⌈⌋ ⎇ branch:  Bitrhythm


Hex Artifact Content

Artifact 5f53a8e5d60dbf40461bc28e14f346f6128c7e2d6ff2f393a86818fcd575efa9:


0000: 2f 2a 21 0a 20 2a 20 6a 51 75 65 72 79 20 4a 61  /*!. * jQuery Ja
0010: 76 61 53 63 72 69 70 74 20 4c 69 62 72 61 72 79  vaScript Library
0020: 20 76 33 2e 35 2e 31 0a 20 2a 20 68 74 74 70 73   v3.5.1. * https
0030: 3a 2f 2f 6a 71 75 65 72 79 2e 63 6f 6d 2f 0a 20  ://jquery.com/. 
0040: 2a 0a 20 2a 20 49 6e 63 6c 75 64 65 73 20 53 69  *. * Includes Si
0050: 7a 7a 6c 65 2e 6a 73 0a 20 2a 20 68 74 74 70 73  zzle.js. * https
0060: 3a 2f 2f 73 69 7a 7a 6c 65 6a 73 2e 63 6f 6d 2f  ://sizzlejs.com/
0070: 0a 20 2a 0a 20 2a 20 43 6f 70 79 72 69 67 68 74  . *. * Copyright
0080: 20 4a 53 20 46 6f 75 6e 64 61 74 69 6f 6e 20 61   JS Foundation a
0090: 6e 64 20 6f 74 68 65 72 20 63 6f 6e 74 72 69 62  nd other contrib
00a0: 75 74 6f 72 73 0a 20 2a 20 52 65 6c 65 61 73 65  utors. * Release
00b0: 64 20 75 6e 64 65 72 20 74 68 65 20 4d 49 54 20  d under the MIT 
00c0: 6c 69 63 65 6e 73 65 0a 20 2a 20 68 74 74 70 73  license. * https
00d0: 3a 2f 2f 6a 71 75 65 72 79 2e 6f 72 67 2f 6c 69  ://jquery.org/li
00e0: 63 65 6e 73 65 0a 20 2a 0a 20 2a 20 44 61 74 65  cense. *. * Date
00f0: 3a 20 32 30 32 30 2d 30 35 2d 30 34 54 32 32 3a  : 2020-05-04T22:
0100: 34 39 5a 0a 20 2a 2f 0a 28 20 66 75 6e 63 74 69  49Z. */.( functi
0110: 6f 6e 28 20 67 6c 6f 62 61 6c 2c 20 66 61 63 74  on( global, fact
0120: 6f 72 79 20 29 20 7b 0a 0a 09 22 75 73 65 20 73  ory ) {..."use s
0130: 74 72 69 63 74 22 3b 0a 0a 09 69 66 20 28 20 74  trict";...if ( t
0140: 79 70 65 6f 66 20 6d 6f 64 75 6c 65 20 3d 3d 3d  ypeof module ===
0150: 20 22 6f 62 6a 65 63 74 22 20 26 26 20 74 79 70   "object" && typ
0160: 65 6f 66 20 6d 6f 64 75 6c 65 2e 65 78 70 6f 72  eof module.expor
0170: 74 73 20 3d 3d 3d 20 22 6f 62 6a 65 63 74 22 20  ts === "object" 
0180: 29 20 7b 0a 0a 09 09 2f 2f 20 46 6f 72 20 43 6f  ) {....// For Co
0190: 6d 6d 6f 6e 4a 53 20 61 6e 64 20 43 6f 6d 6d 6f  mmonJS and Commo
01a0: 6e 4a 53 2d 6c 69 6b 65 20 65 6e 76 69 72 6f 6e  nJS-like environ
01b0: 6d 65 6e 74 73 20 77 68 65 72 65 20 61 20 70 72  ments where a pr
01c0: 6f 70 65 72 20 60 77 69 6e 64 6f 77 60 0a 09 09  oper `window`...
01d0: 2f 2f 20 69 73 20 70 72 65 73 65 6e 74 2c 20 65  // is present, e
01e0: 78 65 63 75 74 65 20 74 68 65 20 66 61 63 74 6f  xecute the facto
01f0: 72 79 20 61 6e 64 20 67 65 74 20 6a 51 75 65 72  ry and get jQuer
0200: 79 2e 0a 09 09 2f 2f 20 46 6f 72 20 65 6e 76 69  y....// For envi
0210: 72 6f 6e 6d 65 6e 74 73 20 74 68 61 74 20 64 6f  ronments that do
0220: 20 6e 6f 74 20 68 61 76 65 20 61 20 60 77 69 6e   not have a `win
0230: 64 6f 77 60 20 77 69 74 68 20 61 20 60 64 6f 63  dow` with a `doc
0240: 75 6d 65 6e 74 60 0a 09 09 2f 2f 20 28 73 75 63  ument`...// (suc
0250: 68 20 61 73 20 4e 6f 64 65 2e 6a 73 29 2c 20 65  h as Node.js), e
0260: 78 70 6f 73 65 20 61 20 66 61 63 74 6f 72 79 20  xpose a factory 
0270: 61 73 20 6d 6f 64 75 6c 65 2e 65 78 70 6f 72 74  as module.export
0280: 73 2e 0a 09 09 2f 2f 20 54 68 69 73 20 61 63 63  s....// This acc
0290: 65 6e 74 75 61 74 65 73 20 74 68 65 20 6e 65 65  entuates the nee
02a0: 64 20 66 6f 72 20 74 68 65 20 63 72 65 61 74 69  d for the creati
02b0: 6f 6e 20 6f 66 20 61 20 72 65 61 6c 20 60 77 69  on of a real `wi
02c0: 6e 64 6f 77 60 2e 0a 09 09 2f 2f 20 65 2e 67 2e  ndow`....// e.g.
02d0: 20 76 61 72 20 6a 51 75 65 72 79 20 3d 20 72 65   var jQuery = re
02e0: 71 75 69 72 65 28 22 6a 71 75 65 72 79 22 29 28  quire("jquery")(
02f0: 77 69 6e 64 6f 77 29 3b 0a 09 09 2f 2f 20 53 65  window);...// Se
0300: 65 20 74 69 63 6b 65 74 20 23 31 34 35 34 39 20  e ticket #14549 
0310: 66 6f 72 20 6d 6f 72 65 20 69 6e 66 6f 2e 0a 09  for more info...
0320: 09 6d 6f 64 75 6c 65 2e 65 78 70 6f 72 74 73 20  .module.exports 
0330: 3d 20 67 6c 6f 62 61 6c 2e 64 6f 63 75 6d 65 6e  = global.documen
0340: 74 20 3f 0a 09 09 09 66 61 63 74 6f 72 79 28 20  t ?....factory( 
0350: 67 6c 6f 62 61 6c 2c 20 74 72 75 65 20 29 20 3a  global, true ) :
0360: 0a 09 09 09 66 75 6e 63 74 69 6f 6e 28 20 77 20  ....function( w 
0370: 29 20 7b 0a 09 09 09 09 69 66 20 28 20 21 77 2e  ) {.....if ( !w.
0380: 64 6f 63 75 6d 65 6e 74 20 29 20 7b 0a 09 09 09  document ) {....
0390: 09 09 74 68 72 6f 77 20 6e 65 77 20 45 72 72 6f  ..throw new Erro
03a0: 72 28 20 22 6a 51 75 65 72 79 20 72 65 71 75 69  r( "jQuery requi
03b0: 72 65 73 20 61 20 77 69 6e 64 6f 77 20 77 69 74  res a window wit
03c0: 68 20 61 20 64 6f 63 75 6d 65 6e 74 22 20 29 3b  h a document" );
03d0: 0a 09 09 09 09 7d 0a 09 09 09 09 72 65 74 75 72  .....}.....retur
03e0: 6e 20 66 61 63 74 6f 72 79 28 20 77 20 29 3b 0a  n factory( w );.
03f0: 09 09 09 7d 3b 0a 09 7d 20 65 6c 73 65 20 7b 0a  ...};..} else {.
0400: 09 09 66 61 63 74 6f 72 79 28 20 67 6c 6f 62 61  ..factory( globa
0410: 6c 20 29 3b 0a 09 7d 0a 0a 2f 2f 20 50 61 73 73  l );..}..// Pass
0420: 20 74 68 69 73 20 69 66 20 77 69 6e 64 6f 77 20   this if window 
0430: 69 73 20 6e 6f 74 20 64 65 66 69 6e 65 64 20 79  is not defined y
0440: 65 74 0a 7d 20 29 28 20 74 79 70 65 6f 66 20 77  et.} )( typeof w
0450: 69 6e 64 6f 77 20 21 3d 3d 20 22 75 6e 64 65 66  indow !== "undef
0460: 69 6e 65 64 22 20 3f 20 77 69 6e 64 6f 77 20 3a  ined" ? window :
0470: 20 74 68 69 73 2c 20 66 75 6e 63 74 69 6f 6e 28   this, function(
0480: 20 77 69 6e 64 6f 77 2c 20 6e 6f 47 6c 6f 62 61   window, noGloba
0490: 6c 20 29 20 7b 0a 0a 2f 2f 20 45 64 67 65 20 3c  l ) {..// Edge <
04a0: 3d 20 31 32 20 2d 20 31 33 2b 2c 20 46 69 72 65  = 12 - 13+, Fire
04b0: 66 6f 78 20 3c 3d 31 38 20 2d 20 34 35 2b 2c 20  fox <=18 - 45+, 
04c0: 49 45 20 31 30 20 2d 20 31 31 2c 20 53 61 66 61  IE 10 - 11, Safa
04d0: 72 69 20 35 2e 31 20 2d 20 39 2b 2c 20 69 4f 53  ri 5.1 - 9+, iOS
04e0: 20 36 20 2d 20 39 2e 31 0a 2f 2f 20 74 68 72 6f   6 - 9.1.// thro
04f0: 77 20 65 78 63 65 70 74 69 6f 6e 73 20 77 68 65  w exceptions whe
0500: 6e 20 6e 6f 6e 2d 73 74 72 69 63 74 20 63 6f 64  n non-strict cod
0510: 65 20 28 65 2e 67 2e 2c 20 41 53 50 2e 4e 45 54  e (e.g., ASP.NET
0520: 20 34 2e 35 29 20 61 63 63 65 73 73 65 73 20 73   4.5) accesses s
0530: 74 72 69 63 74 20 6d 6f 64 65 0a 2f 2f 20 61 72  trict mode.// ar
0540: 67 75 6d 65 6e 74 73 2e 63 61 6c 6c 65 65 2e 63  guments.callee.c
0550: 61 6c 6c 65 72 20 28 74 72 61 63 2d 31 33 33 33  aller (trac-1333
0560: 35 29 2e 20 42 75 74 20 61 73 20 6f 66 20 6a 51  5). But as of jQ
0570: 75 65 72 79 20 33 2e 30 20 28 32 30 31 36 29 2c  uery 3.0 (2016),
0580: 20 73 74 72 69 63 74 20 6d 6f 64 65 20 73 68 6f   strict mode sho
0590: 75 6c 64 20 62 65 20 63 6f 6d 6d 6f 6e 0a 2f 2f  uld be common.//
05a0: 20 65 6e 6f 75 67 68 20 74 68 61 74 20 61 6c 6c   enough that all
05b0: 20 73 75 63 68 20 61 74 74 65 6d 70 74 73 20 61   such attempts a
05c0: 72 65 20 67 75 61 72 64 65 64 20 69 6e 20 61 20  re guarded in a 
05d0: 74 72 79 20 62 6c 6f 63 6b 2e 0a 22 75 73 65 20  try block.."use 
05e0: 73 74 72 69 63 74 22 3b 0a 0a 76 61 72 20 61 72  strict";..var ar
05f0: 72 20 3d 20 5b 5d 3b 0a 0a 76 61 72 20 67 65 74  r = [];..var get
0600: 50 72 6f 74 6f 20 3d 20 4f 62 6a 65 63 74 2e 67  Proto = Object.g
0610: 65 74 50 72 6f 74 6f 74 79 70 65 4f 66 3b 0a 0a  etPrototypeOf;..
0620: 76 61 72 20 73 6c 69 63 65 20 3d 20 61 72 72 2e  var slice = arr.
0630: 73 6c 69 63 65 3b 0a 0a 76 61 72 20 66 6c 61 74  slice;..var flat
0640: 20 3d 20 61 72 72 2e 66 6c 61 74 20 3f 20 66 75   = arr.flat ? fu
0650: 6e 63 74 69 6f 6e 28 20 61 72 72 61 79 20 29 20  nction( array ) 
0660: 7b 0a 09 72 65 74 75 72 6e 20 61 72 72 2e 66 6c  {..return arr.fl
0670: 61 74 2e 63 61 6c 6c 28 20 61 72 72 61 79 20 29  at.call( array )
0680: 3b 0a 7d 20 3a 20 66 75 6e 63 74 69 6f 6e 28 20  ;.} : function( 
0690: 61 72 72 61 79 20 29 20 7b 0a 09 72 65 74 75 72  array ) {..retur
06a0: 6e 20 61 72 72 2e 63 6f 6e 63 61 74 2e 61 70 70  n arr.concat.app
06b0: 6c 79 28 20 5b 5d 2c 20 61 72 72 61 79 20 29 3b  ly( [], array );
06c0: 0a 7d 3b 0a 0a 0a 76 61 72 20 70 75 73 68 20 3d  .};...var push =
06d0: 20 61 72 72 2e 70 75 73 68 3b 0a 0a 76 61 72 20   arr.push;..var 
06e0: 69 6e 64 65 78 4f 66 20 3d 20 61 72 72 2e 69 6e  indexOf = arr.in
06f0: 64 65 78 4f 66 3b 0a 0a 76 61 72 20 63 6c 61 73  dexOf;..var clas
0700: 73 32 74 79 70 65 20 3d 20 7b 7d 3b 0a 0a 76 61  s2type = {};..va
0710: 72 20 74 6f 53 74 72 69 6e 67 20 3d 20 63 6c 61  r toString = cla
0720: 73 73 32 74 79 70 65 2e 74 6f 53 74 72 69 6e 67  ss2type.toString
0730: 3b 0a 0a 76 61 72 20 68 61 73 4f 77 6e 20 3d 20  ;..var hasOwn = 
0740: 63 6c 61 73 73 32 74 79 70 65 2e 68 61 73 4f 77  class2type.hasOw
0750: 6e 50 72 6f 70 65 72 74 79 3b 0a 0a 76 61 72 20  nProperty;..var 
0760: 66 6e 54 6f 53 74 72 69 6e 67 20 3d 20 68 61 73  fnToString = has
0770: 4f 77 6e 2e 74 6f 53 74 72 69 6e 67 3b 0a 0a 76  Own.toString;..v
0780: 61 72 20 4f 62 6a 65 63 74 46 75 6e 63 74 69 6f  ar ObjectFunctio
0790: 6e 53 74 72 69 6e 67 20 3d 20 66 6e 54 6f 53 74  nString = fnToSt
07a0: 72 69 6e 67 2e 63 61 6c 6c 28 20 4f 62 6a 65 63  ring.call( Objec
07b0: 74 20 29 3b 0a 0a 76 61 72 20 73 75 70 70 6f 72  t );..var suppor
07c0: 74 20 3d 20 7b 7d 3b 0a 0a 76 61 72 20 69 73 46  t = {};..var isF
07d0: 75 6e 63 74 69 6f 6e 20 3d 20 66 75 6e 63 74 69  unction = functi
07e0: 6f 6e 20 69 73 46 75 6e 63 74 69 6f 6e 28 20 6f  on isFunction( o
07f0: 62 6a 20 29 20 7b 0a 0a 20 20 20 20 20 20 2f 2f  bj ) {..      //
0800: 20 53 75 70 70 6f 72 74 3a 20 43 68 72 6f 6d 65   Support: Chrome
0810: 20 3c 3d 35 37 2c 20 46 69 72 65 66 6f 78 20 3c   <=57, Firefox <
0820: 3d 35 32 0a 20 20 20 20 20 20 2f 2f 20 49 6e 20  =52.      // In 
0830: 73 6f 6d 65 20 62 72 6f 77 73 65 72 73 2c 20 74  some browsers, t
0840: 79 70 65 6f 66 20 72 65 74 75 72 6e 73 20 22 66  ypeof returns "f
0850: 75 6e 63 74 69 6f 6e 22 20 66 6f 72 20 48 54 4d  unction" for HTM
0860: 4c 20 3c 6f 62 6a 65 63 74 3e 20 65 6c 65 6d 65  L <object> eleme
0870: 6e 74 73 0a 20 20 20 20 20 20 2f 2f 20 28 69 2e  nts.      // (i.
0880: 65 2e 2c 20 60 74 79 70 65 6f 66 20 64 6f 63 75  e., `typeof docu
0890: 6d 65 6e 74 2e 63 72 65 61 74 65 45 6c 65 6d 65  ment.createEleme
08a0: 6e 74 28 20 22 6f 62 6a 65 63 74 22 20 29 20 3d  nt( "object" ) =
08b0: 3d 3d 20 22 66 75 6e 63 74 69 6f 6e 22 60 29 2e  == "function"`).
08c0: 0a 20 20 20 20 20 20 2f 2f 20 57 65 20 64 6f 6e  .      // We don
08d0: 27 74 20 77 61 6e 74 20 74 6f 20 63 6c 61 73 73  't want to class
08e0: 69 66 79 20 2a 61 6e 79 2a 20 44 4f 4d 20 6e 6f  ify *any* DOM no
08f0: 64 65 20 61 73 20 61 20 66 75 6e 63 74 69 6f 6e  de as a function
0900: 2e 0a 20 20 20 20 20 20 72 65 74 75 72 6e 20 74  ..      return t
0910: 79 70 65 6f 66 20 6f 62 6a 20 3d 3d 3d 20 22 66  ypeof obj === "f
0920: 75 6e 63 74 69 6f 6e 22 20 26 26 20 74 79 70 65  unction" && type
0930: 6f 66 20 6f 62 6a 2e 6e 6f 64 65 54 79 70 65 20  of obj.nodeType 
0940: 21 3d 3d 20 22 6e 75 6d 62 65 72 22 3b 0a 20 20  !== "number";.  
0950: 7d 3b 0a 0a 0a 76 61 72 20 69 73 57 69 6e 64 6f  };...var isWindo
0960: 77 20 3d 20 66 75 6e 63 74 69 6f 6e 20 69 73 57  w = function isW
0970: 69 6e 64 6f 77 28 20 6f 62 6a 20 29 20 7b 0a 09  indow( obj ) {..
0980: 09 72 65 74 75 72 6e 20 6f 62 6a 20 21 3d 20 6e  .return obj != n
0990: 75 6c 6c 20 26 26 20 6f 62 6a 20 3d 3d 3d 20 6f  ull && obj === o
09a0: 62 6a 2e 77 69 6e 64 6f 77 3b 0a 09 7d 3b 0a 0a  bj.window;..};..
09b0: 0a 76 61 72 20 64 6f 63 75 6d 65 6e 74 20 3d 20  .var document = 
09c0: 77 69 6e 64 6f 77 2e 64 6f 63 75 6d 65 6e 74 3b  window.document;
09d0: 0a 0a 0a 0a 09 76 61 72 20 70 72 65 73 65 72 76  .....var preserv
09e0: 65 64 53 63 72 69 70 74 41 74 74 72 69 62 75 74  edScriptAttribut
09f0: 65 73 20 3d 20 7b 0a 09 09 74 79 70 65 3a 20 74  es = {...type: t
0a00: 72 75 65 2c 0a 09 09 73 72 63 3a 20 74 72 75 65  rue,...src: true
0a10: 2c 0a 09 09 6e 6f 6e 63 65 3a 20 74 72 75 65 2c  ,...nonce: true,
0a20: 0a 09 09 6e 6f 4d 6f 64 75 6c 65 3a 20 74 72 75  ...noModule: tru
0a30: 65 0a 09 7d 3b 0a 0a 09 66 75 6e 63 74 69 6f 6e  e..};...function
0a40: 20 44 4f 4d 45 76 61 6c 28 20 63 6f 64 65 2c 20   DOMEval( code, 
0a50: 6e 6f 64 65 2c 20 64 6f 63 20 29 20 7b 0a 09 09  node, doc ) {...
0a60: 64 6f 63 20 3d 20 64 6f 63 20 7c 7c 20 64 6f 63  doc = doc || doc
0a70: 75 6d 65 6e 74 3b 0a 0a 09 09 76 61 72 20 69 2c  ument;....var i,
0a80: 20 76 61 6c 2c 0a 09 09 09 73 63 72 69 70 74 20   val,....script 
0a90: 3d 20 64 6f 63 2e 63 72 65 61 74 65 45 6c 65 6d  = doc.createElem
0aa0: 65 6e 74 28 20 22 73 63 72 69 70 74 22 20 29 3b  ent( "script" );
0ab0: 0a 0a 09 09 73 63 72 69 70 74 2e 74 65 78 74 20  ....script.text 
0ac0: 3d 20 63 6f 64 65 3b 0a 09 09 69 66 20 28 20 6e  = code;...if ( n
0ad0: 6f 64 65 20 29 20 7b 0a 09 09 09 66 6f 72 20 28  ode ) {....for (
0ae0: 20 69 20 69 6e 20 70 72 65 73 65 72 76 65 64 53   i in preservedS
0af0: 63 72 69 70 74 41 74 74 72 69 62 75 74 65 73 20  criptAttributes 
0b00: 29 20 7b 0a 0a 09 09 09 09 2f 2f 20 53 75 70 70  ) {......// Supp
0b10: 6f 72 74 3a 20 46 69 72 65 66 6f 78 20 36 34 2b  ort: Firefox 64+
0b20: 2c 20 45 64 67 65 20 31 38 2b 0a 09 09 09 09 2f  , Edge 18+...../
0b30: 2f 20 53 6f 6d 65 20 62 72 6f 77 73 65 72 73 20  / Some browsers 
0b40: 64 6f 6e 27 74 20 73 75 70 70 6f 72 74 20 74 68  don't support th
0b50: 65 20 22 6e 6f 6e 63 65 22 20 70 72 6f 70 65 72  e "nonce" proper
0b60: 74 79 20 6f 6e 20 73 63 72 69 70 74 73 2e 0a 09  ty on scripts...
0b70: 09 09 09 2f 2f 20 4f 6e 20 74 68 65 20 6f 74 68  ...// On the oth
0b80: 65 72 20 68 61 6e 64 2c 20 6a 75 73 74 20 75 73  er hand, just us
0b90: 69 6e 67 20 60 67 65 74 41 74 74 72 69 62 75 74  ing `getAttribut
0ba0: 65 60 20 69 73 20 6e 6f 74 20 65 6e 6f 75 67 68  e` is not enough
0bb0: 20 61 73 0a 09 09 09 09 2f 2f 20 74 68 65 20 60   as.....// the `
0bc0: 6e 6f 6e 63 65 60 20 61 74 74 72 69 62 75 74 65  nonce` attribute
0bd0: 20 69 73 20 72 65 73 65 74 20 74 6f 20 61 6e 20   is reset to an 
0be0: 65 6d 70 74 79 20 73 74 72 69 6e 67 20 77 68 65  empty string whe
0bf0: 6e 65 76 65 72 20 69 74 0a 09 09 09 09 2f 2f 20  never it.....// 
0c00: 62 65 63 6f 6d 65 73 20 62 72 6f 77 73 69 6e 67  becomes browsing
0c10: 2d 63 6f 6e 74 65 78 74 20 63 6f 6e 6e 65 63 74  -context connect
0c20: 65 64 2e 0a 09 09 09 09 2f 2f 20 53 65 65 20 68  ed......// See h
0c30: 74 74 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f  ttps://github.co
0c40: 6d 2f 77 68 61 74 77 67 2f 68 74 6d 6c 2f 69 73  m/whatwg/html/is
0c50: 73 75 65 73 2f 32 33 36 39 0a 09 09 09 09 2f 2f  sues/2369.....//
0c60: 20 53 65 65 20 68 74 74 70 73 3a 2f 2f 68 74 6d   See https://htm
0c70: 6c 2e 73 70 65 63 2e 77 68 61 74 77 67 2e 6f 72  l.spec.whatwg.or
0c80: 67 2f 23 6e 6f 6e 63 65 2d 61 74 74 72 69 62 75  g/#nonce-attribu
0c90: 74 65 73 0a 09 09 09 09 2f 2f 20 54 68 65 20 60  tes.....// The `
0ca0: 6e 6f 64 65 2e 67 65 74 41 74 74 72 69 62 75 74  node.getAttribut
0cb0: 65 60 20 63 68 65 63 6b 20 77 61 73 20 61 64 64  e` check was add
0cc0: 65 64 20 66 6f 72 20 74 68 65 20 73 61 6b 65 20  ed for the sake 
0cd0: 6f 66 0a 09 09 09 09 2f 2f 20 60 6a 51 75 65 72  of.....// `jQuer
0ce0: 79 2e 67 6c 6f 62 61 6c 45 76 61 6c 60 20 73 6f  y.globalEval` so
0cf0: 20 74 68 61 74 20 69 74 20 63 61 6e 20 66 61 6b   that it can fak
0d00: 65 20 61 20 6e 6f 6e 63 65 2d 63 6f 6e 74 61 69  e a nonce-contai
0d10: 6e 69 6e 67 20 6e 6f 64 65 0a 09 09 09 09 2f 2f  ning node.....//
0d20: 20 76 69 61 20 61 6e 20 6f 62 6a 65 63 74 2e 0a   via an object..
0d30: 09 09 09 09 76 61 6c 20 3d 20 6e 6f 64 65 5b 20  ....val = node[ 
0d40: 69 20 5d 20 7c 7c 20 6e 6f 64 65 2e 67 65 74 41  i ] || node.getA
0d50: 74 74 72 69 62 75 74 65 20 26 26 20 6e 6f 64 65  ttribute && node
0d60: 2e 67 65 74 41 74 74 72 69 62 75 74 65 28 20 69  .getAttribute( i
0d70: 20 29 3b 0a 09 09 09 09 69 66 20 28 20 76 61 6c   );.....if ( val
0d80: 20 29 20 7b 0a 09 09 09 09 09 73 63 72 69 70 74   ) {......script
0d90: 2e 73 65 74 41 74 74 72 69 62 75 74 65 28 20 69  .setAttribute( i
0da0: 2c 20 76 61 6c 20 29 3b 0a 09 09 09 09 7d 0a 09  , val );.....}..
0db0: 09 09 7d 0a 09 09 7d 0a 09 09 64 6f 63 2e 68 65  ..}...}...doc.he
0dc0: 61 64 2e 61 70 70 65 6e 64 43 68 69 6c 64 28 20  ad.appendChild( 
0dd0: 73 63 72 69 70 74 20 29 2e 70 61 72 65 6e 74 4e  script ).parentN
0de0: 6f 64 65 2e 72 65 6d 6f 76 65 43 68 69 6c 64 28  ode.removeChild(
0df0: 20 73 63 72 69 70 74 20 29 3b 0a 09 7d 0a 0a 0a   script );..}...
0e00: 66 75 6e 63 74 69 6f 6e 20 74 6f 54 79 70 65 28  function toType(
0e10: 20 6f 62 6a 20 29 20 7b 0a 09 69 66 20 28 20 6f   obj ) {..if ( o
0e20: 62 6a 20 3d 3d 20 6e 75 6c 6c 20 29 20 7b 0a 09  bj == null ) {..
0e30: 09 72 65 74 75 72 6e 20 6f 62 6a 20 2b 20 22 22  .return obj + ""
0e40: 3b 0a 09 7d 0a 0a 09 2f 2f 20 53 75 70 70 6f 72  ;..}...// Suppor
0e50: 74 3a 20 41 6e 64 72 6f 69 64 20 3c 3d 32 2e 33  t: Android <=2.3
0e60: 20 6f 6e 6c 79 20 28 66 75 6e 63 74 69 6f 6e 69   only (functioni
0e70: 73 68 20 52 65 67 45 78 70 29 0a 09 72 65 74 75  sh RegExp)..retu
0e80: 72 6e 20 74 79 70 65 6f 66 20 6f 62 6a 20 3d 3d  rn typeof obj ==
0e90: 3d 20 22 6f 62 6a 65 63 74 22 20 7c 7c 20 74 79  = "object" || ty
0ea0: 70 65 6f 66 20 6f 62 6a 20 3d 3d 3d 20 22 66 75  peof obj === "fu
0eb0: 6e 63 74 69 6f 6e 22 20 3f 0a 09 09 63 6c 61 73  nction" ?...clas
0ec0: 73 32 74 79 70 65 5b 20 74 6f 53 74 72 69 6e 67  s2type[ toString
0ed0: 2e 63 61 6c 6c 28 20 6f 62 6a 20 29 20 5d 20 7c  .call( obj ) ] |
0ee0: 7c 20 22 6f 62 6a 65 63 74 22 20 3a 0a 09 09 74  | "object" :...t
0ef0: 79 70 65 6f 66 20 6f 62 6a 3b 0a 7d 0a 2f 2a 20  ypeof obj;.}./* 
0f00: 67 6c 6f 62 61 6c 20 53 79 6d 62 6f 6c 20 2a 2f  global Symbol */
0f10: 0a 2f 2f 20 44 65 66 69 6e 69 6e 67 20 74 68 69  .// Defining thi
0f20: 73 20 67 6c 6f 62 61 6c 20 69 6e 20 2e 65 73 6c  s global in .esl
0f30: 69 6e 74 72 63 2e 6a 73 6f 6e 20 77 6f 75 6c 64  intrc.json would
0f40: 20 63 72 65 61 74 65 20 61 20 64 61 6e 67 65 72   create a danger
0f50: 20 6f 66 20 75 73 69 6e 67 20 74 68 65 20 67 6c   of using the gl
0f60: 6f 62 61 6c 0a 2f 2f 20 75 6e 67 75 61 72 64 65  obal.// unguarde
0f70: 64 20 69 6e 20 61 6e 6f 74 68 65 72 20 70 6c 61  d in another pla
0f80: 63 65 2c 20 69 74 20 73 65 65 6d 73 20 73 61 66  ce, it seems saf
0f90: 65 72 20 74 6f 20 64 65 66 69 6e 65 20 67 6c 6f  er to define glo
0fa0: 62 61 6c 20 6f 6e 6c 79 20 66 6f 72 20 74 68 69  bal only for thi
0fb0: 73 20 6d 6f 64 75 6c 65 0a 0a 0a 0a 76 61 72 0a  s module....var.
0fc0: 09 76 65 72 73 69 6f 6e 20 3d 20 22 33 2e 35 2e  .version = "3.5.
0fd0: 31 22 2c 0a 0a 09 2f 2f 20 44 65 66 69 6e 65 20  1",...// Define 
0fe0: 61 20 6c 6f 63 61 6c 20 63 6f 70 79 20 6f 66 20  a local copy of 
0ff0: 6a 51 75 65 72 79 0a 09 6a 51 75 65 72 79 20 3d  jQuery..jQuery =
1000: 20 66 75 6e 63 74 69 6f 6e 28 20 73 65 6c 65 63   function( selec
1010: 74 6f 72 2c 20 63 6f 6e 74 65 78 74 20 29 20 7b  tor, context ) {
1020: 0a 0a 09 09 2f 2f 20 54 68 65 20 6a 51 75 65 72  ....// The jQuer
1030: 79 20 6f 62 6a 65 63 74 20 69 73 20 61 63 74 75  y object is actu
1040: 61 6c 6c 79 20 6a 75 73 74 20 74 68 65 20 69 6e  ally just the in
1050: 69 74 20 63 6f 6e 73 74 72 75 63 74 6f 72 20 27  it constructor '
1060: 65 6e 68 61 6e 63 65 64 27 0a 09 09 2f 2f 20 4e  enhanced'...// N
1070: 65 65 64 20 69 6e 69 74 20 69 66 20 6a 51 75 65  eed init if jQue
1080: 72 79 20 69 73 20 63 61 6c 6c 65 64 20 28 6a 75  ry is called (ju
1090: 73 74 20 61 6c 6c 6f 77 20 65 72 72 6f 72 20 74  st allow error t
10a0: 6f 20 62 65 20 74 68 72 6f 77 6e 20 69 66 20 6e  o be thrown if n
10b0: 6f 74 20 69 6e 63 6c 75 64 65 64 29 0a 09 09 72  ot included)...r
10c0: 65 74 75 72 6e 20 6e 65 77 20 6a 51 75 65 72 79  eturn new jQuery
10d0: 2e 66 6e 2e 69 6e 69 74 28 20 73 65 6c 65 63 74  .fn.init( select
10e0: 6f 72 2c 20 63 6f 6e 74 65 78 74 20 29 3b 0a 09  or, context );..
10f0: 7d 3b 0a 0a 6a 51 75 65 72 79 2e 66 6e 20 3d 20  };..jQuery.fn = 
1100: 6a 51 75 65 72 79 2e 70 72 6f 74 6f 74 79 70 65  jQuery.prototype
1110: 20 3d 20 7b 0a 0a 09 2f 2f 20 54 68 65 20 63 75   = {...// The cu
1120: 72 72 65 6e 74 20 76 65 72 73 69 6f 6e 20 6f 66  rrent version of
1130: 20 6a 51 75 65 72 79 20 62 65 69 6e 67 20 75 73   jQuery being us
1140: 65 64 0a 09 6a 71 75 65 72 79 3a 20 76 65 72 73  ed..jquery: vers
1150: 69 6f 6e 2c 0a 0a 09 63 6f 6e 73 74 72 75 63 74  ion,...construct
1160: 6f 72 3a 20 6a 51 75 65 72 79 2c 0a 0a 09 2f 2f  or: jQuery,...//
1170: 20 54 68 65 20 64 65 66 61 75 6c 74 20 6c 65 6e   The default len
1180: 67 74 68 20 6f 66 20 61 20 6a 51 75 65 72 79 20  gth of a jQuery 
1190: 6f 62 6a 65 63 74 20 69 73 20 30 0a 09 6c 65 6e  object is 0..len
11a0: 67 74 68 3a 20 30 2c 0a 0a 09 74 6f 41 72 72 61  gth: 0,...toArra
11b0: 79 3a 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a  y: function() {.
11c0: 09 09 72 65 74 75 72 6e 20 73 6c 69 63 65 2e 63  ..return slice.c
11d0: 61 6c 6c 28 20 74 68 69 73 20 29 3b 0a 09 7d 2c  all( this );..},
11e0: 0a 0a 09 2f 2f 20 47 65 74 20 74 68 65 20 4e 74  ...// Get the Nt
11f0: 68 20 65 6c 65 6d 65 6e 74 20 69 6e 20 74 68 65  h element in the
1200: 20 6d 61 74 63 68 65 64 20 65 6c 65 6d 65 6e 74   matched element
1210: 20 73 65 74 20 4f 52 0a 09 2f 2f 20 47 65 74 20   set OR..// Get 
1220: 74 68 65 20 77 68 6f 6c 65 20 6d 61 74 63 68 65  the whole matche
1230: 64 20 65 6c 65 6d 65 6e 74 20 73 65 74 20 61 73  d element set as
1240: 20 61 20 63 6c 65 61 6e 20 61 72 72 61 79 0a 09   a clean array..
1250: 67 65 74 3a 20 66 75 6e 63 74 69 6f 6e 28 20 6e  get: function( n
1260: 75 6d 20 29 20 7b 0a 0a 09 09 2f 2f 20 52 65 74  um ) {....// Ret
1270: 75 72 6e 20 61 6c 6c 20 74 68 65 20 65 6c 65 6d  urn all the elem
1280: 65 6e 74 73 20 69 6e 20 61 20 63 6c 65 61 6e 20  ents in a clean 
1290: 61 72 72 61 79 0a 09 09 69 66 20 28 20 6e 75 6d  array...if ( num
12a0: 20 3d 3d 20 6e 75 6c 6c 20 29 20 7b 0a 09 09 09   == null ) {....
12b0: 72 65 74 75 72 6e 20 73 6c 69 63 65 2e 63 61 6c  return slice.cal
12c0: 6c 28 20 74 68 69 73 20 29 3b 0a 09 09 7d 0a 0a  l( this );...}..
12d0: 09 09 2f 2f 20 52 65 74 75 72 6e 20 6a 75 73 74  ..// Return just
12e0: 20 74 68 65 20 6f 6e 65 20 65 6c 65 6d 65 6e 74   the one element
12f0: 20 66 72 6f 6d 20 74 68 65 20 73 65 74 0a 09 09   from the set...
1300: 72 65 74 75 72 6e 20 6e 75 6d 20 3c 20 30 20 3f  return num < 0 ?
1310: 20 74 68 69 73 5b 20 6e 75 6d 20 2b 20 74 68 69   this[ num + thi
1320: 73 2e 6c 65 6e 67 74 68 20 5d 20 3a 20 74 68 69  s.length ] : thi
1330: 73 5b 20 6e 75 6d 20 5d 3b 0a 09 7d 2c 0a 0a 09  s[ num ];..},...
1340: 2f 2f 20 54 61 6b 65 20 61 6e 20 61 72 72 61 79  // Take an array
1350: 20 6f 66 20 65 6c 65 6d 65 6e 74 73 20 61 6e 64   of elements and
1360: 20 70 75 73 68 20 69 74 20 6f 6e 74 6f 20 74 68   push it onto th
1370: 65 20 73 74 61 63 6b 0a 09 2f 2f 20 28 72 65 74  e stack..// (ret
1380: 75 72 6e 69 6e 67 20 74 68 65 20 6e 65 77 20 6d  urning the new m
1390: 61 74 63 68 65 64 20 65 6c 65 6d 65 6e 74 20 73  atched element s
13a0: 65 74 29 0a 09 70 75 73 68 53 74 61 63 6b 3a 20  et)..pushStack: 
13b0: 66 75 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 73 20  function( elems 
13c0: 29 20 7b 0a 0a 09 09 2f 2f 20 42 75 69 6c 64 20  ) {....// Build 
13d0: 61 20 6e 65 77 20 6a 51 75 65 72 79 20 6d 61 74  a new jQuery mat
13e0: 63 68 65 64 20 65 6c 65 6d 65 6e 74 20 73 65 74  ched element set
13f0: 0a 09 09 76 61 72 20 72 65 74 20 3d 20 6a 51 75  ...var ret = jQu
1400: 65 72 79 2e 6d 65 72 67 65 28 20 74 68 69 73 2e  ery.merge( this.
1410: 63 6f 6e 73 74 72 75 63 74 6f 72 28 29 2c 20 65  constructor(), e
1420: 6c 65 6d 73 20 29 3b 0a 0a 09 09 2f 2f 20 41 64  lems );....// Ad
1430: 64 20 74 68 65 20 6f 6c 64 20 6f 62 6a 65 63 74  d the old object
1440: 20 6f 6e 74 6f 20 74 68 65 20 73 74 61 63 6b 20   onto the stack 
1450: 28 61 73 20 61 20 72 65 66 65 72 65 6e 63 65 29  (as a reference)
1460: 0a 09 09 72 65 74 2e 70 72 65 76 4f 62 6a 65 63  ...ret.prevObjec
1470: 74 20 3d 20 74 68 69 73 3b 0a 0a 09 09 2f 2f 20  t = this;....// 
1480: 52 65 74 75 72 6e 20 74 68 65 20 6e 65 77 6c 79  Return the newly
1490: 2d 66 6f 72 6d 65 64 20 65 6c 65 6d 65 6e 74 20  -formed element 
14a0: 73 65 74 0a 09 09 72 65 74 75 72 6e 20 72 65 74  set...return ret
14b0: 3b 0a 09 7d 2c 0a 0a 09 2f 2f 20 45 78 65 63 75  ;..},...// Execu
14c0: 74 65 20 61 20 63 61 6c 6c 62 61 63 6b 20 66 6f  te a callback fo
14d0: 72 20 65 76 65 72 79 20 65 6c 65 6d 65 6e 74 20  r every element 
14e0: 69 6e 20 74 68 65 20 6d 61 74 63 68 65 64 20 73  in the matched s
14f0: 65 74 2e 0a 09 65 61 63 68 3a 20 66 75 6e 63 74  et...each: funct
1500: 69 6f 6e 28 20 63 61 6c 6c 62 61 63 6b 20 29 20  ion( callback ) 
1510: 7b 0a 09 09 72 65 74 75 72 6e 20 6a 51 75 65 72  {...return jQuer
1520: 79 2e 65 61 63 68 28 20 74 68 69 73 2c 20 63 61  y.each( this, ca
1530: 6c 6c 62 61 63 6b 20 29 3b 0a 09 7d 2c 0a 0a 09  llback );..},...
1540: 6d 61 70 3a 20 66 75 6e 63 74 69 6f 6e 28 20 63  map: function( c
1550: 61 6c 6c 62 61 63 6b 20 29 20 7b 0a 09 09 72 65  allback ) {...re
1560: 74 75 72 6e 20 74 68 69 73 2e 70 75 73 68 53 74  turn this.pushSt
1570: 61 63 6b 28 20 6a 51 75 65 72 79 2e 6d 61 70 28  ack( jQuery.map(
1580: 20 74 68 69 73 2c 20 66 75 6e 63 74 69 6f 6e 28   this, function(
1590: 20 65 6c 65 6d 2c 20 69 20 29 20 7b 0a 09 09 09   elem, i ) {....
15a0: 72 65 74 75 72 6e 20 63 61 6c 6c 62 61 63 6b 2e  return callback.
15b0: 63 61 6c 6c 28 20 65 6c 65 6d 2c 20 69 2c 20 65  call( elem, i, e
15c0: 6c 65 6d 20 29 3b 0a 09 09 7d 20 29 20 29 3b 0a  lem );...} ) );.
15d0: 09 7d 2c 0a 0a 09 73 6c 69 63 65 3a 20 66 75 6e  .},...slice: fun
15e0: 63 74 69 6f 6e 28 29 20 7b 0a 09 09 72 65 74 75  ction() {...retu
15f0: 72 6e 20 74 68 69 73 2e 70 75 73 68 53 74 61 63  rn this.pushStac
1600: 6b 28 20 73 6c 69 63 65 2e 61 70 70 6c 79 28 20  k( slice.apply( 
1610: 74 68 69 73 2c 20 61 72 67 75 6d 65 6e 74 73 20  this, arguments 
1620: 29 20 29 3b 0a 09 7d 2c 0a 0a 09 66 69 72 73 74  ) );..},...first
1630: 3a 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09  : function() {..
1640: 09 72 65 74 75 72 6e 20 74 68 69 73 2e 65 71 28  .return this.eq(
1650: 20 30 20 29 3b 0a 09 7d 2c 0a 0a 09 6c 61 73 74   0 );..},...last
1660: 3a 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09  : function() {..
1670: 09 72 65 74 75 72 6e 20 74 68 69 73 2e 65 71 28  .return this.eq(
1680: 20 2d 31 20 29 3b 0a 09 7d 2c 0a 0a 09 65 76 65   -1 );..},...eve
1690: 6e 3a 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a  n: function() {.
16a0: 09 09 72 65 74 75 72 6e 20 74 68 69 73 2e 70 75  ..return this.pu
16b0: 73 68 53 74 61 63 6b 28 20 6a 51 75 65 72 79 2e  shStack( jQuery.
16c0: 67 72 65 70 28 20 74 68 69 73 2c 20 66 75 6e 63  grep( this, func
16d0: 74 69 6f 6e 28 20 5f 65 6c 65 6d 2c 20 69 20 29  tion( _elem, i )
16e0: 20 7b 0a 09 09 09 72 65 74 75 72 6e 20 28 20 69   {....return ( i
16f0: 20 2b 20 31 20 29 20 25 20 32 3b 0a 09 09 7d 20   + 1 ) % 2;...} 
1700: 29 20 29 3b 0a 09 7d 2c 0a 0a 09 6f 64 64 3a 20  ) );..},...odd: 
1710: 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09 09 72  function() {...r
1720: 65 74 75 72 6e 20 74 68 69 73 2e 70 75 73 68 53  eturn this.pushS
1730: 74 61 63 6b 28 20 6a 51 75 65 72 79 2e 67 72 65  tack( jQuery.gre
1740: 70 28 20 74 68 69 73 2c 20 66 75 6e 63 74 69 6f  p( this, functio
1750: 6e 28 20 5f 65 6c 65 6d 2c 20 69 20 29 20 7b 0a  n( _elem, i ) {.
1760: 09 09 09 72 65 74 75 72 6e 20 69 20 25 20 32 3b  ...return i % 2;
1770: 0a 09 09 7d 20 29 20 29 3b 0a 09 7d 2c 0a 0a 09  ...} ) );..},...
1780: 65 71 3a 20 66 75 6e 63 74 69 6f 6e 28 20 69 20  eq: function( i 
1790: 29 20 7b 0a 09 09 76 61 72 20 6c 65 6e 20 3d 20  ) {...var len = 
17a0: 74 68 69 73 2e 6c 65 6e 67 74 68 2c 0a 09 09 09  this.length,....
17b0: 6a 20 3d 20 2b 69 20 2b 20 28 20 69 20 3c 20 30  j = +i + ( i < 0
17c0: 20 3f 20 6c 65 6e 20 3a 20 30 20 29 3b 0a 09 09   ? len : 0 );...
17d0: 72 65 74 75 72 6e 20 74 68 69 73 2e 70 75 73 68  return this.push
17e0: 53 74 61 63 6b 28 20 6a 20 3e 3d 20 30 20 26 26  Stack( j >= 0 &&
17f0: 20 6a 20 3c 20 6c 65 6e 20 3f 20 5b 20 74 68 69   j < len ? [ thi
1800: 73 5b 20 6a 20 5d 20 5d 20 3a 20 5b 5d 20 29 3b  s[ j ] ] : [] );
1810: 0a 09 7d 2c 0a 0a 09 65 6e 64 3a 20 66 75 6e 63  ..},...end: func
1820: 74 69 6f 6e 28 29 20 7b 0a 09 09 72 65 74 75 72  tion() {...retur
1830: 6e 20 74 68 69 73 2e 70 72 65 76 4f 62 6a 65 63  n this.prevObjec
1840: 74 20 7c 7c 20 74 68 69 73 2e 63 6f 6e 73 74 72  t || this.constr
1850: 75 63 74 6f 72 28 29 3b 0a 09 7d 2c 0a 0a 09 2f  uctor();..},.../
1860: 2f 20 46 6f 72 20 69 6e 74 65 72 6e 61 6c 20 75  / For internal u
1870: 73 65 20 6f 6e 6c 79 2e 0a 09 2f 2f 20 42 65 68  se only...// Beh
1880: 61 76 65 73 20 6c 69 6b 65 20 61 6e 20 41 72 72  aves like an Arr
1890: 61 79 27 73 20 6d 65 74 68 6f 64 2c 20 6e 6f 74  ay's method, not
18a0: 20 6c 69 6b 65 20 61 20 6a 51 75 65 72 79 20 6d   like a jQuery m
18b0: 65 74 68 6f 64 2e 0a 09 70 75 73 68 3a 20 70 75  ethod...push: pu
18c0: 73 68 2c 0a 09 73 6f 72 74 3a 20 61 72 72 2e 73  sh,..sort: arr.s
18d0: 6f 72 74 2c 0a 09 73 70 6c 69 63 65 3a 20 61 72  ort,..splice: ar
18e0: 72 2e 73 70 6c 69 63 65 0a 7d 3b 0a 0a 6a 51 75  r.splice.};..jQu
18f0: 65 72 79 2e 65 78 74 65 6e 64 20 3d 20 6a 51 75  ery.extend = jQu
1900: 65 72 79 2e 66 6e 2e 65 78 74 65 6e 64 20 3d 20  ery.fn.extend = 
1910: 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09 76 61  function() {..va
1920: 72 20 6f 70 74 69 6f 6e 73 2c 20 6e 61 6d 65 2c  r options, name,
1930: 20 73 72 63 2c 20 63 6f 70 79 2c 20 63 6f 70 79   src, copy, copy
1940: 49 73 41 72 72 61 79 2c 20 63 6c 6f 6e 65 2c 0a  IsArray, clone,.
1950: 09 09 74 61 72 67 65 74 20 3d 20 61 72 67 75 6d  ..target = argum
1960: 65 6e 74 73 5b 20 30 20 5d 20 7c 7c 20 7b 7d 2c  ents[ 0 ] || {},
1970: 0a 09 09 69 20 3d 20 31 2c 0a 09 09 6c 65 6e 67  ...i = 1,...leng
1980: 74 68 20 3d 20 61 72 67 75 6d 65 6e 74 73 2e 6c  th = arguments.l
1990: 65 6e 67 74 68 2c 0a 09 09 64 65 65 70 20 3d 20  ength,...deep = 
19a0: 66 61 6c 73 65 3b 0a 0a 09 2f 2f 20 48 61 6e 64  false;...// Hand
19b0: 6c 65 20 61 20 64 65 65 70 20 63 6f 70 79 20 73  le a deep copy s
19c0: 69 74 75 61 74 69 6f 6e 0a 09 69 66 20 28 20 74  ituation..if ( t
19d0: 79 70 65 6f 66 20 74 61 72 67 65 74 20 3d 3d 3d  ypeof target ===
19e0: 20 22 62 6f 6f 6c 65 61 6e 22 20 29 20 7b 0a 09   "boolean" ) {..
19f0: 09 64 65 65 70 20 3d 20 74 61 72 67 65 74 3b 0a  .deep = target;.
1a00: 0a 09 09 2f 2f 20 53 6b 69 70 20 74 68 65 20 62  ...// Skip the b
1a10: 6f 6f 6c 65 61 6e 20 61 6e 64 20 74 68 65 20 74  oolean and the t
1a20: 61 72 67 65 74 0a 09 09 74 61 72 67 65 74 20 3d  arget...target =
1a30: 20 61 72 67 75 6d 65 6e 74 73 5b 20 69 20 5d 20   arguments[ i ] 
1a40: 7c 7c 20 7b 7d 3b 0a 09 09 69 2b 2b 3b 0a 09 7d  || {};...i++;..}
1a50: 0a 0a 09 2f 2f 20 48 61 6e 64 6c 65 20 63 61 73  ...// Handle cas
1a60: 65 20 77 68 65 6e 20 74 61 72 67 65 74 20 69 73  e when target is
1a70: 20 61 20 73 74 72 69 6e 67 20 6f 72 20 73 6f 6d   a string or som
1a80: 65 74 68 69 6e 67 20 28 70 6f 73 73 69 62 6c 65  ething (possible
1a90: 20 69 6e 20 64 65 65 70 20 63 6f 70 79 29 0a 09   in deep copy)..
1aa0: 69 66 20 28 20 74 79 70 65 6f 66 20 74 61 72 67  if ( typeof targ
1ab0: 65 74 20 21 3d 3d 20 22 6f 62 6a 65 63 74 22 20  et !== "object" 
1ac0: 26 26 20 21 69 73 46 75 6e 63 74 69 6f 6e 28 20  && !isFunction( 
1ad0: 74 61 72 67 65 74 20 29 20 29 20 7b 0a 09 09 74  target ) ) {...t
1ae0: 61 72 67 65 74 20 3d 20 7b 7d 3b 0a 09 7d 0a 0a  arget = {};..}..
1af0: 09 2f 2f 20 45 78 74 65 6e 64 20 6a 51 75 65 72  .// Extend jQuer
1b00: 79 20 69 74 73 65 6c 66 20 69 66 20 6f 6e 6c 79  y itself if only
1b10: 20 6f 6e 65 20 61 72 67 75 6d 65 6e 74 20 69 73   one argument is
1b20: 20 70 61 73 73 65 64 0a 09 69 66 20 28 20 69 20   passed..if ( i 
1b30: 3d 3d 3d 20 6c 65 6e 67 74 68 20 29 20 7b 0a 09  === length ) {..
1b40: 09 74 61 72 67 65 74 20 3d 20 74 68 69 73 3b 0a  .target = this;.
1b50: 09 09 69 2d 2d 3b 0a 09 7d 0a 0a 09 66 6f 72 20  ..i--;..}...for 
1b60: 28 20 3b 20 69 20 3c 20 6c 65 6e 67 74 68 3b 20  ( ; i < length; 
1b70: 69 2b 2b 20 29 20 7b 0a 0a 09 09 2f 2f 20 4f 6e  i++ ) {....// On
1b80: 6c 79 20 64 65 61 6c 20 77 69 74 68 20 6e 6f 6e  ly deal with non
1b90: 2d 6e 75 6c 6c 2f 75 6e 64 65 66 69 6e 65 64 20  -null/undefined 
1ba0: 76 61 6c 75 65 73 0a 09 09 69 66 20 28 20 28 20  values...if ( ( 
1bb0: 6f 70 74 69 6f 6e 73 20 3d 20 61 72 67 75 6d 65  options = argume
1bc0: 6e 74 73 5b 20 69 20 5d 20 29 20 21 3d 20 6e 75  nts[ i ] ) != nu
1bd0: 6c 6c 20 29 20 7b 0a 0a 09 09 09 2f 2f 20 45 78  ll ) {.....// Ex
1be0: 74 65 6e 64 20 74 68 65 20 62 61 73 65 20 6f 62  tend the base ob
1bf0: 6a 65 63 74 0a 09 09 09 66 6f 72 20 28 20 6e 61  ject....for ( na
1c00: 6d 65 20 69 6e 20 6f 70 74 69 6f 6e 73 20 29 20  me in options ) 
1c10: 7b 0a 09 09 09 09 63 6f 70 79 20 3d 20 6f 70 74  {.....copy = opt
1c20: 69 6f 6e 73 5b 20 6e 61 6d 65 20 5d 3b 0a 0a 09  ions[ name ];...
1c30: 09 09 09 2f 2f 20 50 72 65 76 65 6e 74 20 4f 62  ...// Prevent Ob
1c40: 6a 65 63 74 2e 70 72 6f 74 6f 74 79 70 65 20 70  ject.prototype p
1c50: 6f 6c 6c 75 74 69 6f 6e 0a 09 09 09 09 2f 2f 20  ollution.....// 
1c60: 50 72 65 76 65 6e 74 20 6e 65 76 65 72 2d 65 6e  Prevent never-en
1c70: 64 69 6e 67 20 6c 6f 6f 70 0a 09 09 09 09 69 66  ding loop.....if
1c80: 20 28 20 6e 61 6d 65 20 3d 3d 3d 20 22 5f 5f 70   ( name === "__p
1c90: 72 6f 74 6f 5f 5f 22 20 7c 7c 20 74 61 72 67 65  roto__" || targe
1ca0: 74 20 3d 3d 3d 20 63 6f 70 79 20 29 20 7b 0a 09  t === copy ) {..
1cb0: 09 09 09 09 63 6f 6e 74 69 6e 75 65 3b 0a 09 09  ....continue;...
1cc0: 09 09 7d 0a 0a 09 09 09 09 2f 2f 20 52 65 63 75  ..}......// Recu
1cd0: 72 73 65 20 69 66 20 77 65 27 72 65 20 6d 65 72  rse if we're mer
1ce0: 67 69 6e 67 20 70 6c 61 69 6e 20 6f 62 6a 65 63  ging plain objec
1cf0: 74 73 20 6f 72 20 61 72 72 61 79 73 0a 09 09 09  ts or arrays....
1d00: 09 69 66 20 28 20 64 65 65 70 20 26 26 20 63 6f  .if ( deep && co
1d10: 70 79 20 26 26 20 28 20 6a 51 75 65 72 79 2e 69  py && ( jQuery.i
1d20: 73 50 6c 61 69 6e 4f 62 6a 65 63 74 28 20 63 6f  sPlainObject( co
1d30: 70 79 20 29 20 7c 7c 0a 09 09 09 09 09 28 20 63  py ) ||......( c
1d40: 6f 70 79 49 73 41 72 72 61 79 20 3d 20 41 72 72  opyIsArray = Arr
1d50: 61 79 2e 69 73 41 72 72 61 79 28 20 63 6f 70 79  ay.isArray( copy
1d60: 20 29 20 29 20 29 20 29 20 7b 0a 09 09 09 09 09   ) ) ) ) {......
1d70: 73 72 63 20 3d 20 74 61 72 67 65 74 5b 20 6e 61  src = target[ na
1d80: 6d 65 20 5d 3b 0a 0a 09 09 09 09 09 2f 2f 20 45  me ];.......// E
1d90: 6e 73 75 72 65 20 70 72 6f 70 65 72 20 74 79 70  nsure proper typ
1da0: 65 20 66 6f 72 20 74 68 65 20 73 6f 75 72 63 65  e for the source
1db0: 20 76 61 6c 75 65 0a 09 09 09 09 09 69 66 20 28   value......if (
1dc0: 20 63 6f 70 79 49 73 41 72 72 61 79 20 26 26 20   copyIsArray && 
1dd0: 21 41 72 72 61 79 2e 69 73 41 72 72 61 79 28 20  !Array.isArray( 
1de0: 73 72 63 20 29 20 29 20 7b 0a 09 09 09 09 09 09  src ) ) {.......
1df0: 63 6c 6f 6e 65 20 3d 20 5b 5d 3b 0a 09 09 09 09  clone = [];.....
1e00: 09 7d 20 65 6c 73 65 20 69 66 20 28 20 21 63 6f  .} else if ( !co
1e10: 70 79 49 73 41 72 72 61 79 20 26 26 20 21 6a 51  pyIsArray && !jQ
1e20: 75 65 72 79 2e 69 73 50 6c 61 69 6e 4f 62 6a 65  uery.isPlainObje
1e30: 63 74 28 20 73 72 63 20 29 20 29 20 7b 0a 09 09  ct( src ) ) {...
1e40: 09 09 09 09 63 6c 6f 6e 65 20 3d 20 7b 7d 3b 0a  ....clone = {};.
1e50: 09 09 09 09 09 7d 20 65 6c 73 65 20 7b 0a 09 09  .....} else {...
1e60: 09 09 09 09 63 6c 6f 6e 65 20 3d 20 73 72 63 3b  ....clone = src;
1e70: 0a 09 09 09 09 09 7d 0a 09 09 09 09 09 63 6f 70  ......}......cop
1e80: 79 49 73 41 72 72 61 79 20 3d 20 66 61 6c 73 65  yIsArray = false
1e90: 3b 0a 0a 09 09 09 09 09 2f 2f 20 4e 65 76 65 72  ;.......// Never
1ea0: 20 6d 6f 76 65 20 6f 72 69 67 69 6e 61 6c 20 6f   move original o
1eb0: 62 6a 65 63 74 73 2c 20 63 6c 6f 6e 65 20 74 68  bjects, clone th
1ec0: 65 6d 0a 09 09 09 09 09 74 61 72 67 65 74 5b 20  em......target[ 
1ed0: 6e 61 6d 65 20 5d 20 3d 20 6a 51 75 65 72 79 2e  name ] = jQuery.
1ee0: 65 78 74 65 6e 64 28 20 64 65 65 70 2c 20 63 6c  extend( deep, cl
1ef0: 6f 6e 65 2c 20 63 6f 70 79 20 29 3b 0a 0a 09 09  one, copy );....
1f00: 09 09 2f 2f 20 44 6f 6e 27 74 20 62 72 69 6e 67  ..// Don't bring
1f10: 20 69 6e 20 75 6e 64 65 66 69 6e 65 64 20 76 61   in undefined va
1f20: 6c 75 65 73 0a 09 09 09 09 7d 20 65 6c 73 65 20  lues.....} else 
1f30: 69 66 20 28 20 63 6f 70 79 20 21 3d 3d 20 75 6e  if ( copy !== un
1f40: 64 65 66 69 6e 65 64 20 29 20 7b 0a 09 09 09 09  defined ) {.....
1f50: 09 74 61 72 67 65 74 5b 20 6e 61 6d 65 20 5d 20  .target[ name ] 
1f60: 3d 20 63 6f 70 79 3b 0a 09 09 09 09 7d 0a 09 09  = copy;.....}...
1f70: 09 7d 0a 09 09 7d 0a 09 7d 0a 0a 09 2f 2f 20 52  .}...}..}...// R
1f80: 65 74 75 72 6e 20 74 68 65 20 6d 6f 64 69 66 69  eturn the modifi
1f90: 65 64 20 6f 62 6a 65 63 74 0a 09 72 65 74 75 72  ed object..retur
1fa0: 6e 20 74 61 72 67 65 74 3b 0a 7d 3b 0a 0a 6a 51  n target;.};..jQ
1fb0: 75 65 72 79 2e 65 78 74 65 6e 64 28 20 7b 0a 0a  uery.extend( {..
1fc0: 09 2f 2f 20 55 6e 69 71 75 65 20 66 6f 72 20 65  .// Unique for e
1fd0: 61 63 68 20 63 6f 70 79 20 6f 66 20 6a 51 75 65  ach copy of jQue
1fe0: 72 79 20 6f 6e 20 74 68 65 20 70 61 67 65 0a 09  ry on the page..
1ff0: 65 78 70 61 6e 64 6f 3a 20 22 6a 51 75 65 72 79  expando: "jQuery
2000: 22 20 2b 20 28 20 76 65 72 73 69 6f 6e 20 2b 20  " + ( version + 
2010: 4d 61 74 68 2e 72 61 6e 64 6f 6d 28 29 20 29 2e  Math.random() ).
2020: 72 65 70 6c 61 63 65 28 20 2f 5c 44 2f 67 2c 20  replace( /\D/g, 
2030: 22 22 20 29 2c 0a 0a 09 2f 2f 20 41 73 73 75 6d  "" ),...// Assum
2040: 65 20 6a 51 75 65 72 79 20 69 73 20 72 65 61 64  e jQuery is read
2050: 79 20 77 69 74 68 6f 75 74 20 74 68 65 20 72 65  y without the re
2060: 61 64 79 20 6d 6f 64 75 6c 65 0a 09 69 73 52 65  ady module..isRe
2070: 61 64 79 3a 20 74 72 75 65 2c 0a 0a 09 65 72 72  ady: true,...err
2080: 6f 72 3a 20 66 75 6e 63 74 69 6f 6e 28 20 6d 73  or: function( ms
2090: 67 20 29 20 7b 0a 09 09 74 68 72 6f 77 20 6e 65  g ) {...throw ne
20a0: 77 20 45 72 72 6f 72 28 20 6d 73 67 20 29 3b 0a  w Error( msg );.
20b0: 09 7d 2c 0a 0a 09 6e 6f 6f 70 3a 20 66 75 6e 63  .},...noop: func
20c0: 74 69 6f 6e 28 29 20 7b 7d 2c 0a 0a 09 69 73 50  tion() {},...isP
20d0: 6c 61 69 6e 4f 62 6a 65 63 74 3a 20 66 75 6e 63  lainObject: func
20e0: 74 69 6f 6e 28 20 6f 62 6a 20 29 20 7b 0a 09 09  tion( obj ) {...
20f0: 76 61 72 20 70 72 6f 74 6f 2c 20 43 74 6f 72 3b  var proto, Ctor;
2100: 0a 0a 09 09 2f 2f 20 44 65 74 65 63 74 20 6f 62  ....// Detect ob
2110: 76 69 6f 75 73 20 6e 65 67 61 74 69 76 65 73 0a  vious negatives.
2120: 09 09 2f 2f 20 55 73 65 20 74 6f 53 74 72 69 6e  ..// Use toStrin
2130: 67 20 69 6e 73 74 65 61 64 20 6f 66 20 6a 51 75  g instead of jQu
2140: 65 72 79 2e 74 79 70 65 20 74 6f 20 63 61 74 63  ery.type to catc
2150: 68 20 68 6f 73 74 20 6f 62 6a 65 63 74 73 0a 09  h host objects..
2160: 09 69 66 20 28 20 21 6f 62 6a 20 7c 7c 20 74 6f  .if ( !obj || to
2170: 53 74 72 69 6e 67 2e 63 61 6c 6c 28 20 6f 62 6a  String.call( obj
2180: 20 29 20 21 3d 3d 20 22 5b 6f 62 6a 65 63 74 20   ) !== "[object 
2190: 4f 62 6a 65 63 74 5d 22 20 29 20 7b 0a 09 09 09  Object]" ) {....
21a0: 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0a 09 09  return false;...
21b0: 7d 0a 0a 09 09 70 72 6f 74 6f 20 3d 20 67 65 74  }....proto = get
21c0: 50 72 6f 74 6f 28 20 6f 62 6a 20 29 3b 0a 0a 09  Proto( obj );...
21d0: 09 2f 2f 20 4f 62 6a 65 63 74 73 20 77 69 74 68  .// Objects with
21e0: 20 6e 6f 20 70 72 6f 74 6f 74 79 70 65 20 28 65   no prototype (e
21f0: 2e 67 2e 2c 20 60 4f 62 6a 65 63 74 2e 63 72 65  .g., `Object.cre
2200: 61 74 65 28 20 6e 75 6c 6c 20 29 60 29 20 61 72  ate( null )`) ar
2210: 65 20 70 6c 61 69 6e 0a 09 09 69 66 20 28 20 21  e plain...if ( !
2220: 70 72 6f 74 6f 20 29 20 7b 0a 09 09 09 72 65 74  proto ) {....ret
2230: 75 72 6e 20 74 72 75 65 3b 0a 09 09 7d 0a 0a 09  urn true;...}...
2240: 09 2f 2f 20 4f 62 6a 65 63 74 73 20 77 69 74 68  .// Objects with
2250: 20 70 72 6f 74 6f 74 79 70 65 20 61 72 65 20 70   prototype are p
2260: 6c 61 69 6e 20 69 66 66 20 74 68 65 79 20 77 65  lain iff they we
2270: 72 65 20 63 6f 6e 73 74 72 75 63 74 65 64 20 62  re constructed b
2280: 79 20 61 20 67 6c 6f 62 61 6c 20 4f 62 6a 65 63  y a global Objec
2290: 74 20 66 75 6e 63 74 69 6f 6e 0a 09 09 43 74 6f  t function...Cto
22a0: 72 20 3d 20 68 61 73 4f 77 6e 2e 63 61 6c 6c 28  r = hasOwn.call(
22b0: 20 70 72 6f 74 6f 2c 20 22 63 6f 6e 73 74 72 75   proto, "constru
22c0: 63 74 6f 72 22 20 29 20 26 26 20 70 72 6f 74 6f  ctor" ) && proto
22d0: 2e 63 6f 6e 73 74 72 75 63 74 6f 72 3b 0a 09 09  .constructor;...
22e0: 72 65 74 75 72 6e 20 74 79 70 65 6f 66 20 43 74  return typeof Ct
22f0: 6f 72 20 3d 3d 3d 20 22 66 75 6e 63 74 69 6f 6e  or === "function
2300: 22 20 26 26 20 66 6e 54 6f 53 74 72 69 6e 67 2e  " && fnToString.
2310: 63 61 6c 6c 28 20 43 74 6f 72 20 29 20 3d 3d 3d  call( Ctor ) ===
2320: 20 4f 62 6a 65 63 74 46 75 6e 63 74 69 6f 6e 53   ObjectFunctionS
2330: 74 72 69 6e 67 3b 0a 09 7d 2c 0a 0a 09 69 73 45  tring;..},...isE
2340: 6d 70 74 79 4f 62 6a 65 63 74 3a 20 66 75 6e 63  mptyObject: func
2350: 74 69 6f 6e 28 20 6f 62 6a 20 29 20 7b 0a 09 09  tion( obj ) {...
2360: 76 61 72 20 6e 61 6d 65 3b 0a 0a 09 09 66 6f 72  var name;....for
2370: 20 28 20 6e 61 6d 65 20 69 6e 20 6f 62 6a 20 29   ( name in obj )
2380: 20 7b 0a 09 09 09 72 65 74 75 72 6e 20 66 61 6c   {....return fal
2390: 73 65 3b 0a 09 09 7d 0a 09 09 72 65 74 75 72 6e  se;...}...return
23a0: 20 74 72 75 65 3b 0a 09 7d 2c 0a 0a 09 2f 2f 20   true;..},...// 
23b0: 45 76 61 6c 75 61 74 65 73 20 61 20 73 63 72 69  Evaluates a scri
23c0: 70 74 20 69 6e 20 61 20 70 72 6f 76 69 64 65 64  pt in a provided
23d0: 20 63 6f 6e 74 65 78 74 3b 20 66 61 6c 6c 73 20   context; falls 
23e0: 62 61 63 6b 20 74 6f 20 74 68 65 20 67 6c 6f 62  back to the glob
23f0: 61 6c 20 6f 6e 65 0a 09 2f 2f 20 69 66 20 6e 6f  al one..// if no
2400: 74 20 73 70 65 63 69 66 69 65 64 2e 0a 09 67 6c  t specified...gl
2410: 6f 62 61 6c 45 76 61 6c 3a 20 66 75 6e 63 74 69  obalEval: functi
2420: 6f 6e 28 20 63 6f 64 65 2c 20 6f 70 74 69 6f 6e  on( code, option
2430: 73 2c 20 64 6f 63 20 29 20 7b 0a 09 09 44 4f 4d  s, doc ) {...DOM
2440: 45 76 61 6c 28 20 63 6f 64 65 2c 20 7b 20 6e 6f  Eval( code, { no
2450: 6e 63 65 3a 20 6f 70 74 69 6f 6e 73 20 26 26 20  nce: options && 
2460: 6f 70 74 69 6f 6e 73 2e 6e 6f 6e 63 65 20 7d 2c  options.nonce },
2470: 20 64 6f 63 20 29 3b 0a 09 7d 2c 0a 0a 09 65 61   doc );..},...ea
2480: 63 68 3a 20 66 75 6e 63 74 69 6f 6e 28 20 6f 62  ch: function( ob
2490: 6a 2c 20 63 61 6c 6c 62 61 63 6b 20 29 20 7b 0a  j, callback ) {.
24a0: 09 09 76 61 72 20 6c 65 6e 67 74 68 2c 20 69 20  ..var length, i 
24b0: 3d 20 30 3b 0a 0a 09 09 69 66 20 28 20 69 73 41  = 0;....if ( isA
24c0: 72 72 61 79 4c 69 6b 65 28 20 6f 62 6a 20 29 20  rrayLike( obj ) 
24d0: 29 20 7b 0a 09 09 09 6c 65 6e 67 74 68 20 3d 20  ) {....length = 
24e0: 6f 62 6a 2e 6c 65 6e 67 74 68 3b 0a 09 09 09 66  obj.length;....f
24f0: 6f 72 20 28 20 3b 20 69 20 3c 20 6c 65 6e 67 74  or ( ; i < lengt
2500: 68 3b 20 69 2b 2b 20 29 20 7b 0a 09 09 09 09 69  h; i++ ) {.....i
2510: 66 20 28 20 63 61 6c 6c 62 61 63 6b 2e 63 61 6c  f ( callback.cal
2520: 6c 28 20 6f 62 6a 5b 20 69 20 5d 2c 20 69 2c 20  l( obj[ i ], i, 
2530: 6f 62 6a 5b 20 69 20 5d 20 29 20 3d 3d 3d 20 66  obj[ i ] ) === f
2540: 61 6c 73 65 20 29 20 7b 0a 09 09 09 09 09 62 72  alse ) {......br
2550: 65 61 6b 3b 0a 09 09 09 09 7d 0a 09 09 09 7d 0a  eak;.....}....}.
2560: 09 09 7d 20 65 6c 73 65 20 7b 0a 09 09 09 66 6f  ..} else {....fo
2570: 72 20 28 20 69 20 69 6e 20 6f 62 6a 20 29 20 7b  r ( i in obj ) {
2580: 0a 09 09 09 09 69 66 20 28 20 63 61 6c 6c 62 61  .....if ( callba
2590: 63 6b 2e 63 61 6c 6c 28 20 6f 62 6a 5b 20 69 20  ck.call( obj[ i 
25a0: 5d 2c 20 69 2c 20 6f 62 6a 5b 20 69 20 5d 20 29  ], i, obj[ i ] )
25b0: 20 3d 3d 3d 20 66 61 6c 73 65 20 29 20 7b 0a 09   === false ) {..
25c0: 09 09 09 09 62 72 65 61 6b 3b 0a 09 09 09 09 7d  ....break;.....}
25d0: 0a 09 09 09 7d 0a 09 09 7d 0a 0a 09 09 72 65 74  ....}...}....ret
25e0: 75 72 6e 20 6f 62 6a 3b 0a 09 7d 2c 0a 0a 09 2f  urn obj;..},.../
25f0: 2f 20 72 65 73 75 6c 74 73 20 69 73 20 66 6f 72  / results is for
2600: 20 69 6e 74 65 72 6e 61 6c 20 75 73 61 67 65 20   internal usage 
2610: 6f 6e 6c 79 0a 09 6d 61 6b 65 41 72 72 61 79 3a  only..makeArray:
2620: 20 66 75 6e 63 74 69 6f 6e 28 20 61 72 72 2c 20   function( arr, 
2630: 72 65 73 75 6c 74 73 20 29 20 7b 0a 09 09 76 61  results ) {...va
2640: 72 20 72 65 74 20 3d 20 72 65 73 75 6c 74 73 20  r ret = results 
2650: 7c 7c 20 5b 5d 3b 0a 0a 09 09 69 66 20 28 20 61  || [];....if ( a
2660: 72 72 20 21 3d 20 6e 75 6c 6c 20 29 20 7b 0a 09  rr != null ) {..
2670: 09 09 69 66 20 28 20 69 73 41 72 72 61 79 4c 69  ..if ( isArrayLi
2680: 6b 65 28 20 4f 62 6a 65 63 74 28 20 61 72 72 20  ke( Object( arr 
2690: 29 20 29 20 29 20 7b 0a 09 09 09 09 6a 51 75 65  ) ) ) {.....jQue
26a0: 72 79 2e 6d 65 72 67 65 28 20 72 65 74 2c 0a 09  ry.merge( ret,..
26b0: 09 09 09 09 74 79 70 65 6f 66 20 61 72 72 20 3d  ....typeof arr =
26c0: 3d 3d 20 22 73 74 72 69 6e 67 22 20 3f 0a 09 09  == "string" ?...
26d0: 09 09 09 5b 20 61 72 72 20 5d 20 3a 20 61 72 72  ...[ arr ] : arr
26e0: 0a 09 09 09 09 29 3b 0a 09 09 09 7d 20 65 6c 73  .....);....} els
26f0: 65 20 7b 0a 09 09 09 09 70 75 73 68 2e 63 61 6c  e {.....push.cal
2700: 6c 28 20 72 65 74 2c 20 61 72 72 20 29 3b 0a 09  l( ret, arr );..
2710: 09 09 7d 0a 09 09 7d 0a 0a 09 09 72 65 74 75 72  ..}...}....retur
2720: 6e 20 72 65 74 3b 0a 09 7d 2c 0a 0a 09 69 6e 41  n ret;..},...inA
2730: 72 72 61 79 3a 20 66 75 6e 63 74 69 6f 6e 28 20  rray: function( 
2740: 65 6c 65 6d 2c 20 61 72 72 2c 20 69 20 29 20 7b  elem, arr, i ) {
2750: 0a 09 09 72 65 74 75 72 6e 20 61 72 72 20 3d 3d  ...return arr ==
2760: 20 6e 75 6c 6c 20 3f 20 2d 31 20 3a 20 69 6e 64   null ? -1 : ind
2770: 65 78 4f 66 2e 63 61 6c 6c 28 20 61 72 72 2c 20  exOf.call( arr, 
2780: 65 6c 65 6d 2c 20 69 20 29 3b 0a 09 7d 2c 0a 0a  elem, i );..},..
2790: 09 2f 2f 20 53 75 70 70 6f 72 74 3a 20 41 6e 64  .// Support: And
27a0: 72 6f 69 64 20 3c 3d 34 2e 30 20 6f 6e 6c 79 2c  roid <=4.0 only,
27b0: 20 50 68 61 6e 74 6f 6d 4a 53 20 31 20 6f 6e 6c   PhantomJS 1 onl
27c0: 79 0a 09 2f 2f 20 70 75 73 68 2e 61 70 70 6c 79  y..// push.apply
27d0: 28 5f 2c 20 61 72 72 61 79 6c 69 6b 65 29 20 74  (_, arraylike) t
27e0: 68 72 6f 77 73 20 6f 6e 20 61 6e 63 69 65 6e 74  hrows on ancient
27f0: 20 57 65 62 4b 69 74 0a 09 6d 65 72 67 65 3a 20   WebKit..merge: 
2800: 66 75 6e 63 74 69 6f 6e 28 20 66 69 72 73 74 2c  function( first,
2810: 20 73 65 63 6f 6e 64 20 29 20 7b 0a 09 09 76 61   second ) {...va
2820: 72 20 6c 65 6e 20 3d 20 2b 73 65 63 6f 6e 64 2e  r len = +second.
2830: 6c 65 6e 67 74 68 2c 0a 09 09 09 6a 20 3d 20 30  length,....j = 0
2840: 2c 0a 09 09 09 69 20 3d 20 66 69 72 73 74 2e 6c  ,....i = first.l
2850: 65 6e 67 74 68 3b 0a 0a 09 09 66 6f 72 20 28 20  ength;....for ( 
2860: 3b 20 6a 20 3c 20 6c 65 6e 3b 20 6a 2b 2b 20 29  ; j < len; j++ )
2870: 20 7b 0a 09 09 09 66 69 72 73 74 5b 20 69 2b 2b   {....first[ i++
2880: 20 5d 20 3d 20 73 65 63 6f 6e 64 5b 20 6a 20 5d   ] = second[ j ]
2890: 3b 0a 09 09 7d 0a 0a 09 09 66 69 72 73 74 2e 6c  ;...}....first.l
28a0: 65 6e 67 74 68 20 3d 20 69 3b 0a 0a 09 09 72 65  ength = i;....re
28b0: 74 75 72 6e 20 66 69 72 73 74 3b 0a 09 7d 2c 0a  turn first;..},.
28c0: 0a 09 67 72 65 70 3a 20 66 75 6e 63 74 69 6f 6e  ..grep: function
28d0: 28 20 65 6c 65 6d 73 2c 20 63 61 6c 6c 62 61 63  ( elems, callbac
28e0: 6b 2c 20 69 6e 76 65 72 74 20 29 20 7b 0a 09 09  k, invert ) {...
28f0: 76 61 72 20 63 61 6c 6c 62 61 63 6b 49 6e 76 65  var callbackInve
2900: 72 73 65 2c 0a 09 09 09 6d 61 74 63 68 65 73 20  rse,....matches 
2910: 3d 20 5b 5d 2c 0a 09 09 09 69 20 3d 20 30 2c 0a  = [],....i = 0,.
2920: 09 09 09 6c 65 6e 67 74 68 20 3d 20 65 6c 65 6d  ...length = elem
2930: 73 2e 6c 65 6e 67 74 68 2c 0a 09 09 09 63 61 6c  s.length,....cal
2940: 6c 62 61 63 6b 45 78 70 65 63 74 20 3d 20 21 69  lbackExpect = !i
2950: 6e 76 65 72 74 3b 0a 0a 09 09 2f 2f 20 47 6f 20  nvert;....// Go 
2960: 74 68 72 6f 75 67 68 20 74 68 65 20 61 72 72 61  through the arra
2970: 79 2c 20 6f 6e 6c 79 20 73 61 76 69 6e 67 20 74  y, only saving t
2980: 68 65 20 69 74 65 6d 73 0a 09 09 2f 2f 20 74 68  he items...// th
2990: 61 74 20 70 61 73 73 20 74 68 65 20 76 61 6c 69  at pass the vali
29a0: 64 61 74 6f 72 20 66 75 6e 63 74 69 6f 6e 0a 09  dator function..
29b0: 09 66 6f 72 20 28 20 3b 20 69 20 3c 20 6c 65 6e  .for ( ; i < len
29c0: 67 74 68 3b 20 69 2b 2b 20 29 20 7b 0a 09 09 09  gth; i++ ) {....
29d0: 63 61 6c 6c 62 61 63 6b 49 6e 76 65 72 73 65 20  callbackInverse 
29e0: 3d 20 21 63 61 6c 6c 62 61 63 6b 28 20 65 6c 65  = !callback( ele
29f0: 6d 73 5b 20 69 20 5d 2c 20 69 20 29 3b 0a 09 09  ms[ i ], i );...
2a00: 09 69 66 20 28 20 63 61 6c 6c 62 61 63 6b 49 6e  .if ( callbackIn
2a10: 76 65 72 73 65 20 21 3d 3d 20 63 61 6c 6c 62 61  verse !== callba
2a20: 63 6b 45 78 70 65 63 74 20 29 20 7b 0a 09 09 09  ckExpect ) {....
2a30: 09 6d 61 74 63 68 65 73 2e 70 75 73 68 28 20 65  .matches.push( e
2a40: 6c 65 6d 73 5b 20 69 20 5d 20 29 3b 0a 09 09 09  lems[ i ] );....
2a50: 7d 0a 09 09 7d 0a 0a 09 09 72 65 74 75 72 6e 20  }...}....return 
2a60: 6d 61 74 63 68 65 73 3b 0a 09 7d 2c 0a 0a 09 2f  matches;..},.../
2a70: 2f 20 61 72 67 20 69 73 20 66 6f 72 20 69 6e 74  / arg is for int
2a80: 65 72 6e 61 6c 20 75 73 61 67 65 20 6f 6e 6c 79  ernal usage only
2a90: 0a 09 6d 61 70 3a 20 66 75 6e 63 74 69 6f 6e 28  ..map: function(
2aa0: 20 65 6c 65 6d 73 2c 20 63 61 6c 6c 62 61 63 6b   elems, callback
2ab0: 2c 20 61 72 67 20 29 20 7b 0a 09 09 76 61 72 20  , arg ) {...var 
2ac0: 6c 65 6e 67 74 68 2c 20 76 61 6c 75 65 2c 0a 09  length, value,..
2ad0: 09 09 69 20 3d 20 30 2c 0a 09 09 09 72 65 74 20  ..i = 0,....ret 
2ae0: 3d 20 5b 5d 3b 0a 0a 09 09 2f 2f 20 47 6f 20 74  = [];....// Go t
2af0: 68 72 6f 75 67 68 20 74 68 65 20 61 72 72 61 79  hrough the array
2b00: 2c 20 74 72 61 6e 73 6c 61 74 69 6e 67 20 65 61  , translating ea
2b10: 63 68 20 6f 66 20 74 68 65 20 69 74 65 6d 73 20  ch of the items 
2b20: 74 6f 20 74 68 65 69 72 20 6e 65 77 20 76 61 6c  to their new val
2b30: 75 65 73 0a 09 09 69 66 20 28 20 69 73 41 72 72  ues...if ( isArr
2b40: 61 79 4c 69 6b 65 28 20 65 6c 65 6d 73 20 29 20  ayLike( elems ) 
2b50: 29 20 7b 0a 09 09 09 6c 65 6e 67 74 68 20 3d 20  ) {....length = 
2b60: 65 6c 65 6d 73 2e 6c 65 6e 67 74 68 3b 0a 09 09  elems.length;...
2b70: 09 66 6f 72 20 28 20 3b 20 69 20 3c 20 6c 65 6e  .for ( ; i < len
2b80: 67 74 68 3b 20 69 2b 2b 20 29 20 7b 0a 09 09 09  gth; i++ ) {....
2b90: 09 76 61 6c 75 65 20 3d 20 63 61 6c 6c 62 61 63  .value = callbac
2ba0: 6b 28 20 65 6c 65 6d 73 5b 20 69 20 5d 2c 20 69  k( elems[ i ], i
2bb0: 2c 20 61 72 67 20 29 3b 0a 0a 09 09 09 09 69 66  , arg );......if
2bc0: 20 28 20 76 61 6c 75 65 20 21 3d 20 6e 75 6c 6c   ( value != null
2bd0: 20 29 20 7b 0a 09 09 09 09 09 72 65 74 2e 70 75   ) {......ret.pu
2be0: 73 68 28 20 76 61 6c 75 65 20 29 3b 0a 09 09 09  sh( value );....
2bf0: 09 7d 0a 09 09 09 7d 0a 0a 09 09 2f 2f 20 47 6f  .}....}....// Go
2c00: 20 74 68 72 6f 75 67 68 20 65 76 65 72 79 20 6b   through every k
2c10: 65 79 20 6f 6e 20 74 68 65 20 6f 62 6a 65 63 74  ey on the object
2c20: 2c 0a 09 09 7d 20 65 6c 73 65 20 7b 0a 09 09 09  ,...} else {....
2c30: 66 6f 72 20 28 20 69 20 69 6e 20 65 6c 65 6d 73  for ( i in elems
2c40: 20 29 20 7b 0a 09 09 09 09 76 61 6c 75 65 20 3d   ) {.....value =
2c50: 20 63 61 6c 6c 62 61 63 6b 28 20 65 6c 65 6d 73   callback( elems
2c60: 5b 20 69 20 5d 2c 20 69 2c 20 61 72 67 20 29 3b  [ i ], i, arg );
2c70: 0a 0a 09 09 09 09 69 66 20 28 20 76 61 6c 75 65  ......if ( value
2c80: 20 21 3d 20 6e 75 6c 6c 20 29 20 7b 0a 09 09 09   != null ) {....
2c90: 09 09 72 65 74 2e 70 75 73 68 28 20 76 61 6c 75  ..ret.push( valu
2ca0: 65 20 29 3b 0a 09 09 09 09 7d 0a 09 09 09 7d 0a  e );.....}....}.
2cb0: 09 09 7d 0a 0a 09 09 2f 2f 20 46 6c 61 74 74 65  ..}....// Flatte
2cc0: 6e 20 61 6e 79 20 6e 65 73 74 65 64 20 61 72 72  n any nested arr
2cd0: 61 79 73 0a 09 09 72 65 74 75 72 6e 20 66 6c 61  ays...return fla
2ce0: 74 28 20 72 65 74 20 29 3b 0a 09 7d 2c 0a 0a 09  t( ret );..},...
2cf0: 2f 2f 20 41 20 67 6c 6f 62 61 6c 20 47 55 49 44  // A global GUID
2d00: 20 63 6f 75 6e 74 65 72 20 66 6f 72 20 6f 62 6a   counter for obj
2d10: 65 63 74 73 0a 09 67 75 69 64 3a 20 31 2c 0a 0a  ects..guid: 1,..
2d20: 09 2f 2f 20 6a 51 75 65 72 79 2e 73 75 70 70 6f  .// jQuery.suppo
2d30: 72 74 20 69 73 20 6e 6f 74 20 75 73 65 64 20 69  rt is not used i
2d40: 6e 20 43 6f 72 65 20 62 75 74 20 6f 74 68 65 72  n Core but other
2d50: 20 70 72 6f 6a 65 63 74 73 20 61 74 74 61 63 68   projects attach
2d60: 20 74 68 65 69 72 0a 09 2f 2f 20 70 72 6f 70 65   their..// prope
2d70: 72 74 69 65 73 20 74 6f 20 69 74 20 73 6f 20 69  rties to it so i
2d80: 74 20 6e 65 65 64 73 20 74 6f 20 65 78 69 73 74  t needs to exist
2d90: 2e 0a 09 73 75 70 70 6f 72 74 3a 20 73 75 70 70  ...support: supp
2da0: 6f 72 74 0a 7d 20 29 3b 0a 0a 69 66 20 28 20 74  ort.} );..if ( t
2db0: 79 70 65 6f 66 20 53 79 6d 62 6f 6c 20 3d 3d 3d  ypeof Symbol ===
2dc0: 20 22 66 75 6e 63 74 69 6f 6e 22 20 29 20 7b 0a   "function" ) {.
2dd0: 09 6a 51 75 65 72 79 2e 66 6e 5b 20 53 79 6d 62  .jQuery.fn[ Symb
2de0: 6f 6c 2e 69 74 65 72 61 74 6f 72 20 5d 20 3d 20  ol.iterator ] = 
2df0: 61 72 72 5b 20 53 79 6d 62 6f 6c 2e 69 74 65 72  arr[ Symbol.iter
2e00: 61 74 6f 72 20 5d 3b 0a 7d 0a 0a 2f 2f 20 50 6f  ator ];.}..// Po
2e10: 70 75 6c 61 74 65 20 74 68 65 20 63 6c 61 73 73  pulate the class
2e20: 32 74 79 70 65 20 6d 61 70 0a 6a 51 75 65 72 79  2type map.jQuery
2e30: 2e 65 61 63 68 28 20 22 42 6f 6f 6c 65 61 6e 20  .each( "Boolean 
2e40: 4e 75 6d 62 65 72 20 53 74 72 69 6e 67 20 46 75  Number String Fu
2e50: 6e 63 74 69 6f 6e 20 41 72 72 61 79 20 44 61 74  nction Array Dat
2e60: 65 20 52 65 67 45 78 70 20 4f 62 6a 65 63 74 20  e RegExp Object 
2e70: 45 72 72 6f 72 20 53 79 6d 62 6f 6c 22 2e 73 70  Error Symbol".sp
2e80: 6c 69 74 28 20 22 20 22 20 29 2c 0a 66 75 6e 63  lit( " " ),.func
2e90: 74 69 6f 6e 28 20 5f 69 2c 20 6e 61 6d 65 20 29  tion( _i, name )
2ea0: 20 7b 0a 09 63 6c 61 73 73 32 74 79 70 65 5b 20   {..class2type[ 
2eb0: 22 5b 6f 62 6a 65 63 74 20 22 20 2b 20 6e 61 6d  "[object " + nam
2ec0: 65 20 2b 20 22 5d 22 20 5d 20 3d 20 6e 61 6d 65  e + "]" ] = name
2ed0: 2e 74 6f 4c 6f 77 65 72 43 61 73 65 28 29 3b 0a  .toLowerCase();.
2ee0: 7d 20 29 3b 0a 0a 66 75 6e 63 74 69 6f 6e 20 69  } );..function i
2ef0: 73 41 72 72 61 79 4c 69 6b 65 28 20 6f 62 6a 20  sArrayLike( obj 
2f00: 29 20 7b 0a 0a 09 2f 2f 20 53 75 70 70 6f 72 74  ) {...// Support
2f10: 3a 20 72 65 61 6c 20 69 4f 53 20 38 2e 32 20 6f  : real iOS 8.2 o
2f20: 6e 6c 79 20 28 6e 6f 74 20 72 65 70 72 6f 64 75  nly (not reprodu
2f30: 63 69 62 6c 65 20 69 6e 20 73 69 6d 75 6c 61 74  cible in simulat
2f40: 6f 72 29 0a 09 2f 2f 20 60 69 6e 60 20 63 68 65  or)..// `in` che
2f50: 63 6b 20 75 73 65 64 20 74 6f 20 70 72 65 76 65  ck used to preve
2f60: 6e 74 20 4a 49 54 20 65 72 72 6f 72 20 28 67 68  nt JIT error (gh
2f70: 2d 32 31 34 35 29 0a 09 2f 2f 20 68 61 73 4f 77  -2145)..// hasOw
2f80: 6e 20 69 73 6e 27 74 20 75 73 65 64 20 68 65 72  n isn't used her
2f90: 65 20 64 75 65 20 74 6f 20 66 61 6c 73 65 20 6e  e due to false n
2fa0: 65 67 61 74 69 76 65 73 0a 09 2f 2f 20 72 65 67  egatives..// reg
2fb0: 61 72 64 69 6e 67 20 4e 6f 64 65 6c 69 73 74 20  arding Nodelist 
2fc0: 6c 65 6e 67 74 68 20 69 6e 20 49 45 0a 09 76 61  length in IE..va
2fd0: 72 20 6c 65 6e 67 74 68 20 3d 20 21 21 6f 62 6a  r length = !!obj
2fe0: 20 26 26 20 22 6c 65 6e 67 74 68 22 20 69 6e 20   && "length" in 
2ff0: 6f 62 6a 20 26 26 20 6f 62 6a 2e 6c 65 6e 67 74  obj && obj.lengt
3000: 68 2c 0a 09 09 74 79 70 65 20 3d 20 74 6f 54 79  h,...type = toTy
3010: 70 65 28 20 6f 62 6a 20 29 3b 0a 0a 09 69 66 20  pe( obj );...if 
3020: 28 20 69 73 46 75 6e 63 74 69 6f 6e 28 20 6f 62  ( isFunction( ob
3030: 6a 20 29 20 7c 7c 20 69 73 57 69 6e 64 6f 77 28  j ) || isWindow(
3040: 20 6f 62 6a 20 29 20 29 20 7b 0a 09 09 72 65 74   obj ) ) {...ret
3050: 75 72 6e 20 66 61 6c 73 65 3b 0a 09 7d 0a 0a 09  urn false;..}...
3060: 72 65 74 75 72 6e 20 74 79 70 65 20 3d 3d 3d 20  return type === 
3070: 22 61 72 72 61 79 22 20 7c 7c 20 6c 65 6e 67 74  "array" || lengt
3080: 68 20 3d 3d 3d 20 30 20 7c 7c 0a 09 09 74 79 70  h === 0 ||...typ
3090: 65 6f 66 20 6c 65 6e 67 74 68 20 3d 3d 3d 20 22  eof length === "
30a0: 6e 75 6d 62 65 72 22 20 26 26 20 6c 65 6e 67 74  number" && lengt
30b0: 68 20 3e 20 30 20 26 26 20 28 20 6c 65 6e 67 74  h > 0 && ( lengt
30c0: 68 20 2d 20 31 20 29 20 69 6e 20 6f 62 6a 3b 0a  h - 1 ) in obj;.
30d0: 7d 0a 76 61 72 20 53 69 7a 7a 6c 65 20 3d 0a 2f  }.var Sizzle =./
30e0: 2a 21 0a 20 2a 20 53 69 7a 7a 6c 65 20 43 53 53  *!. * Sizzle CSS
30f0: 20 53 65 6c 65 63 74 6f 72 20 45 6e 67 69 6e 65   Selector Engine
3100: 20 76 32 2e 33 2e 35 0a 20 2a 20 68 74 74 70 73   v2.3.5. * https
3110: 3a 2f 2f 73 69 7a 7a 6c 65 6a 73 2e 63 6f 6d 2f  ://sizzlejs.com/
3120: 0a 20 2a 0a 20 2a 20 43 6f 70 79 72 69 67 68 74  . *. * Copyright
3130: 20 4a 53 20 46 6f 75 6e 64 61 74 69 6f 6e 20 61   JS Foundation a
3140: 6e 64 20 6f 74 68 65 72 20 63 6f 6e 74 72 69 62  nd other contrib
3150: 75 74 6f 72 73 0a 20 2a 20 52 65 6c 65 61 73 65  utors. * Release
3160: 64 20 75 6e 64 65 72 20 74 68 65 20 4d 49 54 20  d under the MIT 
3170: 6c 69 63 65 6e 73 65 0a 20 2a 20 68 74 74 70 73  license. * https
3180: 3a 2f 2f 6a 73 2e 66 6f 75 6e 64 61 74 69 6f 6e  ://js.foundation
3190: 2f 0a 20 2a 0a 20 2a 20 44 61 74 65 3a 20 32 30  /. *. * Date: 20
31a0: 32 30 2d 30 33 2d 31 34 0a 20 2a 2f 0a 28 20 66  20-03-14. */.( f
31b0: 75 6e 63 74 69 6f 6e 28 20 77 69 6e 64 6f 77 20  unction( window 
31c0: 29 20 7b 0a 76 61 72 20 69 2c 0a 09 73 75 70 70  ) {.var i,..supp
31d0: 6f 72 74 2c 0a 09 45 78 70 72 2c 0a 09 67 65 74  ort,..Expr,..get
31e0: 54 65 78 74 2c 0a 09 69 73 58 4d 4c 2c 0a 09 74  Text,..isXML,..t
31f0: 6f 6b 65 6e 69 7a 65 2c 0a 09 63 6f 6d 70 69 6c  okenize,..compil
3200: 65 2c 0a 09 73 65 6c 65 63 74 2c 0a 09 6f 75 74  e,..select,..out
3210: 65 72 6d 6f 73 74 43 6f 6e 74 65 78 74 2c 0a 09  ermostContext,..
3220: 73 6f 72 74 49 6e 70 75 74 2c 0a 09 68 61 73 44  sortInput,..hasD
3230: 75 70 6c 69 63 61 74 65 2c 0a 0a 09 2f 2f 20 4c  uplicate,...// L
3240: 6f 63 61 6c 20 64 6f 63 75 6d 65 6e 74 20 76 61  ocal document va
3250: 72 73 0a 09 73 65 74 44 6f 63 75 6d 65 6e 74 2c  rs..setDocument,
3260: 0a 09 64 6f 63 75 6d 65 6e 74 2c 0a 09 64 6f 63  ..document,..doc
3270: 45 6c 65 6d 2c 0a 09 64 6f 63 75 6d 65 6e 74 49  Elem,..documentI
3280: 73 48 54 4d 4c 2c 0a 09 72 62 75 67 67 79 51 53  sHTML,..rbuggyQS
3290: 41 2c 0a 09 72 62 75 67 67 79 4d 61 74 63 68 65  A,..rbuggyMatche
32a0: 73 2c 0a 09 6d 61 74 63 68 65 73 2c 0a 09 63 6f  s,..matches,..co
32b0: 6e 74 61 69 6e 73 2c 0a 0a 09 2f 2f 20 49 6e 73  ntains,...// Ins
32c0: 74 61 6e 63 65 2d 73 70 65 63 69 66 69 63 20 64  tance-specific d
32d0: 61 74 61 0a 09 65 78 70 61 6e 64 6f 20 3d 20 22  ata..expando = "
32e0: 73 69 7a 7a 6c 65 22 20 2b 20 31 20 2a 20 6e 65  sizzle" + 1 * ne
32f0: 77 20 44 61 74 65 28 29 2c 0a 09 70 72 65 66 65  w Date(),..prefe
3300: 72 72 65 64 44 6f 63 20 3d 20 77 69 6e 64 6f 77  rredDoc = window
3310: 2e 64 6f 63 75 6d 65 6e 74 2c 0a 09 64 69 72 72  .document,..dirr
3320: 75 6e 73 20 3d 20 30 2c 0a 09 64 6f 6e 65 20 3d  uns = 0,..done =
3330: 20 30 2c 0a 09 63 6c 61 73 73 43 61 63 68 65 20   0,..classCache 
3340: 3d 20 63 72 65 61 74 65 43 61 63 68 65 28 29 2c  = createCache(),
3350: 0a 09 74 6f 6b 65 6e 43 61 63 68 65 20 3d 20 63  ..tokenCache = c
3360: 72 65 61 74 65 43 61 63 68 65 28 29 2c 0a 09 63  reateCache(),..c
3370: 6f 6d 70 69 6c 65 72 43 61 63 68 65 20 3d 20 63  ompilerCache = c
3380: 72 65 61 74 65 43 61 63 68 65 28 29 2c 0a 09 6e  reateCache(),..n
3390: 6f 6e 6e 61 74 69 76 65 53 65 6c 65 63 74 6f 72  onnativeSelector
33a0: 43 61 63 68 65 20 3d 20 63 72 65 61 74 65 43 61  Cache = createCa
33b0: 63 68 65 28 29 2c 0a 09 73 6f 72 74 4f 72 64 65  che(),..sortOrde
33c0: 72 20 3d 20 66 75 6e 63 74 69 6f 6e 28 20 61 2c  r = function( a,
33d0: 20 62 20 29 20 7b 0a 09 09 69 66 20 28 20 61 20   b ) {...if ( a 
33e0: 3d 3d 3d 20 62 20 29 20 7b 0a 09 09 09 68 61 73  === b ) {....has
33f0: 44 75 70 6c 69 63 61 74 65 20 3d 20 74 72 75 65  Duplicate = true
3400: 3b 0a 09 09 7d 0a 09 09 72 65 74 75 72 6e 20 30  ;...}...return 0
3410: 3b 0a 09 7d 2c 0a 0a 09 2f 2f 20 49 6e 73 74 61  ;..},...// Insta
3420: 6e 63 65 20 6d 65 74 68 6f 64 73 0a 09 68 61 73  nce methods..has
3430: 4f 77 6e 20 3d 20 28 20 7b 7d 20 29 2e 68 61 73  Own = ( {} ).has
3440: 4f 77 6e 50 72 6f 70 65 72 74 79 2c 0a 09 61 72  OwnProperty,..ar
3450: 72 20 3d 20 5b 5d 2c 0a 09 70 6f 70 20 3d 20 61  r = [],..pop = a
3460: 72 72 2e 70 6f 70 2c 0a 09 70 75 73 68 4e 61 74  rr.pop,..pushNat
3470: 69 76 65 20 3d 20 61 72 72 2e 70 75 73 68 2c 0a  ive = arr.push,.
3480: 09 70 75 73 68 20 3d 20 61 72 72 2e 70 75 73 68  .push = arr.push
3490: 2c 0a 09 73 6c 69 63 65 20 3d 20 61 72 72 2e 73  ,..slice = arr.s
34a0: 6c 69 63 65 2c 0a 0a 09 2f 2f 20 55 73 65 20 61  lice,...// Use a
34b0: 20 73 74 72 69 70 70 65 64 2d 64 6f 77 6e 20 69   stripped-down i
34c0: 6e 64 65 78 4f 66 20 61 73 20 69 74 27 73 20 66  ndexOf as it's f
34d0: 61 73 74 65 72 20 74 68 61 6e 20 6e 61 74 69 76  aster than nativ
34e0: 65 0a 09 2f 2f 20 68 74 74 70 73 3a 2f 2f 6a 73  e..// https://js
34f0: 70 65 72 66 2e 63 6f 6d 2f 74 68 6f 72 2d 69 6e  perf.com/thor-in
3500: 64 65 78 6f 66 2d 76 73 2d 66 6f 72 2f 35 0a 09  dexof-vs-for/5..
3510: 69 6e 64 65 78 4f 66 20 3d 20 66 75 6e 63 74 69  indexOf = functi
3520: 6f 6e 28 20 6c 69 73 74 2c 20 65 6c 65 6d 20 29  on( list, elem )
3530: 20 7b 0a 09 09 76 61 72 20 69 20 3d 20 30 2c 0a   {...var i = 0,.
3540: 09 09 09 6c 65 6e 20 3d 20 6c 69 73 74 2e 6c 65  ...len = list.le
3550: 6e 67 74 68 3b 0a 09 09 66 6f 72 20 28 20 3b 20  ngth;...for ( ; 
3560: 69 20 3c 20 6c 65 6e 3b 20 69 2b 2b 20 29 20 7b  i < len; i++ ) {
3570: 0a 09 09 09 69 66 20 28 20 6c 69 73 74 5b 20 69  ....if ( list[ i
3580: 20 5d 20 3d 3d 3d 20 65 6c 65 6d 20 29 20 7b 0a   ] === elem ) {.
3590: 09 09 09 09 72 65 74 75 72 6e 20 69 3b 0a 09 09  ....return i;...
35a0: 09 7d 0a 09 09 7d 0a 09 09 72 65 74 75 72 6e 20  .}...}...return 
35b0: 2d 31 3b 0a 09 7d 2c 0a 0a 09 62 6f 6f 6c 65 61  -1;..},...boolea
35c0: 6e 73 20 3d 20 22 63 68 65 63 6b 65 64 7c 73 65  ns = "checked|se
35d0: 6c 65 63 74 65 64 7c 61 73 79 6e 63 7c 61 75 74  lected|async|aut
35e0: 6f 66 6f 63 75 73 7c 61 75 74 6f 70 6c 61 79 7c  ofocus|autoplay|
35f0: 63 6f 6e 74 72 6f 6c 73 7c 64 65 66 65 72 7c 64  controls|defer|d
3600: 69 73 61 62 6c 65 64 7c 68 69 64 64 65 6e 7c 22  isabled|hidden|"
3610: 20 2b 0a 09 09 22 69 73 6d 61 70 7c 6c 6f 6f 70   +..."ismap|loop
3620: 7c 6d 75 6c 74 69 70 6c 65 7c 6f 70 65 6e 7c 72  |multiple|open|r
3630: 65 61 64 6f 6e 6c 79 7c 72 65 71 75 69 72 65 64  eadonly|required
3640: 7c 73 63 6f 70 65 64 22 2c 0a 0a 09 2f 2f 20 52  |scoped",...// R
3650: 65 67 75 6c 61 72 20 65 78 70 72 65 73 73 69 6f  egular expressio
3660: 6e 73 0a 0a 09 2f 2f 20 68 74 74 70 3a 2f 2f 77  ns...// http://w
3670: 77 77 2e 77 33 2e 6f 72 67 2f 54 52 2f 63 73 73  ww.w3.org/TR/css
3680: 33 2d 73 65 6c 65 63 74 6f 72 73 2f 23 77 68 69  3-selectors/#whi
3690: 74 65 73 70 61 63 65 0a 09 77 68 69 74 65 73 70  tespace..whitesp
36a0: 61 63 65 20 3d 20 22 5b 5c 5c 78 32 30 5c 5c 74  ace = "[\\x20\\t
36b0: 5c 5c 72 5c 5c 6e 5c 5c 66 5d 22 2c 0a 0a 09 2f  \\r\\n\\f]",.../
36c0: 2f 20 68 74 74 70 73 3a 2f 2f 77 77 77 2e 77 33  / https://www.w3
36d0: 2e 6f 72 67 2f 54 52 2f 63 73 73 2d 73 79 6e 74  .org/TR/css-synt
36e0: 61 78 2d 33 2f 23 69 64 65 6e 74 2d 74 6f 6b 65  ax-3/#ident-toke
36f0: 6e 2d 64 69 61 67 72 61 6d 0a 09 69 64 65 6e 74  n-diagram..ident
3700: 69 66 69 65 72 20 3d 20 22 28 3f 3a 5c 5c 5c 5c  ifier = "(?:\\\\
3710: 5b 5c 5c 64 61 2d 66 41 2d 46 5d 7b 31 2c 36 7d  [\\da-fA-F]{1,6}
3720: 22 20 2b 20 77 68 69 74 65 73 70 61 63 65 20 2b  " + whitespace +
3730: 0a 09 09 22 3f 7c 5c 5c 5c 5c 5b 5e 5c 5c 72 5c  ..."?|\\\\[^\\r\
3740: 5c 6e 5c 5c 66 5d 7c 5b 5c 5c 77 2d 5d 7c 5b 5e  \n\\f]|[\\w-]|[^
3750: 5c 30 2d 5c 5c 78 37 66 5d 29 2b 22 2c 0a 0a 09  \0-\\x7f])+",...
3760: 2f 2f 20 41 74 74 72 69 62 75 74 65 20 73 65 6c  // Attribute sel
3770: 65 63 74 6f 72 73 3a 20 68 74 74 70 3a 2f 2f 77  ectors: http://w
3780: 77 77 2e 77 33 2e 6f 72 67 2f 54 52 2f 73 65 6c  ww.w3.org/TR/sel
3790: 65 63 74 6f 72 73 2f 23 61 74 74 72 69 62 75 74  ectors/#attribut
37a0: 65 2d 73 65 6c 65 63 74 6f 72 73 0a 09 61 74 74  e-selectors..att
37b0: 72 69 62 75 74 65 73 20 3d 20 22 5c 5c 5b 22 20  ributes = "\\[" 
37c0: 2b 20 77 68 69 74 65 73 70 61 63 65 20 2b 20 22  + whitespace + "
37d0: 2a 28 22 20 2b 20 69 64 65 6e 74 69 66 69 65 72  *(" + identifier
37e0: 20 2b 20 22 29 28 3f 3a 22 20 2b 20 77 68 69 74   + ")(?:" + whit
37f0: 65 73 70 61 63 65 20 2b 0a 0a 09 09 2f 2f 20 4f  espace +....// O
3800: 70 65 72 61 74 6f 72 20 28 63 61 70 74 75 72 65  perator (capture
3810: 20 32 29 0a 09 09 22 2a 28 5b 2a 5e 24 7c 21 7e   2)..."*([*^$|!~
3820: 5d 3f 3d 29 22 20 2b 20 77 68 69 74 65 73 70 61  ]?=)" + whitespa
3830: 63 65 20 2b 0a 0a 09 09 2f 2f 20 22 41 74 74 72  ce +....// "Attr
3840: 69 62 75 74 65 20 76 61 6c 75 65 73 20 6d 75 73  ibute values mus
3850: 74 20 62 65 20 43 53 53 20 69 64 65 6e 74 69 66  t be CSS identif
3860: 69 65 72 73 20 5b 63 61 70 74 75 72 65 20 35 5d  iers [capture 5]
3870: 0a 09 09 2f 2f 20 6f 72 20 73 74 72 69 6e 67 73  ...// or strings
3880: 20 5b 63 61 70 74 75 72 65 20 33 20 6f 72 20 63   [capture 3 or c
3890: 61 70 74 75 72 65 20 34 5d 22 0a 09 09 22 2a 28  apture 4]"..."*(
38a0: 3f 3a 27 28 28 3f 3a 5c 5c 5c 5c 2e 7c 5b 5e 5c  ?:'((?:\\\\.|[^\
38b0: 5c 5c 5c 27 5d 29 2a 29 27 7c 5c 22 28 28 3f 3a  \\\'])*)'|\"((?:
38c0: 5c 5c 5c 5c 2e 7c 5b 5e 5c 5c 5c 5c 5c 22 5d 29  \\\\.|[^\\\\\"])
38d0: 2a 29 5c 22 7c 28 22 20 2b 20 69 64 65 6e 74 69  *)\"|(" + identi
38e0: 66 69 65 72 20 2b 20 22 29 29 7c 29 22 20 2b 0a  fier + "))|)" +.
38f0: 09 09 77 68 69 74 65 73 70 61 63 65 20 2b 20 22  ..whitespace + "
3900: 2a 5c 5c 5d 22 2c 0a 0a 09 70 73 65 75 64 6f 73  *\\]",...pseudos
3910: 20 3d 20 22 3a 28 22 20 2b 20 69 64 65 6e 74 69   = ":(" + identi
3920: 66 69 65 72 20 2b 20 22 29 28 3f 3a 5c 5c 28 28  fier + ")(?:\\((
3930: 22 20 2b 0a 0a 09 09 2f 2f 20 54 6f 20 72 65 64  " +....// To red
3940: 75 63 65 20 74 68 65 20 6e 75 6d 62 65 72 20 6f  uce the number o
3950: 66 20 73 65 6c 65 63 74 6f 72 73 20 6e 65 65 64  f selectors need
3960: 69 6e 67 20 74 6f 6b 65 6e 69 7a 65 20 69 6e 20  ing tokenize in 
3970: 74 68 65 20 70 72 65 46 69 6c 74 65 72 2c 20 70  the preFilter, p
3980: 72 65 66 65 72 20 61 72 67 75 6d 65 6e 74 73 3a  refer arguments:
3990: 0a 09 09 2f 2f 20 31 2e 20 71 75 6f 74 65 64 20  ...// 1. quoted 
39a0: 28 63 61 70 74 75 72 65 20 33 3b 20 63 61 70 74  (capture 3; capt
39b0: 75 72 65 20 34 20 6f 72 20 63 61 70 74 75 72 65  ure 4 or capture
39c0: 20 35 29 0a 09 09 22 28 27 28 28 3f 3a 5c 5c 5c   5)..."('((?:\\\
39d0: 5c 2e 7c 5b 5e 5c 5c 5c 5c 27 5d 29 2a 29 27 7c  \.|[^\\\\'])*)'|
39e0: 5c 22 28 28 3f 3a 5c 5c 5c 5c 2e 7c 5b 5e 5c 5c  \"((?:\\\\.|[^\\
39f0: 5c 5c 5c 22 5d 29 2a 29 5c 22 29 7c 22 20 2b 0a  \\\"])*)\")|" +.
3a00: 0a 09 09 2f 2f 20 32 2e 20 73 69 6d 70 6c 65 20  ...// 2. simple 
3a10: 28 63 61 70 74 75 72 65 20 36 29 0a 09 09 22 28  (capture 6)..."(
3a20: 28 3f 3a 5c 5c 5c 5c 2e 7c 5b 5e 5c 5c 5c 5c 28  (?:\\\\.|[^\\\\(
3a30: 29 5b 5c 5c 5d 5d 7c 22 20 2b 20 61 74 74 72 69  )[\\]]|" + attri
3a40: 62 75 74 65 73 20 2b 20 22 29 2a 29 7c 22 20 2b  butes + ")*)|" +
3a50: 0a 0a 09 09 2f 2f 20 33 2e 20 61 6e 79 74 68 69  ....// 3. anythi
3a60: 6e 67 20 65 6c 73 65 20 28 63 61 70 74 75 72 65  ng else (capture
3a70: 20 32 29 0a 09 09 22 2e 2a 22 20 2b 0a 09 09 22   2)...".*" +..."
3a80: 29 5c 5c 29 7c 29 22 2c 0a 0a 09 2f 2f 20 4c 65  )\\)|)",...// Le
3a90: 61 64 69 6e 67 20 61 6e 64 20 6e 6f 6e 2d 65 73  ading and non-es
3aa0: 63 61 70 65 64 20 74 72 61 69 6c 69 6e 67 20 77  caped trailing w
3ab0: 68 69 74 65 73 70 61 63 65 2c 20 63 61 70 74 75  hitespace, captu
3ac0: 72 69 6e 67 20 73 6f 6d 65 20 6e 6f 6e 2d 77 68  ring some non-wh
3ad0: 69 74 65 73 70 61 63 65 20 63 68 61 72 61 63 74  itespace charact
3ae0: 65 72 73 20 70 72 65 63 65 64 69 6e 67 20 74 68  ers preceding th
3af0: 65 20 6c 61 74 74 65 72 0a 09 72 77 68 69 74 65  e latter..rwhite
3b00: 73 70 61 63 65 20 3d 20 6e 65 77 20 52 65 67 45  space = new RegE
3b10: 78 70 28 20 77 68 69 74 65 73 70 61 63 65 20 2b  xp( whitespace +
3b20: 20 22 2b 22 2c 20 22 67 22 20 29 2c 0a 09 72 74   "+", "g" ),..rt
3b30: 72 69 6d 20 3d 20 6e 65 77 20 52 65 67 45 78 70  rim = new RegExp
3b40: 28 20 22 5e 22 20 2b 20 77 68 69 74 65 73 70 61  ( "^" + whitespa
3b50: 63 65 20 2b 20 22 2b 7c 28 28 3f 3a 5e 7c 5b 5e  ce + "+|((?:^|[^
3b60: 5c 5c 5c 5c 5d 29 28 3f 3a 5c 5c 5c 5c 2e 29 2a  \\\\])(?:\\\\.)*
3b70: 29 22 20 2b 0a 09 09 77 68 69 74 65 73 70 61 63  )" +...whitespac
3b80: 65 20 2b 20 22 2b 24 22 2c 20 22 67 22 20 29 2c  e + "+$", "g" ),
3b90: 0a 0a 09 72 63 6f 6d 6d 61 20 3d 20 6e 65 77 20  ...rcomma = new 
3ba0: 52 65 67 45 78 70 28 20 22 5e 22 20 2b 20 77 68  RegExp( "^" + wh
3bb0: 69 74 65 73 70 61 63 65 20 2b 20 22 2a 2c 22 20  itespace + "*," 
3bc0: 2b 20 77 68 69 74 65 73 70 61 63 65 20 2b 20 22  + whitespace + "
3bd0: 2a 22 20 29 2c 0a 09 72 63 6f 6d 62 69 6e 61 74  *" ),..rcombinat
3be0: 6f 72 73 20 3d 20 6e 65 77 20 52 65 67 45 78 70  ors = new RegExp
3bf0: 28 20 22 5e 22 20 2b 20 77 68 69 74 65 73 70 61  ( "^" + whitespa
3c00: 63 65 20 2b 20 22 2a 28 5b 3e 2b 7e 5d 7c 22 20  ce + "*([>+~]|" 
3c10: 2b 20 77 68 69 74 65 73 70 61 63 65 20 2b 20 22  + whitespace + "
3c20: 29 22 20 2b 20 77 68 69 74 65 73 70 61 63 65 20  )" + whitespace 
3c30: 2b 0a 09 09 22 2a 22 20 29 2c 0a 09 72 64 65 73  +..."*" ),..rdes
3c40: 63 65 6e 64 20 3d 20 6e 65 77 20 52 65 67 45 78  cend = new RegEx
3c50: 70 28 20 77 68 69 74 65 73 70 61 63 65 20 2b 20  p( whitespace + 
3c60: 22 7c 3e 22 20 29 2c 0a 0a 09 72 70 73 65 75 64  "|>" ),...rpseud
3c70: 6f 20 3d 20 6e 65 77 20 52 65 67 45 78 70 28 20  o = new RegExp( 
3c80: 70 73 65 75 64 6f 73 20 29 2c 0a 09 72 69 64 65  pseudos ),..ride
3c90: 6e 74 69 66 69 65 72 20 3d 20 6e 65 77 20 52 65  ntifier = new Re
3ca0: 67 45 78 70 28 20 22 5e 22 20 2b 20 69 64 65 6e  gExp( "^" + iden
3cb0: 74 69 66 69 65 72 20 2b 20 22 24 22 20 29 2c 0a  tifier + "$" ),.
3cc0: 0a 09 6d 61 74 63 68 45 78 70 72 20 3d 20 7b 0a  ..matchExpr = {.
3cd0: 09 09 22 49 44 22 3a 20 6e 65 77 20 52 65 67 45  .."ID": new RegE
3ce0: 78 70 28 20 22 5e 23 28 22 20 2b 20 69 64 65 6e  xp( "^#(" + iden
3cf0: 74 69 66 69 65 72 20 2b 20 22 29 22 20 29 2c 0a  tifier + ")" ),.
3d00: 09 09 22 43 4c 41 53 53 22 3a 20 6e 65 77 20 52  .."CLASS": new R
3d10: 65 67 45 78 70 28 20 22 5e 5c 5c 2e 28 22 20 2b  egExp( "^\\.(" +
3d20: 20 69 64 65 6e 74 69 66 69 65 72 20 2b 20 22 29   identifier + ")
3d30: 22 20 29 2c 0a 09 09 22 54 41 47 22 3a 20 6e 65  " ),..."TAG": ne
3d40: 77 20 52 65 67 45 78 70 28 20 22 5e 28 22 20 2b  w RegExp( "^(" +
3d50: 20 69 64 65 6e 74 69 66 69 65 72 20 2b 20 22 7c   identifier + "|
3d60: 5b 2a 5d 29 22 20 29 2c 0a 09 09 22 41 54 54 52  [*])" ),..."ATTR
3d70: 22 3a 20 6e 65 77 20 52 65 67 45 78 70 28 20 22  ": new RegExp( "
3d80: 5e 22 20 2b 20 61 74 74 72 69 62 75 74 65 73 20  ^" + attributes 
3d90: 29 2c 0a 09 09 22 50 53 45 55 44 4f 22 3a 20 6e  ),..."PSEUDO": n
3da0: 65 77 20 52 65 67 45 78 70 28 20 22 5e 22 20 2b  ew RegExp( "^" +
3db0: 20 70 73 65 75 64 6f 73 20 29 2c 0a 09 09 22 43   pseudos ),..."C
3dc0: 48 49 4c 44 22 3a 20 6e 65 77 20 52 65 67 45 78  HILD": new RegEx
3dd0: 70 28 20 22 5e 3a 28 6f 6e 6c 79 7c 66 69 72 73  p( "^:(only|firs
3de0: 74 7c 6c 61 73 74 7c 6e 74 68 7c 6e 74 68 2d 6c  t|last|nth|nth-l
3df0: 61 73 74 29 2d 28 63 68 69 6c 64 7c 6f 66 2d 74  ast)-(child|of-t
3e00: 79 70 65 29 28 3f 3a 5c 5c 28 22 20 2b 0a 09 09  ype)(?:\\(" +...
3e10: 09 77 68 69 74 65 73 70 61 63 65 20 2b 20 22 2a  .whitespace + "*
3e20: 28 65 76 65 6e 7c 6f 64 64 7c 28 28 5b 2b 2d 5d  (even|odd|(([+-]
3e30: 7c 29 28 5c 5c 64 2a 29 6e 7c 29 22 20 2b 20 77  |)(\\d*)n|)" + w
3e40: 68 69 74 65 73 70 61 63 65 20 2b 20 22 2a 28 3f  hitespace + "*(?
3e50: 3a 28 5b 2b 2d 5d 7c 29 22 20 2b 0a 09 09 09 77  :([+-]|)" +....w
3e60: 68 69 74 65 73 70 61 63 65 20 2b 20 22 2a 28 5c  hitespace + "*(\
3e70: 5c 64 2b 29 7c 29 29 22 20 2b 20 77 68 69 74 65  \d+)|))" + white
3e80: 73 70 61 63 65 20 2b 20 22 2a 5c 5c 29 7c 29 22  space + "*\\)|)"
3e90: 2c 20 22 69 22 20 29 2c 0a 09 09 22 62 6f 6f 6c  , "i" ),..."bool
3ea0: 22 3a 20 6e 65 77 20 52 65 67 45 78 70 28 20 22  ": new RegExp( "
3eb0: 5e 28 3f 3a 22 20 2b 20 62 6f 6f 6c 65 61 6e 73  ^(?:" + booleans
3ec0: 20 2b 20 22 29 24 22 2c 20 22 69 22 20 29 2c 0a   + ")$", "i" ),.
3ed0: 0a 09 09 2f 2f 20 46 6f 72 20 75 73 65 20 69 6e  ...// For use in
3ee0: 20 6c 69 62 72 61 72 69 65 73 20 69 6d 70 6c 65   libraries imple
3ef0: 6d 65 6e 74 69 6e 67 20 2e 69 73 28 29 0a 09 09  menting .is()...
3f00: 2f 2f 20 57 65 20 75 73 65 20 74 68 69 73 20 66  // We use this f
3f10: 6f 72 20 50 4f 53 20 6d 61 74 63 68 69 6e 67 20  or POS matching 
3f20: 69 6e 20 60 73 65 6c 65 63 74 60 0a 09 09 22 6e  in `select`..."n
3f30: 65 65 64 73 43 6f 6e 74 65 78 74 22 3a 20 6e 65  eedsContext": ne
3f40: 77 20 52 65 67 45 78 70 28 20 22 5e 22 20 2b 20  w RegExp( "^" + 
3f50: 77 68 69 74 65 73 70 61 63 65 20 2b 0a 09 09 09  whitespace +....
3f60: 22 2a 5b 3e 2b 7e 5d 7c 3a 28 65 76 65 6e 7c 6f  "*[>+~]|:(even|o
3f70: 64 64 7c 65 71 7c 67 74 7c 6c 74 7c 6e 74 68 7c  dd|eq|gt|lt|nth|
3f80: 66 69 72 73 74 7c 6c 61 73 74 29 28 3f 3a 5c 5c  first|last)(?:\\
3f90: 28 22 20 2b 20 77 68 69 74 65 73 70 61 63 65 20  (" + whitespace 
3fa0: 2b 0a 09 09 09 22 2a 28 28 3f 3a 2d 5c 5c 64 29  +...."*((?:-\\d)
3fb0: 3f 5c 5c 64 2a 29 22 20 2b 20 77 68 69 74 65 73  ?\\d*)" + whites
3fc0: 70 61 63 65 20 2b 20 22 2a 5c 5c 29 7c 29 28 3f  pace + "*\\)|)(?
3fd0: 3d 5b 5e 2d 5d 7c 24 29 22 2c 20 22 69 22 20 29  =[^-]|$)", "i" )
3fe0: 0a 09 7d 2c 0a 0a 09 72 68 74 6d 6c 20 3d 20 2f  ..},...rhtml = /
3ff0: 48 54 4d 4c 24 2f 69 2c 0a 09 72 69 6e 70 75 74  HTML$/i,..rinput
4000: 73 20 3d 20 2f 5e 28 3f 3a 69 6e 70 75 74 7c 73  s = /^(?:input|s
4010: 65 6c 65 63 74 7c 74 65 78 74 61 72 65 61 7c 62  elect|textarea|b
4020: 75 74 74 6f 6e 29 24 2f 69 2c 0a 09 72 68 65 61  utton)$/i,..rhea
4030: 64 65 72 20 3d 20 2f 5e 68 5c 64 24 2f 69 2c 0a  der = /^h\d$/i,.
4040: 0a 09 72 6e 61 74 69 76 65 20 3d 20 2f 5e 5b 5e  ..rnative = /^[^
4050: 7b 5d 2b 5c 7b 5c 73 2a 5c 5b 6e 61 74 69 76 65  {]+\{\s*\[native
4060: 20 5c 77 2f 2c 0a 0a 09 2f 2f 20 45 61 73 69 6c   \w/,...// Easil
4070: 79 2d 70 61 72 73 65 61 62 6c 65 2f 72 65 74 72  y-parseable/retr
4080: 69 65 76 61 62 6c 65 20 49 44 20 6f 72 20 54 41  ievable ID or TA
4090: 47 20 6f 72 20 43 4c 41 53 53 20 73 65 6c 65 63  G or CLASS selec
40a0: 74 6f 72 73 0a 09 72 71 75 69 63 6b 45 78 70 72  tors..rquickExpr
40b0: 20 3d 20 2f 5e 28 3f 3a 23 28 5b 5c 77 2d 5d 2b   = /^(?:#([\w-]+
40c0: 29 7c 28 5c 77 2b 29 7c 5c 2e 28 5b 5c 77 2d 5d  )|(\w+)|\.([\w-]
40d0: 2b 29 29 24 2f 2c 0a 0a 09 72 73 69 62 6c 69 6e  +))$/,...rsiblin
40e0: 67 20 3d 20 2f 5b 2b 7e 5d 2f 2c 0a 0a 09 2f 2f  g = /[+~]/,...//
40f0: 20 43 53 53 20 65 73 63 61 70 65 73 0a 09 2f 2f   CSS escapes..//
4100: 20 68 74 74 70 3a 2f 2f 77 77 77 2e 77 33 2e 6f   http://www.w3.o
4110: 72 67 2f 54 52 2f 43 53 53 32 31 2f 73 79 6e 64  rg/TR/CSS21/synd
4120: 61 74 61 2e 68 74 6d 6c 23 65 73 63 61 70 65 64  ata.html#escaped
4130: 2d 63 68 61 72 61 63 74 65 72 73 0a 09 72 75 6e  -characters..run
4140: 65 73 63 61 70 65 20 3d 20 6e 65 77 20 52 65 67  escape = new Reg
4150: 45 78 70 28 20 22 5c 5c 5c 5c 5b 5c 5c 64 61 2d  Exp( "\\\\[\\da-
4160: 66 41 2d 46 5d 7b 31 2c 36 7d 22 20 2b 20 77 68  fA-F]{1,6}" + wh
4170: 69 74 65 73 70 61 63 65 20 2b 20 22 3f 7c 5c 5c  itespace + "?|\\
4180: 5c 5c 28 5b 5e 5c 5c 72 5c 5c 6e 5c 5c 66 5d 29  \\([^\\r\\n\\f])
4190: 22 2c 20 22 67 22 20 29 2c 0a 09 66 75 6e 65 73  ", "g" ),..funes
41a0: 63 61 70 65 20 3d 20 66 75 6e 63 74 69 6f 6e 28  cape = function(
41b0: 20 65 73 63 61 70 65 2c 20 6e 6f 6e 48 65 78 20   escape, nonHex 
41c0: 29 20 7b 0a 09 09 76 61 72 20 68 69 67 68 20 3d  ) {...var high =
41d0: 20 22 30 78 22 20 2b 20 65 73 63 61 70 65 2e 73   "0x" + escape.s
41e0: 6c 69 63 65 28 20 31 20 29 20 2d 20 30 78 31 30  lice( 1 ) - 0x10
41f0: 30 30 30 3b 0a 0a 09 09 72 65 74 75 72 6e 20 6e  000;....return n
4200: 6f 6e 48 65 78 20 3f 0a 0a 09 09 09 2f 2f 20 53  onHex ?.....// S
4210: 74 72 69 70 20 74 68 65 20 62 61 63 6b 73 6c 61  trip the backsla
4220: 73 68 20 70 72 65 66 69 78 20 66 72 6f 6d 20 61  sh prefix from a
4230: 20 6e 6f 6e 2d 68 65 78 20 65 73 63 61 70 65 20   non-hex escape 
4240: 73 65 71 75 65 6e 63 65 0a 09 09 09 6e 6f 6e 48  sequence....nonH
4250: 65 78 20 3a 0a 0a 09 09 09 2f 2f 20 52 65 70 6c  ex :.....// Repl
4260: 61 63 65 20 61 20 68 65 78 61 64 65 63 69 6d 61  ace a hexadecima
4270: 6c 20 65 73 63 61 70 65 20 73 65 71 75 65 6e 63  l escape sequenc
4280: 65 20 77 69 74 68 20 74 68 65 20 65 6e 63 6f 64  e with the encod
4290: 65 64 20 55 6e 69 63 6f 64 65 20 63 6f 64 65 20  ed Unicode code 
42a0: 70 6f 69 6e 74 0a 09 09 09 2f 2f 20 53 75 70 70  point....// Supp
42b0: 6f 72 74 3a 20 49 45 20 3c 3d 31 31 2b 0a 09 09  ort: IE <=11+...
42c0: 09 2f 2f 20 46 6f 72 20 76 61 6c 75 65 73 20 6f  .// For values o
42d0: 75 74 73 69 64 65 20 74 68 65 20 42 61 73 69 63  utside the Basic
42e0: 20 4d 75 6c 74 69 6c 69 6e 67 75 61 6c 20 50 6c   Multilingual Pl
42f0: 61 6e 65 20 28 42 4d 50 29 2c 20 6d 61 6e 75 61  ane (BMP), manua
4300: 6c 6c 79 20 63 6f 6e 73 74 72 75 63 74 20 61 0a  lly construct a.
4310: 09 09 09 2f 2f 20 73 75 72 72 6f 67 61 74 65 20  ...// surrogate 
4320: 70 61 69 72 0a 09 09 09 68 69 67 68 20 3c 20 30  pair....high < 0
4330: 20 3f 0a 09 09 09 09 53 74 72 69 6e 67 2e 66 72   ?.....String.fr
4340: 6f 6d 43 68 61 72 43 6f 64 65 28 20 68 69 67 68  omCharCode( high
4350: 20 2b 20 30 78 31 30 30 30 30 20 29 20 3a 0a 09   + 0x10000 ) :..
4360: 09 09 09 53 74 72 69 6e 67 2e 66 72 6f 6d 43 68  ...String.fromCh
4370: 61 72 43 6f 64 65 28 20 68 69 67 68 20 3e 3e 20  arCode( high >> 
4380: 31 30 20 7c 20 30 78 44 38 30 30 2c 20 68 69 67  10 | 0xD800, hig
4390: 68 20 26 20 30 78 33 46 46 20 7c 20 30 78 44 43  h & 0x3FF | 0xDC
43a0: 30 30 20 29 3b 0a 09 7d 2c 0a 0a 09 2f 2f 20 43  00 );..},...// C
43b0: 53 53 20 73 74 72 69 6e 67 2f 69 64 65 6e 74 69  SS string/identi
43c0: 66 69 65 72 20 73 65 72 69 61 6c 69 7a 61 74 69  fier serializati
43d0: 6f 6e 0a 09 2f 2f 20 68 74 74 70 73 3a 2f 2f 64  on..// https://d
43e0: 72 61 66 74 73 2e 63 73 73 77 67 2e 6f 72 67 2f  rafts.csswg.org/
43f0: 63 73 73 6f 6d 2f 23 63 6f 6d 6d 6f 6e 2d 73 65  cssom/#common-se
4400: 72 69 61 6c 69 7a 69 6e 67 2d 69 64 69 6f 6d 73  rializing-idioms
4410: 0a 09 72 63 73 73 65 73 63 61 70 65 20 3d 20 2f  ..rcssescape = /
4420: 28 5b 5c 30 2d 5c 78 31 66 5c 78 37 66 5d 7c 5e  ([\0-\x1f\x7f]|^
4430: 2d 3f 5c 64 29 7c 5e 2d 24 7c 5b 5e 5c 30 2d 5c  -?\d)|^-$|[^\0-\
4440: 78 31 66 5c 78 37 66 2d 5c 75 46 46 46 46 5c 77  x1f\x7f-\uFFFF\w
4450: 2d 5d 2f 67 2c 0a 09 66 63 73 73 65 73 63 61 70  -]/g,..fcssescap
4460: 65 20 3d 20 66 75 6e 63 74 69 6f 6e 28 20 63 68  e = function( ch
4470: 2c 20 61 73 43 6f 64 65 50 6f 69 6e 74 20 29 20  , asCodePoint ) 
4480: 7b 0a 09 09 69 66 20 28 20 61 73 43 6f 64 65 50  {...if ( asCodeP
4490: 6f 69 6e 74 20 29 20 7b 0a 0a 09 09 09 2f 2f 20  oint ) {.....// 
44a0: 55 2b 30 30 30 30 20 4e 55 4c 4c 20 62 65 63 6f  U+0000 NULL beco
44b0: 6d 65 73 20 55 2b 46 46 46 44 20 52 45 50 4c 41  mes U+FFFD REPLA
44c0: 43 45 4d 45 4e 54 20 43 48 41 52 41 43 54 45 52  CEMENT CHARACTER
44d0: 0a 09 09 09 69 66 20 28 20 63 68 20 3d 3d 3d 20  ....if ( ch === 
44e0: 22 5c 30 22 20 29 20 7b 0a 09 09 09 09 72 65 74  "\0" ) {.....ret
44f0: 75 72 6e 20 22 5c 75 46 46 46 44 22 3b 0a 09 09  urn "\uFFFD";...
4500: 09 7d 0a 0a 09 09 09 2f 2f 20 43 6f 6e 74 72 6f  .}.....// Contro
4510: 6c 20 63 68 61 72 61 63 74 65 72 73 20 61 6e 64  l characters and
4520: 20 28 64 65 70 65 6e 64 65 6e 74 20 75 70 6f 6e   (dependent upon
4530: 20 70 6f 73 69 74 69 6f 6e 29 20 6e 75 6d 62 65   position) numbe
4540: 72 73 20 67 65 74 20 65 73 63 61 70 65 64 20 61  rs get escaped a
4550: 73 20 63 6f 64 65 20 70 6f 69 6e 74 73 0a 09 09  s code points...
4560: 09 72 65 74 75 72 6e 20 63 68 2e 73 6c 69 63 65  .return ch.slice
4570: 28 20 30 2c 20 2d 31 20 29 20 2b 20 22 5c 5c 22  ( 0, -1 ) + "\\"
4580: 20 2b 0a 09 09 09 09 63 68 2e 63 68 61 72 43 6f   +.....ch.charCo
4590: 64 65 41 74 28 20 63 68 2e 6c 65 6e 67 74 68 20  deAt( ch.length 
45a0: 2d 20 31 20 29 2e 74 6f 53 74 72 69 6e 67 28 20  - 1 ).toString( 
45b0: 31 36 20 29 20 2b 20 22 20 22 3b 0a 09 09 7d 0a  16 ) + " ";...}.
45c0: 0a 09 09 2f 2f 20 4f 74 68 65 72 20 70 6f 74 65  ...// Other pote
45d0: 6e 74 69 61 6c 6c 79 2d 73 70 65 63 69 61 6c 20  ntially-special 
45e0: 41 53 43 49 49 20 63 68 61 72 61 63 74 65 72 73  ASCII characters
45f0: 20 67 65 74 20 62 61 63 6b 73 6c 61 73 68 2d 65   get backslash-e
4600: 73 63 61 70 65 64 0a 09 09 72 65 74 75 72 6e 20  scaped...return 
4610: 22 5c 5c 22 20 2b 20 63 68 3b 0a 09 7d 2c 0a 0a  "\\" + ch;..},..
4620: 09 2f 2f 20 55 73 65 64 20 66 6f 72 20 69 66 72  .// Used for ifr
4630: 61 6d 65 73 0a 09 2f 2f 20 53 65 65 20 73 65 74  ames..// See set
4640: 44 6f 63 75 6d 65 6e 74 28 29 0a 09 2f 2f 20 52  Document()..// R
4650: 65 6d 6f 76 69 6e 67 20 74 68 65 20 66 75 6e 63  emoving the func
4660: 74 69 6f 6e 20 77 72 61 70 70 65 72 20 63 61 75  tion wrapper cau
4670: 73 65 73 20 61 20 22 50 65 72 6d 69 73 73 69 6f  ses a "Permissio
4680: 6e 20 44 65 6e 69 65 64 22 0a 09 2f 2f 20 65 72  n Denied"..// er
4690: 72 6f 72 20 69 6e 20 49 45 0a 09 75 6e 6c 6f 61  ror in IE..unloa
46a0: 64 48 61 6e 64 6c 65 72 20 3d 20 66 75 6e 63 74  dHandler = funct
46b0: 69 6f 6e 28 29 20 7b 0a 09 09 73 65 74 44 6f 63  ion() {...setDoc
46c0: 75 6d 65 6e 74 28 29 3b 0a 09 7d 2c 0a 0a 09 69  ument();..},...i
46d0: 6e 44 69 73 61 62 6c 65 64 46 69 65 6c 64 73 65  nDisabledFieldse
46e0: 74 20 3d 20 61 64 64 43 6f 6d 62 69 6e 61 74 6f  t = addCombinato
46f0: 72 28 0a 09 09 66 75 6e 63 74 69 6f 6e 28 20 65  r(...function( e
4700: 6c 65 6d 20 29 20 7b 0a 09 09 09 72 65 74 75 72  lem ) {....retur
4710: 6e 20 65 6c 65 6d 2e 64 69 73 61 62 6c 65 64 20  n elem.disabled 
4720: 3d 3d 3d 20 74 72 75 65 20 26 26 20 65 6c 65 6d  === true && elem
4730: 2e 6e 6f 64 65 4e 61 6d 65 2e 74 6f 4c 6f 77 65  .nodeName.toLowe
4740: 72 43 61 73 65 28 29 20 3d 3d 3d 20 22 66 69 65  rCase() === "fie
4750: 6c 64 73 65 74 22 3b 0a 09 09 7d 2c 0a 09 09 7b  ldset";...},...{
4760: 20 64 69 72 3a 20 22 70 61 72 65 6e 74 4e 6f 64   dir: "parentNod
4770: 65 22 2c 20 6e 65 78 74 3a 20 22 6c 65 67 65 6e  e", next: "legen
4780: 64 22 20 7d 0a 09 29 3b 0a 0a 2f 2f 20 4f 70 74  d" }..);..// Opt
4790: 69 6d 69 7a 65 20 66 6f 72 20 70 75 73 68 2e 61  imize for push.a
47a0: 70 70 6c 79 28 20 5f 2c 20 4e 6f 64 65 4c 69 73  pply( _, NodeLis
47b0: 74 20 29 0a 74 72 79 20 7b 0a 09 70 75 73 68 2e  t ).try {..push.
47c0: 61 70 70 6c 79 28 0a 09 09 28 20 61 72 72 20 3d  apply(...( arr =
47d0: 20 73 6c 69 63 65 2e 63 61 6c 6c 28 20 70 72 65   slice.call( pre
47e0: 66 65 72 72 65 64 44 6f 63 2e 63 68 69 6c 64 4e  ferredDoc.childN
47f0: 6f 64 65 73 20 29 20 29 2c 0a 09 09 70 72 65 66  odes ) ),...pref
4800: 65 72 72 65 64 44 6f 63 2e 63 68 69 6c 64 4e 6f  erredDoc.childNo
4810: 64 65 73 0a 09 29 3b 0a 0a 09 2f 2f 20 53 75 70  des..);...// Sup
4820: 70 6f 72 74 3a 20 41 6e 64 72 6f 69 64 3c 34 2e  port: Android<4.
4830: 30 0a 09 2f 2f 20 44 65 74 65 63 74 20 73 69 6c  0..// Detect sil
4840: 65 6e 74 6c 79 20 66 61 69 6c 69 6e 67 20 70 75  ently failing pu
4850: 73 68 2e 61 70 70 6c 79 0a 09 2f 2f 20 65 73 6c  sh.apply..// esl
4860: 69 6e 74 2d 64 69 73 61 62 6c 65 2d 6e 65 78 74  int-disable-next
4870: 2d 6c 69 6e 65 20 6e 6f 2d 75 6e 75 73 65 64 2d  -line no-unused-
4880: 65 78 70 72 65 73 73 69 6f 6e 73 0a 09 61 72 72  expressions..arr
4890: 5b 20 70 72 65 66 65 72 72 65 64 44 6f 63 2e 63  [ preferredDoc.c
48a0: 68 69 6c 64 4e 6f 64 65 73 2e 6c 65 6e 67 74 68  hildNodes.length
48b0: 20 5d 2e 6e 6f 64 65 54 79 70 65 3b 0a 7d 20 63   ].nodeType;.} c
48c0: 61 74 63 68 20 28 20 65 20 29 20 7b 0a 09 70 75  atch ( e ) {..pu
48d0: 73 68 20 3d 20 7b 20 61 70 70 6c 79 3a 20 61 72  sh = { apply: ar
48e0: 72 2e 6c 65 6e 67 74 68 20 3f 0a 0a 09 09 2f 2f  r.length ?....//
48f0: 20 4c 65 76 65 72 61 67 65 20 73 6c 69 63 65 20   Leverage slice 
4900: 69 66 20 70 6f 73 73 69 62 6c 65 0a 09 09 66 75  if possible...fu
4910: 6e 63 74 69 6f 6e 28 20 74 61 72 67 65 74 2c 20  nction( target, 
4920: 65 6c 73 20 29 20 7b 0a 09 09 09 70 75 73 68 4e  els ) {....pushN
4930: 61 74 69 76 65 2e 61 70 70 6c 79 28 20 74 61 72  ative.apply( tar
4940: 67 65 74 2c 20 73 6c 69 63 65 2e 63 61 6c 6c 28  get, slice.call(
4950: 20 65 6c 73 20 29 20 29 3b 0a 09 09 7d 20 3a 0a   els ) );...} :.
4960: 0a 09 09 2f 2f 20 53 75 70 70 6f 72 74 3a 20 49  ...// Support: I
4970: 45 3c 39 0a 09 09 2f 2f 20 4f 74 68 65 72 77 69  E<9...// Otherwi
4980: 73 65 20 61 70 70 65 6e 64 20 64 69 72 65 63 74  se append direct
4990: 6c 79 0a 09 09 66 75 6e 63 74 69 6f 6e 28 20 74  ly...function( t
49a0: 61 72 67 65 74 2c 20 65 6c 73 20 29 20 7b 0a 09  arget, els ) {..
49b0: 09 09 76 61 72 20 6a 20 3d 20 74 61 72 67 65 74  ..var j = target
49c0: 2e 6c 65 6e 67 74 68 2c 0a 09 09 09 09 69 20 3d  .length,.....i =
49d0: 20 30 3b 0a 0a 09 09 09 2f 2f 20 43 61 6e 27 74   0;.....// Can't
49e0: 20 74 72 75 73 74 20 4e 6f 64 65 4c 69 73 74 2e   trust NodeList.
49f0: 6c 65 6e 67 74 68 0a 09 09 09 77 68 69 6c 65 20  length....while 
4a00: 28 20 28 20 74 61 72 67 65 74 5b 20 6a 2b 2b 20  ( ( target[ j++ 
4a10: 5d 20 3d 20 65 6c 73 5b 20 69 2b 2b 20 5d 20 29  ] = els[ i++ ] )
4a20: 20 29 20 7b 7d 0a 09 09 09 74 61 72 67 65 74 2e   ) {}....target.
4a30: 6c 65 6e 67 74 68 20 3d 20 6a 20 2d 20 31 3b 0a  length = j - 1;.
4a40: 09 09 7d 0a 09 7d 3b 0a 7d 0a 0a 66 75 6e 63 74  ..}..};.}..funct
4a50: 69 6f 6e 20 53 69 7a 7a 6c 65 28 20 73 65 6c 65  ion Sizzle( sele
4a60: 63 74 6f 72 2c 20 63 6f 6e 74 65 78 74 2c 20 72  ctor, context, r
4a70: 65 73 75 6c 74 73 2c 20 73 65 65 64 20 29 20 7b  esults, seed ) {
4a80: 0a 09 76 61 72 20 6d 2c 20 69 2c 20 65 6c 65 6d  ..var m, i, elem
4a90: 2c 20 6e 69 64 2c 20 6d 61 74 63 68 2c 20 67 72  , nid, match, gr
4aa0: 6f 75 70 73 2c 20 6e 65 77 53 65 6c 65 63 74 6f  oups, newSelecto
4ab0: 72 2c 0a 09 09 6e 65 77 43 6f 6e 74 65 78 74 20  r,...newContext 
4ac0: 3d 20 63 6f 6e 74 65 78 74 20 26 26 20 63 6f 6e  = context && con
4ad0: 74 65 78 74 2e 6f 77 6e 65 72 44 6f 63 75 6d 65  text.ownerDocume
4ae0: 6e 74 2c 0a 0a 09 09 2f 2f 20 6e 6f 64 65 54 79  nt,....// nodeTy
4af0: 70 65 20 64 65 66 61 75 6c 74 73 20 74 6f 20 39  pe defaults to 9
4b00: 2c 20 73 69 6e 63 65 20 63 6f 6e 74 65 78 74 20  , since context 
4b10: 64 65 66 61 75 6c 74 73 20 74 6f 20 64 6f 63 75  defaults to docu
4b20: 6d 65 6e 74 0a 09 09 6e 6f 64 65 54 79 70 65 20  ment...nodeType 
4b30: 3d 20 63 6f 6e 74 65 78 74 20 3f 20 63 6f 6e 74  = context ? cont
4b40: 65 78 74 2e 6e 6f 64 65 54 79 70 65 20 3a 20 39  ext.nodeType : 9
4b50: 3b 0a 0a 09 72 65 73 75 6c 74 73 20 3d 20 72 65  ;...results = re
4b60: 73 75 6c 74 73 20 7c 7c 20 5b 5d 3b 0a 0a 09 2f  sults || [];.../
4b70: 2f 20 52 65 74 75 72 6e 20 65 61 72 6c 79 20 66  / Return early f
4b80: 72 6f 6d 20 63 61 6c 6c 73 20 77 69 74 68 20 69  rom calls with i
4b90: 6e 76 61 6c 69 64 20 73 65 6c 65 63 74 6f 72 20  nvalid selector 
4ba0: 6f 72 20 63 6f 6e 74 65 78 74 0a 09 69 66 20 28  or context..if (
4bb0: 20 74 79 70 65 6f 66 20 73 65 6c 65 63 74 6f 72   typeof selector
4bc0: 20 21 3d 3d 20 22 73 74 72 69 6e 67 22 20 7c 7c   !== "string" ||
4bd0: 20 21 73 65 6c 65 63 74 6f 72 20 7c 7c 0a 09 09   !selector ||...
4be0: 6e 6f 64 65 54 79 70 65 20 21 3d 3d 20 31 20 26  nodeType !== 1 &
4bf0: 26 20 6e 6f 64 65 54 79 70 65 20 21 3d 3d 20 39  & nodeType !== 9
4c00: 20 26 26 20 6e 6f 64 65 54 79 70 65 20 21 3d 3d   && nodeType !==
4c10: 20 31 31 20 29 20 7b 0a 0a 09 09 72 65 74 75 72   11 ) {....retur
4c20: 6e 20 72 65 73 75 6c 74 73 3b 0a 09 7d 0a 0a 09  n results;..}...
4c30: 2f 2f 20 54 72 79 20 74 6f 20 73 68 6f 72 74 63  // Try to shortc
4c40: 75 74 20 66 69 6e 64 20 6f 70 65 72 61 74 69 6f  ut find operatio
4c50: 6e 73 20 28 61 73 20 6f 70 70 6f 73 65 64 20 74  ns (as opposed t
4c60: 6f 20 66 69 6c 74 65 72 73 29 20 69 6e 20 48 54  o filters) in HT
4c70: 4d 4c 20 64 6f 63 75 6d 65 6e 74 73 0a 09 69 66  ML documents..if
4c80: 20 28 20 21 73 65 65 64 20 29 20 7b 0a 09 09 73   ( !seed ) {...s
4c90: 65 74 44 6f 63 75 6d 65 6e 74 28 20 63 6f 6e 74  etDocument( cont
4ca0: 65 78 74 20 29 3b 0a 09 09 63 6f 6e 74 65 78 74  ext );...context
4cb0: 20 3d 20 63 6f 6e 74 65 78 74 20 7c 7c 20 64 6f   = context || do
4cc0: 63 75 6d 65 6e 74 3b 0a 0a 09 09 69 66 20 28 20  cument;....if ( 
4cd0: 64 6f 63 75 6d 65 6e 74 49 73 48 54 4d 4c 20 29  documentIsHTML )
4ce0: 20 7b 0a 0a 09 09 09 2f 2f 20 49 66 20 74 68 65   {.....// If the
4cf0: 20 73 65 6c 65 63 74 6f 72 20 69 73 20 73 75 66   selector is suf
4d00: 66 69 63 69 65 6e 74 6c 79 20 73 69 6d 70 6c 65  ficiently simple
4d10: 2c 20 74 72 79 20 75 73 69 6e 67 20 61 20 22 67  , try using a "g
4d20: 65 74 2a 42 79 2a 22 20 44 4f 4d 20 6d 65 74 68  et*By*" DOM meth
4d30: 6f 64 0a 09 09 09 2f 2f 20 28 65 78 63 65 70 74  od....// (except
4d40: 69 6e 67 20 44 6f 63 75 6d 65 6e 74 46 72 61 67  ing DocumentFrag
4d50: 6d 65 6e 74 20 63 6f 6e 74 65 78 74 2c 20 77 68  ment context, wh
4d60: 65 72 65 20 74 68 65 20 6d 65 74 68 6f 64 73 20  ere the methods 
4d70: 64 6f 6e 27 74 20 65 78 69 73 74 29 0a 09 09 09  don't exist)....
4d80: 69 66 20 28 20 6e 6f 64 65 54 79 70 65 20 21 3d  if ( nodeType !=
4d90: 3d 20 31 31 20 26 26 20 28 20 6d 61 74 63 68 20  = 11 && ( match 
4da0: 3d 20 72 71 75 69 63 6b 45 78 70 72 2e 65 78 65  = rquickExpr.exe
4db0: 63 28 20 73 65 6c 65 63 74 6f 72 20 29 20 29 20  c( selector ) ) 
4dc0: 29 20 7b 0a 0a 09 09 09 09 2f 2f 20 49 44 20 73  ) {......// ID s
4dd0: 65 6c 65 63 74 6f 72 0a 09 09 09 09 69 66 20 28  elector.....if (
4de0: 20 28 20 6d 20 3d 20 6d 61 74 63 68 5b 20 31 20   ( m = match[ 1 
4df0: 5d 20 29 20 29 20 7b 0a 0a 09 09 09 09 09 2f 2f  ] ) ) {.......//
4e00: 20 44 6f 63 75 6d 65 6e 74 20 63 6f 6e 74 65 78   Document contex
4e10: 74 0a 09 09 09 09 09 69 66 20 28 20 6e 6f 64 65  t......if ( node
4e20: 54 79 70 65 20 3d 3d 3d 20 39 20 29 20 7b 0a 09  Type === 9 ) {..
4e30: 09 09 09 09 09 69 66 20 28 20 28 20 65 6c 65 6d  .....if ( ( elem
4e40: 20 3d 20 63 6f 6e 74 65 78 74 2e 67 65 74 45 6c   = context.getEl
4e50: 65 6d 65 6e 74 42 79 49 64 28 20 6d 20 29 20 29  ementById( m ) )
4e60: 20 29 20 7b 0a 0a 09 09 09 09 09 09 09 2f 2f 20   ) {.........// 
4e70: 53 75 70 70 6f 72 74 3a 20 49 45 2c 20 4f 70 65  Support: IE, Ope
4e80: 72 61 2c 20 57 65 62 6b 69 74 0a 09 09 09 09 09  ra, Webkit......
4e90: 09 09 2f 2f 20 54 4f 44 4f 3a 20 69 64 65 6e 74  ..// TODO: ident
4ea0: 69 66 79 20 76 65 72 73 69 6f 6e 73 0a 09 09 09  ify versions....
4eb0: 09 09 09 09 2f 2f 20 67 65 74 45 6c 65 6d 65 6e  ....// getElemen
4ec0: 74 42 79 49 64 20 63 61 6e 20 6d 61 74 63 68 20  tById can match 
4ed0: 65 6c 65 6d 65 6e 74 73 20 62 79 20 6e 61 6d 65  elements by name
4ee0: 20 69 6e 73 74 65 61 64 20 6f 66 20 49 44 0a 09   instead of ID..
4ef0: 09 09 09 09 09 09 69 66 20 28 20 65 6c 65 6d 2e  ......if ( elem.
4f00: 69 64 20 3d 3d 3d 20 6d 20 29 20 7b 0a 09 09 09  id === m ) {....
4f10: 09 09 09 09 09 72 65 73 75 6c 74 73 2e 70 75 73  .....results.pus
4f20: 68 28 20 65 6c 65 6d 20 29 3b 0a 09 09 09 09 09  h( elem );......
4f30: 09 09 09 72 65 74 75 72 6e 20 72 65 73 75 6c 74  ...return result
4f40: 73 3b 0a 09 09 09 09 09 09 09 7d 0a 09 09 09 09  s;........}.....
4f50: 09 09 7d 20 65 6c 73 65 20 7b 0a 09 09 09 09 09  ..} else {......
4f60: 09 09 72 65 74 75 72 6e 20 72 65 73 75 6c 74 73  ..return results
4f70: 3b 0a 09 09 09 09 09 09 7d 0a 0a 09 09 09 09 09  ;.......}.......
4f80: 2f 2f 20 45 6c 65 6d 65 6e 74 20 63 6f 6e 74 65  // Element conte
4f90: 78 74 0a 09 09 09 09 09 7d 20 65 6c 73 65 20 7b  xt......} else {
4fa0: 0a 0a 09 09 09 09 09 09 2f 2f 20 53 75 70 70 6f  ........// Suppo
4fb0: 72 74 3a 20 49 45 2c 20 4f 70 65 72 61 2c 20 57  rt: IE, Opera, W
4fc0: 65 62 6b 69 74 0a 09 09 09 09 09 09 2f 2f 20 54  ebkit.......// T
4fd0: 4f 44 4f 3a 20 69 64 65 6e 74 69 66 79 20 76 65  ODO: identify ve
4fe0: 72 73 69 6f 6e 73 0a 09 09 09 09 09 09 2f 2f 20  rsions.......// 
4ff0: 67 65 74 45 6c 65 6d 65 6e 74 42 79 49 64 20 63  getElementById c
5000: 61 6e 20 6d 61 74 63 68 20 65 6c 65 6d 65 6e 74  an match element
5010: 73 20 62 79 20 6e 61 6d 65 20 69 6e 73 74 65 61  s by name instea
5020: 64 20 6f 66 20 49 44 0a 09 09 09 09 09 09 69 66  d of ID.......if
5030: 20 28 20 6e 65 77 43 6f 6e 74 65 78 74 20 26 26   ( newContext &&
5040: 20 28 20 65 6c 65 6d 20 3d 20 6e 65 77 43 6f 6e   ( elem = newCon
5050: 74 65 78 74 2e 67 65 74 45 6c 65 6d 65 6e 74 42  text.getElementB
5060: 79 49 64 28 20 6d 20 29 20 29 20 26 26 0a 09 09  yId( m ) ) &&...
5070: 09 09 09 09 09 63 6f 6e 74 61 69 6e 73 28 20 63  .....contains( c
5080: 6f 6e 74 65 78 74 2c 20 65 6c 65 6d 20 29 20 26  ontext, elem ) &
5090: 26 0a 09 09 09 09 09 09 09 65 6c 65 6d 2e 69 64  &........elem.id
50a0: 20 3d 3d 3d 20 6d 20 29 20 7b 0a 0a 09 09 09 09   === m ) {......
50b0: 09 09 09 72 65 73 75 6c 74 73 2e 70 75 73 68 28  ...results.push(
50c0: 20 65 6c 65 6d 20 29 3b 0a 09 09 09 09 09 09 09   elem );........
50d0: 72 65 74 75 72 6e 20 72 65 73 75 6c 74 73 3b 0a  return results;.
50e0: 09 09 09 09 09 09 7d 0a 09 09 09 09 09 7d 0a 0a  ......}......}..
50f0: 09 09 09 09 2f 2f 20 54 79 70 65 20 73 65 6c 65  ....// Type sele
5100: 63 74 6f 72 0a 09 09 09 09 7d 20 65 6c 73 65 20  ctor.....} else 
5110: 69 66 20 28 20 6d 61 74 63 68 5b 20 32 20 5d 20  if ( match[ 2 ] 
5120: 29 20 7b 0a 09 09 09 09 09 70 75 73 68 2e 61 70  ) {......push.ap
5130: 70 6c 79 28 20 72 65 73 75 6c 74 73 2c 20 63 6f  ply( results, co
5140: 6e 74 65 78 74 2e 67 65 74 45 6c 65 6d 65 6e 74  ntext.getElement
5150: 73 42 79 54 61 67 4e 61 6d 65 28 20 73 65 6c 65  sByTagName( sele
5160: 63 74 6f 72 20 29 20 29 3b 0a 09 09 09 09 09 72  ctor ) );......r
5170: 65 74 75 72 6e 20 72 65 73 75 6c 74 73 3b 0a 0a  eturn results;..
5180: 09 09 09 09 2f 2f 20 43 6c 61 73 73 20 73 65 6c  ....// Class sel
5190: 65 63 74 6f 72 0a 09 09 09 09 7d 20 65 6c 73 65  ector.....} else
51a0: 20 69 66 20 28 20 28 20 6d 20 3d 20 6d 61 74 63   if ( ( m = matc
51b0: 68 5b 20 33 20 5d 20 29 20 26 26 20 73 75 70 70  h[ 3 ] ) && supp
51c0: 6f 72 74 2e 67 65 74 45 6c 65 6d 65 6e 74 73 42  ort.getElementsB
51d0: 79 43 6c 61 73 73 4e 61 6d 65 20 26 26 0a 09 09  yClassName &&...
51e0: 09 09 09 63 6f 6e 74 65 78 74 2e 67 65 74 45 6c  ...context.getEl
51f0: 65 6d 65 6e 74 73 42 79 43 6c 61 73 73 4e 61 6d  ementsByClassNam
5200: 65 20 29 20 7b 0a 0a 09 09 09 09 09 70 75 73 68  e ) {.......push
5210: 2e 61 70 70 6c 79 28 20 72 65 73 75 6c 74 73 2c  .apply( results,
5220: 20 63 6f 6e 74 65 78 74 2e 67 65 74 45 6c 65 6d   context.getElem
5230: 65 6e 74 73 42 79 43 6c 61 73 73 4e 61 6d 65 28  entsByClassName(
5240: 20 6d 20 29 20 29 3b 0a 09 09 09 09 09 72 65 74   m ) );......ret
5250: 75 72 6e 20 72 65 73 75 6c 74 73 3b 0a 09 09 09  urn results;....
5260: 09 7d 0a 09 09 09 7d 0a 0a 09 09 09 2f 2f 20 54  .}....}.....// T
5270: 61 6b 65 20 61 64 76 61 6e 74 61 67 65 20 6f 66  ake advantage of
5280: 20 71 75 65 72 79 53 65 6c 65 63 74 6f 72 41 6c   querySelectorAl
5290: 6c 0a 09 09 09 69 66 20 28 20 73 75 70 70 6f 72  l....if ( suppor
52a0: 74 2e 71 73 61 20 26 26 0a 09 09 09 09 21 6e 6f  t.qsa &&.....!no
52b0: 6e 6e 61 74 69 76 65 53 65 6c 65 63 74 6f 72 43  nnativeSelectorC
52c0: 61 63 68 65 5b 20 73 65 6c 65 63 74 6f 72 20 2b  ache[ selector +
52d0: 20 22 20 22 20 5d 20 26 26 0a 09 09 09 09 28 20   " " ] &&.....( 
52e0: 21 72 62 75 67 67 79 51 53 41 20 7c 7c 20 21 72  !rbuggyQSA || !r
52f0: 62 75 67 67 79 51 53 41 2e 74 65 73 74 28 20 73  buggyQSA.test( s
5300: 65 6c 65 63 74 6f 72 20 29 20 29 20 26 26 0a 0a  elector ) ) &&..
5310: 09 09 09 09 2f 2f 20 53 75 70 70 6f 72 74 3a 20  ....// Support: 
5320: 49 45 20 38 20 6f 6e 6c 79 0a 09 09 09 09 2f 2f  IE 8 only.....//
5330: 20 45 78 63 6c 75 64 65 20 6f 62 6a 65 63 74 20   Exclude object 
5340: 65 6c 65 6d 65 6e 74 73 0a 09 09 09 09 28 20 6e  elements.....( n
5350: 6f 64 65 54 79 70 65 20 21 3d 3d 20 31 20 7c 7c  odeType !== 1 ||
5360: 20 63 6f 6e 74 65 78 74 2e 6e 6f 64 65 4e 61 6d   context.nodeNam
5370: 65 2e 74 6f 4c 6f 77 65 72 43 61 73 65 28 29 20  e.toLowerCase() 
5380: 21 3d 3d 20 22 6f 62 6a 65 63 74 22 20 29 20 29  !== "object" ) )
5390: 20 7b 0a 0a 09 09 09 09 6e 65 77 53 65 6c 65 63   {......newSelec
53a0: 74 6f 72 20 3d 20 73 65 6c 65 63 74 6f 72 3b 0a  tor = selector;.
53b0: 09 09 09 09 6e 65 77 43 6f 6e 74 65 78 74 20 3d  ....newContext =
53c0: 20 63 6f 6e 74 65 78 74 3b 0a 0a 09 09 09 09 2f   context;....../
53d0: 2f 20 71 53 41 20 63 6f 6e 73 69 64 65 72 73 20  / qSA considers 
53e0: 65 6c 65 6d 65 6e 74 73 20 6f 75 74 73 69 64 65  elements outside
53f0: 20 61 20 73 63 6f 70 69 6e 67 20 72 6f 6f 74 20   a scoping root 
5400: 77 68 65 6e 20 65 76 61 6c 75 61 74 69 6e 67 20  when evaluating 
5410: 63 68 69 6c 64 20 6f 72 0a 09 09 09 09 2f 2f 20  child or.....// 
5420: 64 65 73 63 65 6e 64 61 6e 74 20 63 6f 6d 62 69  descendant combi
5430: 6e 61 74 6f 72 73 2c 20 77 68 69 63 68 20 69 73  nators, which is
5440: 20 6e 6f 74 20 77 68 61 74 20 77 65 20 77 61 6e   not what we wan
5450: 74 2e 0a 09 09 09 09 2f 2f 20 49 6e 20 73 75 63  t......// In suc
5460: 68 20 63 61 73 65 73 2c 20 77 65 20 77 6f 72 6b  h cases, we work
5470: 20 61 72 6f 75 6e 64 20 74 68 65 20 62 65 68 61   around the beha
5480: 76 69 6f 72 20 62 79 20 70 72 65 66 69 78 69 6e  vior by prefixin
5490: 67 20 65 76 65 72 79 20 73 65 6c 65 63 74 6f 72  g every selector
54a0: 20 69 6e 20 74 68 65 0a 09 09 09 09 2f 2f 20 6c   in the.....// l
54b0: 69 73 74 20 77 69 74 68 20 61 6e 20 49 44 20 73  ist with an ID s
54c0: 65 6c 65 63 74 6f 72 20 72 65 66 65 72 65 6e 63  elector referenc
54d0: 69 6e 67 20 74 68 65 20 73 63 6f 70 65 20 63 6f  ing the scope co
54e0: 6e 74 65 78 74 2e 0a 09 09 09 09 2f 2f 20 54 68  ntext......// Th
54f0: 65 20 74 65 63 68 6e 69 71 75 65 20 68 61 73 20  e technique has 
5500: 74 6f 20 62 65 20 75 73 65 64 20 61 73 20 77 65  to be used as we
5510: 6c 6c 20 77 68 65 6e 20 61 20 6c 65 61 64 69 6e  ll when a leadin
5520: 67 20 63 6f 6d 62 69 6e 61 74 6f 72 20 69 73 20  g combinator is 
5530: 75 73 65 64 0a 09 09 09 09 2f 2f 20 61 73 20 73  used.....// as s
5540: 75 63 68 20 73 65 6c 65 63 74 6f 72 73 20 61 72  uch selectors ar
5550: 65 20 6e 6f 74 20 72 65 63 6f 67 6e 69 7a 65 64  e not recognized
5560: 20 62 79 20 71 75 65 72 79 53 65 6c 65 63 74 6f   by querySelecto
5570: 72 41 6c 6c 2e 0a 09 09 09 09 2f 2f 20 54 68 61  rAll......// Tha
5580: 6e 6b 73 20 74 6f 20 41 6e 64 72 65 77 20 44 75  nks to Andrew Du
5590: 70 6f 6e 74 20 66 6f 72 20 74 68 69 73 20 74 65  pont for this te
55a0: 63 68 6e 69 71 75 65 2e 0a 09 09 09 09 69 66 20  chnique......if 
55b0: 28 20 6e 6f 64 65 54 79 70 65 20 3d 3d 3d 20 31  ( nodeType === 1
55c0: 20 26 26 0a 09 09 09 09 09 28 20 72 64 65 73 63   &&......( rdesc
55d0: 65 6e 64 2e 74 65 73 74 28 20 73 65 6c 65 63 74  end.test( select
55e0: 6f 72 20 29 20 7c 7c 20 72 63 6f 6d 62 69 6e 61  or ) || rcombina
55f0: 74 6f 72 73 2e 74 65 73 74 28 20 73 65 6c 65 63  tors.test( selec
5600: 74 6f 72 20 29 20 29 20 29 20 7b 0a 0a 09 09 09  tor ) ) ) {.....
5610: 09 09 2f 2f 20 45 78 70 61 6e 64 20 63 6f 6e 74  ..// Expand cont
5620: 65 78 74 20 66 6f 72 20 73 69 62 6c 69 6e 67 20  ext for sibling 
5630: 73 65 6c 65 63 74 6f 72 73 0a 09 09 09 09 09 6e  selectors......n
5640: 65 77 43 6f 6e 74 65 78 74 20 3d 20 72 73 69 62  ewContext = rsib
5650: 6c 69 6e 67 2e 74 65 73 74 28 20 73 65 6c 65 63  ling.test( selec
5660: 74 6f 72 20 29 20 26 26 20 74 65 73 74 43 6f 6e  tor ) && testCon
5670: 74 65 78 74 28 20 63 6f 6e 74 65 78 74 2e 70 61  text( context.pa
5680: 72 65 6e 74 4e 6f 64 65 20 29 20 7c 7c 0a 09 09  rentNode ) ||...
5690: 09 09 09 09 63 6f 6e 74 65 78 74 3b 0a 0a 09 09  ....context;....
56a0: 09 09 09 2f 2f 20 57 65 20 63 61 6e 20 75 73 65  ...// We can use
56b0: 20 3a 73 63 6f 70 65 20 69 6e 73 74 65 61 64 20   :scope instead 
56c0: 6f 66 20 74 68 65 20 49 44 20 68 61 63 6b 20 69  of the ID hack i
56d0: 66 20 74 68 65 20 62 72 6f 77 73 65 72 0a 09 09  f the browser...
56e0: 09 09 09 2f 2f 20 73 75 70 70 6f 72 74 73 20 69  ...// supports i
56f0: 74 20 26 20 69 66 20 77 65 27 72 65 20 6e 6f 74  t & if we're not
5700: 20 63 68 61 6e 67 69 6e 67 20 74 68 65 20 63 6f   changing the co
5710: 6e 74 65 78 74 2e 0a 09 09 09 09 09 69 66 20 28  ntext.......if (
5720: 20 6e 65 77 43 6f 6e 74 65 78 74 20 21 3d 3d 20   newContext !== 
5730: 63 6f 6e 74 65 78 74 20 7c 7c 20 21 73 75 70 70  context || !supp
5740: 6f 72 74 2e 73 63 6f 70 65 20 29 20 7b 0a 0a 09  ort.scope ) {...
5750: 09 09 09 09 09 2f 2f 20 43 61 70 74 75 72 65 20  .....// Capture 
5760: 74 68 65 20 63 6f 6e 74 65 78 74 20 49 44 2c 20  the context ID, 
5770: 73 65 74 74 69 6e 67 20 69 74 20 66 69 72 73 74  setting it first
5780: 20 69 66 20 6e 65 63 65 73 73 61 72 79 0a 09 09   if necessary...
5790: 09 09 09 09 69 66 20 28 20 28 20 6e 69 64 20 3d  ....if ( ( nid =
57a0: 20 63 6f 6e 74 65 78 74 2e 67 65 74 41 74 74 72   context.getAttr
57b0: 69 62 75 74 65 28 20 22 69 64 22 20 29 20 29 20  ibute( "id" ) ) 
57c0: 29 20 7b 0a 09 09 09 09 09 09 09 6e 69 64 20 3d  ) {........nid =
57d0: 20 6e 69 64 2e 72 65 70 6c 61 63 65 28 20 72 63   nid.replace( rc
57e0: 73 73 65 73 63 61 70 65 2c 20 66 63 73 73 65 73  ssescape, fcsses
57f0: 63 61 70 65 20 29 3b 0a 09 09 09 09 09 09 7d 20  cape );.......} 
5800: 65 6c 73 65 20 7b 0a 09 09 09 09 09 09 09 63 6f  else {........co
5810: 6e 74 65 78 74 2e 73 65 74 41 74 74 72 69 62 75  ntext.setAttribu
5820: 74 65 28 20 22 69 64 22 2c 20 28 20 6e 69 64 20  te( "id", ( nid 
5830: 3d 20 65 78 70 61 6e 64 6f 20 29 20 29 3b 0a 09  = expando ) );..
5840: 09 09 09 09 09 7d 0a 09 09 09 09 09 7d 0a 0a 09  .....}......}...
5850: 09 09 09 09 2f 2f 20 50 72 65 66 69 78 20 65 76  ....// Prefix ev
5860: 65 72 79 20 73 65 6c 65 63 74 6f 72 20 69 6e 20  ery selector in 
5870: 74 68 65 20 6c 69 73 74 0a 09 09 09 09 09 67 72  the list......gr
5880: 6f 75 70 73 20 3d 20 74 6f 6b 65 6e 69 7a 65 28  oups = tokenize(
5890: 20 73 65 6c 65 63 74 6f 72 20 29 3b 0a 09 09 09   selector );....
58a0: 09 09 69 20 3d 20 67 72 6f 75 70 73 2e 6c 65 6e  ..i = groups.len
58b0: 67 74 68 3b 0a 09 09 09 09 09 77 68 69 6c 65 20  gth;......while 
58c0: 28 20 69 2d 2d 20 29 20 7b 0a 09 09 09 09 09 09  ( i-- ) {.......
58d0: 67 72 6f 75 70 73 5b 20 69 20 5d 20 3d 20 28 20  groups[ i ] = ( 
58e0: 6e 69 64 20 3f 20 22 23 22 20 2b 20 6e 69 64 20  nid ? "#" + nid 
58f0: 3a 20 22 3a 73 63 6f 70 65 22 20 29 20 2b 20 22  : ":scope" ) + "
5900: 20 22 20 2b 0a 09 09 09 09 09 09 09 74 6f 53 65   " +........toSe
5910: 6c 65 63 74 6f 72 28 20 67 72 6f 75 70 73 5b 20  lector( groups[ 
5920: 69 20 5d 20 29 3b 0a 09 09 09 09 09 7d 0a 09 09  i ] );......}...
5930: 09 09 09 6e 65 77 53 65 6c 65 63 74 6f 72 20 3d  ...newSelector =
5940: 20 67 72 6f 75 70 73 2e 6a 6f 69 6e 28 20 22 2c   groups.join( ",
5950: 22 20 29 3b 0a 09 09 09 09 7d 0a 0a 09 09 09 09  " );.....}......
5960: 74 72 79 20 7b 0a 09 09 09 09 09 70 75 73 68 2e  try {......push.
5970: 61 70 70 6c 79 28 20 72 65 73 75 6c 74 73 2c 0a  apply( results,.
5980: 09 09 09 09 09 09 6e 65 77 43 6f 6e 74 65 78 74  ......newContext
5990: 2e 71 75 65 72 79 53 65 6c 65 63 74 6f 72 41 6c  .querySelectorAl
59a0: 6c 28 20 6e 65 77 53 65 6c 65 63 74 6f 72 20 29  l( newSelector )
59b0: 0a 09 09 09 09 09 29 3b 0a 09 09 09 09 09 72 65  ......);......re
59c0: 74 75 72 6e 20 72 65 73 75 6c 74 73 3b 0a 09 09  turn results;...
59d0: 09 09 7d 20 63 61 74 63 68 20 28 20 71 73 61 45  ..} catch ( qsaE
59e0: 72 72 6f 72 20 29 20 7b 0a 09 09 09 09 09 6e 6f  rror ) {......no
59f0: 6e 6e 61 74 69 76 65 53 65 6c 65 63 74 6f 72 43  nnativeSelectorC
5a00: 61 63 68 65 28 20 73 65 6c 65 63 74 6f 72 2c 20  ache( selector, 
5a10: 74 72 75 65 20 29 3b 0a 09 09 09 09 7d 20 66 69  true );.....} fi
5a20: 6e 61 6c 6c 79 20 7b 0a 09 09 09 09 09 69 66 20  nally {......if 
5a30: 28 20 6e 69 64 20 3d 3d 3d 20 65 78 70 61 6e 64  ( nid === expand
5a40: 6f 20 29 20 7b 0a 09 09 09 09 09 09 63 6f 6e 74  o ) {.......cont
5a50: 65 78 74 2e 72 65 6d 6f 76 65 41 74 74 72 69 62  ext.removeAttrib
5a60: 75 74 65 28 20 22 69 64 22 20 29 3b 0a 09 09 09  ute( "id" );....
5a70: 09 09 7d 0a 09 09 09 09 7d 0a 09 09 09 7d 0a 09  ..}.....}....}..
5a80: 09 7d 0a 09 7d 0a 0a 09 2f 2f 20 41 6c 6c 20 6f  .}..}...// All o
5a90: 74 68 65 72 73 0a 09 72 65 74 75 72 6e 20 73 65  thers..return se
5aa0: 6c 65 63 74 28 20 73 65 6c 65 63 74 6f 72 2e 72  lect( selector.r
5ab0: 65 70 6c 61 63 65 28 20 72 74 72 69 6d 2c 20 22  eplace( rtrim, "
5ac0: 24 31 22 20 29 2c 20 63 6f 6e 74 65 78 74 2c 20  $1" ), context, 
5ad0: 72 65 73 75 6c 74 73 2c 20 73 65 65 64 20 29 3b  results, seed );
5ae0: 0a 7d 0a 0a 2f 2a 2a 0a 20 2a 20 43 72 65 61 74  .}../**. * Creat
5af0: 65 20 6b 65 79 2d 76 61 6c 75 65 20 63 61 63 68  e key-value cach
5b00: 65 73 20 6f 66 20 6c 69 6d 69 74 65 64 20 73 69  es of limited si
5b10: 7a 65 0a 20 2a 20 40 72 65 74 75 72 6e 73 20 7b  ze. * @returns {
5b20: 66 75 6e 63 74 69 6f 6e 28 73 74 72 69 6e 67 2c  function(string,
5b30: 20 6f 62 6a 65 63 74 29 7d 20 52 65 74 75 72 6e   object)} Return
5b40: 73 20 74 68 65 20 4f 62 6a 65 63 74 20 64 61 74  s the Object dat
5b50: 61 20 61 66 74 65 72 20 73 74 6f 72 69 6e 67 20  a after storing 
5b60: 69 74 20 6f 6e 20 69 74 73 65 6c 66 20 77 69 74  it on itself wit
5b70: 68 0a 20 2a 09 70 72 6f 70 65 72 74 79 20 6e 61  h. *.property na
5b80: 6d 65 20 74 68 65 20 28 73 70 61 63 65 2d 73 75  me the (space-su
5b90: 66 66 69 78 65 64 29 20 73 74 72 69 6e 67 20 61  ffixed) string a
5ba0: 6e 64 20 28 69 66 20 74 68 65 20 63 61 63 68 65  nd (if the cache
5bb0: 20 69 73 20 6c 61 72 67 65 72 20 74 68 61 6e 20   is larger than 
5bc0: 45 78 70 72 2e 63 61 63 68 65 4c 65 6e 67 74 68  Expr.cacheLength
5bd0: 29 0a 20 2a 09 64 65 6c 65 74 69 6e 67 20 74 68  ). *.deleting th
5be0: 65 20 6f 6c 64 65 73 74 20 65 6e 74 72 79 0a 20  e oldest entry. 
5bf0: 2a 2f 0a 66 75 6e 63 74 69 6f 6e 20 63 72 65 61  */.function crea
5c00: 74 65 43 61 63 68 65 28 29 20 7b 0a 09 76 61 72  teCache() {..var
5c10: 20 6b 65 79 73 20 3d 20 5b 5d 3b 0a 0a 09 66 75   keys = [];...fu
5c20: 6e 63 74 69 6f 6e 20 63 61 63 68 65 28 20 6b 65  nction cache( ke
5c30: 79 2c 20 76 61 6c 75 65 20 29 20 7b 0a 0a 09 09  y, value ) {....
5c40: 2f 2f 20 55 73 65 20 28 6b 65 79 20 2b 20 22 20  // Use (key + " 
5c50: 22 29 20 74 6f 20 61 76 6f 69 64 20 63 6f 6c 6c  ") to avoid coll
5c60: 69 73 69 6f 6e 20 77 69 74 68 20 6e 61 74 69 76  ision with nativ
5c70: 65 20 70 72 6f 74 6f 74 79 70 65 20 70 72 6f 70  e prototype prop
5c80: 65 72 74 69 65 73 20 28 73 65 65 20 49 73 73 75  erties (see Issu
5c90: 65 20 23 31 35 37 29 0a 09 09 69 66 20 28 20 6b  e #157)...if ( k
5ca0: 65 79 73 2e 70 75 73 68 28 20 6b 65 79 20 2b 20  eys.push( key + 
5cb0: 22 20 22 20 29 20 3e 20 45 78 70 72 2e 63 61 63  " " ) > Expr.cac
5cc0: 68 65 4c 65 6e 67 74 68 20 29 20 7b 0a 0a 09 09  heLength ) {....
5cd0: 09 2f 2f 20 4f 6e 6c 79 20 6b 65 65 70 20 74 68  .// Only keep th
5ce0: 65 20 6d 6f 73 74 20 72 65 63 65 6e 74 20 65 6e  e most recent en
5cf0: 74 72 69 65 73 0a 09 09 09 64 65 6c 65 74 65 20  tries....delete 
5d00: 63 61 63 68 65 5b 20 6b 65 79 73 2e 73 68 69 66  cache[ keys.shif
5d10: 74 28 29 20 5d 3b 0a 09 09 7d 0a 09 09 72 65 74  t() ];...}...ret
5d20: 75 72 6e 20 28 20 63 61 63 68 65 5b 20 6b 65 79  urn ( cache[ key
5d30: 20 2b 20 22 20 22 20 5d 20 3d 20 76 61 6c 75 65   + " " ] = value
5d40: 20 29 3b 0a 09 7d 0a 09 72 65 74 75 72 6e 20 63   );..}..return c
5d50: 61 63 68 65 3b 0a 7d 0a 0a 2f 2a 2a 0a 20 2a 20  ache;.}../**. * 
5d60: 4d 61 72 6b 20 61 20 66 75 6e 63 74 69 6f 6e 20  Mark a function 
5d70: 66 6f 72 20 73 70 65 63 69 61 6c 20 75 73 65 20  for special use 
5d80: 62 79 20 53 69 7a 7a 6c 65 0a 20 2a 20 40 70 61  by Sizzle. * @pa
5d90: 72 61 6d 20 7b 46 75 6e 63 74 69 6f 6e 7d 20 66  ram {Function} f
5da0: 6e 20 54 68 65 20 66 75 6e 63 74 69 6f 6e 20 74  n The function t
5db0: 6f 20 6d 61 72 6b 0a 20 2a 2f 0a 66 75 6e 63 74  o mark. */.funct
5dc0: 69 6f 6e 20 6d 61 72 6b 46 75 6e 63 74 69 6f 6e  ion markFunction
5dd0: 28 20 66 6e 20 29 20 7b 0a 09 66 6e 5b 20 65 78  ( fn ) {..fn[ ex
5de0: 70 61 6e 64 6f 20 5d 20 3d 20 74 72 75 65 3b 0a  pando ] = true;.
5df0: 09 72 65 74 75 72 6e 20 66 6e 3b 0a 7d 0a 0a 2f  .return fn;.}../
5e00: 2a 2a 0a 20 2a 20 53 75 70 70 6f 72 74 20 74 65  **. * Support te
5e10: 73 74 69 6e 67 20 75 73 69 6e 67 20 61 6e 20 65  sting using an e
5e20: 6c 65 6d 65 6e 74 0a 20 2a 20 40 70 61 72 61 6d  lement. * @param
5e30: 20 7b 46 75 6e 63 74 69 6f 6e 7d 20 66 6e 20 50   {Function} fn P
5e40: 61 73 73 65 64 20 74 68 65 20 63 72 65 61 74 65  assed the create
5e50: 64 20 65 6c 65 6d 65 6e 74 20 61 6e 64 20 72 65  d element and re
5e60: 74 75 72 6e 73 20 61 20 62 6f 6f 6c 65 61 6e 20  turns a boolean 
5e70: 72 65 73 75 6c 74 0a 20 2a 2f 0a 66 75 6e 63 74  result. */.funct
5e80: 69 6f 6e 20 61 73 73 65 72 74 28 20 66 6e 20 29  ion assert( fn )
5e90: 20 7b 0a 09 76 61 72 20 65 6c 20 3d 20 64 6f 63   {..var el = doc
5ea0: 75 6d 65 6e 74 2e 63 72 65 61 74 65 45 6c 65 6d  ument.createElem
5eb0: 65 6e 74 28 20 22 66 69 65 6c 64 73 65 74 22 20  ent( "fieldset" 
5ec0: 29 3b 0a 0a 09 74 72 79 20 7b 0a 09 09 72 65 74  );...try {...ret
5ed0: 75 72 6e 20 21 21 66 6e 28 20 65 6c 20 29 3b 0a  urn !!fn( el );.
5ee0: 09 7d 20 63 61 74 63 68 20 28 20 65 20 29 20 7b  .} catch ( e ) {
5ef0: 0a 09 09 72 65 74 75 72 6e 20 66 61 6c 73 65 3b  ...return false;
5f00: 0a 09 7d 20 66 69 6e 61 6c 6c 79 20 7b 0a 0a 09  ..} finally {...
5f10: 09 2f 2f 20 52 65 6d 6f 76 65 20 66 72 6f 6d 20  .// Remove from 
5f20: 69 74 73 20 70 61 72 65 6e 74 20 62 79 20 64 65  its parent by de
5f30: 66 61 75 6c 74 0a 09 09 69 66 20 28 20 65 6c 2e  fault...if ( el.
5f40: 70 61 72 65 6e 74 4e 6f 64 65 20 29 20 7b 0a 09  parentNode ) {..
5f50: 09 09 65 6c 2e 70 61 72 65 6e 74 4e 6f 64 65 2e  ..el.parentNode.
5f60: 72 65 6d 6f 76 65 43 68 69 6c 64 28 20 65 6c 20  removeChild( el 
5f70: 29 3b 0a 09 09 7d 0a 0a 09 09 2f 2f 20 72 65 6c  );...}....// rel
5f80: 65 61 73 65 20 6d 65 6d 6f 72 79 20 69 6e 20 49  ease memory in I
5f90: 45 0a 09 09 65 6c 20 3d 20 6e 75 6c 6c 3b 0a 09  E...el = null;..
5fa0: 7d 0a 7d 0a 0a 2f 2a 2a 0a 20 2a 20 41 64 64 73  }.}../**. * Adds
5fb0: 20 74 68 65 20 73 61 6d 65 20 68 61 6e 64 6c 65   the same handle
5fc0: 72 20 66 6f 72 20 61 6c 6c 20 6f 66 20 74 68 65  r for all of the
5fd0: 20 73 70 65 63 69 66 69 65 64 20 61 74 74 72 73   specified attrs
5fe0: 0a 20 2a 20 40 70 61 72 61 6d 20 7b 53 74 72 69  . * @param {Stri
5ff0: 6e 67 7d 20 61 74 74 72 73 20 50 69 70 65 2d 73  ng} attrs Pipe-s
6000: 65 70 61 72 61 74 65 64 20 6c 69 73 74 20 6f 66  eparated list of
6010: 20 61 74 74 72 69 62 75 74 65 73 0a 20 2a 20 40   attributes. * @
6020: 70 61 72 61 6d 20 7b 46 75 6e 63 74 69 6f 6e 7d  param {Function}
6030: 20 68 61 6e 64 6c 65 72 20 54 68 65 20 6d 65 74   handler The met
6040: 68 6f 64 20 74 68 61 74 20 77 69 6c 6c 20 62 65  hod that will be
6050: 20 61 70 70 6c 69 65 64 0a 20 2a 2f 0a 66 75 6e   applied. */.fun
6060: 63 74 69 6f 6e 20 61 64 64 48 61 6e 64 6c 65 28  ction addHandle(
6070: 20 61 74 74 72 73 2c 20 68 61 6e 64 6c 65 72 20   attrs, handler 
6080: 29 20 7b 0a 09 76 61 72 20 61 72 72 20 3d 20 61  ) {..var arr = a
6090: 74 74 72 73 2e 73 70 6c 69 74 28 20 22 7c 22 20  ttrs.split( "|" 
60a0: 29 2c 0a 09 09 69 20 3d 20 61 72 72 2e 6c 65 6e  ),...i = arr.len
60b0: 67 74 68 3b 0a 0a 09 77 68 69 6c 65 20 28 20 69  gth;...while ( i
60c0: 2d 2d 20 29 20 7b 0a 09 09 45 78 70 72 2e 61 74  -- ) {...Expr.at
60d0: 74 72 48 61 6e 64 6c 65 5b 20 61 72 72 5b 20 69  trHandle[ arr[ i
60e0: 20 5d 20 5d 20 3d 20 68 61 6e 64 6c 65 72 3b 0a   ] ] = handler;.
60f0: 09 7d 0a 7d 0a 0a 2f 2a 2a 0a 20 2a 20 43 68 65  .}.}../**. * Che
6100: 63 6b 73 20 64 6f 63 75 6d 65 6e 74 20 6f 72 64  cks document ord
6110: 65 72 20 6f 66 20 74 77 6f 20 73 69 62 6c 69 6e  er of two siblin
6120: 67 73 0a 20 2a 20 40 70 61 72 61 6d 20 7b 45 6c  gs. * @param {El
6130: 65 6d 65 6e 74 7d 20 61 0a 20 2a 20 40 70 61 72  ement} a. * @par
6140: 61 6d 20 7b 45 6c 65 6d 65 6e 74 7d 20 62 0a 20  am {Element} b. 
6150: 2a 20 40 72 65 74 75 72 6e 73 20 7b 4e 75 6d 62  * @returns {Numb
6160: 65 72 7d 20 52 65 74 75 72 6e 73 20 6c 65 73 73  er} Returns less
6170: 20 74 68 61 6e 20 30 20 69 66 20 61 20 70 72 65   than 0 if a pre
6180: 63 65 64 65 73 20 62 2c 20 67 72 65 61 74 65 72  cedes b, greater
6190: 20 74 68 61 6e 20 30 20 69 66 20 61 20 66 6f 6c   than 0 if a fol
61a0: 6c 6f 77 73 20 62 0a 20 2a 2f 0a 66 75 6e 63 74  lows b. */.funct
61b0: 69 6f 6e 20 73 69 62 6c 69 6e 67 43 68 65 63 6b  ion siblingCheck
61c0: 28 20 61 2c 20 62 20 29 20 7b 0a 09 76 61 72 20  ( a, b ) {..var 
61d0: 63 75 72 20 3d 20 62 20 26 26 20 61 2c 0a 09 09  cur = b && a,...
61e0: 64 69 66 66 20 3d 20 63 75 72 20 26 26 20 61 2e  diff = cur && a.
61f0: 6e 6f 64 65 54 79 70 65 20 3d 3d 3d 20 31 20 26  nodeType === 1 &
6200: 26 20 62 2e 6e 6f 64 65 54 79 70 65 20 3d 3d 3d  & b.nodeType ===
6210: 20 31 20 26 26 0a 09 09 09 61 2e 73 6f 75 72 63   1 &&....a.sourc
6220: 65 49 6e 64 65 78 20 2d 20 62 2e 73 6f 75 72 63  eIndex - b.sourc
6230: 65 49 6e 64 65 78 3b 0a 0a 09 2f 2f 20 55 73 65  eIndex;...// Use
6240: 20 49 45 20 73 6f 75 72 63 65 49 6e 64 65 78 20   IE sourceIndex 
6250: 69 66 20 61 76 61 69 6c 61 62 6c 65 20 6f 6e 20  if available on 
6260: 62 6f 74 68 20 6e 6f 64 65 73 0a 09 69 66 20 28  both nodes..if (
6270: 20 64 69 66 66 20 29 20 7b 0a 09 09 72 65 74 75   diff ) {...retu
6280: 72 6e 20 64 69 66 66 3b 0a 09 7d 0a 0a 09 2f 2f  rn diff;..}...//
6290: 20 43 68 65 63 6b 20 69 66 20 62 20 66 6f 6c 6c   Check if b foll
62a0: 6f 77 73 20 61 0a 09 69 66 20 28 20 63 75 72 20  ows a..if ( cur 
62b0: 29 20 7b 0a 09 09 77 68 69 6c 65 20 28 20 28 20  ) {...while ( ( 
62c0: 63 75 72 20 3d 20 63 75 72 2e 6e 65 78 74 53 69  cur = cur.nextSi
62d0: 62 6c 69 6e 67 20 29 20 29 20 7b 0a 09 09 09 69  bling ) ) {....i
62e0: 66 20 28 20 63 75 72 20 3d 3d 3d 20 62 20 29 20  f ( cur === b ) 
62f0: 7b 0a 09 09 09 09 72 65 74 75 72 6e 20 2d 31 3b  {.....return -1;
6300: 0a 09 09 09 7d 0a 09 09 7d 0a 09 7d 0a 0a 09 72  ....}...}..}...r
6310: 65 74 75 72 6e 20 61 20 3f 20 31 20 3a 20 2d 31  eturn a ? 1 : -1
6320: 3b 0a 7d 0a 0a 2f 2a 2a 0a 20 2a 20 52 65 74 75  ;.}../**. * Retu
6330: 72 6e 73 20 61 20 66 75 6e 63 74 69 6f 6e 20 74  rns a function t
6340: 6f 20 75 73 65 20 69 6e 20 70 73 65 75 64 6f 73  o use in pseudos
6350: 20 66 6f 72 20 69 6e 70 75 74 20 74 79 70 65 73   for input types
6360: 0a 20 2a 20 40 70 61 72 61 6d 20 7b 53 74 72 69  . * @param {Stri
6370: 6e 67 7d 20 74 79 70 65 0a 20 2a 2f 0a 66 75 6e  ng} type. */.fun
6380: 63 74 69 6f 6e 20 63 72 65 61 74 65 49 6e 70 75  ction createInpu
6390: 74 50 73 65 75 64 6f 28 20 74 79 70 65 20 29 20  tPseudo( type ) 
63a0: 7b 0a 09 72 65 74 75 72 6e 20 66 75 6e 63 74 69  {..return functi
63b0: 6f 6e 28 20 65 6c 65 6d 20 29 20 7b 0a 09 09 76  on( elem ) {...v
63c0: 61 72 20 6e 61 6d 65 20 3d 20 65 6c 65 6d 2e 6e  ar name = elem.n
63d0: 6f 64 65 4e 61 6d 65 2e 74 6f 4c 6f 77 65 72 43  odeName.toLowerC
63e0: 61 73 65 28 29 3b 0a 09 09 72 65 74 75 72 6e 20  ase();...return 
63f0: 6e 61 6d 65 20 3d 3d 3d 20 22 69 6e 70 75 74 22  name === "input"
6400: 20 26 26 20 65 6c 65 6d 2e 74 79 70 65 20 3d 3d   && elem.type ==
6410: 3d 20 74 79 70 65 3b 0a 09 7d 3b 0a 7d 0a 0a 2f  = type;..};.}../
6420: 2a 2a 0a 20 2a 20 52 65 74 75 72 6e 73 20 61 20  **. * Returns a 
6430: 66 75 6e 63 74 69 6f 6e 20 74 6f 20 75 73 65 20  function to use 
6440: 69 6e 20 70 73 65 75 64 6f 73 20 66 6f 72 20 62  in pseudos for b
6450: 75 74 74 6f 6e 73 0a 20 2a 20 40 70 61 72 61 6d  uttons. * @param
6460: 20 7b 53 74 72 69 6e 67 7d 20 74 79 70 65 0a 20   {String} type. 
6470: 2a 2f 0a 66 75 6e 63 74 69 6f 6e 20 63 72 65 61  */.function crea
6480: 74 65 42 75 74 74 6f 6e 50 73 65 75 64 6f 28 20  teButtonPseudo( 
6490: 74 79 70 65 20 29 20 7b 0a 09 72 65 74 75 72 6e  type ) {..return
64a0: 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 20   function( elem 
64b0: 29 20 7b 0a 09 09 76 61 72 20 6e 61 6d 65 20 3d  ) {...var name =
64c0: 20 65 6c 65 6d 2e 6e 6f 64 65 4e 61 6d 65 2e 74   elem.nodeName.t
64d0: 6f 4c 6f 77 65 72 43 61 73 65 28 29 3b 0a 09 09  oLowerCase();...
64e0: 72 65 74 75 72 6e 20 28 20 6e 61 6d 65 20 3d 3d  return ( name ==
64f0: 3d 20 22 69 6e 70 75 74 22 20 7c 7c 20 6e 61 6d  = "input" || nam
6500: 65 20 3d 3d 3d 20 22 62 75 74 74 6f 6e 22 20 29  e === "button" )
6510: 20 26 26 20 65 6c 65 6d 2e 74 79 70 65 20 3d 3d   && elem.type ==
6520: 3d 20 74 79 70 65 3b 0a 09 7d 3b 0a 7d 0a 0a 2f  = type;..};.}../
6530: 2a 2a 0a 20 2a 20 52 65 74 75 72 6e 73 20 61 20  **. * Returns a 
6540: 66 75 6e 63 74 69 6f 6e 20 74 6f 20 75 73 65 20  function to use 
6550: 69 6e 20 70 73 65 75 64 6f 73 20 66 6f 72 20 3a  in pseudos for :
6560: 65 6e 61 62 6c 65 64 2f 3a 64 69 73 61 62 6c 65  enabled/:disable
6570: 64 0a 20 2a 20 40 70 61 72 61 6d 20 7b 42 6f 6f  d. * @param {Boo
6580: 6c 65 61 6e 7d 20 64 69 73 61 62 6c 65 64 20 74  lean} disabled t
6590: 72 75 65 20 66 6f 72 20 3a 64 69 73 61 62 6c 65  rue for :disable
65a0: 64 3b 20 66 61 6c 73 65 20 66 6f 72 20 3a 65 6e  d; false for :en
65b0: 61 62 6c 65 64 0a 20 2a 2f 0a 66 75 6e 63 74 69  abled. */.functi
65c0: 6f 6e 20 63 72 65 61 74 65 44 69 73 61 62 6c 65  on createDisable
65d0: 64 50 73 65 75 64 6f 28 20 64 69 73 61 62 6c 65  dPseudo( disable
65e0: 64 20 29 20 7b 0a 0a 09 2f 2f 20 4b 6e 6f 77 6e  d ) {...// Known
65f0: 20 3a 64 69 73 61 62 6c 65 64 20 66 61 6c 73 65   :disabled false
6600: 20 70 6f 73 69 74 69 76 65 73 3a 20 66 69 65 6c   positives: fiel
6610: 64 73 65 74 5b 64 69 73 61 62 6c 65 64 5d 20 3e  dset[disabled] >
6620: 20 6c 65 67 65 6e 64 3a 6e 74 68 2d 6f 66 2d 74   legend:nth-of-t
6630: 79 70 65 28 6e 2b 32 29 20 3a 63 61 6e 2d 64 69  ype(n+2) :can-di
6640: 73 61 62 6c 65 0a 09 72 65 74 75 72 6e 20 66 75  sable..return fu
6650: 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 20 29 20 7b  nction( elem ) {
6660: 0a 0a 09 09 2f 2f 20 4f 6e 6c 79 20 63 65 72 74  ....// Only cert
6670: 61 69 6e 20 65 6c 65 6d 65 6e 74 73 20 63 61 6e  ain elements can
6680: 20 6d 61 74 63 68 20 3a 65 6e 61 62 6c 65 64 20   match :enabled 
6690: 6f 72 20 3a 64 69 73 61 62 6c 65 64 0a 09 09 2f  or :disabled.../
66a0: 2f 20 68 74 74 70 73 3a 2f 2f 68 74 6d 6c 2e 73  / https://html.s
66b0: 70 65 63 2e 77 68 61 74 77 67 2e 6f 72 67 2f 6d  pec.whatwg.org/m
66c0: 75 6c 74 69 70 61 67 65 2f 73 63 72 69 70 74 69  ultipage/scripti
66d0: 6e 67 2e 68 74 6d 6c 23 73 65 6c 65 63 74 6f 72  ng.html#selector
66e0: 2d 65 6e 61 62 6c 65 64 0a 09 09 2f 2f 20 68 74  -enabled...// ht
66f0: 74 70 73 3a 2f 2f 68 74 6d 6c 2e 73 70 65 63 2e  tps://html.spec.
6700: 77 68 61 74 77 67 2e 6f 72 67 2f 6d 75 6c 74 69  whatwg.org/multi
6710: 70 61 67 65 2f 73 63 72 69 70 74 69 6e 67 2e 68  page/scripting.h
6720: 74 6d 6c 23 73 65 6c 65 63 74 6f 72 2d 64 69 73  tml#selector-dis
6730: 61 62 6c 65 64 0a 09 09 69 66 20 28 20 22 66 6f  abled...if ( "fo
6740: 72 6d 22 20 69 6e 20 65 6c 65 6d 20 29 20 7b 0a  rm" in elem ) {.
6750: 0a 09 09 09 2f 2f 20 43 68 65 63 6b 20 66 6f 72  ....// Check for
6760: 20 69 6e 68 65 72 69 74 65 64 20 64 69 73 61 62   inherited disab
6770: 6c 65 64 6e 65 73 73 20 6f 6e 20 72 65 6c 65 76  ledness on relev
6780: 61 6e 74 20 6e 6f 6e 2d 64 69 73 61 62 6c 65 64  ant non-disabled
6790: 20 65 6c 65 6d 65 6e 74 73 3a 0a 09 09 09 2f 2f   elements:....//
67a0: 20 2a 20 6c 69 73 74 65 64 20 66 6f 72 6d 2d 61   * listed form-a
67b0: 73 73 6f 63 69 61 74 65 64 20 65 6c 65 6d 65 6e  ssociated elemen
67c0: 74 73 20 69 6e 20 61 20 64 69 73 61 62 6c 65 64  ts in a disabled
67d0: 20 66 69 65 6c 64 73 65 74 0a 09 09 09 2f 2f 20   fieldset....// 
67e0: 20 20 68 74 74 70 73 3a 2f 2f 68 74 6d 6c 2e 73    https://html.s
67f0: 70 65 63 2e 77 68 61 74 77 67 2e 6f 72 67 2f 6d  pec.whatwg.org/m
6800: 75 6c 74 69 70 61 67 65 2f 66 6f 72 6d 73 2e 68  ultipage/forms.h
6810: 74 6d 6c 23 63 61 74 65 67 6f 72 79 2d 6c 69 73  tml#category-lis
6820: 74 65 64 0a 09 09 09 2f 2f 20 20 20 68 74 74 70  ted....//   http
6830: 73 3a 2f 2f 68 74 6d 6c 2e 73 70 65 63 2e 77 68  s://html.spec.wh
6840: 61 74 77 67 2e 6f 72 67 2f 6d 75 6c 74 69 70 61  atwg.org/multipa
6850: 67 65 2f 66 6f 72 6d 73 2e 68 74 6d 6c 23 63 6f  ge/forms.html#co
6860: 6e 63 65 70 74 2d 66 65 2d 64 69 73 61 62 6c 65  ncept-fe-disable
6870: 64 0a 09 09 09 2f 2f 20 2a 20 6f 70 74 69 6f 6e  d....// * option
6880: 20 65 6c 65 6d 65 6e 74 73 20 69 6e 20 61 20 64   elements in a d
6890: 69 73 61 62 6c 65 64 20 6f 70 74 67 72 6f 75 70  isabled optgroup
68a0: 0a 09 09 09 2f 2f 20 20 20 68 74 74 70 73 3a 2f  ....//   https:/
68b0: 2f 68 74 6d 6c 2e 73 70 65 63 2e 77 68 61 74 77  /html.spec.whatw
68c0: 67 2e 6f 72 67 2f 6d 75 6c 74 69 70 61 67 65 2f  g.org/multipage/
68d0: 66 6f 72 6d 73 2e 68 74 6d 6c 23 63 6f 6e 63 65  forms.html#conce
68e0: 70 74 2d 6f 70 74 69 6f 6e 2d 64 69 73 61 62 6c  pt-option-disabl
68f0: 65 64 0a 09 09 09 2f 2f 20 41 6c 6c 20 73 75 63  ed....// All suc
6900: 68 20 65 6c 65 6d 65 6e 74 73 20 68 61 76 65 20  h elements have 
6910: 61 20 22 66 6f 72 6d 22 20 70 72 6f 70 65 72 74  a "form" propert
6920: 79 2e 0a 09 09 09 69 66 20 28 20 65 6c 65 6d 2e  y.....if ( elem.
6930: 70 61 72 65 6e 74 4e 6f 64 65 20 26 26 20 65 6c  parentNode && el
6940: 65 6d 2e 64 69 73 61 62 6c 65 64 20 3d 3d 3d 20  em.disabled === 
6950: 66 61 6c 73 65 20 29 20 7b 0a 0a 09 09 09 09 2f  false ) {....../
6960: 2f 20 4f 70 74 69 6f 6e 20 65 6c 65 6d 65 6e 74  / Option element
6970: 73 20 64 65 66 65 72 20 74 6f 20 61 20 70 61 72  s defer to a par
6980: 65 6e 74 20 6f 70 74 67 72 6f 75 70 20 69 66 20  ent optgroup if 
6990: 70 72 65 73 65 6e 74 0a 09 09 09 09 69 66 20 28  present.....if (
69a0: 20 22 6c 61 62 65 6c 22 20 69 6e 20 65 6c 65 6d   "label" in elem
69b0: 20 29 20 7b 0a 09 09 09 09 09 69 66 20 28 20 22   ) {......if ( "
69c0: 6c 61 62 65 6c 22 20 69 6e 20 65 6c 65 6d 2e 70  label" in elem.p
69d0: 61 72 65 6e 74 4e 6f 64 65 20 29 20 7b 0a 09 09  arentNode ) {...
69e0: 09 09 09 09 72 65 74 75 72 6e 20 65 6c 65 6d 2e  ....return elem.
69f0: 70 61 72 65 6e 74 4e 6f 64 65 2e 64 69 73 61 62  parentNode.disab
6a00: 6c 65 64 20 3d 3d 3d 20 64 69 73 61 62 6c 65 64  led === disabled
6a10: 3b 0a 09 09 09 09 09 7d 20 65 6c 73 65 20 7b 0a  ;......} else {.
6a20: 09 09 09 09 09 09 72 65 74 75 72 6e 20 65 6c 65  ......return ele
6a30: 6d 2e 64 69 73 61 62 6c 65 64 20 3d 3d 3d 20 64  m.disabled === d
6a40: 69 73 61 62 6c 65 64 3b 0a 09 09 09 09 09 7d 0a  isabled;......}.
6a50: 09 09 09 09 7d 0a 0a 09 09 09 09 2f 2f 20 53 75  ....}......// Su
6a60: 70 70 6f 72 74 3a 20 49 45 20 36 20 2d 20 31 31  pport: IE 6 - 11
6a70: 0a 09 09 09 09 2f 2f 20 55 73 65 20 74 68 65 20  .....// Use the 
6a80: 69 73 44 69 73 61 62 6c 65 64 20 73 68 6f 72 74  isDisabled short
6a90: 63 75 74 20 70 72 6f 70 65 72 74 79 20 74 6f 20  cut property to 
6aa0: 63 68 65 63 6b 20 66 6f 72 20 64 69 73 61 62 6c  check for disabl
6ab0: 65 64 20 66 69 65 6c 64 73 65 74 20 61 6e 63 65  ed fieldset ance
6ac0: 73 74 6f 72 73 0a 09 09 09 09 72 65 74 75 72 6e  stors.....return
6ad0: 20 65 6c 65 6d 2e 69 73 44 69 73 61 62 6c 65 64   elem.isDisabled
6ae0: 20 3d 3d 3d 20 64 69 73 61 62 6c 65 64 20 7c 7c   === disabled ||
6af0: 0a 0a 09 09 09 09 09 2f 2f 20 57 68 65 72 65 20  .......// Where 
6b00: 74 68 65 72 65 20 69 73 20 6e 6f 20 69 73 44 69  there is no isDi
6b10: 73 61 62 6c 65 64 2c 20 63 68 65 63 6b 20 6d 61  sabled, check ma
6b20: 6e 75 61 6c 6c 79 0a 09 09 09 09 09 2f 2a 20 6a  nually....../* j
6b30: 73 68 69 6e 74 20 2d 57 30 31 38 20 2a 2f 0a 09  shint -W018 */..
6b40: 09 09 09 09 65 6c 65 6d 2e 69 73 44 69 73 61 62  ....elem.isDisab
6b50: 6c 65 64 20 21 3d 3d 20 21 64 69 73 61 62 6c 65  led !== !disable
6b60: 64 20 26 26 0a 09 09 09 09 09 69 6e 44 69 73 61  d &&......inDisa
6b70: 62 6c 65 64 46 69 65 6c 64 73 65 74 28 20 65 6c  bledFieldset( el
6b80: 65 6d 20 29 20 3d 3d 3d 20 64 69 73 61 62 6c 65  em ) === disable
6b90: 64 3b 0a 09 09 09 7d 0a 0a 09 09 09 72 65 74 75  d;....}.....retu
6ba0: 72 6e 20 65 6c 65 6d 2e 64 69 73 61 62 6c 65 64  rn elem.disabled
6bb0: 20 3d 3d 3d 20 64 69 73 61 62 6c 65 64 3b 0a 0a   === disabled;..
6bc0: 09 09 2f 2f 20 54 72 79 20 74 6f 20 77 69 6e 6e  ..// Try to winn
6bd0: 6f 77 20 6f 75 74 20 65 6c 65 6d 65 6e 74 73 20  ow out elements 
6be0: 74 68 61 74 20 63 61 6e 27 74 20 62 65 20 64 69  that can't be di
6bf0: 73 61 62 6c 65 64 20 62 65 66 6f 72 65 20 74 72  sabled before tr
6c00: 75 73 74 69 6e 67 20 74 68 65 20 64 69 73 61 62  usting the disab
6c10: 6c 65 64 20 70 72 6f 70 65 72 74 79 2e 0a 09 09  led property....
6c20: 2f 2f 20 53 6f 6d 65 20 76 69 63 74 69 6d 73 20  // Some victims 
6c30: 67 65 74 20 63 61 75 67 68 74 20 69 6e 20 6f 75  get caught in ou
6c40: 72 20 6e 65 74 20 28 6c 61 62 65 6c 2c 20 6c 65  r net (label, le
6c50: 67 65 6e 64 2c 20 6d 65 6e 75 2c 20 74 72 61 63  gend, menu, trac
6c60: 6b 29 2c 20 62 75 74 20 69 74 20 73 68 6f 75 6c  k), but it shoul
6c70: 64 6e 27 74 0a 09 09 2f 2f 20 65 76 65 6e 20 65  dn't...// even e
6c80: 78 69 73 74 20 6f 6e 20 74 68 65 6d 2c 20 6c 65  xist on them, le
6c90: 74 20 61 6c 6f 6e 65 20 68 61 76 65 20 61 20 62  t alone have a b
6ca0: 6f 6f 6c 65 61 6e 20 76 61 6c 75 65 2e 0a 09 09  oolean value....
6cb0: 7d 20 65 6c 73 65 20 69 66 20 28 20 22 6c 61 62  } else if ( "lab
6cc0: 65 6c 22 20 69 6e 20 65 6c 65 6d 20 29 20 7b 0a  el" in elem ) {.
6cd0: 09 09 09 72 65 74 75 72 6e 20 65 6c 65 6d 2e 64  ...return elem.d
6ce0: 69 73 61 62 6c 65 64 20 3d 3d 3d 20 64 69 73 61  isabled === disa
6cf0: 62 6c 65 64 3b 0a 09 09 7d 0a 0a 09 09 2f 2f 20  bled;...}....// 
6d00: 52 65 6d 61 69 6e 69 6e 67 20 65 6c 65 6d 65 6e  Remaining elemen
6d10: 74 73 20 61 72 65 20 6e 65 69 74 68 65 72 20 3a  ts are neither :
6d20: 65 6e 61 62 6c 65 64 20 6e 6f 72 20 3a 64 69 73  enabled nor :dis
6d30: 61 62 6c 65 64 0a 09 09 72 65 74 75 72 6e 20 66  abled...return f
6d40: 61 6c 73 65 3b 0a 09 7d 3b 0a 7d 0a 0a 2f 2a 2a  alse;..};.}../**
6d50: 0a 20 2a 20 52 65 74 75 72 6e 73 20 61 20 66 75  . * Returns a fu
6d60: 6e 63 74 69 6f 6e 20 74 6f 20 75 73 65 20 69 6e  nction to use in
6d70: 20 70 73 65 75 64 6f 73 20 66 6f 72 20 70 6f 73   pseudos for pos
6d80: 69 74 69 6f 6e 61 6c 73 0a 20 2a 20 40 70 61 72  itionals. * @par
6d90: 61 6d 20 7b 46 75 6e 63 74 69 6f 6e 7d 20 66 6e  am {Function} fn
6da0: 0a 20 2a 2f 0a 66 75 6e 63 74 69 6f 6e 20 63 72  . */.function cr
6db0: 65 61 74 65 50 6f 73 69 74 69 6f 6e 61 6c 50 73  eatePositionalPs
6dc0: 65 75 64 6f 28 20 66 6e 20 29 20 7b 0a 09 72 65  eudo( fn ) {..re
6dd0: 74 75 72 6e 20 6d 61 72 6b 46 75 6e 63 74 69 6f  turn markFunctio
6de0: 6e 28 20 66 75 6e 63 74 69 6f 6e 28 20 61 72 67  n( function( arg
6df0: 75 6d 65 6e 74 20 29 20 7b 0a 09 09 61 72 67 75  ument ) {...argu
6e00: 6d 65 6e 74 20 3d 20 2b 61 72 67 75 6d 65 6e 74  ment = +argument
6e10: 3b 0a 09 09 72 65 74 75 72 6e 20 6d 61 72 6b 46  ;...return markF
6e20: 75 6e 63 74 69 6f 6e 28 20 66 75 6e 63 74 69 6f  unction( functio
6e30: 6e 28 20 73 65 65 64 2c 20 6d 61 74 63 68 65 73  n( seed, matches
6e40: 20 29 20 7b 0a 09 09 09 76 61 72 20 6a 2c 0a 09   ) {....var j,..
6e50: 09 09 09 6d 61 74 63 68 49 6e 64 65 78 65 73 20  ...matchIndexes 
6e60: 3d 20 66 6e 28 20 5b 5d 2c 20 73 65 65 64 2e 6c  = fn( [], seed.l
6e70: 65 6e 67 74 68 2c 20 61 72 67 75 6d 65 6e 74 20  ength, argument 
6e80: 29 2c 0a 09 09 09 09 69 20 3d 20 6d 61 74 63 68  ),.....i = match
6e90: 49 6e 64 65 78 65 73 2e 6c 65 6e 67 74 68 3b 0a  Indexes.length;.
6ea0: 0a 09 09 09 2f 2f 20 4d 61 74 63 68 20 65 6c 65  ....// Match ele
6eb0: 6d 65 6e 74 73 20 66 6f 75 6e 64 20 61 74 20 74  ments found at t
6ec0: 68 65 20 73 70 65 63 69 66 69 65 64 20 69 6e 64  he specified ind
6ed0: 65 78 65 73 0a 09 09 09 77 68 69 6c 65 20 28 20  exes....while ( 
6ee0: 69 2d 2d 20 29 20 7b 0a 09 09 09 09 69 66 20 28  i-- ) {.....if (
6ef0: 20 73 65 65 64 5b 20 28 20 6a 20 3d 20 6d 61 74   seed[ ( j = mat
6f00: 63 68 49 6e 64 65 78 65 73 5b 20 69 20 5d 20 29  chIndexes[ i ] )
6f10: 20 5d 20 29 20 7b 0a 09 09 09 09 09 73 65 65 64   ] ) {......seed
6f20: 5b 20 6a 20 5d 20 3d 20 21 28 20 6d 61 74 63 68  [ j ] = !( match
6f30: 65 73 5b 20 6a 20 5d 20 3d 20 73 65 65 64 5b 20  es[ j ] = seed[ 
6f40: 6a 20 5d 20 29 3b 0a 09 09 09 09 7d 0a 09 09 09  j ] );.....}....
6f50: 7d 0a 09 09 7d 20 29 3b 0a 09 7d 20 29 3b 0a 7d  }...} );..} );.}
6f60: 0a 0a 2f 2a 2a 0a 20 2a 20 43 68 65 63 6b 73 20  ../**. * Checks 
6f70: 61 20 6e 6f 64 65 20 66 6f 72 20 76 61 6c 69 64  a node for valid
6f80: 69 74 79 20 61 73 20 61 20 53 69 7a 7a 6c 65 20  ity as a Sizzle 
6f90: 63 6f 6e 74 65 78 74 0a 20 2a 20 40 70 61 72 61  context. * @para
6fa0: 6d 20 7b 45 6c 65 6d 65 6e 74 7c 4f 62 6a 65 63  m {Element|Objec
6fb0: 74 3d 7d 20 63 6f 6e 74 65 78 74 0a 20 2a 20 40  t=} context. * @
6fc0: 72 65 74 75 72 6e 73 20 7b 45 6c 65 6d 65 6e 74  returns {Element
6fd0: 7c 4f 62 6a 65 63 74 7c 42 6f 6f 6c 65 61 6e 7d  |Object|Boolean}
6fe0: 20 54 68 65 20 69 6e 70 75 74 20 6e 6f 64 65 20   The input node 
6ff0: 69 66 20 61 63 63 65 70 74 61 62 6c 65 2c 20 6f  if acceptable, o
7000: 74 68 65 72 77 69 73 65 20 61 20 66 61 6c 73 79  therwise a falsy
7010: 20 76 61 6c 75 65 0a 20 2a 2f 0a 66 75 6e 63 74   value. */.funct
7020: 69 6f 6e 20 74 65 73 74 43 6f 6e 74 65 78 74 28  ion testContext(
7030: 20 63 6f 6e 74 65 78 74 20 29 20 7b 0a 09 72 65   context ) {..re
7040: 74 75 72 6e 20 63 6f 6e 74 65 78 74 20 26 26 20  turn context && 
7050: 74 79 70 65 6f 66 20 63 6f 6e 74 65 78 74 2e 67  typeof context.g
7060: 65 74 45 6c 65 6d 65 6e 74 73 42 79 54 61 67 4e  etElementsByTagN
7070: 61 6d 65 20 21 3d 3d 20 22 75 6e 64 65 66 69 6e  ame !== "undefin
7080: 65 64 22 20 26 26 20 63 6f 6e 74 65 78 74 3b 0a  ed" && context;.
7090: 7d 0a 0a 2f 2f 20 45 78 70 6f 73 65 20 73 75 70  }..// Expose sup
70a0: 70 6f 72 74 20 76 61 72 73 20 66 6f 72 20 63 6f  port vars for co
70b0: 6e 76 65 6e 69 65 6e 63 65 0a 73 75 70 70 6f 72  nvenience.suppor
70c0: 74 20 3d 20 53 69 7a 7a 6c 65 2e 73 75 70 70 6f  t = Sizzle.suppo
70d0: 72 74 20 3d 20 7b 7d 3b 0a 0a 2f 2a 2a 0a 20 2a  rt = {};../**. *
70e0: 20 44 65 74 65 63 74 73 20 58 4d 4c 20 6e 6f 64   Detects XML nod
70f0: 65 73 0a 20 2a 20 40 70 61 72 61 6d 20 7b 45 6c  es. * @param {El
7100: 65 6d 65 6e 74 7c 4f 62 6a 65 63 74 7d 20 65 6c  ement|Object} el
7110: 65 6d 20 41 6e 20 65 6c 65 6d 65 6e 74 20 6f 72  em An element or
7120: 20 61 20 64 6f 63 75 6d 65 6e 74 0a 20 2a 20 40   a document. * @
7130: 72 65 74 75 72 6e 73 20 7b 42 6f 6f 6c 65 61 6e  returns {Boolean
7140: 7d 20 54 72 75 65 20 69 66 66 20 65 6c 65 6d 20  } True iff elem 
7150: 69 73 20 61 20 6e 6f 6e 2d 48 54 4d 4c 20 58 4d  is a non-HTML XM
7160: 4c 20 6e 6f 64 65 0a 20 2a 2f 0a 69 73 58 4d 4c  L node. */.isXML
7170: 20 3d 20 53 69 7a 7a 6c 65 2e 69 73 58 4d 4c 20   = Sizzle.isXML 
7180: 3d 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c 65 6d  = function( elem
7190: 20 29 20 7b 0a 09 76 61 72 20 6e 61 6d 65 73 70   ) {..var namesp
71a0: 61 63 65 20 3d 20 65 6c 65 6d 2e 6e 61 6d 65 73  ace = elem.names
71b0: 70 61 63 65 55 52 49 2c 0a 09 09 64 6f 63 45 6c  paceURI,...docEl
71c0: 65 6d 20 3d 20 28 20 65 6c 65 6d 2e 6f 77 6e 65  em = ( elem.owne
71d0: 72 44 6f 63 75 6d 65 6e 74 20 7c 7c 20 65 6c 65  rDocument || ele
71e0: 6d 20 29 2e 64 6f 63 75 6d 65 6e 74 45 6c 65 6d  m ).documentElem
71f0: 65 6e 74 3b 0a 0a 09 2f 2f 20 53 75 70 70 6f 72  ent;...// Suppor
7200: 74 3a 20 49 45 20 3c 3d 38 0a 09 2f 2f 20 41 73  t: IE <=8..// As
7210: 73 75 6d 65 20 48 54 4d 4c 20 77 68 65 6e 20 64  sume HTML when d
7220: 6f 63 75 6d 65 6e 74 45 6c 65 6d 65 6e 74 20 64  ocumentElement d
7230: 6f 65 73 6e 27 74 20 79 65 74 20 65 78 69 73 74  oesn't yet exist
7240: 2c 20 73 75 63 68 20 61 73 20 69 6e 73 69 64 65  , such as inside
7250: 20 6c 6f 61 64 69 6e 67 20 69 66 72 61 6d 65 73   loading iframes
7260: 0a 09 2f 2f 20 68 74 74 70 73 3a 2f 2f 62 75 67  ..// https://bug
7270: 73 2e 6a 71 75 65 72 79 2e 63 6f 6d 2f 74 69 63  s.jquery.com/tic
7280: 6b 65 74 2f 34 38 33 33 0a 09 72 65 74 75 72 6e  ket/4833..return
7290: 20 21 72 68 74 6d 6c 2e 74 65 73 74 28 20 6e 61   !rhtml.test( na
72a0: 6d 65 73 70 61 63 65 20 7c 7c 20 64 6f 63 45 6c  mespace || docEl
72b0: 65 6d 20 26 26 20 64 6f 63 45 6c 65 6d 2e 6e 6f  em && docElem.no
72c0: 64 65 4e 61 6d 65 20 7c 7c 20 22 48 54 4d 4c 22  deName || "HTML"
72d0: 20 29 3b 0a 7d 3b 0a 0a 2f 2a 2a 0a 20 2a 20 53   );.};../**. * S
72e0: 65 74 73 20 64 6f 63 75 6d 65 6e 74 2d 72 65 6c  ets document-rel
72f0: 61 74 65 64 20 76 61 72 69 61 62 6c 65 73 20 6f  ated variables o
7300: 6e 63 65 20 62 61 73 65 64 20 6f 6e 20 74 68 65  nce based on the
7310: 20 63 75 72 72 65 6e 74 20 64 6f 63 75 6d 65 6e   current documen
7320: 74 0a 20 2a 20 40 70 61 72 61 6d 20 7b 45 6c 65  t. * @param {Ele
7330: 6d 65 6e 74 7c 4f 62 6a 65 63 74 7d 20 5b 64 6f  ment|Object} [do
7340: 63 5d 20 41 6e 20 65 6c 65 6d 65 6e 74 20 6f 72  c] An element or
7350: 20 64 6f 63 75 6d 65 6e 74 20 6f 62 6a 65 63 74   document object
7360: 20 74 6f 20 75 73 65 20 74 6f 20 73 65 74 20 74   to use to set t
7370: 68 65 20 64 6f 63 75 6d 65 6e 74 0a 20 2a 20 40  he document. * @
7380: 72 65 74 75 72 6e 73 20 7b 4f 62 6a 65 63 74 7d  returns {Object}
7390: 20 52 65 74 75 72 6e 73 20 74 68 65 20 63 75 72   Returns the cur
73a0: 72 65 6e 74 20 64 6f 63 75 6d 65 6e 74 0a 20 2a  rent document. *
73b0: 2f 0a 73 65 74 44 6f 63 75 6d 65 6e 74 20 3d 20  /.setDocument = 
73c0: 53 69 7a 7a 6c 65 2e 73 65 74 44 6f 63 75 6d 65  Sizzle.setDocume
73d0: 6e 74 20 3d 20 66 75 6e 63 74 69 6f 6e 28 20 6e  nt = function( n
73e0: 6f 64 65 20 29 20 7b 0a 09 76 61 72 20 68 61 73  ode ) {..var has
73f0: 43 6f 6d 70 61 72 65 2c 20 73 75 62 57 69 6e 64  Compare, subWind
7400: 6f 77 2c 0a 09 09 64 6f 63 20 3d 20 6e 6f 64 65  ow,...doc = node
7410: 20 3f 20 6e 6f 64 65 2e 6f 77 6e 65 72 44 6f 63   ? node.ownerDoc
7420: 75 6d 65 6e 74 20 7c 7c 20 6e 6f 64 65 20 3a 20  ument || node : 
7430: 70 72 65 66 65 72 72 65 64 44 6f 63 3b 0a 0a 09  preferredDoc;...
7440: 2f 2f 20 52 65 74 75 72 6e 20 65 61 72 6c 79 20  // Return early 
7450: 69 66 20 64 6f 63 20 69 73 20 69 6e 76 61 6c 69  if doc is invali
7460: 64 20 6f 72 20 61 6c 72 65 61 64 79 20 73 65 6c  d or already sel
7470: 65 63 74 65 64 0a 09 2f 2f 20 53 75 70 70 6f 72  ected..// Suppor
7480: 74 3a 20 49 45 20 31 31 2b 2c 20 45 64 67 65 20  t: IE 11+, Edge 
7490: 31 37 20 2d 20 31 38 2b 0a 09 2f 2f 20 49 45 2f  17 - 18+..// IE/
74a0: 45 64 67 65 20 73 6f 6d 65 74 69 6d 65 73 20 74  Edge sometimes t
74b0: 68 72 6f 77 20 61 20 22 50 65 72 6d 69 73 73 69  hrow a "Permissi
74c0: 6f 6e 20 64 65 6e 69 65 64 22 20 65 72 72 6f 72  on denied" error
74d0: 20 77 68 65 6e 20 73 74 72 69 63 74 2d 63 6f 6d   when strict-com
74e0: 70 61 72 69 6e 67 0a 09 2f 2f 20 74 77 6f 20 64  paring..// two d
74f0: 6f 63 75 6d 65 6e 74 73 3b 20 73 68 61 6c 6c 6f  ocuments; shallo
7500: 77 20 63 6f 6d 70 61 72 69 73 6f 6e 73 20 77 6f  w comparisons wo
7510: 72 6b 2e 0a 09 2f 2f 20 65 73 6c 69 6e 74 2d 64  rk...// eslint-d
7520: 69 73 61 62 6c 65 2d 6e 65 78 74 2d 6c 69 6e 65  isable-next-line
7530: 20 65 71 65 71 65 71 0a 09 69 66 20 28 20 64 6f   eqeqeq..if ( do
7540: 63 20 3d 3d 20 64 6f 63 75 6d 65 6e 74 20 7c 7c  c == document ||
7550: 20 64 6f 63 2e 6e 6f 64 65 54 79 70 65 20 21 3d   doc.nodeType !=
7560: 3d 20 39 20 7c 7c 20 21 64 6f 63 2e 64 6f 63 75  = 9 || !doc.docu
7570: 6d 65 6e 74 45 6c 65 6d 65 6e 74 20 29 20 7b 0a  mentElement ) {.
7580: 09 09 72 65 74 75 72 6e 20 64 6f 63 75 6d 65 6e  ..return documen
7590: 74 3b 0a 09 7d 0a 0a 09 2f 2f 20 55 70 64 61 74  t;..}...// Updat
75a0: 65 20 67 6c 6f 62 61 6c 20 76 61 72 69 61 62 6c  e global variabl
75b0: 65 73 0a 09 64 6f 63 75 6d 65 6e 74 20 3d 20 64  es..document = d
75c0: 6f 63 3b 0a 09 64 6f 63 45 6c 65 6d 20 3d 20 64  oc;..docElem = d
75d0: 6f 63 75 6d 65 6e 74 2e 64 6f 63 75 6d 65 6e 74  ocument.document
75e0: 45 6c 65 6d 65 6e 74 3b 0a 09 64 6f 63 75 6d 65  Element;..docume
75f0: 6e 74 49 73 48 54 4d 4c 20 3d 20 21 69 73 58 4d  ntIsHTML = !isXM
7600: 4c 28 20 64 6f 63 75 6d 65 6e 74 20 29 3b 0a 0a  L( document );..
7610: 09 2f 2f 20 53 75 70 70 6f 72 74 3a 20 49 45 20  .// Support: IE 
7620: 39 20 2d 20 31 31 2b 2c 20 45 64 67 65 20 31 32  9 - 11+, Edge 12
7630: 20 2d 20 31 38 2b 0a 09 2f 2f 20 41 63 63 65 73   - 18+..// Acces
7640: 73 69 6e 67 20 69 66 72 61 6d 65 20 64 6f 63 75  sing iframe docu
7650: 6d 65 6e 74 73 20 61 66 74 65 72 20 75 6e 6c 6f  ments after unlo
7660: 61 64 20 74 68 72 6f 77 73 20 22 70 65 72 6d 69  ad throws "permi
7670: 73 73 69 6f 6e 20 64 65 6e 69 65 64 22 20 65 72  ssion denied" er
7680: 72 6f 72 73 20 28 6a 51 75 65 72 79 20 23 31 33  rors (jQuery #13
7690: 39 33 36 29 0a 09 2f 2f 20 53 75 70 70 6f 72 74  936)..// Support
76a0: 3a 20 49 45 20 31 31 2b 2c 20 45 64 67 65 20 31  : IE 11+, Edge 1
76b0: 37 20 2d 20 31 38 2b 0a 09 2f 2f 20 49 45 2f 45  7 - 18+..// IE/E
76c0: 64 67 65 20 73 6f 6d 65 74 69 6d 65 73 20 74 68  dge sometimes th
76d0: 72 6f 77 20 61 20 22 50 65 72 6d 69 73 73 69 6f  row a "Permissio
76e0: 6e 20 64 65 6e 69 65 64 22 20 65 72 72 6f 72 20  n denied" error 
76f0: 77 68 65 6e 20 73 74 72 69 63 74 2d 63 6f 6d 70  when strict-comp
7700: 61 72 69 6e 67 0a 09 2f 2f 20 74 77 6f 20 64 6f  aring..// two do
7710: 63 75 6d 65 6e 74 73 3b 20 73 68 61 6c 6c 6f 77  cuments; shallow
7720: 20 63 6f 6d 70 61 72 69 73 6f 6e 73 20 77 6f 72   comparisons wor
7730: 6b 2e 0a 09 2f 2f 20 65 73 6c 69 6e 74 2d 64 69  k...// eslint-di
7740: 73 61 62 6c 65 2d 6e 65 78 74 2d 6c 69 6e 65 20  sable-next-line 
7750: 65 71 65 71 65 71 0a 09 69 66 20 28 20 70 72 65  eqeqeq..if ( pre
7760: 66 65 72 72 65 64 44 6f 63 20 21 3d 20 64 6f 63  ferredDoc != doc
7770: 75 6d 65 6e 74 20 26 26 0a 09 09 28 20 73 75 62  ument &&...( sub
7780: 57 69 6e 64 6f 77 20 3d 20 64 6f 63 75 6d 65 6e  Window = documen
7790: 74 2e 64 65 66 61 75 6c 74 56 69 65 77 20 29 20  t.defaultView ) 
77a0: 26 26 20 73 75 62 57 69 6e 64 6f 77 2e 74 6f 70  && subWindow.top
77b0: 20 21 3d 3d 20 73 75 62 57 69 6e 64 6f 77 20 29   !== subWindow )
77c0: 20 7b 0a 0a 09 09 2f 2f 20 53 75 70 70 6f 72 74   {....// Support
77d0: 3a 20 49 45 20 31 31 2c 20 45 64 67 65 0a 09 09  : IE 11, Edge...
77e0: 69 66 20 28 20 73 75 62 57 69 6e 64 6f 77 2e 61  if ( subWindow.a
77f0: 64 64 45 76 65 6e 74 4c 69 73 74 65 6e 65 72 20  ddEventListener 
7800: 29 20 7b 0a 09 09 09 73 75 62 57 69 6e 64 6f 77  ) {....subWindow
7810: 2e 61 64 64 45 76 65 6e 74 4c 69 73 74 65 6e 65  .addEventListene
7820: 72 28 20 22 75 6e 6c 6f 61 64 22 2c 20 75 6e 6c  r( "unload", unl
7830: 6f 61 64 48 61 6e 64 6c 65 72 2c 20 66 61 6c 73  oadHandler, fals
7840: 65 20 29 3b 0a 0a 09 09 2f 2f 20 53 75 70 70 6f  e );....// Suppo
7850: 72 74 3a 20 49 45 20 39 20 2d 20 31 30 20 6f 6e  rt: IE 9 - 10 on
7860: 6c 79 0a 09 09 7d 20 65 6c 73 65 20 69 66 20 28  ly...} else if (
7870: 20 73 75 62 57 69 6e 64 6f 77 2e 61 74 74 61 63   subWindow.attac
7880: 68 45 76 65 6e 74 20 29 20 7b 0a 09 09 09 73 75  hEvent ) {....su
7890: 62 57 69 6e 64 6f 77 2e 61 74 74 61 63 68 45 76  bWindow.attachEv
78a0: 65 6e 74 28 20 22 6f 6e 75 6e 6c 6f 61 64 22 2c  ent( "onunload",
78b0: 20 75 6e 6c 6f 61 64 48 61 6e 64 6c 65 72 20 29   unloadHandler )
78c0: 3b 0a 09 09 7d 0a 09 7d 0a 0a 09 2f 2f 20 53 75  ;...}..}...// Su
78d0: 70 70 6f 72 74 3a 20 49 45 20 38 20 2d 20 31 31  pport: IE 8 - 11
78e0: 2b 2c 20 45 64 67 65 20 31 32 20 2d 20 31 38 2b  +, Edge 12 - 18+
78f0: 2c 20 43 68 72 6f 6d 65 20 3c 3d 31 36 20 2d 20  , Chrome <=16 - 
7900: 32 35 20 6f 6e 6c 79 2c 20 46 69 72 65 66 6f 78  25 only, Firefox
7910: 20 3c 3d 33 2e 36 20 2d 20 33 31 20 6f 6e 6c 79   <=3.6 - 31 only
7920: 2c 0a 09 2f 2f 20 53 61 66 61 72 69 20 34 20 2d  ,..// Safari 4 -
7930: 20 35 20 6f 6e 6c 79 2c 20 4f 70 65 72 61 20 3c   5 only, Opera <
7940: 3d 31 31 2e 36 20 2d 20 31 32 2e 78 20 6f 6e 6c  =11.6 - 12.x onl
7950: 79 0a 09 2f 2f 20 49 45 2f 45 64 67 65 20 26 20  y..// IE/Edge & 
7960: 6f 6c 64 65 72 20 62 72 6f 77 73 65 72 73 20 64  older browsers d
7970: 6f 6e 27 74 20 73 75 70 70 6f 72 74 20 74 68 65  on't support the
7980: 20 3a 73 63 6f 70 65 20 70 73 65 75 64 6f 2d 63   :scope pseudo-c
7990: 6c 61 73 73 2e 0a 09 2f 2f 20 53 75 70 70 6f 72  lass...// Suppor
79a0: 74 3a 20 53 61 66 61 72 69 20 36 2e 30 20 6f 6e  t: Safari 6.0 on
79b0: 6c 79 0a 09 2f 2f 20 53 61 66 61 72 69 20 36 2e  ly..// Safari 6.
79c0: 30 20 73 75 70 70 6f 72 74 73 20 3a 73 63 6f 70  0 supports :scop
79d0: 65 20 62 75 74 20 69 74 27 73 20 61 6e 20 61 6c  e but it's an al
79e0: 69 61 73 20 6f 66 20 3a 72 6f 6f 74 20 74 68 65  ias of :root the
79f0: 72 65 2e 0a 09 73 75 70 70 6f 72 74 2e 73 63 6f  re...support.sco
7a00: 70 65 20 3d 20 61 73 73 65 72 74 28 20 66 75 6e  pe = assert( fun
7a10: 63 74 69 6f 6e 28 20 65 6c 20 29 20 7b 0a 09 09  ction( el ) {...
7a20: 64 6f 63 45 6c 65 6d 2e 61 70 70 65 6e 64 43 68  docElem.appendCh
7a30: 69 6c 64 28 20 65 6c 20 29 2e 61 70 70 65 6e 64  ild( el ).append
7a40: 43 68 69 6c 64 28 20 64 6f 63 75 6d 65 6e 74 2e  Child( document.
7a50: 63 72 65 61 74 65 45 6c 65 6d 65 6e 74 28 20 22  createElement( "
7a60: 64 69 76 22 20 29 20 29 3b 0a 09 09 72 65 74 75  div" ) );...retu
7a70: 72 6e 20 74 79 70 65 6f 66 20 65 6c 2e 71 75 65  rn typeof el.que
7a80: 72 79 53 65 6c 65 63 74 6f 72 41 6c 6c 20 21 3d  rySelectorAll !=
7a90: 3d 20 22 75 6e 64 65 66 69 6e 65 64 22 20 26 26  = "undefined" &&
7aa0: 0a 09 09 09 21 65 6c 2e 71 75 65 72 79 53 65 6c  ....!el.querySel
7ab0: 65 63 74 6f 72 41 6c 6c 28 20 22 3a 73 63 6f 70  ectorAll( ":scop
7ac0: 65 20 66 69 65 6c 64 73 65 74 20 64 69 76 22 20  e fieldset div" 
7ad0: 29 2e 6c 65 6e 67 74 68 3b 0a 09 7d 20 29 3b 0a  ).length;..} );.
7ae0: 0a 09 2f 2a 20 41 74 74 72 69 62 75 74 65 73 0a  ../* Attributes.
7af0: 09 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .---------------
7b00: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
7b10: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
7b20: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
7b30: 2d 2d 2d 2d 2d 2d 2d 20 2a 2f 0a 0a 09 2f 2f 20  ------- */...// 
7b40: 53 75 70 70 6f 72 74 3a 20 49 45 3c 38 0a 09 2f  Support: IE<8../
7b50: 2f 20 56 65 72 69 66 79 20 74 68 61 74 20 67 65  / Verify that ge
7b60: 74 41 74 74 72 69 62 75 74 65 20 72 65 61 6c 6c  tAttribute reall
7b70: 79 20 72 65 74 75 72 6e 73 20 61 74 74 72 69 62  y returns attrib
7b80: 75 74 65 73 20 61 6e 64 20 6e 6f 74 20 70 72 6f  utes and not pro
7b90: 70 65 72 74 69 65 73 0a 09 2f 2f 20 28 65 78 63  perties..// (exc
7ba0: 65 70 74 69 6e 67 20 49 45 38 20 62 6f 6f 6c 65  epting IE8 boole
7bb0: 61 6e 73 29 0a 09 73 75 70 70 6f 72 74 2e 61 74  ans)..support.at
7bc0: 74 72 69 62 75 74 65 73 20 3d 20 61 73 73 65 72  tributes = asser
7bd0: 74 28 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c 20  t( function( el 
7be0: 29 20 7b 0a 09 09 65 6c 2e 63 6c 61 73 73 4e 61  ) {...el.classNa
7bf0: 6d 65 20 3d 20 22 69 22 3b 0a 09 09 72 65 74 75  me = "i";...retu
7c00: 72 6e 20 21 65 6c 2e 67 65 74 41 74 74 72 69 62  rn !el.getAttrib
7c10: 75 74 65 28 20 22 63 6c 61 73 73 4e 61 6d 65 22  ute( "className"
7c20: 20 29 3b 0a 09 7d 20 29 3b 0a 0a 09 2f 2a 20 67   );..} );.../* g
7c30: 65 74 45 6c 65 6d 65 6e 74 28 73 29 42 79 2a 0a  etElement(s)By*.
7c40: 09 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  .---------------
7c50: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
7c60: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
7c70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
7c80: 2d 2d 2d 2d 2d 2d 2d 20 2a 2f 0a 0a 09 2f 2f 20  ------- */...// 
7c90: 43 68 65 63 6b 20 69 66 20 67 65 74 45 6c 65 6d  Check if getElem
7ca0: 65 6e 74 73 42 79 54 61 67 4e 61 6d 65 28 22 2a  entsByTagName("*
7cb0: 22 29 20 72 65 74 75 72 6e 73 20 6f 6e 6c 79 20  ") returns only 
7cc0: 65 6c 65 6d 65 6e 74 73 0a 09 73 75 70 70 6f 72  elements..suppor
7cd0: 74 2e 67 65 74 45 6c 65 6d 65 6e 74 73 42 79 54  t.getElementsByT
7ce0: 61 67 4e 61 6d 65 20 3d 20 61 73 73 65 72 74 28  agName = assert(
7cf0: 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c 20 29 20   function( el ) 
7d00: 7b 0a 09 09 65 6c 2e 61 70 70 65 6e 64 43 68 69  {...el.appendChi
7d10: 6c 64 28 20 64 6f 63 75 6d 65 6e 74 2e 63 72 65  ld( document.cre
7d20: 61 74 65 43 6f 6d 6d 65 6e 74 28 20 22 22 20 29  ateComment( "" )
7d30: 20 29 3b 0a 09 09 72 65 74 75 72 6e 20 21 65 6c   );...return !el
7d40: 2e 67 65 74 45 6c 65 6d 65 6e 74 73 42 79 54 61  .getElementsByTa
7d50: 67 4e 61 6d 65 28 20 22 2a 22 20 29 2e 6c 65 6e  gName( "*" ).len
7d60: 67 74 68 3b 0a 09 7d 20 29 3b 0a 0a 09 2f 2f 20  gth;..} );...// 
7d70: 53 75 70 70 6f 72 74 3a 20 49 45 3c 39 0a 09 73  Support: IE<9..s
7d80: 75 70 70 6f 72 74 2e 67 65 74 45 6c 65 6d 65 6e  upport.getElemen
7d90: 74 73 42 79 43 6c 61 73 73 4e 61 6d 65 20 3d 20  tsByClassName = 
7da0: 72 6e 61 74 69 76 65 2e 74 65 73 74 28 20 64 6f  rnative.test( do
7db0: 63 75 6d 65 6e 74 2e 67 65 74 45 6c 65 6d 65 6e  cument.getElemen
7dc0: 74 73 42 79 43 6c 61 73 73 4e 61 6d 65 20 29 3b  tsByClassName );
7dd0: 0a 0a 09 2f 2f 20 53 75 70 70 6f 72 74 3a 20 49  ...// Support: I
7de0: 45 3c 31 30 0a 09 2f 2f 20 43 68 65 63 6b 20 69  E<10..// Check i
7df0: 66 20 67 65 74 45 6c 65 6d 65 6e 74 42 79 49 64  f getElementById
7e00: 20 72 65 74 75 72 6e 73 20 65 6c 65 6d 65 6e 74   returns element
7e10: 73 20 62 79 20 6e 61 6d 65 0a 09 2f 2f 20 54 68  s by name..// Th
7e20: 65 20 62 72 6f 6b 65 6e 20 67 65 74 45 6c 65 6d  e broken getElem
7e30: 65 6e 74 42 79 49 64 20 6d 65 74 68 6f 64 73 20  entById methods 
7e40: 64 6f 6e 27 74 20 70 69 63 6b 20 75 70 20 70 72  don't pick up pr
7e50: 6f 67 72 61 6d 6d 61 74 69 63 61 6c 6c 79 2d 73  ogrammatically-s
7e60: 65 74 20 6e 61 6d 65 73 2c 0a 09 2f 2f 20 73 6f  et names,..// so
7e70: 20 75 73 65 20 61 20 72 6f 75 6e 64 61 62 6f 75   use a roundabou
7e80: 74 20 67 65 74 45 6c 65 6d 65 6e 74 73 42 79 4e  t getElementsByN
7e90: 61 6d 65 20 74 65 73 74 0a 09 73 75 70 70 6f 72  ame test..suppor
7ea0: 74 2e 67 65 74 42 79 49 64 20 3d 20 61 73 73 65  t.getById = asse
7eb0: 72 74 28 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c  rt( function( el
7ec0: 20 29 20 7b 0a 09 09 64 6f 63 45 6c 65 6d 2e 61   ) {...docElem.a
7ed0: 70 70 65 6e 64 43 68 69 6c 64 28 20 65 6c 20 29  ppendChild( el )
7ee0: 2e 69 64 20 3d 20 65 78 70 61 6e 64 6f 3b 0a 09  .id = expando;..
7ef0: 09 72 65 74 75 72 6e 20 21 64 6f 63 75 6d 65 6e  .return !documen
7f00: 74 2e 67 65 74 45 6c 65 6d 65 6e 74 73 42 79 4e  t.getElementsByN
7f10: 61 6d 65 20 7c 7c 20 21 64 6f 63 75 6d 65 6e 74  ame || !document
7f20: 2e 67 65 74 45 6c 65 6d 65 6e 74 73 42 79 4e 61  .getElementsByNa
7f30: 6d 65 28 20 65 78 70 61 6e 64 6f 20 29 2e 6c 65  me( expando ).le
7f40: 6e 67 74 68 3b 0a 09 7d 20 29 3b 0a 0a 09 2f 2f  ngth;..} );...//
7f50: 20 49 44 20 66 69 6c 74 65 72 20 61 6e 64 20 66   ID filter and f
7f60: 69 6e 64 0a 09 69 66 20 28 20 73 75 70 70 6f 72  ind..if ( suppor
7f70: 74 2e 67 65 74 42 79 49 64 20 29 20 7b 0a 09 09  t.getById ) {...
7f80: 45 78 70 72 2e 66 69 6c 74 65 72 5b 20 22 49 44  Expr.filter[ "ID
7f90: 22 20 5d 20 3d 20 66 75 6e 63 74 69 6f 6e 28 20  " ] = function( 
7fa0: 69 64 20 29 20 7b 0a 09 09 09 76 61 72 20 61 74  id ) {....var at
7fb0: 74 72 49 64 20 3d 20 69 64 2e 72 65 70 6c 61 63  trId = id.replac
7fc0: 65 28 20 72 75 6e 65 73 63 61 70 65 2c 20 66 75  e( runescape, fu
7fd0: 6e 65 73 63 61 70 65 20 29 3b 0a 09 09 09 72 65  nescape );....re
7fe0: 74 75 72 6e 20 66 75 6e 63 74 69 6f 6e 28 20 65  turn function( e
7ff0: 6c 65 6d 20 29 20 7b 0a 09 09 09 09 72 65 74 75  lem ) {.....retu
8000: 72 6e 20 65 6c 65 6d 2e 67 65 74 41 74 74 72 69  rn elem.getAttri
8010: 62 75 74 65 28 20 22 69 64 22 20 29 20 3d 3d 3d  bute( "id" ) ===
8020: 20 61 74 74 72 49 64 3b 0a 09 09 09 7d 3b 0a 09   attrId;....};..
8030: 09 7d 3b 0a 09 09 45 78 70 72 2e 66 69 6e 64 5b  .};...Expr.find[
8040: 20 22 49 44 22 20 5d 20 3d 20 66 75 6e 63 74 69   "ID" ] = functi
8050: 6f 6e 28 20 69 64 2c 20 63 6f 6e 74 65 78 74 20  on( id, context 
8060: 29 20 7b 0a 09 09 09 69 66 20 28 20 74 79 70 65  ) {....if ( type
8070: 6f 66 20 63 6f 6e 74 65 78 74 2e 67 65 74 45 6c  of context.getEl
8080: 65 6d 65 6e 74 42 79 49 64 20 21 3d 3d 20 22 75  ementById !== "u
8090: 6e 64 65 66 69 6e 65 64 22 20 26 26 20 64 6f 63  ndefined" && doc
80a0: 75 6d 65 6e 74 49 73 48 54 4d 4c 20 29 20 7b 0a  umentIsHTML ) {.
80b0: 09 09 09 09 76 61 72 20 65 6c 65 6d 20 3d 20 63  ....var elem = c
80c0: 6f 6e 74 65 78 74 2e 67 65 74 45 6c 65 6d 65 6e  ontext.getElemen
80d0: 74 42 79 49 64 28 20 69 64 20 29 3b 0a 09 09 09  tById( id );....
80e0: 09 72 65 74 75 72 6e 20 65 6c 65 6d 20 3f 20 5b  .return elem ? [
80f0: 20 65 6c 65 6d 20 5d 20 3a 20 5b 5d 3b 0a 09 09   elem ] : [];...
8100: 09 7d 0a 09 09 7d 3b 0a 09 7d 20 65 6c 73 65 20  .}...};..} else 
8110: 7b 0a 09 09 45 78 70 72 2e 66 69 6c 74 65 72 5b  {...Expr.filter[
8120: 20 22 49 44 22 20 5d 20 3d 20 20 66 75 6e 63 74   "ID" ] =  funct
8130: 69 6f 6e 28 20 69 64 20 29 20 7b 0a 09 09 09 76  ion( id ) {....v
8140: 61 72 20 61 74 74 72 49 64 20 3d 20 69 64 2e 72  ar attrId = id.r
8150: 65 70 6c 61 63 65 28 20 72 75 6e 65 73 63 61 70  eplace( runescap
8160: 65 2c 20 66 75 6e 65 73 63 61 70 65 20 29 3b 0a  e, funescape );.
8170: 09 09 09 72 65 74 75 72 6e 20 66 75 6e 63 74 69  ...return functi
8180: 6f 6e 28 20 65 6c 65 6d 20 29 20 7b 0a 09 09 09  on( elem ) {....
8190: 09 76 61 72 20 6e 6f 64 65 20 3d 20 74 79 70 65  .var node = type
81a0: 6f 66 20 65 6c 65 6d 2e 67 65 74 41 74 74 72 69  of elem.getAttri
81b0: 62 75 74 65 4e 6f 64 65 20 21 3d 3d 20 22 75 6e  buteNode !== "un
81c0: 64 65 66 69 6e 65 64 22 20 26 26 0a 09 09 09 09  defined" &&.....
81d0: 09 65 6c 65 6d 2e 67 65 74 41 74 74 72 69 62 75  .elem.getAttribu
81e0: 74 65 4e 6f 64 65 28 20 22 69 64 22 20 29 3b 0a  teNode( "id" );.
81f0: 09 09 09 09 72 65 74 75 72 6e 20 6e 6f 64 65 20  ....return node 
8200: 26 26 20 6e 6f 64 65 2e 76 61 6c 75 65 20 3d 3d  && node.value ==
8210: 3d 20 61 74 74 72 49 64 3b 0a 09 09 09 7d 3b 0a  = attrId;....};.
8220: 09 09 7d 3b 0a 0a 09 09 2f 2f 20 53 75 70 70 6f  ..};....// Suppo
8230: 72 74 3a 20 49 45 20 36 20 2d 20 37 20 6f 6e 6c  rt: IE 6 - 7 onl
8240: 79 0a 09 09 2f 2f 20 67 65 74 45 6c 65 6d 65 6e  y...// getElemen
8250: 74 42 79 49 64 20 69 73 20 6e 6f 74 20 72 65 6c  tById is not rel
8260: 69 61 62 6c 65 20 61 73 20 61 20 66 69 6e 64 20  iable as a find 
8270: 73 68 6f 72 74 63 75 74 0a 09 09 45 78 70 72 2e  shortcut...Expr.
8280: 66 69 6e 64 5b 20 22 49 44 22 20 5d 20 3d 20 66  find[ "ID" ] = f
8290: 75 6e 63 74 69 6f 6e 28 20 69 64 2c 20 63 6f 6e  unction( id, con
82a0: 74 65 78 74 20 29 20 7b 0a 09 09 09 69 66 20 28  text ) {....if (
82b0: 20 74 79 70 65 6f 66 20 63 6f 6e 74 65 78 74 2e   typeof context.
82c0: 67 65 74 45 6c 65 6d 65 6e 74 42 79 49 64 20 21  getElementById !
82d0: 3d 3d 20 22 75 6e 64 65 66 69 6e 65 64 22 20 26  == "undefined" &
82e0: 26 20 64 6f 63 75 6d 65 6e 74 49 73 48 54 4d 4c  & documentIsHTML
82f0: 20 29 20 7b 0a 09 09 09 09 76 61 72 20 6e 6f 64   ) {.....var nod
8300: 65 2c 20 69 2c 20 65 6c 65 6d 73 2c 0a 09 09 09  e, i, elems,....
8310: 09 09 65 6c 65 6d 20 3d 20 63 6f 6e 74 65 78 74  ..elem = context
8320: 2e 67 65 74 45 6c 65 6d 65 6e 74 42 79 49 64 28  .getElementById(
8330: 20 69 64 20 29 3b 0a 0a 09 09 09 09 69 66 20 28   id );......if (
8340: 20 65 6c 65 6d 20 29 20 7b 0a 0a 09 09 09 09 09   elem ) {.......
8350: 2f 2f 20 56 65 72 69 66 79 20 74 68 65 20 69 64  // Verify the id
8360: 20 61 74 74 72 69 62 75 74 65 0a 09 09 09 09 09   attribute......
8370: 6e 6f 64 65 20 3d 20 65 6c 65 6d 2e 67 65 74 41  node = elem.getA
8380: 74 74 72 69 62 75 74 65 4e 6f 64 65 28 20 22 69  ttributeNode( "i
8390: 64 22 20 29 3b 0a 09 09 09 09 09 69 66 20 28 20  d" );......if ( 
83a0: 6e 6f 64 65 20 26 26 20 6e 6f 64 65 2e 76 61 6c  node && node.val
83b0: 75 65 20 3d 3d 3d 20 69 64 20 29 20 7b 0a 09 09  ue === id ) {...
83c0: 09 09 09 09 72 65 74 75 72 6e 20 5b 20 65 6c 65  ....return [ ele
83d0: 6d 20 5d 3b 0a 09 09 09 09 09 7d 0a 0a 09 09 09  m ];......}.....
83e0: 09 09 2f 2f 20 46 61 6c 6c 20 62 61 63 6b 20 6f  ..// Fall back o
83f0: 6e 20 67 65 74 45 6c 65 6d 65 6e 74 73 42 79 4e  n getElementsByN
8400: 61 6d 65 0a 09 09 09 09 09 65 6c 65 6d 73 20 3d  ame......elems =
8410: 20 63 6f 6e 74 65 78 74 2e 67 65 74 45 6c 65 6d   context.getElem
8420: 65 6e 74 73 42 79 4e 61 6d 65 28 20 69 64 20 29  entsByName( id )
8430: 3b 0a 09 09 09 09 09 69 20 3d 20 30 3b 0a 09 09  ;......i = 0;...
8440: 09 09 09 77 68 69 6c 65 20 28 20 28 20 65 6c 65  ...while ( ( ele
8450: 6d 20 3d 20 65 6c 65 6d 73 5b 20 69 2b 2b 20 5d  m = elems[ i++ ]
8460: 20 29 20 29 20 7b 0a 09 09 09 09 09 09 6e 6f 64   ) ) {.......nod
8470: 65 20 3d 20 65 6c 65 6d 2e 67 65 74 41 74 74 72  e = elem.getAttr
8480: 69 62 75 74 65 4e 6f 64 65 28 20 22 69 64 22 20  ibuteNode( "id" 
8490: 29 3b 0a 09 09 09 09 09 09 69 66 20 28 20 6e 6f  );.......if ( no
84a0: 64 65 20 26 26 20 6e 6f 64 65 2e 76 61 6c 75 65  de && node.value
84b0: 20 3d 3d 3d 20 69 64 20 29 20 7b 0a 09 09 09 09   === id ) {.....
84c0: 09 09 09 72 65 74 75 72 6e 20 5b 20 65 6c 65 6d  ...return [ elem
84d0: 20 5d 3b 0a 09 09 09 09 09 09 7d 0a 09 09 09 09   ];.......}.....
84e0: 09 7d 0a 09 09 09 09 7d 0a 0a 09 09 09 09 72 65  .}.....}......re
84f0: 74 75 72 6e 20 5b 5d 3b 0a 09 09 09 7d 0a 09 09  turn [];....}...
8500: 7d 3b 0a 09 7d 0a 0a 09 2f 2f 20 54 61 67 0a 09  };..}...// Tag..
8510: 45 78 70 72 2e 66 69 6e 64 5b 20 22 54 41 47 22  Expr.find[ "TAG"
8520: 20 5d 20 3d 20 73 75 70 70 6f 72 74 2e 67 65 74   ] = support.get
8530: 45 6c 65 6d 65 6e 74 73 42 79 54 61 67 4e 61 6d  ElementsByTagNam
8540: 65 20 3f 0a 09 09 66 75 6e 63 74 69 6f 6e 28 20  e ?...function( 
8550: 74 61 67 2c 20 63 6f 6e 74 65 78 74 20 29 20 7b  tag, context ) {
8560: 0a 09 09 09 69 66 20 28 20 74 79 70 65 6f 66 20  ....if ( typeof 
8570: 63 6f 6e 74 65 78 74 2e 67 65 74 45 6c 65 6d 65  context.getEleme
8580: 6e 74 73 42 79 54 61 67 4e 61 6d 65 20 21 3d 3d  ntsByTagName !==
8590: 20 22 75 6e 64 65 66 69 6e 65 64 22 20 29 20 7b   "undefined" ) {
85a0: 0a 09 09 09 09 72 65 74 75 72 6e 20 63 6f 6e 74  .....return cont
85b0: 65 78 74 2e 67 65 74 45 6c 65 6d 65 6e 74 73 42  ext.getElementsB
85c0: 79 54 61 67 4e 61 6d 65 28 20 74 61 67 20 29 3b  yTagName( tag );
85d0: 0a 0a 09 09 09 2f 2f 20 44 6f 63 75 6d 65 6e 74  .....// Document
85e0: 46 72 61 67 6d 65 6e 74 20 6e 6f 64 65 73 20 64  Fragment nodes d
85f0: 6f 6e 27 74 20 68 61 76 65 20 67 45 42 54 4e 0a  on't have gEBTN.
8600: 09 09 09 7d 20 65 6c 73 65 20 69 66 20 28 20 73  ...} else if ( s
8610: 75 70 70 6f 72 74 2e 71 73 61 20 29 20 7b 0a 09  upport.qsa ) {..
8620: 09 09 09 72 65 74 75 72 6e 20 63 6f 6e 74 65 78  ...return contex
8630: 74 2e 71 75 65 72 79 53 65 6c 65 63 74 6f 72 41  t.querySelectorA
8640: 6c 6c 28 20 74 61 67 20 29 3b 0a 09 09 09 7d 0a  ll( tag );....}.
8650: 09 09 7d 20 3a 0a 0a 09 09 66 75 6e 63 74 69 6f  ..} :....functio
8660: 6e 28 20 74 61 67 2c 20 63 6f 6e 74 65 78 74 20  n( tag, context 
8670: 29 20 7b 0a 09 09 09 76 61 72 20 65 6c 65 6d 2c  ) {....var elem,
8680: 0a 09 09 09 09 74 6d 70 20 3d 20 5b 5d 2c 0a 09  .....tmp = [],..
8690: 09 09 09 69 20 3d 20 30 2c 0a 0a 09 09 09 09 2f  ...i = 0,....../
86a0: 2f 20 42 79 20 68 61 70 70 79 20 63 6f 69 6e 63  / By happy coinc
86b0: 69 64 65 6e 63 65 2c 20 61 20 28 62 72 6f 6b 65  idence, a (broke
86c0: 6e 29 20 67 45 42 54 4e 20 61 70 70 65 61 72 73  n) gEBTN appears
86d0: 20 6f 6e 20 44 6f 63 75 6d 65 6e 74 46 72 61 67   on DocumentFrag
86e0: 6d 65 6e 74 20 6e 6f 64 65 73 20 74 6f 6f 0a 09  ment nodes too..
86f0: 09 09 09 72 65 73 75 6c 74 73 20 3d 20 63 6f 6e  ...results = con
8700: 74 65 78 74 2e 67 65 74 45 6c 65 6d 65 6e 74 73  text.getElements
8710: 42 79 54 61 67 4e 61 6d 65 28 20 74 61 67 20 29  ByTagName( tag )
8720: 3b 0a 0a 09 09 09 2f 2f 20 46 69 6c 74 65 72 20  ;.....// Filter 
8730: 6f 75 74 20 70 6f 73 73 69 62 6c 65 20 63 6f 6d  out possible com
8740: 6d 65 6e 74 73 0a 09 09 09 69 66 20 28 20 74 61  ments....if ( ta
8750: 67 20 3d 3d 3d 20 22 2a 22 20 29 20 7b 0a 09 09  g === "*" ) {...
8760: 09 09 77 68 69 6c 65 20 28 20 28 20 65 6c 65 6d  ..while ( ( elem
8770: 20 3d 20 72 65 73 75 6c 74 73 5b 20 69 2b 2b 20   = results[ i++ 
8780: 5d 20 29 20 29 20 7b 0a 09 09 09 09 09 69 66 20  ] ) ) {......if 
8790: 28 20 65 6c 65 6d 2e 6e 6f 64 65 54 79 70 65 20  ( elem.nodeType 
87a0: 3d 3d 3d 20 31 20 29 20 7b 0a 09 09 09 09 09 09  === 1 ) {.......
87b0: 74 6d 70 2e 70 75 73 68 28 20 65 6c 65 6d 20 29  tmp.push( elem )
87c0: 3b 0a 09 09 09 09 09 7d 0a 09 09 09 09 7d 0a 0a  ;......}.....}..
87d0: 09 09 09 09 72 65 74 75 72 6e 20 74 6d 70 3b 0a  ....return tmp;.
87e0: 09 09 09 7d 0a 09 09 09 72 65 74 75 72 6e 20 72  ...}....return r
87f0: 65 73 75 6c 74 73 3b 0a 09 09 7d 3b 0a 0a 09 2f  esults;...};.../
8800: 2f 20 43 6c 61 73 73 0a 09 45 78 70 72 2e 66 69  / Class..Expr.fi
8810: 6e 64 5b 20 22 43 4c 41 53 53 22 20 5d 20 3d 20  nd[ "CLASS" ] = 
8820: 73 75 70 70 6f 72 74 2e 67 65 74 45 6c 65 6d 65  support.getEleme
8830: 6e 74 73 42 79 43 6c 61 73 73 4e 61 6d 65 20 26  ntsByClassName &
8840: 26 20 66 75 6e 63 74 69 6f 6e 28 20 63 6c 61 73  & function( clas
8850: 73 4e 61 6d 65 2c 20 63 6f 6e 74 65 78 74 20 29  sName, context )
8860: 20 7b 0a 09 09 69 66 20 28 20 74 79 70 65 6f 66   {...if ( typeof
8870: 20 63 6f 6e 74 65 78 74 2e 67 65 74 45 6c 65 6d   context.getElem
8880: 65 6e 74 73 42 79 43 6c 61 73 73 4e 61 6d 65 20  entsByClassName 
8890: 21 3d 3d 20 22 75 6e 64 65 66 69 6e 65 64 22 20  !== "undefined" 
88a0: 26 26 20 64 6f 63 75 6d 65 6e 74 49 73 48 54 4d  && documentIsHTM
88b0: 4c 20 29 20 7b 0a 09 09 09 72 65 74 75 72 6e 20  L ) {....return 
88c0: 63 6f 6e 74 65 78 74 2e 67 65 74 45 6c 65 6d 65  context.getEleme
88d0: 6e 74 73 42 79 43 6c 61 73 73 4e 61 6d 65 28 20  ntsByClassName( 
88e0: 63 6c 61 73 73 4e 61 6d 65 20 29 3b 0a 09 09 7d  className );...}
88f0: 0a 09 7d 3b 0a 0a 09 2f 2a 20 51 53 41 2f 6d 61  ..};.../* QSA/ma
8900: 74 63 68 65 73 53 65 6c 65 63 74 6f 72 0a 09 2d  tchesSelector..-
8910: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
8920: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
8930: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
8940: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
8950: 2d 2d 2d 2d 2d 20 2a 2f 0a 0a 09 2f 2f 20 51 53  ----- */...// QS
8960: 41 20 61 6e 64 20 6d 61 74 63 68 65 73 53 65 6c  A and matchesSel
8970: 65 63 74 6f 72 20 73 75 70 70 6f 72 74 0a 0a 09  ector support...
8980: 2f 2f 20 6d 61 74 63 68 65 73 53 65 6c 65 63 74  // matchesSelect
8990: 6f 72 28 3a 61 63 74 69 76 65 29 20 72 65 70 6f  or(:active) repo
89a0: 72 74 73 20 66 61 6c 73 65 20 77 68 65 6e 20 74  rts false when t
89b0: 72 75 65 20 28 49 45 39 2f 4f 70 65 72 61 20 31  rue (IE9/Opera 1
89c0: 31 2e 35 29 0a 09 72 62 75 67 67 79 4d 61 74 63  1.5)..rbuggyMatc
89d0: 68 65 73 20 3d 20 5b 5d 3b 0a 0a 09 2f 2f 20 71  hes = [];...// q
89e0: 53 61 28 3a 66 6f 63 75 73 29 20 72 65 70 6f 72  Sa(:focus) repor
89f0: 74 73 20 66 61 6c 73 65 20 77 68 65 6e 20 74 72  ts false when tr
8a00: 75 65 20 28 43 68 72 6f 6d 65 20 32 31 29 0a 09  ue (Chrome 21)..
8a10: 2f 2f 20 57 65 20 61 6c 6c 6f 77 20 74 68 69 73  // We allow this
8a20: 20 62 65 63 61 75 73 65 20 6f 66 20 61 20 62 75   because of a bu
8a30: 67 20 69 6e 20 49 45 38 2f 39 20 74 68 61 74 20  g in IE8/9 that 
8a40: 74 68 72 6f 77 73 20 61 6e 20 65 72 72 6f 72 0a  throws an error.
8a50: 09 2f 2f 20 77 68 65 6e 65 76 65 72 20 60 64 6f  .// whenever `do
8a60: 63 75 6d 65 6e 74 2e 61 63 74 69 76 65 45 6c 65  cument.activeEle
8a70: 6d 65 6e 74 60 20 69 73 20 61 63 63 65 73 73 65  ment` is accesse
8a80: 64 20 6f 6e 20 61 6e 20 69 66 72 61 6d 65 0a 09  d on an iframe..
8a90: 2f 2f 20 53 6f 2c 20 77 65 20 61 6c 6c 6f 77 20  // So, we allow 
8aa0: 3a 66 6f 63 75 73 20 74 6f 20 70 61 73 73 20 74  :focus to pass t
8ab0: 68 72 6f 75 67 68 20 51 53 41 20 61 6c 6c 20 74  hrough QSA all t
8ac0: 68 65 20 74 69 6d 65 20 74 6f 20 61 76 6f 69 64  he time to avoid
8ad0: 20 74 68 65 20 49 45 20 65 72 72 6f 72 0a 09 2f   the IE error../
8ae0: 2f 20 53 65 65 20 68 74 74 70 73 3a 2f 2f 62 75  / See https://bu
8af0: 67 73 2e 6a 71 75 65 72 79 2e 63 6f 6d 2f 74 69  gs.jquery.com/ti
8b00: 63 6b 65 74 2f 31 33 33 37 38 0a 09 72 62 75 67  cket/13378..rbug
8b10: 67 79 51 53 41 20 3d 20 5b 5d 3b 0a 0a 09 69 66  gyQSA = [];...if
8b20: 20 28 20 28 20 73 75 70 70 6f 72 74 2e 71 73 61   ( ( support.qsa
8b30: 20 3d 20 72 6e 61 74 69 76 65 2e 74 65 73 74 28   = rnative.test(
8b40: 20 64 6f 63 75 6d 65 6e 74 2e 71 75 65 72 79 53   document.queryS
8b50: 65 6c 65 63 74 6f 72 41 6c 6c 20 29 20 29 20 29  electorAll ) ) )
8b60: 20 7b 0a 0a 09 09 2f 2f 20 42 75 69 6c 64 20 51   {....// Build Q
8b70: 53 41 20 72 65 67 65 78 0a 09 09 2f 2f 20 52 65  SA regex...// Re
8b80: 67 65 78 20 73 74 72 61 74 65 67 79 20 61 64 6f  gex strategy ado
8b90: 70 74 65 64 20 66 72 6f 6d 20 44 69 65 67 6f 20  pted from Diego 
8ba0: 50 65 72 69 6e 69 0a 09 09 61 73 73 65 72 74 28  Perini...assert(
8bb0: 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c 20 29 20   function( el ) 
8bc0: 7b 0a 0a 09 09 09 76 61 72 20 69 6e 70 75 74 3b  {.....var input;
8bd0: 0a 0a 09 09 09 2f 2f 20 53 65 6c 65 63 74 20 69  .....// Select i
8be0: 73 20 73 65 74 20 74 6f 20 65 6d 70 74 79 20 73  s set to empty s
8bf0: 74 72 69 6e 67 20 6f 6e 20 70 75 72 70 6f 73 65  tring on purpose
8c00: 0a 09 09 09 2f 2f 20 54 68 69 73 20 69 73 20 74  ....// This is t
8c10: 6f 20 74 65 73 74 20 49 45 27 73 20 74 72 65 61  o test IE's trea
8c20: 74 6d 65 6e 74 20 6f 66 20 6e 6f 74 20 65 78 70  tment of not exp
8c30: 6c 69 63 69 74 6c 79 0a 09 09 09 2f 2f 20 73 65  licitly....// se
8c40: 74 74 69 6e 67 20 61 20 62 6f 6f 6c 65 61 6e 20  tting a boolean 
8c50: 63 6f 6e 74 65 6e 74 20 61 74 74 72 69 62 75 74  content attribut
8c60: 65 2c 0a 09 09 09 2f 2f 20 73 69 6e 63 65 20 69  e,....// since i
8c70: 74 73 20 70 72 65 73 65 6e 63 65 20 73 68 6f 75  ts presence shou
8c80: 6c 64 20 62 65 20 65 6e 6f 75 67 68 0a 09 09 09  ld be enough....
8c90: 2f 2f 20 68 74 74 70 73 3a 2f 2f 62 75 67 73 2e  // https://bugs.
8ca0: 6a 71 75 65 72 79 2e 63 6f 6d 2f 74 69 63 6b 65  jquery.com/ticke
8cb0: 74 2f 31 32 33 35 39 0a 09 09 09 64 6f 63 45 6c  t/12359....docEl
8cc0: 65 6d 2e 61 70 70 65 6e 64 43 68 69 6c 64 28 20  em.appendChild( 
8cd0: 65 6c 20 29 2e 69 6e 6e 65 72 48 54 4d 4c 20 3d  el ).innerHTML =
8ce0: 20 22 3c 61 20 69 64 3d 27 22 20 2b 20 65 78 70   "<a id='" + exp
8cf0: 61 6e 64 6f 20 2b 20 22 27 3e 3c 2f 61 3e 22 20  ando + "'></a>" 
8d00: 2b 0a 09 09 09 09 22 3c 73 65 6c 65 63 74 20 69  +....."<select i
8d10: 64 3d 27 22 20 2b 20 65 78 70 61 6e 64 6f 20 2b  d='" + expando +
8d20: 20 22 2d 5c 72 5c 5c 27 20 6d 73 61 6c 6c 6f 77   "-\r\\' msallow
8d30: 63 61 70 74 75 72 65 3d 27 27 3e 22 20 2b 0a 09  capture=''>" +..
8d40: 09 09 09 22 3c 6f 70 74 69 6f 6e 20 73 65 6c 65  ..."<option sele
8d50: 63 74 65 64 3d 27 27 3e 3c 2f 6f 70 74 69 6f 6e  cted=''></option
8d60: 3e 3c 2f 73 65 6c 65 63 74 3e 22 3b 0a 0a 09 09  ></select>";....
8d70: 09 2f 2f 20 53 75 70 70 6f 72 74 3a 20 49 45 38  .// Support: IE8
8d80: 2c 20 4f 70 65 72 61 20 31 31 2d 31 32 2e 31 36  , Opera 11-12.16
8d90: 0a 09 09 09 2f 2f 20 4e 6f 74 68 69 6e 67 20 73  ....// Nothing s
8da0: 68 6f 75 6c 64 20 62 65 20 73 65 6c 65 63 74 65  hould be selecte
8db0: 64 20 77 68 65 6e 20 65 6d 70 74 79 20 73 74 72  d when empty str
8dc0: 69 6e 67 73 20 66 6f 6c 6c 6f 77 20 5e 3d 20 6f  ings follow ^= o
8dd0: 72 20 24 3d 20 6f 72 20 2a 3d 0a 09 09 09 2f 2f  r $= or *=....//
8de0: 20 54 68 65 20 74 65 73 74 20 61 74 74 72 69 62   The test attrib
8df0: 75 74 65 20 6d 75 73 74 20 62 65 20 75 6e 6b 6e  ute must be unkn
8e00: 6f 77 6e 20 69 6e 20 4f 70 65 72 61 20 62 75 74  own in Opera but
8e10: 20 22 73 61 66 65 22 20 66 6f 72 20 57 69 6e 52   "safe" for WinR
8e20: 54 0a 09 09 09 2f 2f 20 68 74 74 70 73 3a 2f 2f  T....// https://
8e30: 6d 73 64 6e 2e 6d 69 63 72 6f 73 6f 66 74 2e 63  msdn.microsoft.c
8e40: 6f 6d 2f 65 6e 2d 75 73 2f 6c 69 62 72 61 72 79  om/en-us/library
8e50: 2f 69 65 2f 68 68 34 36 35 33 38 38 2e 61 73 70  /ie/hh465388.asp
8e60: 78 23 61 74 74 72 69 62 75 74 65 5f 73 65 63 74  x#attribute_sect
8e70: 69 6f 6e 0a 09 09 09 69 66 20 28 20 65 6c 2e 71  ion....if ( el.q
8e80: 75 65 72 79 53 65 6c 65 63 74 6f 72 41 6c 6c 28  uerySelectorAll(
8e90: 20 22 5b 6d 73 61 6c 6c 6f 77 63 61 70 74 75 72   "[msallowcaptur
8ea0: 65 5e 3d 27 27 5d 22 20 29 2e 6c 65 6e 67 74 68  e^='']" ).length
8eb0: 20 29 20 7b 0a 09 09 09 09 72 62 75 67 67 79 51   ) {.....rbuggyQ
8ec0: 53 41 2e 70 75 73 68 28 20 22 5b 2a 5e 24 5d 3d  SA.push( "[*^$]=
8ed0: 22 20 2b 20 77 68 69 74 65 73 70 61 63 65 20 2b  " + whitespace +
8ee0: 20 22 2a 28 3f 3a 27 27 7c 5c 22 5c 22 29 22 20   "*(?:''|\"\")" 
8ef0: 29 3b 0a 09 09 09 7d 0a 0a 09 09 09 2f 2f 20 53  );....}.....// S
8f00: 75 70 70 6f 72 74 3a 20 49 45 38 0a 09 09 09 2f  upport: IE8..../
8f10: 2f 20 42 6f 6f 6c 65 61 6e 20 61 74 74 72 69 62  / Boolean attrib
8f20: 75 74 65 73 20 61 6e 64 20 22 76 61 6c 75 65 22  utes and "value"
8f30: 20 61 72 65 20 6e 6f 74 20 74 72 65 61 74 65 64   are not treated
8f40: 20 63 6f 72 72 65 63 74 6c 79 0a 09 09 09 69 66   correctly....if
8f50: 20 28 20 21 65 6c 2e 71 75 65 72 79 53 65 6c 65   ( !el.querySele
8f60: 63 74 6f 72 41 6c 6c 28 20 22 5b 73 65 6c 65 63  ctorAll( "[selec
8f70: 74 65 64 5d 22 20 29 2e 6c 65 6e 67 74 68 20 29  ted]" ).length )
8f80: 20 7b 0a 09 09 09 09 72 62 75 67 67 79 51 53 41   {.....rbuggyQSA
8f90: 2e 70 75 73 68 28 20 22 5c 5c 5b 22 20 2b 20 77  .push( "\\[" + w
8fa0: 68 69 74 65 73 70 61 63 65 20 2b 20 22 2a 28 3f  hitespace + "*(?
8fb0: 3a 76 61 6c 75 65 7c 22 20 2b 20 62 6f 6f 6c 65  :value|" + boole
8fc0: 61 6e 73 20 2b 20 22 29 22 20 29 3b 0a 09 09 09  ans + ")" );....
8fd0: 7d 0a 0a 09 09 09 2f 2f 20 53 75 70 70 6f 72 74  }.....// Support
8fe0: 3a 20 43 68 72 6f 6d 65 3c 32 39 2c 20 41 6e 64  : Chrome<29, And
8ff0: 72 6f 69 64 3c 34 2e 34 2c 20 53 61 66 61 72 69  roid<4.4, Safari
9000: 3c 37 2e 30 2b 2c 20 69 4f 53 3c 37 2e 30 2b 2c  <7.0+, iOS<7.0+,
9010: 20 50 68 61 6e 74 6f 6d 4a 53 3c 31 2e 39 2e 38   PhantomJS<1.9.8
9020: 2b 0a 09 09 09 69 66 20 28 20 21 65 6c 2e 71 75  +....if ( !el.qu
9030: 65 72 79 53 65 6c 65 63 74 6f 72 41 6c 6c 28 20  erySelectorAll( 
9040: 22 5b 69 64 7e 3d 22 20 2b 20 65 78 70 61 6e 64  "[id~=" + expand
9050: 6f 20 2b 20 22 2d 5d 22 20 29 2e 6c 65 6e 67 74  o + "-]" ).lengt
9060: 68 20 29 20 7b 0a 09 09 09 09 72 62 75 67 67 79  h ) {.....rbuggy
9070: 51 53 41 2e 70 75 73 68 28 20 22 7e 3d 22 20 29  QSA.push( "~=" )
9080: 3b 0a 09 09 09 7d 0a 0a 09 09 09 2f 2f 20 53 75  ;....}.....// Su
9090: 70 70 6f 72 74 3a 20 49 45 20 31 31 2b 2c 20 45  pport: IE 11+, E
90a0: 64 67 65 20 31 35 20 2d 20 31 38 2b 0a 09 09 09  dge 15 - 18+....
90b0: 2f 2f 20 49 45 20 31 31 2f 45 64 67 65 20 64 6f  // IE 11/Edge do
90c0: 6e 27 74 20 66 69 6e 64 20 65 6c 65 6d 65 6e 74  n't find element
90d0: 73 20 6f 6e 20 61 20 60 5b 6e 61 6d 65 3d 27 27  s on a `[name=''
90e0: 5d 60 20 71 75 65 72 79 20 69 6e 20 73 6f 6d 65  ]` query in some
90f0: 20 63 61 73 65 73 2e 0a 09 09 09 2f 2f 20 41 64   cases.....// Ad
9100: 64 69 6e 67 20 61 20 74 65 6d 70 6f 72 61 72 79  ding a temporary
9110: 20 61 74 74 72 69 62 75 74 65 20 74 6f 20 74 68   attribute to th
9120: 65 20 64 6f 63 75 6d 65 6e 74 20 62 65 66 6f 72  e document befor
9130: 65 20 74 68 65 20 73 65 6c 65 63 74 69 6f 6e 20  e the selection 
9140: 77 6f 72 6b 73 0a 09 09 09 2f 2f 20 61 72 6f 75  works....// arou
9150: 6e 64 20 74 68 65 20 69 73 73 75 65 2e 0a 09 09  nd the issue....
9160: 09 2f 2f 20 49 6e 74 65 72 65 73 74 69 6e 67 6c  .// Interestingl
9170: 79 2c 20 49 45 20 31 30 20 26 20 6f 6c 64 65 72  y, IE 10 & older
9180: 20 64 6f 6e 27 74 20 73 65 65 6d 20 74 6f 20 68   don't seem to h
9190: 61 76 65 20 74 68 65 20 69 73 73 75 65 2e 0a 09  ave the issue...
91a0: 09 09 69 6e 70 75 74 20 3d 20 64 6f 63 75 6d 65  ..input = docume
91b0: 6e 74 2e 63 72 65 61 74 65 45 6c 65 6d 65 6e 74  nt.createElement
91c0: 28 20 22 69 6e 70 75 74 22 20 29 3b 0a 09 09 09  ( "input" );....
91d0: 69 6e 70 75 74 2e 73 65 74 41 74 74 72 69 62 75  input.setAttribu
91e0: 74 65 28 20 22 6e 61 6d 65 22 2c 20 22 22 20 29  te( "name", "" )
91f0: 3b 0a 09 09 09 65 6c 2e 61 70 70 65 6e 64 43 68  ;....el.appendCh
9200: 69 6c 64 28 20 69 6e 70 75 74 20 29 3b 0a 09 09  ild( input );...
9210: 09 69 66 20 28 20 21 65 6c 2e 71 75 65 72 79 53  .if ( !el.queryS
9220: 65 6c 65 63 74 6f 72 41 6c 6c 28 20 22 5b 6e 61  electorAll( "[na
9230: 6d 65 3d 27 27 5d 22 20 29 2e 6c 65 6e 67 74 68  me='']" ).length
9240: 20 29 20 7b 0a 09 09 09 09 72 62 75 67 67 79 51   ) {.....rbuggyQ
9250: 53 41 2e 70 75 73 68 28 20 22 5c 5c 5b 22 20 2b  SA.push( "\\[" +
9260: 20 77 68 69 74 65 73 70 61 63 65 20 2b 20 22 2a   whitespace + "*
9270: 6e 61 6d 65 22 20 2b 20 77 68 69 74 65 73 70 61  name" + whitespa
9280: 63 65 20 2b 20 22 2a 3d 22 20 2b 0a 09 09 09 09  ce + "*=" +.....
9290: 09 77 68 69 74 65 73 70 61 63 65 20 2b 20 22 2a  .whitespace + "*
92a0: 28 3f 3a 27 27 7c 5c 22 5c 22 29 22 20 29 3b 0a  (?:''|\"\")" );.
92b0: 09 09 09 7d 0a 0a 09 09 09 2f 2f 20 57 65 62 6b  ...}.....// Webk
92c0: 69 74 2f 4f 70 65 72 61 20 2d 20 3a 63 68 65 63  it/Opera - :chec
92d0: 6b 65 64 20 73 68 6f 75 6c 64 20 72 65 74 75 72  ked should retur
92e0: 6e 20 73 65 6c 65 63 74 65 64 20 6f 70 74 69 6f  n selected optio
92f0: 6e 20 65 6c 65 6d 65 6e 74 73 0a 09 09 09 2f 2f  n elements....//
9300: 20 68 74 74 70 3a 2f 2f 77 77 77 2e 77 33 2e 6f   http://www.w3.o
9310: 72 67 2f 54 52 2f 32 30 31 31 2f 52 45 43 2d 63  rg/TR/2011/REC-c
9320: 73 73 33 2d 73 65 6c 65 63 74 6f 72 73 2d 32 30  ss3-selectors-20
9330: 31 31 30 39 32 39 2f 23 63 68 65 63 6b 65 64 0a  110929/#checked.
9340: 09 09 09 2f 2f 20 49 45 38 20 74 68 72 6f 77 73  ...// IE8 throws
9350: 20 65 72 72 6f 72 20 68 65 72 65 20 61 6e 64 20   error here and 
9360: 77 69 6c 6c 20 6e 6f 74 20 73 65 65 20 6c 61 74  will not see lat
9370: 65 72 20 74 65 73 74 73 0a 09 09 09 69 66 20 28  er tests....if (
9380: 20 21 65 6c 2e 71 75 65 72 79 53 65 6c 65 63 74   !el.querySelect
9390: 6f 72 41 6c 6c 28 20 22 3a 63 68 65 63 6b 65 64  orAll( ":checked
93a0: 22 20 29 2e 6c 65 6e 67 74 68 20 29 20 7b 0a 09  " ).length ) {..
93b0: 09 09 09 72 62 75 67 67 79 51 53 41 2e 70 75 73  ...rbuggyQSA.pus
93c0: 68 28 20 22 3a 63 68 65 63 6b 65 64 22 20 29 3b  h( ":checked" );
93d0: 0a 09 09 09 7d 0a 0a 09 09 09 2f 2f 20 53 75 70  ....}.....// Sup
93e0: 70 6f 72 74 3a 20 53 61 66 61 72 69 20 38 2b 2c  port: Safari 8+,
93f0: 20 69 4f 53 20 38 2b 0a 09 09 09 2f 2f 20 68 74   iOS 8+....// ht
9400: 74 70 73 3a 2f 2f 62 75 67 73 2e 77 65 62 6b 69  tps://bugs.webki
9410: 74 2e 6f 72 67 2f 73 68 6f 77 5f 62 75 67 2e 63  t.org/show_bug.c
9420: 67 69 3f 69 64 3d 31 33 36 38 35 31 0a 09 09 09  gi?id=136851....
9430: 2f 2f 20 49 6e 2d 70 61 67 65 20 60 73 65 6c 65  // In-page `sele
9440: 63 74 6f 72 23 69 64 20 73 69 62 6c 69 6e 67 2d  ctor#id sibling-
9450: 63 6f 6d 62 69 6e 61 74 6f 72 20 73 65 6c 65 63  combinator selec
9460: 74 6f 72 60 20 66 61 69 6c 73 0a 09 09 09 69 66  tor` fails....if
9470: 20 28 20 21 65 6c 2e 71 75 65 72 79 53 65 6c 65   ( !el.querySele
9480: 63 74 6f 72 41 6c 6c 28 20 22 61 23 22 20 2b 20  ctorAll( "a#" + 
9490: 65 78 70 61 6e 64 6f 20 2b 20 22 2b 2a 22 20 29  expando + "+*" )
94a0: 2e 6c 65 6e 67 74 68 20 29 20 7b 0a 09 09 09 09  .length ) {.....
94b0: 72 62 75 67 67 79 51 53 41 2e 70 75 73 68 28 20  rbuggyQSA.push( 
94c0: 22 2e 23 2e 2b 5b 2b 7e 5d 22 20 29 3b 0a 09 09  ".#.+[+~]" );...
94d0: 09 7d 0a 0a 09 09 09 2f 2f 20 53 75 70 70 6f 72  .}.....// Suppor
94e0: 74 3a 20 46 69 72 65 66 6f 78 20 3c 3d 33 2e 36  t: Firefox <=3.6
94f0: 20 2d 20 35 20 6f 6e 6c 79 0a 09 09 09 2f 2f 20   - 5 only....// 
9500: 4f 6c 64 20 46 69 72 65 66 6f 78 20 64 6f 65 73  Old Firefox does
9510: 6e 27 74 20 74 68 72 6f 77 20 6f 6e 20 61 20 62  n't throw on a b
9520: 61 64 6c 79 2d 65 73 63 61 70 65 64 20 69 64 65  adly-escaped ide
9530: 6e 74 69 66 69 65 72 2e 0a 09 09 09 65 6c 2e 71  ntifier.....el.q
9540: 75 65 72 79 53 65 6c 65 63 74 6f 72 41 6c 6c 28  uerySelectorAll(
9550: 20 22 5c 5c 5c 66 22 20 29 3b 0a 09 09 09 72 62   "\\\f" );....rb
9560: 75 67 67 79 51 53 41 2e 70 75 73 68 28 20 22 5b  uggyQSA.push( "[
9570: 5c 5c 72 5c 5c 6e 5c 5c 66 5d 22 20 29 3b 0a 09  \\r\\n\\f]" );..
9580: 09 7d 20 29 3b 0a 0a 09 09 61 73 73 65 72 74 28  .} );....assert(
9590: 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c 20 29 20   function( el ) 
95a0: 7b 0a 09 09 09 65 6c 2e 69 6e 6e 65 72 48 54 4d  {....el.innerHTM
95b0: 4c 20 3d 20 22 3c 61 20 68 72 65 66 3d 27 27 20  L = "<a href='' 
95c0: 64 69 73 61 62 6c 65 64 3d 27 64 69 73 61 62 6c  disabled='disabl
95d0: 65 64 27 3e 3c 2f 61 3e 22 20 2b 0a 09 09 09 09  ed'></a>" +.....
95e0: 22 3c 73 65 6c 65 63 74 20 64 69 73 61 62 6c 65  "<select disable
95f0: 64 3d 27 64 69 73 61 62 6c 65 64 27 3e 3c 6f 70  d='disabled'><op
9600: 74 69 6f 6e 2f 3e 3c 2f 73 65 6c 65 63 74 3e 22  tion/></select>"
9610: 3b 0a 0a 09 09 09 2f 2f 20 53 75 70 70 6f 72 74  ;.....// Support
9620: 3a 20 57 69 6e 64 6f 77 73 20 38 20 4e 61 74 69  : Windows 8 Nati
9630: 76 65 20 41 70 70 73 0a 09 09 09 2f 2f 20 54 68  ve Apps....// Th
9640: 65 20 74 79 70 65 20 61 6e 64 20 6e 61 6d 65 20  e type and name 
9650: 61 74 74 72 69 62 75 74 65 73 20 61 72 65 20 72  attributes are r
9660: 65 73 74 72 69 63 74 65 64 20 64 75 72 69 6e 67  estricted during
9670: 20 2e 69 6e 6e 65 72 48 54 4d 4c 20 61 73 73 69   .innerHTML assi
9680: 67 6e 6d 65 6e 74 0a 09 09 09 76 61 72 20 69 6e  gnment....var in
9690: 70 75 74 20 3d 20 64 6f 63 75 6d 65 6e 74 2e 63  put = document.c
96a0: 72 65 61 74 65 45 6c 65 6d 65 6e 74 28 20 22 69  reateElement( "i
96b0: 6e 70 75 74 22 20 29 3b 0a 09 09 09 69 6e 70 75  nput" );....inpu
96c0: 74 2e 73 65 74 41 74 74 72 69 62 75 74 65 28 20  t.setAttribute( 
96d0: 22 74 79 70 65 22 2c 20 22 68 69 64 64 65 6e 22  "type", "hidden"
96e0: 20 29 3b 0a 09 09 09 65 6c 2e 61 70 70 65 6e 64   );....el.append
96f0: 43 68 69 6c 64 28 20 69 6e 70 75 74 20 29 2e 73  Child( input ).s
9700: 65 74 41 74 74 72 69 62 75 74 65 28 20 22 6e 61  etAttribute( "na
9710: 6d 65 22 2c 20 22 44 22 20 29 3b 0a 0a 09 09 09  me", "D" );.....
9720: 2f 2f 20 53 75 70 70 6f 72 74 3a 20 49 45 38 0a  // Support: IE8.
9730: 09 09 09 2f 2f 20 45 6e 66 6f 72 63 65 20 63 61  ...// Enforce ca
9740: 73 65 2d 73 65 6e 73 69 74 69 76 69 74 79 20 6f  se-sensitivity o
9750: 66 20 6e 61 6d 65 20 61 74 74 72 69 62 75 74 65  f name attribute
9760: 0a 09 09 09 69 66 20 28 20 65 6c 2e 71 75 65 72  ....if ( el.quer
9770: 79 53 65 6c 65 63 74 6f 72 41 6c 6c 28 20 22 5b  ySelectorAll( "[
9780: 6e 61 6d 65 3d 64 5d 22 20 29 2e 6c 65 6e 67 74  name=d]" ).lengt
9790: 68 20 29 20 7b 0a 09 09 09 09 72 62 75 67 67 79  h ) {.....rbuggy
97a0: 51 53 41 2e 70 75 73 68 28 20 22 6e 61 6d 65 22  QSA.push( "name"
97b0: 20 2b 20 77 68 69 74 65 73 70 61 63 65 20 2b 20   + whitespace + 
97c0: 22 2a 5b 2a 5e 24 7c 21 7e 5d 3f 3d 22 20 29 3b  "*[*^$|!~]?=" );
97d0: 0a 09 09 09 7d 0a 0a 09 09 09 2f 2f 20 46 46 20  ....}.....// FF 
97e0: 33 2e 35 20 2d 20 3a 65 6e 61 62 6c 65 64 2f 3a  3.5 - :enabled/:
97f0: 64 69 73 61 62 6c 65 64 20 61 6e 64 20 68 69 64  disabled and hid
9800: 64 65 6e 20 65 6c 65 6d 65 6e 74 73 20 28 68 69  den elements (hi
9810: 64 64 65 6e 20 65 6c 65 6d 65 6e 74 73 20 61 72  dden elements ar
9820: 65 20 73 74 69 6c 6c 20 65 6e 61 62 6c 65 64 29  e still enabled)
9830: 0a 09 09 09 2f 2f 20 49 45 38 20 74 68 72 6f 77  ....// IE8 throw
9840: 73 20 65 72 72 6f 72 20 68 65 72 65 20 61 6e 64  s error here and
9850: 20 77 69 6c 6c 20 6e 6f 74 20 73 65 65 20 6c 61   will not see la
9860: 74 65 72 20 74 65 73 74 73 0a 09 09 09 69 66 20  ter tests....if 
9870: 28 20 65 6c 2e 71 75 65 72 79 53 65 6c 65 63 74  ( el.querySelect
9880: 6f 72 41 6c 6c 28 20 22 3a 65 6e 61 62 6c 65 64  orAll( ":enabled
9890: 22 20 29 2e 6c 65 6e 67 74 68 20 21 3d 3d 20 32  " ).length !== 2
98a0: 20 29 20 7b 0a 09 09 09 09 72 62 75 67 67 79 51   ) {.....rbuggyQ
98b0: 53 41 2e 70 75 73 68 28 20 22 3a 65 6e 61 62 6c  SA.push( ":enabl
98c0: 65 64 22 2c 20 22 3a 64 69 73 61 62 6c 65 64 22  ed", ":disabled"
98d0: 20 29 3b 0a 09 09 09 7d 0a 0a 09 09 09 2f 2f 20   );....}.....// 
98e0: 53 75 70 70 6f 72 74 3a 20 49 45 39 2d 31 31 2b  Support: IE9-11+
98f0: 0a 09 09 09 2f 2f 20 49 45 27 73 20 3a 64 69 73  ....// IE's :dis
9900: 61 62 6c 65 64 20 73 65 6c 65 63 74 6f 72 20 64  abled selector d
9910: 6f 65 73 20 6e 6f 74 20 70 69 63 6b 20 75 70 20  oes not pick up 
9920: 74 68 65 20 63 68 69 6c 64 72 65 6e 20 6f 66 20  the children of 
9930: 64 69 73 61 62 6c 65 64 20 66 69 65 6c 64 73 65  disabled fieldse
9940: 74 73 0a 09 09 09 64 6f 63 45 6c 65 6d 2e 61 70  ts....docElem.ap
9950: 70 65 6e 64 43 68 69 6c 64 28 20 65 6c 20 29 2e  pendChild( el ).
9960: 64 69 73 61 62 6c 65 64 20 3d 20 74 72 75 65 3b  disabled = true;
9970: 0a 09 09 09 69 66 20 28 20 65 6c 2e 71 75 65 72  ....if ( el.quer
9980: 79 53 65 6c 65 63 74 6f 72 41 6c 6c 28 20 22 3a  ySelectorAll( ":
9990: 64 69 73 61 62 6c 65 64 22 20 29 2e 6c 65 6e 67  disabled" ).leng
99a0: 74 68 20 21 3d 3d 20 32 20 29 20 7b 0a 09 09 09  th !== 2 ) {....
99b0: 09 72 62 75 67 67 79 51 53 41 2e 70 75 73 68 28  .rbuggyQSA.push(
99c0: 20 22 3a 65 6e 61 62 6c 65 64 22 2c 20 22 3a 64   ":enabled", ":d
99d0: 69 73 61 62 6c 65 64 22 20 29 3b 0a 09 09 09 7d  isabled" );....}
99e0: 0a 0a 09 09 09 2f 2f 20 53 75 70 70 6f 72 74 3a  .....// Support:
99f0: 20 4f 70 65 72 61 20 31 30 20 2d 20 31 31 20 6f   Opera 10 - 11 o
9a00: 6e 6c 79 0a 09 09 09 2f 2f 20 4f 70 65 72 61 20  nly....// Opera 
9a10: 31 30 2d 31 31 20 64 6f 65 73 20 6e 6f 74 20 74  10-11 does not t
9a20: 68 72 6f 77 20 6f 6e 20 70 6f 73 74 2d 63 6f 6d  hrow on post-com
9a30: 6d 61 20 69 6e 76 61 6c 69 64 20 70 73 65 75 64  ma invalid pseud
9a40: 6f 73 0a 09 09 09 65 6c 2e 71 75 65 72 79 53 65  os....el.querySe
9a50: 6c 65 63 74 6f 72 41 6c 6c 28 20 22 2a 2c 3a 78  lectorAll( "*,:x
9a60: 22 20 29 3b 0a 09 09 09 72 62 75 67 67 79 51 53  " );....rbuggyQS
9a70: 41 2e 70 75 73 68 28 20 22 2c 2e 2a 3a 22 20 29  A.push( ",.*:" )
9a80: 3b 0a 09 09 7d 20 29 3b 0a 09 7d 0a 0a 09 69 66  ;...} );..}...if
9a90: 20 28 20 28 20 73 75 70 70 6f 72 74 2e 6d 61 74   ( ( support.mat
9aa0: 63 68 65 73 53 65 6c 65 63 74 6f 72 20 3d 20 72  chesSelector = r
9ab0: 6e 61 74 69 76 65 2e 74 65 73 74 28 20 28 20 6d  native.test( ( m
9ac0: 61 74 63 68 65 73 20 3d 20 64 6f 63 45 6c 65 6d  atches = docElem
9ad0: 2e 6d 61 74 63 68 65 73 20 7c 7c 0a 09 09 64 6f  .matches ||...do
9ae0: 63 45 6c 65 6d 2e 77 65 62 6b 69 74 4d 61 74 63  cElem.webkitMatc
9af0: 68 65 73 53 65 6c 65 63 74 6f 72 20 7c 7c 0a 09  hesSelector ||..
9b00: 09 64 6f 63 45 6c 65 6d 2e 6d 6f 7a 4d 61 74 63  .docElem.mozMatc
9b10: 68 65 73 53 65 6c 65 63 74 6f 72 20 7c 7c 0a 09  hesSelector ||..
9b20: 09 64 6f 63 45 6c 65 6d 2e 6f 4d 61 74 63 68 65  .docElem.oMatche
9b30: 73 53 65 6c 65 63 74 6f 72 20 7c 7c 0a 09 09 64  sSelector ||...d
9b40: 6f 63 45 6c 65 6d 2e 6d 73 4d 61 74 63 68 65 73  ocElem.msMatches
9b50: 53 65 6c 65 63 74 6f 72 20 29 20 29 20 29 20 29  Selector ) ) ) )
9b60: 20 7b 0a 0a 09 09 61 73 73 65 72 74 28 20 66 75   {....assert( fu
9b70: 6e 63 74 69 6f 6e 28 20 65 6c 20 29 20 7b 0a 0a  nction( el ) {..
9b80: 09 09 09 2f 2f 20 43 68 65 63 6b 20 74 6f 20 73  ...// Check to s
9b90: 65 65 20 69 66 20 69 74 27 73 20 70 6f 73 73 69  ee if it's possi
9ba0: 62 6c 65 20 74 6f 20 64 6f 20 6d 61 74 63 68 65  ble to do matche
9bb0: 73 53 65 6c 65 63 74 6f 72 0a 09 09 09 2f 2f 20  sSelector....// 
9bc0: 6f 6e 20 61 20 64 69 73 63 6f 6e 6e 65 63 74 65  on a disconnecte
9bd0: 64 20 6e 6f 64 65 20 28 49 45 20 39 29 0a 09 09  d node (IE 9)...
9be0: 09 73 75 70 70 6f 72 74 2e 64 69 73 63 6f 6e 6e  .support.disconn
9bf0: 65 63 74 65 64 4d 61 74 63 68 20 3d 20 6d 61 74  ectedMatch = mat
9c00: 63 68 65 73 2e 63 61 6c 6c 28 20 65 6c 2c 20 22  ches.call( el, "
9c10: 2a 22 20 29 3b 0a 0a 09 09 09 2f 2f 20 54 68 69  *" );.....// Thi
9c20: 73 20 73 68 6f 75 6c 64 20 66 61 69 6c 20 77 69  s should fail wi
9c30: 74 68 20 61 6e 20 65 78 63 65 70 74 69 6f 6e 0a  th an exception.
9c40: 09 09 09 2f 2f 20 47 65 63 6b 6f 20 64 6f 65 73  ...// Gecko does
9c50: 20 6e 6f 74 20 65 72 72 6f 72 2c 20 72 65 74 75   not error, retu
9c60: 72 6e 73 20 66 61 6c 73 65 20 69 6e 73 74 65 61  rns false instea
9c70: 64 0a 09 09 09 6d 61 74 63 68 65 73 2e 63 61 6c  d....matches.cal
9c80: 6c 28 20 65 6c 2c 20 22 5b 73 21 3d 27 27 5d 3a  l( el, "[s!='']:
9c90: 78 22 20 29 3b 0a 09 09 09 72 62 75 67 67 79 4d  x" );....rbuggyM
9ca0: 61 74 63 68 65 73 2e 70 75 73 68 28 20 22 21 3d  atches.push( "!=
9cb0: 22 2c 20 70 73 65 75 64 6f 73 20 29 3b 0a 09 09  ", pseudos );...
9cc0: 7d 20 29 3b 0a 09 7d 0a 0a 09 72 62 75 67 67 79  } );..}...rbuggy
9cd0: 51 53 41 20 3d 20 72 62 75 67 67 79 51 53 41 2e  QSA = rbuggyQSA.
9ce0: 6c 65 6e 67 74 68 20 26 26 20 6e 65 77 20 52 65  length && new Re
9cf0: 67 45 78 70 28 20 72 62 75 67 67 79 51 53 41 2e  gExp( rbuggyQSA.
9d00: 6a 6f 69 6e 28 20 22 7c 22 20 29 20 29 3b 0a 09  join( "|" ) );..
9d10: 72 62 75 67 67 79 4d 61 74 63 68 65 73 20 3d 20  rbuggyMatches = 
9d20: 72 62 75 67 67 79 4d 61 74 63 68 65 73 2e 6c 65  rbuggyMatches.le
9d30: 6e 67 74 68 20 26 26 20 6e 65 77 20 52 65 67 45  ngth && new RegE
9d40: 78 70 28 20 72 62 75 67 67 79 4d 61 74 63 68 65  xp( rbuggyMatche
9d50: 73 2e 6a 6f 69 6e 28 20 22 7c 22 20 29 20 29 3b  s.join( "|" ) );
9d60: 0a 0a 09 2f 2a 20 43 6f 6e 74 61 69 6e 73 0a 09  .../* Contains..
9d70: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
9d80: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
9d90: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
9da0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
9db0: 2d 2d 2d 2d 2d 2d 20 2a 2f 0a 09 68 61 73 43 6f  ------ */..hasCo
9dc0: 6d 70 61 72 65 20 3d 20 72 6e 61 74 69 76 65 2e  mpare = rnative.
9dd0: 74 65 73 74 28 20 64 6f 63 45 6c 65 6d 2e 63 6f  test( docElem.co
9de0: 6d 70 61 72 65 44 6f 63 75 6d 65 6e 74 50 6f 73  mpareDocumentPos
9df0: 69 74 69 6f 6e 20 29 3b 0a 0a 09 2f 2f 20 45 6c  ition );...// El
9e00: 65 6d 65 6e 74 20 63 6f 6e 74 61 69 6e 73 20 61  ement contains a
9e10: 6e 6f 74 68 65 72 0a 09 2f 2f 20 50 75 72 70 6f  nother..// Purpo
9e20: 73 65 66 75 6c 6c 79 20 73 65 6c 66 2d 65 78 63  sefully self-exc
9e30: 6c 75 73 69 76 65 0a 09 2f 2f 20 41 73 20 69 6e  lusive..// As in
9e40: 2c 20 61 6e 20 65 6c 65 6d 65 6e 74 20 64 6f 65  , an element doe
9e50: 73 20 6e 6f 74 20 63 6f 6e 74 61 69 6e 20 69 74  s not contain it
9e60: 73 65 6c 66 0a 09 63 6f 6e 74 61 69 6e 73 20 3d  self..contains =
9e70: 20 68 61 73 43 6f 6d 70 61 72 65 20 7c 7c 20 72   hasCompare || r
9e80: 6e 61 74 69 76 65 2e 74 65 73 74 28 20 64 6f 63  native.test( doc
9e90: 45 6c 65 6d 2e 63 6f 6e 74 61 69 6e 73 20 29 20  Elem.contains ) 
9ea0: 3f 0a 09 09 66 75 6e 63 74 69 6f 6e 28 20 61 2c  ?...function( a,
9eb0: 20 62 20 29 20 7b 0a 09 09 09 76 61 72 20 61 64   b ) {....var ad
9ec0: 6f 77 6e 20 3d 20 61 2e 6e 6f 64 65 54 79 70 65  own = a.nodeType
9ed0: 20 3d 3d 3d 20 39 20 3f 20 61 2e 64 6f 63 75 6d   === 9 ? a.docum
9ee0: 65 6e 74 45 6c 65 6d 65 6e 74 20 3a 20 61 2c 0a  entElement : a,.
9ef0: 09 09 09 09 62 75 70 20 3d 20 62 20 26 26 20 62  ....bup = b && b
9f00: 2e 70 61 72 65 6e 74 4e 6f 64 65 3b 0a 09 09 09  .parentNode;....
9f10: 72 65 74 75 72 6e 20 61 20 3d 3d 3d 20 62 75 70  return a === bup
9f20: 20 7c 7c 20 21 21 28 20 62 75 70 20 26 26 20 62   || !!( bup && b
9f30: 75 70 2e 6e 6f 64 65 54 79 70 65 20 3d 3d 3d 20  up.nodeType === 
9f40: 31 20 26 26 20 28 0a 09 09 09 09 61 64 6f 77 6e  1 && (.....adown
9f50: 2e 63 6f 6e 74 61 69 6e 73 20 3f 0a 09 09 09 09  .contains ?.....
9f60: 09 61 64 6f 77 6e 2e 63 6f 6e 74 61 69 6e 73 28  .adown.contains(
9f70: 20 62 75 70 20 29 20 3a 0a 09 09 09 09 09 61 2e   bup ) :......a.
9f80: 63 6f 6d 70 61 72 65 44 6f 63 75 6d 65 6e 74 50  compareDocumentP
9f90: 6f 73 69 74 69 6f 6e 20 26 26 20 61 2e 63 6f 6d  osition && a.com
9fa0: 70 61 72 65 44 6f 63 75 6d 65 6e 74 50 6f 73 69  pareDocumentPosi
9fb0: 74 69 6f 6e 28 20 62 75 70 20 29 20 26 20 31 36  tion( bup ) & 16
9fc0: 0a 09 09 09 29 20 29 3b 0a 09 09 7d 20 3a 0a 09  ....) );...} :..
9fd0: 09 66 75 6e 63 74 69 6f 6e 28 20 61 2c 20 62 20  .function( a, b 
9fe0: 29 20 7b 0a 09 09 09 69 66 20 28 20 62 20 29 20  ) {....if ( b ) 
9ff0: 7b 0a 09 09 09 09 77 68 69 6c 65 20 28 20 28 20  {.....while ( ( 
a000: 62 20 3d 20 62 2e 70 61 72 65 6e 74 4e 6f 64 65  b = b.parentNode
a010: 20 29 20 29 20 7b 0a 09 09 09 09 09 69 66 20 28   ) ) {......if (
a020: 20 62 20 3d 3d 3d 20 61 20 29 20 7b 0a 09 09 09   b === a ) {....
a030: 09 09 09 72 65 74 75 72 6e 20 74 72 75 65 3b 0a  ...return true;.
a040: 09 09 09 09 09 7d 0a 09 09 09 09 7d 0a 09 09 09  .....}.....}....
a050: 7d 0a 09 09 09 72 65 74 75 72 6e 20 66 61 6c 73  }....return fals
a060: 65 3b 0a 09 09 7d 3b 0a 0a 09 2f 2a 20 53 6f 72  e;...};.../* Sor
a070: 74 69 6e 67 0a 09 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ting..----------
a080: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
a090: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
a0a0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d  ----------------
a0b0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 20 2a 2f 0a  ------------ */.
a0c0: 0a 09 2f 2f 20 44 6f 63 75 6d 65 6e 74 20 6f 72  ..// Document or
a0d0: 64 65 72 20 73 6f 72 74 69 6e 67 0a 09 73 6f 72  der sorting..sor
a0e0: 74 4f 72 64 65 72 20 3d 20 68 61 73 43 6f 6d 70  tOrder = hasComp
a0f0: 61 72 65 20 3f 0a 09 66 75 6e 63 74 69 6f 6e 28  are ?..function(
a100: 20 61 2c 20 62 20 29 20 7b 0a 0a 09 09 2f 2f 20   a, b ) {....// 
a110: 46 6c 61 67 20 66 6f 72 20 64 75 70 6c 69 63 61  Flag for duplica
a120: 74 65 20 72 65 6d 6f 76 61 6c 0a 09 09 69 66 20  te removal...if 
a130: 28 20 61 20 3d 3d 3d 20 62 20 29 20 7b 0a 09 09  ( a === b ) {...
a140: 09 68 61 73 44 75 70 6c 69 63 61 74 65 20 3d 20  .hasDuplicate = 
a150: 74 72 75 65 3b 0a 09 09 09 72 65 74 75 72 6e 20  true;....return 
a160: 30 3b 0a 09 09 7d 0a 0a 09 09 2f 2f 20 53 6f 72  0;...}....// Sor
a170: 74 20 6f 6e 20 6d 65 74 68 6f 64 20 65 78 69 73  t on method exis
a180: 74 65 6e 63 65 20 69 66 20 6f 6e 6c 79 20 6f 6e  tence if only on
a190: 65 20 69 6e 70 75 74 20 68 61 73 20 63 6f 6d 70  e input has comp
a1a0: 61 72 65 44 6f 63 75 6d 65 6e 74 50 6f 73 69 74  areDocumentPosit
a1b0: 69 6f 6e 0a 09 09 76 61 72 20 63 6f 6d 70 61 72  ion...var compar
a1c0: 65 20 3d 20 21 61 2e 63 6f 6d 70 61 72 65 44 6f  e = !a.compareDo
a1d0: 63 75 6d 65 6e 74 50 6f 73 69 74 69 6f 6e 20 2d  cumentPosition -
a1e0: 20 21 62 2e 63 6f 6d 70 61 72 65 44 6f 63 75 6d   !b.compareDocum
a1f0: 65 6e 74 50 6f 73 69 74 69 6f 6e 3b 0a 09 09 69  entPosition;...i
a200: 66 20 28 20 63 6f 6d 70 61 72 65 20 29 20 7b 0a  f ( compare ) {.
a210: 09 09 09 72 65 74 75 72 6e 20 63 6f 6d 70 61 72  ...return compar
a220: 65 3b 0a 09 09 7d 0a 0a 09 09 2f 2f 20 43 61 6c  e;...}....// Cal
a230: 63 75 6c 61 74 65 20 70 6f 73 69 74 69 6f 6e 20  culate position 
a240: 69 66 20 62 6f 74 68 20 69 6e 70 75 74 73 20 62  if both inputs b
a250: 65 6c 6f 6e 67 20 74 6f 20 74 68 65 20 73 61 6d  elong to the sam
a260: 65 20 64 6f 63 75 6d 65 6e 74 0a 09 09 2f 2f 20  e document...// 
a270: 53 75 70 70 6f 72 74 3a 20 49 45 20 31 31 2b 2c  Support: IE 11+,
a280: 20 45 64 67 65 20 31 37 20 2d 20 31 38 2b 0a 09   Edge 17 - 18+..
a290: 09 2f 2f 20 49 45 2f 45 64 67 65 20 73 6f 6d 65  .// IE/Edge some
a2a0: 74 69 6d 65 73 20 74 68 72 6f 77 20 61 20 22 50  times throw a "P
a2b0: 65 72 6d 69 73 73 69 6f 6e 20 64 65 6e 69 65 64  ermission denied
a2c0: 22 20 65 72 72 6f 72 20 77 68 65 6e 20 73 74 72  " error when str
a2d0: 69 63 74 2d 63 6f 6d 70 61 72 69 6e 67 0a 09 09  ict-comparing...
a2e0: 2f 2f 20 74 77 6f 20 64 6f 63 75 6d 65 6e 74 73  // two documents
a2f0: 3b 20 73 68 61 6c 6c 6f 77 20 63 6f 6d 70 61 72  ; shallow compar
a300: 69 73 6f 6e 73 20 77 6f 72 6b 2e 0a 09 09 2f 2f  isons work....//
a310: 20 65 73 6c 69 6e 74 2d 64 69 73 61 62 6c 65 2d   eslint-disable-
a320: 6e 65 78 74 2d 6c 69 6e 65 20 65 71 65 71 65 71  next-line eqeqeq
a330: 0a 09 09 63 6f 6d 70 61 72 65 20 3d 20 28 20 61  ...compare = ( a
a340: 2e 6f 77 6e 65 72 44 6f 63 75 6d 65 6e 74 20 7c  .ownerDocument |
a350: 7c 20 61 20 29 20 3d 3d 20 28 20 62 2e 6f 77 6e  | a ) == ( b.own
a360: 65 72 44 6f 63 75 6d 65 6e 74 20 7c 7c 20 62 20  erDocument || b 
a370: 29 20 3f 0a 09 09 09 61 2e 63 6f 6d 70 61 72 65  ) ?....a.compare
a380: 44 6f 63 75 6d 65 6e 74 50 6f 73 69 74 69 6f 6e  DocumentPosition
a390: 28 20 62 20 29 20 3a 0a 0a 09 09 09 2f 2f 20 4f  ( b ) :.....// O
a3a0: 74 68 65 72 77 69 73 65 20 77 65 20 6b 6e 6f 77  therwise we know
a3b0: 20 74 68 65 79 20 61 72 65 20 64 69 73 63 6f 6e   they are discon
a3c0: 6e 65 63 74 65 64 0a 09 09 09 31 3b 0a 0a 09 09  nected....1;....
a3d0: 2f 2f 20 44 69 73 63 6f 6e 6e 65 63 74 65 64 20  // Disconnected 
a3e0: 6e 6f 64 65 73 0a 09 09 69 66 20 28 20 63 6f 6d  nodes...if ( com
a3f0: 70 61 72 65 20 26 20 31 20 7c 7c 0a 09 09 09 28  pare & 1 ||....(
a400: 20 21 73 75 70 70 6f 72 74 2e 73 6f 72 74 44 65   !support.sortDe
a410: 74 61 63 68 65 64 20 26 26 20 62 2e 63 6f 6d 70  tached && b.comp
a420: 61 72 65 44 6f 63 75 6d 65 6e 74 50 6f 73 69 74  areDocumentPosit
a430: 69 6f 6e 28 20 61 20 29 20 3d 3d 3d 20 63 6f 6d  ion( a ) === com
a440: 70 61 72 65 20 29 20 29 20 7b 0a 0a 09 09 09 2f  pare ) ) {...../
a450: 2f 20 43 68 6f 6f 73 65 20 74 68 65 20 66 69 72  / Choose the fir
a460: 73 74 20 65 6c 65 6d 65 6e 74 20 74 68 61 74 20  st element that 
a470: 69 73 20 72 65 6c 61 74 65 64 20 74 6f 20 6f 75  is related to ou
a480: 72 20 70 72 65 66 65 72 72 65 64 20 64 6f 63 75  r preferred docu
a490: 6d 65 6e 74 0a 09 09 09 2f 2f 20 53 75 70 70 6f  ment....// Suppo
a4a0: 72 74 3a 20 49 45 20 31 31 2b 2c 20 45 64 67 65  rt: IE 11+, Edge
a4b0: 20 31 37 20 2d 20 31 38 2b 0a 09 09 09 2f 2f 20   17 - 18+....// 
a4c0: 49 45 2f 45 64 67 65 20 73 6f 6d 65 74 69 6d 65  IE/Edge sometime
a4d0: 73 20 74 68 72 6f 77 20 61 20 22 50 65 72 6d 69  s throw a "Permi
a4e0: 73 73 69 6f 6e 20 64 65 6e 69 65 64 22 20 65 72  ssion denied" er
a4f0: 72 6f 72 20 77 68 65 6e 20 73 74 72 69 63 74 2d  ror when strict-
a500: 63 6f 6d 70 61 72 69 6e 67 0a 09 09 09 2f 2f 20  comparing....// 
a510: 74 77 6f 20 64 6f 63 75 6d 65 6e 74 73 3b 20 73  two documents; s
a520: 68 61 6c 6c 6f 77 20 63 6f 6d 70 61 72 69 73 6f  hallow compariso
a530: 6e 73 20 77 6f 72 6b 2e 0a 09 09 09 2f 2f 20 65  ns work.....// e
a540: 73 6c 69 6e 74 2d 64 69 73 61 62 6c 65 2d 6e 65  slint-disable-ne
a550: 78 74 2d 6c 69 6e 65 20 65 71 65 71 65 71 0a 09  xt-line eqeqeq..
a560: 09 09 69 66 20 28 20 61 20 3d 3d 20 64 6f 63 75  ..if ( a == docu
a570: 6d 65 6e 74 20 7c 7c 20 61 2e 6f 77 6e 65 72 44  ment || a.ownerD
a580: 6f 63 75 6d 65 6e 74 20 3d 3d 20 70 72 65 66 65  ocument == prefe
a590: 72 72 65 64 44 6f 63 20 26 26 0a 09 09 09 09 63  rredDoc &&.....c
a5a0: 6f 6e 74 61 69 6e 73 28 20 70 72 65 66 65 72 72  ontains( preferr
a5b0: 65 64 44 6f 63 2c 20 61 20 29 20 29 20 7b 0a 09  edDoc, a ) ) {..
a5c0: 09 09 09 72 65 74 75 72 6e 20 2d 31 3b 0a 09 09  ...return -1;...
a5d0: 09 7d 0a 0a 09 09 09 2f 2f 20 53 75 70 70 6f 72  .}.....// Suppor
a5e0: 74 3a 20 49 45 20 31 31 2b 2c 20 45 64 67 65 20  t: IE 11+, Edge 
a5f0: 31 37 20 2d 20 31 38 2b 0a 09 09 09 2f 2f 20 49  17 - 18+....// I
a600: 45 2f 45 64 67 65 20 73 6f 6d 65 74 69 6d 65 73  E/Edge sometimes
a610: 20 74 68 72 6f 77 20 61 20 22 50 65 72 6d 69 73   throw a "Permis
a620: 73 69 6f 6e 20 64 65 6e 69 65 64 22 20 65 72 72  sion denied" err
a630: 6f 72 20 77 68 65 6e 20 73 74 72 69 63 74 2d 63  or when strict-c
a640: 6f 6d 70 61 72 69 6e 67 0a 09 09 09 2f 2f 20 74  omparing....// t
a650: 77 6f 20 64 6f 63 75 6d 65 6e 74 73 3b 20 73 68  wo documents; sh
a660: 61 6c 6c 6f 77 20 63 6f 6d 70 61 72 69 73 6f 6e  allow comparison
a670: 73 20 77 6f 72 6b 2e 0a 09 09 09 2f 2f 20 65 73  s work.....// es
a680: 6c 69 6e 74 2d 64 69 73 61 62 6c 65 2d 6e 65 78  lint-disable-nex
a690: 74 2d 6c 69 6e 65 20 65 71 65 71 65 71 0a 09 09  t-line eqeqeq...
a6a0: 09 69 66 20 28 20 62 20 3d 3d 20 64 6f 63 75 6d  .if ( b == docum
a6b0: 65 6e 74 20 7c 7c 20 62 2e 6f 77 6e 65 72 44 6f  ent || b.ownerDo
a6c0: 63 75 6d 65 6e 74 20 3d 3d 20 70 72 65 66 65 72  cument == prefer
a6d0: 72 65 64 44 6f 63 20 26 26 0a 09 09 09 09 63 6f  redDoc &&.....co
a6e0: 6e 74 61 69 6e 73 28 20 70 72 65 66 65 72 72 65  ntains( preferre
a6f0: 64 44 6f 63 2c 20 62 20 29 20 29 20 7b 0a 09 09  dDoc, b ) ) {...
a700: 09 09 72 65 74 75 72 6e 20 31 3b 0a 09 09 09 7d  ..return 1;....}
a710: 0a 0a 09 09 09 2f 2f 20 4d 61 69 6e 74 61 69 6e  .....// Maintain
a720: 20 6f 72 69 67 69 6e 61 6c 20 6f 72 64 65 72 0a   original order.
a730: 09 09 09 72 65 74 75 72 6e 20 73 6f 72 74 49 6e  ...return sortIn
a740: 70 75 74 20 3f 0a 09 09 09 09 28 20 69 6e 64 65  put ?.....( inde
a750: 78 4f 66 28 20 73 6f 72 74 49 6e 70 75 74 2c 20  xOf( sortInput, 
a760: 61 20 29 20 2d 20 69 6e 64 65 78 4f 66 28 20 73  a ) - indexOf( s
a770: 6f 72 74 49 6e 70 75 74 2c 20 62 20 29 20 29 20  ortInput, b ) ) 
a780: 3a 0a 09 09 09 09 30 3b 0a 09 09 7d 0a 0a 09 09  :.....0;...}....
a790: 72 65 74 75 72 6e 20 63 6f 6d 70 61 72 65 20 26  return compare &
a7a0: 20 34 20 3f 20 2d 31 20 3a 20 31 3b 0a 09 7d 20   4 ? -1 : 1;..} 
a7b0: 3a 0a 09 66 75 6e 63 74 69 6f 6e 28 20 61 2c 20  :..function( a, 
a7c0: 62 20 29 20 7b 0a 0a 09 09 2f 2f 20 45 78 69 74  b ) {....// Exit
a7d0: 20 65 61 72 6c 79 20 69 66 20 74 68 65 20 6e 6f   early if the no
a7e0: 64 65 73 20 61 72 65 20 69 64 65 6e 74 69 63 61  des are identica
a7f0: 6c 0a 09 09 69 66 20 28 20 61 20 3d 3d 3d 20 62  l...if ( a === b
a800: 20 29 20 7b 0a 09 09 09 68 61 73 44 75 70 6c 69   ) {....hasDupli
a810: 63 61 74 65 20 3d 20 74 72 75 65 3b 0a 09 09 09  cate = true;....
a820: 72 65 74 75 72 6e 20 30 3b 0a 09 09 7d 0a 0a 09  return 0;...}...
a830: 09 76 61 72 20 63 75 72 2c 0a 09 09 09 69 20 3d  .var cur,....i =
a840: 20 30 2c 0a 09 09 09 61 75 70 20 3d 20 61 2e 70   0,....aup = a.p
a850: 61 72 65 6e 74 4e 6f 64 65 2c 0a 09 09 09 62 75  arentNode,....bu
a860: 70 20 3d 20 62 2e 70 61 72 65 6e 74 4e 6f 64 65  p = b.parentNode
a870: 2c 0a 09 09 09 61 70 20 3d 20 5b 20 61 20 5d 2c  ,....ap = [ a ],
a880: 0a 09 09 09 62 70 20 3d 20 5b 20 62 20 5d 3b 0a  ....bp = [ b ];.
a890: 0a 09 09 2f 2f 20 50 61 72 65 6e 74 6c 65 73 73  ...// Parentless
a8a0: 20 6e 6f 64 65 73 20 61 72 65 20 65 69 74 68 65   nodes are eithe
a8b0: 72 20 64 6f 63 75 6d 65 6e 74 73 20 6f 72 20 64  r documents or d
a8c0: 69 73 63 6f 6e 6e 65 63 74 65 64 0a 09 09 69 66  isconnected...if
a8d0: 20 28 20 21 61 75 70 20 7c 7c 20 21 62 75 70 20   ( !aup || !bup 
a8e0: 29 20 7b 0a 0a 09 09 09 2f 2f 20 53 75 70 70 6f  ) {.....// Suppo
a8f0: 72 74 3a 20 49 45 20 31 31 2b 2c 20 45 64 67 65  rt: IE 11+, Edge
a900: 20 31 37 20 2d 20 31 38 2b 0a 09 09 09 2f 2f 20   17 - 18+....// 
a910: 49 45 2f 45 64 67 65 20 73 6f 6d 65 74 69 6d 65  IE/Edge sometime
a920: 73 20 74 68 72 6f 77 20 61 20 22 50 65 72 6d 69  s throw a "Permi
a930: 73 73 69 6f 6e 20 64 65 6e 69 65 64 22 20 65 72  ssion denied" er
a940: 72 6f 72 20 77 68 65 6e 20 73 74 72 69 63 74 2d  ror when strict-
a950: 63 6f 6d 70 61 72 69 6e 67 0a 09 09 09 2f 2f 20  comparing....// 
a960: 74 77 6f 20 64 6f 63 75 6d 65 6e 74 73 3b 20 73  two documents; s
a970: 68 61 6c 6c 6f 77 20 63 6f 6d 70 61 72 69 73 6f  hallow compariso
a980: 6e 73 20 77 6f 72 6b 2e 0a 09 09 09 2f 2a 20 65  ns work...../* e
a990: 73 6c 69 6e 74 2d 64 69 73 61 62 6c 65 20 65 71  slint-disable eq
a9a0: 65 71 65 71 20 2a 2f 0a 09 09 09 72 65 74 75 72  eqeq */....retur
a9b0: 6e 20 61 20 3d 3d 20 64 6f 63 75 6d 65 6e 74 20  n a == document 
a9c0: 3f 20 2d 31 20 3a 0a 09 09 09 09 62 20 3d 3d 20  ? -1 :.....b == 
a9d0: 64 6f 63 75 6d 65 6e 74 20 3f 20 31 20 3a 0a 09  document ? 1 :..
a9e0: 09 09 09 2f 2a 20 65 73 6c 69 6e 74 2d 65 6e 61  .../* eslint-ena
a9f0: 62 6c 65 20 65 71 65 71 65 71 20 2a 2f 0a 09 09  ble eqeqeq */...
aa00: 09 09 61 75 70 20 3f 20 2d 31 20 3a 0a 09 09 09  ..aup ? -1 :....
aa10: 09 62 75 70 20 3f 20 31 20 3a 0a 09 09 09 09 73  .bup ? 1 :.....s
aa20: 6f 72 74 49 6e 70 75 74 20 3f 0a 09 09 09 09 28  ortInput ?.....(
aa30: 20 69 6e 64 65 78 4f 66 28 20 73 6f 72 74 49 6e   indexOf( sortIn
aa40: 70 75 74 2c 20 61 20 29 20 2d 20 69 6e 64 65 78  put, a ) - index
aa50: 4f 66 28 20 73 6f 72 74 49 6e 70 75 74 2c 20 62  Of( sortInput, b
aa60: 20 29 20 29 20 3a 0a 09 09 09 09 30 3b 0a 0a 09   ) ) :.....0;...
aa70: 09 2f 2f 20 49 66 20 74 68 65 20 6e 6f 64 65 73  .// If the nodes
aa80: 20 61 72 65 20 73 69 62 6c 69 6e 67 73 2c 20 77   are siblings, w
aa90: 65 20 63 61 6e 20 64 6f 20 61 20 71 75 69 63 6b  e can do a quick
aaa0: 20 63 68 65 63 6b 0a 09 09 7d 20 65 6c 73 65 20   check...} else 
aab0: 69 66 20 28 20 61 75 70 20 3d 3d 3d 20 62 75 70  if ( aup === bup
aac0: 20 29 20 7b 0a 09 09 09 72 65 74 75 72 6e 20 73   ) {....return s
aad0: 69 62 6c 69 6e 67 43 68 65 63 6b 28 20 61 2c 20  iblingCheck( a, 
aae0: 62 20 29 3b 0a 09 09 7d 0a 0a 09 09 2f 2f 20 4f  b );...}....// O
aaf0: 74 68 65 72 77 69 73 65 20 77 65 20 6e 65 65 64  therwise we need
ab00: 20 66 75 6c 6c 20 6c 69 73 74 73 20 6f 66 20 74   full lists of t
ab10: 68 65 69 72 20 61 6e 63 65 73 74 6f 72 73 20 66  heir ancestors f
ab20: 6f 72 20 63 6f 6d 70 61 72 69 73 6f 6e 0a 09 09  or comparison...
ab30: 63 75 72 20 3d 20 61 3b 0a 09 09 77 68 69 6c 65  cur = a;...while
ab40: 20 28 20 28 20 63 75 72 20 3d 20 63 75 72 2e 70   ( ( cur = cur.p
ab50: 61 72 65 6e 74 4e 6f 64 65 20 29 20 29 20 7b 0a  arentNode ) ) {.
ab60: 09 09 09 61 70 2e 75 6e 73 68 69 66 74 28 20 63  ...ap.unshift( c
ab70: 75 72 20 29 3b 0a 09 09 7d 0a 09 09 63 75 72 20  ur );...}...cur 
ab80: 3d 20 62 3b 0a 09 09 77 68 69 6c 65 20 28 20 28  = b;...while ( (
ab90: 20 63 75 72 20 3d 20 63 75 72 2e 70 61 72 65 6e   cur = cur.paren
aba0: 74 4e 6f 64 65 20 29 20 29 20 7b 0a 09 09 09 62  tNode ) ) {....b
abb0: 70 2e 75 6e 73 68 69 66 74 28 20 63 75 72 20 29  p.unshift( cur )
abc0: 3b 0a 09 09 7d 0a 0a 09 09 2f 2f 20 57 61 6c 6b  ;...}....// Walk
abd0: 20 64 6f 77 6e 20 74 68 65 20 74 72 65 65 20 6c   down the tree l
abe0: 6f 6f 6b 69 6e 67 20 66 6f 72 20 61 20 64 69 73  ooking for a dis
abf0: 63 72 65 70 61 6e 63 79 0a 09 09 77 68 69 6c 65  crepancy...while
ac00: 20 28 20 61 70 5b 20 69 20 5d 20 3d 3d 3d 20 62   ( ap[ i ] === b
ac10: 70 5b 20 69 20 5d 20 29 20 7b 0a 09 09 09 69 2b  p[ i ] ) {....i+
ac20: 2b 3b 0a 09 09 7d 0a 0a 09 09 72 65 74 75 72 6e  +;...}....return
ac30: 20 69 20 3f 0a 0a 09 09 09 2f 2f 20 44 6f 20 61   i ?.....// Do a
ac40: 20 73 69 62 6c 69 6e 67 20 63 68 65 63 6b 20 69   sibling check i
ac50: 66 20 74 68 65 20 6e 6f 64 65 73 20 68 61 76 65  f the nodes have
ac60: 20 61 20 63 6f 6d 6d 6f 6e 20 61 6e 63 65 73 74   a common ancest
ac70: 6f 72 0a 09 09 09 73 69 62 6c 69 6e 67 43 68 65  or....siblingChe
ac80: 63 6b 28 20 61 70 5b 20 69 20 5d 2c 20 62 70 5b  ck( ap[ i ], bp[
ac90: 20 69 20 5d 20 29 20 3a 0a 0a 09 09 09 2f 2f 20   i ] ) :.....// 
aca0: 4f 74 68 65 72 77 69 73 65 20 6e 6f 64 65 73 20  Otherwise nodes 
acb0: 69 6e 20 6f 75 72 20 64 6f 63 75 6d 65 6e 74 20  in our document 
acc0: 73 6f 72 74 20 66 69 72 73 74 0a 09 09 09 2f 2f  sort first....//
acd0: 20 53 75 70 70 6f 72 74 3a 20 49 45 20 31 31 2b   Support: IE 11+
ace0: 2c 20 45 64 67 65 20 31 37 20 2d 20 31 38 2b 0a  , Edge 17 - 18+.
acf0: 09 09 09 2f 2f 20 49 45 2f 45 64 67 65 20 73 6f  ...// IE/Edge so
ad00: 6d 65 74 69 6d 65 73 20 74 68 72 6f 77 20 61 20  metimes throw a 
ad10: 22 50 65 72 6d 69 73 73 69 6f 6e 20 64 65 6e 69  "Permission deni
ad20: 65 64 22 20 65 72 72 6f 72 20 77 68 65 6e 20 73  ed" error when s
ad30: 74 72 69 63 74 2d 63 6f 6d 70 61 72 69 6e 67 0a  trict-comparing.
ad40: 09 09 09 2f 2f 20 74 77 6f 20 64 6f 63 75 6d 65  ...// two docume
ad50: 6e 74 73 3b 20 73 68 61 6c 6c 6f 77 20 63 6f 6d  nts; shallow com
ad60: 70 61 72 69 73 6f 6e 73 20 77 6f 72 6b 2e 0a 09  parisons work...
ad70: 09 09 2f 2a 20 65 73 6c 69 6e 74 2d 64 69 73 61  ../* eslint-disa
ad80: 62 6c 65 20 65 71 65 71 65 71 20 2a 2f 0a 09 09  ble eqeqeq */...
ad90: 09 61 70 5b 20 69 20 5d 20 3d 3d 20 70 72 65 66  .ap[ i ] == pref
ada0: 65 72 72 65 64 44 6f 63 20 3f 20 2d 31 20 3a 0a  erredDoc ? -1 :.
adb0: 09 09 09 62 70 5b 20 69 20 5d 20 3d 3d 20 70 72  ...bp[ i ] == pr
adc0: 65 66 65 72 72 65 64 44 6f 63 20 3f 20 31 20 3a  eferredDoc ? 1 :
add0: 0a 09 09 09 2f 2a 20 65 73 6c 69 6e 74 2d 65 6e  ..../* eslint-en
ade0: 61 62 6c 65 20 65 71 65 71 65 71 20 2a 2f 0a 09  able eqeqeq */..
adf0: 09 09 30 3b 0a 09 7d 3b 0a 0a 09 72 65 74 75 72  ..0;..};...retur
ae00: 6e 20 64 6f 63 75 6d 65 6e 74 3b 0a 7d 3b 0a 0a  n document;.};..
ae10: 53 69 7a 7a 6c 65 2e 6d 61 74 63 68 65 73 20 3d  Sizzle.matches =
ae20: 20 66 75 6e 63 74 69 6f 6e 28 20 65 78 70 72 2c   function( expr,
ae30: 20 65 6c 65 6d 65 6e 74 73 20 29 20 7b 0a 09 72   elements ) {..r
ae40: 65 74 75 72 6e 20 53 69 7a 7a 6c 65 28 20 65 78  eturn Sizzle( ex
ae50: 70 72 2c 20 6e 75 6c 6c 2c 20 6e 75 6c 6c 2c 20  pr, null, null, 
ae60: 65 6c 65 6d 65 6e 74 73 20 29 3b 0a 7d 3b 0a 0a  elements );.};..
ae70: 53 69 7a 7a 6c 65 2e 6d 61 74 63 68 65 73 53 65  Sizzle.matchesSe
ae80: 6c 65 63 74 6f 72 20 3d 20 66 75 6e 63 74 69 6f  lector = functio
ae90: 6e 28 20 65 6c 65 6d 2c 20 65 78 70 72 20 29 20  n( elem, expr ) 
aea0: 7b 0a 09 73 65 74 44 6f 63 75 6d 65 6e 74 28 20  {..setDocument( 
aeb0: 65 6c 65 6d 20 29 3b 0a 0a 09 69 66 20 28 20 73  elem );...if ( s
aec0: 75 70 70 6f 72 74 2e 6d 61 74 63 68 65 73 53 65  upport.matchesSe
aed0: 6c 65 63 74 6f 72 20 26 26 20 64 6f 63 75 6d 65  lector && docume
aee0: 6e 74 49 73 48 54 4d 4c 20 26 26 0a 09 09 21 6e  ntIsHTML &&...!n
aef0: 6f 6e 6e 61 74 69 76 65 53 65 6c 65 63 74 6f 72  onnativeSelector
af00: 43 61 63 68 65 5b 20 65 78 70 72 20 2b 20 22 20  Cache[ expr + " 
af10: 22 20 5d 20 26 26 0a 09 09 28 20 21 72 62 75 67  " ] &&...( !rbug
af20: 67 79 4d 61 74 63 68 65 73 20 7c 7c 20 21 72 62  gyMatches || !rb
af30: 75 67 67 79 4d 61 74 63 68 65 73 2e 74 65 73 74  uggyMatches.test
af40: 28 20 65 78 70 72 20 29 20 29 20 26 26 0a 09 09  ( expr ) ) &&...
af50: 28 20 21 72 62 75 67 67 79 51 53 41 20 20 20 20  ( !rbuggyQSA    
af60: 20 7c 7c 20 21 72 62 75 67 67 79 51 53 41 2e 74   || !rbuggyQSA.t
af70: 65 73 74 28 20 65 78 70 72 20 29 20 29 20 29 20  est( expr ) ) ) 
af80: 7b 0a 0a 09 09 74 72 79 20 7b 0a 09 09 09 76 61  {....try {....va
af90: 72 20 72 65 74 20 3d 20 6d 61 74 63 68 65 73 2e  r ret = matches.
afa0: 63 61 6c 6c 28 20 65 6c 65 6d 2c 20 65 78 70 72  call( elem, expr
afb0: 20 29 3b 0a 0a 09 09 09 2f 2f 20 49 45 20 39 27   );.....// IE 9'
afc0: 73 20 6d 61 74 63 68 65 73 53 65 6c 65 63 74 6f  s matchesSelecto
afd0: 72 20 72 65 74 75 72 6e 73 20 66 61 6c 73 65 20  r returns false 
afe0: 6f 6e 20 64 69 73 63 6f 6e 6e 65 63 74 65 64 20  on disconnected 
aff0: 6e 6f 64 65 73 0a 09 09 09 69 66 20 28 20 72 65  nodes....if ( re
b000: 74 20 7c 7c 20 73 75 70 70 6f 72 74 2e 64 69 73  t || support.dis
b010: 63 6f 6e 6e 65 63 74 65 64 4d 61 74 63 68 20 7c  connectedMatch |
b020: 7c 0a 0a 09 09 09 09 2f 2f 20 41 73 20 77 65 6c  |......// As wel
b030: 6c 2c 20 64 69 73 63 6f 6e 6e 65 63 74 65 64 20  l, disconnected 
b040: 6e 6f 64 65 73 20 61 72 65 20 73 61 69 64 20 74  nodes are said t
b050: 6f 20 62 65 20 69 6e 20 61 20 64 6f 63 75 6d 65  o be in a docume
b060: 6e 74 0a 09 09 09 09 2f 2f 20 66 72 61 67 6d 65  nt.....// fragme
b070: 6e 74 20 69 6e 20 49 45 20 39 0a 09 09 09 09 65  nt in IE 9.....e
b080: 6c 65 6d 2e 64 6f 63 75 6d 65 6e 74 20 26 26 20  lem.document && 
b090: 65 6c 65 6d 2e 64 6f 63 75 6d 65 6e 74 2e 6e 6f  elem.document.no
b0a0: 64 65 54 79 70 65 20 21 3d 3d 20 31 31 20 29 20  deType !== 11 ) 
b0b0: 7b 0a 09 09 09 09 72 65 74 75 72 6e 20 72 65 74  {.....return ret
b0c0: 3b 0a 09 09 09 7d 0a 09 09 7d 20 63 61 74 63 68  ;....}...} catch
b0d0: 20 28 20 65 20 29 20 7b 0a 09 09 09 6e 6f 6e 6e   ( e ) {....nonn
b0e0: 61 74 69 76 65 53 65 6c 65 63 74 6f 72 43 61 63  ativeSelectorCac
b0f0: 68 65 28 20 65 78 70 72 2c 20 74 72 75 65 20 29  he( expr, true )
b100: 3b 0a 09 09 7d 0a 09 7d 0a 0a 09 72 65 74 75 72  ;...}..}...retur
b110: 6e 20 53 69 7a 7a 6c 65 28 20 65 78 70 72 2c 20  n Sizzle( expr, 
b120: 64 6f 63 75 6d 65 6e 74 2c 20 6e 75 6c 6c 2c 20  document, null, 
b130: 5b 20 65 6c 65 6d 20 5d 20 29 2e 6c 65 6e 67 74  [ elem ] ).lengt
b140: 68 20 3e 20 30 3b 0a 7d 3b 0a 0a 53 69 7a 7a 6c  h > 0;.};..Sizzl
b150: 65 2e 63 6f 6e 74 61 69 6e 73 20 3d 20 66 75 6e  e.contains = fun
b160: 63 74 69 6f 6e 28 20 63 6f 6e 74 65 78 74 2c 20  ction( context, 
b170: 65 6c 65 6d 20 29 20 7b 0a 0a 09 2f 2f 20 53 65  elem ) {...// Se
b180: 74 20 64 6f 63 75 6d 65 6e 74 20 76 61 72 73 20  t document vars 
b190: 69 66 20 6e 65 65 64 65 64 0a 09 2f 2f 20 53 75  if needed..// Su
b1a0: 70 70 6f 72 74 3a 20 49 45 20 31 31 2b 2c 20 45  pport: IE 11+, E
b1b0: 64 67 65 20 31 37 20 2d 20 31 38 2b 0a 09 2f 2f  dge 17 - 18+..//
b1c0: 20 49 45 2f 45 64 67 65 20 73 6f 6d 65 74 69 6d   IE/Edge sometim
b1d0: 65 73 20 74 68 72 6f 77 20 61 20 22 50 65 72 6d  es throw a "Perm
b1e0: 69 73 73 69 6f 6e 20 64 65 6e 69 65 64 22 20 65  ission denied" e
b1f0: 72 72 6f 72 20 77 68 65 6e 20 73 74 72 69 63 74  rror when strict
b200: 2d 63 6f 6d 70 61 72 69 6e 67 0a 09 2f 2f 20 74  -comparing..// t
b210: 77 6f 20 64 6f 63 75 6d 65 6e 74 73 3b 20 73 68  wo documents; sh
b220: 61 6c 6c 6f 77 20 63 6f 6d 70 61 72 69 73 6f 6e  allow comparison
b230: 73 20 77 6f 72 6b 2e 0a 09 2f 2f 20 65 73 6c 69  s work...// esli
b240: 6e 74 2d 64 69 73 61 62 6c 65 2d 6e 65 78 74 2d  nt-disable-next-
b250: 6c 69 6e 65 20 65 71 65 71 65 71 0a 09 69 66 20  line eqeqeq..if 
b260: 28 20 28 20 63 6f 6e 74 65 78 74 2e 6f 77 6e 65  ( ( context.owne
b270: 72 44 6f 63 75 6d 65 6e 74 20 7c 7c 20 63 6f 6e  rDocument || con
b280: 74 65 78 74 20 29 20 21 3d 20 64 6f 63 75 6d 65  text ) != docume
b290: 6e 74 20 29 20 7b 0a 09 09 73 65 74 44 6f 63 75  nt ) {...setDocu
b2a0: 6d 65 6e 74 28 20 63 6f 6e 74 65 78 74 20 29 3b  ment( context );
b2b0: 0a 09 7d 0a 09 72 65 74 75 72 6e 20 63 6f 6e 74  ..}..return cont
b2c0: 61 69 6e 73 28 20 63 6f 6e 74 65 78 74 2c 20 65  ains( context, e
b2d0: 6c 65 6d 20 29 3b 0a 7d 3b 0a 0a 53 69 7a 7a 6c  lem );.};..Sizzl
b2e0: 65 2e 61 74 74 72 20 3d 20 66 75 6e 63 74 69 6f  e.attr = functio
b2f0: 6e 28 20 65 6c 65 6d 2c 20 6e 61 6d 65 20 29 20  n( elem, name ) 
b300: 7b 0a 0a 09 2f 2f 20 53 65 74 20 64 6f 63 75 6d  {...// Set docum
b310: 65 6e 74 20 76 61 72 73 20 69 66 20 6e 65 65 64  ent vars if need
b320: 65 64 0a 09 2f 2f 20 53 75 70 70 6f 72 74 3a 20  ed..// Support: 
b330: 49 45 20 31 31 2b 2c 20 45 64 67 65 20 31 37 20  IE 11+, Edge 17 
b340: 2d 20 31 38 2b 0a 09 2f 2f 20 49 45 2f 45 64 67  - 18+..// IE/Edg
b350: 65 20 73 6f 6d 65 74 69 6d 65 73 20 74 68 72 6f  e sometimes thro
b360: 77 20 61 20 22 50 65 72 6d 69 73 73 69 6f 6e 20  w a "Permission 
b370: 64 65 6e 69 65 64 22 20 65 72 72 6f 72 20 77 68  denied" error wh
b380: 65 6e 20 73 74 72 69 63 74 2d 63 6f 6d 70 61 72  en strict-compar
b390: 69 6e 67 0a 09 2f 2f 20 74 77 6f 20 64 6f 63 75  ing..// two docu
b3a0: 6d 65 6e 74 73 3b 20 73 68 61 6c 6c 6f 77 20 63  ments; shallow c
b3b0: 6f 6d 70 61 72 69 73 6f 6e 73 20 77 6f 72 6b 2e  omparisons work.
b3c0: 0a 09 2f 2f 20 65 73 6c 69 6e 74 2d 64 69 73 61  ..// eslint-disa
b3d0: 62 6c 65 2d 6e 65 78 74 2d 6c 69 6e 65 20 65 71  ble-next-line eq
b3e0: 65 71 65 71 0a 09 69 66 20 28 20 28 20 65 6c 65  eqeq..if ( ( ele
b3f0: 6d 2e 6f 77 6e 65 72 44 6f 63 75 6d 65 6e 74 20  m.ownerDocument 
b400: 7c 7c 20 65 6c 65 6d 20 29 20 21 3d 20 64 6f 63  || elem ) != doc
b410: 75 6d 65 6e 74 20 29 20 7b 0a 09 09 73 65 74 44  ument ) {...setD
b420: 6f 63 75 6d 65 6e 74 28 20 65 6c 65 6d 20 29 3b  ocument( elem );
b430: 0a 09 7d 0a 0a 09 76 61 72 20 66 6e 20 3d 20 45  ..}...var fn = E
b440: 78 70 72 2e 61 74 74 72 48 61 6e 64 6c 65 5b 20  xpr.attrHandle[ 
b450: 6e 61 6d 65 2e 74 6f 4c 6f 77 65 72 43 61 73 65  name.toLowerCase
b460: 28 29 20 5d 2c 0a 0a 09 09 2f 2f 20 44 6f 6e 27  () ],....// Don'
b470: 74 20 67 65 74 20 66 6f 6f 6c 65 64 20 62 79 20  t get fooled by 
b480: 4f 62 6a 65 63 74 2e 70 72 6f 74 6f 74 79 70 65  Object.prototype
b490: 20 70 72 6f 70 65 72 74 69 65 73 20 28 6a 51 75   properties (jQu
b4a0: 65 72 79 20 23 31 33 38 30 37 29 0a 09 09 76 61  ery #13807)...va
b4b0: 6c 20 3d 20 66 6e 20 26 26 20 68 61 73 4f 77 6e  l = fn && hasOwn
b4c0: 2e 63 61 6c 6c 28 20 45 78 70 72 2e 61 74 74 72  .call( Expr.attr
b4d0: 48 61 6e 64 6c 65 2c 20 6e 61 6d 65 2e 74 6f 4c  Handle, name.toL
b4e0: 6f 77 65 72 43 61 73 65 28 29 20 29 20 3f 0a 09  owerCase() ) ?..
b4f0: 09 09 66 6e 28 20 65 6c 65 6d 2c 20 6e 61 6d 65  ..fn( elem, name
b500: 2c 20 21 64 6f 63 75 6d 65 6e 74 49 73 48 54 4d  , !documentIsHTM
b510: 4c 20 29 20 3a 0a 09 09 09 75 6e 64 65 66 69 6e  L ) :....undefin
b520: 65 64 3b 0a 0a 09 72 65 74 75 72 6e 20 76 61 6c  ed;...return val
b530: 20 21 3d 3d 20 75 6e 64 65 66 69 6e 65 64 20 3f   !== undefined ?
b540: 0a 09 09 76 61 6c 20 3a 0a 09 09 73 75 70 70 6f  ...val :...suppo
b550: 72 74 2e 61 74 74 72 69 62 75 74 65 73 20 7c 7c  rt.attributes ||
b560: 20 21 64 6f 63 75 6d 65 6e 74 49 73 48 54 4d 4c   !documentIsHTML
b570: 20 3f 0a 09 09 09 65 6c 65 6d 2e 67 65 74 41 74   ?....elem.getAt
b580: 74 72 69 62 75 74 65 28 20 6e 61 6d 65 20 29 20  tribute( name ) 
b590: 3a 0a 09 09 09 28 20 76 61 6c 20 3d 20 65 6c 65  :....( val = ele
b5a0: 6d 2e 67 65 74 41 74 74 72 69 62 75 74 65 4e 6f  m.getAttributeNo
b5b0: 64 65 28 20 6e 61 6d 65 20 29 20 29 20 26 26 20  de( name ) ) && 
b5c0: 76 61 6c 2e 73 70 65 63 69 66 69 65 64 20 3f 0a  val.specified ?.
b5d0: 09 09 09 09 76 61 6c 2e 76 61 6c 75 65 20 3a 0a  ....val.value :.
b5e0: 09 09 09 09 6e 75 6c 6c 3b 0a 7d 3b 0a 0a 53 69  ....null;.};..Si
b5f0: 7a 7a 6c 65 2e 65 73 63 61 70 65 20 3d 20 66 75  zzle.escape = fu
b600: 6e 63 74 69 6f 6e 28 20 73 65 6c 20 29 20 7b 0a  nction( sel ) {.
b610: 09 72 65 74 75 72 6e 20 28 20 73 65 6c 20 2b 20  .return ( sel + 
b620: 22 22 20 29 2e 72 65 70 6c 61 63 65 28 20 72 63  "" ).replace( rc
b630: 73 73 65 73 63 61 70 65 2c 20 66 63 73 73 65 73  ssescape, fcsses
b640: 63 61 70 65 20 29 3b 0a 7d 3b 0a 0a 53 69 7a 7a  cape );.};..Sizz
b650: 6c 65 2e 65 72 72 6f 72 20 3d 20 66 75 6e 63 74  le.error = funct
b660: 69 6f 6e 28 20 6d 73 67 20 29 20 7b 0a 09 74 68  ion( msg ) {..th
b670: 72 6f 77 20 6e 65 77 20 45 72 72 6f 72 28 20 22  row new Error( "
b680: 53 79 6e 74 61 78 20 65 72 72 6f 72 2c 20 75 6e  Syntax error, un
b690: 72 65 63 6f 67 6e 69 7a 65 64 20 65 78 70 72 65  recognized expre
b6a0: 73 73 69 6f 6e 3a 20 22 20 2b 20 6d 73 67 20 29  ssion: " + msg )
b6b0: 3b 0a 7d 3b 0a 0a 2f 2a 2a 0a 20 2a 20 44 6f 63  ;.};../**. * Doc
b6c0: 75 6d 65 6e 74 20 73 6f 72 74 69 6e 67 20 61 6e  ument sorting an
b6d0: 64 20 72 65 6d 6f 76 69 6e 67 20 64 75 70 6c 69  d removing dupli
b6e0: 63 61 74 65 73 0a 20 2a 20 40 70 61 72 61 6d 20  cates. * @param 
b6f0: 7b 41 72 72 61 79 4c 69 6b 65 7d 20 72 65 73 75  {ArrayLike} resu
b700: 6c 74 73 0a 20 2a 2f 0a 53 69 7a 7a 6c 65 2e 75  lts. */.Sizzle.u
b710: 6e 69 71 75 65 53 6f 72 74 20 3d 20 66 75 6e 63  niqueSort = func
b720: 74 69 6f 6e 28 20 72 65 73 75 6c 74 73 20 29 20  tion( results ) 
b730: 7b 0a 09 76 61 72 20 65 6c 65 6d 2c 0a 09 09 64  {..var elem,...d
b740: 75 70 6c 69 63 61 74 65 73 20 3d 20 5b 5d 2c 0a  uplicates = [],.
b750: 09 09 6a 20 3d 20 30 2c 0a 09 09 69 20 3d 20 30  ..j = 0,...i = 0
b760: 3b 0a 0a 09 2f 2f 20 55 6e 6c 65 73 73 20 77 65  ;...// Unless we
b770: 20 2a 6b 6e 6f 77 2a 20 77 65 20 63 61 6e 20 64   *know* we can d
b780: 65 74 65 63 74 20 64 75 70 6c 69 63 61 74 65 73  etect duplicates
b790: 2c 20 61 73 73 75 6d 65 20 74 68 65 69 72 20 70  , assume their p
b7a0: 72 65 73 65 6e 63 65 0a 09 68 61 73 44 75 70 6c  resence..hasDupl
b7b0: 69 63 61 74 65 20 3d 20 21 73 75 70 70 6f 72 74  icate = !support
b7c0: 2e 64 65 74 65 63 74 44 75 70 6c 69 63 61 74 65  .detectDuplicate
b7d0: 73 3b 0a 09 73 6f 72 74 49 6e 70 75 74 20 3d 20  s;..sortInput = 
b7e0: 21 73 75 70 70 6f 72 74 2e 73 6f 72 74 53 74 61  !support.sortSta
b7f0: 62 6c 65 20 26 26 20 72 65 73 75 6c 74 73 2e 73  ble && results.s
b800: 6c 69 63 65 28 20 30 20 29 3b 0a 09 72 65 73 75  lice( 0 );..resu
b810: 6c 74 73 2e 73 6f 72 74 28 20 73 6f 72 74 4f 72  lts.sort( sortOr
b820: 64 65 72 20 29 3b 0a 0a 09 69 66 20 28 20 68 61  der );...if ( ha
b830: 73 44 75 70 6c 69 63 61 74 65 20 29 20 7b 0a 09  sDuplicate ) {..
b840: 09 77 68 69 6c 65 20 28 20 28 20 65 6c 65 6d 20  .while ( ( elem 
b850: 3d 20 72 65 73 75 6c 74 73 5b 20 69 2b 2b 20 5d  = results[ i++ ]
b860: 20 29 20 29 20 7b 0a 09 09 09 69 66 20 28 20 65   ) ) {....if ( e
b870: 6c 65 6d 20 3d 3d 3d 20 72 65 73 75 6c 74 73 5b  lem === results[
b880: 20 69 20 5d 20 29 20 7b 0a 09 09 09 09 6a 20 3d   i ] ) {.....j =
b890: 20 64 75 70 6c 69 63 61 74 65 73 2e 70 75 73 68   duplicates.push
b8a0: 28 20 69 20 29 3b 0a 09 09 09 7d 0a 09 09 7d 0a  ( i );....}...}.
b8b0: 09 09 77 68 69 6c 65 20 28 20 6a 2d 2d 20 29 20  ..while ( j-- ) 
b8c0: 7b 0a 09 09 09 72 65 73 75 6c 74 73 2e 73 70 6c  {....results.spl
b8d0: 69 63 65 28 20 64 75 70 6c 69 63 61 74 65 73 5b  ice( duplicates[
b8e0: 20 6a 20 5d 2c 20 31 20 29 3b 0a 09 09 7d 0a 09   j ], 1 );...}..
b8f0: 7d 0a 0a 09 2f 2f 20 43 6c 65 61 72 20 69 6e 70  }...// Clear inp
b900: 75 74 20 61 66 74 65 72 20 73 6f 72 74 69 6e 67  ut after sorting
b910: 20 74 6f 20 72 65 6c 65 61 73 65 20 6f 62 6a 65   to release obje
b920: 63 74 73 0a 09 2f 2f 20 53 65 65 20 68 74 74 70  cts..// See http
b930: 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d 2f 6a  s://github.com/j
b940: 71 75 65 72 79 2f 73 69 7a 7a 6c 65 2f 70 75 6c  query/sizzle/pul
b950: 6c 2f 32 32 35 0a 09 73 6f 72 74 49 6e 70 75 74  l/225..sortInput
b960: 20 3d 20 6e 75 6c 6c 3b 0a 0a 09 72 65 74 75 72   = null;...retur
b970: 6e 20 72 65 73 75 6c 74 73 3b 0a 7d 3b 0a 0a 2f  n results;.};../
b980: 2a 2a 0a 20 2a 20 55 74 69 6c 69 74 79 20 66 75  **. * Utility fu
b990: 6e 63 74 69 6f 6e 20 66 6f 72 20 72 65 74 72 69  nction for retri
b9a0: 65 76 69 6e 67 20 74 68 65 20 74 65 78 74 20 76  eving the text v
b9b0: 61 6c 75 65 20 6f 66 20 61 6e 20 61 72 72 61 79  alue of an array
b9c0: 20 6f 66 20 44 4f 4d 20 6e 6f 64 65 73 0a 20 2a   of DOM nodes. *
b9d0: 20 40 70 61 72 61 6d 20 7b 41 72 72 61 79 7c 45   @param {Array|E
b9e0: 6c 65 6d 65 6e 74 7d 20 65 6c 65 6d 0a 20 2a 2f  lement} elem. */
b9f0: 0a 67 65 74 54 65 78 74 20 3d 20 53 69 7a 7a 6c  .getText = Sizzl
ba00: 65 2e 67 65 74 54 65 78 74 20 3d 20 66 75 6e 63  e.getText = func
ba10: 74 69 6f 6e 28 20 65 6c 65 6d 20 29 20 7b 0a 09  tion( elem ) {..
ba20: 76 61 72 20 6e 6f 64 65 2c 0a 09 09 72 65 74 20  var node,...ret 
ba30: 3d 20 22 22 2c 0a 09 09 69 20 3d 20 30 2c 0a 09  = "",...i = 0,..
ba40: 09 6e 6f 64 65 54 79 70 65 20 3d 20 65 6c 65 6d  .nodeType = elem
ba50: 2e 6e 6f 64 65 54 79 70 65 3b 0a 0a 09 69 66 20  .nodeType;...if 
ba60: 28 20 21 6e 6f 64 65 54 79 70 65 20 29 20 7b 0a  ( !nodeType ) {.
ba70: 0a 09 09 2f 2f 20 49 66 20 6e 6f 20 6e 6f 64 65  ...// If no node
ba80: 54 79 70 65 2c 20 74 68 69 73 20 69 73 20 65 78  Type, this is ex
ba90: 70 65 63 74 65 64 20 74 6f 20 62 65 20 61 6e 20  pected to be an 
baa0: 61 72 72 61 79 0a 09 09 77 68 69 6c 65 20 28 20  array...while ( 
bab0: 28 20 6e 6f 64 65 20 3d 20 65 6c 65 6d 5b 20 69  ( node = elem[ i
bac0: 2b 2b 20 5d 20 29 20 29 20 7b 0a 0a 09 09 09 2f  ++ ] ) ) {...../
bad0: 2f 20 44 6f 20 6e 6f 74 20 74 72 61 76 65 72 73  / Do not travers
bae0: 65 20 63 6f 6d 6d 65 6e 74 20 6e 6f 64 65 73 0a  e comment nodes.
baf0: 09 09 09 72 65 74 20 2b 3d 20 67 65 74 54 65 78  ...ret += getTex
bb00: 74 28 20 6e 6f 64 65 20 29 3b 0a 09 09 7d 0a 09  t( node );...}..
bb10: 7d 20 65 6c 73 65 20 69 66 20 28 20 6e 6f 64 65  } else if ( node
bb20: 54 79 70 65 20 3d 3d 3d 20 31 20 7c 7c 20 6e 6f  Type === 1 || no
bb30: 64 65 54 79 70 65 20 3d 3d 3d 20 39 20 7c 7c 20  deType === 9 || 
bb40: 6e 6f 64 65 54 79 70 65 20 3d 3d 3d 20 31 31 20  nodeType === 11 
bb50: 29 20 7b 0a 0a 09 09 2f 2f 20 55 73 65 20 74 65  ) {....// Use te
bb60: 78 74 43 6f 6e 74 65 6e 74 20 66 6f 72 20 65 6c  xtContent for el
bb70: 65 6d 65 6e 74 73 0a 09 09 2f 2f 20 69 6e 6e 65  ements...// inne
bb80: 72 54 65 78 74 20 75 73 61 67 65 20 72 65 6d 6f  rText usage remo
bb90: 76 65 64 20 66 6f 72 20 63 6f 6e 73 69 73 74 65  ved for consiste
bba0: 6e 63 79 20 6f 66 20 6e 65 77 20 6c 69 6e 65 73  ncy of new lines
bbb0: 20 28 6a 51 75 65 72 79 20 23 31 31 31 35 33 29   (jQuery #11153)
bbc0: 0a 09 09 69 66 20 28 20 74 79 70 65 6f 66 20 65  ...if ( typeof e
bbd0: 6c 65 6d 2e 74 65 78 74 43 6f 6e 74 65 6e 74 20  lem.textContent 
bbe0: 3d 3d 3d 20 22 73 74 72 69 6e 67 22 20 29 20 7b  === "string" ) {
bbf0: 0a 09 09 09 72 65 74 75 72 6e 20 65 6c 65 6d 2e  ....return elem.
bc00: 74 65 78 74 43 6f 6e 74 65 6e 74 3b 0a 09 09 7d  textContent;...}
bc10: 20 65 6c 73 65 20 7b 0a 0a 09 09 09 2f 2f 20 54   else {.....// T
bc20: 72 61 76 65 72 73 65 20 69 74 73 20 63 68 69 6c  raverse its chil
bc30: 64 72 65 6e 0a 09 09 09 66 6f 72 20 28 20 65 6c  dren....for ( el
bc40: 65 6d 20 3d 20 65 6c 65 6d 2e 66 69 72 73 74 43  em = elem.firstC
bc50: 68 69 6c 64 3b 20 65 6c 65 6d 3b 20 65 6c 65 6d  hild; elem; elem
bc60: 20 3d 20 65 6c 65 6d 2e 6e 65 78 74 53 69 62 6c   = elem.nextSibl
bc70: 69 6e 67 20 29 20 7b 0a 09 09 09 09 72 65 74 20  ing ) {.....ret 
bc80: 2b 3d 20 67 65 74 54 65 78 74 28 20 65 6c 65 6d  += getText( elem
bc90: 20 29 3b 0a 09 09 09 7d 0a 09 09 7d 0a 09 7d 20   );....}...}..} 
bca0: 65 6c 73 65 20 69 66 20 28 20 6e 6f 64 65 54 79  else if ( nodeTy
bcb0: 70 65 20 3d 3d 3d 20 33 20 7c 7c 20 6e 6f 64 65  pe === 3 || node
bcc0: 54 79 70 65 20 3d 3d 3d 20 34 20 29 20 7b 0a 09  Type === 4 ) {..
bcd0: 09 72 65 74 75 72 6e 20 65 6c 65 6d 2e 6e 6f 64  .return elem.nod
bce0: 65 56 61 6c 75 65 3b 0a 09 7d 0a 0a 09 2f 2f 20  eValue;..}...// 
bcf0: 44 6f 20 6e 6f 74 20 69 6e 63 6c 75 64 65 20 63  Do not include c
bd00: 6f 6d 6d 65 6e 74 20 6f 72 20 70 72 6f 63 65 73  omment or proces
bd10: 73 69 6e 67 20 69 6e 73 74 72 75 63 74 69 6f 6e  sing instruction
bd20: 20 6e 6f 64 65 73 0a 0a 09 72 65 74 75 72 6e 20   nodes...return 
bd30: 72 65 74 3b 0a 7d 3b 0a 0a 45 78 70 72 20 3d 20  ret;.};..Expr = 
bd40: 53 69 7a 7a 6c 65 2e 73 65 6c 65 63 74 6f 72 73  Sizzle.selectors
bd50: 20 3d 20 7b 0a 0a 09 2f 2f 20 43 61 6e 20 62 65   = {...// Can be
bd60: 20 61 64 6a 75 73 74 65 64 20 62 79 20 74 68 65   adjusted by the
bd70: 20 75 73 65 72 0a 09 63 61 63 68 65 4c 65 6e 67   user..cacheLeng
bd80: 74 68 3a 20 35 30 2c 0a 0a 09 63 72 65 61 74 65  th: 50,...create
bd90: 50 73 65 75 64 6f 3a 20 6d 61 72 6b 46 75 6e 63  Pseudo: markFunc
bda0: 74 69 6f 6e 2c 0a 0a 09 6d 61 74 63 68 3a 20 6d  tion,...match: m
bdb0: 61 74 63 68 45 78 70 72 2c 0a 0a 09 61 74 74 72  atchExpr,...attr
bdc0: 48 61 6e 64 6c 65 3a 20 7b 7d 2c 0a 0a 09 66 69  Handle: {},...fi
bdd0: 6e 64 3a 20 7b 7d 2c 0a 0a 09 72 65 6c 61 74 69  nd: {},...relati
bde0: 76 65 3a 20 7b 0a 09 09 22 3e 22 3a 20 7b 20 64  ve: {...">": { d
bdf0: 69 72 3a 20 22 70 61 72 65 6e 74 4e 6f 64 65 22  ir: "parentNode"
be00: 2c 20 66 69 72 73 74 3a 20 74 72 75 65 20 7d 2c  , first: true },
be10: 0a 09 09 22 20 22 3a 20 7b 20 64 69 72 3a 20 22  ..." ": { dir: "
be20: 70 61 72 65 6e 74 4e 6f 64 65 22 20 7d 2c 0a 09  parentNode" },..
be30: 09 22 2b 22 3a 20 7b 20 64 69 72 3a 20 22 70 72  ."+": { dir: "pr
be40: 65 76 69 6f 75 73 53 69 62 6c 69 6e 67 22 2c 20  eviousSibling", 
be50: 66 69 72 73 74 3a 20 74 72 75 65 20 7d 2c 0a 09  first: true },..
be60: 09 22 7e 22 3a 20 7b 20 64 69 72 3a 20 22 70 72  ."~": { dir: "pr
be70: 65 76 69 6f 75 73 53 69 62 6c 69 6e 67 22 20 7d  eviousSibling" }
be80: 0a 09 7d 2c 0a 0a 09 70 72 65 46 69 6c 74 65 72  ..},...preFilter
be90: 3a 20 7b 0a 09 09 22 41 54 54 52 22 3a 20 66 75  : {..."ATTR": fu
bea0: 6e 63 74 69 6f 6e 28 20 6d 61 74 63 68 20 29 20  nction( match ) 
beb0: 7b 0a 09 09 09 6d 61 74 63 68 5b 20 31 20 5d 20  {....match[ 1 ] 
bec0: 3d 20 6d 61 74 63 68 5b 20 31 20 5d 2e 72 65 70  = match[ 1 ].rep
bed0: 6c 61 63 65 28 20 72 75 6e 65 73 63 61 70 65 2c  lace( runescape,
bee0: 20 66 75 6e 65 73 63 61 70 65 20 29 3b 0a 0a 09   funescape );...
bef0: 09 09 2f 2f 20 4d 6f 76 65 20 74 68 65 20 67 69  ..// Move the gi
bf00: 76 65 6e 20 76 61 6c 75 65 20 74 6f 20 6d 61 74  ven value to mat
bf10: 63 68 5b 33 5d 20 77 68 65 74 68 65 72 20 71 75  ch[3] whether qu
bf20: 6f 74 65 64 20 6f 72 20 75 6e 71 75 6f 74 65 64  oted or unquoted
bf30: 0a 09 09 09 6d 61 74 63 68 5b 20 33 20 5d 20 3d  ....match[ 3 ] =
bf40: 20 28 20 6d 61 74 63 68 5b 20 33 20 5d 20 7c 7c   ( match[ 3 ] ||
bf50: 20 6d 61 74 63 68 5b 20 34 20 5d 20 7c 7c 0a 09   match[ 4 ] ||..
bf60: 09 09 09 6d 61 74 63 68 5b 20 35 20 5d 20 7c 7c  ...match[ 5 ] ||
bf70: 20 22 22 20 29 2e 72 65 70 6c 61 63 65 28 20 72   "" ).replace( r
bf80: 75 6e 65 73 63 61 70 65 2c 20 66 75 6e 65 73 63  unescape, funesc
bf90: 61 70 65 20 29 3b 0a 0a 09 09 09 69 66 20 28 20  ape );.....if ( 
bfa0: 6d 61 74 63 68 5b 20 32 20 5d 20 3d 3d 3d 20 22  match[ 2 ] === "
bfb0: 7e 3d 22 20 29 20 7b 0a 09 09 09 09 6d 61 74 63  ~=" ) {.....matc
bfc0: 68 5b 20 33 20 5d 20 3d 20 22 20 22 20 2b 20 6d  h[ 3 ] = " " + m
bfd0: 61 74 63 68 5b 20 33 20 5d 20 2b 20 22 20 22 3b  atch[ 3 ] + " ";
bfe0: 0a 09 09 09 7d 0a 0a 09 09 09 72 65 74 75 72 6e  ....}.....return
bff0: 20 6d 61 74 63 68 2e 73 6c 69 63 65 28 20 30 2c   match.slice( 0,
c000: 20 34 20 29 3b 0a 09 09 7d 2c 0a 0a 09 09 22 43   4 );...},...."C
c010: 48 49 4c 44 22 3a 20 66 75 6e 63 74 69 6f 6e 28  HILD": function(
c020: 20 6d 61 74 63 68 20 29 20 7b 0a 0a 09 09 09 2f   match ) {...../
c030: 2a 20 6d 61 74 63 68 65 73 20 66 72 6f 6d 20 6d  * matches from m
c040: 61 74 63 68 45 78 70 72 5b 22 43 48 49 4c 44 22  atchExpr["CHILD"
c050: 5d 0a 09 09 09 09 31 20 74 79 70 65 20 28 6f 6e  ].....1 type (on
c060: 6c 79 7c 6e 74 68 7c 2e 2e 2e 29 0a 09 09 09 09  ly|nth|...).....
c070: 32 20 77 68 61 74 20 28 63 68 69 6c 64 7c 6f 66  2 what (child|of
c080: 2d 74 79 70 65 29 0a 09 09 09 09 33 20 61 72 67  -type).....3 arg
c090: 75 6d 65 6e 74 20 28 65 76 65 6e 7c 6f 64 64 7c  ument (even|odd|
c0a0: 5c 64 2a 7c 5c 64 2a 6e 28 5b 2b 2d 5d 5c 64 2b  \d*|\d*n([+-]\d+
c0b0: 29 3f 7c 2e 2e 2e 29 0a 09 09 09 09 34 20 78 6e  )?|...).....4 xn
c0c0: 2d 63 6f 6d 70 6f 6e 65 6e 74 20 6f 66 20 78 6e  -component of xn
c0d0: 2b 79 20 61 72 67 75 6d 65 6e 74 20 28 5b 2b 2d  +y argument ([+-
c0e0: 5d 3f 5c 64 2a 6e 7c 29 0a 09 09 09 09 35 20 73  ]?\d*n|).....5 s
c0f0: 69 67 6e 20 6f 66 20 78 6e 2d 63 6f 6d 70 6f 6e  ign of xn-compon
c100: 65 6e 74 0a 09 09 09 09 36 20 78 20 6f 66 20 78  ent.....6 x of x
c110: 6e 2d 63 6f 6d 70 6f 6e 65 6e 74 0a 09 09 09 09  n-component.....
c120: 37 20 73 69 67 6e 20 6f 66 20 79 2d 63 6f 6d 70  7 sign of y-comp
c130: 6f 6e 65 6e 74 0a 09 09 09 09 38 20 79 20 6f 66  onent.....8 y of
c140: 20 79 2d 63 6f 6d 70 6f 6e 65 6e 74 0a 09 09 09   y-component....
c150: 2a 2f 0a 09 09 09 6d 61 74 63 68 5b 20 31 20 5d  */....match[ 1 ]
c160: 20 3d 20 6d 61 74 63 68 5b 20 31 20 5d 2e 74 6f   = match[ 1 ].to
c170: 4c 6f 77 65 72 43 61 73 65 28 29 3b 0a 0a 09 09  LowerCase();....
c180: 09 69 66 20 28 20 6d 61 74 63 68 5b 20 31 20 5d  .if ( match[ 1 ]
c190: 2e 73 6c 69 63 65 28 20 30 2c 20 33 20 29 20 3d  .slice( 0, 3 ) =
c1a0: 3d 3d 20 22 6e 74 68 22 20 29 20 7b 0a 0a 09 09  == "nth" ) {....
c1b0: 09 09 2f 2f 20 6e 74 68 2d 2a 20 72 65 71 75 69  ..// nth-* requi
c1c0: 72 65 73 20 61 72 67 75 6d 65 6e 74 0a 09 09 09  res argument....
c1d0: 09 69 66 20 28 20 21 6d 61 74 63 68 5b 20 33 20  .if ( !match[ 3 
c1e0: 5d 20 29 20 7b 0a 09 09 09 09 09 53 69 7a 7a 6c  ] ) {......Sizzl
c1f0: 65 2e 65 72 72 6f 72 28 20 6d 61 74 63 68 5b 20  e.error( match[ 
c200: 30 20 5d 20 29 3b 0a 09 09 09 09 7d 0a 0a 09 09  0 ] );.....}....
c210: 09 09 2f 2f 20 6e 75 6d 65 72 69 63 20 78 20 61  ..// numeric x a
c220: 6e 64 20 79 20 70 61 72 61 6d 65 74 65 72 73 20  nd y parameters 
c230: 66 6f 72 20 45 78 70 72 2e 66 69 6c 74 65 72 2e  for Expr.filter.
c240: 43 48 49 4c 44 0a 09 09 09 09 2f 2f 20 72 65 6d  CHILD.....// rem
c250: 65 6d 62 65 72 20 74 68 61 74 20 66 61 6c 73 65  ember that false
c260: 2f 74 72 75 65 20 63 61 73 74 20 72 65 73 70 65  /true cast respe
c270: 63 74 69 76 65 6c 79 20 74 6f 20 30 2f 31 0a 09  ctively to 0/1..
c280: 09 09 09 6d 61 74 63 68 5b 20 34 20 5d 20 3d 20  ...match[ 4 ] = 
c290: 2b 28 20 6d 61 74 63 68 5b 20 34 20 5d 20 3f 0a  +( match[ 4 ] ?.
c2a0: 09 09 09 09 09 6d 61 74 63 68 5b 20 35 20 5d 20  .....match[ 5 ] 
c2b0: 2b 20 28 20 6d 61 74 63 68 5b 20 36 20 5d 20 7c  + ( match[ 6 ] |
c2c0: 7c 20 31 20 29 20 3a 0a 09 09 09 09 09 32 20 2a  | 1 ) :......2 *
c2d0: 20 28 20 6d 61 74 63 68 5b 20 33 20 5d 20 3d 3d   ( match[ 3 ] ==
c2e0: 3d 20 22 65 76 65 6e 22 20 7c 7c 20 6d 61 74 63  = "even" || matc
c2f0: 68 5b 20 33 20 5d 20 3d 3d 3d 20 22 6f 64 64 22  h[ 3 ] === "odd"
c300: 20 29 20 29 3b 0a 09 09 09 09 6d 61 74 63 68 5b   ) );.....match[
c310: 20 35 20 5d 20 3d 20 2b 28 20 28 20 6d 61 74 63   5 ] = +( ( matc
c320: 68 5b 20 37 20 5d 20 2b 20 6d 61 74 63 68 5b 20  h[ 7 ] + match[ 
c330: 38 20 5d 20 29 20 7c 7c 20 6d 61 74 63 68 5b 20  8 ] ) || match[ 
c340: 33 20 5d 20 3d 3d 3d 20 22 6f 64 64 22 20 29 3b  3 ] === "odd" );
c350: 0a 0a 09 09 09 09 2f 2f 20 6f 74 68 65 72 20 74  ......// other t
c360: 79 70 65 73 20 70 72 6f 68 69 62 69 74 20 61 72  ypes prohibit ar
c370: 67 75 6d 65 6e 74 73 0a 09 09 09 7d 20 65 6c 73  guments....} els
c380: 65 20 69 66 20 28 20 6d 61 74 63 68 5b 20 33 20  e if ( match[ 3 
c390: 5d 20 29 20 7b 0a 09 09 09 09 53 69 7a 7a 6c 65  ] ) {.....Sizzle
c3a0: 2e 65 72 72 6f 72 28 20 6d 61 74 63 68 5b 20 30  .error( match[ 0
c3b0: 20 5d 20 29 3b 0a 09 09 09 7d 0a 0a 09 09 09 72   ] );....}.....r
c3c0: 65 74 75 72 6e 20 6d 61 74 63 68 3b 0a 09 09 7d  eturn match;...}
c3d0: 2c 0a 0a 09 09 22 50 53 45 55 44 4f 22 3a 20 66  ,...."PSEUDO": f
c3e0: 75 6e 63 74 69 6f 6e 28 20 6d 61 74 63 68 20 29  unction( match )
c3f0: 20 7b 0a 09 09 09 76 61 72 20 65 78 63 65 73 73   {....var excess
c400: 2c 0a 09 09 09 09 75 6e 71 75 6f 74 65 64 20 3d  ,.....unquoted =
c410: 20 21 6d 61 74 63 68 5b 20 36 20 5d 20 26 26 20   !match[ 6 ] && 
c420: 6d 61 74 63 68 5b 20 32 20 5d 3b 0a 0a 09 09 09  match[ 2 ];.....
c430: 69 66 20 28 20 6d 61 74 63 68 45 78 70 72 5b 20  if ( matchExpr[ 
c440: 22 43 48 49 4c 44 22 20 5d 2e 74 65 73 74 28 20  "CHILD" ].test( 
c450: 6d 61 74 63 68 5b 20 30 20 5d 20 29 20 29 20 7b  match[ 0 ] ) ) {
c460: 0a 09 09 09 09 72 65 74 75 72 6e 20 6e 75 6c 6c  .....return null
c470: 3b 0a 09 09 09 7d 0a 0a 09 09 09 2f 2f 20 41 63  ;....}.....// Ac
c480: 63 65 70 74 20 71 75 6f 74 65 64 20 61 72 67 75  cept quoted argu
c490: 6d 65 6e 74 73 20 61 73 2d 69 73 0a 09 09 09 69  ments as-is....i
c4a0: 66 20 28 20 6d 61 74 63 68 5b 20 33 20 5d 20 29  f ( match[ 3 ] )
c4b0: 20 7b 0a 09 09 09 09 6d 61 74 63 68 5b 20 32 20   {.....match[ 2 
c4c0: 5d 20 3d 20 6d 61 74 63 68 5b 20 34 20 5d 20 7c  ] = match[ 4 ] |
c4d0: 7c 20 6d 61 74 63 68 5b 20 35 20 5d 20 7c 7c 20  | match[ 5 ] || 
c4e0: 22 22 3b 0a 0a 09 09 09 2f 2f 20 53 74 72 69 70  "";.....// Strip
c4f0: 20 65 78 63 65 73 73 20 63 68 61 72 61 63 74 65   excess characte
c500: 72 73 20 66 72 6f 6d 20 75 6e 71 75 6f 74 65 64  rs from unquoted
c510: 20 61 72 67 75 6d 65 6e 74 73 0a 09 09 09 7d 20   arguments....} 
c520: 65 6c 73 65 20 69 66 20 28 20 75 6e 71 75 6f 74  else if ( unquot
c530: 65 64 20 26 26 20 72 70 73 65 75 64 6f 2e 74 65  ed && rpseudo.te
c540: 73 74 28 20 75 6e 71 75 6f 74 65 64 20 29 20 26  st( unquoted ) &
c550: 26 0a 0a 09 09 09 09 2f 2f 20 47 65 74 20 65 78  &......// Get ex
c560: 63 65 73 73 20 66 72 6f 6d 20 74 6f 6b 65 6e 69  cess from tokeni
c570: 7a 65 20 28 72 65 63 75 72 73 69 76 65 6c 79 29  ze (recursively)
c580: 0a 09 09 09 09 28 20 65 78 63 65 73 73 20 3d 20  .....( excess = 
c590: 74 6f 6b 65 6e 69 7a 65 28 20 75 6e 71 75 6f 74  tokenize( unquot
c5a0: 65 64 2c 20 74 72 75 65 20 29 20 29 20 26 26 0a  ed, true ) ) &&.
c5b0: 0a 09 09 09 09 2f 2f 20 61 64 76 61 6e 63 65 20  .....// advance 
c5c0: 74 6f 20 74 68 65 20 6e 65 78 74 20 63 6c 6f 73  to the next clos
c5d0: 69 6e 67 20 70 61 72 65 6e 74 68 65 73 69 73 0a  ing parenthesis.
c5e0: 09 09 09 09 28 20 65 78 63 65 73 73 20 3d 20 75  ....( excess = u
c5f0: 6e 71 75 6f 74 65 64 2e 69 6e 64 65 78 4f 66 28  nquoted.indexOf(
c600: 20 22 29 22 2c 20 75 6e 71 75 6f 74 65 64 2e 6c   ")", unquoted.l
c610: 65 6e 67 74 68 20 2d 20 65 78 63 65 73 73 20 29  ength - excess )
c620: 20 2d 20 75 6e 71 75 6f 74 65 64 2e 6c 65 6e 67   - unquoted.leng
c630: 74 68 20 29 20 29 20 7b 0a 0a 09 09 09 09 2f 2f  th ) ) {......//
c640: 20 65 78 63 65 73 73 20 69 73 20 61 20 6e 65 67   excess is a neg
c650: 61 74 69 76 65 20 69 6e 64 65 78 0a 09 09 09 09  ative index.....
c660: 6d 61 74 63 68 5b 20 30 20 5d 20 3d 20 6d 61 74  match[ 0 ] = mat
c670: 63 68 5b 20 30 20 5d 2e 73 6c 69 63 65 28 20 30  ch[ 0 ].slice( 0
c680: 2c 20 65 78 63 65 73 73 20 29 3b 0a 09 09 09 09  , excess );.....
c690: 6d 61 74 63 68 5b 20 32 20 5d 20 3d 20 75 6e 71  match[ 2 ] = unq
c6a0: 75 6f 74 65 64 2e 73 6c 69 63 65 28 20 30 2c 20  uoted.slice( 0, 
c6b0: 65 78 63 65 73 73 20 29 3b 0a 09 09 09 7d 0a 0a  excess );....}..
c6c0: 09 09 09 2f 2f 20 52 65 74 75 72 6e 20 6f 6e 6c  ...// Return onl
c6d0: 79 20 63 61 70 74 75 72 65 73 20 6e 65 65 64 65  y captures neede
c6e0: 64 20 62 79 20 74 68 65 20 70 73 65 75 64 6f 20  d by the pseudo 
c6f0: 66 69 6c 74 65 72 20 6d 65 74 68 6f 64 20 28 74  filter method (t
c700: 79 70 65 20 61 6e 64 20 61 72 67 75 6d 65 6e 74  ype and argument
c710: 29 0a 09 09 09 72 65 74 75 72 6e 20 6d 61 74 63  )....return matc
c720: 68 2e 73 6c 69 63 65 28 20 30 2c 20 33 20 29 3b  h.slice( 0, 3 );
c730: 0a 09 09 7d 0a 09 7d 2c 0a 0a 09 66 69 6c 74 65  ...}..},...filte
c740: 72 3a 20 7b 0a 0a 09 09 22 54 41 47 22 3a 20 66  r: {...."TAG": f
c750: 75 6e 63 74 69 6f 6e 28 20 6e 6f 64 65 4e 61 6d  unction( nodeNam
c760: 65 53 65 6c 65 63 74 6f 72 20 29 20 7b 0a 09 09  eSelector ) {...
c770: 09 76 61 72 20 6e 6f 64 65 4e 61 6d 65 20 3d 20  .var nodeName = 
c780: 6e 6f 64 65 4e 61 6d 65 53 65 6c 65 63 74 6f 72  nodeNameSelector
c790: 2e 72 65 70 6c 61 63 65 28 20 72 75 6e 65 73 63  .replace( runesc
c7a0: 61 70 65 2c 20 66 75 6e 65 73 63 61 70 65 20 29  ape, funescape )
c7b0: 2e 74 6f 4c 6f 77 65 72 43 61 73 65 28 29 3b 0a  .toLowerCase();.
c7c0: 09 09 09 72 65 74 75 72 6e 20 6e 6f 64 65 4e 61  ...return nodeNa
c7d0: 6d 65 53 65 6c 65 63 74 6f 72 20 3d 3d 3d 20 22  meSelector === "
c7e0: 2a 22 20 3f 0a 09 09 09 09 66 75 6e 63 74 69 6f  *" ?.....functio
c7f0: 6e 28 29 20 7b 0a 09 09 09 09 09 72 65 74 75 72  n() {......retur
c800: 6e 20 74 72 75 65 3b 0a 09 09 09 09 7d 20 3a 0a  n true;.....} :.
c810: 09 09 09 09 66 75 6e 63 74 69 6f 6e 28 20 65 6c  ....function( el
c820: 65 6d 20 29 20 7b 0a 09 09 09 09 09 72 65 74 75  em ) {......retu
c830: 72 6e 20 65 6c 65 6d 2e 6e 6f 64 65 4e 61 6d 65  rn elem.nodeName
c840: 20 26 26 20 65 6c 65 6d 2e 6e 6f 64 65 4e 61 6d   && elem.nodeNam
c850: 65 2e 74 6f 4c 6f 77 65 72 43 61 73 65 28 29 20  e.toLowerCase() 
c860: 3d 3d 3d 20 6e 6f 64 65 4e 61 6d 65 3b 0a 09 09  === nodeName;...
c870: 09 09 7d 3b 0a 09 09 7d 2c 0a 0a 09 09 22 43 4c  ..};...},...."CL
c880: 41 53 53 22 3a 20 66 75 6e 63 74 69 6f 6e 28 20  ASS": function( 
c890: 63 6c 61 73 73 4e 61 6d 65 20 29 20 7b 0a 09 09  className ) {...
c8a0: 09 76 61 72 20 70 61 74 74 65 72 6e 20 3d 20 63  .var pattern = c
c8b0: 6c 61 73 73 43 61 63 68 65 5b 20 63 6c 61 73 73  lassCache[ class
c8c0: 4e 61 6d 65 20 2b 20 22 20 22 20 5d 3b 0a 0a 09  Name + " " ];...
c8d0: 09 09 72 65 74 75 72 6e 20 70 61 74 74 65 72 6e  ..return pattern
c8e0: 20 7c 7c 0a 09 09 09 09 28 20 70 61 74 74 65 72   ||.....( patter
c8f0: 6e 20 3d 20 6e 65 77 20 52 65 67 45 78 70 28 20  n = new RegExp( 
c900: 22 28 5e 7c 22 20 2b 20 77 68 69 74 65 73 70 61  "(^|" + whitespa
c910: 63 65 20 2b 0a 09 09 09 09 09 22 29 22 20 2b 20  ce +......")" + 
c920: 63 6c 61 73 73 4e 61 6d 65 20 2b 20 22 28 22 20  className + "(" 
c930: 2b 20 77 68 69 74 65 73 70 61 63 65 20 2b 20 22  + whitespace + "
c940: 7c 24 29 22 20 29 20 29 20 26 26 20 63 6c 61 73  |$)" ) ) && clas
c950: 73 43 61 63 68 65 28 0a 09 09 09 09 09 09 63 6c  sCache(.......cl
c960: 61 73 73 4e 61 6d 65 2c 20 66 75 6e 63 74 69 6f  assName, functio
c970: 6e 28 20 65 6c 65 6d 20 29 20 7b 0a 09 09 09 09  n( elem ) {.....
c980: 09 09 09 72 65 74 75 72 6e 20 70 61 74 74 65 72  ...return patter
c990: 6e 2e 74 65 73 74 28 0a 09 09 09 09 09 09 09 09  n.test(.........
c9a0: 74 79 70 65 6f 66 20 65 6c 65 6d 2e 63 6c 61 73  typeof elem.clas
c9b0: 73 4e 61 6d 65 20 3d 3d 3d 20 22 73 74 72 69 6e  sName === "strin
c9c0: 67 22 20 26 26 20 65 6c 65 6d 2e 63 6c 61 73 73  g" && elem.class
c9d0: 4e 61 6d 65 20 7c 7c 0a 09 09 09 09 09 09 09 09  Name ||.........
c9e0: 74 79 70 65 6f 66 20 65 6c 65 6d 2e 67 65 74 41  typeof elem.getA
c9f0: 74 74 72 69 62 75 74 65 20 21 3d 3d 20 22 75 6e  ttribute !== "un
ca00: 64 65 66 69 6e 65 64 22 20 26 26 0a 09 09 09 09  defined" &&.....
ca10: 09 09 09 09 09 65 6c 65 6d 2e 67 65 74 41 74 74  .....elem.getAtt
ca20: 72 69 62 75 74 65 28 20 22 63 6c 61 73 73 22 20  ribute( "class" 
ca30: 29 20 7c 7c 0a 09 09 09 09 09 09 09 09 22 22 0a  ) ||........."".
ca40: 09 09 09 09 09 09 09 29 3b 0a 09 09 09 09 7d 20  .......);.....} 
ca50: 29 3b 0a 09 09 7d 2c 0a 0a 09 09 22 41 54 54 52  );...},...."ATTR
ca60: 22 3a 20 66 75 6e 63 74 69 6f 6e 28 20 6e 61 6d  ": function( nam
ca70: 65 2c 20 6f 70 65 72 61 74 6f 72 2c 20 63 68 65  e, operator, che
ca80: 63 6b 20 29 20 7b 0a 09 09 09 72 65 74 75 72 6e  ck ) {....return
ca90: 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 20   function( elem 
caa0: 29 20 7b 0a 09 09 09 09 76 61 72 20 72 65 73 75  ) {.....var resu
cab0: 6c 74 20 3d 20 53 69 7a 7a 6c 65 2e 61 74 74 72  lt = Sizzle.attr
cac0: 28 20 65 6c 65 6d 2c 20 6e 61 6d 65 20 29 3b 0a  ( elem, name );.
cad0: 0a 09 09 09 09 69 66 20 28 20 72 65 73 75 6c 74  .....if ( result
cae0: 20 3d 3d 20 6e 75 6c 6c 20 29 20 7b 0a 09 09 09   == null ) {....
caf0: 09 09 72 65 74 75 72 6e 20 6f 70 65 72 61 74 6f  ..return operato
cb00: 72 20 3d 3d 3d 20 22 21 3d 22 3b 0a 09 09 09 09  r === "!=";.....
cb10: 7d 0a 09 09 09 09 69 66 20 28 20 21 6f 70 65 72  }.....if ( !oper
cb20: 61 74 6f 72 20 29 20 7b 0a 09 09 09 09 09 72 65  ator ) {......re
cb30: 74 75 72 6e 20 74 72 75 65 3b 0a 09 09 09 09 7d  turn true;.....}
cb40: 0a 0a 09 09 09 09 72 65 73 75 6c 74 20 2b 3d 20  ......result += 
cb50: 22 22 3b 0a 0a 09 09 09 09 2f 2a 20 65 73 6c 69  "";....../* esli
cb60: 6e 74 2d 64 69 73 61 62 6c 65 20 6d 61 78 2d 6c  nt-disable max-l
cb70: 65 6e 20 2a 2f 0a 0a 09 09 09 09 72 65 74 75 72  en */......retur
cb80: 6e 20 6f 70 65 72 61 74 6f 72 20 3d 3d 3d 20 22  n operator === "
cb90: 3d 22 20 3f 20 72 65 73 75 6c 74 20 3d 3d 3d 20  =" ? result === 
cba0: 63 68 65 63 6b 20 3a 0a 09 09 09 09 09 6f 70 65  check :......ope
cbb0: 72 61 74 6f 72 20 3d 3d 3d 20 22 21 3d 22 20 3f  rator === "!=" ?
cbc0: 20 72 65 73 75 6c 74 20 21 3d 3d 20 63 68 65 63   result !== chec
cbd0: 6b 20 3a 0a 09 09 09 09 09 6f 70 65 72 61 74 6f  k :......operato
cbe0: 72 20 3d 3d 3d 20 22 5e 3d 22 20 3f 20 63 68 65  r === "^=" ? che
cbf0: 63 6b 20 26 26 20 72 65 73 75 6c 74 2e 69 6e 64  ck && result.ind
cc00: 65 78 4f 66 28 20 63 68 65 63 6b 20 29 20 3d 3d  exOf( check ) ==
cc10: 3d 20 30 20 3a 0a 09 09 09 09 09 6f 70 65 72 61  = 0 :......opera
cc20: 74 6f 72 20 3d 3d 3d 20 22 2a 3d 22 20 3f 20 63  tor === "*=" ? c
cc30: 68 65 63 6b 20 26 26 20 72 65 73 75 6c 74 2e 69  heck && result.i
cc40: 6e 64 65 78 4f 66 28 20 63 68 65 63 6b 20 29 20  ndexOf( check ) 
cc50: 3e 20 2d 31 20 3a 0a 09 09 09 09 09 6f 70 65 72  > -1 :......oper
cc60: 61 74 6f 72 20 3d 3d 3d 20 22 24 3d 22 20 3f 20  ator === "$=" ? 
cc70: 63 68 65 63 6b 20 26 26 20 72 65 73 75 6c 74 2e  check && result.
cc80: 73 6c 69 63 65 28 20 2d 63 68 65 63 6b 2e 6c 65  slice( -check.le
cc90: 6e 67 74 68 20 29 20 3d 3d 3d 20 63 68 65 63 6b  ngth ) === check
cca0: 20 3a 0a 09 09 09 09 09 6f 70 65 72 61 74 6f 72   :......operator
ccb0: 20 3d 3d 3d 20 22 7e 3d 22 20 3f 20 28 20 22 20   === "~=" ? ( " 
ccc0: 22 20 2b 20 72 65 73 75 6c 74 2e 72 65 70 6c 61  " + result.repla
ccd0: 63 65 28 20 72 77 68 69 74 65 73 70 61 63 65 2c  ce( rwhitespace,
cce0: 20 22 20 22 20 29 20 2b 20 22 20 22 20 29 2e 69   " " ) + " " ).i
ccf0: 6e 64 65 78 4f 66 28 20 63 68 65 63 6b 20 29 20  ndexOf( check ) 
cd00: 3e 20 2d 31 20 3a 0a 09 09 09 09 09 6f 70 65 72  > -1 :......oper
cd10: 61 74 6f 72 20 3d 3d 3d 20 22 7c 3d 22 20 3f 20  ator === "|=" ? 
cd20: 72 65 73 75 6c 74 20 3d 3d 3d 20 63 68 65 63 6b  result === check
cd30: 20 7c 7c 20 72 65 73 75 6c 74 2e 73 6c 69 63 65   || result.slice
cd40: 28 20 30 2c 20 63 68 65 63 6b 2e 6c 65 6e 67 74  ( 0, check.lengt
cd50: 68 20 2b 20 31 20 29 20 3d 3d 3d 20 63 68 65 63  h + 1 ) === chec
cd60: 6b 20 2b 20 22 2d 22 20 3a 0a 09 09 09 09 09 66  k + "-" :......f
cd70: 61 6c 73 65 3b 0a 09 09 09 09 2f 2a 20 65 73 6c  alse;...../* esl
cd80: 69 6e 74 2d 65 6e 61 62 6c 65 20 6d 61 78 2d 6c  int-enable max-l
cd90: 65 6e 20 2a 2f 0a 0a 09 09 09 7d 3b 0a 09 09 7d  en */.....};...}
cda0: 2c 0a 0a 09 09 22 43 48 49 4c 44 22 3a 20 66 75  ,...."CHILD": fu
cdb0: 6e 63 74 69 6f 6e 28 20 74 79 70 65 2c 20 77 68  nction( type, wh
cdc0: 61 74 2c 20 5f 61 72 67 75 6d 65 6e 74 2c 20 66  at, _argument, f
cdd0: 69 72 73 74 2c 20 6c 61 73 74 20 29 20 7b 0a 09  irst, last ) {..
cde0: 09 09 76 61 72 20 73 69 6d 70 6c 65 20 3d 20 74  ..var simple = t
cdf0: 79 70 65 2e 73 6c 69 63 65 28 20 30 2c 20 33 20  ype.slice( 0, 3 
ce00: 29 20 21 3d 3d 20 22 6e 74 68 22 2c 0a 09 09 09  ) !== "nth",....
ce10: 09 66 6f 72 77 61 72 64 20 3d 20 74 79 70 65 2e  .forward = type.
ce20: 73 6c 69 63 65 28 20 2d 34 20 29 20 21 3d 3d 20  slice( -4 ) !== 
ce30: 22 6c 61 73 74 22 2c 0a 09 09 09 09 6f 66 54 79  "last",.....ofTy
ce40: 70 65 20 3d 20 77 68 61 74 20 3d 3d 3d 20 22 6f  pe = what === "o
ce50: 66 2d 74 79 70 65 22 3b 0a 0a 09 09 09 72 65 74  f-type";.....ret
ce60: 75 72 6e 20 66 69 72 73 74 20 3d 3d 3d 20 31 20  urn first === 1 
ce70: 26 26 20 6c 61 73 74 20 3d 3d 3d 20 30 20 3f 0a  && last === 0 ?.
ce80: 0a 09 09 09 09 2f 2f 20 53 68 6f 72 74 63 75 74  .....// Shortcut
ce90: 20 66 6f 72 20 3a 6e 74 68 2d 2a 28 6e 29 0a 09   for :nth-*(n)..
cea0: 09 09 09 66 75 6e 63 74 69 6f 6e 28 20 65 6c 65  ...function( ele
ceb0: 6d 20 29 20 7b 0a 09 09 09 09 09 72 65 74 75 72  m ) {......retur
cec0: 6e 20 21 21 65 6c 65 6d 2e 70 61 72 65 6e 74 4e  n !!elem.parentN
ced0: 6f 64 65 3b 0a 09 09 09 09 7d 20 3a 0a 0a 09 09  ode;.....} :....
cee0: 09 09 66 75 6e 63 74 69 6f 6e 28 20 65 6c 65 6d  ..function( elem
cef0: 2c 20 5f 63 6f 6e 74 65 78 74 2c 20 78 6d 6c 20  , _context, xml 
cf00: 29 20 7b 0a 09 09 09 09 09 76 61 72 20 63 61 63  ) {......var cac
cf10: 68 65 2c 20 75 6e 69 71 75 65 43 61 63 68 65 2c  he, uniqueCache,
cf20: 20 6f 75 74 65 72 43 61 63 68 65 2c 20 6e 6f 64   outerCache, nod
cf30: 65 2c 20 6e 6f 64 65 49 6e 64 65 78 2c 20 73 74  e, nodeIndex, st
cf40: 61 72 74 2c 0a 09 09 09 09 09 09 64 69 72 20 3d  art,.......dir =
cf50: 20 73 69 6d 70 6c 65 20 21 3d 3d 20 66 6f 72 77   simple !== forw
cf60: 61 72 64 20 3f 20 22 6e 65 78 74 53 69 62 6c 69  ard ? "nextSibli
cf70: 6e 67 22 20 3a 20 22 70 72 65 76 69 6f 75 73 53  ng" : "previousS
cf80: 69 62 6c 69 6e 67 22 2c 0a 09 09 09 09 09 09 70  ibling",.......p
cf90: 61 72 65 6e 74 20 3d 20 65 6c 65 6d 2e 70 61 72  arent = elem.par
cfa0: 65 6e 74 4e 6f 64 65 2c 0a 09 09 09 09 09 09 6e  entNode,.......n
cfb0: 61 6d 65 20 3d 20 6f 66 54 79 70 65 20 26 26 20  ame = ofType && 
cfc0: 65 6c 65 6d 2e 6e 6f 64 65 4e 61 6d 65 2e 74 6f  elem.nodeName.to
cfd0: 4c 6f 77 65 72 43 61 73 65 28 29 2c 0a 09 09 09  LowerCase(),....
cfe0: 09 09 09 75 73 65 43 61 63 68 65 20 3d 20 21 78  ...useCache = !x
cff0: 6d 6c 20 26 26 20 21 6f 66 54 79 70 65 2c 0a 09  ml && !ofType,..
d000: 09 09 09 09 09 64 69 66 66 20 3d 20 66 61 6c 73  .....diff = fals
d010: 65 3b 0a 0a 09 09 09 09 09 69 66 20 28 20 70 61  e;.......if ( pa
d020: 72 65 6e 74 20 29 20 7b 0a 0a 09 09 09 09 09 09  rent ) {........
d030: 2f 2f 20 3a 28 66 69 72 73 74 7c 6c 61 73 74 7c  // :(first|last|
d040: 6f 6e 6c 79 29 2d 28 63 68 69 6c 64 7c 6f 66 2d  only)-(child|of-
d050: 74 79 70 65 29 0a 09 09 09 09 09 09 69 66 20 28  type).......if (
d060: 20 73 69 6d 70 6c 65 20 29 20 7b 0a 09 09 09 09   simple ) {.....
d070: 09 09 09 77 68 69 6c 65 20 28 20 64 69 72 20 29  ...while ( dir )
d080: 20 7b 0a 09 09 09 09 09 09 09 09 6e 6f 64 65 20   {.........node 
d090: 3d 20 65 6c 65 6d 3b 0a 09 09 09 09 09 09 09 09  = elem;.........
d0a0: 77 68 69 6c 65 20 28 20 28 20 6e 6f 64 65 20 3d  while ( ( node =
d0b0: 20 6e 6f 64 65 5b 20 64 69 72 20 5d 20 29 20 29   node[ dir ] ) )
d0c0: 20 7b 0a 09 09 09 09 09 09 09 09 09 69 66 20 28   {..........if (
d0d0: 20 6f 66 54 79 70 65 20 3f 0a 09 09 09 09 09 09   ofType ?.......
d0e0: 09 09 09 09 6e 6f 64 65 2e 6e 6f 64 65 4e 61 6d  ....node.nodeNam
d0f0: 65 2e 74 6f 4c 6f 77 65 72 43 61 73 65 28 29 20  e.toLowerCase() 
d100: 3d 3d 3d 20 6e 61 6d 65 20 3a 0a 09 09 09 09 09  === name :......
d110: 09 09 09 09 09 6e 6f 64 65 2e 6e 6f 64 65 54 79  .....node.nodeTy
d120: 70 65 20 3d 3d 3d 20 31 20 29 20 7b 0a 0a 09 09  pe === 1 ) {....
d130: 09 09 09 09 09 09 09 09 72 65 74 75 72 6e 20 66  ........return f
d140: 61 6c 73 65 3b 0a 09 09 09 09 09 09 09 09 09 7d  alse;..........}
d150: 0a 09 09 09 09 09 09 09 09 7d 0a 0a 09 09 09 09  .........}......
d160: 09 09 09 09 2f 2f 20 52 65 76 65 72 73 65 20 64  ....// Reverse d
d170: 69 72 65 63 74 69 6f 6e 20 66 6f 72 20 3a 6f 6e  irection for :on
d180: 6c 79 2d 2a 20 28 69 66 20 77 65 20 68 61 76 65  ly-* (if we have
d190: 6e 27 74 20 79 65 74 20 64 6f 6e 65 20 73 6f 29  n't yet done so)
d1a0: 0a 09 09 09 09 09 09 09 09 73 74 61 72 74 20 3d  .........start =
d1b0: 20 64 69 72 20 3d 20 74 79 70 65 20 3d 3d 3d 20   dir = type === 
d1c0: 22 6f 6e 6c 79 22 20 26 26 20 21 73 74 61 72 74  "only" && !start
d1d0: 20 26 26 20 22 6e 65 78 74 53 69 62 6c 69 6e 67   && "nextSibling
d1e0: 22 3b 0a 09 09 09 09 09 09 09 7d 0a 09 09 09 09  ";........}.....
d1f0: 09 09 09 72 65 74 75 72 6e 20 74 72 75 65 3b 0a  ...return true;.
d200: 09 09 09 09 09 09 7d 0a 0a 09 09 09 09 09 09 73  ......}........s
d210: 74 61 72 74 20 3d 20 5b 20 66 6f 72 77 61 72 64  tart = [ forward
d220: 20 3f 20 70 61 72 65 6e 74 2e 66 69 72 73 74 43   ? parent.firstC
d230: 68 69 6c 64 20 3a 20 70 61 72 65 6e 74 2e 6c 61  hild : parent.la
d240: 73 74 43 68 69 6c 64 20 5d 3b 0a 0a 09 09 09 09  stChild ];......
d250: 09 09 2f 2f 20 6e 6f 6e 2d 78 6d 6c 20 3a 6e 74  ..// non-xml :nt
d260: 68 2d 63 68 69 6c 64 28 2e 2e 2e 29 20 73 74 6f  h-child(...) sto
d270: 72 65 73 20 63 61 63 68 65 20 64 61 74 61 20 6f  res cache data o
d280: 6e 20 60 70 61 72 65 6e 74 60 0a 09 09 09 09 09  n `parent`......
d290: 09 69 66 20 28 20 66 6f 72 77 61 72 64 20 26 26  .if ( forward &&
d2a0: 20 75 73 65 43 61 63 68 65 20 29 20 7b 0a 0a 09   useCache ) {...
d2b0: 09 09 09 09 09 09 2f 2f 20 53 65 65 6b 20 60 65  ......// Seek `e
d2c0: 6c 65 6d 60 20 66 72 6f 6d 20 61 20 70 72 65 76  lem` from a prev
d2d0: 69 6f 75 73 6c 79 2d 63 61 63 68 65 64 20 69 6e  iously-cached in
d2e0: 64 65 78 0a 0a 09 09 09 09 09 09 09 2f 2f 20 2e  dex.........// .
d2f0: 2e 2e 69 6e 20 61 20 67 7a 69 70 2d 66 72 69 65  ..in a gzip-frie
d300: 6e 64 6c 79 20 77 61 79 0a 09 09 09 09 09 09 09  ndly way........
d310: 6e 6f 64 65 20 3d 20 70 61 72 65 6e 74 3b 0a 09  node = parent;..
d320: 09 09 09 09 09 09 6f 75 74 65 72 43 61 63 68 65  ......outerCache
d330: 20 3d 20 6e 6f 64 65 5b 20 65 78 70 61 6e 64 6f   = node[ expando
d340: 20 5d 20 7c 7c 20 28 20 6e 6f 64 65 5b 20 65 78   ] || ( node[ ex
d350: 70 61 6e 64 6f 20 5d 20 3d 20 7b 7d 20 29 3b 0a  pando ] = {} );.
d360: 0a 09 09 09 09 09 09 09 2f 2f 20 53 75 70 70 6f  ........// Suppo
d370: 72 74 3a 20 49 45 20 3c 39 20 6f 6e 6c 79 0a 09  rt: IE <9 only..
d380: 09 09 09 09 09 09 2f 2f 20 44 65 66 65 6e 64 20  ......// Defend 
d390: 61 67 61 69 6e 73 74 20 63 6c 6f 6e 65 64 20 61  against cloned a
d3a0: 74 74 72 6f 70 65 72 74 69 65 73 20 28 6a 51 75  ttroperties (jQu
d3b0: 65 72 79 20 67 68 2d 31 37 30 39 29 0a 09 09 09  ery gh-1709)....
d3c0: 09 09 09 09 75 6e 69 71 75 65 43 61 63 68 65 20  ....uniqueCache 
d3d0: 3d 20 6f 75 74 65 72 43 61 63 68 65 5b 20 6e 6f  = outerCache[ no
d3e0: 64 65 2e 75 6e 69 71 75 65 49 44 20 5d 20 7c 7c  de.uniqueID ] ||
d3f0: 0a 09 09 09 09 09 09 09 09 28 20 6f 75 74 65 72  .........( outer
d400: 43 61 63 68 65 5b 20 6e 6f 64 65 2e 75 6e 69 71  Cache[ node.uniq
d410: 75 65 49 44 20 5d 20 3d 20 7b 7d 20 29 3b 0a 0a  ueID ] = {} );..
d420: 09 09 09 09 09 09 09 63 61 63 68 65 20 3d 20 75  .......cache = u
d430: 6e 69 71 75 65 43 61 63 68 65 5b 20 74 79 70 65  niqueCache[ type
d440: 20 5d 20 7c 7c 20 5b 5d 3b 0a 09 09 09 09 09 09   ] || [];.......
d450: 09 6e 6f 64 65 49 6e 64 65 78 20 3d 20 63 61 63  .nodeIndex = cac
d460: 68 65 5b 20 30 20 5d 20 3d 3d 3d 20 64 69 72 72  he[ 0 ] === dirr
d470: 75 6e 73 20 26 26 20 63 61 63 68 65 5b 20 31 20  uns && cache[ 1 
d480: 5d 3b 0a 09 09 09 09 09 09 09 64 69 66 66 20 3d  ];........diff =
d490: 20 6e 6f 64 65 49 6e 64 65 78 20 26 26 20 63 61   nodeIndex && ca
d4a0: 63 68 65 5b 20 32 20 5d 3b 0a 09 09 09 09 09 09  che[ 2 ];.......
d4b0: 09 6e 6f 64 65 20 3d 20 6e 6f 64 65 49 6e 64 65  .node = nodeInde
d4c0: 78 20 26 26 20 70 61 72 65 6e 74 2e 63 68 69 6c  x && parent.chil
d4d0: 64 4e 6f 64 65 73 5b 20 6e 6f 64 65 49 6e 64 65  dNodes[ nodeInde
d4e0: 78 20 5d 3b 0a 0a 09 09 09 09 09 09 09 77 68 69  x ];.........whi
d4f0: 6c 65 20 28 20 28 20 6e 6f 64 65 20 3d 20 2b 2b  le ( ( node = ++
d500: 6e 6f 64 65 49 6e 64 65 78 20 26 26 20 6e 6f 64  nodeIndex && nod
d510: 65 20 26 26 20 6e 6f 64 65 5b 20 64 69 72 20 5d  e && node[ dir ]
d520: 20 7c 7c 0a 0a 09 09 09 09 09 09 09 09 2f 2f 20   ||..........// 
d530: 46 61 6c 6c 62 61 63 6b 20 74 6f 20 73 65 65 6b  Fallback to seek
d540: 69 6e 67 20 60 65 6c 65 6d 60 20 66 72 6f 6d 20  ing `elem` from 
d550: 74 68 65 20 73 74 61 72 74 0a 09 09 09 09 09 09  the start.......
d560: 09 09 28 20 64 69 66 66 20 3d 20 6e 6f 64 65 49  ..( diff = nodeI
d570: 6e 64 65 78 20 3d 20 30 20 29 20 7c 7c 20 73 74  ndex = 0 ) || st
d580: 61 72 74 2e 70 6f 70 28 29 20 29 20 29 20 7b 0a  art.pop() ) ) {.
d590: 0a 09 09 09 09 09 09 09 09 2f 2f 20 57 68 65 6e  .........// When
d5a0: 20 66 6f 75 6e 64 2c 20 63 61 63 68 65 20 69 6e   found, cache in
d5b0: 64 65 78 65 73 20 6f 6e 20 60 70 61 72 65 6e 74  dexes on `parent
d5c0: 60 20 61 6e 64 20 62 72 65 61 6b 0a 09 09 09 09  ` and break.....
d5d0: 09 09 09 09 69 66 20 28 20 6e 6f 64 65 2e 6e 6f  ....if ( node.no
d5e0: 64 65 54 79 70 65 20 3d 3d 3d 20 31 20 26 26 20  deType === 1 && 
d5f0: 2b 2b 64 69 66 66 20 26 26 20 6e 6f 64 65 20 3d  ++diff && node =
d600: 3d 3d 20 65 6c 65 6d 20 29 20 7b 0a 09 09 09 09  == elem ) {.....
d610: 09 09 09 09 09 75 6e 69 71 75 65 43 61 63 68 65  .....uniqueCache
d620: 5b 20 74 79 70 65 20 5d 20 3d 20 5b 20 64 69 72  [ type ] = [ dir
d630: 72 75 6e 73 2c 20 6e 6f 64 65 49 6e 64 65 78 2c  runs, nodeIndex,
d640: 20 64 69 66 66 20 5d 3b 0a 09 09 09 09 09 09 09   diff ];........
d650: 09 09 62 72 65 61 6b 3b 0a 09 09 09 09 09 09 09  ..break;........
d660: 09 7d 0a 09 09 09 09 09 09 09 7d 0a 0a 09 09 09  .}........}.....
d670: 09 09 09 7d 20 65 6c 73 65 20 7b 0a 0a 09 09 09  ...} else {.....
d680: 09 09 09 09 2f 2f 20 55 73 65 20 70 72 65 76 69  ....// Use previ
d690: 6f 75 73 6c 79 2d 63 61 63 68 65 64 20 65 6c 65  ously-cached ele
d6a0: 6d 65 6e 74 20 69 6e 64 65 78 20 69 66 20 61 76  ment index if av
d6b0: 61 69 6c 61 62 6c 65 0a 09 09 09 09 09 09 09 69  ailable........i
d6c0: 66 20 28 20 75 73 65 43 61 63 68 65 20 29 20 7b  f ( useCache ) {
d6d0: 0a 0a 09 09 09 09 09 09 09 09 2f 2f 20 2e 2e 2e  ..........// ...
d6e0: 69 6e 20 61 20 67 7a 69 70 2d 66 72 69 65 6e 64  in a gzip-friend
d6f0: 6c 79 20 77 61 79 0a 09 09 09 09 09 09 09 09 6e  ly way.........n
d700: 6f 64 65 20 3d 20 65 6c 65 6d 3b 0a 09 09 09 09  ode = elem;.....
d710: 09 09 09 09 6f 75 74 65 72 43 61 63 68 65 20 3d  ....outerCache =
d720: 20 6e 6f 64 65 5b 20 65 78 70 61 6e 64 6f 20 5d   node[ expando ]
d730: 20 7c 7c 20 28 20 6e 6f 64 65 5b 20 65 78 70 61   || ( node[ expa
d740: 6e 64 6f 20 5d 20 3d 20 7b 7d 20 29 3b 0a 0a 09  ndo ] = {} );...
d750: 09 09 09 09 09 09 09 2f 2f 20 53 75 70 70 6f 72  .......// Suppor
d760: 74 3a 20 49 45 20 3c 39 20 6f 6e 6c 79 0a 09 09  t: IE <9 only...
d770: 09 09 09 09 09 09 2f 2f 20 44 65 66 65 6e 64 20  ......// Defend 
d780: 61 67 61 69 6e 73 74 20 63 6c 6f 6e 65 64 20 61  against cloned a
d790: 74 74 72 6f 70 65 72 74 69 65 73 20 28 6a 51 75  ttroperties (jQu
d7a0: 65 72 79 20 67 68 2d 31 37 30 39 29 0a 09 09 09  ery gh-1709)....
d7b0: 09 09 09 09 09 75 6e 69 71 75 65 43 61 63 68 65  .....uniqueCache
d7c0: 20 3d 20 6f 75 74 65 72 43 61 63 68 65 5b 20 6e   = outerCache[ n
d7d0: 6f 64 65 2e 75 6e 69 71 75 65 49 44 20 5d 20 7c  ode.uniqueID ] |
d7e0: 7c 0a 09 09 09 09 09 09 09 09 09 28 20 6f 75 74  |..........( out
d7f0: 65 72 43 61 63 68 65 5b 20 6e 6f 64 65 2e 75 6e  erCache[ node.un
d800: 69 71 75 65 49 44 20 5d 20 3d 20 7b 7d 20 29 3b  iqueID ] = {} );
d810: 0a 0a 09 09 09 09 09 09 09 09 63 61 63 68 65 20  ..........cache 
d820: 3d 20 75 6e 69 71 75 65 43 61 63 68 65 5b 20 74  = uniqueCache[ t
d830: 79 70 65 20 5d 20 7c 7c 20 5b 5d 3b 0a 09 09 09  ype ] || [];....
d840: 09 09 09 09 09 6e 6f 64 65 49 6e 64 65 78 20 3d  .....nodeIndex =
d850: 20 63 61 63 68 65 5b 20 30 20 5d 20 3d 3d 3d 20   cache[ 0 ] === 
d860: 64 69 72 72 75 6e 73 20 26 26 20 63 61 63 68 65  dirruns && cache
d870: 5b 20 31 20 5d 3b 0a 09 09 09 09 09 09 09 09 64  [ 1 ];.........d
d880: 69 66 66 20 3d 20 6e 6f 64 65 49 6e 64 65 78 3b  iff = nodeIndex;
d890: 0a 09 09 09 09 09 09 09 7d 0a 0a 09 09 09 09 09  ........}.......
d8a0: 09 09 2f 2f 20 78 6d 6c 20 3a 6e 74 68 2d 63 68  ..// xml :nth-ch
d8b0: 69 6c 64 28 2e 2e 2e 29 0a 09 09 09 09 09 09 09  ild(...)........
d8c0: 2f 2f 20 6f 72 20 3a 6e 74 68 2d 6c 61 73 74 2d  // or :nth-last-
d8d0: 63 68 69 6c 64 28 2e 2e 2e 29 20 6f 72 20 3a 6e  child(...) or :n
d8e0: 74 68 28 2d 6c 61 73 74 29 3f 2d 6f 66 2d 74 79  th(-last)?-of-ty
d8f0: 70 65 28 2e 2e 2e 29 0a 09 09 09 09 09 09 09 69  pe(...)........i
d900: 66 20 28 20 64 69 66 66 20 3d 3d 3d 20 66 61 6c  f ( diff === fal
d910: 73 65 20 29 20 7b 0a 0a 09 09 09 09 09 09 09 09  se ) {..........
d920: 2f 2f 20 55 73 65 20 74 68 65 20 73 61 6d 65 20  // Use the same 
d930: 6c 6f 6f 70 20 61 73 20 61 62 6f 76 65 20 74 6f  loop as above to
d940: 20 73 65 65 6b 20 60 65 6c 65 6d 60 20 66 72 6f   seek `elem` fro
d950: 6d 20 74 68 65 20 73 74 61 72 74 0a 09 09 09 09  m the start.....
d960: 09 09 09 09 77 68 69 6c 65 20 28 20 28 20 6e 6f  ....while ( ( no
d970: 64 65 20 3d 20 2b 2b 6e 6f 64 65 49 6e 64 65 78  de = ++nodeIndex
d980: 20 26 26 20 6e 6f 64 65 20 26 26 20 6e 6f 64 65   && node && node
d990: 5b 20 64 69 72 20 5d 20 7c 7c 0a 09 09 09 09 09  [ dir ] ||......
d9a0: 09 09 09 09 28 20 64 69 66 66 20 3d 20 6e 6f 64  ....( diff = nod
d9b0: 65 49 6e 64 65 78 20 3d 20 30 20 29 20 7c 7c 20  eIndex = 0 ) || 
d9c0: 73 74 61 72 74 2e 70 6f 70 28 29 20 29 20 29 20  start.pop() ) ) 
d9d0: 7b 0a 0a 09 09 09 09 09 09 09 09 09 69 66 20 28  {...........if (
d9e0: 20 28 20 6f 66 54 79 70 65 20 3f 0a 09 09 09 09   ( ofType ?.....
d9f0: 09 09 09 09 09 09 6e 6f 64 65 2e 6e 6f 64 65 4e  ......node.nodeN
da00: 61 6d 65 2e 74 6f 4c 6f 77 65 72 43 61 73 65 28  ame.toLowerCase(
da10: 29 20 3d 3d 3d 20 6e 61 6d 65 20 3a 0a 09 09 09  ) === name :....
da20: 09 09 09 09 09 09 09 6e 6f 64 65 2e 6e 6f 64 65  .......node.node
da30: 54 79 70 65 20 3d 3d 3d 20 31 20 29 20 26 26 0a  Type === 1 ) &&.
da40: 09 09 09 09 09 09 09 09 09 09 2b 2b 64 69 66 66  ..........++diff
da50: 20 29 20 7b 0a 0a 09 09 09 09 09 09 09 09 09 09   ) {............
da60: 2f 2f 20 43 61 63 68 65 20 74 68 65 20 69 6e 64  // Cache the ind
da70: 65 78 20 6f 66 20 65 61 63 68 20 65 6e 63 6f 75  ex of each encou
da80: 6e 74 65 72 65 64 20 65 6c 65 6d 65 6e 74 0a 09  ntered element..
da90: 09 09 09 09 09 09 09 09 09 69 66 20 28 20 75 73  .........if ( us
daa0: 65 43 61 63 68 65 20 29 20 7b 0a 09 09 09 09 09  eCache ) {......
dab0: 09 09 09 09 09 09 6f 75 74 65 72 43 61 63 68 65  ......outerCache
dac0: 20 3d 20 6e 6f 64 65 5b 20 65 78 70 61 6e 64 6f   = node[ expando
dad0: 20 5d 20 7c 7c 0a 09 09 09 09 09 09 09 09 09 09   ] ||...........
dae0: 09 09 28 20 6e 6f 64 65 5b 20 65 78 70 61 6e 64  ..( node[ expand
daf0: 6f 20 5d 20 3d 20 7b 7d 20 29 3b 0a 0a 09 09 09  o ] = {} );.....
db00: 09 09 09 09 09 09 09 09 2f 2f 20 53 75 70 70 6f  ........// Suppo
db10: 72 74 3a 20 49 45 20 3c 39 20 6f 6e 6c 79 0a 09  rt: IE <9 only..
db20: 09 09 09 09 09 09 09 09 09 09 2f 2f 20 44 65 66  ..........// Def
db30: 65 6e 64 20 61 67 61 69 6e 73 74 20 63 6c 6f 6e  end against clon
db40: 65 64 20 61 74 74 72 6f 70 65 72 74 69 65 73 20  ed attroperties 
db50: 28 6a 51 75 65 72 79 20 67 68 2d 31 37 30 39 29  (jQuery gh-1709)
db60: 0a 09 09 09 09 09 09 09 09 09 09 09 75 6e 69 71  ............uniq
db70: 75 65 43 61 63 68 65 20 3d 20 6f 75 74 65 72 43  ueCache = outerC
db80: 61 63 68 65 5b 20 6e 6f 64 65 2e 75 6e 69 71 75  ache[ node.uniqu
db90: 65 49 44 20 5d 20 7c 7c 0a 09 09 09 09 09 09 09  eID ] ||........
dba0: 09 09 09 09 09 28 20 6f 75 74 65 72 43 61 63 68  .....( outerCach
dbb0: 65 5b 20 6e 6f 64 65 2e 75 6e 69 71 75 65 49 44  e[ node.uniqueID
dbc0: 20 5d 20 3d 20 7b 7d 20 29 3b 0a 0a 09 09 09 09   ] = {} );......
dbd0: 09 09 09 09 09 09 09 75 6e 69 71 75 65 43 61 63  .......uniqueCac
dbe0: 68 65 5b 20 74 79 70 65 20 5d 20 3d 20 5b 20 64  he[ type ] = [ d
dbf0: 69 72 72 75 6e 73 2c 20 64 69 66 66 20 5d 3b 0a  irruns, diff ];.
dc00: 09 09 09 09 09 09 09 09 09 09 7d 0a 0a 09 09 09  ..........}.....
dc10: 09 09 09 09 09 09 09 69 66 20 28 20 6e 6f 64 65  .......if ( node
dc20: 20 3d 3d 3d 20 65 6c 65 6d 20 29 20 7b 0a 09 09   === elem ) {...
dc30: 09 09 09 09 09 09 09 09 09 62 72 65 61 6b 3b 0a  .........break;.
dc40: 09 09 09 09 09 09 09 09 09 09 7d 0a 09 09 09 09  ..........}.....
dc50: 09 09 09 09 09 7d 0a 09 09 09 09 09 09 09 09 7d  .....}.........}
dc60: 0a 09 09 09 09 09 09 09 7d 0a 09 09 09 09 09 09  ........}.......
dc70: 7d 0a 0a 09 09 09 09 09 09 2f 2f 20 49 6e 63 6f  }........// Inco
dc80: 72 70 6f 72 61 74 65 20 74 68 65 20 6f 66 66 73  rporate the offs
dc90: 65 74 2c 20 74 68 65 6e 20 63 68 65 63 6b 20 61  et, then check a
dca0: 67 61 69 6e 73 74 20 63 79 63 6c 65 20 73 69 7a  gainst cycle siz
dcb0: 65 0a 09 09 09 09 09 09 64 69 66 66 20 2d 3d 20  e.......diff -= 
dcc0: 6c 61 73 74 3b 0a 09 09 09 09 09 09 72 65 74 75  last;.......retu
dcd0: 72 6e 20 64 69 66 66 20 3d 3d 3d 20 66 69 72 73  rn diff === firs
dce0: 74 20 7c 7c 20 28 20 64 69 66 66 20 25 20 66 69  t || ( diff % fi
dcf0: 72 73 74 20 3d 3d 3d 20 30 20 26 26 20 64 69 66  rst === 0 && dif
dd00: 66 20 2f 20 66 69 72 73 74 20 3e 3d 20 30 20 29  f / first >= 0 )
dd10: 3b 0a 09 09 09 09 09 7d 0a 09 09 09 09 7d 3b 0a  ;......}.....};.
dd20: 09 09 7d 2c 0a 0a 09 09 22 50 53 45 55 44 4f 22  ..},...."PSEUDO"
dd30: 3a 20 66 75 6e 63 74 69 6f 6e 28 20 70 73 65 75  : function( pseu
dd40: 64 6f 2c 20 61 72 67 75 6d 65 6e 74 20 29 20 7b  do, argument ) {
dd50: 0a 0a 09 09 09 2f 2f 20 70 73 65 75 64 6f 2d 63  .....// pseudo-c
dd60: 6c 61 73 73 20 6e 61 6d 65 73 20 61 72 65 20 63  lass names are c
dd70: 61 73 65 2d 69 6e 73 65 6e 73 69 74 69 76 65 0a  ase-insensitive.
dd80: 09 09 09 2f 2f 20 68 74 74 70 3a 2f 2f 77 77 77  ...// http://www
dd90: 2e 77 33 2e 6f 72 67 2f 54 52 2f 73 65 6c 65 63  .w3.org/TR/selec
dda0: 74 6f 72 73 2f 23 70 73 65 75 64 6f 2d 63 6c 61  tors/#pseudo-cla
ddb0: 73 73 65 73 0a 09 09 09 2f 2f 20 50 72 69 6f 72  sses....// Prior
ddc0: 69 74 69 7a 65 20 62 79 20 63 61 73 65 20 73 65  itize by case se
ddd0: 6e 73 69 74 69 76 69 74 79 20 69 6e 20 63 61 73  nsitivity in cas
dde0: 65 20 63 75 73 74 6f 6d 20 70 73 65 75 64 6f 73  e custom pseudos
ddf0: 20 61 72 65 20 61 64 64 65 64 20 77 69 74 68 20   are added with 
de00: 75 70 70 65 72 63 61 73 65 20 6c 65 74 74 65 72  uppercase letter
de10: 73 0a 09 09 09 2f 2f 20 52 65 6d 65 6d 62 65 72  s....// Remember
de20: 20 74 68 61 74 20 73 65 74 46 69 6c 74 65 72 73   that setFilters
de30: 20 69 6e 68 65 72 69 74 73 20 66 72 6f 6d 20 70   inherits from p
de40: 73 65 75 64 6f 73 0a 09 09 09 76 61 72 20 61 72  seudos....var ar
de50: 67 73 2c 0a 09 09 09 09 66 6e 20 3d 20 45 78 70  gs,.....fn = Exp
de60: 72 2e 70 73 65 75 64 6f 73 5b 20 70 73 65 75 64  r.pseudos[ pseud
de70: 6f 20 5d 20 7c 7c 20 45 78 70 72 2e 73 65 74 46  o ] || Expr.setF
de80: 69 6c 74 65 72 73 5b 20 70 73 65 75 64 6f 2e 74  ilters[ pseudo.t
de90: 6f 4c 6f 77 65 72 43 61 73 65 28 29 20 5d 20 7c  oLowerCase() ] |
dea0: 7c 0a 09 09 09 09 09 53 69 7a 7a 6c 65 2e 65 72  |......Sizzle.er
deb0: 72 6f 72 28 20 22 75 6e 73 75 70 70 6f 72 74 65  ror( "unsupporte
dec0: 64 20 70 73 65 75 64 6f 3a 20 22 20 2b 20 70 73  d pseudo: " + ps
ded0: 65 75 64 6f 20 29 3b 0a 0a 09 09 09 2f 2f 20 54  eudo );.....// T
dee0: 68 65 20 75 73 65 72 20 6d 61 79 20 75 73 65 20  he user may use 
def0: 63 72 65 61 74 65 50 73 65 75 64 6f 20 74 6f 20  createPseudo to 
df00: 69 6e 64 69 63 61 74 65 20 74 68 61 74 0a 09 09  indicate that...
df10: 09 2f 2f 20 61 72 67 75 6d 65 6e 74 73 20 61 72  .// arguments ar
df20: 65 20 6e 65 65 64 65 64 20 74 6f 20 63 72 65 61  e needed to crea
df30: 74 65 20 74 68 65 20 66 69 6c 74 65 72 20 66 75  te the filter fu
df40: 6e 63 74 69 6f 6e 0a 09 09 09 2f 2f 20 6a 75 73  nction....// jus
df50: 74 20 61 73 20 53 69 7a 7a 6c 65 20 64 6f 65 73  t as Sizzle does
df60: 0a 09 09 09 69 66 20 28 20 66 6e 5b 20 65 78 70  ....if ( fn[ exp
df70: 61 6e 64 6f 20 5d 20 29 20 7b 0a 09 09 09 09 72  ando ] ) {.....r
df80: 65 74 75 72 6e 20 66 6e 28 20 61 72 67 75 6d 65  eturn fn( argume
df90: 6e 74 20 29 3b 0a 09 09 09 7d 0a 0a 09 09 09 2f  nt );....}...../
dfa0: 2f 20 42 75 74 20 6d 61 69 6e 74 61 69 6e 20 73  / But maintain s
dfb0: 75 70 70 6f 72 74 20 66 6f 72 20 6f 6c 64 20 73  upport for old s
dfc0: 69 67 6e 61 74 75 72 65 73 0a 09 09 09 69 66 20  ignatures....if 
dfd0: 28 20 66 6e 2e 6c 65 6e 67 74 68 20 3e 20 31 20  ( fn.length > 1 
dfe0: 29 20 7b 0a 09 09 09 09 61 72 67 73 20 3d 20 5b  ) {.....args = [
dff0: 20 70 73 65 75 64 6f 2c 20 70 73 65 75 64 6f 2c   pseudo, pseudo,
e000: 20 22 22 2c 20 61 72 67 75 6d 65 6e 74 20 5d 3b   "", argument ];
e010: 0a 09 09 09 09 72 65 74 75 72 6e 20 45 78 70 72  .....return Expr
e020: 2e 73 65 74 46 69 6c 74 65 72 73 2e 68 61 73 4f  .setFilters.hasO
e030: 77 6e 50 72 6f 70 65 72 74 79 28 20 70 73 65 75  wnProperty( pseu
e040: 64 6f 2e 74 6f 4c 6f 77 65 72 43 61 73 65 28 29  do.toLowerCase()
e050: 20 29 20 3f 0a 09 09 09 09 09 6d 61 72 6b 46 75   ) ?......markFu
e060: 6e 63 74 69 6f 6e 28 20 66 75 6e 63 74 69 6f 6e  nction( function
e070: 28 20 73 65 65 64 2c 20 6d 61 74 63 68 65 73 20  ( seed, matches 
e080: 29 20 7b 0a 09 09 09 09 09 09 76 61 72 20 69 64  ) {.......var id
e090: 78 2c 0a 09 09 09 09 09 09 09 6d 61 74 63 68 65  x,........matche
e0a0: 64 20 3d 20 66 6e 28 20 73 65 65 64 2c 20 61 72  d = fn( seed, ar
e0b0: 67 75 6d 65 6e 74 20 29 2c 0a 09 09 09 09 09 09  gument ),.......
e0c0: 09 69 20 3d 20 6d 61 74 63 68 65 64 2e 6c 65 6e  .i = matched.len
e0d0: 67 74 68 3b 0a 09 09 09 09 09 09 77 68 69 6c 65  gth;.......while
e0e0: 20 28 20 69 2d 2d 20 29 20 7b 0a 09 09 09 09 09   ( i-- ) {......
e0f0: 09 09 69 64 78 20 3d 20 69 6e 64 65 78 4f 66 28  ..idx = indexOf(
e100: 20 73 65 65 64 2c 20 6d 61 74 63 68 65 64 5b 20   seed, matched[ 
e110: 69 20 5d 20 29 3b 0a 09 09 09 09 09 09 09 73 65  i ] );........se
e120: 65 64 5b 20 69 64 78 20 5d 20 3d 20 21 28 20 6d  ed[ idx ] = !( m
e130: 61 74 63 68 65 73 5b 20 69 64 78 20 5d 20 3d 20  atches[ idx ] = 
e140: 6d 61 74 63 68 65 64 5b 20 69 20 5d 20 29 3b 0a  matched[ i ] );.
e150: 09 09 09 09 09 09 7d 0a 09 09 09 09 09 7d 20 29  ......}......} )
e160: 20 3a 0a 09 09 09 09 09 66 75 6e 63 74 69 6f 6e   :......function
e170: 28 20 65 6c 65 6d 20 29 20 7b 0a 09 09 09 09 09  ( elem ) {......
e180: 09 72 65 74 75 72 6e 20 66 6e 28 20 65 6c 65 6d  .return fn( elem
e190: 2c 20 30 2c 20 61 72 67 73 20 29 3b 0a 09 09 09  , 0, args );....
e1a0: 09 09 7d 3b 0a 09 09 09 7d 0a 0a 09 09 09 72 65  ..};....}.....re
e1b0: 74 75 72 6e 20 66 6e 3b 0a 09 09 7d 0a 09 7d 2c  turn fn;...}..},
e1c0: 0a 0a 09 70 73 65 75 64 6f 73 3a 20 7b 0a 0a 09  ...pseudos: {...
e1d0: 09 2f 2f 20 50 6f 74 65 6e 74 69 61 6c 6c 79 20  .// Potentially 
e1e0: 63 6f 6d 70 6c 65 78 20 70 73 65 75 64 6f 73 0a  complex pseudos.
e1f0: 09 09 22 6e 6f 74 22 3a 20 6d 61 72 6b 46 75 6e  .."not": markFun
e200: 63 74 69 6f 6e 28 20 66 75 6e 63 74 69 6f 6e 28  ction( function(
e210: 20 73 65 6c 65 63 74 6f 72 20 29 20 7b 0a 0a 09   selector ) {...
e220: 09 09 2f 2f 20 54 72 69 6d 20 74 68 65 20 73 65  ..// Trim the se
e230: 6c 65 63 74 6f 72 20 70 61 73 73 65 64 20 74 6f  lector passed to
e240: 20 63 6f 6d 70 69 6c 65 0a 09 09 09 2f 2f 20 74   compile....// t
e250: 6f 20 61 76 6f 69 64 20 74 72 65 61 74 69 6e 67  o avoid treating
e260: 20 6c 65 61 64 69 6e 67 20 61 6e 64 20 74 72 61   leading and tra
e270: 69 6c 69 6e 67 0a 09 09 09 2f 2f 20 73 70 61 63  iling....// spac
e280: 65 73 20 61 73 20 63 6f 6d 62 69 6e 61 74 6f 72  es as combinator
e290: 73 0a 09 09 09 76 61 72 20 69 6e 70 75 74 20 3d  s....var input =
e2a0: 20 5b 5d 2c 0a 09 09 09 09 72 65 73 75 6c 74 73   [],.....results
e2b0: 20 3d 20 5b 5d 2c 0a 09 09 09 09 6d 61 74 63 68   = [],.....match
e2c0: 65 72 20 3d 20 63 6f 6d 70 69 6c 65 28 20 73 65  er = compile( se
e2d0: 6c 65 63 74 6f 72 2e 72 65 70 6c 61 63 65 28 20  lector.replace( 
e2e0: 72 74 72 69 6d 2c 20 22 24 31 22 20 29 20 29 3b  rtrim, "$1" ) );
e2f0: 0a 0a 09 09 09 72 65 74 75 72 6e 20 6d 61 74 63  .....return matc
e300: 68 65 72 5b 20 65 78 70 61 6e 64 6f 20 5d 20 3f  her[ expando ] ?
e310: 0a 09 09 09 09 6d 61 72 6b 46 75 6e 63 74 69 6f  .....markFunctio
e320: 6e 28 20 66 75 6e 63 74 69 6f 6e 28 20 73 65 65  n( function( see
e330: 64 2c 20 6d 61 74 63 68 65 73 2c 20 5f 63 6f 6e  d, matches, _con
e340: 74 65 78 74 2c 20 78 6d 6c 20 29 20 7b 0a 09 09  text, xml ) {...
e350: 09 09 09 76 61 72 20 65 6c 65 6d 2c 0a 09 09 09  ...var elem,....
e360: 09 09 09 75 6e 6d 61 74 63 68 65 64 20 3d 20 6d  ...unmatched = m
e370: 61 74 63 68 65 72 28 20 73 65 65 64 2c 20 6e 75  atcher( seed, nu
e380: 6c 6c 2c 20 78 6d 6c 2c 20 5b 5d 20 29 2c 0a 09  ll, xml, [] ),..
e390: 09 09 09 09 09 69 20 3d 20 73 65 65 64 2e 6c 65  .....i = seed.le
e3a0: 6e 67 74 68 3b 0a 0a 09 09 09 09 09 2f 2f 20 4d  ngth;.......// M
e3b0: 61 74 63 68 20 65 6c 65 6d 65 6e 74 73 20 75 6e  atch elements un
e3c0: 6d 61 74 63 68 65 64 20 62 79 20 60 6d 61 74 63  matched by `matc
e3d0: 68 65 72 60 0a 09 09 09 09 09 77 68 69 6c 65 20  her`......while 
e3e0: 28 20 69 2d 2d 20 29 20 7b 0a 09 09 09 09 09 09  ( i-- ) {.......
e3f0: 69 66 20 28 20 28 20 65 6c 65 6d 20 3d 20 75 6e  if ( ( elem = un
e400: 6d 61 74 63 68 65 64 5b 20 69 20 5d 20 29 20 29  matched[ i ] ) )
e410: 20 7b 0a 09 09 09 09 09 09 09 73 65 65 64 5b 20   {........seed[ 
e420: 69 20 5d 20 3d 20 21 28 20 6d 61 74 63 68 65 73  i ] = !( matches
e430: 5b 20 69 20 5d 20 3d 20 65 6c 65 6d 20 29 3b 0a  [ i ] = elem );.
e440: 09 09 09 09 09 09 7d 0a 09 09 09 09 09 7d 0a 09  ......}......}..
e450: 09 09 09 7d 20 29 20 3a 0a 09 09 09 09 66 75 6e  ...} ) :.....fun
e460: 63 74 69 6f 6e 28 20 65 6c 65 6d 2c 20 5f 63 6f  ction( elem, _co
e470: 6e 74 65 78 74 2c 20 78 6d 6c 20 29 20 7b 0a 09  ntext, xml ) {..
e480: 09 09 09 09 69 6e 70 75 74 5b 20 30 20 5d 20 3d  ....input[ 0 ] =
e490: 20 65 6c 65 6d 3b 0a 09 09 09 09 09 6d 61 74 63   elem;......matc
e4a0: 68 65 72 28 20 69 6e 70 75 74 2c 20 6e 75 6c 6c  her( input, null
e4b0: 2c 20 78 6d 6c 2c 20 72 65 73 75 6c 74 73 20 29  , xml, results )
e4c0: 3b 0a 0a 09 09 09 09 09 2f 2f 20 44 6f 6e 27 74  ;.......// Don't
e4d0: 20 6b 65 65 70 20 74 68 65 20 65 6c 65 6d 65 6e   keep the elemen
e4e0: 74 20 28 69 73 73 75 65 20 23 32 39 39 29 0a 09  t (issue #299)..
e4f0: 09 09 09 09 69 6e 70 75 74 5b 20 30 20 5d 20 3d  ....input[ 0 ] =
e500: 20 6e 75 6c 6c 3b 0a 09 09 09 09 09 72 65 74 75   null;......retu
e510: 72 6e 20 21 72 65 73 75 6c 74 73 2e 70 6f 70 28  rn !results.pop(
e520: 29 3b 0a 09 09 09 09 7d 3b 0a 09 09 7d 20 29 2c  );.....};...} ),
e530: 0a 0a 09 09 22 68 61 73 22 3a 20 6d 61 72 6b 46  ...."has": markF
e540: 75 6e 63 74 69 6f 6e 28 20 66 75 6e 63 74 69 6f  unction( functio
e550: 6e 28 20 73 65 6c 65 63 74 6f 72 20 29 20 7b 0a  n( selector ) {.
e560: 09 09 09 72 65 74 75 72 6e 20 66 75 6e 63 74 69  ...return functi
e570: 6f 6e 28 20 65 6c 65 6d 20 29 20 7b 0a 09 09 09  on( elem ) {....
e580: 09 72 65 74 75 72 6e 20 53 69 7a 7a 6c 65 28 20  .return Sizzle( 
e590: 73 65 6c 65 63 74 6f 72 2c 20 65 6c 65 6d 20 29  selector, elem )
e5a0: 2e 6c 65 6e 67 74 68 20 3e 20 30 3b 0a 09 09 09  .length > 0;....
e5b0: 7d 3b 0a 09 09 7d 20 29 2c 0a 0a 09 09 22 63 6f  };...} ),...."co
e5c0: 6e 74 61 69 6e 73 22 3a 20 6d 61 72 6b 46 75 6e  ntains": markFun
e5d0: 63 74 69 6f 6e 28 20 66 75 6e 63 74 69 6f 6e 28  ction( function(
e5e0: 20 74 65 78 74 20 29 20 7b 0a 09 09 09 74 65 78   text ) {....tex
e5f0: 74 20 3d 20 74 65 78 74 2e 72 65 70 6c 61 63 65  t = text.replace
e600: 28 20 72 75 6e 65 73 63 61 70 65 2c 20 66 75 6e  ( runescape, fun
e610: 65 73 63 61 70 65 20 29 3b 0a 09 09 09 72 65 74  escape );....ret
e620: 75 72 6e 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c  urn function( el
e630: 65 6d 20 29 20 7b 0a 09 09 09 09 72 65 74 75 72  em ) {.....retur
e640: 6e 20 28 20 65 6c 65 6d 2e 74 65 78 74 43 6f 6e  n ( elem.textCon
e650: 74 65 6e 74 20 7c 7c 20 67 65 74 54 65 78 74 28  tent || getText(
e660: 20 65 6c 65 6d 20 29 20 29 2e 69 6e 64 65 78 4f   elem ) ).indexO
e670: 66 28 20 74 65 78 74 20 29 20 3e 20 2d 31 3b 0a  f( text ) > -1;.
e680: 09 09 09 7d 3b 0a 09 09 7d 20 29 2c 0a 0a 09 09  ...};...} ),....
e690: 2f 2f 20 22 57 68 65 74 68 65 72 20 61 6e 20 65  // "Whether an e
e6a0: 6c 65 6d 65 6e 74 20 69 73 20 72 65 70 72 65 73  lement is repres
e6b0: 65 6e 74 65 64 20 62 79 20 61 20 3a 6c 61 6e 67  ented by a :lang
e6c0: 28 29 20 73 65 6c 65 63 74 6f 72 0a 09 09 2f 2f  () selector...//
e6d0: 20 69 73 20 62 61 73 65 64 20 73 6f 6c 65 6c 79   is based solely
e6e0: 20 6f 6e 20 74 68 65 20 65 6c 65 6d 65 6e 74 27   on the element'
e6f0: 73 20 6c 61 6e 67 75 61 67 65 20 76 61 6c 75 65  s language value
e700: 0a 09 09 2f 2f 20 62 65 69 6e 67 20 65 71 75 61  ...// being equa
e710: 6c 20 74 6f 20 74 68 65 20 69 64 65 6e 74 69 66  l to the identif
e720: 69 65 72 20 43 2c 0a 09 09 2f 2f 20 6f 72 20 62  ier C,...// or b
e730: 65 67 69 6e 6e 69 6e 67 20 77 69 74 68 20 74 68  eginning with th
e740: 65 20 69 64 65 6e 74 69 66 69 65 72 20 43 20 69  e identifier C i
e750: 6d 6d 65 64 69 61 74 65 6c 79 20 66 6f 6c 6c 6f  mmediately follo
e760: 77 65 64 20 62 79 20 22 2d 22 2e 0a 09 09 2f 2f  wed by "-"....//
e770: 20 54 68 65 20 6d 61 74 63 68 69 6e 67 20 6f 66   The matching of
e780: 20 43 20 61 67 61 69 6e 73 74 20 74 68 65 20 65   C against the e
e790: 6c 65 6d 65 6e 74 27 73 20 6c 61 6e 67 75 61 67  lement's languag
e7a0: 65 20 76 61 6c 75 65 20 69 73 20 70 65 72 66 6f  e value is perfo
e7b0: 72 6d 65 64 20 63 61 73 65 2d 69 6e 73 65 6e 73  rmed case-insens
e7c0: 69 74 69 76 65 6c 79 2e 0a 09 09 2f 2f 20 54 68  itively....// Th
e7d0: 65 20 69 64 65 6e 74 69 66 69 65 72 20 43 20 64  e identifier C d
e7e0: 6f 65 73 20 6e 6f 74 20 68 61 76 65 20 74 6f 20  oes not have to 
e7f0: 62 65 20 61 20 76 61 6c 69 64 20 6c 61 6e 67 75  be a valid langu
e800: 61 67 65 20 6e 61 6d 65 2e 22 0a 09 09 2f 2f 20  age name."...// 
e810: 68 74 74 70 3a 2f 2f 77 77 77 2e 77 33 2e 6f 72  http://www.w3.or
e820: 67 2f 54 52 2f 73 65 6c 65 63 74 6f 72 73 2f 23  g/TR/selectors/#
e830: 6c 61 6e 67 2d 70 73 65 75 64 6f 0a 09 09 22 6c  lang-pseudo..."l
e840: 61 6e 67 22 3a 20 6d 61 72 6b 46 75 6e 63 74 69  ang": markFuncti
e850: 6f 6e 28 20 66 75 6e 63 74 69 6f 6e 28 20 6c 61  on( function( la
e860: 6e 67 20 29 20 7b 0a 0a 09 09 09 2f 2f 20 6c 61  ng ) {.....// la
e870: 6e 67 20 76 61 6c 75 65 20 6d 75 73 74 20 62 65  ng value must be
e880: 20 61 20 76 61 6c 69 64 20 69 64 65 6e 74 69 66   a valid identif
e890: 69 65 72 0a 09 09 09 69 66 20 28 20 21 72 69 64  ier....if ( !rid
e8a0: 65 6e 74 69 66 69 65 72 2e 74 65 73 74 28 20 6c  entifier.test( l
e8b0: 61 6e 67 20 7c 7c 20 22 22 20 29 20 29 20 7b 0a  ang || "" ) ) {.
e8c0: 09 09 09 09 53 69 7a 7a 6c 65 2e 65 72 72 6f 72  ....Sizzle.error
e8d0: 28 20 22 75 6e 73 75 70 70 6f 72 74 65 64 20 6c  ( "unsupported l
e8e0: 61 6e 67 3a 20 22 20 2b 20 6c 61 6e 67 20 29 3b  ang: " + lang );
e8f0: 0a 09 09 09 7d 0a 09 09 09 6c 61 6e 67 20 3d 20  ....}....lang = 
e900: 6c 61 6e 67 2e 72 65 70 6c 61 63 65 28 20 72 75  lang.replace( ru
e910: 6e 65 73 63 61 70 65 2c 20 66 75 6e 65 73 63 61  nescape, funesca
e920: 70 65 20 29 2e 74 6f 4c 6f 77 65 72 43 61 73 65  pe ).toLowerCase
e930: 28 29 3b 0a 09 09 09 72 65 74 75 72 6e 20 66 75  ();....return fu
e940: 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 20 29 20 7b  nction( elem ) {
e950: 0a 09 09 09 09 76 61 72 20 65 6c 65 6d 4c 61 6e  .....var elemLan
e960: 67 3b 0a 09 09 09 09 64 6f 20 7b 0a 09 09 09 09  g;.....do {.....
e970: 09 69 66 20 28 20 28 20 65 6c 65 6d 4c 61 6e 67  .if ( ( elemLang
e980: 20 3d 20 64 6f 63 75 6d 65 6e 74 49 73 48 54 4d   = documentIsHTM
e990: 4c 20 3f 0a 09 09 09 09 09 09 65 6c 65 6d 2e 6c  L ?.......elem.l
e9a0: 61 6e 67 20 3a 0a 09 09 09 09 09 09 65 6c 65 6d  ang :.......elem
e9b0: 2e 67 65 74 41 74 74 72 69 62 75 74 65 28 20 22  .getAttribute( "
e9c0: 78 6d 6c 3a 6c 61 6e 67 22 20 29 20 7c 7c 20 65  xml:lang" ) || e
e9d0: 6c 65 6d 2e 67 65 74 41 74 74 72 69 62 75 74 65  lem.getAttribute
e9e0: 28 20 22 6c 61 6e 67 22 20 29 20 29 20 29 20 7b  ( "lang" ) ) ) {
e9f0: 0a 0a 09 09 09 09 09 09 65 6c 65 6d 4c 61 6e 67  ........elemLang
ea00: 20 3d 20 65 6c 65 6d 4c 61 6e 67 2e 74 6f 4c 6f   = elemLang.toLo
ea10: 77 65 72 43 61 73 65 28 29 3b 0a 09 09 09 09 09  werCase();......
ea20: 09 72 65 74 75 72 6e 20 65 6c 65 6d 4c 61 6e 67  .return elemLang
ea30: 20 3d 3d 3d 20 6c 61 6e 67 20 7c 7c 20 65 6c 65   === lang || ele
ea40: 6d 4c 61 6e 67 2e 69 6e 64 65 78 4f 66 28 20 6c  mLang.indexOf( l
ea50: 61 6e 67 20 2b 20 22 2d 22 20 29 20 3d 3d 3d 20  ang + "-" ) === 
ea60: 30 3b 0a 09 09 09 09 09 7d 0a 09 09 09 09 7d 20  0;......}.....} 
ea70: 77 68 69 6c 65 20 28 20 28 20 65 6c 65 6d 20 3d  while ( ( elem =
ea80: 20 65 6c 65 6d 2e 70 61 72 65 6e 74 4e 6f 64 65   elem.parentNode
ea90: 20 29 20 26 26 20 65 6c 65 6d 2e 6e 6f 64 65 54   ) && elem.nodeT
eaa0: 79 70 65 20 3d 3d 3d 20 31 20 29 3b 0a 09 09 09  ype === 1 );....
eab0: 09 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0a 09  .return false;..
eac0: 09 09 7d 3b 0a 09 09 7d 20 29 2c 0a 0a 09 09 2f  ..};...} ),..../
ead0: 2f 20 4d 69 73 63 65 6c 6c 61 6e 65 6f 75 73 0a  / Miscellaneous.
eae0: 09 09 22 74 61 72 67 65 74 22 3a 20 66 75 6e 63  .."target": func
eaf0: 74 69 6f 6e 28 20 65 6c 65 6d 20 29 20 7b 0a 09  tion( elem ) {..
eb00: 09 09 76 61 72 20 68 61 73 68 20 3d 20 77 69 6e  ..var hash = win
eb10: 64 6f 77 2e 6c 6f 63 61 74 69 6f 6e 20 26 26 20  dow.location && 
eb20: 77 69 6e 64 6f 77 2e 6c 6f 63 61 74 69 6f 6e 2e  window.location.
eb30: 68 61 73 68 3b 0a 09 09 09 72 65 74 75 72 6e 20  hash;....return 
eb40: 68 61 73 68 20 26 26 20 68 61 73 68 2e 73 6c 69  hash && hash.sli
eb50: 63 65 28 20 31 20 29 20 3d 3d 3d 20 65 6c 65 6d  ce( 1 ) === elem
eb60: 2e 69 64 3b 0a 09 09 7d 2c 0a 0a 09 09 22 72 6f  .id;...},...."ro
eb70: 6f 74 22 3a 20 66 75 6e 63 74 69 6f 6e 28 20 65  ot": function( e
eb80: 6c 65 6d 20 29 20 7b 0a 09 09 09 72 65 74 75 72  lem ) {....retur
eb90: 6e 20 65 6c 65 6d 20 3d 3d 3d 20 64 6f 63 45 6c  n elem === docEl
eba0: 65 6d 3b 0a 09 09 7d 2c 0a 0a 09 09 22 66 6f 63  em;...},...."foc
ebb0: 75 73 22 3a 20 66 75 6e 63 74 69 6f 6e 28 20 65  us": function( e
ebc0: 6c 65 6d 20 29 20 7b 0a 09 09 09 72 65 74 75 72  lem ) {....retur
ebd0: 6e 20 65 6c 65 6d 20 3d 3d 3d 20 64 6f 63 75 6d  n elem === docum
ebe0: 65 6e 74 2e 61 63 74 69 76 65 45 6c 65 6d 65 6e  ent.activeElemen
ebf0: 74 20 26 26 0a 09 09 09 09 28 20 21 64 6f 63 75  t &&.....( !docu
ec00: 6d 65 6e 74 2e 68 61 73 46 6f 63 75 73 20 7c 7c  ment.hasFocus ||
ec10: 20 64 6f 63 75 6d 65 6e 74 2e 68 61 73 46 6f 63   document.hasFoc
ec20: 75 73 28 29 20 29 20 26 26 0a 09 09 09 09 21 21  us() ) &&.....!!
ec30: 28 20 65 6c 65 6d 2e 74 79 70 65 20 7c 7c 20 65  ( elem.type || e
ec40: 6c 65 6d 2e 68 72 65 66 20 7c 7c 20 7e 65 6c 65  lem.href || ~ele
ec50: 6d 2e 74 61 62 49 6e 64 65 78 20 29 3b 0a 09 09  m.tabIndex );...
ec60: 7d 2c 0a 0a 09 09 2f 2f 20 42 6f 6f 6c 65 61 6e  },....// Boolean
ec70: 20 70 72 6f 70 65 72 74 69 65 73 0a 09 09 22 65   properties..."e
ec80: 6e 61 62 6c 65 64 22 3a 20 63 72 65 61 74 65 44  nabled": createD
ec90: 69 73 61 62 6c 65 64 50 73 65 75 64 6f 28 20 66  isabledPseudo( f
eca0: 61 6c 73 65 20 29 2c 0a 09 09 22 64 69 73 61 62  alse ),..."disab
ecb0: 6c 65 64 22 3a 20 63 72 65 61 74 65 44 69 73 61  led": createDisa
ecc0: 62 6c 65 64 50 73 65 75 64 6f 28 20 74 72 75 65  bledPseudo( true
ecd0: 20 29 2c 0a 0a 09 09 22 63 68 65 63 6b 65 64 22   ),...."checked"
ece0: 3a 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c 65 6d  : function( elem
ecf0: 20 29 20 7b 0a 0a 09 09 09 2f 2f 20 49 6e 20 43   ) {.....// In C
ed00: 53 53 33 2c 20 3a 63 68 65 63 6b 65 64 20 73 68  SS3, :checked sh
ed10: 6f 75 6c 64 20 72 65 74 75 72 6e 20 62 6f 74 68  ould return both
ed20: 20 63 68 65 63 6b 65 64 20 61 6e 64 20 73 65 6c   checked and sel
ed30: 65 63 74 65 64 20 65 6c 65 6d 65 6e 74 73 0a 09  ected elements..
ed40: 09 09 2f 2f 20 68 74 74 70 3a 2f 2f 77 77 77 2e  ..// http://www.
ed50: 77 33 2e 6f 72 67 2f 54 52 2f 32 30 31 31 2f 52  w3.org/TR/2011/R
ed60: 45 43 2d 63 73 73 33 2d 73 65 6c 65 63 74 6f 72  EC-css3-selector
ed70: 73 2d 32 30 31 31 30 39 32 39 2f 23 63 68 65 63  s-20110929/#chec
ed80: 6b 65 64 0a 09 09 09 76 61 72 20 6e 6f 64 65 4e  ked....var nodeN
ed90: 61 6d 65 20 3d 20 65 6c 65 6d 2e 6e 6f 64 65 4e  ame = elem.nodeN
eda0: 61 6d 65 2e 74 6f 4c 6f 77 65 72 43 61 73 65 28  ame.toLowerCase(
edb0: 29 3b 0a 09 09 09 72 65 74 75 72 6e 20 28 20 6e  );....return ( n
edc0: 6f 64 65 4e 61 6d 65 20 3d 3d 3d 20 22 69 6e 70  odeName === "inp
edd0: 75 74 22 20 26 26 20 21 21 65 6c 65 6d 2e 63 68  ut" && !!elem.ch
ede0: 65 63 6b 65 64 20 29 20 7c 7c 0a 09 09 09 09 28  ecked ) ||.....(
edf0: 20 6e 6f 64 65 4e 61 6d 65 20 3d 3d 3d 20 22 6f   nodeName === "o
ee00: 70 74 69 6f 6e 22 20 26 26 20 21 21 65 6c 65 6d  ption" && !!elem
ee10: 2e 73 65 6c 65 63 74 65 64 20 29 3b 0a 09 09 7d  .selected );...}
ee20: 2c 0a 0a 09 09 22 73 65 6c 65 63 74 65 64 22 3a  ,...."selected":
ee30: 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 20   function( elem 
ee40: 29 20 7b 0a 0a 09 09 09 2f 2f 20 41 63 63 65 73  ) {.....// Acces
ee50: 73 69 6e 67 20 74 68 69 73 20 70 72 6f 70 65 72  sing this proper
ee60: 74 79 20 6d 61 6b 65 73 20 73 65 6c 65 63 74 65  ty makes selecte
ee70: 64 2d 62 79 2d 64 65 66 61 75 6c 74 0a 09 09 09  d-by-default....
ee80: 2f 2f 20 6f 70 74 69 6f 6e 73 20 69 6e 20 53 61  // options in Sa
ee90: 66 61 72 69 20 77 6f 72 6b 20 70 72 6f 70 65 72  fari work proper
eea0: 6c 79 0a 09 09 09 69 66 20 28 20 65 6c 65 6d 2e  ly....if ( elem.
eeb0: 70 61 72 65 6e 74 4e 6f 64 65 20 29 20 7b 0a 09  parentNode ) {..
eec0: 09 09 09 2f 2f 20 65 73 6c 69 6e 74 2d 64 69 73  ...// eslint-dis
eed0: 61 62 6c 65 2d 6e 65 78 74 2d 6c 69 6e 65 20 6e  able-next-line n
eee0: 6f 2d 75 6e 75 73 65 64 2d 65 78 70 72 65 73 73  o-unused-express
eef0: 69 6f 6e 73 0a 09 09 09 09 65 6c 65 6d 2e 70 61  ions.....elem.pa
ef00: 72 65 6e 74 4e 6f 64 65 2e 73 65 6c 65 63 74 65  rentNode.selecte
ef10: 64 49 6e 64 65 78 3b 0a 09 09 09 7d 0a 0a 09 09  dIndex;....}....
ef20: 09 72 65 74 75 72 6e 20 65 6c 65 6d 2e 73 65 6c  .return elem.sel
ef30: 65 63 74 65 64 20 3d 3d 3d 20 74 72 75 65 3b 0a  ected === true;.
ef40: 09 09 7d 2c 0a 0a 09 09 2f 2f 20 43 6f 6e 74 65  ..},....// Conte
ef50: 6e 74 73 0a 09 09 22 65 6d 70 74 79 22 3a 20 66  nts..."empty": f
ef60: 75 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 20 29 20  unction( elem ) 
ef70: 7b 0a 0a 09 09 09 2f 2f 20 68 74 74 70 3a 2f 2f  {.....// http://
ef80: 77 77 77 2e 77 33 2e 6f 72 67 2f 54 52 2f 73 65  www.w3.org/TR/se
ef90: 6c 65 63 74 6f 72 73 2f 23 65 6d 70 74 79 2d 70  lectors/#empty-p
efa0: 73 65 75 64 6f 0a 09 09 09 2f 2f 20 3a 65 6d 70  seudo....// :emp
efb0: 74 79 20 69 73 20 6e 65 67 61 74 65 64 20 62 79  ty is negated by
efc0: 20 65 6c 65 6d 65 6e 74 20 28 31 29 20 6f 72 20   element (1) or 
efd0: 63 6f 6e 74 65 6e 74 20 6e 6f 64 65 73 20 28 74  content nodes (t
efe0: 65 78 74 3a 20 33 3b 20 63 64 61 74 61 3a 20 34  ext: 3; cdata: 4
eff0: 3b 20 65 6e 74 69 74 79 20 72 65 66 3a 20 35 29  ; entity ref: 5)
f000: 2c 0a 09 09 09 2f 2f 20 20 20 62 75 74 20 6e 6f  ,....//   but no
f010: 74 20 62 79 20 6f 74 68 65 72 73 20 28 63 6f 6d  t by others (com
f020: 6d 65 6e 74 3a 20 38 3b 20 70 72 6f 63 65 73 73  ment: 8; process
f030: 69 6e 67 20 69 6e 73 74 72 75 63 74 69 6f 6e 3a  ing instruction:
f040: 20 37 3b 20 65 74 63 2e 29 0a 09 09 09 2f 2f 20   7; etc.)....// 
f050: 6e 6f 64 65 54 79 70 65 20 3c 20 36 20 77 6f 72  nodeType < 6 wor
f060: 6b 73 20 62 65 63 61 75 73 65 20 61 74 74 72 69  ks because attri
f070: 62 75 74 65 73 20 28 32 29 20 64 6f 20 6e 6f 74  butes (2) do not
f080: 20 61 70 70 65 61 72 20 61 73 20 63 68 69 6c 64   appear as child
f090: 72 65 6e 0a 09 09 09 66 6f 72 20 28 20 65 6c 65  ren....for ( ele
f0a0: 6d 20 3d 20 65 6c 65 6d 2e 66 69 72 73 74 43 68  m = elem.firstCh
f0b0: 69 6c 64 3b 20 65 6c 65 6d 3b 20 65 6c 65 6d 20  ild; elem; elem 
f0c0: 3d 20 65 6c 65 6d 2e 6e 65 78 74 53 69 62 6c 69  = elem.nextSibli
f0d0: 6e 67 20 29 20 7b 0a 09 09 09 09 69 66 20 28 20  ng ) {.....if ( 
f0e0: 65 6c 65 6d 2e 6e 6f 64 65 54 79 70 65 20 3c 20  elem.nodeType < 
f0f0: 36 20 29 20 7b 0a 09 09 09 09 09 72 65 74 75 72  6 ) {......retur
f100: 6e 20 66 61 6c 73 65 3b 0a 09 09 09 09 7d 0a 09  n false;.....}..
f110: 09 09 7d 0a 09 09 09 72 65 74 75 72 6e 20 74 72  ..}....return tr
f120: 75 65 3b 0a 09 09 7d 2c 0a 0a 09 09 22 70 61 72  ue;...},...."par
f130: 65 6e 74 22 3a 20 66 75 6e 63 74 69 6f 6e 28 20  ent": function( 
f140: 65 6c 65 6d 20 29 20 7b 0a 09 09 09 72 65 74 75  elem ) {....retu
f150: 72 6e 20 21 45 78 70 72 2e 70 73 65 75 64 6f 73  rn !Expr.pseudos
f160: 5b 20 22 65 6d 70 74 79 22 20 5d 28 20 65 6c 65  [ "empty" ]( ele
f170: 6d 20 29 3b 0a 09 09 7d 2c 0a 0a 09 09 2f 2f 20  m );...},....// 
f180: 45 6c 65 6d 65 6e 74 2f 69 6e 70 75 74 20 74 79  Element/input ty
f190: 70 65 73 0a 09 09 22 68 65 61 64 65 72 22 3a 20  pes..."header": 
f1a0: 66 75 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 20 29  function( elem )
f1b0: 20 7b 0a 09 09 09 72 65 74 75 72 6e 20 72 68 65   {....return rhe
f1c0: 61 64 65 72 2e 74 65 73 74 28 20 65 6c 65 6d 2e  ader.test( elem.
f1d0: 6e 6f 64 65 4e 61 6d 65 20 29 3b 0a 09 09 7d 2c  nodeName );...},
f1e0: 0a 0a 09 09 22 69 6e 70 75 74 22 3a 20 66 75 6e  ...."input": fun
f1f0: 63 74 69 6f 6e 28 20 65 6c 65 6d 20 29 20 7b 0a  ction( elem ) {.
f200: 09 09 09 72 65 74 75 72 6e 20 72 69 6e 70 75 74  ...return rinput
f210: 73 2e 74 65 73 74 28 20 65 6c 65 6d 2e 6e 6f 64  s.test( elem.nod
f220: 65 4e 61 6d 65 20 29 3b 0a 09 09 7d 2c 0a 0a 09  eName );...},...
f230: 09 22 62 75 74 74 6f 6e 22 3a 20 66 75 6e 63 74  ."button": funct
f240: 69 6f 6e 28 20 65 6c 65 6d 20 29 20 7b 0a 09 09  ion( elem ) {...
f250: 09 76 61 72 20 6e 61 6d 65 20 3d 20 65 6c 65 6d  .var name = elem
f260: 2e 6e 6f 64 65 4e 61 6d 65 2e 74 6f 4c 6f 77 65  .nodeName.toLowe
f270: 72 43 61 73 65 28 29 3b 0a 09 09 09 72 65 74 75  rCase();....retu
f280: 72 6e 20 6e 61 6d 65 20 3d 3d 3d 20 22 69 6e 70  rn name === "inp
f290: 75 74 22 20 26 26 20 65 6c 65 6d 2e 74 79 70 65  ut" && elem.type
f2a0: 20 3d 3d 3d 20 22 62 75 74 74 6f 6e 22 20 7c 7c   === "button" ||
f2b0: 20 6e 61 6d 65 20 3d 3d 3d 20 22 62 75 74 74 6f   name === "butto
f2c0: 6e 22 3b 0a 09 09 7d 2c 0a 0a 09 09 22 74 65 78  n";...},...."tex
f2d0: 74 22 3a 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c  t": function( el
f2e0: 65 6d 20 29 20 7b 0a 09 09 09 76 61 72 20 61 74  em ) {....var at
f2f0: 74 72 3b 0a 09 09 09 72 65 74 75 72 6e 20 65 6c  tr;....return el
f300: 65 6d 2e 6e 6f 64 65 4e 61 6d 65 2e 74 6f 4c 6f  em.nodeName.toLo
f310: 77 65 72 43 61 73 65 28 29 20 3d 3d 3d 20 22 69  werCase() === "i
f320: 6e 70 75 74 22 20 26 26 0a 09 09 09 09 65 6c 65  nput" &&.....ele
f330: 6d 2e 74 79 70 65 20 3d 3d 3d 20 22 74 65 78 74  m.type === "text
f340: 22 20 26 26 0a 0a 09 09 09 09 2f 2f 20 53 75 70  " &&......// Sup
f350: 70 6f 72 74 3a 20 49 45 3c 38 0a 09 09 09 09 2f  port: IE<8...../
f360: 2f 20 4e 65 77 20 48 54 4d 4c 35 20 61 74 74 72  / New HTML5 attr
f370: 69 62 75 74 65 20 76 61 6c 75 65 73 20 28 65 2e  ibute values (e.
f380: 67 2e 2c 20 22 73 65 61 72 63 68 22 29 20 61 70  g., "search") ap
f390: 70 65 61 72 20 77 69 74 68 20 65 6c 65 6d 2e 74  pear with elem.t
f3a0: 79 70 65 20 3d 3d 3d 20 22 74 65 78 74 22 0a 09  ype === "text"..
f3b0: 09 09 09 28 20 28 20 61 74 74 72 20 3d 20 65 6c  ...( ( attr = el
f3c0: 65 6d 2e 67 65 74 41 74 74 72 69 62 75 74 65 28  em.getAttribute(
f3d0: 20 22 74 79 70 65 22 20 29 20 29 20 3d 3d 20 6e   "type" ) ) == n
f3e0: 75 6c 6c 20 7c 7c 0a 09 09 09 09 09 61 74 74 72  ull ||......attr
f3f0: 2e 74 6f 4c 6f 77 65 72 43 61 73 65 28 29 20 3d  .toLowerCase() =
f400: 3d 3d 20 22 74 65 78 74 22 20 29 3b 0a 09 09 7d  == "text" );...}
f410: 2c 0a 0a 09 09 2f 2f 20 50 6f 73 69 74 69 6f 6e  ,....// Position
f420: 2d 69 6e 2d 63 6f 6c 6c 65 63 74 69 6f 6e 0a 09  -in-collection..
f430: 09 22 66 69 72 73 74 22 3a 20 63 72 65 61 74 65  ."first": create
f440: 50 6f 73 69 74 69 6f 6e 61 6c 50 73 65 75 64 6f  PositionalPseudo
f450: 28 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09  ( function() {..
f460: 09 09 72 65 74 75 72 6e 20 5b 20 30 20 5d 3b 0a  ..return [ 0 ];.
f470: 09 09 7d 20 29 2c 0a 0a 09 09 22 6c 61 73 74 22  ..} ),...."last"
f480: 3a 20 63 72 65 61 74 65 50 6f 73 69 74 69 6f 6e  : createPosition
f490: 61 6c 50 73 65 75 64 6f 28 20 66 75 6e 63 74 69  alPseudo( functi
f4a0: 6f 6e 28 20 5f 6d 61 74 63 68 49 6e 64 65 78 65  on( _matchIndexe
f4b0: 73 2c 20 6c 65 6e 67 74 68 20 29 20 7b 0a 09 09  s, length ) {...
f4c0: 09 72 65 74 75 72 6e 20 5b 20 6c 65 6e 67 74 68  .return [ length
f4d0: 20 2d 20 31 20 5d 3b 0a 09 09 7d 20 29 2c 0a 0a   - 1 ];...} ),..
f4e0: 09 09 22 65 71 22 3a 20 63 72 65 61 74 65 50 6f  .."eq": createPo
f4f0: 73 69 74 69 6f 6e 61 6c 50 73 65 75 64 6f 28 20  sitionalPseudo( 
f500: 66 75 6e 63 74 69 6f 6e 28 20 5f 6d 61 74 63 68  function( _match
f510: 49 6e 64 65 78 65 73 2c 20 6c 65 6e 67 74 68 2c  Indexes, length,
f520: 20 61 72 67 75 6d 65 6e 74 20 29 20 7b 0a 09 09   argument ) {...
f530: 09 72 65 74 75 72 6e 20 5b 20 61 72 67 75 6d 65  .return [ argume
f540: 6e 74 20 3c 20 30 20 3f 20 61 72 67 75 6d 65 6e  nt < 0 ? argumen
f550: 74 20 2b 20 6c 65 6e 67 74 68 20 3a 20 61 72 67  t + length : arg
f560: 75 6d 65 6e 74 20 5d 3b 0a 09 09 7d 20 29 2c 0a  ument ];...} ),.
f570: 0a 09 09 22 65 76 65 6e 22 3a 20 63 72 65 61 74  ..."even": creat
f580: 65 50 6f 73 69 74 69 6f 6e 61 6c 50 73 65 75 64  ePositionalPseud
f590: 6f 28 20 66 75 6e 63 74 69 6f 6e 28 20 6d 61 74  o( function( mat
f5a0: 63 68 49 6e 64 65 78 65 73 2c 20 6c 65 6e 67 74  chIndexes, lengt
f5b0: 68 20 29 20 7b 0a 09 09 09 76 61 72 20 69 20 3d  h ) {....var i =
f5c0: 20 30 3b 0a 09 09 09 66 6f 72 20 28 20 3b 20 69   0;....for ( ; i
f5d0: 20 3c 20 6c 65 6e 67 74 68 3b 20 69 20 2b 3d 20   < length; i += 
f5e0: 32 20 29 20 7b 0a 09 09 09 09 6d 61 74 63 68 49  2 ) {.....matchI
f5f0: 6e 64 65 78 65 73 2e 70 75 73 68 28 20 69 20 29  ndexes.push( i )
f600: 3b 0a 09 09 09 7d 0a 09 09 09 72 65 74 75 72 6e  ;....}....return
f610: 20 6d 61 74 63 68 49 6e 64 65 78 65 73 3b 0a 09   matchIndexes;..
f620: 09 7d 20 29 2c 0a 0a 09 09 22 6f 64 64 22 3a 20  .} ),...."odd": 
f630: 63 72 65 61 74 65 50 6f 73 69 74 69 6f 6e 61 6c  createPositional
f640: 50 73 65 75 64 6f 28 20 66 75 6e 63 74 69 6f 6e  Pseudo( function
f650: 28 20 6d 61 74 63 68 49 6e 64 65 78 65 73 2c 20  ( matchIndexes, 
f660: 6c 65 6e 67 74 68 20 29 20 7b 0a 09 09 09 76 61  length ) {....va
f670: 72 20 69 20 3d 20 31 3b 0a 09 09 09 66 6f 72 20  r i = 1;....for 
f680: 28 20 3b 20 69 20 3c 20 6c 65 6e 67 74 68 3b 20  ( ; i < length; 
f690: 69 20 2b 3d 20 32 20 29 20 7b 0a 09 09 09 09 6d  i += 2 ) {.....m
f6a0: 61 74 63 68 49 6e 64 65 78 65 73 2e 70 75 73 68  atchIndexes.push
f6b0: 28 20 69 20 29 3b 0a 09 09 09 7d 0a 09 09 09 72  ( i );....}....r
f6c0: 65 74 75 72 6e 20 6d 61 74 63 68 49 6e 64 65 78  eturn matchIndex
f6d0: 65 73 3b 0a 09 09 7d 20 29 2c 0a 0a 09 09 22 6c  es;...} ),...."l
f6e0: 74 22 3a 20 63 72 65 61 74 65 50 6f 73 69 74 69  t": createPositi
f6f0: 6f 6e 61 6c 50 73 65 75 64 6f 28 20 66 75 6e 63  onalPseudo( func
f700: 74 69 6f 6e 28 20 6d 61 74 63 68 49 6e 64 65 78  tion( matchIndex
f710: 65 73 2c 20 6c 65 6e 67 74 68 2c 20 61 72 67 75  es, length, argu
f720: 6d 65 6e 74 20 29 20 7b 0a 09 09 09 76 61 72 20  ment ) {....var 
f730: 69 20 3d 20 61 72 67 75 6d 65 6e 74 20 3c 20 30  i = argument < 0
f740: 20 3f 0a 09 09 09 09 61 72 67 75 6d 65 6e 74 20   ?.....argument 
f750: 2b 20 6c 65 6e 67 74 68 20 3a 0a 09 09 09 09 61  + length :.....a
f760: 72 67 75 6d 65 6e 74 20 3e 20 6c 65 6e 67 74 68  rgument > length
f770: 20 3f 0a 09 09 09 09 09 6c 65 6e 67 74 68 20 3a   ?......length :
f780: 0a 09 09 09 09 09 61 72 67 75 6d 65 6e 74 3b 0a  ......argument;.
f790: 09 09 09 66 6f 72 20 28 20 3b 20 2d 2d 69 20 3e  ...for ( ; --i >
f7a0: 3d 20 30 3b 20 29 20 7b 0a 09 09 09 09 6d 61 74  = 0; ) {.....mat
f7b0: 63 68 49 6e 64 65 78 65 73 2e 70 75 73 68 28 20  chIndexes.push( 
f7c0: 69 20 29 3b 0a 09 09 09 7d 0a 09 09 09 72 65 74  i );....}....ret
f7d0: 75 72 6e 20 6d 61 74 63 68 49 6e 64 65 78 65 73  urn matchIndexes
f7e0: 3b 0a 09 09 7d 20 29 2c 0a 0a 09 09 22 67 74 22  ;...} ),...."gt"
f7f0: 3a 20 63 72 65 61 74 65 50 6f 73 69 74 69 6f 6e  : createPosition
f800: 61 6c 50 73 65 75 64 6f 28 20 66 75 6e 63 74 69  alPseudo( functi
f810: 6f 6e 28 20 6d 61 74 63 68 49 6e 64 65 78 65 73  on( matchIndexes
f820: 2c 20 6c 65 6e 67 74 68 2c 20 61 72 67 75 6d 65  , length, argume
f830: 6e 74 20 29 20 7b 0a 09 09 09 76 61 72 20 69 20  nt ) {....var i 
f840: 3d 20 61 72 67 75 6d 65 6e 74 20 3c 20 30 20 3f  = argument < 0 ?
f850: 20 61 72 67 75 6d 65 6e 74 20 2b 20 6c 65 6e 67   argument + leng
f860: 74 68 20 3a 20 61 72 67 75 6d 65 6e 74 3b 0a 09  th : argument;..
f870: 09 09 66 6f 72 20 28 20 3b 20 2b 2b 69 20 3c 20  ..for ( ; ++i < 
f880: 6c 65 6e 67 74 68 3b 20 29 20 7b 0a 09 09 09 09  length; ) {.....
f890: 6d 61 74 63 68 49 6e 64 65 78 65 73 2e 70 75 73  matchIndexes.pus
f8a0: 68 28 20 69 20 29 3b 0a 09 09 09 7d 0a 09 09 09  h( i );....}....
f8b0: 72 65 74 75 72 6e 20 6d 61 74 63 68 49 6e 64 65  return matchInde
f8c0: 78 65 73 3b 0a 09 09 7d 20 29 0a 09 7d 0a 7d 3b  xes;...} )..}.};
f8d0: 0a 0a 45 78 70 72 2e 70 73 65 75 64 6f 73 5b 20  ..Expr.pseudos[ 
f8e0: 22 6e 74 68 22 20 5d 20 3d 20 45 78 70 72 2e 70  "nth" ] = Expr.p
f8f0: 73 65 75 64 6f 73 5b 20 22 65 71 22 20 5d 3b 0a  seudos[ "eq" ];.
f900: 0a 2f 2f 20 41 64 64 20 62 75 74 74 6f 6e 2f 69  .// Add button/i
f910: 6e 70 75 74 20 74 79 70 65 20 70 73 65 75 64 6f  nput type pseudo
f920: 73 0a 66 6f 72 20 28 20 69 20 69 6e 20 7b 20 72  s.for ( i in { r
f930: 61 64 69 6f 3a 20 74 72 75 65 2c 20 63 68 65 63  adio: true, chec
f940: 6b 62 6f 78 3a 20 74 72 75 65 2c 20 66 69 6c 65  kbox: true, file
f950: 3a 20 74 72 75 65 2c 20 70 61 73 73 77 6f 72 64  : true, password
f960: 3a 20 74 72 75 65 2c 20 69 6d 61 67 65 3a 20 74  : true, image: t
f970: 72 75 65 20 7d 20 29 20 7b 0a 09 45 78 70 72 2e  rue } ) {..Expr.
f980: 70 73 65 75 64 6f 73 5b 20 69 20 5d 20 3d 20 63  pseudos[ i ] = c
f990: 72 65 61 74 65 49 6e 70 75 74 50 73 65 75 64 6f  reateInputPseudo
f9a0: 28 20 69 20 29 3b 0a 7d 0a 66 6f 72 20 28 20 69  ( i );.}.for ( i
f9b0: 20 69 6e 20 7b 20 73 75 62 6d 69 74 3a 20 74 72   in { submit: tr
f9c0: 75 65 2c 20 72 65 73 65 74 3a 20 74 72 75 65 20  ue, reset: true 
f9d0: 7d 20 29 20 7b 0a 09 45 78 70 72 2e 70 73 65 75  } ) {..Expr.pseu
f9e0: 64 6f 73 5b 20 69 20 5d 20 3d 20 63 72 65 61 74  dos[ i ] = creat
f9f0: 65 42 75 74 74 6f 6e 50 73 65 75 64 6f 28 20 69  eButtonPseudo( i
fa00: 20 29 3b 0a 7d 0a 0a 2f 2f 20 45 61 73 79 20 41   );.}..// Easy A
fa10: 50 49 20 66 6f 72 20 63 72 65 61 74 69 6e 67 20  PI for creating 
fa20: 6e 65 77 20 73 65 74 46 69 6c 74 65 72 73 0a 66  new setFilters.f
fa30: 75 6e 63 74 69 6f 6e 20 73 65 74 46 69 6c 74 65  unction setFilte
fa40: 72 73 28 29 20 7b 7d 0a 73 65 74 46 69 6c 74 65  rs() {}.setFilte
fa50: 72 73 2e 70 72 6f 74 6f 74 79 70 65 20 3d 20 45  rs.prototype = E
fa60: 78 70 72 2e 66 69 6c 74 65 72 73 20 3d 20 45 78  xpr.filters = Ex
fa70: 70 72 2e 70 73 65 75 64 6f 73 3b 0a 45 78 70 72  pr.pseudos;.Expr
fa80: 2e 73 65 74 46 69 6c 74 65 72 73 20 3d 20 6e 65  .setFilters = ne
fa90: 77 20 73 65 74 46 69 6c 74 65 72 73 28 29 3b 0a  w setFilters();.
faa0: 0a 74 6f 6b 65 6e 69 7a 65 20 3d 20 53 69 7a 7a  .tokenize = Sizz
fab0: 6c 65 2e 74 6f 6b 65 6e 69 7a 65 20 3d 20 66 75  le.tokenize = fu
fac0: 6e 63 74 69 6f 6e 28 20 73 65 6c 65 63 74 6f 72  nction( selector
fad0: 2c 20 70 61 72 73 65 4f 6e 6c 79 20 29 20 7b 0a  , parseOnly ) {.
fae0: 09 76 61 72 20 6d 61 74 63 68 65 64 2c 20 6d 61  .var matched, ma
faf0: 74 63 68 2c 20 74 6f 6b 65 6e 73 2c 20 74 79 70  tch, tokens, typ
fb00: 65 2c 0a 09 09 73 6f 46 61 72 2c 20 67 72 6f 75  e,...soFar, grou
fb10: 70 73 2c 20 70 72 65 46 69 6c 74 65 72 73 2c 0a  ps, preFilters,.
fb20: 09 09 63 61 63 68 65 64 20 3d 20 74 6f 6b 65 6e  ..cached = token
fb30: 43 61 63 68 65 5b 20 73 65 6c 65 63 74 6f 72 20  Cache[ selector 
fb40: 2b 20 22 20 22 20 5d 3b 0a 0a 09 69 66 20 28 20  + " " ];...if ( 
fb50: 63 61 63 68 65 64 20 29 20 7b 0a 09 09 72 65 74  cached ) {...ret
fb60: 75 72 6e 20 70 61 72 73 65 4f 6e 6c 79 20 3f 20  urn parseOnly ? 
fb70: 30 20 3a 20 63 61 63 68 65 64 2e 73 6c 69 63 65  0 : cached.slice
fb80: 28 20 30 20 29 3b 0a 09 7d 0a 0a 09 73 6f 46 61  ( 0 );..}...soFa
fb90: 72 20 3d 20 73 65 6c 65 63 74 6f 72 3b 0a 09 67  r = selector;..g
fba0: 72 6f 75 70 73 20 3d 20 5b 5d 3b 0a 09 70 72 65  roups = [];..pre
fbb0: 46 69 6c 74 65 72 73 20 3d 20 45 78 70 72 2e 70  Filters = Expr.p
fbc0: 72 65 46 69 6c 74 65 72 3b 0a 0a 09 77 68 69 6c  reFilter;...whil
fbd0: 65 20 28 20 73 6f 46 61 72 20 29 20 7b 0a 0a 09  e ( soFar ) {...
fbe0: 09 2f 2f 20 43 6f 6d 6d 61 20 61 6e 64 20 66 69  .// Comma and fi
fbf0: 72 73 74 20 72 75 6e 0a 09 09 69 66 20 28 20 21  rst run...if ( !
fc00: 6d 61 74 63 68 65 64 20 7c 7c 20 28 20 6d 61 74  matched || ( mat
fc10: 63 68 20 3d 20 72 63 6f 6d 6d 61 2e 65 78 65 63  ch = rcomma.exec
fc20: 28 20 73 6f 46 61 72 20 29 20 29 20 29 20 7b 0a  ( soFar ) ) ) {.
fc30: 09 09 09 69 66 20 28 20 6d 61 74 63 68 20 29 20  ...if ( match ) 
fc40: 7b 0a 0a 09 09 09 09 2f 2f 20 44 6f 6e 27 74 20  {......// Don't 
fc50: 63 6f 6e 73 75 6d 65 20 74 72 61 69 6c 69 6e 67  consume trailing
fc60: 20 63 6f 6d 6d 61 73 20 61 73 20 76 61 6c 69 64   commas as valid
fc70: 0a 09 09 09 09 73 6f 46 61 72 20 3d 20 73 6f 46  .....soFar = soF
fc80: 61 72 2e 73 6c 69 63 65 28 20 6d 61 74 63 68 5b  ar.slice( match[
fc90: 20 30 20 5d 2e 6c 65 6e 67 74 68 20 29 20 7c 7c   0 ].length ) ||
fca0: 20 73 6f 46 61 72 3b 0a 09 09 09 7d 0a 09 09 09   soFar;....}....
fcb0: 67 72 6f 75 70 73 2e 70 75 73 68 28 20 28 20 74  groups.push( ( t
fcc0: 6f 6b 65 6e 73 20 3d 20 5b 5d 20 29 20 29 3b 0a  okens = [] ) );.
fcd0: 09 09 7d 0a 0a 09 09 6d 61 74 63 68 65 64 20 3d  ..}....matched =
fce0: 20 66 61 6c 73 65 3b 0a 0a 09 09 2f 2f 20 43 6f   false;....// Co
fcf0: 6d 62 69 6e 61 74 6f 72 73 0a 09 09 69 66 20 28  mbinators...if (
fd00: 20 28 20 6d 61 74 63 68 20 3d 20 72 63 6f 6d 62   ( match = rcomb
fd10: 69 6e 61 74 6f 72 73 2e 65 78 65 63 28 20 73 6f  inators.exec( so
fd20: 46 61 72 20 29 20 29 20 29 20 7b 0a 09 09 09 6d  Far ) ) ) {....m
fd30: 61 74 63 68 65 64 20 3d 20 6d 61 74 63 68 2e 73  atched = match.s
fd40: 68 69 66 74 28 29 3b 0a 09 09 09 74 6f 6b 65 6e  hift();....token
fd50: 73 2e 70 75 73 68 28 20 7b 0a 09 09 09 09 76 61  s.push( {.....va
fd60: 6c 75 65 3a 20 6d 61 74 63 68 65 64 2c 0a 0a 09  lue: matched,...
fd70: 09 09 09 2f 2f 20 43 61 73 74 20 64 65 73 63 65  ...// Cast desce
fd80: 6e 64 61 6e 74 20 63 6f 6d 62 69 6e 61 74 6f 72  ndant combinator
fd90: 73 20 74 6f 20 73 70 61 63 65 0a 09 09 09 09 74  s to space.....t
fda0: 79 70 65 3a 20 6d 61 74 63 68 5b 20 30 20 5d 2e  ype: match[ 0 ].
fdb0: 72 65 70 6c 61 63 65 28 20 72 74 72 69 6d 2c 20  replace( rtrim, 
fdc0: 22 20 22 20 29 0a 09 09 09 7d 20 29 3b 0a 09 09  " " )....} );...
fdd0: 09 73 6f 46 61 72 20 3d 20 73 6f 46 61 72 2e 73  .soFar = soFar.s
fde0: 6c 69 63 65 28 20 6d 61 74 63 68 65 64 2e 6c 65  lice( matched.le
fdf0: 6e 67 74 68 20 29 3b 0a 09 09 7d 0a 0a 09 09 2f  ngth );...}..../
fe00: 2f 20 46 69 6c 74 65 72 73 0a 09 09 66 6f 72 20  / Filters...for 
fe10: 28 20 74 79 70 65 20 69 6e 20 45 78 70 72 2e 66  ( type in Expr.f
fe20: 69 6c 74 65 72 20 29 20 7b 0a 09 09 09 69 66 20  ilter ) {....if 
fe30: 28 20 28 20 6d 61 74 63 68 20 3d 20 6d 61 74 63  ( ( match = matc
fe40: 68 45 78 70 72 5b 20 74 79 70 65 20 5d 2e 65 78  hExpr[ type ].ex
fe50: 65 63 28 20 73 6f 46 61 72 20 29 20 29 20 26 26  ec( soFar ) ) &&
fe60: 20 28 20 21 70 72 65 46 69 6c 74 65 72 73 5b 20   ( !preFilters[ 
fe70: 74 79 70 65 20 5d 20 7c 7c 0a 09 09 09 09 28 20  type ] ||.....( 
fe80: 6d 61 74 63 68 20 3d 20 70 72 65 46 69 6c 74 65  match = preFilte
fe90: 72 73 5b 20 74 79 70 65 20 5d 28 20 6d 61 74 63  rs[ type ]( matc
fea0: 68 20 29 20 29 20 29 20 29 20 7b 0a 09 09 09 09  h ) ) ) ) {.....
feb0: 6d 61 74 63 68 65 64 20 3d 20 6d 61 74 63 68 2e  matched = match.
fec0: 73 68 69 66 74 28 29 3b 0a 09 09 09 09 74 6f 6b  shift();.....tok
fed0: 65 6e 73 2e 70 75 73 68 28 20 7b 0a 09 09 09 09  ens.push( {.....
fee0: 09 76 61 6c 75 65 3a 20 6d 61 74 63 68 65 64 2c  .value: matched,
fef0: 0a 09 09 09 09 09 74 79 70 65 3a 20 74 79 70 65  ......type: type
ff00: 2c 0a 09 09 09 09 09 6d 61 74 63 68 65 73 3a 20  ,......matches: 
ff10: 6d 61 74 63 68 0a 09 09 09 09 7d 20 29 3b 0a 09  match.....} );..
ff20: 09 09 09 73 6f 46 61 72 20 3d 20 73 6f 46 61 72  ...soFar = soFar
ff30: 2e 73 6c 69 63 65 28 20 6d 61 74 63 68 65 64 2e  .slice( matched.
ff40: 6c 65 6e 67 74 68 20 29 3b 0a 09 09 09 7d 0a 09  length );....}..
ff50: 09 7d 0a 0a 09 09 69 66 20 28 20 21 6d 61 74 63  .}....if ( !matc
ff60: 68 65 64 20 29 20 7b 0a 09 09 09 62 72 65 61 6b  hed ) {....break
ff70: 3b 0a 09 09 7d 0a 09 7d 0a 0a 09 2f 2f 20 52 65  ;...}..}...// Re
ff80: 74 75 72 6e 20 74 68 65 20 6c 65 6e 67 74 68 20  turn the length 
ff90: 6f 66 20 74 68 65 20 69 6e 76 61 6c 69 64 20 65  of the invalid e
ffa0: 78 63 65 73 73 0a 09 2f 2f 20 69 66 20 77 65 27  xcess..// if we'
ffb0: 72 65 20 6a 75 73 74 20 70 61 72 73 69 6e 67 0a  re just parsing.
ffc0: 09 2f 2f 20 4f 74 68 65 72 77 69 73 65 2c 20 74  .// Otherwise, t
ffd0: 68 72 6f 77 20 61 6e 20 65 72 72 6f 72 20 6f 72  hrow an error or
ffe0: 20 72 65 74 75 72 6e 20 74 6f 6b 65 6e 73 0a 09   return tokens..
fff0: 72 65 74 75 72 6e 20 70 61 72 73 65 4f 6e 6c 79  return parseOnly
10000 20 3f 0a 09 09 73 6f 46 61 72 2e 6c 65 6e 67 74   ?...soFar.lengt
10010 68 20 3a 0a 09 09 73 6f 46 61 72 20 3f 0a 09 09  h :...soFar ?...
10020 09 53 69 7a 7a 6c 65 2e 65 72 72 6f 72 28 20 73  .Sizzle.error( s
10030 65 6c 65 63 74 6f 72 20 29 20 3a 0a 0a 09 09 09  elector ) :.....
10040 2f 2f 20 43 61 63 68 65 20 74 68 65 20 74 6f 6b  // Cache the tok
10050 65 6e 73 0a 09 09 09 74 6f 6b 65 6e 43 61 63 68  ens....tokenCach
10060 65 28 20 73 65 6c 65 63 74 6f 72 2c 20 67 72 6f  e( selector, gro
10070 75 70 73 20 29 2e 73 6c 69 63 65 28 20 30 20 29  ups ).slice( 0 )
10080 3b 0a 7d 3b 0a 0a 66 75 6e 63 74 69 6f 6e 20 74  ;.};..function t
10090 6f 53 65 6c 65 63 74 6f 72 28 20 74 6f 6b 65 6e  oSelector( token
100a0 73 20 29 20 7b 0a 09 76 61 72 20 69 20 3d 20 30  s ) {..var i = 0
100b0 2c 0a 09 09 6c 65 6e 20 3d 20 74 6f 6b 65 6e 73  ,...len = tokens
100c0 2e 6c 65 6e 67 74 68 2c 0a 09 09 73 65 6c 65 63  .length,...selec
100d0 74 6f 72 20 3d 20 22 22 3b 0a 09 66 6f 72 20 28  tor = "";..for (
100e0 20 3b 20 69 20 3c 20 6c 65 6e 3b 20 69 2b 2b 20   ; i < len; i++ 
100f0 29 20 7b 0a 09 09 73 65 6c 65 63 74 6f 72 20 2b  ) {...selector +
10100 3d 20 74 6f 6b 65 6e 73 5b 20 69 20 5d 2e 76 61  = tokens[ i ].va
10110 6c 75 65 3b 0a 09 7d 0a 09 72 65 74 75 72 6e 20  lue;..}..return 
10120 73 65 6c 65 63 74 6f 72 3b 0a 7d 0a 0a 66 75 6e  selector;.}..fun
10130 63 74 69 6f 6e 20 61 64 64 43 6f 6d 62 69 6e 61  ction addCombina
10140 74 6f 72 28 20 6d 61 74 63 68 65 72 2c 20 63 6f  tor( matcher, co
10150 6d 62 69 6e 61 74 6f 72 2c 20 62 61 73 65 20 29  mbinator, base )
10160 20 7b 0a 09 76 61 72 20 64 69 72 20 3d 20 63 6f   {..var dir = co
10170 6d 62 69 6e 61 74 6f 72 2e 64 69 72 2c 0a 09 09  mbinator.dir,...
10180 73 6b 69 70 20 3d 20 63 6f 6d 62 69 6e 61 74 6f  skip = combinato
10190 72 2e 6e 65 78 74 2c 0a 09 09 6b 65 79 20 3d 20  r.next,...key = 
101a0 73 6b 69 70 20 7c 7c 20 64 69 72 2c 0a 09 09 63  skip || dir,...c
101b0 68 65 63 6b 4e 6f 6e 45 6c 65 6d 65 6e 74 73 20  heckNonElements 
101c0 3d 20 62 61 73 65 20 26 26 20 6b 65 79 20 3d 3d  = base && key ==
101d0 3d 20 22 70 61 72 65 6e 74 4e 6f 64 65 22 2c 0a  = "parentNode",.
101e0 09 09 64 6f 6e 65 4e 61 6d 65 20 3d 20 64 6f 6e  ..doneName = don
101f0 65 2b 2b 3b 0a 0a 09 72 65 74 75 72 6e 20 63 6f  e++;...return co
10200 6d 62 69 6e 61 74 6f 72 2e 66 69 72 73 74 20 3f  mbinator.first ?
10210 0a 0a 09 09 2f 2f 20 43 68 65 63 6b 20 61 67 61  ....// Check aga
10220 69 6e 73 74 20 63 6c 6f 73 65 73 74 20 61 6e 63  inst closest anc
10230 65 73 74 6f 72 2f 70 72 65 63 65 64 69 6e 67 20  estor/preceding 
10240 65 6c 65 6d 65 6e 74 0a 09 09 66 75 6e 63 74 69  element...functi
10250 6f 6e 28 20 65 6c 65 6d 2c 20 63 6f 6e 74 65 78  on( elem, contex
10260 74 2c 20 78 6d 6c 20 29 20 7b 0a 09 09 09 77 68  t, xml ) {....wh
10270 69 6c 65 20 28 20 28 20 65 6c 65 6d 20 3d 20 65  ile ( ( elem = e
10280 6c 65 6d 5b 20 64 69 72 20 5d 20 29 20 29 20 7b  lem[ dir ] ) ) {
10290 0a 09 09 09 09 69 66 20 28 20 65 6c 65 6d 2e 6e  .....if ( elem.n
102a0 6f 64 65 54 79 70 65 20 3d 3d 3d 20 31 20 7c 7c  odeType === 1 ||
102b0 20 63 68 65 63 6b 4e 6f 6e 45 6c 65 6d 65 6e 74   checkNonElement
102c0 73 20 29 20 7b 0a 09 09 09 09 09 72 65 74 75 72  s ) {......retur
102d0 6e 20 6d 61 74 63 68 65 72 28 20 65 6c 65 6d 2c  n matcher( elem,
102e0 20 63 6f 6e 74 65 78 74 2c 20 78 6d 6c 20 29 3b   context, xml );
102f0 0a 09 09 09 09 7d 0a 09 09 09 7d 0a 09 09 09 72  .....}....}....r
10300 65 74 75 72 6e 20 66 61 6c 73 65 3b 0a 09 09 7d  eturn false;...}
10310 20 3a 0a 0a 09 09 2f 2f 20 43 68 65 63 6b 20 61   :....// Check a
10320 67 61 69 6e 73 74 20 61 6c 6c 20 61 6e 63 65 73  gainst all ances
10330 74 6f 72 2f 70 72 65 63 65 64 69 6e 67 20 65 6c  tor/preceding el
10340 65 6d 65 6e 74 73 0a 09 09 66 75 6e 63 74 69 6f  ements...functio
10350 6e 28 20 65 6c 65 6d 2c 20 63 6f 6e 74 65 78 74  n( elem, context
10360 2c 20 78 6d 6c 20 29 20 7b 0a 09 09 09 76 61 72  , xml ) {....var
10370 20 6f 6c 64 43 61 63 68 65 2c 20 75 6e 69 71 75   oldCache, uniqu
10380 65 43 61 63 68 65 2c 20 6f 75 74 65 72 43 61 63  eCache, outerCac
10390 68 65 2c 0a 09 09 09 09 6e 65 77 43 61 63 68 65  he,.....newCache
103a0 20 3d 20 5b 20 64 69 72 72 75 6e 73 2c 20 64 6f   = [ dirruns, do
103b0 6e 65 4e 61 6d 65 20 5d 3b 0a 0a 09 09 09 2f 2f  neName ];.....//
103c0 20 57 65 20 63 61 6e 27 74 20 73 65 74 20 61 72   We can't set ar
103d0 62 69 74 72 61 72 79 20 64 61 74 61 20 6f 6e 20  bitrary data on 
103e0 58 4d 4c 20 6e 6f 64 65 73 2c 20 73 6f 20 74 68  XML nodes, so th
103f0 65 79 20 64 6f 6e 27 74 20 62 65 6e 65 66 69 74  ey don't benefit
10400 20 66 72 6f 6d 20 63 6f 6d 62 69 6e 61 74 6f 72   from combinator
10410 20 63 61 63 68 69 6e 67 0a 09 09 09 69 66 20 28   caching....if (
10420 20 78 6d 6c 20 29 20 7b 0a 09 09 09 09 77 68 69   xml ) {.....whi
10430 6c 65 20 28 20 28 20 65 6c 65 6d 20 3d 20 65 6c  le ( ( elem = el
10440 65 6d 5b 20 64 69 72 20 5d 20 29 20 29 20 7b 0a  em[ dir ] ) ) {.
10450 09 09 09 09 09 69 66 20 28 20 65 6c 65 6d 2e 6e  .....if ( elem.n
10460 6f 64 65 54 79 70 65 20 3d 3d 3d 20 31 20 7c 7c  odeType === 1 ||
10470 20 63 68 65 63 6b 4e 6f 6e 45 6c 65 6d 65 6e 74   checkNonElement
10480 73 20 29 20 7b 0a 09 09 09 09 09 09 69 66 20 28  s ) {.......if (
10490 20 6d 61 74 63 68 65 72 28 20 65 6c 65 6d 2c 20   matcher( elem, 
104a0 63 6f 6e 74 65 78 74 2c 20 78 6d 6c 20 29 20 29  context, xml ) )
104b0 20 7b 0a 09 09 09 09 09 09 09 72 65 74 75 72 6e   {........return
104c0 20 74 72 75 65 3b 0a 09 09 09 09 09 09 7d 0a 09   true;.......}..
104d0 09 09 09 09 7d 0a 09 09 09 09 7d 0a 09 09 09 7d  ....}.....}....}
104e0 20 65 6c 73 65 20 7b 0a 09 09 09 09 77 68 69 6c   else {.....whil
104f0 65 20 28 20 28 20 65 6c 65 6d 20 3d 20 65 6c 65  e ( ( elem = ele
10500 6d 5b 20 64 69 72 20 5d 20 29 20 29 20 7b 0a 09  m[ dir ] ) ) {..
10510 09 09 09 09 69 66 20 28 20 65 6c 65 6d 2e 6e 6f  ....if ( elem.no
10520 64 65 54 79 70 65 20 3d 3d 3d 20 31 20 7c 7c 20  deType === 1 || 
10530 63 68 65 63 6b 4e 6f 6e 45 6c 65 6d 65 6e 74 73  checkNonElements
10540 20 29 20 7b 0a 09 09 09 09 09 09 6f 75 74 65 72   ) {.......outer
10550 43 61 63 68 65 20 3d 20 65 6c 65 6d 5b 20 65 78  Cache = elem[ ex
10560 70 61 6e 64 6f 20 5d 20 7c 7c 20 28 20 65 6c 65  pando ] || ( ele
10570 6d 5b 20 65 78 70 61 6e 64 6f 20 5d 20 3d 20 7b  m[ expando ] = {
10580 7d 20 29 3b 0a 0a 09 09 09 09 09 09 2f 2f 20 53  } );........// S
10590 75 70 70 6f 72 74 3a 20 49 45 20 3c 39 20 6f 6e  upport: IE <9 on
105a0 6c 79 0a 09 09 09 09 09 09 2f 2f 20 44 65 66 65  ly.......// Defe
105b0 6e 64 20 61 67 61 69 6e 73 74 20 63 6c 6f 6e 65  nd against clone
105c0 64 20 61 74 74 72 6f 70 65 72 74 69 65 73 20 28  d attroperties (
105d0 6a 51 75 65 72 79 20 67 68 2d 31 37 30 39 29 0a  jQuery gh-1709).
105e0 09 09 09 09 09 09 75 6e 69 71 75 65 43 61 63 68  ......uniqueCach
105f0 65 20 3d 20 6f 75 74 65 72 43 61 63 68 65 5b 20  e = outerCache[ 
10600 65 6c 65 6d 2e 75 6e 69 71 75 65 49 44 20 5d 20  elem.uniqueID ] 
10610 7c 7c 0a 09 09 09 09 09 09 09 28 20 6f 75 74 65  ||........( oute
10620 72 43 61 63 68 65 5b 20 65 6c 65 6d 2e 75 6e 69  rCache[ elem.uni
10630 71 75 65 49 44 20 5d 20 3d 20 7b 7d 20 29 3b 0a  queID ] = {} );.
10640 0a 09 09 09 09 09 09 69 66 20 28 20 73 6b 69 70  .......if ( skip
10650 20 26 26 20 73 6b 69 70 20 3d 3d 3d 20 65 6c 65   && skip === ele
10660 6d 2e 6e 6f 64 65 4e 61 6d 65 2e 74 6f 4c 6f 77  m.nodeName.toLow
10670 65 72 43 61 73 65 28 29 20 29 20 7b 0a 09 09 09  erCase() ) {....
10680 09 09 09 09 65 6c 65 6d 20 3d 20 65 6c 65 6d 5b  ....elem = elem[
10690 20 64 69 72 20 5d 20 7c 7c 20 65 6c 65 6d 3b 0a   dir ] || elem;.
106a0 09 09 09 09 09 09 7d 20 65 6c 73 65 20 69 66 20  ......} else if 
106b0 28 20 28 20 6f 6c 64 43 61 63 68 65 20 3d 20 75  ( ( oldCache = u
106c0 6e 69 71 75 65 43 61 63 68 65 5b 20 6b 65 79 20  niqueCache[ key 
106d0 5d 20 29 20 26 26 0a 09 09 09 09 09 09 09 6f 6c  ] ) &&........ol
106e0 64 43 61 63 68 65 5b 20 30 20 5d 20 3d 3d 3d 20  dCache[ 0 ] === 
106f0 64 69 72 72 75 6e 73 20 26 26 20 6f 6c 64 43 61  dirruns && oldCa
10700 63 68 65 5b 20 31 20 5d 20 3d 3d 3d 20 64 6f 6e  che[ 1 ] === don
10710 65 4e 61 6d 65 20 29 20 7b 0a 0a 09 09 09 09 09  eName ) {.......
10720 09 09 2f 2f 20 41 73 73 69 67 6e 20 74 6f 20 6e  ..// Assign to n
10730 65 77 43 61 63 68 65 20 73 6f 20 72 65 73 75 6c  ewCache so resul
10740 74 73 20 62 61 63 6b 2d 70 72 6f 70 61 67 61 74  ts back-propagat
10750 65 20 74 6f 20 70 72 65 76 69 6f 75 73 20 65 6c  e to previous el
10760 65 6d 65 6e 74 73 0a 09 09 09 09 09 09 09 72 65  ements........re
10770 74 75 72 6e 20 28 20 6e 65 77 43 61 63 68 65 5b  turn ( newCache[
10780 20 32 20 5d 20 3d 20 6f 6c 64 43 61 63 68 65 5b   2 ] = oldCache[
10790 20 32 20 5d 20 29 3b 0a 09 09 09 09 09 09 7d 20   2 ] );.......} 
107a0 65 6c 73 65 20 7b 0a 0a 09 09 09 09 09 09 09 2f  else {........./
107b0 2f 20 52 65 75 73 65 20 6e 65 77 63 61 63 68 65  / Reuse newcache
107c0 20 73 6f 20 72 65 73 75 6c 74 73 20 62 61 63 6b   so results back
107d0 2d 70 72 6f 70 61 67 61 74 65 20 74 6f 20 70 72  -propagate to pr
107e0 65 76 69 6f 75 73 20 65 6c 65 6d 65 6e 74 73 0a  evious elements.
107f0 09 09 09 09 09 09 09 75 6e 69 71 75 65 43 61 63  .......uniqueCac
10800 68 65 5b 20 6b 65 79 20 5d 20 3d 20 6e 65 77 43  he[ key ] = newC
10810 61 63 68 65 3b 0a 0a 09 09 09 09 09 09 09 2f 2f  ache;.........//
10820 20 41 20 6d 61 74 63 68 20 6d 65 61 6e 73 20 77   A match means w
10830 65 27 72 65 20 64 6f 6e 65 3b 20 61 20 66 61 69  e're done; a fai
10840 6c 20 6d 65 61 6e 73 20 77 65 20 68 61 76 65 20  l means we have 
10850 74 6f 20 6b 65 65 70 20 63 68 65 63 6b 69 6e 67  to keep checking
10860 0a 09 09 09 09 09 09 09 69 66 20 28 20 28 20 6e  ........if ( ( n
10870 65 77 43 61 63 68 65 5b 20 32 20 5d 20 3d 20 6d  ewCache[ 2 ] = m
10880 61 74 63 68 65 72 28 20 65 6c 65 6d 2c 20 63 6f  atcher( elem, co
10890 6e 74 65 78 74 2c 20 78 6d 6c 20 29 20 29 20 29  ntext, xml ) ) )
108a0 20 7b 0a 09 09 09 09 09 09 09 09 72 65 74 75 72   {.........retur
108b0 6e 20 74 72 75 65 3b 0a 09 09 09 09 09 09 09 7d  n true;........}
108c0 0a 09 09 09 09 09 09 7d 0a 09 09 09 09 09 7d 0a  .......}......}.
108d0 09 09 09 09 7d 0a 09 09 09 7d 0a 09 09 09 72 65  ....}....}....re
108e0 74 75 72 6e 20 66 61 6c 73 65 3b 0a 09 09 7d 3b  turn false;...};
108f0 0a 7d 0a 0a 66 75 6e 63 74 69 6f 6e 20 65 6c 65  .}..function ele
10900 6d 65 6e 74 4d 61 74 63 68 65 72 28 20 6d 61 74  mentMatcher( mat
10910 63 68 65 72 73 20 29 20 7b 0a 09 72 65 74 75 72  chers ) {..retur
10920 6e 20 6d 61 74 63 68 65 72 73 2e 6c 65 6e 67 74  n matchers.lengt
10930 68 20 3e 20 31 20 3f 0a 09 09 66 75 6e 63 74 69  h > 1 ?...functi
10940 6f 6e 28 20 65 6c 65 6d 2c 20 63 6f 6e 74 65 78  on( elem, contex
10950 74 2c 20 78 6d 6c 20 29 20 7b 0a 09 09 09 76 61  t, xml ) {....va
10960 72 20 69 20 3d 20 6d 61 74 63 68 65 72 73 2e 6c  r i = matchers.l
10970 65 6e 67 74 68 3b 0a 09 09 09 77 68 69 6c 65 20  ength;....while 
10980 28 20 69 2d 2d 20 29 20 7b 0a 09 09 09 09 69 66  ( i-- ) {.....if
10990 20 28 20 21 6d 61 74 63 68 65 72 73 5b 20 69 20   ( !matchers[ i 
109a0 5d 28 20 65 6c 65 6d 2c 20 63 6f 6e 74 65 78 74  ]( elem, context
109b0 2c 20 78 6d 6c 20 29 20 29 20 7b 0a 09 09 09 09  , xml ) ) {.....
109c0 09 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0a 09  .return false;..
109d0 09 09 09 7d 0a 09 09 09 7d 0a 09 09 09 72 65 74  ...}....}....ret
109e0 75 72 6e 20 74 72 75 65 3b 0a 09 09 7d 20 3a 0a  urn true;...} :.
109f0 09 09 6d 61 74 63 68 65 72 73 5b 20 30 20 5d 3b  ..matchers[ 0 ];
10a00 0a 7d 0a 0a 66 75 6e 63 74 69 6f 6e 20 6d 75 6c  .}..function mul
10a10 74 69 70 6c 65 43 6f 6e 74 65 78 74 73 28 20 73  tipleContexts( s
10a20 65 6c 65 63 74 6f 72 2c 20 63 6f 6e 74 65 78 74  elector, context
10a30 73 2c 20 72 65 73 75 6c 74 73 20 29 20 7b 0a 09  s, results ) {..
10a40 76 61 72 20 69 20 3d 20 30 2c 0a 09 09 6c 65 6e  var i = 0,...len
10a50 20 3d 20 63 6f 6e 74 65 78 74 73 2e 6c 65 6e 67   = contexts.leng
10a60 74 68 3b 0a 09 66 6f 72 20 28 20 3b 20 69 20 3c  th;..for ( ; i <
10a70 20 6c 65 6e 3b 20 69 2b 2b 20 29 20 7b 0a 09 09   len; i++ ) {...
10a80 53 69 7a 7a 6c 65 28 20 73 65 6c 65 63 74 6f 72  Sizzle( selector
10a90 2c 20 63 6f 6e 74 65 78 74 73 5b 20 69 20 5d 2c  , contexts[ i ],
10aa0 20 72 65 73 75 6c 74 73 20 29 3b 0a 09 7d 0a 09   results );..}..
10ab0 72 65 74 75 72 6e 20 72 65 73 75 6c 74 73 3b 0a  return results;.
10ac0 7d 0a 0a 66 75 6e 63 74 69 6f 6e 20 63 6f 6e 64  }..function cond
10ad0 65 6e 73 65 28 20 75 6e 6d 61 74 63 68 65 64 2c  ense( unmatched,
10ae0 20 6d 61 70 2c 20 66 69 6c 74 65 72 2c 20 63 6f   map, filter, co
10af0 6e 74 65 78 74 2c 20 78 6d 6c 20 29 20 7b 0a 09  ntext, xml ) {..
10b00 76 61 72 20 65 6c 65 6d 2c 0a 09 09 6e 65 77 55  var elem,...newU
10b10 6e 6d 61 74 63 68 65 64 20 3d 20 5b 5d 2c 0a 09  nmatched = [],..
10b20 09 69 20 3d 20 30 2c 0a 09 09 6c 65 6e 20 3d 20  .i = 0,...len = 
10b30 75 6e 6d 61 74 63 68 65 64 2e 6c 65 6e 67 74 68  unmatched.length
10b40 2c 0a 09 09 6d 61 70 70 65 64 20 3d 20 6d 61 70  ,...mapped = map
10b50 20 21 3d 20 6e 75 6c 6c 3b 0a 0a 09 66 6f 72 20   != null;...for 
10b60 28 20 3b 20 69 20 3c 20 6c 65 6e 3b 20 69 2b 2b  ( ; i < len; i++
10b70 20 29 20 7b 0a 09 09 69 66 20 28 20 28 20 65 6c   ) {...if ( ( el
10b80 65 6d 20 3d 20 75 6e 6d 61 74 63 68 65 64 5b 20  em = unmatched[ 
10b90 69 20 5d 20 29 20 29 20 7b 0a 09 09 09 69 66 20  i ] ) ) {....if 
10ba0 28 20 21 66 69 6c 74 65 72 20 7c 7c 20 66 69 6c  ( !filter || fil
10bb0 74 65 72 28 20 65 6c 65 6d 2c 20 63 6f 6e 74 65  ter( elem, conte
10bc0 78 74 2c 20 78 6d 6c 20 29 20 29 20 7b 0a 09 09  xt, xml ) ) {...
10bd0 09 09 6e 65 77 55 6e 6d 61 74 63 68 65 64 2e 70  ..newUnmatched.p
10be0 75 73 68 28 20 65 6c 65 6d 20 29 3b 0a 09 09 09  ush( elem );....
10bf0 09 69 66 20 28 20 6d 61 70 70 65 64 20 29 20 7b  .if ( mapped ) {
10c00 0a 09 09 09 09 09 6d 61 70 2e 70 75 73 68 28 20  ......map.push( 
10c10 69 20 29 3b 0a 09 09 09 09 7d 0a 09 09 09 7d 0a  i );.....}....}.
10c20 09 09 7d 0a 09 7d 0a 0a 09 72 65 74 75 72 6e 20  ..}..}...return 
10c30 6e 65 77 55 6e 6d 61 74 63 68 65 64 3b 0a 7d 0a  newUnmatched;.}.
10c40 0a 66 75 6e 63 74 69 6f 6e 20 73 65 74 4d 61 74  .function setMat
10c50 63 68 65 72 28 20 70 72 65 46 69 6c 74 65 72 2c  cher( preFilter,
10c60 20 73 65 6c 65 63 74 6f 72 2c 20 6d 61 74 63 68   selector, match
10c70 65 72 2c 20 70 6f 73 74 46 69 6c 74 65 72 2c 20  er, postFilter, 
10c80 70 6f 73 74 46 69 6e 64 65 72 2c 20 70 6f 73 74  postFinder, post
10c90 53 65 6c 65 63 74 6f 72 20 29 20 7b 0a 09 69 66  Selector ) {..if
10ca0 20 28 20 70 6f 73 74 46 69 6c 74 65 72 20 26 26   ( postFilter &&
10cb0 20 21 70 6f 73 74 46 69 6c 74 65 72 5b 20 65 78   !postFilter[ ex
10cc0 70 61 6e 64 6f 20 5d 20 29 20 7b 0a 09 09 70 6f  pando ] ) {...po
10cd0 73 74 46 69 6c 74 65 72 20 3d 20 73 65 74 4d 61  stFilter = setMa
10ce0 74 63 68 65 72 28 20 70 6f 73 74 46 69 6c 74 65  tcher( postFilte
10cf0 72 20 29 3b 0a 09 7d 0a 09 69 66 20 28 20 70 6f  r );..}..if ( po
10d00 73 74 46 69 6e 64 65 72 20 26 26 20 21 70 6f 73  stFinder && !pos
10d10 74 46 69 6e 64 65 72 5b 20 65 78 70 61 6e 64 6f  tFinder[ expando
10d20 20 5d 20 29 20 7b 0a 09 09 70 6f 73 74 46 69 6e   ] ) {...postFin
10d30 64 65 72 20 3d 20 73 65 74 4d 61 74 63 68 65 72  der = setMatcher
10d40 28 20 70 6f 73 74 46 69 6e 64 65 72 2c 20 70 6f  ( postFinder, po
10d50 73 74 53 65 6c 65 63 74 6f 72 20 29 3b 0a 09 7d  stSelector );..}
10d60 0a 09 72 65 74 75 72 6e 20 6d 61 72 6b 46 75 6e  ..return markFun
10d70 63 74 69 6f 6e 28 20 66 75 6e 63 74 69 6f 6e 28  ction( function(
10d80 20 73 65 65 64 2c 20 72 65 73 75 6c 74 73 2c 20   seed, results, 
10d90 63 6f 6e 74 65 78 74 2c 20 78 6d 6c 20 29 20 7b  context, xml ) {
10da0 0a 09 09 76 61 72 20 74 65 6d 70 2c 20 69 2c 20  ...var temp, i, 
10db0 65 6c 65 6d 2c 0a 09 09 09 70 72 65 4d 61 70 20  elem,....preMap 
10dc0 3d 20 5b 5d 2c 0a 09 09 09 70 6f 73 74 4d 61 70  = [],....postMap
10dd0 20 3d 20 5b 5d 2c 0a 09 09 09 70 72 65 65 78 69   = [],....preexi
10de0 73 74 69 6e 67 20 3d 20 72 65 73 75 6c 74 73 2e  sting = results.
10df0 6c 65 6e 67 74 68 2c 0a 0a 09 09 09 2f 2f 20 47  length,.....// G
10e00 65 74 20 69 6e 69 74 69 61 6c 20 65 6c 65 6d 65  et initial eleme
10e10 6e 74 73 20 66 72 6f 6d 20 73 65 65 64 20 6f 72  nts from seed or
10e20 20 63 6f 6e 74 65 78 74 0a 09 09 09 65 6c 65 6d   context....elem
10e30 73 20 3d 20 73 65 65 64 20 7c 7c 20 6d 75 6c 74  s = seed || mult
10e40 69 70 6c 65 43 6f 6e 74 65 78 74 73 28 0a 09 09  ipleContexts(...
10e50 09 09 73 65 6c 65 63 74 6f 72 20 7c 7c 20 22 2a  ..selector || "*
10e60 22 2c 0a 09 09 09 09 63 6f 6e 74 65 78 74 2e 6e  ",.....context.n
10e70 6f 64 65 54 79 70 65 20 3f 20 5b 20 63 6f 6e 74  odeType ? [ cont
10e80 65 78 74 20 5d 20 3a 20 63 6f 6e 74 65 78 74 2c  ext ] : context,
10e90 0a 09 09 09 09 5b 5d 0a 09 09 09 29 2c 0a 0a 09  .....[]....),...
10ea0 09 09 2f 2f 20 50 72 65 66 69 6c 74 65 72 20 74  ..// Prefilter t
10eb0 6f 20 67 65 74 20 6d 61 74 63 68 65 72 20 69 6e  o get matcher in
10ec0 70 75 74 2c 20 70 72 65 73 65 72 76 69 6e 67 20  put, preserving 
10ed0 61 20 6d 61 70 20 66 6f 72 20 73 65 65 64 2d 72  a map for seed-r
10ee0 65 73 75 6c 74 73 20 73 79 6e 63 68 72 6f 6e 69  esults synchroni
10ef0 7a 61 74 69 6f 6e 0a 09 09 09 6d 61 74 63 68 65  zation....matche
10f00 72 49 6e 20 3d 20 70 72 65 46 69 6c 74 65 72 20  rIn = preFilter 
10f10 26 26 20 28 20 73 65 65 64 20 7c 7c 20 21 73 65  && ( seed || !se
10f20 6c 65 63 74 6f 72 20 29 20 3f 0a 09 09 09 09 63  lector ) ?.....c
10f30 6f 6e 64 65 6e 73 65 28 20 65 6c 65 6d 73 2c 20  ondense( elems, 
10f40 70 72 65 4d 61 70 2c 20 70 72 65 46 69 6c 74 65  preMap, preFilte
10f50 72 2c 20 63 6f 6e 74 65 78 74 2c 20 78 6d 6c 20  r, context, xml 
10f60 29 20 3a 0a 09 09 09 09 65 6c 65 6d 73 2c 0a 0a  ) :.....elems,..
10f70 09 09 09 6d 61 74 63 68 65 72 4f 75 74 20 3d 20  ...matcherOut = 
10f80 6d 61 74 63 68 65 72 20 3f 0a 0a 09 09 09 09 2f  matcher ?....../
10f90 2f 20 49 66 20 77 65 20 68 61 76 65 20 61 20 70  / If we have a p
10fa0 6f 73 74 46 69 6e 64 65 72 2c 20 6f 72 20 66 69  ostFinder, or fi
10fb0 6c 74 65 72 65 64 20 73 65 65 64 2c 20 6f 72 20  ltered seed, or 
10fc0 6e 6f 6e 2d 73 65 65 64 20 70 6f 73 74 46 69 6c  non-seed postFil
10fd0 74 65 72 20 6f 72 20 70 72 65 65 78 69 73 74 69  ter or preexisti
10fe0 6e 67 20 72 65 73 75 6c 74 73 2c 0a 09 09 09 09  ng results,.....
10ff0 70 6f 73 74 46 69 6e 64 65 72 20 7c 7c 20 28 20  postFinder || ( 
11000 73 65 65 64 20 3f 20 70 72 65 46 69 6c 74 65 72  seed ? preFilter
11010 20 3a 20 70 72 65 65 78 69 73 74 69 6e 67 20 7c   : preexisting |
11020 7c 20 70 6f 73 74 46 69 6c 74 65 72 20 29 20 3f  | postFilter ) ?
11030 0a 0a 09 09 09 09 09 2f 2f 20 2e 2e 2e 69 6e 74  .......// ...int
11040 65 72 6d 65 64 69 61 74 65 20 70 72 6f 63 65 73  ermediate proces
11050 73 69 6e 67 20 69 73 20 6e 65 63 65 73 73 61 72  sing is necessar
11060 79 0a 09 09 09 09 09 5b 5d 20 3a 0a 0a 09 09 09  y......[] :.....
11070 09 09 2f 2f 20 2e 2e 2e 6f 74 68 65 72 77 69 73  ..// ...otherwis
11080 65 20 75 73 65 20 72 65 73 75 6c 74 73 20 64 69  e use results di
11090 72 65 63 74 6c 79 0a 09 09 09 09 09 72 65 73 75  rectly......resu
110a0 6c 74 73 20 3a 0a 09 09 09 09 6d 61 74 63 68 65  lts :.....matche
110b0 72 49 6e 3b 0a 0a 09 09 2f 2f 20 46 69 6e 64 20  rIn;....// Find 
110c0 70 72 69 6d 61 72 79 20 6d 61 74 63 68 65 73 0a  primary matches.
110d0 09 09 69 66 20 28 20 6d 61 74 63 68 65 72 20 29  ..if ( matcher )
110e0 20 7b 0a 09 09 09 6d 61 74 63 68 65 72 28 20 6d   {....matcher( m
110f0 61 74 63 68 65 72 49 6e 2c 20 6d 61 74 63 68 65  atcherIn, matche
11100 72 4f 75 74 2c 20 63 6f 6e 74 65 78 74 2c 20 78  rOut, context, x
11110 6d 6c 20 29 3b 0a 09 09 7d 0a 0a 09 09 2f 2f 20  ml );...}....// 
11120 41 70 70 6c 79 20 70 6f 73 74 46 69 6c 74 65 72  Apply postFilter
11130 0a 09 09 69 66 20 28 20 70 6f 73 74 46 69 6c 74  ...if ( postFilt
11140 65 72 20 29 20 7b 0a 09 09 09 74 65 6d 70 20 3d  er ) {....temp =
11150 20 63 6f 6e 64 65 6e 73 65 28 20 6d 61 74 63 68   condense( match
11160 65 72 4f 75 74 2c 20 70 6f 73 74 4d 61 70 20 29  erOut, postMap )
11170 3b 0a 09 09 09 70 6f 73 74 46 69 6c 74 65 72 28  ;....postFilter(
11180 20 74 65 6d 70 2c 20 5b 5d 2c 20 63 6f 6e 74 65   temp, [], conte
11190 78 74 2c 20 78 6d 6c 20 29 3b 0a 0a 09 09 09 2f  xt, xml );...../
111a0 2f 20 55 6e 2d 6d 61 74 63 68 20 66 61 69 6c 69  / Un-match faili
111b0 6e 67 20 65 6c 65 6d 65 6e 74 73 20 62 79 20 6d  ng elements by m
111c0 6f 76 69 6e 67 20 74 68 65 6d 20 62 61 63 6b 20  oving them back 
111d0 74 6f 20 6d 61 74 63 68 65 72 49 6e 0a 09 09 09  to matcherIn....
111e0 69 20 3d 20 74 65 6d 70 2e 6c 65 6e 67 74 68 3b  i = temp.length;
111f0 0a 09 09 09 77 68 69 6c 65 20 28 20 69 2d 2d 20  ....while ( i-- 
11200 29 20 7b 0a 09 09 09 09 69 66 20 28 20 28 20 65  ) {.....if ( ( e
11210 6c 65 6d 20 3d 20 74 65 6d 70 5b 20 69 20 5d 20  lem = temp[ i ] 
11220 29 20 29 20 7b 0a 09 09 09 09 09 6d 61 74 63 68  ) ) {......match
11230 65 72 4f 75 74 5b 20 70 6f 73 74 4d 61 70 5b 20  erOut[ postMap[ 
11240 69 20 5d 20 5d 20 3d 20 21 28 20 6d 61 74 63 68  i ] ] = !( match
11250 65 72 49 6e 5b 20 70 6f 73 74 4d 61 70 5b 20 69  erIn[ postMap[ i
11260 20 5d 20 5d 20 3d 20 65 6c 65 6d 20 29 3b 0a 09   ] ] = elem );..
11270 09 09 09 7d 0a 09 09 09 7d 0a 09 09 7d 0a 0a 09  ...}....}...}...
11280 09 69 66 20 28 20 73 65 65 64 20 29 20 7b 0a 09  .if ( seed ) {..
11290 09 09 69 66 20 28 20 70 6f 73 74 46 69 6e 64 65  ..if ( postFinde
112a0 72 20 7c 7c 20 70 72 65 46 69 6c 74 65 72 20 29  r || preFilter )
112b0 20 7b 0a 09 09 09 09 69 66 20 28 20 70 6f 73 74   {.....if ( post
112c0 46 69 6e 64 65 72 20 29 20 7b 0a 0a 09 09 09 09  Finder ) {......
112d0 09 2f 2f 20 47 65 74 20 74 68 65 20 66 69 6e 61  .// Get the fina
112e0 6c 20 6d 61 74 63 68 65 72 4f 75 74 20 62 79 20  l matcherOut by 
112f0 63 6f 6e 64 65 6e 73 69 6e 67 20 74 68 69 73 20  condensing this 
11300 69 6e 74 65 72 6d 65 64 69 61 74 65 20 69 6e 74  intermediate int
11310 6f 20 70 6f 73 74 46 69 6e 64 65 72 20 63 6f 6e  o postFinder con
11320 74 65 78 74 73 0a 09 09 09 09 09 74 65 6d 70 20  texts......temp 
11330 3d 20 5b 5d 3b 0a 09 09 09 09 09 69 20 3d 20 6d  = [];......i = m
11340 61 74 63 68 65 72 4f 75 74 2e 6c 65 6e 67 74 68  atcherOut.length
11350 3b 0a 09 09 09 09 09 77 68 69 6c 65 20 28 20 69  ;......while ( i
11360 2d 2d 20 29 20 7b 0a 09 09 09 09 09 09 69 66 20  -- ) {.......if 
11370 28 20 28 20 65 6c 65 6d 20 3d 20 6d 61 74 63 68  ( ( elem = match
11380 65 72 4f 75 74 5b 20 69 20 5d 20 29 20 29 20 7b  erOut[ i ] ) ) {
11390 0a 0a 09 09 09 09 09 09 09 2f 2f 20 52 65 73 74  .........// Rest
113a0 6f 72 65 20 6d 61 74 63 68 65 72 49 6e 20 73 69  ore matcherIn si
113b0 6e 63 65 20 65 6c 65 6d 20 69 73 20 6e 6f 74 20  nce elem is not 
113c0 79 65 74 20 61 20 66 69 6e 61 6c 20 6d 61 74 63  yet a final matc
113d0 68 0a 09 09 09 09 09 09 09 74 65 6d 70 2e 70 75  h........temp.pu
113e0 73 68 28 20 28 20 6d 61 74 63 68 65 72 49 6e 5b  sh( ( matcherIn[
113f0 20 69 20 5d 20 3d 20 65 6c 65 6d 20 29 20 29 3b   i ] = elem ) );
11400 0a 09 09 09 09 09 09 7d 0a 09 09 09 09 09 7d 0a  .......}......}.
11410 09 09 09 09 09 70 6f 73 74 46 69 6e 64 65 72 28  .....postFinder(
11420 20 6e 75 6c 6c 2c 20 28 20 6d 61 74 63 68 65 72   null, ( matcher
11430 4f 75 74 20 3d 20 5b 5d 20 29 2c 20 74 65 6d 70  Out = [] ), temp
11440 2c 20 78 6d 6c 20 29 3b 0a 09 09 09 09 7d 0a 0a  , xml );.....}..
11450 09 09 09 09 2f 2f 20 4d 6f 76 65 20 6d 61 74 63  ....// Move matc
11460 68 65 64 20 65 6c 65 6d 65 6e 74 73 20 66 72 6f  hed elements fro
11470 6d 20 73 65 65 64 20 74 6f 20 72 65 73 75 6c 74  m seed to result
11480 73 20 74 6f 20 6b 65 65 70 20 74 68 65 6d 20 73  s to keep them s
11490 79 6e 63 68 72 6f 6e 69 7a 65 64 0a 09 09 09 09  ynchronized.....
114a0 69 20 3d 20 6d 61 74 63 68 65 72 4f 75 74 2e 6c  i = matcherOut.l
114b0 65 6e 67 74 68 3b 0a 09 09 09 09 77 68 69 6c 65  ength;.....while
114c0 20 28 20 69 2d 2d 20 29 20 7b 0a 09 09 09 09 09   ( i-- ) {......
114d0 69 66 20 28 20 28 20 65 6c 65 6d 20 3d 20 6d 61  if ( ( elem = ma
114e0 74 63 68 65 72 4f 75 74 5b 20 69 20 5d 20 29 20  tcherOut[ i ] ) 
114f0 26 26 0a 09 09 09 09 09 09 28 20 74 65 6d 70 20  &&.......( temp 
11500 3d 20 70 6f 73 74 46 69 6e 64 65 72 20 3f 20 69  = postFinder ? i
11510 6e 64 65 78 4f 66 28 20 73 65 65 64 2c 20 65 6c  ndexOf( seed, el
11520 65 6d 20 29 20 3a 20 70 72 65 4d 61 70 5b 20 69  em ) : preMap[ i
11530 20 5d 20 29 20 3e 20 2d 31 20 29 20 7b 0a 0a 09   ] ) > -1 ) {...
11540 09 09 09 09 09 73 65 65 64 5b 20 74 65 6d 70 20  .....seed[ temp 
11550 5d 20 3d 20 21 28 20 72 65 73 75 6c 74 73 5b 20  ] = !( results[ 
11560 74 65 6d 70 20 5d 20 3d 20 65 6c 65 6d 20 29 3b  temp ] = elem );
11570 0a 09 09 09 09 09 7d 0a 09 09 09 09 7d 0a 09 09  ......}.....}...
11580 09 7d 0a 0a 09 09 2f 2f 20 41 64 64 20 65 6c 65  .}....// Add ele
11590 6d 65 6e 74 73 20 74 6f 20 72 65 73 75 6c 74 73  ments to results
115a0 2c 20 74 68 72 6f 75 67 68 20 70 6f 73 74 46 69  , through postFi
115b0 6e 64 65 72 20 69 66 20 64 65 66 69 6e 65 64 0a  nder if defined.
115c0 09 09 7d 20 65 6c 73 65 20 7b 0a 09 09 09 6d 61  ..} else {....ma
115d0 74 63 68 65 72 4f 75 74 20 3d 20 63 6f 6e 64 65  tcherOut = conde
115e0 6e 73 65 28 0a 09 09 09 09 6d 61 74 63 68 65 72  nse(.....matcher
115f0 4f 75 74 20 3d 3d 3d 20 72 65 73 75 6c 74 73 20  Out === results 
11600 3f 0a 09 09 09 09 09 6d 61 74 63 68 65 72 4f 75  ?......matcherOu
11610 74 2e 73 70 6c 69 63 65 28 20 70 72 65 65 78 69  t.splice( preexi
11620 73 74 69 6e 67 2c 20 6d 61 74 63 68 65 72 4f 75  sting, matcherOu
11630 74 2e 6c 65 6e 67 74 68 20 29 20 3a 0a 09 09 09  t.length ) :....
11640 09 09 6d 61 74 63 68 65 72 4f 75 74 0a 09 09 09  ..matcherOut....
11650 29 3b 0a 09 09 09 69 66 20 28 20 70 6f 73 74 46  );....if ( postF
11660 69 6e 64 65 72 20 29 20 7b 0a 09 09 09 09 70 6f  inder ) {.....po
11670 73 74 46 69 6e 64 65 72 28 20 6e 75 6c 6c 2c 20  stFinder( null, 
11680 72 65 73 75 6c 74 73 2c 20 6d 61 74 63 68 65 72  results, matcher
11690 4f 75 74 2c 20 78 6d 6c 20 29 3b 0a 09 09 09 7d  Out, xml );....}
116a0 20 65 6c 73 65 20 7b 0a 09 09 09 09 70 75 73 68   else {.....push
116b0 2e 61 70 70 6c 79 28 20 72 65 73 75 6c 74 73 2c  .apply( results,
116c0 20 6d 61 74 63 68 65 72 4f 75 74 20 29 3b 0a 09   matcherOut );..
116d0 09 09 7d 0a 09 09 7d 0a 09 7d 20 29 3b 0a 7d 0a  ..}...}..} );.}.
116e0 0a 66 75 6e 63 74 69 6f 6e 20 6d 61 74 63 68 65  .function matche
116f0 72 46 72 6f 6d 54 6f 6b 65 6e 73 28 20 74 6f 6b  rFromTokens( tok
11700 65 6e 73 20 29 20 7b 0a 09 76 61 72 20 63 68 65  ens ) {..var che
11710 63 6b 43 6f 6e 74 65 78 74 2c 20 6d 61 74 63 68  ckContext, match
11720 65 72 2c 20 6a 2c 0a 09 09 6c 65 6e 20 3d 20 74  er, j,...len = t
11730 6f 6b 65 6e 73 2e 6c 65 6e 67 74 68 2c 0a 09 09  okens.length,...
11740 6c 65 61 64 69 6e 67 52 65 6c 61 74 69 76 65 20  leadingRelative 
11750 3d 20 45 78 70 72 2e 72 65 6c 61 74 69 76 65 5b  = Expr.relative[
11760 20 74 6f 6b 65 6e 73 5b 20 30 20 5d 2e 74 79 70   tokens[ 0 ].typ
11770 65 20 5d 2c 0a 09 09 69 6d 70 6c 69 63 69 74 52  e ],...implicitR
11780 65 6c 61 74 69 76 65 20 3d 20 6c 65 61 64 69 6e  elative = leadin
11790 67 52 65 6c 61 74 69 76 65 20 7c 7c 20 45 78 70  gRelative || Exp
117a0 72 2e 72 65 6c 61 74 69 76 65 5b 20 22 20 22 20  r.relative[ " " 
117b0 5d 2c 0a 09 09 69 20 3d 20 6c 65 61 64 69 6e 67  ],...i = leading
117c0 52 65 6c 61 74 69 76 65 20 3f 20 31 20 3a 20 30  Relative ? 1 : 0
117d0 2c 0a 0a 09 09 2f 2f 20 54 68 65 20 66 6f 75 6e  ,....// The foun
117e0 64 61 74 69 6f 6e 61 6c 20 6d 61 74 63 68 65 72  dational matcher
117f0 20 65 6e 73 75 72 65 73 20 74 68 61 74 20 65 6c   ensures that el
11800 65 6d 65 6e 74 73 20 61 72 65 20 72 65 61 63 68  ements are reach
11810 61 62 6c 65 20 66 72 6f 6d 20 74 6f 70 2d 6c 65  able from top-le
11820 76 65 6c 20 63 6f 6e 74 65 78 74 28 73 29 0a 09  vel context(s)..
11830 09 6d 61 74 63 68 43 6f 6e 74 65 78 74 20 3d 20  .matchContext = 
11840 61 64 64 43 6f 6d 62 69 6e 61 74 6f 72 28 20 66  addCombinator( f
11850 75 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 20 29 20  unction( elem ) 
11860 7b 0a 09 09 09 72 65 74 75 72 6e 20 65 6c 65 6d  {....return elem
11870 20 3d 3d 3d 20 63 68 65 63 6b 43 6f 6e 74 65 78   === checkContex
11880 74 3b 0a 09 09 7d 2c 20 69 6d 70 6c 69 63 69 74  t;...}, implicit
11890 52 65 6c 61 74 69 76 65 2c 20 74 72 75 65 20 29  Relative, true )
118a0 2c 0a 09 09 6d 61 74 63 68 41 6e 79 43 6f 6e 74  ,...matchAnyCont
118b0 65 78 74 20 3d 20 61 64 64 43 6f 6d 62 69 6e 61  ext = addCombina
118c0 74 6f 72 28 20 66 75 6e 63 74 69 6f 6e 28 20 65  tor( function( e
118d0 6c 65 6d 20 29 20 7b 0a 09 09 09 72 65 74 75 72  lem ) {....retur
118e0 6e 20 69 6e 64 65 78 4f 66 28 20 63 68 65 63 6b  n indexOf( check
118f0 43 6f 6e 74 65 78 74 2c 20 65 6c 65 6d 20 29 20  Context, elem ) 
11900 3e 20 2d 31 3b 0a 09 09 7d 2c 20 69 6d 70 6c 69  > -1;...}, impli
11910 63 69 74 52 65 6c 61 74 69 76 65 2c 20 74 72 75  citRelative, tru
11920 65 20 29 2c 0a 09 09 6d 61 74 63 68 65 72 73 20  e ),...matchers 
11930 3d 20 5b 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c  = [ function( el
11940 65 6d 2c 20 63 6f 6e 74 65 78 74 2c 20 78 6d 6c  em, context, xml
11950 20 29 20 7b 0a 09 09 09 76 61 72 20 72 65 74 20   ) {....var ret 
11960 3d 20 28 20 21 6c 65 61 64 69 6e 67 52 65 6c 61  = ( !leadingRela
11970 74 69 76 65 20 26 26 20 28 20 78 6d 6c 20 7c 7c  tive && ( xml ||
11980 20 63 6f 6e 74 65 78 74 20 21 3d 3d 20 6f 75 74   context !== out
11990 65 72 6d 6f 73 74 43 6f 6e 74 65 78 74 20 29 20  ermostContext ) 
119a0 29 20 7c 7c 20 28 0a 09 09 09 09 28 20 63 68 65  ) || (.....( che
119b0 63 6b 43 6f 6e 74 65 78 74 20 3d 20 63 6f 6e 74  ckContext = cont
119c0 65 78 74 20 29 2e 6e 6f 64 65 54 79 70 65 20 3f  ext ).nodeType ?
119d0 0a 09 09 09 09 09 6d 61 74 63 68 43 6f 6e 74 65  ......matchConte
119e0 78 74 28 20 65 6c 65 6d 2c 20 63 6f 6e 74 65 78  xt( elem, contex
119f0 74 2c 20 78 6d 6c 20 29 20 3a 0a 09 09 09 09 09  t, xml ) :......
11a00 6d 61 74 63 68 41 6e 79 43 6f 6e 74 65 78 74 28  matchAnyContext(
11a10 20 65 6c 65 6d 2c 20 63 6f 6e 74 65 78 74 2c 20   elem, context, 
11a20 78 6d 6c 20 29 20 29 3b 0a 0a 09 09 09 2f 2f 20  xml ) );.....// 
11a30 41 76 6f 69 64 20 68 61 6e 67 69 6e 67 20 6f 6e  Avoid hanging on
11a40 74 6f 20 65 6c 65 6d 65 6e 74 20 28 69 73 73 75  to element (issu
11a50 65 20 23 32 39 39 29 0a 09 09 09 63 68 65 63 6b  e #299)....check
11a60 43 6f 6e 74 65 78 74 20 3d 20 6e 75 6c 6c 3b 0a  Context = null;.
11a70 09 09 09 72 65 74 75 72 6e 20 72 65 74 3b 0a 09  ...return ret;..
11a80 09 7d 20 5d 3b 0a 0a 09 66 6f 72 20 28 20 3b 20  .} ];...for ( ; 
11a90 69 20 3c 20 6c 65 6e 3b 20 69 2b 2b 20 29 20 7b  i < len; i++ ) {
11aa0 0a 09 09 69 66 20 28 20 28 20 6d 61 74 63 68 65  ...if ( ( matche
11ab0 72 20 3d 20 45 78 70 72 2e 72 65 6c 61 74 69 76  r = Expr.relativ
11ac0 65 5b 20 74 6f 6b 65 6e 73 5b 20 69 20 5d 2e 74  e[ tokens[ i ].t
11ad0 79 70 65 20 5d 20 29 20 29 20 7b 0a 09 09 09 6d  ype ] ) ) {....m
11ae0 61 74 63 68 65 72 73 20 3d 20 5b 20 61 64 64 43  atchers = [ addC
11af0 6f 6d 62 69 6e 61 74 6f 72 28 20 65 6c 65 6d 65  ombinator( eleme
11b00 6e 74 4d 61 74 63 68 65 72 28 20 6d 61 74 63 68  ntMatcher( match
11b10 65 72 73 20 29 2c 20 6d 61 74 63 68 65 72 20 29  ers ), matcher )
11b20 20 5d 3b 0a 09 09 7d 20 65 6c 73 65 20 7b 0a 09   ];...} else {..
11b30 09 09 6d 61 74 63 68 65 72 20 3d 20 45 78 70 72  ..matcher = Expr
11b40 2e 66 69 6c 74 65 72 5b 20 74 6f 6b 65 6e 73 5b  .filter[ tokens[
11b50 20 69 20 5d 2e 74 79 70 65 20 5d 2e 61 70 70 6c   i ].type ].appl
11b60 79 28 20 6e 75 6c 6c 2c 20 74 6f 6b 65 6e 73 5b  y( null, tokens[
11b70 20 69 20 5d 2e 6d 61 74 63 68 65 73 20 29 3b 0a   i ].matches );.
11b80 0a 09 09 09 2f 2f 20 52 65 74 75 72 6e 20 73 70  ....// Return sp
11b90 65 63 69 61 6c 20 75 70 6f 6e 20 73 65 65 69 6e  ecial upon seein
11ba0 67 20 61 20 70 6f 73 69 74 69 6f 6e 61 6c 20 6d  g a positional m
11bb0 61 74 63 68 65 72 0a 09 09 09 69 66 20 28 20 6d  atcher....if ( m
11bc0 61 74 63 68 65 72 5b 20 65 78 70 61 6e 64 6f 20  atcher[ expando 
11bd0 5d 20 29 20 7b 0a 0a 09 09 09 09 2f 2f 20 46 69  ] ) {......// Fi
11be0 6e 64 20 74 68 65 20 6e 65 78 74 20 72 65 6c 61  nd the next rela
11bf0 74 69 76 65 20 6f 70 65 72 61 74 6f 72 20 28 69  tive operator (i
11c00 66 20 61 6e 79 29 20 66 6f 72 20 70 72 6f 70 65  f any) for prope
11c10 72 20 68 61 6e 64 6c 69 6e 67 0a 09 09 09 09 6a  r handling.....j
11c20 20 3d 20 2b 2b 69 3b 0a 09 09 09 09 66 6f 72 20   = ++i;.....for 
11c30 28 20 3b 20 6a 20 3c 20 6c 65 6e 3b 20 6a 2b 2b  ( ; j < len; j++
11c40 20 29 20 7b 0a 09 09 09 09 09 69 66 20 28 20 45   ) {......if ( E
11c50 78 70 72 2e 72 65 6c 61 74 69 76 65 5b 20 74 6f  xpr.relative[ to
11c60 6b 65 6e 73 5b 20 6a 20 5d 2e 74 79 70 65 20 5d  kens[ j ].type ]
11c70 20 29 20 7b 0a 09 09 09 09 09 09 62 72 65 61 6b   ) {.......break
11c80 3b 0a 09 09 09 09 09 7d 0a 09 09 09 09 7d 0a 09  ;......}.....}..
11c90 09 09 09 72 65 74 75 72 6e 20 73 65 74 4d 61 74  ...return setMat
11ca0 63 68 65 72 28 0a 09 09 09 09 09 69 20 3e 20 31  cher(......i > 1
11cb0 20 26 26 20 65 6c 65 6d 65 6e 74 4d 61 74 63 68   && elementMatch
11cc0 65 72 28 20 6d 61 74 63 68 65 72 73 20 29 2c 0a  er( matchers ),.
11cd0 09 09 09 09 09 69 20 3e 20 31 20 26 26 20 74 6f  .....i > 1 && to
11ce0 53 65 6c 65 63 74 6f 72 28 0a 0a 09 09 09 09 09  Selector(.......
11cf0 2f 2f 20 49 66 20 74 68 65 20 70 72 65 63 65 64  // If the preced
11d00 69 6e 67 20 74 6f 6b 65 6e 20 77 61 73 20 61 20  ing token was a 
11d10 64 65 73 63 65 6e 64 61 6e 74 20 63 6f 6d 62 69  descendant combi
11d20 6e 61 74 6f 72 2c 20 69 6e 73 65 72 74 20 61 6e  nator, insert an
11d30 20 69 6d 70 6c 69 63 69 74 20 61 6e 79 2d 65 6c   implicit any-el
11d40 65 6d 65 6e 74 20 60 2a 60 0a 09 09 09 09 09 74  ement `*`......t
11d50 6f 6b 65 6e 73 0a 09 09 09 09 09 09 2e 73 6c 69  okens........sli
11d60 63 65 28 20 30 2c 20 69 20 2d 20 31 20 29 0a 09  ce( 0, i - 1 )..
11d70 09 09 09 09 09 2e 63 6f 6e 63 61 74 28 20 7b 20  ......concat( { 
11d80 76 61 6c 75 65 3a 20 74 6f 6b 65 6e 73 5b 20 69  value: tokens[ i
11d90 20 2d 20 32 20 5d 2e 74 79 70 65 20 3d 3d 3d 20   - 2 ].type === 
11da0 22 20 22 20 3f 20 22 2a 22 20 3a 20 22 22 20 7d  " " ? "*" : "" }
11db0 20 29 0a 09 09 09 09 09 29 2e 72 65 70 6c 61 63   )......).replac
11dc0 65 28 20 72 74 72 69 6d 2c 20 22 24 31 22 20 29  e( rtrim, "$1" )
11dd0 2c 0a 09 09 09 09 09 6d 61 74 63 68 65 72 2c 0a  ,......matcher,.
11de0 09 09 09 09 09 69 20 3c 20 6a 20 26 26 20 6d 61  .....i < j && ma
11df0 74 63 68 65 72 46 72 6f 6d 54 6f 6b 65 6e 73 28  tcherFromTokens(
11e00 20 74 6f 6b 65 6e 73 2e 73 6c 69 63 65 28 20 69   tokens.slice( i
11e10 2c 20 6a 20 29 20 29 2c 0a 09 09 09 09 09 6a 20  , j ) ),......j 
11e20 3c 20 6c 65 6e 20 26 26 20 6d 61 74 63 68 65 72  < len && matcher
11e30 46 72 6f 6d 54 6f 6b 65 6e 73 28 20 28 20 74 6f  FromTokens( ( to
11e40 6b 65 6e 73 20 3d 20 74 6f 6b 65 6e 73 2e 73 6c  kens = tokens.sl
11e50 69 63 65 28 20 6a 20 29 20 29 20 29 2c 0a 09 09  ice( j ) ) ),...
11e60 09 09 09 6a 20 3c 20 6c 65 6e 20 26 26 20 74 6f  ...j < len && to
11e70 53 65 6c 65 63 74 6f 72 28 20 74 6f 6b 65 6e 73  Selector( tokens
11e80 20 29 0a 09 09 09 09 29 3b 0a 09 09 09 7d 0a 09   ).....);....}..
11e90 09 09 6d 61 74 63 68 65 72 73 2e 70 75 73 68 28  ..matchers.push(
11ea0 20 6d 61 74 63 68 65 72 20 29 3b 0a 09 09 7d 0a   matcher );...}.
11eb0 09 7d 0a 0a 09 72 65 74 75 72 6e 20 65 6c 65 6d  .}...return elem
11ec0 65 6e 74 4d 61 74 63 68 65 72 28 20 6d 61 74 63  entMatcher( matc
11ed0 68 65 72 73 20 29 3b 0a 7d 0a 0a 66 75 6e 63 74  hers );.}..funct
11ee0 69 6f 6e 20 6d 61 74 63 68 65 72 46 72 6f 6d 47  ion matcherFromG
11ef0 72 6f 75 70 4d 61 74 63 68 65 72 73 28 20 65 6c  roupMatchers( el
11f00 65 6d 65 6e 74 4d 61 74 63 68 65 72 73 2c 20 73  ementMatchers, s
11f10 65 74 4d 61 74 63 68 65 72 73 20 29 20 7b 0a 09  etMatchers ) {..
11f20 76 61 72 20 62 79 53 65 74 20 3d 20 73 65 74 4d  var bySet = setM
11f30 61 74 63 68 65 72 73 2e 6c 65 6e 67 74 68 20 3e  atchers.length >
11f40 20 30 2c 0a 09 09 62 79 45 6c 65 6d 65 6e 74 20   0,...byElement 
11f50 3d 20 65 6c 65 6d 65 6e 74 4d 61 74 63 68 65 72  = elementMatcher
11f60 73 2e 6c 65 6e 67 74 68 20 3e 20 30 2c 0a 09 09  s.length > 0,...
11f70 73 75 70 65 72 4d 61 74 63 68 65 72 20 3d 20 66  superMatcher = f
11f80 75 6e 63 74 69 6f 6e 28 20 73 65 65 64 2c 20 63  unction( seed, c
11f90 6f 6e 74 65 78 74 2c 20 78 6d 6c 2c 20 72 65 73  ontext, xml, res
11fa0 75 6c 74 73 2c 20 6f 75 74 65 72 6d 6f 73 74 20  ults, outermost 
11fb0 29 20 7b 0a 09 09 09 76 61 72 20 65 6c 65 6d 2c  ) {....var elem,
11fc0 20 6a 2c 20 6d 61 74 63 68 65 72 2c 0a 09 09 09   j, matcher,....
11fd0 09 6d 61 74 63 68 65 64 43 6f 75 6e 74 20 3d 20  .matchedCount = 
11fe0 30 2c 0a 09 09 09 09 69 20 3d 20 22 30 22 2c 0a  0,.....i = "0",.
11ff0 09 09 09 09 75 6e 6d 61 74 63 68 65 64 20 3d 20  ....unmatched = 
12000 73 65 65 64 20 26 26 20 5b 5d 2c 0a 09 09 09 09  seed && [],.....
12010 73 65 74 4d 61 74 63 68 65 64 20 3d 20 5b 5d 2c  setMatched = [],
12020 0a 09 09 09 09 63 6f 6e 74 65 78 74 42 61 63 6b  .....contextBack
12030 75 70 20 3d 20 6f 75 74 65 72 6d 6f 73 74 43 6f  up = outermostCo
12040 6e 74 65 78 74 2c 0a 0a 09 09 09 09 2f 2f 20 57  ntext,......// W
12050 65 20 6d 75 73 74 20 61 6c 77 61 79 73 20 68 61  e must always ha
12060 76 65 20 65 69 74 68 65 72 20 73 65 65 64 20 65  ve either seed e
12070 6c 65 6d 65 6e 74 73 20 6f 72 20 6f 75 74 65 72  lements or outer
12080 6d 6f 73 74 20 63 6f 6e 74 65 78 74 0a 09 09 09  most context....
12090 09 65 6c 65 6d 73 20 3d 20 73 65 65 64 20 7c 7c  .elems = seed ||
120a0 20 62 79 45 6c 65 6d 65 6e 74 20 26 26 20 45 78   byElement && Ex
120b0 70 72 2e 66 69 6e 64 5b 20 22 54 41 47 22 20 5d  pr.find[ "TAG" ]
120c0 28 20 22 2a 22 2c 20 6f 75 74 65 72 6d 6f 73 74  ( "*", outermost
120d0 20 29 2c 0a 0a 09 09 09 09 2f 2f 20 55 73 65 20   ),......// Use 
120e0 69 6e 74 65 67 65 72 20 64 69 72 72 75 6e 73 20  integer dirruns 
120f0 69 66 66 20 74 68 69 73 20 69 73 20 74 68 65 20  iff this is the 
12100 6f 75 74 65 72 6d 6f 73 74 20 6d 61 74 63 68 65  outermost matche
12110 72 0a 09 09 09 09 64 69 72 72 75 6e 73 55 6e 69  r.....dirrunsUni
12120 71 75 65 20 3d 20 28 20 64 69 72 72 75 6e 73 20  que = ( dirruns 
12130 2b 3d 20 63 6f 6e 74 65 78 74 42 61 63 6b 75 70  += contextBackup
12140 20 3d 3d 20 6e 75 6c 6c 20 3f 20 31 20 3a 20 4d   == null ? 1 : M
12150 61 74 68 2e 72 61 6e 64 6f 6d 28 29 20 7c 7c 20  ath.random() || 
12160 30 2e 31 20 29 2c 0a 09 09 09 09 6c 65 6e 20 3d  0.1 ),.....len =
12170 20 65 6c 65 6d 73 2e 6c 65 6e 67 74 68 3b 0a 0a   elems.length;..
12180 09 09 09 69 66 20 28 20 6f 75 74 65 72 6d 6f 73  ...if ( outermos
12190 74 20 29 20 7b 0a 0a 09 09 09 09 2f 2f 20 53 75  t ) {......// Su
121a0 70 70 6f 72 74 3a 20 49 45 20 31 31 2b 2c 20 45  pport: IE 11+, E
121b0 64 67 65 20 31 37 20 2d 20 31 38 2b 0a 09 09 09  dge 17 - 18+....
121c0 09 2f 2f 20 49 45 2f 45 64 67 65 20 73 6f 6d 65  .// IE/Edge some
121d0 74 69 6d 65 73 20 74 68 72 6f 77 20 61 20 22 50  times throw a "P
121e0 65 72 6d 69 73 73 69 6f 6e 20 64 65 6e 69 65 64  ermission denied
121f0 22 20 65 72 72 6f 72 20 77 68 65 6e 20 73 74 72  " error when str
12200 69 63 74 2d 63 6f 6d 70 61 72 69 6e 67 0a 09 09  ict-comparing...
12210 09 09 2f 2f 20 74 77 6f 20 64 6f 63 75 6d 65 6e  ..// two documen
12220 74 73 3b 20 73 68 61 6c 6c 6f 77 20 63 6f 6d 70  ts; shallow comp
12230 61 72 69 73 6f 6e 73 20 77 6f 72 6b 2e 0a 09 09  arisons work....
12240 09 09 2f 2f 20 65 73 6c 69 6e 74 2d 64 69 73 61  ..// eslint-disa
12250 62 6c 65 2d 6e 65 78 74 2d 6c 69 6e 65 20 65 71  ble-next-line eq
12260 65 71 65 71 0a 09 09 09 09 6f 75 74 65 72 6d 6f  eqeq.....outermo
12270 73 74 43 6f 6e 74 65 78 74 20 3d 20 63 6f 6e 74  stContext = cont
12280 65 78 74 20 3d 3d 20 64 6f 63 75 6d 65 6e 74 20  ext == document 
12290 7c 7c 20 63 6f 6e 74 65 78 74 20 7c 7c 20 6f 75  || context || ou
122a0 74 65 72 6d 6f 73 74 3b 0a 09 09 09 7d 0a 0a 09  termost;....}...
122b0 09 09 2f 2f 20 41 64 64 20 65 6c 65 6d 65 6e 74  ..// Add element
122c0 73 20 70 61 73 73 69 6e 67 20 65 6c 65 6d 65 6e  s passing elemen
122d0 74 4d 61 74 63 68 65 72 73 20 64 69 72 65 63 74  tMatchers direct
122e0 6c 79 20 74 6f 20 72 65 73 75 6c 74 73 0a 09 09  ly to results...
122f0 09 2f 2f 20 53 75 70 70 6f 72 74 3a 20 49 45 3c  .// Support: IE<
12300 39 2c 20 53 61 66 61 72 69 0a 09 09 09 2f 2f 20  9, Safari....// 
12310 54 6f 6c 65 72 61 74 65 20 4e 6f 64 65 4c 69 73  Tolerate NodeLis
12320 74 20 70 72 6f 70 65 72 74 69 65 73 20 28 49 45  t properties (IE
12330 3a 20 22 6c 65 6e 67 74 68 22 3b 20 53 61 66 61  : "length"; Safa
12340 72 69 3a 20 3c 6e 75 6d 62 65 72 3e 29 20 6d 61  ri: <number>) ma
12350 74 63 68 69 6e 67 20 65 6c 65 6d 65 6e 74 73 20  tching elements 
12360 62 79 20 69 64 0a 09 09 09 66 6f 72 20 28 20 3b  by id....for ( ;
12370 20 69 20 21 3d 3d 20 6c 65 6e 20 26 26 20 28 20   i !== len && ( 
12380 65 6c 65 6d 20 3d 20 65 6c 65 6d 73 5b 20 69 20  elem = elems[ i 
12390 5d 20 29 20 21 3d 20 6e 75 6c 6c 3b 20 69 2b 2b  ] ) != null; i++
123a0 20 29 20 7b 0a 09 09 09 09 69 66 20 28 20 62 79   ) {.....if ( by
123b0 45 6c 65 6d 65 6e 74 20 26 26 20 65 6c 65 6d 20  Element && elem 
123c0 29 20 7b 0a 09 09 09 09 09 6a 20 3d 20 30 3b 0a  ) {......j = 0;.
123d0 0a 09 09 09 09 09 2f 2f 20 53 75 70 70 6f 72 74  ......// Support
123e0 3a 20 49 45 20 31 31 2b 2c 20 45 64 67 65 20 31  : IE 11+, Edge 1
123f0 37 20 2d 20 31 38 2b 0a 09 09 09 09 09 2f 2f 20  7 - 18+......// 
12400 49 45 2f 45 64 67 65 20 73 6f 6d 65 74 69 6d 65  IE/Edge sometime
12410 73 20 74 68 72 6f 77 20 61 20 22 50 65 72 6d 69  s throw a "Permi
12420 73 73 69 6f 6e 20 64 65 6e 69 65 64 22 20 65 72  ssion denied" er
12430 72 6f 72 20 77 68 65 6e 20 73 74 72 69 63 74 2d  ror when strict-
12440 63 6f 6d 70 61 72 69 6e 67 0a 09 09 09 09 09 2f  comparing....../
12450 2f 20 74 77 6f 20 64 6f 63 75 6d 65 6e 74 73 3b  / two documents;
12460 20 73 68 61 6c 6c 6f 77 20 63 6f 6d 70 61 72 69   shallow compari
12470 73 6f 6e 73 20 77 6f 72 6b 2e 0a 09 09 09 09 09  sons work.......
12480 2f 2f 20 65 73 6c 69 6e 74 2d 64 69 73 61 62 6c  // eslint-disabl
12490 65 2d 6e 65 78 74 2d 6c 69 6e 65 20 65 71 65 71  e-next-line eqeq
124a0 65 71 0a 09 09 09 09 09 69 66 20 28 20 21 63 6f  eq......if ( !co
124b0 6e 74 65 78 74 20 26 26 20 65 6c 65 6d 2e 6f 77  ntext && elem.ow
124c0 6e 65 72 44 6f 63 75 6d 65 6e 74 20 21 3d 20 64  nerDocument != d
124d0 6f 63 75 6d 65 6e 74 20 29 20 7b 0a 09 09 09 09  ocument ) {.....
124e0 09 09 73 65 74 44 6f 63 75 6d 65 6e 74 28 20 65  ..setDocument( e
124f0 6c 65 6d 20 29 3b 0a 09 09 09 09 09 09 78 6d 6c  lem );.......xml
12500 20 3d 20 21 64 6f 63 75 6d 65 6e 74 49 73 48 54   = !documentIsHT
12510 4d 4c 3b 0a 09 09 09 09 09 7d 0a 09 09 09 09 09  ML;......}......
12520 77 68 69 6c 65 20 28 20 28 20 6d 61 74 63 68 65  while ( ( matche
12530 72 20 3d 20 65 6c 65 6d 65 6e 74 4d 61 74 63 68  r = elementMatch
12540 65 72 73 5b 20 6a 2b 2b 20 5d 20 29 20 29 20 7b  ers[ j++ ] ) ) {
12550 0a 09 09 09 09 09 09 69 66 20 28 20 6d 61 74 63  .......if ( matc
12560 68 65 72 28 20 65 6c 65 6d 2c 20 63 6f 6e 74 65  her( elem, conte
12570 78 74 20 7c 7c 20 64 6f 63 75 6d 65 6e 74 2c 20  xt || document, 
12580 78 6d 6c 20 29 20 29 20 7b 0a 09 09 09 09 09 09  xml ) ) {.......
12590 09 72 65 73 75 6c 74 73 2e 70 75 73 68 28 20 65  .results.push( e
125a0 6c 65 6d 20 29 3b 0a 09 09 09 09 09 09 09 62 72  lem );........br
125b0 65 61 6b 3b 0a 09 09 09 09 09 09 7d 0a 09 09 09  eak;.......}....
125c0 09 09 7d 0a 09 09 09 09 09 69 66 20 28 20 6f 75  ..}......if ( ou
125d0 74 65 72 6d 6f 73 74 20 29 20 7b 0a 09 09 09 09  termost ) {.....
125e0 09 09 64 69 72 72 75 6e 73 20 3d 20 64 69 72 72  ..dirruns = dirr
125f0 75 6e 73 55 6e 69 71 75 65 3b 0a 09 09 09 09 09  unsUnique;......
12600 7d 0a 09 09 09 09 7d 0a 0a 09 09 09 09 2f 2f 20  }.....}......// 
12610 54 72 61 63 6b 20 75 6e 6d 61 74 63 68 65 64 20  Track unmatched 
12620 65 6c 65 6d 65 6e 74 73 20 66 6f 72 20 73 65 74  elements for set
12630 20 66 69 6c 74 65 72 73 0a 09 09 09 09 69 66 20   filters.....if 
12640 28 20 62 79 53 65 74 20 29 20 7b 0a 0a 09 09 09  ( bySet ) {.....
12650 09 09 2f 2f 20 54 68 65 79 20 77 69 6c 6c 20 68  ..// They will h
12660 61 76 65 20 67 6f 6e 65 20 74 68 72 6f 75 67 68  ave gone through
12670 20 61 6c 6c 20 70 6f 73 73 69 62 6c 65 20 6d 61   all possible ma
12680 74 63 68 65 72 73 0a 09 09 09 09 09 69 66 20 28  tchers......if (
12690 20 28 20 65 6c 65 6d 20 3d 20 21 6d 61 74 63 68   ( elem = !match
126a0 65 72 20 26 26 20 65 6c 65 6d 20 29 20 29 20 7b  er && elem ) ) {
126b0 0a 09 09 09 09 09 09 6d 61 74 63 68 65 64 43 6f  .......matchedCo
126c0 75 6e 74 2d 2d 3b 0a 09 09 09 09 09 7d 0a 0a 09  unt--;......}...
126d0 09 09 09 09 2f 2f 20 4c 65 6e 67 74 68 65 6e 20  ....// Lengthen 
126e0 74 68 65 20 61 72 72 61 79 20 66 6f 72 20 65 76  the array for ev
126f0 65 72 79 20 65 6c 65 6d 65 6e 74 2c 20 6d 61 74  ery element, mat
12700 63 68 65 64 20 6f 72 20 6e 6f 74 0a 09 09 09 09  ched or not.....
12710 09 69 66 20 28 20 73 65 65 64 20 29 20 7b 0a 09  .if ( seed ) {..
12720 09 09 09 09 09 75 6e 6d 61 74 63 68 65 64 2e 70  .....unmatched.p
12730 75 73 68 28 20 65 6c 65 6d 20 29 3b 0a 09 09 09  ush( elem );....
12740 09 09 7d 0a 09 09 09 09 7d 0a 09 09 09 7d 0a 0a  ..}.....}....}..
12750 09 09 09 2f 2f 20 60 69 60 20 69 73 20 6e 6f 77  ...// `i` is now
12760 20 74 68 65 20 63 6f 75 6e 74 20 6f 66 20 65 6c   the count of el
12770 65 6d 65 6e 74 73 20 76 69 73 69 74 65 64 20 61  ements visited a
12780 62 6f 76 65 2c 20 61 6e 64 20 61 64 64 69 6e 67  bove, and adding
12790 20 69 74 20 74 6f 20 60 6d 61 74 63 68 65 64 43   it to `matchedC
127a0 6f 75 6e 74 60 0a 09 09 09 2f 2f 20 6d 61 6b 65  ount`....// make
127b0 73 20 74 68 65 20 6c 61 74 74 65 72 20 6e 6f 6e  s the latter non
127c0 6e 65 67 61 74 69 76 65 2e 0a 09 09 09 6d 61 74  negative.....mat
127d0 63 68 65 64 43 6f 75 6e 74 20 2b 3d 20 69 3b 0a  chedCount += i;.
127e0 0a 09 09 09 2f 2f 20 41 70 70 6c 79 20 73 65 74  ....// Apply set
127f0 20 66 69 6c 74 65 72 73 20 74 6f 20 75 6e 6d 61   filters to unma
12800 74 63 68 65 64 20 65 6c 65 6d 65 6e 74 73 0a 09  tched elements..
12810 09 09 2f 2f 20 4e 4f 54 45 3a 20 54 68 69 73 20  ..// NOTE: This 
12820 63 61 6e 20 62 65 20 73 6b 69 70 70 65 64 20 69  can be skipped i
12830 66 20 74 68 65 72 65 20 61 72 65 20 6e 6f 20 75  f there are no u
12840 6e 6d 61 74 63 68 65 64 20 65 6c 65 6d 65 6e 74  nmatched element
12850 73 20 28 69 2e 65 2e 2c 20 60 6d 61 74 63 68 65  s (i.e., `matche
12860 64 43 6f 75 6e 74 60 0a 09 09 09 2f 2f 20 65 71  dCount`....// eq
12870 75 61 6c 73 20 60 69 60 29 2c 20 75 6e 6c 65 73  uals `i`), unles
12880 73 20 77 65 20 64 69 64 6e 27 74 20 76 69 73 69  s we didn't visi
12890 74 20 5f 61 6e 79 5f 20 65 6c 65 6d 65 6e 74 73  t _any_ elements
128a0 20 69 6e 20 74 68 65 20 61 62 6f 76 65 20 6c 6f   in the above lo
128b0 6f 70 20 62 65 63 61 75 73 65 20 77 65 20 68 61  op because we ha
128c0 76 65 0a 09 09 09 2f 2f 20 6e 6f 20 65 6c 65 6d  ve....// no elem
128d0 65 6e 74 20 6d 61 74 63 68 65 72 73 20 61 6e 64  ent matchers and
128e0 20 6e 6f 20 73 65 65 64 2e 0a 09 09 09 2f 2f 20   no seed.....// 
128f0 49 6e 63 72 65 6d 65 6e 74 69 6e 67 20 61 6e 20  Incrementing an 
12900 69 6e 69 74 69 61 6c 6c 79 2d 73 74 72 69 6e 67  initially-string
12910 20 22 30 22 20 60 69 60 20 61 6c 6c 6f 77 73 20   "0" `i` allows 
12920 60 69 60 20 74 6f 20 72 65 6d 61 69 6e 20 61 20  `i` to remain a 
12930 73 74 72 69 6e 67 20 6f 6e 6c 79 20 69 6e 20 74  string only in t
12940 68 61 74 0a 09 09 09 2f 2f 20 63 61 73 65 2c 20  hat....// case, 
12950 77 68 69 63 68 20 77 69 6c 6c 20 72 65 73 75 6c  which will resul
12960 74 20 69 6e 20 61 20 22 30 30 22 20 60 6d 61 74  t in a "00" `mat
12970 63 68 65 64 43 6f 75 6e 74 60 20 74 68 61 74 20  chedCount` that 
12980 64 69 66 66 65 72 73 20 66 72 6f 6d 20 60 69 60  differs from `i`
12990 20 62 75 74 20 69 73 20 61 6c 73 6f 0a 09 09 09   but is also....
129a0 2f 2f 20 6e 75 6d 65 72 69 63 61 6c 6c 79 20 7a  // numerically z
129b0 65 72 6f 2e 0a 09 09 09 69 66 20 28 20 62 79 53  ero.....if ( byS
129c0 65 74 20 26 26 20 69 20 21 3d 3d 20 6d 61 74 63  et && i !== matc
129d0 68 65 64 43 6f 75 6e 74 20 29 20 7b 0a 09 09 09  hedCount ) {....
129e0 09 6a 20 3d 20 30 3b 0a 09 09 09 09 77 68 69 6c  .j = 0;.....whil
129f0 65 20 28 20 28 20 6d 61 74 63 68 65 72 20 3d 20  e ( ( matcher = 
12a00 73 65 74 4d 61 74 63 68 65 72 73 5b 20 6a 2b 2b  setMatchers[ j++
12a10 20 5d 20 29 20 29 20 7b 0a 09 09 09 09 09 6d 61   ] ) ) {......ma
12a20 74 63 68 65 72 28 20 75 6e 6d 61 74 63 68 65 64  tcher( unmatched
12a30 2c 20 73 65 74 4d 61 74 63 68 65 64 2c 20 63 6f  , setMatched, co
12a40 6e 74 65 78 74 2c 20 78 6d 6c 20 29 3b 0a 09 09  ntext, xml );...
12a50 09 09 7d 0a 0a 09 09 09 09 69 66 20 28 20 73 65  ..}......if ( se
12a60 65 64 20 29 20 7b 0a 0a 09 09 09 09 09 2f 2f 20  ed ) {.......// 
12a70 52 65 69 6e 74 65 67 72 61 74 65 20 65 6c 65 6d  Reintegrate elem
12a80 65 6e 74 20 6d 61 74 63 68 65 73 20 74 6f 20 65  ent matches to e
12a90 6c 69 6d 69 6e 61 74 65 20 74 68 65 20 6e 65 65  liminate the nee
12aa0 64 20 66 6f 72 20 73 6f 72 74 69 6e 67 0a 09 09  d for sorting...
12ab0 09 09 09 69 66 20 28 20 6d 61 74 63 68 65 64 43  ...if ( matchedC
12ac0 6f 75 6e 74 20 3e 20 30 20 29 20 7b 0a 09 09 09  ount > 0 ) {....
12ad0 09 09 09 77 68 69 6c 65 20 28 20 69 2d 2d 20 29  ...while ( i-- )
12ae0 20 7b 0a 09 09 09 09 09 09 09 69 66 20 28 20 21   {........if ( !
12af0 28 20 75 6e 6d 61 74 63 68 65 64 5b 20 69 20 5d  ( unmatched[ i ]
12b00 20 7c 7c 20 73 65 74 4d 61 74 63 68 65 64 5b 20   || setMatched[ 
12b10 69 20 5d 20 29 20 29 20 7b 0a 09 09 09 09 09 09  i ] ) ) {.......
12b20 09 09 73 65 74 4d 61 74 63 68 65 64 5b 20 69 20  ..setMatched[ i 
12b30 5d 20 3d 20 70 6f 70 2e 63 61 6c 6c 28 20 72 65  ] = pop.call( re
12b40 73 75 6c 74 73 20 29 3b 0a 09 09 09 09 09 09 09  sults );........
12b50 7d 0a 09 09 09 09 09 09 7d 0a 09 09 09 09 09 7d  }.......}......}
12b60 0a 0a 09 09 09 09 09 2f 2f 20 44 69 73 63 61 72  .......// Discar
12b70 64 20 69 6e 64 65 78 20 70 6c 61 63 65 68 6f 6c  d index placehol
12b80 64 65 72 20 76 61 6c 75 65 73 20 74 6f 20 67 65  der values to ge
12b90 74 20 6f 6e 6c 79 20 61 63 74 75 61 6c 20 6d 61  t only actual ma
12ba0 74 63 68 65 73 0a 09 09 09 09 09 73 65 74 4d 61  tches......setMa
12bb0 74 63 68 65 64 20 3d 20 63 6f 6e 64 65 6e 73 65  tched = condense
12bc0 28 20 73 65 74 4d 61 74 63 68 65 64 20 29 3b 0a  ( setMatched );.
12bd0 09 09 09 09 7d 0a 0a 09 09 09 09 2f 2f 20 41 64  ....}......// Ad
12be0 64 20 6d 61 74 63 68 65 73 20 74 6f 20 72 65 73  d matches to res
12bf0 75 6c 74 73 0a 09 09 09 09 70 75 73 68 2e 61 70  ults.....push.ap
12c00 70 6c 79 28 20 72 65 73 75 6c 74 73 2c 20 73 65  ply( results, se
12c10 74 4d 61 74 63 68 65 64 20 29 3b 0a 0a 09 09 09  tMatched );.....
12c20 09 2f 2f 20 53 65 65 64 6c 65 73 73 20 73 65 74  .// Seedless set
12c30 20 6d 61 74 63 68 65 73 20 73 75 63 63 65 65 64   matches succeed
12c40 69 6e 67 20 6d 75 6c 74 69 70 6c 65 20 73 75 63  ing multiple suc
12c50 63 65 73 73 66 75 6c 20 6d 61 74 63 68 65 72 73  cessful matchers
12c60 20 73 74 69 70 75 6c 61 74 65 20 73 6f 72 74 69   stipulate sorti
12c70 6e 67 0a 09 09 09 09 69 66 20 28 20 6f 75 74 65  ng.....if ( oute
12c80 72 6d 6f 73 74 20 26 26 20 21 73 65 65 64 20 26  rmost && !seed &
12c90 26 20 73 65 74 4d 61 74 63 68 65 64 2e 6c 65 6e  & setMatched.len
12ca0 67 74 68 20 3e 20 30 20 26 26 0a 09 09 09 09 09  gth > 0 &&......
12cb0 28 20 6d 61 74 63 68 65 64 43 6f 75 6e 74 20 2b  ( matchedCount +
12cc0 20 73 65 74 4d 61 74 63 68 65 72 73 2e 6c 65 6e   setMatchers.len
12cd0 67 74 68 20 29 20 3e 20 31 20 29 20 7b 0a 0a 09  gth ) > 1 ) {...
12ce0 09 09 09 09 53 69 7a 7a 6c 65 2e 75 6e 69 71 75  ....Sizzle.uniqu
12cf0 65 53 6f 72 74 28 20 72 65 73 75 6c 74 73 20 29  eSort( results )
12d00 3b 0a 09 09 09 09 7d 0a 09 09 09 7d 0a 0a 09 09  ;.....}....}....
12d10 09 2f 2f 20 4f 76 65 72 72 69 64 65 20 6d 61 6e  .// Override man
12d20 69 70 75 6c 61 74 69 6f 6e 20 6f 66 20 67 6c 6f  ipulation of glo
12d30 62 61 6c 73 20 62 79 20 6e 65 73 74 65 64 20 6d  bals by nested m
12d40 61 74 63 68 65 72 73 0a 09 09 09 69 66 20 28 20  atchers....if ( 
12d50 6f 75 74 65 72 6d 6f 73 74 20 29 20 7b 0a 09 09  outermost ) {...
12d60 09 09 64 69 72 72 75 6e 73 20 3d 20 64 69 72 72  ..dirruns = dirr
12d70 75 6e 73 55 6e 69 71 75 65 3b 0a 09 09 09 09 6f  unsUnique;.....o
12d80 75 74 65 72 6d 6f 73 74 43 6f 6e 74 65 78 74 20  utermostContext 
12d90 3d 20 63 6f 6e 74 65 78 74 42 61 63 6b 75 70 3b  = contextBackup;
12da0 0a 09 09 09 7d 0a 0a 09 09 09 72 65 74 75 72 6e  ....}.....return
12db0 20 75 6e 6d 61 74 63 68 65 64 3b 0a 09 09 7d 3b   unmatched;...};
12dc0 0a 0a 09 72 65 74 75 72 6e 20 62 79 53 65 74 20  ...return bySet 
12dd0 3f 0a 09 09 6d 61 72 6b 46 75 6e 63 74 69 6f 6e  ?...markFunction
12de0 28 20 73 75 70 65 72 4d 61 74 63 68 65 72 20 29  ( superMatcher )
12df0 20 3a 0a 09 09 73 75 70 65 72 4d 61 74 63 68 65   :...superMatche
12e00 72 3b 0a 7d 0a 0a 63 6f 6d 70 69 6c 65 20 3d 20  r;.}..compile = 
12e10 53 69 7a 7a 6c 65 2e 63 6f 6d 70 69 6c 65 20 3d  Sizzle.compile =
12e20 20 66 75 6e 63 74 69 6f 6e 28 20 73 65 6c 65 63   function( selec
12e30 74 6f 72 2c 20 6d 61 74 63 68 20 2f 2a 20 49 6e  tor, match /* In
12e40 74 65 72 6e 61 6c 20 55 73 65 20 4f 6e 6c 79 20  ternal Use Only 
12e50 2a 2f 20 29 20 7b 0a 09 76 61 72 20 69 2c 0a 09  */ ) {..var i,..
12e60 09 73 65 74 4d 61 74 63 68 65 72 73 20 3d 20 5b  .setMatchers = [
12e70 5d 2c 0a 09 09 65 6c 65 6d 65 6e 74 4d 61 74 63  ],...elementMatc
12e80 68 65 72 73 20 3d 20 5b 5d 2c 0a 09 09 63 61 63  hers = [],...cac
12e90 68 65 64 20 3d 20 63 6f 6d 70 69 6c 65 72 43 61  hed = compilerCa
12ea0 63 68 65 5b 20 73 65 6c 65 63 74 6f 72 20 2b 20  che[ selector + 
12eb0 22 20 22 20 5d 3b 0a 0a 09 69 66 20 28 20 21 63  " " ];...if ( !c
12ec0 61 63 68 65 64 20 29 20 7b 0a 0a 09 09 2f 2f 20  ached ) {....// 
12ed0 47 65 6e 65 72 61 74 65 20 61 20 66 75 6e 63 74  Generate a funct
12ee0 69 6f 6e 20 6f 66 20 72 65 63 75 72 73 69 76 65  ion of recursive
12ef0 20 66 75 6e 63 74 69 6f 6e 73 20 74 68 61 74 20   functions that 
12f00 63 61 6e 20 62 65 20 75 73 65 64 20 74 6f 20 63  can be used to c
12f10 68 65 63 6b 20 65 61 63 68 20 65 6c 65 6d 65 6e  heck each elemen
12f20 74 0a 09 09 69 66 20 28 20 21 6d 61 74 63 68 20  t...if ( !match 
12f30 29 20 7b 0a 09 09 09 6d 61 74 63 68 20 3d 20 74  ) {....match = t
12f40 6f 6b 65 6e 69 7a 65 28 20 73 65 6c 65 63 74 6f  okenize( selecto
12f50 72 20 29 3b 0a 09 09 7d 0a 09 09 69 20 3d 20 6d  r );...}...i = m
12f60 61 74 63 68 2e 6c 65 6e 67 74 68 3b 0a 09 09 77  atch.length;...w
12f70 68 69 6c 65 20 28 20 69 2d 2d 20 29 20 7b 0a 09  hile ( i-- ) {..
12f80 09 09 63 61 63 68 65 64 20 3d 20 6d 61 74 63 68  ..cached = match
12f90 65 72 46 72 6f 6d 54 6f 6b 65 6e 73 28 20 6d 61  erFromTokens( ma
12fa0 74 63 68 5b 20 69 20 5d 20 29 3b 0a 09 09 09 69  tch[ i ] );....i
12fb0 66 20 28 20 63 61 63 68 65 64 5b 20 65 78 70 61  f ( cached[ expa
12fc0 6e 64 6f 20 5d 20 29 20 7b 0a 09 09 09 09 73 65  ndo ] ) {.....se
12fd0 74 4d 61 74 63 68 65 72 73 2e 70 75 73 68 28 20  tMatchers.push( 
12fe0 63 61 63 68 65 64 20 29 3b 0a 09 09 09 7d 20 65  cached );....} e
12ff0 6c 73 65 20 7b 0a 09 09 09 09 65 6c 65 6d 65 6e  lse {.....elemen
13000 74 4d 61 74 63 68 65 72 73 2e 70 75 73 68 28 20  tMatchers.push( 
13010 63 61 63 68 65 64 20 29 3b 0a 09 09 09 7d 0a 09  cached );....}..
13020 09 7d 0a 0a 09 09 2f 2f 20 43 61 63 68 65 20 74  .}....// Cache t
13030 68 65 20 63 6f 6d 70 69 6c 65 64 20 66 75 6e 63  he compiled func
13040 74 69 6f 6e 0a 09 09 63 61 63 68 65 64 20 3d 20  tion...cached = 
13050 63 6f 6d 70 69 6c 65 72 43 61 63 68 65 28 0a 09  compilerCache(..
13060 09 09 73 65 6c 65 63 74 6f 72 2c 0a 09 09 09 6d  ..selector,....m
13070 61 74 63 68 65 72 46 72 6f 6d 47 72 6f 75 70 4d  atcherFromGroupM
13080 61 74 63 68 65 72 73 28 20 65 6c 65 6d 65 6e 74  atchers( element
13090 4d 61 74 63 68 65 72 73 2c 20 73 65 74 4d 61 74  Matchers, setMat
130a0 63 68 65 72 73 20 29 0a 09 09 29 3b 0a 0a 09 09  chers )...);....
130b0 2f 2f 20 53 61 76 65 20 73 65 6c 65 63 74 6f 72  // Save selector
130c0 20 61 6e 64 20 74 6f 6b 65 6e 69 7a 61 74 69 6f   and tokenizatio
130d0 6e 0a 09 09 63 61 63 68 65 64 2e 73 65 6c 65 63  n...cached.selec
130e0 74 6f 72 20 3d 20 73 65 6c 65 63 74 6f 72 3b 0a  tor = selector;.
130f0 09 7d 0a 09 72 65 74 75 72 6e 20 63 61 63 68 65  .}..return cache
13100 64 3b 0a 7d 3b 0a 0a 2f 2a 2a 0a 20 2a 20 41 20  d;.};../**. * A 
13110 6c 6f 77 2d 6c 65 76 65 6c 20 73 65 6c 65 63 74  low-level select
13120 69 6f 6e 20 66 75 6e 63 74 69 6f 6e 20 74 68 61  ion function tha
13130 74 20 77 6f 72 6b 73 20 77 69 74 68 20 53 69 7a  t works with Siz
13140 7a 6c 65 27 73 20 63 6f 6d 70 69 6c 65 64 0a 20  zle's compiled. 
13150 2a 20 20 73 65 6c 65 63 74 6f 72 20 66 75 6e 63  *  selector func
13160 74 69 6f 6e 73 0a 20 2a 20 40 70 61 72 61 6d 20  tions. * @param 
13170 7b 53 74 72 69 6e 67 7c 46 75 6e 63 74 69 6f 6e  {String|Function
13180 7d 20 73 65 6c 65 63 74 6f 72 20 41 20 73 65 6c  } selector A sel
13190 65 63 74 6f 72 20 6f 72 20 61 20 70 72 65 2d 63  ector or a pre-c
131a0 6f 6d 70 69 6c 65 64 0a 20 2a 20 20 73 65 6c 65  ompiled. *  sele
131b0 63 74 6f 72 20 66 75 6e 63 74 69 6f 6e 20 62 75  ctor function bu
131c0 69 6c 74 20 77 69 74 68 20 53 69 7a 7a 6c 65 2e  ilt with Sizzle.
131d0 63 6f 6d 70 69 6c 65 0a 20 2a 20 40 70 61 72 61  compile. * @para
131e0 6d 20 7b 45 6c 65 6d 65 6e 74 7d 20 63 6f 6e 74  m {Element} cont
131f0 65 78 74 0a 20 2a 20 40 70 61 72 61 6d 20 7b 41  ext. * @param {A
13200 72 72 61 79 7d 20 5b 72 65 73 75 6c 74 73 5d 0a  rray} [results].
13210 20 2a 20 40 70 61 72 61 6d 20 7b 41 72 72 61 79   * @param {Array
13220 7d 20 5b 73 65 65 64 5d 20 41 20 73 65 74 20 6f  } [seed] A set o
13230 66 20 65 6c 65 6d 65 6e 74 73 20 74 6f 20 6d 61  f elements to ma
13240 74 63 68 20 61 67 61 69 6e 73 74 0a 20 2a 2f 0a  tch against. */.
13250 73 65 6c 65 63 74 20 3d 20 53 69 7a 7a 6c 65 2e  select = Sizzle.
13260 73 65 6c 65 63 74 20 3d 20 66 75 6e 63 74 69 6f  select = functio
13270 6e 28 20 73 65 6c 65 63 74 6f 72 2c 20 63 6f 6e  n( selector, con
13280 74 65 78 74 2c 20 72 65 73 75 6c 74 73 2c 20 73  text, results, s
13290 65 65 64 20 29 20 7b 0a 09 76 61 72 20 69 2c 20  eed ) {..var i, 
132a0 74 6f 6b 65 6e 73 2c 20 74 6f 6b 65 6e 2c 20 74  tokens, token, t
132b0 79 70 65 2c 20 66 69 6e 64 2c 0a 09 09 63 6f 6d  ype, find,...com
132c0 70 69 6c 65 64 20 3d 20 74 79 70 65 6f 66 20 73  piled = typeof s
132d0 65 6c 65 63 74 6f 72 20 3d 3d 3d 20 22 66 75 6e  elector === "fun
132e0 63 74 69 6f 6e 22 20 26 26 20 73 65 6c 65 63 74  ction" && select
132f0 6f 72 2c 0a 09 09 6d 61 74 63 68 20 3d 20 21 73  or,...match = !s
13300 65 65 64 20 26 26 20 74 6f 6b 65 6e 69 7a 65 28  eed && tokenize(
13310 20 28 20 73 65 6c 65 63 74 6f 72 20 3d 20 63 6f   ( selector = co
13320 6d 70 69 6c 65 64 2e 73 65 6c 65 63 74 6f 72 20  mpiled.selector 
13330 7c 7c 20 73 65 6c 65 63 74 6f 72 20 29 20 29 3b  || selector ) );
13340 0a 0a 09 72 65 73 75 6c 74 73 20 3d 20 72 65 73  ...results = res
13350 75 6c 74 73 20 7c 7c 20 5b 5d 3b 0a 0a 09 2f 2f  ults || [];...//
13360 20 54 72 79 20 74 6f 20 6d 69 6e 69 6d 69 7a 65   Try to minimize
13370 20 6f 70 65 72 61 74 69 6f 6e 73 20 69 66 20 74   operations if t
13380 68 65 72 65 20 69 73 20 6f 6e 6c 79 20 6f 6e 65  here is only one
13390 20 73 65 6c 65 63 74 6f 72 20 69 6e 20 74 68 65   selector in the
133a0 20 6c 69 73 74 20 61 6e 64 20 6e 6f 20 73 65 65   list and no see
133b0 64 0a 09 2f 2f 20 28 74 68 65 20 6c 61 74 74 65  d..// (the latte
133c0 72 20 6f 66 20 77 68 69 63 68 20 67 75 61 72 61  r of which guara
133d0 6e 74 65 65 73 20 75 73 20 63 6f 6e 74 65 78 74  ntees us context
133e0 29 0a 09 69 66 20 28 20 6d 61 74 63 68 2e 6c 65  )..if ( match.le
133f0 6e 67 74 68 20 3d 3d 3d 20 31 20 29 20 7b 0a 0a  ngth === 1 ) {..
13400 09 09 2f 2f 20 52 65 64 75 63 65 20 63 6f 6e 74  ..// Reduce cont
13410 65 78 74 20 69 66 20 74 68 65 20 6c 65 61 64 69  ext if the leadi
13420 6e 67 20 63 6f 6d 70 6f 75 6e 64 20 73 65 6c 65  ng compound sele
13430 63 74 6f 72 20 69 73 20 61 6e 20 49 44 0a 09 09  ctor is an ID...
13440 74 6f 6b 65 6e 73 20 3d 20 6d 61 74 63 68 5b 20  tokens = match[ 
13450 30 20 5d 20 3d 20 6d 61 74 63 68 5b 20 30 20 5d  0 ] = match[ 0 ]
13460 2e 73 6c 69 63 65 28 20 30 20 29 3b 0a 09 09 69  .slice( 0 );...i
13470 66 20 28 20 74 6f 6b 65 6e 73 2e 6c 65 6e 67 74  f ( tokens.lengt
13480 68 20 3e 20 32 20 26 26 20 28 20 74 6f 6b 65 6e  h > 2 && ( token
13490 20 3d 20 74 6f 6b 65 6e 73 5b 20 30 20 5d 20 29   = tokens[ 0 ] )
134a0 2e 74 79 70 65 20 3d 3d 3d 20 22 49 44 22 20 26  .type === "ID" &
134b0 26 0a 09 09 09 63 6f 6e 74 65 78 74 2e 6e 6f 64  &....context.nod
134c0 65 54 79 70 65 20 3d 3d 3d 20 39 20 26 26 20 64  eType === 9 && d
134d0 6f 63 75 6d 65 6e 74 49 73 48 54 4d 4c 20 26 26  ocumentIsHTML &&
134e0 20 45 78 70 72 2e 72 65 6c 61 74 69 76 65 5b 20   Expr.relative[ 
134f0 74 6f 6b 65 6e 73 5b 20 31 20 5d 2e 74 79 70 65  tokens[ 1 ].type
13500 20 5d 20 29 20 7b 0a 0a 09 09 09 63 6f 6e 74 65   ] ) {.....conte
13510 78 74 20 3d 20 28 20 45 78 70 72 2e 66 69 6e 64  xt = ( Expr.find
13520 5b 20 22 49 44 22 20 5d 28 20 74 6f 6b 65 6e 2e  [ "ID" ]( token.
13530 6d 61 74 63 68 65 73 5b 20 30 20 5d 0a 09 09 09  matches[ 0 ]....
13540 09 2e 72 65 70 6c 61 63 65 28 20 72 75 6e 65 73  ..replace( runes
13550 63 61 70 65 2c 20 66 75 6e 65 73 63 61 70 65 20  cape, funescape 
13560 29 2c 20 63 6f 6e 74 65 78 74 20 29 20 7c 7c 20  ), context ) || 
13570 5b 5d 20 29 5b 20 30 20 5d 3b 0a 09 09 09 69 66  [] )[ 0 ];....if
13580 20 28 20 21 63 6f 6e 74 65 78 74 20 29 20 7b 0a   ( !context ) {.
13590 09 09 09 09 72 65 74 75 72 6e 20 72 65 73 75 6c  ....return resul
135a0 74 73 3b 0a 0a 09 09 09 2f 2f 20 50 72 65 63 6f  ts;.....// Preco
135b0 6d 70 69 6c 65 64 20 6d 61 74 63 68 65 72 73 20  mpiled matchers 
135c0 77 69 6c 6c 20 73 74 69 6c 6c 20 76 65 72 69 66  will still verif
135d0 79 20 61 6e 63 65 73 74 72 79 2c 20 73 6f 20 73  y ancestry, so s
135e0 74 65 70 20 75 70 20 61 20 6c 65 76 65 6c 0a 09  tep up a level..
135f0 09 09 7d 20 65 6c 73 65 20 69 66 20 28 20 63 6f  ..} else if ( co
13600 6d 70 69 6c 65 64 20 29 20 7b 0a 09 09 09 09 63  mpiled ) {.....c
13610 6f 6e 74 65 78 74 20 3d 20 63 6f 6e 74 65 78 74  ontext = context
13620 2e 70 61 72 65 6e 74 4e 6f 64 65 3b 0a 09 09 09  .parentNode;....
13630 7d 0a 0a 09 09 09 73 65 6c 65 63 74 6f 72 20 3d  }.....selector =
13640 20 73 65 6c 65 63 74 6f 72 2e 73 6c 69 63 65 28   selector.slice(
13650 20 74 6f 6b 65 6e 73 2e 73 68 69 66 74 28 29 2e   tokens.shift().
13660 76 61 6c 75 65 2e 6c 65 6e 67 74 68 20 29 3b 0a  value.length );.
13670 09 09 7d 0a 0a 09 09 2f 2f 20 46 65 74 63 68 20  ..}....// Fetch 
13680 61 20 73 65 65 64 20 73 65 74 20 66 6f 72 20 72  a seed set for r
13690 69 67 68 74 2d 74 6f 2d 6c 65 66 74 20 6d 61 74  ight-to-left mat
136a0 63 68 69 6e 67 0a 09 09 69 20 3d 20 6d 61 74 63  ching...i = matc
136b0 68 45 78 70 72 5b 20 22 6e 65 65 64 73 43 6f 6e  hExpr[ "needsCon
136c0 74 65 78 74 22 20 5d 2e 74 65 73 74 28 20 73 65  text" ].test( se
136d0 6c 65 63 74 6f 72 20 29 20 3f 20 30 20 3a 20 74  lector ) ? 0 : t
136e0 6f 6b 65 6e 73 2e 6c 65 6e 67 74 68 3b 0a 09 09  okens.length;...
136f0 77 68 69 6c 65 20 28 20 69 2d 2d 20 29 20 7b 0a  while ( i-- ) {.
13700 09 09 09 74 6f 6b 65 6e 20 3d 20 74 6f 6b 65 6e  ...token = token
13710 73 5b 20 69 20 5d 3b 0a 0a 09 09 09 2f 2f 20 41  s[ i ];.....// A
13720 62 6f 72 74 20 69 66 20 77 65 20 68 69 74 20 61  bort if we hit a
13730 20 63 6f 6d 62 69 6e 61 74 6f 72 0a 09 09 09 69   combinator....i
13740 66 20 28 20 45 78 70 72 2e 72 65 6c 61 74 69 76  f ( Expr.relativ
13750 65 5b 20 28 20 74 79 70 65 20 3d 20 74 6f 6b 65  e[ ( type = toke
13760 6e 2e 74 79 70 65 20 29 20 5d 20 29 20 7b 0a 09  n.type ) ] ) {..
13770 09 09 09 62 72 65 61 6b 3b 0a 09 09 09 7d 0a 09  ...break;....}..
13780 09 09 69 66 20 28 20 28 20 66 69 6e 64 20 3d 20  ..if ( ( find = 
13790 45 78 70 72 2e 66 69 6e 64 5b 20 74 79 70 65 20  Expr.find[ type 
137a0 5d 20 29 20 29 20 7b 0a 0a 09 09 09 09 2f 2f 20  ] ) ) {......// 
137b0 53 65 61 72 63 68 2c 20 65 78 70 61 6e 64 69 6e  Search, expandin
137c0 67 20 63 6f 6e 74 65 78 74 20 66 6f 72 20 6c 65  g context for le
137d0 61 64 69 6e 67 20 73 69 62 6c 69 6e 67 20 63 6f  ading sibling co
137e0 6d 62 69 6e 61 74 6f 72 73 0a 09 09 09 09 69 66  mbinators.....if
137f0 20 28 20 28 20 73 65 65 64 20 3d 20 66 69 6e 64   ( ( seed = find
13800 28 0a 09 09 09 09 09 74 6f 6b 65 6e 2e 6d 61 74  (......token.mat
13810 63 68 65 73 5b 20 30 20 5d 2e 72 65 70 6c 61 63  ches[ 0 ].replac
13820 65 28 20 72 75 6e 65 73 63 61 70 65 2c 20 66 75  e( runescape, fu
13830 6e 65 73 63 61 70 65 20 29 2c 0a 09 09 09 09 09  nescape ),......
13840 72 73 69 62 6c 69 6e 67 2e 74 65 73 74 28 20 74  rsibling.test( t
13850 6f 6b 65 6e 73 5b 20 30 20 5d 2e 74 79 70 65 20  okens[ 0 ].type 
13860 29 20 26 26 20 74 65 73 74 43 6f 6e 74 65 78 74  ) && testContext
13870 28 20 63 6f 6e 74 65 78 74 2e 70 61 72 65 6e 74  ( context.parent
13880 4e 6f 64 65 20 29 20 7c 7c 0a 09 09 09 09 09 09  Node ) ||.......
13890 63 6f 6e 74 65 78 74 0a 09 09 09 09 29 20 29 20  context.....) ) 
138a0 29 20 7b 0a 0a 09 09 09 09 09 2f 2f 20 49 66 20  ) {.......// If 
138b0 73 65 65 64 20 69 73 20 65 6d 70 74 79 20 6f 72  seed is empty or
138c0 20 6e 6f 20 74 6f 6b 65 6e 73 20 72 65 6d 61 69   no tokens remai
138d0 6e 2c 20 77 65 20 63 61 6e 20 72 65 74 75 72 6e  n, we can return
138e0 20 65 61 72 6c 79 0a 09 09 09 09 09 74 6f 6b 65   early......toke
138f0 6e 73 2e 73 70 6c 69 63 65 28 20 69 2c 20 31 20  ns.splice( i, 1 
13900 29 3b 0a 09 09 09 09 09 73 65 6c 65 63 74 6f 72  );......selector
13910 20 3d 20 73 65 65 64 2e 6c 65 6e 67 74 68 20 26   = seed.length &
13920 26 20 74 6f 53 65 6c 65 63 74 6f 72 28 20 74 6f  & toSelector( to
13930 6b 65 6e 73 20 29 3b 0a 09 09 09 09 09 69 66 20  kens );......if 
13940 28 20 21 73 65 6c 65 63 74 6f 72 20 29 20 7b 0a  ( !selector ) {.
13950 09 09 09 09 09 09 70 75 73 68 2e 61 70 70 6c 79  ......push.apply
13960 28 20 72 65 73 75 6c 74 73 2c 20 73 65 65 64 20  ( results, seed 
13970 29 3b 0a 09 09 09 09 09 09 72 65 74 75 72 6e 20  );.......return 
13980 72 65 73 75 6c 74 73 3b 0a 09 09 09 09 09 7d 0a  results;......}.
13990 0a 09 09 09 09 09 62 72 65 61 6b 3b 0a 09 09 09  ......break;....
139a0 09 7d 0a 09 09 09 7d 0a 09 09 7d 0a 09 7d 0a 0a  .}....}...}..}..
139b0 09 2f 2f 20 43 6f 6d 70 69 6c 65 20 61 6e 64 20  .// Compile and 
139c0 65 78 65 63 75 74 65 20 61 20 66 69 6c 74 65 72  execute a filter
139d0 69 6e 67 20 66 75 6e 63 74 69 6f 6e 20 69 66 20  ing function if 
139e0 6f 6e 65 20 69 73 20 6e 6f 74 20 70 72 6f 76 69  one is not provi
139f0 64 65 64 0a 09 2f 2f 20 50 72 6f 76 69 64 65 20  ded..// Provide 
13a00 60 6d 61 74 63 68 60 20 74 6f 20 61 76 6f 69 64  `match` to avoid
13a10 20 72 65 74 6f 6b 65 6e 69 7a 61 74 69 6f 6e 20   retokenization 
13a20 69 66 20 77 65 20 6d 6f 64 69 66 69 65 64 20 74  if we modified t
13a30 68 65 20 73 65 6c 65 63 74 6f 72 20 61 62 6f 76  he selector abov
13a40 65 0a 09 28 20 63 6f 6d 70 69 6c 65 64 20 7c 7c  e..( compiled ||
13a50 20 63 6f 6d 70 69 6c 65 28 20 73 65 6c 65 63 74   compile( select
13a60 6f 72 2c 20 6d 61 74 63 68 20 29 20 29 28 0a 09  or, match ) )(..
13a70 09 73 65 65 64 2c 0a 09 09 63 6f 6e 74 65 78 74  .seed,...context
13a80 2c 0a 09 09 21 64 6f 63 75 6d 65 6e 74 49 73 48  ,...!documentIsH
13a90 54 4d 4c 2c 0a 09 09 72 65 73 75 6c 74 73 2c 0a  TML,...results,.
13aa0 09 09 21 63 6f 6e 74 65 78 74 20 7c 7c 20 72 73  ..!context || rs
13ab0 69 62 6c 69 6e 67 2e 74 65 73 74 28 20 73 65 6c  ibling.test( sel
13ac0 65 63 74 6f 72 20 29 20 26 26 20 74 65 73 74 43  ector ) && testC
13ad0 6f 6e 74 65 78 74 28 20 63 6f 6e 74 65 78 74 2e  ontext( context.
13ae0 70 61 72 65 6e 74 4e 6f 64 65 20 29 20 7c 7c 20  parentNode ) || 
13af0 63 6f 6e 74 65 78 74 0a 09 29 3b 0a 09 72 65 74  context..);..ret
13b00 75 72 6e 20 72 65 73 75 6c 74 73 3b 0a 7d 3b 0a  urn results;.};.
13b10 0a 2f 2f 20 4f 6e 65 2d 74 69 6d 65 20 61 73 73  .// One-time ass
13b20 69 67 6e 6d 65 6e 74 73 0a 0a 2f 2f 20 53 6f 72  ignments..// Sor
13b30 74 20 73 74 61 62 69 6c 69 74 79 0a 73 75 70 70  t stability.supp
13b40 6f 72 74 2e 73 6f 72 74 53 74 61 62 6c 65 20 3d  ort.sortStable =
13b50 20 65 78 70 61 6e 64 6f 2e 73 70 6c 69 74 28 20   expando.split( 
13b60 22 22 20 29 2e 73 6f 72 74 28 20 73 6f 72 74 4f  "" ).sort( sortO
13b70 72 64 65 72 20 29 2e 6a 6f 69 6e 28 20 22 22 20  rder ).join( "" 
13b80 29 20 3d 3d 3d 20 65 78 70 61 6e 64 6f 3b 0a 0a  ) === expando;..
13b90 2f 2f 20 53 75 70 70 6f 72 74 3a 20 43 68 72 6f  // Support: Chro
13ba0 6d 65 20 31 34 2d 33 35 2b 0a 2f 2f 20 41 6c 77  me 14-35+.// Alw
13bb0 61 79 73 20 61 73 73 75 6d 65 20 64 75 70 6c 69  ays assume dupli
13bc0 63 61 74 65 73 20 69 66 20 74 68 65 79 20 61 72  cates if they ar
13bd0 65 6e 27 74 20 70 61 73 73 65 64 20 74 6f 20 74  en't passed to t
13be0 68 65 20 63 6f 6d 70 61 72 69 73 6f 6e 20 66 75  he comparison fu
13bf0 6e 63 74 69 6f 6e 0a 73 75 70 70 6f 72 74 2e 64  nction.support.d
13c00 65 74 65 63 74 44 75 70 6c 69 63 61 74 65 73 20  etectDuplicates 
13c10 3d 20 21 21 68 61 73 44 75 70 6c 69 63 61 74 65  = !!hasDuplicate
13c20 3b 0a 0a 2f 2f 20 49 6e 69 74 69 61 6c 69 7a 65  ;..// Initialize
13c30 20 61 67 61 69 6e 73 74 20 74 68 65 20 64 65 66   against the def
13c40 61 75 6c 74 20 64 6f 63 75 6d 65 6e 74 0a 73 65  ault document.se
13c50 74 44 6f 63 75 6d 65 6e 74 28 29 3b 0a 0a 2f 2f  tDocument();..//
13c60 20 53 75 70 70 6f 72 74 3a 20 57 65 62 6b 69 74   Support: Webkit
13c70 3c 35 33 37 2e 33 32 20 2d 20 53 61 66 61 72 69  <537.32 - Safari
13c80 20 36 2e 30 2e 33 2f 43 68 72 6f 6d 65 20 32 35   6.0.3/Chrome 25
13c90 20 28 66 69 78 65 64 20 69 6e 20 43 68 72 6f 6d   (fixed in Chrom
13ca0 65 20 32 37 29 0a 2f 2f 20 44 65 74 61 63 68 65  e 27).// Detache
13cb0 64 20 6e 6f 64 65 73 20 63 6f 6e 66 6f 75 6e 64  d nodes confound
13cc0 69 6e 67 6c 79 20 66 6f 6c 6c 6f 77 20 2a 65 61  ingly follow *ea
13cd0 63 68 20 6f 74 68 65 72 2a 0a 73 75 70 70 6f 72  ch other*.suppor
13ce0 74 2e 73 6f 72 74 44 65 74 61 63 68 65 64 20 3d  t.sortDetached =
13cf0 20 61 73 73 65 72 74 28 20 66 75 6e 63 74 69 6f   assert( functio
13d00 6e 28 20 65 6c 20 29 20 7b 0a 0a 09 2f 2f 20 53  n( el ) {...// S
13d10 68 6f 75 6c 64 20 72 65 74 75 72 6e 20 31 2c 20  hould return 1, 
13d20 62 75 74 20 72 65 74 75 72 6e 73 20 34 20 28 66  but returns 4 (f
13d30 6f 6c 6c 6f 77 69 6e 67 29 0a 09 72 65 74 75 72  ollowing)..retur
13d40 6e 20 65 6c 2e 63 6f 6d 70 61 72 65 44 6f 63 75  n el.compareDocu
13d50 6d 65 6e 74 50 6f 73 69 74 69 6f 6e 28 20 64 6f  mentPosition( do
13d60 63 75 6d 65 6e 74 2e 63 72 65 61 74 65 45 6c 65  cument.createEle
13d70 6d 65 6e 74 28 20 22 66 69 65 6c 64 73 65 74 22  ment( "fieldset"
13d80 20 29 20 29 20 26 20 31 3b 0a 7d 20 29 3b 0a 0a   ) ) & 1;.} );..
13d90 2f 2f 20 53 75 70 70 6f 72 74 3a 20 49 45 3c 38  // Support: IE<8
13da0 0a 2f 2f 20 50 72 65 76 65 6e 74 20 61 74 74 72  .// Prevent attr
13db0 69 62 75 74 65 2f 70 72 6f 70 65 72 74 79 20 22  ibute/property "
13dc0 69 6e 74 65 72 70 6f 6c 61 74 69 6f 6e 22 0a 2f  interpolation"./
13dd0 2f 20 68 74 74 70 73 3a 2f 2f 6d 73 64 6e 2e 6d  / https://msdn.m
13de0 69 63 72 6f 73 6f 66 74 2e 63 6f 6d 2f 65 6e 2d  icrosoft.com/en-
13df0 75 73 2f 6c 69 62 72 61 72 79 2f 6d 73 35 33 36  us/library/ms536
13e00 34 32 39 25 32 38 56 53 2e 38 35 25 32 39 2e 61  429%28VS.85%29.a
13e10 73 70 78 0a 69 66 20 28 20 21 61 73 73 65 72 74  spx.if ( !assert
13e20 28 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c 20 29  ( function( el )
13e30 20 7b 0a 09 65 6c 2e 69 6e 6e 65 72 48 54 4d 4c   {..el.innerHTML
13e40 20 3d 20 22 3c 61 20 68 72 65 66 3d 27 23 27 3e   = "<a href='#'>
13e50 3c 2f 61 3e 22 3b 0a 09 72 65 74 75 72 6e 20 65  </a>";..return e
13e60 6c 2e 66 69 72 73 74 43 68 69 6c 64 2e 67 65 74  l.firstChild.get
13e70 41 74 74 72 69 62 75 74 65 28 20 22 68 72 65 66  Attribute( "href
13e80 22 20 29 20 3d 3d 3d 20 22 23 22 3b 0a 7d 20 29  " ) === "#";.} )
13e90 20 29 20 7b 0a 09 61 64 64 48 61 6e 64 6c 65 28   ) {..addHandle(
13ea0 20 22 74 79 70 65 7c 68 72 65 66 7c 68 65 69 67   "type|href|heig
13eb0 68 74 7c 77 69 64 74 68 22 2c 20 66 75 6e 63 74  ht|width", funct
13ec0 69 6f 6e 28 20 65 6c 65 6d 2c 20 6e 61 6d 65 2c  ion( elem, name,
13ed0 20 69 73 58 4d 4c 20 29 20 7b 0a 09 09 69 66 20   isXML ) {...if 
13ee0 28 20 21 69 73 58 4d 4c 20 29 20 7b 0a 09 09 09  ( !isXML ) {....
13ef0 72 65 74 75 72 6e 20 65 6c 65 6d 2e 67 65 74 41  return elem.getA
13f00 74 74 72 69 62 75 74 65 28 20 6e 61 6d 65 2c 20  ttribute( name, 
13f10 6e 61 6d 65 2e 74 6f 4c 6f 77 65 72 43 61 73 65  name.toLowerCase
13f20 28 29 20 3d 3d 3d 20 22 74 79 70 65 22 20 3f 20  () === "type" ? 
13f30 31 20 3a 20 32 20 29 3b 0a 09 09 7d 0a 09 7d 20  1 : 2 );...}..} 
13f40 29 3b 0a 7d 0a 0a 2f 2f 20 53 75 70 70 6f 72 74  );.}..// Support
13f50 3a 20 49 45 3c 39 0a 2f 2f 20 55 73 65 20 64 65  : IE<9.// Use de
13f60 66 61 75 6c 74 56 61 6c 75 65 20 69 6e 20 70 6c  faultValue in pl
13f70 61 63 65 20 6f 66 20 67 65 74 41 74 74 72 69 62  ace of getAttrib
13f80 75 74 65 28 22 76 61 6c 75 65 22 29 0a 69 66 20  ute("value").if 
13f90 28 20 21 73 75 70 70 6f 72 74 2e 61 74 74 72 69  ( !support.attri
13fa0 62 75 74 65 73 20 7c 7c 20 21 61 73 73 65 72 74  butes || !assert
13fb0 28 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c 20 29  ( function( el )
13fc0 20 7b 0a 09 65 6c 2e 69 6e 6e 65 72 48 54 4d 4c   {..el.innerHTML
13fd0 20 3d 20 22 3c 69 6e 70 75 74 2f 3e 22 3b 0a 09   = "<input/>";..
13fe0 65 6c 2e 66 69 72 73 74 43 68 69 6c 64 2e 73 65  el.firstChild.se
13ff0 74 41 74 74 72 69 62 75 74 65 28 20 22 76 61 6c  tAttribute( "val
14000 75 65 22 2c 20 22 22 20 29 3b 0a 09 72 65 74 75  ue", "" );..retu
14010 72 6e 20 65 6c 2e 66 69 72 73 74 43 68 69 6c 64  rn el.firstChild
14020 2e 67 65 74 41 74 74 72 69 62 75 74 65 28 20 22  .getAttribute( "
14030 76 61 6c 75 65 22 20 29 20 3d 3d 3d 20 22 22 3b  value" ) === "";
14040 0a 7d 20 29 20 29 20 7b 0a 09 61 64 64 48 61 6e  .} ) ) {..addHan
14050 64 6c 65 28 20 22 76 61 6c 75 65 22 2c 20 66 75  dle( "value", fu
14060 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 2c 20 5f 6e  nction( elem, _n
14070 61 6d 65 2c 20 69 73 58 4d 4c 20 29 20 7b 0a 09  ame, isXML ) {..
14080 09 69 66 20 28 20 21 69 73 58 4d 4c 20 26 26 20  .if ( !isXML && 
14090 65 6c 65 6d 2e 6e 6f 64 65 4e 61 6d 65 2e 74 6f  elem.nodeName.to
140a0 4c 6f 77 65 72 43 61 73 65 28 29 20 3d 3d 3d 20  LowerCase() === 
140b0 22 69 6e 70 75 74 22 20 29 20 7b 0a 09 09 09 72  "input" ) {....r
140c0 65 74 75 72 6e 20 65 6c 65 6d 2e 64 65 66 61 75  eturn elem.defau
140d0 6c 74 56 61 6c 75 65 3b 0a 09 09 7d 0a 09 7d 20  ltValue;...}..} 
140e0 29 3b 0a 7d 0a 0a 2f 2f 20 53 75 70 70 6f 72 74  );.}..// Support
140f0 3a 20 49 45 3c 39 0a 2f 2f 20 55 73 65 20 67 65  : IE<9.// Use ge
14100 74 41 74 74 72 69 62 75 74 65 4e 6f 64 65 20 74  tAttributeNode t
14110 6f 20 66 65 74 63 68 20 62 6f 6f 6c 65 61 6e 73  o fetch booleans
14120 20 77 68 65 6e 20 67 65 74 41 74 74 72 69 62 75   when getAttribu
14130 74 65 20 6c 69 65 73 0a 69 66 20 28 20 21 61 73  te lies.if ( !as
14140 73 65 72 74 28 20 66 75 6e 63 74 69 6f 6e 28 20  sert( function( 
14150 65 6c 20 29 20 7b 0a 09 72 65 74 75 72 6e 20 65  el ) {..return e
14160 6c 2e 67 65 74 41 74 74 72 69 62 75 74 65 28 20  l.getAttribute( 
14170 22 64 69 73 61 62 6c 65 64 22 20 29 20 3d 3d 20  "disabled" ) == 
14180 6e 75 6c 6c 3b 0a 7d 20 29 20 29 20 7b 0a 09 61  null;.} ) ) {..a
14190 64 64 48 61 6e 64 6c 65 28 20 62 6f 6f 6c 65 61  ddHandle( boolea
141a0 6e 73 2c 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c  ns, function( el
141b0 65 6d 2c 20 6e 61 6d 65 2c 20 69 73 58 4d 4c 20  em, name, isXML 
141c0 29 20 7b 0a 09 09 76 61 72 20 76 61 6c 3b 0a 09  ) {...var val;..
141d0 09 69 66 20 28 20 21 69 73 58 4d 4c 20 29 20 7b  .if ( !isXML ) {
141e0 0a 09 09 09 72 65 74 75 72 6e 20 65 6c 65 6d 5b  ....return elem[
141f0 20 6e 61 6d 65 20 5d 20 3d 3d 3d 20 74 72 75 65   name ] === true
14200 20 3f 20 6e 61 6d 65 2e 74 6f 4c 6f 77 65 72 43   ? name.toLowerC
14210 61 73 65 28 29 20 3a 0a 09 09 09 09 28 20 76 61  ase() :.....( va
14220 6c 20 3d 20 65 6c 65 6d 2e 67 65 74 41 74 74 72  l = elem.getAttr
14230 69 62 75 74 65 4e 6f 64 65 28 20 6e 61 6d 65 20  ibuteNode( name 
14240 29 20 29 20 26 26 20 76 61 6c 2e 73 70 65 63 69  ) ) && val.speci
14250 66 69 65 64 20 3f 0a 09 09 09 09 09 76 61 6c 2e  fied ?......val.
14260 76 61 6c 75 65 20 3a 0a 09 09 09 09 09 6e 75 6c  value :......nul
14270 6c 3b 0a 09 09 7d 0a 09 7d 20 29 3b 0a 7d 0a 0a  l;...}..} );.}..
14280 72 65 74 75 72 6e 20 53 69 7a 7a 6c 65 3b 0a 0a  return Sizzle;..
14290 7d 20 29 28 20 77 69 6e 64 6f 77 20 29 3b 0a 0a  } )( window );..
142a0 0a 0a 6a 51 75 65 72 79 2e 66 69 6e 64 20 3d 20  ..jQuery.find = 
142b0 53 69 7a 7a 6c 65 3b 0a 6a 51 75 65 72 79 2e 65  Sizzle;.jQuery.e
142c0 78 70 72 20 3d 20 53 69 7a 7a 6c 65 2e 73 65 6c  xpr = Sizzle.sel
142d0 65 63 74 6f 72 73 3b 0a 0a 2f 2f 20 44 65 70 72  ectors;..// Depr
142e0 65 63 61 74 65 64 0a 6a 51 75 65 72 79 2e 65 78  ecated.jQuery.ex
142f0 70 72 5b 20 22 3a 22 20 5d 20 3d 20 6a 51 75 65  pr[ ":" ] = jQue
14300 72 79 2e 65 78 70 72 2e 70 73 65 75 64 6f 73 3b  ry.expr.pseudos;
14310 0a 6a 51 75 65 72 79 2e 75 6e 69 71 75 65 53 6f  .jQuery.uniqueSo
14320 72 74 20 3d 20 6a 51 75 65 72 79 2e 75 6e 69 71  rt = jQuery.uniq
14330 75 65 20 3d 20 53 69 7a 7a 6c 65 2e 75 6e 69 71  ue = Sizzle.uniq
14340 75 65 53 6f 72 74 3b 0a 6a 51 75 65 72 79 2e 74  ueSort;.jQuery.t
14350 65 78 74 20 3d 20 53 69 7a 7a 6c 65 2e 67 65 74  ext = Sizzle.get
14360 54 65 78 74 3b 0a 6a 51 75 65 72 79 2e 69 73 58  Text;.jQuery.isX
14370 4d 4c 44 6f 63 20 3d 20 53 69 7a 7a 6c 65 2e 69  MLDoc = Sizzle.i
14380 73 58 4d 4c 3b 0a 6a 51 75 65 72 79 2e 63 6f 6e  sXML;.jQuery.con
14390 74 61 69 6e 73 20 3d 20 53 69 7a 7a 6c 65 2e 63  tains = Sizzle.c
143a0 6f 6e 74 61 69 6e 73 3b 0a 6a 51 75 65 72 79 2e  ontains;.jQuery.
143b0 65 73 63 61 70 65 53 65 6c 65 63 74 6f 72 20 3d  escapeSelector =
143c0 20 53 69 7a 7a 6c 65 2e 65 73 63 61 70 65 3b 0a   Sizzle.escape;.
143d0 0a 0a 0a 0a 76 61 72 20 64 69 72 20 3d 20 66 75  ....var dir = fu
143e0 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 2c 20 64 69  nction( elem, di
143f0 72 2c 20 75 6e 74 69 6c 20 29 20 7b 0a 09 76 61  r, until ) {..va
14400 72 20 6d 61 74 63 68 65 64 20 3d 20 5b 5d 2c 0a  r matched = [],.
14410 09 09 74 72 75 6e 63 61 74 65 20 3d 20 75 6e 74  ..truncate = unt
14420 69 6c 20 21 3d 3d 20 75 6e 64 65 66 69 6e 65 64  il !== undefined
14430 3b 0a 0a 09 77 68 69 6c 65 20 28 20 28 20 65 6c  ;...while ( ( el
14440 65 6d 20 3d 20 65 6c 65 6d 5b 20 64 69 72 20 5d  em = elem[ dir ]
14450 20 29 20 26 26 20 65 6c 65 6d 2e 6e 6f 64 65 54   ) && elem.nodeT
14460 79 70 65 20 21 3d 3d 20 39 20 29 20 7b 0a 09 09  ype !== 9 ) {...
14470 69 66 20 28 20 65 6c 65 6d 2e 6e 6f 64 65 54 79  if ( elem.nodeTy
14480 70 65 20 3d 3d 3d 20 31 20 29 20 7b 0a 09 09 09  pe === 1 ) {....
14490 69 66 20 28 20 74 72 75 6e 63 61 74 65 20 26 26  if ( truncate &&
144a0 20 6a 51 75 65 72 79 28 20 65 6c 65 6d 20 29 2e   jQuery( elem ).
144b0 69 73 28 20 75 6e 74 69 6c 20 29 20 29 20 7b 0a  is( until ) ) {.
144c0 09 09 09 09 62 72 65 61 6b 3b 0a 09 09 09 7d 0a  ....break;....}.
144d0 09 09 09 6d 61 74 63 68 65 64 2e 70 75 73 68 28  ...matched.push(
144e0 20 65 6c 65 6d 20 29 3b 0a 09 09 7d 0a 09 7d 0a   elem );...}..}.
144f0 09 72 65 74 75 72 6e 20 6d 61 74 63 68 65 64 3b  .return matched;
14500 0a 7d 3b 0a 0a 0a 76 61 72 20 73 69 62 6c 69 6e  .};...var siblin
14510 67 73 20 3d 20 66 75 6e 63 74 69 6f 6e 28 20 6e  gs = function( n
14520 2c 20 65 6c 65 6d 20 29 20 7b 0a 09 76 61 72 20  , elem ) {..var 
14530 6d 61 74 63 68 65 64 20 3d 20 5b 5d 3b 0a 0a 09  matched = [];...
14540 66 6f 72 20 28 20 3b 20 6e 3b 20 6e 20 3d 20 6e  for ( ; n; n = n
14550 2e 6e 65 78 74 53 69 62 6c 69 6e 67 20 29 20 7b  .nextSibling ) {
14560 0a 09 09 69 66 20 28 20 6e 2e 6e 6f 64 65 54 79  ...if ( n.nodeTy
14570 70 65 20 3d 3d 3d 20 31 20 26 26 20 6e 20 21 3d  pe === 1 && n !=
14580 3d 20 65 6c 65 6d 20 29 20 7b 0a 09 09 09 6d 61  = elem ) {....ma
14590 74 63 68 65 64 2e 70 75 73 68 28 20 6e 20 29 3b  tched.push( n );
145a0 0a 09 09 7d 0a 09 7d 0a 0a 09 72 65 74 75 72 6e  ...}..}...return
145b0 20 6d 61 74 63 68 65 64 3b 0a 7d 3b 0a 0a 0a 76   matched;.};...v
145c0 61 72 20 72 6e 65 65 64 73 43 6f 6e 74 65 78 74  ar rneedsContext
145d0 20 3d 20 6a 51 75 65 72 79 2e 65 78 70 72 2e 6d   = jQuery.expr.m
145e0 61 74 63 68 2e 6e 65 65 64 73 43 6f 6e 74 65 78  atch.needsContex
145f0 74 3b 0a 0a 0a 0a 66 75 6e 63 74 69 6f 6e 20 6e  t;....function n
14600 6f 64 65 4e 61 6d 65 28 20 65 6c 65 6d 2c 20 6e  odeName( elem, n
14610 61 6d 65 20 29 20 7b 0a 0a 20 20 72 65 74 75 72  ame ) {..  retur
14620 6e 20 65 6c 65 6d 2e 6e 6f 64 65 4e 61 6d 65 20  n elem.nodeName 
14630 26 26 20 65 6c 65 6d 2e 6e 6f 64 65 4e 61 6d 65  && elem.nodeName
14640 2e 74 6f 4c 6f 77 65 72 43 61 73 65 28 29 20 3d  .toLowerCase() =
14650 3d 3d 20 6e 61 6d 65 2e 74 6f 4c 6f 77 65 72 43  == name.toLowerC
14660 61 73 65 28 29 3b 0a 0a 7d 3b 0a 76 61 72 20 72  ase();..};.var r
14670 73 69 6e 67 6c 65 54 61 67 20 3d 20 28 20 2f 5e  singleTag = ( /^
14680 3c 28 5b 61 2d 7a 5d 5b 5e 5c 2f 5c 30 3e 3a 5c  <([a-z][^\/\0>:\
14690 78 32 30 5c 74 5c 72 5c 6e 5c 66 5d 2a 29 5b 5c  x20\t\r\n\f]*)[\
146a0 78 32 30 5c 74 5c 72 5c 6e 5c 66 5d 2a 5c 2f 3f  x20\t\r\n\f]*\/?
146b0 3e 28 3f 3a 3c 5c 2f 5c 31 3e 7c 29 24 2f 69 20  >(?:<\/\1>|)$/i 
146c0 29 3b 0a 0a 0a 0a 2f 2f 20 49 6d 70 6c 65 6d 65  );....// Impleme
146d0 6e 74 20 74 68 65 20 69 64 65 6e 74 69 63 61 6c  nt the identical
146e0 20 66 75 6e 63 74 69 6f 6e 61 6c 69 74 79 20 66   functionality f
146f0 6f 72 20 66 69 6c 74 65 72 20 61 6e 64 20 6e 6f  or filter and no
14700 74 0a 66 75 6e 63 74 69 6f 6e 20 77 69 6e 6e 6f  t.function winno
14710 77 28 20 65 6c 65 6d 65 6e 74 73 2c 20 71 75 61  w( elements, qua
14720 6c 69 66 69 65 72 2c 20 6e 6f 74 20 29 20 7b 0a  lifier, not ) {.
14730 09 69 66 20 28 20 69 73 46 75 6e 63 74 69 6f 6e  .if ( isFunction
14740 28 20 71 75 61 6c 69 66 69 65 72 20 29 20 29 20  ( qualifier ) ) 
14750 7b 0a 09 09 72 65 74 75 72 6e 20 6a 51 75 65 72  {...return jQuer
14760 79 2e 67 72 65 70 28 20 65 6c 65 6d 65 6e 74 73  y.grep( elements
14770 2c 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c 65 6d  , function( elem
14780 2c 20 69 20 29 20 7b 0a 09 09 09 72 65 74 75 72  , i ) {....retur
14790 6e 20 21 21 71 75 61 6c 69 66 69 65 72 2e 63 61  n !!qualifier.ca
147a0 6c 6c 28 20 65 6c 65 6d 2c 20 69 2c 20 65 6c 65  ll( elem, i, ele
147b0 6d 20 29 20 21 3d 3d 20 6e 6f 74 3b 0a 09 09 7d  m ) !== not;...}
147c0 20 29 3b 0a 09 7d 0a 0a 09 2f 2f 20 53 69 6e 67   );..}...// Sing
147d0 6c 65 20 65 6c 65 6d 65 6e 74 0a 09 69 66 20 28  le element..if (
147e0 20 71 75 61 6c 69 66 69 65 72 2e 6e 6f 64 65 54   qualifier.nodeT
147f0 79 70 65 20 29 20 7b 0a 09 09 72 65 74 75 72 6e  ype ) {...return
14800 20 6a 51 75 65 72 79 2e 67 72 65 70 28 20 65 6c   jQuery.grep( el
14810 65 6d 65 6e 74 73 2c 20 66 75 6e 63 74 69 6f 6e  ements, function
14820 28 20 65 6c 65 6d 20 29 20 7b 0a 09 09 09 72 65  ( elem ) {....re
14830 74 75 72 6e 20 28 20 65 6c 65 6d 20 3d 3d 3d 20  turn ( elem === 
14840 71 75 61 6c 69 66 69 65 72 20 29 20 21 3d 3d 20  qualifier ) !== 
14850 6e 6f 74 3b 0a 09 09 7d 20 29 3b 0a 09 7d 0a 0a  not;...} );..}..
14860 09 2f 2f 20 41 72 72 61 79 6c 69 6b 65 20 6f 66  .// Arraylike of
14870 20 65 6c 65 6d 65 6e 74 73 20 28 6a 51 75 65 72   elements (jQuer
14880 79 2c 20 61 72 67 75 6d 65 6e 74 73 2c 20 41 72  y, arguments, Ar
14890 72 61 79 29 0a 09 69 66 20 28 20 74 79 70 65 6f  ray)..if ( typeo
148a0 66 20 71 75 61 6c 69 66 69 65 72 20 21 3d 3d 20  f qualifier !== 
148b0 22 73 74 72 69 6e 67 22 20 29 20 7b 0a 09 09 72  "string" ) {...r
148c0 65 74 75 72 6e 20 6a 51 75 65 72 79 2e 67 72 65  eturn jQuery.gre
148d0 70 28 20 65 6c 65 6d 65 6e 74 73 2c 20 66 75 6e  p( elements, fun
148e0 63 74 69 6f 6e 28 20 65 6c 65 6d 20 29 20 7b 0a  ction( elem ) {.
148f0 09 09 09 72 65 74 75 72 6e 20 28 20 69 6e 64 65  ...return ( inde
14900 78 4f 66 2e 63 61 6c 6c 28 20 71 75 61 6c 69 66  xOf.call( qualif
14910 69 65 72 2c 20 65 6c 65 6d 20 29 20 3e 20 2d 31  ier, elem ) > -1
14920 20 29 20 21 3d 3d 20 6e 6f 74 3b 0a 09 09 7d 20   ) !== not;...} 
14930 29 3b 0a 09 7d 0a 0a 09 2f 2f 20 46 69 6c 74 65  );..}...// Filte
14940 72 65 64 20 64 69 72 65 63 74 6c 79 20 66 6f 72  red directly for
14950 20 62 6f 74 68 20 73 69 6d 70 6c 65 20 61 6e 64   both simple and
14960 20 63 6f 6d 70 6c 65 78 20 73 65 6c 65 63 74 6f   complex selecto
14970 72 73 0a 09 72 65 74 75 72 6e 20 6a 51 75 65 72  rs..return jQuer
14980 79 2e 66 69 6c 74 65 72 28 20 71 75 61 6c 69 66  y.filter( qualif
14990 69 65 72 2c 20 65 6c 65 6d 65 6e 74 73 2c 20 6e  ier, elements, n
149a0 6f 74 20 29 3b 0a 7d 0a 0a 6a 51 75 65 72 79 2e  ot );.}..jQuery.
149b0 66 69 6c 74 65 72 20 3d 20 66 75 6e 63 74 69 6f  filter = functio
149c0 6e 28 20 65 78 70 72 2c 20 65 6c 65 6d 73 2c 20  n( expr, elems, 
149d0 6e 6f 74 20 29 20 7b 0a 09 76 61 72 20 65 6c 65  not ) {..var ele
149e0 6d 20 3d 20 65 6c 65 6d 73 5b 20 30 20 5d 3b 0a  m = elems[ 0 ];.
149f0 0a 09 69 66 20 28 20 6e 6f 74 20 29 20 7b 0a 09  ..if ( not ) {..
14a00 09 65 78 70 72 20 3d 20 22 3a 6e 6f 74 28 22 20  .expr = ":not(" 
14a10 2b 20 65 78 70 72 20 2b 20 22 29 22 3b 0a 09 7d  + expr + ")";..}
14a20 0a 0a 09 69 66 20 28 20 65 6c 65 6d 73 2e 6c 65  ...if ( elems.le
14a30 6e 67 74 68 20 3d 3d 3d 20 31 20 26 26 20 65 6c  ngth === 1 && el
14a40 65 6d 2e 6e 6f 64 65 54 79 70 65 20 3d 3d 3d 20  em.nodeType === 
14a50 31 20 29 20 7b 0a 09 09 72 65 74 75 72 6e 20 6a  1 ) {...return j
14a60 51 75 65 72 79 2e 66 69 6e 64 2e 6d 61 74 63 68  Query.find.match
14a70 65 73 53 65 6c 65 63 74 6f 72 28 20 65 6c 65 6d  esSelector( elem
14a80 2c 20 65 78 70 72 20 29 20 3f 20 5b 20 65 6c 65  , expr ) ? [ ele
14a90 6d 20 5d 20 3a 20 5b 5d 3b 0a 09 7d 0a 0a 09 72  m ] : [];..}...r
14aa0 65 74 75 72 6e 20 6a 51 75 65 72 79 2e 66 69 6e  eturn jQuery.fin
14ab0 64 2e 6d 61 74 63 68 65 73 28 20 65 78 70 72 2c  d.matches( expr,
14ac0 20 6a 51 75 65 72 79 2e 67 72 65 70 28 20 65 6c   jQuery.grep( el
14ad0 65 6d 73 2c 20 66 75 6e 63 74 69 6f 6e 28 20 65  ems, function( e
14ae0 6c 65 6d 20 29 20 7b 0a 09 09 72 65 74 75 72 6e  lem ) {...return
14af0 20 65 6c 65 6d 2e 6e 6f 64 65 54 79 70 65 20 3d   elem.nodeType =
14b00 3d 3d 20 31 3b 0a 09 7d 20 29 20 29 3b 0a 7d 3b  == 1;..} ) );.};
14b10 0a 0a 6a 51 75 65 72 79 2e 66 6e 2e 65 78 74 65  ..jQuery.fn.exte
14b20 6e 64 28 20 7b 0a 09 66 69 6e 64 3a 20 66 75 6e  nd( {..find: fun
14b30 63 74 69 6f 6e 28 20 73 65 6c 65 63 74 6f 72 20  ction( selector 
14b40 29 20 7b 0a 09 09 76 61 72 20 69 2c 20 72 65 74  ) {...var i, ret
14b50 2c 0a 09 09 09 6c 65 6e 20 3d 20 74 68 69 73 2e  ,....len = this.
14b60 6c 65 6e 67 74 68 2c 0a 09 09 09 73 65 6c 66 20  length,....self 
14b70 3d 20 74 68 69 73 3b 0a 0a 09 09 69 66 20 28 20  = this;....if ( 
14b80 74 79 70 65 6f 66 20 73 65 6c 65 63 74 6f 72 20  typeof selector 
14b90 21 3d 3d 20 22 73 74 72 69 6e 67 22 20 29 20 7b  !== "string" ) {
14ba0 0a 09 09 09 72 65 74 75 72 6e 20 74 68 69 73 2e  ....return this.
14bb0 70 75 73 68 53 74 61 63 6b 28 20 6a 51 75 65 72  pushStack( jQuer
14bc0 79 28 20 73 65 6c 65 63 74 6f 72 20 29 2e 66 69  y( selector ).fi
14bd0 6c 74 65 72 28 20 66 75 6e 63 74 69 6f 6e 28 29  lter( function()
14be0 20 7b 0a 09 09 09 09 66 6f 72 20 28 20 69 20 3d   {.....for ( i =
14bf0 20 30 3b 20 69 20 3c 20 6c 65 6e 3b 20 69 2b 2b   0; i < len; i++
14c00 20 29 20 7b 0a 09 09 09 09 09 69 66 20 28 20 6a   ) {......if ( j
14c10 51 75 65 72 79 2e 63 6f 6e 74 61 69 6e 73 28 20  Query.contains( 
14c20 73 65 6c 66 5b 20 69 20 5d 2c 20 74 68 69 73 20  self[ i ], this 
14c30 29 20 29 20 7b 0a 09 09 09 09 09 09 72 65 74 75  ) ) {.......retu
14c40 72 6e 20 74 72 75 65 3b 0a 09 09 09 09 09 7d 0a  rn true;......}.
14c50 09 09 09 09 7d 0a 09 09 09 7d 20 29 20 29 3b 0a  ....}....} ) );.
14c60 09 09 7d 0a 0a 09 09 72 65 74 20 3d 20 74 68 69  ..}....ret = thi
14c70 73 2e 70 75 73 68 53 74 61 63 6b 28 20 5b 5d 20  s.pushStack( [] 
14c80 29 3b 0a 0a 09 09 66 6f 72 20 28 20 69 20 3d 20  );....for ( i = 
14c90 30 3b 20 69 20 3c 20 6c 65 6e 3b 20 69 2b 2b 20  0; i < len; i++ 
14ca0 29 20 7b 0a 09 09 09 6a 51 75 65 72 79 2e 66 69  ) {....jQuery.fi
14cb0 6e 64 28 20 73 65 6c 65 63 74 6f 72 2c 20 73 65  nd( selector, se
14cc0 6c 66 5b 20 69 20 5d 2c 20 72 65 74 20 29 3b 0a  lf[ i ], ret );.
14cd0 09 09 7d 0a 0a 09 09 72 65 74 75 72 6e 20 6c 65  ..}....return le
14ce0 6e 20 3e 20 31 20 3f 20 6a 51 75 65 72 79 2e 75  n > 1 ? jQuery.u
14cf0 6e 69 71 75 65 53 6f 72 74 28 20 72 65 74 20 29  niqueSort( ret )
14d00 20 3a 20 72 65 74 3b 0a 09 7d 2c 0a 09 66 69 6c   : ret;..},..fil
14d10 74 65 72 3a 20 66 75 6e 63 74 69 6f 6e 28 20 73  ter: function( s
14d20 65 6c 65 63 74 6f 72 20 29 20 7b 0a 09 09 72 65  elector ) {...re
14d30 74 75 72 6e 20 74 68 69 73 2e 70 75 73 68 53 74  turn this.pushSt
14d40 61 63 6b 28 20 77 69 6e 6e 6f 77 28 20 74 68 69  ack( winnow( thi
14d50 73 2c 20 73 65 6c 65 63 74 6f 72 20 7c 7c 20 5b  s, selector || [
14d60 5d 2c 20 66 61 6c 73 65 20 29 20 29 3b 0a 09 7d  ], false ) );..}
14d70 2c 0a 09 6e 6f 74 3a 20 66 75 6e 63 74 69 6f 6e  ,..not: function
14d80 28 20 73 65 6c 65 63 74 6f 72 20 29 20 7b 0a 09  ( selector ) {..
14d90 09 72 65 74 75 72 6e 20 74 68 69 73 2e 70 75 73  .return this.pus
14da0 68 53 74 61 63 6b 28 20 77 69 6e 6e 6f 77 28 20  hStack( winnow( 
14db0 74 68 69 73 2c 20 73 65 6c 65 63 74 6f 72 20 7c  this, selector |
14dc0 7c 20 5b 5d 2c 20 74 72 75 65 20 29 20 29 3b 0a  | [], true ) );.
14dd0 09 7d 2c 0a 09 69 73 3a 20 66 75 6e 63 74 69 6f  .},..is: functio
14de0 6e 28 20 73 65 6c 65 63 74 6f 72 20 29 20 7b 0a  n( selector ) {.
14df0 09 09 72 65 74 75 72 6e 20 21 21 77 69 6e 6e 6f  ..return !!winno
14e00 77 28 0a 09 09 09 74 68 69 73 2c 0a 0a 09 09 09  w(....this,.....
14e10 2f 2f 20 49 66 20 74 68 69 73 20 69 73 20 61 20  // If this is a 
14e20 70 6f 73 69 74 69 6f 6e 61 6c 2f 72 65 6c 61 74  positional/relat
14e30 69 76 65 20 73 65 6c 65 63 74 6f 72 2c 20 63 68  ive selector, ch
14e40 65 63 6b 20 6d 65 6d 62 65 72 73 68 69 70 20 69  eck membership i
14e50 6e 20 74 68 65 20 72 65 74 75 72 6e 65 64 20 73  n the returned s
14e60 65 74 0a 09 09 09 2f 2f 20 73 6f 20 24 28 22 70  et....// so $("p
14e70 3a 66 69 72 73 74 22 29 2e 69 73 28 22 70 3a 6c  :first").is("p:l
14e80 61 73 74 22 29 20 77 6f 6e 27 74 20 72 65 74 75  ast") won't retu
14e90 72 6e 20 74 72 75 65 20 66 6f 72 20 61 20 64 6f  rn true for a do
14ea0 63 20 77 69 74 68 20 74 77 6f 20 22 70 22 2e 0a  c with two "p"..
14eb0 09 09 09 74 79 70 65 6f 66 20 73 65 6c 65 63 74  ...typeof select
14ec0 6f 72 20 3d 3d 3d 20 22 73 74 72 69 6e 67 22 20  or === "string" 
14ed0 26 26 20 72 6e 65 65 64 73 43 6f 6e 74 65 78 74  && rneedsContext
14ee0 2e 74 65 73 74 28 20 73 65 6c 65 63 74 6f 72 20  .test( selector 
14ef0 29 20 3f 0a 09 09 09 09 6a 51 75 65 72 79 28 20  ) ?.....jQuery( 
14f00 73 65 6c 65 63 74 6f 72 20 29 20 3a 0a 09 09 09  selector ) :....
14f10 09 73 65 6c 65 63 74 6f 72 20 7c 7c 20 5b 5d 2c  .selector || [],
14f20 0a 09 09 09 66 61 6c 73 65 0a 09 09 29 2e 6c 65  ....false...).le
14f30 6e 67 74 68 3b 0a 09 7d 0a 7d 20 29 3b 0a 0a 0a  ngth;..}.} );...
14f40 2f 2f 20 49 6e 69 74 69 61 6c 69 7a 65 20 61 20  // Initialize a 
14f50 6a 51 75 65 72 79 20 6f 62 6a 65 63 74 0a 0a 0a  jQuery object...
14f60 2f 2f 20 41 20 63 65 6e 74 72 61 6c 20 72 65 66  // A central ref
14f70 65 72 65 6e 63 65 20 74 6f 20 74 68 65 20 72 6f  erence to the ro
14f80 6f 74 20 6a 51 75 65 72 79 28 64 6f 63 75 6d 65  ot jQuery(docume
14f90 6e 74 29 0a 76 61 72 20 72 6f 6f 74 6a 51 75 65  nt).var rootjQue
14fa0 72 79 2c 0a 0a 09 2f 2f 20 41 20 73 69 6d 70 6c  ry,...// A simpl
14fb0 65 20 77 61 79 20 74 6f 20 63 68 65 63 6b 20 66  e way to check f
14fc0 6f 72 20 48 54 4d 4c 20 73 74 72 69 6e 67 73 0a  or HTML strings.
14fd0 09 2f 2f 20 50 72 69 6f 72 69 74 69 7a 65 20 23  .// Prioritize #
14fe0 69 64 20 6f 76 65 72 20 3c 74 61 67 3e 20 74 6f  id over <tag> to
14ff0 20 61 76 6f 69 64 20 58 53 53 20 76 69 61 20 6c   avoid XSS via l
15000 6f 63 61 74 69 6f 6e 2e 68 61 73 68 20 28 23 39  ocation.hash (#9
15010 35 32 31 29 0a 09 2f 2f 20 53 74 72 69 63 74 20  521)..// Strict 
15020 48 54 4d 4c 20 72 65 63 6f 67 6e 69 74 69 6f 6e  HTML recognition
15030 20 28 23 31 31 32 39 30 3a 20 6d 75 73 74 20 73   (#11290: must s
15040 74 61 72 74 20 77 69 74 68 20 3c 29 0a 09 2f 2f  tart with <)..//
15050 20 53 68 6f 72 74 63 75 74 20 73 69 6d 70 6c 65   Shortcut simple
15060 20 23 69 64 20 63 61 73 65 20 66 6f 72 20 73 70   #id case for sp
15070 65 65 64 0a 09 72 71 75 69 63 6b 45 78 70 72 20  eed..rquickExpr 
15080 3d 20 2f 5e 28 3f 3a 5c 73 2a 28 3c 5b 5c 77 5c  = /^(?:\s*(<[\w\
15090 57 5d 2b 3e 29 5b 5e 3e 5d 2a 7c 23 28 5b 5c 77  W]+>)[^>]*|#([\w
150a0 2d 5d 2b 29 29 24 2f 2c 0a 0a 09 69 6e 69 74 20  -]+))$/,...init 
150b0 3d 20 6a 51 75 65 72 79 2e 66 6e 2e 69 6e 69 74  = jQuery.fn.init
150c0 20 3d 20 66 75 6e 63 74 69 6f 6e 28 20 73 65 6c   = function( sel
150d0 65 63 74 6f 72 2c 20 63 6f 6e 74 65 78 74 2c 20  ector, context, 
150e0 72 6f 6f 74 20 29 20 7b 0a 09 09 76 61 72 20 6d  root ) {...var m
150f0 61 74 63 68 2c 20 65 6c 65 6d 3b 0a 0a 09 09 2f  atch, elem;..../
15100 2f 20 48 41 4e 44 4c 45 3a 20 24 28 22 22 29 2c  / HANDLE: $(""),
15110 20 24 28 6e 75 6c 6c 29 2c 20 24 28 75 6e 64 65   $(null), $(unde
15120 66 69 6e 65 64 29 2c 20 24 28 66 61 6c 73 65 29  fined), $(false)
15130 0a 09 09 69 66 20 28 20 21 73 65 6c 65 63 74 6f  ...if ( !selecto
15140 72 20 29 20 7b 0a 09 09 09 72 65 74 75 72 6e 20  r ) {....return 
15150 74 68 69 73 3b 0a 09 09 7d 0a 0a 09 09 2f 2f 20  this;...}....// 
15160 4d 65 74 68 6f 64 20 69 6e 69 74 28 29 20 61 63  Method init() ac
15170 63 65 70 74 73 20 61 6e 20 61 6c 74 65 72 6e 61  cepts an alterna
15180 74 65 20 72 6f 6f 74 6a 51 75 65 72 79 0a 09 09  te rootjQuery...
15190 2f 2f 20 73 6f 20 6d 69 67 72 61 74 65 20 63 61  // so migrate ca
151a0 6e 20 73 75 70 70 6f 72 74 20 6a 51 75 65 72 79  n support jQuery
151b0 2e 73 75 62 20 28 67 68 2d 32 31 30 31 29 0a 09  .sub (gh-2101)..
151c0 09 72 6f 6f 74 20 3d 20 72 6f 6f 74 20 7c 7c 20  .root = root || 
151d0 72 6f 6f 74 6a 51 75 65 72 79 3b 0a 0a 09 09 2f  rootjQuery;..../
151e0 2f 20 48 61 6e 64 6c 65 20 48 54 4d 4c 20 73 74  / Handle HTML st
151f0 72 69 6e 67 73 0a 09 09 69 66 20 28 20 74 79 70  rings...if ( typ
15200 65 6f 66 20 73 65 6c 65 63 74 6f 72 20 3d 3d 3d  eof selector ===
15210 20 22 73 74 72 69 6e 67 22 20 29 20 7b 0a 09 09   "string" ) {...
15220 09 69 66 20 28 20 73 65 6c 65 63 74 6f 72 5b 20  .if ( selector[ 
15230 30 20 5d 20 3d 3d 3d 20 22 3c 22 20 26 26 0a 09  0 ] === "<" &&..
15240 09 09 09 73 65 6c 65 63 74 6f 72 5b 20 73 65 6c  ...selector[ sel
15250 65 63 74 6f 72 2e 6c 65 6e 67 74 68 20 2d 20 31  ector.length - 1
15260 20 5d 20 3d 3d 3d 20 22 3e 22 20 26 26 0a 09 09   ] === ">" &&...
15270 09 09 73 65 6c 65 63 74 6f 72 2e 6c 65 6e 67 74  ..selector.lengt
15280 68 20 3e 3d 20 33 20 29 20 7b 0a 0a 09 09 09 09  h >= 3 ) {......
15290 2f 2f 20 41 73 73 75 6d 65 20 74 68 61 74 20 73  // Assume that s
152a0 74 72 69 6e 67 73 20 74 68 61 74 20 73 74 61 72  trings that star
152b0 74 20 61 6e 64 20 65 6e 64 20 77 69 74 68 20 3c  t and end with <
152c0 3e 20 61 72 65 20 48 54 4d 4c 20 61 6e 64 20 73  > are HTML and s
152d0 6b 69 70 20 74 68 65 20 72 65 67 65 78 20 63 68  kip the regex ch
152e0 65 63 6b 0a 09 09 09 09 6d 61 74 63 68 20 3d 20  eck.....match = 
152f0 5b 20 6e 75 6c 6c 2c 20 73 65 6c 65 63 74 6f 72  [ null, selector
15300 2c 20 6e 75 6c 6c 20 5d 3b 0a 0a 09 09 09 7d 20  , null ];.....} 
15310 65 6c 73 65 20 7b 0a 09 09 09 09 6d 61 74 63 68  else {.....match
15320 20 3d 20 72 71 75 69 63 6b 45 78 70 72 2e 65 78   = rquickExpr.ex
15330 65 63 28 20 73 65 6c 65 63 74 6f 72 20 29 3b 0a  ec( selector );.
15340 09 09 09 7d 0a 0a 09 09 09 2f 2f 20 4d 61 74 63  ...}.....// Matc
15350 68 20 68 74 6d 6c 20 6f 72 20 6d 61 6b 65 20 73  h html or make s
15360 75 72 65 20 6e 6f 20 63 6f 6e 74 65 78 74 20 69  ure no context i
15370 73 20 73 70 65 63 69 66 69 65 64 20 66 6f 72 20  s specified for 
15380 23 69 64 0a 09 09 09 69 66 20 28 20 6d 61 74 63  #id....if ( matc
15390 68 20 26 26 20 28 20 6d 61 74 63 68 5b 20 31 20  h && ( match[ 1 
153a0 5d 20 7c 7c 20 21 63 6f 6e 74 65 78 74 20 29 20  ] || !context ) 
153b0 29 20 7b 0a 0a 09 09 09 09 2f 2f 20 48 41 4e 44  ) {......// HAND
153c0 4c 45 3a 20 24 28 68 74 6d 6c 29 20 2d 3e 20 24  LE: $(html) -> $
153d0 28 61 72 72 61 79 29 0a 09 09 09 09 69 66 20 28  (array).....if (
153e0 20 6d 61 74 63 68 5b 20 31 20 5d 20 29 20 7b 0a   match[ 1 ] ) {.
153f0 09 09 09 09 09 63 6f 6e 74 65 78 74 20 3d 20 63  .....context = c
15400 6f 6e 74 65 78 74 20 69 6e 73 74 61 6e 63 65 6f  ontext instanceo
15410 66 20 6a 51 75 65 72 79 20 3f 20 63 6f 6e 74 65  f jQuery ? conte
15420 78 74 5b 20 30 20 5d 20 3a 20 63 6f 6e 74 65 78  xt[ 0 ] : contex
15430 74 3b 0a 0a 09 09 09 09 09 2f 2f 20 4f 70 74 69  t;.......// Opti
15440 6f 6e 20 74 6f 20 72 75 6e 20 73 63 72 69 70 74  on to run script
15450 73 20 69 73 20 74 72 75 65 20 66 6f 72 20 62 61  s is true for ba
15460 63 6b 2d 63 6f 6d 70 61 74 0a 09 09 09 09 09 2f  ck-compat....../
15470 2f 20 49 6e 74 65 6e 74 69 6f 6e 61 6c 6c 79 20  / Intentionally 
15480 6c 65 74 20 74 68 65 20 65 72 72 6f 72 20 62 65  let the error be
15490 20 74 68 72 6f 77 6e 20 69 66 20 70 61 72 73 65   thrown if parse
154a0 48 54 4d 4c 20 69 73 20 6e 6f 74 20 70 72 65 73  HTML is not pres
154b0 65 6e 74 0a 09 09 09 09 09 6a 51 75 65 72 79 2e  ent......jQuery.
154c0 6d 65 72 67 65 28 20 74 68 69 73 2c 20 6a 51 75  merge( this, jQu
154d0 65 72 79 2e 70 61 72 73 65 48 54 4d 4c 28 0a 09  ery.parseHTML(..
154e0 09 09 09 09 09 6d 61 74 63 68 5b 20 31 20 5d 2c  .....match[ 1 ],
154f0 0a 09 09 09 09 09 09 63 6f 6e 74 65 78 74 20 26  .......context &
15500 26 20 63 6f 6e 74 65 78 74 2e 6e 6f 64 65 54 79  & context.nodeTy
15510 70 65 20 3f 20 63 6f 6e 74 65 78 74 2e 6f 77 6e  pe ? context.own
15520 65 72 44 6f 63 75 6d 65 6e 74 20 7c 7c 20 63 6f  erDocument || co
15530 6e 74 65 78 74 20 3a 20 64 6f 63 75 6d 65 6e 74  ntext : document
15540 2c 0a 09 09 09 09 09 09 74 72 75 65 0a 09 09 09  ,.......true....
15550 09 09 29 20 29 3b 0a 0a 09 09 09 09 09 2f 2f 20  ..) );.......// 
15560 48 41 4e 44 4c 45 3a 20 24 28 68 74 6d 6c 2c 20  HANDLE: $(html, 
15570 70 72 6f 70 73 29 0a 09 09 09 09 09 69 66 20 28  props)......if (
15580 20 72 73 69 6e 67 6c 65 54 61 67 2e 74 65 73 74   rsingleTag.test
15590 28 20 6d 61 74 63 68 5b 20 31 20 5d 20 29 20 26  ( match[ 1 ] ) &
155a0 26 20 6a 51 75 65 72 79 2e 69 73 50 6c 61 69 6e  & jQuery.isPlain
155b0 4f 62 6a 65 63 74 28 20 63 6f 6e 74 65 78 74 20  Object( context 
155c0 29 20 29 20 7b 0a 09 09 09 09 09 09 66 6f 72 20  ) ) {.......for 
155d0 28 20 6d 61 74 63 68 20 69 6e 20 63 6f 6e 74 65  ( match in conte
155e0 78 74 20 29 20 7b 0a 0a 09 09 09 09 09 09 09 2f  xt ) {........./
155f0 2f 20 50 72 6f 70 65 72 74 69 65 73 20 6f 66 20  / Properties of 
15600 63 6f 6e 74 65 78 74 20 61 72 65 20 63 61 6c 6c  context are call
15610 65 64 20 61 73 20 6d 65 74 68 6f 64 73 20 69 66  ed as methods if
15620 20 70 6f 73 73 69 62 6c 65 0a 09 09 09 09 09 09   possible.......
15630 09 69 66 20 28 20 69 73 46 75 6e 63 74 69 6f 6e  .if ( isFunction
15640 28 20 74 68 69 73 5b 20 6d 61 74 63 68 20 5d 20  ( this[ match ] 
15650 29 20 29 20 7b 0a 09 09 09 09 09 09 09 09 74 68  ) ) {.........th
15660 69 73 5b 20 6d 61 74 63 68 20 5d 28 20 63 6f 6e  is[ match ]( con
15670 74 65 78 74 5b 20 6d 61 74 63 68 20 5d 20 29 3b  text[ match ] );
15680 0a 0a 09 09 09 09 09 09 09 2f 2f 20 2e 2e 2e 61  .........// ...a
15690 6e 64 20 6f 74 68 65 72 77 69 73 65 20 73 65 74  nd otherwise set
156a0 20 61 73 20 61 74 74 72 69 62 75 74 65 73 0a 09   as attributes..
156b0 09 09 09 09 09 09 7d 20 65 6c 73 65 20 7b 0a 09  ......} else {..
156c0 09 09 09 09 09 09 09 74 68 69 73 2e 61 74 74 72  .......this.attr
156d0 28 20 6d 61 74 63 68 2c 20 63 6f 6e 74 65 78 74  ( match, context
156e0 5b 20 6d 61 74 63 68 20 5d 20 29 3b 0a 09 09 09  [ match ] );....
156f0 09 09 09 09 7d 0a 09 09 09 09 09 09 7d 0a 09 09  ....}.......}...
15700 09 09 09 7d 0a 0a 09 09 09 09 09 72 65 74 75 72  ...}.......retur
15710 6e 20 74 68 69 73 3b 0a 0a 09 09 09 09 2f 2f 20  n this;......// 
15720 48 41 4e 44 4c 45 3a 20 24 28 23 69 64 29 0a 09  HANDLE: $(#id)..
15730 09 09 09 7d 20 65 6c 73 65 20 7b 0a 09 09 09 09  ...} else {.....
15740 09 65 6c 65 6d 20 3d 20 64 6f 63 75 6d 65 6e 74  .elem = document
15750 2e 67 65 74 45 6c 65 6d 65 6e 74 42 79 49 64 28  .getElementById(
15760 20 6d 61 74 63 68 5b 20 32 20 5d 20 29 3b 0a 0a   match[ 2 ] );..
15770 09 09 09 09 09 69 66 20 28 20 65 6c 65 6d 20 29  .....if ( elem )
15780 20 7b 0a 0a 09 09 09 09 09 09 2f 2f 20 49 6e 6a   {........// Inj
15790 65 63 74 20 74 68 65 20 65 6c 65 6d 65 6e 74 20  ect the element 
157a0 64 69 72 65 63 74 6c 79 20 69 6e 74 6f 20 74 68  directly into th
157b0 65 20 6a 51 75 65 72 79 20 6f 62 6a 65 63 74 0a  e jQuery object.
157c0 09 09 09 09 09 09 74 68 69 73 5b 20 30 20 5d 20  ......this[ 0 ] 
157d0 3d 20 65 6c 65 6d 3b 0a 09 09 09 09 09 09 74 68  = elem;.......th
157e0 69 73 2e 6c 65 6e 67 74 68 20 3d 20 31 3b 0a 09  is.length = 1;..
157f0 09 09 09 09 7d 0a 09 09 09 09 09 72 65 74 75 72  ....}......retur
15800 6e 20 74 68 69 73 3b 0a 09 09 09 09 7d 0a 0a 09  n this;.....}...
15810 09 09 2f 2f 20 48 41 4e 44 4c 45 3a 20 24 28 65  ..// HANDLE: $(e
15820 78 70 72 2c 20 24 28 2e 2e 2e 29 29 0a 09 09 09  xpr, $(...))....
15830 7d 20 65 6c 73 65 20 69 66 20 28 20 21 63 6f 6e  } else if ( !con
15840 74 65 78 74 20 7c 7c 20 63 6f 6e 74 65 78 74 2e  text || context.
15850 6a 71 75 65 72 79 20 29 20 7b 0a 09 09 09 09 72  jquery ) {.....r
15860 65 74 75 72 6e 20 28 20 63 6f 6e 74 65 78 74 20  eturn ( context 
15870 7c 7c 20 72 6f 6f 74 20 29 2e 66 69 6e 64 28 20  || root ).find( 
15880 73 65 6c 65 63 74 6f 72 20 29 3b 0a 0a 09 09 09  selector );.....
15890 2f 2f 20 48 41 4e 44 4c 45 3a 20 24 28 65 78 70  // HANDLE: $(exp
158a0 72 2c 20 63 6f 6e 74 65 78 74 29 0a 09 09 09 2f  r, context)..../
158b0 2f 20 28 77 68 69 63 68 20 69 73 20 6a 75 73 74  / (which is just
158c0 20 65 71 75 69 76 61 6c 65 6e 74 20 74 6f 3a 20   equivalent to: 
158d0 24 28 63 6f 6e 74 65 78 74 29 2e 66 69 6e 64 28  $(context).find(
158e0 65 78 70 72 29 0a 09 09 09 7d 20 65 6c 73 65 20  expr)....} else 
158f0 7b 0a 09 09 09 09 72 65 74 75 72 6e 20 74 68 69  {.....return thi
15900 73 2e 63 6f 6e 73 74 72 75 63 74 6f 72 28 20 63  s.constructor( c
15910 6f 6e 74 65 78 74 20 29 2e 66 69 6e 64 28 20 73  ontext ).find( s
15920 65 6c 65 63 74 6f 72 20 29 3b 0a 09 09 09 7d 0a  elector );....}.
15930 0a 09 09 2f 2f 20 48 41 4e 44 4c 45 3a 20 24 28  ...// HANDLE: $(
15940 44 4f 4d 45 6c 65 6d 65 6e 74 29 0a 09 09 7d 20  DOMElement)...} 
15950 65 6c 73 65 20 69 66 20 28 20 73 65 6c 65 63 74  else if ( select
15960 6f 72 2e 6e 6f 64 65 54 79 70 65 20 29 20 7b 0a  or.nodeType ) {.
15970 09 09 09 74 68 69 73 5b 20 30 20 5d 20 3d 20 73  ...this[ 0 ] = s
15980 65 6c 65 63 74 6f 72 3b 0a 09 09 09 74 68 69 73  elector;....this
15990 2e 6c 65 6e 67 74 68 20 3d 20 31 3b 0a 09 09 09  .length = 1;....
159a0 72 65 74 75 72 6e 20 74 68 69 73 3b 0a 0a 09 09  return this;....
159b0 2f 2f 20 48 41 4e 44 4c 45 3a 20 24 28 66 75 6e  // HANDLE: $(fun
159c0 63 74 69 6f 6e 29 0a 09 09 2f 2f 20 53 68 6f 72  ction)...// Shor
159d0 74 63 75 74 20 66 6f 72 20 64 6f 63 75 6d 65 6e  tcut for documen
159e0 74 20 72 65 61 64 79 0a 09 09 7d 20 65 6c 73 65  t ready...} else
159f0 20 69 66 20 28 20 69 73 46 75 6e 63 74 69 6f 6e   if ( isFunction
15a00 28 20 73 65 6c 65 63 74 6f 72 20 29 20 29 20 7b  ( selector ) ) {
15a10 0a 09 09 09 72 65 74 75 72 6e 20 72 6f 6f 74 2e  ....return root.
15a20 72 65 61 64 79 20 21 3d 3d 20 75 6e 64 65 66 69  ready !== undefi
15a30 6e 65 64 20 3f 0a 09 09 09 09 72 6f 6f 74 2e 72  ned ?.....root.r
15a40 65 61 64 79 28 20 73 65 6c 65 63 74 6f 72 20 29  eady( selector )
15a50 20 3a 0a 0a 09 09 09 09 2f 2f 20 45 78 65 63 75   :......// Execu
15a60 74 65 20 69 6d 6d 65 64 69 61 74 65 6c 79 20 69  te immediately i
15a70 66 20 72 65 61 64 79 20 69 73 20 6e 6f 74 20 70  f ready is not p
15a80 72 65 73 65 6e 74 0a 09 09 09 09 73 65 6c 65 63  resent.....selec
15a90 74 6f 72 28 20 6a 51 75 65 72 79 20 29 3b 0a 09  tor( jQuery );..
15aa0 09 7d 0a 0a 09 09 72 65 74 75 72 6e 20 6a 51 75  .}....return jQu
15ab0 65 72 79 2e 6d 61 6b 65 41 72 72 61 79 28 20 73  ery.makeArray( s
15ac0 65 6c 65 63 74 6f 72 2c 20 74 68 69 73 20 29 3b  elector, this );
15ad0 0a 09 7d 3b 0a 0a 2f 2f 20 47 69 76 65 20 74 68  ..};..// Give th
15ae0 65 20 69 6e 69 74 20 66 75 6e 63 74 69 6f 6e 20  e init function 
15af0 74 68 65 20 6a 51 75 65 72 79 20 70 72 6f 74 6f  the jQuery proto
15b00 74 79 70 65 20 66 6f 72 20 6c 61 74 65 72 20 69  type for later i
15b10 6e 73 74 61 6e 74 69 61 74 69 6f 6e 0a 69 6e 69  nstantiation.ini
15b20 74 2e 70 72 6f 74 6f 74 79 70 65 20 3d 20 6a 51  t.prototype = jQ
15b30 75 65 72 79 2e 66 6e 3b 0a 0a 2f 2f 20 49 6e 69  uery.fn;..// Ini
15b40 74 69 61 6c 69 7a 65 20 63 65 6e 74 72 61 6c 20  tialize central 
15b50 72 65 66 65 72 65 6e 63 65 0a 72 6f 6f 74 6a 51  reference.rootjQ
15b60 75 65 72 79 20 3d 20 6a 51 75 65 72 79 28 20 64  uery = jQuery( d
15b70 6f 63 75 6d 65 6e 74 20 29 3b 0a 0a 0a 76 61 72  ocument );...var
15b80 20 72 70 61 72 65 6e 74 73 70 72 65 76 20 3d 20   rparentsprev = 
15b90 2f 5e 28 3f 3a 70 61 72 65 6e 74 73 7c 70 72 65  /^(?:parents|pre
15ba0 76 28 3f 3a 55 6e 74 69 6c 7c 41 6c 6c 29 29 2f  v(?:Until|All))/
15bb0 2c 0a 0a 09 2f 2f 20 4d 65 74 68 6f 64 73 20 67  ,...// Methods g
15bc0 75 61 72 61 6e 74 65 65 64 20 74 6f 20 70 72 6f  uaranteed to pro
15bd0 64 75 63 65 20 61 20 75 6e 69 71 75 65 20 73 65  duce a unique se
15be0 74 20 77 68 65 6e 20 73 74 61 72 74 69 6e 67 20  t when starting 
15bf0 66 72 6f 6d 20 61 20 75 6e 69 71 75 65 20 73 65  from a unique se
15c00 74 0a 09 67 75 61 72 61 6e 74 65 65 64 55 6e 69  t..guaranteedUni
15c10 71 75 65 20 3d 20 7b 0a 09 09 63 68 69 6c 64 72  que = {...childr
15c20 65 6e 3a 20 74 72 75 65 2c 0a 09 09 63 6f 6e 74  en: true,...cont
15c30 65 6e 74 73 3a 20 74 72 75 65 2c 0a 09 09 6e 65  ents: true,...ne
15c40 78 74 3a 20 74 72 75 65 2c 0a 09 09 70 72 65 76  xt: true,...prev
15c50 3a 20 74 72 75 65 0a 09 7d 3b 0a 0a 6a 51 75 65  : true..};..jQue
15c60 72 79 2e 66 6e 2e 65 78 74 65 6e 64 28 20 7b 0a  ry.fn.extend( {.
15c70 09 68 61 73 3a 20 66 75 6e 63 74 69 6f 6e 28 20  .has: function( 
15c80 74 61 72 67 65 74 20 29 20 7b 0a 09 09 76 61 72  target ) {...var
15c90 20 74 61 72 67 65 74 73 20 3d 20 6a 51 75 65 72   targets = jQuer
15ca0 79 28 20 74 61 72 67 65 74 2c 20 74 68 69 73 20  y( target, this 
15cb0 29 2c 0a 09 09 09 6c 20 3d 20 74 61 72 67 65 74  ),....l = target
15cc0 73 2e 6c 65 6e 67 74 68 3b 0a 0a 09 09 72 65 74  s.length;....ret
15cd0 75 72 6e 20 74 68 69 73 2e 66 69 6c 74 65 72 28  urn this.filter(
15ce0 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09 09   function() {...
15cf0 09 76 61 72 20 69 20 3d 20 30 3b 0a 09 09 09 66  .var i = 0;....f
15d00 6f 72 20 28 20 3b 20 69 20 3c 20 6c 3b 20 69 2b  or ( ; i < l; i+
15d10 2b 20 29 20 7b 0a 09 09 09 09 69 66 20 28 20 6a  + ) {.....if ( j
15d20 51 75 65 72 79 2e 63 6f 6e 74 61 69 6e 73 28 20  Query.contains( 
15d30 74 68 69 73 2c 20 74 61 72 67 65 74 73 5b 20 69  this, targets[ i
15d40 20 5d 20 29 20 29 20 7b 0a 09 09 09 09 09 72 65   ] ) ) {......re
15d50 74 75 72 6e 20 74 72 75 65 3b 0a 09 09 09 09 7d  turn true;.....}
15d60 0a 09 09 09 7d 0a 09 09 7d 20 29 3b 0a 09 7d 2c  ....}...} );..},
15d70 0a 0a 09 63 6c 6f 73 65 73 74 3a 20 66 75 6e 63  ...closest: func
15d80 74 69 6f 6e 28 20 73 65 6c 65 63 74 6f 72 73 2c  tion( selectors,
15d90 20 63 6f 6e 74 65 78 74 20 29 20 7b 0a 09 09 76   context ) {...v
15da0 61 72 20 63 75 72 2c 0a 09 09 09 69 20 3d 20 30  ar cur,....i = 0
15db0 2c 0a 09 09 09 6c 20 3d 20 74 68 69 73 2e 6c 65  ,....l = this.le
15dc0 6e 67 74 68 2c 0a 09 09 09 6d 61 74 63 68 65 64  ngth,....matched
15dd0 20 3d 20 5b 5d 2c 0a 09 09 09 74 61 72 67 65 74   = [],....target
15de0 73 20 3d 20 74 79 70 65 6f 66 20 73 65 6c 65 63  s = typeof selec
15df0 74 6f 72 73 20 21 3d 3d 20 22 73 74 72 69 6e 67  tors !== "string
15e00 22 20 26 26 20 6a 51 75 65 72 79 28 20 73 65 6c  " && jQuery( sel
15e10 65 63 74 6f 72 73 20 29 3b 0a 0a 09 09 2f 2f 20  ectors );....// 
15e20 50 6f 73 69 74 69 6f 6e 61 6c 20 73 65 6c 65 63  Positional selec
15e30 74 6f 72 73 20 6e 65 76 65 72 20 6d 61 74 63 68  tors never match
15e40 2c 20 73 69 6e 63 65 20 74 68 65 72 65 27 73 20  , since there's 
15e50 6e 6f 20 5f 73 65 6c 65 63 74 69 6f 6e 5f 20 63  no _selection_ c
15e60 6f 6e 74 65 78 74 0a 09 09 69 66 20 28 20 21 72  ontext...if ( !r
15e70 6e 65 65 64 73 43 6f 6e 74 65 78 74 2e 74 65 73  needsContext.tes
15e80 74 28 20 73 65 6c 65 63 74 6f 72 73 20 29 20 29  t( selectors ) )
15e90 20 7b 0a 09 09 09 66 6f 72 20 28 20 3b 20 69 20   {....for ( ; i 
15ea0 3c 20 6c 3b 20 69 2b 2b 20 29 20 7b 0a 09 09 09  < l; i++ ) {....
15eb0 09 66 6f 72 20 28 20 63 75 72 20 3d 20 74 68 69  .for ( cur = thi
15ec0 73 5b 20 69 20 5d 3b 20 63 75 72 20 26 26 20 63  s[ i ]; cur && c
15ed0 75 72 20 21 3d 3d 20 63 6f 6e 74 65 78 74 3b 20  ur !== context; 
15ee0 63 75 72 20 3d 20 63 75 72 2e 70 61 72 65 6e 74  cur = cur.parent
15ef0 4e 6f 64 65 20 29 20 7b 0a 0a 09 09 09 09 09 2f  Node ) {......./
15f00 2f 20 41 6c 77 61 79 73 20 73 6b 69 70 20 64 6f  / Always skip do
15f10 63 75 6d 65 6e 74 20 66 72 61 67 6d 65 6e 74 73  cument fragments
15f20 0a 09 09 09 09 09 69 66 20 28 20 63 75 72 2e 6e  ......if ( cur.n
15f30 6f 64 65 54 79 70 65 20 3c 20 31 31 20 26 26 20  odeType < 11 && 
15f40 28 20 74 61 72 67 65 74 73 20 3f 0a 09 09 09 09  ( targets ?.....
15f50 09 09 74 61 72 67 65 74 73 2e 69 6e 64 65 78 28  ..targets.index(
15f60 20 63 75 72 20 29 20 3e 20 2d 31 20 3a 0a 0a 09   cur ) > -1 :...
15f70 09 09 09 09 09 2f 2f 20 44 6f 6e 27 74 20 70 61  .....// Don't pa
15f80 73 73 20 6e 6f 6e 2d 65 6c 65 6d 65 6e 74 73 20  ss non-elements 
15f90 74 6f 20 53 69 7a 7a 6c 65 0a 09 09 09 09 09 09  to Sizzle.......
15fa0 63 75 72 2e 6e 6f 64 65 54 79 70 65 20 3d 3d 3d  cur.nodeType ===
15fb0 20 31 20 26 26 0a 09 09 09 09 09 09 09 6a 51 75   1 &&........jQu
15fc0 65 72 79 2e 66 69 6e 64 2e 6d 61 74 63 68 65 73  ery.find.matches
15fd0 53 65 6c 65 63 74 6f 72 28 20 63 75 72 2c 20 73  Selector( cur, s
15fe0 65 6c 65 63 74 6f 72 73 20 29 20 29 20 29 20 7b  electors ) ) ) {
15ff0 0a 0a 09 09 09 09 09 09 6d 61 74 63 68 65 64 2e  ........matched.
16000 70 75 73 68 28 20 63 75 72 20 29 3b 0a 09 09 09  push( cur );....
16010 09 09 09 62 72 65 61 6b 3b 0a 09 09 09 09 09 7d  ...break;......}
16020 0a 09 09 09 09 7d 0a 09 09 09 7d 0a 09 09 7d 0a  .....}....}...}.
16030 0a 09 09 72 65 74 75 72 6e 20 74 68 69 73 2e 70  ...return this.p
16040 75 73 68 53 74 61 63 6b 28 20 6d 61 74 63 68 65  ushStack( matche
16050 64 2e 6c 65 6e 67 74 68 20 3e 20 31 20 3f 20 6a  d.length > 1 ? j
16060 51 75 65 72 79 2e 75 6e 69 71 75 65 53 6f 72 74  Query.uniqueSort
16070 28 20 6d 61 74 63 68 65 64 20 29 20 3a 20 6d 61  ( matched ) : ma
16080 74 63 68 65 64 20 29 3b 0a 09 7d 2c 0a 0a 09 2f  tched );..},.../
16090 2f 20 44 65 74 65 72 6d 69 6e 65 20 74 68 65 20  / Determine the 
160a0 70 6f 73 69 74 69 6f 6e 20 6f 66 20 61 6e 20 65  position of an e
160b0 6c 65 6d 65 6e 74 20 77 69 74 68 69 6e 20 74 68  lement within th
160c0 65 20 73 65 74 0a 09 69 6e 64 65 78 3a 20 66 75  e set..index: fu
160d0 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 20 29 20 7b  nction( elem ) {
160e0 0a 0a 09 09 2f 2f 20 4e 6f 20 61 72 67 75 6d 65  ....// No argume
160f0 6e 74 2c 20 72 65 74 75 72 6e 20 69 6e 64 65 78  nt, return index
16100 20 69 6e 20 70 61 72 65 6e 74 0a 09 09 69 66 20   in parent...if 
16110 28 20 21 65 6c 65 6d 20 29 20 7b 0a 09 09 09 72  ( !elem ) {....r
16120 65 74 75 72 6e 20 28 20 74 68 69 73 5b 20 30 20  eturn ( this[ 0 
16130 5d 20 26 26 20 74 68 69 73 5b 20 30 20 5d 2e 70  ] && this[ 0 ].p
16140 61 72 65 6e 74 4e 6f 64 65 20 29 20 3f 20 74 68  arentNode ) ? th
16150 69 73 2e 66 69 72 73 74 28 29 2e 70 72 65 76 41  is.first().prevA
16160 6c 6c 28 29 2e 6c 65 6e 67 74 68 20 3a 20 2d 31  ll().length : -1
16170 3b 0a 09 09 7d 0a 0a 09 09 2f 2f 20 49 6e 64 65  ;...}....// Inde
16180 78 20 69 6e 20 73 65 6c 65 63 74 6f 72 0a 09 09  x in selector...
16190 69 66 20 28 20 74 79 70 65 6f 66 20 65 6c 65 6d  if ( typeof elem
161a0 20 3d 3d 3d 20 22 73 74 72 69 6e 67 22 20 29 20   === "string" ) 
161b0 7b 0a 09 09 09 72 65 74 75 72 6e 20 69 6e 64 65  {....return inde
161c0 78 4f 66 2e 63 61 6c 6c 28 20 6a 51 75 65 72 79  xOf.call( jQuery
161d0 28 20 65 6c 65 6d 20 29 2c 20 74 68 69 73 5b 20  ( elem ), this[ 
161e0 30 20 5d 20 29 3b 0a 09 09 7d 0a 0a 09 09 2f 2f  0 ] );...}....//
161f0 20 4c 6f 63 61 74 65 20 74 68 65 20 70 6f 73 69   Locate the posi
16200 74 69 6f 6e 20 6f 66 20 74 68 65 20 64 65 73 69  tion of the desi
16210 72 65 64 20 65 6c 65 6d 65 6e 74 0a 09 09 72 65  red element...re
16220 74 75 72 6e 20 69 6e 64 65 78 4f 66 2e 63 61 6c  turn indexOf.cal
16230 6c 28 20 74 68 69 73 2c 0a 0a 09 09 09 2f 2f 20  l( this,.....// 
16240 49 66 20 69 74 20 72 65 63 65 69 76 65 73 20 61  If it receives a
16250 20 6a 51 75 65 72 79 20 6f 62 6a 65 63 74 2c 20   jQuery object, 
16260 74 68 65 20 66 69 72 73 74 20 65 6c 65 6d 65 6e  the first elemen
16270 74 20 69 73 20 75 73 65 64 0a 09 09 09 65 6c 65  t is used....ele
16280 6d 2e 6a 71 75 65 72 79 20 3f 20 65 6c 65 6d 5b  m.jquery ? elem[
16290 20 30 20 5d 20 3a 20 65 6c 65 6d 0a 09 09 29 3b   0 ] : elem...);
162a0 0a 09 7d 2c 0a 0a 09 61 64 64 3a 20 66 75 6e 63  ..},...add: func
162b0 74 69 6f 6e 28 20 73 65 6c 65 63 74 6f 72 2c 20  tion( selector, 
162c0 63 6f 6e 74 65 78 74 20 29 20 7b 0a 09 09 72 65  context ) {...re
162d0 74 75 72 6e 20 74 68 69 73 2e 70 75 73 68 53 74  turn this.pushSt
162e0 61 63 6b 28 0a 09 09 09 6a 51 75 65 72 79 2e 75  ack(....jQuery.u
162f0 6e 69 71 75 65 53 6f 72 74 28 0a 09 09 09 09 6a  niqueSort(.....j
16300 51 75 65 72 79 2e 6d 65 72 67 65 28 20 74 68 69  Query.merge( thi
16310 73 2e 67 65 74 28 29 2c 20 6a 51 75 65 72 79 28  s.get(), jQuery(
16320 20 73 65 6c 65 63 74 6f 72 2c 20 63 6f 6e 74 65   selector, conte
16330 78 74 20 29 20 29 0a 09 09 09 29 0a 09 09 29 3b  xt ) )....)...);
16340 0a 09 7d 2c 0a 0a 09 61 64 64 42 61 63 6b 3a 20  ..},...addBack: 
16350 66 75 6e 63 74 69 6f 6e 28 20 73 65 6c 65 63 74  function( select
16360 6f 72 20 29 20 7b 0a 09 09 72 65 74 75 72 6e 20  or ) {...return 
16370 74 68 69 73 2e 61 64 64 28 20 73 65 6c 65 63 74  this.add( select
16380 6f 72 20 3d 3d 20 6e 75 6c 6c 20 3f 0a 09 09 09  or == null ?....
16390 74 68 69 73 2e 70 72 65 76 4f 62 6a 65 63 74 20  this.prevObject 
163a0 3a 20 74 68 69 73 2e 70 72 65 76 4f 62 6a 65 63  : this.prevObjec
163b0 74 2e 66 69 6c 74 65 72 28 20 73 65 6c 65 63 74  t.filter( select
163c0 6f 72 20 29 0a 09 09 29 3b 0a 09 7d 0a 7d 20 29  or )...);..}.} )
163d0 3b 0a 0a 66 75 6e 63 74 69 6f 6e 20 73 69 62 6c  ;..function sibl
163e0 69 6e 67 28 20 63 75 72 2c 20 64 69 72 20 29 20  ing( cur, dir ) 
163f0 7b 0a 09 77 68 69 6c 65 20 28 20 28 20 63 75 72  {..while ( ( cur
16400 20 3d 20 63 75 72 5b 20 64 69 72 20 5d 20 29 20   = cur[ dir ] ) 
16410 26 26 20 63 75 72 2e 6e 6f 64 65 54 79 70 65 20  && cur.nodeType 
16420 21 3d 3d 20 31 20 29 20 7b 7d 0a 09 72 65 74 75  !== 1 ) {}..retu
16430 72 6e 20 63 75 72 3b 0a 7d 0a 0a 6a 51 75 65 72  rn cur;.}..jQuer
16440 79 2e 65 61 63 68 28 20 7b 0a 09 70 61 72 65 6e  y.each( {..paren
16450 74 3a 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c 65  t: function( ele
16460 6d 20 29 20 7b 0a 09 09 76 61 72 20 70 61 72 65  m ) {...var pare
16470 6e 74 20 3d 20 65 6c 65 6d 2e 70 61 72 65 6e 74  nt = elem.parent
16480 4e 6f 64 65 3b 0a 09 09 72 65 74 75 72 6e 20 70  Node;...return p
16490 61 72 65 6e 74 20 26 26 20 70 61 72 65 6e 74 2e  arent && parent.
164a0 6e 6f 64 65 54 79 70 65 20 21 3d 3d 20 31 31 20  nodeType !== 11 
164b0 3f 20 70 61 72 65 6e 74 20 3a 20 6e 75 6c 6c 3b  ? parent : null;
164c0 0a 09 7d 2c 0a 09 70 61 72 65 6e 74 73 3a 20 66  ..},..parents: f
164d0 75 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 20 29 20  unction( elem ) 
164e0 7b 0a 09 09 72 65 74 75 72 6e 20 64 69 72 28 20  {...return dir( 
164f0 65 6c 65 6d 2c 20 22 70 61 72 65 6e 74 4e 6f 64  elem, "parentNod
16500 65 22 20 29 3b 0a 09 7d 2c 0a 09 70 61 72 65 6e  e" );..},..paren
16510 74 73 55 6e 74 69 6c 3a 20 66 75 6e 63 74 69 6f  tsUntil: functio
16520 6e 28 20 65 6c 65 6d 2c 20 5f 69 2c 20 75 6e 74  n( elem, _i, unt
16530 69 6c 20 29 20 7b 0a 09 09 72 65 74 75 72 6e 20  il ) {...return 
16540 64 69 72 28 20 65 6c 65 6d 2c 20 22 70 61 72 65  dir( elem, "pare
16550 6e 74 4e 6f 64 65 22 2c 20 75 6e 74 69 6c 20 29  ntNode", until )
16560 3b 0a 09 7d 2c 0a 09 6e 65 78 74 3a 20 66 75 6e  ;..},..next: fun
16570 63 74 69 6f 6e 28 20 65 6c 65 6d 20 29 20 7b 0a  ction( elem ) {.
16580 09 09 72 65 74 75 72 6e 20 73 69 62 6c 69 6e 67  ..return sibling
16590 28 20 65 6c 65 6d 2c 20 22 6e 65 78 74 53 69 62  ( elem, "nextSib
165a0 6c 69 6e 67 22 20 29 3b 0a 09 7d 2c 0a 09 70 72  ling" );..},..pr
165b0 65 76 3a 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c  ev: function( el
165c0 65 6d 20 29 20 7b 0a 09 09 72 65 74 75 72 6e 20  em ) {...return 
165d0 73 69 62 6c 69 6e 67 28 20 65 6c 65 6d 2c 20 22  sibling( elem, "
165e0 70 72 65 76 69 6f 75 73 53 69 62 6c 69 6e 67 22  previousSibling"
165f0 20 29 3b 0a 09 7d 2c 0a 09 6e 65 78 74 41 6c 6c   );..},..nextAll
16600 3a 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c 65 6d  : function( elem
16610 20 29 20 7b 0a 09 09 72 65 74 75 72 6e 20 64 69   ) {...return di
16620 72 28 20 65 6c 65 6d 2c 20 22 6e 65 78 74 53 69  r( elem, "nextSi
16630 62 6c 69 6e 67 22 20 29 3b 0a 09 7d 2c 0a 09 70  bling" );..},..p
16640 72 65 76 41 6c 6c 3a 20 66 75 6e 63 74 69 6f 6e  revAll: function
16650 28 20 65 6c 65 6d 20 29 20 7b 0a 09 09 72 65 74  ( elem ) {...ret
16660 75 72 6e 20 64 69 72 28 20 65 6c 65 6d 2c 20 22  urn dir( elem, "
16670 70 72 65 76 69 6f 75 73 53 69 62 6c 69 6e 67 22  previousSibling"
16680 20 29 3b 0a 09 7d 2c 0a 09 6e 65 78 74 55 6e 74   );..},..nextUnt
16690 69 6c 3a 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c  il: function( el
166a0 65 6d 2c 20 5f 69 2c 20 75 6e 74 69 6c 20 29 20  em, _i, until ) 
166b0 7b 0a 09 09 72 65 74 75 72 6e 20 64 69 72 28 20  {...return dir( 
166c0 65 6c 65 6d 2c 20 22 6e 65 78 74 53 69 62 6c 69  elem, "nextSibli
166d0 6e 67 22 2c 20 75 6e 74 69 6c 20 29 3b 0a 09 7d  ng", until );..}
166e0 2c 0a 09 70 72 65 76 55 6e 74 69 6c 3a 20 66 75  ,..prevUntil: fu
166f0 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 2c 20 5f 69  nction( elem, _i
16700 2c 20 75 6e 74 69 6c 20 29 20 7b 0a 09 09 72 65  , until ) {...re
16710 74 75 72 6e 20 64 69 72 28 20 65 6c 65 6d 2c 20  turn dir( elem, 
16720 22 70 72 65 76 69 6f 75 73 53 69 62 6c 69 6e 67  "previousSibling
16730 22 2c 20 75 6e 74 69 6c 20 29 3b 0a 09 7d 2c 0a  ", until );..},.
16740 09 73 69 62 6c 69 6e 67 73 3a 20 66 75 6e 63 74  .siblings: funct
16750 69 6f 6e 28 20 65 6c 65 6d 20 29 20 7b 0a 09 09  ion( elem ) {...
16760 72 65 74 75 72 6e 20 73 69 62 6c 69 6e 67 73 28  return siblings(
16770 20 28 20 65 6c 65 6d 2e 70 61 72 65 6e 74 4e 6f   ( elem.parentNo
16780 64 65 20 7c 7c 20 7b 7d 20 29 2e 66 69 72 73 74  de || {} ).first
16790 43 68 69 6c 64 2c 20 65 6c 65 6d 20 29 3b 0a 09  Child, elem );..
167a0 7d 2c 0a 09 63 68 69 6c 64 72 65 6e 3a 20 66 75  },..children: fu
167b0 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 20 29 20 7b  nction( elem ) {
167c0 0a 09 09 72 65 74 75 72 6e 20 73 69 62 6c 69 6e  ...return siblin
167d0 67 73 28 20 65 6c 65 6d 2e 66 69 72 73 74 43 68  gs( elem.firstCh
167e0 69 6c 64 20 29 3b 0a 09 7d 2c 0a 09 63 6f 6e 74  ild );..},..cont
167f0 65 6e 74 73 3a 20 66 75 6e 63 74 69 6f 6e 28 20  ents: function( 
16800 65 6c 65 6d 20 29 20 7b 0a 09 09 69 66 20 28 20  elem ) {...if ( 
16810 65 6c 65 6d 2e 63 6f 6e 74 65 6e 74 44 6f 63 75  elem.contentDocu
16820 6d 65 6e 74 20 21 3d 20 6e 75 6c 6c 20 26 26 0a  ment != null &&.
16830 0a 09 09 09 2f 2f 20 53 75 70 70 6f 72 74 3a 20  ....// Support: 
16840 49 45 20 31 31 2b 0a 09 09 09 2f 2f 20 3c 6f 62  IE 11+....// <ob
16850 6a 65 63 74 3e 20 65 6c 65 6d 65 6e 74 73 20 77  ject> elements w
16860 69 74 68 20 6e 6f 20 60 64 61 74 61 60 20 61 74  ith no `data` at
16870 74 72 69 62 75 74 65 20 68 61 73 20 61 6e 20 6f  tribute has an o
16880 62 6a 65 63 74 0a 09 09 09 2f 2f 20 60 63 6f 6e  bject....// `con
16890 74 65 6e 74 44 6f 63 75 6d 65 6e 74 60 20 77 69  tentDocument` wi
168a0 74 68 20 61 20 60 6e 75 6c 6c 60 20 70 72 6f 74  th a `null` prot
168b0 6f 74 79 70 65 2e 0a 09 09 09 67 65 74 50 72 6f  otype.....getPro
168c0 74 6f 28 20 65 6c 65 6d 2e 63 6f 6e 74 65 6e 74  to( elem.content
168d0 44 6f 63 75 6d 65 6e 74 20 29 20 29 20 7b 0a 0a  Document ) ) {..
168e0 09 09 09 72 65 74 75 72 6e 20 65 6c 65 6d 2e 63  ...return elem.c
168f0 6f 6e 74 65 6e 74 44 6f 63 75 6d 65 6e 74 3b 0a  ontentDocument;.
16900 09 09 7d 0a 0a 09 09 2f 2f 20 53 75 70 70 6f 72  ..}....// Suppor
16910 74 3a 20 49 45 20 39 20 2d 20 31 31 20 6f 6e 6c  t: IE 9 - 11 onl
16920 79 2c 20 69 4f 53 20 37 20 6f 6e 6c 79 2c 20 41  y, iOS 7 only, A
16930 6e 64 72 6f 69 64 20 42 72 6f 77 73 65 72 20 3c  ndroid Browser <
16940 3d 34 2e 33 20 6f 6e 6c 79 0a 09 09 2f 2f 20 54  =4.3 only...// T
16950 72 65 61 74 20 74 68 65 20 74 65 6d 70 6c 61 74  reat the templat
16960 65 20 65 6c 65 6d 65 6e 74 20 61 73 20 61 20 72  e element as a r
16970 65 67 75 6c 61 72 20 6f 6e 65 20 69 6e 20 62 72  egular one in br
16980 6f 77 73 65 72 73 20 74 68 61 74 0a 09 09 2f 2f  owsers that...//
16990 20 64 6f 6e 27 74 20 73 75 70 70 6f 72 74 20 69   don't support i
169a0 74 2e 0a 09 09 69 66 20 28 20 6e 6f 64 65 4e 61  t....if ( nodeNa
169b0 6d 65 28 20 65 6c 65 6d 2c 20 22 74 65 6d 70 6c  me( elem, "templ
169c0 61 74 65 22 20 29 20 29 20 7b 0a 09 09 09 65 6c  ate" ) ) {....el
169d0 65 6d 20 3d 20 65 6c 65 6d 2e 63 6f 6e 74 65 6e  em = elem.conten
169e0 74 20 7c 7c 20 65 6c 65 6d 3b 0a 09 09 7d 0a 0a  t || elem;...}..
169f0 09 09 72 65 74 75 72 6e 20 6a 51 75 65 72 79 2e  ..return jQuery.
16a00 6d 65 72 67 65 28 20 5b 5d 2c 20 65 6c 65 6d 2e  merge( [], elem.
16a10 63 68 69 6c 64 4e 6f 64 65 73 20 29 3b 0a 09 7d  childNodes );..}
16a20 0a 7d 2c 20 66 75 6e 63 74 69 6f 6e 28 20 6e 61  .}, function( na
16a30 6d 65 2c 20 66 6e 20 29 20 7b 0a 09 6a 51 75 65  me, fn ) {..jQue
16a40 72 79 2e 66 6e 5b 20 6e 61 6d 65 20 5d 20 3d 20  ry.fn[ name ] = 
16a50 66 75 6e 63 74 69 6f 6e 28 20 75 6e 74 69 6c 2c  function( until,
16a60 20 73 65 6c 65 63 74 6f 72 20 29 20 7b 0a 09 09   selector ) {...
16a70 76 61 72 20 6d 61 74 63 68 65 64 20 3d 20 6a 51  var matched = jQ
16a80 75 65 72 79 2e 6d 61 70 28 20 74 68 69 73 2c 20  uery.map( this, 
16a90 66 6e 2c 20 75 6e 74 69 6c 20 29 3b 0a 0a 09 09  fn, until );....
16aa0 69 66 20 28 20 6e 61 6d 65 2e 73 6c 69 63 65 28  if ( name.slice(
16ab0 20 2d 35 20 29 20 21 3d 3d 20 22 55 6e 74 69 6c   -5 ) !== "Until
16ac0 22 20 29 20 7b 0a 09 09 09 73 65 6c 65 63 74 6f  " ) {....selecto
16ad0 72 20 3d 20 75 6e 74 69 6c 3b 0a 09 09 7d 0a 0a  r = until;...}..
16ae0 09 09 69 66 20 28 20 73 65 6c 65 63 74 6f 72 20  ..if ( selector 
16af0 26 26 20 74 79 70 65 6f 66 20 73 65 6c 65 63 74  && typeof select
16b00 6f 72 20 3d 3d 3d 20 22 73 74 72 69 6e 67 22 20  or === "string" 
16b10 29 20 7b 0a 09 09 09 6d 61 74 63 68 65 64 20 3d  ) {....matched =
16b20 20 6a 51 75 65 72 79 2e 66 69 6c 74 65 72 28 20   jQuery.filter( 
16b30 73 65 6c 65 63 74 6f 72 2c 20 6d 61 74 63 68 65  selector, matche
16b40 64 20 29 3b 0a 09 09 7d 0a 0a 09 09 69 66 20 28  d );...}....if (
16b50 20 74 68 69 73 2e 6c 65 6e 67 74 68 20 3e 20 31   this.length > 1
16b60 20 29 20 7b 0a 0a 09 09 09 2f 2f 20 52 65 6d 6f   ) {.....// Remo
16b70 76 65 20 64 75 70 6c 69 63 61 74 65 73 0a 09 09  ve duplicates...
16b80 09 69 66 20 28 20 21 67 75 61 72 61 6e 74 65 65  .if ( !guarantee
16b90 64 55 6e 69 71 75 65 5b 20 6e 61 6d 65 20 5d 20  dUnique[ name ] 
16ba0 29 20 7b 0a 09 09 09 09 6a 51 75 65 72 79 2e 75  ) {.....jQuery.u
16bb0 6e 69 71 75 65 53 6f 72 74 28 20 6d 61 74 63 68  niqueSort( match
16bc0 65 64 20 29 3b 0a 09 09 09 7d 0a 0a 09 09 09 2f  ed );....}...../
16bd0 2f 20 52 65 76 65 72 73 65 20 6f 72 64 65 72 20  / Reverse order 
16be0 66 6f 72 20 70 61 72 65 6e 74 73 2a 20 61 6e 64  for parents* and
16bf0 20 70 72 65 76 2d 64 65 72 69 76 61 74 69 76 65   prev-derivative
16c00 73 0a 09 09 09 69 66 20 28 20 72 70 61 72 65 6e  s....if ( rparen
16c10 74 73 70 72 65 76 2e 74 65 73 74 28 20 6e 61 6d  tsprev.test( nam
16c20 65 20 29 20 29 20 7b 0a 09 09 09 09 6d 61 74 63  e ) ) {.....matc
16c30 68 65 64 2e 72 65 76 65 72 73 65 28 29 3b 0a 09  hed.reverse();..
16c40 09 09 7d 0a 09 09 7d 0a 0a 09 09 72 65 74 75 72  ..}...}....retur
16c50 6e 20 74 68 69 73 2e 70 75 73 68 53 74 61 63 6b  n this.pushStack
16c60 28 20 6d 61 74 63 68 65 64 20 29 3b 0a 09 7d 3b  ( matched );..};
16c70 0a 7d 20 29 3b 0a 76 61 72 20 72 6e 6f 74 68 74  .} );.var rnotht
16c80 6d 6c 77 68 69 74 65 20 3d 20 28 20 2f 5b 5e 5c  mlwhite = ( /[^\
16c90 78 32 30 5c 74 5c 72 5c 6e 5c 66 5d 2b 2f 67 20  x20\t\r\n\f]+/g 
16ca0 29 3b 0a 0a 0a 0a 2f 2f 20 43 6f 6e 76 65 72 74  );....// Convert
16cb0 20 53 74 72 69 6e 67 2d 66 6f 72 6d 61 74 74 65   String-formatte
16cc0 64 20 6f 70 74 69 6f 6e 73 20 69 6e 74 6f 20 4f  d options into O
16cd0 62 6a 65 63 74 2d 66 6f 72 6d 61 74 74 65 64 20  bject-formatted 
16ce0 6f 6e 65 73 0a 66 75 6e 63 74 69 6f 6e 20 63 72  ones.function cr
16cf0 65 61 74 65 4f 70 74 69 6f 6e 73 28 20 6f 70 74  eateOptions( opt
16d00 69 6f 6e 73 20 29 20 7b 0a 09 76 61 72 20 6f 62  ions ) {..var ob
16d10 6a 65 63 74 20 3d 20 7b 7d 3b 0a 09 6a 51 75 65  ject = {};..jQue
16d20 72 79 2e 65 61 63 68 28 20 6f 70 74 69 6f 6e 73  ry.each( options
16d30 2e 6d 61 74 63 68 28 20 72 6e 6f 74 68 74 6d 6c  .match( rnothtml
16d40 77 68 69 74 65 20 29 20 7c 7c 20 5b 5d 2c 20 66  white ) || [], f
16d50 75 6e 63 74 69 6f 6e 28 20 5f 2c 20 66 6c 61 67  unction( _, flag
16d60 20 29 20 7b 0a 09 09 6f 62 6a 65 63 74 5b 20 66   ) {...object[ f
16d70 6c 61 67 20 5d 20 3d 20 74 72 75 65 3b 0a 09 7d  lag ] = true;..}
16d80 20 29 3b 0a 09 72 65 74 75 72 6e 20 6f 62 6a 65   );..return obje
16d90 63 74 3b 0a 7d 0a 0a 2f 2a 0a 20 2a 20 43 72 65  ct;.}../*. * Cre
16da0 61 74 65 20 61 20 63 61 6c 6c 62 61 63 6b 20 6c  ate a callback l
16db0 69 73 74 20 75 73 69 6e 67 20 74 68 65 20 66 6f  ist using the fo
16dc0 6c 6c 6f 77 69 6e 67 20 70 61 72 61 6d 65 74 65  llowing paramete
16dd0 72 73 3a 0a 20 2a 0a 20 2a 09 6f 70 74 69 6f 6e  rs:. *. *.option
16de0 73 3a 20 61 6e 20 6f 70 74 69 6f 6e 61 6c 20 6c  s: an optional l
16df0 69 73 74 20 6f 66 20 73 70 61 63 65 2d 73 65 70  ist of space-sep
16e00 61 72 61 74 65 64 20 6f 70 74 69 6f 6e 73 20 74  arated options t
16e10 68 61 74 20 77 69 6c 6c 20 63 68 61 6e 67 65 20  hat will change 
16e20 68 6f 77 0a 20 2a 09 09 09 74 68 65 20 63 61 6c  how. *...the cal
16e30 6c 62 61 63 6b 20 6c 69 73 74 20 62 65 68 61 76  lback list behav
16e40 65 73 20 6f 72 20 61 20 6d 6f 72 65 20 74 72 61  es or a more tra
16e50 64 69 74 69 6f 6e 61 6c 20 6f 70 74 69 6f 6e 20  ditional option 
16e60 6f 62 6a 65 63 74 0a 20 2a 0a 20 2a 20 42 79 20  object. *. * By 
16e70 64 65 66 61 75 6c 74 20 61 20 63 61 6c 6c 62 61  default a callba
16e80 63 6b 20 6c 69 73 74 20 77 69 6c 6c 20 61 63 74  ck list will act
16e90 20 6c 69 6b 65 20 61 6e 20 65 76 65 6e 74 20 63   like an event c
16ea0 61 6c 6c 62 61 63 6b 20 6c 69 73 74 20 61 6e 64  allback list and
16eb0 20 63 61 6e 20 62 65 0a 20 2a 20 22 66 69 72 65   can be. * "fire
16ec0 64 22 20 6d 75 6c 74 69 70 6c 65 20 74 69 6d 65  d" multiple time
16ed0 73 2e 0a 20 2a 0a 20 2a 20 50 6f 73 73 69 62 6c  s.. *. * Possibl
16ee0 65 20 6f 70 74 69 6f 6e 73 3a 0a 20 2a 0a 20 2a  e options:. *. *
16ef0 09 6f 6e 63 65 3a 09 09 09 77 69 6c 6c 20 65 6e  .once:...will en
16f00 73 75 72 65 20 74 68 65 20 63 61 6c 6c 62 61 63  sure the callbac
16f10 6b 20 6c 69 73 74 20 63 61 6e 20 6f 6e 6c 79 20  k list can only 
16f20 62 65 20 66 69 72 65 64 20 6f 6e 63 65 20 28 6c  be fired once (l
16f30 69 6b 65 20 61 20 44 65 66 65 72 72 65 64 29 0a  ike a Deferred).
16f40 20 2a 0a 20 2a 09 6d 65 6d 6f 72 79 3a 09 09 09   *. *.memory:...
16f50 77 69 6c 6c 20 6b 65 65 70 20 74 72 61 63 6b 20  will keep track 
16f60 6f 66 20 70 72 65 76 69 6f 75 73 20 76 61 6c 75  of previous valu
16f70 65 73 20 61 6e 64 20 77 69 6c 6c 20 63 61 6c 6c  es and will call
16f80 20 61 6e 79 20 63 61 6c 6c 62 61 63 6b 20 61 64   any callback ad
16f90 64 65 64 0a 20 2a 09 09 09 09 09 61 66 74 65 72  ded. *.....after
16fa0 20 74 68 65 20 6c 69 73 74 20 68 61 73 20 62 65   the list has be
16fb0 65 6e 20 66 69 72 65 64 20 72 69 67 68 74 20 61  en fired right a
16fc0 77 61 79 20 77 69 74 68 20 74 68 65 20 6c 61 74  way with the lat
16fd0 65 73 74 20 22 6d 65 6d 6f 72 69 7a 65 64 22 0a  est "memorized".
16fe0 20 2a 09 09 09 09 09 76 61 6c 75 65 73 20 28 6c   *.....values (l
16ff0 69 6b 65 20 61 20 44 65 66 65 72 72 65 64 29 0a  ike a Deferred).
17000 20 2a 0a 20 2a 09 75 6e 69 71 75 65 3a 09 09 09   *. *.unique:...
17010 77 69 6c 6c 20 65 6e 73 75 72 65 20 61 20 63 61  will ensure a ca
17020 6c 6c 62 61 63 6b 20 63 61 6e 20 6f 6e 6c 79 20  llback can only 
17030 62 65 20 61 64 64 65 64 20 6f 6e 63 65 20 28 6e  be added once (n
17040 6f 20 64 75 70 6c 69 63 61 74 65 20 69 6e 20 74  o duplicate in t
17050 68 65 20 6c 69 73 74 29 0a 20 2a 0a 20 2a 09 73  he list). *. *.s
17060 74 6f 70 4f 6e 46 61 6c 73 65 3a 09 69 6e 74 65  topOnFalse:.inte
17070 72 72 75 70 74 20 63 61 6c 6c 69 6e 67 73 20 77  rrupt callings w
17080 68 65 6e 20 61 20 63 61 6c 6c 62 61 63 6b 20 72  hen a callback r
17090 65 74 75 72 6e 73 20 66 61 6c 73 65 0a 20 2a 0a  eturns false. *.
170a0 20 2a 2f 0a 6a 51 75 65 72 79 2e 43 61 6c 6c 62   */.jQuery.Callb
170b0 61 63 6b 73 20 3d 20 66 75 6e 63 74 69 6f 6e 28  acks = function(
170c0 20 6f 70 74 69 6f 6e 73 20 29 20 7b 0a 0a 09 2f   options ) {.../
170d0 2f 20 43 6f 6e 76 65 72 74 20 6f 70 74 69 6f 6e  / Convert option
170e0 73 20 66 72 6f 6d 20 53 74 72 69 6e 67 2d 66 6f  s from String-fo
170f0 72 6d 61 74 74 65 64 20 74 6f 20 4f 62 6a 65 63  rmatted to Objec
17100 74 2d 66 6f 72 6d 61 74 74 65 64 20 69 66 20 6e  t-formatted if n
17110 65 65 64 65 64 0a 09 2f 2f 20 28 77 65 20 63 68  eeded..// (we ch
17120 65 63 6b 20 69 6e 20 63 61 63 68 65 20 66 69 72  eck in cache fir
17130 73 74 29 0a 09 6f 70 74 69 6f 6e 73 20 3d 20 74  st)..options = t
17140 79 70 65 6f 66 20 6f 70 74 69 6f 6e 73 20 3d 3d  ypeof options ==
17150 3d 20 22 73 74 72 69 6e 67 22 20 3f 0a 09 09 63  = "string" ?...c
17160 72 65 61 74 65 4f 70 74 69 6f 6e 73 28 20 6f 70  reateOptions( op
17170 74 69 6f 6e 73 20 29 20 3a 0a 09 09 6a 51 75 65  tions ) :...jQue
17180 72 79 2e 65 78 74 65 6e 64 28 20 7b 7d 2c 20 6f  ry.extend( {}, o
17190 70 74 69 6f 6e 73 20 29 3b 0a 0a 09 76 61 72 20  ptions );...var 
171a0 2f 2f 20 46 6c 61 67 20 74 6f 20 6b 6e 6f 77 20  // Flag to know 
171b0 69 66 20 6c 69 73 74 20 69 73 20 63 75 72 72 65  if list is curre
171c0 6e 74 6c 79 20 66 69 72 69 6e 67 0a 09 09 66 69  ntly firing...fi
171d0 72 69 6e 67 2c 0a 0a 09 09 2f 2f 20 4c 61 73 74  ring,....// Last
171e0 20 66 69 72 65 20 76 61 6c 75 65 20 66 6f 72 20   fire value for 
171f0 6e 6f 6e 2d 66 6f 72 67 65 74 74 61 62 6c 65 20  non-forgettable 
17200 6c 69 73 74 73 0a 09 09 6d 65 6d 6f 72 79 2c 0a  lists...memory,.
17210 0a 09 09 2f 2f 20 46 6c 61 67 20 74 6f 20 6b 6e  ...// Flag to kn
17220 6f 77 20 69 66 20 6c 69 73 74 20 77 61 73 20 61  ow if list was a
17230 6c 72 65 61 64 79 20 66 69 72 65 64 0a 09 09 66  lready fired...f
17240 69 72 65 64 2c 0a 0a 09 09 2f 2f 20 46 6c 61 67  ired,....// Flag
17250 20 74 6f 20 70 72 65 76 65 6e 74 20 66 69 72 69   to prevent firi
17260 6e 67 0a 09 09 6c 6f 63 6b 65 64 2c 0a 0a 09 09  ng...locked,....
17270 2f 2f 20 41 63 74 75 61 6c 20 63 61 6c 6c 62 61  // Actual callba
17280 63 6b 20 6c 69 73 74 0a 09 09 6c 69 73 74 20 3d  ck list...list =
17290 20 5b 5d 2c 0a 0a 09 09 2f 2f 20 51 75 65 75 65   [],....// Queue
172a0 20 6f 66 20 65 78 65 63 75 74 69 6f 6e 20 64 61   of execution da
172b0 74 61 20 66 6f 72 20 72 65 70 65 61 74 61 62 6c  ta for repeatabl
172c0 65 20 6c 69 73 74 73 0a 09 09 71 75 65 75 65 20  e lists...queue 
172d0 3d 20 5b 5d 2c 0a 0a 09 09 2f 2f 20 49 6e 64 65  = [],....// Inde
172e0 78 20 6f 66 20 63 75 72 72 65 6e 74 6c 79 20 66  x of currently f
172f0 69 72 69 6e 67 20 63 61 6c 6c 62 61 63 6b 20 28  iring callback (
17300 6d 6f 64 69 66 69 65 64 20 62 79 20 61 64 64 2f  modified by add/
17310 72 65 6d 6f 76 65 20 61 73 20 6e 65 65 64 65 64  remove as needed
17320 29 0a 09 09 66 69 72 69 6e 67 49 6e 64 65 78 20  )...firingIndex 
17330 3d 20 2d 31 2c 0a 0a 09 09 2f 2f 20 46 69 72 65  = -1,....// Fire
17340 20 63 61 6c 6c 62 61 63 6b 73 0a 09 09 66 69 72   callbacks...fir
17350 65 20 3d 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b  e = function() {
17360 0a 0a 09 09 09 2f 2f 20 45 6e 66 6f 72 63 65 20  .....// Enforce 
17370 73 69 6e 67 6c 65 2d 66 69 72 69 6e 67 0a 09 09  single-firing...
17380 09 6c 6f 63 6b 65 64 20 3d 20 6c 6f 63 6b 65 64  .locked = locked
17390 20 7c 7c 20 6f 70 74 69 6f 6e 73 2e 6f 6e 63 65   || options.once
173a0 3b 0a 0a 09 09 09 2f 2f 20 45 78 65 63 75 74 65  ;.....// Execute
173b0 20 63 61 6c 6c 62 61 63 6b 73 20 66 6f 72 20 61   callbacks for a
173c0 6c 6c 20 70 65 6e 64 69 6e 67 20 65 78 65 63 75  ll pending execu
173d0 74 69 6f 6e 73 2c 0a 09 09 09 2f 2f 20 72 65 73  tions,....// res
173e0 70 65 63 74 69 6e 67 20 66 69 72 69 6e 67 49 6e  pecting firingIn
173f0 64 65 78 20 6f 76 65 72 72 69 64 65 73 20 61 6e  dex overrides an
17400 64 20 72 75 6e 74 69 6d 65 20 63 68 61 6e 67 65  d runtime change
17410 73 0a 09 09 09 66 69 72 65 64 20 3d 20 66 69 72  s....fired = fir
17420 69 6e 67 20 3d 20 74 72 75 65 3b 0a 09 09 09 66  ing = true;....f
17430 6f 72 20 28 20 3b 20 71 75 65 75 65 2e 6c 65 6e  or ( ; queue.len
17440 67 74 68 3b 20 66 69 72 69 6e 67 49 6e 64 65 78  gth; firingIndex
17450 20 3d 20 2d 31 20 29 20 7b 0a 09 09 09 09 6d 65   = -1 ) {.....me
17460 6d 6f 72 79 20 3d 20 71 75 65 75 65 2e 73 68 69  mory = queue.shi
17470 66 74 28 29 3b 0a 09 09 09 09 77 68 69 6c 65 20  ft();.....while 
17480 28 20 2b 2b 66 69 72 69 6e 67 49 6e 64 65 78 20  ( ++firingIndex 
17490 3c 20 6c 69 73 74 2e 6c 65 6e 67 74 68 20 29 20  < list.length ) 
174a0 7b 0a 0a 09 09 09 09 09 2f 2f 20 52 75 6e 20 63  {.......// Run c
174b0 61 6c 6c 62 61 63 6b 20 61 6e 64 20 63 68 65 63  allback and chec
174c0 6b 20 66 6f 72 20 65 61 72 6c 79 20 74 65 72 6d  k for early term
174d0 69 6e 61 74 69 6f 6e 0a 09 09 09 09 09 69 66 20  ination......if 
174e0 28 20 6c 69 73 74 5b 20 66 69 72 69 6e 67 49 6e  ( list[ firingIn
174f0 64 65 78 20 5d 2e 61 70 70 6c 79 28 20 6d 65 6d  dex ].apply( mem
17500 6f 72 79 5b 20 30 20 5d 2c 20 6d 65 6d 6f 72 79  ory[ 0 ], memory
17510 5b 20 31 20 5d 20 29 20 3d 3d 3d 20 66 61 6c 73  [ 1 ] ) === fals
17520 65 20 26 26 0a 09 09 09 09 09 09 6f 70 74 69 6f  e &&.......optio
17530 6e 73 2e 73 74 6f 70 4f 6e 46 61 6c 73 65 20 29  ns.stopOnFalse )
17540 20 7b 0a 0a 09 09 09 09 09 09 2f 2f 20 4a 75 6d   {........// Jum
17550 70 20 74 6f 20 65 6e 64 20 61 6e 64 20 66 6f 72  p to end and for
17560 67 65 74 20 74 68 65 20 64 61 74 61 20 73 6f 20  get the data so 
17570 2e 61 64 64 20 64 6f 65 73 6e 27 74 20 72 65 2d  .add doesn't re-
17580 66 69 72 65 0a 09 09 09 09 09 09 66 69 72 69 6e  fire.......firin
17590 67 49 6e 64 65 78 20 3d 20 6c 69 73 74 2e 6c 65  gIndex = list.le
175a0 6e 67 74 68 3b 0a 09 09 09 09 09 09 6d 65 6d 6f  ngth;.......memo
175b0 72 79 20 3d 20 66 61 6c 73 65 3b 0a 09 09 09 09  ry = false;.....
175c0 09 7d 0a 09 09 09 09 7d 0a 09 09 09 7d 0a 0a 09  .}.....}....}...
175d0 09 09 2f 2f 20 46 6f 72 67 65 74 20 74 68 65 20  ..// Forget the 
175e0 64 61 74 61 20 69 66 20 77 65 27 72 65 20 64 6f  data if we're do
175f0 6e 65 20 77 69 74 68 20 69 74 0a 09 09 09 69 66  ne with it....if
17600 20 28 20 21 6f 70 74 69 6f 6e 73 2e 6d 65 6d 6f   ( !options.memo
17610 72 79 20 29 20 7b 0a 09 09 09 09 6d 65 6d 6f 72  ry ) {.....memor
17620 79 20 3d 20 66 61 6c 73 65 3b 0a 09 09 09 7d 0a  y = false;....}.
17630 0a 09 09 09 66 69 72 69 6e 67 20 3d 20 66 61 6c  ....firing = fal
17640 73 65 3b 0a 0a 09 09 09 2f 2f 20 43 6c 65 61 6e  se;.....// Clean
17650 20 75 70 20 69 66 20 77 65 27 72 65 20 64 6f 6e   up if we're don
17660 65 20 66 69 72 69 6e 67 20 66 6f 72 20 67 6f 6f  e firing for goo
17670 64 0a 09 09 09 69 66 20 28 20 6c 6f 63 6b 65 64  d....if ( locked
17680 20 29 20 7b 0a 0a 09 09 09 09 2f 2f 20 4b 65 65   ) {......// Kee
17690 70 20 61 6e 20 65 6d 70 74 79 20 6c 69 73 74 20  p an empty list 
176a0 69 66 20 77 65 20 68 61 76 65 20 64 61 74 61 20  if we have data 
176b0 66 6f 72 20 66 75 74 75 72 65 20 61 64 64 20 63  for future add c
176c0 61 6c 6c 73 0a 09 09 09 09 69 66 20 28 20 6d 65  alls.....if ( me
176d0 6d 6f 72 79 20 29 20 7b 0a 09 09 09 09 09 6c 69  mory ) {......li
176e0 73 74 20 3d 20 5b 5d 3b 0a 0a 09 09 09 09 2f 2f  st = [];......//
176f0 20 4f 74 68 65 72 77 69 73 65 2c 20 74 68 69 73   Otherwise, this
17700 20 6f 62 6a 65 63 74 20 69 73 20 73 70 65 6e 74   object is spent
17710 0a 09 09 09 09 7d 20 65 6c 73 65 20 7b 0a 09 09  .....} else {...
17720 09 09 09 6c 69 73 74 20 3d 20 22 22 3b 0a 09 09  ...list = "";...
17730 09 09 7d 0a 09 09 09 7d 0a 09 09 7d 2c 0a 0a 09  ..}....}...},...
17740 09 2f 2f 20 41 63 74 75 61 6c 20 43 61 6c 6c 62  .// Actual Callb
17750 61 63 6b 73 20 6f 62 6a 65 63 74 0a 09 09 73 65  acks object...se
17760 6c 66 20 3d 20 7b 0a 0a 09 09 09 2f 2f 20 41 64  lf = {.....// Ad
17770 64 20 61 20 63 61 6c 6c 62 61 63 6b 20 6f 72 20  d a callback or 
17780 61 20 63 6f 6c 6c 65 63 74 69 6f 6e 20 6f 66 20  a collection of 
17790 63 61 6c 6c 62 61 63 6b 73 20 74 6f 20 74 68 65  callbacks to the
177a0 20 6c 69 73 74 0a 09 09 09 61 64 64 3a 20 66 75   list....add: fu
177b0 6e 63 74 69 6f 6e 28 29 20 7b 0a 09 09 09 09 69  nction() {.....i
177c0 66 20 28 20 6c 69 73 74 20 29 20 7b 0a 0a 09 09  f ( list ) {....
177d0 09 09 09 2f 2f 20 49 66 20 77 65 20 68 61 76 65  ...// If we have
177e0 20 6d 65 6d 6f 72 79 20 66 72 6f 6d 20 61 20 70   memory from a p
177f0 61 73 74 20 72 75 6e 2c 20 77 65 20 73 68 6f 75  ast run, we shou
17800 6c 64 20 66 69 72 65 20 61 66 74 65 72 20 61 64  ld fire after ad
17810 64 69 6e 67 0a 09 09 09 09 09 69 66 20 28 20 6d  ding......if ( m
17820 65 6d 6f 72 79 20 26 26 20 21 66 69 72 69 6e 67  emory && !firing
17830 20 29 20 7b 0a 09 09 09 09 09 09 66 69 72 69 6e   ) {.......firin
17840 67 49 6e 64 65 78 20 3d 20 6c 69 73 74 2e 6c 65  gIndex = list.le
17850 6e 67 74 68 20 2d 20 31 3b 0a 09 09 09 09 09 09  ngth - 1;.......
17860 71 75 65 75 65 2e 70 75 73 68 28 20 6d 65 6d 6f  queue.push( memo
17870 72 79 20 29 3b 0a 09 09 09 09 09 7d 0a 0a 09 09  ry );......}....
17880 09 09 09 28 20 66 75 6e 63 74 69 6f 6e 20 61 64  ...( function ad
17890 64 28 20 61 72 67 73 20 29 20 7b 0a 09 09 09 09  d( args ) {.....
178a0 09 09 6a 51 75 65 72 79 2e 65 61 63 68 28 20 61  ..jQuery.each( a
178b0 72 67 73 2c 20 66 75 6e 63 74 69 6f 6e 28 20 5f  rgs, function( _
178c0 2c 20 61 72 67 20 29 20 7b 0a 09 09 09 09 09 09  , arg ) {.......
178d0 09 69 66 20 28 20 69 73 46 75 6e 63 74 69 6f 6e  .if ( isFunction
178e0 28 20 61 72 67 20 29 20 29 20 7b 0a 09 09 09 09  ( arg ) ) {.....
178f0 09 09 09 09 69 66 20 28 20 21 6f 70 74 69 6f 6e  ....if ( !option
17900 73 2e 75 6e 69 71 75 65 20 7c 7c 20 21 73 65 6c  s.unique || !sel
17910 66 2e 68 61 73 28 20 61 72 67 20 29 20 29 20 7b  f.has( arg ) ) {
17920 0a 09 09 09 09 09 09 09 09 09 6c 69 73 74 2e 70  ..........list.p
17930 75 73 68 28 20 61 72 67 20 29 3b 0a 09 09 09 09  ush( arg );.....
17940 09 09 09 09 7d 0a 09 09 09 09 09 09 09 7d 20 65  ....}........} e
17950 6c 73 65 20 69 66 20 28 20 61 72 67 20 26 26 20  lse if ( arg && 
17960 61 72 67 2e 6c 65 6e 67 74 68 20 26 26 20 74 6f  arg.length && to
17970 54 79 70 65 28 20 61 72 67 20 29 20 21 3d 3d 20  Type( arg ) !== 
17980 22 73 74 72 69 6e 67 22 20 29 20 7b 0a 0a 09 09  "string" ) {....
17990 09 09 09 09 09 09 2f 2f 20 49 6e 73 70 65 63 74  ......// Inspect
179a0 20 72 65 63 75 72 73 69 76 65 6c 79 0a 09 09 09   recursively....
179b0 09 09 09 09 09 61 64 64 28 20 61 72 67 20 29 3b  .....add( arg );
179c0 0a 09 09 09 09 09 09 09 7d 0a 09 09 09 09 09 09  ........}.......
179d0 7d 20 29 3b 0a 09 09 09 09 09 7d 20 29 28 20 61  } );......} )( a
179e0 72 67 75 6d 65 6e 74 73 20 29 3b 0a 0a 09 09 09  rguments );.....
179f0 09 09 69 66 20 28 20 6d 65 6d 6f 72 79 20 26 26  ..if ( memory &&
17a00 20 21 66 69 72 69 6e 67 20 29 20 7b 0a 09 09 09   !firing ) {....
17a10 09 09 09 66 69 72 65 28 29 3b 0a 09 09 09 09 09  ...fire();......
17a20 7d 0a 09 09 09 09 7d 0a 09 09 09 09 72 65 74 75  }.....}.....retu
17a30 72 6e 20 74 68 69 73 3b 0a 09 09 09 7d 2c 0a 0a  rn this;....},..
17a40 09 09 09 2f 2f 20 52 65 6d 6f 76 65 20 61 20 63  ...// Remove a c
17a50 61 6c 6c 62 61 63 6b 20 66 72 6f 6d 20 74 68 65  allback from the
17a60 20 6c 69 73 74 0a 09 09 09 72 65 6d 6f 76 65 3a   list....remove:
17a70 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09 09   function() {...
17a80 09 09 6a 51 75 65 72 79 2e 65 61 63 68 28 20 61  ..jQuery.each( a
17a90 72 67 75 6d 65 6e 74 73 2c 20 66 75 6e 63 74 69  rguments, functi
17aa0 6f 6e 28 20 5f 2c 20 61 72 67 20 29 20 7b 0a 09  on( _, arg ) {..
17ab0 09 09 09 09 76 61 72 20 69 6e 64 65 78 3b 0a 09  ....var index;..
17ac0 09 09 09 09 77 68 69 6c 65 20 28 20 28 20 69 6e  ....while ( ( in
17ad0 64 65 78 20 3d 20 6a 51 75 65 72 79 2e 69 6e 41  dex = jQuery.inA
17ae0 72 72 61 79 28 20 61 72 67 2c 20 6c 69 73 74 2c  rray( arg, list,
17af0 20 69 6e 64 65 78 20 29 20 29 20 3e 20 2d 31 20   index ) ) > -1 
17b00 29 20 7b 0a 09 09 09 09 09 09 6c 69 73 74 2e 73  ) {.......list.s
17b10 70 6c 69 63 65 28 20 69 6e 64 65 78 2c 20 31 20  plice( index, 1 
17b20 29 3b 0a 0a 09 09 09 09 09 09 2f 2f 20 48 61 6e  );........// Han
17b30 64 6c 65 20 66 69 72 69 6e 67 20 69 6e 64 65 78  dle firing index
17b40 65 73 0a 09 09 09 09 09 09 69 66 20 28 20 69 6e  es.......if ( in
17b50 64 65 78 20 3c 3d 20 66 69 72 69 6e 67 49 6e 64  dex <= firingInd
17b60 65 78 20 29 20 7b 0a 09 09 09 09 09 09 09 66 69  ex ) {........fi
17b70 72 69 6e 67 49 6e 64 65 78 2d 2d 3b 0a 09 09 09  ringIndex--;....
17b80 09 09 09 7d 0a 09 09 09 09 09 7d 0a 09 09 09 09  ...}......}.....
17b90 7d 20 29 3b 0a 09 09 09 09 72 65 74 75 72 6e 20  } );.....return 
17ba0 74 68 69 73 3b 0a 09 09 09 7d 2c 0a 0a 09 09 09  this;....},.....
17bb0 2f 2f 20 43 68 65 63 6b 20 69 66 20 61 20 67 69  // Check if a gi
17bc0 76 65 6e 20 63 61 6c 6c 62 61 63 6b 20 69 73 20  ven callback is 
17bd0 69 6e 20 74 68 65 20 6c 69 73 74 2e 0a 09 09 09  in the list.....
17be0 2f 2f 20 49 66 20 6e 6f 20 61 72 67 75 6d 65 6e  // If no argumen
17bf0 74 20 69 73 20 67 69 76 65 6e 2c 20 72 65 74 75  t is given, retu
17c00 72 6e 20 77 68 65 74 68 65 72 20 6f 72 20 6e 6f  rn whether or no
17c10 74 20 6c 69 73 74 20 68 61 73 20 63 61 6c 6c 62  t list has callb
17c20 61 63 6b 73 20 61 74 74 61 63 68 65 64 2e 0a 09  acks attached...
17c30 09 09 68 61 73 3a 20 66 75 6e 63 74 69 6f 6e 28  ..has: function(
17c40 20 66 6e 20 29 20 7b 0a 09 09 09 09 72 65 74 75   fn ) {.....retu
17c50 72 6e 20 66 6e 20 3f 0a 09 09 09 09 09 6a 51 75  rn fn ?......jQu
17c60 65 72 79 2e 69 6e 41 72 72 61 79 28 20 66 6e 2c  ery.inArray( fn,
17c70 20 6c 69 73 74 20 29 20 3e 20 2d 31 20 3a 0a 09   list ) > -1 :..
17c80 09 09 09 09 6c 69 73 74 2e 6c 65 6e 67 74 68 20  ....list.length 
17c90 3e 20 30 3b 0a 09 09 09 7d 2c 0a 0a 09 09 09 2f  > 0;....},...../
17ca0 2f 20 52 65 6d 6f 76 65 20 61 6c 6c 20 63 61 6c  / Remove all cal
17cb0 6c 62 61 63 6b 73 20 66 72 6f 6d 20 74 68 65 20  lbacks from the 
17cc0 6c 69 73 74 0a 09 09 09 65 6d 70 74 79 3a 20 66  list....empty: f
17cd0 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09 09 09 09  unction() {.....
17ce0 69 66 20 28 20 6c 69 73 74 20 29 20 7b 0a 09 09  if ( list ) {...
17cf0 09 09 09 6c 69 73 74 20 3d 20 5b 5d 3b 0a 09 09  ...list = [];...
17d00 09 09 7d 0a 09 09 09 09 72 65 74 75 72 6e 20 74  ..}.....return t
17d10 68 69 73 3b 0a 09 09 09 7d 2c 0a 0a 09 09 09 2f  his;....},...../
17d20 2f 20 44 69 73 61 62 6c 65 20 2e 66 69 72 65 20  / Disable .fire 
17d30 61 6e 64 20 2e 61 64 64 0a 09 09 09 2f 2f 20 41  and .add....// A
17d40 62 6f 72 74 20 61 6e 79 20 63 75 72 72 65 6e 74  bort any current
17d50 2f 70 65 6e 64 69 6e 67 20 65 78 65 63 75 74 69  /pending executi
17d60 6f 6e 73 0a 09 09 09 2f 2f 20 43 6c 65 61 72 20  ons....// Clear 
17d70 61 6c 6c 20 63 61 6c 6c 62 61 63 6b 73 20 61 6e  all callbacks an
17d80 64 20 76 61 6c 75 65 73 0a 09 09 09 64 69 73 61  d values....disa
17d90 62 6c 65 3a 20 66 75 6e 63 74 69 6f 6e 28 29 20  ble: function() 
17da0 7b 0a 09 09 09 09 6c 6f 63 6b 65 64 20 3d 20 71  {.....locked = q
17db0 75 65 75 65 20 3d 20 5b 5d 3b 0a 09 09 09 09 6c  ueue = [];.....l
17dc0 69 73 74 20 3d 20 6d 65 6d 6f 72 79 20 3d 20 22  ist = memory = "
17dd0 22 3b 0a 09 09 09 09 72 65 74 75 72 6e 20 74 68  ";.....return th
17de0 69 73 3b 0a 09 09 09 7d 2c 0a 09 09 09 64 69 73  is;....},....dis
17df0 61 62 6c 65 64 3a 20 66 75 6e 63 74 69 6f 6e 28  abled: function(
17e00 29 20 7b 0a 09 09 09 09 72 65 74 75 72 6e 20 21  ) {.....return !
17e10 6c 69 73 74 3b 0a 09 09 09 7d 2c 0a 0a 09 09 09  list;....},.....
17e20 2f 2f 20 44 69 73 61 62 6c 65 20 2e 66 69 72 65  // Disable .fire
17e30 0a 09 09 09 2f 2f 20 41 6c 73 6f 20 64 69 73 61  ....// Also disa
17e40 62 6c 65 20 2e 61 64 64 20 75 6e 6c 65 73 73 20  ble .add unless 
17e50 77 65 20 68 61 76 65 20 6d 65 6d 6f 72 79 20 28  we have memory (
17e60 73 69 6e 63 65 20 69 74 20 77 6f 75 6c 64 20 68  since it would h
17e70 61 76 65 20 6e 6f 20 65 66 66 65 63 74 29 0a 09  ave no effect)..
17e80 09 09 2f 2f 20 41 62 6f 72 74 20 61 6e 79 20 70  ..// Abort any p
17e90 65 6e 64 69 6e 67 20 65 78 65 63 75 74 69 6f 6e  ending execution
17ea0 73 0a 09 09 09 6c 6f 63 6b 3a 20 66 75 6e 63 74  s....lock: funct
17eb0 69 6f 6e 28 29 20 7b 0a 09 09 09 09 6c 6f 63 6b  ion() {.....lock
17ec0 65 64 20 3d 20 71 75 65 75 65 20 3d 20 5b 5d 3b  ed = queue = [];
17ed0 0a 09 09 09 09 69 66 20 28 20 21 6d 65 6d 6f 72  .....if ( !memor
17ee0 79 20 26 26 20 21 66 69 72 69 6e 67 20 29 20 7b  y && !firing ) {
17ef0 0a 09 09 09 09 09 6c 69 73 74 20 3d 20 6d 65 6d  ......list = mem
17f00 6f 72 79 20 3d 20 22 22 3b 0a 09 09 09 09 7d 0a  ory = "";.....}.
17f10 09 09 09 09 72 65 74 75 72 6e 20 74 68 69 73 3b  ....return this;
17f20 0a 09 09 09 7d 2c 0a 09 09 09 6c 6f 63 6b 65 64  ....},....locked
17f30 3a 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09  : function() {..
17f40 09 09 09 72 65 74 75 72 6e 20 21 21 6c 6f 63 6b  ...return !!lock
17f50 65 64 3b 0a 09 09 09 7d 2c 0a 0a 09 09 09 2f 2f  ed;....},.....//
17f60 20 43 61 6c 6c 20 61 6c 6c 20 63 61 6c 6c 62 61   Call all callba
17f70 63 6b 73 20 77 69 74 68 20 74 68 65 20 67 69 76  cks with the giv
17f80 65 6e 20 63 6f 6e 74 65 78 74 20 61 6e 64 20 61  en context and a
17f90 72 67 75 6d 65 6e 74 73 0a 09 09 09 66 69 72 65  rguments....fire
17fa0 57 69 74 68 3a 20 66 75 6e 63 74 69 6f 6e 28 20  With: function( 
17fb0 63 6f 6e 74 65 78 74 2c 20 61 72 67 73 20 29 20  context, args ) 
17fc0 7b 0a 09 09 09 09 69 66 20 28 20 21 6c 6f 63 6b  {.....if ( !lock
17fd0 65 64 20 29 20 7b 0a 09 09 09 09 09 61 72 67 73  ed ) {......args
17fe0 20 3d 20 61 72 67 73 20 7c 7c 20 5b 5d 3b 0a 09   = args || [];..
17ff0 09 09 09 09 61 72 67 73 20 3d 20 5b 20 63 6f 6e  ....args = [ con
18000 74 65 78 74 2c 20 61 72 67 73 2e 73 6c 69 63 65  text, args.slice
18010 20 3f 20 61 72 67 73 2e 73 6c 69 63 65 28 29 20   ? args.slice() 
18020 3a 20 61 72 67 73 20 5d 3b 0a 09 09 09 09 09 71  : args ];......q
18030 75 65 75 65 2e 70 75 73 68 28 20 61 72 67 73 20  ueue.push( args 
18040 29 3b 0a 09 09 09 09 09 69 66 20 28 20 21 66 69  );......if ( !fi
18050 72 69 6e 67 20 29 20 7b 0a 09 09 09 09 09 09 66  ring ) {.......f
18060 69 72 65 28 29 3b 0a 09 09 09 09 09 7d 0a 09 09  ire();......}...
18070 09 09 7d 0a 09 09 09 09 72 65 74 75 72 6e 20 74  ..}.....return t
18080 68 69 73 3b 0a 09 09 09 7d 2c 0a 0a 09 09 09 2f  his;....},...../
18090 2f 20 43 61 6c 6c 20 61 6c 6c 20 74 68 65 20 63  / Call all the c
180a0 61 6c 6c 62 61 63 6b 73 20 77 69 74 68 20 74 68  allbacks with th
180b0 65 20 67 69 76 65 6e 20 61 72 67 75 6d 65 6e 74  e given argument
180c0 73 0a 09 09 09 66 69 72 65 3a 20 66 75 6e 63 74  s....fire: funct
180d0 69 6f 6e 28 29 20 7b 0a 09 09 09 09 73 65 6c 66  ion() {.....self
180e0 2e 66 69 72 65 57 69 74 68 28 20 74 68 69 73 2c  .fireWith( this,
180f0 20 61 72 67 75 6d 65 6e 74 73 20 29 3b 0a 09 09   arguments );...
18100 09 09 72 65 74 75 72 6e 20 74 68 69 73 3b 0a 09  ..return this;..
18110 09 09 7d 2c 0a 0a 09 09 09 2f 2f 20 54 6f 20 6b  ..},.....// To k
18120 6e 6f 77 20 69 66 20 74 68 65 20 63 61 6c 6c 62  now if the callb
18130 61 63 6b 73 20 68 61 76 65 20 61 6c 72 65 61 64  acks have alread
18140 79 20 62 65 65 6e 20 63 61 6c 6c 65 64 20 61 74  y been called at
18150 20 6c 65 61 73 74 20 6f 6e 63 65 0a 09 09 09 66   least once....f
18160 69 72 65 64 3a 20 66 75 6e 63 74 69 6f 6e 28 29  ired: function()
18170 20 7b 0a 09 09 09 09 72 65 74 75 72 6e 20 21 21   {.....return !!
18180 66 69 72 65 64 3b 0a 09 09 09 7d 0a 09 09 7d 3b  fired;....}...};
18190 0a 0a 09 72 65 74 75 72 6e 20 73 65 6c 66 3b 0a  ...return self;.
181a0 7d 3b 0a 0a 0a 66 75 6e 63 74 69 6f 6e 20 49 64  };...function Id
181b0 65 6e 74 69 74 79 28 20 76 20 29 20 7b 0a 09 72  entity( v ) {..r
181c0 65 74 75 72 6e 20 76 3b 0a 7d 0a 66 75 6e 63 74  eturn v;.}.funct
181d0 69 6f 6e 20 54 68 72 6f 77 65 72 28 20 65 78 20  ion Thrower( ex 
181e0 29 20 7b 0a 09 74 68 72 6f 77 20 65 78 3b 0a 7d  ) {..throw ex;.}
181f0 0a 0a 66 75 6e 63 74 69 6f 6e 20 61 64 6f 70 74  ..function adopt
18200 56 61 6c 75 65 28 20 76 61 6c 75 65 2c 20 72 65  Value( value, re
18210 73 6f 6c 76 65 2c 20 72 65 6a 65 63 74 2c 20 6e  solve, reject, n
18220 6f 56 61 6c 75 65 20 29 20 7b 0a 09 76 61 72 20  oValue ) {..var 
18230 6d 65 74 68 6f 64 3b 0a 0a 09 74 72 79 20 7b 0a  method;...try {.
18240 0a 09 09 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20  ...// Check for 
18250 70 72 6f 6d 69 73 65 20 61 73 70 65 63 74 20 66  promise aspect f
18260 69 72 73 74 20 74 6f 20 70 72 69 76 69 6c 65 67  irst to privileg
18270 65 20 73 79 6e 63 68 72 6f 6e 6f 75 73 20 62 65  e synchronous be
18280 68 61 76 69 6f 72 0a 09 09 69 66 20 28 20 76 61  havior...if ( va
18290 6c 75 65 20 26 26 20 69 73 46 75 6e 63 74 69 6f  lue && isFunctio
182a0 6e 28 20 28 20 6d 65 74 68 6f 64 20 3d 20 76 61  n( ( method = va
182b0 6c 75 65 2e 70 72 6f 6d 69 73 65 20 29 20 29 20  lue.promise ) ) 
182c0 29 20 7b 0a 09 09 09 6d 65 74 68 6f 64 2e 63 61  ) {....method.ca
182d0 6c 6c 28 20 76 61 6c 75 65 20 29 2e 64 6f 6e 65  ll( value ).done
182e0 28 20 72 65 73 6f 6c 76 65 20 29 2e 66 61 69 6c  ( resolve ).fail
182f0 28 20 72 65 6a 65 63 74 20 29 3b 0a 0a 09 09 2f  ( reject );..../
18300 2f 20 4f 74 68 65 72 20 74 68 65 6e 61 62 6c 65  / Other thenable
18310 73 0a 09 09 7d 20 65 6c 73 65 20 69 66 20 28 20  s...} else if ( 
18320 76 61 6c 75 65 20 26 26 20 69 73 46 75 6e 63 74  value && isFunct
18330 69 6f 6e 28 20 28 20 6d 65 74 68 6f 64 20 3d 20  ion( ( method = 
18340 76 61 6c 75 65 2e 74 68 65 6e 20 29 20 29 20 29  value.then ) ) )
18350 20 7b 0a 09 09 09 6d 65 74 68 6f 64 2e 63 61 6c   {....method.cal
18360 6c 28 20 76 61 6c 75 65 2c 20 72 65 73 6f 6c 76  l( value, resolv
18370 65 2c 20 72 65 6a 65 63 74 20 29 3b 0a 0a 09 09  e, reject );....
18380 2f 2f 20 4f 74 68 65 72 20 6e 6f 6e 2d 74 68 65  // Other non-the
18390 6e 61 62 6c 65 73 0a 09 09 7d 20 65 6c 73 65 20  nables...} else 
183a0 7b 0a 0a 09 09 09 2f 2f 20 43 6f 6e 74 72 6f 6c  {.....// Control
183b0 20 60 72 65 73 6f 6c 76 65 60 20 61 72 67 75 6d   `resolve` argum
183c0 65 6e 74 73 20 62 79 20 6c 65 74 74 69 6e 67 20  ents by letting 
183d0 41 72 72 61 79 23 73 6c 69 63 65 20 63 61 73 74  Array#slice cast
183e0 20 62 6f 6f 6c 65 61 6e 20 60 6e 6f 56 61 6c 75   boolean `noValu
183f0 65 60 20 74 6f 20 69 6e 74 65 67 65 72 3a 0a 09  e` to integer:..
18400 09 09 2f 2f 20 2a 20 66 61 6c 73 65 3a 20 5b 20  ..// * false: [ 
18410 76 61 6c 75 65 20 5d 2e 73 6c 69 63 65 28 20 30  value ].slice( 0
18420 20 29 20 3d 3e 20 72 65 73 6f 6c 76 65 28 20 76   ) => resolve( v
18430 61 6c 75 65 20 29 0a 09 09 09 2f 2f 20 2a 20 74  alue )....// * t
18440 72 75 65 3a 20 5b 20 76 61 6c 75 65 20 5d 2e 73  rue: [ value ].s
18450 6c 69 63 65 28 20 31 20 29 20 3d 3e 20 72 65 73  lice( 1 ) => res
18460 6f 6c 76 65 28 29 0a 09 09 09 72 65 73 6f 6c 76  olve()....resolv
18470 65 2e 61 70 70 6c 79 28 20 75 6e 64 65 66 69 6e  e.apply( undefin
18480 65 64 2c 20 5b 20 76 61 6c 75 65 20 5d 2e 73 6c  ed, [ value ].sl
18490 69 63 65 28 20 6e 6f 56 61 6c 75 65 20 29 20 29  ice( noValue ) )
184a0 3b 0a 09 09 7d 0a 0a 09 2f 2f 20 46 6f 72 20 50  ;...}...// For P
184b0 72 6f 6d 69 73 65 73 2f 41 2b 2c 20 63 6f 6e 76  romises/A+, conv
184c0 65 72 74 20 65 78 63 65 70 74 69 6f 6e 73 20 69  ert exceptions i
184d0 6e 74 6f 20 72 65 6a 65 63 74 69 6f 6e 73 0a 09  nto rejections..
184e0 2f 2f 20 53 69 6e 63 65 20 6a 51 75 65 72 79 2e  // Since jQuery.
184f0 77 68 65 6e 20 64 6f 65 73 6e 27 74 20 75 6e 77  when doesn't unw
18500 72 61 70 20 74 68 65 6e 61 62 6c 65 73 2c 20 77  rap thenables, w
18510 65 20 63 61 6e 20 73 6b 69 70 20 74 68 65 20 65  e can skip the e
18520 78 74 72 61 20 63 68 65 63 6b 73 20 61 70 70 65  xtra checks appe
18530 61 72 69 6e 67 20 69 6e 0a 09 2f 2f 20 44 65 66  aring in..// Def
18540 65 72 72 65 64 23 74 68 65 6e 20 74 6f 20 63 6f  erred#then to co
18550 6e 64 69 74 69 6f 6e 61 6c 6c 79 20 73 75 70 70  nditionally supp
18560 72 65 73 73 20 72 65 6a 65 63 74 69 6f 6e 2e 0a  ress rejection..
18570 09 7d 20 63 61 74 63 68 20 28 20 76 61 6c 75 65  .} catch ( value
18580 20 29 20 7b 0a 0a 09 09 2f 2f 20 53 75 70 70 6f   ) {....// Suppo
18590 72 74 3a 20 41 6e 64 72 6f 69 64 20 34 2e 30 20  rt: Android 4.0 
185a0 6f 6e 6c 79 0a 09 09 2f 2f 20 53 74 72 69 63 74  only...// Strict
185b0 20 6d 6f 64 65 20 66 75 6e 63 74 69 6f 6e 73 20   mode functions 
185c0 69 6e 76 6f 6b 65 64 20 77 69 74 68 6f 75 74 20  invoked without 
185d0 2e 63 61 6c 6c 2f 2e 61 70 70 6c 79 20 67 65 74  .call/.apply get
185e0 20 67 6c 6f 62 61 6c 2d 6f 62 6a 65 63 74 20 63   global-object c
185f0 6f 6e 74 65 78 74 0a 09 09 72 65 6a 65 63 74 2e  ontext...reject.
18600 61 70 70 6c 79 28 20 75 6e 64 65 66 69 6e 65 64  apply( undefined
18610 2c 20 5b 20 76 61 6c 75 65 20 5d 20 29 3b 0a 09  , [ value ] );..
18620 7d 0a 7d 0a 0a 6a 51 75 65 72 79 2e 65 78 74 65  }.}..jQuery.exte
18630 6e 64 28 20 7b 0a 0a 09 44 65 66 65 72 72 65 64  nd( {...Deferred
18640 3a 20 66 75 6e 63 74 69 6f 6e 28 20 66 75 6e 63  : function( func
18650 20 29 20 7b 0a 09 09 76 61 72 20 74 75 70 6c 65   ) {...var tuple
18660 73 20 3d 20 5b 0a 0a 09 09 09 09 2f 2f 20 61 63  s = [......// ac
18670 74 69 6f 6e 2c 20 61 64 64 20 6c 69 73 74 65 6e  tion, add listen
18680 65 72 2c 20 63 61 6c 6c 62 61 63 6b 73 2c 0a 09  er, callbacks,..
18690 09 09 09 2f 2f 20 2e 2e 2e 20 2e 74 68 65 6e 20  ...// ... .then 
186a0 68 61 6e 64 6c 65 72 73 2c 20 61 72 67 75 6d 65  handlers, argume
186b0 6e 74 20 69 6e 64 65 78 2c 20 5b 66 69 6e 61 6c  nt index, [final
186c0 20 73 74 61 74 65 5d 0a 09 09 09 09 5b 20 22 6e   state].....[ "n
186d0 6f 74 69 66 79 22 2c 20 22 70 72 6f 67 72 65 73  otify", "progres
186e0 73 22 2c 20 6a 51 75 65 72 79 2e 43 61 6c 6c 62  s", jQuery.Callb
186f0 61 63 6b 73 28 20 22 6d 65 6d 6f 72 79 22 20 29  acks( "memory" )
18700 2c 0a 09 09 09 09 09 6a 51 75 65 72 79 2e 43 61  ,......jQuery.Ca
18710 6c 6c 62 61 63 6b 73 28 20 22 6d 65 6d 6f 72 79  llbacks( "memory
18720 22 20 29 2c 20 32 20 5d 2c 0a 09 09 09 09 5b 20  " ), 2 ],.....[ 
18730 22 72 65 73 6f 6c 76 65 22 2c 20 22 64 6f 6e 65  "resolve", "done
18740 22 2c 20 6a 51 75 65 72 79 2e 43 61 6c 6c 62 61  ", jQuery.Callba
18750 63 6b 73 28 20 22 6f 6e 63 65 20 6d 65 6d 6f 72  cks( "once memor
18760 79 22 20 29 2c 0a 09 09 09 09 09 6a 51 75 65 72  y" ),......jQuer
18770 79 2e 43 61 6c 6c 62 61 63 6b 73 28 20 22 6f 6e  y.Callbacks( "on
18780 63 65 20 6d 65 6d 6f 72 79 22 20 29 2c 20 30 2c  ce memory" ), 0,
18790 20 22 72 65 73 6f 6c 76 65 64 22 20 5d 2c 0a 09   "resolved" ],..
187a0 09 09 09 5b 20 22 72 65 6a 65 63 74 22 2c 20 22  ...[ "reject", "
187b0 66 61 69 6c 22 2c 20 6a 51 75 65 72 79 2e 43 61  fail", jQuery.Ca
187c0 6c 6c 62 61 63 6b 73 28 20 22 6f 6e 63 65 20 6d  llbacks( "once m
187d0 65 6d 6f 72 79 22 20 29 2c 0a 09 09 09 09 09 6a  emory" ),......j
187e0 51 75 65 72 79 2e 43 61 6c 6c 62 61 63 6b 73 28  Query.Callbacks(
187f0 20 22 6f 6e 63 65 20 6d 65 6d 6f 72 79 22 20 29   "once memory" )
18800 2c 20 31 2c 20 22 72 65 6a 65 63 74 65 64 22 20  , 1, "rejected" 
18810 5d 0a 09 09 09 5d 2c 0a 09 09 09 73 74 61 74 65  ]....],....state
18820 20 3d 20 22 70 65 6e 64 69 6e 67 22 2c 0a 09 09   = "pending",...
18830 09 70 72 6f 6d 69 73 65 20 3d 20 7b 0a 09 09 09  .promise = {....
18840 09 73 74 61 74 65 3a 20 66 75 6e 63 74 69 6f 6e  .state: function
18850 28 29 20 7b 0a 09 09 09 09 09 72 65 74 75 72 6e  () {......return
18860 20 73 74 61 74 65 3b 0a 09 09 09 09 7d 2c 0a 09   state;.....},..
18870 09 09 09 61 6c 77 61 79 73 3a 20 66 75 6e 63 74  ...always: funct
18880 69 6f 6e 28 29 20 7b 0a 09 09 09 09 09 64 65 66  ion() {......def
18890 65 72 72 65 64 2e 64 6f 6e 65 28 20 61 72 67 75  erred.done( argu
188a0 6d 65 6e 74 73 20 29 2e 66 61 69 6c 28 20 61 72  ments ).fail( ar
188b0 67 75 6d 65 6e 74 73 20 29 3b 0a 09 09 09 09 09  guments );......
188c0 72 65 74 75 72 6e 20 74 68 69 73 3b 0a 09 09 09  return this;....
188d0 09 7d 2c 0a 09 09 09 09 22 63 61 74 63 68 22 3a  .},....."catch":
188e0 20 66 75 6e 63 74 69 6f 6e 28 20 66 6e 20 29 20   function( fn ) 
188f0 7b 0a 09 09 09 09 09 72 65 74 75 72 6e 20 70 72  {......return pr
18900 6f 6d 69 73 65 2e 74 68 65 6e 28 20 6e 75 6c 6c  omise.then( null
18910 2c 20 66 6e 20 29 3b 0a 09 09 09 09 7d 2c 0a 0a  , fn );.....},..
18920 09 09 09 09 2f 2f 20 4b 65 65 70 20 70 69 70 65  ....// Keep pipe
18930 20 66 6f 72 20 62 61 63 6b 2d 63 6f 6d 70 61 74   for back-compat
18940 0a 09 09 09 09 70 69 70 65 3a 20 66 75 6e 63 74  .....pipe: funct
18950 69 6f 6e 28 20 2f 2a 20 66 6e 44 6f 6e 65 2c 20  ion( /* fnDone, 
18960 66 6e 46 61 69 6c 2c 20 66 6e 50 72 6f 67 72 65  fnFail, fnProgre
18970 73 73 20 2a 2f 20 29 20 7b 0a 09 09 09 09 09 76  ss */ ) {......v
18980 61 72 20 66 6e 73 20 3d 20 61 72 67 75 6d 65 6e  ar fns = argumen
18990 74 73 3b 0a 0a 09 09 09 09 09 72 65 74 75 72 6e  ts;.......return
189a0 20 6a 51 75 65 72 79 2e 44 65 66 65 72 72 65 64   jQuery.Deferred
189b0 28 20 66 75 6e 63 74 69 6f 6e 28 20 6e 65 77 44  ( function( newD
189c0 65 66 65 72 20 29 20 7b 0a 09 09 09 09 09 09 6a  efer ) {.......j
189d0 51 75 65 72 79 2e 65 61 63 68 28 20 74 75 70 6c  Query.each( tupl
189e0 65 73 2c 20 66 75 6e 63 74 69 6f 6e 28 20 5f 69  es, function( _i
189f0 2c 20 74 75 70 6c 65 20 29 20 7b 0a 0a 09 09 09  , tuple ) {.....
18a00 09 09 09 09 2f 2f 20 4d 61 70 20 74 75 70 6c 65  ....// Map tuple
18a10 73 20 28 70 72 6f 67 72 65 73 73 2c 20 64 6f 6e  s (progress, don
18a20 65 2c 20 66 61 69 6c 29 20 74 6f 20 61 72 67 75  e, fail) to argu
18a30 6d 65 6e 74 73 20 28 64 6f 6e 65 2c 20 66 61 69  ments (done, fai
18a40 6c 2c 20 70 72 6f 67 72 65 73 73 29 0a 09 09 09  l, progress)....
18a50 09 09 09 09 76 61 72 20 66 6e 20 3d 20 69 73 46  ....var fn = isF
18a60 75 6e 63 74 69 6f 6e 28 20 66 6e 73 5b 20 74 75  unction( fns[ tu
18a70 70 6c 65 5b 20 34 20 5d 20 5d 20 29 20 26 26 20  ple[ 4 ] ] ) && 
18a80 66 6e 73 5b 20 74 75 70 6c 65 5b 20 34 20 5d 20  fns[ tuple[ 4 ] 
18a90 5d 3b 0a 0a 09 09 09 09 09 09 09 2f 2f 20 64 65  ];.........// de
18aa0 66 65 72 72 65 64 2e 70 72 6f 67 72 65 73 73 28  ferred.progress(
18ab0 66 75 6e 63 74 69 6f 6e 28 29 20 7b 20 62 69 6e  function() { bin
18ac0 64 20 74 6f 20 6e 65 77 44 65 66 65 72 20 6f 72  d to newDefer or
18ad0 20 6e 65 77 44 65 66 65 72 2e 6e 6f 74 69 66 79   newDefer.notify
18ae0 20 7d 29 0a 09 09 09 09 09 09 09 2f 2f 20 64 65   })........// de
18af0 66 65 72 72 65 64 2e 64 6f 6e 65 28 66 75 6e 63  ferred.done(func
18b00 74 69 6f 6e 28 29 20 7b 20 62 69 6e 64 20 74 6f  tion() { bind to
18b10 20 6e 65 77 44 65 66 65 72 20 6f 72 20 6e 65 77   newDefer or new
18b20 44 65 66 65 72 2e 72 65 73 6f 6c 76 65 20 7d 29  Defer.resolve })
18b30 0a 09 09 09 09 09 09 09 2f 2f 20 64 65 66 65 72  ........// defer
18b40 72 65 64 2e 66 61 69 6c 28 66 75 6e 63 74 69 6f  red.fail(functio
18b50 6e 28 29 20 7b 20 62 69 6e 64 20 74 6f 20 6e 65  n() { bind to ne
18b60 77 44 65 66 65 72 20 6f 72 20 6e 65 77 44 65 66  wDefer or newDef
18b70 65 72 2e 72 65 6a 65 63 74 20 7d 29 0a 09 09 09  er.reject })....
18b80 09 09 09 09 64 65 66 65 72 72 65 64 5b 20 74 75  ....deferred[ tu
18b90 70 6c 65 5b 20 31 20 5d 20 5d 28 20 66 75 6e 63  ple[ 1 ] ]( func
18ba0 74 69 6f 6e 28 29 20 7b 0a 09 09 09 09 09 09 09  tion() {........
18bb0 09 76 61 72 20 72 65 74 75 72 6e 65 64 20 3d 20  .var returned = 
18bc0 66 6e 20 26 26 20 66 6e 2e 61 70 70 6c 79 28 20  fn && fn.apply( 
18bd0 74 68 69 73 2c 20 61 72 67 75 6d 65 6e 74 73 20  this, arguments 
18be0 29 3b 0a 09 09 09 09 09 09 09 09 69 66 20 28 20  );.........if ( 
18bf0 72 65 74 75 72 6e 65 64 20 26 26 20 69 73 46 75  returned && isFu
18c00 6e 63 74 69 6f 6e 28 20 72 65 74 75 72 6e 65 64  nction( returned
18c10 2e 70 72 6f 6d 69 73 65 20 29 20 29 20 7b 0a 09  .promise ) ) {..
18c20 09 09 09 09 09 09 09 09 72 65 74 75 72 6e 65 64  ........returned
18c30 2e 70 72 6f 6d 69 73 65 28 29 0a 09 09 09 09 09  .promise()......
18c40 09 09 09 09 09 2e 70 72 6f 67 72 65 73 73 28 20  ......progress( 
18c50 6e 65 77 44 65 66 65 72 2e 6e 6f 74 69 66 79 20  newDefer.notify 
18c60 29 0a 09 09 09 09 09 09 09 09 09 09 2e 64 6f 6e  )............don
18c70 65 28 20 6e 65 77 44 65 66 65 72 2e 72 65 73 6f  e( newDefer.reso
18c80 6c 76 65 20 29 0a 09 09 09 09 09 09 09 09 09 09  lve )...........
18c90 2e 66 61 69 6c 28 20 6e 65 77 44 65 66 65 72 2e  .fail( newDefer.
18ca0 72 65 6a 65 63 74 20 29 3b 0a 09 09 09 09 09 09  reject );.......
18cb0 09 09 7d 20 65 6c 73 65 20 7b 0a 09 09 09 09 09  ..} else {......
18cc0 09 09 09 09 6e 65 77 44 65 66 65 72 5b 20 74 75  ....newDefer[ tu
18cd0 70 6c 65 5b 20 30 20 5d 20 2b 20 22 57 69 74 68  ple[ 0 ] + "With
18ce0 22 20 5d 28 0a 09 09 09 09 09 09 09 09 09 09 74  " ](...........t
18cf0 68 69 73 2c 0a 09 09 09 09 09 09 09 09 09 09 66  his,...........f
18d00 6e 20 3f 20 5b 20 72 65 74 75 72 6e 65 64 20 5d  n ? [ returned ]
18d10 20 3a 20 61 72 67 75 6d 65 6e 74 73 0a 09 09 09   : arguments....
18d20 09 09 09 09 09 09 29 3b 0a 09 09 09 09 09 09 09  ......);........
18d30 09 7d 0a 09 09 09 09 09 09 09 7d 20 29 3b 0a 09  .}........} );..
18d40 09 09 09 09 09 7d 20 29 3b 0a 09 09 09 09 09 09  .....} );.......
18d50 66 6e 73 20 3d 20 6e 75 6c 6c 3b 0a 09 09 09 09  fns = null;.....
18d60 09 7d 20 29 2e 70 72 6f 6d 69 73 65 28 29 3b 0a  .} ).promise();.
18d70 09 09 09 09 7d 2c 0a 09 09 09 09 74 68 65 6e 3a  ....},.....then:
18d80 20 66 75 6e 63 74 69 6f 6e 28 20 6f 6e 46 75 6c   function( onFul
18d90 66 69 6c 6c 65 64 2c 20 6f 6e 52 65 6a 65 63 74  filled, onReject
18da0 65 64 2c 20 6f 6e 50 72 6f 67 72 65 73 73 20 29  ed, onProgress )
18db0 20 7b 0a 09 09 09 09 09 76 61 72 20 6d 61 78 44   {......var maxD
18dc0 65 70 74 68 20 3d 20 30 3b 0a 09 09 09 09 09 66  epth = 0;......f
18dd0 75 6e 63 74 69 6f 6e 20 72 65 73 6f 6c 76 65 28  unction resolve(
18de0 20 64 65 70 74 68 2c 20 64 65 66 65 72 72 65 64   depth, deferred
18df0 2c 20 68 61 6e 64 6c 65 72 2c 20 73 70 65 63 69  , handler, speci
18e00 61 6c 20 29 20 7b 0a 09 09 09 09 09 09 72 65 74  al ) {.......ret
18e10 75 72 6e 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b  urn function() {
18e20 0a 09 09 09 09 09 09 09 76 61 72 20 74 68 61 74  ........var that
18e30 20 3d 20 74 68 69 73 2c 0a 09 09 09 09 09 09 09   = this,........
18e40 09 61 72 67 73 20 3d 20 61 72 67 75 6d 65 6e 74  .args = argument
18e50 73 2c 0a 09 09 09 09 09 09 09 09 6d 69 67 68 74  s,.........might
18e60 54 68 72 6f 77 20 3d 20 66 75 6e 63 74 69 6f 6e  Throw = function
18e70 28 29 20 7b 0a 09 09 09 09 09 09 09 09 09 76 61  () {..........va
18e80 72 20 72 65 74 75 72 6e 65 64 2c 20 74 68 65 6e  r returned, then
18e90 3b 0a 0a 09 09 09 09 09 09 09 09 09 2f 2f 20 53  ;...........// S
18ea0 75 70 70 6f 72 74 3a 20 50 72 6f 6d 69 73 65 73  upport: Promises
18eb0 2f 41 2b 20 73 65 63 74 69 6f 6e 20 32 2e 33 2e  /A+ section 2.3.
18ec0 33 2e 33 2e 33 0a 09 09 09 09 09 09 09 09 09 2f  3.3.3........../
18ed0 2f 20 68 74 74 70 73 3a 2f 2f 70 72 6f 6d 69 73  / https://promis
18ee0 65 73 61 70 6c 75 73 2e 63 6f 6d 2f 23 70 6f 69  esaplus.com/#poi
18ef0 6e 74 2d 35 39 0a 09 09 09 09 09 09 09 09 09 2f  nt-59........../
18f00 2f 20 49 67 6e 6f 72 65 20 64 6f 75 62 6c 65 2d  / Ignore double-
18f10 72 65 73 6f 6c 75 74 69 6f 6e 20 61 74 74 65 6d  resolution attem
18f20 70 74 73 0a 09 09 09 09 09 09 09 09 09 69 66 20  pts..........if 
18f30 28 20 64 65 70 74 68 20 3c 20 6d 61 78 44 65 70  ( depth < maxDep
18f40 74 68 20 29 20 7b 0a 09 09 09 09 09 09 09 09 09  th ) {..........
18f50 09 72 65 74 75 72 6e 3b 0a 09 09 09 09 09 09 09  .return;........
18f60 09 09 7d 0a 0a 09 09 09 09 09 09 09 09 09 72 65  ..}...........re
18f70 74 75 72 6e 65 64 20 3d 20 68 61 6e 64 6c 65 72  turned = handler
18f80 2e 61 70 70 6c 79 28 20 74 68 61 74 2c 20 61 72  .apply( that, ar
18f90 67 73 20 29 3b 0a 0a 09 09 09 09 09 09 09 09 09  gs );...........
18fa0 2f 2f 20 53 75 70 70 6f 72 74 3a 20 50 72 6f 6d  // Support: Prom
18fb0 69 73 65 73 2f 41 2b 20 73 65 63 74 69 6f 6e 20  ises/A+ section 
18fc0 32 2e 33 2e 31 0a 09 09 09 09 09 09 09 09 09 2f  2.3.1........../
18fd0 2f 20 68 74 74 70 73 3a 2f 2f 70 72 6f 6d 69 73  / https://promis
18fe0 65 73 61 70 6c 75 73 2e 63 6f 6d 2f 23 70 6f 69  esaplus.com/#poi
18ff0 6e 74 2d 34 38 0a 09 09 09 09 09 09 09 09 09 69  nt-48..........i
19000 66 20 28 20 72 65 74 75 72 6e 65 64 20 3d 3d 3d  f ( returned ===
19010 20 64 65 66 65 72 72 65 64 2e 70 72 6f 6d 69 73   deferred.promis
19020 65 28 29 20 29 20 7b 0a 09 09 09 09 09 09 09 09  e() ) {.........
19030 09 09 74 68 72 6f 77 20 6e 65 77 20 54 79 70 65  ..throw new Type
19040 45 72 72 6f 72 28 20 22 54 68 65 6e 61 62 6c 65  Error( "Thenable
19050 20 73 65 6c 66 2d 72 65 73 6f 6c 75 74 69 6f 6e   self-resolution
19060 22 20 29 3b 0a 09 09 09 09 09 09 09 09 09 7d 0a  " );..........}.
19070 0a 09 09 09 09 09 09 09 09 09 2f 2f 20 53 75 70  ..........// Sup
19080 70 6f 72 74 3a 20 50 72 6f 6d 69 73 65 73 2f 41  port: Promises/A
19090 2b 20 73 65 63 74 69 6f 6e 73 20 32 2e 33 2e 33  + sections 2.3.3
190a0 2e 31 2c 20 33 2e 35 0a 09 09 09 09 09 09 09 09  .1, 3.5.........
190b0 09 2f 2f 20 68 74 74 70 73 3a 2f 2f 70 72 6f 6d  .// https://prom
190c0 69 73 65 73 61 70 6c 75 73 2e 63 6f 6d 2f 23 70  isesaplus.com/#p
190d0 6f 69 6e 74 2d 35 34 0a 09 09 09 09 09 09 09 09  oint-54.........
190e0 09 2f 2f 20 68 74 74 70 73 3a 2f 2f 70 72 6f 6d  .// https://prom
190f0 69 73 65 73 61 70 6c 75 73 2e 63 6f 6d 2f 23 70  isesaplus.com/#p
19100 6f 69 6e 74 2d 37 35 0a 09 09 09 09 09 09 09 09  oint-75.........
19110 09 2f 2f 20 52 65 74 72 69 65 76 65 20 60 74 68  .// Retrieve `th
19120 65 6e 60 20 6f 6e 6c 79 20 6f 6e 63 65 0a 09 09  en` only once...
19130 09 09 09 09 09 09 09 74 68 65 6e 20 3d 20 72 65  .......then = re
19140 74 75 72 6e 65 64 20 26 26 0a 0a 09 09 09 09 09  turned &&.......
19150 09 09 09 09 09 2f 2f 20 53 75 70 70 6f 72 74 3a  .....// Support:
19160 20 50 72 6f 6d 69 73 65 73 2f 41 2b 20 73 65 63   Promises/A+ sec
19170 74 69 6f 6e 20 32 2e 33 2e 34 0a 09 09 09 09 09  tion 2.3.4......
19180 09 09 09 09 09 2f 2f 20 68 74 74 70 73 3a 2f 2f  .....// https://
19190 70 72 6f 6d 69 73 65 73 61 70 6c 75 73 2e 63 6f  promisesaplus.co
191a0 6d 2f 23 70 6f 69 6e 74 2d 36 34 0a 09 09 09 09  m/#point-64.....
191b0 09 09 09 09 09 09 2f 2f 20 4f 6e 6c 79 20 63 68  ......// Only ch
191c0 65 63 6b 20 6f 62 6a 65 63 74 73 20 61 6e 64 20  eck objects and 
191d0 66 75 6e 63 74 69 6f 6e 73 20 66 6f 72 20 74 68  functions for th
191e0 65 6e 61 62 69 6c 69 74 79 0a 09 09 09 09 09 09  enability.......
191f0 09 09 09 09 28 20 74 79 70 65 6f 66 20 72 65 74  ....( typeof ret
19200 75 72 6e 65 64 20 3d 3d 3d 20 22 6f 62 6a 65 63  urned === "objec
19210 74 22 20 7c 7c 0a 09 09 09 09 09 09 09 09 09 09  t" ||...........
19220 09 74 79 70 65 6f 66 20 72 65 74 75 72 6e 65 64  .typeof returned
19230 20 3d 3d 3d 20 22 66 75 6e 63 74 69 6f 6e 22 20   === "function" 
19240 29 20 26 26 0a 09 09 09 09 09 09 09 09 09 09 72  ) &&...........r
19250 65 74 75 72 6e 65 64 2e 74 68 65 6e 3b 0a 0a 09  eturned.then;...
19260 09 09 09 09 09 09 09 09 2f 2f 20 48 61 6e 64 6c  ........// Handl
19270 65 20 61 20 72 65 74 75 72 6e 65 64 20 74 68 65  e a returned the
19280 6e 61 62 6c 65 0a 09 09 09 09 09 09 09 09 09 69  nable..........i
19290 66 20 28 20 69 73 46 75 6e 63 74 69 6f 6e 28 20  f ( isFunction( 
192a0 74 68 65 6e 20 29 20 29 20 7b 0a 0a 09 09 09 09  then ) ) {......
192b0 09 09 09 09 09 09 2f 2f 20 53 70 65 63 69 61 6c  ......// Special
192c0 20 70 72 6f 63 65 73 73 6f 72 73 20 28 6e 6f 74   processors (not
192d0 69 66 79 29 20 6a 75 73 74 20 77 61 69 74 20 66  ify) just wait f
192e0 6f 72 20 72 65 73 6f 6c 75 74 69 6f 6e 0a 09 09  or resolution...
192f0 09 09 09 09 09 09 09 09 69 66 20 28 20 73 70 65  ........if ( spe
19300 63 69 61 6c 20 29 20 7b 0a 09 09 09 09 09 09 09  cial ) {........
19310 09 09 09 09 74 68 65 6e 2e 63 61 6c 6c 28 0a 09  ....then.call(..
19320 09 09 09 09 09 09 09 09 09 09 09 72 65 74 75 72  ...........retur
19330 6e 65 64 2c 0a 09 09 09 09 09 09 09 09 09 09 09  ned,............
19340 09 72 65 73 6f 6c 76 65 28 20 6d 61 78 44 65 70  .resolve( maxDep
19350 74 68 2c 20 64 65 66 65 72 72 65 64 2c 20 49 64  th, deferred, Id
19360 65 6e 74 69 74 79 2c 20 73 70 65 63 69 61 6c 20  entity, special 
19370 29 2c 0a 09 09 09 09 09 09 09 09 09 09 09 09 72  ),.............r
19380 65 73 6f 6c 76 65 28 20 6d 61 78 44 65 70 74 68  esolve( maxDepth
19390 2c 20 64 65 66 65 72 72 65 64 2c 20 54 68 72 6f  , deferred, Thro
193a0 77 65 72 2c 20 73 70 65 63 69 61 6c 20 29 0a 09  wer, special )..
193b0 09 09 09 09 09 09 09 09 09 09 29 3b 0a 0a 09 09  ..........);....
193c0 09 09 09 09 09 09 09 09 2f 2f 20 4e 6f 72 6d 61  ........// Norma
193d0 6c 20 70 72 6f 63 65 73 73 6f 72 73 20 28 72 65  l processors (re
193e0 73 6f 6c 76 65 29 20 61 6c 73 6f 20 68 6f 6f 6b  solve) also hook
193f0 20 69 6e 74 6f 20 70 72 6f 67 72 65 73 73 0a 09   into progress..
19400 09 09 09 09 09 09 09 09 09 7d 20 65 6c 73 65 20  .........} else 
19410 7b 0a 0a 09 09 09 09 09 09 09 09 09 09 09 2f 2f  {.............//
19420 20 2e 2e 2e 61 6e 64 20 64 69 73 72 65 67 61 72   ...and disregar
19430 64 20 6f 6c 64 65 72 20 72 65 73 6f 6c 75 74 69  d older resoluti
19440 6f 6e 20 76 61 6c 75 65 73 0a 09 09 09 09 09 09  on values.......
19450 09 09 09 09 09 6d 61 78 44 65 70 74 68 2b 2b 3b  .....maxDepth++;
19460 0a 0a 09 09 09 09 09 09 09 09 09 09 09 74 68 65  .............the
19470 6e 2e 63 61 6c 6c 28 0a 09 09 09 09 09 09 09 09  n.call(.........
19480 09 09 09 09 72 65 74 75 72 6e 65 64 2c 0a 09 09  ....returned,...
19490 09 09 09 09 09 09 09 09 09 09 72 65 73 6f 6c 76  ..........resolv
194a0 65 28 20 6d 61 78 44 65 70 74 68 2c 20 64 65 66  e( maxDepth, def
194b0 65 72 72 65 64 2c 20 49 64 65 6e 74 69 74 79 2c  erred, Identity,
194c0 20 73 70 65 63 69 61 6c 20 29 2c 0a 09 09 09 09   special ),.....
194d0 09 09 09 09 09 09 09 09 72 65 73 6f 6c 76 65 28  ........resolve(
194e0 20 6d 61 78 44 65 70 74 68 2c 20 64 65 66 65 72   maxDepth, defer
194f0 72 65 64 2c 20 54 68 72 6f 77 65 72 2c 20 73 70  red, Thrower, sp
19500 65 63 69 61 6c 20 29 2c 0a 09 09 09 09 09 09 09  ecial ),........
19510 09 09 09 09 09 72 65 73 6f 6c 76 65 28 20 6d 61  .....resolve( ma
19520 78 44 65 70 74 68 2c 20 64 65 66 65 72 72 65 64  xDepth, deferred
19530 2c 20 49 64 65 6e 74 69 74 79 2c 0a 09 09 09 09  , Identity,.....
19540 09 09 09 09 09 09 09 09 09 64 65 66 65 72 72 65  .........deferre
19550 64 2e 6e 6f 74 69 66 79 57 69 74 68 20 29 0a 09  d.notifyWith )..
19560 09 09 09 09 09 09 09 09 09 09 29 3b 0a 09 09 09  ..........);....
19570 09 09 09 09 09 09 09 7d 0a 0a 09 09 09 09 09 09  .......}........
19580 09 09 09 2f 2f 20 48 61 6e 64 6c 65 20 61 6c 6c  ...// Handle all
19590 20 6f 74 68 65 72 20 72 65 74 75 72 6e 65 64 20   other returned 
195a0 76 61 6c 75 65 73 0a 09 09 09 09 09 09 09 09 09  values..........
195b0 7d 20 65 6c 73 65 20 7b 0a 0a 09 09 09 09 09 09  } else {........
195c0 09 09 09 09 2f 2f 20 4f 6e 6c 79 20 73 75 62 73  ....// Only subs
195d0 74 69 74 75 74 65 20 68 61 6e 64 6c 65 72 73 20  titute handlers 
195e0 70 61 73 73 20 6f 6e 20 63 6f 6e 74 65 78 74 0a  pass on context.
195f0 09 09 09 09 09 09 09 09 09 09 2f 2f 20 61 6e 64  ..........// and
19600 20 6d 75 6c 74 69 70 6c 65 20 76 61 6c 75 65 73   multiple values
19610 20 28 6e 6f 6e 2d 73 70 65 63 20 62 65 68 61 76   (non-spec behav
19620 69 6f 72 29 0a 09 09 09 09 09 09 09 09 09 09 69  ior)...........i
19630 66 20 28 20 68 61 6e 64 6c 65 72 20 21 3d 3d 20  f ( handler !== 
19640 49 64 65 6e 74 69 74 79 20 29 20 7b 0a 09 09 09  Identity ) {....
19650 09 09 09 09 09 09 09 09 74 68 61 74 20 3d 20 75  ........that = u
19660 6e 64 65 66 69 6e 65 64 3b 0a 09 09 09 09 09 09  ndefined;.......
19670 09 09 09 09 09 61 72 67 73 20 3d 20 5b 20 72 65  .....args = [ re
19680 74 75 72 6e 65 64 20 5d 3b 0a 09 09 09 09 09 09  turned ];.......
19690 09 09 09 09 7d 0a 0a 09 09 09 09 09 09 09 09 09  ....}...........
196a0 09 2f 2f 20 50 72 6f 63 65 73 73 20 74 68 65 20  .// Process the 
196b0 76 61 6c 75 65 28 73 29 0a 09 09 09 09 09 09 09  value(s)........
196c0 09 09 09 2f 2f 20 44 65 66 61 75 6c 74 20 70 72  ...// Default pr
196d0 6f 63 65 73 73 20 69 73 20 72 65 73 6f 6c 76 65  ocess is resolve
196e0 0a 09 09 09 09 09 09 09 09 09 09 28 20 73 70 65  ...........( spe
196f0 63 69 61 6c 20 7c 7c 20 64 65 66 65 72 72 65 64  cial || deferred
19700 2e 72 65 73 6f 6c 76 65 57 69 74 68 20 29 28 20  .resolveWith )( 
19710 74 68 61 74 2c 20 61 72 67 73 20 29 3b 0a 09 09  that, args );...
19720 09 09 09 09 09 09 09 7d 0a 09 09 09 09 09 09 09  .......}........
19730 09 7d 2c 0a 0a 09 09 09 09 09 09 09 09 2f 2f 20  .},..........// 
19740 4f 6e 6c 79 20 6e 6f 72 6d 61 6c 20 70 72 6f 63  Only normal proc
19750 65 73 73 6f 72 73 20 28 72 65 73 6f 6c 76 65 29  essors (resolve)
19760 20 63 61 74 63 68 20 61 6e 64 20 72 65 6a 65 63   catch and rejec
19770 74 20 65 78 63 65 70 74 69 6f 6e 73 0a 09 09 09  t exceptions....
19780 09 09 09 09 09 70 72 6f 63 65 73 73 20 3d 20 73  .....process = s
19790 70 65 63 69 61 6c 20 3f 0a 09 09 09 09 09 09 09  pecial ?........
197a0 09 09 6d 69 67 68 74 54 68 72 6f 77 20 3a 0a 09  ..mightThrow :..
197b0 09 09 09 09 09 09 09 09 66 75 6e 63 74 69 6f 6e  ........function
197c0 28 29 20 7b 0a 09 09 09 09 09 09 09 09 09 09 74  () {...........t
197d0 72 79 20 7b 0a 09 09 09 09 09 09 09 09 09 09 09  ry {............
197e0 6d 69 67 68 74 54 68 72 6f 77 28 29 3b 0a 09 09  mightThrow();...
197f0 09 09 09 09 09 09 09 09 7d 20 63 61 74 63 68 20  ........} catch 
19800 28 20 65 20 29 20 7b 0a 0a 09 09 09 09 09 09 09  ( e ) {.........
19810 09 09 09 09 69 66 20 28 20 6a 51 75 65 72 79 2e  ....if ( jQuery.
19820 44 65 66 65 72 72 65 64 2e 65 78 63 65 70 74 69  Deferred.excepti
19830 6f 6e 48 6f 6f 6b 20 29 20 7b 0a 09 09 09 09 09  onHook ) {......
19840 09 09 09 09 09 09 09 6a 51 75 65 72 79 2e 44 65  .......jQuery.De
19850 66 65 72 72 65 64 2e 65 78 63 65 70 74 69 6f 6e  ferred.exception
19860 48 6f 6f 6b 28 20 65 2c 0a 09 09 09 09 09 09 09  Hook( e,........
19870 09 09 09 09 09 09 70 72 6f 63 65 73 73 2e 73 74  ......process.st
19880 61 63 6b 54 72 61 63 65 20 29 3b 0a 09 09 09 09  ackTrace );.....
19890 09 09 09 09 09 09 09 7d 0a 0a 09 09 09 09 09 09  .......}........
198a0 09 09 09 09 09 2f 2f 20 53 75 70 70 6f 72 74 3a  .....// Support:
198b0 20 50 72 6f 6d 69 73 65 73 2f 41 2b 20 73 65 63   Promises/A+ sec
198c0 74 69 6f 6e 20 32 2e 33 2e 33 2e 33 2e 34 2e 31  tion 2.3.3.3.4.1
198d0 0a 09 09 09 09 09 09 09 09 09 09 09 2f 2f 20 68  ............// h
198e0 74 74 70 73 3a 2f 2f 70 72 6f 6d 69 73 65 73 61  ttps://promisesa
198f0 70 6c 75 73 2e 63 6f 6d 2f 23 70 6f 69 6e 74 2d  plus.com/#point-
19900 36 31 0a 09 09 09 09 09 09 09 09 09 09 09 2f 2f  61............//
19910 20 49 67 6e 6f 72 65 20 70 6f 73 74 2d 72 65 73   Ignore post-res
19920 6f 6c 75 74 69 6f 6e 20 65 78 63 65 70 74 69 6f  olution exceptio
19930 6e 73 0a 09 09 09 09 09 09 09 09 09 09 09 69 66  ns............if
19940 20 28 20 64 65 70 74 68 20 2b 20 31 20 3e 3d 20   ( depth + 1 >= 
19950 6d 61 78 44 65 70 74 68 20 29 20 7b 0a 0a 09 09  maxDepth ) {....
19960 09 09 09 09 09 09 09 09 09 09 2f 2f 20 4f 6e 6c  ..........// Onl
19970 79 20 73 75 62 73 74 69 74 75 74 65 20 68 61 6e  y substitute han
19980 64 6c 65 72 73 20 70 61 73 73 20 6f 6e 20 63 6f  dlers pass on co
19990 6e 74 65 78 74 0a 09 09 09 09 09 09 09 09 09 09  ntext...........
199a0 09 09 2f 2f 20 61 6e 64 20 6d 75 6c 74 69 70 6c  ..// and multipl
199b0 65 20 76 61 6c 75 65 73 20 28 6e 6f 6e 2d 73 70  e values (non-sp
199c0 65 63 20 62 65 68 61 76 69 6f 72 29 0a 09 09 09  ec behavior)....
199d0 09 09 09 09 09 09 09 09 09 69 66 20 28 20 68 61  .........if ( ha
199e0 6e 64 6c 65 72 20 21 3d 3d 20 54 68 72 6f 77 65  ndler !== Throwe
199f0 72 20 29 20 7b 0a 09 09 09 09 09 09 09 09 09 09  r ) {...........
19a00 09 09 09 74 68 61 74 20 3d 20 75 6e 64 65 66 69  ...that = undefi
19a10 6e 65 64 3b 0a 09 09 09 09 09 09 09 09 09 09 09  ned;............
19a20 09 09 61 72 67 73 20 3d 20 5b 20 65 20 5d 3b 0a  ..args = [ e ];.
19a30 09 09 09 09 09 09 09 09 09 09 09 09 7d 0a 0a 09  ............}...
19a40 09 09 09 09 09 09 09 09 09 09 09 64 65 66 65 72  ...........defer
19a50 72 65 64 2e 72 65 6a 65 63 74 57 69 74 68 28 20  red.rejectWith( 
19a60 74 68 61 74 2c 20 61 72 67 73 20 29 3b 0a 09 09  that, args );...
19a70 09 09 09 09 09 09 09 09 09 7d 0a 09 09 09 09 09  .........}......
19a80 09 09 09 09 09 7d 0a 09 09 09 09 09 09 09 09 09  .....}..........
19a90 7d 3b 0a 0a 09 09 09 09 09 09 09 2f 2f 20 53 75  };.........// Su
19aa0 70 70 6f 72 74 3a 20 50 72 6f 6d 69 73 65 73 2f  pport: Promises/
19ab0 41 2b 20 73 65 63 74 69 6f 6e 20 32 2e 33 2e 33  A+ section 2.3.3
19ac0 2e 33 2e 31 0a 09 09 09 09 09 09 09 2f 2f 20 68  .3.1........// h
19ad0 74 74 70 73 3a 2f 2f 70 72 6f 6d 69 73 65 73 61  ttps://promisesa
19ae0 70 6c 75 73 2e 63 6f 6d 2f 23 70 6f 69 6e 74 2d  plus.com/#point-
19af0 35 37 0a 09 09 09 09 09 09 09 2f 2f 20 52 65 2d  57........// Re-
19b00 72 65 73 6f 6c 76 65 20 70 72 6f 6d 69 73 65 73  resolve promises
19b10 20 69 6d 6d 65 64 69 61 74 65 6c 79 20 74 6f 20   immediately to 
19b20 64 6f 64 67 65 20 66 61 6c 73 65 20 72 65 6a 65  dodge false reje
19b30 63 74 69 6f 6e 20 66 72 6f 6d 0a 09 09 09 09 09  ction from......
19b40 09 09 2f 2f 20 73 75 62 73 65 71 75 65 6e 74 20  ..// subsequent 
19b50 65 72 72 6f 72 73 0a 09 09 09 09 09 09 09 69 66  errors........if
19b60 20 28 20 64 65 70 74 68 20 29 20 7b 0a 09 09 09   ( depth ) {....
19b70 09 09 09 09 09 70 72 6f 63 65 73 73 28 29 3b 0a  .....process();.
19b80 09 09 09 09 09 09 09 7d 20 65 6c 73 65 20 7b 0a  .......} else {.
19b90 0a 09 09 09 09 09 09 09 09 2f 2f 20 43 61 6c 6c  .........// Call
19ba0 20 61 6e 20 6f 70 74 69 6f 6e 61 6c 20 68 6f 6f   an optional hoo
19bb0 6b 20 74 6f 20 72 65 63 6f 72 64 20 74 68 65 20  k to record the 
19bc0 73 74 61 63 6b 2c 20 69 6e 20 63 61 73 65 20 6f  stack, in case o
19bd0 66 20 65 78 63 65 70 74 69 6f 6e 0a 09 09 09 09  f exception.....
19be0 09 09 09 09 2f 2f 20 73 69 6e 63 65 20 69 74 27  ....// since it'
19bf0 73 20 6f 74 68 65 72 77 69 73 65 20 6c 6f 73 74  s otherwise lost
19c00 20 77 68 65 6e 20 65 78 65 63 75 74 69 6f 6e 20   when execution 
19c10 67 6f 65 73 20 61 73 79 6e 63 0a 09 09 09 09 09  goes async......
19c20 09 09 09 69 66 20 28 20 6a 51 75 65 72 79 2e 44  ...if ( jQuery.D
19c30 65 66 65 72 72 65 64 2e 67 65 74 53 74 61 63 6b  eferred.getStack
19c40 48 6f 6f 6b 20 29 20 7b 0a 09 09 09 09 09 09 09  Hook ) {........
19c50 09 09 70 72 6f 63 65 73 73 2e 73 74 61 63 6b 54  ..process.stackT
19c60 72 61 63 65 20 3d 20 6a 51 75 65 72 79 2e 44 65  race = jQuery.De
19c70 66 65 72 72 65 64 2e 67 65 74 53 74 61 63 6b 48  ferred.getStackH
19c80 6f 6f 6b 28 29 3b 0a 09 09 09 09 09 09 09 09 7d  ook();.........}
19c90 0a 09 09 09 09 09 09 09 09 77 69 6e 64 6f 77 2e  .........window.
19ca0 73 65 74 54 69 6d 65 6f 75 74 28 20 70 72 6f 63  setTimeout( proc
19cb0 65 73 73 20 29 3b 0a 09 09 09 09 09 09 09 7d 0a  ess );........}.
19cc0 09 09 09 09 09 09 7d 3b 0a 09 09 09 09 09 7d 0a  ......};......}.
19cd0 0a 09 09 09 09 09 72 65 74 75 72 6e 20 6a 51 75  ......return jQu
19ce0 65 72 79 2e 44 65 66 65 72 72 65 64 28 20 66 75  ery.Deferred( fu
19cf0 6e 63 74 69 6f 6e 28 20 6e 65 77 44 65 66 65 72  nction( newDefer
19d00 20 29 20 7b 0a 0a 09 09 09 09 09 09 2f 2f 20 70   ) {........// p
19d10 72 6f 67 72 65 73 73 5f 68 61 6e 64 6c 65 72 73  rogress_handlers
19d20 2e 61 64 64 28 20 2e 2e 2e 20 29 0a 09 09 09 09  .add( ... ).....
19d30 09 09 74 75 70 6c 65 73 5b 20 30 20 5d 5b 20 33  ..tuples[ 0 ][ 3
19d40 20 5d 2e 61 64 64 28 0a 09 09 09 09 09 09 09 72   ].add(........r
19d50 65 73 6f 6c 76 65 28 0a 09 09 09 09 09 09 09 09  esolve(.........
19d60 30 2c 0a 09 09 09 09 09 09 09 09 6e 65 77 44 65  0,.........newDe
19d70 66 65 72 2c 0a 09 09 09 09 09 09 09 09 69 73 46  fer,.........isF
19d80 75 6e 63 74 69 6f 6e 28 20 6f 6e 50 72 6f 67 72  unction( onProgr
19d90 65 73 73 20 29 20 3f 0a 09 09 09 09 09 09 09 09  ess ) ?.........
19da0 09 6f 6e 50 72 6f 67 72 65 73 73 20 3a 0a 09 09  .onProgress :...
19db0 09 09 09 09 09 09 09 49 64 65 6e 74 69 74 79 2c  .......Identity,
19dc0 0a 09 09 09 09 09 09 09 09 6e 65 77 44 65 66 65  .........newDefe
19dd0 72 2e 6e 6f 74 69 66 79 57 69 74 68 0a 09 09 09  r.notifyWith....
19de0 09 09 09 09 29 0a 09 09 09 09 09 09 29 3b 0a 0a  ....).......);..
19df0 09 09 09 09 09 09 2f 2f 20 66 75 6c 66 69 6c 6c  ......// fulfill
19e00 65 64 5f 68 61 6e 64 6c 65 72 73 2e 61 64 64 28  ed_handlers.add(
19e10 20 2e 2e 2e 20 29 0a 09 09 09 09 09 09 74 75 70   ... ).......tup
19e20 6c 65 73 5b 20 31 20 5d 5b 20 33 20 5d 2e 61 64  les[ 1 ][ 3 ].ad
19e30 64 28 0a 09 09 09 09 09 09 09 72 65 73 6f 6c 76  d(........resolv
19e40 65 28 0a 09 09 09 09 09 09 09 09 30 2c 0a 09 09  e(.........0,...
19e50 09 09 09 09 09 09 6e 65 77 44 65 66 65 72 2c 0a  ......newDefer,.
19e60 09 09 09 09 09 09 09 09 69 73 46 75 6e 63 74 69  ........isFuncti
19e70 6f 6e 28 20 6f 6e 46 75 6c 66 69 6c 6c 65 64 20  on( onFulfilled 
19e80 29 20 3f 0a 09 09 09 09 09 09 09 09 09 6f 6e 46  ) ?..........onF
19e90 75 6c 66 69 6c 6c 65 64 20 3a 0a 09 09 09 09 09  ulfilled :......
19ea0 09 09 09 09 49 64 65 6e 74 69 74 79 0a 09 09 09  ....Identity....
19eb0 09 09 09 09 29 0a 09 09 09 09 09 09 29 3b 0a 0a  ....).......);..
19ec0 09 09 09 09 09 09 2f 2f 20 72 65 6a 65 63 74 65  ......// rejecte
19ed0 64 5f 68 61 6e 64 6c 65 72 73 2e 61 64 64 28 20  d_handlers.add( 
19ee0 2e 2e 2e 20 29 0a 09 09 09 09 09 09 74 75 70 6c  ... ).......tupl
19ef0 65 73 5b 20 32 20 5d 5b 20 33 20 5d 2e 61 64 64  es[ 2 ][ 3 ].add
19f00 28 0a 09 09 09 09 09 09 09 72 65 73 6f 6c 76 65  (........resolve
19f10 28 0a 09 09 09 09 09 09 09 09 30 2c 0a 09 09 09  (.........0,....
19f20 09 09 09 09 09 6e 65 77 44 65 66 65 72 2c 0a 09  .....newDefer,..
19f30 09 09 09 09 09 09 09 69 73 46 75 6e 63 74 69 6f  .......isFunctio
19f40 6e 28 20 6f 6e 52 65 6a 65 63 74 65 64 20 29 20  n( onRejected ) 
19f50 3f 0a 09 09 09 09 09 09 09 09 09 6f 6e 52 65 6a  ?..........onRej
19f60 65 63 74 65 64 20 3a 0a 09 09 09 09 09 09 09 09  ected :.........
19f70 09 54 68 72 6f 77 65 72 0a 09 09 09 09 09 09 09  .Thrower........
19f80 29 0a 09 09 09 09 09 09 29 3b 0a 09 09 09 09 09  ).......);......
19f90 7d 20 29 2e 70 72 6f 6d 69 73 65 28 29 3b 0a 09  } ).promise();..
19fa0 09 09 09 7d 2c 0a 0a 09 09 09 09 2f 2f 20 47 65  ...},......// Ge
19fb0 74 20 61 20 70 72 6f 6d 69 73 65 20 66 6f 72 20  t a promise for 
19fc0 74 68 69 73 20 64 65 66 65 72 72 65 64 0a 09 09  this deferred...
19fd0 09 09 2f 2f 20 49 66 20 6f 62 6a 20 69 73 20 70  ..// If obj is p
19fe0 72 6f 76 69 64 65 64 2c 20 74 68 65 20 70 72 6f  rovided, the pro
19ff0 6d 69 73 65 20 61 73 70 65 63 74 20 69 73 20 61  mise aspect is a
1a000 64 64 65 64 20 74 6f 20 74 68 65 20 6f 62 6a 65  dded to the obje
1a010 63 74 0a 09 09 09 09 70 72 6f 6d 69 73 65 3a 20  ct.....promise: 
1a020 66 75 6e 63 74 69 6f 6e 28 20 6f 62 6a 20 29 20  function( obj ) 
1a030 7b 0a 09 09 09 09 09 72 65 74 75 72 6e 20 6f 62  {......return ob
1a040 6a 20 21 3d 20 6e 75 6c 6c 20 3f 20 6a 51 75 65  j != null ? jQue
1a050 72 79 2e 65 78 74 65 6e 64 28 20 6f 62 6a 2c 20  ry.extend( obj, 
1a060 70 72 6f 6d 69 73 65 20 29 20 3a 20 70 72 6f 6d  promise ) : prom
1a070 69 73 65 3b 0a 09 09 09 09 7d 0a 09 09 09 7d 2c  ise;.....}....},
1a080 0a 09 09 09 64 65 66 65 72 72 65 64 20 3d 20 7b  ....deferred = {
1a090 7d 3b 0a 0a 09 09 2f 2f 20 41 64 64 20 6c 69 73  };....// Add lis
1a0a0 74 2d 73 70 65 63 69 66 69 63 20 6d 65 74 68 6f  t-specific metho
1a0b0 64 73 0a 09 09 6a 51 75 65 72 79 2e 65 61 63 68  ds...jQuery.each
1a0c0 28 20 74 75 70 6c 65 73 2c 20 66 75 6e 63 74 69  ( tuples, functi
1a0d0 6f 6e 28 20 69 2c 20 74 75 70 6c 65 20 29 20 7b  on( i, tuple ) {
1a0e0 0a 09 09 09 76 61 72 20 6c 69 73 74 20 3d 20 74  ....var list = t
1a0f0 75 70 6c 65 5b 20 32 20 5d 2c 0a 09 09 09 09 73  uple[ 2 ],.....s
1a100 74 61 74 65 53 74 72 69 6e 67 20 3d 20 74 75 70  tateString = tup
1a110 6c 65 5b 20 35 20 5d 3b 0a 0a 09 09 09 2f 2f 20  le[ 5 ];.....// 
1a120 70 72 6f 6d 69 73 65 2e 70 72 6f 67 72 65 73 73  promise.progress
1a130 20 3d 20 6c 69 73 74 2e 61 64 64 0a 09 09 09 2f   = list.add..../
1a140 2f 20 70 72 6f 6d 69 73 65 2e 64 6f 6e 65 20 3d  / promise.done =
1a150 20 6c 69 73 74 2e 61 64 64 0a 09 09 09 2f 2f 20   list.add....// 
1a160 70 72 6f 6d 69 73 65 2e 66 61 69 6c 20 3d 20 6c  promise.fail = l
1a170 69 73 74 2e 61 64 64 0a 09 09 09 70 72 6f 6d 69  ist.add....promi
1a180 73 65 5b 20 74 75 70 6c 65 5b 20 31 20 5d 20 5d  se[ tuple[ 1 ] ]
1a190 20 3d 20 6c 69 73 74 2e 61 64 64 3b 0a 0a 09 09   = list.add;....
1a1a0 09 2f 2f 20 48 61 6e 64 6c 65 20 73 74 61 74 65  .// Handle state
1a1b0 0a 09 09 09 69 66 20 28 20 73 74 61 74 65 53 74  ....if ( stateSt
1a1c0 72 69 6e 67 20 29 20 7b 0a 09 09 09 09 6c 69 73  ring ) {.....lis
1a1d0 74 2e 61 64 64 28 0a 09 09 09 09 09 66 75 6e 63  t.add(......func
1a1e0 74 69 6f 6e 28 29 20 7b 0a 0a 09 09 09 09 09 09  tion() {........
1a1f0 2f 2f 20 73 74 61 74 65 20 3d 20 22 72 65 73 6f  // state = "reso
1a200 6c 76 65 64 22 20 28 69 2e 65 2e 2c 20 66 75 6c  lved" (i.e., ful
1a210 66 69 6c 6c 65 64 29 0a 09 09 09 09 09 09 2f 2f  filled).......//
1a220 20 73 74 61 74 65 20 3d 20 22 72 65 6a 65 63 74   state = "reject
1a230 65 64 22 0a 09 09 09 09 09 09 73 74 61 74 65 20  ed".......state 
1a240 3d 20 73 74 61 74 65 53 74 72 69 6e 67 3b 0a 09  = stateString;..
1a250 09 09 09 09 7d 2c 0a 0a 09 09 09 09 09 2f 2f 20  ....},.......// 
1a260 72 65 6a 65 63 74 65 64 5f 63 61 6c 6c 62 61 63  rejected_callbac
1a270 6b 73 2e 64 69 73 61 62 6c 65 0a 09 09 09 09 09  ks.disable......
1a280 2f 2f 20 66 75 6c 66 69 6c 6c 65 64 5f 63 61 6c  // fulfilled_cal
1a290 6c 62 61 63 6b 73 2e 64 69 73 61 62 6c 65 0a 09  lbacks.disable..
1a2a0 09 09 09 09 74 75 70 6c 65 73 5b 20 33 20 2d 20  ....tuples[ 3 - 
1a2b0 69 20 5d 5b 20 32 20 5d 2e 64 69 73 61 62 6c 65  i ][ 2 ].disable
1a2c0 2c 0a 0a 09 09 09 09 09 2f 2f 20 72 65 6a 65 63  ,.......// rejec
1a2d0 74 65 64 5f 68 61 6e 64 6c 65 72 73 2e 64 69 73  ted_handlers.dis
1a2e0 61 62 6c 65 0a 09 09 09 09 09 2f 2f 20 66 75 6c  able......// ful
1a2f0 66 69 6c 6c 65 64 5f 68 61 6e 64 6c 65 72 73 2e  filled_handlers.
1a300 64 69 73 61 62 6c 65 0a 09 09 09 09 09 74 75 70  disable......tup
1a310 6c 65 73 5b 20 33 20 2d 20 69 20 5d 5b 20 33 20  les[ 3 - i ][ 3 
1a320 5d 2e 64 69 73 61 62 6c 65 2c 0a 0a 09 09 09 09  ].disable,......
1a330 09 2f 2f 20 70 72 6f 67 72 65 73 73 5f 63 61 6c  .// progress_cal
1a340 6c 62 61 63 6b 73 2e 6c 6f 63 6b 0a 09 09 09 09  lbacks.lock.....
1a350 09 74 75 70 6c 65 73 5b 20 30 20 5d 5b 20 32 20  .tuples[ 0 ][ 2 
1a360 5d 2e 6c 6f 63 6b 2c 0a 0a 09 09 09 09 09 2f 2f  ].lock,.......//
1a370 20 70 72 6f 67 72 65 73 73 5f 68 61 6e 64 6c 65   progress_handle
1a380 72 73 2e 6c 6f 63 6b 0a 09 09 09 09 09 74 75 70  rs.lock......tup
1a390 6c 65 73 5b 20 30 20 5d 5b 20 33 20 5d 2e 6c 6f  les[ 0 ][ 3 ].lo
1a3a0 63 6b 0a 09 09 09 09 29 3b 0a 09 09 09 7d 0a 0a  ck.....);....}..
1a3b0 09 09 09 2f 2f 20 70 72 6f 67 72 65 73 73 5f 68  ...// progress_h
1a3c0 61 6e 64 6c 65 72 73 2e 66 69 72 65 0a 09 09 09  andlers.fire....
1a3d0 2f 2f 20 66 75 6c 66 69 6c 6c 65 64 5f 68 61 6e  // fulfilled_han
1a3e0 64 6c 65 72 73 2e 66 69 72 65 0a 09 09 09 2f 2f  dlers.fire....//
1a3f0 20 72 65 6a 65 63 74 65 64 5f 68 61 6e 64 6c 65   rejected_handle
1a400 72 73 2e 66 69 72 65 0a 09 09 09 6c 69 73 74 2e  rs.fire....list.
1a410 61 64 64 28 20 74 75 70 6c 65 5b 20 33 20 5d 2e  add( tuple[ 3 ].
1a420 66 69 72 65 20 29 3b 0a 0a 09 09 09 2f 2f 20 64  fire );.....// d
1a430 65 66 65 72 72 65 64 2e 6e 6f 74 69 66 79 20 3d  eferred.notify =
1a440 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 20 64 65   function() { de
1a450 66 65 72 72 65 64 2e 6e 6f 74 69 66 79 57 69 74  ferred.notifyWit
1a460 68 28 2e 2e 2e 29 20 7d 0a 09 09 09 2f 2f 20 64  h(...) }....// d
1a470 65 66 65 72 72 65 64 2e 72 65 73 6f 6c 76 65 20  eferred.resolve 
1a480 3d 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 20 64  = function() { d
1a490 65 66 65 72 72 65 64 2e 72 65 73 6f 6c 76 65 57  eferred.resolveW
1a4a0 69 74 68 28 2e 2e 2e 29 20 7d 0a 09 09 09 2f 2f  ith(...) }....//
1a4b0 20 64 65 66 65 72 72 65 64 2e 72 65 6a 65 63 74   deferred.reject
1a4c0 20 3d 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 20   = function() { 
1a4d0 64 65 66 65 72 72 65 64 2e 72 65 6a 65 63 74 57  deferred.rejectW
1a4e0 69 74 68 28 2e 2e 2e 29 20 7d 0a 09 09 09 64 65  ith(...) }....de
1a4f0 66 65 72 72 65 64 5b 20 74 75 70 6c 65 5b 20 30  ferred[ tuple[ 0
1a500 20 5d 20 5d 20 3d 20 66 75 6e 63 74 69 6f 6e 28   ] ] = function(
1a510 29 20 7b 0a 09 09 09 09 64 65 66 65 72 72 65 64  ) {.....deferred
1a520 5b 20 74 75 70 6c 65 5b 20 30 20 5d 20 2b 20 22  [ tuple[ 0 ] + "
1a530 57 69 74 68 22 20 5d 28 20 74 68 69 73 20 3d 3d  With" ]( this ==
1a540 3d 20 64 65 66 65 72 72 65 64 20 3f 20 75 6e 64  = deferred ? und
1a550 65 66 69 6e 65 64 20 3a 20 74 68 69 73 2c 20 61  efined : this, a
1a560 72 67 75 6d 65 6e 74 73 20 29 3b 0a 09 09 09 09  rguments );.....
1a570 72 65 74 75 72 6e 20 74 68 69 73 3b 0a 09 09 09  return this;....
1a580 7d 3b 0a 0a 09 09 09 2f 2f 20 64 65 66 65 72 72  };.....// deferr
1a590 65 64 2e 6e 6f 74 69 66 79 57 69 74 68 20 3d 20  ed.notifyWith = 
1a5a0 6c 69 73 74 2e 66 69 72 65 57 69 74 68 0a 09 09  list.fireWith...
1a5b0 09 2f 2f 20 64 65 66 65 72 72 65 64 2e 72 65 73  .// deferred.res
1a5c0 6f 6c 76 65 57 69 74 68 20 3d 20 6c 69 73 74 2e  olveWith = list.
1a5d0 66 69 72 65 57 69 74 68 0a 09 09 09 2f 2f 20 64  fireWith....// d
1a5e0 65 66 65 72 72 65 64 2e 72 65 6a 65 63 74 57 69  eferred.rejectWi
1a5f0 74 68 20 3d 20 6c 69 73 74 2e 66 69 72 65 57 69  th = list.fireWi
1a600 74 68 0a 09 09 09 64 65 66 65 72 72 65 64 5b 20  th....deferred[ 
1a610 74 75 70 6c 65 5b 20 30 20 5d 20 2b 20 22 57 69  tuple[ 0 ] + "Wi
1a620 74 68 22 20 5d 20 3d 20 6c 69 73 74 2e 66 69 72  th" ] = list.fir
1a630 65 57 69 74 68 3b 0a 09 09 7d 20 29 3b 0a 0a 09  eWith;...} );...
1a640 09 2f 2f 20 4d 61 6b 65 20 74 68 65 20 64 65 66  .// Make the def
1a650 65 72 72 65 64 20 61 20 70 72 6f 6d 69 73 65 0a  erred a promise.
1a660 09 09 70 72 6f 6d 69 73 65 2e 70 72 6f 6d 69 73  ..promise.promis
1a670 65 28 20 64 65 66 65 72 72 65 64 20 29 3b 0a 0a  e( deferred );..
1a680 09 09 2f 2f 20 43 61 6c 6c 20 67 69 76 65 6e 20  ..// Call given 
1a690 66 75 6e 63 20 69 66 20 61 6e 79 0a 09 09 69 66  func if any...if
1a6a0 20 28 20 66 75 6e 63 20 29 20 7b 0a 09 09 09 66   ( func ) {....f
1a6b0 75 6e 63 2e 63 61 6c 6c 28 20 64 65 66 65 72 72  unc.call( deferr
1a6c0 65 64 2c 20 64 65 66 65 72 72 65 64 20 29 3b 0a  ed, deferred );.
1a6d0 09 09 7d 0a 0a 09 09 2f 2f 20 41 6c 6c 20 64 6f  ..}....// All do
1a6e0 6e 65 21 0a 09 09 72 65 74 75 72 6e 20 64 65 66  ne!...return def
1a6f0 65 72 72 65 64 3b 0a 09 7d 2c 0a 0a 09 2f 2f 20  erred;..},...// 
1a700 44 65 66 65 72 72 65 64 20 68 65 6c 70 65 72 0a  Deferred helper.
1a710 09 77 68 65 6e 3a 20 66 75 6e 63 74 69 6f 6e 28  .when: function(
1a720 20 73 69 6e 67 6c 65 56 61 6c 75 65 20 29 20 7b   singleValue ) {
1a730 0a 09 09 76 61 72 0a 0a 09 09 09 2f 2f 20 63 6f  ...var.....// co
1a740 75 6e 74 20 6f 66 20 75 6e 63 6f 6d 70 6c 65 74  unt of uncomplet
1a750 65 64 20 73 75 62 6f 72 64 69 6e 61 74 65 73 0a  ed subordinates.
1a760 09 09 09 72 65 6d 61 69 6e 69 6e 67 20 3d 20 61  ...remaining = a
1a770 72 67 75 6d 65 6e 74 73 2e 6c 65 6e 67 74 68 2c  rguments.length,
1a780 0a 0a 09 09 09 2f 2f 20 63 6f 75 6e 74 20 6f 66  .....// count of
1a790 20 75 6e 70 72 6f 63 65 73 73 65 64 20 61 72 67   unprocessed arg
1a7a0 75 6d 65 6e 74 73 0a 09 09 09 69 20 3d 20 72 65  uments....i = re
1a7b0 6d 61 69 6e 69 6e 67 2c 0a 0a 09 09 09 2f 2f 20  maining,.....// 
1a7c0 73 75 62 6f 72 64 69 6e 61 74 65 20 66 75 6c 66  subordinate fulf
1a7d0 69 6c 6c 6d 65 6e 74 20 64 61 74 61 0a 09 09 09  illment data....
1a7e0 72 65 73 6f 6c 76 65 43 6f 6e 74 65 78 74 73 20  resolveContexts 
1a7f0 3d 20 41 72 72 61 79 28 20 69 20 29 2c 0a 09 09  = Array( i ),...
1a800 09 72 65 73 6f 6c 76 65 56 61 6c 75 65 73 20 3d  .resolveValues =
1a810 20 73 6c 69 63 65 2e 63 61 6c 6c 28 20 61 72 67   slice.call( arg
1a820 75 6d 65 6e 74 73 20 29 2c 0a 0a 09 09 09 2f 2f  uments ),.....//
1a830 20 74 68 65 20 6d 61 73 74 65 72 20 44 65 66 65   the master Defe
1a840 72 72 65 64 0a 09 09 09 6d 61 73 74 65 72 20 3d  rred....master =
1a850 20 6a 51 75 65 72 79 2e 44 65 66 65 72 72 65 64   jQuery.Deferred
1a860 28 29 2c 0a 0a 09 09 09 2f 2f 20 73 75 62 6f 72  (),.....// subor
1a870 64 69 6e 61 74 65 20 63 61 6c 6c 62 61 63 6b 20  dinate callback 
1a880 66 61 63 74 6f 72 79 0a 09 09 09 75 70 64 61 74  factory....updat
1a890 65 46 75 6e 63 20 3d 20 66 75 6e 63 74 69 6f 6e  eFunc = function
1a8a0 28 20 69 20 29 20 7b 0a 09 09 09 09 72 65 74 75  ( i ) {.....retu
1a8b0 72 6e 20 66 75 6e 63 74 69 6f 6e 28 20 76 61 6c  rn function( val
1a8c0 75 65 20 29 20 7b 0a 09 09 09 09 09 72 65 73 6f  ue ) {......reso
1a8d0 6c 76 65 43 6f 6e 74 65 78 74 73 5b 20 69 20 5d  lveContexts[ i ]
1a8e0 20 3d 20 74 68 69 73 3b 0a 09 09 09 09 09 72 65   = this;......re
1a8f0 73 6f 6c 76 65 56 61 6c 75 65 73 5b 20 69 20 5d  solveValues[ i ]
1a900 20 3d 20 61 72 67 75 6d 65 6e 74 73 2e 6c 65 6e   = arguments.len
1a910 67 74 68 20 3e 20 31 20 3f 20 73 6c 69 63 65 2e  gth > 1 ? slice.
1a920 63 61 6c 6c 28 20 61 72 67 75 6d 65 6e 74 73 20  call( arguments 
1a930 29 20 3a 20 76 61 6c 75 65 3b 0a 09 09 09 09 09  ) : value;......
1a940 69 66 20 28 20 21 28 20 2d 2d 72 65 6d 61 69 6e  if ( !( --remain
1a950 69 6e 67 20 29 20 29 20 7b 0a 09 09 09 09 09 09  ing ) ) {.......
1a960 6d 61 73 74 65 72 2e 72 65 73 6f 6c 76 65 57 69  master.resolveWi
1a970 74 68 28 20 72 65 73 6f 6c 76 65 43 6f 6e 74 65  th( resolveConte
1a980 78 74 73 2c 20 72 65 73 6f 6c 76 65 56 61 6c 75  xts, resolveValu
1a990 65 73 20 29 3b 0a 09 09 09 09 09 7d 0a 09 09 09  es );......}....
1a9a0 09 7d 3b 0a 09 09 09 7d 3b 0a 0a 09 09 2f 2f 20  .};....};....// 
1a9b0 53 69 6e 67 6c 65 2d 20 61 6e 64 20 65 6d 70 74  Single- and empt
1a9c0 79 20 61 72 67 75 6d 65 6e 74 73 20 61 72 65 20  y arguments are 
1a9d0 61 64 6f 70 74 65 64 20 6c 69 6b 65 20 50 72 6f  adopted like Pro
1a9e0 6d 69 73 65 2e 72 65 73 6f 6c 76 65 0a 09 09 69  mise.resolve...i
1a9f0 66 20 28 20 72 65 6d 61 69 6e 69 6e 67 20 3c 3d  f ( remaining <=
1aa00 20 31 20 29 20 7b 0a 09 09 09 61 64 6f 70 74 56   1 ) {....adoptV
1aa10 61 6c 75 65 28 20 73 69 6e 67 6c 65 56 61 6c 75  alue( singleValu
1aa20 65 2c 20 6d 61 73 74 65 72 2e 64 6f 6e 65 28 20  e, master.done( 
1aa30 75 70 64 61 74 65 46 75 6e 63 28 20 69 20 29 20  updateFunc( i ) 
1aa40 29 2e 72 65 73 6f 6c 76 65 2c 20 6d 61 73 74 65  ).resolve, maste
1aa50 72 2e 72 65 6a 65 63 74 2c 0a 09 09 09 09 21 72  r.reject,.....!r
1aa60 65 6d 61 69 6e 69 6e 67 20 29 3b 0a 0a 09 09 09  emaining );.....
1aa70 2f 2f 20 55 73 65 20 2e 74 68 65 6e 28 29 20 74  // Use .then() t
1aa80 6f 20 75 6e 77 72 61 70 20 73 65 63 6f 6e 64 61  o unwrap seconda
1aa90 72 79 20 74 68 65 6e 61 62 6c 65 73 20 28 63 66  ry thenables (cf
1aaa0 2e 20 67 68 2d 33 30 30 30 29 0a 09 09 09 69 66  . gh-3000)....if
1aab0 20 28 20 6d 61 73 74 65 72 2e 73 74 61 74 65 28   ( master.state(
1aac0 29 20 3d 3d 3d 20 22 70 65 6e 64 69 6e 67 22 20  ) === "pending" 
1aad0 7c 7c 0a 09 09 09 09 69 73 46 75 6e 63 74 69 6f  ||.....isFunctio
1aae0 6e 28 20 72 65 73 6f 6c 76 65 56 61 6c 75 65 73  n( resolveValues
1aaf0 5b 20 69 20 5d 20 26 26 20 72 65 73 6f 6c 76 65  [ i ] && resolve
1ab00 56 61 6c 75 65 73 5b 20 69 20 5d 2e 74 68 65 6e  Values[ i ].then
1ab10 20 29 20 29 20 7b 0a 0a 09 09 09 09 72 65 74 75   ) ) {......retu
1ab20 72 6e 20 6d 61 73 74 65 72 2e 74 68 65 6e 28 29  rn master.then()
1ab30 3b 0a 09 09 09 7d 0a 09 09 7d 0a 0a 09 09 2f 2f  ;....}...}....//
1ab40 20 4d 75 6c 74 69 70 6c 65 20 61 72 67 75 6d 65   Multiple argume
1ab50 6e 74 73 20 61 72 65 20 61 67 67 72 65 67 61 74  nts are aggregat
1ab60 65 64 20 6c 69 6b 65 20 50 72 6f 6d 69 73 65 2e  ed like Promise.
1ab70 61 6c 6c 20 61 72 72 61 79 20 65 6c 65 6d 65 6e  all array elemen
1ab80 74 73 0a 09 09 77 68 69 6c 65 20 28 20 69 2d 2d  ts...while ( i--
1ab90 20 29 20 7b 0a 09 09 09 61 64 6f 70 74 56 61 6c   ) {....adoptVal
1aba0 75 65 28 20 72 65 73 6f 6c 76 65 56 61 6c 75 65  ue( resolveValue
1abb0 73 5b 20 69 20 5d 2c 20 75 70 64 61 74 65 46 75  s[ i ], updateFu
1abc0 6e 63 28 20 69 20 29 2c 20 6d 61 73 74 65 72 2e  nc( i ), master.
1abd0 72 65 6a 65 63 74 20 29 3b 0a 09 09 7d 0a 0a 09  reject );...}...
1abe0 09 72 65 74 75 72 6e 20 6d 61 73 74 65 72 2e 70  .return master.p
1abf0 72 6f 6d 69 73 65 28 29 3b 0a 09 7d 0a 7d 20 29  romise();..}.} )
1ac00 3b 0a 0a 0a 2f 2f 20 54 68 65 73 65 20 75 73 75  ;...// These usu
1ac10 61 6c 6c 79 20 69 6e 64 69 63 61 74 65 20 61 20  ally indicate a 
1ac20 70 72 6f 67 72 61 6d 6d 65 72 20 6d 69 73 74 61  programmer mista
1ac30 6b 65 20 64 75 72 69 6e 67 20 64 65 76 65 6c 6f  ke during develo
1ac40 70 6d 65 6e 74 2c 0a 2f 2f 20 77 61 72 6e 20 61  pment,.// warn a
1ac50 62 6f 75 74 20 74 68 65 6d 20 41 53 41 50 20 72  bout them ASAP r
1ac60 61 74 68 65 72 20 74 68 61 6e 20 73 77 61 6c 6c  ather than swall
1ac70 6f 77 69 6e 67 20 74 68 65 6d 20 62 79 20 64 65  owing them by de
1ac80 66 61 75 6c 74 2e 0a 76 61 72 20 72 65 72 72 6f  fault..var rerro
1ac90 72 4e 61 6d 65 73 20 3d 20 2f 5e 28 45 76 61 6c  rNames = /^(Eval
1aca0 7c 49 6e 74 65 72 6e 61 6c 7c 52 61 6e 67 65 7c  |Internal|Range|
1acb0 52 65 66 65 72 65 6e 63 65 7c 53 79 6e 74 61 78  Reference|Syntax
1acc0 7c 54 79 70 65 7c 55 52 49 29 45 72 72 6f 72 24  |Type|URI)Error$
1acd0 2f 3b 0a 0a 6a 51 75 65 72 79 2e 44 65 66 65 72  /;..jQuery.Defer
1ace0 72 65 64 2e 65 78 63 65 70 74 69 6f 6e 48 6f 6f  red.exceptionHoo
1acf0 6b 20 3d 20 66 75 6e 63 74 69 6f 6e 28 20 65 72  k = function( er
1ad00 72 6f 72 2c 20 73 74 61 63 6b 20 29 20 7b 0a 0a  ror, stack ) {..
1ad10 09 2f 2f 20 53 75 70 70 6f 72 74 3a 20 49 45 20  .// Support: IE 
1ad20 38 20 2d 20 39 20 6f 6e 6c 79 0a 09 2f 2f 20 43  8 - 9 only..// C
1ad30 6f 6e 73 6f 6c 65 20 65 78 69 73 74 73 20 77 68  onsole exists wh
1ad40 65 6e 20 64 65 76 20 74 6f 6f 6c 73 20 61 72 65  en dev tools are
1ad50 20 6f 70 65 6e 2c 20 77 68 69 63 68 20 63 61 6e   open, which can
1ad60 20 68 61 70 70 65 6e 20 61 74 20 61 6e 79 20 74   happen at any t
1ad70 69 6d 65 0a 09 69 66 20 28 20 77 69 6e 64 6f 77  ime..if ( window
1ad80 2e 63 6f 6e 73 6f 6c 65 20 26 26 20 77 69 6e 64  .console && wind
1ad90 6f 77 2e 63 6f 6e 73 6f 6c 65 2e 77 61 72 6e 20  ow.console.warn 
1ada0 26 26 20 65 72 72 6f 72 20 26 26 20 72 65 72 72  && error && rerr
1adb0 6f 72 4e 61 6d 65 73 2e 74 65 73 74 28 20 65 72  orNames.test( er
1adc0 72 6f 72 2e 6e 61 6d 65 20 29 20 29 20 7b 0a 09  ror.name ) ) {..
1add0 09 77 69 6e 64 6f 77 2e 63 6f 6e 73 6f 6c 65 2e  .window.console.
1ade0 77 61 72 6e 28 20 22 6a 51 75 65 72 79 2e 44 65  warn( "jQuery.De
1adf0 66 65 72 72 65 64 20 65 78 63 65 70 74 69 6f 6e  ferred exception
1ae00 3a 20 22 20 2b 20 65 72 72 6f 72 2e 6d 65 73 73  : " + error.mess
1ae10 61 67 65 2c 20 65 72 72 6f 72 2e 73 74 61 63 6b  age, error.stack
1ae20 2c 20 73 74 61 63 6b 20 29 3b 0a 09 7d 0a 7d 3b  , stack );..}.};
1ae30 0a 0a 0a 0a 0a 6a 51 75 65 72 79 2e 72 65 61 64  .....jQuery.read
1ae40 79 45 78 63 65 70 74 69 6f 6e 20 3d 20 66 75 6e  yException = fun
1ae50 63 74 69 6f 6e 28 20 65 72 72 6f 72 20 29 20 7b  ction( error ) {
1ae60 0a 09 77 69 6e 64 6f 77 2e 73 65 74 54 69 6d 65  ..window.setTime
1ae70 6f 75 74 28 20 66 75 6e 63 74 69 6f 6e 28 29 20  out( function() 
1ae80 7b 0a 09 09 74 68 72 6f 77 20 65 72 72 6f 72 3b  {...throw error;
1ae90 0a 09 7d 20 29 3b 0a 7d 3b 0a 0a 0a 0a 0a 2f 2f  ..} );.};.....//
1aea0 20 54 68 65 20 64 65 66 65 72 72 65 64 20 75 73   The deferred us
1aeb0 65 64 20 6f 6e 20 44 4f 4d 20 72 65 61 64 79 0a  ed on DOM ready.
1aec0 76 61 72 20 72 65 61 64 79 4c 69 73 74 20 3d 20  var readyList = 
1aed0 6a 51 75 65 72 79 2e 44 65 66 65 72 72 65 64 28  jQuery.Deferred(
1aee0 29 3b 0a 0a 6a 51 75 65 72 79 2e 66 6e 2e 72 65  );..jQuery.fn.re
1aef0 61 64 79 20 3d 20 66 75 6e 63 74 69 6f 6e 28 20  ady = function( 
1af00 66 6e 20 29 20 7b 0a 0a 09 72 65 61 64 79 4c 69  fn ) {...readyLi
1af10 73 74 0a 09 09 2e 74 68 65 6e 28 20 66 6e 20 29  st....then( fn )
1af20 0a 0a 09 09 2f 2f 20 57 72 61 70 20 6a 51 75 65  ....// Wrap jQue
1af30 72 79 2e 72 65 61 64 79 45 78 63 65 70 74 69 6f  ry.readyExceptio
1af40 6e 20 69 6e 20 61 20 66 75 6e 63 74 69 6f 6e 20  n in a function 
1af50 73 6f 20 74 68 61 74 20 74 68 65 20 6c 6f 6f 6b  so that the look
1af60 75 70 0a 09 09 2f 2f 20 68 61 70 70 65 6e 73 20  up...// happens 
1af70 61 74 20 74 68 65 20 74 69 6d 65 20 6f 66 20 65  at the time of e
1af80 72 72 6f 72 20 68 61 6e 64 6c 69 6e 67 20 69 6e  rror handling in
1af90 73 74 65 61 64 20 6f 66 20 63 61 6c 6c 62 61 63  stead of callbac
1afa0 6b 0a 09 09 2f 2f 20 72 65 67 69 73 74 72 61 74  k...// registrat
1afb0 69 6f 6e 2e 0a 09 09 2e 63 61 74 63 68 28 20 66  ion.....catch( f
1afc0 75 6e 63 74 69 6f 6e 28 20 65 72 72 6f 72 20 29  unction( error )
1afd0 20 7b 0a 09 09 09 6a 51 75 65 72 79 2e 72 65 61   {....jQuery.rea
1afe0 64 79 45 78 63 65 70 74 69 6f 6e 28 20 65 72 72  dyException( err
1aff0 6f 72 20 29 3b 0a 09 09 7d 20 29 3b 0a 0a 09 72  or );...} );...r
1b000 65 74 75 72 6e 20 74 68 69 73 3b 0a 7d 3b 0a 0a  eturn this;.};..
1b010 6a 51 75 65 72 79 2e 65 78 74 65 6e 64 28 20 7b  jQuery.extend( {
1b020 0a 0a 09 2f 2f 20 49 73 20 74 68 65 20 44 4f 4d  ...// Is the DOM
1b030 20 72 65 61 64 79 20 74 6f 20 62 65 20 75 73 65   ready to be use
1b040 64 3f 20 53 65 74 20 74 6f 20 74 72 75 65 20 6f  d? Set to true o
1b050 6e 63 65 20 69 74 20 6f 63 63 75 72 73 2e 0a 09  nce it occurs...
1b060 69 73 52 65 61 64 79 3a 20 66 61 6c 73 65 2c 0a  isReady: false,.
1b070 0a 09 2f 2f 20 41 20 63 6f 75 6e 74 65 72 20 74  ..// A counter t
1b080 6f 20 74 72 61 63 6b 20 68 6f 77 20 6d 61 6e 79  o track how many
1b090 20 69 74 65 6d 73 20 74 6f 20 77 61 69 74 20 66   items to wait f
1b0a0 6f 72 20 62 65 66 6f 72 65 0a 09 2f 2f 20 74 68  or before..// th
1b0b0 65 20 72 65 61 64 79 20 65 76 65 6e 74 20 66 69  e ready event fi
1b0c0 72 65 73 2e 20 53 65 65 20 23 36 37 38 31 0a 09  res. See #6781..
1b0d0 72 65 61 64 79 57 61 69 74 3a 20 31 2c 0a 0a 09  readyWait: 1,...
1b0e0 2f 2f 20 48 61 6e 64 6c 65 20 77 68 65 6e 20 74  // Handle when t
1b0f0 68 65 20 44 4f 4d 20 69 73 20 72 65 61 64 79 0a  he DOM is ready.
1b100 09 72 65 61 64 79 3a 20 66 75 6e 63 74 69 6f 6e  .ready: function
1b110 28 20 77 61 69 74 20 29 20 7b 0a 0a 09 09 2f 2f  ( wait ) {....//
1b120 20 41 62 6f 72 74 20 69 66 20 74 68 65 72 65 20   Abort if there 
1b130 61 72 65 20 70 65 6e 64 69 6e 67 20 68 6f 6c 64  are pending hold
1b140 73 20 6f 72 20 77 65 27 72 65 20 61 6c 72 65 61  s or we're alrea
1b150 64 79 20 72 65 61 64 79 0a 09 09 69 66 20 28 20  dy ready...if ( 
1b160 77 61 69 74 20 3d 3d 3d 20 74 72 75 65 20 3f 20  wait === true ? 
1b170 2d 2d 6a 51 75 65 72 79 2e 72 65 61 64 79 57 61  --jQuery.readyWa
1b180 69 74 20 3a 20 6a 51 75 65 72 79 2e 69 73 52 65  it : jQuery.isRe
1b190 61 64 79 20 29 20 7b 0a 09 09 09 72 65 74 75 72  ady ) {....retur
1b1a0 6e 3b 0a 09 09 7d 0a 0a 09 09 2f 2f 20 52 65 6d  n;...}....// Rem
1b1b0 65 6d 62 65 72 20 74 68 61 74 20 74 68 65 20 44  ember that the D
1b1c0 4f 4d 20 69 73 20 72 65 61 64 79 0a 09 09 6a 51  OM is ready...jQ
1b1d0 75 65 72 79 2e 69 73 52 65 61 64 79 20 3d 20 74  uery.isReady = t
1b1e0 72 75 65 3b 0a 0a 09 09 2f 2f 20 49 66 20 61 20  rue;....// If a 
1b1f0 6e 6f 72 6d 61 6c 20 44 4f 4d 20 52 65 61 64 79  normal DOM Ready
1b200 20 65 76 65 6e 74 20 66 69 72 65 64 2c 20 64 65   event fired, de
1b210 63 72 65 6d 65 6e 74 2c 20 61 6e 64 20 77 61 69  crement, and wai
1b220 74 20 69 66 20 6e 65 65 64 20 62 65 0a 09 09 69  t if need be...i
1b230 66 20 28 20 77 61 69 74 20 21 3d 3d 20 74 72 75  f ( wait !== tru
1b240 65 20 26 26 20 2d 2d 6a 51 75 65 72 79 2e 72 65  e && --jQuery.re
1b250 61 64 79 57 61 69 74 20 3e 20 30 20 29 20 7b 0a  adyWait > 0 ) {.
1b260 09 09 09 72 65 74 75 72 6e 3b 0a 09 09 7d 0a 0a  ...return;...}..
1b270 09 09 2f 2f 20 49 66 20 74 68 65 72 65 20 61 72  ..// If there ar
1b280 65 20 66 75 6e 63 74 69 6f 6e 73 20 62 6f 75 6e  e functions boun
1b290 64 2c 20 74 6f 20 65 78 65 63 75 74 65 0a 09 09  d, to execute...
1b2a0 72 65 61 64 79 4c 69 73 74 2e 72 65 73 6f 6c 76  readyList.resolv
1b2b0 65 57 69 74 68 28 20 64 6f 63 75 6d 65 6e 74 2c  eWith( document,
1b2c0 20 5b 20 6a 51 75 65 72 79 20 5d 20 29 3b 0a 09   [ jQuery ] );..
1b2d0 7d 0a 7d 20 29 3b 0a 0a 6a 51 75 65 72 79 2e 72  }.} );..jQuery.r
1b2e0 65 61 64 79 2e 74 68 65 6e 20 3d 20 72 65 61 64  eady.then = read
1b2f0 79 4c 69 73 74 2e 74 68 65 6e 3b 0a 0a 2f 2f 20  yList.then;..// 
1b300 54 68 65 20 72 65 61 64 79 20 65 76 65 6e 74 20  The ready event 
1b310 68 61 6e 64 6c 65 72 20 61 6e 64 20 73 65 6c 66  handler and self
1b320 20 63 6c 65 61 6e 75 70 20 6d 65 74 68 6f 64 0a   cleanup method.
1b330 66 75 6e 63 74 69 6f 6e 20 63 6f 6d 70 6c 65 74  function complet
1b340 65 64 28 29 20 7b 0a 09 64 6f 63 75 6d 65 6e 74  ed() {..document
1b350 2e 72 65 6d 6f 76 65 45 76 65 6e 74 4c 69 73 74  .removeEventList
1b360 65 6e 65 72 28 20 22 44 4f 4d 43 6f 6e 74 65 6e  ener( "DOMConten
1b370 74 4c 6f 61 64 65 64 22 2c 20 63 6f 6d 70 6c 65  tLoaded", comple
1b380 74 65 64 20 29 3b 0a 09 77 69 6e 64 6f 77 2e 72  ted );..window.r
1b390 65 6d 6f 76 65 45 76 65 6e 74 4c 69 73 74 65 6e  emoveEventListen
1b3a0 65 72 28 20 22 6c 6f 61 64 22 2c 20 63 6f 6d 70  er( "load", comp
1b3b0 6c 65 74 65 64 20 29 3b 0a 09 6a 51 75 65 72 79  leted );..jQuery
1b3c0 2e 72 65 61 64 79 28 29 3b 0a 7d 0a 0a 2f 2f 20  .ready();.}..// 
1b3d0 43 61 74 63 68 20 63 61 73 65 73 20 77 68 65 72  Catch cases wher
1b3e0 65 20 24 28 64 6f 63 75 6d 65 6e 74 29 2e 72 65  e $(document).re
1b3f0 61 64 79 28 29 20 69 73 20 63 61 6c 6c 65 64 0a  ady() is called.
1b400 2f 2f 20 61 66 74 65 72 20 74 68 65 20 62 72 6f  // after the bro
1b410 77 73 65 72 20 65 76 65 6e 74 20 68 61 73 20 61  wser event has a
1b420 6c 72 65 61 64 79 20 6f 63 63 75 72 72 65 64 2e  lready occurred.
1b430 0a 2f 2f 20 53 75 70 70 6f 72 74 3a 20 49 45 20  .// Support: IE 
1b440 3c 3d 39 20 2d 20 31 30 20 6f 6e 6c 79 0a 2f 2f  <=9 - 10 only.//
1b450 20 4f 6c 64 65 72 20 49 45 20 73 6f 6d 65 74 69   Older IE someti
1b460 6d 65 73 20 73 69 67 6e 61 6c 73 20 22 69 6e 74  mes signals "int
1b470 65 72 61 63 74 69 76 65 22 20 74 6f 6f 20 73 6f  eractive" too so
1b480 6f 6e 0a 69 66 20 28 20 64 6f 63 75 6d 65 6e 74  on.if ( document
1b490 2e 72 65 61 64 79 53 74 61 74 65 20 3d 3d 3d 20  .readyState === 
1b4a0 22 63 6f 6d 70 6c 65 74 65 22 20 7c 7c 0a 09 28  "complete" ||..(
1b4b0 20 64 6f 63 75 6d 65 6e 74 2e 72 65 61 64 79 53   document.readyS
1b4c0 74 61 74 65 20 21 3d 3d 20 22 6c 6f 61 64 69 6e  tate !== "loadin
1b4d0 67 22 20 26 26 20 21 64 6f 63 75 6d 65 6e 74 2e  g" && !document.
1b4e0 64 6f 63 75 6d 65 6e 74 45 6c 65 6d 65 6e 74 2e  documentElement.
1b4f0 64 6f 53 63 72 6f 6c 6c 20 29 20 29 20 7b 0a 0a  doScroll ) ) {..
1b500 09 2f 2f 20 48 61 6e 64 6c 65 20 69 74 20 61 73  .// Handle it as
1b510 79 6e 63 68 72 6f 6e 6f 75 73 6c 79 20 74 6f 20  ynchronously to 
1b520 61 6c 6c 6f 77 20 73 63 72 69 70 74 73 20 74 68  allow scripts th
1b530 65 20 6f 70 70 6f 72 74 75 6e 69 74 79 20 74 6f  e opportunity to
1b540 20 64 65 6c 61 79 20 72 65 61 64 79 0a 09 77 69   delay ready..wi
1b550 6e 64 6f 77 2e 73 65 74 54 69 6d 65 6f 75 74 28  ndow.setTimeout(
1b560 20 6a 51 75 65 72 79 2e 72 65 61 64 79 20 29 3b   jQuery.ready );
1b570 0a 0a 7d 20 65 6c 73 65 20 7b 0a 0a 09 2f 2f 20  ..} else {...// 
1b580 55 73 65 20 74 68 65 20 68 61 6e 64 79 20 65 76  Use the handy ev
1b590 65 6e 74 20 63 61 6c 6c 62 61 63 6b 0a 09 64 6f  ent callback..do
1b5a0 63 75 6d 65 6e 74 2e 61 64 64 45 76 65 6e 74 4c  cument.addEventL
1b5b0 69 73 74 65 6e 65 72 28 20 22 44 4f 4d 43 6f 6e  istener( "DOMCon
1b5c0 74 65 6e 74 4c 6f 61 64 65 64 22 2c 20 63 6f 6d  tentLoaded", com
1b5d0 70 6c 65 74 65 64 20 29 3b 0a 0a 09 2f 2f 20 41  pleted );...// A
1b5e0 20 66 61 6c 6c 62 61 63 6b 20 74 6f 20 77 69 6e   fallback to win
1b5f0 64 6f 77 2e 6f 6e 6c 6f 61 64 2c 20 74 68 61 74  dow.onload, that
1b600 20 77 69 6c 6c 20 61 6c 77 61 79 73 20 77 6f 72   will always wor
1b610 6b 0a 09 77 69 6e 64 6f 77 2e 61 64 64 45 76 65  k..window.addEve
1b620 6e 74 4c 69 73 74 65 6e 65 72 28 20 22 6c 6f 61  ntListener( "loa
1b630 64 22 2c 20 63 6f 6d 70 6c 65 74 65 64 20 29 3b  d", completed );
1b640 0a 7d 0a 0a 0a 0a 0a 2f 2f 20 4d 75 6c 74 69 66  .}.....// Multif
1b650 75 6e 63 74 69 6f 6e 61 6c 20 6d 65 74 68 6f 64  unctional method
1b660 20 74 6f 20 67 65 74 20 61 6e 64 20 73 65 74 20   to get and set 
1b670 76 61 6c 75 65 73 20 6f 66 20 61 20 63 6f 6c 6c  values of a coll
1b680 65 63 74 69 6f 6e 0a 2f 2f 20 54 68 65 20 76 61  ection.// The va
1b690 6c 75 65 2f 73 20 63 61 6e 20 6f 70 74 69 6f 6e  lue/s can option
1b6a0 61 6c 6c 79 20 62 65 20 65 78 65 63 75 74 65 64  ally be executed
1b6b0 20 69 66 20 69 74 27 73 20 61 20 66 75 6e 63 74   if it's a funct
1b6c0 69 6f 6e 0a 76 61 72 20 61 63 63 65 73 73 20 3d  ion.var access =
1b6d0 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 73   function( elems
1b6e0 2c 20 66 6e 2c 20 6b 65 79 2c 20 76 61 6c 75 65  , fn, key, value
1b6f0 2c 20 63 68 61 69 6e 61 62 6c 65 2c 20 65 6d 70  , chainable, emp
1b700 74 79 47 65 74 2c 20 72 61 77 20 29 20 7b 0a 09  tyGet, raw ) {..
1b710 76 61 72 20 69 20 3d 20 30 2c 0a 09 09 6c 65 6e  var i = 0,...len
1b720 20 3d 20 65 6c 65 6d 73 2e 6c 65 6e 67 74 68 2c   = elems.length,
1b730 0a 09 09 62 75 6c 6b 20 3d 20 6b 65 79 20 3d 3d  ...bulk = key ==
1b740 20 6e 75 6c 6c 3b 0a 0a 09 2f 2f 20 53 65 74 73   null;...// Sets
1b750 20 6d 61 6e 79 20 76 61 6c 75 65 73 0a 09 69 66   many values..if
1b760 20 28 20 74 6f 54 79 70 65 28 20 6b 65 79 20 29   ( toType( key )
1b770 20 3d 3d 3d 20 22 6f 62 6a 65 63 74 22 20 29 20   === "object" ) 
1b780 7b 0a 09 09 63 68 61 69 6e 61 62 6c 65 20 3d 20  {...chainable = 
1b790 74 72 75 65 3b 0a 09 09 66 6f 72 20 28 20 69 20  true;...for ( i 
1b7a0 69 6e 20 6b 65 79 20 29 20 7b 0a 09 09 09 61 63  in key ) {....ac
1b7b0 63 65 73 73 28 20 65 6c 65 6d 73 2c 20 66 6e 2c  cess( elems, fn,
1b7c0 20 69 2c 20 6b 65 79 5b 20 69 20 5d 2c 20 74 72   i, key[ i ], tr
1b7d0 75 65 2c 20 65 6d 70 74 79 47 65 74 2c 20 72 61  ue, emptyGet, ra
1b7e0 77 20 29 3b 0a 09 09 7d 0a 0a 09 2f 2f 20 53 65  w );...}...// Se
1b7f0 74 73 20 6f 6e 65 20 76 61 6c 75 65 0a 09 7d 20  ts one value..} 
1b800 65 6c 73 65 20 69 66 20 28 20 76 61 6c 75 65 20  else if ( value 
1b810 21 3d 3d 20 75 6e 64 65 66 69 6e 65 64 20 29 20  !== undefined ) 
1b820 7b 0a 09 09 63 68 61 69 6e 61 62 6c 65 20 3d 20  {...chainable = 
1b830 74 72 75 65 3b 0a 0a 09 09 69 66 20 28 20 21 69  true;....if ( !i
1b840 73 46 75 6e 63 74 69 6f 6e 28 20 76 61 6c 75 65  sFunction( value
1b850 20 29 20 29 20 7b 0a 09 09 09 72 61 77 20 3d 20   ) ) {....raw = 
1b860 74 72 75 65 3b 0a 09 09 7d 0a 0a 09 09 69 66 20  true;...}....if 
1b870 28 20 62 75 6c 6b 20 29 20 7b 0a 0a 09 09 09 2f  ( bulk ) {...../
1b880 2f 20 42 75 6c 6b 20 6f 70 65 72 61 74 69 6f 6e  / Bulk operation
1b890 73 20 72 75 6e 20 61 67 61 69 6e 73 74 20 74 68  s run against th
1b8a0 65 20 65 6e 74 69 72 65 20 73 65 74 0a 09 09 09  e entire set....
1b8b0 69 66 20 28 20 72 61 77 20 29 20 7b 0a 09 09 09  if ( raw ) {....
1b8c0 09 66 6e 2e 63 61 6c 6c 28 20 65 6c 65 6d 73 2c  .fn.call( elems,
1b8d0 20 76 61 6c 75 65 20 29 3b 0a 09 09 09 09 66 6e   value );.....fn
1b8e0 20 3d 20 6e 75 6c 6c 3b 0a 0a 09 09 09 2f 2f 20   = null;.....// 
1b8f0 2e 2e 2e 65 78 63 65 70 74 20 77 68 65 6e 20 65  ...except when e
1b900 78 65 63 75 74 69 6e 67 20 66 75 6e 63 74 69 6f  xecuting functio
1b910 6e 20 76 61 6c 75 65 73 0a 09 09 09 7d 20 65 6c  n values....} el
1b920 73 65 20 7b 0a 09 09 09 09 62 75 6c 6b 20 3d 20  se {.....bulk = 
1b930 66 6e 3b 0a 09 09 09 09 66 6e 20 3d 20 66 75 6e  fn;.....fn = fun
1b940 63 74 69 6f 6e 28 20 65 6c 65 6d 2c 20 5f 6b 65  ction( elem, _ke
1b950 79 2c 20 76 61 6c 75 65 20 29 20 7b 0a 09 09 09  y, value ) {....
1b960 09 09 72 65 74 75 72 6e 20 62 75 6c 6b 2e 63 61  ..return bulk.ca
1b970 6c 6c 28 20 6a 51 75 65 72 79 28 20 65 6c 65 6d  ll( jQuery( elem
1b980 20 29 2c 20 76 61 6c 75 65 20 29 3b 0a 09 09 09   ), value );....
1b990 09 7d 3b 0a 09 09 09 7d 0a 09 09 7d 0a 0a 09 09  .};....}...}....
1b9a0 69 66 20 28 20 66 6e 20 29 20 7b 0a 09 09 09 66  if ( fn ) {....f
1b9b0 6f 72 20 28 20 3b 20 69 20 3c 20 6c 65 6e 3b 20  or ( ; i < len; 
1b9c0 69 2b 2b 20 29 20 7b 0a 09 09 09 09 66 6e 28 0a  i++ ) {.....fn(.
1b9d0 09 09 09 09 09 65 6c 65 6d 73 5b 20 69 20 5d 2c  .....elems[ i ],
1b9e0 20 6b 65 79 2c 20 72 61 77 20 3f 0a 09 09 09 09   key, raw ?.....
1b9f0 09 76 61 6c 75 65 20 3a 0a 09 09 09 09 09 76 61  .value :......va
1ba00 6c 75 65 2e 63 61 6c 6c 28 20 65 6c 65 6d 73 5b  lue.call( elems[
1ba10 20 69 20 5d 2c 20 69 2c 20 66 6e 28 20 65 6c 65   i ], i, fn( ele
1ba20 6d 73 5b 20 69 20 5d 2c 20 6b 65 79 20 29 20 29  ms[ i ], key ) )
1ba30 0a 09 09 09 09 29 3b 0a 09 09 09 7d 0a 09 09 7d  .....);....}...}
1ba40 0a 09 7d 0a 0a 09 69 66 20 28 20 63 68 61 69 6e  ..}...if ( chain
1ba50 61 62 6c 65 20 29 20 7b 0a 09 09 72 65 74 75 72  able ) {...retur
1ba60 6e 20 65 6c 65 6d 73 3b 0a 09 7d 0a 0a 09 2f 2f  n elems;..}...//
1ba70 20 47 65 74 73 0a 09 69 66 20 28 20 62 75 6c 6b   Gets..if ( bulk
1ba80 20 29 20 7b 0a 09 09 72 65 74 75 72 6e 20 66 6e   ) {...return fn
1ba90 2e 63 61 6c 6c 28 20 65 6c 65 6d 73 20 29 3b 0a  .call( elems );.
1baa0 09 7d 0a 0a 09 72 65 74 75 72 6e 20 6c 65 6e 20  .}...return len 
1bab0 3f 20 66 6e 28 20 65 6c 65 6d 73 5b 20 30 20 5d  ? fn( elems[ 0 ]
1bac0 2c 20 6b 65 79 20 29 20 3a 20 65 6d 70 74 79 47  , key ) : emptyG
1bad0 65 74 3b 0a 7d 3b 0a 0a 0a 2f 2f 20 4d 61 74 63  et;.};...// Matc
1bae0 68 65 73 20 64 61 73 68 65 64 20 73 74 72 69 6e  hes dashed strin
1baf0 67 20 66 6f 72 20 63 61 6d 65 6c 69 7a 69 6e 67  g for camelizing
1bb00 0a 76 61 72 20 72 6d 73 50 72 65 66 69 78 20 3d  .var rmsPrefix =
1bb10 20 2f 5e 2d 6d 73 2d 2f 2c 0a 09 72 64 61 73 68   /^-ms-/,..rdash
1bb20 41 6c 70 68 61 20 3d 20 2f 2d 28 5b 61 2d 7a 5d  Alpha = /-([a-z]
1bb30 29 2f 67 3b 0a 0a 2f 2f 20 55 73 65 64 20 62 79  )/g;..// Used by
1bb40 20 63 61 6d 65 6c 43 61 73 65 20 61 73 20 63 61   camelCase as ca
1bb50 6c 6c 62 61 63 6b 20 74 6f 20 72 65 70 6c 61 63  llback to replac
1bb60 65 28 29 0a 66 75 6e 63 74 69 6f 6e 20 66 63 61  e().function fca
1bb70 6d 65 6c 43 61 73 65 28 20 5f 61 6c 6c 2c 20 6c  melCase( _all, l
1bb80 65 74 74 65 72 20 29 20 7b 0a 09 72 65 74 75 72  etter ) {..retur
1bb90 6e 20 6c 65 74 74 65 72 2e 74 6f 55 70 70 65 72  n letter.toUpper
1bba0 43 61 73 65 28 29 3b 0a 7d 0a 0a 2f 2f 20 43 6f  Case();.}..// Co
1bbb0 6e 76 65 72 74 20 64 61 73 68 65 64 20 74 6f 20  nvert dashed to 
1bbc0 63 61 6d 65 6c 43 61 73 65 3b 20 75 73 65 64 20  camelCase; used 
1bbd0 62 79 20 74 68 65 20 63 73 73 20 61 6e 64 20 64  by the css and d
1bbe0 61 74 61 20 6d 6f 64 75 6c 65 73 0a 2f 2f 20 53  ata modules.// S
1bbf0 75 70 70 6f 72 74 3a 20 49 45 20 3c 3d 39 20 2d  upport: IE <=9 -
1bc00 20 31 31 2c 20 45 64 67 65 20 31 32 20 2d 20 31   11, Edge 12 - 1
1bc10 35 0a 2f 2f 20 4d 69 63 72 6f 73 6f 66 74 20 66  5.// Microsoft f
1bc20 6f 72 67 6f 74 20 74 6f 20 68 75 6d 70 20 74 68  orgot to hump th
1bc30 65 69 72 20 76 65 6e 64 6f 72 20 70 72 65 66 69  eir vendor prefi
1bc40 78 20 28 23 39 35 37 32 29 0a 66 75 6e 63 74 69  x (#9572).functi
1bc50 6f 6e 20 63 61 6d 65 6c 43 61 73 65 28 20 73 74  on camelCase( st
1bc60 72 69 6e 67 20 29 20 7b 0a 09 72 65 74 75 72 6e  ring ) {..return
1bc70 20 73 74 72 69 6e 67 2e 72 65 70 6c 61 63 65 28   string.replace(
1bc80 20 72 6d 73 50 72 65 66 69 78 2c 20 22 6d 73 2d   rmsPrefix, "ms-
1bc90 22 20 29 2e 72 65 70 6c 61 63 65 28 20 72 64 61  " ).replace( rda
1bca0 73 68 41 6c 70 68 61 2c 20 66 63 61 6d 65 6c 43  shAlpha, fcamelC
1bcb0 61 73 65 20 29 3b 0a 7d 0a 76 61 72 20 61 63 63  ase );.}.var acc
1bcc0 65 70 74 44 61 74 61 20 3d 20 66 75 6e 63 74 69  eptData = functi
1bcd0 6f 6e 28 20 6f 77 6e 65 72 20 29 20 7b 0a 0a 09  on( owner ) {...
1bce0 2f 2f 20 41 63 63 65 70 74 73 20 6f 6e 6c 79 3a  // Accepts only:
1bcf0 0a 09 2f 2f 20 20 2d 20 4e 6f 64 65 0a 09 2f 2f  ..//  - Node..//
1bd00 20 20 20 20 2d 20 4e 6f 64 65 2e 45 4c 45 4d 45      - Node.ELEME
1bd10 4e 54 5f 4e 4f 44 45 0a 09 2f 2f 20 20 20 20 2d  NT_NODE..//    -
1bd20 20 4e 6f 64 65 2e 44 4f 43 55 4d 45 4e 54 5f 4e   Node.DOCUMENT_N
1bd30 4f 44 45 0a 09 2f 2f 20 20 2d 20 4f 62 6a 65 63  ODE..//  - Objec
1bd40 74 0a 09 2f 2f 20 20 20 20 2d 20 41 6e 79 0a 09  t..//    - Any..
1bd50 72 65 74 75 72 6e 20 6f 77 6e 65 72 2e 6e 6f 64  return owner.nod
1bd60 65 54 79 70 65 20 3d 3d 3d 20 31 20 7c 7c 20 6f  eType === 1 || o
1bd70 77 6e 65 72 2e 6e 6f 64 65 54 79 70 65 20 3d 3d  wner.nodeType ==
1bd80 3d 20 39 20 7c 7c 20 21 28 20 2b 6f 77 6e 65 72  = 9 || !( +owner
1bd90 2e 6e 6f 64 65 54 79 70 65 20 29 3b 0a 7d 3b 0a  .nodeType );.};.
1bda0 0a 0a 0a 0a 66 75 6e 63 74 69 6f 6e 20 44 61 74  ....function Dat
1bdb0 61 28 29 20 7b 0a 09 74 68 69 73 2e 65 78 70 61  a() {..this.expa
1bdc0 6e 64 6f 20 3d 20 6a 51 75 65 72 79 2e 65 78 70  ndo = jQuery.exp
1bdd0 61 6e 64 6f 20 2b 20 44 61 74 61 2e 75 69 64 2b  ando + Data.uid+
1bde0 2b 3b 0a 7d 0a 0a 44 61 74 61 2e 75 69 64 20 3d  +;.}..Data.uid =
1bdf0 20 31 3b 0a 0a 44 61 74 61 2e 70 72 6f 74 6f 74   1;..Data.protot
1be00 79 70 65 20 3d 20 7b 0a 0a 09 63 61 63 68 65 3a  ype = {...cache:
1be10 20 66 75 6e 63 74 69 6f 6e 28 20 6f 77 6e 65 72   function( owner
1be20 20 29 20 7b 0a 0a 09 09 2f 2f 20 43 68 65 63 6b   ) {....// Check
1be30 20 69 66 20 74 68 65 20 6f 77 6e 65 72 20 6f 62   if the owner ob
1be40 6a 65 63 74 20 61 6c 72 65 61 64 79 20 68 61 73  ject already has
1be50 20 61 20 63 61 63 68 65 0a 09 09 76 61 72 20 76   a cache...var v
1be60 61 6c 75 65 20 3d 20 6f 77 6e 65 72 5b 20 74 68  alue = owner[ th
1be70 69 73 2e 65 78 70 61 6e 64 6f 20 5d 3b 0a 0a 09  is.expando ];...
1be80 09 2f 2f 20 49 66 20 6e 6f 74 2c 20 63 72 65 61  .// If not, crea
1be90 74 65 20 6f 6e 65 0a 09 09 69 66 20 28 20 21 76  te one...if ( !v
1bea0 61 6c 75 65 20 29 20 7b 0a 09 09 09 76 61 6c 75  alue ) {....valu
1beb0 65 20 3d 20 7b 7d 3b 0a 0a 09 09 09 2f 2f 20 57  e = {};.....// W
1bec0 65 20 63 61 6e 20 61 63 63 65 70 74 20 64 61 74  e can accept dat
1bed0 61 20 66 6f 72 20 6e 6f 6e 2d 65 6c 65 6d 65 6e  a for non-elemen
1bee0 74 20 6e 6f 64 65 73 20 69 6e 20 6d 6f 64 65 72  t nodes in moder
1bef0 6e 20 62 72 6f 77 73 65 72 73 2c 0a 09 09 09 2f  n browsers,..../
1bf00 2f 20 62 75 74 20 77 65 20 73 68 6f 75 6c 64 20  / but we should 
1bf10 6e 6f 74 2c 20 73 65 65 20 23 38 33 33 35 2e 0a  not, see #8335..
1bf20 09 09 09 2f 2f 20 41 6c 77 61 79 73 20 72 65 74  ...// Always ret
1bf30 75 72 6e 20 61 6e 20 65 6d 70 74 79 20 6f 62 6a  urn an empty obj
1bf40 65 63 74 2e 0a 09 09 09 69 66 20 28 20 61 63 63  ect.....if ( acc
1bf50 65 70 74 44 61 74 61 28 20 6f 77 6e 65 72 20 29  eptData( owner )
1bf60 20 29 20 7b 0a 0a 09 09 09 09 2f 2f 20 49 66 20   ) {......// If 
1bf70 69 74 20 69 73 20 61 20 6e 6f 64 65 20 75 6e 6c  it is a node unl
1bf80 69 6b 65 6c 79 20 74 6f 20 62 65 20 73 74 72 69  ikely to be stri
1bf90 6e 67 69 66 79 2d 65 64 20 6f 72 20 6c 6f 6f 70  ngify-ed or loop
1bfa0 65 64 20 6f 76 65 72 0a 09 09 09 09 2f 2f 20 75  ed over.....// u
1bfb0 73 65 20 70 6c 61 69 6e 20 61 73 73 69 67 6e 6d  se plain assignm
1bfc0 65 6e 74 0a 09 09 09 09 69 66 20 28 20 6f 77 6e  ent.....if ( own
1bfd0 65 72 2e 6e 6f 64 65 54 79 70 65 20 29 20 7b 0a  er.nodeType ) {.
1bfe0 09 09 09 09 09 6f 77 6e 65 72 5b 20 74 68 69 73  .....owner[ this
1bff0 2e 65 78 70 61 6e 64 6f 20 5d 20 3d 20 76 61 6c  .expando ] = val
1c000 75 65 3b 0a 0a 09 09 09 09 2f 2f 20 4f 74 68 65  ue;......// Othe
1c010 72 77 69 73 65 20 73 65 63 75 72 65 20 69 74 20  rwise secure it 
1c020 69 6e 20 61 20 6e 6f 6e 2d 65 6e 75 6d 65 72 61  in a non-enumera
1c030 62 6c 65 20 70 72 6f 70 65 72 74 79 0a 09 09 09  ble property....
1c040 09 2f 2f 20 63 6f 6e 66 69 67 75 72 61 62 6c 65  .// configurable
1c050 20 6d 75 73 74 20 62 65 20 74 72 75 65 20 74 6f   must be true to
1c060 20 61 6c 6c 6f 77 20 74 68 65 20 70 72 6f 70 65   allow the prope
1c070 72 74 79 20 74 6f 20 62 65 0a 09 09 09 09 2f 2f  rty to be.....//
1c080 20 64 65 6c 65 74 65 64 20 77 68 65 6e 20 64 61   deleted when da
1c090 74 61 20 69 73 20 72 65 6d 6f 76 65 64 0a 09 09  ta is removed...
1c0a0 09 09 7d 20 65 6c 73 65 20 7b 0a 09 09 09 09 09  ..} else {......
1c0b0 4f 62 6a 65 63 74 2e 64 65 66 69 6e 65 50 72 6f  Object.definePro
1c0c0 70 65 72 74 79 28 20 6f 77 6e 65 72 2c 20 74 68  perty( owner, th
1c0d0 69 73 2e 65 78 70 61 6e 64 6f 2c 20 7b 0a 09 09  is.expando, {...
1c0e0 09 09 09 09 76 61 6c 75 65 3a 20 76 61 6c 75 65  ....value: value
1c0f0 2c 0a 09 09 09 09 09 09 63 6f 6e 66 69 67 75 72  ,.......configur
1c100 61 62 6c 65 3a 20 74 72 75 65 0a 09 09 09 09 09  able: true......
1c110 7d 20 29 3b 0a 09 09 09 09 7d 0a 09 09 09 7d 0a  } );.....}....}.
1c120 09 09 7d 0a 0a 09 09 72 65 74 75 72 6e 20 76 61  ..}....return va
1c130 6c 75 65 3b 0a 09 7d 2c 0a 09 73 65 74 3a 20 66  lue;..},..set: f
1c140 75 6e 63 74 69 6f 6e 28 20 6f 77 6e 65 72 2c 20  unction( owner, 
1c150 64 61 74 61 2c 20 76 61 6c 75 65 20 29 20 7b 0a  data, value ) {.
1c160 09 09 76 61 72 20 70 72 6f 70 2c 0a 09 09 09 63  ..var prop,....c
1c170 61 63 68 65 20 3d 20 74 68 69 73 2e 63 61 63 68  ache = this.cach
1c180 65 28 20 6f 77 6e 65 72 20 29 3b 0a 0a 09 09 2f  e( owner );..../
1c190 2f 20 48 61 6e 64 6c 65 3a 20 5b 20 6f 77 6e 65  / Handle: [ owne
1c1a0 72 2c 20 6b 65 79 2c 20 76 61 6c 75 65 20 5d 20  r, key, value ] 
1c1b0 61 72 67 73 0a 09 09 2f 2f 20 41 6c 77 61 79 73  args...// Always
1c1c0 20 75 73 65 20 63 61 6d 65 6c 43 61 73 65 20 6b   use camelCase k
1c1d0 65 79 20 28 67 68 2d 32 32 35 37 29 0a 09 09 69  ey (gh-2257)...i
1c1e0 66 20 28 20 74 79 70 65 6f 66 20 64 61 74 61 20  f ( typeof data 
1c1f0 3d 3d 3d 20 22 73 74 72 69 6e 67 22 20 29 20 7b  === "string" ) {
1c200 0a 09 09 09 63 61 63 68 65 5b 20 63 61 6d 65 6c  ....cache[ camel
1c210 43 61 73 65 28 20 64 61 74 61 20 29 20 5d 20 3d  Case( data ) ] =
1c220 20 76 61 6c 75 65 3b 0a 0a 09 09 2f 2f 20 48 61   value;....// Ha
1c230 6e 64 6c 65 3a 20 5b 20 6f 77 6e 65 72 2c 20 7b  ndle: [ owner, {
1c240 20 70 72 6f 70 65 72 74 69 65 73 20 7d 20 5d 20   properties } ] 
1c250 61 72 67 73 0a 09 09 7d 20 65 6c 73 65 20 7b 0a  args...} else {.
1c260 0a 09 09 09 2f 2f 20 43 6f 70 79 20 74 68 65 20  ....// Copy the 
1c270 70 72 6f 70 65 72 74 69 65 73 20 6f 6e 65 2d 62  properties one-b
1c280 79 2d 6f 6e 65 20 74 6f 20 74 68 65 20 63 61 63  y-one to the cac
1c290 68 65 20 6f 62 6a 65 63 74 0a 09 09 09 66 6f 72  he object....for
1c2a0 20 28 20 70 72 6f 70 20 69 6e 20 64 61 74 61 20   ( prop in data 
1c2b0 29 20 7b 0a 09 09 09 09 63 61 63 68 65 5b 20 63  ) {.....cache[ c
1c2c0 61 6d 65 6c 43 61 73 65 28 20 70 72 6f 70 20 29  amelCase( prop )
1c2d0 20 5d 20 3d 20 64 61 74 61 5b 20 70 72 6f 70 20   ] = data[ prop 
1c2e0 5d 3b 0a 09 09 09 7d 0a 09 09 7d 0a 09 09 72 65  ];....}...}...re
1c2f0 74 75 72 6e 20 63 61 63 68 65 3b 0a 09 7d 2c 0a  turn cache;..},.
1c300 09 67 65 74 3a 20 66 75 6e 63 74 69 6f 6e 28 20  .get: function( 
1c310 6f 77 6e 65 72 2c 20 6b 65 79 20 29 20 7b 0a 09  owner, key ) {..
1c320 09 72 65 74 75 72 6e 20 6b 65 79 20 3d 3d 3d 20  .return key === 
1c330 75 6e 64 65 66 69 6e 65 64 20 3f 0a 09 09 09 74  undefined ?....t
1c340 68 69 73 2e 63 61 63 68 65 28 20 6f 77 6e 65 72  his.cache( owner
1c350 20 29 20 3a 0a 0a 09 09 09 2f 2f 20 41 6c 77 61   ) :.....// Alwa
1c360 79 73 20 75 73 65 20 63 61 6d 65 6c 43 61 73 65  ys use camelCase
1c370 20 6b 65 79 20 28 67 68 2d 32 32 35 37 29 0a 09   key (gh-2257)..
1c380 09 09 6f 77 6e 65 72 5b 20 74 68 69 73 2e 65 78  ..owner[ this.ex
1c390 70 61 6e 64 6f 20 5d 20 26 26 20 6f 77 6e 65 72  pando ] && owner
1c3a0 5b 20 74 68 69 73 2e 65 78 70 61 6e 64 6f 20 5d  [ this.expando ]
1c3b0 5b 20 63 61 6d 65 6c 43 61 73 65 28 20 6b 65 79  [ camelCase( key
1c3c0 20 29 20 5d 3b 0a 09 7d 2c 0a 09 61 63 63 65 73   ) ];..},..acces
1c3d0 73 3a 20 66 75 6e 63 74 69 6f 6e 28 20 6f 77 6e  s: function( own
1c3e0 65 72 2c 20 6b 65 79 2c 20 76 61 6c 75 65 20 29  er, key, value )
1c3f0 20 7b 0a 0a 09 09 2f 2f 20 49 6e 20 63 61 73 65   {....// In case
1c400 73 20 77 68 65 72 65 20 65 69 74 68 65 72 3a 0a  s where either:.
1c410 09 09 2f 2f 0a 09 09 2f 2f 20 20 20 31 2e 20 4e  ..//...//   1. N
1c420 6f 20 6b 65 79 20 77 61 73 20 73 70 65 63 69 66  o key was specif
1c430 69 65 64 0a 09 09 2f 2f 20 20 20 32 2e 20 41 20  ied...//   2. A 
1c440 73 74 72 69 6e 67 20 6b 65 79 20 77 61 73 20 73  string key was s
1c450 70 65 63 69 66 69 65 64 2c 20 62 75 74 20 6e 6f  pecified, but no
1c460 20 76 61 6c 75 65 20 70 72 6f 76 69 64 65 64 0a   value provided.
1c470 09 09 2f 2f 0a 09 09 2f 2f 20 54 61 6b 65 20 74  ..//...// Take t
1c480 68 65 20 22 72 65 61 64 22 20 70 61 74 68 20 61  he "read" path a
1c490 6e 64 20 61 6c 6c 6f 77 20 74 68 65 20 67 65 74  nd allow the get
1c4a0 20 6d 65 74 68 6f 64 20 74 6f 20 64 65 74 65 72   method to deter
1c4b0 6d 69 6e 65 0a 09 09 2f 2f 20 77 68 69 63 68 20  mine...// which 
1c4c0 76 61 6c 75 65 20 74 6f 20 72 65 74 75 72 6e 2c  value to return,
1c4d0 20 72 65 73 70 65 63 74 69 76 65 6c 79 20 65 69   respectively ei
1c4e0 74 68 65 72 3a 0a 09 09 2f 2f 0a 09 09 2f 2f 20  ther:...//...// 
1c4f0 20 20 31 2e 20 54 68 65 20 65 6e 74 69 72 65 20    1. The entire 
1c500 63 61 63 68 65 20 6f 62 6a 65 63 74 0a 09 09 2f  cache object.../
1c510 2f 20 20 20 32 2e 20 54 68 65 20 64 61 74 61 20  /   2. The data 
1c520 73 74 6f 72 65 64 20 61 74 20 74 68 65 20 6b 65  stored at the ke
1c530 79 0a 09 09 2f 2f 0a 09 09 69 66 20 28 20 6b 65  y...//...if ( ke
1c540 79 20 3d 3d 3d 20 75 6e 64 65 66 69 6e 65 64 20  y === undefined 
1c550 7c 7c 0a 09 09 09 09 28 20 28 20 6b 65 79 20 26  ||.....( ( key &
1c560 26 20 74 79 70 65 6f 66 20 6b 65 79 20 3d 3d 3d  & typeof key ===
1c570 20 22 73 74 72 69 6e 67 22 20 29 20 26 26 20 76   "string" ) && v
1c580 61 6c 75 65 20 3d 3d 3d 20 75 6e 64 65 66 69 6e  alue === undefin
1c590 65 64 20 29 20 29 20 7b 0a 0a 09 09 09 72 65 74  ed ) ) {.....ret
1c5a0 75 72 6e 20 74 68 69 73 2e 67 65 74 28 20 6f 77  urn this.get( ow
1c5b0 6e 65 72 2c 20 6b 65 79 20 29 3b 0a 09 09 7d 0a  ner, key );...}.
1c5c0 0a 09 09 2f 2f 20 57 68 65 6e 20 74 68 65 20 6b  ...// When the k
1c5d0 65 79 20 69 73 20 6e 6f 74 20 61 20 73 74 72 69  ey is not a stri
1c5e0 6e 67 2c 20 6f 72 20 62 6f 74 68 20 61 20 6b 65  ng, or both a ke
1c5f0 79 20 61 6e 64 20 76 61 6c 75 65 0a 09 09 2f 2f  y and value...//
1c600 20 61 72 65 20 73 70 65 63 69 66 69 65 64 2c 20   are specified, 
1c610 73 65 74 20 6f 72 20 65 78 74 65 6e 64 20 28 65  set or extend (e
1c620 78 69 73 74 69 6e 67 20 6f 62 6a 65 63 74 73 29  xisting objects)
1c630 20 77 69 74 68 20 65 69 74 68 65 72 3a 0a 09 09   with either:...
1c640 2f 2f 0a 09 09 2f 2f 20 20 20 31 2e 20 41 6e 20  //...//   1. An 
1c650 6f 62 6a 65 63 74 20 6f 66 20 70 72 6f 70 65 72  object of proper
1c660 74 69 65 73 0a 09 09 2f 2f 20 20 20 32 2e 20 41  ties...//   2. A
1c670 20 6b 65 79 20 61 6e 64 20 76 61 6c 75 65 0a 09   key and value..
1c680 09 2f 2f 0a 09 09 74 68 69 73 2e 73 65 74 28 20  .//...this.set( 
1c690 6f 77 6e 65 72 2c 20 6b 65 79 2c 20 76 61 6c 75  owner, key, valu
1c6a0 65 20 29 3b 0a 0a 09 09 2f 2f 20 53 69 6e 63 65  e );....// Since
1c6b0 20 74 68 65 20 22 73 65 74 22 20 70 61 74 68 20   the "set" path 
1c6c0 63 61 6e 20 68 61 76 65 20 74 77 6f 20 70 6f 73  can have two pos
1c6d0 73 69 62 6c 65 20 65 6e 74 72 79 20 70 6f 69 6e  sible entry poin
1c6e0 74 73 0a 09 09 2f 2f 20 72 65 74 75 72 6e 20 74  ts...// return t
1c6f0 68 65 20 65 78 70 65 63 74 65 64 20 64 61 74 61  he expected data
1c700 20 62 61 73 65 64 20 6f 6e 20 77 68 69 63 68 20   based on which 
1c710 70 61 74 68 20 77 61 73 20 74 61 6b 65 6e 5b 2a  path was taken[*
1c720 5d 0a 09 09 72 65 74 75 72 6e 20 76 61 6c 75 65  ]...return value
1c730 20 21 3d 3d 20 75 6e 64 65 66 69 6e 65 64 20 3f   !== undefined ?
1c740 20 76 61 6c 75 65 20 3a 20 6b 65 79 3b 0a 09 7d   value : key;..}
1c750 2c 0a 09 72 65 6d 6f 76 65 3a 20 66 75 6e 63 74  ,..remove: funct
1c760 69 6f 6e 28 20 6f 77 6e 65 72 2c 20 6b 65 79 20  ion( owner, key 
1c770 29 20 7b 0a 09 09 76 61 72 20 69 2c 0a 09 09 09  ) {...var i,....
1c780 63 61 63 68 65 20 3d 20 6f 77 6e 65 72 5b 20 74  cache = owner[ t
1c790 68 69 73 2e 65 78 70 61 6e 64 6f 20 5d 3b 0a 0a  his.expando ];..
1c7a0 09 09 69 66 20 28 20 63 61 63 68 65 20 3d 3d 3d  ..if ( cache ===
1c7b0 20 75 6e 64 65 66 69 6e 65 64 20 29 20 7b 0a 09   undefined ) {..
1c7c0 09 09 72 65 74 75 72 6e 3b 0a 09 09 7d 0a 0a 09  ..return;...}...
1c7d0 09 69 66 20 28 20 6b 65 79 20 21 3d 3d 20 75 6e  .if ( key !== un
1c7e0 64 65 66 69 6e 65 64 20 29 20 7b 0a 0a 09 09 09  defined ) {.....
1c7f0 2f 2f 20 53 75 70 70 6f 72 74 20 61 72 72 61 79  // Support array
1c800 20 6f 72 20 73 70 61 63 65 20 73 65 70 61 72 61   or space separa
1c810 74 65 64 20 73 74 72 69 6e 67 20 6f 66 20 6b 65  ted string of ke
1c820 79 73 0a 09 09 09 69 66 20 28 20 41 72 72 61 79  ys....if ( Array
1c830 2e 69 73 41 72 72 61 79 28 20 6b 65 79 20 29 20  .isArray( key ) 
1c840 29 20 7b 0a 0a 09 09 09 09 2f 2f 20 49 66 20 6b  ) {......// If k
1c850 65 79 20 69 73 20 61 6e 20 61 72 72 61 79 20 6f  ey is an array o
1c860 66 20 6b 65 79 73 2e 2e 2e 0a 09 09 09 09 2f 2f  f keys........//
1c870 20 57 65 20 61 6c 77 61 79 73 20 73 65 74 20 63   We always set c
1c880 61 6d 65 6c 43 61 73 65 20 6b 65 79 73 2c 20 73  amelCase keys, s
1c890 6f 20 72 65 6d 6f 76 65 20 74 68 61 74 2e 0a 09  o remove that...
1c8a0 09 09 09 6b 65 79 20 3d 20 6b 65 79 2e 6d 61 70  ...key = key.map
1c8b0 28 20 63 61 6d 65 6c 43 61 73 65 20 29 3b 0a 09  ( camelCase );..
1c8c0 09 09 7d 20 65 6c 73 65 20 7b 0a 09 09 09 09 6b  ..} else {.....k
1c8d0 65 79 20 3d 20 63 61 6d 65 6c 43 61 73 65 28 20  ey = camelCase( 
1c8e0 6b 65 79 20 29 3b 0a 0a 09 09 09 09 2f 2f 20 49  key );......// I
1c8f0 66 20 61 20 6b 65 79 20 77 69 74 68 20 74 68 65  f a key with the
1c900 20 73 70 61 63 65 73 20 65 78 69 73 74 73 2c 20   spaces exists, 
1c910 75 73 65 20 69 74 2e 0a 09 09 09 09 2f 2f 20 4f  use it......// O
1c920 74 68 65 72 77 69 73 65 2c 20 63 72 65 61 74 65  therwise, create
1c930 20 61 6e 20 61 72 72 61 79 20 62 79 20 6d 61 74   an array by mat
1c940 63 68 69 6e 67 20 6e 6f 6e 2d 77 68 69 74 65 73  ching non-whites
1c950 70 61 63 65 0a 09 09 09 09 6b 65 79 20 3d 20 6b  pace.....key = k
1c960 65 79 20 69 6e 20 63 61 63 68 65 20 3f 0a 09 09  ey in cache ?...
1c970 09 09 09 5b 20 6b 65 79 20 5d 20 3a 0a 09 09 09  ...[ key ] :....
1c980 09 09 28 20 6b 65 79 2e 6d 61 74 63 68 28 20 72  ..( key.match( r
1c990 6e 6f 74 68 74 6d 6c 77 68 69 74 65 20 29 20 7c  nothtmlwhite ) |
1c9a0 7c 20 5b 5d 20 29 3b 0a 09 09 09 7d 0a 0a 09 09  | [] );....}....
1c9b0 09 69 20 3d 20 6b 65 79 2e 6c 65 6e 67 74 68 3b  .i = key.length;
1c9c0 0a 0a 09 09 09 77 68 69 6c 65 20 28 20 69 2d 2d  .....while ( i--
1c9d0 20 29 20 7b 0a 09 09 09 09 64 65 6c 65 74 65 20   ) {.....delete 
1c9e0 63 61 63 68 65 5b 20 6b 65 79 5b 20 69 20 5d 20  cache[ key[ i ] 
1c9f0 5d 3b 0a 09 09 09 7d 0a 09 09 7d 0a 0a 09 09 2f  ];....}...}..../
1ca00 2f 20 52 65 6d 6f 76 65 20 74 68 65 20 65 78 70  / Remove the exp
1ca10 61 6e 64 6f 20 69 66 20 74 68 65 72 65 27 73 20  ando if there's 
1ca20 6e 6f 20 6d 6f 72 65 20 64 61 74 61 0a 09 09 69  no more data...i
1ca30 66 20 28 20 6b 65 79 20 3d 3d 3d 20 75 6e 64 65  f ( key === unde
1ca40 66 69 6e 65 64 20 7c 7c 20 6a 51 75 65 72 79 2e  fined || jQuery.
1ca50 69 73 45 6d 70 74 79 4f 62 6a 65 63 74 28 20 63  isEmptyObject( c
1ca60 61 63 68 65 20 29 20 29 20 7b 0a 0a 09 09 09 2f  ache ) ) {...../
1ca70 2f 20 53 75 70 70 6f 72 74 3a 20 43 68 72 6f 6d  / Support: Chrom
1ca80 65 20 3c 3d 33 35 20 2d 20 34 35 0a 09 09 09 2f  e <=35 - 45..../
1ca90 2f 20 57 65 62 6b 69 74 20 26 20 42 6c 69 6e 6b  / Webkit & Blink
1caa0 20 70 65 72 66 6f 72 6d 61 6e 63 65 20 73 75 66   performance suf
1cab0 66 65 72 73 20 77 68 65 6e 20 64 65 6c 65 74 69  fers when deleti
1cac0 6e 67 20 70 72 6f 70 65 72 74 69 65 73 0a 09 09  ng properties...
1cad0 09 2f 2f 20 66 72 6f 6d 20 44 4f 4d 20 6e 6f 64  .// from DOM nod
1cae0 65 73 2c 20 73 6f 20 73 65 74 20 74 6f 20 75 6e  es, so set to un
1caf0 64 65 66 69 6e 65 64 20 69 6e 73 74 65 61 64 0a  defined instead.
1cb00 09 09 09 2f 2f 20 68 74 74 70 73 3a 2f 2f 62 75  ...// https://bu
1cb10 67 73 2e 63 68 72 6f 6d 69 75 6d 2e 6f 72 67 2f  gs.chromium.org/
1cb20 70 2f 63 68 72 6f 6d 69 75 6d 2f 69 73 73 75 65  p/chromium/issue
1cb30 73 2f 64 65 74 61 69 6c 3f 69 64 3d 33 37 38 36  s/detail?id=3786
1cb40 30 37 20 28 62 75 67 20 72 65 73 74 72 69 63 74  07 (bug restrict
1cb50 65 64 29 0a 09 09 09 69 66 20 28 20 6f 77 6e 65  ed)....if ( owne
1cb60 72 2e 6e 6f 64 65 54 79 70 65 20 29 20 7b 0a 09  r.nodeType ) {..
1cb70 09 09 09 6f 77 6e 65 72 5b 20 74 68 69 73 2e 65  ...owner[ this.e
1cb80 78 70 61 6e 64 6f 20 5d 20 3d 20 75 6e 64 65 66  xpando ] = undef
1cb90 69 6e 65 64 3b 0a 09 09 09 7d 20 65 6c 73 65 20  ined;....} else 
1cba0 7b 0a 09 09 09 09 64 65 6c 65 74 65 20 6f 77 6e  {.....delete own
1cbb0 65 72 5b 20 74 68 69 73 2e 65 78 70 61 6e 64 6f  er[ this.expando
1cbc0 20 5d 3b 0a 09 09 09 7d 0a 09 09 7d 0a 09 7d 2c   ];....}...}..},
1cbd0 0a 09 68 61 73 44 61 74 61 3a 20 66 75 6e 63 74  ..hasData: funct
1cbe0 69 6f 6e 28 20 6f 77 6e 65 72 20 29 20 7b 0a 09  ion( owner ) {..
1cbf0 09 76 61 72 20 63 61 63 68 65 20 3d 20 6f 77 6e  .var cache = own
1cc00 65 72 5b 20 74 68 69 73 2e 65 78 70 61 6e 64 6f  er[ this.expando
1cc10 20 5d 3b 0a 09 09 72 65 74 75 72 6e 20 63 61 63   ];...return cac
1cc20 68 65 20 21 3d 3d 20 75 6e 64 65 66 69 6e 65 64  he !== undefined
1cc30 20 26 26 20 21 6a 51 75 65 72 79 2e 69 73 45 6d   && !jQuery.isEm
1cc40 70 74 79 4f 62 6a 65 63 74 28 20 63 61 63 68 65  ptyObject( cache
1cc50 20 29 3b 0a 09 7d 0a 7d 3b 0a 76 61 72 20 64 61   );..}.};.var da
1cc60 74 61 50 72 69 76 20 3d 20 6e 65 77 20 44 61 74  taPriv = new Dat
1cc70 61 28 29 3b 0a 0a 76 61 72 20 64 61 74 61 55 73  a();..var dataUs
1cc80 65 72 20 3d 20 6e 65 77 20 44 61 74 61 28 29 3b  er = new Data();
1cc90 0a 0a 0a 0a 2f 2f 09 49 6d 70 6c 65 6d 65 6e 74  ....//.Implement
1cca0 61 74 69 6f 6e 20 53 75 6d 6d 61 72 79 0a 2f 2f  ation Summary.//
1ccb0 0a 2f 2f 09 31 2e 20 45 6e 66 6f 72 63 65 20 41  .//.1. Enforce A
1ccc0 50 49 20 73 75 72 66 61 63 65 20 61 6e 64 20 73  PI surface and s
1ccd0 65 6d 61 6e 74 69 63 20 63 6f 6d 70 61 74 69 62  emantic compatib
1cce0 69 6c 69 74 79 20 77 69 74 68 20 31 2e 39 2e 78  ility with 1.9.x
1ccf0 20 62 72 61 6e 63 68 0a 2f 2f 09 32 2e 20 49 6d   branch.//.2. Im
1cd00 70 72 6f 76 65 20 74 68 65 20 6d 6f 64 75 6c 65  prove the module
1cd10 27 73 20 6d 61 69 6e 74 61 69 6e 61 62 69 6c 69  's maintainabili
1cd20 74 79 20 62 79 20 72 65 64 75 63 69 6e 67 20 74  ty by reducing t
1cd30 68 65 20 73 74 6f 72 61 67 65 0a 2f 2f 09 09 70  he storage.//..p
1cd40 61 74 68 73 20 74 6f 20 61 20 73 69 6e 67 6c 65  aths to a single
1cd50 20 6d 65 63 68 61 6e 69 73 6d 2e 0a 2f 2f 09 33   mechanism..//.3
1cd60 2e 20 55 73 65 20 74 68 65 20 73 61 6d 65 20 73  . Use the same s
1cd70 69 6e 67 6c 65 20 6d 65 63 68 61 6e 69 73 6d 20  ingle mechanism 
1cd80 74 6f 20 73 75 70 70 6f 72 74 20 22 70 72 69 76  to support "priv
1cd90 61 74 65 22 20 61 6e 64 20 22 75 73 65 72 22 20  ate" and "user" 
1cda0 64 61 74 61 2e 0a 2f 2f 09 34 2e 20 5f 4e 65 76  data..//.4. _Nev
1cdb0 65 72 5f 20 65 78 70 6f 73 65 20 22 70 72 69 76  er_ expose "priv
1cdc0 61 74 65 22 20 64 61 74 61 20 74 6f 20 75 73 65  ate" data to use
1cdd0 72 20 63 6f 64 65 20 28 54 4f 44 4f 3a 20 44 72  r code (TODO: Dr
1cde0 6f 70 20 5f 64 61 74 61 2c 20 5f 72 65 6d 6f 76  op _data, _remov
1cdf0 65 44 61 74 61 29 0a 2f 2f 09 35 2e 20 41 76 6f  eData).//.5. Avo
1ce00 69 64 20 65 78 70 6f 73 69 6e 67 20 69 6d 70 6c  id exposing impl
1ce10 65 6d 65 6e 74 61 74 69 6f 6e 20 64 65 74 61 69  ementation detai
1ce20 6c 73 20 6f 6e 20 75 73 65 72 20 6f 62 6a 65 63  ls on user objec
1ce30 74 73 20 28 65 67 2e 20 65 78 70 61 6e 64 6f 20  ts (eg. expando 
1ce40 70 72 6f 70 65 72 74 69 65 73 29 0a 2f 2f 09 36  properties).//.6
1ce50 2e 20 50 72 6f 76 69 64 65 20 61 20 63 6c 65 61  . Provide a clea
1ce60 72 20 70 61 74 68 20 66 6f 72 20 69 6d 70 6c 65  r path for imple
1ce70 6d 65 6e 74 61 74 69 6f 6e 20 75 70 67 72 61 64  mentation upgrad
1ce80 65 20 74 6f 20 57 65 61 6b 4d 61 70 20 69 6e 20  e to WeakMap in 
1ce90 32 30 31 34 0a 0a 76 61 72 20 72 62 72 61 63 65  2014..var rbrace
1cea0 20 3d 20 2f 5e 28 3f 3a 5c 7b 5b 5c 77 5c 57 5d   = /^(?:\{[\w\W]
1ceb0 2a 5c 7d 7c 5c 5b 5b 5c 77 5c 57 5d 2a 5c 5d 29  *\}|\[[\w\W]*\])
1cec0 24 2f 2c 0a 09 72 6d 75 6c 74 69 44 61 73 68 20  $/,..rmultiDash 
1ced0 3d 20 2f 5b 41 2d 5a 5d 2f 67 3b 0a 0a 66 75 6e  = /[A-Z]/g;..fun
1cee0 63 74 69 6f 6e 20 67 65 74 44 61 74 61 28 20 64  ction getData( d
1cef0 61 74 61 20 29 20 7b 0a 09 69 66 20 28 20 64 61  ata ) {..if ( da
1cf00 74 61 20 3d 3d 3d 20 22 74 72 75 65 22 20 29 20  ta === "true" ) 
1cf10 7b 0a 09 09 72 65 74 75 72 6e 20 74 72 75 65 3b  {...return true;
1cf20 0a 09 7d 0a 0a 09 69 66 20 28 20 64 61 74 61 20  ..}...if ( data 
1cf30 3d 3d 3d 20 22 66 61 6c 73 65 22 20 29 20 7b 0a  === "false" ) {.
1cf40 09 09 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0a  ..return false;.
1cf50 09 7d 0a 0a 09 69 66 20 28 20 64 61 74 61 20 3d  .}...if ( data =
1cf60 3d 3d 20 22 6e 75 6c 6c 22 20 29 20 7b 0a 09 09  == "null" ) {...
1cf70 72 65 74 75 72 6e 20 6e 75 6c 6c 3b 0a 09 7d 0a  return null;..}.
1cf80 0a 09 2f 2f 20 4f 6e 6c 79 20 63 6f 6e 76 65 72  ..// Only conver
1cf90 74 20 74 6f 20 61 20 6e 75 6d 62 65 72 20 69 66  t to a number if
1cfa0 20 69 74 20 64 6f 65 73 6e 27 74 20 63 68 61 6e   it doesn't chan
1cfb0 67 65 20 74 68 65 20 73 74 72 69 6e 67 0a 09 69  ge the string..i
1cfc0 66 20 28 20 64 61 74 61 20 3d 3d 3d 20 2b 64 61  f ( data === +da
1cfd0 74 61 20 2b 20 22 22 20 29 20 7b 0a 09 09 72 65  ta + "" ) {...re
1cfe0 74 75 72 6e 20 2b 64 61 74 61 3b 0a 09 7d 0a 0a  turn +data;..}..
1cff0 09 69 66 20 28 20 72 62 72 61 63 65 2e 74 65 73  .if ( rbrace.tes
1d000 74 28 20 64 61 74 61 20 29 20 29 20 7b 0a 09 09  t( data ) ) {...
1d010 72 65 74 75 72 6e 20 4a 53 4f 4e 2e 70 61 72 73  return JSON.pars
1d020 65 28 20 64 61 74 61 20 29 3b 0a 09 7d 0a 0a 09  e( data );..}...
1d030 72 65 74 75 72 6e 20 64 61 74 61 3b 0a 7d 0a 0a  return data;.}..
1d040 66 75 6e 63 74 69 6f 6e 20 64 61 74 61 41 74 74  function dataAtt
1d050 72 28 20 65 6c 65 6d 2c 20 6b 65 79 2c 20 64 61  r( elem, key, da
1d060 74 61 20 29 20 7b 0a 09 76 61 72 20 6e 61 6d 65  ta ) {..var name
1d070 3b 0a 0a 09 2f 2f 20 49 66 20 6e 6f 74 68 69 6e  ;...// If nothin
1d080 67 20 77 61 73 20 66 6f 75 6e 64 20 69 6e 74 65  g was found inte
1d090 72 6e 61 6c 6c 79 2c 20 74 72 79 20 74 6f 20 66  rnally, try to f
1d0a0 65 74 63 68 20 61 6e 79 0a 09 2f 2f 20 64 61 74  etch any..// dat
1d0b0 61 20 66 72 6f 6d 20 74 68 65 20 48 54 4d 4c 35  a from the HTML5
1d0c0 20 64 61 74 61 2d 2a 20 61 74 74 72 69 62 75 74   data-* attribut
1d0d0 65 0a 09 69 66 20 28 20 64 61 74 61 20 3d 3d 3d  e..if ( data ===
1d0e0 20 75 6e 64 65 66 69 6e 65 64 20 26 26 20 65 6c   undefined && el
1d0f0 65 6d 2e 6e 6f 64 65 54 79 70 65 20 3d 3d 3d 20  em.nodeType === 
1d100 31 20 29 20 7b 0a 09 09 6e 61 6d 65 20 3d 20 22  1 ) {...name = "
1d110 64 61 74 61 2d 22 20 2b 20 6b 65 79 2e 72 65 70  data-" + key.rep
1d120 6c 61 63 65 28 20 72 6d 75 6c 74 69 44 61 73 68  lace( rmultiDash
1d130 2c 20 22 2d 24 26 22 20 29 2e 74 6f 4c 6f 77 65  , "-$&" ).toLowe
1d140 72 43 61 73 65 28 29 3b 0a 09 09 64 61 74 61 20  rCase();...data 
1d150 3d 20 65 6c 65 6d 2e 67 65 74 41 74 74 72 69 62  = elem.getAttrib
1d160 75 74 65 28 20 6e 61 6d 65 20 29 3b 0a 0a 09 09  ute( name );....
1d170 69 66 20 28 20 74 79 70 65 6f 66 20 64 61 74 61  if ( typeof data
1d180 20 3d 3d 3d 20 22 73 74 72 69 6e 67 22 20 29 20   === "string" ) 
1d190 7b 0a 09 09 09 74 72 79 20 7b 0a 09 09 09 09 64  {....try {.....d
1d1a0 61 74 61 20 3d 20 67 65 74 44 61 74 61 28 20 64  ata = getData( d
1d1b0 61 74 61 20 29 3b 0a 09 09 09 7d 20 63 61 74 63  ata );....} catc
1d1c0 68 20 28 20 65 20 29 20 7b 7d 0a 0a 09 09 09 2f  h ( e ) {}...../
1d1d0 2f 20 4d 61 6b 65 20 73 75 72 65 20 77 65 20 73  / Make sure we s
1d1e0 65 74 20 74 68 65 20 64 61 74 61 20 73 6f 20 69  et the data so i
1d1f0 74 20 69 73 6e 27 74 20 63 68 61 6e 67 65 64 20  t isn't changed 
1d200 6c 61 74 65 72 0a 09 09 09 64 61 74 61 55 73 65  later....dataUse
1d210 72 2e 73 65 74 28 20 65 6c 65 6d 2c 20 6b 65 79  r.set( elem, key
1d220 2c 20 64 61 74 61 20 29 3b 0a 09 09 7d 20 65 6c  , data );...} el
1d230 73 65 20 7b 0a 09 09 09 64 61 74 61 20 3d 20 75  se {....data = u
1d240 6e 64 65 66 69 6e 65 64 3b 0a 09 09 7d 0a 09 7d  ndefined;...}..}
1d250 0a 09 72 65 74 75 72 6e 20 64 61 74 61 3b 0a 7d  ..return data;.}
1d260 0a 0a 6a 51 75 65 72 79 2e 65 78 74 65 6e 64 28  ..jQuery.extend(
1d270 20 7b 0a 09 68 61 73 44 61 74 61 3a 20 66 75 6e   {..hasData: fun
1d280 63 74 69 6f 6e 28 20 65 6c 65 6d 20 29 20 7b 0a  ction( elem ) {.
1d290 09 09 72 65 74 75 72 6e 20 64 61 74 61 55 73 65  ..return dataUse
1d2a0 72 2e 68 61 73 44 61 74 61 28 20 65 6c 65 6d 20  r.hasData( elem 
1d2b0 29 20 7c 7c 20 64 61 74 61 50 72 69 76 2e 68 61  ) || dataPriv.ha
1d2c0 73 44 61 74 61 28 20 65 6c 65 6d 20 29 3b 0a 09  sData( elem );..
1d2d0 7d 2c 0a 0a 09 64 61 74 61 3a 20 66 75 6e 63 74  },...data: funct
1d2e0 69 6f 6e 28 20 65 6c 65 6d 2c 20 6e 61 6d 65 2c  ion( elem, name,
1d2f0 20 64 61 74 61 20 29 20 7b 0a 09 09 72 65 74 75   data ) {...retu
1d300 72 6e 20 64 61 74 61 55 73 65 72 2e 61 63 63 65  rn dataUser.acce
1d310 73 73 28 20 65 6c 65 6d 2c 20 6e 61 6d 65 2c 20  ss( elem, name, 
1d320 64 61 74 61 20 29 3b 0a 09 7d 2c 0a 0a 09 72 65  data );..},...re
1d330 6d 6f 76 65 44 61 74 61 3a 20 66 75 6e 63 74 69  moveData: functi
1d340 6f 6e 28 20 65 6c 65 6d 2c 20 6e 61 6d 65 20 29  on( elem, name )
1d350 20 7b 0a 09 09 64 61 74 61 55 73 65 72 2e 72 65   {...dataUser.re
1d360 6d 6f 76 65 28 20 65 6c 65 6d 2c 20 6e 61 6d 65  move( elem, name
1d370 20 29 3b 0a 09 7d 2c 0a 0a 09 2f 2f 20 54 4f 44   );..},...// TOD
1d380 4f 3a 20 4e 6f 77 20 74 68 61 74 20 61 6c 6c 20  O: Now that all 
1d390 63 61 6c 6c 73 20 74 6f 20 5f 64 61 74 61 20 61  calls to _data a
1d3a0 6e 64 20 5f 72 65 6d 6f 76 65 44 61 74 61 20 68  nd _removeData h
1d3b0 61 76 65 20 62 65 65 6e 20 72 65 70 6c 61 63 65  ave been replace
1d3c0 64 0a 09 2f 2f 20 77 69 74 68 20 64 69 72 65 63  d..// with direc
1d3d0 74 20 63 61 6c 6c 73 20 74 6f 20 64 61 74 61 50  t calls to dataP
1d3e0 72 69 76 20 6d 65 74 68 6f 64 73 2c 20 74 68 65  riv methods, the
1d3f0 73 65 20 63 61 6e 20 62 65 20 64 65 70 72 65 63  se can be deprec
1d400 61 74 65 64 2e 0a 09 5f 64 61 74 61 3a 20 66 75  ated..._data: fu
1d410 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 2c 20 6e 61  nction( elem, na
1d420 6d 65 2c 20 64 61 74 61 20 29 20 7b 0a 09 09 72  me, data ) {...r
1d430 65 74 75 72 6e 20 64 61 74 61 50 72 69 76 2e 61  eturn dataPriv.a
1d440 63 63 65 73 73 28 20 65 6c 65 6d 2c 20 6e 61 6d  ccess( elem, nam
1d450 65 2c 20 64 61 74 61 20 29 3b 0a 09 7d 2c 0a 0a  e, data );..},..
1d460 09 5f 72 65 6d 6f 76 65 44 61 74 61 3a 20 66 75  ._removeData: fu
1d470 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 2c 20 6e 61  nction( elem, na
1d480 6d 65 20 29 20 7b 0a 09 09 64 61 74 61 50 72 69  me ) {...dataPri
1d490 76 2e 72 65 6d 6f 76 65 28 20 65 6c 65 6d 2c 20  v.remove( elem, 
1d4a0 6e 61 6d 65 20 29 3b 0a 09 7d 0a 7d 20 29 3b 0a  name );..}.} );.
1d4b0 0a 6a 51 75 65 72 79 2e 66 6e 2e 65 78 74 65 6e  .jQuery.fn.exten
1d4c0 64 28 20 7b 0a 09 64 61 74 61 3a 20 66 75 6e 63  d( {..data: func
1d4d0 74 69 6f 6e 28 20 6b 65 79 2c 20 76 61 6c 75 65  tion( key, value
1d4e0 20 29 20 7b 0a 09 09 76 61 72 20 69 2c 20 6e 61   ) {...var i, na
1d4f0 6d 65 2c 20 64 61 74 61 2c 0a 09 09 09 65 6c 65  me, data,....ele
1d500 6d 20 3d 20 74 68 69 73 5b 20 30 20 5d 2c 0a 09  m = this[ 0 ],..
1d510 09 09 61 74 74 72 73 20 3d 20 65 6c 65 6d 20 26  ..attrs = elem &
1d520 26 20 65 6c 65 6d 2e 61 74 74 72 69 62 75 74 65  & elem.attribute
1d530 73 3b 0a 0a 09 09 2f 2f 20 47 65 74 73 20 61 6c  s;....// Gets al
1d540 6c 20 76 61 6c 75 65 73 0a 09 09 69 66 20 28 20  l values...if ( 
1d550 6b 65 79 20 3d 3d 3d 20 75 6e 64 65 66 69 6e 65  key === undefine
1d560 64 20 29 20 7b 0a 09 09 09 69 66 20 28 20 74 68  d ) {....if ( th
1d570 69 73 2e 6c 65 6e 67 74 68 20 29 20 7b 0a 09 09  is.length ) {...
1d580 09 09 64 61 74 61 20 3d 20 64 61 74 61 55 73 65  ..data = dataUse
1d590 72 2e 67 65 74 28 20 65 6c 65 6d 20 29 3b 0a 0a  r.get( elem );..
1d5a0 09 09 09 09 69 66 20 28 20 65 6c 65 6d 2e 6e 6f  ....if ( elem.no
1d5b0 64 65 54 79 70 65 20 3d 3d 3d 20 31 20 26 26 20  deType === 1 && 
1d5c0 21 64 61 74 61 50 72 69 76 2e 67 65 74 28 20 65  !dataPriv.get( e
1d5d0 6c 65 6d 2c 20 22 68 61 73 44 61 74 61 41 74 74  lem, "hasDataAtt
1d5e0 72 73 22 20 29 20 29 20 7b 0a 09 09 09 09 09 69  rs" ) ) {......i
1d5f0 20 3d 20 61 74 74 72 73 2e 6c 65 6e 67 74 68 3b   = attrs.length;
1d600 0a 09 09 09 09 09 77 68 69 6c 65 20 28 20 69 2d  ......while ( i-
1d610 2d 20 29 20 7b 0a 0a 09 09 09 09 09 09 2f 2f 20  - ) {........// 
1d620 53 75 70 70 6f 72 74 3a 20 49 45 20 31 31 20 6f  Support: IE 11 o
1d630 6e 6c 79 0a 09 09 09 09 09 09 2f 2f 20 54 68 65  nly.......// The
1d640 20 61 74 74 72 73 20 65 6c 65 6d 65 6e 74 73 20   attrs elements 
1d650 63 61 6e 20 62 65 20 6e 75 6c 6c 20 28 23 31 34  can be null (#14
1d660 38 39 34 29 0a 09 09 09 09 09 09 69 66 20 28 20  894).......if ( 
1d670 61 74 74 72 73 5b 20 69 20 5d 20 29 20 7b 0a 09  attrs[ i ] ) {..
1d680 09 09 09 09 09 09 6e 61 6d 65 20 3d 20 61 74 74  ......name = att
1d690 72 73 5b 20 69 20 5d 2e 6e 61 6d 65 3b 0a 09 09  rs[ i ].name;...
1d6a0 09 09 09 09 09 69 66 20 28 20 6e 61 6d 65 2e 69  .....if ( name.i
1d6b0 6e 64 65 78 4f 66 28 20 22 64 61 74 61 2d 22 20  ndexOf( "data-" 
1d6c0 29 20 3d 3d 3d 20 30 20 29 20 7b 0a 09 09 09 09  ) === 0 ) {.....
1d6d0 09 09 09 09 6e 61 6d 65 20 3d 20 63 61 6d 65 6c  ....name = camel
1d6e0 43 61 73 65 28 20 6e 61 6d 65 2e 73 6c 69 63 65  Case( name.slice
1d6f0 28 20 35 20 29 20 29 3b 0a 09 09 09 09 09 09 09  ( 5 ) );........
1d700 09 64 61 74 61 41 74 74 72 28 20 65 6c 65 6d 2c  .dataAttr( elem,
1d710 20 6e 61 6d 65 2c 20 64 61 74 61 5b 20 6e 61 6d   name, data[ nam
1d720 65 20 5d 20 29 3b 0a 09 09 09 09 09 09 09 7d 0a  e ] );........}.
1d730 09 09 09 09 09 09 7d 0a 09 09 09 09 09 7d 0a 09  ......}......}..
1d740 09 09 09 09 64 61 74 61 50 72 69 76 2e 73 65 74  ....dataPriv.set
1d750 28 20 65 6c 65 6d 2c 20 22 68 61 73 44 61 74 61  ( elem, "hasData
1d760 41 74 74 72 73 22 2c 20 74 72 75 65 20 29 3b 0a  Attrs", true );.
1d770 09 09 09 09 7d 0a 09 09 09 7d 0a 0a 09 09 09 72  ....}....}.....r
1d780 65 74 75 72 6e 20 64 61 74 61 3b 0a 09 09 7d 0a  eturn data;...}.
1d790 0a 09 09 2f 2f 20 53 65 74 73 20 6d 75 6c 74 69  ...// Sets multi
1d7a0 70 6c 65 20 76 61 6c 75 65 73 0a 09 09 69 66 20  ple values...if 
1d7b0 28 20 74 79 70 65 6f 66 20 6b 65 79 20 3d 3d 3d  ( typeof key ===
1d7c0 20 22 6f 62 6a 65 63 74 22 20 29 20 7b 0a 09 09   "object" ) {...
1d7d0 09 72 65 74 75 72 6e 20 74 68 69 73 2e 65 61 63  .return this.eac
1d7e0 68 28 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a  h( function() {.
1d7f0 09 09 09 09 64 61 74 61 55 73 65 72 2e 73 65 74  ....dataUser.set
1d800 28 20 74 68 69 73 2c 20 6b 65 79 20 29 3b 0a 09  ( this, key );..
1d810 09 09 7d 20 29 3b 0a 09 09 7d 0a 0a 09 09 72 65  ..} );...}....re
1d820 74 75 72 6e 20 61 63 63 65 73 73 28 20 74 68 69  turn access( thi
1d830 73 2c 20 66 75 6e 63 74 69 6f 6e 28 20 76 61 6c  s, function( val
1d840 75 65 20 29 20 7b 0a 09 09 09 76 61 72 20 64 61  ue ) {....var da
1d850 74 61 3b 0a 0a 09 09 09 2f 2f 20 54 68 65 20 63  ta;.....// The c
1d860 61 6c 6c 69 6e 67 20 6a 51 75 65 72 79 20 6f 62  alling jQuery ob
1d870 6a 65 63 74 20 28 65 6c 65 6d 65 6e 74 20 6d 61  ject (element ma
1d880 74 63 68 65 73 29 20 69 73 20 6e 6f 74 20 65 6d  tches) is not em
1d890 70 74 79 0a 09 09 09 2f 2f 20 28 61 6e 64 20 74  pty....// (and t
1d8a0 68 65 72 65 66 6f 72 65 20 68 61 73 20 61 6e 20  herefore has an 
1d8b0 65 6c 65 6d 65 6e 74 20 61 70 70 65 61 72 73 20  element appears 
1d8c0 61 74 20 74 68 69 73 5b 20 30 20 5d 29 20 61 6e  at this[ 0 ]) an
1d8d0 64 20 74 68 65 0a 09 09 09 2f 2f 20 60 76 61 6c  d the....// `val
1d8e0 75 65 60 20 70 61 72 61 6d 65 74 65 72 20 77 61  ue` parameter wa
1d8f0 73 20 6e 6f 74 20 75 6e 64 65 66 69 6e 65 64 2e  s not undefined.
1d900 20 41 6e 20 65 6d 70 74 79 20 6a 51 75 65 72 79   An empty jQuery
1d910 20 6f 62 6a 65 63 74 0a 09 09 09 2f 2f 20 77 69   object....// wi
1d920 6c 6c 20 72 65 73 75 6c 74 20 69 6e 20 60 75 6e  ll result in `un
1d930 64 65 66 69 6e 65 64 60 20 66 6f 72 20 65 6c 65  defined` for ele
1d940 6d 20 3d 20 74 68 69 73 5b 20 30 20 5d 20 77 68  m = this[ 0 ] wh
1d950 69 63 68 20 77 69 6c 6c 0a 09 09 09 2f 2f 20 74  ich will....// t
1d960 68 72 6f 77 20 61 6e 20 65 78 63 65 70 74 69 6f  hrow an exceptio
1d970 6e 20 69 66 20 61 6e 20 61 74 74 65 6d 70 74 20  n if an attempt 
1d980 74 6f 20 72 65 61 64 20 61 20 64 61 74 61 20 63  to read a data c
1d990 61 63 68 65 20 69 73 20 6d 61 64 65 2e 0a 09 09  ache is made....
1d9a0 09 69 66 20 28 20 65 6c 65 6d 20 26 26 20 76 61  .if ( elem && va
1d9b0 6c 75 65 20 3d 3d 3d 20 75 6e 64 65 66 69 6e 65  lue === undefine
1d9c0 64 20 29 20 7b 0a 0a 09 09 09 09 2f 2f 20 41 74  d ) {......// At
1d9d0 74 65 6d 70 74 20 74 6f 20 67 65 74 20 64 61 74  tempt to get dat
1d9e0 61 20 66 72 6f 6d 20 74 68 65 20 63 61 63 68 65  a from the cache
1d9f0 0a 09 09 09 09 2f 2f 20 54 68 65 20 6b 65 79 20  .....// The key 
1da00 77 69 6c 6c 20 61 6c 77 61 79 73 20 62 65 20 63  will always be c
1da10 61 6d 65 6c 43 61 73 65 64 20 69 6e 20 44 61 74  amelCased in Dat
1da20 61 0a 09 09 09 09 64 61 74 61 20 3d 20 64 61 74  a.....data = dat
1da30 61 55 73 65 72 2e 67 65 74 28 20 65 6c 65 6d 2c  aUser.get( elem,
1da40 20 6b 65 79 20 29 3b 0a 09 09 09 09 69 66 20 28   key );.....if (
1da50 20 64 61 74 61 20 21 3d 3d 20 75 6e 64 65 66 69   data !== undefi
1da60 6e 65 64 20 29 20 7b 0a 09 09 09 09 09 72 65 74  ned ) {......ret
1da70 75 72 6e 20 64 61 74 61 3b 0a 09 09 09 09 7d 0a  urn data;.....}.
1da80 0a 09 09 09 09 2f 2f 20 41 74 74 65 6d 70 74 20  .....// Attempt 
1da90 74 6f 20 22 64 69 73 63 6f 76 65 72 22 20 74 68  to "discover" th
1daa0 65 20 64 61 74 61 20 69 6e 0a 09 09 09 09 2f 2f  e data in.....//
1dab0 20 48 54 4d 4c 35 20 63 75 73 74 6f 6d 20 64 61   HTML5 custom da
1dac0 74 61 2d 2a 20 61 74 74 72 73 0a 09 09 09 09 64  ta-* attrs.....d
1dad0 61 74 61 20 3d 20 64 61 74 61 41 74 74 72 28 20  ata = dataAttr( 
1dae0 65 6c 65 6d 2c 20 6b 65 79 20 29 3b 0a 09 09 09  elem, key );....
1daf0 09 69 66 20 28 20 64 61 74 61 20 21 3d 3d 20 75  .if ( data !== u
1db00 6e 64 65 66 69 6e 65 64 20 29 20 7b 0a 09 09 09  ndefined ) {....
1db10 09 09 72 65 74 75 72 6e 20 64 61 74 61 3b 0a 09  ..return data;..
1db20 09 09 09 7d 0a 0a 09 09 09 09 2f 2f 20 57 65 20  ...}......// We 
1db30 74 72 69 65 64 20 72 65 61 6c 6c 79 20 68 61 72  tried really har
1db40 64 2c 20 62 75 74 20 74 68 65 20 64 61 74 61 20  d, but the data 
1db50 64 6f 65 73 6e 27 74 20 65 78 69 73 74 2e 0a 09  doesn't exist...
1db60 09 09 09 72 65 74 75 72 6e 3b 0a 09 09 09 7d 0a  ...return;....}.
1db70 0a 09 09 09 2f 2f 20 53 65 74 20 74 68 65 20 64  ....// Set the d
1db80 61 74 61 2e 2e 2e 0a 09 09 09 74 68 69 73 2e 65  ata.......this.e
1db90 61 63 68 28 20 66 75 6e 63 74 69 6f 6e 28 29 20  ach( function() 
1dba0 7b 0a 0a 09 09 09 09 2f 2f 20 57 65 20 61 6c 77  {......// We alw
1dbb0 61 79 73 20 73 74 6f 72 65 20 74 68 65 20 63 61  ays store the ca
1dbc0 6d 65 6c 43 61 73 65 64 20 6b 65 79 0a 09 09 09  melCased key....
1dbd0 09 64 61 74 61 55 73 65 72 2e 73 65 74 28 20 74  .dataUser.set( t
1dbe0 68 69 73 2c 20 6b 65 79 2c 20 76 61 6c 75 65 20  his, key, value 
1dbf0 29 3b 0a 09 09 09 7d 20 29 3b 0a 09 09 7d 2c 20  );....} );...}, 
1dc00 6e 75 6c 6c 2c 20 76 61 6c 75 65 2c 20 61 72 67  null, value, arg
1dc10 75 6d 65 6e 74 73 2e 6c 65 6e 67 74 68 20 3e 20  uments.length > 
1dc20 31 2c 20 6e 75 6c 6c 2c 20 74 72 75 65 20 29 3b  1, null, true );
1dc30 0a 09 7d 2c 0a 0a 09 72 65 6d 6f 76 65 44 61 74  ..},...removeDat
1dc40 61 3a 20 66 75 6e 63 74 69 6f 6e 28 20 6b 65 79  a: function( key
1dc50 20 29 20 7b 0a 09 09 72 65 74 75 72 6e 20 74 68   ) {...return th
1dc60 69 73 2e 65 61 63 68 28 20 66 75 6e 63 74 69 6f  is.each( functio
1dc70 6e 28 29 20 7b 0a 09 09 09 64 61 74 61 55 73 65  n() {....dataUse
1dc80 72 2e 72 65 6d 6f 76 65 28 20 74 68 69 73 2c 20  r.remove( this, 
1dc90 6b 65 79 20 29 3b 0a 09 09 7d 20 29 3b 0a 09 7d  key );...} );..}
1dca0 0a 7d 20 29 3b 0a 0a 0a 6a 51 75 65 72 79 2e 65  .} );...jQuery.e
1dcb0 78 74 65 6e 64 28 20 7b 0a 09 71 75 65 75 65 3a  xtend( {..queue:
1dcc0 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 2c   function( elem,
1dcd0 20 74 79 70 65 2c 20 64 61 74 61 20 29 20 7b 0a   type, data ) {.
1dce0 09 09 76 61 72 20 71 75 65 75 65 3b 0a 0a 09 09  ..var queue;....
1dcf0 69 66 20 28 20 65 6c 65 6d 20 29 20 7b 0a 09 09  if ( elem ) {...
1dd00 09 74 79 70 65 20 3d 20 28 20 74 79 70 65 20 7c  .type = ( type |
1dd10 7c 20 22 66 78 22 20 29 20 2b 20 22 71 75 65 75  | "fx" ) + "queu
1dd20 65 22 3b 0a 09 09 09 71 75 65 75 65 20 3d 20 64  e";....queue = d
1dd30 61 74 61 50 72 69 76 2e 67 65 74 28 20 65 6c 65  ataPriv.get( ele
1dd40 6d 2c 20 74 79 70 65 20 29 3b 0a 0a 09 09 09 2f  m, type );...../
1dd50 2f 20 53 70 65 65 64 20 75 70 20 64 65 71 75 65  / Speed up deque
1dd60 75 65 20 62 79 20 67 65 74 74 69 6e 67 20 6f 75  ue by getting ou
1dd70 74 20 71 75 69 63 6b 6c 79 20 69 66 20 74 68 69  t quickly if thi
1dd80 73 20 69 73 20 6a 75 73 74 20 61 20 6c 6f 6f 6b  s is just a look
1dd90 75 70 0a 09 09 09 69 66 20 28 20 64 61 74 61 20  up....if ( data 
1dda0 29 20 7b 0a 09 09 09 09 69 66 20 28 20 21 71 75  ) {.....if ( !qu
1ddb0 65 75 65 20 7c 7c 20 41 72 72 61 79 2e 69 73 41  eue || Array.isA
1ddc0 72 72 61 79 28 20 64 61 74 61 20 29 20 29 20 7b  rray( data ) ) {
1ddd0 0a 09 09 09 09 09 71 75 65 75 65 20 3d 20 64 61  ......queue = da
1dde0 74 61 50 72 69 76 2e 61 63 63 65 73 73 28 20 65  taPriv.access( e
1ddf0 6c 65 6d 2c 20 74 79 70 65 2c 20 6a 51 75 65 72  lem, type, jQuer
1de00 79 2e 6d 61 6b 65 41 72 72 61 79 28 20 64 61 74  y.makeArray( dat
1de10 61 20 29 20 29 3b 0a 09 09 09 09 7d 20 65 6c 73  a ) );.....} els
1de20 65 20 7b 0a 09 09 09 09 09 71 75 65 75 65 2e 70  e {......queue.p
1de30 75 73 68 28 20 64 61 74 61 20 29 3b 0a 09 09 09  ush( data );....
1de40 09 7d 0a 09 09 09 7d 0a 09 09 09 72 65 74 75 72  .}....}....retur
1de50 6e 20 71 75 65 75 65 20 7c 7c 20 5b 5d 3b 0a 09  n queue || [];..
1de60 09 7d 0a 09 7d 2c 0a 0a 09 64 65 71 75 65 75 65  .}..},...dequeue
1de70 3a 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c 65 6d  : function( elem
1de80 2c 20 74 79 70 65 20 29 20 7b 0a 09 09 74 79 70  , type ) {...typ
1de90 65 20 3d 20 74 79 70 65 20 7c 7c 20 22 66 78 22  e = type || "fx"
1dea0 3b 0a 0a 09 09 76 61 72 20 71 75 65 75 65 20 3d  ;....var queue =
1deb0 20 6a 51 75 65 72 79 2e 71 75 65 75 65 28 20 65   jQuery.queue( e
1dec0 6c 65 6d 2c 20 74 79 70 65 20 29 2c 0a 09 09 09  lem, type ),....
1ded0 73 74 61 72 74 4c 65 6e 67 74 68 20 3d 20 71 75  startLength = qu
1dee0 65 75 65 2e 6c 65 6e 67 74 68 2c 0a 09 09 09 66  eue.length,....f
1def0 6e 20 3d 20 71 75 65 75 65 2e 73 68 69 66 74 28  n = queue.shift(
1df00 29 2c 0a 09 09 09 68 6f 6f 6b 73 20 3d 20 6a 51  ),....hooks = jQ
1df10 75 65 72 79 2e 5f 71 75 65 75 65 48 6f 6f 6b 73  uery._queueHooks
1df20 28 20 65 6c 65 6d 2c 20 74 79 70 65 20 29 2c 0a  ( elem, type ),.
1df30 09 09 09 6e 65 78 74 20 3d 20 66 75 6e 63 74 69  ...next = functi
1df40 6f 6e 28 29 20 7b 0a 09 09 09 09 6a 51 75 65 72  on() {.....jQuer
1df50 79 2e 64 65 71 75 65 75 65 28 20 65 6c 65 6d 2c  y.dequeue( elem,
1df60 20 74 79 70 65 20 29 3b 0a 09 09 09 7d 3b 0a 0a   type );....};..
1df70 09 09 2f 2f 20 49 66 20 74 68 65 20 66 78 20 71  ..// If the fx q
1df80 75 65 75 65 20 69 73 20 64 65 71 75 65 75 65 64  ueue is dequeued
1df90 2c 20 61 6c 77 61 79 73 20 72 65 6d 6f 76 65 20  , always remove 
1dfa0 74 68 65 20 70 72 6f 67 72 65 73 73 20 73 65 6e  the progress sen
1dfb0 74 69 6e 65 6c 0a 09 09 69 66 20 28 20 66 6e 20  tinel...if ( fn 
1dfc0 3d 3d 3d 20 22 69 6e 70 72 6f 67 72 65 73 73 22  === "inprogress"
1dfd0 20 29 20 7b 0a 09 09 09 66 6e 20 3d 20 71 75 65   ) {....fn = que
1dfe0 75 65 2e 73 68 69 66 74 28 29 3b 0a 09 09 09 73  ue.shift();....s
1dff0 74 61 72 74 4c 65 6e 67 74 68 2d 2d 3b 0a 09 09  tartLength--;...
1e000 7d 0a 0a 09 09 69 66 20 28 20 66 6e 20 29 20 7b  }....if ( fn ) {
1e010 0a 0a 09 09 09 2f 2f 20 41 64 64 20 61 20 70 72  .....// Add a pr
1e020 6f 67 72 65 73 73 20 73 65 6e 74 69 6e 65 6c 20  ogress sentinel 
1e030 74 6f 20 70 72 65 76 65 6e 74 20 74 68 65 20 66  to prevent the f
1e040 78 20 71 75 65 75 65 20 66 72 6f 6d 20 62 65 69  x queue from bei
1e050 6e 67 0a 09 09 09 2f 2f 20 61 75 74 6f 6d 61 74  ng....// automat
1e060 69 63 61 6c 6c 79 20 64 65 71 75 65 75 65 64 0a  ically dequeued.
1e070 09 09 09 69 66 20 28 20 74 79 70 65 20 3d 3d 3d  ...if ( type ===
1e080 20 22 66 78 22 20 29 20 7b 0a 09 09 09 09 71 75   "fx" ) {.....qu
1e090 65 75 65 2e 75 6e 73 68 69 66 74 28 20 22 69 6e  eue.unshift( "in
1e0a0 70 72 6f 67 72 65 73 73 22 20 29 3b 0a 09 09 09  progress" );....
1e0b0 7d 0a 0a 09 09 09 2f 2f 20 43 6c 65 61 72 20 75  }.....// Clear u
1e0c0 70 20 74 68 65 20 6c 61 73 74 20 71 75 65 75 65  p the last queue
1e0d0 20 73 74 6f 70 20 66 75 6e 63 74 69 6f 6e 0a 09   stop function..
1e0e0 09 09 64 65 6c 65 74 65 20 68 6f 6f 6b 73 2e 73  ..delete hooks.s
1e0f0 74 6f 70 3b 0a 09 09 09 66 6e 2e 63 61 6c 6c 28  top;....fn.call(
1e100 20 65 6c 65 6d 2c 20 6e 65 78 74 2c 20 68 6f 6f   elem, next, hoo
1e110 6b 73 20 29 3b 0a 09 09 7d 0a 0a 09 09 69 66 20  ks );...}....if 
1e120 28 20 21 73 74 61 72 74 4c 65 6e 67 74 68 20 26  ( !startLength &
1e130 26 20 68 6f 6f 6b 73 20 29 20 7b 0a 09 09 09 68  & hooks ) {....h
1e140 6f 6f 6b 73 2e 65 6d 70 74 79 2e 66 69 72 65 28  ooks.empty.fire(
1e150 29 3b 0a 09 09 7d 0a 09 7d 2c 0a 0a 09 2f 2f 20  );...}..},...// 
1e160 4e 6f 74 20 70 75 62 6c 69 63 20 2d 20 67 65 6e  Not public - gen
1e170 65 72 61 74 65 20 61 20 71 75 65 75 65 48 6f 6f  erate a queueHoo
1e180 6b 73 20 6f 62 6a 65 63 74 2c 20 6f 72 20 72 65  ks object, or re
1e190 74 75 72 6e 20 74 68 65 20 63 75 72 72 65 6e 74  turn the current
1e1a0 20 6f 6e 65 0a 09 5f 71 75 65 75 65 48 6f 6f 6b   one.._queueHook
1e1b0 73 3a 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c 65  s: function( ele
1e1c0 6d 2c 20 74 79 70 65 20 29 20 7b 0a 09 09 76 61  m, type ) {...va
1e1d0 72 20 6b 65 79 20 3d 20 74 79 70 65 20 2b 20 22  r key = type + "
1e1e0 71 75 65 75 65 48 6f 6f 6b 73 22 3b 0a 09 09 72  queueHooks";...r
1e1f0 65 74 75 72 6e 20 64 61 74 61 50 72 69 76 2e 67  eturn dataPriv.g
1e200 65 74 28 20 65 6c 65 6d 2c 20 6b 65 79 20 29 20  et( elem, key ) 
1e210 7c 7c 20 64 61 74 61 50 72 69 76 2e 61 63 63 65  || dataPriv.acce
1e220 73 73 28 20 65 6c 65 6d 2c 20 6b 65 79 2c 20 7b  ss( elem, key, {
1e230 0a 09 09 09 65 6d 70 74 79 3a 20 6a 51 75 65 72  ....empty: jQuer
1e240 79 2e 43 61 6c 6c 62 61 63 6b 73 28 20 22 6f 6e  y.Callbacks( "on
1e250 63 65 20 6d 65 6d 6f 72 79 22 20 29 2e 61 64 64  ce memory" ).add
1e260 28 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09  ( function() {..
1e270 09 09 09 64 61 74 61 50 72 69 76 2e 72 65 6d 6f  ...dataPriv.remo
1e280 76 65 28 20 65 6c 65 6d 2c 20 5b 20 74 79 70 65  ve( elem, [ type
1e290 20 2b 20 22 71 75 65 75 65 22 2c 20 6b 65 79 20   + "queue", key 
1e2a0 5d 20 29 3b 0a 09 09 09 7d 20 29 0a 09 09 7d 20  ] );....} )...} 
1e2b0 29 3b 0a 09 7d 0a 7d 20 29 3b 0a 0a 6a 51 75 65  );..}.} );..jQue
1e2c0 72 79 2e 66 6e 2e 65 78 74 65 6e 64 28 20 7b 0a  ry.fn.extend( {.
1e2d0 09 71 75 65 75 65 3a 20 66 75 6e 63 74 69 6f 6e  .queue: function
1e2e0 28 20 74 79 70 65 2c 20 64 61 74 61 20 29 20 7b  ( type, data ) {
1e2f0 0a 09 09 76 61 72 20 73 65 74 74 65 72 20 3d 20  ...var setter = 
1e300 32 3b 0a 0a 09 09 69 66 20 28 20 74 79 70 65 6f  2;....if ( typeo
1e310 66 20 74 79 70 65 20 21 3d 3d 20 22 73 74 72 69  f type !== "stri
1e320 6e 67 22 20 29 20 7b 0a 09 09 09 64 61 74 61 20  ng" ) {....data 
1e330 3d 20 74 79 70 65 3b 0a 09 09 09 74 79 70 65 20  = type;....type 
1e340 3d 20 22 66 78 22 3b 0a 09 09 09 73 65 74 74 65  = "fx";....sette
1e350 72 2d 2d 3b 0a 09 09 7d 0a 0a 09 09 69 66 20 28  r--;...}....if (
1e360 20 61 72 67 75 6d 65 6e 74 73 2e 6c 65 6e 67 74   arguments.lengt
1e370 68 20 3c 20 73 65 74 74 65 72 20 29 20 7b 0a 09  h < setter ) {..
1e380 09 09 72 65 74 75 72 6e 20 6a 51 75 65 72 79 2e  ..return jQuery.
1e390 71 75 65 75 65 28 20 74 68 69 73 5b 20 30 20 5d  queue( this[ 0 ]
1e3a0 2c 20 74 79 70 65 20 29 3b 0a 09 09 7d 0a 0a 09  , type );...}...
1e3b0 09 72 65 74 75 72 6e 20 64 61 74 61 20 3d 3d 3d  .return data ===
1e3c0 20 75 6e 64 65 66 69 6e 65 64 20 3f 0a 09 09 09   undefined ?....
1e3d0 74 68 69 73 20 3a 0a 09 09 09 74 68 69 73 2e 65  this :....this.e
1e3e0 61 63 68 28 20 66 75 6e 63 74 69 6f 6e 28 29 20  ach( function() 
1e3f0 7b 0a 09 09 09 09 76 61 72 20 71 75 65 75 65 20  {.....var queue 
1e400 3d 20 6a 51 75 65 72 79 2e 71 75 65 75 65 28 20  = jQuery.queue( 
1e410 74 68 69 73 2c 20 74 79 70 65 2c 20 64 61 74 61  this, type, data
1e420 20 29 3b 0a 0a 09 09 09 09 2f 2f 20 45 6e 73 75   );......// Ensu
1e430 72 65 20 61 20 68 6f 6f 6b 73 20 66 6f 72 20 74  re a hooks for t
1e440 68 69 73 20 71 75 65 75 65 0a 09 09 09 09 6a 51  his queue.....jQ
1e450 75 65 72 79 2e 5f 71 75 65 75 65 48 6f 6f 6b 73  uery._queueHooks
1e460 28 20 74 68 69 73 2c 20 74 79 70 65 20 29 3b 0a  ( this, type );.
1e470 0a 09 09 09 09 69 66 20 28 20 74 79 70 65 20 3d  .....if ( type =
1e480 3d 3d 20 22 66 78 22 20 26 26 20 71 75 65 75 65  == "fx" && queue
1e490 5b 20 30 20 5d 20 21 3d 3d 20 22 69 6e 70 72 6f  [ 0 ] !== "inpro
1e4a0 67 72 65 73 73 22 20 29 20 7b 0a 09 09 09 09 09  gress" ) {......
1e4b0 6a 51 75 65 72 79 2e 64 65 71 75 65 75 65 28 20  jQuery.dequeue( 
1e4c0 74 68 69 73 2c 20 74 79 70 65 20 29 3b 0a 09 09  this, type );...
1e4d0 09 09 7d 0a 09 09 09 7d 20 29 3b 0a 09 7d 2c 0a  ..}....} );..},.
1e4e0 09 64 65 71 75 65 75 65 3a 20 66 75 6e 63 74 69  .dequeue: functi
1e4f0 6f 6e 28 20 74 79 70 65 20 29 20 7b 0a 09 09 72  on( type ) {...r
1e500 65 74 75 72 6e 20 74 68 69 73 2e 65 61 63 68 28  eturn this.each(
1e510 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09 09   function() {...
1e520 09 6a 51 75 65 72 79 2e 64 65 71 75 65 75 65 28  .jQuery.dequeue(
1e530 20 74 68 69 73 2c 20 74 79 70 65 20 29 3b 0a 09   this, type );..
1e540 09 7d 20 29 3b 0a 09 7d 2c 0a 09 63 6c 65 61 72  .} );..},..clear
1e550 51 75 65 75 65 3a 20 66 75 6e 63 74 69 6f 6e 28  Queue: function(
1e560 20 74 79 70 65 20 29 20 7b 0a 09 09 72 65 74 75   type ) {...retu
1e570 72 6e 20 74 68 69 73 2e 71 75 65 75 65 28 20 74  rn this.queue( t
1e580 79 70 65 20 7c 7c 20 22 66 78 22 2c 20 5b 5d 20  ype || "fx", [] 
1e590 29 3b 0a 09 7d 2c 0a 0a 09 2f 2f 20 47 65 74 20  );..},...// Get 
1e5a0 61 20 70 72 6f 6d 69 73 65 20 72 65 73 6f 6c 76  a promise resolv
1e5b0 65 64 20 77 68 65 6e 20 71 75 65 75 65 73 20 6f  ed when queues o
1e5c0 66 20 61 20 63 65 72 74 61 69 6e 20 74 79 70 65  f a certain type
1e5d0 0a 09 2f 2f 20 61 72 65 20 65 6d 70 74 69 65 64  ..// are emptied
1e5e0 20 28 66 78 20 69 73 20 74 68 65 20 74 79 70 65   (fx is the type
1e5f0 20 62 79 20 64 65 66 61 75 6c 74 29 0a 09 70 72   by default)..pr
1e600 6f 6d 69 73 65 3a 20 66 75 6e 63 74 69 6f 6e 28  omise: function(
1e610 20 74 79 70 65 2c 20 6f 62 6a 20 29 20 7b 0a 09   type, obj ) {..
1e620 09 76 61 72 20 74 6d 70 2c 0a 09 09 09 63 6f 75  .var tmp,....cou
1e630 6e 74 20 3d 20 31 2c 0a 09 09 09 64 65 66 65 72  nt = 1,....defer
1e640 20 3d 20 6a 51 75 65 72 79 2e 44 65 66 65 72 72   = jQuery.Deferr
1e650 65 64 28 29 2c 0a 09 09 09 65 6c 65 6d 65 6e 74  ed(),....element
1e660 73 20 3d 20 74 68 69 73 2c 0a 09 09 09 69 20 3d  s = this,....i =
1e670 20 74 68 69 73 2e 6c 65 6e 67 74 68 2c 0a 09 09   this.length,...
1e680 09 72 65 73 6f 6c 76 65 20 3d 20 66 75 6e 63 74  .resolve = funct
1e690 69 6f 6e 28 29 20 7b 0a 09 09 09 09 69 66 20 28  ion() {.....if (
1e6a0 20 21 28 20 2d 2d 63 6f 75 6e 74 20 29 20 29 20   !( --count ) ) 
1e6b0 7b 0a 09 09 09 09 09 64 65 66 65 72 2e 72 65 73  {......defer.res
1e6c0 6f 6c 76 65 57 69 74 68 28 20 65 6c 65 6d 65 6e  olveWith( elemen
1e6d0 74 73 2c 20 5b 20 65 6c 65 6d 65 6e 74 73 20 5d  ts, [ elements ]
1e6e0 20 29 3b 0a 09 09 09 09 7d 0a 09 09 09 7d 3b 0a   );.....}....};.
1e6f0 0a 09 09 69 66 20 28 20 74 79 70 65 6f 66 20 74  ...if ( typeof t
1e700 79 70 65 20 21 3d 3d 20 22 73 74 72 69 6e 67 22  ype !== "string"
1e710 20 29 20 7b 0a 09 09 09 6f 62 6a 20 3d 20 74 79   ) {....obj = ty
1e720 70 65 3b 0a 09 09 09 74 79 70 65 20 3d 20 75 6e  pe;....type = un
1e730 64 65 66 69 6e 65 64 3b 0a 09 09 7d 0a 09 09 74  defined;...}...t
1e740 79 70 65 20 3d 20 74 79 70 65 20 7c 7c 20 22 66  ype = type || "f
1e750 78 22 3b 0a 0a 09 09 77 68 69 6c 65 20 28 20 69  x";....while ( i
1e760 2d 2d 20 29 20 7b 0a 09 09 09 74 6d 70 20 3d 20  -- ) {....tmp = 
1e770 64 61 74 61 50 72 69 76 2e 67 65 74 28 20 65 6c  dataPriv.get( el
1e780 65 6d 65 6e 74 73 5b 20 69 20 5d 2c 20 74 79 70  ements[ i ], typ
1e790 65 20 2b 20 22 71 75 65 75 65 48 6f 6f 6b 73 22  e + "queueHooks"
1e7a0 20 29 3b 0a 09 09 09 69 66 20 28 20 74 6d 70 20   );....if ( tmp 
1e7b0 26 26 20 74 6d 70 2e 65 6d 70 74 79 20 29 20 7b  && tmp.empty ) {
1e7c0 0a 09 09 09 09 63 6f 75 6e 74 2b 2b 3b 0a 09 09  .....count++;...
1e7d0 09 09 74 6d 70 2e 65 6d 70 74 79 2e 61 64 64 28  ..tmp.empty.add(
1e7e0 20 72 65 73 6f 6c 76 65 20 29 3b 0a 09 09 09 7d   resolve );....}
1e7f0 0a 09 09 7d 0a 09 09 72 65 73 6f 6c 76 65 28 29  ...}...resolve()
1e800 3b 0a 09 09 72 65 74 75 72 6e 20 64 65 66 65 72  ;...return defer
1e810 2e 70 72 6f 6d 69 73 65 28 20 6f 62 6a 20 29 3b  .promise( obj );
1e820 0a 09 7d 0a 7d 20 29 3b 0a 76 61 72 20 70 6e 75  ..}.} );.var pnu
1e830 6d 20 3d 20 28 20 2f 5b 2b 2d 5d 3f 28 3f 3a 5c  m = ( /[+-]?(?:\
1e840 64 2a 5c 2e 7c 29 5c 64 2b 28 3f 3a 5b 65 45 5d  d*\.|)\d+(?:[eE]
1e850 5b 2b 2d 5d 3f 5c 64 2b 7c 29 2f 20 29 2e 73 6f  [+-]?\d+|)/ ).so
1e860 75 72 63 65 3b 0a 0a 76 61 72 20 72 63 73 73 4e  urce;..var rcssN
1e870 75 6d 20 3d 20 6e 65 77 20 52 65 67 45 78 70 28  um = new RegExp(
1e880 20 22 5e 28 3f 3a 28 5b 2b 2d 5d 29 3d 7c 29 28   "^(?:([+-])=|)(
1e890 22 20 2b 20 70 6e 75 6d 20 2b 20 22 29 28 5b 61  " + pnum + ")([a
1e8a0 2d 7a 25 5d 2a 29 24 22 2c 20 22 69 22 20 29 3b  -z%]*)$", "i" );
1e8b0 0a 0a 0a 76 61 72 20 63 73 73 45 78 70 61 6e 64  ...var cssExpand
1e8c0 20 3d 20 5b 20 22 54 6f 70 22 2c 20 22 52 69 67   = [ "Top", "Rig
1e8d0 68 74 22 2c 20 22 42 6f 74 74 6f 6d 22 2c 20 22  ht", "Bottom", "
1e8e0 4c 65 66 74 22 20 5d 3b 0a 0a 76 61 72 20 64 6f  Left" ];..var do
1e8f0 63 75 6d 65 6e 74 45 6c 65 6d 65 6e 74 20 3d 20  cumentElement = 
1e900 64 6f 63 75 6d 65 6e 74 2e 64 6f 63 75 6d 65 6e  document.documen
1e910 74 45 6c 65 6d 65 6e 74 3b 0a 0a 0a 0a 09 76 61  tElement;.....va
1e920 72 20 69 73 41 74 74 61 63 68 65 64 20 3d 20 66  r isAttached = f
1e930 75 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 20 29 20  unction( elem ) 
1e940 7b 0a 09 09 09 72 65 74 75 72 6e 20 6a 51 75 65  {....return jQue
1e950 72 79 2e 63 6f 6e 74 61 69 6e 73 28 20 65 6c 65  ry.contains( ele
1e960 6d 2e 6f 77 6e 65 72 44 6f 63 75 6d 65 6e 74 2c  m.ownerDocument,
1e970 20 65 6c 65 6d 20 29 3b 0a 09 09 7d 2c 0a 09 09   elem );...},...
1e980 63 6f 6d 70 6f 73 65 64 20 3d 20 7b 20 63 6f 6d  composed = { com
1e990 70 6f 73 65 64 3a 20 74 72 75 65 20 7d 3b 0a 0a  posed: true };..
1e9a0 09 2f 2f 20 53 75 70 70 6f 72 74 3a 20 49 45 20  .// Support: IE 
1e9b0 39 20 2d 20 31 31 2b 2c 20 45 64 67 65 20 31 32  9 - 11+, Edge 12
1e9c0 20 2d 20 31 38 2b 2c 20 69 4f 53 20 31 30 2e 30   - 18+, iOS 10.0
1e9d0 20 2d 20 31 30 2e 32 20 6f 6e 6c 79 0a 09 2f 2f   - 10.2 only..//
1e9e0 20 43 68 65 63 6b 20 61 74 74 61 63 68 6d 65 6e   Check attachmen
1e9f0 74 20 61 63 72 6f 73 73 20 73 68 61 64 6f 77 20  t across shadow 
1ea00 44 4f 4d 20 62 6f 75 6e 64 61 72 69 65 73 20 77  DOM boundaries w
1ea10 68 65 6e 20 70 6f 73 73 69 62 6c 65 20 28 67 68  hen possible (gh
1ea20 2d 33 35 30 34 29 0a 09 2f 2f 20 53 75 70 70 6f  -3504)..// Suppo
1ea30 72 74 3a 20 69 4f 53 20 31 30 2e 30 2d 31 30 2e  rt: iOS 10.0-10.
1ea40 32 20 6f 6e 6c 79 0a 09 2f 2f 20 45 61 72 6c 79  2 only..// Early
1ea50 20 69 4f 53 20 31 30 20 76 65 72 73 69 6f 6e 73   iOS 10 versions
1ea60 20 73 75 70 70 6f 72 74 20 60 61 74 74 61 63 68   support `attach
1ea70 53 68 61 64 6f 77 60 20 62 75 74 20 6e 6f 74 20  Shadow` but not 
1ea80 60 67 65 74 52 6f 6f 74 4e 6f 64 65 60 2c 0a 09  `getRootNode`,..
1ea90 2f 2f 20 6c 65 61 64 69 6e 67 20 74 6f 20 65 72  // leading to er
1eaa0 72 6f 72 73 2e 20 57 65 20 6e 65 65 64 20 74 6f  rors. We need to
1eab0 20 63 68 65 63 6b 20 66 6f 72 20 60 67 65 74 52   check for `getR
1eac0 6f 6f 74 4e 6f 64 65 60 2e 0a 09 69 66 20 28 20  ootNode`...if ( 
1ead0 64 6f 63 75 6d 65 6e 74 45 6c 65 6d 65 6e 74 2e  documentElement.
1eae0 67 65 74 52 6f 6f 74 4e 6f 64 65 20 29 20 7b 0a  getRootNode ) {.
1eaf0 09 09 69 73 41 74 74 61 63 68 65 64 20 3d 20 66  ..isAttached = f
1eb00 75 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 20 29 20  unction( elem ) 
1eb10 7b 0a 09 09 09 72 65 74 75 72 6e 20 6a 51 75 65  {....return jQue
1eb20 72 79 2e 63 6f 6e 74 61 69 6e 73 28 20 65 6c 65  ry.contains( ele
1eb30 6d 2e 6f 77 6e 65 72 44 6f 63 75 6d 65 6e 74 2c  m.ownerDocument,
1eb40 20 65 6c 65 6d 20 29 20 7c 7c 0a 09 09 09 09 65   elem ) ||.....e
1eb50 6c 65 6d 2e 67 65 74 52 6f 6f 74 4e 6f 64 65 28  lem.getRootNode(
1eb60 20 63 6f 6d 70 6f 73 65 64 20 29 20 3d 3d 3d 20   composed ) === 
1eb70 65 6c 65 6d 2e 6f 77 6e 65 72 44 6f 63 75 6d 65  elem.ownerDocume
1eb80 6e 74 3b 0a 09 09 7d 3b 0a 09 7d 0a 76 61 72 20  nt;...};..}.var 
1eb90 69 73 48 69 64 64 65 6e 57 69 74 68 69 6e 54 72  isHiddenWithinTr
1eba0 65 65 20 3d 20 66 75 6e 63 74 69 6f 6e 28 20 65  ee = function( e
1ebb0 6c 65 6d 2c 20 65 6c 20 29 20 7b 0a 0a 09 09 2f  lem, el ) {..../
1ebc0 2f 20 69 73 48 69 64 64 65 6e 57 69 74 68 69 6e  / isHiddenWithin
1ebd0 54 72 65 65 20 6d 69 67 68 74 20 62 65 20 63 61  Tree might be ca
1ebe0 6c 6c 65 64 20 66 72 6f 6d 20 6a 51 75 65 72 79  lled from jQuery
1ebf0 23 66 69 6c 74 65 72 20 66 75 6e 63 74 69 6f 6e  #filter function
1ec00 3b 0a 09 09 2f 2f 20 69 6e 20 74 68 61 74 20 63  ;...// in that c
1ec10 61 73 65 2c 20 65 6c 65 6d 65 6e 74 20 77 69 6c  ase, element wil
1ec20 6c 20 62 65 20 73 65 63 6f 6e 64 20 61 72 67 75  l be second argu
1ec30 6d 65 6e 74 0a 09 09 65 6c 65 6d 20 3d 20 65 6c  ment...elem = el
1ec40 20 7c 7c 20 65 6c 65 6d 3b 0a 0a 09 09 2f 2f 20   || elem;....// 
1ec50 49 6e 6c 69 6e 65 20 73 74 79 6c 65 20 74 72 75  Inline style tru
1ec60 6d 70 73 20 61 6c 6c 0a 09 09 72 65 74 75 72 6e  mps all...return
1ec70 20 65 6c 65 6d 2e 73 74 79 6c 65 2e 64 69 73 70   elem.style.disp
1ec80 6c 61 79 20 3d 3d 3d 20 22 6e 6f 6e 65 22 20 7c  lay === "none" |
1ec90 7c 0a 09 09 09 65 6c 65 6d 2e 73 74 79 6c 65 2e  |....elem.style.
1eca0 64 69 73 70 6c 61 79 20 3d 3d 3d 20 22 22 20 26  display === "" &
1ecb0 26 0a 0a 09 09 09 2f 2f 20 4f 74 68 65 72 77 69  &.....// Otherwi
1ecc0 73 65 2c 20 63 68 65 63 6b 20 63 6f 6d 70 75 74  se, check comput
1ecd0 65 64 20 73 74 79 6c 65 0a 09 09 09 2f 2f 20 53  ed style....// S
1ece0 75 70 70 6f 72 74 3a 20 46 69 72 65 66 6f 78 20  upport: Firefox 
1ecf0 3c 3d 34 33 20 2d 20 34 35 0a 09 09 09 2f 2f 20  <=43 - 45....// 
1ed00 44 69 73 63 6f 6e 6e 65 63 74 65 64 20 65 6c 65  Disconnected ele
1ed10 6d 65 6e 74 73 20 63 61 6e 20 68 61 76 65 20 63  ments can have c
1ed20 6f 6d 70 75 74 65 64 20 64 69 73 70 6c 61 79 3a  omputed display:
1ed30 20 6e 6f 6e 65 2c 20 73 6f 20 66 69 72 73 74 20   none, so first 
1ed40 63 6f 6e 66 69 72 6d 20 74 68 61 74 20 65 6c 65  confirm that ele
1ed50 6d 20 69 73 0a 09 09 09 2f 2f 20 69 6e 20 74 68  m is....// in th
1ed60 65 20 64 6f 63 75 6d 65 6e 74 2e 0a 09 09 09 69  e document.....i
1ed70 73 41 74 74 61 63 68 65 64 28 20 65 6c 65 6d 20  sAttached( elem 
1ed80 29 20 26 26 0a 0a 09 09 09 6a 51 75 65 72 79 2e  ) &&.....jQuery.
1ed90 63 73 73 28 20 65 6c 65 6d 2c 20 22 64 69 73 70  css( elem, "disp
1eda0 6c 61 79 22 20 29 20 3d 3d 3d 20 22 6e 6f 6e 65  lay" ) === "none
1edb0 22 3b 0a 09 7d 3b 0a 0a 0a 0a 66 75 6e 63 74 69  ";..};....functi
1edc0 6f 6e 20 61 64 6a 75 73 74 43 53 53 28 20 65 6c  on adjustCSS( el
1edd0 65 6d 2c 20 70 72 6f 70 2c 20 76 61 6c 75 65 50  em, prop, valueP
1ede0 61 72 74 73 2c 20 74 77 65 65 6e 20 29 20 7b 0a  arts, tween ) {.
1edf0 09 76 61 72 20 61 64 6a 75 73 74 65 64 2c 20 73  .var adjusted, s
1ee00 63 61 6c 65 2c 0a 09 09 6d 61 78 49 74 65 72 61  cale,...maxItera
1ee10 74 69 6f 6e 73 20 3d 20 32 30 2c 0a 09 09 63 75  tions = 20,...cu
1ee20 72 72 65 6e 74 56 61 6c 75 65 20 3d 20 74 77 65  rrentValue = twe
1ee30 65 6e 20 3f 0a 09 09 09 66 75 6e 63 74 69 6f 6e  en ?....function
1ee40 28 29 20 7b 0a 09 09 09 09 72 65 74 75 72 6e 20  () {.....return 
1ee50 74 77 65 65 6e 2e 63 75 72 28 29 3b 0a 09 09 09  tween.cur();....
1ee60 7d 20 3a 0a 09 09 09 66 75 6e 63 74 69 6f 6e 28  } :....function(
1ee70 29 20 7b 0a 09 09 09 09 72 65 74 75 72 6e 20 6a  ) {.....return j
1ee80 51 75 65 72 79 2e 63 73 73 28 20 65 6c 65 6d 2c  Query.css( elem,
1ee90 20 70 72 6f 70 2c 20 22 22 20 29 3b 0a 09 09 09   prop, "" );....
1eea0 7d 2c 0a 09 09 69 6e 69 74 69 61 6c 20 3d 20 63  },...initial = c
1eeb0 75 72 72 65 6e 74 56 61 6c 75 65 28 29 2c 0a 09  urrentValue(),..
1eec0 09 75 6e 69 74 20 3d 20 76 61 6c 75 65 50 61 72  .unit = valuePar
1eed0 74 73 20 26 26 20 76 61 6c 75 65 50 61 72 74 73  ts && valueParts
1eee0 5b 20 33 20 5d 20 7c 7c 20 28 20 6a 51 75 65 72  [ 3 ] || ( jQuer
1eef0 79 2e 63 73 73 4e 75 6d 62 65 72 5b 20 70 72 6f  y.cssNumber[ pro
1ef00 70 20 5d 20 3f 20 22 22 20 3a 20 22 70 78 22 20  p ] ? "" : "px" 
1ef10 29 2c 0a 0a 09 09 2f 2f 20 53 74 61 72 74 69 6e  ),....// Startin
1ef20 67 20 76 61 6c 75 65 20 63 6f 6d 70 75 74 61 74  g value computat
1ef30 69 6f 6e 20 69 73 20 72 65 71 75 69 72 65 64 20  ion is required 
1ef40 66 6f 72 20 70 6f 74 65 6e 74 69 61 6c 20 75 6e  for potential un
1ef50 69 74 20 6d 69 73 6d 61 74 63 68 65 73 0a 09 09  it mismatches...
1ef60 69 6e 69 74 69 61 6c 49 6e 55 6e 69 74 20 3d 20  initialInUnit = 
1ef70 65 6c 65 6d 2e 6e 6f 64 65 54 79 70 65 20 26 26  elem.nodeType &&
1ef80 0a 09 09 09 28 20 6a 51 75 65 72 79 2e 63 73 73  ....( jQuery.css
1ef90 4e 75 6d 62 65 72 5b 20 70 72 6f 70 20 5d 20 7c  Number[ prop ] |
1efa0 7c 20 75 6e 69 74 20 21 3d 3d 20 22 70 78 22 20  | unit !== "px" 
1efb0 26 26 20 2b 69 6e 69 74 69 61 6c 20 29 20 26 26  && +initial ) &&
1efc0 0a 09 09 09 72 63 73 73 4e 75 6d 2e 65 78 65 63  ....rcssNum.exec
1efd0 28 20 6a 51 75 65 72 79 2e 63 73 73 28 20 65 6c  ( jQuery.css( el
1efe0 65 6d 2c 20 70 72 6f 70 20 29 20 29 3b 0a 0a 09  em, prop ) );...
1eff0 69 66 20 28 20 69 6e 69 74 69 61 6c 49 6e 55 6e  if ( initialInUn
1f000 69 74 20 26 26 20 69 6e 69 74 69 61 6c 49 6e 55  it && initialInU
1f010 6e 69 74 5b 20 33 20 5d 20 21 3d 3d 20 75 6e 69  nit[ 3 ] !== uni
1f020 74 20 29 20 7b 0a 0a 09 09 2f 2f 20 53 75 70 70  t ) {....// Supp
1f030 6f 72 74 3a 20 46 69 72 65 66 6f 78 20 3c 3d 35  ort: Firefox <=5
1f040 34 0a 09 09 2f 2f 20 48 61 6c 76 65 20 74 68 65  4...// Halve the
1f050 20 69 74 65 72 61 74 69 6f 6e 20 74 61 72 67 65   iteration targe
1f060 74 20 76 61 6c 75 65 20 74 6f 20 70 72 65 76 65  t value to preve
1f070 6e 74 20 69 6e 74 65 72 66 65 72 65 6e 63 65 20  nt interference 
1f080 66 72 6f 6d 20 43 53 53 20 75 70 70 65 72 20 62  from CSS upper b
1f090 6f 75 6e 64 73 20 28 67 68 2d 32 31 34 34 29 0a  ounds (gh-2144).
1f0a0 09 09 69 6e 69 74 69 61 6c 20 3d 20 69 6e 69 74  ..initial = init
1f0b0 69 61 6c 20 2f 20 32 3b 0a 0a 09 09 2f 2f 20 54  ial / 2;....// T
1f0c0 72 75 73 74 20 75 6e 69 74 73 20 72 65 70 6f 72  rust units repor
1f0d0 74 65 64 20 62 79 20 6a 51 75 65 72 79 2e 63 73  ted by jQuery.cs
1f0e0 73 0a 09 09 75 6e 69 74 20 3d 20 75 6e 69 74 20  s...unit = unit 
1f0f0 7c 7c 20 69 6e 69 74 69 61 6c 49 6e 55 6e 69 74  || initialInUnit
1f100 5b 20 33 20 5d 3b 0a 0a 09 09 2f 2f 20 49 74 65  [ 3 ];....// Ite
1f110 72 61 74 69 76 65 6c 79 20 61 70 70 72 6f 78 69  ratively approxi
1f120 6d 61 74 65 20 66 72 6f 6d 20 61 20 6e 6f 6e 7a  mate from a nonz
1f130 65 72 6f 20 73 74 61 72 74 69 6e 67 20 70 6f 69  ero starting poi
1f140 6e 74 0a 09 09 69 6e 69 74 69 61 6c 49 6e 55 6e  nt...initialInUn
1f150 69 74 20 3d 20 2b 69 6e 69 74 69 61 6c 20 7c 7c  it = +initial ||
1f160 20 31 3b 0a 0a 09 09 77 68 69 6c 65 20 28 20 6d   1;....while ( m
1f170 61 78 49 74 65 72 61 74 69 6f 6e 73 2d 2d 20 29  axIterations-- )
1f180 20 7b 0a 0a 09 09 09 2f 2f 20 45 76 61 6c 75 61   {.....// Evalua
1f190 74 65 20 61 6e 64 20 75 70 64 61 74 65 20 6f 75  te and update ou
1f1a0 72 20 62 65 73 74 20 67 75 65 73 73 20 28 64 6f  r best guess (do
1f1b0 75 62 6c 69 6e 67 20 67 75 65 73 73 65 73 20 74  ubling guesses t
1f1c0 68 61 74 20 7a 65 72 6f 20 6f 75 74 29 2e 0a 09  hat zero out)...
1f1d0 09 09 2f 2f 20 46 69 6e 69 73 68 20 69 66 20 74  ..// Finish if t
1f1e0 68 65 20 73 63 61 6c 65 20 65 71 75 61 6c 73 20  he scale equals 
1f1f0 6f 72 20 63 72 6f 73 73 65 73 20 31 20 28 6d 61  or crosses 1 (ma
1f200 6b 69 6e 67 20 74 68 65 20 6f 6c 64 2a 6e 65 77  king the old*new
1f210 20 70 72 6f 64 75 63 74 20 6e 6f 6e 2d 70 6f 73   product non-pos
1f220 69 74 69 76 65 29 2e 0a 09 09 09 6a 51 75 65 72  itive).....jQuer
1f230 79 2e 73 74 79 6c 65 28 20 65 6c 65 6d 2c 20 70  y.style( elem, p
1f240 72 6f 70 2c 20 69 6e 69 74 69 61 6c 49 6e 55 6e  rop, initialInUn
1f250 69 74 20 2b 20 75 6e 69 74 20 29 3b 0a 09 09 09  it + unit );....
1f260 69 66 20 28 20 28 20 31 20 2d 20 73 63 61 6c 65  if ( ( 1 - scale
1f270 20 29 20 2a 20 28 20 31 20 2d 20 28 20 73 63 61   ) * ( 1 - ( sca
1f280 6c 65 20 3d 20 63 75 72 72 65 6e 74 56 61 6c 75  le = currentValu
1f290 65 28 29 20 2f 20 69 6e 69 74 69 61 6c 20 7c 7c  e() / initial ||
1f2a0 20 30 2e 35 20 29 20 29 20 3c 3d 20 30 20 29 20   0.5 ) ) <= 0 ) 
1f2b0 7b 0a 09 09 09 09 6d 61 78 49 74 65 72 61 74 69  {.....maxIterati
1f2c0 6f 6e 73 20 3d 20 30 3b 0a 09 09 09 7d 0a 09 09  ons = 0;....}...
1f2d0 09 69 6e 69 74 69 61 6c 49 6e 55 6e 69 74 20 3d  .initialInUnit =
1f2e0 20 69 6e 69 74 69 61 6c 49 6e 55 6e 69 74 20 2f   initialInUnit /
1f2f0 20 73 63 61 6c 65 3b 0a 0a 09 09 7d 0a 0a 09 09   scale;....}....
1f300 69 6e 69 74 69 61 6c 49 6e 55 6e 69 74 20 3d 20  initialInUnit = 
1f310 69 6e 69 74 69 61 6c 49 6e 55 6e 69 74 20 2a 20  initialInUnit * 
1f320 32 3b 0a 09 09 6a 51 75 65 72 79 2e 73 74 79 6c  2;...jQuery.styl
1f330 65 28 20 65 6c 65 6d 2c 20 70 72 6f 70 2c 20 69  e( elem, prop, i
1f340 6e 69 74 69 61 6c 49 6e 55 6e 69 74 20 2b 20 75  nitialInUnit + u
1f350 6e 69 74 20 29 3b 0a 0a 09 09 2f 2f 20 4d 61 6b  nit );....// Mak
1f360 65 20 73 75 72 65 20 77 65 20 75 70 64 61 74 65  e sure we update
1f370 20 74 68 65 20 74 77 65 65 6e 20 70 72 6f 70 65   the tween prope
1f380 72 74 69 65 73 20 6c 61 74 65 72 20 6f 6e 0a 09  rties later on..
1f390 09 76 61 6c 75 65 50 61 72 74 73 20 3d 20 76 61  .valueParts = va
1f3a0 6c 75 65 50 61 72 74 73 20 7c 7c 20 5b 5d 3b 0a  lueParts || [];.
1f3b0 09 7d 0a 0a 09 69 66 20 28 20 76 61 6c 75 65 50  .}...if ( valueP
1f3c0 61 72 74 73 20 29 20 7b 0a 09 09 69 6e 69 74 69  arts ) {...initi
1f3d0 61 6c 49 6e 55 6e 69 74 20 3d 20 2b 69 6e 69 74  alInUnit = +init
1f3e0 69 61 6c 49 6e 55 6e 69 74 20 7c 7c 20 2b 69 6e  ialInUnit || +in
1f3f0 69 74 69 61 6c 20 7c 7c 20 30 3b 0a 0a 09 09 2f  itial || 0;..../
1f400 2f 20 41 70 70 6c 79 20 72 65 6c 61 74 69 76 65  / Apply relative
1f410 20 6f 66 66 73 65 74 20 28 2b 3d 2f 2d 3d 29 20   offset (+=/-=) 
1f420 69 66 20 73 70 65 63 69 66 69 65 64 0a 09 09 61  if specified...a
1f430 64 6a 75 73 74 65 64 20 3d 20 76 61 6c 75 65 50  djusted = valueP
1f440 61 72 74 73 5b 20 31 20 5d 20 3f 0a 09 09 09 69  arts[ 1 ] ?....i
1f450 6e 69 74 69 61 6c 49 6e 55 6e 69 74 20 2b 20 28  nitialInUnit + (
1f460 20 76 61 6c 75 65 50 61 72 74 73 5b 20 31 20 5d   valueParts[ 1 ]
1f470 20 2b 20 31 20 29 20 2a 20 76 61 6c 75 65 50 61   + 1 ) * valuePa
1f480 72 74 73 5b 20 32 20 5d 20 3a 0a 09 09 09 2b 76  rts[ 2 ] :....+v
1f490 61 6c 75 65 50 61 72 74 73 5b 20 32 20 5d 3b 0a  alueParts[ 2 ];.
1f4a0 09 09 69 66 20 28 20 74 77 65 65 6e 20 29 20 7b  ..if ( tween ) {
1f4b0 0a 09 09 09 74 77 65 65 6e 2e 75 6e 69 74 20 3d  ....tween.unit =
1f4c0 20 75 6e 69 74 3b 0a 09 09 09 74 77 65 65 6e 2e   unit;....tween.
1f4d0 73 74 61 72 74 20 3d 20 69 6e 69 74 69 61 6c 49  start = initialI
1f4e0 6e 55 6e 69 74 3b 0a 09 09 09 74 77 65 65 6e 2e  nUnit;....tween.
1f4f0 65 6e 64 20 3d 20 61 64 6a 75 73 74 65 64 3b 0a  end = adjusted;.
1f500 09 09 7d 0a 09 7d 0a 09 72 65 74 75 72 6e 20 61  ..}..}..return a
1f510 64 6a 75 73 74 65 64 3b 0a 7d 0a 0a 0a 76 61 72  djusted;.}...var
1f520 20 64 65 66 61 75 6c 74 44 69 73 70 6c 61 79 4d   defaultDisplayM
1f530 61 70 20 3d 20 7b 7d 3b 0a 0a 66 75 6e 63 74 69  ap = {};..functi
1f540 6f 6e 20 67 65 74 44 65 66 61 75 6c 74 44 69 73  on getDefaultDis
1f550 70 6c 61 79 28 20 65 6c 65 6d 20 29 20 7b 0a 09  play( elem ) {..
1f560 76 61 72 20 74 65 6d 70 2c 0a 09 09 64 6f 63 20  var temp,...doc 
1f570 3d 20 65 6c 65 6d 2e 6f 77 6e 65 72 44 6f 63 75  = elem.ownerDocu
1f580 6d 65 6e 74 2c 0a 09 09 6e 6f 64 65 4e 61 6d 65  ment,...nodeName
1f590 20 3d 20 65 6c 65 6d 2e 6e 6f 64 65 4e 61 6d 65   = elem.nodeName
1f5a0 2c 0a 09 09 64 69 73 70 6c 61 79 20 3d 20 64 65  ,...display = de
1f5b0 66 61 75 6c 74 44 69 73 70 6c 61 79 4d 61 70 5b  faultDisplayMap[
1f5c0 20 6e 6f 64 65 4e 61 6d 65 20 5d 3b 0a 0a 09 69   nodeName ];...i
1f5d0 66 20 28 20 64 69 73 70 6c 61 79 20 29 20 7b 0a  f ( display ) {.
1f5e0 09 09 72 65 74 75 72 6e 20 64 69 73 70 6c 61 79  ..return display
1f5f0 3b 0a 09 7d 0a 0a 09 74 65 6d 70 20 3d 20 64 6f  ;..}...temp = do
1f600 63 2e 62 6f 64 79 2e 61 70 70 65 6e 64 43 68 69  c.body.appendChi
1f610 6c 64 28 20 64 6f 63 2e 63 72 65 61 74 65 45 6c  ld( doc.createEl
1f620 65 6d 65 6e 74 28 20 6e 6f 64 65 4e 61 6d 65 20  ement( nodeName 
1f630 29 20 29 3b 0a 09 64 69 73 70 6c 61 79 20 3d 20  ) );..display = 
1f640 6a 51 75 65 72 79 2e 63 73 73 28 20 74 65 6d 70  jQuery.css( temp
1f650 2c 20 22 64 69 73 70 6c 61 79 22 20 29 3b 0a 0a  , "display" );..
1f660 09 74 65 6d 70 2e 70 61 72 65 6e 74 4e 6f 64 65  .temp.parentNode
1f670 2e 72 65 6d 6f 76 65 43 68 69 6c 64 28 20 74 65  .removeChild( te
1f680 6d 70 20 29 3b 0a 0a 09 69 66 20 28 20 64 69 73  mp );...if ( dis
1f690 70 6c 61 79 20 3d 3d 3d 20 22 6e 6f 6e 65 22 20  play === "none" 
1f6a0 29 20 7b 0a 09 09 64 69 73 70 6c 61 79 20 3d 20  ) {...display = 
1f6b0 22 62 6c 6f 63 6b 22 3b 0a 09 7d 0a 09 64 65 66  "block";..}..def
1f6c0 61 75 6c 74 44 69 73 70 6c 61 79 4d 61 70 5b 20  aultDisplayMap[ 
1f6d0 6e 6f 64 65 4e 61 6d 65 20 5d 20 3d 20 64 69 73  nodeName ] = dis
1f6e0 70 6c 61 79 3b 0a 0a 09 72 65 74 75 72 6e 20 64  play;...return d
1f6f0 69 73 70 6c 61 79 3b 0a 7d 0a 0a 66 75 6e 63 74  isplay;.}..funct
1f700 69 6f 6e 20 73 68 6f 77 48 69 64 65 28 20 65 6c  ion showHide( el
1f710 65 6d 65 6e 74 73 2c 20 73 68 6f 77 20 29 20 7b  ements, show ) {
1f720 0a 09 76 61 72 20 64 69 73 70 6c 61 79 2c 20 65  ..var display, e
1f730 6c 65 6d 2c 0a 09 09 76 61 6c 75 65 73 20 3d 20  lem,...values = 
1f740 5b 5d 2c 0a 09 09 69 6e 64 65 78 20 3d 20 30 2c  [],...index = 0,
1f750 0a 09 09 6c 65 6e 67 74 68 20 3d 20 65 6c 65 6d  ...length = elem
1f760 65 6e 74 73 2e 6c 65 6e 67 74 68 3b 0a 0a 09 2f  ents.length;.../
1f770 2f 20 44 65 74 65 72 6d 69 6e 65 20 6e 65 77 20  / Determine new 
1f780 64 69 73 70 6c 61 79 20 76 61 6c 75 65 20 66 6f  display value fo
1f790 72 20 65 6c 65 6d 65 6e 74 73 20 74 68 61 74 20  r elements that 
1f7a0 6e 65 65 64 20 74 6f 20 63 68 61 6e 67 65 0a 09  need to change..
1f7b0 66 6f 72 20 28 20 3b 20 69 6e 64 65 78 20 3c 20  for ( ; index < 
1f7c0 6c 65 6e 67 74 68 3b 20 69 6e 64 65 78 2b 2b 20  length; index++ 
1f7d0 29 20 7b 0a 09 09 65 6c 65 6d 20 3d 20 65 6c 65  ) {...elem = ele
1f7e0 6d 65 6e 74 73 5b 20 69 6e 64 65 78 20 5d 3b 0a  ments[ index ];.
1f7f0 09 09 69 66 20 28 20 21 65 6c 65 6d 2e 73 74 79  ..if ( !elem.sty
1f800 6c 65 20 29 20 7b 0a 09 09 09 63 6f 6e 74 69 6e  le ) {....contin
1f810 75 65 3b 0a 09 09 7d 0a 0a 09 09 64 69 73 70 6c  ue;...}....displ
1f820 61 79 20 3d 20 65 6c 65 6d 2e 73 74 79 6c 65 2e  ay = elem.style.
1f830 64 69 73 70 6c 61 79 3b 0a 09 09 69 66 20 28 20  display;...if ( 
1f840 73 68 6f 77 20 29 20 7b 0a 0a 09 09 09 2f 2f 20  show ) {.....// 
1f850 53 69 6e 63 65 20 77 65 20 66 6f 72 63 65 20 76  Since we force v
1f860 69 73 69 62 69 6c 69 74 79 20 75 70 6f 6e 20 63  isibility upon c
1f870 61 73 63 61 64 65 2d 68 69 64 64 65 6e 20 65 6c  ascade-hidden el
1f880 65 6d 65 6e 74 73 2c 20 61 6e 20 69 6d 6d 65 64  ements, an immed
1f890 69 61 74 65 20 28 61 6e 64 20 73 6c 6f 77 29 0a  iate (and slow).
1f8a0 09 09 09 2f 2f 20 63 68 65 63 6b 20 69 73 20 72  ...// check is r
1f8b0 65 71 75 69 72 65 64 20 69 6e 20 74 68 69 73 20  equired in this 
1f8c0 66 69 72 73 74 20 6c 6f 6f 70 20 75 6e 6c 65 73  first loop unles
1f8d0 73 20 77 65 20 68 61 76 65 20 61 20 6e 6f 6e 65  s we have a none
1f8e0 6d 70 74 79 20 64 69 73 70 6c 61 79 20 76 61 6c  mpty display val
1f8f0 75 65 20 28 65 69 74 68 65 72 0a 09 09 09 2f 2f  ue (either....//
1f900 20 69 6e 6c 69 6e 65 20 6f 72 20 61 62 6f 75 74   inline or about
1f910 2d 74 6f 2d 62 65 2d 72 65 73 74 6f 72 65 64 29  -to-be-restored)
1f920 0a 09 09 09 69 66 20 28 20 64 69 73 70 6c 61 79  ....if ( display
1f930 20 3d 3d 3d 20 22 6e 6f 6e 65 22 20 29 20 7b 0a   === "none" ) {.
1f940 09 09 09 09 76 61 6c 75 65 73 5b 20 69 6e 64 65  ....values[ inde
1f950 78 20 5d 20 3d 20 64 61 74 61 50 72 69 76 2e 67  x ] = dataPriv.g
1f960 65 74 28 20 65 6c 65 6d 2c 20 22 64 69 73 70 6c  et( elem, "displ
1f970 61 79 22 20 29 20 7c 7c 20 6e 75 6c 6c 3b 0a 09  ay" ) || null;..
1f980 09 09 09 69 66 20 28 20 21 76 61 6c 75 65 73 5b  ...if ( !values[
1f990 20 69 6e 64 65 78 20 5d 20 29 20 7b 0a 09 09 09   index ] ) {....
1f9a0 09 09 65 6c 65 6d 2e 73 74 79 6c 65 2e 64 69 73  ..elem.style.dis
1f9b0 70 6c 61 79 20 3d 20 22 22 3b 0a 09 09 09 09 7d  play = "";.....}
1f9c0 0a 09 09 09 7d 0a 09 09 09 69 66 20 28 20 65 6c  ....}....if ( el
1f9d0 65 6d 2e 73 74 79 6c 65 2e 64 69 73 70 6c 61 79  em.style.display
1f9e0 20 3d 3d 3d 20 22 22 20 26 26 20 69 73 48 69 64   === "" && isHid
1f9f0 64 65 6e 57 69 74 68 69 6e 54 72 65 65 28 20 65  denWithinTree( e
1fa00 6c 65 6d 20 29 20 29 20 7b 0a 09 09 09 09 76 61  lem ) ) {.....va
1fa10 6c 75 65 73 5b 20 69 6e 64 65 78 20 5d 20 3d 20  lues[ index ] = 
1fa20 67 65 74 44 65 66 61 75 6c 74 44 69 73 70 6c 61  getDefaultDispla
1fa30 79 28 20 65 6c 65 6d 20 29 3b 0a 09 09 09 7d 0a  y( elem );....}.
1fa40 09 09 7d 20 65 6c 73 65 20 7b 0a 09 09 09 69 66  ..} else {....if
1fa50 20 28 20 64 69 73 70 6c 61 79 20 21 3d 3d 20 22   ( display !== "
1fa60 6e 6f 6e 65 22 20 29 20 7b 0a 09 09 09 09 76 61  none" ) {.....va
1fa70 6c 75 65 73 5b 20 69 6e 64 65 78 20 5d 20 3d 20  lues[ index ] = 
1fa80 22 6e 6f 6e 65 22 3b 0a 0a 09 09 09 09 2f 2f 20  "none";......// 
1fa90 52 65 6d 65 6d 62 65 72 20 77 68 61 74 20 77 65  Remember what we
1faa0 27 72 65 20 6f 76 65 72 77 72 69 74 69 6e 67 0a  're overwriting.
1fab0 09 09 09 09 64 61 74 61 50 72 69 76 2e 73 65 74  ....dataPriv.set
1fac0 28 20 65 6c 65 6d 2c 20 22 64 69 73 70 6c 61 79  ( elem, "display
1fad0 22 2c 20 64 69 73 70 6c 61 79 20 29 3b 0a 09 09  ", display );...
1fae0 09 7d 0a 09 09 7d 0a 09 7d 0a 0a 09 2f 2f 20 53  .}...}..}...// S
1faf0 65 74 20 74 68 65 20 64 69 73 70 6c 61 79 20 6f  et the display o
1fb00 66 20 74 68 65 20 65 6c 65 6d 65 6e 74 73 20 69  f the elements i
1fb10 6e 20 61 20 73 65 63 6f 6e 64 20 6c 6f 6f 70 20  n a second loop 
1fb20 74 6f 20 61 76 6f 69 64 20 63 6f 6e 73 74 61 6e  to avoid constan
1fb30 74 20 72 65 66 6c 6f 77 0a 09 66 6f 72 20 28 20  t reflow..for ( 
1fb40 69 6e 64 65 78 20 3d 20 30 3b 20 69 6e 64 65 78  index = 0; index
1fb50 20 3c 20 6c 65 6e 67 74 68 3b 20 69 6e 64 65 78   < length; index
1fb60 2b 2b 20 29 20 7b 0a 09 09 69 66 20 28 20 76 61  ++ ) {...if ( va
1fb70 6c 75 65 73 5b 20 69 6e 64 65 78 20 5d 20 21 3d  lues[ index ] !=
1fb80 20 6e 75 6c 6c 20 29 20 7b 0a 09 09 09 65 6c 65   null ) {....ele
1fb90 6d 65 6e 74 73 5b 20 69 6e 64 65 78 20 5d 2e 73  ments[ index ].s
1fba0 74 79 6c 65 2e 64 69 73 70 6c 61 79 20 3d 20 76  tyle.display = v
1fbb0 61 6c 75 65 73 5b 20 69 6e 64 65 78 20 5d 3b 0a  alues[ index ];.
1fbc0 09 09 7d 0a 09 7d 0a 0a 09 72 65 74 75 72 6e 20  ..}..}...return 
1fbd0 65 6c 65 6d 65 6e 74 73 3b 0a 7d 0a 0a 6a 51 75  elements;.}..jQu
1fbe0 65 72 79 2e 66 6e 2e 65 78 74 65 6e 64 28 20 7b  ery.fn.extend( {
1fbf0 0a 09 73 68 6f 77 3a 20 66 75 6e 63 74 69 6f 6e  ..show: function
1fc00 28 29 20 7b 0a 09 09 72 65 74 75 72 6e 20 73 68  () {...return sh
1fc10 6f 77 48 69 64 65 28 20 74 68 69 73 2c 20 74 72  owHide( this, tr
1fc20 75 65 20 29 3b 0a 09 7d 2c 0a 09 68 69 64 65 3a  ue );..},..hide:
1fc30 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09 09   function() {...
1fc40 72 65 74 75 72 6e 20 73 68 6f 77 48 69 64 65 28  return showHide(
1fc50 20 74 68 69 73 20 29 3b 0a 09 7d 2c 0a 09 74 6f   this );..},..to
1fc60 67 67 6c 65 3a 20 66 75 6e 63 74 69 6f 6e 28 20  ggle: function( 
1fc70 73 74 61 74 65 20 29 20 7b 0a 09 09 69 66 20 28  state ) {...if (
1fc80 20 74 79 70 65 6f 66 20 73 74 61 74 65 20 3d 3d   typeof state ==
1fc90 3d 20 22 62 6f 6f 6c 65 61 6e 22 20 29 20 7b 0a  = "boolean" ) {.
1fca0 09 09 09 72 65 74 75 72 6e 20 73 74 61 74 65 20  ...return state 
1fcb0 3f 20 74 68 69 73 2e 73 68 6f 77 28 29 20 3a 20  ? this.show() : 
1fcc0 74 68 69 73 2e 68 69 64 65 28 29 3b 0a 09 09 7d  this.hide();...}
1fcd0 0a 0a 09 09 72 65 74 75 72 6e 20 74 68 69 73 2e  ....return this.
1fce0 65 61 63 68 28 20 66 75 6e 63 74 69 6f 6e 28 29  each( function()
1fcf0 20 7b 0a 09 09 09 69 66 20 28 20 69 73 48 69 64   {....if ( isHid
1fd00 64 65 6e 57 69 74 68 69 6e 54 72 65 65 28 20 74  denWithinTree( t
1fd10 68 69 73 20 29 20 29 20 7b 0a 09 09 09 09 6a 51  his ) ) {.....jQ
1fd20 75 65 72 79 28 20 74 68 69 73 20 29 2e 73 68 6f  uery( this ).sho
1fd30 77 28 29 3b 0a 09 09 09 7d 20 65 6c 73 65 20 7b  w();....} else {
1fd40 0a 09 09 09 09 6a 51 75 65 72 79 28 20 74 68 69  .....jQuery( thi
1fd50 73 20 29 2e 68 69 64 65 28 29 3b 0a 09 09 09 7d  s ).hide();....}
1fd60 0a 09 09 7d 20 29 3b 0a 09 7d 0a 7d 20 29 3b 0a  ...} );..}.} );.
1fd70 76 61 72 20 72 63 68 65 63 6b 61 62 6c 65 54 79  var rcheckableTy
1fd80 70 65 20 3d 20 28 20 2f 5e 28 3f 3a 63 68 65 63  pe = ( /^(?:chec
1fd90 6b 62 6f 78 7c 72 61 64 69 6f 29 24 2f 69 20 29  kbox|radio)$/i )
1fda0 3b 0a 0a 76 61 72 20 72 74 61 67 4e 61 6d 65 20  ;..var rtagName 
1fdb0 3d 20 28 20 2f 3c 28 5b 61 2d 7a 5d 5b 5e 5c 2f  = ( /<([a-z][^\/
1fdc0 5c 30 3e 5c 78 32 30 5c 74 5c 72 5c 6e 5c 66 5d  \0>\x20\t\r\n\f]
1fdd0 2a 29 2f 69 20 29 3b 0a 0a 76 61 72 20 72 73 63  *)/i );..var rsc
1fde0 72 69 70 74 54 79 70 65 20 3d 20 28 20 2f 5e 24  riptType = ( /^$
1fdf0 7c 5e 6d 6f 64 75 6c 65 24 7c 5c 2f 28 3f 3a 6a  |^module$|\/(?:j
1fe00 61 76 61 7c 65 63 6d 61 29 73 63 72 69 70 74 2f  ava|ecma)script/
1fe10 69 20 29 3b 0a 0a 0a 0a 28 20 66 75 6e 63 74 69  i );....( functi
1fe20 6f 6e 28 29 20 7b 0a 09 76 61 72 20 66 72 61 67  on() {..var frag
1fe30 6d 65 6e 74 20 3d 20 64 6f 63 75 6d 65 6e 74 2e  ment = document.
1fe40 63 72 65 61 74 65 44 6f 63 75 6d 65 6e 74 46 72  createDocumentFr
1fe50 61 67 6d 65 6e 74 28 29 2c 0a 09 09 64 69 76 20  agment(),...div 
1fe60 3d 20 66 72 61 67 6d 65 6e 74 2e 61 70 70 65 6e  = fragment.appen
1fe70 64 43 68 69 6c 64 28 20 64 6f 63 75 6d 65 6e 74  dChild( document
1fe80 2e 63 72 65 61 74 65 45 6c 65 6d 65 6e 74 28 20  .createElement( 
1fe90 22 64 69 76 22 20 29 20 29 2c 0a 09 09 69 6e 70  "div" ) ),...inp
1fea0 75 74 20 3d 20 64 6f 63 75 6d 65 6e 74 2e 63 72  ut = document.cr
1feb0 65 61 74 65 45 6c 65 6d 65 6e 74 28 20 22 69 6e  eateElement( "in
1fec0 70 75 74 22 20 29 3b 0a 0a 09 2f 2f 20 53 75 70  put" );...// Sup
1fed0 70 6f 72 74 3a 20 41 6e 64 72 6f 69 64 20 34 2e  port: Android 4.
1fee0 30 20 2d 20 34 2e 33 20 6f 6e 6c 79 0a 09 2f 2f  0 - 4.3 only..//
1fef0 20 43 68 65 63 6b 20 73 74 61 74 65 20 6c 6f 73   Check state los
1ff00 74 20 69 66 20 74 68 65 20 6e 61 6d 65 20 69 73  t if the name is
1ff10 20 73 65 74 20 28 23 31 31 32 31 37 29 0a 09 2f   set (#11217)../
1ff20 2f 20 53 75 70 70 6f 72 74 3a 20 57 69 6e 64 6f  / Support: Windo
1ff30 77 73 20 57 65 62 20 41 70 70 73 20 28 57 57 41  ws Web Apps (WWA
1ff40 29 0a 09 2f 2f 20 60 6e 61 6d 65 60 20 61 6e 64  )..// `name` and
1ff50 20 60 74 79 70 65 60 20 6d 75 73 74 20 75 73 65   `type` must use
1ff60 20 2e 73 65 74 41 74 74 72 69 62 75 74 65 20 66   .setAttribute f
1ff70 6f 72 20 57 57 41 20 28 23 31 34 39 30 31 29 0a  or WWA (#14901).
1ff80 09 69 6e 70 75 74 2e 73 65 74 41 74 74 72 69 62  .input.setAttrib
1ff90 75 74 65 28 20 22 74 79 70 65 22 2c 20 22 72 61  ute( "type", "ra
1ffa0 64 69 6f 22 20 29 3b 0a 09 69 6e 70 75 74 2e 73  dio" );..input.s
1ffb0 65 74 41 74 74 72 69 62 75 74 65 28 20 22 63 68  etAttribute( "ch
1ffc0 65 63 6b 65 64 22 2c 20 22 63 68 65 63 6b 65 64  ecked", "checked
1ffd0 22 20 29 3b 0a 09 69 6e 70 75 74 2e 73 65 74 41  " );..input.setA
1ffe0 74 74 72 69 62 75 74 65 28 20 22 6e 61 6d 65 22  ttribute( "name"
1fff0 2c 20 22 74 22 20 29 3b 0a 0a 09 64 69 76 2e 61  , "t" );...div.a
20000 70 70 65 6e 64 43 68 69 6c 64 28 20 69 6e 70 75  ppendChild( inpu
20010 74 20 29 3b 0a 0a 09 2f 2f 20 53 75 70 70 6f 72  t );...// Suppor
20020 74 3a 20 41 6e 64 72 6f 69 64 20 3c 3d 34 2e 31  t: Android <=4.1
20030 20 6f 6e 6c 79 0a 09 2f 2f 20 4f 6c 64 65 72 20   only..// Older 
20040 57 65 62 4b 69 74 20 64 6f 65 73 6e 27 74 20 63  WebKit doesn't c
20050 6c 6f 6e 65 20 63 68 65 63 6b 65 64 20 73 74 61  lone checked sta
20060 74 65 20 63 6f 72 72 65 63 74 6c 79 20 69 6e 20  te correctly in 
20070 66 72 61 67 6d 65 6e 74 73 0a 09 73 75 70 70 6f  fragments..suppo
20080 72 74 2e 63 68 65 63 6b 43 6c 6f 6e 65 20 3d 20  rt.checkClone = 
20090 64 69 76 2e 63 6c 6f 6e 65 4e 6f 64 65 28 20 74  div.cloneNode( t
200a0 72 75 65 20 29 2e 63 6c 6f 6e 65 4e 6f 64 65 28  rue ).cloneNode(
200b0 20 74 72 75 65 20 29 2e 6c 61 73 74 43 68 69 6c   true ).lastChil
200c0 64 2e 63 68 65 63 6b 65 64 3b 0a 0a 09 2f 2f 20  d.checked;...// 
200d0 53 75 70 70 6f 72 74 3a 20 49 45 20 3c 3d 31 31  Support: IE <=11
200e0 20 6f 6e 6c 79 0a 09 2f 2f 20 4d 61 6b 65 20 73   only..// Make s
200f0 75 72 65 20 74 65 78 74 61 72 65 61 20 28 61 6e  ure textarea (an
20100 64 20 63 68 65 63 6b 62 6f 78 29 20 64 65 66 61  d checkbox) defa
20110 75 6c 74 56 61 6c 75 65 20 69 73 20 70 72 6f 70  ultValue is prop
20120 65 72 6c 79 20 63 6c 6f 6e 65 64 0a 09 64 69 76  erly cloned..div
20130 2e 69 6e 6e 65 72 48 54 4d 4c 20 3d 20 22 3c 74  .innerHTML = "<t
20140 65 78 74 61 72 65 61 3e 78 3c 2f 74 65 78 74 61  extarea>x</texta
20150 72 65 61 3e 22 3b 0a 09 73 75 70 70 6f 72 74 2e  rea>";..support.
20160 6e 6f 43 6c 6f 6e 65 43 68 65 63 6b 65 64 20 3d  noCloneChecked =
20170 20 21 21 64 69 76 2e 63 6c 6f 6e 65 4e 6f 64 65   !!div.cloneNode
20180 28 20 74 72 75 65 20 29 2e 6c 61 73 74 43 68 69  ( true ).lastChi
20190 6c 64 2e 64 65 66 61 75 6c 74 56 61 6c 75 65 3b  ld.defaultValue;
201a0 0a 0a 09 2f 2f 20 53 75 70 70 6f 72 74 3a 20 49  ...// Support: I
201b0 45 20 3c 3d 39 20 6f 6e 6c 79 0a 09 2f 2f 20 49  E <=9 only..// I
201c0 45 20 3c 3d 39 20 72 65 70 6c 61 63 65 73 20 3c  E <=9 replaces <
201d0 6f 70 74 69 6f 6e 3e 20 74 61 67 73 20 77 69 74  option> tags wit
201e0 68 20 74 68 65 69 72 20 63 6f 6e 74 65 6e 74 73  h their contents
201f0 20 77 68 65 6e 20 69 6e 73 65 72 74 65 64 20 6f   when inserted o
20200 75 74 73 69 64 65 20 6f 66 0a 09 2f 2f 20 74 68  utside of..// th
20210 65 20 73 65 6c 65 63 74 20 65 6c 65 6d 65 6e 74  e select element
20220 2e 0a 09 64 69 76 2e 69 6e 6e 65 72 48 54 4d 4c  ...div.innerHTML
20230 20 3d 20 22 3c 6f 70 74 69 6f 6e 3e 3c 2f 6f 70   = "<option></op
20240 74 69 6f 6e 3e 22 3b 0a 09 73 75 70 70 6f 72 74  tion>";..support
20250 2e 6f 70 74 69 6f 6e 20 3d 20 21 21 64 69 76 2e  .option = !!div.
20260 6c 61 73 74 43 68 69 6c 64 3b 0a 7d 20 29 28 29  lastChild;.} )()
20270 3b 0a 0a 0a 2f 2f 20 57 65 20 68 61 76 65 20 74  ;...// We have t
20280 6f 20 63 6c 6f 73 65 20 74 68 65 73 65 20 74 61  o close these ta
20290 67 73 20 74 6f 20 73 75 70 70 6f 72 74 20 58 48  gs to support XH
202a0 54 4d 4c 20 28 23 31 33 32 30 30 29 0a 76 61 72  TML (#13200).var
202b0 20 77 72 61 70 4d 61 70 20 3d 20 7b 0a 0a 09 2f   wrapMap = {.../
202c0 2f 20 58 48 54 4d 4c 20 70 61 72 73 65 72 73 20  / XHTML parsers 
202d0 64 6f 20 6e 6f 74 20 6d 61 67 69 63 61 6c 6c 79  do not magically
202e0 20 69 6e 73 65 72 74 20 65 6c 65 6d 65 6e 74 73   insert elements
202f0 20 69 6e 20 74 68 65 0a 09 2f 2f 20 73 61 6d 65   in the..// same
20300 20 77 61 79 20 74 68 61 74 20 74 61 67 20 73 6f   way that tag so
20310 75 70 20 70 61 72 73 65 72 73 20 64 6f 2e 20 53  up parsers do. S
20320 6f 20 77 65 20 63 61 6e 6e 6f 74 20 73 68 6f 72  o we cannot shor
20330 74 65 6e 0a 09 2f 2f 20 74 68 69 73 20 62 79 20  ten..// this by 
20340 6f 6d 69 74 74 69 6e 67 20 3c 74 62 6f 64 79 3e  omitting <tbody>
20350 20 6f 72 20 6f 74 68 65 72 20 72 65 71 75 69 72   or other requir
20360 65 64 20 65 6c 65 6d 65 6e 74 73 2e 0a 09 74 68  ed elements...th
20370 65 61 64 3a 20 5b 20 31 2c 20 22 3c 74 61 62 6c  ead: [ 1, "<tabl
20380 65 3e 22 2c 20 22 3c 2f 74 61 62 6c 65 3e 22 20  e>", "</table>" 
20390 5d 2c 0a 09 63 6f 6c 3a 20 5b 20 32 2c 20 22 3c  ],..col: [ 2, "<
203a0 74 61 62 6c 65 3e 3c 63 6f 6c 67 72 6f 75 70 3e  table><colgroup>
203b0 22 2c 20 22 3c 2f 63 6f 6c 67 72 6f 75 70 3e 3c  ", "</colgroup><
203c0 2f 74 61 62 6c 65 3e 22 20 5d 2c 0a 09 74 72 3a  /table>" ],..tr:
203d0 20 5b 20 32 2c 20 22 3c 74 61 62 6c 65 3e 3c 74   [ 2, "<table><t
203e0 62 6f 64 79 3e 22 2c 20 22 3c 2f 74 62 6f 64 79  body>", "</tbody
203f0 3e 3c 2f 74 61 62 6c 65 3e 22 20 5d 2c 0a 09 74  ></table>" ],..t
20400 64 3a 20 5b 20 33 2c 20 22 3c 74 61 62 6c 65 3e  d: [ 3, "<table>
20410 3c 74 62 6f 64 79 3e 3c 74 72 3e 22 2c 20 22 3c  <tbody><tr>", "<
20420 2f 74 72 3e 3c 2f 74 62 6f 64 79 3e 3c 2f 74 61  /tr></tbody></ta
20430 62 6c 65 3e 22 20 5d 2c 0a 0a 09 5f 64 65 66 61  ble>" ],..._defa
20440 75 6c 74 3a 20 5b 20 30 2c 20 22 22 2c 20 22 22  ult: [ 0, "", ""
20450 20 5d 0a 7d 3b 0a 0a 77 72 61 70 4d 61 70 2e 74   ].};..wrapMap.t
20460 62 6f 64 79 20 3d 20 77 72 61 70 4d 61 70 2e 74  body = wrapMap.t
20470 66 6f 6f 74 20 3d 20 77 72 61 70 4d 61 70 2e 63  foot = wrapMap.c
20480 6f 6c 67 72 6f 75 70 20 3d 20 77 72 61 70 4d 61  olgroup = wrapMa
20490 70 2e 63 61 70 74 69 6f 6e 20 3d 20 77 72 61 70  p.caption = wrap
204a0 4d 61 70 2e 74 68 65 61 64 3b 0a 77 72 61 70 4d  Map.thead;.wrapM
204b0 61 70 2e 74 68 20 3d 20 77 72 61 70 4d 61 70 2e  ap.th = wrapMap.
204c0 74 64 3b 0a 0a 2f 2f 20 53 75 70 70 6f 72 74 3a  td;..// Support:
204d0 20 49 45 20 3c 3d 39 20 6f 6e 6c 79 0a 69 66 20   IE <=9 only.if 
204e0 28 20 21 73 75 70 70 6f 72 74 2e 6f 70 74 69 6f  ( !support.optio
204f0 6e 20 29 20 7b 0a 09 77 72 61 70 4d 61 70 2e 6f  n ) {..wrapMap.o
20500 70 74 67 72 6f 75 70 20 3d 20 77 72 61 70 4d 61  ptgroup = wrapMa
20510 70 2e 6f 70 74 69 6f 6e 20 3d 20 5b 20 31 2c 20  p.option = [ 1, 
20520 22 3c 73 65 6c 65 63 74 20 6d 75 6c 74 69 70 6c  "<select multipl
20530 65 3d 27 6d 75 6c 74 69 70 6c 65 27 3e 22 2c 20  e='multiple'>", 
20540 22 3c 2f 73 65 6c 65 63 74 3e 22 20 5d 3b 0a 7d  "</select>" ];.}
20550 0a 0a 0a 66 75 6e 63 74 69 6f 6e 20 67 65 74 41  ...function getA
20560 6c 6c 28 20 63 6f 6e 74 65 78 74 2c 20 74 61 67  ll( context, tag
20570 20 29 20 7b 0a 0a 09 2f 2f 20 53 75 70 70 6f 72   ) {...// Suppor
20580 74 3a 20 49 45 20 3c 3d 39 20 2d 20 31 31 20 6f  t: IE <=9 - 11 o
20590 6e 6c 79 0a 09 2f 2f 20 55 73 65 20 74 79 70 65  nly..// Use type
205a0 6f 66 20 74 6f 20 61 76 6f 69 64 20 7a 65 72 6f  of to avoid zero
205b0 2d 61 72 67 75 6d 65 6e 74 20 6d 65 74 68 6f 64  -argument method
205c0 20 69 6e 76 6f 63 61 74 69 6f 6e 20 6f 6e 20 68   invocation on h
205d0 6f 73 74 20 6f 62 6a 65 63 74 73 20 28 23 31 35  ost objects (#15
205e0 31 35 31 29 0a 09 76 61 72 20 72 65 74 3b 0a 0a  151)..var ret;..
205f0 09 69 66 20 28 20 74 79 70 65 6f 66 20 63 6f 6e  .if ( typeof con
20600 74 65 78 74 2e 67 65 74 45 6c 65 6d 65 6e 74 73  text.getElements
20610 42 79 54 61 67 4e 61 6d 65 20 21 3d 3d 20 22 75  ByTagName !== "u
20620 6e 64 65 66 69 6e 65 64 22 20 29 20 7b 0a 09 09  ndefined" ) {...
20630 72 65 74 20 3d 20 63 6f 6e 74 65 78 74 2e 67 65  ret = context.ge
20640 74 45 6c 65 6d 65 6e 74 73 42 79 54 61 67 4e 61  tElementsByTagNa
20650 6d 65 28 20 74 61 67 20 7c 7c 20 22 2a 22 20 29  me( tag || "*" )
20660 3b 0a 0a 09 7d 20 65 6c 73 65 20 69 66 20 28 20  ;...} else if ( 
20670 74 79 70 65 6f 66 20 63 6f 6e 74 65 78 74 2e 71  typeof context.q
20680 75 65 72 79 53 65 6c 65 63 74 6f 72 41 6c 6c 20  uerySelectorAll 
20690 21 3d 3d 20 22 75 6e 64 65 66 69 6e 65 64 22 20  !== "undefined" 
206a0 29 20 7b 0a 09 09 72 65 74 20 3d 20 63 6f 6e 74  ) {...ret = cont
206b0 65 78 74 2e 71 75 65 72 79 53 65 6c 65 63 74 6f  ext.querySelecto
206c0 72 41 6c 6c 28 20 74 61 67 20 7c 7c 20 22 2a 22  rAll( tag || "*"
206d0 20 29 3b 0a 0a 09 7d 20 65 6c 73 65 20 7b 0a 09   );...} else {..
206e0 09 72 65 74 20 3d 20 5b 5d 3b 0a 09 7d 0a 0a 09  .ret = [];..}...
206f0 69 66 20 28 20 74 61 67 20 3d 3d 3d 20 75 6e 64  if ( tag === und
20700 65 66 69 6e 65 64 20 7c 7c 20 74 61 67 20 26 26  efined || tag &&
20710 20 6e 6f 64 65 4e 61 6d 65 28 20 63 6f 6e 74 65   nodeName( conte
20720 78 74 2c 20 74 61 67 20 29 20 29 20 7b 0a 09 09  xt, tag ) ) {...
20730 72 65 74 75 72 6e 20 6a 51 75 65 72 79 2e 6d 65  return jQuery.me
20740 72 67 65 28 20 5b 20 63 6f 6e 74 65 78 74 20 5d  rge( [ context ]
20750 2c 20 72 65 74 20 29 3b 0a 09 7d 0a 0a 09 72 65  , ret );..}...re
20760 74 75 72 6e 20 72 65 74 3b 0a 7d 0a 0a 0a 2f 2f  turn ret;.}...//
20770 20 4d 61 72 6b 20 73 63 72 69 70 74 73 20 61 73   Mark scripts as
20780 20 68 61 76 69 6e 67 20 61 6c 72 65 61 64 79 20   having already 
20790 62 65 65 6e 20 65 76 61 6c 75 61 74 65 64 0a 66  been evaluated.f
207a0 75 6e 63 74 69 6f 6e 20 73 65 74 47 6c 6f 62 61  unction setGloba
207b0 6c 45 76 61 6c 28 20 65 6c 65 6d 73 2c 20 72 65  lEval( elems, re
207c0 66 45 6c 65 6d 65 6e 74 73 20 29 20 7b 0a 09 76  fElements ) {..v
207d0 61 72 20 69 20 3d 20 30 2c 0a 09 09 6c 20 3d 20  ar i = 0,...l = 
207e0 65 6c 65 6d 73 2e 6c 65 6e 67 74 68 3b 0a 0a 09  elems.length;...
207f0 66 6f 72 20 28 20 3b 20 69 20 3c 20 6c 3b 20 69  for ( ; i < l; i
20800 2b 2b 20 29 20 7b 0a 09 09 64 61 74 61 50 72 69  ++ ) {...dataPri
20810 76 2e 73 65 74 28 0a 09 09 09 65 6c 65 6d 73 5b  v.set(....elems[
20820 20 69 20 5d 2c 0a 09 09 09 22 67 6c 6f 62 61 6c   i ],...."global
20830 45 76 61 6c 22 2c 0a 09 09 09 21 72 65 66 45 6c  Eval",....!refEl
20840 65 6d 65 6e 74 73 20 7c 7c 20 64 61 74 61 50 72  ements || dataPr
20850 69 76 2e 67 65 74 28 20 72 65 66 45 6c 65 6d 65  iv.get( refEleme
20860 6e 74 73 5b 20 69 20 5d 2c 20 22 67 6c 6f 62 61  nts[ i ], "globa
20870 6c 45 76 61 6c 22 20 29 0a 09 09 29 3b 0a 09 7d  lEval" )...);..}
20880 0a 7d 0a 0a 0a 76 61 72 20 72 68 74 6d 6c 20 3d  .}...var rhtml =
20890 20 2f 3c 7c 26 23 3f 5c 77 2b 3b 2f 3b 0a 0a 66   /<|&#?\w+;/;..f
208a0 75 6e 63 74 69 6f 6e 20 62 75 69 6c 64 46 72 61  unction buildFra
208b0 67 6d 65 6e 74 28 20 65 6c 65 6d 73 2c 20 63 6f  gment( elems, co
208c0 6e 74 65 78 74 2c 20 73 63 72 69 70 74 73 2c 20  ntext, scripts, 
208d0 73 65 6c 65 63 74 69 6f 6e 2c 20 69 67 6e 6f 72  selection, ignor
208e0 65 64 20 29 20 7b 0a 09 76 61 72 20 65 6c 65 6d  ed ) {..var elem
208f0 2c 20 74 6d 70 2c 20 74 61 67 2c 20 77 72 61 70  , tmp, tag, wrap
20900 2c 20 61 74 74 61 63 68 65 64 2c 20 6a 2c 0a 09  , attached, j,..
20910 09 66 72 61 67 6d 65 6e 74 20 3d 20 63 6f 6e 74  .fragment = cont
20920 65 78 74 2e 63 72 65 61 74 65 44 6f 63 75 6d 65  ext.createDocume
20930 6e 74 46 72 61 67 6d 65 6e 74 28 29 2c 0a 09 09  ntFragment(),...
20940 6e 6f 64 65 73 20 3d 20 5b 5d 2c 0a 09 09 69 20  nodes = [],...i 
20950 3d 20 30 2c 0a 09 09 6c 20 3d 20 65 6c 65 6d 73  = 0,...l = elems
20960 2e 6c 65 6e 67 74 68 3b 0a 0a 09 66 6f 72 20 28  .length;...for (
20970 20 3b 20 69 20 3c 20 6c 3b 20 69 2b 2b 20 29 20   ; i < l; i++ ) 
20980 7b 0a 09 09 65 6c 65 6d 20 3d 20 65 6c 65 6d 73  {...elem = elems
20990 5b 20 69 20 5d 3b 0a 0a 09 09 69 66 20 28 20 65  [ i ];....if ( e
209a0 6c 65 6d 20 7c 7c 20 65 6c 65 6d 20 3d 3d 3d 20  lem || elem === 
209b0 30 20 29 20 7b 0a 0a 09 09 09 2f 2f 20 41 64 64  0 ) {.....// Add
209c0 20 6e 6f 64 65 73 20 64 69 72 65 63 74 6c 79 0a   nodes directly.
209d0 09 09 09 69 66 20 28 20 74 6f 54 79 70 65 28 20  ...if ( toType( 
209e0 65 6c 65 6d 20 29 20 3d 3d 3d 20 22 6f 62 6a 65  elem ) === "obje
209f0 63 74 22 20 29 20 7b 0a 0a 09 09 09 09 2f 2f 20  ct" ) {......// 
20a00 53 75 70 70 6f 72 74 3a 20 41 6e 64 72 6f 69 64  Support: Android
20a10 20 3c 3d 34 2e 30 20 6f 6e 6c 79 2c 20 50 68 61   <=4.0 only, Pha
20a20 6e 74 6f 6d 4a 53 20 31 20 6f 6e 6c 79 0a 09 09  ntomJS 1 only...
20a30 09 09 2f 2f 20 70 75 73 68 2e 61 70 70 6c 79 28  ..// push.apply(
20a40 5f 2c 20 61 72 72 61 79 6c 69 6b 65 29 20 74 68  _, arraylike) th
20a50 72 6f 77 73 20 6f 6e 20 61 6e 63 69 65 6e 74 20  rows on ancient 
20a60 57 65 62 4b 69 74 0a 09 09 09 09 6a 51 75 65 72  WebKit.....jQuer
20a70 79 2e 6d 65 72 67 65 28 20 6e 6f 64 65 73 2c 20  y.merge( nodes, 
20a80 65 6c 65 6d 2e 6e 6f 64 65 54 79 70 65 20 3f 20  elem.nodeType ? 
20a90 5b 20 65 6c 65 6d 20 5d 20 3a 20 65 6c 65 6d 20  [ elem ] : elem 
20aa0 29 3b 0a 0a 09 09 09 2f 2f 20 43 6f 6e 76 65 72  );.....// Conver
20ab0 74 20 6e 6f 6e 2d 68 74 6d 6c 20 69 6e 74 6f 20  t non-html into 
20ac0 61 20 74 65 78 74 20 6e 6f 64 65 0a 09 09 09 7d  a text node....}
20ad0 20 65 6c 73 65 20 69 66 20 28 20 21 72 68 74 6d   else if ( !rhtm
20ae0 6c 2e 74 65 73 74 28 20 65 6c 65 6d 20 29 20 29  l.test( elem ) )
20af0 20 7b 0a 09 09 09 09 6e 6f 64 65 73 2e 70 75 73   {.....nodes.pus
20b00 68 28 20 63 6f 6e 74 65 78 74 2e 63 72 65 61 74  h( context.creat
20b10 65 54 65 78 74 4e 6f 64 65 28 20 65 6c 65 6d 20  eTextNode( elem 
20b20 29 20 29 3b 0a 0a 09 09 09 2f 2f 20 43 6f 6e 76  ) );.....// Conv
20b30 65 72 74 20 68 74 6d 6c 20 69 6e 74 6f 20 44 4f  ert html into DO
20b40 4d 20 6e 6f 64 65 73 0a 09 09 09 7d 20 65 6c 73  M nodes....} els
20b50 65 20 7b 0a 09 09 09 09 74 6d 70 20 3d 20 74 6d  e {.....tmp = tm
20b60 70 20 7c 7c 20 66 72 61 67 6d 65 6e 74 2e 61 70  p || fragment.ap
20b70 70 65 6e 64 43 68 69 6c 64 28 20 63 6f 6e 74 65  pendChild( conte
20b80 78 74 2e 63 72 65 61 74 65 45 6c 65 6d 65 6e 74  xt.createElement
20b90 28 20 22 64 69 76 22 20 29 20 29 3b 0a 0a 09 09  ( "div" ) );....
20ba0 09 09 2f 2f 20 44 65 73 65 72 69 61 6c 69 7a 65  ..// Deserialize
20bb0 20 61 20 73 74 61 6e 64 61 72 64 20 72 65 70 72   a standard repr
20bc0 65 73 65 6e 74 61 74 69 6f 6e 0a 09 09 09 09 74  esentation.....t
20bd0 61 67 20 3d 20 28 20 72 74 61 67 4e 61 6d 65 2e  ag = ( rtagName.
20be0 65 78 65 63 28 20 65 6c 65 6d 20 29 20 7c 7c 20  exec( elem ) || 
20bf0 5b 20 22 22 2c 20 22 22 20 5d 20 29 5b 20 31 20  [ "", "" ] )[ 1 
20c00 5d 2e 74 6f 4c 6f 77 65 72 43 61 73 65 28 29 3b  ].toLowerCase();
20c10 0a 09 09 09 09 77 72 61 70 20 3d 20 77 72 61 70  .....wrap = wrap
20c20 4d 61 70 5b 20 74 61 67 20 5d 20 7c 7c 20 77 72  Map[ tag ] || wr
20c30 61 70 4d 61 70 2e 5f 64 65 66 61 75 6c 74 3b 0a  apMap._default;.
20c40 09 09 09 09 74 6d 70 2e 69 6e 6e 65 72 48 54 4d  ....tmp.innerHTM
20c50 4c 20 3d 20 77 72 61 70 5b 20 31 20 5d 20 2b 20  L = wrap[ 1 ] + 
20c60 6a 51 75 65 72 79 2e 68 74 6d 6c 50 72 65 66 69  jQuery.htmlPrefi
20c70 6c 74 65 72 28 20 65 6c 65 6d 20 29 20 2b 20 77  lter( elem ) + w
20c80 72 61 70 5b 20 32 20 5d 3b 0a 0a 09 09 09 09 2f  rap[ 2 ];....../
20c90 2f 20 44 65 73 63 65 6e 64 20 74 68 72 6f 75 67  / Descend throug
20ca0 68 20 77 72 61 70 70 65 72 73 20 74 6f 20 74 68  h wrappers to th
20cb0 65 20 72 69 67 68 74 20 63 6f 6e 74 65 6e 74 0a  e right content.
20cc0 09 09 09 09 6a 20 3d 20 77 72 61 70 5b 20 30 20  ....j = wrap[ 0 
20cd0 5d 3b 0a 09 09 09 09 77 68 69 6c 65 20 28 20 6a  ];.....while ( j
20ce0 2d 2d 20 29 20 7b 0a 09 09 09 09 09 74 6d 70 20  -- ) {......tmp 
20cf0 3d 20 74 6d 70 2e 6c 61 73 74 43 68 69 6c 64 3b  = tmp.lastChild;
20d00 0a 09 09 09 09 7d 0a 0a 09 09 09 09 2f 2f 20 53  .....}......// S
20d10 75 70 70 6f 72 74 3a 20 41 6e 64 72 6f 69 64 20  upport: Android 
20d20 3c 3d 34 2e 30 20 6f 6e 6c 79 2c 20 50 68 61 6e  <=4.0 only, Phan
20d30 74 6f 6d 4a 53 20 31 20 6f 6e 6c 79 0a 09 09 09  tomJS 1 only....
20d40 09 2f 2f 20 70 75 73 68 2e 61 70 70 6c 79 28 5f  .// push.apply(_
20d50 2c 20 61 72 72 61 79 6c 69 6b 65 29 20 74 68 72  , arraylike) thr
20d60 6f 77 73 20 6f 6e 20 61 6e 63 69 65 6e 74 20 57  ows on ancient W
20d70 65 62 4b 69 74 0a 09 09 09 09 6a 51 75 65 72 79  ebKit.....jQuery
20d80 2e 6d 65 72 67 65 28 20 6e 6f 64 65 73 2c 20 74  .merge( nodes, t
20d90 6d 70 2e 63 68 69 6c 64 4e 6f 64 65 73 20 29 3b  mp.childNodes );
20da0 0a 0a 09 09 09 09 2f 2f 20 52 65 6d 65 6d 62 65  ......// Remembe
20db0 72 20 74 68 65 20 74 6f 70 2d 6c 65 76 65 6c 20  r the top-level 
20dc0 63 6f 6e 74 61 69 6e 65 72 0a 09 09 09 09 74 6d  container.....tm
20dd0 70 20 3d 20 66 72 61 67 6d 65 6e 74 2e 66 69 72  p = fragment.fir
20de0 73 74 43 68 69 6c 64 3b 0a 0a 09 09 09 09 2f 2f  stChild;......//
20df0 20 45 6e 73 75 72 65 20 74 68 65 20 63 72 65 61   Ensure the crea
20e00 74 65 64 20 6e 6f 64 65 73 20 61 72 65 20 6f 72  ted nodes are or
20e10 70 68 61 6e 65 64 20 28 23 31 32 33 39 32 29 0a  phaned (#12392).
20e20 09 09 09 09 74 6d 70 2e 74 65 78 74 43 6f 6e 74  ....tmp.textCont
20e30 65 6e 74 20 3d 20 22 22 3b 0a 09 09 09 7d 0a 09  ent = "";....}..
20e40 09 7d 0a 09 7d 0a 0a 09 2f 2f 20 52 65 6d 6f 76  .}..}...// Remov
20e50 65 20 77 72 61 70 70 65 72 20 66 72 6f 6d 20 66  e wrapper from f
20e60 72 61 67 6d 65 6e 74 0a 09 66 72 61 67 6d 65 6e  ragment..fragmen
20e70 74 2e 74 65 78 74 43 6f 6e 74 65 6e 74 20 3d 20  t.textContent = 
20e80 22 22 3b 0a 0a 09 69 20 3d 20 30 3b 0a 09 77 68  "";...i = 0;..wh
20e90 69 6c 65 20 28 20 28 20 65 6c 65 6d 20 3d 20 6e  ile ( ( elem = n
20ea0 6f 64 65 73 5b 20 69 2b 2b 20 5d 20 29 20 29 20  odes[ i++ ] ) ) 
20eb0 7b 0a 0a 09 09 2f 2f 20 53 6b 69 70 20 65 6c 65  {....// Skip ele
20ec0 6d 65 6e 74 73 20 61 6c 72 65 61 64 79 20 69 6e  ments already in
20ed0 20 74 68 65 20 63 6f 6e 74 65 78 74 20 63 6f 6c   the context col
20ee0 6c 65 63 74 69 6f 6e 20 28 74 72 61 63 2d 34 30  lection (trac-40
20ef0 38 37 29 0a 09 09 69 66 20 28 20 73 65 6c 65 63  87)...if ( selec
20f00 74 69 6f 6e 20 26 26 20 6a 51 75 65 72 79 2e 69  tion && jQuery.i
20f10 6e 41 72 72 61 79 28 20 65 6c 65 6d 2c 20 73 65  nArray( elem, se
20f20 6c 65 63 74 69 6f 6e 20 29 20 3e 20 2d 31 20 29  lection ) > -1 )
20f30 20 7b 0a 09 09 09 69 66 20 28 20 69 67 6e 6f 72   {....if ( ignor
20f40 65 64 20 29 20 7b 0a 09 09 09 09 69 67 6e 6f 72  ed ) {.....ignor
20f50 65 64 2e 70 75 73 68 28 20 65 6c 65 6d 20 29 3b  ed.push( elem );
20f60 0a 09 09 09 7d 0a 09 09 09 63 6f 6e 74 69 6e 75  ....}....continu
20f70 65 3b 0a 09 09 7d 0a 0a 09 09 61 74 74 61 63 68  e;...}....attach
20f80 65 64 20 3d 20 69 73 41 74 74 61 63 68 65 64 28  ed = isAttached(
20f90 20 65 6c 65 6d 20 29 3b 0a 0a 09 09 2f 2f 20 41   elem );....// A
20fa0 70 70 65 6e 64 20 74 6f 20 66 72 61 67 6d 65 6e  ppend to fragmen
20fb0 74 0a 09 09 74 6d 70 20 3d 20 67 65 74 41 6c 6c  t...tmp = getAll
20fc0 28 20 66 72 61 67 6d 65 6e 74 2e 61 70 70 65 6e  ( fragment.appen
20fd0 64 43 68 69 6c 64 28 20 65 6c 65 6d 20 29 2c 20  dChild( elem ), 
20fe0 22 73 63 72 69 70 74 22 20 29 3b 0a 0a 09 09 2f  "script" );..../
20ff0 2f 20 50 72 65 73 65 72 76 65 20 73 63 72 69 70  / Preserve scrip
21000 74 20 65 76 61 6c 75 61 74 69 6f 6e 20 68 69 73  t evaluation his
21010 74 6f 72 79 0a 09 09 69 66 20 28 20 61 74 74 61  tory...if ( atta
21020 63 68 65 64 20 29 20 7b 0a 09 09 09 73 65 74 47  ched ) {....setG
21030 6c 6f 62 61 6c 45 76 61 6c 28 20 74 6d 70 20 29  lobalEval( tmp )
21040 3b 0a 09 09 7d 0a 0a 09 09 2f 2f 20 43 61 70 74  ;...}....// Capt
21050 75 72 65 20 65 78 65 63 75 74 61 62 6c 65 73 0a  ure executables.
21060 09 09 69 66 20 28 20 73 63 72 69 70 74 73 20 29  ..if ( scripts )
21070 20 7b 0a 09 09 09 6a 20 3d 20 30 3b 0a 09 09 09   {....j = 0;....
21080 77 68 69 6c 65 20 28 20 28 20 65 6c 65 6d 20 3d  while ( ( elem =
21090 20 74 6d 70 5b 20 6a 2b 2b 20 5d 20 29 20 29 20   tmp[ j++ ] ) ) 
210a0 7b 0a 09 09 09 09 69 66 20 28 20 72 73 63 72 69  {.....if ( rscri
210b0 70 74 54 79 70 65 2e 74 65 73 74 28 20 65 6c 65  ptType.test( ele
210c0 6d 2e 74 79 70 65 20 7c 7c 20 22 22 20 29 20 29  m.type || "" ) )
210d0 20 7b 0a 09 09 09 09 09 73 63 72 69 70 74 73 2e   {......scripts.
210e0 70 75 73 68 28 20 65 6c 65 6d 20 29 3b 0a 09 09  push( elem );...
210f0 09 09 7d 0a 09 09 09 7d 0a 09 09 7d 0a 09 7d 0a  ..}....}...}..}.
21100 0a 09 72 65 74 75 72 6e 20 66 72 61 67 6d 65 6e  ..return fragmen
21110 74 3b 0a 7d 0a 0a 0a 76 61 72 0a 09 72 6b 65 79  t;.}...var..rkey
21120 45 76 65 6e 74 20 3d 20 2f 5e 6b 65 79 2f 2c 0a  Event = /^key/,.
21130 09 72 6d 6f 75 73 65 45 76 65 6e 74 20 3d 20 2f  .rmouseEvent = /
21140 5e 28 3f 3a 6d 6f 75 73 65 7c 70 6f 69 6e 74 65  ^(?:mouse|pointe
21150 72 7c 63 6f 6e 74 65 78 74 6d 65 6e 75 7c 64 72  r|contextmenu|dr
21160 61 67 7c 64 72 6f 70 29 7c 63 6c 69 63 6b 2f 2c  ag|drop)|click/,
21170 0a 09 72 74 79 70 65 6e 61 6d 65 73 70 61 63 65  ..rtypenamespace
21180 20 3d 20 2f 5e 28 5b 5e 2e 5d 2a 29 28 3f 3a 5c   = /^([^.]*)(?:\
21190 2e 28 2e 2b 29 7c 29 2f 3b 0a 0a 66 75 6e 63 74  .(.+)|)/;..funct
211a0 69 6f 6e 20 72 65 74 75 72 6e 54 72 75 65 28 29  ion returnTrue()
211b0 20 7b 0a 09 72 65 74 75 72 6e 20 74 72 75 65 3b   {..return true;
211c0 0a 7d 0a 0a 66 75 6e 63 74 69 6f 6e 20 72 65 74  .}..function ret
211d0 75 72 6e 46 61 6c 73 65 28 29 20 7b 0a 09 72 65  urnFalse() {..re
211e0 74 75 72 6e 20 66 61 6c 73 65 3b 0a 7d 0a 0a 2f  turn false;.}../
211f0 2f 20 53 75 70 70 6f 72 74 3a 20 49 45 20 3c 3d  / Support: IE <=
21200 39 20 2d 20 31 31 2b 0a 2f 2f 20 66 6f 63 75 73  9 - 11+.// focus
21210 28 29 20 61 6e 64 20 62 6c 75 72 28 29 20 61 72  () and blur() ar
21220 65 20 61 73 79 6e 63 68 72 6f 6e 6f 75 73 2c 20  e asynchronous, 
21230 65 78 63 65 70 74 20 77 68 65 6e 20 74 68 65 79  except when they
21240 20 61 72 65 20 6e 6f 2d 6f 70 2e 0a 2f 2f 20 53   are no-op..// S
21250 6f 20 65 78 70 65 63 74 20 66 6f 63 75 73 20 74  o expect focus t
21260 6f 20 62 65 20 73 79 6e 63 68 72 6f 6e 6f 75 73  o be synchronous
21270 20 77 68 65 6e 20 74 68 65 20 65 6c 65 6d 65 6e   when the elemen
21280 74 20 69 73 20 61 6c 72 65 61 64 79 20 61 63 74  t is already act
21290 69 76 65 2c 0a 2f 2f 20 61 6e 64 20 62 6c 75 72  ive,.// and blur
212a0 20 74 6f 20 62 65 20 73 79 6e 63 68 72 6f 6e 6f   to be synchrono
212b0 75 73 20 77 68 65 6e 20 74 68 65 20 65 6c 65 6d  us when the elem
212c0 65 6e 74 20 69 73 20 6e 6f 74 20 61 6c 72 65 61  ent is not alrea
212d0 64 79 20 61 63 74 69 76 65 2e 0a 2f 2f 20 28 66  dy active..// (f
212e0 6f 63 75 73 20 61 6e 64 20 62 6c 75 72 20 61 72  ocus and blur ar
212f0 65 20 61 6c 77 61 79 73 20 73 79 6e 63 68 72 6f  e always synchro
21300 6e 6f 75 73 20 69 6e 20 6f 74 68 65 72 20 73 75  nous in other su
21310 70 70 6f 72 74 65 64 20 62 72 6f 77 73 65 72 73  pported browsers
21320 2c 0a 2f 2f 20 74 68 69 73 20 6a 75 73 74 20 64  ,.// this just d
21330 65 66 69 6e 65 73 20 77 68 65 6e 20 77 65 20 63  efines when we c
21340 61 6e 20 63 6f 75 6e 74 20 6f 6e 20 69 74 29 2e  an count on it).
21350 0a 66 75 6e 63 74 69 6f 6e 20 65 78 70 65 63 74  .function expect
21360 53 79 6e 63 28 20 65 6c 65 6d 2c 20 74 79 70 65  Sync( elem, type
21370 20 29 20 7b 0a 09 72 65 74 75 72 6e 20 28 20 65   ) {..return ( e
21380 6c 65 6d 20 3d 3d 3d 20 73 61 66 65 41 63 74 69  lem === safeActi
21390 76 65 45 6c 65 6d 65 6e 74 28 29 20 29 20 3d 3d  veElement() ) ==
213a0 3d 20 28 20 74 79 70 65 20 3d 3d 3d 20 22 66 6f  = ( type === "fo
213b0 63 75 73 22 20 29 3b 0a 7d 0a 0a 2f 2f 20 53 75  cus" );.}..// Su
213c0 70 70 6f 72 74 3a 20 49 45 20 3c 3d 39 20 6f 6e  pport: IE <=9 on
213d0 6c 79 0a 2f 2f 20 41 63 63 65 73 73 69 6e 67 20  ly.// Accessing 
213e0 64 6f 63 75 6d 65 6e 74 2e 61 63 74 69 76 65 45  document.activeE
213f0 6c 65 6d 65 6e 74 20 63 61 6e 20 74 68 72 6f 77  lement can throw
21400 20 75 6e 65 78 70 65 63 74 65 64 6c 79 0a 2f 2f   unexpectedly.//
21410 20 68 74 74 70 73 3a 2f 2f 62 75 67 73 2e 6a 71   https://bugs.jq
21420 75 65 72 79 2e 63 6f 6d 2f 74 69 63 6b 65 74 2f  uery.com/ticket/
21430 31 33 33 39 33 0a 66 75 6e 63 74 69 6f 6e 20 73  13393.function s
21440 61 66 65 41 63 74 69 76 65 45 6c 65 6d 65 6e 74  afeActiveElement
21450 28 29 20 7b 0a 09 74 72 79 20 7b 0a 09 09 72 65  () {..try {...re
21460 74 75 72 6e 20 64 6f 63 75 6d 65 6e 74 2e 61 63  turn document.ac
21470 74 69 76 65 45 6c 65 6d 65 6e 74 3b 0a 09 7d 20  tiveElement;..} 
21480 63 61 74 63 68 20 28 20 65 72 72 20 29 20 7b 20  catch ( err ) { 
21490 7d 0a 7d 0a 0a 66 75 6e 63 74 69 6f 6e 20 6f 6e  }.}..function on
214a0 28 20 65 6c 65 6d 2c 20 74 79 70 65 73 2c 20 73  ( elem, types, s
214b0 65 6c 65 63 74 6f 72 2c 20 64 61 74 61 2c 20 66  elector, data, f
214c0 6e 2c 20 6f 6e 65 20 29 20 7b 0a 09 76 61 72 20  n, one ) {..var 
214d0 6f 72 69 67 46 6e 2c 20 74 79 70 65 3b 0a 0a 09  origFn, type;...
214e0 2f 2f 20 54 79 70 65 73 20 63 61 6e 20 62 65 20  // Types can be 
214f0 61 20 6d 61 70 20 6f 66 20 74 79 70 65 73 2f 68  a map of types/h
21500 61 6e 64 6c 65 72 73 0a 09 69 66 20 28 20 74 79  andlers..if ( ty
21510 70 65 6f 66 20 74 79 70 65 73 20 3d 3d 3d 20 22  peof types === "
21520 6f 62 6a 65 63 74 22 20 29 20 7b 0a 0a 09 09 2f  object" ) {..../
21530 2f 20 28 20 74 79 70 65 73 2d 4f 62 6a 65 63 74  / ( types-Object
21540 2c 20 73 65 6c 65 63 74 6f 72 2c 20 64 61 74 61  , selector, data
21550 20 29 0a 09 09 69 66 20 28 20 74 79 70 65 6f 66   )...if ( typeof
21560 20 73 65 6c 65 63 74 6f 72 20 21 3d 3d 20 22 73   selector !== "s
21570 74 72 69 6e 67 22 20 29 20 7b 0a 0a 09 09 09 2f  tring" ) {...../
21580 2f 20 28 20 74 79 70 65 73 2d 4f 62 6a 65 63 74  / ( types-Object
21590 2c 20 64 61 74 61 20 29 0a 09 09 09 64 61 74 61  , data )....data
215a0 20 3d 20 64 61 74 61 20 7c 7c 20 73 65 6c 65 63   = data || selec
215b0 74 6f 72 3b 0a 09 09 09 73 65 6c 65 63 74 6f 72  tor;....selector
215c0 20 3d 20 75 6e 64 65 66 69 6e 65 64 3b 0a 09 09   = undefined;...
215d0 7d 0a 09 09 66 6f 72 20 28 20 74 79 70 65 20 69  }...for ( type i
215e0 6e 20 74 79 70 65 73 20 29 20 7b 0a 09 09 09 6f  n types ) {....o
215f0 6e 28 20 65 6c 65 6d 2c 20 74 79 70 65 2c 20 73  n( elem, type, s
21600 65 6c 65 63 74 6f 72 2c 20 64 61 74 61 2c 20 74  elector, data, t
21610 79 70 65 73 5b 20 74 79 70 65 20 5d 2c 20 6f 6e  ypes[ type ], on
21620 65 20 29 3b 0a 09 09 7d 0a 09 09 72 65 74 75 72  e );...}...retur
21630 6e 20 65 6c 65 6d 3b 0a 09 7d 0a 0a 09 69 66 20  n elem;..}...if 
21640 28 20 64 61 74 61 20 3d 3d 20 6e 75 6c 6c 20 26  ( data == null &
21650 26 20 66 6e 20 3d 3d 20 6e 75 6c 6c 20 29 20 7b  & fn == null ) {
21660 0a 0a 09 09 2f 2f 20 28 20 74 79 70 65 73 2c 20  ....// ( types, 
21670 66 6e 20 29 0a 09 09 66 6e 20 3d 20 73 65 6c 65  fn )...fn = sele
21680 63 74 6f 72 3b 0a 09 09 64 61 74 61 20 3d 20 73  ctor;...data = s
21690 65 6c 65 63 74 6f 72 20 3d 20 75 6e 64 65 66 69  elector = undefi
216a0 6e 65 64 3b 0a 09 7d 20 65 6c 73 65 20 69 66 20  ned;..} else if 
216b0 28 20 66 6e 20 3d 3d 20 6e 75 6c 6c 20 29 20 7b  ( fn == null ) {
216c0 0a 09 09 69 66 20 28 20 74 79 70 65 6f 66 20 73  ...if ( typeof s
216d0 65 6c 65 63 74 6f 72 20 3d 3d 3d 20 22 73 74 72  elector === "str
216e0 69 6e 67 22 20 29 20 7b 0a 0a 09 09 09 2f 2f 20  ing" ) {.....// 
216f0 28 20 74 79 70 65 73 2c 20 73 65 6c 65 63 74 6f  ( types, selecto
21700 72 2c 20 66 6e 20 29 0a 09 09 09 66 6e 20 3d 20  r, fn )....fn = 
21710 64 61 74 61 3b 0a 09 09 09 64 61 74 61 20 3d 20  data;....data = 
21720 75 6e 64 65 66 69 6e 65 64 3b 0a 09 09 7d 20 65  undefined;...} e
21730 6c 73 65 20 7b 0a 0a 09 09 09 2f 2f 20 28 20 74  lse {.....// ( t
21740 79 70 65 73 2c 20 64 61 74 61 2c 20 66 6e 20 29  ypes, data, fn )
21750 0a 09 09 09 66 6e 20 3d 20 64 61 74 61 3b 0a 09  ....fn = data;..
21760 09 09 64 61 74 61 20 3d 20 73 65 6c 65 63 74 6f  ..data = selecto
21770 72 3b 0a 09 09 09 73 65 6c 65 63 74 6f 72 20 3d  r;....selector =
21780 20 75 6e 64 65 66 69 6e 65 64 3b 0a 09 09 7d 0a   undefined;...}.
21790 09 7d 0a 09 69 66 20 28 20 66 6e 20 3d 3d 3d 20  .}..if ( fn === 
217a0 66 61 6c 73 65 20 29 20 7b 0a 09 09 66 6e 20 3d  false ) {...fn =
217b0 20 72 65 74 75 72 6e 46 61 6c 73 65 3b 0a 09 7d   returnFalse;..}
217c0 20 65 6c 73 65 20 69 66 20 28 20 21 66 6e 20 29   else if ( !fn )
217d0 20 7b 0a 09 09 72 65 74 75 72 6e 20 65 6c 65 6d   {...return elem
217e0 3b 0a 09 7d 0a 0a 09 69 66 20 28 20 6f 6e 65 20  ;..}...if ( one 
217f0 3d 3d 3d 20 31 20 29 20 7b 0a 09 09 6f 72 69 67  === 1 ) {...orig
21800 46 6e 20 3d 20 66 6e 3b 0a 09 09 66 6e 20 3d 20  Fn = fn;...fn = 
21810 66 75 6e 63 74 69 6f 6e 28 20 65 76 65 6e 74 20  function( event 
21820 29 20 7b 0a 0a 09 09 09 2f 2f 20 43 61 6e 20 75  ) {.....// Can u
21830 73 65 20 61 6e 20 65 6d 70 74 79 20 73 65 74 2c  se an empty set,
21840 20 73 69 6e 63 65 20 65 76 65 6e 74 20 63 6f 6e   since event con
21850 74 61 69 6e 73 20 74 68 65 20 69 6e 66 6f 0a 09  tains the info..
21860 09 09 6a 51 75 65 72 79 28 29 2e 6f 66 66 28 20  ..jQuery().off( 
21870 65 76 65 6e 74 20 29 3b 0a 09 09 09 72 65 74 75  event );....retu
21880 72 6e 20 6f 72 69 67 46 6e 2e 61 70 70 6c 79 28  rn origFn.apply(
21890 20 74 68 69 73 2c 20 61 72 67 75 6d 65 6e 74 73   this, arguments
218a0 20 29 3b 0a 09 09 7d 3b 0a 0a 09 09 2f 2f 20 55   );...};....// U
218b0 73 65 20 73 61 6d 65 20 67 75 69 64 20 73 6f 20  se same guid so 
218c0 63 61 6c 6c 65 72 20 63 61 6e 20 72 65 6d 6f 76  caller can remov
218d0 65 20 75 73 69 6e 67 20 6f 72 69 67 46 6e 0a 09  e using origFn..
218e0 09 66 6e 2e 67 75 69 64 20 3d 20 6f 72 69 67 46  .fn.guid = origF
218f0 6e 2e 67 75 69 64 20 7c 7c 20 28 20 6f 72 69 67  n.guid || ( orig
21900 46 6e 2e 67 75 69 64 20 3d 20 6a 51 75 65 72 79  Fn.guid = jQuery
21910 2e 67 75 69 64 2b 2b 20 29 3b 0a 09 7d 0a 09 72  .guid++ );..}..r
21920 65 74 75 72 6e 20 65 6c 65 6d 2e 65 61 63 68 28  eturn elem.each(
21930 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09 09   function() {...
21940 6a 51 75 65 72 79 2e 65 76 65 6e 74 2e 61 64 64  jQuery.event.add
21950 28 20 74 68 69 73 2c 20 74 79 70 65 73 2c 20 66  ( this, types, f
21960 6e 2c 20 64 61 74 61 2c 20 73 65 6c 65 63 74 6f  n, data, selecto
21970 72 20 29 3b 0a 09 7d 20 29 3b 0a 7d 0a 0a 2f 2a  r );..} );.}../*
21980 0a 20 2a 20 48 65 6c 70 65 72 20 66 75 6e 63 74  . * Helper funct
21990 69 6f 6e 73 20 66 6f 72 20 6d 61 6e 61 67 69 6e  ions for managin
219a0 67 20 65 76 65 6e 74 73 20 2d 2d 20 6e 6f 74 20  g events -- not 
219b0 70 61 72 74 20 6f 66 20 74 68 65 20 70 75 62 6c  part of the publ
219c0 69 63 20 69 6e 74 65 72 66 61 63 65 2e 0a 20 2a  ic interface.. *
219d0 20 50 72 6f 70 73 20 74 6f 20 44 65 61 6e 20 45   Props to Dean E
219e0 64 77 61 72 64 73 27 20 61 64 64 45 76 65 6e 74  dwards' addEvent
219f0 20 6c 69 62 72 61 72 79 20 66 6f 72 20 6d 61 6e   library for man
21a00 79 20 6f 66 20 74 68 65 20 69 64 65 61 73 2e 0a  y of the ideas..
21a10 20 2a 2f 0a 6a 51 75 65 72 79 2e 65 76 65 6e 74   */.jQuery.event
21a20 20 3d 20 7b 0a 0a 09 67 6c 6f 62 61 6c 3a 20 7b   = {...global: {
21a30 7d 2c 0a 0a 09 61 64 64 3a 20 66 75 6e 63 74 69  },...add: functi
21a40 6f 6e 28 20 65 6c 65 6d 2c 20 74 79 70 65 73 2c  on( elem, types,
21a50 20 68 61 6e 64 6c 65 72 2c 20 64 61 74 61 2c 20   handler, data, 
21a60 73 65 6c 65 63 74 6f 72 20 29 20 7b 0a 0a 09 09  selector ) {....
21a70 76 61 72 20 68 61 6e 64 6c 65 4f 62 6a 49 6e 2c  var handleObjIn,
21a80 20 65 76 65 6e 74 48 61 6e 64 6c 65 2c 20 74 6d   eventHandle, tm
21a90 70 2c 0a 09 09 09 65 76 65 6e 74 73 2c 20 74 2c  p,....events, t,
21aa0 20 68 61 6e 64 6c 65 4f 62 6a 2c 0a 09 09 09 73   handleObj,....s
21ab0 70 65 63 69 61 6c 2c 20 68 61 6e 64 6c 65 72 73  pecial, handlers
21ac0 2c 20 74 79 70 65 2c 20 6e 61 6d 65 73 70 61 63  , type, namespac
21ad0 65 73 2c 20 6f 72 69 67 54 79 70 65 2c 0a 09 09  es, origType,...
21ae0 09 65 6c 65 6d 44 61 74 61 20 3d 20 64 61 74 61  .elemData = data
21af0 50 72 69 76 2e 67 65 74 28 20 65 6c 65 6d 20 29  Priv.get( elem )
21b00 3b 0a 0a 09 09 2f 2f 20 4f 6e 6c 79 20 61 74 74  ;....// Only att
21b10 61 63 68 20 65 76 65 6e 74 73 20 74 6f 20 6f 62  ach events to ob
21b20 6a 65 63 74 73 20 74 68 61 74 20 61 63 63 65 70  jects that accep
21b30 74 20 64 61 74 61 0a 09 09 69 66 20 28 20 21 61  t data...if ( !a
21b40 63 63 65 70 74 44 61 74 61 28 20 65 6c 65 6d 20  cceptData( elem 
21b50 29 20 29 20 7b 0a 09 09 09 72 65 74 75 72 6e 3b  ) ) {....return;
21b60 0a 09 09 7d 0a 0a 09 09 2f 2f 20 43 61 6c 6c 65  ...}....// Calle
21b70 72 20 63 61 6e 20 70 61 73 73 20 69 6e 20 61 6e  r can pass in an
21b80 20 6f 62 6a 65 63 74 20 6f 66 20 63 75 73 74 6f   object of custo
21b90 6d 20 64 61 74 61 20 69 6e 20 6c 69 65 75 20 6f  m data in lieu o
21ba0 66 20 74 68 65 20 68 61 6e 64 6c 65 72 0a 09 09  f the handler...
21bb0 69 66 20 28 20 68 61 6e 64 6c 65 72 2e 68 61 6e  if ( handler.han
21bc0 64 6c 65 72 20 29 20 7b 0a 09 09 09 68 61 6e 64  dler ) {....hand
21bd0 6c 65 4f 62 6a 49 6e 20 3d 20 68 61 6e 64 6c 65  leObjIn = handle
21be0 72 3b 0a 09 09 09 68 61 6e 64 6c 65 72 20 3d 20  r;....handler = 
21bf0 68 61 6e 64 6c 65 4f 62 6a 49 6e 2e 68 61 6e 64  handleObjIn.hand
21c00 6c 65 72 3b 0a 09 09 09 73 65 6c 65 63 74 6f 72  ler;....selector
21c10 20 3d 20 68 61 6e 64 6c 65 4f 62 6a 49 6e 2e 73   = handleObjIn.s
21c20 65 6c 65 63 74 6f 72 3b 0a 09 09 7d 0a 0a 09 09  elector;...}....
21c30 2f 2f 20 45 6e 73 75 72 65 20 74 68 61 74 20 69  // Ensure that i
21c40 6e 76 61 6c 69 64 20 73 65 6c 65 63 74 6f 72 73  nvalid selectors
21c50 20 74 68 72 6f 77 20 65 78 63 65 70 74 69 6f 6e   throw exception
21c60 73 20 61 74 20 61 74 74 61 63 68 20 74 69 6d 65  s at attach time
21c70 0a 09 09 2f 2f 20 45 76 61 6c 75 61 74 65 20 61  ...// Evaluate a
21c80 67 61 69 6e 73 74 20 64 6f 63 75 6d 65 6e 74 45  gainst documentE
21c90 6c 65 6d 65 6e 74 20 69 6e 20 63 61 73 65 20 65  lement in case e
21ca0 6c 65 6d 20 69 73 20 61 20 6e 6f 6e 2d 65 6c 65  lem is a non-ele
21cb0 6d 65 6e 74 20 6e 6f 64 65 20 28 65 2e 67 2e 2c  ment node (e.g.,
21cc0 20 64 6f 63 75 6d 65 6e 74 29 0a 09 09 69 66 20   document)...if 
21cd0 28 20 73 65 6c 65 63 74 6f 72 20 29 20 7b 0a 09  ( selector ) {..
21ce0 09 09 6a 51 75 65 72 79 2e 66 69 6e 64 2e 6d 61  ..jQuery.find.ma
21cf0 74 63 68 65 73 53 65 6c 65 63 74 6f 72 28 20 64  tchesSelector( d
21d00 6f 63 75 6d 65 6e 74 45 6c 65 6d 65 6e 74 2c 20  ocumentElement, 
21d10 73 65 6c 65 63 74 6f 72 20 29 3b 0a 09 09 7d 0a  selector );...}.
21d20 0a 09 09 2f 2f 20 4d 61 6b 65 20 73 75 72 65 20  ...// Make sure 
21d30 74 68 61 74 20 74 68 65 20 68 61 6e 64 6c 65 72  that the handler
21d40 20 68 61 73 20 61 20 75 6e 69 71 75 65 20 49 44   has a unique ID
21d50 2c 20 75 73 65 64 20 74 6f 20 66 69 6e 64 2f 72  , used to find/r
21d60 65 6d 6f 76 65 20 69 74 20 6c 61 74 65 72 0a 09  emove it later..
21d70 09 69 66 20 28 20 21 68 61 6e 64 6c 65 72 2e 67  .if ( !handler.g
21d80 75 69 64 20 29 20 7b 0a 09 09 09 68 61 6e 64 6c  uid ) {....handl
21d90 65 72 2e 67 75 69 64 20 3d 20 6a 51 75 65 72 79  er.guid = jQuery
21da0 2e 67 75 69 64 2b 2b 3b 0a 09 09 7d 0a 0a 09 09  .guid++;...}....
21db0 2f 2f 20 49 6e 69 74 20 74 68 65 20 65 6c 65 6d  // Init the elem
21dc0 65 6e 74 27 73 20 65 76 65 6e 74 20 73 74 72 75  ent's event stru
21dd0 63 74 75 72 65 20 61 6e 64 20 6d 61 69 6e 20 68  cture and main h
21de0 61 6e 64 6c 65 72 2c 20 69 66 20 74 68 69 73 20  andler, if this 
21df0 69 73 20 74 68 65 20 66 69 72 73 74 0a 09 09 69  is the first...i
21e00 66 20 28 20 21 28 20 65 76 65 6e 74 73 20 3d 20  f ( !( events = 
21e10 65 6c 65 6d 44 61 74 61 2e 65 76 65 6e 74 73 20  elemData.events 
21e20 29 20 29 20 7b 0a 09 09 09 65 76 65 6e 74 73 20  ) ) {....events 
21e30 3d 20 65 6c 65 6d 44 61 74 61 2e 65 76 65 6e 74  = elemData.event
21e40 73 20 3d 20 4f 62 6a 65 63 74 2e 63 72 65 61 74  s = Object.creat
21e50 65 28 20 6e 75 6c 6c 20 29 3b 0a 09 09 7d 0a 09  e( null );...}..
21e60 09 69 66 20 28 20 21 28 20 65 76 65 6e 74 48 61  .if ( !( eventHa
21e70 6e 64 6c 65 20 3d 20 65 6c 65 6d 44 61 74 61 2e  ndle = elemData.
21e80 68 61 6e 64 6c 65 20 29 20 29 20 7b 0a 09 09 09  handle ) ) {....
21e90 65 76 65 6e 74 48 61 6e 64 6c 65 20 3d 20 65 6c  eventHandle = el
21ea0 65 6d 44 61 74 61 2e 68 61 6e 64 6c 65 20 3d 20  emData.handle = 
21eb0 66 75 6e 63 74 69 6f 6e 28 20 65 20 29 20 7b 0a  function( e ) {.
21ec0 0a 09 09 09 09 2f 2f 20 44 69 73 63 61 72 64 20  .....// Discard 
21ed0 74 68 65 20 73 65 63 6f 6e 64 20 65 76 65 6e 74  the second event
21ee0 20 6f 66 20 61 20 6a 51 75 65 72 79 2e 65 76 65   of a jQuery.eve
21ef0 6e 74 2e 74 72 69 67 67 65 72 28 29 20 61 6e 64  nt.trigger() and
21f00 0a 09 09 09 09 2f 2f 20 77 68 65 6e 20 61 6e 20  .....// when an 
21f10 65 76 65 6e 74 20 69 73 20 63 61 6c 6c 65 64 20  event is called 
21f20 61 66 74 65 72 20 61 20 70 61 67 65 20 68 61 73  after a page has
21f30 20 75 6e 6c 6f 61 64 65 64 0a 09 09 09 09 72 65   unloaded.....re
21f40 74 75 72 6e 20 74 79 70 65 6f 66 20 6a 51 75 65  turn typeof jQue
21f50 72 79 20 21 3d 3d 20 22 75 6e 64 65 66 69 6e 65  ry !== "undefine
21f60 64 22 20 26 26 20 6a 51 75 65 72 79 2e 65 76 65  d" && jQuery.eve
21f70 6e 74 2e 74 72 69 67 67 65 72 65 64 20 21 3d 3d  nt.triggered !==
21f80 20 65 2e 74 79 70 65 20 3f 0a 09 09 09 09 09 6a   e.type ?......j
21f90 51 75 65 72 79 2e 65 76 65 6e 74 2e 64 69 73 70  Query.event.disp
21fa0 61 74 63 68 2e 61 70 70 6c 79 28 20 65 6c 65 6d  atch.apply( elem
21fb0 2c 20 61 72 67 75 6d 65 6e 74 73 20 29 20 3a 20  , arguments ) : 
21fc0 75 6e 64 65 66 69 6e 65 64 3b 0a 09 09 09 7d 3b  undefined;....};
21fd0 0a 09 09 7d 0a 0a 09 09 2f 2f 20 48 61 6e 64 6c  ...}....// Handl
21fe0 65 20 6d 75 6c 74 69 70 6c 65 20 65 76 65 6e 74  e multiple event
21ff0 73 20 73 65 70 61 72 61 74 65 64 20 62 79 20 61  s separated by a
22000 20 73 70 61 63 65 0a 09 09 74 79 70 65 73 20 3d   space...types =
22010 20 28 20 74 79 70 65 73 20 7c 7c 20 22 22 20 29   ( types || "" )
22020 2e 6d 61 74 63 68 28 20 72 6e 6f 74 68 74 6d 6c  .match( rnothtml
22030 77 68 69 74 65 20 29 20 7c 7c 20 5b 20 22 22 20  white ) || [ "" 
22040 5d 3b 0a 09 09 74 20 3d 20 74 79 70 65 73 2e 6c  ];...t = types.l
22050 65 6e 67 74 68 3b 0a 09 09 77 68 69 6c 65 20 28  ength;...while (
22060 20 74 2d 2d 20 29 20 7b 0a 09 09 09 74 6d 70 20   t-- ) {....tmp 
22070 3d 20 72 74 79 70 65 6e 61 6d 65 73 70 61 63 65  = rtypenamespace
22080 2e 65 78 65 63 28 20 74 79 70 65 73 5b 20 74 20  .exec( types[ t 
22090 5d 20 29 20 7c 7c 20 5b 5d 3b 0a 09 09 09 74 79  ] ) || [];....ty
220a0 70 65 20 3d 20 6f 72 69 67 54 79 70 65 20 3d 20  pe = origType = 
220b0 74 6d 70 5b 20 31 20 5d 3b 0a 09 09 09 6e 61 6d  tmp[ 1 ];....nam
220c0 65 73 70 61 63 65 73 20 3d 20 28 20 74 6d 70 5b  espaces = ( tmp[
220d0 20 32 20 5d 20 7c 7c 20 22 22 20 29 2e 73 70 6c   2 ] || "" ).spl
220e0 69 74 28 20 22 2e 22 20 29 2e 73 6f 72 74 28 29  it( "." ).sort()
220f0 3b 0a 0a 09 09 09 2f 2f 20 54 68 65 72 65 20 2a  ;.....// There *
22100 6d 75 73 74 2a 20 62 65 20 61 20 74 79 70 65 2c  must* be a type,
22110 20 6e 6f 20 61 74 74 61 63 68 69 6e 67 20 6e 61   no attaching na
22120 6d 65 73 70 61 63 65 2d 6f 6e 6c 79 20 68 61 6e  mespace-only han
22130 64 6c 65 72 73 0a 09 09 09 69 66 20 28 20 21 74  dlers....if ( !t
22140 79 70 65 20 29 20 7b 0a 09 09 09 09 63 6f 6e 74  ype ) {.....cont
22150 69 6e 75 65 3b 0a 09 09 09 7d 0a 0a 09 09 09 2f  inue;....}...../
22160 2f 20 49 66 20 65 76 65 6e 74 20 63 68 61 6e 67  / If event chang
22170 65 73 20 69 74 73 20 74 79 70 65 2c 20 75 73 65  es its type, use
22180 20 74 68 65 20 73 70 65 63 69 61 6c 20 65 76 65   the special eve
22190 6e 74 20 68 61 6e 64 6c 65 72 73 20 66 6f 72 20  nt handlers for 
221a0 74 68 65 20 63 68 61 6e 67 65 64 20 74 79 70 65  the changed type
221b0 0a 09 09 09 73 70 65 63 69 61 6c 20 3d 20 6a 51  ....special = jQ
221c0 75 65 72 79 2e 65 76 65 6e 74 2e 73 70 65 63 69  uery.event.speci
221d0 61 6c 5b 20 74 79 70 65 20 5d 20 7c 7c 20 7b 7d  al[ type ] || {}
221e0 3b 0a 0a 09 09 09 2f 2f 20 49 66 20 73 65 6c 65  ;.....// If sele
221f0 63 74 6f 72 20 64 65 66 69 6e 65 64 2c 20 64 65  ctor defined, de
22200 74 65 72 6d 69 6e 65 20 73 70 65 63 69 61 6c 20  termine special 
22210 65 76 65 6e 74 20 61 70 69 20 74 79 70 65 2c 20  event api type, 
22220 6f 74 68 65 72 77 69 73 65 20 67 69 76 65 6e 20  otherwise given 
22230 74 79 70 65 0a 09 09 09 74 79 70 65 20 3d 20 28  type....type = (
22240 20 73 65 6c 65 63 74 6f 72 20 3f 20 73 70 65 63   selector ? spec
22250 69 61 6c 2e 64 65 6c 65 67 61 74 65 54 79 70 65  ial.delegateType
22260 20 3a 20 73 70 65 63 69 61 6c 2e 62 69 6e 64 54   : special.bindT
22270 79 70 65 20 29 20 7c 7c 20 74 79 70 65 3b 0a 0a  ype ) || type;..
22280 09 09 09 2f 2f 20 55 70 64 61 74 65 20 73 70 65  ...// Update spe
22290 63 69 61 6c 20 62 61 73 65 64 20 6f 6e 20 6e 65  cial based on ne
222a0 77 6c 79 20 72 65 73 65 74 20 74 79 70 65 0a 09  wly reset type..
222b0 09 09 73 70 65 63 69 61 6c 20 3d 20 6a 51 75 65  ..special = jQue
222c0 72 79 2e 65 76 65 6e 74 2e 73 70 65 63 69 61 6c  ry.event.special
222d0 5b 20 74 79 70 65 20 5d 20 7c 7c 20 7b 7d 3b 0a  [ type ] || {};.
222e0 0a 09 09 09 2f 2f 20 68 61 6e 64 6c 65 4f 62 6a  ....// handleObj
222f0 20 69 73 20 70 61 73 73 65 64 20 74 6f 20 61 6c   is passed to al
22300 6c 20 65 76 65 6e 74 20 68 61 6e 64 6c 65 72 73  l event handlers
22310 0a 09 09 09 68 61 6e 64 6c 65 4f 62 6a 20 3d 20  ....handleObj = 
22320 6a 51 75 65 72 79 2e 65 78 74 65 6e 64 28 20 7b  jQuery.extend( {
22330 0a 09 09 09 09 74 79 70 65 3a 20 74 79 70 65 2c  .....type: type,
22340 0a 09 09 09 09 6f 72 69 67 54 79 70 65 3a 20 6f  .....origType: o
22350 72 69 67 54 79 70 65 2c 0a 09 09 09 09 64 61 74  rigType,.....dat
22360 61 3a 20 64 61 74 61 2c 0a 09 09 09 09 68 61 6e  a: data,.....han
22370 64 6c 65 72 3a 20 68 61 6e 64 6c 65 72 2c 0a 09  dler: handler,..
22380 09 09 09 67 75 69 64 3a 20 68 61 6e 64 6c 65 72  ...guid: handler
22390 2e 67 75 69 64 2c 0a 09 09 09 09 73 65 6c 65 63  .guid,.....selec
223a0 74 6f 72 3a 20 73 65 6c 65 63 74 6f 72 2c 0a 09  tor: selector,..
223b0 09 09 09 6e 65 65 64 73 43 6f 6e 74 65 78 74 3a  ...needsContext:
223c0 20 73 65 6c 65 63 74 6f 72 20 26 26 20 6a 51 75   selector && jQu
223d0 65 72 79 2e 65 78 70 72 2e 6d 61 74 63 68 2e 6e  ery.expr.match.n
223e0 65 65 64 73 43 6f 6e 74 65 78 74 2e 74 65 73 74  eedsContext.test
223f0 28 20 73 65 6c 65 63 74 6f 72 20 29 2c 0a 09 09  ( selector ),...
22400 09 09 6e 61 6d 65 73 70 61 63 65 3a 20 6e 61 6d  ..namespace: nam
22410 65 73 70 61 63 65 73 2e 6a 6f 69 6e 28 20 22 2e  espaces.join( ".
22420 22 20 29 0a 09 09 09 7d 2c 20 68 61 6e 64 6c 65  " )....}, handle
22430 4f 62 6a 49 6e 20 29 3b 0a 0a 09 09 09 2f 2f 20  ObjIn );.....// 
22440 49 6e 69 74 20 74 68 65 20 65 76 65 6e 74 20 68  Init the event h
22450 61 6e 64 6c 65 72 20 71 75 65 75 65 20 69 66 20  andler queue if 
22460 77 65 27 72 65 20 74 68 65 20 66 69 72 73 74 0a  we're the first.
22470 09 09 09 69 66 20 28 20 21 28 20 68 61 6e 64 6c  ...if ( !( handl
22480 65 72 73 20 3d 20 65 76 65 6e 74 73 5b 20 74 79  ers = events[ ty
22490 70 65 20 5d 20 29 20 29 20 7b 0a 09 09 09 09 68  pe ] ) ) {.....h
224a0 61 6e 64 6c 65 72 73 20 3d 20 65 76 65 6e 74 73  andlers = events
224b0 5b 20 74 79 70 65 20 5d 20 3d 20 5b 5d 3b 0a 09  [ type ] = [];..
224c0 09 09 09 68 61 6e 64 6c 65 72 73 2e 64 65 6c 65  ...handlers.dele
224d0 67 61 74 65 43 6f 75 6e 74 20 3d 20 30 3b 0a 0a  gateCount = 0;..
224e0 09 09 09 09 2f 2f 20 4f 6e 6c 79 20 75 73 65 20  ....// Only use 
224f0 61 64 64 45 76 65 6e 74 4c 69 73 74 65 6e 65 72  addEventListener
22500 20 69 66 20 74 68 65 20 73 70 65 63 69 61 6c 20   if the special 
22510 65 76 65 6e 74 73 20 68 61 6e 64 6c 65 72 20 72  events handler r
22520 65 74 75 72 6e 73 20 66 61 6c 73 65 0a 09 09 09  eturns false....
22530 09 69 66 20 28 20 21 73 70 65 63 69 61 6c 2e 73  .if ( !special.s
22540 65 74 75 70 20 7c 7c 0a 09 09 09 09 09 73 70 65  etup ||......spe
22550 63 69 61 6c 2e 73 65 74 75 70 2e 63 61 6c 6c 28  cial.setup.call(
22560 20 65 6c 65 6d 2c 20 64 61 74 61 2c 20 6e 61 6d   elem, data, nam
22570 65 73 70 61 63 65 73 2c 20 65 76 65 6e 74 48 61  espaces, eventHa
22580 6e 64 6c 65 20 29 20 3d 3d 3d 20 66 61 6c 73 65  ndle ) === false
22590 20 29 20 7b 0a 0a 09 09 09 09 09 69 66 20 28 20   ) {.......if ( 
225a0 65 6c 65 6d 2e 61 64 64 45 76 65 6e 74 4c 69 73  elem.addEventLis
225b0 74 65 6e 65 72 20 29 20 7b 0a 09 09 09 09 09 09  tener ) {.......
225c0 65 6c 65 6d 2e 61 64 64 45 76 65 6e 74 4c 69 73  elem.addEventLis
225d0 74 65 6e 65 72 28 20 74 79 70 65 2c 20 65 76 65  tener( type, eve
225e0 6e 74 48 61 6e 64 6c 65 20 29 3b 0a 09 09 09 09  ntHandle );.....
225f0 09 7d 0a 09 09 09 09 7d 0a 09 09 09 7d 0a 0a 09  .}.....}....}...
22600 09 09 69 66 20 28 20 73 70 65 63 69 61 6c 2e 61  ..if ( special.a
22610 64 64 20 29 20 7b 0a 09 09 09 09 73 70 65 63 69  dd ) {.....speci
22620 61 6c 2e 61 64 64 2e 63 61 6c 6c 28 20 65 6c 65  al.add.call( ele
22630 6d 2c 20 68 61 6e 64 6c 65 4f 62 6a 20 29 3b 0a  m, handleObj );.
22640 0a 09 09 09 09 69 66 20 28 20 21 68 61 6e 64 6c  .....if ( !handl
22650 65 4f 62 6a 2e 68 61 6e 64 6c 65 72 2e 67 75 69  eObj.handler.gui
22660 64 20 29 20 7b 0a 09 09 09 09 09 68 61 6e 64 6c  d ) {......handl
22670 65 4f 62 6a 2e 68 61 6e 64 6c 65 72 2e 67 75 69  eObj.handler.gui
22680 64 20 3d 20 68 61 6e 64 6c 65 72 2e 67 75 69 64  d = handler.guid
22690 3b 0a 09 09 09 09 7d 0a 09 09 09 7d 0a 0a 09 09  ;.....}....}....
226a0 09 2f 2f 20 41 64 64 20 74 6f 20 74 68 65 20 65  .// Add to the e
226b0 6c 65 6d 65 6e 74 27 73 20 68 61 6e 64 6c 65 72  lement's handler
226c0 20 6c 69 73 74 2c 20 64 65 6c 65 67 61 74 65 73   list, delegates
226d0 20 69 6e 20 66 72 6f 6e 74 0a 09 09 09 69 66 20   in front....if 
226e0 28 20 73 65 6c 65 63 74 6f 72 20 29 20 7b 0a 09  ( selector ) {..
226f0 09 09 09 68 61 6e 64 6c 65 72 73 2e 73 70 6c 69  ...handlers.spli
22700 63 65 28 20 68 61 6e 64 6c 65 72 73 2e 64 65 6c  ce( handlers.del
22710 65 67 61 74 65 43 6f 75 6e 74 2b 2b 2c 20 30 2c  egateCount++, 0,
22720 20 68 61 6e 64 6c 65 4f 62 6a 20 29 3b 0a 09 09   handleObj );...
22730 09 7d 20 65 6c 73 65 20 7b 0a 09 09 09 09 68 61  .} else {.....ha
22740 6e 64 6c 65 72 73 2e 70 75 73 68 28 20 68 61 6e  ndlers.push( han
22750 64 6c 65 4f 62 6a 20 29 3b 0a 09 09 09 7d 0a 0a  dleObj );....}..
22760 09 09 09 2f 2f 20 4b 65 65 70 20 74 72 61 63 6b  ...// Keep track
22770 20 6f 66 20 77 68 69 63 68 20 65 76 65 6e 74 73   of which events
22780 20 68 61 76 65 20 65 76 65 72 20 62 65 65 6e 20   have ever been 
22790 75 73 65 64 2c 20 66 6f 72 20 65 76 65 6e 74 20  used, for event 
227a0 6f 70 74 69 6d 69 7a 61 74 69 6f 6e 0a 09 09 09  optimization....
227b0 6a 51 75 65 72 79 2e 65 76 65 6e 74 2e 67 6c 6f  jQuery.event.glo
227c0 62 61 6c 5b 20 74 79 70 65 20 5d 20 3d 20 74 72  bal[ type ] = tr
227d0 75 65 3b 0a 09 09 7d 0a 0a 09 7d 2c 0a 0a 09 2f  ue;...}...},.../
227e0 2f 20 44 65 74 61 63 68 20 61 6e 20 65 76 65 6e  / Detach an even
227f0 74 20 6f 72 20 73 65 74 20 6f 66 20 65 76 65 6e  t or set of even
22800 74 73 20 66 72 6f 6d 20 61 6e 20 65 6c 65 6d 65  ts from an eleme
22810 6e 74 0a 09 72 65 6d 6f 76 65 3a 20 66 75 6e 63  nt..remove: func
22820 74 69 6f 6e 28 20 65 6c 65 6d 2c 20 74 79 70 65  tion( elem, type
22830 73 2c 20 68 61 6e 64 6c 65 72 2c 20 73 65 6c 65  s, handler, sele
22840 63 74 6f 72 2c 20 6d 61 70 70 65 64 54 79 70 65  ctor, mappedType
22850 73 20 29 20 7b 0a 0a 09 09 76 61 72 20 6a 2c 20  s ) {....var j, 
22860 6f 72 69 67 43 6f 75 6e 74 2c 20 74 6d 70 2c 0a  origCount, tmp,.
22870 09 09 09 65 76 65 6e 74 73 2c 20 74 2c 20 68 61  ...events, t, ha
22880 6e 64 6c 65 4f 62 6a 2c 0a 09 09 09 73 70 65 63  ndleObj,....spec
22890 69 61 6c 2c 20 68 61 6e 64 6c 65 72 73 2c 20 74  ial, handlers, t
228a0 79 70 65 2c 20 6e 61 6d 65 73 70 61 63 65 73 2c  ype, namespaces,
228b0 20 6f 72 69 67 54 79 70 65 2c 0a 09 09 09 65 6c   origType,....el
228c0 65 6d 44 61 74 61 20 3d 20 64 61 74 61 50 72 69  emData = dataPri
228d0 76 2e 68 61 73 44 61 74 61 28 20 65 6c 65 6d 20  v.hasData( elem 
228e0 29 20 26 26 20 64 61 74 61 50 72 69 76 2e 67 65  ) && dataPriv.ge
228f0 74 28 20 65 6c 65 6d 20 29 3b 0a 0a 09 09 69 66  t( elem );....if
22900 20 28 20 21 65 6c 65 6d 44 61 74 61 20 7c 7c 20   ( !elemData || 
22910 21 28 20 65 76 65 6e 74 73 20 3d 20 65 6c 65 6d  !( events = elem
22920 44 61 74 61 2e 65 76 65 6e 74 73 20 29 20 29 20  Data.events ) ) 
22930 7b 0a 09 09 09 72 65 74 75 72 6e 3b 0a 09 09 7d  {....return;...}
22940 0a 0a 09 09 2f 2f 20 4f 6e 63 65 20 66 6f 72 20  ....// Once for 
22950 65 61 63 68 20 74 79 70 65 2e 6e 61 6d 65 73 70  each type.namesp
22960 61 63 65 20 69 6e 20 74 79 70 65 73 3b 20 74 79  ace in types; ty
22970 70 65 20 6d 61 79 20 62 65 20 6f 6d 69 74 74 65  pe may be omitte
22980 64 0a 09 09 74 79 70 65 73 20 3d 20 28 20 74 79  d...types = ( ty
22990 70 65 73 20 7c 7c 20 22 22 20 29 2e 6d 61 74 63  pes || "" ).matc
229a0 68 28 20 72 6e 6f 74 68 74 6d 6c 77 68 69 74 65  h( rnothtmlwhite
229b0 20 29 20 7c 7c 20 5b 20 22 22 20 5d 3b 0a 09 09   ) || [ "" ];...
229c0 74 20 3d 20 74 79 70 65 73 2e 6c 65 6e 67 74 68  t = types.length
229d0 3b 0a 09 09 77 68 69 6c 65 20 28 20 74 2d 2d 20  ;...while ( t-- 
229e0 29 20 7b 0a 09 09 09 74 6d 70 20 3d 20 72 74 79  ) {....tmp = rty
229f0 70 65 6e 61 6d 65 73 70 61 63 65 2e 65 78 65 63  penamespace.exec
22a00 28 20 74 79 70 65 73 5b 20 74 20 5d 20 29 20 7c  ( types[ t ] ) |
22a10 7c 20 5b 5d 3b 0a 09 09 09 74 79 70 65 20 3d 20  | [];....type = 
22a20 6f 72 69 67 54 79 70 65 20 3d 20 74 6d 70 5b 20  origType = tmp[ 
22a30 31 20 5d 3b 0a 09 09 09 6e 61 6d 65 73 70 61 63  1 ];....namespac
22a40 65 73 20 3d 20 28 20 74 6d 70 5b 20 32 20 5d 20  es = ( tmp[ 2 ] 
22a50 7c 7c 20 22 22 20 29 2e 73 70 6c 69 74 28 20 22  || "" ).split( "
22a60 2e 22 20 29 2e 73 6f 72 74 28 29 3b 0a 0a 09 09  ." ).sort();....
22a70 09 2f 2f 20 55 6e 62 69 6e 64 20 61 6c 6c 20 65  .// Unbind all e
22a80 76 65 6e 74 73 20 28 6f 6e 20 74 68 69 73 20 6e  vents (on this n
22a90 61 6d 65 73 70 61 63 65 2c 20 69 66 20 70 72 6f  amespace, if pro
22aa0 76 69 64 65 64 29 20 66 6f 72 20 74 68 65 20 65  vided) for the e
22ab0 6c 65 6d 65 6e 74 0a 09 09 09 69 66 20 28 20 21  lement....if ( !
22ac0 74 79 70 65 20 29 20 7b 0a 09 09 09 09 66 6f 72  type ) {.....for
22ad0 20 28 20 74 79 70 65 20 69 6e 20 65 76 65 6e 74   ( type in event
22ae0 73 20 29 20 7b 0a 09 09 09 09 09 6a 51 75 65 72  s ) {......jQuer
22af0 79 2e 65 76 65 6e 74 2e 72 65 6d 6f 76 65 28 20  y.event.remove( 
22b00 65 6c 65 6d 2c 20 74 79 70 65 20 2b 20 74 79 70  elem, type + typ
22b10 65 73 5b 20 74 20 5d 2c 20 68 61 6e 64 6c 65 72  es[ t ], handler
22b20 2c 20 73 65 6c 65 63 74 6f 72 2c 20 74 72 75 65  , selector, true
22b30 20 29 3b 0a 09 09 09 09 7d 0a 09 09 09 09 63 6f   );.....}.....co
22b40 6e 74 69 6e 75 65 3b 0a 09 09 09 7d 0a 0a 09 09  ntinue;....}....
22b50 09 73 70 65 63 69 61 6c 20 3d 20 6a 51 75 65 72  .special = jQuer
22b60 79 2e 65 76 65 6e 74 2e 73 70 65 63 69 61 6c 5b  y.event.special[
22b70 20 74 79 70 65 20 5d 20 7c 7c 20 7b 7d 3b 0a 09   type ] || {};..
22b80 09 09 74 79 70 65 20 3d 20 28 20 73 65 6c 65 63  ..type = ( selec
22b90 74 6f 72 20 3f 20 73 70 65 63 69 61 6c 2e 64 65  tor ? special.de
22ba0 6c 65 67 61 74 65 54 79 70 65 20 3a 20 73 70 65  legateType : spe
22bb0 63 69 61 6c 2e 62 69 6e 64 54 79 70 65 20 29 20  cial.bindType ) 
22bc0 7c 7c 20 74 79 70 65 3b 0a 09 09 09 68 61 6e 64  || type;....hand
22bd0 6c 65 72 73 20 3d 20 65 76 65 6e 74 73 5b 20 74  lers = events[ t
22be0 79 70 65 20 5d 20 7c 7c 20 5b 5d 3b 0a 09 09 09  ype ] || [];....
22bf0 74 6d 70 20 3d 20 74 6d 70 5b 20 32 20 5d 20 26  tmp = tmp[ 2 ] &
22c00 26 0a 09 09 09 09 6e 65 77 20 52 65 67 45 78 70  &.....new RegExp
22c10 28 20 22 28 5e 7c 5c 5c 2e 29 22 20 2b 20 6e 61  ( "(^|\\.)" + na
22c20 6d 65 73 70 61 63 65 73 2e 6a 6f 69 6e 28 20 22  mespaces.join( "
22c30 5c 5c 2e 28 3f 3a 2e 2a 5c 5c 2e 7c 29 22 20 29  \\.(?:.*\\.|)" )
22c40 20 2b 20 22 28 5c 5c 2e 7c 24 29 22 20 29 3b 0a   + "(\\.|$)" );.
22c50 0a 09 09 09 2f 2f 20 52 65 6d 6f 76 65 20 6d 61  ....// Remove ma
22c60 74 63 68 69 6e 67 20 65 76 65 6e 74 73 0a 09 09  tching events...
22c70 09 6f 72 69 67 43 6f 75 6e 74 20 3d 20 6a 20 3d  .origCount = j =
22c80 20 68 61 6e 64 6c 65 72 73 2e 6c 65 6e 67 74 68   handlers.length
22c90 3b 0a 09 09 09 77 68 69 6c 65 20 28 20 6a 2d 2d  ;....while ( j--
22ca0 20 29 20 7b 0a 09 09 09 09 68 61 6e 64 6c 65 4f   ) {.....handleO
22cb0 62 6a 20 3d 20 68 61 6e 64 6c 65 72 73 5b 20 6a  bj = handlers[ j
22cc0 20 5d 3b 0a 0a 09 09 09 09 69 66 20 28 20 28 20   ];......if ( ( 
22cd0 6d 61 70 70 65 64 54 79 70 65 73 20 7c 7c 20 6f  mappedTypes || o
22ce0 72 69 67 54 79 70 65 20 3d 3d 3d 20 68 61 6e 64  rigType === hand
22cf0 6c 65 4f 62 6a 2e 6f 72 69 67 54 79 70 65 20 29  leObj.origType )
22d00 20 26 26 0a 09 09 09 09 09 28 20 21 68 61 6e 64   &&......( !hand
22d10 6c 65 72 20 7c 7c 20 68 61 6e 64 6c 65 72 2e 67  ler || handler.g
22d20 75 69 64 20 3d 3d 3d 20 68 61 6e 64 6c 65 4f 62  uid === handleOb
22d30 6a 2e 67 75 69 64 20 29 20 26 26 0a 09 09 09 09  j.guid ) &&.....
22d40 09 28 20 21 74 6d 70 20 7c 7c 20 74 6d 70 2e 74  .( !tmp || tmp.t
22d50 65 73 74 28 20 68 61 6e 64 6c 65 4f 62 6a 2e 6e  est( handleObj.n
22d60 61 6d 65 73 70 61 63 65 20 29 20 29 20 26 26 0a  amespace ) ) &&.
22d70 09 09 09 09 09 28 20 21 73 65 6c 65 63 74 6f 72  .....( !selector
22d80 20 7c 7c 20 73 65 6c 65 63 74 6f 72 20 3d 3d 3d   || selector ===
22d90 20 68 61 6e 64 6c 65 4f 62 6a 2e 73 65 6c 65 63   handleObj.selec
22da0 74 6f 72 20 7c 7c 0a 09 09 09 09 09 09 73 65 6c  tor ||.......sel
22db0 65 63 74 6f 72 20 3d 3d 3d 20 22 2a 2a 22 20 26  ector === "**" &
22dc0 26 20 68 61 6e 64 6c 65 4f 62 6a 2e 73 65 6c 65  & handleObj.sele
22dd0 63 74 6f 72 20 29 20 29 20 7b 0a 09 09 09 09 09  ctor ) ) {......
22de0 68 61 6e 64 6c 65 72 73 2e 73 70 6c 69 63 65 28  handlers.splice(
22df0 20 6a 2c 20 31 20 29 3b 0a 0a 09 09 09 09 09 69   j, 1 );.......i
22e00 66 20 28 20 68 61 6e 64 6c 65 4f 62 6a 2e 73 65  f ( handleObj.se
22e10 6c 65 63 74 6f 72 20 29 20 7b 0a 09 09 09 09 09  lector ) {......
22e20 09 68 61 6e 64 6c 65 72 73 2e 64 65 6c 65 67 61  .handlers.delega
22e30 74 65 43 6f 75 6e 74 2d 2d 3b 0a 09 09 09 09 09  teCount--;......
22e40 7d 0a 09 09 09 09 09 69 66 20 28 20 73 70 65 63  }......if ( spec
22e50 69 61 6c 2e 72 65 6d 6f 76 65 20 29 20 7b 0a 09  ial.remove ) {..
22e60 09 09 09 09 09 73 70 65 63 69 61 6c 2e 72 65 6d  .....special.rem
22e70 6f 76 65 2e 63 61 6c 6c 28 20 65 6c 65 6d 2c 20  ove.call( elem, 
22e80 68 61 6e 64 6c 65 4f 62 6a 20 29 3b 0a 09 09 09  handleObj );....
22e90 09 09 7d 0a 09 09 09 09 7d 0a 09 09 09 7d 0a 0a  ..}.....}....}..
22ea0 09 09 09 2f 2f 20 52 65 6d 6f 76 65 20 67 65 6e  ...// Remove gen
22eb0 65 72 69 63 20 65 76 65 6e 74 20 68 61 6e 64 6c  eric event handl
22ec0 65 72 20 69 66 20 77 65 20 72 65 6d 6f 76 65 64  er if we removed
22ed0 20 73 6f 6d 65 74 68 69 6e 67 20 61 6e 64 20 6e   something and n
22ee0 6f 20 6d 6f 72 65 20 68 61 6e 64 6c 65 72 73 20  o more handlers 
22ef0 65 78 69 73 74 0a 09 09 09 2f 2f 20 28 61 76 6f  exist....// (avo
22f00 69 64 73 20 70 6f 74 65 6e 74 69 61 6c 20 66 6f  ids potential fo
22f10 72 20 65 6e 64 6c 65 73 73 20 72 65 63 75 72 73  r endless recurs
22f20 69 6f 6e 20 64 75 72 69 6e 67 20 72 65 6d 6f 76  ion during remov
22f30 61 6c 20 6f 66 20 73 70 65 63 69 61 6c 20 65 76  al of special ev
22f40 65 6e 74 20 68 61 6e 64 6c 65 72 73 29 0a 09 09  ent handlers)...
22f50 09 69 66 20 28 20 6f 72 69 67 43 6f 75 6e 74 20  .if ( origCount 
22f60 26 26 20 21 68 61 6e 64 6c 65 72 73 2e 6c 65 6e  && !handlers.len
22f70 67 74 68 20 29 20 7b 0a 09 09 09 09 69 66 20 28  gth ) {.....if (
22f80 20 21 73 70 65 63 69 61 6c 2e 74 65 61 72 64 6f   !special.teardo
22f90 77 6e 20 7c 7c 0a 09 09 09 09 09 73 70 65 63 69  wn ||......speci
22fa0 61 6c 2e 74 65 61 72 64 6f 77 6e 2e 63 61 6c 6c  al.teardown.call
22fb0 28 20 65 6c 65 6d 2c 20 6e 61 6d 65 73 70 61 63  ( elem, namespac
22fc0 65 73 2c 20 65 6c 65 6d 44 61 74 61 2e 68 61 6e  es, elemData.han
22fd0 64 6c 65 20 29 20 3d 3d 3d 20 66 61 6c 73 65 20  dle ) === false 
22fe0 29 20 7b 0a 0a 09 09 09 09 09 6a 51 75 65 72 79  ) {.......jQuery
22ff0 2e 72 65 6d 6f 76 65 45 76 65 6e 74 28 20 65 6c  .removeEvent( el
23000 65 6d 2c 20 74 79 70 65 2c 20 65 6c 65 6d 44 61  em, type, elemDa
23010 74 61 2e 68 61 6e 64 6c 65 20 29 3b 0a 09 09 09  ta.handle );....
23020 09 7d 0a 0a 09 09 09 09 64 65 6c 65 74 65 20 65  .}......delete e
23030 76 65 6e 74 73 5b 20 74 79 70 65 20 5d 3b 0a 09  vents[ type ];..
23040 09 09 7d 0a 09 09 7d 0a 0a 09 09 2f 2f 20 52 65  ..}...}....// Re
23050 6d 6f 76 65 20 64 61 74 61 20 61 6e 64 20 74 68  move data and th
23060 65 20 65 78 70 61 6e 64 6f 20 69 66 20 69 74 27  e expando if it'
23070 73 20 6e 6f 20 6c 6f 6e 67 65 72 20 75 73 65 64  s no longer used
23080 0a 09 09 69 66 20 28 20 6a 51 75 65 72 79 2e 69  ...if ( jQuery.i
23090 73 45 6d 70 74 79 4f 62 6a 65 63 74 28 20 65 76  sEmptyObject( ev
230a0 65 6e 74 73 20 29 20 29 20 7b 0a 09 09 09 64 61  ents ) ) {....da
230b0 74 61 50 72 69 76 2e 72 65 6d 6f 76 65 28 20 65  taPriv.remove( e
230c0 6c 65 6d 2c 20 22 68 61 6e 64 6c 65 20 65 76 65  lem, "handle eve
230d0 6e 74 73 22 20 29 3b 0a 09 09 7d 0a 09 7d 2c 0a  nts" );...}..},.
230e0 0a 09 64 69 73 70 61 74 63 68 3a 20 66 75 6e 63  ..dispatch: func
230f0 74 69 6f 6e 28 20 6e 61 74 69 76 65 45 76 65 6e  tion( nativeEven
23100 74 20 29 20 7b 0a 0a 09 09 76 61 72 20 69 2c 20  t ) {....var i, 
23110 6a 2c 20 72 65 74 2c 20 6d 61 74 63 68 65 64 2c  j, ret, matched,
23120 20 68 61 6e 64 6c 65 4f 62 6a 2c 20 68 61 6e 64   handleObj, hand
23130 6c 65 72 51 75 65 75 65 2c 0a 09 09 09 61 72 67  lerQueue,....arg
23140 73 20 3d 20 6e 65 77 20 41 72 72 61 79 28 20 61  s = new Array( a
23150 72 67 75 6d 65 6e 74 73 2e 6c 65 6e 67 74 68 20  rguments.length 
23160 29 2c 0a 0a 09 09 09 2f 2f 20 4d 61 6b 65 20 61  ),.....// Make a
23170 20 77 72 69 74 61 62 6c 65 20 6a 51 75 65 72 79   writable jQuery
23180 2e 45 76 65 6e 74 20 66 72 6f 6d 20 74 68 65 20  .Event from the 
23190 6e 61 74 69 76 65 20 65 76 65 6e 74 20 6f 62 6a  native event obj
231a0 65 63 74 0a 09 09 09 65 76 65 6e 74 20 3d 20 6a  ect....event = j
231b0 51 75 65 72 79 2e 65 76 65 6e 74 2e 66 69 78 28  Query.event.fix(
231c0 20 6e 61 74 69 76 65 45 76 65 6e 74 20 29 2c 0a   nativeEvent ),.
231d0 0a 09 09 09 68 61 6e 64 6c 65 72 73 20 3d 20 28  ....handlers = (
231e0 0a 09 09 09 09 09 64 61 74 61 50 72 69 76 2e 67  ......dataPriv.g
231f0 65 74 28 20 74 68 69 73 2c 20 22 65 76 65 6e 74  et( this, "event
23200 73 22 20 29 20 7c 7c 20 4f 62 6a 65 63 74 2e 63  s" ) || Object.c
23210 72 65 61 74 65 28 20 6e 75 6c 6c 20 29 0a 09 09  reate( null )...
23220 09 09 29 5b 20 65 76 65 6e 74 2e 74 79 70 65 20  ..)[ event.type 
23230 5d 20 7c 7c 20 5b 5d 2c 0a 09 09 09 73 70 65 63  ] || [],....spec
23240 69 61 6c 20 3d 20 6a 51 75 65 72 79 2e 65 76 65  ial = jQuery.eve
23250 6e 74 2e 73 70 65 63 69 61 6c 5b 20 65 76 65 6e  nt.special[ even
23260 74 2e 74 79 70 65 20 5d 20 7c 7c 20 7b 7d 3b 0a  t.type ] || {};.
23270 0a 09 09 2f 2f 20 55 73 65 20 74 68 65 20 66 69  ...// Use the fi
23280 78 2d 65 64 20 6a 51 75 65 72 79 2e 45 76 65 6e  x-ed jQuery.Even
23290 74 20 72 61 74 68 65 72 20 74 68 61 6e 20 74 68  t rather than th
232a0 65 20 28 72 65 61 64 2d 6f 6e 6c 79 29 20 6e 61  e (read-only) na
232b0 74 69 76 65 20 65 76 65 6e 74 0a 09 09 61 72 67  tive event...arg
232c0 73 5b 20 30 20 5d 20 3d 20 65 76 65 6e 74 3b 0a  s[ 0 ] = event;.
232d0 0a 09 09 66 6f 72 20 28 20 69 20 3d 20 31 3b 20  ...for ( i = 1; 
232e0 69 20 3c 20 61 72 67 75 6d 65 6e 74 73 2e 6c 65  i < arguments.le
232f0 6e 67 74 68 3b 20 69 2b 2b 20 29 20 7b 0a 09 09  ngth; i++ ) {...
23300 09 61 72 67 73 5b 20 69 20 5d 20 3d 20 61 72 67  .args[ i ] = arg
23310 75 6d 65 6e 74 73 5b 20 69 20 5d 3b 0a 09 09 7d  uments[ i ];...}
23320 0a 0a 09 09 65 76 65 6e 74 2e 64 65 6c 65 67 61  ....event.delega
23330 74 65 54 61 72 67 65 74 20 3d 20 74 68 69 73 3b  teTarget = this;
23340 0a 0a 09 09 2f 2f 20 43 61 6c 6c 20 74 68 65 20  ....// Call the 
23350 70 72 65 44 69 73 70 61 74 63 68 20 68 6f 6f 6b  preDispatch hook
23360 20 66 6f 72 20 74 68 65 20 6d 61 70 70 65 64 20   for the mapped 
23370 74 79 70 65 2c 20 61 6e 64 20 6c 65 74 20 69 74  type, and let it
23380 20 62 61 69 6c 20 69 66 20 64 65 73 69 72 65 64   bail if desired
23390 0a 09 09 69 66 20 28 20 73 70 65 63 69 61 6c 2e  ...if ( special.
233a0 70 72 65 44 69 73 70 61 74 63 68 20 26 26 20 73  preDispatch && s
233b0 70 65 63 69 61 6c 2e 70 72 65 44 69 73 70 61 74  pecial.preDispat
233c0 63 68 2e 63 61 6c 6c 28 20 74 68 69 73 2c 20 65  ch.call( this, e
233d0 76 65 6e 74 20 29 20 3d 3d 3d 20 66 61 6c 73 65  vent ) === false
233e0 20 29 20 7b 0a 09 09 09 72 65 74 75 72 6e 3b 0a   ) {....return;.
233f0 09 09 7d 0a 0a 09 09 2f 2f 20 44 65 74 65 72 6d  ..}....// Determ
23400 69 6e 65 20 68 61 6e 64 6c 65 72 73 0a 09 09 68  ine handlers...h
23410 61 6e 64 6c 65 72 51 75 65 75 65 20 3d 20 6a 51  andlerQueue = jQ
23420 75 65 72 79 2e 65 76 65 6e 74 2e 68 61 6e 64 6c  uery.event.handl
23430 65 72 73 2e 63 61 6c 6c 28 20 74 68 69 73 2c 20  ers.call( this, 
23440 65 76 65 6e 74 2c 20 68 61 6e 64 6c 65 72 73 20  event, handlers 
23450 29 3b 0a 0a 09 09 2f 2f 20 52 75 6e 20 64 65 6c  );....// Run del
23460 65 67 61 74 65 73 20 66 69 72 73 74 3b 20 74 68  egates first; th
23470 65 79 20 6d 61 79 20 77 61 6e 74 20 74 6f 20 73  ey may want to s
23480 74 6f 70 20 70 72 6f 70 61 67 61 74 69 6f 6e 20  top propagation 
23490 62 65 6e 65 61 74 68 20 75 73 0a 09 09 69 20 3d  beneath us...i =
234a0 20 30 3b 0a 09 09 77 68 69 6c 65 20 28 20 28 20   0;...while ( ( 
234b0 6d 61 74 63 68 65 64 20 3d 20 68 61 6e 64 6c 65  matched = handle
234c0 72 51 75 65 75 65 5b 20 69 2b 2b 20 5d 20 29 20  rQueue[ i++ ] ) 
234d0 26 26 20 21 65 76 65 6e 74 2e 69 73 50 72 6f 70  && !event.isProp
234e0 61 67 61 74 69 6f 6e 53 74 6f 70 70 65 64 28 29  agationStopped()
234f0 20 29 20 7b 0a 09 09 09 65 76 65 6e 74 2e 63 75   ) {....event.cu
23500 72 72 65 6e 74 54 61 72 67 65 74 20 3d 20 6d 61  rrentTarget = ma
23510 74 63 68 65 64 2e 65 6c 65 6d 3b 0a 0a 09 09 09  tched.elem;.....
23520 6a 20 3d 20 30 3b 0a 09 09 09 77 68 69 6c 65 20  j = 0;....while 
23530 28 20 28 20 68 61 6e 64 6c 65 4f 62 6a 20 3d 20  ( ( handleObj = 
23540 6d 61 74 63 68 65 64 2e 68 61 6e 64 6c 65 72 73  matched.handlers
23550 5b 20 6a 2b 2b 20 5d 20 29 20 26 26 0a 09 09 09  [ j++ ] ) &&....
23560 09 21 65 76 65 6e 74 2e 69 73 49 6d 6d 65 64 69  .!event.isImmedi
23570 61 74 65 50 72 6f 70 61 67 61 74 69 6f 6e 53 74  atePropagationSt
23580 6f 70 70 65 64 28 29 20 29 20 7b 0a 0a 09 09 09  opped() ) {.....
23590 09 2f 2f 20 49 66 20 74 68 65 20 65 76 65 6e 74  .// If the event
235a0 20 69 73 20 6e 61 6d 65 73 70 61 63 65 64 2c 20   is namespaced, 
235b0 74 68 65 6e 20 65 61 63 68 20 68 61 6e 64 6c 65  then each handle
235c0 72 20 69 73 20 6f 6e 6c 79 20 69 6e 76 6f 6b 65  r is only invoke
235d0 64 20 69 66 20 69 74 20 69 73 0a 09 09 09 09 2f  d if it is...../
235e0 2f 20 73 70 65 63 69 61 6c 6c 79 20 75 6e 69 76  / specially univ
235f0 65 72 73 61 6c 20 6f 72 20 69 74 73 20 6e 61 6d  ersal or its nam
23600 65 73 70 61 63 65 73 20 61 72 65 20 61 20 73 75  espaces are a su
23610 70 65 72 73 65 74 20 6f 66 20 74 68 65 20 65 76  perset of the ev
23620 65 6e 74 27 73 2e 0a 09 09 09 09 69 66 20 28 20  ent's......if ( 
23630 21 65 76 65 6e 74 2e 72 6e 61 6d 65 73 70 61 63  !event.rnamespac
23640 65 20 7c 7c 20 68 61 6e 64 6c 65 4f 62 6a 2e 6e  e || handleObj.n
23650 61 6d 65 73 70 61 63 65 20 3d 3d 3d 20 66 61 6c  amespace === fal
23660 73 65 20 7c 7c 0a 09 09 09 09 09 65 76 65 6e 74  se ||......event
23670 2e 72 6e 61 6d 65 73 70 61 63 65 2e 74 65 73 74  .rnamespace.test
23680 28 20 68 61 6e 64 6c 65 4f 62 6a 2e 6e 61 6d 65  ( handleObj.name
23690 73 70 61 63 65 20 29 20 29 20 7b 0a 0a 09 09 09  space ) ) {.....
236a0 09 09 65 76 65 6e 74 2e 68 61 6e 64 6c 65 4f 62  ..event.handleOb
236b0 6a 20 3d 20 68 61 6e 64 6c 65 4f 62 6a 3b 0a 09  j = handleObj;..
236c0 09 09 09 09 65 76 65 6e 74 2e 64 61 74 61 20 3d  ....event.data =
236d0 20 68 61 6e 64 6c 65 4f 62 6a 2e 64 61 74 61 3b   handleObj.data;
236e0 0a 0a 09 09 09 09 09 72 65 74 20 3d 20 28 20 28  .......ret = ( (
236f0 20 6a 51 75 65 72 79 2e 65 76 65 6e 74 2e 73 70   jQuery.event.sp
23700 65 63 69 61 6c 5b 20 68 61 6e 64 6c 65 4f 62 6a  ecial[ handleObj
23710 2e 6f 72 69 67 54 79 70 65 20 5d 20 7c 7c 20 7b  .origType ] || {
23720 7d 20 29 2e 68 61 6e 64 6c 65 20 7c 7c 0a 09 09  } ).handle ||...
23730 09 09 09 09 68 61 6e 64 6c 65 4f 62 6a 2e 68 61  ....handleObj.ha
23740 6e 64 6c 65 72 20 29 2e 61 70 70 6c 79 28 20 6d  ndler ).apply( m
23750 61 74 63 68 65 64 2e 65 6c 65 6d 2c 20 61 72 67  atched.elem, arg
23760 73 20 29 3b 0a 0a 09 09 09 09 09 69 66 20 28 20  s );.......if ( 
23770 72 65 74 20 21 3d 3d 20 75 6e 64 65 66 69 6e 65  ret !== undefine
23780 64 20 29 20 7b 0a 09 09 09 09 09 09 69 66 20 28  d ) {.......if (
23790 20 28 20 65 76 65 6e 74 2e 72 65 73 75 6c 74 20   ( event.result 
237a0 3d 20 72 65 74 20 29 20 3d 3d 3d 20 66 61 6c 73  = ret ) === fals
237b0 65 20 29 20 7b 0a 09 09 09 09 09 09 09 65 76 65  e ) {........eve
237c0 6e 74 2e 70 72 65 76 65 6e 74 44 65 66 61 75 6c  nt.preventDefaul
237d0 74 28 29 3b 0a 09 09 09 09 09 09 09 65 76 65 6e  t();........even
237e0 74 2e 73 74 6f 70 50 72 6f 70 61 67 61 74 69 6f  t.stopPropagatio
237f0 6e 28 29 3b 0a 09 09 09 09 09 09 7d 0a 09 09 09  n();.......}....
23800 09 09 7d 0a 09 09 09 09 7d 0a 09 09 09 7d 0a 09  ..}.....}....}..
23810 09 7d 0a 0a 09 09 2f 2f 20 43 61 6c 6c 20 74 68  .}....// Call th
23820 65 20 70 6f 73 74 44 69 73 70 61 74 63 68 20 68  e postDispatch h
23830 6f 6f 6b 20 66 6f 72 20 74 68 65 20 6d 61 70 70  ook for the mapp
23840 65 64 20 74 79 70 65 0a 09 09 69 66 20 28 20 73  ed type...if ( s
23850 70 65 63 69 61 6c 2e 70 6f 73 74 44 69 73 70 61  pecial.postDispa
23860 74 63 68 20 29 20 7b 0a 09 09 09 73 70 65 63 69  tch ) {....speci
23870 61 6c 2e 70 6f 73 74 44 69 73 70 61 74 63 68 2e  al.postDispatch.
23880 63 61 6c 6c 28 20 74 68 69 73 2c 20 65 76 65 6e  call( this, even
23890 74 20 29 3b 0a 09 09 7d 0a 0a 09 09 72 65 74 75  t );...}....retu
238a0 72 6e 20 65 76 65 6e 74 2e 72 65 73 75 6c 74 3b  rn event.result;
238b0 0a 09 7d 2c 0a 0a 09 68 61 6e 64 6c 65 72 73 3a  ..},...handlers:
238c0 20 66 75 6e 63 74 69 6f 6e 28 20 65 76 65 6e 74   function( event
238d0 2c 20 68 61 6e 64 6c 65 72 73 20 29 20 7b 0a 09  , handlers ) {..
238e0 09 76 61 72 20 69 2c 20 68 61 6e 64 6c 65 4f 62  .var i, handleOb
238f0 6a 2c 20 73 65 6c 2c 20 6d 61 74 63 68 65 64 48  j, sel, matchedH
23900 61 6e 64 6c 65 72 73 2c 20 6d 61 74 63 68 65 64  andlers, matched
23910 53 65 6c 65 63 74 6f 72 73 2c 0a 09 09 09 68 61  Selectors,....ha
23920 6e 64 6c 65 72 51 75 65 75 65 20 3d 20 5b 5d 2c  ndlerQueue = [],
23930 0a 09 09 09 64 65 6c 65 67 61 74 65 43 6f 75 6e  ....delegateCoun
23940 74 20 3d 20 68 61 6e 64 6c 65 72 73 2e 64 65 6c  t = handlers.del
23950 65 67 61 74 65 43 6f 75 6e 74 2c 0a 09 09 09 63  egateCount,....c
23960 75 72 20 3d 20 65 76 65 6e 74 2e 74 61 72 67 65  ur = event.targe
23970 74 3b 0a 0a 09 09 2f 2f 20 46 69 6e 64 20 64 65  t;....// Find de
23980 6c 65 67 61 74 65 20 68 61 6e 64 6c 65 72 73 0a  legate handlers.
23990 09 09 69 66 20 28 20 64 65 6c 65 67 61 74 65 43  ..if ( delegateC
239a0 6f 75 6e 74 20 26 26 0a 0a 09 09 09 2f 2f 20 53  ount &&.....// S
239b0 75 70 70 6f 72 74 3a 20 49 45 20 3c 3d 39 0a 09  upport: IE <=9..
239c0 09 09 2f 2f 20 42 6c 61 63 6b 2d 68 6f 6c 65 20  ..// Black-hole 
239d0 53 56 47 20 3c 75 73 65 3e 20 69 6e 73 74 61 6e  SVG <use> instan
239e0 63 65 20 74 72 65 65 73 20 28 74 72 61 63 2d 31  ce trees (trac-1
239f0 33 31 38 30 29 0a 09 09 09 63 75 72 2e 6e 6f 64  3180)....cur.nod
23a00 65 54 79 70 65 20 26 26 0a 0a 09 09 09 2f 2f 20  eType &&.....// 
23a10 53 75 70 70 6f 72 74 3a 20 46 69 72 65 66 6f 78  Support: Firefox
23a20 20 3c 3d 34 32 0a 09 09 09 2f 2f 20 53 75 70 70   <=42....// Supp
23a30 72 65 73 73 20 73 70 65 63 2d 76 69 6f 6c 61 74  ress spec-violat
23a40 69 6e 67 20 63 6c 69 63 6b 73 20 69 6e 64 69 63  ing clicks indic
23a50 61 74 69 6e 67 20 61 20 6e 6f 6e 2d 70 72 69 6d  ating a non-prim
23a60 61 72 79 20 70 6f 69 6e 74 65 72 20 62 75 74 74  ary pointer butt
23a70 6f 6e 20 28 74 72 61 63 2d 33 38 36 31 29 0a 09  on (trac-3861)..
23a80 09 09 2f 2f 20 68 74 74 70 73 3a 2f 2f 77 77 77  ..// https://www
23a90 2e 77 33 2e 6f 72 67 2f 54 52 2f 44 4f 4d 2d 4c  .w3.org/TR/DOM-L
23aa0 65 76 65 6c 2d 33 2d 45 76 65 6e 74 73 2f 23 65  evel-3-Events/#e
23ab0 76 65 6e 74 2d 74 79 70 65 2d 63 6c 69 63 6b 0a  vent-type-click.
23ac0 09 09 09 2f 2f 20 53 75 70 70 6f 72 74 3a 20 49  ...// Support: I
23ad0 45 20 31 31 20 6f 6e 6c 79 0a 09 09 09 2f 2f 20  E 11 only....// 
23ae0 2e 2e 2e 62 75 74 20 6e 6f 74 20 61 72 72 6f 77  ...but not arrow
23af0 20 6b 65 79 20 22 63 6c 69 63 6b 73 22 20 6f 66   key "clicks" of
23b00 20 72 61 64 69 6f 20 69 6e 70 75 74 73 2c 20 77   radio inputs, w
23b10 68 69 63 68 20 63 61 6e 20 68 61 76 65 20 60 62  hich can have `b
23b20 75 74 74 6f 6e 60 20 2d 31 20 28 67 68 2d 32 33  utton` -1 (gh-23
23b30 34 33 29 0a 09 09 09 21 28 20 65 76 65 6e 74 2e  43)....!( event.
23b40 74 79 70 65 20 3d 3d 3d 20 22 63 6c 69 63 6b 22  type === "click"
23b50 20 26 26 20 65 76 65 6e 74 2e 62 75 74 74 6f 6e   && event.button
23b60 20 3e 3d 20 31 20 29 20 29 20 7b 0a 0a 09 09 09   >= 1 ) ) {.....
23b70 66 6f 72 20 28 20 3b 20 63 75 72 20 21 3d 3d 20  for ( ; cur !== 
23b80 74 68 69 73 3b 20 63 75 72 20 3d 20 63 75 72 2e  this; cur = cur.
23b90 70 61 72 65 6e 74 4e 6f 64 65 20 7c 7c 20 74 68  parentNode || th
23ba0 69 73 20 29 20 7b 0a 0a 09 09 09 09 2f 2f 20 44  is ) {......// D
23bb0 6f 6e 27 74 20 63 68 65 63 6b 20 6e 6f 6e 2d 65  on't check non-e
23bc0 6c 65 6d 65 6e 74 73 20 28 23 31 33 32 30 38 29  lements (#13208)
23bd0 0a 09 09 09 09 2f 2f 20 44 6f 6e 27 74 20 70 72  .....// Don't pr
23be0 6f 63 65 73 73 20 63 6c 69 63 6b 73 20 6f 6e 20  ocess clicks on 
23bf0 64 69 73 61 62 6c 65 64 20 65 6c 65 6d 65 6e 74  disabled element
23c00 73 20 28 23 36 39 31 31 2c 20 23 38 31 36 35 2c  s (#6911, #8165,
23c10 20 23 31 31 33 38 32 2c 20 23 31 31 37 36 34 29   #11382, #11764)
23c20 0a 09 09 09 09 69 66 20 28 20 63 75 72 2e 6e 6f  .....if ( cur.no
23c30 64 65 54 79 70 65 20 3d 3d 3d 20 31 20 26 26 20  deType === 1 && 
23c40 21 28 20 65 76 65 6e 74 2e 74 79 70 65 20 3d 3d  !( event.type ==
23c50 3d 20 22 63 6c 69 63 6b 22 20 26 26 20 63 75 72  = "click" && cur
23c60 2e 64 69 73 61 62 6c 65 64 20 3d 3d 3d 20 74 72  .disabled === tr
23c70 75 65 20 29 20 29 20 7b 0a 09 09 09 09 09 6d 61  ue ) ) {......ma
23c80 74 63 68 65 64 48 61 6e 64 6c 65 72 73 20 3d 20  tchedHandlers = 
23c90 5b 5d 3b 0a 09 09 09 09 09 6d 61 74 63 68 65 64  [];......matched
23ca0 53 65 6c 65 63 74 6f 72 73 20 3d 20 7b 7d 3b 0a  Selectors = {};.
23cb0 09 09 09 09 09 66 6f 72 20 28 20 69 20 3d 20 30  .....for ( i = 0
23cc0 3b 20 69 20 3c 20 64 65 6c 65 67 61 74 65 43 6f  ; i < delegateCo
23cd0 75 6e 74 3b 20 69 2b 2b 20 29 20 7b 0a 09 09 09  unt; i++ ) {....
23ce0 09 09 09 68 61 6e 64 6c 65 4f 62 6a 20 3d 20 68  ...handleObj = h
23cf0 61 6e 64 6c 65 72 73 5b 20 69 20 5d 3b 0a 0a 09  andlers[ i ];...
23d00 09 09 09 09 09 2f 2f 20 44 6f 6e 27 74 20 63 6f  .....// Don't co
23d10 6e 66 6c 69 63 74 20 77 69 74 68 20 4f 62 6a 65  nflict with Obje
23d20 63 74 2e 70 72 6f 74 6f 74 79 70 65 20 70 72 6f  ct.prototype pro
23d30 70 65 72 74 69 65 73 20 28 23 31 33 32 30 33 29  perties (#13203)
23d40 0a 09 09 09 09 09 09 73 65 6c 20 3d 20 68 61 6e  .......sel = han
23d50 64 6c 65 4f 62 6a 2e 73 65 6c 65 63 74 6f 72 20  dleObj.selector 
23d60 2b 20 22 20 22 3b 0a 0a 09 09 09 09 09 09 69 66  + " ";........if
23d70 20 28 20 6d 61 74 63 68 65 64 53 65 6c 65 63 74   ( matchedSelect
23d80 6f 72 73 5b 20 73 65 6c 20 5d 20 3d 3d 3d 20 75  ors[ sel ] === u
23d90 6e 64 65 66 69 6e 65 64 20 29 20 7b 0a 09 09 09  ndefined ) {....
23da0 09 09 09 09 6d 61 74 63 68 65 64 53 65 6c 65 63  ....matchedSelec
23db0 74 6f 72 73 5b 20 73 65 6c 20 5d 20 3d 20 68 61  tors[ sel ] = ha
23dc0 6e 64 6c 65 4f 62 6a 2e 6e 65 65 64 73 43 6f 6e  ndleObj.needsCon
23dd0 74 65 78 74 20 3f 0a 09 09 09 09 09 09 09 09 6a  text ?.........j
23de0 51 75 65 72 79 28 20 73 65 6c 2c 20 74 68 69 73  Query( sel, this
23df0 20 29 2e 69 6e 64 65 78 28 20 63 75 72 20 29 20   ).index( cur ) 
23e00 3e 20 2d 31 20 3a 0a 09 09 09 09 09 09 09 09 6a  > -1 :.........j
23e10 51 75 65 72 79 2e 66 69 6e 64 28 20 73 65 6c 2c  Query.find( sel,
23e20 20 74 68 69 73 2c 20 6e 75 6c 6c 2c 20 5b 20 63   this, null, [ c
23e30 75 72 20 5d 20 29 2e 6c 65 6e 67 74 68 3b 0a 09  ur ] ).length;..
23e40 09 09 09 09 09 7d 0a 09 09 09 09 09 09 69 66 20  .....}.......if 
23e50 28 20 6d 61 74 63 68 65 64 53 65 6c 65 63 74 6f  ( matchedSelecto
23e60 72 73 5b 20 73 65 6c 20 5d 20 29 20 7b 0a 09 09  rs[ sel ] ) {...
23e70 09 09 09 09 09 6d 61 74 63 68 65 64 48 61 6e 64  .....matchedHand
23e80 6c 65 72 73 2e 70 75 73 68 28 20 68 61 6e 64 6c  lers.push( handl
23e90 65 4f 62 6a 20 29 3b 0a 09 09 09 09 09 09 7d 0a  eObj );.......}.
23ea0 09 09 09 09 09 7d 0a 09 09 09 09 09 69 66 20 28  .....}......if (
23eb0 20 6d 61 74 63 68 65 64 48 61 6e 64 6c 65 72 73   matchedHandlers
23ec0 2e 6c 65 6e 67 74 68 20 29 20 7b 0a 09 09 09 09  .length ) {.....
23ed0 09 09 68 61 6e 64 6c 65 72 51 75 65 75 65 2e 70  ..handlerQueue.p
23ee0 75 73 68 28 20 7b 20 65 6c 65 6d 3a 20 63 75 72  ush( { elem: cur
23ef0 2c 20 68 61 6e 64 6c 65 72 73 3a 20 6d 61 74 63  , handlers: matc
23f00 68 65 64 48 61 6e 64 6c 65 72 73 20 7d 20 29 3b  hedHandlers } );
23f10 0a 09 09 09 09 09 7d 0a 09 09 09 09 7d 0a 09 09  ......}.....}...
23f20 09 7d 0a 09 09 7d 0a 0a 09 09 2f 2f 20 41 64 64  .}...}....// Add
23f30 20 74 68 65 20 72 65 6d 61 69 6e 69 6e 67 20 28   the remaining (
23f40 64 69 72 65 63 74 6c 79 2d 62 6f 75 6e 64 29 20  directly-bound) 
23f50 68 61 6e 64 6c 65 72 73 0a 09 09 63 75 72 20 3d  handlers...cur =
23f60 20 74 68 69 73 3b 0a 09 09 69 66 20 28 20 64 65   this;...if ( de
23f70 6c 65 67 61 74 65 43 6f 75 6e 74 20 3c 20 68 61  legateCount < ha
23f80 6e 64 6c 65 72 73 2e 6c 65 6e 67 74 68 20 29 20  ndlers.length ) 
23f90 7b 0a 09 09 09 68 61 6e 64 6c 65 72 51 75 65 75  {....handlerQueu
23fa0 65 2e 70 75 73 68 28 20 7b 20 65 6c 65 6d 3a 20  e.push( { elem: 
23fb0 63 75 72 2c 20 68 61 6e 64 6c 65 72 73 3a 20 68  cur, handlers: h
23fc0 61 6e 64 6c 65 72 73 2e 73 6c 69 63 65 28 20 64  andlers.slice( d
23fd0 65 6c 65 67 61 74 65 43 6f 75 6e 74 20 29 20 7d  elegateCount ) }
23fe0 20 29 3b 0a 09 09 7d 0a 0a 09 09 72 65 74 75 72   );...}....retur
23ff0 6e 20 68 61 6e 64 6c 65 72 51 75 65 75 65 3b 0a  n handlerQueue;.
24000 09 7d 2c 0a 0a 09 61 64 64 50 72 6f 70 3a 20 66  .},...addProp: f
24010 75 6e 63 74 69 6f 6e 28 20 6e 61 6d 65 2c 20 68  unction( name, h
24020 6f 6f 6b 20 29 20 7b 0a 09 09 4f 62 6a 65 63 74  ook ) {...Object
24030 2e 64 65 66 69 6e 65 50 72 6f 70 65 72 74 79 28  .defineProperty(
24040 20 6a 51 75 65 72 79 2e 45 76 65 6e 74 2e 70 72   jQuery.Event.pr
24050 6f 74 6f 74 79 70 65 2c 20 6e 61 6d 65 2c 20 7b  ototype, name, {
24060 0a 09 09 09 65 6e 75 6d 65 72 61 62 6c 65 3a 20  ....enumerable: 
24070 74 72 75 65 2c 0a 09 09 09 63 6f 6e 66 69 67 75  true,....configu
24080 72 61 62 6c 65 3a 20 74 72 75 65 2c 0a 0a 09 09  rable: true,....
24090 09 67 65 74 3a 20 69 73 46 75 6e 63 74 69 6f 6e  .get: isFunction
240a0 28 20 68 6f 6f 6b 20 29 20 3f 0a 09 09 09 09 66  ( hook ) ?.....f
240b0 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09 09 09 09  unction() {.....
240c0 09 69 66 20 28 20 74 68 69 73 2e 6f 72 69 67 69  .if ( this.origi
240d0 6e 61 6c 45 76 65 6e 74 20 29 20 7b 0a 09 09 09  nalEvent ) {....
240e0 09 09 09 09 72 65 74 75 72 6e 20 68 6f 6f 6b 28  ....return hook(
240f0 20 74 68 69 73 2e 6f 72 69 67 69 6e 61 6c 45 76   this.originalEv
24100 65 6e 74 20 29 3b 0a 09 09 09 09 09 7d 0a 09 09  ent );......}...
24110 09 09 7d 20 3a 0a 09 09 09 09 66 75 6e 63 74 69  ..} :.....functi
24120 6f 6e 28 29 20 7b 0a 09 09 09 09 09 69 66 20 28  on() {......if (
24130 20 74 68 69 73 2e 6f 72 69 67 69 6e 61 6c 45 76   this.originalEv
24140 65 6e 74 20 29 20 7b 0a 09 09 09 09 09 09 09 72  ent ) {........r
24150 65 74 75 72 6e 20 74 68 69 73 2e 6f 72 69 67 69  eturn this.origi
24160 6e 61 6c 45 76 65 6e 74 5b 20 6e 61 6d 65 20 5d  nalEvent[ name ]
24170 3b 0a 09 09 09 09 09 7d 0a 09 09 09 09 7d 2c 0a  ;......}.....},.
24180 0a 09 09 09 73 65 74 3a 20 66 75 6e 63 74 69 6f  ....set: functio
24190 6e 28 20 76 61 6c 75 65 20 29 20 7b 0a 09 09 09  n( value ) {....
241a0 09 4f 62 6a 65 63 74 2e 64 65 66 69 6e 65 50 72  .Object.definePr
241b0 6f 70 65 72 74 79 28 20 74 68 69 73 2c 20 6e 61  operty( this, na
241c0 6d 65 2c 20 7b 0a 09 09 09 09 09 65 6e 75 6d 65  me, {......enume
241d0 72 61 62 6c 65 3a 20 74 72 75 65 2c 0a 09 09 09  rable: true,....
241e0 09 09 63 6f 6e 66 69 67 75 72 61 62 6c 65 3a 20  ..configurable: 
241f0 74 72 75 65 2c 0a 09 09 09 09 09 77 72 69 74 61  true,......writa
24200 62 6c 65 3a 20 74 72 75 65 2c 0a 09 09 09 09 09  ble: true,......
24210 76 61 6c 75 65 3a 20 76 61 6c 75 65 0a 09 09 09  value: value....
24220 09 7d 20 29 3b 0a 09 09 09 7d 0a 09 09 7d 20 29  .} );....}...} )
24230 3b 0a 09 7d 2c 0a 0a 09 66 69 78 3a 20 66 75 6e  ;..},...fix: fun
24240 63 74 69 6f 6e 28 20 6f 72 69 67 69 6e 61 6c 45  ction( originalE
24250 76 65 6e 74 20 29 20 7b 0a 09 09 72 65 74 75 72  vent ) {...retur
24260 6e 20 6f 72 69 67 69 6e 61 6c 45 76 65 6e 74 5b  n originalEvent[
24270 20 6a 51 75 65 72 79 2e 65 78 70 61 6e 64 6f 20   jQuery.expando 
24280 5d 20 3f 0a 09 09 09 6f 72 69 67 69 6e 61 6c 45  ] ?....originalE
24290 76 65 6e 74 20 3a 0a 09 09 09 6e 65 77 20 6a 51  vent :....new jQ
242a0 75 65 72 79 2e 45 76 65 6e 74 28 20 6f 72 69 67  uery.Event( orig
242b0 69 6e 61 6c 45 76 65 6e 74 20 29 3b 0a 09 7d 2c  inalEvent );..},
242c0 0a 0a 09 73 70 65 63 69 61 6c 3a 20 7b 0a 09 09  ...special: {...
242d0 6c 6f 61 64 3a 20 7b 0a 0a 09 09 09 2f 2f 20 50  load: {.....// P
242e0 72 65 76 65 6e 74 20 74 72 69 67 67 65 72 65 64  revent triggered
242f0 20 69 6d 61 67 65 2e 6c 6f 61 64 20 65 76 65 6e   image.load even
24300 74 73 20 66 72 6f 6d 20 62 75 62 62 6c 69 6e 67  ts from bubbling
24310 20 74 6f 20 77 69 6e 64 6f 77 2e 6c 6f 61 64 0a   to window.load.
24320 09 09 09 6e 6f 42 75 62 62 6c 65 3a 20 74 72 75  ...noBubble: tru
24330 65 0a 09 09 7d 2c 0a 09 09 63 6c 69 63 6b 3a 20  e...},...click: 
24340 7b 0a 0a 09 09 09 2f 2f 20 55 74 69 6c 69 7a 65  {.....// Utilize
24350 20 6e 61 74 69 76 65 20 65 76 65 6e 74 20 74 6f   native event to
24360 20 65 6e 73 75 72 65 20 63 6f 72 72 65 63 74 20   ensure correct 
24370 73 74 61 74 65 20 66 6f 72 20 63 68 65 63 6b 61  state for checka
24380 62 6c 65 20 69 6e 70 75 74 73 0a 09 09 09 73 65  ble inputs....se
24390 74 75 70 3a 20 66 75 6e 63 74 69 6f 6e 28 20 64  tup: function( d
243a0 61 74 61 20 29 20 7b 0a 0a 09 09 09 09 2f 2f 20  ata ) {......// 
243b0 46 6f 72 20 6d 75 74 75 61 6c 20 63 6f 6d 70 72  For mutual compr
243c0 65 73 73 69 62 69 6c 69 74 79 20 77 69 74 68 20  essibility with 
243d0 5f 64 65 66 61 75 6c 74 2c 20 72 65 70 6c 61 63  _default, replac
243e0 65 20 60 74 68 69 73 60 20 61 63 63 65 73 73 20  e `this` access 
243f0 77 69 74 68 20 61 20 6c 6f 63 61 6c 20 76 61 72  with a local var
24400 2e 0a 09 09 09 09 2f 2f 20 60 7c 7c 20 64 61 74  ......// `|| dat
24410 61 60 20 69 73 20 64 65 61 64 20 63 6f 64 65 20  a` is dead code 
24420 6d 65 61 6e 74 20 6f 6e 6c 79 20 74 6f 20 70 72  meant only to pr
24430 65 73 65 72 76 65 20 74 68 65 20 76 61 72 69 61  eserve the varia
24440 62 6c 65 20 74 68 72 6f 75 67 68 20 6d 69 6e 69  ble through mini
24450 66 69 63 61 74 69 6f 6e 2e 0a 09 09 09 09 76 61  fication......va
24460 72 20 65 6c 20 3d 20 74 68 69 73 20 7c 7c 20 64  r el = this || d
24470 61 74 61 3b 0a 0a 09 09 09 09 2f 2f 20 43 6c 61  ata;......// Cla
24480 69 6d 20 74 68 65 20 66 69 72 73 74 20 68 61 6e  im the first han
24490 64 6c 65 72 0a 09 09 09 09 69 66 20 28 20 72 63  dler.....if ( rc
244a0 68 65 63 6b 61 62 6c 65 54 79 70 65 2e 74 65 73  heckableType.tes
244b0 74 28 20 65 6c 2e 74 79 70 65 20 29 20 26 26 0a  t( el.type ) &&.
244c0 09 09 09 09 09 65 6c 2e 63 6c 69 63 6b 20 26 26  .....el.click &&
244d0 20 6e 6f 64 65 4e 61 6d 65 28 20 65 6c 2c 20 22   nodeName( el, "
244e0 69 6e 70 75 74 22 20 29 20 29 20 7b 0a 0a 09 09  input" ) ) {....
244f0 09 09 09 2f 2f 20 64 61 74 61 50 72 69 76 2e 73  ...// dataPriv.s
24500 65 74 28 20 65 6c 2c 20 22 63 6c 69 63 6b 22 2c  et( el, "click",
24510 20 2e 2e 2e 20 29 0a 09 09 09 09 09 6c 65 76 65   ... )......leve
24520 72 61 67 65 4e 61 74 69 76 65 28 20 65 6c 2c 20  rageNative( el, 
24530 22 63 6c 69 63 6b 22 2c 20 72 65 74 75 72 6e 54  "click", returnT
24540 72 75 65 20 29 3b 0a 09 09 09 09 7d 0a 0a 09 09  rue );.....}....
24550 09 09 2f 2f 20 52 65 74 75 72 6e 20 66 61 6c 73  ..// Return fals
24560 65 20 74 6f 20 61 6c 6c 6f 77 20 6e 6f 72 6d 61  e to allow norma
24570 6c 20 70 72 6f 63 65 73 73 69 6e 67 20 69 6e 20  l processing in 
24580 74 68 65 20 63 61 6c 6c 65 72 0a 09 09 09 09 72  the caller.....r
24590 65 74 75 72 6e 20 66 61 6c 73 65 3b 0a 09 09 09  eturn false;....
245a0 7d 2c 0a 09 09 09 74 72 69 67 67 65 72 3a 20 66  },....trigger: f
245b0 75 6e 63 74 69 6f 6e 28 20 64 61 74 61 20 29 20  unction( data ) 
245c0 7b 0a 0a 09 09 09 09 2f 2f 20 46 6f 72 20 6d 75  {......// For mu
245d0 74 75 61 6c 20 63 6f 6d 70 72 65 73 73 69 62 69  tual compressibi
245e0 6c 69 74 79 20 77 69 74 68 20 5f 64 65 66 61 75  lity with _defau
245f0 6c 74 2c 20 72 65 70 6c 61 63 65 20 60 74 68 69  lt, replace `thi
24600 73 60 20 61 63 63 65 73 73 20 77 69 74 68 20 61  s` access with a
24610 20 6c 6f 63 61 6c 20 76 61 72 2e 0a 09 09 09 09   local var......
24620 2f 2f 20 60 7c 7c 20 64 61 74 61 60 20 69 73 20  // `|| data` is 
24630 64 65 61 64 20 63 6f 64 65 20 6d 65 61 6e 74 20  dead code meant 
24640 6f 6e 6c 79 20 74 6f 20 70 72 65 73 65 72 76 65  only to preserve
24650 20 74 68 65 20 76 61 72 69 61 62 6c 65 20 74 68   the variable th
24660 72 6f 75 67 68 20 6d 69 6e 69 66 69 63 61 74 69  rough minificati
24670 6f 6e 2e 0a 09 09 09 09 76 61 72 20 65 6c 20 3d  on......var el =
24680 20 74 68 69 73 20 7c 7c 20 64 61 74 61 3b 0a 0a   this || data;..
24690 09 09 09 09 2f 2f 20 46 6f 72 63 65 20 73 65 74  ....// Force set
246a0 75 70 20 62 65 66 6f 72 65 20 74 72 69 67 67 65  up before trigge
246b0 72 69 6e 67 20 61 20 63 6c 69 63 6b 0a 09 09 09  ring a click....
246c0 09 69 66 20 28 20 72 63 68 65 63 6b 61 62 6c 65  .if ( rcheckable
246d0 54 79 70 65 2e 74 65 73 74 28 20 65 6c 2e 74 79  Type.test( el.ty
246e0 70 65 20 29 20 26 26 0a 09 09 09 09 09 65 6c 2e  pe ) &&......el.
246f0 63 6c 69 63 6b 20 26 26 20 6e 6f 64 65 4e 61 6d  click && nodeNam
24700 65 28 20 65 6c 2c 20 22 69 6e 70 75 74 22 20 29  e( el, "input" )
24710 20 29 20 7b 0a 0a 09 09 09 09 09 6c 65 76 65 72   ) {.......lever
24720 61 67 65 4e 61 74 69 76 65 28 20 65 6c 2c 20 22  ageNative( el, "
24730 63 6c 69 63 6b 22 20 29 3b 0a 09 09 09 09 7d 0a  click" );.....}.
24740 0a 09 09 09 09 2f 2f 20 52 65 74 75 72 6e 20 6e  .....// Return n
24750 6f 6e 2d 66 61 6c 73 65 20 74 6f 20 61 6c 6c 6f  on-false to allo
24760 77 20 6e 6f 72 6d 61 6c 20 65 76 65 6e 74 2d 70  w normal event-p
24770 61 74 68 20 70 72 6f 70 61 67 61 74 69 6f 6e 0a  ath propagation.
24780 09 09 09 09 72 65 74 75 72 6e 20 74 72 75 65 3b  ....return true;
24790 0a 09 09 09 7d 2c 0a 0a 09 09 09 2f 2f 20 46 6f  ....},.....// Fo
247a0 72 20 63 72 6f 73 73 2d 62 72 6f 77 73 65 72 20  r cross-browser 
247b0 63 6f 6e 73 69 73 74 65 6e 63 79 2c 20 73 75 70  consistency, sup
247c0 70 72 65 73 73 20 6e 61 74 69 76 65 20 2e 63 6c  press native .cl
247d0 69 63 6b 28 29 20 6f 6e 20 6c 69 6e 6b 73 0a 09  ick() on links..
247e0 09 09 2f 2f 20 41 6c 73 6f 20 70 72 65 76 65 6e  ..// Also preven
247f0 74 20 69 74 20 69 66 20 77 65 27 72 65 20 63 75  t it if we're cu
24800 72 72 65 6e 74 6c 79 20 69 6e 73 69 64 65 20 61  rrently inside a
24810 20 6c 65 76 65 72 61 67 65 64 20 6e 61 74 69 76   leveraged nativ
24820 65 2d 65 76 65 6e 74 20 73 74 61 63 6b 0a 09 09  e-event stack...
24830 09 5f 64 65 66 61 75 6c 74 3a 20 66 75 6e 63 74  ._default: funct
24840 69 6f 6e 28 20 65 76 65 6e 74 20 29 20 7b 0a 09  ion( event ) {..
24850 09 09 09 76 61 72 20 74 61 72 67 65 74 20 3d 20  ...var target = 
24860 65 76 65 6e 74 2e 74 61 72 67 65 74 3b 0a 09 09  event.target;...
24870 09 09 72 65 74 75 72 6e 20 72 63 68 65 63 6b 61  ..return rchecka
24880 62 6c 65 54 79 70 65 2e 74 65 73 74 28 20 74 61  bleType.test( ta
24890 72 67 65 74 2e 74 79 70 65 20 29 20 26 26 0a 09  rget.type ) &&..
248a0 09 09 09 09 74 61 72 67 65 74 2e 63 6c 69 63 6b  ....target.click
248b0 20 26 26 20 6e 6f 64 65 4e 61 6d 65 28 20 74 61   && nodeName( ta
248c0 72 67 65 74 2c 20 22 69 6e 70 75 74 22 20 29 20  rget, "input" ) 
248d0 26 26 0a 09 09 09 09 09 64 61 74 61 50 72 69 76  &&......dataPriv
248e0 2e 67 65 74 28 20 74 61 72 67 65 74 2c 20 22 63  .get( target, "c
248f0 6c 69 63 6b 22 20 29 20 7c 7c 0a 09 09 09 09 09  lick" ) ||......
24900 6e 6f 64 65 4e 61 6d 65 28 20 74 61 72 67 65 74  nodeName( target
24910 2c 20 22 61 22 20 29 3b 0a 09 09 09 7d 0a 09 09  , "a" );....}...
24920 7d 2c 0a 0a 09 09 62 65 66 6f 72 65 75 6e 6c 6f  },....beforeunlo
24930 61 64 3a 20 7b 0a 09 09 09 70 6f 73 74 44 69 73  ad: {....postDis
24940 70 61 74 63 68 3a 20 66 75 6e 63 74 69 6f 6e 28  patch: function(
24950 20 65 76 65 6e 74 20 29 20 7b 0a 0a 09 09 09 09   event ) {......
24960 2f 2f 20 53 75 70 70 6f 72 74 3a 20 46 69 72 65  // Support: Fire
24970 66 6f 78 20 32 30 2b 0a 09 09 09 09 2f 2f 20 46  fox 20+.....// F
24980 69 72 65 66 6f 78 20 64 6f 65 73 6e 27 74 20 61  irefox doesn't a
24990 6c 65 72 74 20 69 66 20 74 68 65 20 72 65 74 75  lert if the retu
249a0 72 6e 56 61 6c 75 65 20 66 69 65 6c 64 20 69 73  rnValue field is
249b0 20 6e 6f 74 20 73 65 74 2e 0a 09 09 09 09 69 66   not set......if
249c0 20 28 20 65 76 65 6e 74 2e 72 65 73 75 6c 74 20   ( event.result 
249d0 21 3d 3d 20 75 6e 64 65 66 69 6e 65 64 20 26 26  !== undefined &&
249e0 20 65 76 65 6e 74 2e 6f 72 69 67 69 6e 61 6c 45   event.originalE
249f0 76 65 6e 74 20 29 20 7b 0a 09 09 09 09 09 65 76  vent ) {......ev
24a00 65 6e 74 2e 6f 72 69 67 69 6e 61 6c 45 76 65 6e  ent.originalEven
24a10 74 2e 72 65 74 75 72 6e 56 61 6c 75 65 20 3d 20  t.returnValue = 
24a20 65 76 65 6e 74 2e 72 65 73 75 6c 74 3b 0a 09 09  event.result;...
24a30 09 09 7d 0a 09 09 09 7d 0a 09 09 7d 0a 09 7d 0a  ..}....}...}..}.
24a40 7d 3b 0a 0a 2f 2f 20 45 6e 73 75 72 65 20 74 68  };..// Ensure th
24a50 65 20 70 72 65 73 65 6e 63 65 20 6f 66 20 61 6e  e presence of an
24a60 20 65 76 65 6e 74 20 6c 69 73 74 65 6e 65 72 20   event listener 
24a70 74 68 61 74 20 68 61 6e 64 6c 65 73 20 6d 61 6e  that handles man
24a80 75 61 6c 6c 79 2d 74 72 69 67 67 65 72 65 64 0a  ually-triggered.
24a90 2f 2f 20 73 79 6e 74 68 65 74 69 63 20 65 76 65  // synthetic eve
24aa0 6e 74 73 20 62 79 20 69 6e 74 65 72 72 75 70 74  nts by interrupt
24ab0 69 6e 67 20 70 72 6f 67 72 65 73 73 20 75 6e 74  ing progress unt
24ac0 69 6c 20 72 65 69 6e 76 6f 6b 65 64 20 69 6e 20  il reinvoked in 
24ad0 72 65 73 70 6f 6e 73 65 20 74 6f 0a 2f 2f 20 2a  response to.// *
24ae0 6e 61 74 69 76 65 2a 20 65 76 65 6e 74 73 20 74  native* events t
24af0 68 61 74 20 69 74 20 66 69 72 65 73 20 64 69 72  hat it fires dir
24b00 65 63 74 6c 79 2c 20 65 6e 73 75 72 69 6e 67 20  ectly, ensuring 
24b10 74 68 61 74 20 73 74 61 74 65 20 63 68 61 6e 67  that state chang
24b20 65 73 20 68 61 76 65 0a 2f 2f 20 61 6c 72 65 61  es have.// alrea
24b30 64 79 20 6f 63 63 75 72 72 65 64 20 62 65 66 6f  dy occurred befo
24b40 72 65 20 6f 74 68 65 72 20 6c 69 73 74 65 6e 65  re other listene
24b50 72 73 20 61 72 65 20 69 6e 76 6f 6b 65 64 2e 0a  rs are invoked..
24b60 66 75 6e 63 74 69 6f 6e 20 6c 65 76 65 72 61 67  function leverag
24b70 65 4e 61 74 69 76 65 28 20 65 6c 2c 20 74 79 70  eNative( el, typ
24b80 65 2c 20 65 78 70 65 63 74 53 79 6e 63 20 29 20  e, expectSync ) 
24b90 7b 0a 0a 09 2f 2f 20 4d 69 73 73 69 6e 67 20 65  {...// Missing e
24ba0 78 70 65 63 74 53 79 6e 63 20 69 6e 64 69 63 61  xpectSync indica
24bb0 74 65 73 20 61 20 74 72 69 67 67 65 72 20 63 61  tes a trigger ca
24bc0 6c 6c 2c 20 77 68 69 63 68 20 6d 75 73 74 20 66  ll, which must f
24bd0 6f 72 63 65 20 73 65 74 75 70 20 74 68 72 6f 75  orce setup throu
24be0 67 68 20 6a 51 75 65 72 79 2e 65 76 65 6e 74 2e  gh jQuery.event.
24bf0 61 64 64 0a 09 69 66 20 28 20 21 65 78 70 65 63  add..if ( !expec
24c00 74 53 79 6e 63 20 29 20 7b 0a 09 09 69 66 20 28  tSync ) {...if (
24c10 20 64 61 74 61 50 72 69 76 2e 67 65 74 28 20 65   dataPriv.get( e
24c20 6c 2c 20 74 79 70 65 20 29 20 3d 3d 3d 20 75 6e  l, type ) === un
24c30 64 65 66 69 6e 65 64 20 29 20 7b 0a 09 09 09 6a  defined ) {....j
24c40 51 75 65 72 79 2e 65 76 65 6e 74 2e 61 64 64 28  Query.event.add(
24c50 20 65 6c 2c 20 74 79 70 65 2c 20 72 65 74 75 72   el, type, retur
24c60 6e 54 72 75 65 20 29 3b 0a 09 09 7d 0a 09 09 72  nTrue );...}...r
24c70 65 74 75 72 6e 3b 0a 09 7d 0a 0a 09 2f 2f 20 52  eturn;..}...// R
24c80 65 67 69 73 74 65 72 20 74 68 65 20 63 6f 6e 74  egister the cont
24c90 72 6f 6c 6c 65 72 20 61 73 20 61 20 73 70 65 63  roller as a spec
24ca0 69 61 6c 20 75 6e 69 76 65 72 73 61 6c 20 68 61  ial universal ha
24cb0 6e 64 6c 65 72 20 66 6f 72 20 61 6c 6c 20 65 76  ndler for all ev
24cc0 65 6e 74 20 6e 61 6d 65 73 70 61 63 65 73 0a 09  ent namespaces..
24cd0 64 61 74 61 50 72 69 76 2e 73 65 74 28 20 65 6c  dataPriv.set( el
24ce0 2c 20 74 79 70 65 2c 20 66 61 6c 73 65 20 29 3b  , type, false );
24cf0 0a 09 6a 51 75 65 72 79 2e 65 76 65 6e 74 2e 61  ..jQuery.event.a
24d00 64 64 28 20 65 6c 2c 20 74 79 70 65 2c 20 7b 0a  dd( el, type, {.
24d10 09 09 6e 61 6d 65 73 70 61 63 65 3a 20 66 61 6c  ..namespace: fal
24d20 73 65 2c 0a 09 09 68 61 6e 64 6c 65 72 3a 20 66  se,...handler: f
24d30 75 6e 63 74 69 6f 6e 28 20 65 76 65 6e 74 20 29  unction( event )
24d40 20 7b 0a 09 09 09 76 61 72 20 6e 6f 74 41 73 79   {....var notAsy
24d50 6e 63 2c 20 72 65 73 75 6c 74 2c 0a 09 09 09 09  nc, result,.....
24d60 73 61 76 65 64 20 3d 20 64 61 74 61 50 72 69 76  saved = dataPriv
24d70 2e 67 65 74 28 20 74 68 69 73 2c 20 74 79 70 65  .get( this, type
24d80 20 29 3b 0a 0a 09 09 09 69 66 20 28 20 28 20 65   );.....if ( ( e
24d90 76 65 6e 74 2e 69 73 54 72 69 67 67 65 72 20 26  vent.isTrigger &
24da0 20 31 20 29 20 26 26 20 74 68 69 73 5b 20 74 79   1 ) && this[ ty
24db0 70 65 20 5d 20 29 20 7b 0a 0a 09 09 09 09 2f 2f  pe ] ) {......//
24dc0 20 49 6e 74 65 72 72 75 70 74 20 70 72 6f 63 65   Interrupt proce
24dd0 73 73 69 6e 67 20 6f 66 20 74 68 65 20 6f 75 74  ssing of the out
24de0 65 72 20 73 79 6e 74 68 65 74 69 63 20 2e 74 72  er synthetic .tr
24df0 69 67 67 65 72 28 29 65 64 20 65 76 65 6e 74 0a  igger()ed event.
24e00 09 09 09 09 2f 2f 20 53 61 76 65 64 20 64 61 74  ....// Saved dat
24e10 61 20 73 68 6f 75 6c 64 20 62 65 20 66 61 6c 73  a should be fals
24e20 65 20 69 6e 20 73 75 63 68 20 63 61 73 65 73 2c  e in such cases,
24e30 20 62 75 74 20 6d 69 67 68 74 20 62 65 20 61 20   but might be a 
24e40 6c 65 66 74 6f 76 65 72 20 63 61 70 74 75 72 65  leftover capture
24e50 20 6f 62 6a 65 63 74 0a 09 09 09 09 2f 2f 20 66   object.....// f
24e60 72 6f 6d 20 61 6e 20 61 73 79 6e 63 20 6e 61 74  rom an async nat
24e70 69 76 65 20 68 61 6e 64 6c 65 72 20 28 67 68 2d  ive handler (gh-
24e80 34 33 35 30 29 0a 09 09 09 09 69 66 20 28 20 21  4350).....if ( !
24e90 73 61 76 65 64 2e 6c 65 6e 67 74 68 20 29 20 7b  saved.length ) {
24ea0 0a 0a 09 09 09 09 09 2f 2f 20 53 74 6f 72 65 20  .......// Store 
24eb0 61 72 67 75 6d 65 6e 74 73 20 66 6f 72 20 75 73  arguments for us
24ec0 65 20 77 68 65 6e 20 68 61 6e 64 6c 69 6e 67 20  e when handling 
24ed0 74 68 65 20 69 6e 6e 65 72 20 6e 61 74 69 76 65  the inner native
24ee0 20 65 76 65 6e 74 0a 09 09 09 09 09 2f 2f 20 54   event......// T
24ef0 68 65 72 65 20 77 69 6c 6c 20 61 6c 77 61 79 73  here will always
24f00 20 62 65 20 61 74 20 6c 65 61 73 74 20 6f 6e 65   be at least one
24f10 20 61 72 67 75 6d 65 6e 74 20 28 61 6e 20 65 76   argument (an ev
24f20 65 6e 74 20 6f 62 6a 65 63 74 29 2c 20 73 6f 20  ent object), so 
24f30 74 68 69 73 20 61 72 72 61 79 0a 09 09 09 09 09  this array......
24f40 2f 2f 20 77 69 6c 6c 20 6e 6f 74 20 62 65 20 63  // will not be c
24f50 6f 6e 66 75 73 65 64 20 77 69 74 68 20 61 20 6c  onfused with a l
24f60 65 66 74 6f 76 65 72 20 63 61 70 74 75 72 65 20  eftover capture 
24f70 6f 62 6a 65 63 74 2e 0a 09 09 09 09 09 73 61 76  object.......sav
24f80 65 64 20 3d 20 73 6c 69 63 65 2e 63 61 6c 6c 28  ed = slice.call(
24f90 20 61 72 67 75 6d 65 6e 74 73 20 29 3b 0a 09 09   arguments );...
24fa0 09 09 09 64 61 74 61 50 72 69 76 2e 73 65 74 28  ...dataPriv.set(
24fb0 20 74 68 69 73 2c 20 74 79 70 65 2c 20 73 61 76   this, type, sav
24fc0 65 64 20 29 3b 0a 0a 09 09 09 09 09 2f 2f 20 54  ed );.......// T
24fd0 72 69 67 67 65 72 20 74 68 65 20 6e 61 74 69 76  rigger the nativ
24fe0 65 20 65 76 65 6e 74 20 61 6e 64 20 63 61 70 74  e event and capt
24ff0 75 72 65 20 69 74 73 20 72 65 73 75 6c 74 0a 09  ure its result..
25000 09 09 09 09 2f 2f 20 53 75 70 70 6f 72 74 3a 20  ....// Support: 
25010 49 45 20 3c 3d 39 20 2d 20 31 31 2b 0a 09 09 09  IE <=9 - 11+....
25020 09 09 2f 2f 20 66 6f 63 75 73 28 29 20 61 6e 64  ..// focus() and
25030 20 62 6c 75 72 28 29 20 61 72 65 20 61 73 79 6e   blur() are asyn
25040 63 68 72 6f 6e 6f 75 73 0a 09 09 09 09 09 6e 6f  chronous......no
25050 74 41 73 79 6e 63 20 3d 20 65 78 70 65 63 74 53  tAsync = expectS
25060 79 6e 63 28 20 74 68 69 73 2c 20 74 79 70 65 20  ync( this, type 
25070 29 3b 0a 09 09 09 09 09 74 68 69 73 5b 20 74 79  );......this[ ty
25080 70 65 20 5d 28 29 3b 0a 09 09 09 09 09 72 65 73  pe ]();......res
25090 75 6c 74 20 3d 20 64 61 74 61 50 72 69 76 2e 67  ult = dataPriv.g
250a0 65 74 28 20 74 68 69 73 2c 20 74 79 70 65 20 29  et( this, type )
250b0 3b 0a 09 09 09 09 09 69 66 20 28 20 73 61 76 65  ;......if ( save
250c0 64 20 21 3d 3d 20 72 65 73 75 6c 74 20 7c 7c 20  d !== result || 
250d0 6e 6f 74 41 73 79 6e 63 20 29 20 7b 0a 09 09 09  notAsync ) {....
250e0 09 09 09 64 61 74 61 50 72 69 76 2e 73 65 74 28  ...dataPriv.set(
250f0 20 74 68 69 73 2c 20 74 79 70 65 2c 20 66 61 6c   this, type, fal
25100 73 65 20 29 3b 0a 09 09 09 09 09 7d 20 65 6c 73  se );......} els
25110 65 20 7b 0a 09 09 09 09 09 09 72 65 73 75 6c 74  e {.......result
25120 20 3d 20 7b 7d 3b 0a 09 09 09 09 09 7d 0a 09 09   = {};......}...
25130 09 09 09 69 66 20 28 20 73 61 76 65 64 20 21 3d  ...if ( saved !=
25140 3d 20 72 65 73 75 6c 74 20 29 20 7b 0a 0a 09 09  = result ) {....
25150 09 09 09 09 2f 2f 20 43 61 6e 63 65 6c 20 74 68  ....// Cancel th
25160 65 20 6f 75 74 65 72 20 73 79 6e 74 68 65 74 69  e outer syntheti
25170 63 20 65 76 65 6e 74 0a 09 09 09 09 09 09 65 76  c event.......ev
25180 65 6e 74 2e 73 74 6f 70 49 6d 6d 65 64 69 61 74  ent.stopImmediat
25190 65 50 72 6f 70 61 67 61 74 69 6f 6e 28 29 3b 0a  ePropagation();.
251a0 09 09 09 09 09 09 65 76 65 6e 74 2e 70 72 65 76  ......event.prev
251b0 65 6e 74 44 65 66 61 75 6c 74 28 29 3b 0a 09 09  entDefault();...
251c0 09 09 09 09 72 65 74 75 72 6e 20 72 65 73 75 6c  ....return resul
251d0 74 2e 76 61 6c 75 65 3b 0a 09 09 09 09 09 7d 0a  t.value;......}.
251e0 0a 09 09 09 09 2f 2f 20 49 66 20 74 68 69 73 20  .....// If this 
251f0 69 73 20 61 6e 20 69 6e 6e 65 72 20 73 79 6e 74  is an inner synt
25200 68 65 74 69 63 20 65 76 65 6e 74 20 66 6f 72 20  hetic event for 
25210 61 6e 20 65 76 65 6e 74 20 77 69 74 68 20 61 20  an event with a 
25220 62 75 62 62 6c 69 6e 67 20 73 75 72 72 6f 67 61  bubbling surroga
25230 74 65 0a 09 09 09 09 2f 2f 20 28 66 6f 63 75 73  te.....// (focus
25240 20 6f 72 20 62 6c 75 72 29 2c 20 61 73 73 75 6d   or blur), assum
25250 65 20 74 68 61 74 20 74 68 65 20 73 75 72 72 6f  e that the surro
25260 67 61 74 65 20 61 6c 72 65 61 64 79 20 70 72 6f  gate already pro
25270 70 61 67 61 74 65 64 20 66 72 6f 6d 20 74 72 69  pagated from tri
25280 67 67 65 72 69 6e 67 20 74 68 65 0a 09 09 09 09  ggering the.....
25290 2f 2f 20 6e 61 74 69 76 65 20 65 76 65 6e 74 20  // native event 
252a0 61 6e 64 20 70 72 65 76 65 6e 74 20 74 68 61 74  and prevent that
252b0 20 66 72 6f 6d 20 68 61 70 70 65 6e 69 6e 67 20   from happening 
252c0 61 67 61 69 6e 20 68 65 72 65 2e 0a 09 09 09 09  again here......
252d0 2f 2f 20 54 68 69 73 20 74 65 63 68 6e 69 63 61  // This technica
252e0 6c 6c 79 20 67 65 74 73 20 74 68 65 20 6f 72 64  lly gets the ord
252f0 65 72 69 6e 67 20 77 72 6f 6e 67 20 77 2e 72 2e  ering wrong w.r.
25300 74 2e 20 74 6f 20 60 2e 74 72 69 67 67 65 72 28  t. to `.trigger(
25310 29 60 20 28 69 6e 20 77 68 69 63 68 20 74 68 65  )` (in which the
25320 0a 09 09 09 09 2f 2f 20 62 75 62 62 6c 69 6e 67  .....// bubbling
25330 20 73 75 72 72 6f 67 61 74 65 20 70 72 6f 70 61   surrogate propa
25340 67 61 74 65 73 20 2a 61 66 74 65 72 2a 20 74 68  gates *after* th
25350 65 20 6e 6f 6e 2d 62 75 62 62 6c 69 6e 67 20 62  e non-bubbling b
25360 61 73 65 29 2c 20 62 75 74 20 74 68 61 74 20 73  ase), but that s
25370 65 65 6d 73 0a 09 09 09 09 2f 2f 20 6c 65 73 73  eems.....// less
25380 20 62 61 64 20 74 68 61 6e 20 64 75 70 6c 69 63   bad than duplic
25390 61 74 69 6f 6e 2e 0a 09 09 09 09 7d 20 65 6c 73  ation......} els
253a0 65 20 69 66 20 28 20 28 20 6a 51 75 65 72 79 2e  e if ( ( jQuery.
253b0 65 76 65 6e 74 2e 73 70 65 63 69 61 6c 5b 20 74  event.special[ t
253c0 79 70 65 20 5d 20 7c 7c 20 7b 7d 20 29 2e 64 65  ype ] || {} ).de
253d0 6c 65 67 61 74 65 54 79 70 65 20 29 20 7b 0a 09  legateType ) {..
253e0 09 09 09 09 65 76 65 6e 74 2e 73 74 6f 70 50 72  ....event.stopPr
253f0 6f 70 61 67 61 74 69 6f 6e 28 29 3b 0a 09 09 09  opagation();....
25400 09 7d 0a 0a 09 09 09 2f 2f 20 49 66 20 74 68 69  .}.....// If thi
25410 73 20 69 73 20 61 20 6e 61 74 69 76 65 20 65 76  s is a native ev
25420 65 6e 74 20 74 72 69 67 67 65 72 65 64 20 61 62  ent triggered ab
25430 6f 76 65 2c 20 65 76 65 72 79 74 68 69 6e 67 20  ove, everything 
25440 69 73 20 6e 6f 77 20 69 6e 20 6f 72 64 65 72 0a  is now in order.
25450 09 09 09 2f 2f 20 46 69 72 65 20 61 6e 20 69 6e  ...// Fire an in
25460 6e 65 72 20 73 79 6e 74 68 65 74 69 63 20 65 76  ner synthetic ev
25470 65 6e 74 20 77 69 74 68 20 74 68 65 20 6f 72 69  ent with the ori
25480 67 69 6e 61 6c 20 61 72 67 75 6d 65 6e 74 73 0a  ginal arguments.
25490 09 09 09 7d 20 65 6c 73 65 20 69 66 20 28 20 73  ...} else if ( s
254a0 61 76 65 64 2e 6c 65 6e 67 74 68 20 29 20 7b 0a  aved.length ) {.
254b0 0a 09 09 09 09 2f 2f 20 2e 2e 2e 61 6e 64 20 63  .....// ...and c
254c0 61 70 74 75 72 65 20 74 68 65 20 72 65 73 75 6c  apture the resul
254d0 74 0a 09 09 09 09 64 61 74 61 50 72 69 76 2e 73  t.....dataPriv.s
254e0 65 74 28 20 74 68 69 73 2c 20 74 79 70 65 2c 20  et( this, type, 
254f0 7b 0a 09 09 09 09 09 76 61 6c 75 65 3a 20 6a 51  {......value: jQ
25500 75 65 72 79 2e 65 76 65 6e 74 2e 74 72 69 67 67  uery.event.trigg
25510 65 72 28 0a 0a 09 09 09 09 09 09 2f 2f 20 53 75  er(........// Su
25520 70 70 6f 72 74 3a 20 49 45 20 3c 3d 39 20 2d 20  pport: IE <=9 - 
25530 31 31 2b 0a 09 09 09 09 09 09 2f 2f 20 45 78 74  11+.......// Ext
25540 65 6e 64 20 77 69 74 68 20 74 68 65 20 70 72 6f  end with the pro
25550 74 6f 74 79 70 65 20 74 6f 20 72 65 73 65 74 20  totype to reset 
25560 74 68 65 20 61 62 6f 76 65 20 73 74 6f 70 49 6d  the above stopIm
25570 6d 65 64 69 61 74 65 50 72 6f 70 61 67 61 74 69  mediatePropagati
25580 6f 6e 28 29 0a 09 09 09 09 09 09 6a 51 75 65 72  on().......jQuer
25590 79 2e 65 78 74 65 6e 64 28 20 73 61 76 65 64 5b  y.extend( saved[
255a0 20 30 20 5d 2c 20 6a 51 75 65 72 79 2e 45 76 65   0 ], jQuery.Eve
255b0 6e 74 2e 70 72 6f 74 6f 74 79 70 65 20 29 2c 0a  nt.prototype ),.
255c0 09 09 09 09 09 09 73 61 76 65 64 2e 73 6c 69 63  ......saved.slic
255d0 65 28 20 31 20 29 2c 0a 09 09 09 09 09 09 74 68  e( 1 ),.......th
255e0 69 73 0a 09 09 09 09 09 29 0a 09 09 09 09 7d 20  is......).....} 
255f0 29 3b 0a 0a 09 09 09 09 2f 2f 20 41 62 6f 72 74  );......// Abort
25600 20 68 61 6e 64 6c 69 6e 67 20 6f 66 20 74 68 65   handling of the
25610 20 6e 61 74 69 76 65 20 65 76 65 6e 74 0a 09 09   native event...
25620 09 09 65 76 65 6e 74 2e 73 74 6f 70 49 6d 6d 65  ..event.stopImme
25630 64 69 61 74 65 50 72 6f 70 61 67 61 74 69 6f 6e  diatePropagation
25640 28 29 3b 0a 09 09 09 7d 0a 09 09 7d 0a 09 7d 20  ();....}...}..} 
25650 29 3b 0a 7d 0a 0a 6a 51 75 65 72 79 2e 72 65 6d  );.}..jQuery.rem
25660 6f 76 65 45 76 65 6e 74 20 3d 20 66 75 6e 63 74  oveEvent = funct
25670 69 6f 6e 28 20 65 6c 65 6d 2c 20 74 79 70 65 2c  ion( elem, type,
25680 20 68 61 6e 64 6c 65 20 29 20 7b 0a 0a 09 2f 2f   handle ) {...//
25690 20 54 68 69 73 20 22 69 66 22 20 69 73 20 6e 65   This "if" is ne
256a0 65 64 65 64 20 66 6f 72 20 70 6c 61 69 6e 20 6f  eded for plain o
256b0 62 6a 65 63 74 73 0a 09 69 66 20 28 20 65 6c 65  bjects..if ( ele
256c0 6d 2e 72 65 6d 6f 76 65 45 76 65 6e 74 4c 69 73  m.removeEventLis
256d0 74 65 6e 65 72 20 29 20 7b 0a 09 09 65 6c 65 6d  tener ) {...elem
256e0 2e 72 65 6d 6f 76 65 45 76 65 6e 74 4c 69 73 74  .removeEventList
256f0 65 6e 65 72 28 20 74 79 70 65 2c 20 68 61 6e 64  ener( type, hand
25700 6c 65 20 29 3b 0a 09 7d 0a 7d 3b 0a 0a 6a 51 75  le );..}.};..jQu
25710 65 72 79 2e 45 76 65 6e 74 20 3d 20 66 75 6e 63  ery.Event = func
25720 74 69 6f 6e 28 20 73 72 63 2c 20 70 72 6f 70 73  tion( src, props
25730 20 29 20 7b 0a 0a 09 2f 2f 20 41 6c 6c 6f 77 20   ) {...// Allow 
25740 69 6e 73 74 61 6e 74 69 61 74 69 6f 6e 20 77 69  instantiation wi
25750 74 68 6f 75 74 20 74 68 65 20 27 6e 65 77 27 20  thout the 'new' 
25760 6b 65 79 77 6f 72 64 0a 09 69 66 20 28 20 21 28  keyword..if ( !(
25770 20 74 68 69 73 20 69 6e 73 74 61 6e 63 65 6f 66   this instanceof
25780 20 6a 51 75 65 72 79 2e 45 76 65 6e 74 20 29 20   jQuery.Event ) 
25790 29 20 7b 0a 09 09 72 65 74 75 72 6e 20 6e 65 77  ) {...return new
257a0 20 6a 51 75 65 72 79 2e 45 76 65 6e 74 28 20 73   jQuery.Event( s
257b0 72 63 2c 20 70 72 6f 70 73 20 29 3b 0a 09 7d 0a  rc, props );..}.
257c0 0a 09 2f 2f 20 45 76 65 6e 74 20 6f 62 6a 65 63  ..// Event objec
257d0 74 0a 09 69 66 20 28 20 73 72 63 20 26 26 20 73  t..if ( src && s
257e0 72 63 2e 74 79 70 65 20 29 20 7b 0a 09 09 74 68  rc.type ) {...th
257f0 69 73 2e 6f 72 69 67 69 6e 61 6c 45 76 65 6e 74  is.originalEvent
25800 20 3d 20 73 72 63 3b 0a 09 09 74 68 69 73 2e 74   = src;...this.t
25810 79 70 65 20 3d 20 73 72 63 2e 74 79 70 65 3b 0a  ype = src.type;.
25820 0a 09 09 2f 2f 20 45 76 65 6e 74 73 20 62 75 62  ...// Events bub
25830 62 6c 69 6e 67 20 75 70 20 74 68 65 20 64 6f 63  bling up the doc
25840 75 6d 65 6e 74 20 6d 61 79 20 68 61 76 65 20 62  ument may have b
25850 65 65 6e 20 6d 61 72 6b 65 64 20 61 73 20 70 72  een marked as pr
25860 65 76 65 6e 74 65 64 0a 09 09 2f 2f 20 62 79 20  evented...// by 
25870 61 20 68 61 6e 64 6c 65 72 20 6c 6f 77 65 72 20  a handler lower 
25880 64 6f 77 6e 20 74 68 65 20 74 72 65 65 3b 20 72  down the tree; r
25890 65 66 6c 65 63 74 20 74 68 65 20 63 6f 72 72 65  eflect the corre
258a0 63 74 20 76 61 6c 75 65 2e 0a 09 09 74 68 69 73  ct value....this
258b0 2e 69 73 44 65 66 61 75 6c 74 50 72 65 76 65 6e  .isDefaultPreven
258c0 74 65 64 20 3d 20 73 72 63 2e 64 65 66 61 75 6c  ted = src.defaul
258d0 74 50 72 65 76 65 6e 74 65 64 20 7c 7c 0a 09 09  tPrevented ||...
258e0 09 09 73 72 63 2e 64 65 66 61 75 6c 74 50 72 65  ..src.defaultPre
258f0 76 65 6e 74 65 64 20 3d 3d 3d 20 75 6e 64 65 66  vented === undef
25900 69 6e 65 64 20 26 26 0a 0a 09 09 09 09 2f 2f 20  ined &&......// 
25910 53 75 70 70 6f 72 74 3a 20 41 6e 64 72 6f 69 64  Support: Android
25920 20 3c 3d 32 2e 33 20 6f 6e 6c 79 0a 09 09 09 09   <=2.3 only.....
25930 73 72 63 2e 72 65 74 75 72 6e 56 61 6c 75 65 20  src.returnValue 
25940 3d 3d 3d 20 66 61 6c 73 65 20 3f 0a 09 09 09 72  === false ?....r
25950 65 74 75 72 6e 54 72 75 65 20 3a 0a 09 09 09 72  eturnTrue :....r
25960 65 74 75 72 6e 46 61 6c 73 65 3b 0a 0a 09 09 2f  eturnFalse;..../
25970 2f 20 43 72 65 61 74 65 20 74 61 72 67 65 74 20  / Create target 
25980 70 72 6f 70 65 72 74 69 65 73 0a 09 09 2f 2f 20  properties...// 
25990 53 75 70 70 6f 72 74 3a 20 53 61 66 61 72 69 20  Support: Safari 
259a0 3c 3d 36 20 2d 20 37 20 6f 6e 6c 79 0a 09 09 2f  <=6 - 7 only.../
259b0 2f 20 54 61 72 67 65 74 20 73 68 6f 75 6c 64 20  / Target should 
259c0 6e 6f 74 20 62 65 20 61 20 74 65 78 74 20 6e 6f  not be a text no
259d0 64 65 20 28 23 35 30 34 2c 20 23 31 33 31 34 33  de (#504, #13143
259e0 29 0a 09 09 74 68 69 73 2e 74 61 72 67 65 74 20  )...this.target 
259f0 3d 20 28 20 73 72 63 2e 74 61 72 67 65 74 20 26  = ( src.target &
25a00 26 20 73 72 63 2e 74 61 72 67 65 74 2e 6e 6f 64  & src.target.nod
25a10 65 54 79 70 65 20 3d 3d 3d 20 33 20 29 20 3f 0a  eType === 3 ) ?.
25a20 09 09 09 73 72 63 2e 74 61 72 67 65 74 2e 70 61  ...src.target.pa
25a30 72 65 6e 74 4e 6f 64 65 20 3a 0a 09 09 09 73 72  rentNode :....sr
25a40 63 2e 74 61 72 67 65 74 3b 0a 0a 09 09 74 68 69  c.target;....thi
25a50 73 2e 63 75 72 72 65 6e 74 54 61 72 67 65 74 20  s.currentTarget 
25a60 3d 20 73 72 63 2e 63 75 72 72 65 6e 74 54 61 72  = src.currentTar
25a70 67 65 74 3b 0a 09 09 74 68 69 73 2e 72 65 6c 61  get;...this.rela
25a80 74 65 64 54 61 72 67 65 74 20 3d 20 73 72 63 2e  tedTarget = src.
25a90 72 65 6c 61 74 65 64 54 61 72 67 65 74 3b 0a 0a  relatedTarget;..
25aa0 09 2f 2f 20 45 76 65 6e 74 20 74 79 70 65 0a 09  .// Event type..
25ab0 7d 20 65 6c 73 65 20 7b 0a 09 09 74 68 69 73 2e  } else {...this.
25ac0 74 79 70 65 20 3d 20 73 72 63 3b 0a 09 7d 0a 0a  type = src;..}..
25ad0 09 2f 2f 20 50 75 74 20 65 78 70 6c 69 63 69 74  .// Put explicit
25ae0 6c 79 20 70 72 6f 76 69 64 65 64 20 70 72 6f 70  ly provided prop
25af0 65 72 74 69 65 73 20 6f 6e 74 6f 20 74 68 65 20  erties onto the 
25b00 65 76 65 6e 74 20 6f 62 6a 65 63 74 0a 09 69 66  event object..if
25b10 20 28 20 70 72 6f 70 73 20 29 20 7b 0a 09 09 6a   ( props ) {...j
25b20 51 75 65 72 79 2e 65 78 74 65 6e 64 28 20 74 68  Query.extend( th
25b30 69 73 2c 20 70 72 6f 70 73 20 29 3b 0a 09 7d 0a  is, props );..}.
25b40 0a 09 2f 2f 20 43 72 65 61 74 65 20 61 20 74 69  ..// Create a ti
25b50 6d 65 73 74 61 6d 70 20 69 66 20 69 6e 63 6f 6d  mestamp if incom
25b60 69 6e 67 20 65 76 65 6e 74 20 64 6f 65 73 6e 27  ing event doesn'
25b70 74 20 68 61 76 65 20 6f 6e 65 0a 09 74 68 69 73  t have one..this
25b80 2e 74 69 6d 65 53 74 61 6d 70 20 3d 20 73 72 63  .timeStamp = src
25b90 20 26 26 20 73 72 63 2e 74 69 6d 65 53 74 61 6d   && src.timeStam
25ba0 70 20 7c 7c 20 44 61 74 65 2e 6e 6f 77 28 29 3b  p || Date.now();
25bb0 0a 0a 09 2f 2f 20 4d 61 72 6b 20 69 74 20 61 73  ...// Mark it as
25bc0 20 66 69 78 65 64 0a 09 74 68 69 73 5b 20 6a 51   fixed..this[ jQ
25bd0 75 65 72 79 2e 65 78 70 61 6e 64 6f 20 5d 20 3d  uery.expando ] =
25be0 20 74 72 75 65 3b 0a 7d 3b 0a 0a 2f 2f 20 6a 51   true;.};..// jQ
25bf0 75 65 72 79 2e 45 76 65 6e 74 20 69 73 20 62 61  uery.Event is ba
25c00 73 65 64 20 6f 6e 20 44 4f 4d 33 20 45 76 65 6e  sed on DOM3 Even
25c10 74 73 20 61 73 20 73 70 65 63 69 66 69 65 64 20  ts as specified 
25c20 62 79 20 74 68 65 20 45 43 4d 41 53 63 72 69 70  by the ECMAScrip
25c30 74 20 4c 61 6e 67 75 61 67 65 20 42 69 6e 64 69  t Language Bindi
25c40 6e 67 0a 2f 2f 20 68 74 74 70 73 3a 2f 2f 77 77  ng.// https://ww
25c50 77 2e 77 33 2e 6f 72 67 2f 54 52 2f 32 30 30 33  w.w3.org/TR/2003
25c60 2f 57 44 2d 44 4f 4d 2d 4c 65 76 65 6c 2d 33 2d  /WD-DOM-Level-3-
25c70 45 76 65 6e 74 73 2d 32 30 30 33 30 33 33 31 2f  Events-20030331/
25c80 65 63 6d 61 2d 73 63 72 69 70 74 2d 62 69 6e 64  ecma-script-bind
25c90 69 6e 67 2e 68 74 6d 6c 0a 6a 51 75 65 72 79 2e  ing.html.jQuery.
25ca0 45 76 65 6e 74 2e 70 72 6f 74 6f 74 79 70 65 20  Event.prototype 
25cb0 3d 20 7b 0a 09 63 6f 6e 73 74 72 75 63 74 6f 72  = {..constructor
25cc0 3a 20 6a 51 75 65 72 79 2e 45 76 65 6e 74 2c 0a  : jQuery.Event,.
25cd0 09 69 73 44 65 66 61 75 6c 74 50 72 65 76 65 6e  .isDefaultPreven
25ce0 74 65 64 3a 20 72 65 74 75 72 6e 46 61 6c 73 65  ted: returnFalse
25cf0 2c 0a 09 69 73 50 72 6f 70 61 67 61 74 69 6f 6e  ,..isPropagation
25d00 53 74 6f 70 70 65 64 3a 20 72 65 74 75 72 6e 46  Stopped: returnF
25d10 61 6c 73 65 2c 0a 09 69 73 49 6d 6d 65 64 69 61  alse,..isImmedia
25d20 74 65 50 72 6f 70 61 67 61 74 69 6f 6e 53 74 6f  tePropagationSto
25d30 70 70 65 64 3a 20 72 65 74 75 72 6e 46 61 6c 73  pped: returnFals
25d40 65 2c 0a 09 69 73 53 69 6d 75 6c 61 74 65 64 3a  e,..isSimulated:
25d50 20 66 61 6c 73 65 2c 0a 0a 09 70 72 65 76 65 6e   false,...preven
25d60 74 44 65 66 61 75 6c 74 3a 20 66 75 6e 63 74 69  tDefault: functi
25d70 6f 6e 28 29 20 7b 0a 09 09 76 61 72 20 65 20 3d  on() {...var e =
25d80 20 74 68 69 73 2e 6f 72 69 67 69 6e 61 6c 45 76   this.originalEv
25d90 65 6e 74 3b 0a 0a 09 09 74 68 69 73 2e 69 73 44  ent;....this.isD
25da0 65 66 61 75 6c 74 50 72 65 76 65 6e 74 65 64 20  efaultPrevented 
25db0 3d 20 72 65 74 75 72 6e 54 72 75 65 3b 0a 0a 09  = returnTrue;...
25dc0 09 69 66 20 28 20 65 20 26 26 20 21 74 68 69 73  .if ( e && !this
25dd0 2e 69 73 53 69 6d 75 6c 61 74 65 64 20 29 20 7b  .isSimulated ) {
25de0 0a 09 09 09 65 2e 70 72 65 76 65 6e 74 44 65 66  ....e.preventDef
25df0 61 75 6c 74 28 29 3b 0a 09 09 7d 0a 09 7d 2c 0a  ault();...}..},.
25e00 09 73 74 6f 70 50 72 6f 70 61 67 61 74 69 6f 6e  .stopPropagation
25e10 3a 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09  : function() {..
25e20 09 76 61 72 20 65 20 3d 20 74 68 69 73 2e 6f 72  .var e = this.or
25e30 69 67 69 6e 61 6c 45 76 65 6e 74 3b 0a 0a 09 09  iginalEvent;....
25e40 74 68 69 73 2e 69 73 50 72 6f 70 61 67 61 74 69  this.isPropagati
25e50 6f 6e 53 74 6f 70 70 65 64 20 3d 20 72 65 74 75  onStopped = retu
25e60 72 6e 54 72 75 65 3b 0a 0a 09 09 69 66 20 28 20  rnTrue;....if ( 
25e70 65 20 26 26 20 21 74 68 69 73 2e 69 73 53 69 6d  e && !this.isSim
25e80 75 6c 61 74 65 64 20 29 20 7b 0a 09 09 09 65 2e  ulated ) {....e.
25e90 73 74 6f 70 50 72 6f 70 61 67 61 74 69 6f 6e 28  stopPropagation(
25ea0 29 3b 0a 09 09 7d 0a 09 7d 2c 0a 09 73 74 6f 70  );...}..},..stop
25eb0 49 6d 6d 65 64 69 61 74 65 50 72 6f 70 61 67 61  ImmediatePropaga
25ec0 74 69 6f 6e 3a 20 66 75 6e 63 74 69 6f 6e 28 29  tion: function()
25ed0 20 7b 0a 09 09 76 61 72 20 65 20 3d 20 74 68 69   {...var e = thi
25ee0 73 2e 6f 72 69 67 69 6e 61 6c 45 76 65 6e 74 3b  s.originalEvent;
25ef0 0a 0a 09 09 74 68 69 73 2e 69 73 49 6d 6d 65 64  ....this.isImmed
25f00 69 61 74 65 50 72 6f 70 61 67 61 74 69 6f 6e 53  iatePropagationS
25f10 74 6f 70 70 65 64 20 3d 20 72 65 74 75 72 6e 54  topped = returnT
25f20 72 75 65 3b 0a 0a 09 09 69 66 20 28 20 65 20 26  rue;....if ( e &
25f30 26 20 21 74 68 69 73 2e 69 73 53 69 6d 75 6c 61  & !this.isSimula
25f40 74 65 64 20 29 20 7b 0a 09 09 09 65 2e 73 74 6f  ted ) {....e.sto
25f50 70 49 6d 6d 65 64 69 61 74 65 50 72 6f 70 61 67  pImmediatePropag
25f60 61 74 69 6f 6e 28 29 3b 0a 09 09 7d 0a 0a 09 09  ation();...}....
25f70 74 68 69 73 2e 73 74 6f 70 50 72 6f 70 61 67 61  this.stopPropaga
25f80 74 69 6f 6e 28 29 3b 0a 09 7d 0a 7d 3b 0a 0a 2f  tion();..}.};../
25f90 2f 20 49 6e 63 6c 75 64 65 73 20 61 6c 6c 20 63  / Includes all c
25fa0 6f 6d 6d 6f 6e 20 65 76 65 6e 74 20 70 72 6f 70  ommon event prop
25fb0 73 20 69 6e 63 6c 75 64 69 6e 67 20 4b 65 79 45  s including KeyE
25fc0 76 65 6e 74 20 61 6e 64 20 4d 6f 75 73 65 45 76  vent and MouseEv
25fd0 65 6e 74 20 73 70 65 63 69 66 69 63 20 70 72 6f  ent specific pro
25fe0 70 73 0a 6a 51 75 65 72 79 2e 65 61 63 68 28 20  ps.jQuery.each( 
25ff0 7b 0a 09 61 6c 74 4b 65 79 3a 20 74 72 75 65 2c  {..altKey: true,
26000 0a 09 62 75 62 62 6c 65 73 3a 20 74 72 75 65 2c  ..bubbles: true,
26010 0a 09 63 61 6e 63 65 6c 61 62 6c 65 3a 20 74 72  ..cancelable: tr
26020 75 65 2c 0a 09 63 68 61 6e 67 65 64 54 6f 75 63  ue,..changedTouc
26030 68 65 73 3a 20 74 72 75 65 2c 0a 09 63 74 72 6c  hes: true,..ctrl
26040 4b 65 79 3a 20 74 72 75 65 2c 0a 09 64 65 74 61  Key: true,..deta
26050 69 6c 3a 20 74 72 75 65 2c 0a 09 65 76 65 6e 74  il: true,..event
26060 50 68 61 73 65 3a 20 74 72 75 65 2c 0a 09 6d 65  Phase: true,..me
26070 74 61 4b 65 79 3a 20 74 72 75 65 2c 0a 09 70 61  taKey: true,..pa
26080 67 65 58 3a 20 74 72 75 65 2c 0a 09 70 61 67 65  geX: true,..page
26090 59 3a 20 74 72 75 65 2c 0a 09 73 68 69 66 74 4b  Y: true,..shiftK
260a0 65 79 3a 20 74 72 75 65 2c 0a 09 76 69 65 77 3a  ey: true,..view:
260b0 20 74 72 75 65 2c 0a 09 22 63 68 61 72 22 3a 20   true,.."char": 
260c0 74 72 75 65 2c 0a 09 63 6f 64 65 3a 20 74 72 75  true,..code: tru
260d0 65 2c 0a 09 63 68 61 72 43 6f 64 65 3a 20 74 72  e,..charCode: tr
260e0 75 65 2c 0a 09 6b 65 79 3a 20 74 72 75 65 2c 0a  ue,..key: true,.
260f0 09 6b 65 79 43 6f 64 65 3a 20 74 72 75 65 2c 0a  .keyCode: true,.
26100 09 62 75 74 74 6f 6e 3a 20 74 72 75 65 2c 0a 09  .button: true,..
26110 62 75 74 74 6f 6e 73 3a 20 74 72 75 65 2c 0a 09  buttons: true,..
26120 63 6c 69 65 6e 74 58 3a 20 74 72 75 65 2c 0a 09  clientX: true,..
26130 63 6c 69 65 6e 74 59 3a 20 74 72 75 65 2c 0a 09  clientY: true,..
26140 6f 66 66 73 65 74 58 3a 20 74 72 75 65 2c 0a 09  offsetX: true,..
26150 6f 66 66 73 65 74 59 3a 20 74 72 75 65 2c 0a 09  offsetY: true,..
26160 70 6f 69 6e 74 65 72 49 64 3a 20 74 72 75 65 2c  pointerId: true,
26170 0a 09 70 6f 69 6e 74 65 72 54 79 70 65 3a 20 74  ..pointerType: t
26180 72 75 65 2c 0a 09 73 63 72 65 65 6e 58 3a 20 74  rue,..screenX: t
26190 72 75 65 2c 0a 09 73 63 72 65 65 6e 59 3a 20 74  rue,..screenY: t
261a0 72 75 65 2c 0a 09 74 61 72 67 65 74 54 6f 75 63  rue,..targetTouc
261b0 68 65 73 3a 20 74 72 75 65 2c 0a 09 74 6f 45 6c  hes: true,..toEl
261c0 65 6d 65 6e 74 3a 20 74 72 75 65 2c 0a 09 74 6f  ement: true,..to
261d0 75 63 68 65 73 3a 20 74 72 75 65 2c 0a 0a 09 77  uches: true,...w
261e0 68 69 63 68 3a 20 66 75 6e 63 74 69 6f 6e 28 20  hich: function( 
261f0 65 76 65 6e 74 20 29 20 7b 0a 09 09 76 61 72 20  event ) {...var 
26200 62 75 74 74 6f 6e 20 3d 20 65 76 65 6e 74 2e 62  button = event.b
26210 75 74 74 6f 6e 3b 0a 0a 09 09 2f 2f 20 41 64 64  utton;....// Add
26220 20 77 68 69 63 68 20 66 6f 72 20 6b 65 79 20 65   which for key e
26230 76 65 6e 74 73 0a 09 09 69 66 20 28 20 65 76 65  vents...if ( eve
26240 6e 74 2e 77 68 69 63 68 20 3d 3d 20 6e 75 6c 6c  nt.which == null
26250 20 26 26 20 72 6b 65 79 45 76 65 6e 74 2e 74 65   && rkeyEvent.te
26260 73 74 28 20 65 76 65 6e 74 2e 74 79 70 65 20 29  st( event.type )
26270 20 29 20 7b 0a 09 09 09 72 65 74 75 72 6e 20 65   ) {....return e
26280 76 65 6e 74 2e 63 68 61 72 43 6f 64 65 20 21 3d  vent.charCode !=
26290 20 6e 75 6c 6c 20 3f 20 65 76 65 6e 74 2e 63 68   null ? event.ch
262a0 61 72 43 6f 64 65 20 3a 20 65 76 65 6e 74 2e 6b  arCode : event.k
262b0 65 79 43 6f 64 65 3b 0a 09 09 7d 0a 0a 09 09 2f  eyCode;...}..../
262c0 2f 20 41 64 64 20 77 68 69 63 68 20 66 6f 72 20  / Add which for 
262d0 63 6c 69 63 6b 3a 20 31 20 3d 3d 3d 20 6c 65 66  click: 1 === lef
262e0 74 3b 20 32 20 3d 3d 3d 20 6d 69 64 64 6c 65 3b  t; 2 === middle;
262f0 20 33 20 3d 3d 3d 20 72 69 67 68 74 0a 09 09 69   3 === right...i
26300 66 20 28 20 21 65 76 65 6e 74 2e 77 68 69 63 68  f ( !event.which
26310 20 26 26 20 62 75 74 74 6f 6e 20 21 3d 3d 20 75   && button !== u
26320 6e 64 65 66 69 6e 65 64 20 26 26 20 72 6d 6f 75  ndefined && rmou
26330 73 65 45 76 65 6e 74 2e 74 65 73 74 28 20 65 76  seEvent.test( ev
26340 65 6e 74 2e 74 79 70 65 20 29 20 29 20 7b 0a 09  ent.type ) ) {..
26350 09 09 69 66 20 28 20 62 75 74 74 6f 6e 20 26 20  ..if ( button & 
26360 31 20 29 20 7b 0a 09 09 09 09 72 65 74 75 72 6e  1 ) {.....return
26370 20 31 3b 0a 09 09 09 7d 0a 0a 09 09 09 69 66 20   1;....}.....if 
26380 28 20 62 75 74 74 6f 6e 20 26 20 32 20 29 20 7b  ( button & 2 ) {
26390 0a 09 09 09 09 72 65 74 75 72 6e 20 33 3b 0a 09  .....return 3;..
263a0 09 09 7d 0a 0a 09 09 09 69 66 20 28 20 62 75 74  ..}.....if ( but
263b0 74 6f 6e 20 26 20 34 20 29 20 7b 0a 09 09 09 09  ton & 4 ) {.....
263c0 72 65 74 75 72 6e 20 32 3b 0a 09 09 09 7d 0a 0a  return 2;....}..
263d0 09 09 09 72 65 74 75 72 6e 20 30 3b 0a 09 09 7d  ...return 0;...}
263e0 0a 0a 09 09 72 65 74 75 72 6e 20 65 76 65 6e 74  ....return event
263f0 2e 77 68 69 63 68 3b 0a 09 7d 0a 7d 2c 20 6a 51  .which;..}.}, jQ
26400 75 65 72 79 2e 65 76 65 6e 74 2e 61 64 64 50 72  uery.event.addPr
26410 6f 70 20 29 3b 0a 0a 6a 51 75 65 72 79 2e 65 61  op );..jQuery.ea
26420 63 68 28 20 7b 20 66 6f 63 75 73 3a 20 22 66 6f  ch( { focus: "fo
26430 63 75 73 69 6e 22 2c 20 62 6c 75 72 3a 20 22 66  cusin", blur: "f
26440 6f 63 75 73 6f 75 74 22 20 7d 2c 20 66 75 6e 63  ocusout" }, func
26450 74 69 6f 6e 28 20 74 79 70 65 2c 20 64 65 6c 65  tion( type, dele
26460 67 61 74 65 54 79 70 65 20 29 20 7b 0a 09 6a 51  gateType ) {..jQ
26470 75 65 72 79 2e 65 76 65 6e 74 2e 73 70 65 63 69  uery.event.speci
26480 61 6c 5b 20 74 79 70 65 20 5d 20 3d 20 7b 0a 0a  al[ type ] = {..
26490 09 09 2f 2f 20 55 74 69 6c 69 7a 65 20 6e 61 74  ..// Utilize nat
264a0 69 76 65 20 65 76 65 6e 74 20 69 66 20 70 6f 73  ive event if pos
264b0 73 69 62 6c 65 20 73 6f 20 62 6c 75 72 2f 66 6f  sible so blur/fo
264c0 63 75 73 20 73 65 71 75 65 6e 63 65 20 69 73 20  cus sequence is 
264d0 63 6f 72 72 65 63 74 0a 09 09 73 65 74 75 70 3a  correct...setup:
264e0 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 0a 09   function() {...
264f0 09 09 2f 2f 20 43 6c 61 69 6d 20 74 68 65 20 66  ..// Claim the f
26500 69 72 73 74 20 68 61 6e 64 6c 65 72 0a 09 09 09  irst handler....
26510 2f 2f 20 64 61 74 61 50 72 69 76 2e 73 65 74 28  // dataPriv.set(
26520 20 74 68 69 73 2c 20 22 66 6f 63 75 73 22 2c 20   this, "focus", 
26530 2e 2e 2e 20 29 0a 09 09 09 2f 2f 20 64 61 74 61  ... )....// data
26540 50 72 69 76 2e 73 65 74 28 20 74 68 69 73 2c 20  Priv.set( this, 
26550 22 62 6c 75 72 22 2c 20 2e 2e 2e 20 29 0a 09 09  "blur", ... )...
26560 09 6c 65 76 65 72 61 67 65 4e 61 74 69 76 65 28  .leverageNative(
26570 20 74 68 69 73 2c 20 74 79 70 65 2c 20 65 78 70   this, type, exp
26580 65 63 74 53 79 6e 63 20 29 3b 0a 0a 09 09 09 2f  ectSync );...../
26590 2f 20 52 65 74 75 72 6e 20 66 61 6c 73 65 20 74  / Return false t
265a0 6f 20 61 6c 6c 6f 77 20 6e 6f 72 6d 61 6c 20 70  o allow normal p
265b0 72 6f 63 65 73 73 69 6e 67 20 69 6e 20 74 68 65  rocessing in the
265c0 20 63 61 6c 6c 65 72 0a 09 09 09 72 65 74 75 72   caller....retur
265d0 6e 20 66 61 6c 73 65 3b 0a 09 09 7d 2c 0a 09 09  n false;...},...
265e0 74 72 69 67 67 65 72 3a 20 66 75 6e 63 74 69 6f  trigger: functio
265f0 6e 28 29 20 7b 0a 0a 09 09 09 2f 2f 20 46 6f 72  n() {.....// For
26600 63 65 20 73 65 74 75 70 20 62 65 66 6f 72 65 20  ce setup before 
26610 74 72 69 67 67 65 72 0a 09 09 09 6c 65 76 65 72  trigger....lever
26620 61 67 65 4e 61 74 69 76 65 28 20 74 68 69 73 2c  ageNative( this,
26630 20 74 79 70 65 20 29 3b 0a 0a 09 09 09 2f 2f 20   type );.....// 
26640 52 65 74 75 72 6e 20 6e 6f 6e 2d 66 61 6c 73 65  Return non-false
26650 20 74 6f 20 61 6c 6c 6f 77 20 6e 6f 72 6d 61 6c   to allow normal
26660 20 65 76 65 6e 74 2d 70 61 74 68 20 70 72 6f 70   event-path prop
26670 61 67 61 74 69 6f 6e 0a 09 09 09 72 65 74 75 72  agation....retur
26680 6e 20 74 72 75 65 3b 0a 09 09 7d 2c 0a 0a 09 09  n true;...},....
26690 64 65 6c 65 67 61 74 65 54 79 70 65 3a 20 64 65  delegateType: de
266a0 6c 65 67 61 74 65 54 79 70 65 0a 09 7d 3b 0a 7d  legateType..};.}
266b0 20 29 3b 0a 0a 2f 2f 20 43 72 65 61 74 65 20 6d   );..// Create m
266c0 6f 75 73 65 65 6e 74 65 72 2f 6c 65 61 76 65 20  ouseenter/leave 
266d0 65 76 65 6e 74 73 20 75 73 69 6e 67 20 6d 6f 75  events using mou
266e0 73 65 6f 76 65 72 2f 6f 75 74 20 61 6e 64 20 65  seover/out and e
266f0 76 65 6e 74 2d 74 69 6d 65 20 63 68 65 63 6b 73  vent-time checks
26700 0a 2f 2f 20 73 6f 20 74 68 61 74 20 65 76 65 6e  .// so that even
26710 74 20 64 65 6c 65 67 61 74 69 6f 6e 20 77 6f 72  t delegation wor
26720 6b 73 20 69 6e 20 6a 51 75 65 72 79 2e 0a 2f 2f  ks in jQuery..//
26730 20 44 6f 20 74 68 65 20 73 61 6d 65 20 66 6f 72   Do the same for
26740 20 70 6f 69 6e 74 65 72 65 6e 74 65 72 2f 70 6f   pointerenter/po
26750 69 6e 74 65 72 6c 65 61 76 65 20 61 6e 64 20 70  interleave and p
26760 6f 69 6e 74 65 72 6f 76 65 72 2f 70 6f 69 6e 74  ointerover/point
26770 65 72 6f 75 74 0a 2f 2f 0a 2f 2f 20 53 75 70 70  erout.//.// Supp
26780 6f 72 74 3a 20 53 61 66 61 72 69 20 37 20 6f 6e  ort: Safari 7 on
26790 6c 79 0a 2f 2f 20 53 61 66 61 72 69 20 73 65 6e  ly.// Safari sen
267a0 64 73 20 6d 6f 75 73 65 65 6e 74 65 72 20 74 6f  ds mouseenter to
267b0 6f 20 6f 66 74 65 6e 3b 20 73 65 65 3a 0a 2f 2f  o often; see:.//
267c0 20 68 74 74 70 73 3a 2f 2f 62 75 67 73 2e 63 68   https://bugs.ch
267d0 72 6f 6d 69 75 6d 2e 6f 72 67 2f 70 2f 63 68 72  romium.org/p/chr
267e0 6f 6d 69 75 6d 2f 69 73 73 75 65 73 2f 64 65 74  omium/issues/det
267f0 61 69 6c 3f 69 64 3d 34 37 30 32 35 38 0a 2f 2f  ail?id=470258.//
26800 20 66 6f 72 20 74 68 65 20 64 65 73 63 72 69 70   for the descrip
26810 74 69 6f 6e 20 6f 66 20 74 68 65 20 62 75 67 20  tion of the bug 
26820 28 69 74 20 65 78 69 73 74 65 64 20 69 6e 20 6f  (it existed in o
26830 6c 64 65 72 20 43 68 72 6f 6d 65 20 76 65 72 73  lder Chrome vers
26840 69 6f 6e 73 20 61 73 20 77 65 6c 6c 29 2e 0a 6a  ions as well)..j
26850 51 75 65 72 79 2e 65 61 63 68 28 20 7b 0a 09 6d  Query.each( {..m
26860 6f 75 73 65 65 6e 74 65 72 3a 20 22 6d 6f 75 73  ouseenter: "mous
26870 65 6f 76 65 72 22 2c 0a 09 6d 6f 75 73 65 6c 65  eover",..mousele
26880 61 76 65 3a 20 22 6d 6f 75 73 65 6f 75 74 22 2c  ave: "mouseout",
26890 0a 09 70 6f 69 6e 74 65 72 65 6e 74 65 72 3a 20  ..pointerenter: 
268a0 22 70 6f 69 6e 74 65 72 6f 76 65 72 22 2c 0a 09  "pointerover",..
268b0 70 6f 69 6e 74 65 72 6c 65 61 76 65 3a 20 22 70  pointerleave: "p
268c0 6f 69 6e 74 65 72 6f 75 74 22 0a 7d 2c 20 66 75  ointerout".}, fu
268d0 6e 63 74 69 6f 6e 28 20 6f 72 69 67 2c 20 66 69  nction( orig, fi
268e0 78 20 29 20 7b 0a 09 6a 51 75 65 72 79 2e 65 76  x ) {..jQuery.ev
268f0 65 6e 74 2e 73 70 65 63 69 61 6c 5b 20 6f 72 69  ent.special[ ori
26900 67 20 5d 20 3d 20 7b 0a 09 09 64 65 6c 65 67 61  g ] = {...delega
26910 74 65 54 79 70 65 3a 20 66 69 78 2c 0a 09 09 62  teType: fix,...b
26920 69 6e 64 54 79 70 65 3a 20 66 69 78 2c 0a 0a 09  indType: fix,...
26930 09 68 61 6e 64 6c 65 3a 20 66 75 6e 63 74 69 6f  .handle: functio
26940 6e 28 20 65 76 65 6e 74 20 29 20 7b 0a 09 09 09  n( event ) {....
26950 76 61 72 20 72 65 74 2c 0a 09 09 09 09 74 61 72  var ret,.....tar
26960 67 65 74 20 3d 20 74 68 69 73 2c 0a 09 09 09 09  get = this,.....
26970 72 65 6c 61 74 65 64 20 3d 20 65 76 65 6e 74 2e  related = event.
26980 72 65 6c 61 74 65 64 54 61 72 67 65 74 2c 0a 09  relatedTarget,..
26990 09 09 09 68 61 6e 64 6c 65 4f 62 6a 20 3d 20 65  ...handleObj = e
269a0 76 65 6e 74 2e 68 61 6e 64 6c 65 4f 62 6a 3b 0a  vent.handleObj;.
269b0 0a 09 09 09 2f 2f 20 46 6f 72 20 6d 6f 75 73 65  ....// For mouse
269c0 65 6e 74 65 72 2f 6c 65 61 76 65 20 63 61 6c 6c  enter/leave call
269d0 20 74 68 65 20 68 61 6e 64 6c 65 72 20 69 66 20   the handler if 
269e0 72 65 6c 61 74 65 64 20 69 73 20 6f 75 74 73 69  related is outsi
269f0 64 65 20 74 68 65 20 74 61 72 67 65 74 2e 0a 09  de the target...
26a00 09 09 2f 2f 20 4e 42 3a 20 4e 6f 20 72 65 6c 61  ..// NB: No rela
26a10 74 65 64 54 61 72 67 65 74 20 69 66 20 74 68 65  tedTarget if the
26a20 20 6d 6f 75 73 65 20 6c 65 66 74 2f 65 6e 74 65   mouse left/ente
26a30 72 65 64 20 74 68 65 20 62 72 6f 77 73 65 72 20  red the browser 
26a40 77 69 6e 64 6f 77 0a 09 09 09 69 66 20 28 20 21  window....if ( !
26a50 72 65 6c 61 74 65 64 20 7c 7c 20 28 20 72 65 6c  related || ( rel
26a60 61 74 65 64 20 21 3d 3d 20 74 61 72 67 65 74 20  ated !== target 
26a70 26 26 20 21 6a 51 75 65 72 79 2e 63 6f 6e 74 61  && !jQuery.conta
26a80 69 6e 73 28 20 74 61 72 67 65 74 2c 20 72 65 6c  ins( target, rel
26a90 61 74 65 64 20 29 20 29 20 29 20 7b 0a 09 09 09  ated ) ) ) {....
26aa0 09 65 76 65 6e 74 2e 74 79 70 65 20 3d 20 68 61  .event.type = ha
26ab0 6e 64 6c 65 4f 62 6a 2e 6f 72 69 67 54 79 70 65  ndleObj.origType
26ac0 3b 0a 09 09 09 09 72 65 74 20 3d 20 68 61 6e 64  ;.....ret = hand
26ad0 6c 65 4f 62 6a 2e 68 61 6e 64 6c 65 72 2e 61 70  leObj.handler.ap
26ae0 70 6c 79 28 20 74 68 69 73 2c 20 61 72 67 75 6d  ply( this, argum
26af0 65 6e 74 73 20 29 3b 0a 09 09 09 09 65 76 65 6e  ents );.....even
26b00 74 2e 74 79 70 65 20 3d 20 66 69 78 3b 0a 09 09  t.type = fix;...
26b10 09 7d 0a 09 09 09 72 65 74 75 72 6e 20 72 65 74  .}....return ret
26b20 3b 0a 09 09 7d 0a 09 7d 3b 0a 7d 20 29 3b 0a 0a  ;...}..};.} );..
26b30 6a 51 75 65 72 79 2e 66 6e 2e 65 78 74 65 6e 64  jQuery.fn.extend
26b40 28 20 7b 0a 0a 09 6f 6e 3a 20 66 75 6e 63 74 69  ( {...on: functi
26b50 6f 6e 28 20 74 79 70 65 73 2c 20 73 65 6c 65 63  on( types, selec
26b60 74 6f 72 2c 20 64 61 74 61 2c 20 66 6e 20 29 20  tor, data, fn ) 
26b70 7b 0a 09 09 72 65 74 75 72 6e 20 6f 6e 28 20 74  {...return on( t
26b80 68 69 73 2c 20 74 79 70 65 73 2c 20 73 65 6c 65  his, types, sele
26b90 63 74 6f 72 2c 20 64 61 74 61 2c 20 66 6e 20 29  ctor, data, fn )
26ba0 3b 0a 09 7d 2c 0a 09 6f 6e 65 3a 20 66 75 6e 63  ;..},..one: func
26bb0 74 69 6f 6e 28 20 74 79 70 65 73 2c 20 73 65 6c  tion( types, sel
26bc0 65 63 74 6f 72 2c 20 64 61 74 61 2c 20 66 6e 20  ector, data, fn 
26bd0 29 20 7b 0a 09 09 72 65 74 75 72 6e 20 6f 6e 28  ) {...return on(
26be0 20 74 68 69 73 2c 20 74 79 70 65 73 2c 20 73 65   this, types, se
26bf0 6c 65 63 74 6f 72 2c 20 64 61 74 61 2c 20 66 6e  lector, data, fn
26c00 2c 20 31 20 29 3b 0a 09 7d 2c 0a 09 6f 66 66 3a  , 1 );..},..off:
26c10 20 66 75 6e 63 74 69 6f 6e 28 20 74 79 70 65 73   function( types
26c20 2c 20 73 65 6c 65 63 74 6f 72 2c 20 66 6e 20 29  , selector, fn )
26c30 20 7b 0a 09 09 76 61 72 20 68 61 6e 64 6c 65 4f   {...var handleO
26c40 62 6a 2c 20 74 79 70 65 3b 0a 09 09 69 66 20 28  bj, type;...if (
26c50 20 74 79 70 65 73 20 26 26 20 74 79 70 65 73 2e   types && types.
26c60 70 72 65 76 65 6e 74 44 65 66 61 75 6c 74 20 26  preventDefault &
26c70 26 20 74 79 70 65 73 2e 68 61 6e 64 6c 65 4f 62  & types.handleOb
26c80 6a 20 29 20 7b 0a 0a 09 09 09 2f 2f 20 28 20 65  j ) {.....// ( e
26c90 76 65 6e 74 20 29 20 20 64 69 73 70 61 74 63 68  vent )  dispatch
26ca0 65 64 20 6a 51 75 65 72 79 2e 45 76 65 6e 74 0a  ed jQuery.Event.
26cb0 09 09 09 68 61 6e 64 6c 65 4f 62 6a 20 3d 20 74  ...handleObj = t
26cc0 79 70 65 73 2e 68 61 6e 64 6c 65 4f 62 6a 3b 0a  ypes.handleObj;.
26cd0 09 09 09 6a 51 75 65 72 79 28 20 74 79 70 65 73  ...jQuery( types
26ce0 2e 64 65 6c 65 67 61 74 65 54 61 72 67 65 74 20  .delegateTarget 
26cf0 29 2e 6f 66 66 28 0a 09 09 09 09 68 61 6e 64 6c  ).off(.....handl
26d00 65 4f 62 6a 2e 6e 61 6d 65 73 70 61 63 65 20 3f  eObj.namespace ?
26d10 0a 09 09 09 09 09 68 61 6e 64 6c 65 4f 62 6a 2e  ......handleObj.
26d20 6f 72 69 67 54 79 70 65 20 2b 20 22 2e 22 20 2b  origType + "." +
26d30 20 68 61 6e 64 6c 65 4f 62 6a 2e 6e 61 6d 65 73   handleObj.names
26d40 70 61 63 65 20 3a 0a 09 09 09 09 09 68 61 6e 64  pace :......hand
26d50 6c 65 4f 62 6a 2e 6f 72 69 67 54 79 70 65 2c 0a  leObj.origType,.
26d60 09 09 09 09 68 61 6e 64 6c 65 4f 62 6a 2e 73 65  ....handleObj.se
26d70 6c 65 63 74 6f 72 2c 0a 09 09 09 09 68 61 6e 64  lector,.....hand
26d80 6c 65 4f 62 6a 2e 68 61 6e 64 6c 65 72 0a 09 09  leObj.handler...
26d90 09 29 3b 0a 09 09 09 72 65 74 75 72 6e 20 74 68  .);....return th
26da0 69 73 3b 0a 09 09 7d 0a 09 09 69 66 20 28 20 74  is;...}...if ( t
26db0 79 70 65 6f 66 20 74 79 70 65 73 20 3d 3d 3d 20  ypeof types === 
26dc0 22 6f 62 6a 65 63 74 22 20 29 20 7b 0a 0a 09 09  "object" ) {....
26dd0 09 2f 2f 20 28 20 74 79 70 65 73 2d 6f 62 6a 65  .// ( types-obje
26de0 63 74 20 5b 2c 20 73 65 6c 65 63 74 6f 72 5d 20  ct [, selector] 
26df0 29 0a 09 09 09 66 6f 72 20 28 20 74 79 70 65 20  )....for ( type 
26e00 69 6e 20 74 79 70 65 73 20 29 20 7b 0a 09 09 09  in types ) {....
26e10 09 74 68 69 73 2e 6f 66 66 28 20 74 79 70 65 2c  .this.off( type,
26e20 20 73 65 6c 65 63 74 6f 72 2c 20 74 79 70 65 73   selector, types
26e30 5b 20 74 79 70 65 20 5d 20 29 3b 0a 09 09 09 7d  [ type ] );....}
26e40 0a 09 09 09 72 65 74 75 72 6e 20 74 68 69 73 3b  ....return this;
26e50 0a 09 09 7d 0a 09 09 69 66 20 28 20 73 65 6c 65  ...}...if ( sele
26e60 63 74 6f 72 20 3d 3d 3d 20 66 61 6c 73 65 20 7c  ctor === false |
26e70 7c 20 74 79 70 65 6f 66 20 73 65 6c 65 63 74 6f  | typeof selecto
26e80 72 20 3d 3d 3d 20 22 66 75 6e 63 74 69 6f 6e 22  r === "function"
26e90 20 29 20 7b 0a 0a 09 09 09 2f 2f 20 28 20 74 79   ) {.....// ( ty
26ea0 70 65 73 20 5b 2c 20 66 6e 5d 20 29 0a 09 09 09  pes [, fn] )....
26eb0 66 6e 20 3d 20 73 65 6c 65 63 74 6f 72 3b 0a 09  fn = selector;..
26ec0 09 09 73 65 6c 65 63 74 6f 72 20 3d 20 75 6e 64  ..selector = und
26ed0 65 66 69 6e 65 64 3b 0a 09 09 7d 0a 09 09 69 66  efined;...}...if
26ee0 20 28 20 66 6e 20 3d 3d 3d 20 66 61 6c 73 65 20   ( fn === false 
26ef0 29 20 7b 0a 09 09 09 66 6e 20 3d 20 72 65 74 75  ) {....fn = retu
26f00 72 6e 46 61 6c 73 65 3b 0a 09 09 7d 0a 09 09 72  rnFalse;...}...r
26f10 65 74 75 72 6e 20 74 68 69 73 2e 65 61 63 68 28  eturn this.each(
26f20 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09 09   function() {...
26f30 09 6a 51 75 65 72 79 2e 65 76 65 6e 74 2e 72 65  .jQuery.event.re
26f40 6d 6f 76 65 28 20 74 68 69 73 2c 20 74 79 70 65  move( this, type
26f50 73 2c 20 66 6e 2c 20 73 65 6c 65 63 74 6f 72 20  s, fn, selector 
26f60 29 3b 0a 09 09 7d 20 29 3b 0a 09 7d 0a 7d 20 29  );...} );..}.} )
26f70 3b 0a 0a 0a 76 61 72 0a 0a 09 2f 2f 20 53 75 70  ;...var...// Sup
26f80 70 6f 72 74 3a 20 49 45 20 3c 3d 31 30 20 2d 20  port: IE <=10 - 
26f90 31 31 2c 20 45 64 67 65 20 31 32 20 2d 20 31 33  11, Edge 12 - 13
26fa0 20 6f 6e 6c 79 0a 09 2f 2f 20 49 6e 20 49 45 2f   only..// In IE/
26fb0 45 64 67 65 20 75 73 69 6e 67 20 72 65 67 65 78  Edge using regex
26fc0 20 67 72 6f 75 70 73 20 68 65 72 65 20 63 61 75   groups here cau
26fd0 73 65 73 20 73 65 76 65 72 65 20 73 6c 6f 77 64  ses severe slowd
26fe0 6f 77 6e 73 2e 0a 09 2f 2f 20 53 65 65 20 68 74  owns...// See ht
26ff0 74 70 73 3a 2f 2f 63 6f 6e 6e 65 63 74 2e 6d 69  tps://connect.mi
27000 63 72 6f 73 6f 66 74 2e 63 6f 6d 2f 49 45 2f 66  crosoft.com/IE/f
27010 65 65 64 62 61 63 6b 2f 64 65 74 61 69 6c 73 2f  eedback/details/
27020 31 37 33 36 35 31 32 2f 0a 09 72 6e 6f 49 6e 6e  1736512/..rnoInn
27030 65 72 68 74 6d 6c 20 3d 20 2f 3c 73 63 72 69 70  erhtml = /<scrip
27040 74 7c 3c 73 74 79 6c 65 7c 3c 6c 69 6e 6b 2f 69  t|<style|<link/i
27050 2c 0a 0a 09 2f 2f 20 63 68 65 63 6b 65 64 3d 22  ,...// checked="
27060 63 68 65 63 6b 65 64 22 20 6f 72 20 63 68 65 63  checked" or chec
27070 6b 65 64 0a 09 72 63 68 65 63 6b 65 64 20 3d 20  ked..rchecked = 
27080 2f 63 68 65 63 6b 65 64 5c 73 2a 28 3f 3a 5b 5e  /checked\s*(?:[^
27090 3d 5d 7c 3d 5c 73 2a 2e 63 68 65 63 6b 65 64 2e  =]|=\s*.checked.
270a0 29 2f 69 2c 0a 09 72 63 6c 65 61 6e 53 63 72 69  )/i,..rcleanScri
270b0 70 74 20 3d 20 2f 5e 5c 73 2a 3c 21 28 3f 3a 5c  pt = /^\s*<!(?:\
270c0 5b 43 44 41 54 41 5c 5b 7c 2d 2d 29 7c 28 3f 3a  [CDATA\[|--)|(?:
270d0 5c 5d 5c 5d 7c 2d 2d 29 3e 5c 73 2a 24 2f 67 3b  \]\]|--)>\s*$/g;
270e0 0a 0a 2f 2f 20 50 72 65 66 65 72 20 61 20 74 62  ..// Prefer a tb
270f0 6f 64 79 20 6f 76 65 72 20 69 74 73 20 70 61 72  ody over its par
27100 65 6e 74 20 74 61 62 6c 65 20 66 6f 72 20 63 6f  ent table for co
27110 6e 74 61 69 6e 69 6e 67 20 6e 65 77 20 72 6f 77  ntaining new row
27120 73 0a 66 75 6e 63 74 69 6f 6e 20 6d 61 6e 69 70  s.function manip
27130 75 6c 61 74 69 6f 6e 54 61 72 67 65 74 28 20 65  ulationTarget( e
27140 6c 65 6d 2c 20 63 6f 6e 74 65 6e 74 20 29 20 7b  lem, content ) {
27150 0a 09 69 66 20 28 20 6e 6f 64 65 4e 61 6d 65 28  ..if ( nodeName(
27160 20 65 6c 65 6d 2c 20 22 74 61 62 6c 65 22 20 29   elem, "table" )
27170 20 26 26 0a 09 09 6e 6f 64 65 4e 61 6d 65 28 20   &&...nodeName( 
27180 63 6f 6e 74 65 6e 74 2e 6e 6f 64 65 54 79 70 65  content.nodeType
27190 20 21 3d 3d 20 31 31 20 3f 20 63 6f 6e 74 65 6e   !== 11 ? conten
271a0 74 20 3a 20 63 6f 6e 74 65 6e 74 2e 66 69 72 73  t : content.firs
271b0 74 43 68 69 6c 64 2c 20 22 74 72 22 20 29 20 29  tChild, "tr" ) )
271c0 20 7b 0a 0a 09 09 72 65 74 75 72 6e 20 6a 51 75   {....return jQu
271d0 65 72 79 28 20 65 6c 65 6d 20 29 2e 63 68 69 6c  ery( elem ).chil
271e0 64 72 65 6e 28 20 22 74 62 6f 64 79 22 20 29 5b  dren( "tbody" )[
271f0 20 30 20 5d 20 7c 7c 20 65 6c 65 6d 3b 0a 09 7d   0 ] || elem;..}
27200 0a 0a 09 72 65 74 75 72 6e 20 65 6c 65 6d 3b 0a  ...return elem;.
27210 7d 0a 0a 2f 2f 20 52 65 70 6c 61 63 65 2f 72 65  }..// Replace/re
27220 73 74 6f 72 65 20 74 68 65 20 74 79 70 65 20 61  store the type a
27230 74 74 72 69 62 75 74 65 20 6f 66 20 73 63 72 69  ttribute of scri
27240 70 74 20 65 6c 65 6d 65 6e 74 73 20 66 6f 72 20  pt elements for 
27250 73 61 66 65 20 44 4f 4d 20 6d 61 6e 69 70 75 6c  safe DOM manipul
27260 61 74 69 6f 6e 0a 66 75 6e 63 74 69 6f 6e 20 64  ation.function d
27270 69 73 61 62 6c 65 53 63 72 69 70 74 28 20 65 6c  isableScript( el
27280 65 6d 20 29 20 7b 0a 09 65 6c 65 6d 2e 74 79 70  em ) {..elem.typ
27290 65 20 3d 20 28 20 65 6c 65 6d 2e 67 65 74 41 74  e = ( elem.getAt
272a0 74 72 69 62 75 74 65 28 20 22 74 79 70 65 22 20  tribute( "type" 
272b0 29 20 21 3d 3d 20 6e 75 6c 6c 20 29 20 2b 20 22  ) !== null ) + "
272c0 2f 22 20 2b 20 65 6c 65 6d 2e 74 79 70 65 3b 0a  /" + elem.type;.
272d0 09 72 65 74 75 72 6e 20 65 6c 65 6d 3b 0a 7d 0a  .return elem;.}.
272e0 66 75 6e 63 74 69 6f 6e 20 72 65 73 74 6f 72 65  function restore
272f0 53 63 72 69 70 74 28 20 65 6c 65 6d 20 29 20 7b  Script( elem ) {
27300 0a 09 69 66 20 28 20 28 20 65 6c 65 6d 2e 74 79  ..if ( ( elem.ty
27310 70 65 20 7c 7c 20 22 22 20 29 2e 73 6c 69 63 65  pe || "" ).slice
27320 28 20 30 2c 20 35 20 29 20 3d 3d 3d 20 22 74 72  ( 0, 5 ) === "tr
27330 75 65 2f 22 20 29 20 7b 0a 09 09 65 6c 65 6d 2e  ue/" ) {...elem.
27340 74 79 70 65 20 3d 20 65 6c 65 6d 2e 74 79 70 65  type = elem.type
27350 2e 73 6c 69 63 65 28 20 35 20 29 3b 0a 09 7d 20  .slice( 5 );..} 
27360 65 6c 73 65 20 7b 0a 09 09 65 6c 65 6d 2e 72 65  else {...elem.re
27370 6d 6f 76 65 41 74 74 72 69 62 75 74 65 28 20 22  moveAttribute( "
27380 74 79 70 65 22 20 29 3b 0a 09 7d 0a 0a 09 72 65  type" );..}...re
27390 74 75 72 6e 20 65 6c 65 6d 3b 0a 7d 0a 0a 66 75  turn elem;.}..fu
273a0 6e 63 74 69 6f 6e 20 63 6c 6f 6e 65 43 6f 70 79  nction cloneCopy
273b0 45 76 65 6e 74 28 20 73 72 63 2c 20 64 65 73 74  Event( src, dest
273c0 20 29 20 7b 0a 09 76 61 72 20 69 2c 20 6c 2c 20   ) {..var i, l, 
273d0 74 79 70 65 2c 20 70 64 61 74 61 4f 6c 64 2c 20  type, pdataOld, 
273e0 75 64 61 74 61 4f 6c 64 2c 20 75 64 61 74 61 43  udataOld, udataC
273f0 75 72 2c 20 65 76 65 6e 74 73 3b 0a 0a 09 69 66  ur, events;...if
27400 20 28 20 64 65 73 74 2e 6e 6f 64 65 54 79 70 65   ( dest.nodeType
27410 20 21 3d 3d 20 31 20 29 20 7b 0a 09 09 72 65 74   !== 1 ) {...ret
27420 75 72 6e 3b 0a 09 7d 0a 0a 09 2f 2f 20 31 2e 20  urn;..}...// 1. 
27430 43 6f 70 79 20 70 72 69 76 61 74 65 20 64 61 74  Copy private dat
27440 61 3a 20 65 76 65 6e 74 73 2c 20 68 61 6e 64 6c  a: events, handl
27450 65 72 73 2c 20 65 74 63 2e 0a 09 69 66 20 28 20  ers, etc...if ( 
27460 64 61 74 61 50 72 69 76 2e 68 61 73 44 61 74 61  dataPriv.hasData
27470 28 20 73 72 63 20 29 20 29 20 7b 0a 09 09 70 64  ( src ) ) {...pd
27480 61 74 61 4f 6c 64 20 3d 20 64 61 74 61 50 72 69  ataOld = dataPri
27490 76 2e 67 65 74 28 20 73 72 63 20 29 3b 0a 09 09  v.get( src );...
274a0 65 76 65 6e 74 73 20 3d 20 70 64 61 74 61 4f 6c  events = pdataOl
274b0 64 2e 65 76 65 6e 74 73 3b 0a 0a 09 09 69 66 20  d.events;....if 
274c0 28 20 65 76 65 6e 74 73 20 29 20 7b 0a 09 09 09  ( events ) {....
274d0 64 61 74 61 50 72 69 76 2e 72 65 6d 6f 76 65 28  dataPriv.remove(
274e0 20 64 65 73 74 2c 20 22 68 61 6e 64 6c 65 20 65   dest, "handle e
274f0 76 65 6e 74 73 22 20 29 3b 0a 0a 09 09 09 66 6f  vents" );.....fo
27500 72 20 28 20 74 79 70 65 20 69 6e 20 65 76 65 6e  r ( type in even
27510 74 73 20 29 20 7b 0a 09 09 09 09 66 6f 72 20 28  ts ) {.....for (
27520 20 69 20 3d 20 30 2c 20 6c 20 3d 20 65 76 65 6e   i = 0, l = even
27530 74 73 5b 20 74 79 70 65 20 5d 2e 6c 65 6e 67 74  ts[ type ].lengt
27540 68 3b 20 69 20 3c 20 6c 3b 20 69 2b 2b 20 29 20  h; i < l; i++ ) 
27550 7b 0a 09 09 09 09 09 6a 51 75 65 72 79 2e 65 76  {......jQuery.ev
27560 65 6e 74 2e 61 64 64 28 20 64 65 73 74 2c 20 74  ent.add( dest, t
27570 79 70 65 2c 20 65 76 65 6e 74 73 5b 20 74 79 70  ype, events[ typ
27580 65 20 5d 5b 20 69 20 5d 20 29 3b 0a 09 09 09 09  e ][ i ] );.....
27590 7d 0a 09 09 09 7d 0a 09 09 7d 0a 09 7d 0a 0a 09  }....}...}..}...
275a0 2f 2f 20 32 2e 20 43 6f 70 79 20 75 73 65 72 20  // 2. Copy user 
275b0 64 61 74 61 0a 09 69 66 20 28 20 64 61 74 61 55  data..if ( dataU
275c0 73 65 72 2e 68 61 73 44 61 74 61 28 20 73 72 63  ser.hasData( src
275d0 20 29 20 29 20 7b 0a 09 09 75 64 61 74 61 4f 6c   ) ) {...udataOl
275e0 64 20 3d 20 64 61 74 61 55 73 65 72 2e 61 63 63  d = dataUser.acc
275f0 65 73 73 28 20 73 72 63 20 29 3b 0a 09 09 75 64  ess( src );...ud
27600 61 74 61 43 75 72 20 3d 20 6a 51 75 65 72 79 2e  ataCur = jQuery.
27610 65 78 74 65 6e 64 28 20 7b 7d 2c 20 75 64 61 74  extend( {}, udat
27620 61 4f 6c 64 20 29 3b 0a 0a 09 09 64 61 74 61 55  aOld );....dataU
27630 73 65 72 2e 73 65 74 28 20 64 65 73 74 2c 20 75  ser.set( dest, u
27640 64 61 74 61 43 75 72 20 29 3b 0a 09 7d 0a 7d 0a  dataCur );..}.}.
27650 0a 2f 2f 20 46 69 78 20 49 45 20 62 75 67 73 2c  .// Fix IE bugs,
27660 20 73 65 65 20 73 75 70 70 6f 72 74 20 74 65 73   see support tes
27670 74 73 0a 66 75 6e 63 74 69 6f 6e 20 66 69 78 49  ts.function fixI
27680 6e 70 75 74 28 20 73 72 63 2c 20 64 65 73 74 20  nput( src, dest 
27690 29 20 7b 0a 09 76 61 72 20 6e 6f 64 65 4e 61 6d  ) {..var nodeNam
276a0 65 20 3d 20 64 65 73 74 2e 6e 6f 64 65 4e 61 6d  e = dest.nodeNam
276b0 65 2e 74 6f 4c 6f 77 65 72 43 61 73 65 28 29 3b  e.toLowerCase();
276c0 0a 0a 09 2f 2f 20 46 61 69 6c 73 20 74 6f 20 70  ...// Fails to p
276d0 65 72 73 69 73 74 20 74 68 65 20 63 68 65 63 6b  ersist the check
276e0 65 64 20 73 74 61 74 65 20 6f 66 20 61 20 63 6c  ed state of a cl
276f0 6f 6e 65 64 20 63 68 65 63 6b 62 6f 78 20 6f 72  oned checkbox or
27700 20 72 61 64 69 6f 20 62 75 74 74 6f 6e 2e 0a 09   radio button...
27710 69 66 20 28 20 6e 6f 64 65 4e 61 6d 65 20 3d 3d  if ( nodeName ==
27720 3d 20 22 69 6e 70 75 74 22 20 26 26 20 72 63 68  = "input" && rch
27730 65 63 6b 61 62 6c 65 54 79 70 65 2e 74 65 73 74  eckableType.test
27740 28 20 73 72 63 2e 74 79 70 65 20 29 20 29 20 7b  ( src.type ) ) {
27750 0a 09 09 64 65 73 74 2e 63 68 65 63 6b 65 64 20  ...dest.checked 
27760 3d 20 73 72 63 2e 63 68 65 63 6b 65 64 3b 0a 0a  = src.checked;..
27770 09 2f 2f 20 46 61 69 6c 73 20 74 6f 20 72 65 74  .// Fails to ret
27780 75 72 6e 20 74 68 65 20 73 65 6c 65 63 74 65 64  urn the selected
27790 20 6f 70 74 69 6f 6e 20 74 6f 20 74 68 65 20 64   option to the d
277a0 65 66 61 75 6c 74 20 73 65 6c 65 63 74 65 64 20  efault selected 
277b0 73 74 61 74 65 20 77 68 65 6e 20 63 6c 6f 6e 69  state when cloni
277c0 6e 67 20 6f 70 74 69 6f 6e 73 0a 09 7d 20 65 6c  ng options..} el
277d0 73 65 20 69 66 20 28 20 6e 6f 64 65 4e 61 6d 65  se if ( nodeName
277e0 20 3d 3d 3d 20 22 69 6e 70 75 74 22 20 7c 7c 20   === "input" || 
277f0 6e 6f 64 65 4e 61 6d 65 20 3d 3d 3d 20 22 74 65  nodeName === "te
27800 78 74 61 72 65 61 22 20 29 20 7b 0a 09 09 64 65  xtarea" ) {...de
27810 73 74 2e 64 65 66 61 75 6c 74 56 61 6c 75 65 20  st.defaultValue 
27820 3d 20 73 72 63 2e 64 65 66 61 75 6c 74 56 61 6c  = src.defaultVal
27830 75 65 3b 0a 09 7d 0a 7d 0a 0a 66 75 6e 63 74 69  ue;..}.}..functi
27840 6f 6e 20 64 6f 6d 4d 61 6e 69 70 28 20 63 6f 6c  on domManip( col
27850 6c 65 63 74 69 6f 6e 2c 20 61 72 67 73 2c 20 63  lection, args, c
27860 61 6c 6c 62 61 63 6b 2c 20 69 67 6e 6f 72 65 64  allback, ignored
27870 20 29 20 7b 0a 0a 09 2f 2f 20 46 6c 61 74 74 65   ) {...// Flatte
27880 6e 20 61 6e 79 20 6e 65 73 74 65 64 20 61 72 72  n any nested arr
27890 61 79 73 0a 09 61 72 67 73 20 3d 20 66 6c 61 74  ays..args = flat
278a0 28 20 61 72 67 73 20 29 3b 0a 0a 09 76 61 72 20  ( args );...var 
278b0 66 72 61 67 6d 65 6e 74 2c 20 66 69 72 73 74 2c  fragment, first,
278c0 20 73 63 72 69 70 74 73 2c 20 68 61 73 53 63 72   scripts, hasScr
278d0 69 70 74 73 2c 20 6e 6f 64 65 2c 20 64 6f 63 2c  ipts, node, doc,
278e0 0a 09 09 69 20 3d 20 30 2c 0a 09 09 6c 20 3d 20  ...i = 0,...l = 
278f0 63 6f 6c 6c 65 63 74 69 6f 6e 2e 6c 65 6e 67 74  collection.lengt
27900 68 2c 0a 09 09 69 4e 6f 43 6c 6f 6e 65 20 3d 20  h,...iNoClone = 
27910 6c 20 2d 20 31 2c 0a 09 09 76 61 6c 75 65 20 3d  l - 1,...value =
27920 20 61 72 67 73 5b 20 30 20 5d 2c 0a 09 09 76 61   args[ 0 ],...va
27930 6c 75 65 49 73 46 75 6e 63 74 69 6f 6e 20 3d 20  lueIsFunction = 
27940 69 73 46 75 6e 63 74 69 6f 6e 28 20 76 61 6c 75  isFunction( valu
27950 65 20 29 3b 0a 0a 09 2f 2f 20 57 65 20 63 61 6e  e );...// We can
27960 27 74 20 63 6c 6f 6e 65 4e 6f 64 65 20 66 72 61  't cloneNode fra
27970 67 6d 65 6e 74 73 20 74 68 61 74 20 63 6f 6e 74  gments that cont
27980 61 69 6e 20 63 68 65 63 6b 65 64 2c 20 69 6e 20  ain checked, in 
27990 57 65 62 4b 69 74 0a 09 69 66 20 28 20 76 61 6c  WebKit..if ( val
279a0 75 65 49 73 46 75 6e 63 74 69 6f 6e 20 7c 7c 0a  ueIsFunction ||.
279b0 09 09 09 28 20 6c 20 3e 20 31 20 26 26 20 74 79  ...( l > 1 && ty
279c0 70 65 6f 66 20 76 61 6c 75 65 20 3d 3d 3d 20 22  peof value === "
279d0 73 74 72 69 6e 67 22 20 26 26 0a 09 09 09 09 21  string" &&.....!
279e0 73 75 70 70 6f 72 74 2e 63 68 65 63 6b 43 6c 6f  support.checkClo
279f0 6e 65 20 26 26 20 72 63 68 65 63 6b 65 64 2e 74  ne && rchecked.t
27a00 65 73 74 28 20 76 61 6c 75 65 20 29 20 29 20 29  est( value ) ) )
27a10 20 7b 0a 09 09 72 65 74 75 72 6e 20 63 6f 6c 6c   {...return coll
27a20 65 63 74 69 6f 6e 2e 65 61 63 68 28 20 66 75 6e  ection.each( fun
27a30 63 74 69 6f 6e 28 20 69 6e 64 65 78 20 29 20 7b  ction( index ) {
27a40 0a 09 09 09 76 61 72 20 73 65 6c 66 20 3d 20 63  ....var self = c
27a50 6f 6c 6c 65 63 74 69 6f 6e 2e 65 71 28 20 69 6e  ollection.eq( in
27a60 64 65 78 20 29 3b 0a 09 09 09 69 66 20 28 20 76  dex );....if ( v
27a70 61 6c 75 65 49 73 46 75 6e 63 74 69 6f 6e 20 29  alueIsFunction )
27a80 20 7b 0a 09 09 09 09 61 72 67 73 5b 20 30 20 5d   {.....args[ 0 ]
27a90 20 3d 20 76 61 6c 75 65 2e 63 61 6c 6c 28 20 74   = value.call( t
27aa0 68 69 73 2c 20 69 6e 64 65 78 2c 20 73 65 6c 66  his, index, self
27ab0 2e 68 74 6d 6c 28 29 20 29 3b 0a 09 09 09 7d 0a  .html() );....}.
27ac0 09 09 09 64 6f 6d 4d 61 6e 69 70 28 20 73 65 6c  ...domManip( sel
27ad0 66 2c 20 61 72 67 73 2c 20 63 61 6c 6c 62 61 63  f, args, callbac
27ae0 6b 2c 20 69 67 6e 6f 72 65 64 20 29 3b 0a 09 09  k, ignored );...
27af0 7d 20 29 3b 0a 09 7d 0a 0a 09 69 66 20 28 20 6c  } );..}...if ( l
27b00 20 29 20 7b 0a 09 09 66 72 61 67 6d 65 6e 74 20   ) {...fragment 
27b10 3d 20 62 75 69 6c 64 46 72 61 67 6d 65 6e 74 28  = buildFragment(
27b20 20 61 72 67 73 2c 20 63 6f 6c 6c 65 63 74 69 6f   args, collectio
27b30 6e 5b 20 30 20 5d 2e 6f 77 6e 65 72 44 6f 63 75  n[ 0 ].ownerDocu
27b40 6d 65 6e 74 2c 20 66 61 6c 73 65 2c 20 63 6f 6c  ment, false, col
27b50 6c 65 63 74 69 6f 6e 2c 20 69 67 6e 6f 72 65 64  lection, ignored
27b60 20 29 3b 0a 09 09 66 69 72 73 74 20 3d 20 66 72   );...first = fr
27b70 61 67 6d 65 6e 74 2e 66 69 72 73 74 43 68 69 6c  agment.firstChil
27b80 64 3b 0a 0a 09 09 69 66 20 28 20 66 72 61 67 6d  d;....if ( fragm
27b90 65 6e 74 2e 63 68 69 6c 64 4e 6f 64 65 73 2e 6c  ent.childNodes.l
27ba0 65 6e 67 74 68 20 3d 3d 3d 20 31 20 29 20 7b 0a  ength === 1 ) {.
27bb0 09 09 09 66 72 61 67 6d 65 6e 74 20 3d 20 66 69  ...fragment = fi
27bc0 72 73 74 3b 0a 09 09 7d 0a 0a 09 09 2f 2f 20 52  rst;...}....// R
27bd0 65 71 75 69 72 65 20 65 69 74 68 65 72 20 6e 65  equire either ne
27be0 77 20 63 6f 6e 74 65 6e 74 20 6f 72 20 61 6e 20  w content or an 
27bf0 69 6e 74 65 72 65 73 74 20 69 6e 20 69 67 6e 6f  interest in igno
27c00 72 65 64 20 65 6c 65 6d 65 6e 74 73 20 74 6f 20  red elements to 
27c10 69 6e 76 6f 6b 65 20 74 68 65 20 63 61 6c 6c 62  invoke the callb
27c20 61 63 6b 0a 09 09 69 66 20 28 20 66 69 72 73 74  ack...if ( first
27c30 20 7c 7c 20 69 67 6e 6f 72 65 64 20 29 20 7b 0a   || ignored ) {.
27c40 09 09 09 73 63 72 69 70 74 73 20 3d 20 6a 51 75  ...scripts = jQu
27c50 65 72 79 2e 6d 61 70 28 20 67 65 74 41 6c 6c 28  ery.map( getAll(
27c60 20 66 72 61 67 6d 65 6e 74 2c 20 22 73 63 72 69   fragment, "scri
27c70 70 74 22 20 29 2c 20 64 69 73 61 62 6c 65 53 63  pt" ), disableSc
27c80 72 69 70 74 20 29 3b 0a 09 09 09 68 61 73 53 63  ript );....hasSc
27c90 72 69 70 74 73 20 3d 20 73 63 72 69 70 74 73 2e  ripts = scripts.
27ca0 6c 65 6e 67 74 68 3b 0a 0a 09 09 09 2f 2f 20 55  length;.....// U
27cb0 73 65 20 74 68 65 20 6f 72 69 67 69 6e 61 6c 20  se the original 
27cc0 66 72 61 67 6d 65 6e 74 20 66 6f 72 20 74 68 65  fragment for the
27cd0 20 6c 61 73 74 20 69 74 65 6d 0a 09 09 09 2f 2f   last item....//
27ce0 20 69 6e 73 74 65 61 64 20 6f 66 20 74 68 65 20   instead of the 
27cf0 66 69 72 73 74 20 62 65 63 61 75 73 65 20 69 74  first because it
27d00 20 63 61 6e 20 65 6e 64 20 75 70 0a 09 09 09 2f   can end up..../
27d10 2f 20 62 65 69 6e 67 20 65 6d 70 74 69 65 64 20  / being emptied 
27d20 69 6e 63 6f 72 72 65 63 74 6c 79 20 69 6e 20 63  incorrectly in c
27d30 65 72 74 61 69 6e 20 73 69 74 75 61 74 69 6f 6e  ertain situation
27d40 73 20 28 23 38 30 37 30 29 2e 0a 09 09 09 66 6f  s (#8070).....fo
27d50 72 20 28 20 3b 20 69 20 3c 20 6c 3b 20 69 2b 2b  r ( ; i < l; i++
27d60 20 29 20 7b 0a 09 09 09 09 6e 6f 64 65 20 3d 20   ) {.....node = 
27d70 66 72 61 67 6d 65 6e 74 3b 0a 0a 09 09 09 09 69  fragment;......i
27d80 66 20 28 20 69 20 21 3d 3d 20 69 4e 6f 43 6c 6f  f ( i !== iNoClo
27d90 6e 65 20 29 20 7b 0a 09 09 09 09 09 6e 6f 64 65  ne ) {......node
27da0 20 3d 20 6a 51 75 65 72 79 2e 63 6c 6f 6e 65 28   = jQuery.clone(
27db0 20 6e 6f 64 65 2c 20 74 72 75 65 2c 20 74 72 75   node, true, tru
27dc0 65 20 29 3b 0a 0a 09 09 09 09 09 2f 2f 20 4b 65  e );.......// Ke
27dd0 65 70 20 72 65 66 65 72 65 6e 63 65 73 20 74 6f  ep references to
27de0 20 63 6c 6f 6e 65 64 20 73 63 72 69 70 74 73 20   cloned scripts 
27df0 66 6f 72 20 6c 61 74 65 72 20 72 65 73 74 6f 72  for later restor
27e00 61 74 69 6f 6e 0a 09 09 09 09 09 69 66 20 28 20  ation......if ( 
27e10 68 61 73 53 63 72 69 70 74 73 20 29 20 7b 0a 0a  hasScripts ) {..
27e20 09 09 09 09 09 09 2f 2f 20 53 75 70 70 6f 72 74  ......// Support
27e30 3a 20 41 6e 64 72 6f 69 64 20 3c 3d 34 2e 30 20  : Android <=4.0 
27e40 6f 6e 6c 79 2c 20 50 68 61 6e 74 6f 6d 4a 53 20  only, PhantomJS 
27e50 31 20 6f 6e 6c 79 0a 09 09 09 09 09 09 2f 2f 20  1 only.......// 
27e60 70 75 73 68 2e 61 70 70 6c 79 28 5f 2c 20 61 72  push.apply(_, ar
27e70 72 61 79 6c 69 6b 65 29 20 74 68 72 6f 77 73 20  raylike) throws 
27e80 6f 6e 20 61 6e 63 69 65 6e 74 20 57 65 62 4b 69  on ancient WebKi
27e90 74 0a 09 09 09 09 09 09 6a 51 75 65 72 79 2e 6d  t.......jQuery.m
27ea0 65 72 67 65 28 20 73 63 72 69 70 74 73 2c 20 67  erge( scripts, g
27eb0 65 74 41 6c 6c 28 20 6e 6f 64 65 2c 20 22 73 63  etAll( node, "sc
27ec0 72 69 70 74 22 20 29 20 29 3b 0a 09 09 09 09 09  ript" ) );......
27ed0 7d 0a 09 09 09 09 7d 0a 0a 09 09 09 09 63 61 6c  }.....}......cal
27ee0 6c 62 61 63 6b 2e 63 61 6c 6c 28 20 63 6f 6c 6c  lback.call( coll
27ef0 65 63 74 69 6f 6e 5b 20 69 20 5d 2c 20 6e 6f 64  ection[ i ], nod
27f00 65 2c 20 69 20 29 3b 0a 09 09 09 7d 0a 0a 09 09  e, i );....}....
27f10 09 69 66 20 28 20 68 61 73 53 63 72 69 70 74 73  .if ( hasScripts
27f20 20 29 20 7b 0a 09 09 09 09 64 6f 63 20 3d 20 73   ) {.....doc = s
27f30 63 72 69 70 74 73 5b 20 73 63 72 69 70 74 73 2e  cripts[ scripts.
27f40 6c 65 6e 67 74 68 20 2d 20 31 20 5d 2e 6f 77 6e  length - 1 ].own
27f50 65 72 44 6f 63 75 6d 65 6e 74 3b 0a 0a 09 09 09  erDocument;.....
27f60 09 2f 2f 20 52 65 65 6e 61 62 6c 65 20 73 63 72  .// Reenable scr
27f70 69 70 74 73 0a 09 09 09 09 6a 51 75 65 72 79 2e  ipts.....jQuery.
27f80 6d 61 70 28 20 73 63 72 69 70 74 73 2c 20 72 65  map( scripts, re
27f90 73 74 6f 72 65 53 63 72 69 70 74 20 29 3b 0a 0a  storeScript );..
27fa0 09 09 09 09 2f 2f 20 45 76 61 6c 75 61 74 65 20  ....// Evaluate 
27fb0 65 78 65 63 75 74 61 62 6c 65 20 73 63 72 69 70  executable scrip
27fc0 74 73 20 6f 6e 20 66 69 72 73 74 20 64 6f 63 75  ts on first docu
27fd0 6d 65 6e 74 20 69 6e 73 65 72 74 69 6f 6e 0a 09  ment insertion..
27fe0 09 09 09 66 6f 72 20 28 20 69 20 3d 20 30 3b 20  ...for ( i = 0; 
27ff0 69 20 3c 20 68 61 73 53 63 72 69 70 74 73 3b 20  i < hasScripts; 
28000 69 2b 2b 20 29 20 7b 0a 09 09 09 09 09 6e 6f 64  i++ ) {......nod
28010 65 20 3d 20 73 63 72 69 70 74 73 5b 20 69 20 5d  e = scripts[ i ]
28020 3b 0a 09 09 09 09 09 69 66 20 28 20 72 73 63 72  ;......if ( rscr
28030 69 70 74 54 79 70 65 2e 74 65 73 74 28 20 6e 6f  iptType.test( no
28040 64 65 2e 74 79 70 65 20 7c 7c 20 22 22 20 29 20  de.type || "" ) 
28050 26 26 0a 09 09 09 09 09 09 21 64 61 74 61 50 72  &&.......!dataPr
28060 69 76 2e 61 63 63 65 73 73 28 20 6e 6f 64 65 2c  iv.access( node,
28070 20 22 67 6c 6f 62 61 6c 45 76 61 6c 22 20 29 20   "globalEval" ) 
28080 26 26 0a 09 09 09 09 09 09 6a 51 75 65 72 79 2e  &&.......jQuery.
28090 63 6f 6e 74 61 69 6e 73 28 20 64 6f 63 2c 20 6e  contains( doc, n
280a0 6f 64 65 20 29 20 29 20 7b 0a 0a 09 09 09 09 09  ode ) ) {.......
280b0 09 69 66 20 28 20 6e 6f 64 65 2e 73 72 63 20 26  .if ( node.src &
280c0 26 20 28 20 6e 6f 64 65 2e 74 79 70 65 20 7c 7c  & ( node.type ||
280d0 20 22 22 20 29 2e 74 6f 4c 6f 77 65 72 43 61 73   "" ).toLowerCas
280e0 65 28 29 20 20 21 3d 3d 20 22 6d 6f 64 75 6c 65  e()  !== "module
280f0 22 20 29 20 7b 0a 0a 09 09 09 09 09 09 09 2f 2f  " ) {.........//
28100 20 4f 70 74 69 6f 6e 61 6c 20 41 4a 41 58 20 64   Optional AJAX d
28110 65 70 65 6e 64 65 6e 63 79 2c 20 62 75 74 20 77  ependency, but w
28120 6f 6e 27 74 20 72 75 6e 20 73 63 72 69 70 74 73  on't run scripts
28130 20 69 66 20 6e 6f 74 20 70 72 65 73 65 6e 74 0a   if not present.
28140 09 09 09 09 09 09 09 69 66 20 28 20 6a 51 75 65  .......if ( jQue
28150 72 79 2e 5f 65 76 61 6c 55 72 6c 20 26 26 20 21  ry._evalUrl && !
28160 6e 6f 64 65 2e 6e 6f 4d 6f 64 75 6c 65 20 29 20  node.noModule ) 
28170 7b 0a 09 09 09 09 09 09 09 09 6a 51 75 65 72 79  {.........jQuery
28180 2e 5f 65 76 61 6c 55 72 6c 28 20 6e 6f 64 65 2e  ._evalUrl( node.
28190 73 72 63 2c 20 7b 0a 09 09 09 09 09 09 09 09 09  src, {..........
281a0 6e 6f 6e 63 65 3a 20 6e 6f 64 65 2e 6e 6f 6e 63  nonce: node.nonc
281b0 65 20 7c 7c 20 6e 6f 64 65 2e 67 65 74 41 74 74  e || node.getAtt
281c0 72 69 62 75 74 65 28 20 22 6e 6f 6e 63 65 22 20  ribute( "nonce" 
281d0 29 0a 09 09 09 09 09 09 09 09 7d 2c 20 64 6f 63  ).........}, doc
281e0 20 29 3b 0a 09 09 09 09 09 09 09 7d 0a 09 09 09   );........}....
281f0 09 09 09 7d 20 65 6c 73 65 20 7b 0a 09 09 09 09  ...} else {.....
28200 09 09 09 44 4f 4d 45 76 61 6c 28 20 6e 6f 64 65  ...DOMEval( node
28210 2e 74 65 78 74 43 6f 6e 74 65 6e 74 2e 72 65 70  .textContent.rep
28220 6c 61 63 65 28 20 72 63 6c 65 61 6e 53 63 72 69  lace( rcleanScri
28230 70 74 2c 20 22 22 20 29 2c 20 6e 6f 64 65 2c 20  pt, "" ), node, 
28240 64 6f 63 20 29 3b 0a 09 09 09 09 09 09 7d 0a 09  doc );.......}..
28250 09 09 09 09 7d 0a 09 09 09 09 7d 0a 09 09 09 7d  ....}.....}....}
28260 0a 09 09 7d 0a 09 7d 0a 0a 09 72 65 74 75 72 6e  ...}..}...return
28270 20 63 6f 6c 6c 65 63 74 69 6f 6e 3b 0a 7d 0a 0a   collection;.}..
28280 66 75 6e 63 74 69 6f 6e 20 72 65 6d 6f 76 65 28  function remove(
28290 20 65 6c 65 6d 2c 20 73 65 6c 65 63 74 6f 72 2c   elem, selector,
282a0 20 6b 65 65 70 44 61 74 61 20 29 20 7b 0a 09 76   keepData ) {..v
282b0 61 72 20 6e 6f 64 65 2c 0a 09 09 6e 6f 64 65 73  ar node,...nodes
282c0 20 3d 20 73 65 6c 65 63 74 6f 72 20 3f 20 6a 51   = selector ? jQ
282d0 75 65 72 79 2e 66 69 6c 74 65 72 28 20 73 65 6c  uery.filter( sel
282e0 65 63 74 6f 72 2c 20 65 6c 65 6d 20 29 20 3a 20  ector, elem ) : 
282f0 65 6c 65 6d 2c 0a 09 09 69 20 3d 20 30 3b 0a 0a  elem,...i = 0;..
28300 09 66 6f 72 20 28 20 3b 20 28 20 6e 6f 64 65 20  .for ( ; ( node 
28310 3d 20 6e 6f 64 65 73 5b 20 69 20 5d 20 29 20 21  = nodes[ i ] ) !
28320 3d 20 6e 75 6c 6c 3b 20 69 2b 2b 20 29 20 7b 0a  = null; i++ ) {.
28330 09 09 69 66 20 28 20 21 6b 65 65 70 44 61 74 61  ..if ( !keepData
28340 20 26 26 20 6e 6f 64 65 2e 6e 6f 64 65 54 79 70   && node.nodeTyp
28350 65 20 3d 3d 3d 20 31 20 29 20 7b 0a 09 09 09 6a  e === 1 ) {....j
28360 51 75 65 72 79 2e 63 6c 65 61 6e 44 61 74 61 28  Query.cleanData(
28370 20 67 65 74 41 6c 6c 28 20 6e 6f 64 65 20 29 20   getAll( node ) 
28380 29 3b 0a 09 09 7d 0a 0a 09 09 69 66 20 28 20 6e  );...}....if ( n
28390 6f 64 65 2e 70 61 72 65 6e 74 4e 6f 64 65 20 29  ode.parentNode )
283a0 20 7b 0a 09 09 09 69 66 20 28 20 6b 65 65 70 44   {....if ( keepD
283b0 61 74 61 20 26 26 20 69 73 41 74 74 61 63 68 65  ata && isAttache
283c0 64 28 20 6e 6f 64 65 20 29 20 29 20 7b 0a 09 09  d( node ) ) {...
283d0 09 09 73 65 74 47 6c 6f 62 61 6c 45 76 61 6c 28  ..setGlobalEval(
283e0 20 67 65 74 41 6c 6c 28 20 6e 6f 64 65 2c 20 22   getAll( node, "
283f0 73 63 72 69 70 74 22 20 29 20 29 3b 0a 09 09 09  script" ) );....
28400 7d 0a 09 09 09 6e 6f 64 65 2e 70 61 72 65 6e 74  }....node.parent
28410 4e 6f 64 65 2e 72 65 6d 6f 76 65 43 68 69 6c 64  Node.removeChild
28420 28 20 6e 6f 64 65 20 29 3b 0a 09 09 7d 0a 09 7d  ( node );...}..}
28430 0a 0a 09 72 65 74 75 72 6e 20 65 6c 65 6d 3b 0a  ...return elem;.
28440 7d 0a 0a 6a 51 75 65 72 79 2e 65 78 74 65 6e 64  }..jQuery.extend
28450 28 20 7b 0a 09 68 74 6d 6c 50 72 65 66 69 6c 74  ( {..htmlPrefilt
28460 65 72 3a 20 66 75 6e 63 74 69 6f 6e 28 20 68 74  er: function( ht
28470 6d 6c 20 29 20 7b 0a 09 09 72 65 74 75 72 6e 20  ml ) {...return 
28480 68 74 6d 6c 3b 0a 09 7d 2c 0a 0a 09 63 6c 6f 6e  html;..},...clon
28490 65 3a 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c 65  e: function( ele
284a0 6d 2c 20 64 61 74 61 41 6e 64 45 76 65 6e 74 73  m, dataAndEvents
284b0 2c 20 64 65 65 70 44 61 74 61 41 6e 64 45 76 65  , deepDataAndEve
284c0 6e 74 73 20 29 20 7b 0a 09 09 76 61 72 20 69 2c  nts ) {...var i,
284d0 20 6c 2c 20 73 72 63 45 6c 65 6d 65 6e 74 73 2c   l, srcElements,
284e0 20 64 65 73 74 45 6c 65 6d 65 6e 74 73 2c 0a 09   destElements,..
284f0 09 09 63 6c 6f 6e 65 20 3d 20 65 6c 65 6d 2e 63  ..clone = elem.c
28500 6c 6f 6e 65 4e 6f 64 65 28 20 74 72 75 65 20 29  loneNode( true )
28510 2c 0a 09 09 09 69 6e 50 61 67 65 20 3d 20 69 73  ,....inPage = is
28520 41 74 74 61 63 68 65 64 28 20 65 6c 65 6d 20 29  Attached( elem )
28530 3b 0a 0a 09 09 2f 2f 20 46 69 78 20 49 45 20 63  ;....// Fix IE c
28540 6c 6f 6e 69 6e 67 20 69 73 73 75 65 73 0a 09 09  loning issues...
28550 69 66 20 28 20 21 73 75 70 70 6f 72 74 2e 6e 6f  if ( !support.no
28560 43 6c 6f 6e 65 43 68 65 63 6b 65 64 20 26 26 20  CloneChecked && 
28570 28 20 65 6c 65 6d 2e 6e 6f 64 65 54 79 70 65 20  ( elem.nodeType 
28580 3d 3d 3d 20 31 20 7c 7c 20 65 6c 65 6d 2e 6e 6f  === 1 || elem.no
28590 64 65 54 79 70 65 20 3d 3d 3d 20 31 31 20 29 20  deType === 11 ) 
285a0 26 26 0a 09 09 09 09 21 6a 51 75 65 72 79 2e 69  &&.....!jQuery.i
285b0 73 58 4d 4c 44 6f 63 28 20 65 6c 65 6d 20 29 20  sXMLDoc( elem ) 
285c0 29 20 7b 0a 0a 09 09 09 2f 2f 20 57 65 20 65 73  ) {.....// We es
285d0 63 68 65 77 20 53 69 7a 7a 6c 65 20 68 65 72 65  chew Sizzle here
285e0 20 66 6f 72 20 70 65 72 66 6f 72 6d 61 6e 63 65   for performance
285f0 20 72 65 61 73 6f 6e 73 3a 20 68 74 74 70 73 3a   reasons: https:
28600 2f 2f 6a 73 70 65 72 66 2e 63 6f 6d 2f 67 65 74  //jsperf.com/get
28610 61 6c 6c 2d 76 73 2d 73 69 7a 7a 6c 65 2f 32 0a  all-vs-sizzle/2.
28620 09 09 09 64 65 73 74 45 6c 65 6d 65 6e 74 73 20  ...destElements 
28630 3d 20 67 65 74 41 6c 6c 28 20 63 6c 6f 6e 65 20  = getAll( clone 
28640 29 3b 0a 09 09 09 73 72 63 45 6c 65 6d 65 6e 74  );....srcElement
28650 73 20 3d 20 67 65 74 41 6c 6c 28 20 65 6c 65 6d  s = getAll( elem
28660 20 29 3b 0a 0a 09 09 09 66 6f 72 20 28 20 69 20   );.....for ( i 
28670 3d 20 30 2c 20 6c 20 3d 20 73 72 63 45 6c 65 6d  = 0, l = srcElem
28680 65 6e 74 73 2e 6c 65 6e 67 74 68 3b 20 69 20 3c  ents.length; i <
28690 20 6c 3b 20 69 2b 2b 20 29 20 7b 0a 09 09 09 09   l; i++ ) {.....
286a0 66 69 78 49 6e 70 75 74 28 20 73 72 63 45 6c 65  fixInput( srcEle
286b0 6d 65 6e 74 73 5b 20 69 20 5d 2c 20 64 65 73 74  ments[ i ], dest
286c0 45 6c 65 6d 65 6e 74 73 5b 20 69 20 5d 20 29 3b  Elements[ i ] );
286d0 0a 09 09 09 7d 0a 09 09 7d 0a 0a 09 09 2f 2f 20  ....}...}....// 
286e0 43 6f 70 79 20 74 68 65 20 65 76 65 6e 74 73 20  Copy the events 
286f0 66 72 6f 6d 20 74 68 65 20 6f 72 69 67 69 6e 61  from the origina
28700 6c 20 74 6f 20 74 68 65 20 63 6c 6f 6e 65 0a 09  l to the clone..
28710 09 69 66 20 28 20 64 61 74 61 41 6e 64 45 76 65  .if ( dataAndEve
28720 6e 74 73 20 29 20 7b 0a 09 09 09 69 66 20 28 20  nts ) {....if ( 
28730 64 65 65 70 44 61 74 61 41 6e 64 45 76 65 6e 74  deepDataAndEvent
28740 73 20 29 20 7b 0a 09 09 09 09 73 72 63 45 6c 65  s ) {.....srcEle
28750 6d 65 6e 74 73 20 3d 20 73 72 63 45 6c 65 6d 65  ments = srcEleme
28760 6e 74 73 20 7c 7c 20 67 65 74 41 6c 6c 28 20 65  nts || getAll( e
28770 6c 65 6d 20 29 3b 0a 09 09 09 09 64 65 73 74 45  lem );.....destE
28780 6c 65 6d 65 6e 74 73 20 3d 20 64 65 73 74 45 6c  lements = destEl
28790 65 6d 65 6e 74 73 20 7c 7c 20 67 65 74 41 6c 6c  ements || getAll
287a0 28 20 63 6c 6f 6e 65 20 29 3b 0a 0a 09 09 09 09  ( clone );......
287b0 66 6f 72 20 28 20 69 20 3d 20 30 2c 20 6c 20 3d  for ( i = 0, l =
287c0 20 73 72 63 45 6c 65 6d 65 6e 74 73 2e 6c 65 6e   srcElements.len
287d0 67 74 68 3b 20 69 20 3c 20 6c 3b 20 69 2b 2b 20  gth; i < l; i++ 
287e0 29 20 7b 0a 09 09 09 09 09 63 6c 6f 6e 65 43 6f  ) {......cloneCo
287f0 70 79 45 76 65 6e 74 28 20 73 72 63 45 6c 65 6d  pyEvent( srcElem
28800 65 6e 74 73 5b 20 69 20 5d 2c 20 64 65 73 74 45  ents[ i ], destE
28810 6c 65 6d 65 6e 74 73 5b 20 69 20 5d 20 29 3b 0a  lements[ i ] );.
28820 09 09 09 09 7d 0a 09 09 09 7d 20 65 6c 73 65 20  ....}....} else 
28830 7b 0a 09 09 09 09 63 6c 6f 6e 65 43 6f 70 79 45  {.....cloneCopyE
28840 76 65 6e 74 28 20 65 6c 65 6d 2c 20 63 6c 6f 6e  vent( elem, clon
28850 65 20 29 3b 0a 09 09 09 7d 0a 09 09 7d 0a 0a 09  e );....}...}...
28860 09 2f 2f 20 50 72 65 73 65 72 76 65 20 73 63 72  .// Preserve scr
28870 69 70 74 20 65 76 61 6c 75 61 74 69 6f 6e 20 68  ipt evaluation h
28880 69 73 74 6f 72 79 0a 09 09 64 65 73 74 45 6c 65  istory...destEle
28890 6d 65 6e 74 73 20 3d 20 67 65 74 41 6c 6c 28 20  ments = getAll( 
288a0 63 6c 6f 6e 65 2c 20 22 73 63 72 69 70 74 22 20  clone, "script" 
288b0 29 3b 0a 09 09 69 66 20 28 20 64 65 73 74 45 6c  );...if ( destEl
288c0 65 6d 65 6e 74 73 2e 6c 65 6e 67 74 68 20 3e 20  ements.length > 
288d0 30 20 29 20 7b 0a 09 09 09 73 65 74 47 6c 6f 62  0 ) {....setGlob
288e0 61 6c 45 76 61 6c 28 20 64 65 73 74 45 6c 65 6d  alEval( destElem
288f0 65 6e 74 73 2c 20 21 69 6e 50 61 67 65 20 26 26  ents, !inPage &&
28900 20 67 65 74 41 6c 6c 28 20 65 6c 65 6d 2c 20 22   getAll( elem, "
28910 73 63 72 69 70 74 22 20 29 20 29 3b 0a 09 09 7d  script" ) );...}
28920 0a 0a 09 09 2f 2f 20 52 65 74 75 72 6e 20 74 68  ....// Return th
28930 65 20 63 6c 6f 6e 65 64 20 73 65 74 0a 09 09 72  e cloned set...r
28940 65 74 75 72 6e 20 63 6c 6f 6e 65 3b 0a 09 7d 2c  eturn clone;..},
28950 0a 0a 09 63 6c 65 61 6e 44 61 74 61 3a 20 66 75  ...cleanData: fu
28960 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 73 20 29 20  nction( elems ) 
28970 7b 0a 09 09 76 61 72 20 64 61 74 61 2c 20 65 6c  {...var data, el
28980 65 6d 2c 20 74 79 70 65 2c 0a 09 09 09 73 70 65  em, type,....spe
28990 63 69 61 6c 20 3d 20 6a 51 75 65 72 79 2e 65 76  cial = jQuery.ev
289a0 65 6e 74 2e 73 70 65 63 69 61 6c 2c 0a 09 09 09  ent.special,....
289b0 69 20 3d 20 30 3b 0a 0a 09 09 66 6f 72 20 28 20  i = 0;....for ( 
289c0 3b 20 28 20 65 6c 65 6d 20 3d 20 65 6c 65 6d 73  ; ( elem = elems
289d0 5b 20 69 20 5d 20 29 20 21 3d 3d 20 75 6e 64 65  [ i ] ) !== unde
289e0 66 69 6e 65 64 3b 20 69 2b 2b 20 29 20 7b 0a 09  fined; i++ ) {..
289f0 09 09 69 66 20 28 20 61 63 63 65 70 74 44 61 74  ..if ( acceptDat
28a00 61 28 20 65 6c 65 6d 20 29 20 29 20 7b 0a 09 09  a( elem ) ) {...
28a10 09 09 69 66 20 28 20 28 20 64 61 74 61 20 3d 20  ..if ( ( data = 
28a20 65 6c 65 6d 5b 20 64 61 74 61 50 72 69 76 2e 65  elem[ dataPriv.e
28a30 78 70 61 6e 64 6f 20 5d 20 29 20 29 20 7b 0a 09  xpando ] ) ) {..
28a40 09 09 09 09 69 66 20 28 20 64 61 74 61 2e 65 76  ....if ( data.ev
28a50 65 6e 74 73 20 29 20 7b 0a 09 09 09 09 09 09 66  ents ) {.......f
28a60 6f 72 20 28 20 74 79 70 65 20 69 6e 20 64 61 74  or ( type in dat
28a70 61 2e 65 76 65 6e 74 73 20 29 20 7b 0a 09 09 09  a.events ) {....
28a80 09 09 09 09 69 66 20 28 20 73 70 65 63 69 61 6c  ....if ( special
28a90 5b 20 74 79 70 65 20 5d 20 29 20 7b 0a 09 09 09  [ type ] ) {....
28aa0 09 09 09 09 09 6a 51 75 65 72 79 2e 65 76 65 6e  .....jQuery.even
28ab0 74 2e 72 65 6d 6f 76 65 28 20 65 6c 65 6d 2c 20  t.remove( elem, 
28ac0 74 79 70 65 20 29 3b 0a 0a 09 09 09 09 09 09 09  type );.........
28ad0 2f 2f 20 54 68 69 73 20 69 73 20 61 20 73 68 6f  // This is a sho
28ae0 72 74 63 75 74 20 74 6f 20 61 76 6f 69 64 20 6a  rtcut to avoid j
28af0 51 75 65 72 79 2e 65 76 65 6e 74 2e 72 65 6d 6f  Query.event.remo
28b00 76 65 27 73 20 6f 76 65 72 68 65 61 64 0a 09 09  ve's overhead...
28b10 09 09 09 09 09 7d 20 65 6c 73 65 20 7b 0a 09 09  .....} else {...
28b20 09 09 09 09 09 09 6a 51 75 65 72 79 2e 72 65 6d  ......jQuery.rem
28b30 6f 76 65 45 76 65 6e 74 28 20 65 6c 65 6d 2c 20  oveEvent( elem, 
28b40 74 79 70 65 2c 20 64 61 74 61 2e 68 61 6e 64 6c  type, data.handl
28b50 65 20 29 3b 0a 09 09 09 09 09 09 09 7d 0a 09 09  e );........}...
28b60 09 09 09 09 7d 0a 09 09 09 09 09 7d 0a 0a 09 09  ....}......}....
28b70 09 09 09 2f 2f 20 53 75 70 70 6f 72 74 3a 20 43  ...// Support: C
28b80 68 72 6f 6d 65 20 3c 3d 33 35 20 2d 20 34 35 2b  hrome <=35 - 45+
28b90 0a 09 09 09 09 09 2f 2f 20 41 73 73 69 67 6e 20  ......// Assign 
28ba0 75 6e 64 65 66 69 6e 65 64 20 69 6e 73 74 65 61  undefined instea
28bb0 64 20 6f 66 20 75 73 69 6e 67 20 64 65 6c 65 74  d of using delet
28bc0 65 2c 20 73 65 65 20 44 61 74 61 23 72 65 6d 6f  e, see Data#remo
28bd0 76 65 0a 09 09 09 09 09 65 6c 65 6d 5b 20 64 61  ve......elem[ da
28be0 74 61 50 72 69 76 2e 65 78 70 61 6e 64 6f 20 5d  taPriv.expando ]
28bf0 20 3d 20 75 6e 64 65 66 69 6e 65 64 3b 0a 09 09   = undefined;...
28c00 09 09 7d 0a 09 09 09 09 69 66 20 28 20 65 6c 65  ..}.....if ( ele
28c10 6d 5b 20 64 61 74 61 55 73 65 72 2e 65 78 70 61  m[ dataUser.expa
28c20 6e 64 6f 20 5d 20 29 20 7b 0a 0a 09 09 09 09 09  ndo ] ) {.......
28c30 2f 2f 20 53 75 70 70 6f 72 74 3a 20 43 68 72 6f  // Support: Chro
28c40 6d 65 20 3c 3d 33 35 20 2d 20 34 35 2b 0a 09 09  me <=35 - 45+...
28c50 09 09 09 2f 2f 20 41 73 73 69 67 6e 20 75 6e 64  ...// Assign und
28c60 65 66 69 6e 65 64 20 69 6e 73 74 65 61 64 20 6f  efined instead o
28c70 66 20 75 73 69 6e 67 20 64 65 6c 65 74 65 2c 20  f using delete, 
28c80 73 65 65 20 44 61 74 61 23 72 65 6d 6f 76 65 0a  see Data#remove.
28c90 09 09 09 09 09 65 6c 65 6d 5b 20 64 61 74 61 55  .....elem[ dataU
28ca0 73 65 72 2e 65 78 70 61 6e 64 6f 20 5d 20 3d 20  ser.expando ] = 
28cb0 75 6e 64 65 66 69 6e 65 64 3b 0a 09 09 09 09 7d  undefined;.....}
28cc0 0a 09 09 09 7d 0a 09 09 7d 0a 09 7d 0a 7d 20 29  ....}...}..}.} )
28cd0 3b 0a 0a 6a 51 75 65 72 79 2e 66 6e 2e 65 78 74  ;..jQuery.fn.ext
28ce0 65 6e 64 28 20 7b 0a 09 64 65 74 61 63 68 3a 20  end( {..detach: 
28cf0 66 75 6e 63 74 69 6f 6e 28 20 73 65 6c 65 63 74  function( select
28d00 6f 72 20 29 20 7b 0a 09 09 72 65 74 75 72 6e 20  or ) {...return 
28d10 72 65 6d 6f 76 65 28 20 74 68 69 73 2c 20 73 65  remove( this, se
28d20 6c 65 63 74 6f 72 2c 20 74 72 75 65 20 29 3b 0a  lector, true );.
28d30 09 7d 2c 0a 0a 09 72 65 6d 6f 76 65 3a 20 66 75  .},...remove: fu
28d40 6e 63 74 69 6f 6e 28 20 73 65 6c 65 63 74 6f 72  nction( selector
28d50 20 29 20 7b 0a 09 09 72 65 74 75 72 6e 20 72 65   ) {...return re
28d60 6d 6f 76 65 28 20 74 68 69 73 2c 20 73 65 6c 65  move( this, sele
28d70 63 74 6f 72 20 29 3b 0a 09 7d 2c 0a 0a 09 74 65  ctor );..},...te
28d80 78 74 3a 20 66 75 6e 63 74 69 6f 6e 28 20 76 61  xt: function( va
28d90 6c 75 65 20 29 20 7b 0a 09 09 72 65 74 75 72 6e  lue ) {...return
28da0 20 61 63 63 65 73 73 28 20 74 68 69 73 2c 20 66   access( this, f
28db0 75 6e 63 74 69 6f 6e 28 20 76 61 6c 75 65 20 29  unction( value )
28dc0 20 7b 0a 09 09 09 72 65 74 75 72 6e 20 76 61 6c   {....return val
28dd0 75 65 20 3d 3d 3d 20 75 6e 64 65 66 69 6e 65 64  ue === undefined
28de0 20 3f 0a 09 09 09 09 6a 51 75 65 72 79 2e 74 65   ?.....jQuery.te
28df0 78 74 28 20 74 68 69 73 20 29 20 3a 0a 09 09 09  xt( this ) :....
28e00 09 74 68 69 73 2e 65 6d 70 74 79 28 29 2e 65 61  .this.empty().ea
28e10 63 68 28 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b  ch( function() {
28e20 0a 09 09 09 09 09 69 66 20 28 20 74 68 69 73 2e  ......if ( this.
28e30 6e 6f 64 65 54 79 70 65 20 3d 3d 3d 20 31 20 7c  nodeType === 1 |
28e40 7c 20 74 68 69 73 2e 6e 6f 64 65 54 79 70 65 20  | this.nodeType 
28e50 3d 3d 3d 20 31 31 20 7c 7c 20 74 68 69 73 2e 6e  === 11 || this.n
28e60 6f 64 65 54 79 70 65 20 3d 3d 3d 20 39 20 29 20  odeType === 9 ) 
28e70 7b 0a 09 09 09 09 09 09 74 68 69 73 2e 74 65 78  {.......this.tex
28e80 74 43 6f 6e 74 65 6e 74 20 3d 20 76 61 6c 75 65  tContent = value
28e90 3b 0a 09 09 09 09 09 7d 0a 09 09 09 09 7d 20 29  ;......}.....} )
28ea0 3b 0a 09 09 7d 2c 20 6e 75 6c 6c 2c 20 76 61 6c  ;...}, null, val
28eb0 75 65 2c 20 61 72 67 75 6d 65 6e 74 73 2e 6c 65  ue, arguments.le
28ec0 6e 67 74 68 20 29 3b 0a 09 7d 2c 0a 0a 09 61 70  ngth );..},...ap
28ed0 70 65 6e 64 3a 20 66 75 6e 63 74 69 6f 6e 28 29  pend: function()
28ee0 20 7b 0a 09 09 72 65 74 75 72 6e 20 64 6f 6d 4d   {...return domM
28ef0 61 6e 69 70 28 20 74 68 69 73 2c 20 61 72 67 75  anip( this, argu
28f00 6d 65 6e 74 73 2c 20 66 75 6e 63 74 69 6f 6e 28  ments, function(
28f10 20 65 6c 65 6d 20 29 20 7b 0a 09 09 09 69 66 20   elem ) {....if 
28f20 28 20 74 68 69 73 2e 6e 6f 64 65 54 79 70 65 20  ( this.nodeType 
28f30 3d 3d 3d 20 31 20 7c 7c 20 74 68 69 73 2e 6e 6f  === 1 || this.no
28f40 64 65 54 79 70 65 20 3d 3d 3d 20 31 31 20 7c 7c  deType === 11 ||
28f50 20 74 68 69 73 2e 6e 6f 64 65 54 79 70 65 20 3d   this.nodeType =
28f60 3d 3d 20 39 20 29 20 7b 0a 09 09 09 09 76 61 72  == 9 ) {.....var
28f70 20 74 61 72 67 65 74 20 3d 20 6d 61 6e 69 70 75   target = manipu
28f80 6c 61 74 69 6f 6e 54 61 72 67 65 74 28 20 74 68  lationTarget( th
28f90 69 73 2c 20 65 6c 65 6d 20 29 3b 0a 09 09 09 09  is, elem );.....
28fa0 74 61 72 67 65 74 2e 61 70 70 65 6e 64 43 68 69  target.appendChi
28fb0 6c 64 28 20 65 6c 65 6d 20 29 3b 0a 09 09 09 7d  ld( elem );....}
28fc0 0a 09 09 7d 20 29 3b 0a 09 7d 2c 0a 0a 09 70 72  ...} );..},...pr
28fd0 65 70 65 6e 64 3a 20 66 75 6e 63 74 69 6f 6e 28  epend: function(
28fe0 29 20 7b 0a 09 09 72 65 74 75 72 6e 20 64 6f 6d  ) {...return dom
28ff0 4d 61 6e 69 70 28 20 74 68 69 73 2c 20 61 72 67  Manip( this, arg
29000 75 6d 65 6e 74 73 2c 20 66 75 6e 63 74 69 6f 6e  uments, function
29010 28 20 65 6c 65 6d 20 29 20 7b 0a 09 09 09 69 66  ( elem ) {....if
29020 20 28 20 74 68 69 73 2e 6e 6f 64 65 54 79 70 65   ( this.nodeType
29030 20 3d 3d 3d 20 31 20 7c 7c 20 74 68 69 73 2e 6e   === 1 || this.n
29040 6f 64 65 54 79 70 65 20 3d 3d 3d 20 31 31 20 7c  odeType === 11 |
29050 7c 20 74 68 69 73 2e 6e 6f 64 65 54 79 70 65 20  | this.nodeType 
29060 3d 3d 3d 20 39 20 29 20 7b 0a 09 09 09 09 76 61  === 9 ) {.....va
29070 72 20 74 61 72 67 65 74 20 3d 20 6d 61 6e 69 70  r target = manip
29080 75 6c 61 74 69 6f 6e 54 61 72 67 65 74 28 20 74  ulationTarget( t
29090 68 69 73 2c 20 65 6c 65 6d 20 29 3b 0a 09 09 09  his, elem );....
290a0 09 74 61 72 67 65 74 2e 69 6e 73 65 72 74 42 65  .target.insertBe
290b0 66 6f 72 65 28 20 65 6c 65 6d 2c 20 74 61 72 67  fore( elem, targ
290c0 65 74 2e 66 69 72 73 74 43 68 69 6c 64 20 29 3b  et.firstChild );
290d0 0a 09 09 09 7d 0a 09 09 7d 20 29 3b 0a 09 7d 2c  ....}...} );..},
290e0 0a 0a 09 62 65 66 6f 72 65 3a 20 66 75 6e 63 74  ...before: funct
290f0 69 6f 6e 28 29 20 7b 0a 09 09 72 65 74 75 72 6e  ion() {...return
29100 20 64 6f 6d 4d 61 6e 69 70 28 20 74 68 69 73 2c   domManip( this,
29110 20 61 72 67 75 6d 65 6e 74 73 2c 20 66 75 6e 63   arguments, func
29120 74 69 6f 6e 28 20 65 6c 65 6d 20 29 20 7b 0a 09  tion( elem ) {..
29130 09 09 69 66 20 28 20 74 68 69 73 2e 70 61 72 65  ..if ( this.pare
29140 6e 74 4e 6f 64 65 20 29 20 7b 0a 09 09 09 09 74  ntNode ) {.....t
29150 68 69 73 2e 70 61 72 65 6e 74 4e 6f 64 65 2e 69  his.parentNode.i
29160 6e 73 65 72 74 42 65 66 6f 72 65 28 20 65 6c 65  nsertBefore( ele
29170 6d 2c 20 74 68 69 73 20 29 3b 0a 09 09 09 7d 0a  m, this );....}.
29180 09 09 7d 20 29 3b 0a 09 7d 2c 0a 0a 09 61 66 74  ..} );..},...aft
29190 65 72 3a 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b  er: function() {
291a0 0a 09 09 72 65 74 75 72 6e 20 64 6f 6d 4d 61 6e  ...return domMan
291b0 69 70 28 20 74 68 69 73 2c 20 61 72 67 75 6d 65  ip( this, argume
291c0 6e 74 73 2c 20 66 75 6e 63 74 69 6f 6e 28 20 65  nts, function( e
291d0 6c 65 6d 20 29 20 7b 0a 09 09 09 69 66 20 28 20  lem ) {....if ( 
291e0 74 68 69 73 2e 70 61 72 65 6e 74 4e 6f 64 65 20  this.parentNode 
291f0 29 20 7b 0a 09 09 09 09 74 68 69 73 2e 70 61 72  ) {.....this.par
29200 65 6e 74 4e 6f 64 65 2e 69 6e 73 65 72 74 42 65  entNode.insertBe
29210 66 6f 72 65 28 20 65 6c 65 6d 2c 20 74 68 69 73  fore( elem, this
29220 2e 6e 65 78 74 53 69 62 6c 69 6e 67 20 29 3b 0a  .nextSibling );.
29230 09 09 09 7d 0a 09 09 7d 20 29 3b 0a 09 7d 2c 0a  ...}...} );..},.
29240 0a 09 65 6d 70 74 79 3a 20 66 75 6e 63 74 69 6f  ..empty: functio
29250 6e 28 29 20 7b 0a 09 09 76 61 72 20 65 6c 65 6d  n() {...var elem
29260 2c 0a 09 09 09 69 20 3d 20 30 3b 0a 0a 09 09 66  ,....i = 0;....f
29270 6f 72 20 28 20 3b 20 28 20 65 6c 65 6d 20 3d 20  or ( ; ( elem = 
29280 74 68 69 73 5b 20 69 20 5d 20 29 20 21 3d 20 6e  this[ i ] ) != n
29290 75 6c 6c 3b 20 69 2b 2b 20 29 20 7b 0a 09 09 09  ull; i++ ) {....
292a0 69 66 20 28 20 65 6c 65 6d 2e 6e 6f 64 65 54 79  if ( elem.nodeTy
292b0 70 65 20 3d 3d 3d 20 31 20 29 20 7b 0a 0a 09 09  pe === 1 ) {....
292c0 09 09 2f 2f 20 50 72 65 76 65 6e 74 20 6d 65 6d  ..// Prevent mem
292d0 6f 72 79 20 6c 65 61 6b 73 0a 09 09 09 09 6a 51  ory leaks.....jQ
292e0 75 65 72 79 2e 63 6c 65 61 6e 44 61 74 61 28 20  uery.cleanData( 
292f0 67 65 74 41 6c 6c 28 20 65 6c 65 6d 2c 20 66 61  getAll( elem, fa
29300 6c 73 65 20 29 20 29 3b 0a 0a 09 09 09 09 2f 2f  lse ) );......//
29310 20 52 65 6d 6f 76 65 20 61 6e 79 20 72 65 6d 61   Remove any rema
29320 69 6e 69 6e 67 20 6e 6f 64 65 73 0a 09 09 09 09  ining nodes.....
29330 65 6c 65 6d 2e 74 65 78 74 43 6f 6e 74 65 6e 74  elem.textContent
29340 20 3d 20 22 22 3b 0a 09 09 09 7d 0a 09 09 7d 0a   = "";....}...}.
29350 0a 09 09 72 65 74 75 72 6e 20 74 68 69 73 3b 0a  ...return this;.
29360 09 7d 2c 0a 0a 09 63 6c 6f 6e 65 3a 20 66 75 6e  .},...clone: fun
29370 63 74 69 6f 6e 28 20 64 61 74 61 41 6e 64 45 76  ction( dataAndEv
29380 65 6e 74 73 2c 20 64 65 65 70 44 61 74 61 41 6e  ents, deepDataAn
29390 64 45 76 65 6e 74 73 20 29 20 7b 0a 09 09 64 61  dEvents ) {...da
293a0 74 61 41 6e 64 45 76 65 6e 74 73 20 3d 20 64 61  taAndEvents = da
293b0 74 61 41 6e 64 45 76 65 6e 74 73 20 3d 3d 20 6e  taAndEvents == n
293c0 75 6c 6c 20 3f 20 66 61 6c 73 65 20 3a 20 64 61  ull ? false : da
293d0 74 61 41 6e 64 45 76 65 6e 74 73 3b 0a 09 09 64  taAndEvents;...d
293e0 65 65 70 44 61 74 61 41 6e 64 45 76 65 6e 74 73  eepDataAndEvents
293f0 20 3d 20 64 65 65 70 44 61 74 61 41 6e 64 45 76   = deepDataAndEv
29400 65 6e 74 73 20 3d 3d 20 6e 75 6c 6c 20 3f 20 64  ents == null ? d
29410 61 74 61 41 6e 64 45 76 65 6e 74 73 20 3a 20 64  ataAndEvents : d
29420 65 65 70 44 61 74 61 41 6e 64 45 76 65 6e 74 73  eepDataAndEvents
29430 3b 0a 0a 09 09 72 65 74 75 72 6e 20 74 68 69 73  ;....return this
29440 2e 6d 61 70 28 20 66 75 6e 63 74 69 6f 6e 28 29  .map( function()
29450 20 7b 0a 09 09 09 72 65 74 75 72 6e 20 6a 51 75   {....return jQu
29460 65 72 79 2e 63 6c 6f 6e 65 28 20 74 68 69 73 2c  ery.clone( this,
29470 20 64 61 74 61 41 6e 64 45 76 65 6e 74 73 2c 20   dataAndEvents, 
29480 64 65 65 70 44 61 74 61 41 6e 64 45 76 65 6e 74  deepDataAndEvent
29490 73 20 29 3b 0a 09 09 7d 20 29 3b 0a 09 7d 2c 0a  s );...} );..},.
294a0 0a 09 68 74 6d 6c 3a 20 66 75 6e 63 74 69 6f 6e  ..html: function
294b0 28 20 76 61 6c 75 65 20 29 20 7b 0a 09 09 72 65  ( value ) {...re
294c0 74 75 72 6e 20 61 63 63 65 73 73 28 20 74 68 69  turn access( thi
294d0 73 2c 20 66 75 6e 63 74 69 6f 6e 28 20 76 61 6c  s, function( val
294e0 75 65 20 29 20 7b 0a 09 09 09 76 61 72 20 65 6c  ue ) {....var el
294f0 65 6d 20 3d 20 74 68 69 73 5b 20 30 20 5d 20 7c  em = this[ 0 ] |
29500 7c 20 7b 7d 2c 0a 09 09 09 09 69 20 3d 20 30 2c  | {},.....i = 0,
29510 0a 09 09 09 09 6c 20 3d 20 74 68 69 73 2e 6c 65  .....l = this.le
29520 6e 67 74 68 3b 0a 0a 09 09 09 69 66 20 28 20 76  ngth;.....if ( v
29530 61 6c 75 65 20 3d 3d 3d 20 75 6e 64 65 66 69 6e  alue === undefin
29540 65 64 20 26 26 20 65 6c 65 6d 2e 6e 6f 64 65 54  ed && elem.nodeT
29550 79 70 65 20 3d 3d 3d 20 31 20 29 20 7b 0a 09 09  ype === 1 ) {...
29560 09 09 72 65 74 75 72 6e 20 65 6c 65 6d 2e 69 6e  ..return elem.in
29570 6e 65 72 48 54 4d 4c 3b 0a 09 09 09 7d 0a 0a 09  nerHTML;....}...
29580 09 09 2f 2f 20 53 65 65 20 69 66 20 77 65 20 63  ..// See if we c
29590 61 6e 20 74 61 6b 65 20 61 20 73 68 6f 72 74 63  an take a shortc
295a0 75 74 20 61 6e 64 20 6a 75 73 74 20 75 73 65 20  ut and just use 
295b0 69 6e 6e 65 72 48 54 4d 4c 0a 09 09 09 69 66 20  innerHTML....if 
295c0 28 20 74 79 70 65 6f 66 20 76 61 6c 75 65 20 3d  ( typeof value =
295d0 3d 3d 20 22 73 74 72 69 6e 67 22 20 26 26 20 21  == "string" && !
295e0 72 6e 6f 49 6e 6e 65 72 68 74 6d 6c 2e 74 65 73  rnoInnerhtml.tes
295f0 74 28 20 76 61 6c 75 65 20 29 20 26 26 0a 09 09  t( value ) &&...
29600 09 09 21 77 72 61 70 4d 61 70 5b 20 28 20 72 74  ..!wrapMap[ ( rt
29610 61 67 4e 61 6d 65 2e 65 78 65 63 28 20 76 61 6c  agName.exec( val
29620 75 65 20 29 20 7c 7c 20 5b 20 22 22 2c 20 22 22  ue ) || [ "", ""
29630 20 5d 20 29 5b 20 31 20 5d 2e 74 6f 4c 6f 77 65   ] )[ 1 ].toLowe
29640 72 43 61 73 65 28 29 20 5d 20 29 20 7b 0a 0a 09  rCase() ] ) {...
29650 09 09 09 76 61 6c 75 65 20 3d 20 6a 51 75 65 72  ...value = jQuer
29660 79 2e 68 74 6d 6c 50 72 65 66 69 6c 74 65 72 28  y.htmlPrefilter(
29670 20 76 61 6c 75 65 20 29 3b 0a 0a 09 09 09 09 74   value );......t
29680 72 79 20 7b 0a 09 09 09 09 09 66 6f 72 20 28 20  ry {......for ( 
29690 3b 20 69 20 3c 20 6c 3b 20 69 2b 2b 20 29 20 7b  ; i < l; i++ ) {
296a0 0a 09 09 09 09 09 09 65 6c 65 6d 20 3d 20 74 68  .......elem = th
296b0 69 73 5b 20 69 20 5d 20 7c 7c 20 7b 7d 3b 0a 0a  is[ i ] || {};..
296c0 09 09 09 09 09 09 2f 2f 20 52 65 6d 6f 76 65 20  ......// Remove 
296d0 65 6c 65 6d 65 6e 74 20 6e 6f 64 65 73 20 61 6e  element nodes an
296e0 64 20 70 72 65 76 65 6e 74 20 6d 65 6d 6f 72 79  d prevent memory
296f0 20 6c 65 61 6b 73 0a 09 09 09 09 09 09 69 66 20   leaks.......if 
29700 28 20 65 6c 65 6d 2e 6e 6f 64 65 54 79 70 65 20  ( elem.nodeType 
29710 3d 3d 3d 20 31 20 29 20 7b 0a 09 09 09 09 09 09  === 1 ) {.......
29720 09 6a 51 75 65 72 79 2e 63 6c 65 61 6e 44 61 74  .jQuery.cleanDat
29730 61 28 20 67 65 74 41 6c 6c 28 20 65 6c 65 6d 2c  a( getAll( elem,
29740 20 66 61 6c 73 65 20 29 20 29 3b 0a 09 09 09 09   false ) );.....
29750 09 09 09 65 6c 65 6d 2e 69 6e 6e 65 72 48 54 4d  ...elem.innerHTM
29760 4c 20 3d 20 76 61 6c 75 65 3b 0a 09 09 09 09 09  L = value;......
29770 09 7d 0a 09 09 09 09 09 7d 0a 0a 09 09 09 09 09  .}......}.......
29780 65 6c 65 6d 20 3d 20 30 3b 0a 0a 09 09 09 09 2f  elem = 0;....../
29790 2f 20 49 66 20 75 73 69 6e 67 20 69 6e 6e 65 72  / If using inner
297a0 48 54 4d 4c 20 74 68 72 6f 77 73 20 61 6e 20 65  HTML throws an e
297b0 78 63 65 70 74 69 6f 6e 2c 20 75 73 65 20 74 68  xception, use th
297c0 65 20 66 61 6c 6c 62 61 63 6b 20 6d 65 74 68 6f  e fallback metho
297d0 64 0a 09 09 09 09 7d 20 63 61 74 63 68 20 28 20  d.....} catch ( 
297e0 65 20 29 20 7b 7d 0a 09 09 09 7d 0a 0a 09 09 09  e ) {}....}.....
297f0 69 66 20 28 20 65 6c 65 6d 20 29 20 7b 0a 09 09  if ( elem ) {...
29800 09 09 74 68 69 73 2e 65 6d 70 74 79 28 29 2e 61  ..this.empty().a
29810 70 70 65 6e 64 28 20 76 61 6c 75 65 20 29 3b 0a  ppend( value );.
29820 09 09 09 7d 0a 09 09 7d 2c 20 6e 75 6c 6c 2c 20  ...}...}, null, 
29830 76 61 6c 75 65 2c 20 61 72 67 75 6d 65 6e 74 73  value, arguments
29840 2e 6c 65 6e 67 74 68 20 29 3b 0a 09 7d 2c 0a 0a  .length );..},..
29850 09 72 65 70 6c 61 63 65 57 69 74 68 3a 20 66 75  .replaceWith: fu
29860 6e 63 74 69 6f 6e 28 29 20 7b 0a 09 09 76 61 72  nction() {...var
29870 20 69 67 6e 6f 72 65 64 20 3d 20 5b 5d 3b 0a 0a   ignored = [];..
29880 09 09 2f 2f 20 4d 61 6b 65 20 74 68 65 20 63 68  ..// Make the ch
29890 61 6e 67 65 73 2c 20 72 65 70 6c 61 63 69 6e 67  anges, replacing
298a0 20 65 61 63 68 20 6e 6f 6e 2d 69 67 6e 6f 72 65   each non-ignore
298b0 64 20 63 6f 6e 74 65 78 74 20 65 6c 65 6d 65 6e  d context elemen
298c0 74 20 77 69 74 68 20 74 68 65 20 6e 65 77 20 63  t with the new c
298d0 6f 6e 74 65 6e 74 0a 09 09 72 65 74 75 72 6e 20  ontent...return 
298e0 64 6f 6d 4d 61 6e 69 70 28 20 74 68 69 73 2c 20  domManip( this, 
298f0 61 72 67 75 6d 65 6e 74 73 2c 20 66 75 6e 63 74  arguments, funct
29900 69 6f 6e 28 20 65 6c 65 6d 20 29 20 7b 0a 09 09  ion( elem ) {...
29910 09 76 61 72 20 70 61 72 65 6e 74 20 3d 20 74 68  .var parent = th
29920 69 73 2e 70 61 72 65 6e 74 4e 6f 64 65 3b 0a 0a  is.parentNode;..
29930 09 09 09 69 66 20 28 20 6a 51 75 65 72 79 2e 69  ...if ( jQuery.i
29940 6e 41 72 72 61 79 28 20 74 68 69 73 2c 20 69 67  nArray( this, ig
29950 6e 6f 72 65 64 20 29 20 3c 20 30 20 29 20 7b 0a  nored ) < 0 ) {.
29960 09 09 09 09 6a 51 75 65 72 79 2e 63 6c 65 61 6e  ....jQuery.clean
29970 44 61 74 61 28 20 67 65 74 41 6c 6c 28 20 74 68  Data( getAll( th
29980 69 73 20 29 20 29 3b 0a 09 09 09 09 69 66 20 28  is ) );.....if (
29990 20 70 61 72 65 6e 74 20 29 20 7b 0a 09 09 09 09   parent ) {.....
299a0 09 70 61 72 65 6e 74 2e 72 65 70 6c 61 63 65 43  .parent.replaceC
299b0 68 69 6c 64 28 20 65 6c 65 6d 2c 20 74 68 69 73  hild( elem, this
299c0 20 29 3b 0a 09 09 09 09 7d 0a 09 09 09 7d 0a 0a   );.....}....}..
299d0 09 09 2f 2f 20 46 6f 72 63 65 20 63 61 6c 6c 62  ..// Force callb
299e0 61 63 6b 20 69 6e 76 6f 63 61 74 69 6f 6e 0a 09  ack invocation..
299f0 09 7d 2c 20 69 67 6e 6f 72 65 64 20 29 3b 0a 09  .}, ignored );..
29a00 7d 0a 7d 20 29 3b 0a 0a 6a 51 75 65 72 79 2e 65  }.} );..jQuery.e
29a10 61 63 68 28 20 7b 0a 09 61 70 70 65 6e 64 54 6f  ach( {..appendTo
29a20 3a 20 22 61 70 70 65 6e 64 22 2c 0a 09 70 72 65  : "append",..pre
29a30 70 65 6e 64 54 6f 3a 20 22 70 72 65 70 65 6e 64  pendTo: "prepend
29a40 22 2c 0a 09 69 6e 73 65 72 74 42 65 66 6f 72 65  ",..insertBefore
29a50 3a 20 22 62 65 66 6f 72 65 22 2c 0a 09 69 6e 73  : "before",..ins
29a60 65 72 74 41 66 74 65 72 3a 20 22 61 66 74 65 72  ertAfter: "after
29a70 22 2c 0a 09 72 65 70 6c 61 63 65 41 6c 6c 3a 20  ",..replaceAll: 
29a80 22 72 65 70 6c 61 63 65 57 69 74 68 22 0a 7d 2c  "replaceWith".},
29a90 20 66 75 6e 63 74 69 6f 6e 28 20 6e 61 6d 65 2c   function( name,
29aa0 20 6f 72 69 67 69 6e 61 6c 20 29 20 7b 0a 09 6a   original ) {..j
29ab0 51 75 65 72 79 2e 66 6e 5b 20 6e 61 6d 65 20 5d  Query.fn[ name ]
29ac0 20 3d 20 66 75 6e 63 74 69 6f 6e 28 20 73 65 6c   = function( sel
29ad0 65 63 74 6f 72 20 29 20 7b 0a 09 09 76 61 72 20  ector ) {...var 
29ae0 65 6c 65 6d 73 2c 0a 09 09 09 72 65 74 20 3d 20  elems,....ret = 
29af0 5b 5d 2c 0a 09 09 09 69 6e 73 65 72 74 20 3d 20  [],....insert = 
29b00 6a 51 75 65 72 79 28 20 73 65 6c 65 63 74 6f 72  jQuery( selector
29b10 20 29 2c 0a 09 09 09 6c 61 73 74 20 3d 20 69 6e   ),....last = in
29b20 73 65 72 74 2e 6c 65 6e 67 74 68 20 2d 20 31 2c  sert.length - 1,
29b30 0a 09 09 09 69 20 3d 20 30 3b 0a 0a 09 09 66 6f  ....i = 0;....fo
29b40 72 20 28 20 3b 20 69 20 3c 3d 20 6c 61 73 74 3b  r ( ; i <= last;
29b50 20 69 2b 2b 20 29 20 7b 0a 09 09 09 65 6c 65 6d   i++ ) {....elem
29b60 73 20 3d 20 69 20 3d 3d 3d 20 6c 61 73 74 20 3f  s = i === last ?
29b70 20 74 68 69 73 20 3a 20 74 68 69 73 2e 63 6c 6f   this : this.clo
29b80 6e 65 28 20 74 72 75 65 20 29 3b 0a 09 09 09 6a  ne( true );....j
29b90 51 75 65 72 79 28 20 69 6e 73 65 72 74 5b 20 69  Query( insert[ i
29ba0 20 5d 20 29 5b 20 6f 72 69 67 69 6e 61 6c 20 5d   ] )[ original ]
29bb0 28 20 65 6c 65 6d 73 20 29 3b 0a 0a 09 09 09 2f  ( elems );...../
29bc0 2f 20 53 75 70 70 6f 72 74 3a 20 41 6e 64 72 6f  / Support: Andro
29bd0 69 64 20 3c 3d 34 2e 30 20 6f 6e 6c 79 2c 20 50  id <=4.0 only, P
29be0 68 61 6e 74 6f 6d 4a 53 20 31 20 6f 6e 6c 79 0a  hantomJS 1 only.
29bf0 09 09 09 2f 2f 20 2e 67 65 74 28 29 20 62 65 63  ...// .get() bec
29c00 61 75 73 65 20 70 75 73 68 2e 61 70 70 6c 79 28  ause push.apply(
29c10 5f 2c 20 61 72 72 61 79 6c 69 6b 65 29 20 74 68  _, arraylike) th
29c20 72 6f 77 73 20 6f 6e 20 61 6e 63 69 65 6e 74 20  rows on ancient 
29c30 57 65 62 4b 69 74 0a 09 09 09 70 75 73 68 2e 61  WebKit....push.a
29c40 70 70 6c 79 28 20 72 65 74 2c 20 65 6c 65 6d 73  pply( ret, elems
29c50 2e 67 65 74 28 29 20 29 3b 0a 09 09 7d 0a 0a 09  .get() );...}...
29c60 09 72 65 74 75 72 6e 20 74 68 69 73 2e 70 75 73  .return this.pus
29c70 68 53 74 61 63 6b 28 20 72 65 74 20 29 3b 0a 09  hStack( ret );..
29c80 7d 3b 0a 7d 20 29 3b 0a 76 61 72 20 72 6e 75 6d  };.} );.var rnum
29c90 6e 6f 6e 70 78 20 3d 20 6e 65 77 20 52 65 67 45  nonpx = new RegE
29ca0 78 70 28 20 22 5e 28 22 20 2b 20 70 6e 75 6d 20  xp( "^(" + pnum 
29cb0 2b 20 22 29 28 3f 21 70 78 29 5b 61 2d 7a 25 5d  + ")(?!px)[a-z%]
29cc0 2b 24 22 2c 20 22 69 22 20 29 3b 0a 0a 76 61 72  +$", "i" );..var
29cd0 20 67 65 74 53 74 79 6c 65 73 20 3d 20 66 75 6e   getStyles = fun
29ce0 63 74 69 6f 6e 28 20 65 6c 65 6d 20 29 20 7b 0a  ction( elem ) {.
29cf0 0a 09 09 2f 2f 20 53 75 70 70 6f 72 74 3a 20 49  ...// Support: I
29d00 45 20 3c 3d 31 31 20 6f 6e 6c 79 2c 20 46 69 72  E <=11 only, Fir
29d10 65 66 6f 78 20 3c 3d 33 30 20 28 23 31 35 30 39  efox <=30 (#1509
29d20 38 2c 20 23 31 34 31 35 30 29 0a 09 09 2f 2f 20  8, #14150)...// 
29d30 49 45 20 74 68 72 6f 77 73 20 6f 6e 20 65 6c 65  IE throws on ele
29d40 6d 65 6e 74 73 20 63 72 65 61 74 65 64 20 69 6e  ments created in
29d50 20 70 6f 70 75 70 73 0a 09 09 2f 2f 20 46 46 20   popups...// FF 
29d60 6d 65 61 6e 77 68 69 6c 65 20 74 68 72 6f 77 73  meanwhile throws
29d70 20 6f 6e 20 66 72 61 6d 65 20 65 6c 65 6d 65 6e   on frame elemen
29d80 74 73 20 74 68 72 6f 75 67 68 20 22 64 65 66 61  ts through "defa
29d90 75 6c 74 56 69 65 77 2e 67 65 74 43 6f 6d 70 75  ultView.getCompu
29da0 74 65 64 53 74 79 6c 65 22 0a 09 09 76 61 72 20  tedStyle"...var 
29db0 76 69 65 77 20 3d 20 65 6c 65 6d 2e 6f 77 6e 65  view = elem.owne
29dc0 72 44 6f 63 75 6d 65 6e 74 2e 64 65 66 61 75 6c  rDocument.defaul
29dd0 74 56 69 65 77 3b 0a 0a 09 09 69 66 20 28 20 21  tView;....if ( !
29de0 76 69 65 77 20 7c 7c 20 21 76 69 65 77 2e 6f 70  view || !view.op
29df0 65 6e 65 72 20 29 20 7b 0a 09 09 09 76 69 65 77  ener ) {....view
29e00 20 3d 20 77 69 6e 64 6f 77 3b 0a 09 09 7d 0a 0a   = window;...}..
29e10 09 09 72 65 74 75 72 6e 20 76 69 65 77 2e 67 65  ..return view.ge
29e20 74 43 6f 6d 70 75 74 65 64 53 74 79 6c 65 28 20  tComputedStyle( 
29e30 65 6c 65 6d 20 29 3b 0a 09 7d 3b 0a 0a 76 61 72  elem );..};..var
29e40 20 73 77 61 70 20 3d 20 66 75 6e 63 74 69 6f 6e   swap = function
29e50 28 20 65 6c 65 6d 2c 20 6f 70 74 69 6f 6e 73 2c  ( elem, options,
29e60 20 63 61 6c 6c 62 61 63 6b 20 29 20 7b 0a 09 76   callback ) {..v
29e70 61 72 20 72 65 74 2c 20 6e 61 6d 65 2c 0a 09 09  ar ret, name,...
29e80 6f 6c 64 20 3d 20 7b 7d 3b 0a 0a 09 2f 2f 20 52  old = {};...// R
29e90 65 6d 65 6d 62 65 72 20 74 68 65 20 6f 6c 64 20  emember the old 
29ea0 76 61 6c 75 65 73 2c 20 61 6e 64 20 69 6e 73 65  values, and inse
29eb0 72 74 20 74 68 65 20 6e 65 77 20 6f 6e 65 73 0a  rt the new ones.
29ec0 09 66 6f 72 20 28 20 6e 61 6d 65 20 69 6e 20 6f  .for ( name in o
29ed0 70 74 69 6f 6e 73 20 29 20 7b 0a 09 09 6f 6c 64  ptions ) {...old
29ee0 5b 20 6e 61 6d 65 20 5d 20 3d 20 65 6c 65 6d 2e  [ name ] = elem.
29ef0 73 74 79 6c 65 5b 20 6e 61 6d 65 20 5d 3b 0a 09  style[ name ];..
29f00 09 65 6c 65 6d 2e 73 74 79 6c 65 5b 20 6e 61 6d  .elem.style[ nam
29f10 65 20 5d 20 3d 20 6f 70 74 69 6f 6e 73 5b 20 6e  e ] = options[ n
29f20 61 6d 65 20 5d 3b 0a 09 7d 0a 0a 09 72 65 74 20  ame ];..}...ret 
29f30 3d 20 63 61 6c 6c 62 61 63 6b 2e 63 61 6c 6c 28  = callback.call(
29f40 20 65 6c 65 6d 20 29 3b 0a 0a 09 2f 2f 20 52 65   elem );...// Re
29f50 76 65 72 74 20 74 68 65 20 6f 6c 64 20 76 61 6c  vert the old val
29f60 75 65 73 0a 09 66 6f 72 20 28 20 6e 61 6d 65 20  ues..for ( name 
29f70 69 6e 20 6f 70 74 69 6f 6e 73 20 29 20 7b 0a 09  in options ) {..
29f80 09 65 6c 65 6d 2e 73 74 79 6c 65 5b 20 6e 61 6d  .elem.style[ nam
29f90 65 20 5d 20 3d 20 6f 6c 64 5b 20 6e 61 6d 65 20  e ] = old[ name 
29fa0 5d 3b 0a 09 7d 0a 0a 09 72 65 74 75 72 6e 20 72  ];..}...return r
29fb0 65 74 3b 0a 7d 3b 0a 0a 0a 76 61 72 20 72 62 6f  et;.};...var rbo
29fc0 78 53 74 79 6c 65 20 3d 20 6e 65 77 20 52 65 67  xStyle = new Reg
29fd0 45 78 70 28 20 63 73 73 45 78 70 61 6e 64 2e 6a  Exp( cssExpand.j
29fe0 6f 69 6e 28 20 22 7c 22 20 29 2c 20 22 69 22 20  oin( "|" ), "i" 
29ff0 29 3b 0a 0a 0a 0a 28 20 66 75 6e 63 74 69 6f 6e  );....( function
2a000 28 29 20 7b 0a 0a 09 2f 2f 20 45 78 65 63 75 74  () {...// Execut
2a010 69 6e 67 20 62 6f 74 68 20 70 69 78 65 6c 50 6f  ing both pixelPo
2a020 73 69 74 69 6f 6e 20 26 20 62 6f 78 53 69 7a 69  sition & boxSizi
2a030 6e 67 52 65 6c 69 61 62 6c 65 20 74 65 73 74 73  ngReliable tests
2a040 20 72 65 71 75 69 72 65 20 6f 6e 6c 79 20 6f 6e   require only on
2a050 65 20 6c 61 79 6f 75 74 0a 09 2f 2f 20 73 6f 20  e layout..// so 
2a060 74 68 65 79 27 72 65 20 65 78 65 63 75 74 65 64  they're executed
2a070 20 61 74 20 74 68 65 20 73 61 6d 65 20 74 69 6d   at the same tim
2a080 65 20 74 6f 20 73 61 76 65 20 74 68 65 20 73 65  e to save the se
2a090 63 6f 6e 64 20 63 6f 6d 70 75 74 61 74 69 6f 6e  cond computation
2a0a0 2e 0a 09 66 75 6e 63 74 69 6f 6e 20 63 6f 6d 70  ...function comp
2a0b0 75 74 65 53 74 79 6c 65 54 65 73 74 73 28 29 20  uteStyleTests() 
2a0c0 7b 0a 0a 09 09 2f 2f 20 54 68 69 73 20 69 73 20  {....// This is 
2a0d0 61 20 73 69 6e 67 6c 65 74 6f 6e 2c 20 77 65 20  a singleton, we 
2a0e0 6e 65 65 64 20 74 6f 20 65 78 65 63 75 74 65 20  need to execute 
2a0f0 69 74 20 6f 6e 6c 79 20 6f 6e 63 65 0a 09 09 69  it only once...i
2a100 66 20 28 20 21 64 69 76 20 29 20 7b 0a 09 09 09  f ( !div ) {....
2a110 72 65 74 75 72 6e 3b 0a 09 09 7d 0a 0a 09 09 63  return;...}....c
2a120 6f 6e 74 61 69 6e 65 72 2e 73 74 79 6c 65 2e 63  ontainer.style.c
2a130 73 73 54 65 78 74 20 3d 20 22 70 6f 73 69 74 69  ssText = "positi
2a140 6f 6e 3a 61 62 73 6f 6c 75 74 65 3b 6c 65 66 74  on:absolute;left
2a150 3a 2d 31 31 31 31 31 70 78 3b 77 69 64 74 68 3a  :-11111px;width:
2a160 36 30 70 78 3b 22 20 2b 0a 09 09 09 22 6d 61 72  60px;" +...."mar
2a170 67 69 6e 2d 74 6f 70 3a 31 70 78 3b 70 61 64 64  gin-top:1px;padd
2a180 69 6e 67 3a 30 3b 62 6f 72 64 65 72 3a 30 22 3b  ing:0;border:0";
2a190 0a 09 09 64 69 76 2e 73 74 79 6c 65 2e 63 73 73  ...div.style.css
2a1a0 54 65 78 74 20 3d 0a 09 09 09 22 70 6f 73 69 74  Text =...."posit
2a1b0 69 6f 6e 3a 72 65 6c 61 74 69 76 65 3b 64 69 73  ion:relative;dis
2a1c0 70 6c 61 79 3a 62 6c 6f 63 6b 3b 62 6f 78 2d 73  play:block;box-s
2a1d0 69 7a 69 6e 67 3a 62 6f 72 64 65 72 2d 62 6f 78  izing:border-box
2a1e0 3b 6f 76 65 72 66 6c 6f 77 3a 73 63 72 6f 6c 6c  ;overflow:scroll
2a1f0 3b 22 20 2b 0a 09 09 09 22 6d 61 72 67 69 6e 3a  ;" +...."margin:
2a200 61 75 74 6f 3b 62 6f 72 64 65 72 3a 31 70 78 3b  auto;border:1px;
2a210 70 61 64 64 69 6e 67 3a 31 70 78 3b 22 20 2b 0a  padding:1px;" +.
2a220 09 09 09 22 77 69 64 74 68 3a 36 30 25 3b 74 6f  ..."width:60%;to
2a230 70 3a 31 25 22 3b 0a 09 09 64 6f 63 75 6d 65 6e  p:1%";...documen
2a240 74 45 6c 65 6d 65 6e 74 2e 61 70 70 65 6e 64 43  tElement.appendC
2a250 68 69 6c 64 28 20 63 6f 6e 74 61 69 6e 65 72 20  hild( container 
2a260 29 2e 61 70 70 65 6e 64 43 68 69 6c 64 28 20 64  ).appendChild( d
2a270 69 76 20 29 3b 0a 0a 09 09 76 61 72 20 64 69 76  iv );....var div
2a280 53 74 79 6c 65 20 3d 20 77 69 6e 64 6f 77 2e 67  Style = window.g
2a290 65 74 43 6f 6d 70 75 74 65 64 53 74 79 6c 65 28  etComputedStyle(
2a2a0 20 64 69 76 20 29 3b 0a 09 09 70 69 78 65 6c 50   div );...pixelP
2a2b0 6f 73 69 74 69 6f 6e 56 61 6c 20 3d 20 64 69 76  ositionVal = div
2a2c0 53 74 79 6c 65 2e 74 6f 70 20 21 3d 3d 20 22 31  Style.top !== "1
2a2d0 25 22 3b 0a 0a 09 09 2f 2f 20 53 75 70 70 6f 72  %";....// Suppor
2a2e0 74 3a 20 41 6e 64 72 6f 69 64 20 34 2e 30 20 2d  t: Android 4.0 -
2a2f0 20 34 2e 33 20 6f 6e 6c 79 2c 20 46 69 72 65 66   4.3 only, Firef
2a300 6f 78 20 3c 3d 33 20 2d 20 34 34 0a 09 09 72 65  ox <=3 - 44...re
2a310 6c 69 61 62 6c 65 4d 61 72 67 69 6e 4c 65 66 74  liableMarginLeft
2a320 56 61 6c 20 3d 20 72 6f 75 6e 64 50 69 78 65 6c  Val = roundPixel
2a330 4d 65 61 73 75 72 65 73 28 20 64 69 76 53 74 79  Measures( divSty
2a340 6c 65 2e 6d 61 72 67 69 6e 4c 65 66 74 20 29 20  le.marginLeft ) 
2a350 3d 3d 3d 20 31 32 3b 0a 0a 09 09 2f 2f 20 53 75  === 12;....// Su
2a360 70 70 6f 72 74 3a 20 41 6e 64 72 6f 69 64 20 34  pport: Android 4
2a370 2e 30 20 2d 20 34 2e 33 20 6f 6e 6c 79 2c 20 53  .0 - 4.3 only, S
2a380 61 66 61 72 69 20 3c 3d 39 2e 31 20 2d 20 31 30  afari <=9.1 - 10
2a390 2e 31 2c 20 69 4f 53 20 3c 3d 37 2e 30 20 2d 20  .1, iOS <=7.0 - 
2a3a0 39 2e 33 0a 09 09 2f 2f 20 53 6f 6d 65 20 73 74  9.3...// Some st
2a3b0 79 6c 65 73 20 63 6f 6d 65 20 62 61 63 6b 20 77  yles come back w
2a3c0 69 74 68 20 70 65 72 63 65 6e 74 61 67 65 20 76  ith percentage v
2a3d0 61 6c 75 65 73 2c 20 65 76 65 6e 20 74 68 6f 75  alues, even thou
2a3e0 67 68 20 74 68 65 79 20 73 68 6f 75 6c 64 6e 27  gh they shouldn'
2a3f0 74 0a 09 09 64 69 76 2e 73 74 79 6c 65 2e 72 69  t...div.style.ri
2a400 67 68 74 20 3d 20 22 36 30 25 22 3b 0a 09 09 70  ght = "60%";...p
2a410 69 78 65 6c 42 6f 78 53 74 79 6c 65 73 56 61 6c  ixelBoxStylesVal
2a420 20 3d 20 72 6f 75 6e 64 50 69 78 65 6c 4d 65 61   = roundPixelMea
2a430 73 75 72 65 73 28 20 64 69 76 53 74 79 6c 65 2e  sures( divStyle.
2a440 72 69 67 68 74 20 29 20 3d 3d 3d 20 33 36 3b 0a  right ) === 36;.
2a450 0a 09 09 2f 2f 20 53 75 70 70 6f 72 74 3a 20 49  ...// Support: I
2a460 45 20 39 20 2d 20 31 31 20 6f 6e 6c 79 0a 09 09  E 9 - 11 only...
2a470 2f 2f 20 44 65 74 65 63 74 20 6d 69 73 72 65 70  // Detect misrep
2a480 6f 72 74 69 6e 67 20 6f 66 20 63 6f 6e 74 65 6e  orting of conten
2a490 74 20 64 69 6d 65 6e 73 69 6f 6e 73 20 66 6f 72  t dimensions for
2a4a0 20 62 6f 78 2d 73 69 7a 69 6e 67 3a 62 6f 72 64   box-sizing:bord
2a4b0 65 72 2d 62 6f 78 20 65 6c 65 6d 65 6e 74 73 0a  er-box elements.
2a4c0 09 09 62 6f 78 53 69 7a 69 6e 67 52 65 6c 69 61  ..boxSizingRelia
2a4d0 62 6c 65 56 61 6c 20 3d 20 72 6f 75 6e 64 50 69  bleVal = roundPi
2a4e0 78 65 6c 4d 65 61 73 75 72 65 73 28 20 64 69 76  xelMeasures( div
2a4f0 53 74 79 6c 65 2e 77 69 64 74 68 20 29 20 3d 3d  Style.width ) ==
2a500 3d 20 33 36 3b 0a 0a 09 09 2f 2f 20 53 75 70 70  = 36;....// Supp
2a510 6f 72 74 3a 20 49 45 20 39 20 6f 6e 6c 79 0a 09  ort: IE 9 only..
2a520 09 2f 2f 20 44 65 74 65 63 74 20 6f 76 65 72 66  .// Detect overf
2a530 6c 6f 77 3a 73 63 72 6f 6c 6c 20 73 63 72 65 77  low:scroll screw
2a540 69 6e 65 73 73 20 28 67 68 2d 33 36 39 39 29 0a  iness (gh-3699).
2a550 09 09 2f 2f 20 53 75 70 70 6f 72 74 3a 20 43 68  ..// Support: Ch
2a560 72 6f 6d 65 20 3c 3d 36 34 0a 09 09 2f 2f 20 44  rome <=64...// D
2a570 6f 6e 27 74 20 67 65 74 20 74 72 69 63 6b 65 64  on't get tricked
2a580 20 77 68 65 6e 20 7a 6f 6f 6d 20 61 66 66 65 63   when zoom affec
2a590 74 73 20 6f 66 66 73 65 74 57 69 64 74 68 20 28  ts offsetWidth (
2a5a0 67 68 2d 34 30 32 39 29 0a 09 09 64 69 76 2e 73  gh-4029)...div.s
2a5b0 74 79 6c 65 2e 70 6f 73 69 74 69 6f 6e 20 3d 20  tyle.position = 
2a5c0 22 61 62 73 6f 6c 75 74 65 22 3b 0a 09 09 73 63  "absolute";...sc
2a5d0 72 6f 6c 6c 62 6f 78 53 69 7a 65 56 61 6c 20 3d  rollboxSizeVal =
2a5e0 20 72 6f 75 6e 64 50 69 78 65 6c 4d 65 61 73 75   roundPixelMeasu
2a5f0 72 65 73 28 20 64 69 76 2e 6f 66 66 73 65 74 57  res( div.offsetW
2a600 69 64 74 68 20 2f 20 33 20 29 20 3d 3d 3d 20 31  idth / 3 ) === 1
2a610 32 3b 0a 0a 09 09 64 6f 63 75 6d 65 6e 74 45 6c  2;....documentEl
2a620 65 6d 65 6e 74 2e 72 65 6d 6f 76 65 43 68 69 6c  ement.removeChil
2a630 64 28 20 63 6f 6e 74 61 69 6e 65 72 20 29 3b 0a  d( container );.
2a640 0a 09 09 2f 2f 20 4e 75 6c 6c 69 66 79 20 74 68  ...// Nullify th
2a650 65 20 64 69 76 20 73 6f 20 69 74 20 77 6f 75 6c  e div so it woul
2a660 64 6e 27 74 20 62 65 20 73 74 6f 72 65 64 20 69  dn't be stored i
2a670 6e 20 74 68 65 20 6d 65 6d 6f 72 79 20 61 6e 64  n the memory and
2a680 0a 09 09 2f 2f 20 69 74 20 77 69 6c 6c 20 61 6c  ...// it will al
2a690 73 6f 20 62 65 20 61 20 73 69 67 6e 20 74 68 61  so be a sign tha
2a6a0 74 20 63 68 65 63 6b 73 20 61 6c 72 65 61 64 79  t checks already
2a6b0 20 70 65 72 66 6f 72 6d 65 64 0a 09 09 64 69 76   performed...div
2a6c0 20 3d 20 6e 75 6c 6c 3b 0a 09 7d 0a 0a 09 66 75   = null;..}...fu
2a6d0 6e 63 74 69 6f 6e 20 72 6f 75 6e 64 50 69 78 65  nction roundPixe
2a6e0 6c 4d 65 61 73 75 72 65 73 28 20 6d 65 61 73 75  lMeasures( measu
2a6f0 72 65 20 29 20 7b 0a 09 09 72 65 74 75 72 6e 20  re ) {...return 
2a700 4d 61 74 68 2e 72 6f 75 6e 64 28 20 70 61 72 73  Math.round( pars
2a710 65 46 6c 6f 61 74 28 20 6d 65 61 73 75 72 65 20  eFloat( measure 
2a720 29 20 29 3b 0a 09 7d 0a 0a 09 76 61 72 20 70 69  ) );..}...var pi
2a730 78 65 6c 50 6f 73 69 74 69 6f 6e 56 61 6c 2c 20  xelPositionVal, 
2a740 62 6f 78 53 69 7a 69 6e 67 52 65 6c 69 61 62 6c  boxSizingReliabl
2a750 65 56 61 6c 2c 20 73 63 72 6f 6c 6c 62 6f 78 53  eVal, scrollboxS
2a760 69 7a 65 56 61 6c 2c 20 70 69 78 65 6c 42 6f 78  izeVal, pixelBox
2a770 53 74 79 6c 65 73 56 61 6c 2c 0a 09 09 72 65 6c  StylesVal,...rel
2a780 69 61 62 6c 65 54 72 44 69 6d 65 6e 73 69 6f 6e  iableTrDimension
2a790 73 56 61 6c 2c 20 72 65 6c 69 61 62 6c 65 4d 61  sVal, reliableMa
2a7a0 72 67 69 6e 4c 65 66 74 56 61 6c 2c 0a 09 09 63  rginLeftVal,...c
2a7b0 6f 6e 74 61 69 6e 65 72 20 3d 20 64 6f 63 75 6d  ontainer = docum
2a7c0 65 6e 74 2e 63 72 65 61 74 65 45 6c 65 6d 65 6e  ent.createElemen
2a7d0 74 28 20 22 64 69 76 22 20 29 2c 0a 09 09 64 69  t( "div" ),...di
2a7e0 76 20 3d 20 64 6f 63 75 6d 65 6e 74 2e 63 72 65  v = document.cre
2a7f0 61 74 65 45 6c 65 6d 65 6e 74 28 20 22 64 69 76  ateElement( "div
2a800 22 20 29 3b 0a 0a 09 2f 2f 20 46 69 6e 69 73 68  " );...// Finish
2a810 20 65 61 72 6c 79 20 69 6e 20 6c 69 6d 69 74 65   early in limite
2a820 64 20 28 6e 6f 6e 2d 62 72 6f 77 73 65 72 29 20  d (non-browser) 
2a830 65 6e 76 69 72 6f 6e 6d 65 6e 74 73 0a 09 69 66  environments..if
2a840 20 28 20 21 64 69 76 2e 73 74 79 6c 65 20 29 20   ( !div.style ) 
2a850 7b 0a 09 09 72 65 74 75 72 6e 3b 0a 09 7d 0a 0a  {...return;..}..
2a860 09 2f 2f 20 53 75 70 70 6f 72 74 3a 20 49 45 20  .// Support: IE 
2a870 3c 3d 39 20 2d 20 31 31 20 6f 6e 6c 79 0a 09 2f  <=9 - 11 only../
2a880 2f 20 53 74 79 6c 65 20 6f 66 20 63 6c 6f 6e 65  / Style of clone
2a890 64 20 65 6c 65 6d 65 6e 74 20 61 66 66 65 63 74  d element affect
2a8a0 73 20 73 6f 75 72 63 65 20 65 6c 65 6d 65 6e 74  s source element
2a8b0 20 63 6c 6f 6e 65 64 20 28 23 38 39 30 38 29 0a   cloned (#8908).
2a8c0 09 64 69 76 2e 73 74 79 6c 65 2e 62 61 63 6b 67  .div.style.backg
2a8d0 72 6f 75 6e 64 43 6c 69 70 20 3d 20 22 63 6f 6e  roundClip = "con
2a8e0 74 65 6e 74 2d 62 6f 78 22 3b 0a 09 64 69 76 2e  tent-box";..div.
2a8f0 63 6c 6f 6e 65 4e 6f 64 65 28 20 74 72 75 65 20  cloneNode( true 
2a900 29 2e 73 74 79 6c 65 2e 62 61 63 6b 67 72 6f 75  ).style.backgrou
2a910 6e 64 43 6c 69 70 20 3d 20 22 22 3b 0a 09 73 75  ndClip = "";..su
2a920 70 70 6f 72 74 2e 63 6c 65 61 72 43 6c 6f 6e 65  pport.clearClone
2a930 53 74 79 6c 65 20 3d 20 64 69 76 2e 73 74 79 6c  Style = div.styl
2a940 65 2e 62 61 63 6b 67 72 6f 75 6e 64 43 6c 69 70  e.backgroundClip
2a950 20 3d 3d 3d 20 22 63 6f 6e 74 65 6e 74 2d 62 6f   === "content-bo
2a960 78 22 3b 0a 0a 09 6a 51 75 65 72 79 2e 65 78 74  x";...jQuery.ext
2a970 65 6e 64 28 20 73 75 70 70 6f 72 74 2c 20 7b 0a  end( support, {.
2a980 09 09 62 6f 78 53 69 7a 69 6e 67 52 65 6c 69 61  ..boxSizingRelia
2a990 62 6c 65 3a 20 66 75 6e 63 74 69 6f 6e 28 29 20  ble: function() 
2a9a0 7b 0a 09 09 09 63 6f 6d 70 75 74 65 53 74 79 6c  {....computeStyl
2a9b0 65 54 65 73 74 73 28 29 3b 0a 09 09 09 72 65 74  eTests();....ret
2a9c0 75 72 6e 20 62 6f 78 53 69 7a 69 6e 67 52 65 6c  urn boxSizingRel
2a9d0 69 61 62 6c 65 56 61 6c 3b 0a 09 09 7d 2c 0a 09  iableVal;...},..
2a9e0 09 70 69 78 65 6c 42 6f 78 53 74 79 6c 65 73 3a  .pixelBoxStyles:
2a9f0 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09 09   function() {...
2aa00 09 63 6f 6d 70 75 74 65 53 74 79 6c 65 54 65 73  .computeStyleTes
2aa10 74 73 28 29 3b 0a 09 09 09 72 65 74 75 72 6e 20  ts();....return 
2aa20 70 69 78 65 6c 42 6f 78 53 74 79 6c 65 73 56 61  pixelBoxStylesVa
2aa30 6c 3b 0a 09 09 7d 2c 0a 09 09 70 69 78 65 6c 50  l;...},...pixelP
2aa40 6f 73 69 74 69 6f 6e 3a 20 66 75 6e 63 74 69 6f  osition: functio
2aa50 6e 28 29 20 7b 0a 09 09 09 63 6f 6d 70 75 74 65  n() {....compute
2aa60 53 74 79 6c 65 54 65 73 74 73 28 29 3b 0a 09 09  StyleTests();...
2aa70 09 72 65 74 75 72 6e 20 70 69 78 65 6c 50 6f 73  .return pixelPos
2aa80 69 74 69 6f 6e 56 61 6c 3b 0a 09 09 7d 2c 0a 09  itionVal;...},..
2aa90 09 72 65 6c 69 61 62 6c 65 4d 61 72 67 69 6e 4c  .reliableMarginL
2aaa0 65 66 74 3a 20 66 75 6e 63 74 69 6f 6e 28 29 20  eft: function() 
2aab0 7b 0a 09 09 09 63 6f 6d 70 75 74 65 53 74 79 6c  {....computeStyl
2aac0 65 54 65 73 74 73 28 29 3b 0a 09 09 09 72 65 74  eTests();....ret
2aad0 75 72 6e 20 72 65 6c 69 61 62 6c 65 4d 61 72 67  urn reliableMarg
2aae0 69 6e 4c 65 66 74 56 61 6c 3b 0a 09 09 7d 2c 0a  inLeftVal;...},.
2aaf0 09 09 73 63 72 6f 6c 6c 62 6f 78 53 69 7a 65 3a  ..scrollboxSize:
2ab00 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09 09   function() {...
2ab10 09 63 6f 6d 70 75 74 65 53 74 79 6c 65 54 65 73  .computeStyleTes
2ab20 74 73 28 29 3b 0a 09 09 09 72 65 74 75 72 6e 20  ts();....return 
2ab30 73 63 72 6f 6c 6c 62 6f 78 53 69 7a 65 56 61 6c  scrollboxSizeVal
2ab40 3b 0a 09 09 7d 2c 0a 0a 09 09 2f 2f 20 53 75 70  ;...},....// Sup
2ab50 70 6f 72 74 3a 20 49 45 20 39 20 2d 20 31 31 2b  port: IE 9 - 11+
2ab60 2c 20 45 64 67 65 20 31 35 20 2d 20 31 38 2b 0a  , Edge 15 - 18+.
2ab70 09 09 2f 2f 20 49 45 2f 45 64 67 65 20 6d 69 73  ..// IE/Edge mis
2ab80 72 65 70 6f 72 74 20 60 67 65 74 43 6f 6d 70 75  report `getCompu
2ab90 74 65 64 53 74 79 6c 65 60 20 6f 66 20 74 61 62  tedStyle` of tab
2aba0 6c 65 20 72 6f 77 73 20 77 69 74 68 20 77 69 64  le rows with wid
2abb0 74 68 2f 68 65 69 67 68 74 0a 09 09 2f 2f 20 73  th/height...// s
2abc0 65 74 20 69 6e 20 43 53 53 20 77 68 69 6c 65 20  et in CSS while 
2abd0 60 6f 66 66 73 65 74 2a 60 20 70 72 6f 70 65 72  `offset*` proper
2abe0 74 69 65 73 20 72 65 70 6f 72 74 20 63 6f 72 72  ties report corr
2abf0 65 63 74 20 76 61 6c 75 65 73 2e 0a 09 09 2f 2f  ect values....//
2ac00 20 42 65 68 61 76 69 6f 72 20 69 6e 20 49 45 20   Behavior in IE 
2ac10 39 20 69 73 20 6d 6f 72 65 20 73 75 62 74 6c 65  9 is more subtle
2ac20 20 74 68 61 6e 20 69 6e 20 6e 65 77 65 72 20 76   than in newer v
2ac30 65 72 73 69 6f 6e 73 20 26 20 69 74 20 70 61 73  ersions & it pas
2ac40 73 65 73 0a 09 09 2f 2f 20 73 6f 6d 65 20 76 65  ses...// some ve
2ac50 72 73 69 6f 6e 73 20 6f 66 20 74 68 69 73 20 74  rsions of this t
2ac60 65 73 74 3b 20 6d 61 6b 65 20 73 75 72 65 20 6e  est; make sure n
2ac70 6f 74 20 74 6f 20 6d 61 6b 65 20 69 74 20 70 61  ot to make it pa
2ac80 73 73 20 74 68 65 72 65 21 0a 09 09 72 65 6c 69  ss there!...reli
2ac90 61 62 6c 65 54 72 44 69 6d 65 6e 73 69 6f 6e 73  ableTrDimensions
2aca0 3a 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09  : function() {..
2acb0 09 09 76 61 72 20 74 61 62 6c 65 2c 20 74 72 2c  ..var table, tr,
2acc0 20 74 72 43 68 69 6c 64 2c 20 74 72 53 74 79 6c   trChild, trStyl
2acd0 65 3b 0a 09 09 09 69 66 20 28 20 72 65 6c 69 61  e;....if ( relia
2ace0 62 6c 65 54 72 44 69 6d 65 6e 73 69 6f 6e 73 56  bleTrDimensionsV
2acf0 61 6c 20 3d 3d 20 6e 75 6c 6c 20 29 20 7b 0a 09  al == null ) {..
2ad00 09 09 09 74 61 62 6c 65 20 3d 20 64 6f 63 75 6d  ...table = docum
2ad10 65 6e 74 2e 63 72 65 61 74 65 45 6c 65 6d 65 6e  ent.createElemen
2ad20 74 28 20 22 74 61 62 6c 65 22 20 29 3b 0a 09 09  t( "table" );...
2ad30 09 09 74 72 20 3d 20 64 6f 63 75 6d 65 6e 74 2e  ..tr = document.
2ad40 63 72 65 61 74 65 45 6c 65 6d 65 6e 74 28 20 22  createElement( "
2ad50 74 72 22 20 29 3b 0a 09 09 09 09 74 72 43 68 69  tr" );.....trChi
2ad60 6c 64 20 3d 20 64 6f 63 75 6d 65 6e 74 2e 63 72  ld = document.cr
2ad70 65 61 74 65 45 6c 65 6d 65 6e 74 28 20 22 64 69  eateElement( "di
2ad80 76 22 20 29 3b 0a 0a 09 09 09 09 74 61 62 6c 65  v" );......table
2ad90 2e 73 74 79 6c 65 2e 63 73 73 54 65 78 74 20 3d  .style.cssText =
2ada0 20 22 70 6f 73 69 74 69 6f 6e 3a 61 62 73 6f 6c   "position:absol
2adb0 75 74 65 3b 6c 65 66 74 3a 2d 31 31 31 31 31 70  ute;left:-11111p
2adc0 78 22 3b 0a 09 09 09 09 74 72 2e 73 74 79 6c 65  x";.....tr.style
2add0 2e 68 65 69 67 68 74 20 3d 20 22 31 70 78 22 3b  .height = "1px";
2ade0 0a 09 09 09 09 74 72 43 68 69 6c 64 2e 73 74 79  .....trChild.sty
2adf0 6c 65 2e 68 65 69 67 68 74 20 3d 20 22 39 70 78  le.height = "9px
2ae00 22 3b 0a 0a 09 09 09 09 64 6f 63 75 6d 65 6e 74  ";......document
2ae10 45 6c 65 6d 65 6e 74 0a 09 09 09 09 09 2e 61 70  Element.......ap
2ae20 70 65 6e 64 43 68 69 6c 64 28 20 74 61 62 6c 65  pendChild( table
2ae30 20 29 0a 09 09 09 09 09 2e 61 70 70 65 6e 64 43   ).......appendC
2ae40 68 69 6c 64 28 20 74 72 20 29 0a 09 09 09 09 09  hild( tr )......
2ae50 2e 61 70 70 65 6e 64 43 68 69 6c 64 28 20 74 72  .appendChild( tr
2ae60 43 68 69 6c 64 20 29 3b 0a 0a 09 09 09 09 74 72  Child );......tr
2ae70 53 74 79 6c 65 20 3d 20 77 69 6e 64 6f 77 2e 67  Style = window.g
2ae80 65 74 43 6f 6d 70 75 74 65 64 53 74 79 6c 65 28  etComputedStyle(
2ae90 20 74 72 20 29 3b 0a 09 09 09 09 72 65 6c 69 61   tr );.....relia
2aea0 62 6c 65 54 72 44 69 6d 65 6e 73 69 6f 6e 73 56  bleTrDimensionsV
2aeb0 61 6c 20 3d 20 70 61 72 73 65 49 6e 74 28 20 74  al = parseInt( t
2aec0 72 53 74 79 6c 65 2e 68 65 69 67 68 74 20 29 20  rStyle.height ) 
2aed0 3e 20 33 3b 0a 0a 09 09 09 09 64 6f 63 75 6d 65  > 3;......docume
2aee0 6e 74 45 6c 65 6d 65 6e 74 2e 72 65 6d 6f 76 65  ntElement.remove
2aef0 43 68 69 6c 64 28 20 74 61 62 6c 65 20 29 3b 0a  Child( table );.
2af00 09 09 09 7d 0a 09 09 09 72 65 74 75 72 6e 20 72  ...}....return r
2af10 65 6c 69 61 62 6c 65 54 72 44 69 6d 65 6e 73 69  eliableTrDimensi
2af20 6f 6e 73 56 61 6c 3b 0a 09 09 7d 0a 09 7d 20 29  onsVal;...}..} )
2af30 3b 0a 7d 20 29 28 29 3b 0a 0a 0a 66 75 6e 63 74  ;.} )();...funct
2af40 69 6f 6e 20 63 75 72 43 53 53 28 20 65 6c 65 6d  ion curCSS( elem
2af50 2c 20 6e 61 6d 65 2c 20 63 6f 6d 70 75 74 65 64  , name, computed
2af60 20 29 20 7b 0a 09 76 61 72 20 77 69 64 74 68 2c   ) {..var width,
2af70 20 6d 69 6e 57 69 64 74 68 2c 20 6d 61 78 57 69   minWidth, maxWi
2af80 64 74 68 2c 20 72 65 74 2c 0a 0a 09 09 2f 2f 20  dth, ret,....// 
2af90 53 75 70 70 6f 72 74 3a 20 46 69 72 65 66 6f 78  Support: Firefox
2afa0 20 35 31 2b 0a 09 09 2f 2f 20 52 65 74 72 69 65   51+...// Retrie
2afb0 76 69 6e 67 20 73 74 79 6c 65 20 62 65 66 6f 72  ving style befor
2afc0 65 20 63 6f 6d 70 75 74 65 64 20 73 6f 6d 65 68  e computed someh
2afd0 6f 77 0a 09 09 2f 2f 20 66 69 78 65 73 20 61 6e  ow...// fixes an
2afe0 20 69 73 73 75 65 20 77 69 74 68 20 67 65 74 74   issue with gett
2aff0 69 6e 67 20 77 72 6f 6e 67 20 76 61 6c 75 65 73  ing wrong values
2b000 0a 09 09 2f 2f 20 6f 6e 20 64 65 74 61 63 68 65  ...// on detache
2b010 64 20 65 6c 65 6d 65 6e 74 73 0a 09 09 73 74 79  d elements...sty
2b020 6c 65 20 3d 20 65 6c 65 6d 2e 73 74 79 6c 65 3b  le = elem.style;
2b030 0a 0a 09 63 6f 6d 70 75 74 65 64 20 3d 20 63 6f  ...computed = co
2b040 6d 70 75 74 65 64 20 7c 7c 20 67 65 74 53 74 79  mputed || getSty
2b050 6c 65 73 28 20 65 6c 65 6d 20 29 3b 0a 0a 09 2f  les( elem );.../
2b060 2f 20 67 65 74 50 72 6f 70 65 72 74 79 56 61 6c  / getPropertyVal
2b070 75 65 20 69 73 20 6e 65 65 64 65 64 20 66 6f 72  ue is needed for
2b080 3a 0a 09 2f 2f 20 20 20 2e 63 73 73 28 27 66 69  :..//   .css('fi
2b090 6c 74 65 72 27 29 20 28 49 45 20 39 20 6f 6e 6c  lter') (IE 9 onl
2b0a0 79 2c 20 23 31 32 35 33 37 29 0a 09 2f 2f 20 20  y, #12537)..//  
2b0b0 20 2e 63 73 73 28 27 2d 2d 63 75 73 74 6f 6d 50   .css('--customP
2b0c0 72 6f 70 65 72 74 79 29 20 28 23 33 31 34 34 29  roperty) (#3144)
2b0d0 0a 09 69 66 20 28 20 63 6f 6d 70 75 74 65 64 20  ..if ( computed 
2b0e0 29 20 7b 0a 09 09 72 65 74 20 3d 20 63 6f 6d 70  ) {...ret = comp
2b0f0 75 74 65 64 2e 67 65 74 50 72 6f 70 65 72 74 79  uted.getProperty
2b100 56 61 6c 75 65 28 20 6e 61 6d 65 20 29 20 7c 7c  Value( name ) ||
2b110 20 63 6f 6d 70 75 74 65 64 5b 20 6e 61 6d 65 20   computed[ name 
2b120 5d 3b 0a 0a 09 09 69 66 20 28 20 72 65 74 20 3d  ];....if ( ret =
2b130 3d 3d 20 22 22 20 26 26 20 21 69 73 41 74 74 61  == "" && !isAtta
2b140 63 68 65 64 28 20 65 6c 65 6d 20 29 20 29 20 7b  ched( elem ) ) {
2b150 0a 09 09 09 72 65 74 20 3d 20 6a 51 75 65 72 79  ....ret = jQuery
2b160 2e 73 74 79 6c 65 28 20 65 6c 65 6d 2c 20 6e 61  .style( elem, na
2b170 6d 65 20 29 3b 0a 09 09 7d 0a 0a 09 09 2f 2f 20  me );...}....// 
2b180 41 20 74 72 69 62 75 74 65 20 74 6f 20 74 68 65  A tribute to the
2b190 20 22 61 77 65 73 6f 6d 65 20 68 61 63 6b 20 62   "awesome hack b
2b1a0 79 20 44 65 61 6e 20 45 64 77 61 72 64 73 22 0a  y Dean Edwards".
2b1b0 09 09 2f 2f 20 41 6e 64 72 6f 69 64 20 42 72 6f  ..// Android Bro
2b1c0 77 73 65 72 20 72 65 74 75 72 6e 73 20 70 65 72  wser returns per
2b1d0 63 65 6e 74 61 67 65 20 66 6f 72 20 73 6f 6d 65  centage for some
2b1e0 20 76 61 6c 75 65 73 2c 0a 09 09 2f 2f 20 62 75   values,...// bu
2b1f0 74 20 77 69 64 74 68 20 73 65 65 6d 73 20 74 6f  t width seems to
2b200 20 62 65 20 72 65 6c 69 61 62 6c 79 20 70 69 78   be reliably pix
2b210 65 6c 73 2e 0a 09 09 2f 2f 20 54 68 69 73 20 69  els....// This i
2b220 73 20 61 67 61 69 6e 73 74 20 74 68 65 20 43 53  s against the CS
2b230 53 4f 4d 20 64 72 61 66 74 20 73 70 65 63 3a 0a  SOM draft spec:.
2b240 09 09 2f 2f 20 68 74 74 70 73 3a 2f 2f 64 72 61  ..// https://dra
2b250 66 74 73 2e 63 73 73 77 67 2e 6f 72 67 2f 63 73  fts.csswg.org/cs
2b260 73 6f 6d 2f 23 72 65 73 6f 6c 76 65 64 2d 76 61  som/#resolved-va
2b270 6c 75 65 73 0a 09 09 69 66 20 28 20 21 73 75 70  lues...if ( !sup
2b280 70 6f 72 74 2e 70 69 78 65 6c 42 6f 78 53 74 79  port.pixelBoxSty
2b290 6c 65 73 28 29 20 26 26 20 72 6e 75 6d 6e 6f 6e  les() && rnumnon
2b2a0 70 78 2e 74 65 73 74 28 20 72 65 74 20 29 20 26  px.test( ret ) &
2b2b0 26 20 72 62 6f 78 53 74 79 6c 65 2e 74 65 73 74  & rboxStyle.test
2b2c0 28 20 6e 61 6d 65 20 29 20 29 20 7b 0a 0a 09 09  ( name ) ) {....
2b2d0 09 2f 2f 20 52 65 6d 65 6d 62 65 72 20 74 68 65  .// Remember the
2b2e0 20 6f 72 69 67 69 6e 61 6c 20 76 61 6c 75 65 73   original values
2b2f0 0a 09 09 09 77 69 64 74 68 20 3d 20 73 74 79 6c  ....width = styl
2b300 65 2e 77 69 64 74 68 3b 0a 09 09 09 6d 69 6e 57  e.width;....minW
2b310 69 64 74 68 20 3d 20 73 74 79 6c 65 2e 6d 69 6e  idth = style.min
2b320 57 69 64 74 68 3b 0a 09 09 09 6d 61 78 57 69 64  Width;....maxWid
2b330 74 68 20 3d 20 73 74 79 6c 65 2e 6d 61 78 57 69  th = style.maxWi
2b340 64 74 68 3b 0a 0a 09 09 09 2f 2f 20 50 75 74 20  dth;.....// Put 
2b350 69 6e 20 74 68 65 20 6e 65 77 20 76 61 6c 75 65  in the new value
2b360 73 20 74 6f 20 67 65 74 20 61 20 63 6f 6d 70 75  s to get a compu
2b370 74 65 64 20 76 61 6c 75 65 20 6f 75 74 0a 09 09  ted value out...
2b380 09 73 74 79 6c 65 2e 6d 69 6e 57 69 64 74 68 20  .style.minWidth 
2b390 3d 20 73 74 79 6c 65 2e 6d 61 78 57 69 64 74 68  = style.maxWidth
2b3a0 20 3d 20 73 74 79 6c 65 2e 77 69 64 74 68 20 3d   = style.width =
2b3b0 20 72 65 74 3b 0a 09 09 09 72 65 74 20 3d 20 63   ret;....ret = c
2b3c0 6f 6d 70 75 74 65 64 2e 77 69 64 74 68 3b 0a 0a  omputed.width;..
2b3d0 09 09 09 2f 2f 20 52 65 76 65 72 74 20 74 68 65  ...// Revert the
2b3e0 20 63 68 61 6e 67 65 64 20 76 61 6c 75 65 73 0a   changed values.
2b3f0 09 09 09 73 74 79 6c 65 2e 77 69 64 74 68 20 3d  ...style.width =
2b400 20 77 69 64 74 68 3b 0a 09 09 09 73 74 79 6c 65   width;....style
2b410 2e 6d 69 6e 57 69 64 74 68 20 3d 20 6d 69 6e 57  .minWidth = minW
2b420 69 64 74 68 3b 0a 09 09 09 73 74 79 6c 65 2e 6d  idth;....style.m
2b430 61 78 57 69 64 74 68 20 3d 20 6d 61 78 57 69 64  axWidth = maxWid
2b440 74 68 3b 0a 09 09 7d 0a 09 7d 0a 0a 09 72 65 74  th;...}..}...ret
2b450 75 72 6e 20 72 65 74 20 21 3d 3d 20 75 6e 64 65  urn ret !== unde
2b460 66 69 6e 65 64 20 3f 0a 0a 09 09 2f 2f 20 53 75  fined ?....// Su
2b470 70 70 6f 72 74 3a 20 49 45 20 3c 3d 39 20 2d 20  pport: IE <=9 - 
2b480 31 31 20 6f 6e 6c 79 0a 09 09 2f 2f 20 49 45 20  11 only...// IE 
2b490 72 65 74 75 72 6e 73 20 7a 49 6e 64 65 78 20 76  returns zIndex v
2b4a0 61 6c 75 65 20 61 73 20 61 6e 20 69 6e 74 65 67  alue as an integ
2b4b0 65 72 2e 0a 09 09 72 65 74 20 2b 20 22 22 20 3a  er....ret + "" :
2b4c0 0a 09 09 72 65 74 3b 0a 7d 0a 0a 0a 66 75 6e 63  ...ret;.}...func
2b4d0 74 69 6f 6e 20 61 64 64 47 65 74 48 6f 6f 6b 49  tion addGetHookI
2b4e0 66 28 20 63 6f 6e 64 69 74 69 6f 6e 46 6e 2c 20  f( conditionFn, 
2b4f0 68 6f 6f 6b 46 6e 20 29 20 7b 0a 0a 09 2f 2f 20  hookFn ) {...// 
2b500 44 65 66 69 6e 65 20 74 68 65 20 68 6f 6f 6b 2c  Define the hook,
2b510 20 77 65 27 6c 6c 20 63 68 65 63 6b 20 6f 6e 20   we'll check on 
2b520 74 68 65 20 66 69 72 73 74 20 72 75 6e 20 69 66  the first run if
2b530 20 69 74 27 73 20 72 65 61 6c 6c 79 20 6e 65 65   it's really nee
2b540 64 65 64 2e 0a 09 72 65 74 75 72 6e 20 7b 0a 09  ded...return {..
2b550 09 67 65 74 3a 20 66 75 6e 63 74 69 6f 6e 28 29  .get: function()
2b560 20 7b 0a 09 09 09 69 66 20 28 20 63 6f 6e 64 69   {....if ( condi
2b570 74 69 6f 6e 46 6e 28 29 20 29 20 7b 0a 0a 09 09  tionFn() ) {....
2b580 09 09 2f 2f 20 48 6f 6f 6b 20 6e 6f 74 20 6e 65  ..// Hook not ne
2b590 65 64 65 64 20 28 6f 72 20 69 74 27 73 20 6e 6f  eded (or it's no
2b5a0 74 20 70 6f 73 73 69 62 6c 65 20 74 6f 20 75 73  t possible to us
2b5b0 65 20 69 74 20 64 75 65 0a 09 09 09 09 2f 2f 20  e it due.....// 
2b5c0 74 6f 20 6d 69 73 73 69 6e 67 20 64 65 70 65 6e  to missing depen
2b5d0 64 65 6e 63 79 29 2c 20 72 65 6d 6f 76 65 20 69  dency), remove i
2b5e0 74 2e 0a 09 09 09 09 64 65 6c 65 74 65 20 74 68  t......delete th
2b5f0 69 73 2e 67 65 74 3b 0a 09 09 09 09 72 65 74 75  is.get;.....retu
2b600 72 6e 3b 0a 09 09 09 7d 0a 0a 09 09 09 2f 2f 20  rn;....}.....// 
2b610 48 6f 6f 6b 20 6e 65 65 64 65 64 3b 20 72 65 64  Hook needed; red
2b620 65 66 69 6e 65 20 69 74 20 73 6f 20 74 68 61 74  efine it so that
2b630 20 74 68 65 20 73 75 70 70 6f 72 74 20 74 65 73   the support tes
2b640 74 20 69 73 20 6e 6f 74 20 65 78 65 63 75 74 65  t is not execute
2b650 64 20 61 67 61 69 6e 2e 0a 09 09 09 72 65 74 75  d again.....retu
2b660 72 6e 20 28 20 74 68 69 73 2e 67 65 74 20 3d 20  rn ( this.get = 
2b670 68 6f 6f 6b 46 6e 20 29 2e 61 70 70 6c 79 28 20  hookFn ).apply( 
2b680 74 68 69 73 2c 20 61 72 67 75 6d 65 6e 74 73 20  this, arguments 
2b690 29 3b 0a 09 09 7d 0a 09 7d 3b 0a 7d 0a 0a 0a 76  );...}..};.}...v
2b6a0 61 72 20 63 73 73 50 72 65 66 69 78 65 73 20 3d  ar cssPrefixes =
2b6b0 20 5b 20 22 57 65 62 6b 69 74 22 2c 20 22 4d 6f   [ "Webkit", "Mo
2b6c0 7a 22 2c 20 22 6d 73 22 20 5d 2c 0a 09 65 6d 70  z", "ms" ],..emp
2b6d0 74 79 53 74 79 6c 65 20 3d 20 64 6f 63 75 6d 65  tyStyle = docume
2b6e0 6e 74 2e 63 72 65 61 74 65 45 6c 65 6d 65 6e 74  nt.createElement
2b6f0 28 20 22 64 69 76 22 20 29 2e 73 74 79 6c 65 2c  ( "div" ).style,
2b700 0a 09 76 65 6e 64 6f 72 50 72 6f 70 73 20 3d 20  ..vendorProps = 
2b710 7b 7d 3b 0a 0a 2f 2f 20 52 65 74 75 72 6e 20 61  {};..// Return a
2b720 20 76 65 6e 64 6f 72 2d 70 72 65 66 69 78 65 64   vendor-prefixed
2b730 20 70 72 6f 70 65 72 74 79 20 6f 72 20 75 6e 64   property or und
2b740 65 66 69 6e 65 64 0a 66 75 6e 63 74 69 6f 6e 20  efined.function 
2b750 76 65 6e 64 6f 72 50 72 6f 70 4e 61 6d 65 28 20  vendorPropName( 
2b760 6e 61 6d 65 20 29 20 7b 0a 0a 09 2f 2f 20 43 68  name ) {...// Ch
2b770 65 63 6b 20 66 6f 72 20 76 65 6e 64 6f 72 20 70  eck for vendor p
2b780 72 65 66 69 78 65 64 20 6e 61 6d 65 73 0a 09 76  refixed names..v
2b790 61 72 20 63 61 70 4e 61 6d 65 20 3d 20 6e 61 6d  ar capName = nam
2b7a0 65 5b 20 30 20 5d 2e 74 6f 55 70 70 65 72 43 61  e[ 0 ].toUpperCa
2b7b0 73 65 28 29 20 2b 20 6e 61 6d 65 2e 73 6c 69 63  se() + name.slic
2b7c0 65 28 20 31 20 29 2c 0a 09 09 69 20 3d 20 63 73  e( 1 ),...i = cs
2b7d0 73 50 72 65 66 69 78 65 73 2e 6c 65 6e 67 74 68  sPrefixes.length
2b7e0 3b 0a 0a 09 77 68 69 6c 65 20 28 20 69 2d 2d 20  ;...while ( i-- 
2b7f0 29 20 7b 0a 09 09 6e 61 6d 65 20 3d 20 63 73 73  ) {...name = css
2b800 50 72 65 66 69 78 65 73 5b 20 69 20 5d 20 2b 20  Prefixes[ i ] + 
2b810 63 61 70 4e 61 6d 65 3b 0a 09 09 69 66 20 28 20  capName;...if ( 
2b820 6e 61 6d 65 20 69 6e 20 65 6d 70 74 79 53 74 79  name in emptySty
2b830 6c 65 20 29 20 7b 0a 09 09 09 72 65 74 75 72 6e  le ) {....return
2b840 20 6e 61 6d 65 3b 0a 09 09 7d 0a 09 7d 0a 7d 0a   name;...}..}.}.
2b850 0a 2f 2f 20 52 65 74 75 72 6e 20 61 20 70 6f 74  .// Return a pot
2b860 65 6e 74 69 61 6c 6c 79 2d 6d 61 70 70 65 64 20  entially-mapped 
2b870 6a 51 75 65 72 79 2e 63 73 73 50 72 6f 70 73 20  jQuery.cssProps 
2b880 6f 72 20 76 65 6e 64 6f 72 20 70 72 65 66 69 78  or vendor prefix
2b890 65 64 20 70 72 6f 70 65 72 74 79 0a 66 75 6e 63  ed property.func
2b8a0 74 69 6f 6e 20 66 69 6e 61 6c 50 72 6f 70 4e 61  tion finalPropNa
2b8b0 6d 65 28 20 6e 61 6d 65 20 29 20 7b 0a 09 76 61  me( name ) {..va
2b8c0 72 20 66 69 6e 61 6c 20 3d 20 6a 51 75 65 72 79  r final = jQuery
2b8d0 2e 63 73 73 50 72 6f 70 73 5b 20 6e 61 6d 65 20  .cssProps[ name 
2b8e0 5d 20 7c 7c 20 76 65 6e 64 6f 72 50 72 6f 70 73  ] || vendorProps
2b8f0 5b 20 6e 61 6d 65 20 5d 3b 0a 0a 09 69 66 20 28  [ name ];...if (
2b900 20 66 69 6e 61 6c 20 29 20 7b 0a 09 09 72 65 74   final ) {...ret
2b910 75 72 6e 20 66 69 6e 61 6c 3b 0a 09 7d 0a 09 69  urn final;..}..i
2b920 66 20 28 20 6e 61 6d 65 20 69 6e 20 65 6d 70 74  f ( name in empt
2b930 79 53 74 79 6c 65 20 29 20 7b 0a 09 09 72 65 74  yStyle ) {...ret
2b940 75 72 6e 20 6e 61 6d 65 3b 0a 09 7d 0a 09 72 65  urn name;..}..re
2b950 74 75 72 6e 20 76 65 6e 64 6f 72 50 72 6f 70 73  turn vendorProps
2b960 5b 20 6e 61 6d 65 20 5d 20 3d 20 76 65 6e 64 6f  [ name ] = vendo
2b970 72 50 72 6f 70 4e 61 6d 65 28 20 6e 61 6d 65 20  rPropName( name 
2b980 29 20 7c 7c 20 6e 61 6d 65 3b 0a 7d 0a 0a 0a 76  ) || name;.}...v
2b990 61 72 0a 0a 09 2f 2f 20 53 77 61 70 70 61 62 6c  ar...// Swappabl
2b9a0 65 20 69 66 20 64 69 73 70 6c 61 79 20 69 73 20  e if display is 
2b9b0 6e 6f 6e 65 20 6f 72 20 73 74 61 72 74 73 20 77  none or starts w
2b9c0 69 74 68 20 74 61 62 6c 65 0a 09 2f 2f 20 65 78  ith table..// ex
2b9d0 63 65 70 74 20 22 74 61 62 6c 65 22 2c 20 22 74  cept "table", "t
2b9e0 61 62 6c 65 2d 63 65 6c 6c 22 2c 20 6f 72 20 22  able-cell", or "
2b9f0 74 61 62 6c 65 2d 63 61 70 74 69 6f 6e 22 0a 09  table-caption"..
2ba00 2f 2f 20 53 65 65 20 68 65 72 65 20 66 6f 72 20  // See here for 
2ba10 64 69 73 70 6c 61 79 20 76 61 6c 75 65 73 3a 20  display values: 
2ba20 68 74 74 70 73 3a 2f 2f 64 65 76 65 6c 6f 70 65  https://develope
2ba30 72 2e 6d 6f 7a 69 6c 6c 61 2e 6f 72 67 2f 65 6e  r.mozilla.org/en
2ba40 2d 55 53 2f 64 6f 63 73 2f 43 53 53 2f 64 69 73  -US/docs/CSS/dis
2ba50 70 6c 61 79 0a 09 72 64 69 73 70 6c 61 79 73 77  play..rdisplaysw
2ba60 61 70 20 3d 20 2f 5e 28 6e 6f 6e 65 7c 74 61 62  ap = /^(none|tab
2ba70 6c 65 28 3f 21 2d 63 5b 65 61 5d 29 2e 2b 29 2f  le(?!-c[ea]).+)/
2ba80 2c 0a 09 72 63 75 73 74 6f 6d 50 72 6f 70 20 3d  ,..rcustomProp =
2ba90 20 2f 5e 2d 2d 2f 2c 0a 09 63 73 73 53 68 6f 77   /^--/,..cssShow
2baa0 20 3d 20 7b 20 70 6f 73 69 74 69 6f 6e 3a 20 22   = { position: "
2bab0 61 62 73 6f 6c 75 74 65 22 2c 20 76 69 73 69 62  absolute", visib
2bac0 69 6c 69 74 79 3a 20 22 68 69 64 64 65 6e 22 2c  ility: "hidden",
2bad0 20 64 69 73 70 6c 61 79 3a 20 22 62 6c 6f 63 6b   display: "block
2bae0 22 20 7d 2c 0a 09 63 73 73 4e 6f 72 6d 61 6c 54  " },..cssNormalT
2baf0 72 61 6e 73 66 6f 72 6d 20 3d 20 7b 0a 09 09 6c  ransform = {...l
2bb00 65 74 74 65 72 53 70 61 63 69 6e 67 3a 20 22 30  etterSpacing: "0
2bb10 22 2c 0a 09 09 66 6f 6e 74 57 65 69 67 68 74 3a  ",...fontWeight:
2bb20 20 22 34 30 30 22 0a 09 7d 3b 0a 0a 66 75 6e 63   "400"..};..func
2bb30 74 69 6f 6e 20 73 65 74 50 6f 73 69 74 69 76 65  tion setPositive
2bb40 4e 75 6d 62 65 72 28 20 5f 65 6c 65 6d 2c 20 76  Number( _elem, v
2bb50 61 6c 75 65 2c 20 73 75 62 74 72 61 63 74 20 29  alue, subtract )
2bb60 20 7b 0a 0a 09 2f 2f 20 41 6e 79 20 72 65 6c 61   {...// Any rela
2bb70 74 69 76 65 20 28 2b 2f 2d 29 20 76 61 6c 75 65  tive (+/-) value
2bb80 73 20 68 61 76 65 20 61 6c 72 65 61 64 79 20 62  s have already b
2bb90 65 65 6e 0a 09 2f 2f 20 6e 6f 72 6d 61 6c 69 7a  een..// normaliz
2bba0 65 64 20 61 74 20 74 68 69 73 20 70 6f 69 6e 74  ed at this point
2bbb0 0a 09 76 61 72 20 6d 61 74 63 68 65 73 20 3d 20  ..var matches = 
2bbc0 72 63 73 73 4e 75 6d 2e 65 78 65 63 28 20 76 61  rcssNum.exec( va
2bbd0 6c 75 65 20 29 3b 0a 09 72 65 74 75 72 6e 20 6d  lue );..return m
2bbe0 61 74 63 68 65 73 20 3f 0a 0a 09 09 2f 2f 20 47  atches ?....// G
2bbf0 75 61 72 64 20 61 67 61 69 6e 73 74 20 75 6e 64  uard against und
2bc00 65 66 69 6e 65 64 20 22 73 75 62 74 72 61 63 74  efined "subtract
2bc10 22 2c 20 65 2e 67 2e 2c 20 77 68 65 6e 20 75 73  ", e.g., when us
2bc20 65 64 20 61 73 20 69 6e 20 63 73 73 48 6f 6f 6b  ed as in cssHook
2bc30 73 0a 09 09 4d 61 74 68 2e 6d 61 78 28 20 30 2c  s...Math.max( 0,
2bc40 20 6d 61 74 63 68 65 73 5b 20 32 20 5d 20 2d 20   matches[ 2 ] - 
2bc50 28 20 73 75 62 74 72 61 63 74 20 7c 7c 20 30 20  ( subtract || 0 
2bc60 29 20 29 20 2b 20 28 20 6d 61 74 63 68 65 73 5b  ) ) + ( matches[
2bc70 20 33 20 5d 20 7c 7c 20 22 70 78 22 20 29 20 3a   3 ] || "px" ) :
2bc80 0a 09 09 76 61 6c 75 65 3b 0a 7d 0a 0a 66 75 6e  ...value;.}..fun
2bc90 63 74 69 6f 6e 20 62 6f 78 4d 6f 64 65 6c 41 64  ction boxModelAd
2bca0 6a 75 73 74 6d 65 6e 74 28 20 65 6c 65 6d 2c 20  justment( elem, 
2bcb0 64 69 6d 65 6e 73 69 6f 6e 2c 20 62 6f 78 2c 20  dimension, box, 
2bcc0 69 73 42 6f 72 64 65 72 42 6f 78 2c 20 73 74 79  isBorderBox, sty
2bcd0 6c 65 73 2c 20 63 6f 6d 70 75 74 65 64 56 61 6c  les, computedVal
2bce0 20 29 20 7b 0a 09 76 61 72 20 69 20 3d 20 64 69   ) {..var i = di
2bcf0 6d 65 6e 73 69 6f 6e 20 3d 3d 3d 20 22 77 69 64  mension === "wid
2bd00 74 68 22 20 3f 20 31 20 3a 20 30 2c 0a 09 09 65  th" ? 1 : 0,...e
2bd10 78 74 72 61 20 3d 20 30 2c 0a 09 09 64 65 6c 74  xtra = 0,...delt
2bd20 61 20 3d 20 30 3b 0a 0a 09 2f 2f 20 41 64 6a 75  a = 0;...// Adju
2bd30 73 74 6d 65 6e 74 20 6d 61 79 20 6e 6f 74 20 62  stment may not b
2bd40 65 20 6e 65 63 65 73 73 61 72 79 0a 09 69 66 20  e necessary..if 
2bd50 28 20 62 6f 78 20 3d 3d 3d 20 28 20 69 73 42 6f  ( box === ( isBo
2bd60 72 64 65 72 42 6f 78 20 3f 20 22 62 6f 72 64 65  rderBox ? "borde
2bd70 72 22 20 3a 20 22 63 6f 6e 74 65 6e 74 22 20 29  r" : "content" )
2bd80 20 29 20 7b 0a 09 09 72 65 74 75 72 6e 20 30 3b   ) {...return 0;
2bd90 0a 09 7d 0a 0a 09 66 6f 72 20 28 20 3b 20 69 20  ..}...for ( ; i 
2bda0 3c 20 34 3b 20 69 20 2b 3d 20 32 20 29 20 7b 0a  < 4; i += 2 ) {.
2bdb0 0a 09 09 2f 2f 20 42 6f 74 68 20 62 6f 78 20 6d  ...// Both box m
2bdc0 6f 64 65 6c 73 20 65 78 63 6c 75 64 65 20 6d 61  odels exclude ma
2bdd0 72 67 69 6e 0a 09 09 69 66 20 28 20 62 6f 78 20  rgin...if ( box 
2bde0 3d 3d 3d 20 22 6d 61 72 67 69 6e 22 20 29 20 7b  === "margin" ) {
2bdf0 0a 09 09 09 64 65 6c 74 61 20 2b 3d 20 6a 51 75  ....delta += jQu
2be00 65 72 79 2e 63 73 73 28 20 65 6c 65 6d 2c 20 62  ery.css( elem, b
2be10 6f 78 20 2b 20 63 73 73 45 78 70 61 6e 64 5b 20  ox + cssExpand[ 
2be20 69 20 5d 2c 20 74 72 75 65 2c 20 73 74 79 6c 65  i ], true, style
2be30 73 20 29 3b 0a 09 09 7d 0a 0a 09 09 2f 2f 20 49  s );...}....// I
2be40 66 20 77 65 20 67 65 74 20 68 65 72 65 20 77 69  f we get here wi
2be50 74 68 20 61 20 63 6f 6e 74 65 6e 74 2d 62 6f 78  th a content-box
2be60 2c 20 77 65 27 72 65 20 73 65 65 6b 69 6e 67 20  , we're seeking 
2be70 22 70 61 64 64 69 6e 67 22 20 6f 72 20 22 62 6f  "padding" or "bo
2be80 72 64 65 72 22 20 6f 72 20 22 6d 61 72 67 69 6e  rder" or "margin
2be90 22 0a 09 09 69 66 20 28 20 21 69 73 42 6f 72 64  "...if ( !isBord
2bea0 65 72 42 6f 78 20 29 20 7b 0a 0a 09 09 09 2f 2f  erBox ) {.....//
2beb0 20 41 64 64 20 70 61 64 64 69 6e 67 0a 09 09 09   Add padding....
2bec0 64 65 6c 74 61 20 2b 3d 20 6a 51 75 65 72 79 2e  delta += jQuery.
2bed0 63 73 73 28 20 65 6c 65 6d 2c 20 22 70 61 64 64  css( elem, "padd
2bee0 69 6e 67 22 20 2b 20 63 73 73 45 78 70 61 6e 64  ing" + cssExpand
2bef0 5b 20 69 20 5d 2c 20 74 72 75 65 2c 20 73 74 79  [ i ], true, sty
2bf00 6c 65 73 20 29 3b 0a 0a 09 09 09 2f 2f 20 46 6f  les );.....// Fo
2bf10 72 20 22 62 6f 72 64 65 72 22 20 6f 72 20 22 6d  r "border" or "m
2bf20 61 72 67 69 6e 22 2c 20 61 64 64 20 62 6f 72 64  argin", add bord
2bf30 65 72 0a 09 09 09 69 66 20 28 20 62 6f 78 20 21  er....if ( box !
2bf40 3d 3d 20 22 70 61 64 64 69 6e 67 22 20 29 20 7b  == "padding" ) {
2bf50 0a 09 09 09 09 64 65 6c 74 61 20 2b 3d 20 6a 51  .....delta += jQ
2bf60 75 65 72 79 2e 63 73 73 28 20 65 6c 65 6d 2c 20  uery.css( elem, 
2bf70 22 62 6f 72 64 65 72 22 20 2b 20 63 73 73 45 78  "border" + cssEx
2bf80 70 61 6e 64 5b 20 69 20 5d 20 2b 20 22 57 69 64  pand[ i ] + "Wid
2bf90 74 68 22 2c 20 74 72 75 65 2c 20 73 74 79 6c 65  th", true, style
2bfa0 73 20 29 3b 0a 0a 09 09 09 2f 2f 20 42 75 74 20  s );.....// But 
2bfb0 73 74 69 6c 6c 20 6b 65 65 70 20 74 72 61 63 6b  still keep track
2bfc0 20 6f 66 20 69 74 20 6f 74 68 65 72 77 69 73 65   of it otherwise
2bfd0 0a 09 09 09 7d 20 65 6c 73 65 20 7b 0a 09 09 09  ....} else {....
2bfe0 09 65 78 74 72 61 20 2b 3d 20 6a 51 75 65 72 79  .extra += jQuery
2bff0 2e 63 73 73 28 20 65 6c 65 6d 2c 20 22 62 6f 72  .css( elem, "bor
2c000 64 65 72 22 20 2b 20 63 73 73 45 78 70 61 6e 64  der" + cssExpand
2c010 5b 20 69 20 5d 20 2b 20 22 57 69 64 74 68 22 2c  [ i ] + "Width",
2c020 20 74 72 75 65 2c 20 73 74 79 6c 65 73 20 29 3b   true, styles );
2c030 0a 09 09 09 7d 0a 0a 09 09 2f 2f 20 49 66 20 77  ....}....// If w
2c040 65 20 67 65 74 20 68 65 72 65 20 77 69 74 68 20  e get here with 
2c050 61 20 62 6f 72 64 65 72 2d 62 6f 78 20 28 63 6f  a border-box (co
2c060 6e 74 65 6e 74 20 2b 20 70 61 64 64 69 6e 67 20  ntent + padding 
2c070 2b 20 62 6f 72 64 65 72 29 2c 20 77 65 27 72 65  + border), we're
2c080 20 73 65 65 6b 69 6e 67 20 22 63 6f 6e 74 65 6e   seeking "conten
2c090 74 22 20 6f 72 0a 09 09 2f 2f 20 22 70 61 64 64  t" or...// "padd
2c0a0 69 6e 67 22 20 6f 72 20 22 6d 61 72 67 69 6e 22  ing" or "margin"
2c0b0 0a 09 09 7d 20 65 6c 73 65 20 7b 0a 0a 09 09 09  ...} else {.....
2c0c0 2f 2f 20 46 6f 72 20 22 63 6f 6e 74 65 6e 74 22  // For "content"
2c0d0 2c 20 73 75 62 74 72 61 63 74 20 70 61 64 64 69  , subtract paddi
2c0e0 6e 67 0a 09 09 09 69 66 20 28 20 62 6f 78 20 3d  ng....if ( box =
2c0f0 3d 3d 20 22 63 6f 6e 74 65 6e 74 22 20 29 20 7b  == "content" ) {
2c100 0a 09 09 09 09 64 65 6c 74 61 20 2d 3d 20 6a 51  .....delta -= jQ
2c110 75 65 72 79 2e 63 73 73 28 20 65 6c 65 6d 2c 20  uery.css( elem, 
2c120 22 70 61 64 64 69 6e 67 22 20 2b 20 63 73 73 45  "padding" + cssE
2c130 78 70 61 6e 64 5b 20 69 20 5d 2c 20 74 72 75 65  xpand[ i ], true
2c140 2c 20 73 74 79 6c 65 73 20 29 3b 0a 09 09 09 7d  , styles );....}
2c150 0a 0a 09 09 09 2f 2f 20 46 6f 72 20 22 63 6f 6e  .....// For "con
2c160 74 65 6e 74 22 20 6f 72 20 22 70 61 64 64 69 6e  tent" or "paddin
2c170 67 22 2c 20 73 75 62 74 72 61 63 74 20 62 6f 72  g", subtract bor
2c180 64 65 72 0a 09 09 09 69 66 20 28 20 62 6f 78 20  der....if ( box 
2c190 21 3d 3d 20 22 6d 61 72 67 69 6e 22 20 29 20 7b  !== "margin" ) {
2c1a0 0a 09 09 09 09 64 65 6c 74 61 20 2d 3d 20 6a 51  .....delta -= jQ
2c1b0 75 65 72 79 2e 63 73 73 28 20 65 6c 65 6d 2c 20  uery.css( elem, 
2c1c0 22 62 6f 72 64 65 72 22 20 2b 20 63 73 73 45 78  "border" + cssEx
2c1d0 70 61 6e 64 5b 20 69 20 5d 20 2b 20 22 57 69 64  pand[ i ] + "Wid
2c1e0 74 68 22 2c 20 74 72 75 65 2c 20 73 74 79 6c 65  th", true, style
2c1f0 73 20 29 3b 0a 09 09 09 7d 0a 09 09 7d 0a 09 7d  s );....}...}..}
2c200 0a 0a 09 2f 2f 20 41 63 63 6f 75 6e 74 20 66 6f  ...// Account fo
2c210 72 20 70 6f 73 69 74 69 76 65 20 63 6f 6e 74 65  r positive conte
2c220 6e 74 2d 62 6f 78 20 73 63 72 6f 6c 6c 20 67 75  nt-box scroll gu
2c230 74 74 65 72 20 77 68 65 6e 20 72 65 71 75 65 73  tter when reques
2c240 74 65 64 20 62 79 20 70 72 6f 76 69 64 69 6e 67  ted by providing
2c250 20 63 6f 6d 70 75 74 65 64 56 61 6c 0a 09 69 66   computedVal..if
2c260 20 28 20 21 69 73 42 6f 72 64 65 72 42 6f 78 20   ( !isBorderBox 
2c270 26 26 20 63 6f 6d 70 75 74 65 64 56 61 6c 20 3e  && computedVal >
2c280 3d 20 30 20 29 20 7b 0a 0a 09 09 2f 2f 20 6f 66  = 0 ) {....// of
2c290 66 73 65 74 57 69 64 74 68 2f 6f 66 66 73 65 74  fsetWidth/offset
2c2a0 48 65 69 67 68 74 20 69 73 20 61 20 72 6f 75 6e  Height is a roun
2c2b0 64 65 64 20 73 75 6d 20 6f 66 20 63 6f 6e 74 65  ded sum of conte
2c2c0 6e 74 2c 20 70 61 64 64 69 6e 67 2c 20 73 63 72  nt, padding, scr
2c2d0 6f 6c 6c 20 67 75 74 74 65 72 2c 20 61 6e 64 20  oll gutter, and 
2c2e0 62 6f 72 64 65 72 0a 09 09 2f 2f 20 41 73 73 75  border...// Assu
2c2f0 6d 69 6e 67 20 69 6e 74 65 67 65 72 20 73 63 72  ming integer scr
2c300 6f 6c 6c 20 67 75 74 74 65 72 2c 20 73 75 62 74  oll gutter, subt
2c310 72 61 63 74 20 74 68 65 20 72 65 73 74 20 61 6e  ract the rest an
2c320 64 20 72 6f 75 6e 64 20 64 6f 77 6e 0a 09 09 64  d round down...d
2c330 65 6c 74 61 20 2b 3d 20 4d 61 74 68 2e 6d 61 78  elta += Math.max
2c340 28 20 30 2c 20 4d 61 74 68 2e 63 65 69 6c 28 0a  ( 0, Math.ceil(.
2c350 09 09 09 65 6c 65 6d 5b 20 22 6f 66 66 73 65 74  ...elem[ "offset
2c360 22 20 2b 20 64 69 6d 65 6e 73 69 6f 6e 5b 20 30  " + dimension[ 0
2c370 20 5d 2e 74 6f 55 70 70 65 72 43 61 73 65 28 29   ].toUpperCase()
2c380 20 2b 20 64 69 6d 65 6e 73 69 6f 6e 2e 73 6c 69   + dimension.sli
2c390 63 65 28 20 31 20 29 20 5d 20 2d 0a 09 09 09 63  ce( 1 ) ] -....c
2c3a0 6f 6d 70 75 74 65 64 56 61 6c 20 2d 0a 09 09 09  omputedVal -....
2c3b0 64 65 6c 74 61 20 2d 0a 09 09 09 65 78 74 72 61  delta -....extra
2c3c0 20 2d 0a 09 09 09 30 2e 35 0a 0a 09 09 2f 2f 20   -....0.5....// 
2c3d0 49 66 20 6f 66 66 73 65 74 57 69 64 74 68 2f 6f  If offsetWidth/o
2c3e0 66 66 73 65 74 48 65 69 67 68 74 20 69 73 20 75  ffsetHeight is u
2c3f0 6e 6b 6e 6f 77 6e 2c 20 74 68 65 6e 20 77 65 20  nknown, then we 
2c400 63 61 6e 27 74 20 64 65 74 65 72 6d 69 6e 65 20  can't determine 
2c410 63 6f 6e 74 65 6e 74 2d 62 6f 78 20 73 63 72 6f  content-box scro
2c420 6c 6c 20 67 75 74 74 65 72 0a 09 09 2f 2f 20 55  ll gutter...// U
2c430 73 65 20 61 6e 20 65 78 70 6c 69 63 69 74 20 7a  se an explicit z
2c440 65 72 6f 20 74 6f 20 61 76 6f 69 64 20 4e 61 4e  ero to avoid NaN
2c450 20 28 67 68 2d 33 39 36 34 29 0a 09 09 29 20 29   (gh-3964)...) )
2c460 20 7c 7c 20 30 3b 0a 09 7d 0a 0a 09 72 65 74 75   || 0;..}...retu
2c470 72 6e 20 64 65 6c 74 61 3b 0a 7d 0a 0a 66 75 6e  rn delta;.}..fun
2c480 63 74 69 6f 6e 20 67 65 74 57 69 64 74 68 4f 72  ction getWidthOr
2c490 48 65 69 67 68 74 28 20 65 6c 65 6d 2c 20 64 69  Height( elem, di
2c4a0 6d 65 6e 73 69 6f 6e 2c 20 65 78 74 72 61 20 29  mension, extra )
2c4b0 20 7b 0a 0a 09 2f 2f 20 53 74 61 72 74 20 77 69   {...// Start wi
2c4c0 74 68 20 63 6f 6d 70 75 74 65 64 20 73 74 79 6c  th computed styl
2c4d0 65 0a 09 76 61 72 20 73 74 79 6c 65 73 20 3d 20  e..var styles = 
2c4e0 67 65 74 53 74 79 6c 65 73 28 20 65 6c 65 6d 20  getStyles( elem 
2c4f0 29 2c 0a 0a 09 09 2f 2f 20 54 6f 20 61 76 6f 69  ),....// To avoi
2c500 64 20 66 6f 72 63 69 6e 67 20 61 20 72 65 66 6c  d forcing a refl
2c510 6f 77 2c 20 6f 6e 6c 79 20 66 65 74 63 68 20 62  ow, only fetch b
2c520 6f 78 53 69 7a 69 6e 67 20 69 66 20 77 65 20 6e  oxSizing if we n
2c530 65 65 64 20 69 74 20 28 67 68 2d 34 33 32 32 29  eed it (gh-4322)
2c540 2e 0a 09 09 2f 2f 20 46 61 6b 65 20 63 6f 6e 74  ....// Fake cont
2c550 65 6e 74 2d 62 6f 78 20 75 6e 74 69 6c 20 77 65  ent-box until we
2c560 20 6b 6e 6f 77 20 69 74 27 73 20 6e 65 65 64 65   know it's neede
2c570 64 20 74 6f 20 6b 6e 6f 77 20 74 68 65 20 74 72  d to know the tr
2c580 75 65 20 76 61 6c 75 65 2e 0a 09 09 62 6f 78 53  ue value....boxS
2c590 69 7a 69 6e 67 4e 65 65 64 65 64 20 3d 20 21 73  izingNeeded = !s
2c5a0 75 70 70 6f 72 74 2e 62 6f 78 53 69 7a 69 6e 67  upport.boxSizing
2c5b0 52 65 6c 69 61 62 6c 65 28 29 20 7c 7c 20 65 78  Reliable() || ex
2c5c0 74 72 61 2c 0a 09 09 69 73 42 6f 72 64 65 72 42  tra,...isBorderB
2c5d0 6f 78 20 3d 20 62 6f 78 53 69 7a 69 6e 67 4e 65  ox = boxSizingNe
2c5e0 65 64 65 64 20 26 26 0a 09 09 09 6a 51 75 65 72  eded &&....jQuer
2c5f0 79 2e 63 73 73 28 20 65 6c 65 6d 2c 20 22 62 6f  y.css( elem, "bo
2c600 78 53 69 7a 69 6e 67 22 2c 20 66 61 6c 73 65 2c  xSizing", false,
2c610 20 73 74 79 6c 65 73 20 29 20 3d 3d 3d 20 22 62   styles ) === "b
2c620 6f 72 64 65 72 2d 62 6f 78 22 2c 0a 09 09 76 61  order-box",...va
2c630 6c 75 65 49 73 42 6f 72 64 65 72 42 6f 78 20 3d  lueIsBorderBox =
2c640 20 69 73 42 6f 72 64 65 72 42 6f 78 2c 0a 0a 09   isBorderBox,...
2c650 09 76 61 6c 20 3d 20 63 75 72 43 53 53 28 20 65  .val = curCSS( e
2c660 6c 65 6d 2c 20 64 69 6d 65 6e 73 69 6f 6e 2c 20  lem, dimension, 
2c670 73 74 79 6c 65 73 20 29 2c 0a 09 09 6f 66 66 73  styles ),...offs
2c680 65 74 50 72 6f 70 20 3d 20 22 6f 66 66 73 65 74  etProp = "offset
2c690 22 20 2b 20 64 69 6d 65 6e 73 69 6f 6e 5b 20 30  " + dimension[ 0
2c6a0 20 5d 2e 74 6f 55 70 70 65 72 43 61 73 65 28 29   ].toUpperCase()
2c6b0 20 2b 20 64 69 6d 65 6e 73 69 6f 6e 2e 73 6c 69   + dimension.sli
2c6c0 63 65 28 20 31 20 29 3b 0a 0a 09 2f 2f 20 53 75  ce( 1 );...// Su
2c6d0 70 70 6f 72 74 3a 20 46 69 72 65 66 6f 78 20 3c  pport: Firefox <
2c6e0 3d 35 34 0a 09 2f 2f 20 52 65 74 75 72 6e 20 61  =54..// Return a
2c6f0 20 63 6f 6e 66 6f 75 6e 64 69 6e 67 20 6e 6f 6e   confounding non
2c700 2d 70 69 78 65 6c 20 76 61 6c 75 65 20 6f 72 20  -pixel value or 
2c710 66 65 69 67 6e 20 69 67 6e 6f 72 61 6e 63 65 2c  feign ignorance,
2c720 20 61 73 20 61 70 70 72 6f 70 72 69 61 74 65 2e   as appropriate.
2c730 0a 09 69 66 20 28 20 72 6e 75 6d 6e 6f 6e 70 78  ..if ( rnumnonpx
2c740 2e 74 65 73 74 28 20 76 61 6c 20 29 20 29 20 7b  .test( val ) ) {
2c750 0a 09 09 69 66 20 28 20 21 65 78 74 72 61 20 29  ...if ( !extra )
2c760 20 7b 0a 09 09 09 72 65 74 75 72 6e 20 76 61 6c   {....return val
2c770 3b 0a 09 09 7d 0a 09 09 76 61 6c 20 3d 20 22 61  ;...}...val = "a
2c780 75 74 6f 22 3b 0a 09 7d 0a 0a 0a 09 2f 2f 20 53  uto";..}....// S
2c790 75 70 70 6f 72 74 3a 20 49 45 20 39 20 2d 20 31  upport: IE 9 - 1
2c7a0 31 20 6f 6e 6c 79 0a 09 2f 2f 20 55 73 65 20 6f  1 only..// Use o
2c7b0 66 66 73 65 74 57 69 64 74 68 2f 6f 66 66 73 65  ffsetWidth/offse
2c7c0 74 48 65 69 67 68 74 20 66 6f 72 20 77 68 65 6e  tHeight for when
2c7d0 20 62 6f 78 20 73 69 7a 69 6e 67 20 69 73 20 75   box sizing is u
2c7e0 6e 72 65 6c 69 61 62 6c 65 2e 0a 09 2f 2f 20 49  nreliable...// I
2c7f0 6e 20 74 68 6f 73 65 20 63 61 73 65 73 2c 20 74  n those cases, t
2c800 68 65 20 63 6f 6d 70 75 74 65 64 20 76 61 6c 75  he computed valu
2c810 65 20 63 61 6e 20 62 65 20 74 72 75 73 74 65 64  e can be trusted
2c820 20 74 6f 20 62 65 20 62 6f 72 64 65 72 2d 62 6f   to be border-bo
2c830 78 2e 0a 09 69 66 20 28 20 28 20 21 73 75 70 70  x...if ( ( !supp
2c840 6f 72 74 2e 62 6f 78 53 69 7a 69 6e 67 52 65 6c  ort.boxSizingRel
2c850 69 61 62 6c 65 28 29 20 26 26 20 69 73 42 6f 72  iable() && isBor
2c860 64 65 72 42 6f 78 20 7c 7c 0a 0a 09 09 2f 2f 20  derBox ||....// 
2c870 53 75 70 70 6f 72 74 3a 20 49 45 20 31 30 20 2d  Support: IE 10 -
2c880 20 31 31 2b 2c 20 45 64 67 65 20 31 35 20 2d 20   11+, Edge 15 - 
2c890 31 38 2b 0a 09 09 2f 2f 20 49 45 2f 45 64 67 65  18+...// IE/Edge
2c8a0 20 6d 69 73 72 65 70 6f 72 74 20 60 67 65 74 43   misreport `getC
2c8b0 6f 6d 70 75 74 65 64 53 74 79 6c 65 60 20 6f 66  omputedStyle` of
2c8c0 20 74 61 62 6c 65 20 72 6f 77 73 20 77 69 74 68   table rows with
2c8d0 20 77 69 64 74 68 2f 68 65 69 67 68 74 0a 09 09   width/height...
2c8e0 2f 2f 20 73 65 74 20 69 6e 20 43 53 53 20 77 68  // set in CSS wh
2c8f0 69 6c 65 20 60 6f 66 66 73 65 74 2a 60 20 70 72  ile `offset*` pr
2c900 6f 70 65 72 74 69 65 73 20 72 65 70 6f 72 74 20  operties report 
2c910 63 6f 72 72 65 63 74 20 76 61 6c 75 65 73 2e 0a  correct values..
2c920 09 09 2f 2f 20 49 6e 74 65 72 65 73 74 69 6e 67  ..// Interesting
2c930 6c 79 2c 20 69 6e 20 73 6f 6d 65 20 63 61 73 65  ly, in some case
2c940 73 20 49 45 20 39 20 64 6f 65 73 6e 27 74 20 73  s IE 9 doesn't s
2c950 75 66 66 65 72 20 66 72 6f 6d 20 74 68 69 73 20  uffer from this 
2c960 69 73 73 75 65 2e 0a 09 09 21 73 75 70 70 6f 72  issue....!suppor
2c970 74 2e 72 65 6c 69 61 62 6c 65 54 72 44 69 6d 65  t.reliableTrDime
2c980 6e 73 69 6f 6e 73 28 29 20 26 26 20 6e 6f 64 65  nsions() && node
2c990 4e 61 6d 65 28 20 65 6c 65 6d 2c 20 22 74 72 22  Name( elem, "tr"
2c9a0 20 29 20 7c 7c 0a 0a 09 09 2f 2f 20 46 61 6c 6c   ) ||....// Fall
2c9b0 20 62 61 63 6b 20 74 6f 20 6f 66 66 73 65 74 57   back to offsetW
2c9c0 69 64 74 68 2f 6f 66 66 73 65 74 48 65 69 67 68  idth/offsetHeigh
2c9d0 74 20 77 68 65 6e 20 76 61 6c 75 65 20 69 73 20  t when value is 
2c9e0 22 61 75 74 6f 22 0a 09 09 2f 2f 20 54 68 69 73  "auto"...// This
2c9f0 20 68 61 70 70 65 6e 73 20 66 6f 72 20 69 6e 6c   happens for inl
2ca00 69 6e 65 20 65 6c 65 6d 65 6e 74 73 20 77 69 74  ine elements wit
2ca10 68 20 6e 6f 20 65 78 70 6c 69 63 69 74 20 73 65  h no explicit se
2ca20 74 74 69 6e 67 20 28 67 68 2d 33 35 37 31 29 0a  tting (gh-3571).
2ca30 09 09 76 61 6c 20 3d 3d 3d 20 22 61 75 74 6f 22  ..val === "auto"
2ca40 20 7c 7c 0a 0a 09 09 2f 2f 20 53 75 70 70 6f 72   ||....// Suppor
2ca50 74 3a 20 41 6e 64 72 6f 69 64 20 3c 3d 34 2e 31  t: Android <=4.1
2ca60 20 2d 20 34 2e 33 20 6f 6e 6c 79 0a 09 09 2f 2f   - 4.3 only...//
2ca70 20 41 6c 73 6f 20 75 73 65 20 6f 66 66 73 65 74   Also use offset
2ca80 57 69 64 74 68 2f 6f 66 66 73 65 74 48 65 69 67  Width/offsetHeig
2ca90 68 74 20 66 6f 72 20 6d 69 73 72 65 70 6f 72 74  ht for misreport
2caa0 65 64 20 69 6e 6c 69 6e 65 20 64 69 6d 65 6e 73  ed inline dimens
2cab0 69 6f 6e 73 20 28 67 68 2d 33 36 30 32 29 0a 09  ions (gh-3602)..
2cac0 09 21 70 61 72 73 65 46 6c 6f 61 74 28 20 76 61  .!parseFloat( va
2cad0 6c 20 29 20 26 26 20 6a 51 75 65 72 79 2e 63 73  l ) && jQuery.cs
2cae0 73 28 20 65 6c 65 6d 2c 20 22 64 69 73 70 6c 61  s( elem, "displa
2caf0 79 22 2c 20 66 61 6c 73 65 2c 20 73 74 79 6c 65  y", false, style
2cb00 73 20 29 20 3d 3d 3d 20 22 69 6e 6c 69 6e 65 22  s ) === "inline"
2cb10 20 29 20 26 26 0a 0a 09 09 2f 2f 20 4d 61 6b 65   ) &&....// Make
2cb20 20 73 75 72 65 20 74 68 65 20 65 6c 65 6d 65 6e   sure the elemen
2cb30 74 20 69 73 20 76 69 73 69 62 6c 65 20 26 20 63  t is visible & c
2cb40 6f 6e 6e 65 63 74 65 64 0a 09 09 65 6c 65 6d 2e  onnected...elem.
2cb50 67 65 74 43 6c 69 65 6e 74 52 65 63 74 73 28 29  getClientRects()
2cb60 2e 6c 65 6e 67 74 68 20 29 20 7b 0a 0a 09 09 69  .length ) {....i
2cb70 73 42 6f 72 64 65 72 42 6f 78 20 3d 20 6a 51 75  sBorderBox = jQu
2cb80 65 72 79 2e 63 73 73 28 20 65 6c 65 6d 2c 20 22  ery.css( elem, "
2cb90 62 6f 78 53 69 7a 69 6e 67 22 2c 20 66 61 6c 73  boxSizing", fals
2cba0 65 2c 20 73 74 79 6c 65 73 20 29 20 3d 3d 3d 20  e, styles ) === 
2cbb0 22 62 6f 72 64 65 72 2d 62 6f 78 22 3b 0a 0a 09  "border-box";...
2cbc0 09 2f 2f 20 57 68 65 72 65 20 61 76 61 69 6c 61  .// Where availa
2cbd0 62 6c 65 2c 20 6f 66 66 73 65 74 57 69 64 74 68  ble, offsetWidth
2cbe0 2f 6f 66 66 73 65 74 48 65 69 67 68 74 20 61 70  /offsetHeight ap
2cbf0 70 72 6f 78 69 6d 61 74 65 20 62 6f 72 64 65 72  proximate border
2cc00 20 62 6f 78 20 64 69 6d 65 6e 73 69 6f 6e 73 2e   box dimensions.
2cc10 0a 09 09 2f 2f 20 57 68 65 72 65 20 6e 6f 74 20  ...// Where not 
2cc20 61 76 61 69 6c 61 62 6c 65 20 28 65 2e 67 2e 2c  available (e.g.,
2cc30 20 53 56 47 29 2c 20 61 73 73 75 6d 65 20 75 6e   SVG), assume un
2cc40 72 65 6c 69 61 62 6c 65 20 62 6f 78 2d 73 69 7a  reliable box-siz
2cc50 69 6e 67 20 61 6e 64 20 69 6e 74 65 72 70 72 65  ing and interpre
2cc60 74 20 74 68 65 0a 09 09 2f 2f 20 72 65 74 72 69  t the...// retri
2cc70 65 76 65 64 20 76 61 6c 75 65 20 61 73 20 61 20  eved value as a 
2cc80 63 6f 6e 74 65 6e 74 20 62 6f 78 20 64 69 6d 65  content box dime
2cc90 6e 73 69 6f 6e 2e 0a 09 09 76 61 6c 75 65 49 73  nsion....valueIs
2cca0 42 6f 72 64 65 72 42 6f 78 20 3d 20 6f 66 66 73  BorderBox = offs
2ccb0 65 74 50 72 6f 70 20 69 6e 20 65 6c 65 6d 3b 0a  etProp in elem;.
2ccc0 09 09 69 66 20 28 20 76 61 6c 75 65 49 73 42 6f  ..if ( valueIsBo
2ccd0 72 64 65 72 42 6f 78 20 29 20 7b 0a 09 09 09 76  rderBox ) {....v
2cce0 61 6c 20 3d 20 65 6c 65 6d 5b 20 6f 66 66 73 65  al = elem[ offse
2ccf0 74 50 72 6f 70 20 5d 3b 0a 09 09 7d 0a 09 7d 0a  tProp ];...}..}.
2cd00 0a 09 2f 2f 20 4e 6f 72 6d 61 6c 69 7a 65 20 22  ..// Normalize "
2cd10 22 20 61 6e 64 20 61 75 74 6f 0a 09 76 61 6c 20  " and auto..val 
2cd20 3d 20 70 61 72 73 65 46 6c 6f 61 74 28 20 76 61  = parseFloat( va
2cd30 6c 20 29 20 7c 7c 20 30 3b 0a 0a 09 2f 2f 20 41  l ) || 0;...// A
2cd40 64 6a 75 73 74 20 66 6f 72 20 74 68 65 20 65 6c  djust for the el
2cd50 65 6d 65 6e 74 27 73 20 62 6f 78 20 6d 6f 64 65  ement's box mode
2cd60 6c 0a 09 72 65 74 75 72 6e 20 28 20 76 61 6c 20  l..return ( val 
2cd70 2b 0a 09 09 62 6f 78 4d 6f 64 65 6c 41 64 6a 75  +...boxModelAdju
2cd80 73 74 6d 65 6e 74 28 0a 09 09 09 65 6c 65 6d 2c  stment(....elem,
2cd90 0a 09 09 09 64 69 6d 65 6e 73 69 6f 6e 2c 0a 09  ....dimension,..
2cda0 09 09 65 78 74 72 61 20 7c 7c 20 28 20 69 73 42  ..extra || ( isB
2cdb0 6f 72 64 65 72 42 6f 78 20 3f 20 22 62 6f 72 64  orderBox ? "bord
2cdc0 65 72 22 20 3a 20 22 63 6f 6e 74 65 6e 74 22 20  er" : "content" 
2cdd0 29 2c 0a 09 09 09 76 61 6c 75 65 49 73 42 6f 72  ),....valueIsBor
2cde0 64 65 72 42 6f 78 2c 0a 09 09 09 73 74 79 6c 65  derBox,....style
2cdf0 73 2c 0a 0a 09 09 09 2f 2f 20 50 72 6f 76 69 64  s,.....// Provid
2ce00 65 20 74 68 65 20 63 75 72 72 65 6e 74 20 63 6f  e the current co
2ce10 6d 70 75 74 65 64 20 73 69 7a 65 20 74 6f 20 72  mputed size to r
2ce20 65 71 75 65 73 74 20 73 63 72 6f 6c 6c 20 67 75  equest scroll gu
2ce30 74 74 65 72 20 63 61 6c 63 75 6c 61 74 69 6f 6e  tter calculation
2ce40 20 28 67 68 2d 33 35 38 39 29 0a 09 09 09 76 61   (gh-3589)....va
2ce50 6c 0a 09 09 29 0a 09 29 20 2b 20 22 70 78 22 3b  l...)..) + "px";
2ce60 0a 7d 0a 0a 6a 51 75 65 72 79 2e 65 78 74 65 6e  .}..jQuery.exten
2ce70 64 28 20 7b 0a 0a 09 2f 2f 20 41 64 64 20 69 6e  d( {...// Add in
2ce80 20 73 74 79 6c 65 20 70 72 6f 70 65 72 74 79 20   style property 
2ce90 68 6f 6f 6b 73 20 66 6f 72 20 6f 76 65 72 72 69  hooks for overri
2cea0 64 69 6e 67 20 74 68 65 20 64 65 66 61 75 6c 74  ding the default
2ceb0 0a 09 2f 2f 20 62 65 68 61 76 69 6f 72 20 6f 66  ..// behavior of
2cec0 20 67 65 74 74 69 6e 67 20 61 6e 64 20 73 65 74   getting and set
2ced0 74 69 6e 67 20 61 20 73 74 79 6c 65 20 70 72 6f  ting a style pro
2cee0 70 65 72 74 79 0a 09 63 73 73 48 6f 6f 6b 73 3a  perty..cssHooks:
2cef0 20 7b 0a 09 09 6f 70 61 63 69 74 79 3a 20 7b 0a   {...opacity: {.
2cf00 09 09 09 67 65 74 3a 20 66 75 6e 63 74 69 6f 6e  ...get: function
2cf10 28 20 65 6c 65 6d 2c 20 63 6f 6d 70 75 74 65 64  ( elem, computed
2cf20 20 29 20 7b 0a 09 09 09 09 69 66 20 28 20 63 6f   ) {.....if ( co
2cf30 6d 70 75 74 65 64 20 29 20 7b 0a 0a 09 09 09 09  mputed ) {......
2cf40 09 2f 2f 20 57 65 20 73 68 6f 75 6c 64 20 61 6c  .// We should al
2cf50 77 61 79 73 20 67 65 74 20 61 20 6e 75 6d 62 65  ways get a numbe
2cf60 72 20 62 61 63 6b 20 66 72 6f 6d 20 6f 70 61 63  r back from opac
2cf70 69 74 79 0a 09 09 09 09 09 76 61 72 20 72 65 74  ity......var ret
2cf80 20 3d 20 63 75 72 43 53 53 28 20 65 6c 65 6d 2c   = curCSS( elem,
2cf90 20 22 6f 70 61 63 69 74 79 22 20 29 3b 0a 09 09   "opacity" );...
2cfa0 09 09 09 72 65 74 75 72 6e 20 72 65 74 20 3d 3d  ...return ret ==
2cfb0 3d 20 22 22 20 3f 20 22 31 22 20 3a 20 72 65 74  = "" ? "1" : ret
2cfc0 3b 0a 09 09 09 09 7d 0a 09 09 09 7d 0a 09 09 7d  ;.....}....}...}
2cfd0 0a 09 7d 2c 0a 0a 09 2f 2f 20 44 6f 6e 27 74 20  ..},...// Don't 
2cfe0 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 61 64  automatically ad
2cff0 64 20 22 70 78 22 20 74 6f 20 74 68 65 73 65 20  d "px" to these 
2d000 70 6f 73 73 69 62 6c 79 2d 75 6e 69 74 6c 65 73  possibly-unitles
2d010 73 20 70 72 6f 70 65 72 74 69 65 73 0a 09 63 73  s properties..cs
2d020 73 4e 75 6d 62 65 72 3a 20 7b 0a 09 09 22 61 6e  sNumber: {..."an
2d030 69 6d 61 74 69 6f 6e 49 74 65 72 61 74 69 6f 6e  imationIteration
2d040 43 6f 75 6e 74 22 3a 20 74 72 75 65 2c 0a 09 09  Count": true,...
2d050 22 63 6f 6c 75 6d 6e 43 6f 75 6e 74 22 3a 20 74  "columnCount": t
2d060 72 75 65 2c 0a 09 09 22 66 69 6c 6c 4f 70 61 63  rue,..."fillOpac
2d070 69 74 79 22 3a 20 74 72 75 65 2c 0a 09 09 22 66  ity": true,..."f
2d080 6c 65 78 47 72 6f 77 22 3a 20 74 72 75 65 2c 0a  lexGrow": true,.
2d090 09 09 22 66 6c 65 78 53 68 72 69 6e 6b 22 3a 20  .."flexShrink": 
2d0a0 74 72 75 65 2c 0a 09 09 22 66 6f 6e 74 57 65 69  true,..."fontWei
2d0b0 67 68 74 22 3a 20 74 72 75 65 2c 0a 09 09 22 67  ght": true,..."g
2d0c0 72 69 64 41 72 65 61 22 3a 20 74 72 75 65 2c 0a  ridArea": true,.
2d0d0 09 09 22 67 72 69 64 43 6f 6c 75 6d 6e 22 3a 20  .."gridColumn": 
2d0e0 74 72 75 65 2c 0a 09 09 22 67 72 69 64 43 6f 6c  true,..."gridCol
2d0f0 75 6d 6e 45 6e 64 22 3a 20 74 72 75 65 2c 0a 09  umnEnd": true,..
2d100 09 22 67 72 69 64 43 6f 6c 75 6d 6e 53 74 61 72  ."gridColumnStar
2d110 74 22 3a 20 74 72 75 65 2c 0a 09 09 22 67 72 69  t": true,..."gri
2d120 64 52 6f 77 22 3a 20 74 72 75 65 2c 0a 09 09 22  dRow": true,..."
2d130 67 72 69 64 52 6f 77 45 6e 64 22 3a 20 74 72 75  gridRowEnd": tru
2d140 65 2c 0a 09 09 22 67 72 69 64 52 6f 77 53 74 61  e,..."gridRowSta
2d150 72 74 22 3a 20 74 72 75 65 2c 0a 09 09 22 6c 69  rt": true,..."li
2d160 6e 65 48 65 69 67 68 74 22 3a 20 74 72 75 65 2c  neHeight": true,
2d170 0a 09 09 22 6f 70 61 63 69 74 79 22 3a 20 74 72  ..."opacity": tr
2d180 75 65 2c 0a 09 09 22 6f 72 64 65 72 22 3a 20 74  ue,..."order": t
2d190 72 75 65 2c 0a 09 09 22 6f 72 70 68 61 6e 73 22  rue,..."orphans"
2d1a0 3a 20 74 72 75 65 2c 0a 09 09 22 77 69 64 6f 77  : true,..."widow
2d1b0 73 22 3a 20 74 72 75 65 2c 0a 09 09 22 7a 49 6e  s": true,..."zIn
2d1c0 64 65 78 22 3a 20 74 72 75 65 2c 0a 09 09 22 7a  dex": true,..."z
2d1d0 6f 6f 6d 22 3a 20 74 72 75 65 0a 09 7d 2c 0a 0a  oom": true..},..
2d1e0 09 2f 2f 20 41 64 64 20 69 6e 20 70 72 6f 70 65  .// Add in prope
2d1f0 72 74 69 65 73 20 77 68 6f 73 65 20 6e 61 6d 65  rties whose name
2d200 73 20 79 6f 75 20 77 69 73 68 20 74 6f 20 66 69  s you wish to fi
2d210 78 20 62 65 66 6f 72 65 0a 09 2f 2f 20 73 65 74  x before..// set
2d220 74 69 6e 67 20 6f 72 20 67 65 74 74 69 6e 67 20  ting or getting 
2d230 74 68 65 20 76 61 6c 75 65 0a 09 63 73 73 50 72  the value..cssPr
2d240 6f 70 73 3a 20 7b 7d 2c 0a 0a 09 2f 2f 20 47 65  ops: {},...// Ge
2d250 74 20 61 6e 64 20 73 65 74 20 74 68 65 20 73 74  t and set the st
2d260 79 6c 65 20 70 72 6f 70 65 72 74 79 20 6f 6e 20  yle property on 
2d270 61 20 44 4f 4d 20 4e 6f 64 65 0a 09 73 74 79 6c  a DOM Node..styl
2d280 65 3a 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c 65  e: function( ele
2d290 6d 2c 20 6e 61 6d 65 2c 20 76 61 6c 75 65 2c 20  m, name, value, 
2d2a0 65 78 74 72 61 20 29 20 7b 0a 0a 09 09 2f 2f 20  extra ) {....// 
2d2b0 44 6f 6e 27 74 20 73 65 74 20 73 74 79 6c 65 73  Don't set styles
2d2c0 20 6f 6e 20 74 65 78 74 20 61 6e 64 20 63 6f 6d   on text and com
2d2d0 6d 65 6e 74 20 6e 6f 64 65 73 0a 09 09 69 66 20  ment nodes...if 
2d2e0 28 20 21 65 6c 65 6d 20 7c 7c 20 65 6c 65 6d 2e  ( !elem || elem.
2d2f0 6e 6f 64 65 54 79 70 65 20 3d 3d 3d 20 33 20 7c  nodeType === 3 |
2d300 7c 20 65 6c 65 6d 2e 6e 6f 64 65 54 79 70 65 20  | elem.nodeType 
2d310 3d 3d 3d 20 38 20 7c 7c 20 21 65 6c 65 6d 2e 73  === 8 || !elem.s
2d320 74 79 6c 65 20 29 20 7b 0a 09 09 09 72 65 74 75  tyle ) {....retu
2d330 72 6e 3b 0a 09 09 7d 0a 0a 09 09 2f 2f 20 4d 61  rn;...}....// Ma
2d340 6b 65 20 73 75 72 65 20 74 68 61 74 20 77 65 27  ke sure that we'
2d350 72 65 20 77 6f 72 6b 69 6e 67 20 77 69 74 68 20  re working with 
2d360 74 68 65 20 72 69 67 68 74 20 6e 61 6d 65 0a 09  the right name..
2d370 09 76 61 72 20 72 65 74 2c 20 74 79 70 65 2c 20  .var ret, type, 
2d380 68 6f 6f 6b 73 2c 0a 09 09 09 6f 72 69 67 4e 61  hooks,....origNa
2d390 6d 65 20 3d 20 63 61 6d 65 6c 43 61 73 65 28 20  me = camelCase( 
2d3a0 6e 61 6d 65 20 29 2c 0a 09 09 09 69 73 43 75 73  name ),....isCus
2d3b0 74 6f 6d 50 72 6f 70 20 3d 20 72 63 75 73 74 6f  tomProp = rcusto
2d3c0 6d 50 72 6f 70 2e 74 65 73 74 28 20 6e 61 6d 65  mProp.test( name
2d3d0 20 29 2c 0a 09 09 09 73 74 79 6c 65 20 3d 20 65   ),....style = e
2d3e0 6c 65 6d 2e 73 74 79 6c 65 3b 0a 0a 09 09 2f 2f  lem.style;....//
2d3f0 20 4d 61 6b 65 20 73 75 72 65 20 74 68 61 74 20   Make sure that 
2d400 77 65 27 72 65 20 77 6f 72 6b 69 6e 67 20 77 69  we're working wi
2d410 74 68 20 74 68 65 20 72 69 67 68 74 20 6e 61 6d  th the right nam
2d420 65 2e 20 57 65 20 64 6f 6e 27 74 0a 09 09 2f 2f  e. We don't...//
2d430 20 77 61 6e 74 20 74 6f 20 71 75 65 72 79 20 74   want to query t
2d440 68 65 20 76 61 6c 75 65 20 69 66 20 69 74 20 69  he value if it i
2d450 73 20 61 20 43 53 53 20 63 75 73 74 6f 6d 20 70  s a CSS custom p
2d460 72 6f 70 65 72 74 79 0a 09 09 2f 2f 20 73 69 6e  roperty...// sin
2d470 63 65 20 74 68 65 79 20 61 72 65 20 75 73 65 72  ce they are user
2d480 2d 64 65 66 69 6e 65 64 2e 0a 09 09 69 66 20 28  -defined....if (
2d490 20 21 69 73 43 75 73 74 6f 6d 50 72 6f 70 20 29   !isCustomProp )
2d4a0 20 7b 0a 09 09 09 6e 61 6d 65 20 3d 20 66 69 6e   {....name = fin
2d4b0 61 6c 50 72 6f 70 4e 61 6d 65 28 20 6f 72 69 67  alPropName( orig
2d4c0 4e 61 6d 65 20 29 3b 0a 09 09 7d 0a 0a 09 09 2f  Name );...}..../
2d4d0 2f 20 47 65 74 73 20 68 6f 6f 6b 20 66 6f 72 20  / Gets hook for 
2d4e0 74 68 65 20 70 72 65 66 69 78 65 64 20 76 65 72  the prefixed ver
2d4f0 73 69 6f 6e 2c 20 74 68 65 6e 20 75 6e 70 72 65  sion, then unpre
2d500 66 69 78 65 64 20 76 65 72 73 69 6f 6e 0a 09 09  fixed version...
2d510 68 6f 6f 6b 73 20 3d 20 6a 51 75 65 72 79 2e 63  hooks = jQuery.c
2d520 73 73 48 6f 6f 6b 73 5b 20 6e 61 6d 65 20 5d 20  ssHooks[ name ] 
2d530 7c 7c 20 6a 51 75 65 72 79 2e 63 73 73 48 6f 6f  || jQuery.cssHoo
2d540 6b 73 5b 20 6f 72 69 67 4e 61 6d 65 20 5d 3b 0a  ks[ origName ];.
2d550 0a 09 09 2f 2f 20 43 68 65 63 6b 20 69 66 20 77  ...// Check if w
2d560 65 27 72 65 20 73 65 74 74 69 6e 67 20 61 20 76  e're setting a v
2d570 61 6c 75 65 0a 09 09 69 66 20 28 20 76 61 6c 75  alue...if ( valu
2d580 65 20 21 3d 3d 20 75 6e 64 65 66 69 6e 65 64 20  e !== undefined 
2d590 29 20 7b 0a 09 09 09 74 79 70 65 20 3d 20 74 79  ) {....type = ty
2d5a0 70 65 6f 66 20 76 61 6c 75 65 3b 0a 0a 09 09 09  peof value;.....
2d5b0 2f 2f 20 43 6f 6e 76 65 72 74 20 22 2b 3d 22 20  // Convert "+=" 
2d5c0 6f 72 20 22 2d 3d 22 20 74 6f 20 72 65 6c 61 74  or "-=" to relat
2d5d0 69 76 65 20 6e 75 6d 62 65 72 73 20 28 23 37 33  ive numbers (#73
2d5e0 34 35 29 0a 09 09 09 69 66 20 28 20 74 79 70 65  45)....if ( type
2d5f0 20 3d 3d 3d 20 22 73 74 72 69 6e 67 22 20 26 26   === "string" &&
2d600 20 28 20 72 65 74 20 3d 20 72 63 73 73 4e 75 6d   ( ret = rcssNum
2d610 2e 65 78 65 63 28 20 76 61 6c 75 65 20 29 20 29  .exec( value ) )
2d620 20 26 26 20 72 65 74 5b 20 31 20 5d 20 29 20 7b   && ret[ 1 ] ) {
2d630 0a 09 09 09 09 76 61 6c 75 65 20 3d 20 61 64 6a  .....value = adj
2d640 75 73 74 43 53 53 28 20 65 6c 65 6d 2c 20 6e 61  ustCSS( elem, na
2d650 6d 65 2c 20 72 65 74 20 29 3b 0a 0a 09 09 09 09  me, ret );......
2d660 2f 2f 20 46 69 78 65 73 20 62 75 67 20 23 39 32  // Fixes bug #92
2d670 33 37 0a 09 09 09 09 74 79 70 65 20 3d 20 22 6e  37.....type = "n
2d680 75 6d 62 65 72 22 3b 0a 09 09 09 7d 0a 0a 09 09  umber";....}....
2d690 09 2f 2f 20 4d 61 6b 65 20 73 75 72 65 20 74 68  .// Make sure th
2d6a0 61 74 20 6e 75 6c 6c 20 61 6e 64 20 4e 61 4e 20  at null and NaN 
2d6b0 76 61 6c 75 65 73 20 61 72 65 6e 27 74 20 73 65  values aren't se
2d6c0 74 20 28 23 37 31 31 36 29 0a 09 09 09 69 66 20  t (#7116)....if 
2d6d0 28 20 76 61 6c 75 65 20 3d 3d 20 6e 75 6c 6c 20  ( value == null 
2d6e0 7c 7c 20 76 61 6c 75 65 20 21 3d 3d 20 76 61 6c  || value !== val
2d6f0 75 65 20 29 20 7b 0a 09 09 09 09 72 65 74 75 72  ue ) {.....retur
2d700 6e 3b 0a 09 09 09 7d 0a 0a 09 09 09 2f 2f 20 49  n;....}.....// I
2d710 66 20 61 20 6e 75 6d 62 65 72 20 77 61 73 20 70  f a number was p
2d720 61 73 73 65 64 20 69 6e 2c 20 61 64 64 20 74 68  assed in, add th
2d730 65 20 75 6e 69 74 20 28 65 78 63 65 70 74 20 66  e unit (except f
2d740 6f 72 20 63 65 72 74 61 69 6e 20 43 53 53 20 70  or certain CSS p
2d750 72 6f 70 65 72 74 69 65 73 29 0a 09 09 09 2f 2f  roperties)....//
2d760 20 54 68 65 20 69 73 43 75 73 74 6f 6d 50 72 6f   The isCustomPro
2d770 70 20 63 68 65 63 6b 20 63 61 6e 20 62 65 20 72  p check can be r
2d780 65 6d 6f 76 65 64 20 69 6e 20 6a 51 75 65 72 79  emoved in jQuery
2d790 20 34 2e 30 20 77 68 65 6e 20 77 65 20 6f 6e 6c   4.0 when we onl
2d7a0 79 20 61 75 74 6f 2d 61 70 70 65 6e 64 0a 09 09  y auto-append...
2d7b0 09 2f 2f 20 22 70 78 22 20 74 6f 20 61 20 66 65  .// "px" to a fe
2d7c0 77 20 68 61 72 64 63 6f 64 65 64 20 76 61 6c 75  w hardcoded valu
2d7d0 65 73 2e 0a 09 09 09 69 66 20 28 20 74 79 70 65  es.....if ( type
2d7e0 20 3d 3d 3d 20 22 6e 75 6d 62 65 72 22 20 26 26   === "number" &&
2d7f0 20 21 69 73 43 75 73 74 6f 6d 50 72 6f 70 20 29   !isCustomProp )
2d800 20 7b 0a 09 09 09 09 76 61 6c 75 65 20 2b 3d 20   {.....value += 
2d810 72 65 74 20 26 26 20 72 65 74 5b 20 33 20 5d 20  ret && ret[ 3 ] 
2d820 7c 7c 20 28 20 6a 51 75 65 72 79 2e 63 73 73 4e  || ( jQuery.cssN
2d830 75 6d 62 65 72 5b 20 6f 72 69 67 4e 61 6d 65 20  umber[ origName 
2d840 5d 20 3f 20 22 22 20 3a 20 22 70 78 22 20 29 3b  ] ? "" : "px" );
2d850 0a 09 09 09 7d 0a 0a 09 09 09 2f 2f 20 62 61 63  ....}.....// bac
2d860 6b 67 72 6f 75 6e 64 2d 2a 20 70 72 6f 70 73 20  kground-* props 
2d870 61 66 66 65 63 74 20 6f 72 69 67 69 6e 61 6c 20  affect original 
2d880 63 6c 6f 6e 65 27 73 20 76 61 6c 75 65 73 0a 09  clone's values..
2d890 09 09 69 66 20 28 20 21 73 75 70 70 6f 72 74 2e  ..if ( !support.
2d8a0 63 6c 65 61 72 43 6c 6f 6e 65 53 74 79 6c 65 20  clearCloneStyle 
2d8b0 26 26 20 76 61 6c 75 65 20 3d 3d 3d 20 22 22 20  && value === "" 
2d8c0 26 26 20 6e 61 6d 65 2e 69 6e 64 65 78 4f 66 28  && name.indexOf(
2d8d0 20 22 62 61 63 6b 67 72 6f 75 6e 64 22 20 29 20   "background" ) 
2d8e0 3d 3d 3d 20 30 20 29 20 7b 0a 09 09 09 09 73 74  === 0 ) {.....st
2d8f0 79 6c 65 5b 20 6e 61 6d 65 20 5d 20 3d 20 22 69  yle[ name ] = "i
2d900 6e 68 65 72 69 74 22 3b 0a 09 09 09 7d 0a 0a 09  nherit";....}...
2d910 09 09 2f 2f 20 49 66 20 61 20 68 6f 6f 6b 20 77  ..// If a hook w
2d920 61 73 20 70 72 6f 76 69 64 65 64 2c 20 75 73 65  as provided, use
2d930 20 74 68 61 74 20 76 61 6c 75 65 2c 20 6f 74 68   that value, oth
2d940 65 72 77 69 73 65 20 6a 75 73 74 20 73 65 74 20  erwise just set 
2d950 74 68 65 20 73 70 65 63 69 66 69 65 64 20 76 61  the specified va
2d960 6c 75 65 0a 09 09 09 69 66 20 28 20 21 68 6f 6f  lue....if ( !hoo
2d970 6b 73 20 7c 7c 20 21 28 20 22 73 65 74 22 20 69  ks || !( "set" i
2d980 6e 20 68 6f 6f 6b 73 20 29 20 7c 7c 0a 09 09 09  n hooks ) ||....
2d990 09 28 20 76 61 6c 75 65 20 3d 20 68 6f 6f 6b 73  .( value = hooks
2d9a0 2e 73 65 74 28 20 65 6c 65 6d 2c 20 76 61 6c 75  .set( elem, valu
2d9b0 65 2c 20 65 78 74 72 61 20 29 20 29 20 21 3d 3d  e, extra ) ) !==
2d9c0 20 75 6e 64 65 66 69 6e 65 64 20 29 20 7b 0a 0a   undefined ) {..
2d9d0 09 09 09 09 69 66 20 28 20 69 73 43 75 73 74 6f  ....if ( isCusto
2d9e0 6d 50 72 6f 70 20 29 20 7b 0a 09 09 09 09 09 73  mProp ) {......s
2d9f0 74 79 6c 65 2e 73 65 74 50 72 6f 70 65 72 74 79  tyle.setProperty
2da00 28 20 6e 61 6d 65 2c 20 76 61 6c 75 65 20 29 3b  ( name, value );
2da10 0a 09 09 09 09 7d 20 65 6c 73 65 20 7b 0a 09 09  .....} else {...
2da20 09 09 09 73 74 79 6c 65 5b 20 6e 61 6d 65 20 5d  ...style[ name ]
2da30 20 3d 20 76 61 6c 75 65 3b 0a 09 09 09 09 7d 0a   = value;.....}.
2da40 09 09 09 7d 0a 0a 09 09 7d 20 65 6c 73 65 20 7b  ...}....} else {
2da50 0a 0a 09 09 09 2f 2f 20 49 66 20 61 20 68 6f 6f  .....// If a hoo
2da60 6b 20 77 61 73 20 70 72 6f 76 69 64 65 64 20 67  k was provided g
2da70 65 74 20 74 68 65 20 6e 6f 6e 2d 63 6f 6d 70 75  et the non-compu
2da80 74 65 64 20 76 61 6c 75 65 20 66 72 6f 6d 20 74  ted value from t
2da90 68 65 72 65 0a 09 09 09 69 66 20 28 20 68 6f 6f  here....if ( hoo
2daa0 6b 73 20 26 26 20 22 67 65 74 22 20 69 6e 20 68  ks && "get" in h
2dab0 6f 6f 6b 73 20 26 26 0a 09 09 09 09 28 20 72 65  ooks &&.....( re
2dac0 74 20 3d 20 68 6f 6f 6b 73 2e 67 65 74 28 20 65  t = hooks.get( e
2dad0 6c 65 6d 2c 20 66 61 6c 73 65 2c 20 65 78 74 72  lem, false, extr
2dae0 61 20 29 20 29 20 21 3d 3d 20 75 6e 64 65 66 69  a ) ) !== undefi
2daf0 6e 65 64 20 29 20 7b 0a 0a 09 09 09 09 72 65 74  ned ) {......ret
2db00 75 72 6e 20 72 65 74 3b 0a 09 09 09 7d 0a 0a 09  urn ret;....}...
2db10 09 09 2f 2f 20 4f 74 68 65 72 77 69 73 65 20 6a  ..// Otherwise j
2db20 75 73 74 20 67 65 74 20 74 68 65 20 76 61 6c 75  ust get the valu
2db30 65 20 66 72 6f 6d 20 74 68 65 20 73 74 79 6c 65  e from the style
2db40 20 6f 62 6a 65 63 74 0a 09 09 09 72 65 74 75 72   object....retur
2db50 6e 20 73 74 79 6c 65 5b 20 6e 61 6d 65 20 5d 3b  n style[ name ];
2db60 0a 09 09 7d 0a 09 7d 2c 0a 0a 09 63 73 73 3a 20  ...}..},...css: 
2db70 66 75 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 2c 20  function( elem, 
2db80 6e 61 6d 65 2c 20 65 78 74 72 61 2c 20 73 74 79  name, extra, sty
2db90 6c 65 73 20 29 20 7b 0a 09 09 76 61 72 20 76 61  les ) {...var va
2dba0 6c 2c 20 6e 75 6d 2c 20 68 6f 6f 6b 73 2c 0a 09  l, num, hooks,..
2dbb0 09 09 6f 72 69 67 4e 61 6d 65 20 3d 20 63 61 6d  ..origName = cam
2dbc0 65 6c 43 61 73 65 28 20 6e 61 6d 65 20 29 2c 0a  elCase( name ),.
2dbd0 09 09 09 69 73 43 75 73 74 6f 6d 50 72 6f 70 20  ...isCustomProp 
2dbe0 3d 20 72 63 75 73 74 6f 6d 50 72 6f 70 2e 74 65  = rcustomProp.te
2dbf0 73 74 28 20 6e 61 6d 65 20 29 3b 0a 0a 09 09 2f  st( name );..../
2dc00 2f 20 4d 61 6b 65 20 73 75 72 65 20 74 68 61 74  / Make sure that
2dc10 20 77 65 27 72 65 20 77 6f 72 6b 69 6e 67 20 77   we're working w
2dc20 69 74 68 20 74 68 65 20 72 69 67 68 74 20 6e 61  ith the right na
2dc30 6d 65 2e 20 57 65 20 64 6f 6e 27 74 0a 09 09 2f  me. We don't.../
2dc40 2f 20 77 61 6e 74 20 74 6f 20 6d 6f 64 69 66 79  / want to modify
2dc50 20 74 68 65 20 76 61 6c 75 65 20 69 66 20 69 74   the value if it
2dc60 20 69 73 20 61 20 43 53 53 20 63 75 73 74 6f 6d   is a CSS custom
2dc70 20 70 72 6f 70 65 72 74 79 0a 09 09 2f 2f 20 73   property...// s
2dc80 69 6e 63 65 20 74 68 65 79 20 61 72 65 20 75 73  ince they are us
2dc90 65 72 2d 64 65 66 69 6e 65 64 2e 0a 09 09 69 66  er-defined....if
2dca0 20 28 20 21 69 73 43 75 73 74 6f 6d 50 72 6f 70   ( !isCustomProp
2dcb0 20 29 20 7b 0a 09 09 09 6e 61 6d 65 20 3d 20 66   ) {....name = f
2dcc0 69 6e 61 6c 50 72 6f 70 4e 61 6d 65 28 20 6f 72  inalPropName( or
2dcd0 69 67 4e 61 6d 65 20 29 3b 0a 09 09 7d 0a 0a 09  igName );...}...
2dce0 09 2f 2f 20 54 72 79 20 70 72 65 66 69 78 65 64  .// Try prefixed
2dcf0 20 6e 61 6d 65 20 66 6f 6c 6c 6f 77 65 64 20 62   name followed b
2dd00 79 20 74 68 65 20 75 6e 70 72 65 66 69 78 65 64  y the unprefixed
2dd10 20 6e 61 6d 65 0a 09 09 68 6f 6f 6b 73 20 3d 20   name...hooks = 
2dd20 6a 51 75 65 72 79 2e 63 73 73 48 6f 6f 6b 73 5b  jQuery.cssHooks[
2dd30 20 6e 61 6d 65 20 5d 20 7c 7c 20 6a 51 75 65 72   name ] || jQuer
2dd40 79 2e 63 73 73 48 6f 6f 6b 73 5b 20 6f 72 69 67  y.cssHooks[ orig
2dd50 4e 61 6d 65 20 5d 3b 0a 0a 09 09 2f 2f 20 49 66  Name ];....// If
2dd60 20 61 20 68 6f 6f 6b 20 77 61 73 20 70 72 6f 76   a hook was prov
2dd70 69 64 65 64 20 67 65 74 20 74 68 65 20 63 6f 6d  ided get the com
2dd80 70 75 74 65 64 20 76 61 6c 75 65 20 66 72 6f 6d  puted value from
2dd90 20 74 68 65 72 65 0a 09 09 69 66 20 28 20 68 6f   there...if ( ho
2dda0 6f 6b 73 20 26 26 20 22 67 65 74 22 20 69 6e 20  oks && "get" in 
2ddb0 68 6f 6f 6b 73 20 29 20 7b 0a 09 09 09 76 61 6c  hooks ) {....val
2ddc0 20 3d 20 68 6f 6f 6b 73 2e 67 65 74 28 20 65 6c   = hooks.get( el
2ddd0 65 6d 2c 20 74 72 75 65 2c 20 65 78 74 72 61 20  em, true, extra 
2dde0 29 3b 0a 09 09 7d 0a 0a 09 09 2f 2f 20 4f 74 68  );...}....// Oth
2ddf0 65 72 77 69 73 65 2c 20 69 66 20 61 20 77 61 79  erwise, if a way
2de00 20 74 6f 20 67 65 74 20 74 68 65 20 63 6f 6d 70   to get the comp
2de10 75 74 65 64 20 76 61 6c 75 65 20 65 78 69 73 74  uted value exist
2de20 73 2c 20 75 73 65 20 74 68 61 74 0a 09 09 69 66  s, use that...if
2de30 20 28 20 76 61 6c 20 3d 3d 3d 20 75 6e 64 65 66   ( val === undef
2de40 69 6e 65 64 20 29 20 7b 0a 09 09 09 76 61 6c 20  ined ) {....val 
2de50 3d 20 63 75 72 43 53 53 28 20 65 6c 65 6d 2c 20  = curCSS( elem, 
2de60 6e 61 6d 65 2c 20 73 74 79 6c 65 73 20 29 3b 0a  name, styles );.
2de70 09 09 7d 0a 0a 09 09 2f 2f 20 43 6f 6e 76 65 72  ..}....// Conver
2de80 74 20 22 6e 6f 72 6d 61 6c 22 20 74 6f 20 63 6f  t "normal" to co
2de90 6d 70 75 74 65 64 20 76 61 6c 75 65 0a 09 09 69  mputed value...i
2dea0 66 20 28 20 76 61 6c 20 3d 3d 3d 20 22 6e 6f 72  f ( val === "nor
2deb0 6d 61 6c 22 20 26 26 20 6e 61 6d 65 20 69 6e 20  mal" && name in 
2dec0 63 73 73 4e 6f 72 6d 61 6c 54 72 61 6e 73 66 6f  cssNormalTransfo
2ded0 72 6d 20 29 20 7b 0a 09 09 09 76 61 6c 20 3d 20  rm ) {....val = 
2dee0 63 73 73 4e 6f 72 6d 61 6c 54 72 61 6e 73 66 6f  cssNormalTransfo
2def0 72 6d 5b 20 6e 61 6d 65 20 5d 3b 0a 09 09 7d 0a  rm[ name ];...}.
2df00 0a 09 09 2f 2f 20 4d 61 6b 65 20 6e 75 6d 65 72  ...// Make numer
2df10 69 63 20 69 66 20 66 6f 72 63 65 64 20 6f 72 20  ic if forced or 
2df20 61 20 71 75 61 6c 69 66 69 65 72 20 77 61 73 20  a qualifier was 
2df30 70 72 6f 76 69 64 65 64 20 61 6e 64 20 76 61 6c  provided and val
2df40 20 6c 6f 6f 6b 73 20 6e 75 6d 65 72 69 63 0a 09   looks numeric..
2df50 09 69 66 20 28 20 65 78 74 72 61 20 3d 3d 3d 20  .if ( extra === 
2df60 22 22 20 7c 7c 20 65 78 74 72 61 20 29 20 7b 0a  "" || extra ) {.
2df70 09 09 09 6e 75 6d 20 3d 20 70 61 72 73 65 46 6c  ...num = parseFl
2df80 6f 61 74 28 20 76 61 6c 20 29 3b 0a 09 09 09 72  oat( val );....r
2df90 65 74 75 72 6e 20 65 78 74 72 61 20 3d 3d 3d 20  eturn extra === 
2dfa0 74 72 75 65 20 7c 7c 20 69 73 46 69 6e 69 74 65  true || isFinite
2dfb0 28 20 6e 75 6d 20 29 20 3f 20 6e 75 6d 20 7c 7c  ( num ) ? num ||
2dfc0 20 30 20 3a 20 76 61 6c 3b 0a 09 09 7d 0a 0a 09   0 : val;...}...
2dfd0 09 72 65 74 75 72 6e 20 76 61 6c 3b 0a 09 7d 0a  .return val;..}.
2dfe0 7d 20 29 3b 0a 0a 6a 51 75 65 72 79 2e 65 61 63  } );..jQuery.eac
2dff0 68 28 20 5b 20 22 68 65 69 67 68 74 22 2c 20 22  h( [ "height", "
2e000 77 69 64 74 68 22 20 5d 2c 20 66 75 6e 63 74 69  width" ], functi
2e010 6f 6e 28 20 5f 69 2c 20 64 69 6d 65 6e 73 69 6f  on( _i, dimensio
2e020 6e 20 29 20 7b 0a 09 6a 51 75 65 72 79 2e 63 73  n ) {..jQuery.cs
2e030 73 48 6f 6f 6b 73 5b 20 64 69 6d 65 6e 73 69 6f  sHooks[ dimensio
2e040 6e 20 5d 20 3d 20 7b 0a 09 09 67 65 74 3a 20 66  n ] = {...get: f
2e050 75 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 2c 20 63  unction( elem, c
2e060 6f 6d 70 75 74 65 64 2c 20 65 78 74 72 61 20 29  omputed, extra )
2e070 20 7b 0a 09 09 09 69 66 20 28 20 63 6f 6d 70 75   {....if ( compu
2e080 74 65 64 20 29 20 7b 0a 0a 09 09 09 09 2f 2f 20  ted ) {......// 
2e090 43 65 72 74 61 69 6e 20 65 6c 65 6d 65 6e 74 73  Certain elements
2e0a0 20 63 61 6e 20 68 61 76 65 20 64 69 6d 65 6e 73   can have dimens
2e0b0 69 6f 6e 20 69 6e 66 6f 20 69 66 20 77 65 20 69  ion info if we i
2e0c0 6e 76 69 73 69 62 6c 79 20 73 68 6f 77 20 74 68  nvisibly show th
2e0d0 65 6d 0a 09 09 09 09 2f 2f 20 62 75 74 20 69 74  em.....// but it
2e0e0 20 6d 75 73 74 20 68 61 76 65 20 61 20 63 75 72   must have a cur
2e0f0 72 65 6e 74 20 64 69 73 70 6c 61 79 20 73 74 79  rent display sty
2e100 6c 65 20 74 68 61 74 20 77 6f 75 6c 64 20 62 65  le that would be
2e110 6e 65 66 69 74 0a 09 09 09 09 72 65 74 75 72 6e  nefit.....return
2e120 20 72 64 69 73 70 6c 61 79 73 77 61 70 2e 74 65   rdisplayswap.te
2e130 73 74 28 20 6a 51 75 65 72 79 2e 63 73 73 28 20  st( jQuery.css( 
2e140 65 6c 65 6d 2c 20 22 64 69 73 70 6c 61 79 22 20  elem, "display" 
2e150 29 20 29 20 26 26 0a 0a 09 09 09 09 09 2f 2f 20  ) ) &&.......// 
2e160 53 75 70 70 6f 72 74 3a 20 53 61 66 61 72 69 20  Support: Safari 
2e170 38 2b 0a 09 09 09 09 09 2f 2f 20 54 61 62 6c 65  8+......// Table
2e180 20 63 6f 6c 75 6d 6e 73 20 69 6e 20 53 61 66 61   columns in Safa
2e190 72 69 20 68 61 76 65 20 6e 6f 6e 2d 7a 65 72 6f  ri have non-zero
2e1a0 20 6f 66 66 73 65 74 57 69 64 74 68 20 26 20 7a   offsetWidth & z
2e1b0 65 72 6f 0a 09 09 09 09 09 2f 2f 20 67 65 74 42  ero......// getB
2e1c0 6f 75 6e 64 69 6e 67 43 6c 69 65 6e 74 52 65 63  oundingClientRec
2e1d0 74 28 29 2e 77 69 64 74 68 20 75 6e 6c 65 73 73  t().width unless
2e1e0 20 64 69 73 70 6c 61 79 20 69 73 20 63 68 61 6e   display is chan
2e1f0 67 65 64 2e 0a 09 09 09 09 09 2f 2f 20 53 75 70  ged.......// Sup
2e200 70 6f 72 74 3a 20 49 45 20 3c 3d 31 31 20 6f 6e  port: IE <=11 on
2e210 6c 79 0a 09 09 09 09 09 2f 2f 20 52 75 6e 6e 69  ly......// Runni
2e220 6e 67 20 67 65 74 42 6f 75 6e 64 69 6e 67 43 6c  ng getBoundingCl
2e230 69 65 6e 74 52 65 63 74 20 6f 6e 20 61 20 64 69  ientRect on a di
2e240 73 63 6f 6e 6e 65 63 74 65 64 20 6e 6f 64 65 0a  sconnected node.
2e250 09 09 09 09 09 2f 2f 20 69 6e 20 49 45 20 74 68  .....// in IE th
2e260 72 6f 77 73 20 61 6e 20 65 72 72 6f 72 2e 0a 09  rows an error...
2e270 09 09 09 09 28 20 21 65 6c 65 6d 2e 67 65 74 43  ....( !elem.getC
2e280 6c 69 65 6e 74 52 65 63 74 73 28 29 2e 6c 65 6e  lientRects().len
2e290 67 74 68 20 7c 7c 20 21 65 6c 65 6d 2e 67 65 74  gth || !elem.get
2e2a0 42 6f 75 6e 64 69 6e 67 43 6c 69 65 6e 74 52 65  BoundingClientRe
2e2b0 63 74 28 29 2e 77 69 64 74 68 20 29 20 3f 0a 09  ct().width ) ?..
2e2c0 09 09 09 09 09 73 77 61 70 28 20 65 6c 65 6d 2c  .....swap( elem,
2e2d0 20 63 73 73 53 68 6f 77 2c 20 66 75 6e 63 74 69   cssShow, functi
2e2e0 6f 6e 28 29 20 7b 0a 09 09 09 09 09 09 09 72 65  on() {........re
2e2f0 74 75 72 6e 20 67 65 74 57 69 64 74 68 4f 72 48  turn getWidthOrH
2e300 65 69 67 68 74 28 20 65 6c 65 6d 2c 20 64 69 6d  eight( elem, dim
2e310 65 6e 73 69 6f 6e 2c 20 65 78 74 72 61 20 29 3b  ension, extra );
2e320 0a 09 09 09 09 09 09 7d 20 29 20 3a 0a 09 09 09  .......} ) :....
2e330 09 09 09 67 65 74 57 69 64 74 68 4f 72 48 65 69  ...getWidthOrHei
2e340 67 68 74 28 20 65 6c 65 6d 2c 20 64 69 6d 65 6e  ght( elem, dimen
2e350 73 69 6f 6e 2c 20 65 78 74 72 61 20 29 3b 0a 09  sion, extra );..
2e360 09 09 7d 0a 09 09 7d 2c 0a 0a 09 09 73 65 74 3a  ..}...},....set:
2e370 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 2c   function( elem,
2e380 20 76 61 6c 75 65 2c 20 65 78 74 72 61 20 29 20   value, extra ) 
2e390 7b 0a 09 09 09 76 61 72 20 6d 61 74 63 68 65 73  {....var matches
2e3a0 2c 0a 09 09 09 09 73 74 79 6c 65 73 20 3d 20 67  ,.....styles = g
2e3b0 65 74 53 74 79 6c 65 73 28 20 65 6c 65 6d 20 29  etStyles( elem )
2e3c0 2c 0a 0a 09 09 09 09 2f 2f 20 4f 6e 6c 79 20 72  ,......// Only r
2e3d0 65 61 64 20 73 74 79 6c 65 73 2e 70 6f 73 69 74  ead styles.posit
2e3e0 69 6f 6e 20 69 66 20 74 68 65 20 74 65 73 74 20  ion if the test 
2e3f0 68 61 73 20 61 20 63 68 61 6e 63 65 20 74 6f 20  has a chance to 
2e400 66 61 69 6c 0a 09 09 09 09 2f 2f 20 74 6f 20 61  fail.....// to a
2e410 76 6f 69 64 20 66 6f 72 63 69 6e 67 20 61 20 72  void forcing a r
2e420 65 66 6c 6f 77 2e 0a 09 09 09 09 73 63 72 6f 6c  eflow......scrol
2e430 6c 62 6f 78 53 69 7a 65 42 75 67 67 79 20 3d 20  lboxSizeBuggy = 
2e440 21 73 75 70 70 6f 72 74 2e 73 63 72 6f 6c 6c 62  !support.scrollb
2e450 6f 78 53 69 7a 65 28 29 20 26 26 0a 09 09 09 09  oxSize() &&.....
2e460 09 73 74 79 6c 65 73 2e 70 6f 73 69 74 69 6f 6e  .styles.position
2e470 20 3d 3d 3d 20 22 61 62 73 6f 6c 75 74 65 22 2c   === "absolute",
2e480 0a 0a 09 09 09 09 2f 2f 20 54 6f 20 61 76 6f 69  ......// To avoi
2e490 64 20 66 6f 72 63 69 6e 67 20 61 20 72 65 66 6c  d forcing a refl
2e4a0 6f 77 2c 20 6f 6e 6c 79 20 66 65 74 63 68 20 62  ow, only fetch b
2e4b0 6f 78 53 69 7a 69 6e 67 20 69 66 20 77 65 20 6e  oxSizing if we n
2e4c0 65 65 64 20 69 74 20 28 67 68 2d 33 39 39 31 29  eed it (gh-3991)
2e4d0 0a 09 09 09 09 62 6f 78 53 69 7a 69 6e 67 4e 65  .....boxSizingNe
2e4e0 65 64 65 64 20 3d 20 73 63 72 6f 6c 6c 62 6f 78  eded = scrollbox
2e4f0 53 69 7a 65 42 75 67 67 79 20 7c 7c 20 65 78 74  SizeBuggy || ext
2e500 72 61 2c 0a 09 09 09 09 69 73 42 6f 72 64 65 72  ra,.....isBorder
2e510 42 6f 78 20 3d 20 62 6f 78 53 69 7a 69 6e 67 4e  Box = boxSizingN
2e520 65 65 64 65 64 20 26 26 0a 09 09 09 09 09 6a 51  eeded &&......jQ
2e530 75 65 72 79 2e 63 73 73 28 20 65 6c 65 6d 2c 20  uery.css( elem, 
2e540 22 62 6f 78 53 69 7a 69 6e 67 22 2c 20 66 61 6c  "boxSizing", fal
2e550 73 65 2c 20 73 74 79 6c 65 73 20 29 20 3d 3d 3d  se, styles ) ===
2e560 20 22 62 6f 72 64 65 72 2d 62 6f 78 22 2c 0a 09   "border-box",..
2e570 09 09 09 73 75 62 74 72 61 63 74 20 3d 20 65 78  ...subtract = ex
2e580 74 72 61 20 3f 0a 09 09 09 09 09 62 6f 78 4d 6f  tra ?......boxMo
2e590 64 65 6c 41 64 6a 75 73 74 6d 65 6e 74 28 0a 09  delAdjustment(..
2e5a0 09 09 09 09 09 65 6c 65 6d 2c 0a 09 09 09 09 09  .....elem,......
2e5b0 09 64 69 6d 65 6e 73 69 6f 6e 2c 0a 09 09 09 09  .dimension,.....
2e5c0 09 09 65 78 74 72 61 2c 0a 09 09 09 09 09 09 69  ..extra,.......i
2e5d0 73 42 6f 72 64 65 72 42 6f 78 2c 0a 09 09 09 09  sBorderBox,.....
2e5e0 09 09 73 74 79 6c 65 73 0a 09 09 09 09 09 29 20  ..styles......) 
2e5f0 3a 0a 09 09 09 09 09 30 3b 0a 0a 09 09 09 2f 2f  :......0;.....//
2e600 20 41 63 63 6f 75 6e 74 20 66 6f 72 20 75 6e 72   Account for unr
2e610 65 6c 69 61 62 6c 65 20 62 6f 72 64 65 72 2d 62  eliable border-b
2e620 6f 78 20 64 69 6d 65 6e 73 69 6f 6e 73 20 62 79  ox dimensions by
2e630 20 63 6f 6d 70 61 72 69 6e 67 20 6f 66 66 73 65   comparing offse
2e640 74 2a 20 74 6f 20 63 6f 6d 70 75 74 65 64 20 61  t* to computed a
2e650 6e 64 0a 09 09 09 2f 2f 20 66 61 6b 69 6e 67 20  nd....// faking 
2e660 61 20 63 6f 6e 74 65 6e 74 2d 62 6f 78 20 74 6f  a content-box to
2e670 20 67 65 74 20 62 6f 72 64 65 72 20 61 6e 64 20   get border and 
2e680 70 61 64 64 69 6e 67 20 28 67 68 2d 33 36 39 39  padding (gh-3699
2e690 29 0a 09 09 09 69 66 20 28 20 69 73 42 6f 72 64  )....if ( isBord
2e6a0 65 72 42 6f 78 20 26 26 20 73 63 72 6f 6c 6c 62  erBox && scrollb
2e6b0 6f 78 53 69 7a 65 42 75 67 67 79 20 29 20 7b 0a  oxSizeBuggy ) {.
2e6c0 09 09 09 09 73 75 62 74 72 61 63 74 20 2d 3d 20  ....subtract -= 
2e6d0 4d 61 74 68 2e 63 65 69 6c 28 0a 09 09 09 09 09  Math.ceil(......
2e6e0 65 6c 65 6d 5b 20 22 6f 66 66 73 65 74 22 20 2b  elem[ "offset" +
2e6f0 20 64 69 6d 65 6e 73 69 6f 6e 5b 20 30 20 5d 2e   dimension[ 0 ].
2e700 74 6f 55 70 70 65 72 43 61 73 65 28 29 20 2b 20  toUpperCase() + 
2e710 64 69 6d 65 6e 73 69 6f 6e 2e 73 6c 69 63 65 28  dimension.slice(
2e720 20 31 20 29 20 5d 20 2d 0a 09 09 09 09 09 70 61   1 ) ] -......pa
2e730 72 73 65 46 6c 6f 61 74 28 20 73 74 79 6c 65 73  rseFloat( styles
2e740 5b 20 64 69 6d 65 6e 73 69 6f 6e 20 5d 20 29 20  [ dimension ] ) 
2e750 2d 0a 09 09 09 09 09 62 6f 78 4d 6f 64 65 6c 41  -......boxModelA
2e760 64 6a 75 73 74 6d 65 6e 74 28 20 65 6c 65 6d 2c  djustment( elem,
2e770 20 64 69 6d 65 6e 73 69 6f 6e 2c 20 22 62 6f 72   dimension, "bor
2e780 64 65 72 22 2c 20 66 61 6c 73 65 2c 20 73 74 79  der", false, sty
2e790 6c 65 73 20 29 20 2d 0a 09 09 09 09 09 30 2e 35  les ) -......0.5
2e7a0 0a 09 09 09 09 29 3b 0a 09 09 09 7d 0a 0a 09 09  .....);....}....
2e7b0 09 2f 2f 20 43 6f 6e 76 65 72 74 20 74 6f 20 70  .// Convert to p
2e7c0 69 78 65 6c 73 20 69 66 20 76 61 6c 75 65 20 61  ixels if value a
2e7d0 64 6a 75 73 74 6d 65 6e 74 20 69 73 20 6e 65 65  djustment is nee
2e7e0 64 65 64 0a 09 09 09 69 66 20 28 20 73 75 62 74  ded....if ( subt
2e7f0 72 61 63 74 20 26 26 20 28 20 6d 61 74 63 68 65  ract && ( matche
2e800 73 20 3d 20 72 63 73 73 4e 75 6d 2e 65 78 65 63  s = rcssNum.exec
2e810 28 20 76 61 6c 75 65 20 29 20 29 20 26 26 0a 09  ( value ) ) &&..
2e820 09 09 09 28 20 6d 61 74 63 68 65 73 5b 20 33 20  ...( matches[ 3 
2e830 5d 20 7c 7c 20 22 70 78 22 20 29 20 21 3d 3d 20  ] || "px" ) !== 
2e840 22 70 78 22 20 29 20 7b 0a 0a 09 09 09 09 65 6c  "px" ) {......el
2e850 65 6d 2e 73 74 79 6c 65 5b 20 64 69 6d 65 6e 73  em.style[ dimens
2e860 69 6f 6e 20 5d 20 3d 20 76 61 6c 75 65 3b 0a 09  ion ] = value;..
2e870 09 09 09 76 61 6c 75 65 20 3d 20 6a 51 75 65 72  ...value = jQuer
2e880 79 2e 63 73 73 28 20 65 6c 65 6d 2c 20 64 69 6d  y.css( elem, dim
2e890 65 6e 73 69 6f 6e 20 29 3b 0a 09 09 09 7d 0a 0a  ension );....}..
2e8a0 09 09 09 72 65 74 75 72 6e 20 73 65 74 50 6f 73  ...return setPos
2e8b0 69 74 69 76 65 4e 75 6d 62 65 72 28 20 65 6c 65  itiveNumber( ele
2e8c0 6d 2c 20 76 61 6c 75 65 2c 20 73 75 62 74 72 61  m, value, subtra
2e8d0 63 74 20 29 3b 0a 09 09 7d 0a 09 7d 3b 0a 7d 20  ct );...}..};.} 
2e8e0 29 3b 0a 0a 6a 51 75 65 72 79 2e 63 73 73 48 6f  );..jQuery.cssHo
2e8f0 6f 6b 73 2e 6d 61 72 67 69 6e 4c 65 66 74 20 3d  oks.marginLeft =
2e900 20 61 64 64 47 65 74 48 6f 6f 6b 49 66 28 20 73   addGetHookIf( s
2e910 75 70 70 6f 72 74 2e 72 65 6c 69 61 62 6c 65 4d  upport.reliableM
2e920 61 72 67 69 6e 4c 65 66 74 2c 0a 09 66 75 6e 63  arginLeft,..func
2e930 74 69 6f 6e 28 20 65 6c 65 6d 2c 20 63 6f 6d 70  tion( elem, comp
2e940 75 74 65 64 20 29 20 7b 0a 09 09 69 66 20 28 20  uted ) {...if ( 
2e950 63 6f 6d 70 75 74 65 64 20 29 20 7b 0a 09 09 09  computed ) {....
2e960 72 65 74 75 72 6e 20 28 20 70 61 72 73 65 46 6c  return ( parseFl
2e970 6f 61 74 28 20 63 75 72 43 53 53 28 20 65 6c 65  oat( curCSS( ele
2e980 6d 2c 20 22 6d 61 72 67 69 6e 4c 65 66 74 22 20  m, "marginLeft" 
2e990 29 20 29 20 7c 7c 0a 09 09 09 09 65 6c 65 6d 2e  ) ) ||.....elem.
2e9a0 67 65 74 42 6f 75 6e 64 69 6e 67 43 6c 69 65 6e  getBoundingClien
2e9b0 74 52 65 63 74 28 29 2e 6c 65 66 74 20 2d 0a 09  tRect().left -..
2e9c0 09 09 09 09 73 77 61 70 28 20 65 6c 65 6d 2c 20  ....swap( elem, 
2e9d0 7b 20 6d 61 72 67 69 6e 4c 65 66 74 3a 20 30 20  { marginLeft: 0 
2e9e0 7d 2c 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a  }, function() {.
2e9f0 09 09 09 09 09 09 72 65 74 75 72 6e 20 65 6c 65  ......return ele
2ea00 6d 2e 67 65 74 42 6f 75 6e 64 69 6e 67 43 6c 69  m.getBoundingCli
2ea10 65 6e 74 52 65 63 74 28 29 2e 6c 65 66 74 3b 0a  entRect().left;.
2ea20 09 09 09 09 09 7d 20 29 0a 09 09 09 09 29 20 2b  .....} ).....) +
2ea30 20 22 70 78 22 3b 0a 09 09 7d 0a 09 7d 0a 29 3b   "px";...}..}.);
2ea40 0a 0a 2f 2f 20 54 68 65 73 65 20 68 6f 6f 6b 73  ..// These hooks
2ea50 20 61 72 65 20 75 73 65 64 20 62 79 20 61 6e 69   are used by ani
2ea60 6d 61 74 65 20 74 6f 20 65 78 70 61 6e 64 20 70  mate to expand p
2ea70 72 6f 70 65 72 74 69 65 73 0a 6a 51 75 65 72 79  roperties.jQuery
2ea80 2e 65 61 63 68 28 20 7b 0a 09 6d 61 72 67 69 6e  .each( {..margin
2ea90 3a 20 22 22 2c 0a 09 70 61 64 64 69 6e 67 3a 20  : "",..padding: 
2eaa0 22 22 2c 0a 09 62 6f 72 64 65 72 3a 20 22 57 69  "",..border: "Wi
2eab0 64 74 68 22 0a 7d 2c 20 66 75 6e 63 74 69 6f 6e  dth".}, function
2eac0 28 20 70 72 65 66 69 78 2c 20 73 75 66 66 69 78  ( prefix, suffix
2ead0 20 29 20 7b 0a 09 6a 51 75 65 72 79 2e 63 73 73   ) {..jQuery.css
2eae0 48 6f 6f 6b 73 5b 20 70 72 65 66 69 78 20 2b 20  Hooks[ prefix + 
2eaf0 73 75 66 66 69 78 20 5d 20 3d 20 7b 0a 09 09 65  suffix ] = {...e
2eb00 78 70 61 6e 64 3a 20 66 75 6e 63 74 69 6f 6e 28  xpand: function(
2eb10 20 76 61 6c 75 65 20 29 20 7b 0a 09 09 09 76 61   value ) {....va
2eb20 72 20 69 20 3d 20 30 2c 0a 09 09 09 09 65 78 70  r i = 0,.....exp
2eb30 61 6e 64 65 64 20 3d 20 7b 7d 2c 0a 0a 09 09 09  anded = {},.....
2eb40 09 2f 2f 20 41 73 73 75 6d 65 73 20 61 20 73 69  .// Assumes a si
2eb50 6e 67 6c 65 20 6e 75 6d 62 65 72 20 69 66 20 6e  ngle number if n
2eb60 6f 74 20 61 20 73 74 72 69 6e 67 0a 09 09 09 09  ot a string.....
2eb70 70 61 72 74 73 20 3d 20 74 79 70 65 6f 66 20 76  parts = typeof v
2eb80 61 6c 75 65 20 3d 3d 3d 20 22 73 74 72 69 6e 67  alue === "string
2eb90 22 20 3f 20 76 61 6c 75 65 2e 73 70 6c 69 74 28  " ? value.split(
2eba0 20 22 20 22 20 29 20 3a 20 5b 20 76 61 6c 75 65   " " ) : [ value
2ebb0 20 5d 3b 0a 0a 09 09 09 66 6f 72 20 28 20 3b 20   ];.....for ( ; 
2ebc0 69 20 3c 20 34 3b 20 69 2b 2b 20 29 20 7b 0a 09  i < 4; i++ ) {..
2ebd0 09 09 09 65 78 70 61 6e 64 65 64 5b 20 70 72 65  ...expanded[ pre
2ebe0 66 69 78 20 2b 20 63 73 73 45 78 70 61 6e 64 5b  fix + cssExpand[
2ebf0 20 69 20 5d 20 2b 20 73 75 66 66 69 78 20 5d 20   i ] + suffix ] 
2ec00 3d 0a 09 09 09 09 09 70 61 72 74 73 5b 20 69 20  =......parts[ i 
2ec10 5d 20 7c 7c 20 70 61 72 74 73 5b 20 69 20 2d 20  ] || parts[ i - 
2ec20 32 20 5d 20 7c 7c 20 70 61 72 74 73 5b 20 30 20  2 ] || parts[ 0 
2ec30 5d 3b 0a 09 09 09 7d 0a 0a 09 09 09 72 65 74 75  ];....}.....retu
2ec40 72 6e 20 65 78 70 61 6e 64 65 64 3b 0a 09 09 7d  rn expanded;...}
2ec50 0a 09 7d 3b 0a 0a 09 69 66 20 28 20 70 72 65 66  ..};...if ( pref
2ec60 69 78 20 21 3d 3d 20 22 6d 61 72 67 69 6e 22 20  ix !== "margin" 
2ec70 29 20 7b 0a 09 09 6a 51 75 65 72 79 2e 63 73 73  ) {...jQuery.css
2ec80 48 6f 6f 6b 73 5b 20 70 72 65 66 69 78 20 2b 20  Hooks[ prefix + 
2ec90 73 75 66 66 69 78 20 5d 2e 73 65 74 20 3d 20 73  suffix ].set = s
2eca0 65 74 50 6f 73 69 74 69 76 65 4e 75 6d 62 65 72  etPositiveNumber
2ecb0 3b 0a 09 7d 0a 7d 20 29 3b 0a 0a 6a 51 75 65 72  ;..}.} );..jQuer
2ecc0 79 2e 66 6e 2e 65 78 74 65 6e 64 28 20 7b 0a 09  y.fn.extend( {..
2ecd0 63 73 73 3a 20 66 75 6e 63 74 69 6f 6e 28 20 6e  css: function( n
2ece0 61 6d 65 2c 20 76 61 6c 75 65 20 29 20 7b 0a 09  ame, value ) {..
2ecf0 09 72 65 74 75 72 6e 20 61 63 63 65 73 73 28 20  .return access( 
2ed00 74 68 69 73 2c 20 66 75 6e 63 74 69 6f 6e 28 20  this, function( 
2ed10 65 6c 65 6d 2c 20 6e 61 6d 65 2c 20 76 61 6c 75  elem, name, valu
2ed20 65 20 29 20 7b 0a 09 09 09 76 61 72 20 73 74 79  e ) {....var sty
2ed30 6c 65 73 2c 20 6c 65 6e 2c 0a 09 09 09 09 6d 61  les, len,.....ma
2ed40 70 20 3d 20 7b 7d 2c 0a 09 09 09 09 69 20 3d 20  p = {},.....i = 
2ed50 30 3b 0a 0a 09 09 09 69 66 20 28 20 41 72 72 61  0;.....if ( Arra
2ed60 79 2e 69 73 41 72 72 61 79 28 20 6e 61 6d 65 20  y.isArray( name 
2ed70 29 20 29 20 7b 0a 09 09 09 09 73 74 79 6c 65 73  ) ) {.....styles
2ed80 20 3d 20 67 65 74 53 74 79 6c 65 73 28 20 65 6c   = getStyles( el
2ed90 65 6d 20 29 3b 0a 09 09 09 09 6c 65 6e 20 3d 20  em );.....len = 
2eda0 6e 61 6d 65 2e 6c 65 6e 67 74 68 3b 0a 0a 09 09  name.length;....
2edb0 09 09 66 6f 72 20 28 20 3b 20 69 20 3c 20 6c 65  ..for ( ; i < le
2edc0 6e 3b 20 69 2b 2b 20 29 20 7b 0a 09 09 09 09 09  n; i++ ) {......
2edd0 6d 61 70 5b 20 6e 61 6d 65 5b 20 69 20 5d 20 5d  map[ name[ i ] ]
2ede0 20 3d 20 6a 51 75 65 72 79 2e 63 73 73 28 20 65   = jQuery.css( e
2edf0 6c 65 6d 2c 20 6e 61 6d 65 5b 20 69 20 5d 2c 20  lem, name[ i ], 
2ee00 66 61 6c 73 65 2c 20 73 74 79 6c 65 73 20 29 3b  false, styles );
2ee10 0a 09 09 09 09 7d 0a 0a 09 09 09 09 72 65 74 75  .....}......retu
2ee20 72 6e 20 6d 61 70 3b 0a 09 09 09 7d 0a 0a 09 09  rn map;....}....
2ee30 09 72 65 74 75 72 6e 20 76 61 6c 75 65 20 21 3d  .return value !=
2ee40 3d 20 75 6e 64 65 66 69 6e 65 64 20 3f 0a 09 09  = undefined ?...
2ee50 09 09 6a 51 75 65 72 79 2e 73 74 79 6c 65 28 20  ..jQuery.style( 
2ee60 65 6c 65 6d 2c 20 6e 61 6d 65 2c 20 76 61 6c 75  elem, name, valu
2ee70 65 20 29 20 3a 0a 09 09 09 09 6a 51 75 65 72 79  e ) :.....jQuery
2ee80 2e 63 73 73 28 20 65 6c 65 6d 2c 20 6e 61 6d 65  .css( elem, name
2ee90 20 29 3b 0a 09 09 7d 2c 20 6e 61 6d 65 2c 20 76   );...}, name, v
2eea0 61 6c 75 65 2c 20 61 72 67 75 6d 65 6e 74 73 2e  alue, arguments.
2eeb0 6c 65 6e 67 74 68 20 3e 20 31 20 29 3b 0a 09 7d  length > 1 );..}
2eec0 0a 7d 20 29 3b 0a 0a 0a 66 75 6e 63 74 69 6f 6e  .} );...function
2eed0 20 54 77 65 65 6e 28 20 65 6c 65 6d 2c 20 6f 70   Tween( elem, op
2eee0 74 69 6f 6e 73 2c 20 70 72 6f 70 2c 20 65 6e 64  tions, prop, end
2eef0 2c 20 65 61 73 69 6e 67 20 29 20 7b 0a 09 72 65  , easing ) {..re
2ef00 74 75 72 6e 20 6e 65 77 20 54 77 65 65 6e 2e 70  turn new Tween.p
2ef10 72 6f 74 6f 74 79 70 65 2e 69 6e 69 74 28 20 65  rototype.init( e
2ef20 6c 65 6d 2c 20 6f 70 74 69 6f 6e 73 2c 20 70 72  lem, options, pr
2ef30 6f 70 2c 20 65 6e 64 2c 20 65 61 73 69 6e 67 20  op, end, easing 
2ef40 29 3b 0a 7d 0a 6a 51 75 65 72 79 2e 54 77 65 65  );.}.jQuery.Twee
2ef50 6e 20 3d 20 54 77 65 65 6e 3b 0a 0a 54 77 65 65  n = Tween;..Twee
2ef60 6e 2e 70 72 6f 74 6f 74 79 70 65 20 3d 20 7b 0a  n.prototype = {.
2ef70 09 63 6f 6e 73 74 72 75 63 74 6f 72 3a 20 54 77  .constructor: Tw
2ef80 65 65 6e 2c 0a 09 69 6e 69 74 3a 20 66 75 6e 63  een,..init: func
2ef90 74 69 6f 6e 28 20 65 6c 65 6d 2c 20 6f 70 74 69  tion( elem, opti
2efa0 6f 6e 73 2c 20 70 72 6f 70 2c 20 65 6e 64 2c 20  ons, prop, end, 
2efb0 65 61 73 69 6e 67 2c 20 75 6e 69 74 20 29 20 7b  easing, unit ) {
2efc0 0a 09 09 74 68 69 73 2e 65 6c 65 6d 20 3d 20 65  ...this.elem = e
2efd0 6c 65 6d 3b 0a 09 09 74 68 69 73 2e 70 72 6f 70  lem;...this.prop
2efe0 20 3d 20 70 72 6f 70 3b 0a 09 09 74 68 69 73 2e   = prop;...this.
2eff0 65 61 73 69 6e 67 20 3d 20 65 61 73 69 6e 67 20  easing = easing 
2f000 7c 7c 20 6a 51 75 65 72 79 2e 65 61 73 69 6e 67  || jQuery.easing
2f010 2e 5f 64 65 66 61 75 6c 74 3b 0a 09 09 74 68 69  ._default;...thi
2f020 73 2e 6f 70 74 69 6f 6e 73 20 3d 20 6f 70 74 69  s.options = opti
2f030 6f 6e 73 3b 0a 09 09 74 68 69 73 2e 73 74 61 72  ons;...this.star
2f040 74 20 3d 20 74 68 69 73 2e 6e 6f 77 20 3d 20 74  t = this.now = t
2f050 68 69 73 2e 63 75 72 28 29 3b 0a 09 09 74 68 69  his.cur();...thi
2f060 73 2e 65 6e 64 20 3d 20 65 6e 64 3b 0a 09 09 74  s.end = end;...t
2f070 68 69 73 2e 75 6e 69 74 20 3d 20 75 6e 69 74 20  his.unit = unit 
2f080 7c 7c 20 28 20 6a 51 75 65 72 79 2e 63 73 73 4e  || ( jQuery.cssN
2f090 75 6d 62 65 72 5b 20 70 72 6f 70 20 5d 20 3f 20  umber[ prop ] ? 
2f0a0 22 22 20 3a 20 22 70 78 22 20 29 3b 0a 09 7d 2c  "" : "px" );..},
2f0b0 0a 09 63 75 72 3a 20 66 75 6e 63 74 69 6f 6e 28  ..cur: function(
2f0c0 29 20 7b 0a 09 09 76 61 72 20 68 6f 6f 6b 73 20  ) {...var hooks 
2f0d0 3d 20 54 77 65 65 6e 2e 70 72 6f 70 48 6f 6f 6b  = Tween.propHook
2f0e0 73 5b 20 74 68 69 73 2e 70 72 6f 70 20 5d 3b 0a  s[ this.prop ];.
2f0f0 0a 09 09 72 65 74 75 72 6e 20 68 6f 6f 6b 73 20  ...return hooks 
2f100 26 26 20 68 6f 6f 6b 73 2e 67 65 74 20 3f 0a 09  && hooks.get ?..
2f110 09 09 68 6f 6f 6b 73 2e 67 65 74 28 20 74 68 69  ..hooks.get( thi
2f120 73 20 29 20 3a 0a 09 09 09 54 77 65 65 6e 2e 70  s ) :....Tween.p
2f130 72 6f 70 48 6f 6f 6b 73 2e 5f 64 65 66 61 75 6c  ropHooks._defaul
2f140 74 2e 67 65 74 28 20 74 68 69 73 20 29 3b 0a 09  t.get( this );..
2f150 7d 2c 0a 09 72 75 6e 3a 20 66 75 6e 63 74 69 6f  },..run: functio
2f160 6e 28 20 70 65 72 63 65 6e 74 20 29 20 7b 0a 09  n( percent ) {..
2f170 09 76 61 72 20 65 61 73 65 64 2c 0a 09 09 09 68  .var eased,....h
2f180 6f 6f 6b 73 20 3d 20 54 77 65 65 6e 2e 70 72 6f  ooks = Tween.pro
2f190 70 48 6f 6f 6b 73 5b 20 74 68 69 73 2e 70 72 6f  pHooks[ this.pro
2f1a0 70 20 5d 3b 0a 0a 09 09 69 66 20 28 20 74 68 69  p ];....if ( thi
2f1b0 73 2e 6f 70 74 69 6f 6e 73 2e 64 75 72 61 74 69  s.options.durati
2f1c0 6f 6e 20 29 20 7b 0a 09 09 09 74 68 69 73 2e 70  on ) {....this.p
2f1d0 6f 73 20 3d 20 65 61 73 65 64 20 3d 20 6a 51 75  os = eased = jQu
2f1e0 65 72 79 2e 65 61 73 69 6e 67 5b 20 74 68 69 73  ery.easing[ this
2f1f0 2e 65 61 73 69 6e 67 20 5d 28 0a 09 09 09 09 70  .easing ](.....p
2f200 65 72 63 65 6e 74 2c 20 74 68 69 73 2e 6f 70 74  ercent, this.opt
2f210 69 6f 6e 73 2e 64 75 72 61 74 69 6f 6e 20 2a 20  ions.duration * 
2f220 70 65 72 63 65 6e 74 2c 20 30 2c 20 31 2c 20 74  percent, 0, 1, t
2f230 68 69 73 2e 6f 70 74 69 6f 6e 73 2e 64 75 72 61  his.options.dura
2f240 74 69 6f 6e 0a 09 09 09 29 3b 0a 09 09 7d 20 65  tion....);...} e
2f250 6c 73 65 20 7b 0a 09 09 09 74 68 69 73 2e 70 6f  lse {....this.po
2f260 73 20 3d 20 65 61 73 65 64 20 3d 20 70 65 72 63  s = eased = perc
2f270 65 6e 74 3b 0a 09 09 7d 0a 09 09 74 68 69 73 2e  ent;...}...this.
2f280 6e 6f 77 20 3d 20 28 20 74 68 69 73 2e 65 6e 64  now = ( this.end
2f290 20 2d 20 74 68 69 73 2e 73 74 61 72 74 20 29 20   - this.start ) 
2f2a0 2a 20 65 61 73 65 64 20 2b 20 74 68 69 73 2e 73  * eased + this.s
2f2b0 74 61 72 74 3b 0a 0a 09 09 69 66 20 28 20 74 68  tart;....if ( th
2f2c0 69 73 2e 6f 70 74 69 6f 6e 73 2e 73 74 65 70 20  is.options.step 
2f2d0 29 20 7b 0a 09 09 09 74 68 69 73 2e 6f 70 74 69  ) {....this.opti
2f2e0 6f 6e 73 2e 73 74 65 70 2e 63 61 6c 6c 28 20 74  ons.step.call( t
2f2f0 68 69 73 2e 65 6c 65 6d 2c 20 74 68 69 73 2e 6e  his.elem, this.n
2f300 6f 77 2c 20 74 68 69 73 20 29 3b 0a 09 09 7d 0a  ow, this );...}.
2f310 0a 09 09 69 66 20 28 20 68 6f 6f 6b 73 20 26 26  ...if ( hooks &&
2f320 20 68 6f 6f 6b 73 2e 73 65 74 20 29 20 7b 0a 09   hooks.set ) {..
2f330 09 09 68 6f 6f 6b 73 2e 73 65 74 28 20 74 68 69  ..hooks.set( thi
2f340 73 20 29 3b 0a 09 09 7d 20 65 6c 73 65 20 7b 0a  s );...} else {.
2f350 09 09 09 54 77 65 65 6e 2e 70 72 6f 70 48 6f 6f  ...Tween.propHoo
2f360 6b 73 2e 5f 64 65 66 61 75 6c 74 2e 73 65 74 28  ks._default.set(
2f370 20 74 68 69 73 20 29 3b 0a 09 09 7d 0a 09 09 72   this );...}...r
2f380 65 74 75 72 6e 20 74 68 69 73 3b 0a 09 7d 0a 7d  eturn this;..}.}
2f390 3b 0a 0a 54 77 65 65 6e 2e 70 72 6f 74 6f 74 79  ;..Tween.prototy
2f3a0 70 65 2e 69 6e 69 74 2e 70 72 6f 74 6f 74 79 70  pe.init.prototyp
2f3b0 65 20 3d 20 54 77 65 65 6e 2e 70 72 6f 74 6f 74  e = Tween.protot
2f3c0 79 70 65 3b 0a 0a 54 77 65 65 6e 2e 70 72 6f 70  ype;..Tween.prop
2f3d0 48 6f 6f 6b 73 20 3d 20 7b 0a 09 5f 64 65 66 61  Hooks = {.._defa
2f3e0 75 6c 74 3a 20 7b 0a 09 09 67 65 74 3a 20 66 75  ult: {...get: fu
2f3f0 6e 63 74 69 6f 6e 28 20 74 77 65 65 6e 20 29 20  nction( tween ) 
2f400 7b 0a 09 09 09 76 61 72 20 72 65 73 75 6c 74 3b  {....var result;
2f410 0a 0a 09 09 09 2f 2f 20 55 73 65 20 61 20 70 72  .....// Use a pr
2f420 6f 70 65 72 74 79 20 6f 6e 20 74 68 65 20 65 6c  operty on the el
2f430 65 6d 65 6e 74 20 64 69 72 65 63 74 6c 79 20 77  ement directly w
2f440 68 65 6e 20 69 74 20 69 73 20 6e 6f 74 20 61 20  hen it is not a 
2f450 44 4f 4d 20 65 6c 65 6d 65 6e 74 2c 0a 09 09 09  DOM element,....
2f460 2f 2f 20 6f 72 20 77 68 65 6e 20 74 68 65 72 65  // or when there
2f470 20 69 73 20 6e 6f 20 6d 61 74 63 68 69 6e 67 20   is no matching 
2f480 73 74 79 6c 65 20 70 72 6f 70 65 72 74 79 20 74  style property t
2f490 68 61 74 20 65 78 69 73 74 73 2e 0a 09 09 09 69  hat exists.....i
2f4a0 66 20 28 20 74 77 65 65 6e 2e 65 6c 65 6d 2e 6e  f ( tween.elem.n
2f4b0 6f 64 65 54 79 70 65 20 21 3d 3d 20 31 20 7c 7c  odeType !== 1 ||
2f4c0 0a 09 09 09 09 74 77 65 65 6e 2e 65 6c 65 6d 5b  .....tween.elem[
2f4d0 20 74 77 65 65 6e 2e 70 72 6f 70 20 5d 20 21 3d   tween.prop ] !=
2f4e0 20 6e 75 6c 6c 20 26 26 20 74 77 65 65 6e 2e 65   null && tween.e
2f4f0 6c 65 6d 2e 73 74 79 6c 65 5b 20 74 77 65 65 6e  lem.style[ tween
2f500 2e 70 72 6f 70 20 5d 20 3d 3d 20 6e 75 6c 6c 20  .prop ] == null 
2f510 29 20 7b 0a 09 09 09 09 72 65 74 75 72 6e 20 74  ) {.....return t
2f520 77 65 65 6e 2e 65 6c 65 6d 5b 20 74 77 65 65 6e  ween.elem[ tween
2f530 2e 70 72 6f 70 20 5d 3b 0a 09 09 09 7d 0a 0a 09  .prop ];....}...
2f540 09 09 2f 2f 20 50 61 73 73 69 6e 67 20 61 6e 20  ..// Passing an 
2f550 65 6d 70 74 79 20 73 74 72 69 6e 67 20 61 73 20  empty string as 
2f560 61 20 33 72 64 20 70 61 72 61 6d 65 74 65 72 20  a 3rd parameter 
2f570 74 6f 20 2e 63 73 73 20 77 69 6c 6c 20 61 75 74  to .css will aut
2f580 6f 6d 61 74 69 63 61 6c 6c 79 0a 09 09 09 2f 2f  omatically....//
2f590 20 61 74 74 65 6d 70 74 20 61 20 70 61 72 73 65   attempt a parse
2f5a0 46 6c 6f 61 74 20 61 6e 64 20 66 61 6c 6c 62 61  Float and fallba
2f5b0 63 6b 20 74 6f 20 61 20 73 74 72 69 6e 67 20 69  ck to a string i
2f5c0 66 20 74 68 65 20 70 61 72 73 65 20 66 61 69 6c  f the parse fail
2f5d0 73 2e 0a 09 09 09 2f 2f 20 53 69 6d 70 6c 65 20  s.....// Simple 
2f5e0 76 61 6c 75 65 73 20 73 75 63 68 20 61 73 20 22  values such as "
2f5f0 31 30 70 78 22 20 61 72 65 20 70 61 72 73 65 64  10px" are parsed
2f600 20 74 6f 20 46 6c 6f 61 74 3b 0a 09 09 09 2f 2f   to Float;....//
2f610 20 63 6f 6d 70 6c 65 78 20 76 61 6c 75 65 73 20   complex values 
2f620 73 75 63 68 20 61 73 20 22 72 6f 74 61 74 65 28  such as "rotate(
2f630 31 72 61 64 29 22 20 61 72 65 20 72 65 74 75 72  1rad)" are retur
2f640 6e 65 64 20 61 73 2d 69 73 2e 0a 09 09 09 72 65  ned as-is.....re
2f650 73 75 6c 74 20 3d 20 6a 51 75 65 72 79 2e 63 73  sult = jQuery.cs
2f660 73 28 20 74 77 65 65 6e 2e 65 6c 65 6d 2c 20 74  s( tween.elem, t
2f670 77 65 65 6e 2e 70 72 6f 70 2c 20 22 22 20 29 3b  ween.prop, "" );
2f680 0a 0a 09 09 09 2f 2f 20 45 6d 70 74 79 20 73 74  .....// Empty st
2f690 72 69 6e 67 73 2c 20 6e 75 6c 6c 2c 20 75 6e 64  rings, null, und
2f6a0 65 66 69 6e 65 64 20 61 6e 64 20 22 61 75 74 6f  efined and "auto
2f6b0 22 20 61 72 65 20 63 6f 6e 76 65 72 74 65 64 20  " are converted 
2f6c0 74 6f 20 30 2e 0a 09 09 09 72 65 74 75 72 6e 20  to 0.....return 
2f6d0 21 72 65 73 75 6c 74 20 7c 7c 20 72 65 73 75 6c  !result || resul
2f6e0 74 20 3d 3d 3d 20 22 61 75 74 6f 22 20 3f 20 30  t === "auto" ? 0
2f6f0 20 3a 20 72 65 73 75 6c 74 3b 0a 09 09 7d 2c 0a   : result;...},.
2f700 09 09 73 65 74 3a 20 66 75 6e 63 74 69 6f 6e 28  ..set: function(
2f710 20 74 77 65 65 6e 20 29 20 7b 0a 0a 09 09 09 2f   tween ) {...../
2f720 2f 20 55 73 65 20 73 74 65 70 20 68 6f 6f 6b 20  / Use step hook 
2f730 66 6f 72 20 62 61 63 6b 20 63 6f 6d 70 61 74 2e  for back compat.
2f740 0a 09 09 09 2f 2f 20 55 73 65 20 63 73 73 48 6f  ....// Use cssHo
2f750 6f 6b 20 69 66 20 69 74 73 20 74 68 65 72 65 2e  ok if its there.
2f760 0a 09 09 09 2f 2f 20 55 73 65 20 2e 73 74 79 6c  ....// Use .styl
2f770 65 20 69 66 20 61 76 61 69 6c 61 62 6c 65 20 61  e if available a
2f780 6e 64 20 75 73 65 20 70 6c 61 69 6e 20 70 72 6f  nd use plain pro
2f790 70 65 72 74 69 65 73 20 77 68 65 72 65 20 61 76  perties where av
2f7a0 61 69 6c 61 62 6c 65 2e 0a 09 09 09 69 66 20 28  ailable.....if (
2f7b0 20 6a 51 75 65 72 79 2e 66 78 2e 73 74 65 70 5b   jQuery.fx.step[
2f7c0 20 74 77 65 65 6e 2e 70 72 6f 70 20 5d 20 29 20   tween.prop ] ) 
2f7d0 7b 0a 09 09 09 09 6a 51 75 65 72 79 2e 66 78 2e  {.....jQuery.fx.
2f7e0 73 74 65 70 5b 20 74 77 65 65 6e 2e 70 72 6f 70  step[ tween.prop
2f7f0 20 5d 28 20 74 77 65 65 6e 20 29 3b 0a 09 09 09   ]( tween );....
2f800 7d 20 65 6c 73 65 20 69 66 20 28 20 74 77 65 65  } else if ( twee
2f810 6e 2e 65 6c 65 6d 2e 6e 6f 64 65 54 79 70 65 20  n.elem.nodeType 
2f820 3d 3d 3d 20 31 20 26 26 20 28 0a 09 09 09 09 09  === 1 && (......
2f830 6a 51 75 65 72 79 2e 63 73 73 48 6f 6f 6b 73 5b  jQuery.cssHooks[
2f840 20 74 77 65 65 6e 2e 70 72 6f 70 20 5d 20 7c 7c   tween.prop ] ||
2f850 0a 09 09 09 09 09 74 77 65 65 6e 2e 65 6c 65 6d  ......tween.elem
2f860 2e 73 74 79 6c 65 5b 20 66 69 6e 61 6c 50 72 6f  .style[ finalPro
2f870 70 4e 61 6d 65 28 20 74 77 65 65 6e 2e 70 72 6f  pName( tween.pro
2f880 70 20 29 20 5d 20 21 3d 20 6e 75 6c 6c 20 29 20  p ) ] != null ) 
2f890 29 20 7b 0a 09 09 09 09 6a 51 75 65 72 79 2e 73  ) {.....jQuery.s
2f8a0 74 79 6c 65 28 20 74 77 65 65 6e 2e 65 6c 65 6d  tyle( tween.elem
2f8b0 2c 20 74 77 65 65 6e 2e 70 72 6f 70 2c 20 74 77  , tween.prop, tw
2f8c0 65 65 6e 2e 6e 6f 77 20 2b 20 74 77 65 65 6e 2e  een.now + tween.
2f8d0 75 6e 69 74 20 29 3b 0a 09 09 09 7d 20 65 6c 73  unit );....} els
2f8e0 65 20 7b 0a 09 09 09 09 74 77 65 65 6e 2e 65 6c  e {.....tween.el
2f8f0 65 6d 5b 20 74 77 65 65 6e 2e 70 72 6f 70 20 5d  em[ tween.prop ]
2f900 20 3d 20 74 77 65 65 6e 2e 6e 6f 77 3b 0a 09 09   = tween.now;...
2f910 09 7d 0a 09 09 7d 0a 09 7d 0a 7d 3b 0a 0a 2f 2f  .}...}..}.};..//
2f920 20 53 75 70 70 6f 72 74 3a 20 49 45 20 3c 3d 39   Support: IE <=9
2f930 20 6f 6e 6c 79 0a 2f 2f 20 50 61 6e 69 63 20 62   only.// Panic b
2f940 61 73 65 64 20 61 70 70 72 6f 61 63 68 20 74 6f  ased approach to
2f950 20 73 65 74 74 69 6e 67 20 74 68 69 6e 67 73 20   setting things 
2f960 6f 6e 20 64 69 73 63 6f 6e 6e 65 63 74 65 64 20  on disconnected 
2f970 6e 6f 64 65 73 0a 54 77 65 65 6e 2e 70 72 6f 70  nodes.Tween.prop
2f980 48 6f 6f 6b 73 2e 73 63 72 6f 6c 6c 54 6f 70 20  Hooks.scrollTop 
2f990 3d 20 54 77 65 65 6e 2e 70 72 6f 70 48 6f 6f 6b  = Tween.propHook
2f9a0 73 2e 73 63 72 6f 6c 6c 4c 65 66 74 20 3d 20 7b  s.scrollLeft = {
2f9b0 0a 09 73 65 74 3a 20 66 75 6e 63 74 69 6f 6e 28  ..set: function(
2f9c0 20 74 77 65 65 6e 20 29 20 7b 0a 09 09 69 66 20   tween ) {...if 
2f9d0 28 20 74 77 65 65 6e 2e 65 6c 65 6d 2e 6e 6f 64  ( tween.elem.nod
2f9e0 65 54 79 70 65 20 26 26 20 74 77 65 65 6e 2e 65  eType && tween.e
2f9f0 6c 65 6d 2e 70 61 72 65 6e 74 4e 6f 64 65 20 29  lem.parentNode )
2fa00 20 7b 0a 09 09 09 74 77 65 65 6e 2e 65 6c 65 6d   {....tween.elem
2fa10 5b 20 74 77 65 65 6e 2e 70 72 6f 70 20 5d 20 3d  [ tween.prop ] =
2fa20 20 74 77 65 65 6e 2e 6e 6f 77 3b 0a 09 09 7d 0a   tween.now;...}.
2fa30 09 7d 0a 7d 3b 0a 0a 6a 51 75 65 72 79 2e 65 61  .}.};..jQuery.ea
2fa40 73 69 6e 67 20 3d 20 7b 0a 09 6c 69 6e 65 61 72  sing = {..linear
2fa50 3a 20 66 75 6e 63 74 69 6f 6e 28 20 70 20 29 20  : function( p ) 
2fa60 7b 0a 09 09 72 65 74 75 72 6e 20 70 3b 0a 09 7d  {...return p;..}
2fa70 2c 0a 09 73 77 69 6e 67 3a 20 66 75 6e 63 74 69  ,..swing: functi
2fa80 6f 6e 28 20 70 20 29 20 7b 0a 09 09 72 65 74 75  on( p ) {...retu
2fa90 72 6e 20 30 2e 35 20 2d 20 4d 61 74 68 2e 63 6f  rn 0.5 - Math.co
2faa0 73 28 20 70 20 2a 20 4d 61 74 68 2e 50 49 20 29  s( p * Math.PI )
2fab0 20 2f 20 32 3b 0a 09 7d 2c 0a 09 5f 64 65 66 61   / 2;..},.._defa
2fac0 75 6c 74 3a 20 22 73 77 69 6e 67 22 0a 7d 3b 0a  ult: "swing".};.
2fad0 0a 6a 51 75 65 72 79 2e 66 78 20 3d 20 54 77 65  .jQuery.fx = Twe
2fae0 65 6e 2e 70 72 6f 74 6f 74 79 70 65 2e 69 6e 69  en.prototype.ini
2faf0 74 3b 0a 0a 2f 2f 20 42 61 63 6b 20 63 6f 6d 70  t;..// Back comp
2fb00 61 74 20 3c 31 2e 38 20 65 78 74 65 6e 73 69 6f  at <1.8 extensio
2fb10 6e 20 70 6f 69 6e 74 0a 6a 51 75 65 72 79 2e 66  n point.jQuery.f
2fb20 78 2e 73 74 65 70 20 3d 20 7b 7d 3b 0a 0a 0a 0a  x.step = {};....
2fb30 0a 76 61 72 0a 09 66 78 4e 6f 77 2c 20 69 6e 50  .var..fxNow, inP
2fb40 72 6f 67 72 65 73 73 2c 0a 09 72 66 78 74 79 70  rogress,..rfxtyp
2fb50 65 73 20 3d 20 2f 5e 28 3f 3a 74 6f 67 67 6c 65  es = /^(?:toggle
2fb60 7c 73 68 6f 77 7c 68 69 64 65 29 24 2f 2c 0a 09  |show|hide)$/,..
2fb70 72 72 75 6e 20 3d 20 2f 71 75 65 75 65 48 6f 6f  rrun = /queueHoo
2fb80 6b 73 24 2f 3b 0a 0a 66 75 6e 63 74 69 6f 6e 20  ks$/;..function 
2fb90 73 63 68 65 64 75 6c 65 28 29 20 7b 0a 09 69 66  schedule() {..if
2fba0 20 28 20 69 6e 50 72 6f 67 72 65 73 73 20 29 20   ( inProgress ) 
2fbb0 7b 0a 09 09 69 66 20 28 20 64 6f 63 75 6d 65 6e  {...if ( documen
2fbc0 74 2e 68 69 64 64 65 6e 20 3d 3d 3d 20 66 61 6c  t.hidden === fal
2fbd0 73 65 20 26 26 20 77 69 6e 64 6f 77 2e 72 65 71  se && window.req
2fbe0 75 65 73 74 41 6e 69 6d 61 74 69 6f 6e 46 72 61  uestAnimationFra
2fbf0 6d 65 20 29 20 7b 0a 09 09 09 77 69 6e 64 6f 77  me ) {....window
2fc00 2e 72 65 71 75 65 73 74 41 6e 69 6d 61 74 69 6f  .requestAnimatio
2fc10 6e 46 72 61 6d 65 28 20 73 63 68 65 64 75 6c 65  nFrame( schedule
2fc20 20 29 3b 0a 09 09 7d 20 65 6c 73 65 20 7b 0a 09   );...} else {..
2fc30 09 09 77 69 6e 64 6f 77 2e 73 65 74 54 69 6d 65  ..window.setTime
2fc40 6f 75 74 28 20 73 63 68 65 64 75 6c 65 2c 20 6a  out( schedule, j
2fc50 51 75 65 72 79 2e 66 78 2e 69 6e 74 65 72 76 61  Query.fx.interva
2fc60 6c 20 29 3b 0a 09 09 7d 0a 0a 09 09 6a 51 75 65  l );...}....jQue
2fc70 72 79 2e 66 78 2e 74 69 63 6b 28 29 3b 0a 09 7d  ry.fx.tick();..}
2fc80 0a 7d 0a 0a 2f 2f 20 41 6e 69 6d 61 74 69 6f 6e  .}..// Animation
2fc90 73 20 63 72 65 61 74 65 64 20 73 79 6e 63 68 72  s created synchr
2fca0 6f 6e 6f 75 73 6c 79 20 77 69 6c 6c 20 72 75 6e  onously will run
2fcb0 20 73 79 6e 63 68 72 6f 6e 6f 75 73 6c 79 0a 66   synchronously.f
2fcc0 75 6e 63 74 69 6f 6e 20 63 72 65 61 74 65 46 78  unction createFx
2fcd0 4e 6f 77 28 29 20 7b 0a 09 77 69 6e 64 6f 77 2e  Now() {..window.
2fce0 73 65 74 54 69 6d 65 6f 75 74 28 20 66 75 6e 63  setTimeout( func
2fcf0 74 69 6f 6e 28 29 20 7b 0a 09 09 66 78 4e 6f 77  tion() {...fxNow
2fd00 20 3d 20 75 6e 64 65 66 69 6e 65 64 3b 0a 09 7d   = undefined;..}
2fd10 20 29 3b 0a 09 72 65 74 75 72 6e 20 28 20 66 78   );..return ( fx
2fd20 4e 6f 77 20 3d 20 44 61 74 65 2e 6e 6f 77 28 29  Now = Date.now()
2fd30 20 29 3b 0a 7d 0a 0a 2f 2f 20 47 65 6e 65 72 61   );.}..// Genera
2fd40 74 65 20 70 61 72 61 6d 65 74 65 72 73 20 74 6f  te parameters to
2fd50 20 63 72 65 61 74 65 20 61 20 73 74 61 6e 64 61   create a standa
2fd60 72 64 20 61 6e 69 6d 61 74 69 6f 6e 0a 66 75 6e  rd animation.fun
2fd70 63 74 69 6f 6e 20 67 65 6e 46 78 28 20 74 79 70  ction genFx( typ
2fd80 65 2c 20 69 6e 63 6c 75 64 65 57 69 64 74 68 20  e, includeWidth 
2fd90 29 20 7b 0a 09 76 61 72 20 77 68 69 63 68 2c 0a  ) {..var which,.
2fda0 09 09 69 20 3d 20 30 2c 0a 09 09 61 74 74 72 73  ..i = 0,...attrs
2fdb0 20 3d 20 7b 20 68 65 69 67 68 74 3a 20 74 79 70   = { height: typ
2fdc0 65 20 7d 3b 0a 0a 09 2f 2f 20 49 66 20 77 65 20  e };...// If we 
2fdd0 69 6e 63 6c 75 64 65 20 77 69 64 74 68 2c 20 73  include width, s
2fde0 74 65 70 20 76 61 6c 75 65 20 69 73 20 31 20 74  tep value is 1 t
2fdf0 6f 20 64 6f 20 61 6c 6c 20 63 73 73 45 78 70 61  o do all cssExpa
2fe00 6e 64 20 76 61 6c 75 65 73 2c 0a 09 2f 2f 20 6f  nd values,..// o
2fe10 74 68 65 72 77 69 73 65 20 73 74 65 70 20 76 61  therwise step va
2fe20 6c 75 65 20 69 73 20 32 20 74 6f 20 73 6b 69 70  lue is 2 to skip
2fe30 20 6f 76 65 72 20 4c 65 66 74 20 61 6e 64 20 52   over Left and R
2fe40 69 67 68 74 0a 09 69 6e 63 6c 75 64 65 57 69 64  ight..includeWid
2fe50 74 68 20 3d 20 69 6e 63 6c 75 64 65 57 69 64 74  th = includeWidt
2fe60 68 20 3f 20 31 20 3a 20 30 3b 0a 09 66 6f 72 20  h ? 1 : 0;..for 
2fe70 28 20 3b 20 69 20 3c 20 34 3b 20 69 20 2b 3d 20  ( ; i < 4; i += 
2fe80 32 20 2d 20 69 6e 63 6c 75 64 65 57 69 64 74 68  2 - includeWidth
2fe90 20 29 20 7b 0a 09 09 77 68 69 63 68 20 3d 20 63   ) {...which = c
2fea0 73 73 45 78 70 61 6e 64 5b 20 69 20 5d 3b 0a 09  ssExpand[ i ];..
2feb0 09 61 74 74 72 73 5b 20 22 6d 61 72 67 69 6e 22  .attrs[ "margin"
2fec0 20 2b 20 77 68 69 63 68 20 5d 20 3d 20 61 74 74   + which ] = att
2fed0 72 73 5b 20 22 70 61 64 64 69 6e 67 22 20 2b 20  rs[ "padding" + 
2fee0 77 68 69 63 68 20 5d 20 3d 20 74 79 70 65 3b 0a  which ] = type;.
2fef0 09 7d 0a 0a 09 69 66 20 28 20 69 6e 63 6c 75 64  .}...if ( includ
2ff00 65 57 69 64 74 68 20 29 20 7b 0a 09 09 61 74 74  eWidth ) {...att
2ff10 72 73 2e 6f 70 61 63 69 74 79 20 3d 20 61 74 74  rs.opacity = att
2ff20 72 73 2e 77 69 64 74 68 20 3d 20 74 79 70 65 3b  rs.width = type;
2ff30 0a 09 7d 0a 0a 09 72 65 74 75 72 6e 20 61 74 74  ..}...return att
2ff40 72 73 3b 0a 7d 0a 0a 66 75 6e 63 74 69 6f 6e 20  rs;.}..function 
2ff50 63 72 65 61 74 65 54 77 65 65 6e 28 20 76 61 6c  createTween( val
2ff60 75 65 2c 20 70 72 6f 70 2c 20 61 6e 69 6d 61 74  ue, prop, animat
2ff70 69 6f 6e 20 29 20 7b 0a 09 76 61 72 20 74 77 65  ion ) {..var twe
2ff80 65 6e 2c 0a 09 09 63 6f 6c 6c 65 63 74 69 6f 6e  en,...collection
2ff90 20 3d 20 28 20 41 6e 69 6d 61 74 69 6f 6e 2e 74   = ( Animation.t
2ffa0 77 65 65 6e 65 72 73 5b 20 70 72 6f 70 20 5d 20  weeners[ prop ] 
2ffb0 7c 7c 20 5b 5d 20 29 2e 63 6f 6e 63 61 74 28 20  || [] ).concat( 
2ffc0 41 6e 69 6d 61 74 69 6f 6e 2e 74 77 65 65 6e 65  Animation.tweene
2ffd0 72 73 5b 20 22 2a 22 20 5d 20 29 2c 0a 09 09 69  rs[ "*" ] ),...i
2ffe0 6e 64 65 78 20 3d 20 30 2c 0a 09 09 6c 65 6e 67  ndex = 0,...leng
2fff0 74 68 20 3d 20 63 6f 6c 6c 65 63 74 69 6f 6e 2e  th = collection.
30000 6c 65 6e 67 74 68 3b 0a 09 66 6f 72 20 28 20 3b  length;..for ( ;
30010 20 69 6e 64 65 78 20 3c 20 6c 65 6e 67 74 68 3b   index < length;
30020 20 69 6e 64 65 78 2b 2b 20 29 20 7b 0a 09 09 69   index++ ) {...i
30030 66 20 28 20 28 20 74 77 65 65 6e 20 3d 20 63 6f  f ( ( tween = co
30040 6c 6c 65 63 74 69 6f 6e 5b 20 69 6e 64 65 78 20  llection[ index 
30050 5d 2e 63 61 6c 6c 28 20 61 6e 69 6d 61 74 69 6f  ].call( animatio
30060 6e 2c 20 70 72 6f 70 2c 20 76 61 6c 75 65 20 29  n, prop, value )
30070 20 29 20 29 20 7b 0a 0a 09 09 09 2f 2f 20 57 65   ) ) {.....// We
30080 27 72 65 20 64 6f 6e 65 20 77 69 74 68 20 74 68  're done with th
30090 69 73 20 70 72 6f 70 65 72 74 79 0a 09 09 09 72  is property....r
300a0 65 74 75 72 6e 20 74 77 65 65 6e 3b 0a 09 09 7d  eturn tween;...}
300b0 0a 09 7d 0a 7d 0a 0a 66 75 6e 63 74 69 6f 6e 20  ..}.}..function 
300c0 64 65 66 61 75 6c 74 50 72 65 66 69 6c 74 65 72  defaultPrefilter
300d0 28 20 65 6c 65 6d 2c 20 70 72 6f 70 73 2c 20 6f  ( elem, props, o
300e0 70 74 73 20 29 20 7b 0a 09 76 61 72 20 70 72 6f  pts ) {..var pro
300f0 70 2c 20 76 61 6c 75 65 2c 20 74 6f 67 67 6c 65  p, value, toggle
30100 2c 20 68 6f 6f 6b 73 2c 20 6f 6c 64 66 69 72 65  , hooks, oldfire
30110 2c 20 70 72 6f 70 54 77 65 65 6e 2c 20 72 65 73  , propTween, res
30120 74 6f 72 65 44 69 73 70 6c 61 79 2c 20 64 69 73  toreDisplay, dis
30130 70 6c 61 79 2c 0a 09 09 69 73 42 6f 78 20 3d 20  play,...isBox = 
30140 22 77 69 64 74 68 22 20 69 6e 20 70 72 6f 70 73  "width" in props
30150 20 7c 7c 20 22 68 65 69 67 68 74 22 20 69 6e 20   || "height" in 
30160 70 72 6f 70 73 2c 0a 09 09 61 6e 69 6d 20 3d 20  props,...anim = 
30170 74 68 69 73 2c 0a 09 09 6f 72 69 67 20 3d 20 7b  this,...orig = {
30180 7d 2c 0a 09 09 73 74 79 6c 65 20 3d 20 65 6c 65  },...style = ele
30190 6d 2e 73 74 79 6c 65 2c 0a 09 09 68 69 64 64 65  m.style,...hidde
301a0 6e 20 3d 20 65 6c 65 6d 2e 6e 6f 64 65 54 79 70  n = elem.nodeTyp
301b0 65 20 26 26 20 69 73 48 69 64 64 65 6e 57 69 74  e && isHiddenWit
301c0 68 69 6e 54 72 65 65 28 20 65 6c 65 6d 20 29 2c  hinTree( elem ),
301d0 0a 09 09 64 61 74 61 53 68 6f 77 20 3d 20 64 61  ...dataShow = da
301e0 74 61 50 72 69 76 2e 67 65 74 28 20 65 6c 65 6d  taPriv.get( elem
301f0 2c 20 22 66 78 73 68 6f 77 22 20 29 3b 0a 0a 09  , "fxshow" );...
30200 2f 2f 20 51 75 65 75 65 2d 73 6b 69 70 70 69 6e  // Queue-skippin
30210 67 20 61 6e 69 6d 61 74 69 6f 6e 73 20 68 69 6a  g animations hij
30220 61 63 6b 20 74 68 65 20 66 78 20 68 6f 6f 6b 73  ack the fx hooks
30230 0a 09 69 66 20 28 20 21 6f 70 74 73 2e 71 75 65  ..if ( !opts.que
30240 75 65 20 29 20 7b 0a 09 09 68 6f 6f 6b 73 20 3d  ue ) {...hooks =
30250 20 6a 51 75 65 72 79 2e 5f 71 75 65 75 65 48 6f   jQuery._queueHo
30260 6f 6b 73 28 20 65 6c 65 6d 2c 20 22 66 78 22 20  oks( elem, "fx" 
30270 29 3b 0a 09 09 69 66 20 28 20 68 6f 6f 6b 73 2e  );...if ( hooks.
30280 75 6e 71 75 65 75 65 64 20 3d 3d 20 6e 75 6c 6c  unqueued == null
30290 20 29 20 7b 0a 09 09 09 68 6f 6f 6b 73 2e 75 6e   ) {....hooks.un
302a0 71 75 65 75 65 64 20 3d 20 30 3b 0a 09 09 09 6f  queued = 0;....o
302b0 6c 64 66 69 72 65 20 3d 20 68 6f 6f 6b 73 2e 65  ldfire = hooks.e
302c0 6d 70 74 79 2e 66 69 72 65 3b 0a 09 09 09 68 6f  mpty.fire;....ho
302d0 6f 6b 73 2e 65 6d 70 74 79 2e 66 69 72 65 20 3d  oks.empty.fire =
302e0 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09 09   function() {...
302f0 09 09 69 66 20 28 20 21 68 6f 6f 6b 73 2e 75 6e  ..if ( !hooks.un
30300 71 75 65 75 65 64 20 29 20 7b 0a 09 09 09 09 09  queued ) {......
30310 6f 6c 64 66 69 72 65 28 29 3b 0a 09 09 09 09 7d  oldfire();.....}
30320 0a 09 09 09 7d 3b 0a 09 09 7d 0a 09 09 68 6f 6f  ....};...}...hoo
30330 6b 73 2e 75 6e 71 75 65 75 65 64 2b 2b 3b 0a 0a  ks.unqueued++;..
30340 09 09 61 6e 69 6d 2e 61 6c 77 61 79 73 28 20 66  ..anim.always( f
30350 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 0a 09 09 09  unction() {.....
30360 2f 2f 20 45 6e 73 75 72 65 20 74 68 65 20 63 6f  // Ensure the co
30370 6d 70 6c 65 74 65 20 68 61 6e 64 6c 65 72 20 69  mplete handler i
30380 73 20 63 61 6c 6c 65 64 20 62 65 66 6f 72 65 20  s called before 
30390 74 68 69 73 20 63 6f 6d 70 6c 65 74 65 73 0a 09  this completes..
303a0 09 09 61 6e 69 6d 2e 61 6c 77 61 79 73 28 20 66  ..anim.always( f
303b0 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09 09 09 09  unction() {.....
303c0 68 6f 6f 6b 73 2e 75 6e 71 75 65 75 65 64 2d 2d  hooks.unqueued--
303d0 3b 0a 09 09 09 09 69 66 20 28 20 21 6a 51 75 65  ;.....if ( !jQue
303e0 72 79 2e 71 75 65 75 65 28 20 65 6c 65 6d 2c 20  ry.queue( elem, 
303f0 22 66 78 22 20 29 2e 6c 65 6e 67 74 68 20 29 20  "fx" ).length ) 
30400 7b 0a 09 09 09 09 09 68 6f 6f 6b 73 2e 65 6d 70  {......hooks.emp
30410 74 79 2e 66 69 72 65 28 29 3b 0a 09 09 09 09 7d  ty.fire();.....}
30420 0a 09 09 09 7d 20 29 3b 0a 09 09 7d 20 29 3b 0a  ....} );...} );.
30430 09 7d 0a 0a 09 2f 2f 20 44 65 74 65 63 74 20 73  .}...// Detect s
30440 68 6f 77 2f 68 69 64 65 20 61 6e 69 6d 61 74 69  how/hide animati
30450 6f 6e 73 0a 09 66 6f 72 20 28 20 70 72 6f 70 20  ons..for ( prop 
30460 69 6e 20 70 72 6f 70 73 20 29 20 7b 0a 09 09 76  in props ) {...v
30470 61 6c 75 65 20 3d 20 70 72 6f 70 73 5b 20 70 72  alue = props[ pr
30480 6f 70 20 5d 3b 0a 09 09 69 66 20 28 20 72 66 78  op ];...if ( rfx
30490 74 79 70 65 73 2e 74 65 73 74 28 20 76 61 6c 75  types.test( valu
304a0 65 20 29 20 29 20 7b 0a 09 09 09 64 65 6c 65 74  e ) ) {....delet
304b0 65 20 70 72 6f 70 73 5b 20 70 72 6f 70 20 5d 3b  e props[ prop ];
304c0 0a 09 09 09 74 6f 67 67 6c 65 20 3d 20 74 6f 67  ....toggle = tog
304d0 67 6c 65 20 7c 7c 20 76 61 6c 75 65 20 3d 3d 3d  gle || value ===
304e0 20 22 74 6f 67 67 6c 65 22 3b 0a 09 09 09 69 66   "toggle";....if
304f0 20 28 20 76 61 6c 75 65 20 3d 3d 3d 20 28 20 68   ( value === ( h
30500 69 64 64 65 6e 20 3f 20 22 68 69 64 65 22 20 3a  idden ? "hide" :
30510 20 22 73 68 6f 77 22 20 29 20 29 20 7b 0a 0a 09   "show" ) ) {...
30520 09 09 09 2f 2f 20 50 72 65 74 65 6e 64 20 74 6f  ...// Pretend to
30530 20 62 65 20 68 69 64 64 65 6e 20 69 66 20 74 68   be hidden if th
30540 69 73 20 69 73 20 61 20 22 73 68 6f 77 22 20 61  is is a "show" a
30550 6e 64 0a 09 09 09 09 2f 2f 20 74 68 65 72 65 20  nd.....// there 
30560 69 73 20 73 74 69 6c 6c 20 64 61 74 61 20 66 72  is still data fr
30570 6f 6d 20 61 20 73 74 6f 70 70 65 64 20 73 68 6f  om a stopped sho
30580 77 2f 68 69 64 65 0a 09 09 09 09 69 66 20 28 20  w/hide.....if ( 
30590 76 61 6c 75 65 20 3d 3d 3d 20 22 73 68 6f 77 22  value === "show"
305a0 20 26 26 20 64 61 74 61 53 68 6f 77 20 26 26 20   && dataShow && 
305b0 64 61 74 61 53 68 6f 77 5b 20 70 72 6f 70 20 5d  dataShow[ prop ]
305c0 20 21 3d 3d 20 75 6e 64 65 66 69 6e 65 64 20 29   !== undefined )
305d0 20 7b 0a 09 09 09 09 09 68 69 64 64 65 6e 20 3d   {......hidden =
305e0 20 74 72 75 65 3b 0a 0a 09 09 09 09 2f 2f 20 49   true;......// I
305f0 67 6e 6f 72 65 20 61 6c 6c 20 6f 74 68 65 72 20  gnore all other 
30600 6e 6f 2d 6f 70 20 73 68 6f 77 2f 68 69 64 65 20  no-op show/hide 
30610 64 61 74 61 0a 09 09 09 09 7d 20 65 6c 73 65 20  data.....} else 
30620 7b 0a 09 09 09 09 09 63 6f 6e 74 69 6e 75 65 3b  {......continue;
30630 0a 09 09 09 09 7d 0a 09 09 09 7d 0a 09 09 09 6f  .....}....}....o
30640 72 69 67 5b 20 70 72 6f 70 20 5d 20 3d 20 64 61  rig[ prop ] = da
30650 74 61 53 68 6f 77 20 26 26 20 64 61 74 61 53 68  taShow && dataSh
30660 6f 77 5b 20 70 72 6f 70 20 5d 20 7c 7c 20 6a 51  ow[ prop ] || jQ
30670 75 65 72 79 2e 73 74 79 6c 65 28 20 65 6c 65 6d  uery.style( elem
30680 2c 20 70 72 6f 70 20 29 3b 0a 09 09 7d 0a 09 7d  , prop );...}..}
30690 0a 0a 09 2f 2f 20 42 61 69 6c 20 6f 75 74 20 69  ...// Bail out i
306a0 66 20 74 68 69 73 20 69 73 20 61 20 6e 6f 2d 6f  f this is a no-o
306b0 70 20 6c 69 6b 65 20 2e 68 69 64 65 28 29 2e 68  p like .hide().h
306c0 69 64 65 28 29 0a 09 70 72 6f 70 54 77 65 65 6e  ide()..propTween
306d0 20 3d 20 21 6a 51 75 65 72 79 2e 69 73 45 6d 70   = !jQuery.isEmp
306e0 74 79 4f 62 6a 65 63 74 28 20 70 72 6f 70 73 20  tyObject( props 
306f0 29 3b 0a 09 69 66 20 28 20 21 70 72 6f 70 54 77  );..if ( !propTw
30700 65 65 6e 20 26 26 20 6a 51 75 65 72 79 2e 69 73  een && jQuery.is
30710 45 6d 70 74 79 4f 62 6a 65 63 74 28 20 6f 72 69  EmptyObject( ori
30720 67 20 29 20 29 20 7b 0a 09 09 72 65 74 75 72 6e  g ) ) {...return
30730 3b 0a 09 7d 0a 0a 09 2f 2f 20 52 65 73 74 72 69  ;..}...// Restri
30740 63 74 20 22 6f 76 65 72 66 6c 6f 77 22 20 61 6e  ct "overflow" an
30750 64 20 22 64 69 73 70 6c 61 79 22 20 73 74 79 6c  d "display" styl
30760 65 73 20 64 75 72 69 6e 67 20 62 6f 78 20 61 6e  es during box an
30770 69 6d 61 74 69 6f 6e 73 0a 09 69 66 20 28 20 69  imations..if ( i
30780 73 42 6f 78 20 26 26 20 65 6c 65 6d 2e 6e 6f 64  sBox && elem.nod
30790 65 54 79 70 65 20 3d 3d 3d 20 31 20 29 20 7b 0a  eType === 1 ) {.
307a0 0a 09 09 2f 2f 20 53 75 70 70 6f 72 74 3a 20 49  ...// Support: I
307b0 45 20 3c 3d 39 20 2d 20 31 31 2c 20 45 64 67 65  E <=9 - 11, Edge
307c0 20 31 32 20 2d 20 31 35 0a 09 09 2f 2f 20 52 65   12 - 15...// Re
307d0 63 6f 72 64 20 61 6c 6c 20 33 20 6f 76 65 72 66  cord all 3 overf
307e0 6c 6f 77 20 61 74 74 72 69 62 75 74 65 73 20 62  low attributes b
307f0 65 63 61 75 73 65 20 49 45 20 64 6f 65 73 20 6e  ecause IE does n
30800 6f 74 20 69 6e 66 65 72 20 74 68 65 20 73 68 6f  ot infer the sho
30810 72 74 68 61 6e 64 0a 09 09 2f 2f 20 66 72 6f 6d  rthand...// from
30820 20 69 64 65 6e 74 69 63 61 6c 6c 79 2d 76 61 6c   identically-val
30830 75 65 64 20 6f 76 65 72 66 6c 6f 77 58 20 61 6e  ued overflowX an
30840 64 20 6f 76 65 72 66 6c 6f 77 59 20 61 6e 64 20  d overflowY and 
30850 45 64 67 65 20 6a 75 73 74 20 6d 69 72 72 6f 72  Edge just mirror
30860 73 0a 09 09 2f 2f 20 74 68 65 20 6f 76 65 72 66  s...// the overf
30870 6c 6f 77 58 20 76 61 6c 75 65 20 74 68 65 72 65  lowX value there
30880 2e 0a 09 09 6f 70 74 73 2e 6f 76 65 72 66 6c 6f  ....opts.overflo
30890 77 20 3d 20 5b 20 73 74 79 6c 65 2e 6f 76 65 72  w = [ style.over
308a0 66 6c 6f 77 2c 20 73 74 79 6c 65 2e 6f 76 65 72  flow, style.over
308b0 66 6c 6f 77 58 2c 20 73 74 79 6c 65 2e 6f 76 65  flowX, style.ove
308c0 72 66 6c 6f 77 59 20 5d 3b 0a 0a 09 09 2f 2f 20  rflowY ];....// 
308d0 49 64 65 6e 74 69 66 79 20 61 20 64 69 73 70 6c  Identify a displ
308e0 61 79 20 74 79 70 65 2c 20 70 72 65 66 65 72 72  ay type, preferr
308f0 69 6e 67 20 6f 6c 64 20 73 68 6f 77 2f 68 69 64  ing old show/hid
30900 65 20 64 61 74 61 20 6f 76 65 72 20 74 68 65 20  e data over the 
30910 43 53 53 20 63 61 73 63 61 64 65 0a 09 09 72 65  CSS cascade...re
30920 73 74 6f 72 65 44 69 73 70 6c 61 79 20 3d 20 64  storeDisplay = d
30930 61 74 61 53 68 6f 77 20 26 26 20 64 61 74 61 53  ataShow && dataS
30940 68 6f 77 2e 64 69 73 70 6c 61 79 3b 0a 09 09 69  how.display;...i
30950 66 20 28 20 72 65 73 74 6f 72 65 44 69 73 70 6c  f ( restoreDispl
30960 61 79 20 3d 3d 20 6e 75 6c 6c 20 29 20 7b 0a 09  ay == null ) {..
30970 09 09 72 65 73 74 6f 72 65 44 69 73 70 6c 61 79  ..restoreDisplay
30980 20 3d 20 64 61 74 61 50 72 69 76 2e 67 65 74 28   = dataPriv.get(
30990 20 65 6c 65 6d 2c 20 22 64 69 73 70 6c 61 79 22   elem, "display"
309a0 20 29 3b 0a 09 09 7d 0a 09 09 64 69 73 70 6c 61   );...}...displa
309b0 79 20 3d 20 6a 51 75 65 72 79 2e 63 73 73 28 20  y = jQuery.css( 
309c0 65 6c 65 6d 2c 20 22 64 69 73 70 6c 61 79 22 20  elem, "display" 
309d0 29 3b 0a 09 09 69 66 20 28 20 64 69 73 70 6c 61  );...if ( displa
309e0 79 20 3d 3d 3d 20 22 6e 6f 6e 65 22 20 29 20 7b  y === "none" ) {
309f0 0a 09 09 09 69 66 20 28 20 72 65 73 74 6f 72 65  ....if ( restore
30a00 44 69 73 70 6c 61 79 20 29 20 7b 0a 09 09 09 09  Display ) {.....
30a10 64 69 73 70 6c 61 79 20 3d 20 72 65 73 74 6f 72  display = restor
30a20 65 44 69 73 70 6c 61 79 3b 0a 09 09 09 7d 20 65  eDisplay;....} e
30a30 6c 73 65 20 7b 0a 0a 09 09 09 09 2f 2f 20 47 65  lse {......// Ge
30a40 74 20 6e 6f 6e 65 6d 70 74 79 20 76 61 6c 75 65  t nonempty value
30a50 28 73 29 20 62 79 20 74 65 6d 70 6f 72 61 72 69  (s) by temporari
30a60 6c 79 20 66 6f 72 63 69 6e 67 20 76 69 73 69 62  ly forcing visib
30a70 69 6c 69 74 79 0a 09 09 09 09 73 68 6f 77 48 69  ility.....showHi
30a80 64 65 28 20 5b 20 65 6c 65 6d 20 5d 2c 20 74 72  de( [ elem ], tr
30a90 75 65 20 29 3b 0a 09 09 09 09 72 65 73 74 6f 72  ue );.....restor
30aa0 65 44 69 73 70 6c 61 79 20 3d 20 65 6c 65 6d 2e  eDisplay = elem.
30ab0 73 74 79 6c 65 2e 64 69 73 70 6c 61 79 20 7c 7c  style.display ||
30ac0 20 72 65 73 74 6f 72 65 44 69 73 70 6c 61 79 3b   restoreDisplay;
30ad0 0a 09 09 09 09 64 69 73 70 6c 61 79 20 3d 20 6a  .....display = j
30ae0 51 75 65 72 79 2e 63 73 73 28 20 65 6c 65 6d 2c  Query.css( elem,
30af0 20 22 64 69 73 70 6c 61 79 22 20 29 3b 0a 09 09   "display" );...
30b00 09 09 73 68 6f 77 48 69 64 65 28 20 5b 20 65 6c  ..showHide( [ el
30b10 65 6d 20 5d 20 29 3b 0a 09 09 09 7d 0a 09 09 7d  em ] );....}...}
30b20 0a 0a 09 09 2f 2f 20 41 6e 69 6d 61 74 65 20 69  ....// Animate i
30b30 6e 6c 69 6e 65 20 65 6c 65 6d 65 6e 74 73 20 61  nline elements a
30b40 73 20 69 6e 6c 69 6e 65 2d 62 6c 6f 63 6b 0a 09  s inline-block..
30b50 09 69 66 20 28 20 64 69 73 70 6c 61 79 20 3d 3d  .if ( display ==
30b60 3d 20 22 69 6e 6c 69 6e 65 22 20 7c 7c 20 64 69  = "inline" || di
30b70 73 70 6c 61 79 20 3d 3d 3d 20 22 69 6e 6c 69 6e  splay === "inlin
30b80 65 2d 62 6c 6f 63 6b 22 20 26 26 20 72 65 73 74  e-block" && rest
30b90 6f 72 65 44 69 73 70 6c 61 79 20 21 3d 20 6e 75  oreDisplay != nu
30ba0 6c 6c 20 29 20 7b 0a 09 09 09 69 66 20 28 20 6a  ll ) {....if ( j
30bb0 51 75 65 72 79 2e 63 73 73 28 20 65 6c 65 6d 2c  Query.css( elem,
30bc0 20 22 66 6c 6f 61 74 22 20 29 20 3d 3d 3d 20 22   "float" ) === "
30bd0 6e 6f 6e 65 22 20 29 20 7b 0a 0a 09 09 09 09 2f  none" ) {....../
30be0 2f 20 52 65 73 74 6f 72 65 20 74 68 65 20 6f 72  / Restore the or
30bf0 69 67 69 6e 61 6c 20 64 69 73 70 6c 61 79 20 76  iginal display v
30c00 61 6c 75 65 20 61 74 20 74 68 65 20 65 6e 64 20  alue at the end 
30c10 6f 66 20 70 75 72 65 20 73 68 6f 77 2f 68 69 64  of pure show/hid
30c20 65 20 61 6e 69 6d 61 74 69 6f 6e 73 0a 09 09 09  e animations....
30c30 09 69 66 20 28 20 21 70 72 6f 70 54 77 65 65 6e  .if ( !propTween
30c40 20 29 20 7b 0a 09 09 09 09 09 61 6e 69 6d 2e 64   ) {......anim.d
30c50 6f 6e 65 28 20 66 75 6e 63 74 69 6f 6e 28 29 20  one( function() 
30c60 7b 0a 09 09 09 09 09 09 73 74 79 6c 65 2e 64 69  {.......style.di
30c70 73 70 6c 61 79 20 3d 20 72 65 73 74 6f 72 65 44  splay = restoreD
30c80 69 73 70 6c 61 79 3b 0a 09 09 09 09 09 7d 20 29  isplay;......} )
30c90 3b 0a 09 09 09 09 09 69 66 20 28 20 72 65 73 74  ;......if ( rest
30ca0 6f 72 65 44 69 73 70 6c 61 79 20 3d 3d 20 6e 75  oreDisplay == nu
30cb0 6c 6c 20 29 20 7b 0a 09 09 09 09 09 09 64 69 73  ll ) {.......dis
30cc0 70 6c 61 79 20 3d 20 73 74 79 6c 65 2e 64 69 73  play = style.dis
30cd0 70 6c 61 79 3b 0a 09 09 09 09 09 09 72 65 73 74  play;.......rest
30ce0 6f 72 65 44 69 73 70 6c 61 79 20 3d 20 64 69 73  oreDisplay = dis
30cf0 70 6c 61 79 20 3d 3d 3d 20 22 6e 6f 6e 65 22 20  play === "none" 
30d00 3f 20 22 22 20 3a 20 64 69 73 70 6c 61 79 3b 0a  ? "" : display;.
30d10 09 09 09 09 09 7d 0a 09 09 09 09 7d 0a 09 09 09  .....}.....}....
30d20 09 73 74 79 6c 65 2e 64 69 73 70 6c 61 79 20 3d  .style.display =
30d30 20 22 69 6e 6c 69 6e 65 2d 62 6c 6f 63 6b 22 3b   "inline-block";
30d40 0a 09 09 09 7d 0a 09 09 7d 0a 09 7d 0a 0a 09 69  ....}...}..}...i
30d50 66 20 28 20 6f 70 74 73 2e 6f 76 65 72 66 6c 6f  f ( opts.overflo
30d60 77 20 29 20 7b 0a 09 09 73 74 79 6c 65 2e 6f 76  w ) {...style.ov
30d70 65 72 66 6c 6f 77 20 3d 20 22 68 69 64 64 65 6e  erflow = "hidden
30d80 22 3b 0a 09 09 61 6e 69 6d 2e 61 6c 77 61 79 73  ";...anim.always
30d90 28 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09  ( function() {..
30da0 09 09 73 74 79 6c 65 2e 6f 76 65 72 66 6c 6f 77  ..style.overflow
30db0 20 3d 20 6f 70 74 73 2e 6f 76 65 72 66 6c 6f 77   = opts.overflow
30dc0 5b 20 30 20 5d 3b 0a 09 09 09 73 74 79 6c 65 2e  [ 0 ];....style.
30dd0 6f 76 65 72 66 6c 6f 77 58 20 3d 20 6f 70 74 73  overflowX = opts
30de0 2e 6f 76 65 72 66 6c 6f 77 5b 20 31 20 5d 3b 0a  .overflow[ 1 ];.
30df0 09 09 09 73 74 79 6c 65 2e 6f 76 65 72 66 6c 6f  ...style.overflo
30e00 77 59 20 3d 20 6f 70 74 73 2e 6f 76 65 72 66 6c  wY = opts.overfl
30e10 6f 77 5b 20 32 20 5d 3b 0a 09 09 7d 20 29 3b 0a  ow[ 2 ];...} );.
30e20 09 7d 0a 0a 09 2f 2f 20 49 6d 70 6c 65 6d 65 6e  .}...// Implemen
30e30 74 20 73 68 6f 77 2f 68 69 64 65 20 61 6e 69 6d  t show/hide anim
30e40 61 74 69 6f 6e 73 0a 09 70 72 6f 70 54 77 65 65  ations..propTwee
30e50 6e 20 3d 20 66 61 6c 73 65 3b 0a 09 66 6f 72 20  n = false;..for 
30e60 28 20 70 72 6f 70 20 69 6e 20 6f 72 69 67 20 29  ( prop in orig )
30e70 20 7b 0a 0a 09 09 2f 2f 20 47 65 6e 65 72 61 6c   {....// General
30e80 20 73 68 6f 77 2f 68 69 64 65 20 73 65 74 75 70   show/hide setup
30e90 20 66 6f 72 20 74 68 69 73 20 65 6c 65 6d 65 6e   for this elemen
30ea0 74 20 61 6e 69 6d 61 74 69 6f 6e 0a 09 09 69 66  t animation...if
30eb0 20 28 20 21 70 72 6f 70 54 77 65 65 6e 20 29 20   ( !propTween ) 
30ec0 7b 0a 09 09 09 69 66 20 28 20 64 61 74 61 53 68  {....if ( dataSh
30ed0 6f 77 20 29 20 7b 0a 09 09 09 09 69 66 20 28 20  ow ) {.....if ( 
30ee0 22 68 69 64 64 65 6e 22 20 69 6e 20 64 61 74 61  "hidden" in data
30ef0 53 68 6f 77 20 29 20 7b 0a 09 09 09 09 09 68 69  Show ) {......hi
30f00 64 64 65 6e 20 3d 20 64 61 74 61 53 68 6f 77 2e  dden = dataShow.
30f10 68 69 64 64 65 6e 3b 0a 09 09 09 09 7d 0a 09 09  hidden;.....}...
30f20 09 7d 20 65 6c 73 65 20 7b 0a 09 09 09 09 64 61  .} else {.....da
30f30 74 61 53 68 6f 77 20 3d 20 64 61 74 61 50 72 69  taShow = dataPri
30f40 76 2e 61 63 63 65 73 73 28 20 65 6c 65 6d 2c 20  v.access( elem, 
30f50 22 66 78 73 68 6f 77 22 2c 20 7b 20 64 69 73 70  "fxshow", { disp
30f60 6c 61 79 3a 20 72 65 73 74 6f 72 65 44 69 73 70  lay: restoreDisp
30f70 6c 61 79 20 7d 20 29 3b 0a 09 09 09 7d 0a 0a 09  lay } );....}...
30f80 09 09 2f 2f 20 53 74 6f 72 65 20 68 69 64 64 65  ..// Store hidde
30f90 6e 2f 76 69 73 69 62 6c 65 20 66 6f 72 20 74 6f  n/visible for to
30fa0 67 67 6c 65 20 73 6f 20 60 2e 73 74 6f 70 28 29  ggle so `.stop()
30fb0 2e 74 6f 67 67 6c 65 28 29 60 20 22 72 65 76 65  .toggle()` "reve
30fc0 72 73 65 73 22 0a 09 09 09 69 66 20 28 20 74 6f  rses"....if ( to
30fd0 67 67 6c 65 20 29 20 7b 0a 09 09 09 09 64 61 74  ggle ) {.....dat
30fe0 61 53 68 6f 77 2e 68 69 64 64 65 6e 20 3d 20 21  aShow.hidden = !
30ff0 68 69 64 64 65 6e 3b 0a 09 09 09 7d 0a 0a 09 09  hidden;....}....
31000 09 2f 2f 20 53 68 6f 77 20 65 6c 65 6d 65 6e 74  .// Show element
31010 73 20 62 65 66 6f 72 65 20 61 6e 69 6d 61 74 69  s before animati
31020 6e 67 20 74 68 65 6d 0a 09 09 09 69 66 20 28 20  ng them....if ( 
31030 68 69 64 64 65 6e 20 29 20 7b 0a 09 09 09 09 73  hidden ) {.....s
31040 68 6f 77 48 69 64 65 28 20 5b 20 65 6c 65 6d 20  howHide( [ elem 
31050 5d 2c 20 74 72 75 65 20 29 3b 0a 09 09 09 7d 0a  ], true );....}.
31060 0a 09 09 09 2f 2a 20 65 73 6c 69 6e 74 2d 64 69  ..../* eslint-di
31070 73 61 62 6c 65 20 6e 6f 2d 6c 6f 6f 70 2d 66 75  sable no-loop-fu
31080 6e 63 20 2a 2f 0a 0a 09 09 09 61 6e 69 6d 2e 64  nc */.....anim.d
31090 6f 6e 65 28 20 66 75 6e 63 74 69 6f 6e 28 29 20  one( function() 
310a0 7b 0a 0a 09 09 09 2f 2a 20 65 73 6c 69 6e 74 2d  {...../* eslint-
310b0 65 6e 61 62 6c 65 20 6e 6f 2d 6c 6f 6f 70 2d 66  enable no-loop-f
310c0 75 6e 63 20 2a 2f 0a 0a 09 09 09 09 2f 2f 20 54  unc */......// T
310d0 68 65 20 66 69 6e 61 6c 20 73 74 65 70 20 6f 66  he final step of
310e0 20 61 20 22 68 69 64 65 22 20 61 6e 69 6d 61 74   a "hide" animat
310f0 69 6f 6e 20 69 73 20 61 63 74 75 61 6c 6c 79 20  ion is actually 
31100 68 69 64 69 6e 67 20 74 68 65 20 65 6c 65 6d 65  hiding the eleme
31110 6e 74 0a 09 09 09 09 69 66 20 28 20 21 68 69 64  nt.....if ( !hid
31120 64 65 6e 20 29 20 7b 0a 09 09 09 09 09 73 68 6f  den ) {......sho
31130 77 48 69 64 65 28 20 5b 20 65 6c 65 6d 20 5d 20  wHide( [ elem ] 
31140 29 3b 0a 09 09 09 09 7d 0a 09 09 09 09 64 61 74  );.....}.....dat
31150 61 50 72 69 76 2e 72 65 6d 6f 76 65 28 20 65 6c  aPriv.remove( el
31160 65 6d 2c 20 22 66 78 73 68 6f 77 22 20 29 3b 0a  em, "fxshow" );.
31170 09 09 09 09 66 6f 72 20 28 20 70 72 6f 70 20 69  ....for ( prop i
31180 6e 20 6f 72 69 67 20 29 20 7b 0a 09 09 09 09 09  n orig ) {......
31190 6a 51 75 65 72 79 2e 73 74 79 6c 65 28 20 65 6c  jQuery.style( el
311a0 65 6d 2c 20 70 72 6f 70 2c 20 6f 72 69 67 5b 20  em, prop, orig[ 
311b0 70 72 6f 70 20 5d 20 29 3b 0a 09 09 09 09 7d 0a  prop ] );.....}.
311c0 09 09 09 7d 20 29 3b 0a 09 09 7d 0a 0a 09 09 2f  ...} );...}..../
311d0 2f 20 50 65 72 2d 70 72 6f 70 65 72 74 79 20 73  / Per-property s
311e0 65 74 75 70 0a 09 09 70 72 6f 70 54 77 65 65 6e  etup...propTween
311f0 20 3d 20 63 72 65 61 74 65 54 77 65 65 6e 28 20   = createTween( 
31200 68 69 64 64 65 6e 20 3f 20 64 61 74 61 53 68 6f  hidden ? dataSho
31210 77 5b 20 70 72 6f 70 20 5d 20 3a 20 30 2c 20 70  w[ prop ] : 0, p
31220 72 6f 70 2c 20 61 6e 69 6d 20 29 3b 0a 09 09 69  rop, anim );...i
31230 66 20 28 20 21 28 20 70 72 6f 70 20 69 6e 20 64  f ( !( prop in d
31240 61 74 61 53 68 6f 77 20 29 20 29 20 7b 0a 09 09  ataShow ) ) {...
31250 09 64 61 74 61 53 68 6f 77 5b 20 70 72 6f 70 20  .dataShow[ prop 
31260 5d 20 3d 20 70 72 6f 70 54 77 65 65 6e 2e 73 74  ] = propTween.st
31270 61 72 74 3b 0a 09 09 09 69 66 20 28 20 68 69 64  art;....if ( hid
31280 64 65 6e 20 29 20 7b 0a 09 09 09 09 70 72 6f 70  den ) {.....prop
31290 54 77 65 65 6e 2e 65 6e 64 20 3d 20 70 72 6f 70  Tween.end = prop
312a0 54 77 65 65 6e 2e 73 74 61 72 74 3b 0a 09 09 09  Tween.start;....
312b0 09 70 72 6f 70 54 77 65 65 6e 2e 73 74 61 72 74  .propTween.start
312c0 20 3d 20 30 3b 0a 09 09 09 7d 0a 09 09 7d 0a 09   = 0;....}...}..
312d0 7d 0a 7d 0a 0a 66 75 6e 63 74 69 6f 6e 20 70 72  }.}..function pr
312e0 6f 70 46 69 6c 74 65 72 28 20 70 72 6f 70 73 2c  opFilter( props,
312f0 20 73 70 65 63 69 61 6c 45 61 73 69 6e 67 20 29   specialEasing )
31300 20 7b 0a 09 76 61 72 20 69 6e 64 65 78 2c 20 6e   {..var index, n
31310 61 6d 65 2c 20 65 61 73 69 6e 67 2c 20 76 61 6c  ame, easing, val
31320 75 65 2c 20 68 6f 6f 6b 73 3b 0a 0a 09 2f 2f 20  ue, hooks;...// 
31330 63 61 6d 65 6c 43 61 73 65 2c 20 73 70 65 63 69  camelCase, speci
31340 61 6c 45 61 73 69 6e 67 20 61 6e 64 20 65 78 70  alEasing and exp
31350 61 6e 64 20 63 73 73 48 6f 6f 6b 20 70 61 73 73  and cssHook pass
31360 0a 09 66 6f 72 20 28 20 69 6e 64 65 78 20 69 6e  ..for ( index in
31370 20 70 72 6f 70 73 20 29 20 7b 0a 09 09 6e 61 6d   props ) {...nam
31380 65 20 3d 20 63 61 6d 65 6c 43 61 73 65 28 20 69  e = camelCase( i
31390 6e 64 65 78 20 29 3b 0a 09 09 65 61 73 69 6e 67  ndex );...easing
313a0 20 3d 20 73 70 65 63 69 61 6c 45 61 73 69 6e 67   = specialEasing
313b0 5b 20 6e 61 6d 65 20 5d 3b 0a 09 09 76 61 6c 75  [ name ];...valu
313c0 65 20 3d 20 70 72 6f 70 73 5b 20 69 6e 64 65 78  e = props[ index
313d0 20 5d 3b 0a 09 09 69 66 20 28 20 41 72 72 61 79   ];...if ( Array
313e0 2e 69 73 41 72 72 61 79 28 20 76 61 6c 75 65 20  .isArray( value 
313f0 29 20 29 20 7b 0a 09 09 09 65 61 73 69 6e 67 20  ) ) {....easing 
31400 3d 20 76 61 6c 75 65 5b 20 31 20 5d 3b 0a 09 09  = value[ 1 ];...
31410 09 76 61 6c 75 65 20 3d 20 70 72 6f 70 73 5b 20  .value = props[ 
31420 69 6e 64 65 78 20 5d 20 3d 20 76 61 6c 75 65 5b  index ] = value[
31430 20 30 20 5d 3b 0a 09 09 7d 0a 0a 09 09 69 66 20   0 ];...}....if 
31440 28 20 69 6e 64 65 78 20 21 3d 3d 20 6e 61 6d 65  ( index !== name
31450 20 29 20 7b 0a 09 09 09 70 72 6f 70 73 5b 20 6e   ) {....props[ n
31460 61 6d 65 20 5d 20 3d 20 76 61 6c 75 65 3b 0a 09  ame ] = value;..
31470 09 09 64 65 6c 65 74 65 20 70 72 6f 70 73 5b 20  ..delete props[ 
31480 69 6e 64 65 78 20 5d 3b 0a 09 09 7d 0a 0a 09 09  index ];...}....
31490 68 6f 6f 6b 73 20 3d 20 6a 51 75 65 72 79 2e 63  hooks = jQuery.c
314a0 73 73 48 6f 6f 6b 73 5b 20 6e 61 6d 65 20 5d 3b  ssHooks[ name ];
314b0 0a 09 09 69 66 20 28 20 68 6f 6f 6b 73 20 26 26  ...if ( hooks &&
314c0 20 22 65 78 70 61 6e 64 22 20 69 6e 20 68 6f 6f   "expand" in hoo
314d0 6b 73 20 29 20 7b 0a 09 09 09 76 61 6c 75 65 20  ks ) {....value 
314e0 3d 20 68 6f 6f 6b 73 2e 65 78 70 61 6e 64 28 20  = hooks.expand( 
314f0 76 61 6c 75 65 20 29 3b 0a 09 09 09 64 65 6c 65  value );....dele
31500 74 65 20 70 72 6f 70 73 5b 20 6e 61 6d 65 20 5d  te props[ name ]
31510 3b 0a 0a 09 09 09 2f 2f 20 4e 6f 74 20 71 75 69  ;.....// Not qui
31520 74 65 20 24 2e 65 78 74 65 6e 64 2c 20 74 68 69  te $.extend, thi
31530 73 20 77 6f 6e 27 74 20 6f 76 65 72 77 72 69 74  s won't overwrit
31540 65 20 65 78 69 73 74 69 6e 67 20 6b 65 79 73 2e  e existing keys.
31550 0a 09 09 09 2f 2f 20 52 65 75 73 69 6e 67 20 27  ....// Reusing '
31560 69 6e 64 65 78 27 20 62 65 63 61 75 73 65 20 77  index' because w
31570 65 20 68 61 76 65 20 74 68 65 20 63 6f 72 72 65  e have the corre
31580 63 74 20 22 6e 61 6d 65 22 0a 09 09 09 66 6f 72  ct "name"....for
31590 20 28 20 69 6e 64 65 78 20 69 6e 20 76 61 6c 75   ( index in valu
315a0 65 20 29 20 7b 0a 09 09 09 09 69 66 20 28 20 21  e ) {.....if ( !
315b0 28 20 69 6e 64 65 78 20 69 6e 20 70 72 6f 70 73  ( index in props
315c0 20 29 20 29 20 7b 0a 09 09 09 09 09 70 72 6f 70   ) ) {......prop
315d0 73 5b 20 69 6e 64 65 78 20 5d 20 3d 20 76 61 6c  s[ index ] = val
315e0 75 65 5b 20 69 6e 64 65 78 20 5d 3b 0a 09 09 09  ue[ index ];....
315f0 09 09 73 70 65 63 69 61 6c 45 61 73 69 6e 67 5b  ..specialEasing[
31600 20 69 6e 64 65 78 20 5d 20 3d 20 65 61 73 69 6e   index ] = easin
31610 67 3b 0a 09 09 09 09 7d 0a 09 09 09 7d 0a 09 09  g;.....}....}...
31620 7d 20 65 6c 73 65 20 7b 0a 09 09 09 73 70 65 63  } else {....spec
31630 69 61 6c 45 61 73 69 6e 67 5b 20 6e 61 6d 65 20  ialEasing[ name 
31640 5d 20 3d 20 65 61 73 69 6e 67 3b 0a 09 09 7d 0a  ] = easing;...}.
31650 09 7d 0a 7d 0a 0a 66 75 6e 63 74 69 6f 6e 20 41  .}.}..function A
31660 6e 69 6d 61 74 69 6f 6e 28 20 65 6c 65 6d 2c 20  nimation( elem, 
31670 70 72 6f 70 65 72 74 69 65 73 2c 20 6f 70 74 69  properties, opti
31680 6f 6e 73 20 29 20 7b 0a 09 76 61 72 20 72 65 73  ons ) {..var res
31690 75 6c 74 2c 0a 09 09 73 74 6f 70 70 65 64 2c 0a  ult,...stopped,.
316a0 09 09 69 6e 64 65 78 20 3d 20 30 2c 0a 09 09 6c  ..index = 0,...l
316b0 65 6e 67 74 68 20 3d 20 41 6e 69 6d 61 74 69 6f  ength = Animatio
316c0 6e 2e 70 72 65 66 69 6c 74 65 72 73 2e 6c 65 6e  n.prefilters.len
316d0 67 74 68 2c 0a 09 09 64 65 66 65 72 72 65 64 20  gth,...deferred 
316e0 3d 20 6a 51 75 65 72 79 2e 44 65 66 65 72 72 65  = jQuery.Deferre
316f0 64 28 29 2e 61 6c 77 61 79 73 28 20 66 75 6e 63  d().always( func
31700 74 69 6f 6e 28 29 20 7b 0a 0a 09 09 09 2f 2f 20  tion() {.....// 
31710 44 6f 6e 27 74 20 6d 61 74 63 68 20 65 6c 65 6d  Don't match elem
31720 20 69 6e 20 74 68 65 20 3a 61 6e 69 6d 61 74 65   in the :animate
31730 64 20 73 65 6c 65 63 74 6f 72 0a 09 09 09 64 65  d selector....de
31740 6c 65 74 65 20 74 69 63 6b 2e 65 6c 65 6d 3b 0a  lete tick.elem;.
31750 09 09 7d 20 29 2c 0a 09 09 74 69 63 6b 20 3d 20  ..} ),...tick = 
31760 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09 09 09  function() {....
31770 69 66 20 28 20 73 74 6f 70 70 65 64 20 29 20 7b  if ( stopped ) {
31780 0a 09 09 09 09 72 65 74 75 72 6e 20 66 61 6c 73  .....return fals
31790 65 3b 0a 09 09 09 7d 0a 09 09 09 76 61 72 20 63  e;....}....var c
317a0 75 72 72 65 6e 74 54 69 6d 65 20 3d 20 66 78 4e  urrentTime = fxN
317b0 6f 77 20 7c 7c 20 63 72 65 61 74 65 46 78 4e 6f  ow || createFxNo
317c0 77 28 29 2c 0a 09 09 09 09 72 65 6d 61 69 6e 69  w(),.....remaini
317d0 6e 67 20 3d 20 4d 61 74 68 2e 6d 61 78 28 20 30  ng = Math.max( 0
317e0 2c 20 61 6e 69 6d 61 74 69 6f 6e 2e 73 74 61 72  , animation.star
317f0 74 54 69 6d 65 20 2b 20 61 6e 69 6d 61 74 69 6f  tTime + animatio
31800 6e 2e 64 75 72 61 74 69 6f 6e 20 2d 20 63 75 72  n.duration - cur
31810 72 65 6e 74 54 69 6d 65 20 29 2c 0a 0a 09 09 09  rentTime ),.....
31820 09 2f 2f 20 53 75 70 70 6f 72 74 3a 20 41 6e 64  .// Support: And
31830 72 6f 69 64 20 32 2e 33 20 6f 6e 6c 79 0a 09 09  roid 2.3 only...
31840 09 09 2f 2f 20 41 72 63 68 61 69 63 20 63 72 61  ..// Archaic cra
31850 73 68 20 62 75 67 20 77 6f 6e 27 74 20 61 6c 6c  sh bug won't all
31860 6f 77 20 75 73 20 74 6f 20 75 73 65 20 60 31 20  ow us to use `1 
31870 2d 20 28 20 30 2e 35 20 7c 7c 20 30 20 29 60 20  - ( 0.5 || 0 )` 
31880 28 23 31 32 34 39 37 29 0a 09 09 09 09 74 65 6d  (#12497).....tem
31890 70 20 3d 20 72 65 6d 61 69 6e 69 6e 67 20 2f 20  p = remaining / 
318a0 61 6e 69 6d 61 74 69 6f 6e 2e 64 75 72 61 74 69  animation.durati
318b0 6f 6e 20 7c 7c 20 30 2c 0a 09 09 09 09 70 65 72  on || 0,.....per
318c0 63 65 6e 74 20 3d 20 31 20 2d 20 74 65 6d 70 2c  cent = 1 - temp,
318d0 0a 09 09 09 09 69 6e 64 65 78 20 3d 20 30 2c 0a  .....index = 0,.
318e0 09 09 09 09 6c 65 6e 67 74 68 20 3d 20 61 6e 69  ....length = ani
318f0 6d 61 74 69 6f 6e 2e 74 77 65 65 6e 73 2e 6c 65  mation.tweens.le
31900 6e 67 74 68 3b 0a 0a 09 09 09 66 6f 72 20 28 20  ngth;.....for ( 
31910 3b 20 69 6e 64 65 78 20 3c 20 6c 65 6e 67 74 68  ; index < length
31920 3b 20 69 6e 64 65 78 2b 2b 20 29 20 7b 0a 09 09  ; index++ ) {...
31930 09 09 61 6e 69 6d 61 74 69 6f 6e 2e 74 77 65 65  ..animation.twee
31940 6e 73 5b 20 69 6e 64 65 78 20 5d 2e 72 75 6e 28  ns[ index ].run(
31950 20 70 65 72 63 65 6e 74 20 29 3b 0a 09 09 09 7d   percent );....}
31960 0a 0a 09 09 09 64 65 66 65 72 72 65 64 2e 6e 6f  .....deferred.no
31970 74 69 66 79 57 69 74 68 28 20 65 6c 65 6d 2c 20  tifyWith( elem, 
31980 5b 20 61 6e 69 6d 61 74 69 6f 6e 2c 20 70 65 72  [ animation, per
31990 63 65 6e 74 2c 20 72 65 6d 61 69 6e 69 6e 67 20  cent, remaining 
319a0 5d 20 29 3b 0a 0a 09 09 09 2f 2f 20 49 66 20 74  ] );.....// If t
319b0 68 65 72 65 27 73 20 6d 6f 72 65 20 74 6f 20 64  here's more to d
319c0 6f 2c 20 79 69 65 6c 64 0a 09 09 09 69 66 20 28  o, yield....if (
319d0 20 70 65 72 63 65 6e 74 20 3c 20 31 20 26 26 20   percent < 1 && 
319e0 6c 65 6e 67 74 68 20 29 20 7b 0a 09 09 09 09 72  length ) {.....r
319f0 65 74 75 72 6e 20 72 65 6d 61 69 6e 69 6e 67 3b  eturn remaining;
31a00 0a 09 09 09 7d 0a 0a 09 09 09 2f 2f 20 49 66 20  ....}.....// If 
31a10 74 68 69 73 20 77 61 73 20 61 6e 20 65 6d 70 74  this was an empt
31a20 79 20 61 6e 69 6d 61 74 69 6f 6e 2c 20 73 79 6e  y animation, syn
31a30 74 68 65 73 69 7a 65 20 61 20 66 69 6e 61 6c 20  thesize a final 
31a40 70 72 6f 67 72 65 73 73 20 6e 6f 74 69 66 69 63  progress notific
31a50 61 74 69 6f 6e 0a 09 09 09 69 66 20 28 20 21 6c  ation....if ( !l
31a60 65 6e 67 74 68 20 29 20 7b 0a 09 09 09 09 64 65  ength ) {.....de
31a70 66 65 72 72 65 64 2e 6e 6f 74 69 66 79 57 69 74  ferred.notifyWit
31a80 68 28 20 65 6c 65 6d 2c 20 5b 20 61 6e 69 6d 61  h( elem, [ anima
31a90 74 69 6f 6e 2c 20 31 2c 20 30 20 5d 20 29 3b 0a  tion, 1, 0 ] );.
31aa0 09 09 09 7d 0a 0a 09 09 09 2f 2f 20 52 65 73 6f  ...}.....// Reso
31ab0 6c 76 65 20 74 68 65 20 61 6e 69 6d 61 74 69 6f  lve the animatio
31ac0 6e 20 61 6e 64 20 72 65 70 6f 72 74 20 69 74 73  n and report its
31ad0 20 63 6f 6e 63 6c 75 73 69 6f 6e 0a 09 09 09 64   conclusion....d
31ae0 65 66 65 72 72 65 64 2e 72 65 73 6f 6c 76 65 57  eferred.resolveW
31af0 69 74 68 28 20 65 6c 65 6d 2c 20 5b 20 61 6e 69  ith( elem, [ ani
31b00 6d 61 74 69 6f 6e 20 5d 20 29 3b 0a 09 09 09 72  mation ] );....r
31b10 65 74 75 72 6e 20 66 61 6c 73 65 3b 0a 09 09 7d  eturn false;...}
31b20 2c 0a 09 09 61 6e 69 6d 61 74 69 6f 6e 20 3d 20  ,...animation = 
31b30 64 65 66 65 72 72 65 64 2e 70 72 6f 6d 69 73 65  deferred.promise
31b40 28 20 7b 0a 09 09 09 65 6c 65 6d 3a 20 65 6c 65  ( {....elem: ele
31b50 6d 2c 0a 09 09 09 70 72 6f 70 73 3a 20 6a 51 75  m,....props: jQu
31b60 65 72 79 2e 65 78 74 65 6e 64 28 20 7b 7d 2c 20  ery.extend( {}, 
31b70 70 72 6f 70 65 72 74 69 65 73 20 29 2c 0a 09 09  properties ),...
31b80 09 6f 70 74 73 3a 20 6a 51 75 65 72 79 2e 65 78  .opts: jQuery.ex
31b90 74 65 6e 64 28 20 74 72 75 65 2c 20 7b 0a 09 09  tend( true, {...
31ba0 09 09 73 70 65 63 69 61 6c 45 61 73 69 6e 67 3a  ..specialEasing:
31bb0 20 7b 7d 2c 0a 09 09 09 09 65 61 73 69 6e 67 3a   {},.....easing:
31bc0 20 6a 51 75 65 72 79 2e 65 61 73 69 6e 67 2e 5f   jQuery.easing._
31bd0 64 65 66 61 75 6c 74 0a 09 09 09 7d 2c 20 6f 70  default....}, op
31be0 74 69 6f 6e 73 20 29 2c 0a 09 09 09 6f 72 69 67  tions ),....orig
31bf0 69 6e 61 6c 50 72 6f 70 65 72 74 69 65 73 3a 20  inalProperties: 
31c00 70 72 6f 70 65 72 74 69 65 73 2c 0a 09 09 09 6f  properties,....o
31c10 72 69 67 69 6e 61 6c 4f 70 74 69 6f 6e 73 3a 20  riginalOptions: 
31c20 6f 70 74 69 6f 6e 73 2c 0a 09 09 09 73 74 61 72  options,....star
31c30 74 54 69 6d 65 3a 20 66 78 4e 6f 77 20 7c 7c 20  tTime: fxNow || 
31c40 63 72 65 61 74 65 46 78 4e 6f 77 28 29 2c 0a 09  createFxNow(),..
31c50 09 09 64 75 72 61 74 69 6f 6e 3a 20 6f 70 74 69  ..duration: opti
31c60 6f 6e 73 2e 64 75 72 61 74 69 6f 6e 2c 0a 09 09  ons.duration,...
31c70 09 74 77 65 65 6e 73 3a 20 5b 5d 2c 0a 09 09 09  .tweens: [],....
31c80 63 72 65 61 74 65 54 77 65 65 6e 3a 20 66 75 6e  createTween: fun
31c90 63 74 69 6f 6e 28 20 70 72 6f 70 2c 20 65 6e 64  ction( prop, end
31ca0 20 29 20 7b 0a 09 09 09 09 76 61 72 20 74 77 65   ) {.....var twe
31cb0 65 6e 20 3d 20 6a 51 75 65 72 79 2e 54 77 65 65  en = jQuery.Twee
31cc0 6e 28 20 65 6c 65 6d 2c 20 61 6e 69 6d 61 74 69  n( elem, animati
31cd0 6f 6e 2e 6f 70 74 73 2c 20 70 72 6f 70 2c 20 65  on.opts, prop, e
31ce0 6e 64 2c 0a 09 09 09 09 09 09 61 6e 69 6d 61 74  nd,.......animat
31cf0 69 6f 6e 2e 6f 70 74 73 2e 73 70 65 63 69 61 6c  ion.opts.special
31d00 45 61 73 69 6e 67 5b 20 70 72 6f 70 20 5d 20 7c  Easing[ prop ] |
31d10 7c 20 61 6e 69 6d 61 74 69 6f 6e 2e 6f 70 74 73  | animation.opts
31d20 2e 65 61 73 69 6e 67 20 29 3b 0a 09 09 09 09 61  .easing );.....a
31d30 6e 69 6d 61 74 69 6f 6e 2e 74 77 65 65 6e 73 2e  nimation.tweens.
31d40 70 75 73 68 28 20 74 77 65 65 6e 20 29 3b 0a 09  push( tween );..
31d50 09 09 09 72 65 74 75 72 6e 20 74 77 65 65 6e 3b  ...return tween;
31d60 0a 09 09 09 7d 2c 0a 09 09 09 73 74 6f 70 3a 20  ....},....stop: 
31d70 66 75 6e 63 74 69 6f 6e 28 20 67 6f 74 6f 45 6e  function( gotoEn
31d80 64 20 29 20 7b 0a 09 09 09 09 76 61 72 20 69 6e  d ) {.....var in
31d90 64 65 78 20 3d 20 30 2c 0a 0a 09 09 09 09 09 2f  dex = 0,......./
31da0 2f 20 49 66 20 77 65 20 61 72 65 20 67 6f 69 6e  / If we are goin
31db0 67 20 74 6f 20 74 68 65 20 65 6e 64 2c 20 77 65  g to the end, we
31dc0 20 77 61 6e 74 20 74 6f 20 72 75 6e 20 61 6c 6c   want to run all
31dd0 20 74 68 65 20 74 77 65 65 6e 73 0a 09 09 09 09   the tweens.....
31de0 09 2f 2f 20 6f 74 68 65 72 77 69 73 65 20 77 65  .// otherwise we
31df0 20 73 6b 69 70 20 74 68 69 73 20 70 61 72 74 0a   skip this part.
31e00 09 09 09 09 09 6c 65 6e 67 74 68 20 3d 20 67 6f  .....length = go
31e10 74 6f 45 6e 64 20 3f 20 61 6e 69 6d 61 74 69 6f  toEnd ? animatio
31e20 6e 2e 74 77 65 65 6e 73 2e 6c 65 6e 67 74 68 20  n.tweens.length 
31e30 3a 20 30 3b 0a 09 09 09 09 69 66 20 28 20 73 74  : 0;.....if ( st
31e40 6f 70 70 65 64 20 29 20 7b 0a 09 09 09 09 09 72  opped ) {......r
31e50 65 74 75 72 6e 20 74 68 69 73 3b 0a 09 09 09 09  eturn this;.....
31e60 7d 0a 09 09 09 09 73 74 6f 70 70 65 64 20 3d 20  }.....stopped = 
31e70 74 72 75 65 3b 0a 09 09 09 09 66 6f 72 20 28 20  true;.....for ( 
31e80 3b 20 69 6e 64 65 78 20 3c 20 6c 65 6e 67 74 68  ; index < length
31e90 3b 20 69 6e 64 65 78 2b 2b 20 29 20 7b 0a 09 09  ; index++ ) {...
31ea0 09 09 09 61 6e 69 6d 61 74 69 6f 6e 2e 74 77 65  ...animation.twe
31eb0 65 6e 73 5b 20 69 6e 64 65 78 20 5d 2e 72 75 6e  ens[ index ].run
31ec0 28 20 31 20 29 3b 0a 09 09 09 09 7d 0a 0a 09 09  ( 1 );.....}....
31ed0 09 09 2f 2f 20 52 65 73 6f 6c 76 65 20 77 68 65  ..// Resolve whe
31ee0 6e 20 77 65 20 70 6c 61 79 65 64 20 74 68 65 20  n we played the 
31ef0 6c 61 73 74 20 66 72 61 6d 65 3b 20 6f 74 68 65  last frame; othe
31f00 72 77 69 73 65 2c 20 72 65 6a 65 63 74 0a 09 09  rwise, reject...
31f10 09 09 69 66 20 28 20 67 6f 74 6f 45 6e 64 20 29  ..if ( gotoEnd )
31f20 20 7b 0a 09 09 09 09 09 64 65 66 65 72 72 65 64   {......deferred
31f30 2e 6e 6f 74 69 66 79 57 69 74 68 28 20 65 6c 65  .notifyWith( ele
31f40 6d 2c 20 5b 20 61 6e 69 6d 61 74 69 6f 6e 2c 20  m, [ animation, 
31f50 31 2c 20 30 20 5d 20 29 3b 0a 09 09 09 09 09 64  1, 0 ] );......d
31f60 65 66 65 72 72 65 64 2e 72 65 73 6f 6c 76 65 57  eferred.resolveW
31f70 69 74 68 28 20 65 6c 65 6d 2c 20 5b 20 61 6e 69  ith( elem, [ ani
31f80 6d 61 74 69 6f 6e 2c 20 67 6f 74 6f 45 6e 64 20  mation, gotoEnd 
31f90 5d 20 29 3b 0a 09 09 09 09 7d 20 65 6c 73 65 20  ] );.....} else 
31fa0 7b 0a 09 09 09 09 09 64 65 66 65 72 72 65 64 2e  {......deferred.
31fb0 72 65 6a 65 63 74 57 69 74 68 28 20 65 6c 65 6d  rejectWith( elem
31fc0 2c 20 5b 20 61 6e 69 6d 61 74 69 6f 6e 2c 20 67  , [ animation, g
31fd0 6f 74 6f 45 6e 64 20 5d 20 29 3b 0a 09 09 09 09  otoEnd ] );.....
31fe0 7d 0a 09 09 09 09 72 65 74 75 72 6e 20 74 68 69  }.....return thi
31ff0 73 3b 0a 09 09 09 7d 0a 09 09 7d 20 29 2c 0a 09  s;....}...} ),..
32000 09 70 72 6f 70 73 20 3d 20 61 6e 69 6d 61 74 69  .props = animati
32010 6f 6e 2e 70 72 6f 70 73 3b 0a 0a 09 70 72 6f 70  on.props;...prop
32020 46 69 6c 74 65 72 28 20 70 72 6f 70 73 2c 20 61  Filter( props, a
32030 6e 69 6d 61 74 69 6f 6e 2e 6f 70 74 73 2e 73 70  nimation.opts.sp
32040 65 63 69 61 6c 45 61 73 69 6e 67 20 29 3b 0a 0a  ecialEasing );..
32050 09 66 6f 72 20 28 20 3b 20 69 6e 64 65 78 20 3c  .for ( ; index <
32060 20 6c 65 6e 67 74 68 3b 20 69 6e 64 65 78 2b 2b   length; index++
32070 20 29 20 7b 0a 09 09 72 65 73 75 6c 74 20 3d 20   ) {...result = 
32080 41 6e 69 6d 61 74 69 6f 6e 2e 70 72 65 66 69 6c  Animation.prefil
32090 74 65 72 73 5b 20 69 6e 64 65 78 20 5d 2e 63 61  ters[ index ].ca
320a0 6c 6c 28 20 61 6e 69 6d 61 74 69 6f 6e 2c 20 65  ll( animation, e
320b0 6c 65 6d 2c 20 70 72 6f 70 73 2c 20 61 6e 69 6d  lem, props, anim
320c0 61 74 69 6f 6e 2e 6f 70 74 73 20 29 3b 0a 09 09  ation.opts );...
320d0 69 66 20 28 20 72 65 73 75 6c 74 20 29 20 7b 0a  if ( result ) {.
320e0 09 09 09 69 66 20 28 20 69 73 46 75 6e 63 74 69  ...if ( isFuncti
320f0 6f 6e 28 20 72 65 73 75 6c 74 2e 73 74 6f 70 20  on( result.stop 
32100 29 20 29 20 7b 0a 09 09 09 09 6a 51 75 65 72 79  ) ) {.....jQuery
32110 2e 5f 71 75 65 75 65 48 6f 6f 6b 73 28 20 61 6e  ._queueHooks( an
32120 69 6d 61 74 69 6f 6e 2e 65 6c 65 6d 2c 20 61 6e  imation.elem, an
32130 69 6d 61 74 69 6f 6e 2e 6f 70 74 73 2e 71 75 65  imation.opts.que
32140 75 65 20 29 2e 73 74 6f 70 20 3d 0a 09 09 09 09  ue ).stop =.....
32150 09 72 65 73 75 6c 74 2e 73 74 6f 70 2e 62 69 6e  .result.stop.bin
32160 64 28 20 72 65 73 75 6c 74 20 29 3b 0a 09 09 09  d( result );....
32170 7d 0a 09 09 09 72 65 74 75 72 6e 20 72 65 73 75  }....return resu
32180 6c 74 3b 0a 09 09 7d 0a 09 7d 0a 0a 09 6a 51 75  lt;...}..}...jQu
32190 65 72 79 2e 6d 61 70 28 20 70 72 6f 70 73 2c 20  ery.map( props, 
321a0 63 72 65 61 74 65 54 77 65 65 6e 2c 20 61 6e 69  createTween, ani
321b0 6d 61 74 69 6f 6e 20 29 3b 0a 0a 09 69 66 20 28  mation );...if (
321c0 20 69 73 46 75 6e 63 74 69 6f 6e 28 20 61 6e 69   isFunction( ani
321d0 6d 61 74 69 6f 6e 2e 6f 70 74 73 2e 73 74 61 72  mation.opts.star
321e0 74 20 29 20 29 20 7b 0a 09 09 61 6e 69 6d 61 74  t ) ) {...animat
321f0 69 6f 6e 2e 6f 70 74 73 2e 73 74 61 72 74 2e 63  ion.opts.start.c
32200 61 6c 6c 28 20 65 6c 65 6d 2c 20 61 6e 69 6d 61  all( elem, anima
32210 74 69 6f 6e 20 29 3b 0a 09 7d 0a 0a 09 2f 2f 20  tion );..}...// 
32220 41 74 74 61 63 68 20 63 61 6c 6c 62 61 63 6b 73  Attach callbacks
32230 20 66 72 6f 6d 20 6f 70 74 69 6f 6e 73 0a 09 61   from options..a
32240 6e 69 6d 61 74 69 6f 6e 0a 09 09 2e 70 72 6f 67  nimation....prog
32250 72 65 73 73 28 20 61 6e 69 6d 61 74 69 6f 6e 2e  ress( animation.
32260 6f 70 74 73 2e 70 72 6f 67 72 65 73 73 20 29 0a  opts.progress ).
32270 09 09 2e 64 6f 6e 65 28 20 61 6e 69 6d 61 74 69  ...done( animati
32280 6f 6e 2e 6f 70 74 73 2e 64 6f 6e 65 2c 20 61 6e  on.opts.done, an
32290 69 6d 61 74 69 6f 6e 2e 6f 70 74 73 2e 63 6f 6d  imation.opts.com
322a0 70 6c 65 74 65 20 29 0a 09 09 2e 66 61 69 6c 28  plete )....fail(
322b0 20 61 6e 69 6d 61 74 69 6f 6e 2e 6f 70 74 73 2e   animation.opts.
322c0 66 61 69 6c 20 29 0a 09 09 2e 61 6c 77 61 79 73  fail )....always
322d0 28 20 61 6e 69 6d 61 74 69 6f 6e 2e 6f 70 74 73  ( animation.opts
322e0 2e 61 6c 77 61 79 73 20 29 3b 0a 0a 09 6a 51 75  .always );...jQu
322f0 65 72 79 2e 66 78 2e 74 69 6d 65 72 28 0a 09 09  ery.fx.timer(...
32300 6a 51 75 65 72 79 2e 65 78 74 65 6e 64 28 20 74  jQuery.extend( t
32310 69 63 6b 2c 20 7b 0a 09 09 09 65 6c 65 6d 3a 20  ick, {....elem: 
32320 65 6c 65 6d 2c 0a 09 09 09 61 6e 69 6d 3a 20 61  elem,....anim: a
32330 6e 69 6d 61 74 69 6f 6e 2c 0a 09 09 09 71 75 65  nimation,....que
32340 75 65 3a 20 61 6e 69 6d 61 74 69 6f 6e 2e 6f 70  ue: animation.op
32350 74 73 2e 71 75 65 75 65 0a 09 09 7d 20 29 0a 09  ts.queue...} )..
32360 29 3b 0a 0a 09 72 65 74 75 72 6e 20 61 6e 69 6d  );...return anim
32370 61 74 69 6f 6e 3b 0a 7d 0a 0a 6a 51 75 65 72 79  ation;.}..jQuery
32380 2e 41 6e 69 6d 61 74 69 6f 6e 20 3d 20 6a 51 75  .Animation = jQu
32390 65 72 79 2e 65 78 74 65 6e 64 28 20 41 6e 69 6d  ery.extend( Anim
323a0 61 74 69 6f 6e 2c 20 7b 0a 0a 09 74 77 65 65 6e  ation, {...tween
323b0 65 72 73 3a 20 7b 0a 09 09 22 2a 22 3a 20 5b 20  ers: {..."*": [ 
323c0 66 75 6e 63 74 69 6f 6e 28 20 70 72 6f 70 2c 20  function( prop, 
323d0 76 61 6c 75 65 20 29 20 7b 0a 09 09 09 76 61 72  value ) {....var
323e0 20 74 77 65 65 6e 20 3d 20 74 68 69 73 2e 63 72   tween = this.cr
323f0 65 61 74 65 54 77 65 65 6e 28 20 70 72 6f 70 2c  eateTween( prop,
32400 20 76 61 6c 75 65 20 29 3b 0a 09 09 09 61 64 6a   value );....adj
32410 75 73 74 43 53 53 28 20 74 77 65 65 6e 2e 65 6c  ustCSS( tween.el
32420 65 6d 2c 20 70 72 6f 70 2c 20 72 63 73 73 4e 75  em, prop, rcssNu
32430 6d 2e 65 78 65 63 28 20 76 61 6c 75 65 20 29 2c  m.exec( value ),
32440 20 74 77 65 65 6e 20 29 3b 0a 09 09 09 72 65 74   tween );....ret
32450 75 72 6e 20 74 77 65 65 6e 3b 0a 09 09 7d 20 5d  urn tween;...} ]
32460 0a 09 7d 2c 0a 0a 09 74 77 65 65 6e 65 72 3a 20  ..},...tweener: 
32470 66 75 6e 63 74 69 6f 6e 28 20 70 72 6f 70 73 2c  function( props,
32480 20 63 61 6c 6c 62 61 63 6b 20 29 20 7b 0a 09 09   callback ) {...
32490 69 66 20 28 20 69 73 46 75 6e 63 74 69 6f 6e 28  if ( isFunction(
324a0 20 70 72 6f 70 73 20 29 20 29 20 7b 0a 09 09 09   props ) ) {....
324b0 63 61 6c 6c 62 61 63 6b 20 3d 20 70 72 6f 70 73  callback = props
324c0 3b 0a 09 09 09 70 72 6f 70 73 20 3d 20 5b 20 22  ;....props = [ "
324d0 2a 22 20 5d 3b 0a 09 09 7d 20 65 6c 73 65 20 7b  *" ];...} else {
324e0 0a 09 09 09 70 72 6f 70 73 20 3d 20 70 72 6f 70  ....props = prop
324f0 73 2e 6d 61 74 63 68 28 20 72 6e 6f 74 68 74 6d  s.match( rnothtm
32500 6c 77 68 69 74 65 20 29 3b 0a 09 09 7d 0a 0a 09  lwhite );...}...
32510 09 76 61 72 20 70 72 6f 70 2c 0a 09 09 09 69 6e  .var prop,....in
32520 64 65 78 20 3d 20 30 2c 0a 09 09 09 6c 65 6e 67  dex = 0,....leng
32530 74 68 20 3d 20 70 72 6f 70 73 2e 6c 65 6e 67 74  th = props.lengt
32540 68 3b 0a 0a 09 09 66 6f 72 20 28 20 3b 20 69 6e  h;....for ( ; in
32550 64 65 78 20 3c 20 6c 65 6e 67 74 68 3b 20 69 6e  dex < length; in
32560 64 65 78 2b 2b 20 29 20 7b 0a 09 09 09 70 72 6f  dex++ ) {....pro
32570 70 20 3d 20 70 72 6f 70 73 5b 20 69 6e 64 65 78  p = props[ index
32580 20 5d 3b 0a 09 09 09 41 6e 69 6d 61 74 69 6f 6e   ];....Animation
32590 2e 74 77 65 65 6e 65 72 73 5b 20 70 72 6f 70 20  .tweeners[ prop 
325a0 5d 20 3d 20 41 6e 69 6d 61 74 69 6f 6e 2e 74 77  ] = Animation.tw
325b0 65 65 6e 65 72 73 5b 20 70 72 6f 70 20 5d 20 7c  eeners[ prop ] |
325c0 7c 20 5b 5d 3b 0a 09 09 09 41 6e 69 6d 61 74 69  | [];....Animati
325d0 6f 6e 2e 74 77 65 65 6e 65 72 73 5b 20 70 72 6f  on.tweeners[ pro
325e0 70 20 5d 2e 75 6e 73 68 69 66 74 28 20 63 61 6c  p ].unshift( cal
325f0 6c 62 61 63 6b 20 29 3b 0a 09 09 7d 0a 09 7d 2c  lback );...}..},
32600 0a 0a 09 70 72 65 66 69 6c 74 65 72 73 3a 20 5b  ...prefilters: [
32610 20 64 65 66 61 75 6c 74 50 72 65 66 69 6c 74 65   defaultPrefilte
32620 72 20 5d 2c 0a 0a 09 70 72 65 66 69 6c 74 65 72  r ],...prefilter
32630 3a 20 66 75 6e 63 74 69 6f 6e 28 20 63 61 6c 6c  : function( call
32640 62 61 63 6b 2c 20 70 72 65 70 65 6e 64 20 29 20  back, prepend ) 
32650 7b 0a 09 09 69 66 20 28 20 70 72 65 70 65 6e 64  {...if ( prepend
32660 20 29 20 7b 0a 09 09 09 41 6e 69 6d 61 74 69 6f   ) {....Animatio
32670 6e 2e 70 72 65 66 69 6c 74 65 72 73 2e 75 6e 73  n.prefilters.uns
32680 68 69 66 74 28 20 63 61 6c 6c 62 61 63 6b 20 29  hift( callback )
32690 3b 0a 09 09 7d 20 65 6c 73 65 20 7b 0a 09 09 09  ;...} else {....
326a0 41 6e 69 6d 61 74 69 6f 6e 2e 70 72 65 66 69 6c  Animation.prefil
326b0 74 65 72 73 2e 70 75 73 68 28 20 63 61 6c 6c 62  ters.push( callb
326c0 61 63 6b 20 29 3b 0a 09 09 7d 0a 09 7d 0a 7d 20  ack );...}..}.} 
326d0 29 3b 0a 0a 6a 51 75 65 72 79 2e 73 70 65 65 64  );..jQuery.speed
326e0 20 3d 20 66 75 6e 63 74 69 6f 6e 28 20 73 70 65   = function( spe
326f0 65 64 2c 20 65 61 73 69 6e 67 2c 20 66 6e 20 29  ed, easing, fn )
32700 20 7b 0a 09 76 61 72 20 6f 70 74 20 3d 20 73 70   {..var opt = sp
32710 65 65 64 20 26 26 20 74 79 70 65 6f 66 20 73 70  eed && typeof sp
32720 65 65 64 20 3d 3d 3d 20 22 6f 62 6a 65 63 74 22  eed === "object"
32730 20 3f 20 6a 51 75 65 72 79 2e 65 78 74 65 6e 64   ? jQuery.extend
32740 28 20 7b 7d 2c 20 73 70 65 65 64 20 29 20 3a 20  ( {}, speed ) : 
32750 7b 0a 09 09 63 6f 6d 70 6c 65 74 65 3a 20 66 6e  {...complete: fn
32760 20 7c 7c 20 21 66 6e 20 26 26 20 65 61 73 69 6e   || !fn && easin
32770 67 20 7c 7c 0a 09 09 09 69 73 46 75 6e 63 74 69  g ||....isFuncti
32780 6f 6e 28 20 73 70 65 65 64 20 29 20 26 26 20 73  on( speed ) && s
32790 70 65 65 64 2c 0a 09 09 64 75 72 61 74 69 6f 6e  peed,...duration
327a0 3a 20 73 70 65 65 64 2c 0a 09 09 65 61 73 69 6e  : speed,...easin
327b0 67 3a 20 66 6e 20 26 26 20 65 61 73 69 6e 67 20  g: fn && easing 
327c0 7c 7c 20 65 61 73 69 6e 67 20 26 26 20 21 69 73  || easing && !is
327d0 46 75 6e 63 74 69 6f 6e 28 20 65 61 73 69 6e 67  Function( easing
327e0 20 29 20 26 26 20 65 61 73 69 6e 67 0a 09 7d 3b   ) && easing..};
327f0 0a 0a 09 2f 2f 20 47 6f 20 74 6f 20 74 68 65 20  ...// Go to the 
32800 65 6e 64 20 73 74 61 74 65 20 69 66 20 66 78 20  end state if fx 
32810 61 72 65 20 6f 66 66 0a 09 69 66 20 28 20 6a 51  are off..if ( jQ
32820 75 65 72 79 2e 66 78 2e 6f 66 66 20 29 20 7b 0a  uery.fx.off ) {.
32830 09 09 6f 70 74 2e 64 75 72 61 74 69 6f 6e 20 3d  ..opt.duration =
32840 20 30 3b 0a 0a 09 7d 20 65 6c 73 65 20 7b 0a 09   0;...} else {..
32850 09 69 66 20 28 20 74 79 70 65 6f 66 20 6f 70 74  .if ( typeof opt
32860 2e 64 75 72 61 74 69 6f 6e 20 21 3d 3d 20 22 6e  .duration !== "n
32870 75 6d 62 65 72 22 20 29 20 7b 0a 09 09 09 69 66  umber" ) {....if
32880 20 28 20 6f 70 74 2e 64 75 72 61 74 69 6f 6e 20   ( opt.duration 
32890 69 6e 20 6a 51 75 65 72 79 2e 66 78 2e 73 70 65  in jQuery.fx.spe
328a0 65 64 73 20 29 20 7b 0a 09 09 09 09 6f 70 74 2e  eds ) {.....opt.
328b0 64 75 72 61 74 69 6f 6e 20 3d 20 6a 51 75 65 72  duration = jQuer
328c0 79 2e 66 78 2e 73 70 65 65 64 73 5b 20 6f 70 74  y.fx.speeds[ opt
328d0 2e 64 75 72 61 74 69 6f 6e 20 5d 3b 0a 0a 09 09  .duration ];....
328e0 09 7d 20 65 6c 73 65 20 7b 0a 09 09 09 09 6f 70  .} else {.....op
328f0 74 2e 64 75 72 61 74 69 6f 6e 20 3d 20 6a 51 75  t.duration = jQu
32900 65 72 79 2e 66 78 2e 73 70 65 65 64 73 2e 5f 64  ery.fx.speeds._d
32910 65 66 61 75 6c 74 3b 0a 09 09 09 7d 0a 09 09 7d  efault;....}...}
32920 0a 09 7d 0a 0a 09 2f 2f 20 4e 6f 72 6d 61 6c 69  ..}...// Normali
32930 7a 65 20 6f 70 74 2e 71 75 65 75 65 20 2d 20 74  ze opt.queue - t
32940 72 75 65 2f 75 6e 64 65 66 69 6e 65 64 2f 6e 75  rue/undefined/nu
32950 6c 6c 20 2d 3e 20 22 66 78 22 0a 09 69 66 20 28  ll -> "fx"..if (
32960 20 6f 70 74 2e 71 75 65 75 65 20 3d 3d 20 6e 75   opt.queue == nu
32970 6c 6c 20 7c 7c 20 6f 70 74 2e 71 75 65 75 65 20  ll || opt.queue 
32980 3d 3d 3d 20 74 72 75 65 20 29 20 7b 0a 09 09 6f  === true ) {...o
32990 70 74 2e 71 75 65 75 65 20 3d 20 22 66 78 22 3b  pt.queue = "fx";
329a0 0a 09 7d 0a 0a 09 2f 2f 20 51 75 65 75 65 69 6e  ..}...// Queuein
329b0 67 0a 09 6f 70 74 2e 6f 6c 64 20 3d 20 6f 70 74  g..opt.old = opt
329c0 2e 63 6f 6d 70 6c 65 74 65 3b 0a 0a 09 6f 70 74  .complete;...opt
329d0 2e 63 6f 6d 70 6c 65 74 65 20 3d 20 66 75 6e 63  .complete = func
329e0 74 69 6f 6e 28 29 20 7b 0a 09 09 69 66 20 28 20  tion() {...if ( 
329f0 69 73 46 75 6e 63 74 69 6f 6e 28 20 6f 70 74 2e  isFunction( opt.
32a00 6f 6c 64 20 29 20 29 20 7b 0a 09 09 09 6f 70 74  old ) ) {....opt
32a10 2e 6f 6c 64 2e 63 61 6c 6c 28 20 74 68 69 73 20  .old.call( this 
32a20 29 3b 0a 09 09 7d 0a 0a 09 09 69 66 20 28 20 6f  );...}....if ( o
32a30 70 74 2e 71 75 65 75 65 20 29 20 7b 0a 09 09 09  pt.queue ) {....
32a40 6a 51 75 65 72 79 2e 64 65 71 75 65 75 65 28 20  jQuery.dequeue( 
32a50 74 68 69 73 2c 20 6f 70 74 2e 71 75 65 75 65 20  this, opt.queue 
32a60 29 3b 0a 09 09 7d 0a 09 7d 3b 0a 0a 09 72 65 74  );...}..};...ret
32a70 75 72 6e 20 6f 70 74 3b 0a 7d 3b 0a 0a 6a 51 75  urn opt;.};..jQu
32a80 65 72 79 2e 66 6e 2e 65 78 74 65 6e 64 28 20 7b  ery.fn.extend( {
32a90 0a 09 66 61 64 65 54 6f 3a 20 66 75 6e 63 74 69  ..fadeTo: functi
32aa0 6f 6e 28 20 73 70 65 65 64 2c 20 74 6f 2c 20 65  on( speed, to, e
32ab0 61 73 69 6e 67 2c 20 63 61 6c 6c 62 61 63 6b 20  asing, callback 
32ac0 29 20 7b 0a 0a 09 09 2f 2f 20 53 68 6f 77 20 61  ) {....// Show a
32ad0 6e 79 20 68 69 64 64 65 6e 20 65 6c 65 6d 65 6e  ny hidden elemen
32ae0 74 73 20 61 66 74 65 72 20 73 65 74 74 69 6e 67  ts after setting
32af0 20 6f 70 61 63 69 74 79 20 74 6f 20 30 0a 09 09   opacity to 0...
32b00 72 65 74 75 72 6e 20 74 68 69 73 2e 66 69 6c 74  return this.filt
32b10 65 72 28 20 69 73 48 69 64 64 65 6e 57 69 74 68  er( isHiddenWith
32b20 69 6e 54 72 65 65 20 29 2e 63 73 73 28 20 22 6f  inTree ).css( "o
32b30 70 61 63 69 74 79 22 2c 20 30 20 29 2e 73 68 6f  pacity", 0 ).sho
32b40 77 28 29 0a 0a 09 09 09 2f 2f 20 41 6e 69 6d 61  w().....// Anima
32b50 74 65 20 74 6f 20 74 68 65 20 76 61 6c 75 65 20  te to the value 
32b60 73 70 65 63 69 66 69 65 64 0a 09 09 09 2e 65 6e  specified.....en
32b70 64 28 29 2e 61 6e 69 6d 61 74 65 28 20 7b 20 6f  d().animate( { o
32b80 70 61 63 69 74 79 3a 20 74 6f 20 7d 2c 20 73 70  pacity: to }, sp
32b90 65 65 64 2c 20 65 61 73 69 6e 67 2c 20 63 61 6c  eed, easing, cal
32ba0 6c 62 61 63 6b 20 29 3b 0a 09 7d 2c 0a 09 61 6e  lback );..},..an
32bb0 69 6d 61 74 65 3a 20 66 75 6e 63 74 69 6f 6e 28  imate: function(
32bc0 20 70 72 6f 70 2c 20 73 70 65 65 64 2c 20 65 61   prop, speed, ea
32bd0 73 69 6e 67 2c 20 63 61 6c 6c 62 61 63 6b 20 29  sing, callback )
32be0 20 7b 0a 09 09 76 61 72 20 65 6d 70 74 79 20 3d   {...var empty =
32bf0 20 6a 51 75 65 72 79 2e 69 73 45 6d 70 74 79 4f   jQuery.isEmptyO
32c00 62 6a 65 63 74 28 20 70 72 6f 70 20 29 2c 0a 09  bject( prop ),..
32c10 09 09 6f 70 74 61 6c 6c 20 3d 20 6a 51 75 65 72  ..optall = jQuer
32c20 79 2e 73 70 65 65 64 28 20 73 70 65 65 64 2c 20  y.speed( speed, 
32c30 65 61 73 69 6e 67 2c 20 63 61 6c 6c 62 61 63 6b  easing, callback
32c40 20 29 2c 0a 09 09 09 64 6f 41 6e 69 6d 61 74 69   ),....doAnimati
32c50 6f 6e 20 3d 20 66 75 6e 63 74 69 6f 6e 28 29 20  on = function() 
32c60 7b 0a 0a 09 09 09 09 2f 2f 20 4f 70 65 72 61 74  {......// Operat
32c70 65 20 6f 6e 20 61 20 63 6f 70 79 20 6f 66 20 70  e on a copy of p
32c80 72 6f 70 20 73 6f 20 70 65 72 2d 70 72 6f 70 65  rop so per-prope
32c90 72 74 79 20 65 61 73 69 6e 67 20 77 6f 6e 27 74  rty easing won't
32ca0 20 62 65 20 6c 6f 73 74 0a 09 09 09 09 76 61 72   be lost.....var
32cb0 20 61 6e 69 6d 20 3d 20 41 6e 69 6d 61 74 69 6f   anim = Animatio
32cc0 6e 28 20 74 68 69 73 2c 20 6a 51 75 65 72 79 2e  n( this, jQuery.
32cd0 65 78 74 65 6e 64 28 20 7b 7d 2c 20 70 72 6f 70  extend( {}, prop
32ce0 20 29 2c 20 6f 70 74 61 6c 6c 20 29 3b 0a 0a 09   ), optall );...
32cf0 09 09 09 2f 2f 20 45 6d 70 74 79 20 61 6e 69 6d  ...// Empty anim
32d00 61 74 69 6f 6e 73 2c 20 6f 72 20 66 69 6e 69 73  ations, or finis
32d10 68 69 6e 67 20 72 65 73 6f 6c 76 65 73 20 69 6d  hing resolves im
32d20 6d 65 64 69 61 74 65 6c 79 0a 09 09 09 09 69 66  mediately.....if
32d30 20 28 20 65 6d 70 74 79 20 7c 7c 20 64 61 74 61   ( empty || data
32d40 50 72 69 76 2e 67 65 74 28 20 74 68 69 73 2c 20  Priv.get( this, 
32d50 22 66 69 6e 69 73 68 22 20 29 20 29 20 7b 0a 09  "finish" ) ) {..
32d60 09 09 09 09 61 6e 69 6d 2e 73 74 6f 70 28 20 74  ....anim.stop( t
32d70 72 75 65 20 29 3b 0a 09 09 09 09 7d 0a 09 09 09  rue );.....}....
32d80 7d 3b 0a 09 09 09 64 6f 41 6e 69 6d 61 74 69 6f  };....doAnimatio
32d90 6e 2e 66 69 6e 69 73 68 20 3d 20 64 6f 41 6e 69  n.finish = doAni
32da0 6d 61 74 69 6f 6e 3b 0a 0a 09 09 72 65 74 75 72  mation;....retur
32db0 6e 20 65 6d 70 74 79 20 7c 7c 20 6f 70 74 61 6c  n empty || optal
32dc0 6c 2e 71 75 65 75 65 20 3d 3d 3d 20 66 61 6c 73  l.queue === fals
32dd0 65 20 3f 0a 09 09 09 74 68 69 73 2e 65 61 63 68  e ?....this.each
32de0 28 20 64 6f 41 6e 69 6d 61 74 69 6f 6e 20 29 20  ( doAnimation ) 
32df0 3a 0a 09 09 09 74 68 69 73 2e 71 75 65 75 65 28  :....this.queue(
32e00 20 6f 70 74 61 6c 6c 2e 71 75 65 75 65 2c 20 64   optall.queue, d
32e10 6f 41 6e 69 6d 61 74 69 6f 6e 20 29 3b 0a 09 7d  oAnimation );..}
32e20 2c 0a 09 73 74 6f 70 3a 20 66 75 6e 63 74 69 6f  ,..stop: functio
32e30 6e 28 20 74 79 70 65 2c 20 63 6c 65 61 72 51 75  n( type, clearQu
32e40 65 75 65 2c 20 67 6f 74 6f 45 6e 64 20 29 20 7b  eue, gotoEnd ) {
32e50 0a 09 09 76 61 72 20 73 74 6f 70 51 75 65 75 65  ...var stopQueue
32e60 20 3d 20 66 75 6e 63 74 69 6f 6e 28 20 68 6f 6f   = function( hoo
32e70 6b 73 20 29 20 7b 0a 09 09 09 76 61 72 20 73 74  ks ) {....var st
32e80 6f 70 20 3d 20 68 6f 6f 6b 73 2e 73 74 6f 70 3b  op = hooks.stop;
32e90 0a 09 09 09 64 65 6c 65 74 65 20 68 6f 6f 6b 73  ....delete hooks
32ea0 2e 73 74 6f 70 3b 0a 09 09 09 73 74 6f 70 28 20  .stop;....stop( 
32eb0 67 6f 74 6f 45 6e 64 20 29 3b 0a 09 09 7d 3b 0a  gotoEnd );...};.
32ec0 0a 09 09 69 66 20 28 20 74 79 70 65 6f 66 20 74  ...if ( typeof t
32ed0 79 70 65 20 21 3d 3d 20 22 73 74 72 69 6e 67 22  ype !== "string"
32ee0 20 29 20 7b 0a 09 09 09 67 6f 74 6f 45 6e 64 20   ) {....gotoEnd 
32ef0 3d 20 63 6c 65 61 72 51 75 65 75 65 3b 0a 09 09  = clearQueue;...
32f00 09 63 6c 65 61 72 51 75 65 75 65 20 3d 20 74 79  .clearQueue = ty
32f10 70 65 3b 0a 09 09 09 74 79 70 65 20 3d 20 75 6e  pe;....type = un
32f20 64 65 66 69 6e 65 64 3b 0a 09 09 7d 0a 09 09 69  defined;...}...i
32f30 66 20 28 20 63 6c 65 61 72 51 75 65 75 65 20 29  f ( clearQueue )
32f40 20 7b 0a 09 09 09 74 68 69 73 2e 71 75 65 75 65   {....this.queue
32f50 28 20 74 79 70 65 20 7c 7c 20 22 66 78 22 2c 20  ( type || "fx", 
32f60 5b 5d 20 29 3b 0a 09 09 7d 0a 0a 09 09 72 65 74  [] );...}....ret
32f70 75 72 6e 20 74 68 69 73 2e 65 61 63 68 28 20 66  urn this.each( f
32f80 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09 09 09 76  unction() {....v
32f90 61 72 20 64 65 71 75 65 75 65 20 3d 20 74 72 75  ar dequeue = tru
32fa0 65 2c 0a 09 09 09 09 69 6e 64 65 78 20 3d 20 74  e,.....index = t
32fb0 79 70 65 20 21 3d 20 6e 75 6c 6c 20 26 26 20 74  ype != null && t
32fc0 79 70 65 20 2b 20 22 71 75 65 75 65 48 6f 6f 6b  ype + "queueHook
32fd0 73 22 2c 0a 09 09 09 09 74 69 6d 65 72 73 20 3d  s",.....timers =
32fe0 20 6a 51 75 65 72 79 2e 74 69 6d 65 72 73 2c 0a   jQuery.timers,.
32ff0 09 09 09 09 64 61 74 61 20 3d 20 64 61 74 61 50  ....data = dataP
33000 72 69 76 2e 67 65 74 28 20 74 68 69 73 20 29 3b  riv.get( this );
33010 0a 0a 09 09 09 69 66 20 28 20 69 6e 64 65 78 20  .....if ( index 
33020 29 20 7b 0a 09 09 09 09 69 66 20 28 20 64 61 74  ) {.....if ( dat
33030 61 5b 20 69 6e 64 65 78 20 5d 20 26 26 20 64 61  a[ index ] && da
33040 74 61 5b 20 69 6e 64 65 78 20 5d 2e 73 74 6f 70  ta[ index ].stop
33050 20 29 20 7b 0a 09 09 09 09 09 73 74 6f 70 51 75   ) {......stopQu
33060 65 75 65 28 20 64 61 74 61 5b 20 69 6e 64 65 78  eue( data[ index
33070 20 5d 20 29 3b 0a 09 09 09 09 7d 0a 09 09 09 7d   ] );.....}....}
33080 20 65 6c 73 65 20 7b 0a 09 09 09 09 66 6f 72 20   else {.....for 
33090 28 20 69 6e 64 65 78 20 69 6e 20 64 61 74 61 20  ( index in data 
330a0 29 20 7b 0a 09 09 09 09 09 69 66 20 28 20 64 61  ) {......if ( da
330b0 74 61 5b 20 69 6e 64 65 78 20 5d 20 26 26 20 64  ta[ index ] && d
330c0 61 74 61 5b 20 69 6e 64 65 78 20 5d 2e 73 74 6f  ata[ index ].sto
330d0 70 20 26 26 20 72 72 75 6e 2e 74 65 73 74 28 20  p && rrun.test( 
330e0 69 6e 64 65 78 20 29 20 29 20 7b 0a 09 09 09 09  index ) ) {.....
330f0 09 09 73 74 6f 70 51 75 65 75 65 28 20 64 61 74  ..stopQueue( dat
33100 61 5b 20 69 6e 64 65 78 20 5d 20 29 3b 0a 09 09  a[ index ] );...
33110 09 09 09 7d 0a 09 09 09 09 7d 0a 09 09 09 7d 0a  ...}.....}....}.
33120 0a 09 09 09 66 6f 72 20 28 20 69 6e 64 65 78 20  ....for ( index 
33130 3d 20 74 69 6d 65 72 73 2e 6c 65 6e 67 74 68 3b  = timers.length;
33140 20 69 6e 64 65 78 2d 2d 3b 20 29 20 7b 0a 09 09   index--; ) {...
33150 09 09 69 66 20 28 20 74 69 6d 65 72 73 5b 20 69  ..if ( timers[ i
33160 6e 64 65 78 20 5d 2e 65 6c 65 6d 20 3d 3d 3d 20  ndex ].elem === 
33170 74 68 69 73 20 26 26 0a 09 09 09 09 09 28 20 74  this &&......( t
33180 79 70 65 20 3d 3d 20 6e 75 6c 6c 20 7c 7c 20 74  ype == null || t
33190 69 6d 65 72 73 5b 20 69 6e 64 65 78 20 5d 2e 71  imers[ index ].q
331a0 75 65 75 65 20 3d 3d 3d 20 74 79 70 65 20 29 20  ueue === type ) 
331b0 29 20 7b 0a 0a 09 09 09 09 09 74 69 6d 65 72 73  ) {.......timers
331c0 5b 20 69 6e 64 65 78 20 5d 2e 61 6e 69 6d 2e 73  [ index ].anim.s
331d0 74 6f 70 28 20 67 6f 74 6f 45 6e 64 20 29 3b 0a  top( gotoEnd );.
331e0 09 09 09 09 09 64 65 71 75 65 75 65 20 3d 20 66  .....dequeue = f
331f0 61 6c 73 65 3b 0a 09 09 09 09 09 74 69 6d 65 72  alse;......timer
33200 73 2e 73 70 6c 69 63 65 28 20 69 6e 64 65 78 2c  s.splice( index,
33210 20 31 20 29 3b 0a 09 09 09 09 7d 0a 09 09 09 7d   1 );.....}....}
33220 0a 0a 09 09 09 2f 2f 20 53 74 61 72 74 20 74 68  .....// Start th
33230 65 20 6e 65 78 74 20 69 6e 20 74 68 65 20 71 75  e next in the qu
33240 65 75 65 20 69 66 20 74 68 65 20 6c 61 73 74 20  eue if the last 
33250 73 74 65 70 20 77 61 73 6e 27 74 20 66 6f 72 63  step wasn't forc
33260 65 64 2e 0a 09 09 09 2f 2f 20 54 69 6d 65 72 73  ed.....// Timers
33270 20 63 75 72 72 65 6e 74 6c 79 20 77 69 6c 6c 20   currently will 
33280 63 61 6c 6c 20 74 68 65 69 72 20 63 6f 6d 70 6c  call their compl
33290 65 74 65 20 63 61 6c 6c 62 61 63 6b 73 2c 20 77  ete callbacks, w
332a0 68 69 63 68 0a 09 09 09 2f 2f 20 77 69 6c 6c 20  hich....// will 
332b0 64 65 71 75 65 75 65 20 62 75 74 20 6f 6e 6c 79  dequeue but only
332c0 20 69 66 20 74 68 65 79 20 77 65 72 65 20 67 6f   if they were go
332d0 74 6f 45 6e 64 2e 0a 09 09 09 69 66 20 28 20 64  toEnd.....if ( d
332e0 65 71 75 65 75 65 20 7c 7c 20 21 67 6f 74 6f 45  equeue || !gotoE
332f0 6e 64 20 29 20 7b 0a 09 09 09 09 6a 51 75 65 72  nd ) {.....jQuer
33300 79 2e 64 65 71 75 65 75 65 28 20 74 68 69 73 2c  y.dequeue( this,
33310 20 74 79 70 65 20 29 3b 0a 09 09 09 7d 0a 09 09   type );....}...
33320 7d 20 29 3b 0a 09 7d 2c 0a 09 66 69 6e 69 73 68  } );..},..finish
33330 3a 20 66 75 6e 63 74 69 6f 6e 28 20 74 79 70 65  : function( type
33340 20 29 20 7b 0a 09 09 69 66 20 28 20 74 79 70 65   ) {...if ( type
33350 20 21 3d 3d 20 66 61 6c 73 65 20 29 20 7b 0a 09   !== false ) {..
33360 09 09 74 79 70 65 20 3d 20 74 79 70 65 20 7c 7c  ..type = type ||
33370 20 22 66 78 22 3b 0a 09 09 7d 0a 09 09 72 65 74   "fx";...}...ret
33380 75 72 6e 20 74 68 69 73 2e 65 61 63 68 28 20 66  urn this.each( f
33390 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09 09 09 76  unction() {....v
333a0 61 72 20 69 6e 64 65 78 2c 0a 09 09 09 09 64 61  ar index,.....da
333b0 74 61 20 3d 20 64 61 74 61 50 72 69 76 2e 67 65  ta = dataPriv.ge
333c0 74 28 20 74 68 69 73 20 29 2c 0a 09 09 09 09 71  t( this ),.....q
333d0 75 65 75 65 20 3d 20 64 61 74 61 5b 20 74 79 70  ueue = data[ typ
333e0 65 20 2b 20 22 71 75 65 75 65 22 20 5d 2c 0a 09  e + "queue" ],..
333f0 09 09 09 68 6f 6f 6b 73 20 3d 20 64 61 74 61 5b  ...hooks = data[
33400 20 74 79 70 65 20 2b 20 22 71 75 65 75 65 48 6f   type + "queueHo
33410 6f 6b 73 22 20 5d 2c 0a 09 09 09 09 74 69 6d 65  oks" ],.....time
33420 72 73 20 3d 20 6a 51 75 65 72 79 2e 74 69 6d 65  rs = jQuery.time
33430 72 73 2c 0a 09 09 09 09 6c 65 6e 67 74 68 20 3d  rs,.....length =
33440 20 71 75 65 75 65 20 3f 20 71 75 65 75 65 2e 6c   queue ? queue.l
33450 65 6e 67 74 68 20 3a 20 30 3b 0a 0a 09 09 09 2f  ength : 0;...../
33460 2f 20 45 6e 61 62 6c 65 20 66 69 6e 69 73 68 69  / Enable finishi
33470 6e 67 20 66 6c 61 67 20 6f 6e 20 70 72 69 76 61  ng flag on priva
33480 74 65 20 64 61 74 61 0a 09 09 09 64 61 74 61 2e  te data....data.
33490 66 69 6e 69 73 68 20 3d 20 74 72 75 65 3b 0a 0a  finish = true;..
334a0 09 09 09 2f 2f 20 45 6d 70 74 79 20 74 68 65 20  ...// Empty the 
334b0 71 75 65 75 65 20 66 69 72 73 74 0a 09 09 09 6a  queue first....j
334c0 51 75 65 72 79 2e 71 75 65 75 65 28 20 74 68 69  Query.queue( thi
334d0 73 2c 20 74 79 70 65 2c 20 5b 5d 20 29 3b 0a 0a  s, type, [] );..
334e0 09 09 09 69 66 20 28 20 68 6f 6f 6b 73 20 26 26  ...if ( hooks &&
334f0 20 68 6f 6f 6b 73 2e 73 74 6f 70 20 29 20 7b 0a   hooks.stop ) {.
33500 09 09 09 09 68 6f 6f 6b 73 2e 73 74 6f 70 2e 63  ....hooks.stop.c
33510 61 6c 6c 28 20 74 68 69 73 2c 20 74 72 75 65 20  all( this, true 
33520 29 3b 0a 09 09 09 7d 0a 0a 09 09 09 2f 2f 20 4c  );....}.....// L
33530 6f 6f 6b 20 66 6f 72 20 61 6e 79 20 61 63 74 69  ook for any acti
33540 76 65 20 61 6e 69 6d 61 74 69 6f 6e 73 2c 20 61  ve animations, a
33550 6e 64 20 66 69 6e 69 73 68 20 74 68 65 6d 0a 09  nd finish them..
33560 09 09 66 6f 72 20 28 20 69 6e 64 65 78 20 3d 20  ..for ( index = 
33570 74 69 6d 65 72 73 2e 6c 65 6e 67 74 68 3b 20 69  timers.length; i
33580 6e 64 65 78 2d 2d 3b 20 29 20 7b 0a 09 09 09 09  ndex--; ) {.....
33590 69 66 20 28 20 74 69 6d 65 72 73 5b 20 69 6e 64  if ( timers[ ind
335a0 65 78 20 5d 2e 65 6c 65 6d 20 3d 3d 3d 20 74 68  ex ].elem === th
335b0 69 73 20 26 26 20 74 69 6d 65 72 73 5b 20 69 6e  is && timers[ in
335c0 64 65 78 20 5d 2e 71 75 65 75 65 20 3d 3d 3d 20  dex ].queue === 
335d0 74 79 70 65 20 29 20 7b 0a 09 09 09 09 09 74 69  type ) {......ti
335e0 6d 65 72 73 5b 20 69 6e 64 65 78 20 5d 2e 61 6e  mers[ index ].an
335f0 69 6d 2e 73 74 6f 70 28 20 74 72 75 65 20 29 3b  im.stop( true );
33600 0a 09 09 09 09 09 74 69 6d 65 72 73 2e 73 70 6c  ......timers.spl
33610 69 63 65 28 20 69 6e 64 65 78 2c 20 31 20 29 3b  ice( index, 1 );
33620 0a 09 09 09 09 7d 0a 09 09 09 7d 0a 0a 09 09 09  .....}....}.....
33630 2f 2f 20 4c 6f 6f 6b 20 66 6f 72 20 61 6e 79 20  // Look for any 
33640 61 6e 69 6d 61 74 69 6f 6e 73 20 69 6e 20 74 68  animations in th
33650 65 20 6f 6c 64 20 71 75 65 75 65 20 61 6e 64 20  e old queue and 
33660 66 69 6e 69 73 68 20 74 68 65 6d 0a 09 09 09 66  finish them....f
33670 6f 72 20 28 20 69 6e 64 65 78 20 3d 20 30 3b 20  or ( index = 0; 
33680 69 6e 64 65 78 20 3c 20 6c 65 6e 67 74 68 3b 20  index < length; 
33690 69 6e 64 65 78 2b 2b 20 29 20 7b 0a 09 09 09 09  index++ ) {.....
336a0 69 66 20 28 20 71 75 65 75 65 5b 20 69 6e 64 65  if ( queue[ inde
336b0 78 20 5d 20 26 26 20 71 75 65 75 65 5b 20 69 6e  x ] && queue[ in
336c0 64 65 78 20 5d 2e 66 69 6e 69 73 68 20 29 20 7b  dex ].finish ) {
336d0 0a 09 09 09 09 09 71 75 65 75 65 5b 20 69 6e 64  ......queue[ ind
336e0 65 78 20 5d 2e 66 69 6e 69 73 68 2e 63 61 6c 6c  ex ].finish.call
336f0 28 20 74 68 69 73 20 29 3b 0a 09 09 09 09 7d 0a  ( this );.....}.
33700 09 09 09 7d 0a 0a 09 09 09 2f 2f 20 54 75 72 6e  ...}.....// Turn
33710 20 6f 66 66 20 66 69 6e 69 73 68 69 6e 67 20 66   off finishing f
33720 6c 61 67 0a 09 09 09 64 65 6c 65 74 65 20 64 61  lag....delete da
33730 74 61 2e 66 69 6e 69 73 68 3b 0a 09 09 7d 20 29  ta.finish;...} )
33740 3b 0a 09 7d 0a 7d 20 29 3b 0a 0a 6a 51 75 65 72  ;..}.} );..jQuer
33750 79 2e 65 61 63 68 28 20 5b 20 22 74 6f 67 67 6c  y.each( [ "toggl
33760 65 22 2c 20 22 73 68 6f 77 22 2c 20 22 68 69 64  e", "show", "hid
33770 65 22 20 5d 2c 20 66 75 6e 63 74 69 6f 6e 28 20  e" ], function( 
33780 5f 69 2c 20 6e 61 6d 65 20 29 20 7b 0a 09 76 61  _i, name ) {..va
33790 72 20 63 73 73 46 6e 20 3d 20 6a 51 75 65 72 79  r cssFn = jQuery
337a0 2e 66 6e 5b 20 6e 61 6d 65 20 5d 3b 0a 09 6a 51  .fn[ name ];..jQ
337b0 75 65 72 79 2e 66 6e 5b 20 6e 61 6d 65 20 5d 20  uery.fn[ name ] 
337c0 3d 20 66 75 6e 63 74 69 6f 6e 28 20 73 70 65 65  = function( spee
337d0 64 2c 20 65 61 73 69 6e 67 2c 20 63 61 6c 6c 62  d, easing, callb
337e0 61 63 6b 20 29 20 7b 0a 09 09 72 65 74 75 72 6e  ack ) {...return
337f0 20 73 70 65 65 64 20 3d 3d 20 6e 75 6c 6c 20 7c   speed == null |
33800 7c 20 74 79 70 65 6f 66 20 73 70 65 65 64 20 3d  | typeof speed =
33810 3d 3d 20 22 62 6f 6f 6c 65 61 6e 22 20 3f 0a 09  == "boolean" ?..
33820 09 09 63 73 73 46 6e 2e 61 70 70 6c 79 28 20 74  ..cssFn.apply( t
33830 68 69 73 2c 20 61 72 67 75 6d 65 6e 74 73 20 29  his, arguments )
33840 20 3a 0a 09 09 09 74 68 69 73 2e 61 6e 69 6d 61   :....this.anima
33850 74 65 28 20 67 65 6e 46 78 28 20 6e 61 6d 65 2c  te( genFx( name,
33860 20 74 72 75 65 20 29 2c 20 73 70 65 65 64 2c 20   true ), speed, 
33870 65 61 73 69 6e 67 2c 20 63 61 6c 6c 62 61 63 6b  easing, callback
33880 20 29 3b 0a 09 7d 3b 0a 7d 20 29 3b 0a 0a 2f 2f   );..};.} );..//
33890 20 47 65 6e 65 72 61 74 65 20 73 68 6f 72 74 63   Generate shortc
338a0 75 74 73 20 66 6f 72 20 63 75 73 74 6f 6d 20 61  uts for custom a
338b0 6e 69 6d 61 74 69 6f 6e 73 0a 6a 51 75 65 72 79  nimations.jQuery
338c0 2e 65 61 63 68 28 20 7b 0a 09 73 6c 69 64 65 44  .each( {..slideD
338d0 6f 77 6e 3a 20 67 65 6e 46 78 28 20 22 73 68 6f  own: genFx( "sho
338e0 77 22 20 29 2c 0a 09 73 6c 69 64 65 55 70 3a 20  w" ),..slideUp: 
338f0 67 65 6e 46 78 28 20 22 68 69 64 65 22 20 29 2c  genFx( "hide" ),
33900 0a 09 73 6c 69 64 65 54 6f 67 67 6c 65 3a 20 67  ..slideToggle: g
33910 65 6e 46 78 28 20 22 74 6f 67 67 6c 65 22 20 29  enFx( "toggle" )
33920 2c 0a 09 66 61 64 65 49 6e 3a 20 7b 20 6f 70 61  ,..fadeIn: { opa
33930 63 69 74 79 3a 20 22 73 68 6f 77 22 20 7d 2c 0a  city: "show" },.
33940 09 66 61 64 65 4f 75 74 3a 20 7b 20 6f 70 61 63  .fadeOut: { opac
33950 69 74 79 3a 20 22 68 69 64 65 22 20 7d 2c 0a 09  ity: "hide" },..
33960 66 61 64 65 54 6f 67 67 6c 65 3a 20 7b 20 6f 70  fadeToggle: { op
33970 61 63 69 74 79 3a 20 22 74 6f 67 67 6c 65 22 20  acity: "toggle" 
33980 7d 0a 7d 2c 20 66 75 6e 63 74 69 6f 6e 28 20 6e  }.}, function( n
33990 61 6d 65 2c 20 70 72 6f 70 73 20 29 20 7b 0a 09  ame, props ) {..
339a0 6a 51 75 65 72 79 2e 66 6e 5b 20 6e 61 6d 65 20  jQuery.fn[ name 
339b0 5d 20 3d 20 66 75 6e 63 74 69 6f 6e 28 20 73 70  ] = function( sp
339c0 65 65 64 2c 20 65 61 73 69 6e 67 2c 20 63 61 6c  eed, easing, cal
339d0 6c 62 61 63 6b 20 29 20 7b 0a 09 09 72 65 74 75  lback ) {...retu
339e0 72 6e 20 74 68 69 73 2e 61 6e 69 6d 61 74 65 28  rn this.animate(
339f0 20 70 72 6f 70 73 2c 20 73 70 65 65 64 2c 20 65   props, speed, e
33a00 61 73 69 6e 67 2c 20 63 61 6c 6c 62 61 63 6b 20  asing, callback 
33a10 29 3b 0a 09 7d 3b 0a 7d 20 29 3b 0a 0a 6a 51 75  );..};.} );..jQu
33a20 65 72 79 2e 74 69 6d 65 72 73 20 3d 20 5b 5d 3b  ery.timers = [];
33a30 0a 6a 51 75 65 72 79 2e 66 78 2e 74 69 63 6b 20  .jQuery.fx.tick 
33a40 3d 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09  = function() {..
33a50 76 61 72 20 74 69 6d 65 72 2c 0a 09 09 69 20 3d  var timer,...i =
33a60 20 30 2c 0a 09 09 74 69 6d 65 72 73 20 3d 20 6a   0,...timers = j
33a70 51 75 65 72 79 2e 74 69 6d 65 72 73 3b 0a 0a 09  Query.timers;...
33a80 66 78 4e 6f 77 20 3d 20 44 61 74 65 2e 6e 6f 77  fxNow = Date.now
33a90 28 29 3b 0a 0a 09 66 6f 72 20 28 20 3b 20 69 20  ();...for ( ; i 
33aa0 3c 20 74 69 6d 65 72 73 2e 6c 65 6e 67 74 68 3b  < timers.length;
33ab0 20 69 2b 2b 20 29 20 7b 0a 09 09 74 69 6d 65 72   i++ ) {...timer
33ac0 20 3d 20 74 69 6d 65 72 73 5b 20 69 20 5d 3b 0a   = timers[ i ];.
33ad0 0a 09 09 2f 2f 20 52 75 6e 20 74 68 65 20 74 69  ...// Run the ti
33ae0 6d 65 72 20 61 6e 64 20 73 61 66 65 6c 79 20 72  mer and safely r
33af0 65 6d 6f 76 65 20 69 74 20 77 68 65 6e 20 64 6f  emove it when do
33b00 6e 65 20 28 61 6c 6c 6f 77 69 6e 67 20 66 6f 72  ne (allowing for
33b10 20 65 78 74 65 72 6e 61 6c 20 72 65 6d 6f 76 61   external remova
33b20 6c 29 0a 09 09 69 66 20 28 20 21 74 69 6d 65 72  l)...if ( !timer
33b30 28 29 20 26 26 20 74 69 6d 65 72 73 5b 20 69 20  () && timers[ i 
33b40 5d 20 3d 3d 3d 20 74 69 6d 65 72 20 29 20 7b 0a  ] === timer ) {.
33b50 09 09 09 74 69 6d 65 72 73 2e 73 70 6c 69 63 65  ...timers.splice
33b60 28 20 69 2d 2d 2c 20 31 20 29 3b 0a 09 09 7d 0a  ( i--, 1 );...}.
33b70 09 7d 0a 0a 09 69 66 20 28 20 21 74 69 6d 65 72  .}...if ( !timer
33b80 73 2e 6c 65 6e 67 74 68 20 29 20 7b 0a 09 09 6a  s.length ) {...j
33b90 51 75 65 72 79 2e 66 78 2e 73 74 6f 70 28 29 3b  Query.fx.stop();
33ba0 0a 09 7d 0a 09 66 78 4e 6f 77 20 3d 20 75 6e 64  ..}..fxNow = und
33bb0 65 66 69 6e 65 64 3b 0a 7d 3b 0a 0a 6a 51 75 65  efined;.};..jQue
33bc0 72 79 2e 66 78 2e 74 69 6d 65 72 20 3d 20 66 75  ry.fx.timer = fu
33bd0 6e 63 74 69 6f 6e 28 20 74 69 6d 65 72 20 29 20  nction( timer ) 
33be0 7b 0a 09 6a 51 75 65 72 79 2e 74 69 6d 65 72 73  {..jQuery.timers
33bf0 2e 70 75 73 68 28 20 74 69 6d 65 72 20 29 3b 0a  .push( timer );.
33c00 09 6a 51 75 65 72 79 2e 66 78 2e 73 74 61 72 74  .jQuery.fx.start
33c10 28 29 3b 0a 7d 3b 0a 0a 6a 51 75 65 72 79 2e 66  ();.};..jQuery.f
33c20 78 2e 69 6e 74 65 72 76 61 6c 20 3d 20 31 33 3b  x.interval = 13;
33c30 0a 6a 51 75 65 72 79 2e 66 78 2e 73 74 61 72 74  .jQuery.fx.start
33c40 20 3d 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a   = function() {.
33c50 09 69 66 20 28 20 69 6e 50 72 6f 67 72 65 73 73  .if ( inProgress
33c60 20 29 20 7b 0a 09 09 72 65 74 75 72 6e 3b 0a 09   ) {...return;..
33c70 7d 0a 0a 09 69 6e 50 72 6f 67 72 65 73 73 20 3d  }...inProgress =
33c80 20 74 72 75 65 3b 0a 09 73 63 68 65 64 75 6c 65   true;..schedule
33c90 28 29 3b 0a 7d 3b 0a 0a 6a 51 75 65 72 79 2e 66  ();.};..jQuery.f
33ca0 78 2e 73 74 6f 70 20 3d 20 66 75 6e 63 74 69 6f  x.stop = functio
33cb0 6e 28 29 20 7b 0a 09 69 6e 50 72 6f 67 72 65 73  n() {..inProgres
33cc0 73 20 3d 20 6e 75 6c 6c 3b 0a 7d 3b 0a 0a 6a 51  s = null;.};..jQ
33cd0 75 65 72 79 2e 66 78 2e 73 70 65 65 64 73 20 3d  uery.fx.speeds =
33ce0 20 7b 0a 09 73 6c 6f 77 3a 20 36 30 30 2c 0a 09   {..slow: 600,..
33cf0 66 61 73 74 3a 20 32 30 30 2c 0a 0a 09 2f 2f 20  fast: 200,...// 
33d00 44 65 66 61 75 6c 74 20 73 70 65 65 64 0a 09 5f  Default speed.._
33d10 64 65 66 61 75 6c 74 3a 20 34 30 30 0a 7d 3b 0a  default: 400.};.
33d20 0a 0a 2f 2f 20 42 61 73 65 64 20 6f 66 66 20 6f  ..// Based off o
33d30 66 20 74 68 65 20 70 6c 75 67 69 6e 20 62 79 20  f the plugin by 
33d40 43 6c 69 6e 74 20 48 65 6c 66 65 72 73 2c 20 77  Clint Helfers, w
33d50 69 74 68 20 70 65 72 6d 69 73 73 69 6f 6e 2e 0a  ith permission..
33d60 2f 2f 20 68 74 74 70 73 3a 2f 2f 77 65 62 2e 61  // https://web.a
33d70 72 63 68 69 76 65 2e 6f 72 67 2f 77 65 62 2f 32  rchive.org/web/2
33d80 30 31 30 30 33 32 34 30 31 34 37 34 37 2f 68 74  0100324014747/ht
33d90 74 70 3a 2f 2f 62 6c 69 6e 64 73 69 67 6e 61 6c  tp://blindsignal
33da0 73 2e 63 6f 6d 2f 69 6e 64 65 78 2e 70 68 70 2f  s.com/index.php/
33db0 32 30 30 39 2f 30 37 2f 6a 71 75 65 72 79 2d 64  2009/07/jquery-d
33dc0 65 6c 61 79 2f 0a 6a 51 75 65 72 79 2e 66 6e 2e  elay/.jQuery.fn.
33dd0 64 65 6c 61 79 20 3d 20 66 75 6e 63 74 69 6f 6e  delay = function
33de0 28 20 74 69 6d 65 2c 20 74 79 70 65 20 29 20 7b  ( time, type ) {
33df0 0a 09 74 69 6d 65 20 3d 20 6a 51 75 65 72 79 2e  ..time = jQuery.
33e00 66 78 20 3f 20 6a 51 75 65 72 79 2e 66 78 2e 73  fx ? jQuery.fx.s
33e10 70 65 65 64 73 5b 20 74 69 6d 65 20 5d 20 7c 7c  peeds[ time ] ||
33e20 20 74 69 6d 65 20 3a 20 74 69 6d 65 3b 0a 09 74   time : time;..t
33e30 79 70 65 20 3d 20 74 79 70 65 20 7c 7c 20 22 66  ype = type || "f
33e40 78 22 3b 0a 0a 09 72 65 74 75 72 6e 20 74 68 69  x";...return thi
33e50 73 2e 71 75 65 75 65 28 20 74 79 70 65 2c 20 66  s.queue( type, f
33e60 75 6e 63 74 69 6f 6e 28 20 6e 65 78 74 2c 20 68  unction( next, h
33e70 6f 6f 6b 73 20 29 20 7b 0a 09 09 76 61 72 20 74  ooks ) {...var t
33e80 69 6d 65 6f 75 74 20 3d 20 77 69 6e 64 6f 77 2e  imeout = window.
33e90 73 65 74 54 69 6d 65 6f 75 74 28 20 6e 65 78 74  setTimeout( next
33ea0 2c 20 74 69 6d 65 20 29 3b 0a 09 09 68 6f 6f 6b  , time );...hook
33eb0 73 2e 73 74 6f 70 20 3d 20 66 75 6e 63 74 69 6f  s.stop = functio
33ec0 6e 28 29 20 7b 0a 09 09 09 77 69 6e 64 6f 77 2e  n() {....window.
33ed0 63 6c 65 61 72 54 69 6d 65 6f 75 74 28 20 74 69  clearTimeout( ti
33ee0 6d 65 6f 75 74 20 29 3b 0a 09 09 7d 3b 0a 09 7d  meout );...};..}
33ef0 20 29 3b 0a 7d 3b 0a 0a 0a 28 20 66 75 6e 63 74   );.};...( funct
33f00 69 6f 6e 28 29 20 7b 0a 09 76 61 72 20 69 6e 70  ion() {..var inp
33f10 75 74 20 3d 20 64 6f 63 75 6d 65 6e 74 2e 63 72  ut = document.cr
33f20 65 61 74 65 45 6c 65 6d 65 6e 74 28 20 22 69 6e  eateElement( "in
33f30 70 75 74 22 20 29 2c 0a 09 09 73 65 6c 65 63 74  put" ),...select
33f40 20 3d 20 64 6f 63 75 6d 65 6e 74 2e 63 72 65 61   = document.crea
33f50 74 65 45 6c 65 6d 65 6e 74 28 20 22 73 65 6c 65  teElement( "sele
33f60 63 74 22 20 29 2c 0a 09 09 6f 70 74 20 3d 20 73  ct" ),...opt = s
33f70 65 6c 65 63 74 2e 61 70 70 65 6e 64 43 68 69 6c  elect.appendChil
33f80 64 28 20 64 6f 63 75 6d 65 6e 74 2e 63 72 65 61  d( document.crea
33f90 74 65 45 6c 65 6d 65 6e 74 28 20 22 6f 70 74 69  teElement( "opti
33fa0 6f 6e 22 20 29 20 29 3b 0a 0a 09 69 6e 70 75 74  on" ) );...input
33fb0 2e 74 79 70 65 20 3d 20 22 63 68 65 63 6b 62 6f  .type = "checkbo
33fc0 78 22 3b 0a 0a 09 2f 2f 20 53 75 70 70 6f 72 74  x";...// Support
33fd0 3a 20 41 6e 64 72 6f 69 64 20 3c 3d 34 2e 33 20  : Android <=4.3 
33fe0 6f 6e 6c 79 0a 09 2f 2f 20 44 65 66 61 75 6c 74  only..// Default
33ff0 20 76 61 6c 75 65 20 66 6f 72 20 61 20 63 68 65   value for a che
34000 63 6b 62 6f 78 20 73 68 6f 75 6c 64 20 62 65 20  ckbox should be 
34010 22 6f 6e 22 0a 09 73 75 70 70 6f 72 74 2e 63 68  "on"..support.ch
34020 65 63 6b 4f 6e 20 3d 20 69 6e 70 75 74 2e 76 61  eckOn = input.va
34030 6c 75 65 20 21 3d 3d 20 22 22 3b 0a 0a 09 2f 2f  lue !== "";...//
34040 20 53 75 70 70 6f 72 74 3a 20 49 45 20 3c 3d 31   Support: IE <=1
34050 31 20 6f 6e 6c 79 0a 09 2f 2f 20 4d 75 73 74 20  1 only..// Must 
34060 61 63 63 65 73 73 20 73 65 6c 65 63 74 65 64 49  access selectedI
34070 6e 64 65 78 20 74 6f 20 6d 61 6b 65 20 64 65 66  ndex to make def
34080 61 75 6c 74 20 6f 70 74 69 6f 6e 73 20 73 65 6c  ault options sel
34090 65 63 74 0a 09 73 75 70 70 6f 72 74 2e 6f 70 74  ect..support.opt
340a0 53 65 6c 65 63 74 65 64 20 3d 20 6f 70 74 2e 73  Selected = opt.s
340b0 65 6c 65 63 74 65 64 3b 0a 0a 09 2f 2f 20 53 75  elected;...// Su
340c0 70 70 6f 72 74 3a 20 49 45 20 3c 3d 31 31 20 6f  pport: IE <=11 o
340d0 6e 6c 79 0a 09 2f 2f 20 41 6e 20 69 6e 70 75 74  nly..// An input
340e0 20 6c 6f 73 65 73 20 69 74 73 20 76 61 6c 75 65   loses its value
340f0 20 61 66 74 65 72 20 62 65 63 6f 6d 69 6e 67 20   after becoming 
34100 61 20 72 61 64 69 6f 0a 09 69 6e 70 75 74 20 3d  a radio..input =
34110 20 64 6f 63 75 6d 65 6e 74 2e 63 72 65 61 74 65   document.create
34120 45 6c 65 6d 65 6e 74 28 20 22 69 6e 70 75 74 22  Element( "input"
34130 20 29 3b 0a 09 69 6e 70 75 74 2e 76 61 6c 75 65   );..input.value
34140 20 3d 20 22 74 22 3b 0a 09 69 6e 70 75 74 2e 74   = "t";..input.t
34150 79 70 65 20 3d 20 22 72 61 64 69 6f 22 3b 0a 09  ype = "radio";..
34160 73 75 70 70 6f 72 74 2e 72 61 64 69 6f 56 61 6c  support.radioVal
34170 75 65 20 3d 20 69 6e 70 75 74 2e 76 61 6c 75 65  ue = input.value
34180 20 3d 3d 3d 20 22 74 22 3b 0a 7d 20 29 28 29 3b   === "t";.} )();
34190 0a 0a 0a 76 61 72 20 62 6f 6f 6c 48 6f 6f 6b 2c  ...var boolHook,
341a0 0a 09 61 74 74 72 48 61 6e 64 6c 65 20 3d 20 6a  ..attrHandle = j
341b0 51 75 65 72 79 2e 65 78 70 72 2e 61 74 74 72 48  Query.expr.attrH
341c0 61 6e 64 6c 65 3b 0a 0a 6a 51 75 65 72 79 2e 66  andle;..jQuery.f
341d0 6e 2e 65 78 74 65 6e 64 28 20 7b 0a 09 61 74 74  n.extend( {..att
341e0 72 3a 20 66 75 6e 63 74 69 6f 6e 28 20 6e 61 6d  r: function( nam
341f0 65 2c 20 76 61 6c 75 65 20 29 20 7b 0a 09 09 72  e, value ) {...r
34200 65 74 75 72 6e 20 61 63 63 65 73 73 28 20 74 68  eturn access( th
34210 69 73 2c 20 6a 51 75 65 72 79 2e 61 74 74 72 2c  is, jQuery.attr,
34220 20 6e 61 6d 65 2c 20 76 61 6c 75 65 2c 20 61 72   name, value, ar
34230 67 75 6d 65 6e 74 73 2e 6c 65 6e 67 74 68 20 3e  guments.length >
34240 20 31 20 29 3b 0a 09 7d 2c 0a 0a 09 72 65 6d 6f   1 );..},...remo
34250 76 65 41 74 74 72 3a 20 66 75 6e 63 74 69 6f 6e  veAttr: function
34260 28 20 6e 61 6d 65 20 29 20 7b 0a 09 09 72 65 74  ( name ) {...ret
34270 75 72 6e 20 74 68 69 73 2e 65 61 63 68 28 20 66  urn this.each( f
34280 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09 09 09 6a  unction() {....j
34290 51 75 65 72 79 2e 72 65 6d 6f 76 65 41 74 74 72  Query.removeAttr
342a0 28 20 74 68 69 73 2c 20 6e 61 6d 65 20 29 3b 0a  ( this, name );.
342b0 09 09 7d 20 29 3b 0a 09 7d 0a 7d 20 29 3b 0a 0a  ..} );..}.} );..
342c0 6a 51 75 65 72 79 2e 65 78 74 65 6e 64 28 20 7b  jQuery.extend( {
342d0 0a 09 61 74 74 72 3a 20 66 75 6e 63 74 69 6f 6e  ..attr: function
342e0 28 20 65 6c 65 6d 2c 20 6e 61 6d 65 2c 20 76 61  ( elem, name, va
342f0 6c 75 65 20 29 20 7b 0a 09 09 76 61 72 20 72 65  lue ) {...var re
34300 74 2c 20 68 6f 6f 6b 73 2c 0a 09 09 09 6e 54 79  t, hooks,....nTy
34310 70 65 20 3d 20 65 6c 65 6d 2e 6e 6f 64 65 54 79  pe = elem.nodeTy
34320 70 65 3b 0a 0a 09 09 2f 2f 20 44 6f 6e 27 74 20  pe;....// Don't 
34330 67 65 74 2f 73 65 74 20 61 74 74 72 69 62 75 74  get/set attribut
34340 65 73 20 6f 6e 20 74 65 78 74 2c 20 63 6f 6d 6d  es on text, comm
34350 65 6e 74 20 61 6e 64 20 61 74 74 72 69 62 75 74  ent and attribut
34360 65 20 6e 6f 64 65 73 0a 09 09 69 66 20 28 20 6e  e nodes...if ( n
34370 54 79 70 65 20 3d 3d 3d 20 33 20 7c 7c 20 6e 54  Type === 3 || nT
34380 79 70 65 20 3d 3d 3d 20 38 20 7c 7c 20 6e 54 79  ype === 8 || nTy
34390 70 65 20 3d 3d 3d 20 32 20 29 20 7b 0a 09 09 09  pe === 2 ) {....
343a0 72 65 74 75 72 6e 3b 0a 09 09 7d 0a 0a 09 09 2f  return;...}..../
343b0 2f 20 46 61 6c 6c 62 61 63 6b 20 74 6f 20 70 72  / Fallback to pr
343c0 6f 70 20 77 68 65 6e 20 61 74 74 72 69 62 75 74  op when attribut
343d0 65 73 20 61 72 65 20 6e 6f 74 20 73 75 70 70 6f  es are not suppo
343e0 72 74 65 64 0a 09 09 69 66 20 28 20 74 79 70 65  rted...if ( type
343f0 6f 66 20 65 6c 65 6d 2e 67 65 74 41 74 74 72 69  of elem.getAttri
34400 62 75 74 65 20 3d 3d 3d 20 22 75 6e 64 65 66 69  bute === "undefi
34410 6e 65 64 22 20 29 20 7b 0a 09 09 09 72 65 74 75  ned" ) {....retu
34420 72 6e 20 6a 51 75 65 72 79 2e 70 72 6f 70 28 20  rn jQuery.prop( 
34430 65 6c 65 6d 2c 20 6e 61 6d 65 2c 20 76 61 6c 75  elem, name, valu
34440 65 20 29 3b 0a 09 09 7d 0a 0a 09 09 2f 2f 20 41  e );...}....// A
34450 74 74 72 69 62 75 74 65 20 68 6f 6f 6b 73 20 61  ttribute hooks a
34460 72 65 20 64 65 74 65 72 6d 69 6e 65 64 20 62 79  re determined by
34470 20 74 68 65 20 6c 6f 77 65 72 63 61 73 65 20 76   the lowercase v
34480 65 72 73 69 6f 6e 0a 09 09 2f 2f 20 47 72 61 62  ersion...// Grab
34490 20 6e 65 63 65 73 73 61 72 79 20 68 6f 6f 6b 20   necessary hook 
344a0 69 66 20 6f 6e 65 20 69 73 20 64 65 66 69 6e 65  if one is define
344b0 64 0a 09 09 69 66 20 28 20 6e 54 79 70 65 20 21  d...if ( nType !
344c0 3d 3d 20 31 20 7c 7c 20 21 6a 51 75 65 72 79 2e  == 1 || !jQuery.
344d0 69 73 58 4d 4c 44 6f 63 28 20 65 6c 65 6d 20 29  isXMLDoc( elem )
344e0 20 29 20 7b 0a 09 09 09 68 6f 6f 6b 73 20 3d 20   ) {....hooks = 
344f0 6a 51 75 65 72 79 2e 61 74 74 72 48 6f 6f 6b 73  jQuery.attrHooks
34500 5b 20 6e 61 6d 65 2e 74 6f 4c 6f 77 65 72 43 61  [ name.toLowerCa
34510 73 65 28 29 20 5d 20 7c 7c 0a 09 09 09 09 28 20  se() ] ||.....( 
34520 6a 51 75 65 72 79 2e 65 78 70 72 2e 6d 61 74 63  jQuery.expr.matc
34530 68 2e 62 6f 6f 6c 2e 74 65 73 74 28 20 6e 61 6d  h.bool.test( nam
34540 65 20 29 20 3f 20 62 6f 6f 6c 48 6f 6f 6b 20 3a  e ) ? boolHook :
34550 20 75 6e 64 65 66 69 6e 65 64 20 29 3b 0a 09 09   undefined );...
34560 7d 0a 0a 09 09 69 66 20 28 20 76 61 6c 75 65 20  }....if ( value 
34570 21 3d 3d 20 75 6e 64 65 66 69 6e 65 64 20 29 20  !== undefined ) 
34580 7b 0a 09 09 09 69 66 20 28 20 76 61 6c 75 65 20  {....if ( value 
34590 3d 3d 3d 20 6e 75 6c 6c 20 29 20 7b 0a 09 09 09  === null ) {....
345a0 09 6a 51 75 65 72 79 2e 72 65 6d 6f 76 65 41 74  .jQuery.removeAt
345b0 74 72 28 20 65 6c 65 6d 2c 20 6e 61 6d 65 20 29  tr( elem, name )
345c0 3b 0a 09 09 09 09 72 65 74 75 72 6e 3b 0a 09 09  ;.....return;...
345d0 09 7d 0a 0a 09 09 09 69 66 20 28 20 68 6f 6f 6b  .}.....if ( hook
345e0 73 20 26 26 20 22 73 65 74 22 20 69 6e 20 68 6f  s && "set" in ho
345f0 6f 6b 73 20 26 26 0a 09 09 09 09 28 20 72 65 74  oks &&.....( ret
34600 20 3d 20 68 6f 6f 6b 73 2e 73 65 74 28 20 65 6c   = hooks.set( el
34610 65 6d 2c 20 76 61 6c 75 65 2c 20 6e 61 6d 65 20  em, value, name 
34620 29 20 29 20 21 3d 3d 20 75 6e 64 65 66 69 6e 65  ) ) !== undefine
34630 64 20 29 20 7b 0a 09 09 09 09 72 65 74 75 72 6e  d ) {.....return
34640 20 72 65 74 3b 0a 09 09 09 7d 0a 0a 09 09 09 65   ret;....}.....e
34650 6c 65 6d 2e 73 65 74 41 74 74 72 69 62 75 74 65  lem.setAttribute
34660 28 20 6e 61 6d 65 2c 20 76 61 6c 75 65 20 2b 20  ( name, value + 
34670 22 22 20 29 3b 0a 09 09 09 72 65 74 75 72 6e 20  "" );....return 
34680 76 61 6c 75 65 3b 0a 09 09 7d 0a 0a 09 09 69 66  value;...}....if
34690 20 28 20 68 6f 6f 6b 73 20 26 26 20 22 67 65 74   ( hooks && "get
346a0 22 20 69 6e 20 68 6f 6f 6b 73 20 26 26 20 28 20  " in hooks && ( 
346b0 72 65 74 20 3d 20 68 6f 6f 6b 73 2e 67 65 74 28  ret = hooks.get(
346c0 20 65 6c 65 6d 2c 20 6e 61 6d 65 20 29 20 29 20   elem, name ) ) 
346d0 21 3d 3d 20 6e 75 6c 6c 20 29 20 7b 0a 09 09 09  !== null ) {....
346e0 72 65 74 75 72 6e 20 72 65 74 3b 0a 09 09 7d 0a  return ret;...}.
346f0 0a 09 09 72 65 74 20 3d 20 6a 51 75 65 72 79 2e  ...ret = jQuery.
34700 66 69 6e 64 2e 61 74 74 72 28 20 65 6c 65 6d 2c  find.attr( elem,
34710 20 6e 61 6d 65 20 29 3b 0a 0a 09 09 2f 2f 20 4e   name );....// N
34720 6f 6e 2d 65 78 69 73 74 65 6e 74 20 61 74 74 72  on-existent attr
34730 69 62 75 74 65 73 20 72 65 74 75 72 6e 20 6e 75  ibutes return nu
34740 6c 6c 2c 20 77 65 20 6e 6f 72 6d 61 6c 69 7a 65  ll, we normalize
34750 20 74 6f 20 75 6e 64 65 66 69 6e 65 64 0a 09 09   to undefined...
34760 72 65 74 75 72 6e 20 72 65 74 20 3d 3d 20 6e 75  return ret == nu
34770 6c 6c 20 3f 20 75 6e 64 65 66 69 6e 65 64 20 3a  ll ? undefined :
34780 20 72 65 74 3b 0a 09 7d 2c 0a 0a 09 61 74 74 72   ret;..},...attr
34790 48 6f 6f 6b 73 3a 20 7b 0a 09 09 74 79 70 65 3a  Hooks: {...type:
347a0 20 7b 0a 09 09 09 73 65 74 3a 20 66 75 6e 63 74   {....set: funct
347b0 69 6f 6e 28 20 65 6c 65 6d 2c 20 76 61 6c 75 65  ion( elem, value
347c0 20 29 20 7b 0a 09 09 09 09 69 66 20 28 20 21 73   ) {.....if ( !s
347d0 75 70 70 6f 72 74 2e 72 61 64 69 6f 56 61 6c 75  upport.radioValu
347e0 65 20 26 26 20 76 61 6c 75 65 20 3d 3d 3d 20 22  e && value === "
347f0 72 61 64 69 6f 22 20 26 26 0a 09 09 09 09 09 6e  radio" &&......n
34800 6f 64 65 4e 61 6d 65 28 20 65 6c 65 6d 2c 20 22  odeName( elem, "
34810 69 6e 70 75 74 22 20 29 20 29 20 7b 0a 09 09 09  input" ) ) {....
34820 09 09 76 61 72 20 76 61 6c 20 3d 20 65 6c 65 6d  ..var val = elem
34830 2e 76 61 6c 75 65 3b 0a 09 09 09 09 09 65 6c 65  .value;......ele
34840 6d 2e 73 65 74 41 74 74 72 69 62 75 74 65 28 20  m.setAttribute( 
34850 22 74 79 70 65 22 2c 20 76 61 6c 75 65 20 29 3b  "type", value );
34860 0a 09 09 09 09 09 69 66 20 28 20 76 61 6c 20 29  ......if ( val )
34870 20 7b 0a 09 09 09 09 09 09 65 6c 65 6d 2e 76 61   {.......elem.va
34880 6c 75 65 20 3d 20 76 61 6c 3b 0a 09 09 09 09 09  lue = val;......
34890 7d 0a 09 09 09 09 09 72 65 74 75 72 6e 20 76 61  }......return va
348a0 6c 75 65 3b 0a 09 09 09 09 7d 0a 09 09 09 7d 0a  lue;.....}....}.
348b0 09 09 7d 0a 09 7d 2c 0a 0a 09 72 65 6d 6f 76 65  ..}..},...remove
348c0 41 74 74 72 3a 20 66 75 6e 63 74 69 6f 6e 28 20  Attr: function( 
348d0 65 6c 65 6d 2c 20 76 61 6c 75 65 20 29 20 7b 0a  elem, value ) {.
348e0 09 09 76 61 72 20 6e 61 6d 65 2c 0a 09 09 09 69  ..var name,....i
348f0 20 3d 20 30 2c 0a 0a 09 09 09 2f 2f 20 41 74 74   = 0,.....// Att
34900 72 69 62 75 74 65 20 6e 61 6d 65 73 20 63 61 6e  ribute names can
34910 20 63 6f 6e 74 61 69 6e 20 6e 6f 6e 2d 48 54 4d   contain non-HTM
34920 4c 20 77 68 69 74 65 73 70 61 63 65 20 63 68 61  L whitespace cha
34930 72 61 63 74 65 72 73 0a 09 09 09 2f 2f 20 68 74  racters....// ht
34940 74 70 73 3a 2f 2f 68 74 6d 6c 2e 73 70 65 63 2e  tps://html.spec.
34950 77 68 61 74 77 67 2e 6f 72 67 2f 6d 75 6c 74 69  whatwg.org/multi
34960 70 61 67 65 2f 73 79 6e 74 61 78 2e 68 74 6d 6c  page/syntax.html
34970 23 61 74 74 72 69 62 75 74 65 73 2d 32 0a 09 09  #attributes-2...
34980 09 61 74 74 72 4e 61 6d 65 73 20 3d 20 76 61 6c  .attrNames = val
34990 75 65 20 26 26 20 76 61 6c 75 65 2e 6d 61 74 63  ue && value.matc
349a0 68 28 20 72 6e 6f 74 68 74 6d 6c 77 68 69 74 65  h( rnothtmlwhite
349b0 20 29 3b 0a 0a 09 09 69 66 20 28 20 61 74 74 72   );....if ( attr
349c0 4e 61 6d 65 73 20 26 26 20 65 6c 65 6d 2e 6e 6f  Names && elem.no
349d0 64 65 54 79 70 65 20 3d 3d 3d 20 31 20 29 20 7b  deType === 1 ) {
349e0 0a 09 09 09 77 68 69 6c 65 20 28 20 28 20 6e 61  ....while ( ( na
349f0 6d 65 20 3d 20 61 74 74 72 4e 61 6d 65 73 5b 20  me = attrNames[ 
34a00 69 2b 2b 20 5d 20 29 20 29 20 7b 0a 09 09 09 09  i++ ] ) ) {.....
34a10 65 6c 65 6d 2e 72 65 6d 6f 76 65 41 74 74 72 69  elem.removeAttri
34a20 62 75 74 65 28 20 6e 61 6d 65 20 29 3b 0a 09 09  bute( name );...
34a30 09 7d 0a 09 09 7d 0a 09 7d 0a 7d 20 29 3b 0a 0a  .}...}..}.} );..
34a40 2f 2f 20 48 6f 6f 6b 73 20 66 6f 72 20 62 6f 6f  // Hooks for boo
34a50 6c 65 61 6e 20 61 74 74 72 69 62 75 74 65 73 0a  lean attributes.
34a60 62 6f 6f 6c 48 6f 6f 6b 20 3d 20 7b 0a 09 73 65  boolHook = {..se
34a70 74 3a 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c 65  t: function( ele
34a80 6d 2c 20 76 61 6c 75 65 2c 20 6e 61 6d 65 20 29  m, value, name )
34a90 20 7b 0a 09 09 69 66 20 28 20 76 61 6c 75 65 20   {...if ( value 
34aa0 3d 3d 3d 20 66 61 6c 73 65 20 29 20 7b 0a 0a 09  === false ) {...
34ab0 09 09 2f 2f 20 52 65 6d 6f 76 65 20 62 6f 6f 6c  ..// Remove bool
34ac0 65 61 6e 20 61 74 74 72 69 62 75 74 65 73 20 77  ean attributes w
34ad0 68 65 6e 20 73 65 74 20 74 6f 20 66 61 6c 73 65  hen set to false
34ae0 0a 09 09 09 6a 51 75 65 72 79 2e 72 65 6d 6f 76  ....jQuery.remov
34af0 65 41 74 74 72 28 20 65 6c 65 6d 2c 20 6e 61 6d  eAttr( elem, nam
34b00 65 20 29 3b 0a 09 09 7d 20 65 6c 73 65 20 7b 0a  e );...} else {.
34b10 09 09 09 65 6c 65 6d 2e 73 65 74 41 74 74 72 69  ...elem.setAttri
34b20 62 75 74 65 28 20 6e 61 6d 65 2c 20 6e 61 6d 65  bute( name, name
34b30 20 29 3b 0a 09 09 7d 0a 09 09 72 65 74 75 72 6e   );...}...return
34b40 20 6e 61 6d 65 3b 0a 09 7d 0a 7d 3b 0a 0a 6a 51   name;..}.};..jQ
34b50 75 65 72 79 2e 65 61 63 68 28 20 6a 51 75 65 72  uery.each( jQuer
34b60 79 2e 65 78 70 72 2e 6d 61 74 63 68 2e 62 6f 6f  y.expr.match.boo
34b70 6c 2e 73 6f 75 72 63 65 2e 6d 61 74 63 68 28 20  l.source.match( 
34b80 2f 5c 77 2b 2f 67 20 29 2c 20 66 75 6e 63 74 69  /\w+/g ), functi
34b90 6f 6e 28 20 5f 69 2c 20 6e 61 6d 65 20 29 20 7b  on( _i, name ) {
34ba0 0a 09 76 61 72 20 67 65 74 74 65 72 20 3d 20 61  ..var getter = a
34bb0 74 74 72 48 61 6e 64 6c 65 5b 20 6e 61 6d 65 20  ttrHandle[ name 
34bc0 5d 20 7c 7c 20 6a 51 75 65 72 79 2e 66 69 6e 64  ] || jQuery.find
34bd0 2e 61 74 74 72 3b 0a 0a 09 61 74 74 72 48 61 6e  .attr;...attrHan
34be0 64 6c 65 5b 20 6e 61 6d 65 20 5d 20 3d 20 66 75  dle[ name ] = fu
34bf0 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 2c 20 6e 61  nction( elem, na
34c00 6d 65 2c 20 69 73 58 4d 4c 20 29 20 7b 0a 09 09  me, isXML ) {...
34c10 76 61 72 20 72 65 74 2c 20 68 61 6e 64 6c 65 2c  var ret, handle,
34c20 0a 09 09 09 6c 6f 77 65 72 63 61 73 65 4e 61 6d  ....lowercaseNam
34c30 65 20 3d 20 6e 61 6d 65 2e 74 6f 4c 6f 77 65 72  e = name.toLower
34c40 43 61 73 65 28 29 3b 0a 0a 09 09 69 66 20 28 20  Case();....if ( 
34c50 21 69 73 58 4d 4c 20 29 20 7b 0a 0a 09 09 09 2f  !isXML ) {...../
34c60 2f 20 41 76 6f 69 64 20 61 6e 20 69 6e 66 69 6e  / Avoid an infin
34c70 69 74 65 20 6c 6f 6f 70 20 62 79 20 74 65 6d 70  ite loop by temp
34c80 6f 72 61 72 69 6c 79 20 72 65 6d 6f 76 69 6e 67  orarily removing
34c90 20 74 68 69 73 20 66 75 6e 63 74 69 6f 6e 20 66   this function f
34ca0 72 6f 6d 20 74 68 65 20 67 65 74 74 65 72 0a 09  rom the getter..
34cb0 09 09 68 61 6e 64 6c 65 20 3d 20 61 74 74 72 48  ..handle = attrH
34cc0 61 6e 64 6c 65 5b 20 6c 6f 77 65 72 63 61 73 65  andle[ lowercase
34cd0 4e 61 6d 65 20 5d 3b 0a 09 09 09 61 74 74 72 48  Name ];....attrH
34ce0 61 6e 64 6c 65 5b 20 6c 6f 77 65 72 63 61 73 65  andle[ lowercase
34cf0 4e 61 6d 65 20 5d 20 3d 20 72 65 74 3b 0a 09 09  Name ] = ret;...
34d00 09 72 65 74 20 3d 20 67 65 74 74 65 72 28 20 65  .ret = getter( e
34d10 6c 65 6d 2c 20 6e 61 6d 65 2c 20 69 73 58 4d 4c  lem, name, isXML
34d20 20 29 20 21 3d 20 6e 75 6c 6c 20 3f 0a 09 09 09   ) != null ?....
34d30 09 6c 6f 77 65 72 63 61 73 65 4e 61 6d 65 20 3a  .lowercaseName :
34d40 0a 09 09 09 09 6e 75 6c 6c 3b 0a 09 09 09 61 74  .....null;....at
34d50 74 72 48 61 6e 64 6c 65 5b 20 6c 6f 77 65 72 63  trHandle[ lowerc
34d60 61 73 65 4e 61 6d 65 20 5d 20 3d 20 68 61 6e 64  aseName ] = hand
34d70 6c 65 3b 0a 09 09 7d 0a 09 09 72 65 74 75 72 6e  le;...}...return
34d80 20 72 65 74 3b 0a 09 7d 3b 0a 7d 20 29 3b 0a 0a   ret;..};.} );..
34d90 0a 0a 0a 76 61 72 20 72 66 6f 63 75 73 61 62 6c  ...var rfocusabl
34da0 65 20 3d 20 2f 5e 28 3f 3a 69 6e 70 75 74 7c 73  e = /^(?:input|s
34db0 65 6c 65 63 74 7c 74 65 78 74 61 72 65 61 7c 62  elect|textarea|b
34dc0 75 74 74 6f 6e 29 24 2f 69 2c 0a 09 72 63 6c 69  utton)$/i,..rcli
34dd0 63 6b 61 62 6c 65 20 3d 20 2f 5e 28 3f 3a 61 7c  ckable = /^(?:a|
34de0 61 72 65 61 29 24 2f 69 3b 0a 0a 6a 51 75 65 72  area)$/i;..jQuer
34df0 79 2e 66 6e 2e 65 78 74 65 6e 64 28 20 7b 0a 09  y.fn.extend( {..
34e00 70 72 6f 70 3a 20 66 75 6e 63 74 69 6f 6e 28 20  prop: function( 
34e10 6e 61 6d 65 2c 20 76 61 6c 75 65 20 29 20 7b 0a  name, value ) {.
34e20 09 09 72 65 74 75 72 6e 20 61 63 63 65 73 73 28  ..return access(
34e30 20 74 68 69 73 2c 20 6a 51 75 65 72 79 2e 70 72   this, jQuery.pr
34e40 6f 70 2c 20 6e 61 6d 65 2c 20 76 61 6c 75 65 2c  op, name, value,
34e50 20 61 72 67 75 6d 65 6e 74 73 2e 6c 65 6e 67 74   arguments.lengt
34e60 68 20 3e 20 31 20 29 3b 0a 09 7d 2c 0a 0a 09 72  h > 1 );..},...r
34e70 65 6d 6f 76 65 50 72 6f 70 3a 20 66 75 6e 63 74  emoveProp: funct
34e80 69 6f 6e 28 20 6e 61 6d 65 20 29 20 7b 0a 09 09  ion( name ) {...
34e90 72 65 74 75 72 6e 20 74 68 69 73 2e 65 61 63 68  return this.each
34ea0 28 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09  ( function() {..
34eb0 09 09 64 65 6c 65 74 65 20 74 68 69 73 5b 20 6a  ..delete this[ j
34ec0 51 75 65 72 79 2e 70 72 6f 70 46 69 78 5b 20 6e  Query.propFix[ n
34ed0 61 6d 65 20 5d 20 7c 7c 20 6e 61 6d 65 20 5d 3b  ame ] || name ];
34ee0 0a 09 09 7d 20 29 3b 0a 09 7d 0a 7d 20 29 3b 0a  ...} );..}.} );.
34ef0 0a 6a 51 75 65 72 79 2e 65 78 74 65 6e 64 28 20  .jQuery.extend( 
34f00 7b 0a 09 70 72 6f 70 3a 20 66 75 6e 63 74 69 6f  {..prop: functio
34f10 6e 28 20 65 6c 65 6d 2c 20 6e 61 6d 65 2c 20 76  n( elem, name, v
34f20 61 6c 75 65 20 29 20 7b 0a 09 09 76 61 72 20 72  alue ) {...var r
34f30 65 74 2c 20 68 6f 6f 6b 73 2c 0a 09 09 09 6e 54  et, hooks,....nT
34f40 79 70 65 20 3d 20 65 6c 65 6d 2e 6e 6f 64 65 54  ype = elem.nodeT
34f50 79 70 65 3b 0a 0a 09 09 2f 2f 20 44 6f 6e 27 74  ype;....// Don't
34f60 20 67 65 74 2f 73 65 74 20 70 72 6f 70 65 72 74   get/set propert
34f70 69 65 73 20 6f 6e 20 74 65 78 74 2c 20 63 6f 6d  ies on text, com
34f80 6d 65 6e 74 20 61 6e 64 20 61 74 74 72 69 62 75  ment and attribu
34f90 74 65 20 6e 6f 64 65 73 0a 09 09 69 66 20 28 20  te nodes...if ( 
34fa0 6e 54 79 70 65 20 3d 3d 3d 20 33 20 7c 7c 20 6e  nType === 3 || n
34fb0 54 79 70 65 20 3d 3d 3d 20 38 20 7c 7c 20 6e 54  Type === 8 || nT
34fc0 79 70 65 20 3d 3d 3d 20 32 20 29 20 7b 0a 09 09  ype === 2 ) {...
34fd0 09 72 65 74 75 72 6e 3b 0a 09 09 7d 0a 0a 09 09  .return;...}....
34fe0 69 66 20 28 20 6e 54 79 70 65 20 21 3d 3d 20 31  if ( nType !== 1
34ff0 20 7c 7c 20 21 6a 51 75 65 72 79 2e 69 73 58 4d   || !jQuery.isXM
35000 4c 44 6f 63 28 20 65 6c 65 6d 20 29 20 29 20 7b  LDoc( elem ) ) {
35010 0a 0a 09 09 09 2f 2f 20 46 69 78 20 6e 61 6d 65  .....// Fix name
35020 20 61 6e 64 20 61 74 74 61 63 68 20 68 6f 6f 6b   and attach hook
35030 73 0a 09 09 09 6e 61 6d 65 20 3d 20 6a 51 75 65  s....name = jQue
35040 72 79 2e 70 72 6f 70 46 69 78 5b 20 6e 61 6d 65  ry.propFix[ name
35050 20 5d 20 7c 7c 20 6e 61 6d 65 3b 0a 09 09 09 68   ] || name;....h
35060 6f 6f 6b 73 20 3d 20 6a 51 75 65 72 79 2e 70 72  ooks = jQuery.pr
35070 6f 70 48 6f 6f 6b 73 5b 20 6e 61 6d 65 20 5d 3b  opHooks[ name ];
35080 0a 09 09 7d 0a 0a 09 09 69 66 20 28 20 76 61 6c  ...}....if ( val
35090 75 65 20 21 3d 3d 20 75 6e 64 65 66 69 6e 65 64  ue !== undefined
350a0 20 29 20 7b 0a 09 09 09 69 66 20 28 20 68 6f 6f   ) {....if ( hoo
350b0 6b 73 20 26 26 20 22 73 65 74 22 20 69 6e 20 68  ks && "set" in h
350c0 6f 6f 6b 73 20 26 26 0a 09 09 09 09 28 20 72 65  ooks &&.....( re
350d0 74 20 3d 20 68 6f 6f 6b 73 2e 73 65 74 28 20 65  t = hooks.set( e
350e0 6c 65 6d 2c 20 76 61 6c 75 65 2c 20 6e 61 6d 65  lem, value, name
350f0 20 29 20 29 20 21 3d 3d 20 75 6e 64 65 66 69 6e   ) ) !== undefin
35100 65 64 20 29 20 7b 0a 09 09 09 09 72 65 74 75 72  ed ) {.....retur
35110 6e 20 72 65 74 3b 0a 09 09 09 7d 0a 0a 09 09 09  n ret;....}.....
35120 72 65 74 75 72 6e 20 28 20 65 6c 65 6d 5b 20 6e  return ( elem[ n
35130 61 6d 65 20 5d 20 3d 20 76 61 6c 75 65 20 29 3b  ame ] = value );
35140 0a 09 09 7d 0a 0a 09 09 69 66 20 28 20 68 6f 6f  ...}....if ( hoo
35150 6b 73 20 26 26 20 22 67 65 74 22 20 69 6e 20 68  ks && "get" in h
35160 6f 6f 6b 73 20 26 26 20 28 20 72 65 74 20 3d 20  ooks && ( ret = 
35170 68 6f 6f 6b 73 2e 67 65 74 28 20 65 6c 65 6d 2c  hooks.get( elem,
35180 20 6e 61 6d 65 20 29 20 29 20 21 3d 3d 20 6e 75   name ) ) !== nu
35190 6c 6c 20 29 20 7b 0a 09 09 09 72 65 74 75 72 6e  ll ) {....return
351a0 20 72 65 74 3b 0a 09 09 7d 0a 0a 09 09 72 65 74   ret;...}....ret
351b0 75 72 6e 20 65 6c 65 6d 5b 20 6e 61 6d 65 20 5d  urn elem[ name ]
351c0 3b 0a 09 7d 2c 0a 0a 09 70 72 6f 70 48 6f 6f 6b  ;..},...propHook
351d0 73 3a 20 7b 0a 09 09 74 61 62 49 6e 64 65 78 3a  s: {...tabIndex:
351e0 20 7b 0a 09 09 09 67 65 74 3a 20 66 75 6e 63 74   {....get: funct
351f0 69 6f 6e 28 20 65 6c 65 6d 20 29 20 7b 0a 0a 09  ion( elem ) {...
35200 09 09 09 2f 2f 20 53 75 70 70 6f 72 74 3a 20 49  ...// Support: I
35210 45 20 3c 3d 39 20 2d 20 31 31 20 6f 6e 6c 79 0a  E <=9 - 11 only.
35220 09 09 09 09 2f 2f 20 65 6c 65 6d 2e 74 61 62 49  ....// elem.tabI
35230 6e 64 65 78 20 64 6f 65 73 6e 27 74 20 61 6c 77  ndex doesn't alw
35240 61 79 73 20 72 65 74 75 72 6e 20 74 68 65 0a 09  ays return the..
35250 09 09 09 2f 2f 20 63 6f 72 72 65 63 74 20 76 61  ...// correct va
35260 6c 75 65 20 77 68 65 6e 20 69 74 20 68 61 73 6e  lue when it hasn
35270 27 74 20 62 65 65 6e 20 65 78 70 6c 69 63 69 74  't been explicit
35280 6c 79 20 73 65 74 0a 09 09 09 09 2f 2f 20 68 74  ly set.....// ht
35290 74 70 73 3a 2f 2f 77 65 62 2e 61 72 63 68 69 76  tps://web.archiv
352a0 65 2e 6f 72 67 2f 77 65 62 2f 32 30 31 34 31 31  e.org/web/201411
352b0 31 36 32 33 33 33 34 37 2f 68 74 74 70 3a 2f 2f  16233347/http://
352c0 66 6c 75 69 64 70 72 6f 6a 65 63 74 2e 6f 72 67  fluidproject.org
352d0 2f 62 6c 6f 67 2f 32 30 30 38 2f 30 31 2f 30 39  /blog/2008/01/09
352e0 2f 67 65 74 74 69 6e 67 2d 73 65 74 74 69 6e 67  /getting-setting
352f0 2d 61 6e 64 2d 72 65 6d 6f 76 69 6e 67 2d 74 61  -and-removing-ta
35300 62 69 6e 64 65 78 2d 76 61 6c 75 65 73 2d 77 69  bindex-values-wi
35310 74 68 2d 6a 61 76 61 73 63 72 69 70 74 2f 0a 09  th-javascript/..
35320 09 09 09 2f 2f 20 55 73 65 20 70 72 6f 70 65 72  ...// Use proper
35330 20 61 74 74 72 69 62 75 74 65 20 72 65 74 72 69   attribute retri
35340 65 76 61 6c 28 23 31 32 30 37 32 29 0a 09 09 09  eval(#12072)....
35350 09 76 61 72 20 74 61 62 69 6e 64 65 78 20 3d 20  .var tabindex = 
35360 6a 51 75 65 72 79 2e 66 69 6e 64 2e 61 74 74 72  jQuery.find.attr
35370 28 20 65 6c 65 6d 2c 20 22 74 61 62 69 6e 64 65  ( elem, "tabinde
35380 78 22 20 29 3b 0a 0a 09 09 09 09 69 66 20 28 20  x" );......if ( 
35390 74 61 62 69 6e 64 65 78 20 29 20 7b 0a 09 09 09  tabindex ) {....
353a0 09 09 72 65 74 75 72 6e 20 70 61 72 73 65 49 6e  ..return parseIn
353b0 74 28 20 74 61 62 69 6e 64 65 78 2c 20 31 30 20  t( tabindex, 10 
353c0 29 3b 0a 09 09 09 09 7d 0a 0a 09 09 09 09 69 66  );.....}......if
353d0 20 28 0a 09 09 09 09 09 72 66 6f 63 75 73 61 62   (......rfocusab
353e0 6c 65 2e 74 65 73 74 28 20 65 6c 65 6d 2e 6e 6f  le.test( elem.no
353f0 64 65 4e 61 6d 65 20 29 20 7c 7c 0a 09 09 09 09  deName ) ||.....
35400 09 72 63 6c 69 63 6b 61 62 6c 65 2e 74 65 73 74  .rclickable.test
35410 28 20 65 6c 65 6d 2e 6e 6f 64 65 4e 61 6d 65 20  ( elem.nodeName 
35420 29 20 26 26 0a 09 09 09 09 09 65 6c 65 6d 2e 68  ) &&......elem.h
35430 72 65 66 0a 09 09 09 09 29 20 7b 0a 09 09 09 09  ref.....) {.....
35440 09 72 65 74 75 72 6e 20 30 3b 0a 09 09 09 09 7d  .return 0;.....}
35450 0a 0a 09 09 09 09 72 65 74 75 72 6e 20 2d 31 3b  ......return -1;
35460 0a 09 09 09 7d 0a 09 09 7d 0a 09 7d 2c 0a 0a 09  ....}...}..},...
35470 70 72 6f 70 46 69 78 3a 20 7b 0a 09 09 22 66 6f  propFix: {..."fo
35480 72 22 3a 20 22 68 74 6d 6c 46 6f 72 22 2c 0a 09  r": "htmlFor",..
35490 09 22 63 6c 61 73 73 22 3a 20 22 63 6c 61 73 73  ."class": "class
354a0 4e 61 6d 65 22 0a 09 7d 0a 7d 20 29 3b 0a 0a 2f  Name"..}.} );../
354b0 2f 20 53 75 70 70 6f 72 74 3a 20 49 45 20 3c 3d  / Support: IE <=
354c0 31 31 20 6f 6e 6c 79 0a 2f 2f 20 41 63 63 65 73  11 only.// Acces
354d0 73 69 6e 67 20 74 68 65 20 73 65 6c 65 63 74 65  sing the selecte
354e0 64 49 6e 64 65 78 20 70 72 6f 70 65 72 74 79 0a  dIndex property.
354f0 2f 2f 20 66 6f 72 63 65 73 20 74 68 65 20 62 72  // forces the br
35500 6f 77 73 65 72 20 74 6f 20 72 65 73 70 65 63 74  owser to respect
35510 20 73 65 74 74 69 6e 67 20 73 65 6c 65 63 74 65   setting selecte
35520 64 0a 2f 2f 20 6f 6e 20 74 68 65 20 6f 70 74 69  d.// on the opti
35530 6f 6e 0a 2f 2f 20 54 68 65 20 67 65 74 74 65 72  on.// The getter
35540 20 65 6e 73 75 72 65 73 20 61 20 64 65 66 61 75   ensures a defau
35550 6c 74 20 6f 70 74 69 6f 6e 20 69 73 20 73 65 6c  lt option is sel
35560 65 63 74 65 64 0a 2f 2f 20 77 68 65 6e 20 69 6e  ected.// when in
35570 20 61 6e 20 6f 70 74 67 72 6f 75 70 0a 2f 2f 20   an optgroup.// 
35580 65 73 6c 69 6e 74 20 72 75 6c 65 20 22 6e 6f 2d  eslint rule "no-
35590 75 6e 75 73 65 64 2d 65 78 70 72 65 73 73 69 6f  unused-expressio
355a0 6e 73 22 20 69 73 20 64 69 73 61 62 6c 65 64 20  ns" is disabled 
355b0 66 6f 72 20 74 68 69 73 20 63 6f 64 65 0a 2f 2f  for this code.//
355c0 20 73 69 6e 63 65 20 69 74 20 63 6f 6e 73 69 64   since it consid
355d0 65 72 73 20 73 75 63 68 20 61 63 63 65 73 73 69  ers such accessi
355e0 6f 6e 73 20 6e 6f 6f 70 0a 69 66 20 28 20 21 73  ons noop.if ( !s
355f0 75 70 70 6f 72 74 2e 6f 70 74 53 65 6c 65 63 74  upport.optSelect
35600 65 64 20 29 20 7b 0a 09 6a 51 75 65 72 79 2e 70  ed ) {..jQuery.p
35610 72 6f 70 48 6f 6f 6b 73 2e 73 65 6c 65 63 74 65  ropHooks.selecte
35620 64 20 3d 20 7b 0a 09 09 67 65 74 3a 20 66 75 6e  d = {...get: fun
35630 63 74 69 6f 6e 28 20 65 6c 65 6d 20 29 20 7b 0a  ction( elem ) {.
35640 0a 09 09 09 2f 2a 20 65 73 6c 69 6e 74 20 6e 6f  ..../* eslint no
35650 2d 75 6e 75 73 65 64 2d 65 78 70 72 65 73 73 69  -unused-expressi
35660 6f 6e 73 3a 20 22 6f 66 66 22 20 2a 2f 0a 0a 09  ons: "off" */...
35670 09 09 76 61 72 20 70 61 72 65 6e 74 20 3d 20 65  ..var parent = e
35680 6c 65 6d 2e 70 61 72 65 6e 74 4e 6f 64 65 3b 0a  lem.parentNode;.
35690 09 09 09 69 66 20 28 20 70 61 72 65 6e 74 20 26  ...if ( parent &
356a0 26 20 70 61 72 65 6e 74 2e 70 61 72 65 6e 74 4e  & parent.parentN
356b0 6f 64 65 20 29 20 7b 0a 09 09 09 09 70 61 72 65  ode ) {.....pare
356c0 6e 74 2e 70 61 72 65 6e 74 4e 6f 64 65 2e 73 65  nt.parentNode.se
356d0 6c 65 63 74 65 64 49 6e 64 65 78 3b 0a 09 09 09  lectedIndex;....
356e0 7d 0a 09 09 09 72 65 74 75 72 6e 20 6e 75 6c 6c  }....return null
356f0 3b 0a 09 09 7d 2c 0a 09 09 73 65 74 3a 20 66 75  ;...},...set: fu
35700 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 20 29 20 7b  nction( elem ) {
35710 0a 0a 09 09 09 2f 2a 20 65 73 6c 69 6e 74 20 6e  ...../* eslint n
35720 6f 2d 75 6e 75 73 65 64 2d 65 78 70 72 65 73 73  o-unused-express
35730 69 6f 6e 73 3a 20 22 6f 66 66 22 20 2a 2f 0a 0a  ions: "off" */..
35740 09 09 09 76 61 72 20 70 61 72 65 6e 74 20 3d 20  ...var parent = 
35750 65 6c 65 6d 2e 70 61 72 65 6e 74 4e 6f 64 65 3b  elem.parentNode;
35760 0a 09 09 09 69 66 20 28 20 70 61 72 65 6e 74 20  ....if ( parent 
35770 29 20 7b 0a 09 09 09 09 70 61 72 65 6e 74 2e 73  ) {.....parent.s
35780 65 6c 65 63 74 65 64 49 6e 64 65 78 3b 0a 0a 09  electedIndex;...
35790 09 09 09 69 66 20 28 20 70 61 72 65 6e 74 2e 70  ...if ( parent.p
357a0 61 72 65 6e 74 4e 6f 64 65 20 29 20 7b 0a 09 09  arentNode ) {...
357b0 09 09 09 70 61 72 65 6e 74 2e 70 61 72 65 6e 74  ...parent.parent
357c0 4e 6f 64 65 2e 73 65 6c 65 63 74 65 64 49 6e 64  Node.selectedInd
357d0 65 78 3b 0a 09 09 09 09 7d 0a 09 09 09 7d 0a 09  ex;.....}....}..
357e0 09 7d 0a 09 7d 3b 0a 7d 0a 0a 6a 51 75 65 72 79  .}..};.}..jQuery
357f0 2e 65 61 63 68 28 20 5b 0a 09 22 74 61 62 49 6e  .each( [.."tabIn
35800 64 65 78 22 2c 0a 09 22 72 65 61 64 4f 6e 6c 79  dex",.."readOnly
35810 22 2c 0a 09 22 6d 61 78 4c 65 6e 67 74 68 22 2c  ",.."maxLength",
35820 0a 09 22 63 65 6c 6c 53 70 61 63 69 6e 67 22 2c  .."cellSpacing",
35830 0a 09 22 63 65 6c 6c 50 61 64 64 69 6e 67 22 2c  .."cellPadding",
35840 0a 09 22 72 6f 77 53 70 61 6e 22 2c 0a 09 22 63  .."rowSpan",.."c
35850 6f 6c 53 70 61 6e 22 2c 0a 09 22 75 73 65 4d 61  olSpan",.."useMa
35860 70 22 2c 0a 09 22 66 72 61 6d 65 42 6f 72 64 65  p",.."frameBorde
35870 72 22 2c 0a 09 22 63 6f 6e 74 65 6e 74 45 64 69  r",.."contentEdi
35880 74 61 62 6c 65 22 0a 5d 2c 20 66 75 6e 63 74 69  table".], functi
35890 6f 6e 28 29 20 7b 0a 09 6a 51 75 65 72 79 2e 70  on() {..jQuery.p
358a0 72 6f 70 46 69 78 5b 20 74 68 69 73 2e 74 6f 4c  ropFix[ this.toL
358b0 6f 77 65 72 43 61 73 65 28 29 20 5d 20 3d 20 74  owerCase() ] = t
358c0 68 69 73 3b 0a 7d 20 29 3b 0a 0a 0a 0a 0a 09 2f  his;.} );....../
358d0 2f 20 53 74 72 69 70 20 61 6e 64 20 63 6f 6c 6c  / Strip and coll
358e0 61 70 73 65 20 77 68 69 74 65 73 70 61 63 65 20  apse whitespace 
358f0 61 63 63 6f 72 64 69 6e 67 20 74 6f 20 48 54 4d  according to HTM
35900 4c 20 73 70 65 63 0a 09 2f 2f 20 68 74 74 70 73  L spec..// https
35910 3a 2f 2f 69 6e 66 72 61 2e 73 70 65 63 2e 77 68  ://infra.spec.wh
35920 61 74 77 67 2e 6f 72 67 2f 23 73 74 72 69 70 2d  atwg.org/#strip-
35930 61 6e 64 2d 63 6f 6c 6c 61 70 73 65 2d 61 73 63  and-collapse-asc
35940 69 69 2d 77 68 69 74 65 73 70 61 63 65 0a 09 66  ii-whitespace..f
35950 75 6e 63 74 69 6f 6e 20 73 74 72 69 70 41 6e 64  unction stripAnd
35960 43 6f 6c 6c 61 70 73 65 28 20 76 61 6c 75 65 20  Collapse( value 
35970 29 20 7b 0a 09 09 76 61 72 20 74 6f 6b 65 6e 73  ) {...var tokens
35980 20 3d 20 76 61 6c 75 65 2e 6d 61 74 63 68 28 20   = value.match( 
35990 72 6e 6f 74 68 74 6d 6c 77 68 69 74 65 20 29 20  rnothtmlwhite ) 
359a0 7c 7c 20 5b 5d 3b 0a 09 09 72 65 74 75 72 6e 20  || [];...return 
359b0 74 6f 6b 65 6e 73 2e 6a 6f 69 6e 28 20 22 20 22  tokens.join( " "
359c0 20 29 3b 0a 09 7d 0a 0a 0a 66 75 6e 63 74 69 6f   );..}...functio
359d0 6e 20 67 65 74 43 6c 61 73 73 28 20 65 6c 65 6d  n getClass( elem
359e0 20 29 20 7b 0a 09 72 65 74 75 72 6e 20 65 6c 65   ) {..return ele
359f0 6d 2e 67 65 74 41 74 74 72 69 62 75 74 65 20 26  m.getAttribute &
35a00 26 20 65 6c 65 6d 2e 67 65 74 41 74 74 72 69 62  & elem.getAttrib
35a10 75 74 65 28 20 22 63 6c 61 73 73 22 20 29 20 7c  ute( "class" ) |
35a20 7c 20 22 22 3b 0a 7d 0a 0a 66 75 6e 63 74 69 6f  | "";.}..functio
35a30 6e 20 63 6c 61 73 73 65 73 54 6f 41 72 72 61 79  n classesToArray
35a40 28 20 76 61 6c 75 65 20 29 20 7b 0a 09 69 66 20  ( value ) {..if 
35a50 28 20 41 72 72 61 79 2e 69 73 41 72 72 61 79 28  ( Array.isArray(
35a60 20 76 61 6c 75 65 20 29 20 29 20 7b 0a 09 09 72   value ) ) {...r
35a70 65 74 75 72 6e 20 76 61 6c 75 65 3b 0a 09 7d 0a  eturn value;..}.
35a80 09 69 66 20 28 20 74 79 70 65 6f 66 20 76 61 6c  .if ( typeof val
35a90 75 65 20 3d 3d 3d 20 22 73 74 72 69 6e 67 22 20  ue === "string" 
35aa0 29 20 7b 0a 09 09 72 65 74 75 72 6e 20 76 61 6c  ) {...return val
35ab0 75 65 2e 6d 61 74 63 68 28 20 72 6e 6f 74 68 74  ue.match( rnotht
35ac0 6d 6c 77 68 69 74 65 20 29 20 7c 7c 20 5b 5d 3b  mlwhite ) || [];
35ad0 0a 09 7d 0a 09 72 65 74 75 72 6e 20 5b 5d 3b 0a  ..}..return [];.
35ae0 7d 0a 0a 6a 51 75 65 72 79 2e 66 6e 2e 65 78 74  }..jQuery.fn.ext
35af0 65 6e 64 28 20 7b 0a 09 61 64 64 43 6c 61 73 73  end( {..addClass
35b00 3a 20 66 75 6e 63 74 69 6f 6e 28 20 76 61 6c 75  : function( valu
35b10 65 20 29 20 7b 0a 09 09 76 61 72 20 63 6c 61 73  e ) {...var clas
35b20 73 65 73 2c 20 65 6c 65 6d 2c 20 63 75 72 2c 20  ses, elem, cur, 
35b30 63 75 72 56 61 6c 75 65 2c 20 63 6c 61 7a 7a 2c  curValue, clazz,
35b40 20 6a 2c 20 66 69 6e 61 6c 56 61 6c 75 65 2c 0a   j, finalValue,.
35b50 09 09 09 69 20 3d 20 30 3b 0a 0a 09 09 69 66 20  ...i = 0;....if 
35b60 28 20 69 73 46 75 6e 63 74 69 6f 6e 28 20 76 61  ( isFunction( va
35b70 6c 75 65 20 29 20 29 20 7b 0a 09 09 09 72 65 74  lue ) ) {....ret
35b80 75 72 6e 20 74 68 69 73 2e 65 61 63 68 28 20 66  urn this.each( f
35b90 75 6e 63 74 69 6f 6e 28 20 6a 20 29 20 7b 0a 09  unction( j ) {..
35ba0 09 09 09 6a 51 75 65 72 79 28 20 74 68 69 73 20  ...jQuery( this 
35bb0 29 2e 61 64 64 43 6c 61 73 73 28 20 76 61 6c 75  ).addClass( valu
35bc0 65 2e 63 61 6c 6c 28 20 74 68 69 73 2c 20 6a 2c  e.call( this, j,
35bd0 20 67 65 74 43 6c 61 73 73 28 20 74 68 69 73 20   getClass( this 
35be0 29 20 29 20 29 3b 0a 09 09 09 7d 20 29 3b 0a 09  ) ) );....} );..
35bf0 09 7d 0a 0a 09 09 63 6c 61 73 73 65 73 20 3d 20  .}....classes = 
35c00 63 6c 61 73 73 65 73 54 6f 41 72 72 61 79 28 20  classesToArray( 
35c10 76 61 6c 75 65 20 29 3b 0a 0a 09 09 69 66 20 28  value );....if (
35c20 20 63 6c 61 73 73 65 73 2e 6c 65 6e 67 74 68 20   classes.length 
35c30 29 20 7b 0a 09 09 09 77 68 69 6c 65 20 28 20 28  ) {....while ( (
35c40 20 65 6c 65 6d 20 3d 20 74 68 69 73 5b 20 69 2b   elem = this[ i+
35c50 2b 20 5d 20 29 20 29 20 7b 0a 09 09 09 09 63 75  + ] ) ) {.....cu
35c60 72 56 61 6c 75 65 20 3d 20 67 65 74 43 6c 61 73  rValue = getClas
35c70 73 28 20 65 6c 65 6d 20 29 3b 0a 09 09 09 09 63  s( elem );.....c
35c80 75 72 20 3d 20 65 6c 65 6d 2e 6e 6f 64 65 54 79  ur = elem.nodeTy
35c90 70 65 20 3d 3d 3d 20 31 20 26 26 20 28 20 22 20  pe === 1 && ( " 
35ca0 22 20 2b 20 73 74 72 69 70 41 6e 64 43 6f 6c 6c  " + stripAndColl
35cb0 61 70 73 65 28 20 63 75 72 56 61 6c 75 65 20 29  apse( curValue )
35cc0 20 2b 20 22 20 22 20 29 3b 0a 0a 09 09 09 09 69   + " " );......i
35cd0 66 20 28 20 63 75 72 20 29 20 7b 0a 09 09 09 09  f ( cur ) {.....
35ce0 09 6a 20 3d 20 30 3b 0a 09 09 09 09 09 77 68 69  .j = 0;......whi
35cf0 6c 65 20 28 20 28 20 63 6c 61 7a 7a 20 3d 20 63  le ( ( clazz = c
35d00 6c 61 73 73 65 73 5b 20 6a 2b 2b 20 5d 20 29 20  lasses[ j++ ] ) 
35d10 29 20 7b 0a 09 09 09 09 09 09 69 66 20 28 20 63  ) {.......if ( c
35d20 75 72 2e 69 6e 64 65 78 4f 66 28 20 22 20 22 20  ur.indexOf( " " 
35d30 2b 20 63 6c 61 7a 7a 20 2b 20 22 20 22 20 29 20  + clazz + " " ) 
35d40 3c 20 30 20 29 20 7b 0a 09 09 09 09 09 09 09 63  < 0 ) {........c
35d50 75 72 20 2b 3d 20 63 6c 61 7a 7a 20 2b 20 22 20  ur += clazz + " 
35d60 22 3b 0a 09 09 09 09 09 09 7d 0a 09 09 09 09 09  ";.......}......
35d70 7d 0a 0a 09 09 09 09 09 2f 2f 20 4f 6e 6c 79 20  }.......// Only 
35d80 61 73 73 69 67 6e 20 69 66 20 64 69 66 66 65 72  assign if differ
35d90 65 6e 74 20 74 6f 20 61 76 6f 69 64 20 75 6e 6e  ent to avoid unn
35da0 65 65 64 65 64 20 72 65 6e 64 65 72 69 6e 67 2e  eeded rendering.
35db0 0a 09 09 09 09 09 66 69 6e 61 6c 56 61 6c 75 65  ......finalValue
35dc0 20 3d 20 73 74 72 69 70 41 6e 64 43 6f 6c 6c 61   = stripAndColla
35dd0 70 73 65 28 20 63 75 72 20 29 3b 0a 09 09 09 09  pse( cur );.....
35de0 09 69 66 20 28 20 63 75 72 56 61 6c 75 65 20 21  .if ( curValue !
35df0 3d 3d 20 66 69 6e 61 6c 56 61 6c 75 65 20 29 20  == finalValue ) 
35e00 7b 0a 09 09 09 09 09 09 65 6c 65 6d 2e 73 65 74  {.......elem.set
35e10 41 74 74 72 69 62 75 74 65 28 20 22 63 6c 61 73  Attribute( "clas
35e20 73 22 2c 20 66 69 6e 61 6c 56 61 6c 75 65 20 29  s", finalValue )
35e30 3b 0a 09 09 09 09 09 7d 0a 09 09 09 09 7d 0a 09  ;......}.....}..
35e40 09 09 7d 0a 09 09 7d 0a 0a 09 09 72 65 74 75 72  ..}...}....retur
35e50 6e 20 74 68 69 73 3b 0a 09 7d 2c 0a 0a 09 72 65  n this;..},...re
35e60 6d 6f 76 65 43 6c 61 73 73 3a 20 66 75 6e 63 74  moveClass: funct
35e70 69 6f 6e 28 20 76 61 6c 75 65 20 29 20 7b 0a 09  ion( value ) {..
35e80 09 76 61 72 20 63 6c 61 73 73 65 73 2c 20 65 6c  .var classes, el
35e90 65 6d 2c 20 63 75 72 2c 20 63 75 72 56 61 6c 75  em, cur, curValu
35ea0 65 2c 20 63 6c 61 7a 7a 2c 20 6a 2c 20 66 69 6e  e, clazz, j, fin
35eb0 61 6c 56 61 6c 75 65 2c 0a 09 09 09 69 20 3d 20  alValue,....i = 
35ec0 30 3b 0a 0a 09 09 69 66 20 28 20 69 73 46 75 6e  0;....if ( isFun
35ed0 63 74 69 6f 6e 28 20 76 61 6c 75 65 20 29 20 29  ction( value ) )
35ee0 20 7b 0a 09 09 09 72 65 74 75 72 6e 20 74 68 69   {....return thi
35ef0 73 2e 65 61 63 68 28 20 66 75 6e 63 74 69 6f 6e  s.each( function
35f00 28 20 6a 20 29 20 7b 0a 09 09 09 09 6a 51 75 65  ( j ) {.....jQue
35f10 72 79 28 20 74 68 69 73 20 29 2e 72 65 6d 6f 76  ry( this ).remov
35f20 65 43 6c 61 73 73 28 20 76 61 6c 75 65 2e 63 61  eClass( value.ca
35f30 6c 6c 28 20 74 68 69 73 2c 20 6a 2c 20 67 65 74  ll( this, j, get
35f40 43 6c 61 73 73 28 20 74 68 69 73 20 29 20 29 20  Class( this ) ) 
35f50 29 3b 0a 09 09 09 7d 20 29 3b 0a 09 09 7d 0a 0a  );....} );...}..
35f60 09 09 69 66 20 28 20 21 61 72 67 75 6d 65 6e 74  ..if ( !argument
35f70 73 2e 6c 65 6e 67 74 68 20 29 20 7b 0a 09 09 09  s.length ) {....
35f80 72 65 74 75 72 6e 20 74 68 69 73 2e 61 74 74 72  return this.attr
35f90 28 20 22 63 6c 61 73 73 22 2c 20 22 22 20 29 3b  ( "class", "" );
35fa0 0a 09 09 7d 0a 0a 09 09 63 6c 61 73 73 65 73 20  ...}....classes 
35fb0 3d 20 63 6c 61 73 73 65 73 54 6f 41 72 72 61 79  = classesToArray
35fc0 28 20 76 61 6c 75 65 20 29 3b 0a 0a 09 09 69 66  ( value );....if
35fd0 20 28 20 63 6c 61 73 73 65 73 2e 6c 65 6e 67 74   ( classes.lengt
35fe0 68 20 29 20 7b 0a 09 09 09 77 68 69 6c 65 20 28  h ) {....while (
35ff0 20 28 20 65 6c 65 6d 20 3d 20 74 68 69 73 5b 20   ( elem = this[ 
36000 69 2b 2b 20 5d 20 29 20 29 20 7b 0a 09 09 09 09  i++ ] ) ) {.....
36010 63 75 72 56 61 6c 75 65 20 3d 20 67 65 74 43 6c  curValue = getCl
36020 61 73 73 28 20 65 6c 65 6d 20 29 3b 0a 0a 09 09  ass( elem );....
36030 09 09 2f 2f 20 54 68 69 73 20 65 78 70 72 65 73  ..// This expres
36040 73 69 6f 6e 20 69 73 20 68 65 72 65 20 66 6f 72  sion is here for
36050 20 62 65 74 74 65 72 20 63 6f 6d 70 72 65 73 73   better compress
36060 69 62 69 6c 69 74 79 20 28 73 65 65 20 61 64 64  ibility (see add
36070 43 6c 61 73 73 29 0a 09 09 09 09 63 75 72 20 3d  Class).....cur =
36080 20 65 6c 65 6d 2e 6e 6f 64 65 54 79 70 65 20 3d   elem.nodeType =
36090 3d 3d 20 31 20 26 26 20 28 20 22 20 22 20 2b 20  == 1 && ( " " + 
360a0 73 74 72 69 70 41 6e 64 43 6f 6c 6c 61 70 73 65  stripAndCollapse
360b0 28 20 63 75 72 56 61 6c 75 65 20 29 20 2b 20 22  ( curValue ) + "
360c0 20 22 20 29 3b 0a 0a 09 09 09 09 69 66 20 28 20   " );......if ( 
360d0 63 75 72 20 29 20 7b 0a 09 09 09 09 09 6a 20 3d  cur ) {......j =
360e0 20 30 3b 0a 09 09 09 09 09 77 68 69 6c 65 20 28   0;......while (
360f0 20 28 20 63 6c 61 7a 7a 20 3d 20 63 6c 61 73 73   ( clazz = class
36100 65 73 5b 20 6a 2b 2b 20 5d 20 29 20 29 20 7b 0a  es[ j++ ] ) ) {.
36110 0a 09 09 09 09 09 09 2f 2f 20 52 65 6d 6f 76 65  .......// Remove
36120 20 2a 61 6c 6c 2a 20 69 6e 73 74 61 6e 63 65 73   *all* instances
36130 0a 09 09 09 09 09 09 77 68 69 6c 65 20 28 20 63  .......while ( c
36140 75 72 2e 69 6e 64 65 78 4f 66 28 20 22 20 22 20  ur.indexOf( " " 
36150 2b 20 63 6c 61 7a 7a 20 2b 20 22 20 22 20 29 20  + clazz + " " ) 
36160 3e 20 2d 31 20 29 20 7b 0a 09 09 09 09 09 09 09  > -1 ) {........
36170 63 75 72 20 3d 20 63 75 72 2e 72 65 70 6c 61 63  cur = cur.replac
36180 65 28 20 22 20 22 20 2b 20 63 6c 61 7a 7a 20 2b  e( " " + clazz +
36190 20 22 20 22 2c 20 22 20 22 20 29 3b 0a 09 09 09   " ", " " );....
361a0 09 09 09 7d 0a 09 09 09 09 09 7d 0a 0a 09 09 09  ...}......}.....
361b0 09 09 2f 2f 20 4f 6e 6c 79 20 61 73 73 69 67 6e  ..// Only assign
361c0 20 69 66 20 64 69 66 66 65 72 65 6e 74 20 74 6f   if different to
361d0 20 61 76 6f 69 64 20 75 6e 6e 65 65 64 65 64 20   avoid unneeded 
361e0 72 65 6e 64 65 72 69 6e 67 2e 0a 09 09 09 09 09  rendering.......
361f0 66 69 6e 61 6c 56 61 6c 75 65 20 3d 20 73 74 72  finalValue = str
36200 69 70 41 6e 64 43 6f 6c 6c 61 70 73 65 28 20 63  ipAndCollapse( c
36210 75 72 20 29 3b 0a 09 09 09 09 09 69 66 20 28 20  ur );......if ( 
36220 63 75 72 56 61 6c 75 65 20 21 3d 3d 20 66 69 6e  curValue !== fin
36230 61 6c 56 61 6c 75 65 20 29 20 7b 0a 09 09 09 09  alValue ) {.....
36240 09 09 65 6c 65 6d 2e 73 65 74 41 74 74 72 69 62  ..elem.setAttrib
36250 75 74 65 28 20 22 63 6c 61 73 73 22 2c 20 66 69  ute( "class", fi
36260 6e 61 6c 56 61 6c 75 65 20 29 3b 0a 09 09 09 09  nalValue );.....
36270 09 7d 0a 09 09 09 09 7d 0a 09 09 09 7d 0a 09 09  .}.....}....}...
36280 7d 0a 0a 09 09 72 65 74 75 72 6e 20 74 68 69 73  }....return this
36290 3b 0a 09 7d 2c 0a 0a 09 74 6f 67 67 6c 65 43 6c  ;..},...toggleCl
362a0 61 73 73 3a 20 66 75 6e 63 74 69 6f 6e 28 20 76  ass: function( v
362b0 61 6c 75 65 2c 20 73 74 61 74 65 56 61 6c 20 29  alue, stateVal )
362c0 20 7b 0a 09 09 76 61 72 20 74 79 70 65 20 3d 20   {...var type = 
362d0 74 79 70 65 6f 66 20 76 61 6c 75 65 2c 0a 09 09  typeof value,...
362e0 09 69 73 56 61 6c 69 64 56 61 6c 75 65 20 3d 20  .isValidValue = 
362f0 74 79 70 65 20 3d 3d 3d 20 22 73 74 72 69 6e 67  type === "string
36300 22 20 7c 7c 20 41 72 72 61 79 2e 69 73 41 72 72  " || Array.isArr
36310 61 79 28 20 76 61 6c 75 65 20 29 3b 0a 0a 09 09  ay( value );....
36320 69 66 20 28 20 74 79 70 65 6f 66 20 73 74 61 74  if ( typeof stat
36330 65 56 61 6c 20 3d 3d 3d 20 22 62 6f 6f 6c 65 61  eVal === "boolea
36340 6e 22 20 26 26 20 69 73 56 61 6c 69 64 56 61 6c  n" && isValidVal
36350 75 65 20 29 20 7b 0a 09 09 09 72 65 74 75 72 6e  ue ) {....return
36360 20 73 74 61 74 65 56 61 6c 20 3f 20 74 68 69 73   stateVal ? this
36370 2e 61 64 64 43 6c 61 73 73 28 20 76 61 6c 75 65  .addClass( value
36380 20 29 20 3a 20 74 68 69 73 2e 72 65 6d 6f 76 65   ) : this.remove
36390 43 6c 61 73 73 28 20 76 61 6c 75 65 20 29 3b 0a  Class( value );.
363a0 09 09 7d 0a 0a 09 09 69 66 20 28 20 69 73 46 75  ..}....if ( isFu
363b0 6e 63 74 69 6f 6e 28 20 76 61 6c 75 65 20 29 20  nction( value ) 
363c0 29 20 7b 0a 09 09 09 72 65 74 75 72 6e 20 74 68  ) {....return th
363d0 69 73 2e 65 61 63 68 28 20 66 75 6e 63 74 69 6f  is.each( functio
363e0 6e 28 20 69 20 29 20 7b 0a 09 09 09 09 6a 51 75  n( i ) {.....jQu
363f0 65 72 79 28 20 74 68 69 73 20 29 2e 74 6f 67 67  ery( this ).togg
36400 6c 65 43 6c 61 73 73 28 0a 09 09 09 09 09 76 61  leClass(......va
36410 6c 75 65 2e 63 61 6c 6c 28 20 74 68 69 73 2c 20  lue.call( this, 
36420 69 2c 20 67 65 74 43 6c 61 73 73 28 20 74 68 69  i, getClass( thi
36430 73 20 29 2c 20 73 74 61 74 65 56 61 6c 20 29 2c  s ), stateVal ),
36440 0a 09 09 09 09 09 73 74 61 74 65 56 61 6c 0a 09  ......stateVal..
36450 09 09 09 29 3b 0a 09 09 09 7d 20 29 3b 0a 09 09  ...);....} );...
36460 7d 0a 0a 09 09 72 65 74 75 72 6e 20 74 68 69 73  }....return this
36470 2e 65 61 63 68 28 20 66 75 6e 63 74 69 6f 6e 28  .each( function(
36480 29 20 7b 0a 09 09 09 76 61 72 20 63 6c 61 73 73  ) {....var class
36490 4e 61 6d 65 2c 20 69 2c 20 73 65 6c 66 2c 20 63  Name, i, self, c
364a0 6c 61 73 73 4e 61 6d 65 73 3b 0a 0a 09 09 09 69  lassNames;.....i
364b0 66 20 28 20 69 73 56 61 6c 69 64 56 61 6c 75 65  f ( isValidValue
364c0 20 29 20 7b 0a 0a 09 09 09 09 2f 2f 20 54 6f 67   ) {......// Tog
364d0 67 6c 65 20 69 6e 64 69 76 69 64 75 61 6c 20 63  gle individual c
364e0 6c 61 73 73 20 6e 61 6d 65 73 0a 09 09 09 09 69  lass names.....i
364f0 20 3d 20 30 3b 0a 09 09 09 09 73 65 6c 66 20 3d   = 0;.....self =
36500 20 6a 51 75 65 72 79 28 20 74 68 69 73 20 29 3b   jQuery( this );
36510 0a 09 09 09 09 63 6c 61 73 73 4e 61 6d 65 73 20  .....classNames 
36520 3d 20 63 6c 61 73 73 65 73 54 6f 41 72 72 61 79  = classesToArray
36530 28 20 76 61 6c 75 65 20 29 3b 0a 0a 09 09 09 09  ( value );......
36540 77 68 69 6c 65 20 28 20 28 20 63 6c 61 73 73 4e  while ( ( classN
36550 61 6d 65 20 3d 20 63 6c 61 73 73 4e 61 6d 65 73  ame = classNames
36560 5b 20 69 2b 2b 20 5d 20 29 20 29 20 7b 0a 0a 09  [ i++ ] ) ) {...
36570 09 09 09 09 2f 2f 20 43 68 65 63 6b 20 65 61 63  ....// Check eac
36580 68 20 63 6c 61 73 73 4e 61 6d 65 20 67 69 76 65  h className give
36590 6e 2c 20 73 70 61 63 65 20 73 65 70 61 72 61 74  n, space separat
365a0 65 64 20 6c 69 73 74 0a 09 09 09 09 09 69 66 20  ed list......if 
365b0 28 20 73 65 6c 66 2e 68 61 73 43 6c 61 73 73 28  ( self.hasClass(
365c0 20 63 6c 61 73 73 4e 61 6d 65 20 29 20 29 20 7b   className ) ) {
365d0 0a 09 09 09 09 09 09 73 65 6c 66 2e 72 65 6d 6f  .......self.remo
365e0 76 65 43 6c 61 73 73 28 20 63 6c 61 73 73 4e 61  veClass( classNa
365f0 6d 65 20 29 3b 0a 09 09 09 09 09 7d 20 65 6c 73  me );......} els
36600 65 20 7b 0a 09 09 09 09 09 09 73 65 6c 66 2e 61  e {.......self.a
36610 64 64 43 6c 61 73 73 28 20 63 6c 61 73 73 4e 61  ddClass( classNa
36620 6d 65 20 29 3b 0a 09 09 09 09 09 7d 0a 09 09 09  me );......}....
36630 09 7d 0a 0a 09 09 09 2f 2f 20 54 6f 67 67 6c 65  .}.....// Toggle
36640 20 77 68 6f 6c 65 20 63 6c 61 73 73 20 6e 61 6d   whole class nam
36650 65 0a 09 09 09 7d 20 65 6c 73 65 20 69 66 20 28  e....} else if (
36660 20 76 61 6c 75 65 20 3d 3d 3d 20 75 6e 64 65 66   value === undef
36670 69 6e 65 64 20 7c 7c 20 74 79 70 65 20 3d 3d 3d  ined || type ===
36680 20 22 62 6f 6f 6c 65 61 6e 22 20 29 20 7b 0a 09   "boolean" ) {..
36690 09 09 09 63 6c 61 73 73 4e 61 6d 65 20 3d 20 67  ...className = g
366a0 65 74 43 6c 61 73 73 28 20 74 68 69 73 20 29 3b  etClass( this );
366b0 0a 09 09 09 09 69 66 20 28 20 63 6c 61 73 73 4e  .....if ( classN
366c0 61 6d 65 20 29 20 7b 0a 0a 09 09 09 09 09 2f 2f  ame ) {.......//
366d0 20 53 74 6f 72 65 20 63 6c 61 73 73 4e 61 6d 65   Store className
366e0 20 69 66 20 73 65 74 0a 09 09 09 09 09 64 61 74   if set......dat
366f0 61 50 72 69 76 2e 73 65 74 28 20 74 68 69 73 2c  aPriv.set( this,
36700 20 22 5f 5f 63 6c 61 73 73 4e 61 6d 65 5f 5f 22   "__className__"
36710 2c 20 63 6c 61 73 73 4e 61 6d 65 20 29 3b 0a 09  , className );..
36720 09 09 09 7d 0a 0a 09 09 09 09 2f 2f 20 49 66 20  ...}......// If 
36730 74 68 65 20 65 6c 65 6d 65 6e 74 20 68 61 73 20  the element has 
36740 61 20 63 6c 61 73 73 20 6e 61 6d 65 20 6f 72 20  a class name or 
36750 69 66 20 77 65 27 72 65 20 70 61 73 73 65 64 20  if we're passed 
36760 60 66 61 6c 73 65 60 2c 0a 09 09 09 09 2f 2f 20  `false`,.....// 
36770 74 68 65 6e 20 72 65 6d 6f 76 65 20 74 68 65 20  then remove the 
36780 77 68 6f 6c 65 20 63 6c 61 73 73 6e 61 6d 65 20  whole classname 
36790 28 69 66 20 74 68 65 72 65 20 77 61 73 20 6f 6e  (if there was on
367a0 65 2c 20 74 68 65 20 61 62 6f 76 65 20 73 61 76  e, the above sav
367b0 65 64 20 69 74 29 2e 0a 09 09 09 09 2f 2f 20 4f  ed it)......// O
367c0 74 68 65 72 77 69 73 65 20 62 72 69 6e 67 20 62  therwise bring b
367d0 61 63 6b 20 77 68 61 74 65 76 65 72 20 77 61 73  ack whatever was
367e0 20 70 72 65 76 69 6f 75 73 6c 79 20 73 61 76 65   previously save
367f0 64 20 28 69 66 20 61 6e 79 74 68 69 6e 67 29 2c  d (if anything),
36800 0a 09 09 09 09 2f 2f 20 66 61 6c 6c 69 6e 67 20  .....// falling 
36810 62 61 63 6b 20 74 6f 20 74 68 65 20 65 6d 70 74  back to the empt
36820 79 20 73 74 72 69 6e 67 20 69 66 20 6e 6f 74 68  y string if noth
36830 69 6e 67 20 77 61 73 20 73 74 6f 72 65 64 2e 0a  ing was stored..
36840 09 09 09 09 69 66 20 28 20 74 68 69 73 2e 73 65  ....if ( this.se
36850 74 41 74 74 72 69 62 75 74 65 20 29 20 7b 0a 09  tAttribute ) {..
36860 09 09 09 09 74 68 69 73 2e 73 65 74 41 74 74 72  ....this.setAttr
36870 69 62 75 74 65 28 20 22 63 6c 61 73 73 22 2c 0a  ibute( "class",.
36880 09 09 09 09 09 09 63 6c 61 73 73 4e 61 6d 65 20  ......className 
36890 7c 7c 20 76 61 6c 75 65 20 3d 3d 3d 20 66 61 6c  || value === fal
368a0 73 65 20 3f 0a 09 09 09 09 09 09 22 22 20 3a 0a  se ?......."" :.
368b0 09 09 09 09 09 09 64 61 74 61 50 72 69 76 2e 67  ......dataPriv.g
368c0 65 74 28 20 74 68 69 73 2c 20 22 5f 5f 63 6c 61  et( this, "__cla
368d0 73 73 4e 61 6d 65 5f 5f 22 20 29 20 7c 7c 20 22  ssName__" ) || "
368e0 22 0a 09 09 09 09 09 29 3b 0a 09 09 09 09 7d 0a  "......);.....}.
368f0 09 09 09 7d 0a 09 09 7d 20 29 3b 0a 09 7d 2c 0a  ...}...} );..},.
36900 0a 09 68 61 73 43 6c 61 73 73 3a 20 66 75 6e 63  ..hasClass: func
36910 74 69 6f 6e 28 20 73 65 6c 65 63 74 6f 72 20 29  tion( selector )
36920 20 7b 0a 09 09 76 61 72 20 63 6c 61 73 73 4e 61   {...var classNa
36930 6d 65 2c 20 65 6c 65 6d 2c 0a 09 09 09 69 20 3d  me, elem,....i =
36940 20 30 3b 0a 0a 09 09 63 6c 61 73 73 4e 61 6d 65   0;....className
36950 20 3d 20 22 20 22 20 2b 20 73 65 6c 65 63 74 6f   = " " + selecto
36960 72 20 2b 20 22 20 22 3b 0a 09 09 77 68 69 6c 65  r + " ";...while
36970 20 28 20 28 20 65 6c 65 6d 20 3d 20 74 68 69 73   ( ( elem = this
36980 5b 20 69 2b 2b 20 5d 20 29 20 29 20 7b 0a 09 09  [ i++ ] ) ) {...
36990 09 69 66 20 28 20 65 6c 65 6d 2e 6e 6f 64 65 54  .if ( elem.nodeT
369a0 79 70 65 20 3d 3d 3d 20 31 20 26 26 0a 09 09 09  ype === 1 &&....
369b0 09 28 20 22 20 22 20 2b 20 73 74 72 69 70 41 6e  .( " " + stripAn
369c0 64 43 6f 6c 6c 61 70 73 65 28 20 67 65 74 43 6c  dCollapse( getCl
369d0 61 73 73 28 20 65 6c 65 6d 20 29 20 29 20 2b 20  ass( elem ) ) + 
369e0 22 20 22 20 29 2e 69 6e 64 65 78 4f 66 28 20 63  " " ).indexOf( c
369f0 6c 61 73 73 4e 61 6d 65 20 29 20 3e 20 2d 31 20  lassName ) > -1 
36a00 29 20 7b 0a 09 09 09 09 09 72 65 74 75 72 6e 20  ) {......return 
36a10 74 72 75 65 3b 0a 09 09 09 7d 0a 09 09 7d 0a 0a  true;....}...}..
36a20 09 09 72 65 74 75 72 6e 20 66 61 6c 73 65 3b 0a  ..return false;.
36a30 09 7d 0a 7d 20 29 3b 0a 0a 0a 0a 0a 76 61 72 20  .}.} );.....var 
36a40 72 72 65 74 75 72 6e 20 3d 20 2f 5c 72 2f 67 3b  rreturn = /\r/g;
36a50 0a 0a 6a 51 75 65 72 79 2e 66 6e 2e 65 78 74 65  ..jQuery.fn.exte
36a60 6e 64 28 20 7b 0a 09 76 61 6c 3a 20 66 75 6e 63  nd( {..val: func
36a70 74 69 6f 6e 28 20 76 61 6c 75 65 20 29 20 7b 0a  tion( value ) {.
36a80 09 09 76 61 72 20 68 6f 6f 6b 73 2c 20 72 65 74  ..var hooks, ret
36a90 2c 20 76 61 6c 75 65 49 73 46 75 6e 63 74 69 6f  , valueIsFunctio
36aa0 6e 2c 0a 09 09 09 65 6c 65 6d 20 3d 20 74 68 69  n,....elem = thi
36ab0 73 5b 20 30 20 5d 3b 0a 0a 09 09 69 66 20 28 20  s[ 0 ];....if ( 
36ac0 21 61 72 67 75 6d 65 6e 74 73 2e 6c 65 6e 67 74  !arguments.lengt
36ad0 68 20 29 20 7b 0a 09 09 09 69 66 20 28 20 65 6c  h ) {....if ( el
36ae0 65 6d 20 29 20 7b 0a 09 09 09 09 68 6f 6f 6b 73  em ) {.....hooks
36af0 20 3d 20 6a 51 75 65 72 79 2e 76 61 6c 48 6f 6f   = jQuery.valHoo
36b00 6b 73 5b 20 65 6c 65 6d 2e 74 79 70 65 20 5d 20  ks[ elem.type ] 
36b10 7c 7c 0a 09 09 09 09 09 6a 51 75 65 72 79 2e 76  ||......jQuery.v
36b20 61 6c 48 6f 6f 6b 73 5b 20 65 6c 65 6d 2e 6e 6f  alHooks[ elem.no
36b30 64 65 4e 61 6d 65 2e 74 6f 4c 6f 77 65 72 43 61  deName.toLowerCa
36b40 73 65 28 29 20 5d 3b 0a 0a 09 09 09 09 69 66 20  se() ];......if 
36b50 28 20 68 6f 6f 6b 73 20 26 26 0a 09 09 09 09 09  ( hooks &&......
36b60 22 67 65 74 22 20 69 6e 20 68 6f 6f 6b 73 20 26  "get" in hooks &
36b70 26 0a 09 09 09 09 09 28 20 72 65 74 20 3d 20 68  &......( ret = h
36b80 6f 6f 6b 73 2e 67 65 74 28 20 65 6c 65 6d 2c 20  ooks.get( elem, 
36b90 22 76 61 6c 75 65 22 20 29 20 29 20 21 3d 3d 20  "value" ) ) !== 
36ba0 75 6e 64 65 66 69 6e 65 64 0a 09 09 09 09 29 20  undefined.....) 
36bb0 7b 0a 09 09 09 09 09 72 65 74 75 72 6e 20 72 65  {......return re
36bc0 74 3b 0a 09 09 09 09 7d 0a 0a 09 09 09 09 72 65  t;.....}......re
36bd0 74 20 3d 20 65 6c 65 6d 2e 76 61 6c 75 65 3b 0a  t = elem.value;.
36be0 0a 09 09 09 09 2f 2f 20 48 61 6e 64 6c 65 20 6d  .....// Handle m
36bf0 6f 73 74 20 63 6f 6d 6d 6f 6e 20 73 74 72 69 6e  ost common strin
36c00 67 20 63 61 73 65 73 0a 09 09 09 09 69 66 20 28  g cases.....if (
36c10 20 74 79 70 65 6f 66 20 72 65 74 20 3d 3d 3d 20   typeof ret === 
36c20 22 73 74 72 69 6e 67 22 20 29 20 7b 0a 09 09 09  "string" ) {....
36c30 09 09 72 65 74 75 72 6e 20 72 65 74 2e 72 65 70  ..return ret.rep
36c40 6c 61 63 65 28 20 72 72 65 74 75 72 6e 2c 20 22  lace( rreturn, "
36c50 22 20 29 3b 0a 09 09 09 09 7d 0a 0a 09 09 09 09  " );.....}......
36c60 2f 2f 20 48 61 6e 64 6c 65 20 63 61 73 65 73 20  // Handle cases 
36c70 77 68 65 72 65 20 76 61 6c 75 65 20 69 73 20 6e  where value is n
36c80 75 6c 6c 2f 75 6e 64 65 66 20 6f 72 20 6e 75 6d  ull/undef or num
36c90 62 65 72 0a 09 09 09 09 72 65 74 75 72 6e 20 72  ber.....return r
36ca0 65 74 20 3d 3d 20 6e 75 6c 6c 20 3f 20 22 22 20  et == null ? "" 
36cb0 3a 20 72 65 74 3b 0a 09 09 09 7d 0a 0a 09 09 09  : ret;....}.....
36cc0 72 65 74 75 72 6e 3b 0a 09 09 7d 0a 0a 09 09 76  return;...}....v
36cd0 61 6c 75 65 49 73 46 75 6e 63 74 69 6f 6e 20 3d  alueIsFunction =
36ce0 20 69 73 46 75 6e 63 74 69 6f 6e 28 20 76 61 6c   isFunction( val
36cf0 75 65 20 29 3b 0a 0a 09 09 72 65 74 75 72 6e 20  ue );....return 
36d00 74 68 69 73 2e 65 61 63 68 28 20 66 75 6e 63 74  this.each( funct
36d10 69 6f 6e 28 20 69 20 29 20 7b 0a 09 09 09 76 61  ion( i ) {....va
36d20 72 20 76 61 6c 3b 0a 0a 09 09 09 69 66 20 28 20  r val;.....if ( 
36d30 74 68 69 73 2e 6e 6f 64 65 54 79 70 65 20 21 3d  this.nodeType !=
36d40 3d 20 31 20 29 20 7b 0a 09 09 09 09 72 65 74 75  = 1 ) {.....retu
36d50 72 6e 3b 0a 09 09 09 7d 0a 0a 09 09 09 69 66 20  rn;....}.....if 
36d60 28 20 76 61 6c 75 65 49 73 46 75 6e 63 74 69 6f  ( valueIsFunctio
36d70 6e 20 29 20 7b 0a 09 09 09 09 76 61 6c 20 3d 20  n ) {.....val = 
36d80 76 61 6c 75 65 2e 63 61 6c 6c 28 20 74 68 69 73  value.call( this
36d90 2c 20 69 2c 20 6a 51 75 65 72 79 28 20 74 68 69  , i, jQuery( thi
36da0 73 20 29 2e 76 61 6c 28 29 20 29 3b 0a 09 09 09  s ).val() );....
36db0 7d 20 65 6c 73 65 20 7b 0a 09 09 09 09 76 61 6c  } else {.....val
36dc0 20 3d 20 76 61 6c 75 65 3b 0a 09 09 09 7d 0a 0a   = value;....}..
36dd0 09 09 09 2f 2f 20 54 72 65 61 74 20 6e 75 6c 6c  ...// Treat null
36de0 2f 75 6e 64 65 66 69 6e 65 64 20 61 73 20 22 22  /undefined as ""
36df0 3b 20 63 6f 6e 76 65 72 74 20 6e 75 6d 62 65 72  ; convert number
36e00 73 20 74 6f 20 73 74 72 69 6e 67 0a 09 09 09 69  s to string....i
36e10 66 20 28 20 76 61 6c 20 3d 3d 20 6e 75 6c 6c 20  f ( val == null 
36e20 29 20 7b 0a 09 09 09 09 76 61 6c 20 3d 20 22 22  ) {.....val = ""
36e30 3b 0a 0a 09 09 09 7d 20 65 6c 73 65 20 69 66 20  ;.....} else if 
36e40 28 20 74 79 70 65 6f 66 20 76 61 6c 20 3d 3d 3d  ( typeof val ===
36e50 20 22 6e 75 6d 62 65 72 22 20 29 20 7b 0a 09 09   "number" ) {...
36e60 09 09 76 61 6c 20 2b 3d 20 22 22 3b 0a 0a 09 09  ..val += "";....
36e70 09 7d 20 65 6c 73 65 20 69 66 20 28 20 41 72 72  .} else if ( Arr
36e80 61 79 2e 69 73 41 72 72 61 79 28 20 76 61 6c 20  ay.isArray( val 
36e90 29 20 29 20 7b 0a 09 09 09 09 76 61 6c 20 3d 20  ) ) {.....val = 
36ea0 6a 51 75 65 72 79 2e 6d 61 70 28 20 76 61 6c 2c  jQuery.map( val,
36eb0 20 66 75 6e 63 74 69 6f 6e 28 20 76 61 6c 75 65   function( value
36ec0 20 29 20 7b 0a 09 09 09 09 09 72 65 74 75 72 6e   ) {......return
36ed0 20 76 61 6c 75 65 20 3d 3d 20 6e 75 6c 6c 20 3f   value == null ?
36ee0 20 22 22 20 3a 20 76 61 6c 75 65 20 2b 20 22 22   "" : value + ""
36ef0 3b 0a 09 09 09 09 7d 20 29 3b 0a 09 09 09 7d 0a  ;.....} );....}.
36f00 0a 09 09 09 68 6f 6f 6b 73 20 3d 20 6a 51 75 65  ....hooks = jQue
36f10 72 79 2e 76 61 6c 48 6f 6f 6b 73 5b 20 74 68 69  ry.valHooks[ thi
36f20 73 2e 74 79 70 65 20 5d 20 7c 7c 20 6a 51 75 65  s.type ] || jQue
36f30 72 79 2e 76 61 6c 48 6f 6f 6b 73 5b 20 74 68 69  ry.valHooks[ thi
36f40 73 2e 6e 6f 64 65 4e 61 6d 65 2e 74 6f 4c 6f 77  s.nodeName.toLow
36f50 65 72 43 61 73 65 28 29 20 5d 3b 0a 0a 09 09 09  erCase() ];.....
36f60 2f 2f 20 49 66 20 73 65 74 20 72 65 74 75 72 6e  // If set return
36f70 73 20 75 6e 64 65 66 69 6e 65 64 2c 20 66 61 6c  s undefined, fal
36f80 6c 20 62 61 63 6b 20 74 6f 20 6e 6f 72 6d 61 6c  l back to normal
36f90 20 73 65 74 74 69 6e 67 0a 09 09 09 69 66 20 28   setting....if (
36fa0 20 21 68 6f 6f 6b 73 20 7c 7c 20 21 28 20 22 73   !hooks || !( "s
36fb0 65 74 22 20 69 6e 20 68 6f 6f 6b 73 20 29 20 7c  et" in hooks ) |
36fc0 7c 20 68 6f 6f 6b 73 2e 73 65 74 28 20 74 68 69  | hooks.set( thi
36fd0 73 2c 20 76 61 6c 2c 20 22 76 61 6c 75 65 22 20  s, val, "value" 
36fe0 29 20 3d 3d 3d 20 75 6e 64 65 66 69 6e 65 64 20  ) === undefined 
36ff0 29 20 7b 0a 09 09 09 09 74 68 69 73 2e 76 61 6c  ) {.....this.val
37000 75 65 20 3d 20 76 61 6c 3b 0a 09 09 09 7d 0a 09  ue = val;....}..
37010 09 7d 20 29 3b 0a 09 7d 0a 7d 20 29 3b 0a 0a 6a  .} );..}.} );..j
37020 51 75 65 72 79 2e 65 78 74 65 6e 64 28 20 7b 0a  Query.extend( {.
37030 09 76 61 6c 48 6f 6f 6b 73 3a 20 7b 0a 09 09 6f  .valHooks: {...o
37040 70 74 69 6f 6e 3a 20 7b 0a 09 09 09 67 65 74 3a  ption: {....get:
37050 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 20   function( elem 
37060 29 20 7b 0a 0a 09 09 09 09 76 61 72 20 76 61 6c  ) {......var val
37070 20 3d 20 6a 51 75 65 72 79 2e 66 69 6e 64 2e 61   = jQuery.find.a
37080 74 74 72 28 20 65 6c 65 6d 2c 20 22 76 61 6c 75  ttr( elem, "valu
37090 65 22 20 29 3b 0a 09 09 09 09 72 65 74 75 72 6e  e" );.....return
370a0 20 76 61 6c 20 21 3d 20 6e 75 6c 6c 20 3f 0a 09   val != null ?..
370b0 09 09 09 09 76 61 6c 20 3a 0a 0a 09 09 09 09 09  ....val :.......
370c0 2f 2f 20 53 75 70 70 6f 72 74 3a 20 49 45 20 3c  // Support: IE <
370d0 3d 31 30 20 2d 20 31 31 20 6f 6e 6c 79 0a 09 09  =10 - 11 only...
370e0 09 09 09 2f 2f 20 6f 70 74 69 6f 6e 2e 74 65 78  ...// option.tex
370f0 74 20 74 68 72 6f 77 73 20 65 78 63 65 70 74 69  t throws excepti
37100 6f 6e 73 20 28 23 31 34 36 38 36 2c 20 23 31 34  ons (#14686, #14
37110 38 35 38 29 0a 09 09 09 09 09 2f 2f 20 53 74 72  858)......// Str
37120 69 70 20 61 6e 64 20 63 6f 6c 6c 61 70 73 65 20  ip and collapse 
37130 77 68 69 74 65 73 70 61 63 65 0a 09 09 09 09 09  whitespace......
37140 2f 2f 20 68 74 74 70 73 3a 2f 2f 68 74 6d 6c 2e  // https://html.
37150 73 70 65 63 2e 77 68 61 74 77 67 2e 6f 72 67 2f  spec.whatwg.org/
37160 23 73 74 72 69 70 2d 61 6e 64 2d 63 6f 6c 6c 61  #strip-and-colla
37170 70 73 65 2d 77 68 69 74 65 73 70 61 63 65 0a 09  pse-whitespace..
37180 09 09 09 09 73 74 72 69 70 41 6e 64 43 6f 6c 6c  ....stripAndColl
37190 61 70 73 65 28 20 6a 51 75 65 72 79 2e 74 65 78  apse( jQuery.tex
371a0 74 28 20 65 6c 65 6d 20 29 20 29 3b 0a 09 09 09  t( elem ) );....
371b0 7d 0a 09 09 7d 2c 0a 09 09 73 65 6c 65 63 74 3a  }...},...select:
371c0 20 7b 0a 09 09 09 67 65 74 3a 20 66 75 6e 63 74   {....get: funct
371d0 69 6f 6e 28 20 65 6c 65 6d 20 29 20 7b 0a 09 09  ion( elem ) {...
371e0 09 09 76 61 72 20 76 61 6c 75 65 2c 20 6f 70 74  ..var value, opt
371f0 69 6f 6e 2c 20 69 2c 0a 09 09 09 09 09 6f 70 74  ion, i,......opt
37200 69 6f 6e 73 20 3d 20 65 6c 65 6d 2e 6f 70 74 69  ions = elem.opti
37210 6f 6e 73 2c 0a 09 09 09 09 09 69 6e 64 65 78 20  ons,......index 
37220 3d 20 65 6c 65 6d 2e 73 65 6c 65 63 74 65 64 49  = elem.selectedI
37230 6e 64 65 78 2c 0a 09 09 09 09 09 6f 6e 65 20 3d  ndex,......one =
37240 20 65 6c 65 6d 2e 74 79 70 65 20 3d 3d 3d 20 22   elem.type === "
37250 73 65 6c 65 63 74 2d 6f 6e 65 22 2c 0a 09 09 09  select-one",....
37260 09 09 76 61 6c 75 65 73 20 3d 20 6f 6e 65 20 3f  ..values = one ?
37270 20 6e 75 6c 6c 20 3a 20 5b 5d 2c 0a 09 09 09 09   null : [],.....
37280 09 6d 61 78 20 3d 20 6f 6e 65 20 3f 20 69 6e 64  .max = one ? ind
37290 65 78 20 2b 20 31 20 3a 20 6f 70 74 69 6f 6e 73  ex + 1 : options
372a0 2e 6c 65 6e 67 74 68 3b 0a 0a 09 09 09 09 69 66  .length;......if
372b0 20 28 20 69 6e 64 65 78 20 3c 20 30 20 29 20 7b   ( index < 0 ) {
372c0 0a 09 09 09 09 09 69 20 3d 20 6d 61 78 3b 0a 0a  ......i = max;..
372d0 09 09 09 09 7d 20 65 6c 73 65 20 7b 0a 09 09 09  ....} else {....
372e0 09 09 69 20 3d 20 6f 6e 65 20 3f 20 69 6e 64 65  ..i = one ? inde
372f0 78 20 3a 20 30 3b 0a 09 09 09 09 7d 0a 0a 09 09  x : 0;.....}....
37300 09 09 2f 2f 20 4c 6f 6f 70 20 74 68 72 6f 75 67  ..// Loop throug
37310 68 20 61 6c 6c 20 74 68 65 20 73 65 6c 65 63 74  h all the select
37320 65 64 20 6f 70 74 69 6f 6e 73 0a 09 09 09 09 66  ed options.....f
37330 6f 72 20 28 20 3b 20 69 20 3c 20 6d 61 78 3b 20  or ( ; i < max; 
37340 69 2b 2b 20 29 20 7b 0a 09 09 09 09 09 6f 70 74  i++ ) {......opt
37350 69 6f 6e 20 3d 20 6f 70 74 69 6f 6e 73 5b 20 69  ion = options[ i
37360 20 5d 3b 0a 0a 09 09 09 09 09 2f 2f 20 53 75 70   ];.......// Sup
37370 70 6f 72 74 3a 20 49 45 20 3c 3d 39 20 6f 6e 6c  port: IE <=9 onl
37380 79 0a 09 09 09 09 09 2f 2f 20 49 45 38 2d 39 20  y......// IE8-9 
37390 64 6f 65 73 6e 27 74 20 75 70 64 61 74 65 20 73  doesn't update s
373a0 65 6c 65 63 74 65 64 20 61 66 74 65 72 20 66 6f  elected after fo
373b0 72 6d 20 72 65 73 65 74 20 28 23 32 35 35 31 29  rm reset (#2551)
373c0 0a 09 09 09 09 09 69 66 20 28 20 28 20 6f 70 74  ......if ( ( opt
373d0 69 6f 6e 2e 73 65 6c 65 63 74 65 64 20 7c 7c 20  ion.selected || 
373e0 69 20 3d 3d 3d 20 69 6e 64 65 78 20 29 20 26 26  i === index ) &&
373f0 0a 0a 09 09 09 09 09 09 09 2f 2f 20 44 6f 6e 27  .........// Don'
37400 74 20 72 65 74 75 72 6e 20 6f 70 74 69 6f 6e 73  t return options
37410 20 74 68 61 74 20 61 72 65 20 64 69 73 61 62 6c   that are disabl
37420 65 64 20 6f 72 20 69 6e 20 61 20 64 69 73 61 62  ed or in a disab
37430 6c 65 64 20 6f 70 74 67 72 6f 75 70 0a 09 09 09  led optgroup....
37440 09 09 09 09 21 6f 70 74 69 6f 6e 2e 64 69 73 61  ....!option.disa
37450 62 6c 65 64 20 26 26 0a 09 09 09 09 09 09 09 28  bled &&........(
37460 20 21 6f 70 74 69 6f 6e 2e 70 61 72 65 6e 74 4e   !option.parentN
37470 6f 64 65 2e 64 69 73 61 62 6c 65 64 20 7c 7c 0a  ode.disabled ||.
37480 09 09 09 09 09 09 09 09 21 6e 6f 64 65 4e 61 6d  ........!nodeNam
37490 65 28 20 6f 70 74 69 6f 6e 2e 70 61 72 65 6e 74  e( option.parent
374a0 4e 6f 64 65 2c 20 22 6f 70 74 67 72 6f 75 70 22  Node, "optgroup"
374b0 20 29 20 29 20 29 20 7b 0a 0a 09 09 09 09 09 09   ) ) ) {........
374c0 2f 2f 20 47 65 74 20 74 68 65 20 73 70 65 63 69  // Get the speci
374d0 66 69 63 20 76 61 6c 75 65 20 66 6f 72 20 74 68  fic value for th
374e0 65 20 6f 70 74 69 6f 6e 0a 09 09 09 09 09 09 76  e option.......v
374f0 61 6c 75 65 20 3d 20 6a 51 75 65 72 79 28 20 6f  alue = jQuery( o
37500 70 74 69 6f 6e 20 29 2e 76 61 6c 28 29 3b 0a 0a  ption ).val();..
37510 09 09 09 09 09 09 2f 2f 20 57 65 20 64 6f 6e 27  ......// We don'
37520 74 20 6e 65 65 64 20 61 6e 20 61 72 72 61 79 20  t need an array 
37530 66 6f 72 20 6f 6e 65 20 73 65 6c 65 63 74 73 0a  for one selects.
37540 09 09 09 09 09 09 69 66 20 28 20 6f 6e 65 20 29  ......if ( one )
37550 20 7b 0a 09 09 09 09 09 09 09 72 65 74 75 72 6e   {........return
37560 20 76 61 6c 75 65 3b 0a 09 09 09 09 09 09 7d 0a   value;.......}.
37570 0a 09 09 09 09 09 09 2f 2f 20 4d 75 6c 74 69 2d  .......// Multi-
37580 53 65 6c 65 63 74 73 20 72 65 74 75 72 6e 20 61  Selects return a
37590 6e 20 61 72 72 61 79 0a 09 09 09 09 09 09 76 61  n array.......va
375a0 6c 75 65 73 2e 70 75 73 68 28 20 76 61 6c 75 65  lues.push( value
375b0 20 29 3b 0a 09 09 09 09 09 7d 0a 09 09 09 09 7d   );......}.....}
375c0 0a 0a 09 09 09 09 72 65 74 75 72 6e 20 76 61 6c  ......return val
375d0 75 65 73 3b 0a 09 09 09 7d 2c 0a 0a 09 09 09 73  ues;....},.....s
375e0 65 74 3a 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c  et: function( el
375f0 65 6d 2c 20 76 61 6c 75 65 20 29 20 7b 0a 09 09  em, value ) {...
37600 09 09 76 61 72 20 6f 70 74 69 6f 6e 53 65 74 2c  ..var optionSet,
37610 20 6f 70 74 69 6f 6e 2c 0a 09 09 09 09 09 6f 70   option,......op
37620 74 69 6f 6e 73 20 3d 20 65 6c 65 6d 2e 6f 70 74  tions = elem.opt
37630 69 6f 6e 73 2c 0a 09 09 09 09 09 76 61 6c 75 65  ions,......value
37640 73 20 3d 20 6a 51 75 65 72 79 2e 6d 61 6b 65 41  s = jQuery.makeA
37650 72 72 61 79 28 20 76 61 6c 75 65 20 29 2c 0a 09  rray( value ),..
37660 09 09 09 09 69 20 3d 20 6f 70 74 69 6f 6e 73 2e  ....i = options.
37670 6c 65 6e 67 74 68 3b 0a 0a 09 09 09 09 77 68 69  length;......whi
37680 6c 65 20 28 20 69 2d 2d 20 29 20 7b 0a 09 09 09  le ( i-- ) {....
37690 09 09 6f 70 74 69 6f 6e 20 3d 20 6f 70 74 69 6f  ..option = optio
376a0 6e 73 5b 20 69 20 5d 3b 0a 0a 09 09 09 09 09 2f  ns[ i ];......./
376b0 2a 20 65 73 6c 69 6e 74 2d 64 69 73 61 62 6c 65  * eslint-disable
376c0 20 6e 6f 2d 63 6f 6e 64 2d 61 73 73 69 67 6e 20   no-cond-assign 
376d0 2a 2f 0a 0a 09 09 09 09 09 69 66 20 28 20 6f 70  */.......if ( op
376e0 74 69 6f 6e 2e 73 65 6c 65 63 74 65 64 20 3d 0a  tion.selected =.
376f0 09 09 09 09 09 09 6a 51 75 65 72 79 2e 69 6e 41  ......jQuery.inA
37700 72 72 61 79 28 20 6a 51 75 65 72 79 2e 76 61 6c  rray( jQuery.val
37710 48 6f 6f 6b 73 2e 6f 70 74 69 6f 6e 2e 67 65 74  Hooks.option.get
37720 28 20 6f 70 74 69 6f 6e 20 29 2c 20 76 61 6c 75  ( option ), valu
37730 65 73 20 29 20 3e 20 2d 31 0a 09 09 09 09 09 29  es ) > -1......)
37740 20 7b 0a 09 09 09 09 09 09 6f 70 74 69 6f 6e 53   {.......optionS
37750 65 74 20 3d 20 74 72 75 65 3b 0a 09 09 09 09 09  et = true;......
37760 7d 0a 0a 09 09 09 09 09 2f 2a 20 65 73 6c 69 6e  }......./* eslin
37770 74 2d 65 6e 61 62 6c 65 20 6e 6f 2d 63 6f 6e 64  t-enable no-cond
37780 2d 61 73 73 69 67 6e 20 2a 2f 0a 09 09 09 09 7d  -assign */.....}
37790 0a 0a 09 09 09 09 2f 2f 20 46 6f 72 63 65 20 62  ......// Force b
377a0 72 6f 77 73 65 72 73 20 74 6f 20 62 65 68 61 76  rowsers to behav
377b0 65 20 63 6f 6e 73 69 73 74 65 6e 74 6c 79 20 77  e consistently w
377c0 68 65 6e 20 6e 6f 6e 2d 6d 61 74 63 68 69 6e 67  hen non-matching
377d0 20 76 61 6c 75 65 20 69 73 20 73 65 74 0a 09 09   value is set...
377e0 09 09 69 66 20 28 20 21 6f 70 74 69 6f 6e 53 65  ..if ( !optionSe
377f0 74 20 29 20 7b 0a 09 09 09 09 09 65 6c 65 6d 2e  t ) {......elem.
37800 73 65 6c 65 63 74 65 64 49 6e 64 65 78 20 3d 20  selectedIndex = 
37810 2d 31 3b 0a 09 09 09 09 7d 0a 09 09 09 09 72 65  -1;.....}.....re
37820 74 75 72 6e 20 76 61 6c 75 65 73 3b 0a 09 09 09  turn values;....
37830 7d 0a 09 09 7d 0a 09 7d 0a 7d 20 29 3b 0a 0a 2f  }...}..}.} );../
37840 2f 20 52 61 64 69 6f 73 20 61 6e 64 20 63 68 65  / Radios and che
37850 63 6b 62 6f 78 65 73 20 67 65 74 74 65 72 2f 73  ckboxes getter/s
37860 65 74 74 65 72 0a 6a 51 75 65 72 79 2e 65 61 63  etter.jQuery.eac
37870 68 28 20 5b 20 22 72 61 64 69 6f 22 2c 20 22 63  h( [ "radio", "c
37880 68 65 63 6b 62 6f 78 22 20 5d 2c 20 66 75 6e 63  heckbox" ], func
37890 74 69 6f 6e 28 29 20 7b 0a 09 6a 51 75 65 72 79  tion() {..jQuery
378a0 2e 76 61 6c 48 6f 6f 6b 73 5b 20 74 68 69 73 20  .valHooks[ this 
378b0 5d 20 3d 20 7b 0a 09 09 73 65 74 3a 20 66 75 6e  ] = {...set: fun
378c0 63 74 69 6f 6e 28 20 65 6c 65 6d 2c 20 76 61 6c  ction( elem, val
378d0 75 65 20 29 20 7b 0a 09 09 09 69 66 20 28 20 41  ue ) {....if ( A
378e0 72 72 61 79 2e 69 73 41 72 72 61 79 28 20 76 61  rray.isArray( va
378f0 6c 75 65 20 29 20 29 20 7b 0a 09 09 09 09 72 65  lue ) ) {.....re
37900 74 75 72 6e 20 28 20 65 6c 65 6d 2e 63 68 65 63  turn ( elem.chec
37910 6b 65 64 20 3d 20 6a 51 75 65 72 79 2e 69 6e 41  ked = jQuery.inA
37920 72 72 61 79 28 20 6a 51 75 65 72 79 28 20 65 6c  rray( jQuery( el
37930 65 6d 20 29 2e 76 61 6c 28 29 2c 20 76 61 6c 75  em ).val(), valu
37940 65 20 29 20 3e 20 2d 31 20 29 3b 0a 09 09 09 7d  e ) > -1 );....}
37950 0a 09 09 7d 0a 09 7d 3b 0a 09 69 66 20 28 20 21  ...}..};..if ( !
37960 73 75 70 70 6f 72 74 2e 63 68 65 63 6b 4f 6e 20  support.checkOn 
37970 29 20 7b 0a 09 09 6a 51 75 65 72 79 2e 76 61 6c  ) {...jQuery.val
37980 48 6f 6f 6b 73 5b 20 74 68 69 73 20 5d 2e 67 65  Hooks[ this ].ge
37990 74 20 3d 20 66 75 6e 63 74 69 6f 6e 28 20 65 6c  t = function( el
379a0 65 6d 20 29 20 7b 0a 09 09 09 72 65 74 75 72 6e  em ) {....return
379b0 20 65 6c 65 6d 2e 67 65 74 41 74 74 72 69 62 75   elem.getAttribu
379c0 74 65 28 20 22 76 61 6c 75 65 22 20 29 20 3d 3d  te( "value" ) ==
379d0 3d 20 6e 75 6c 6c 20 3f 20 22 6f 6e 22 20 3a 20  = null ? "on" : 
379e0 65 6c 65 6d 2e 76 61 6c 75 65 3b 0a 09 09 7d 3b  elem.value;...};
379f0 0a 09 7d 0a 7d 20 29 3b 0a 0a 0a 0a 0a 2f 2f 20  ..}.} );.....// 
37a00 52 65 74 75 72 6e 20 6a 51 75 65 72 79 20 66 6f  Return jQuery fo
37a10 72 20 61 74 74 72 69 62 75 74 65 73 2d 6f 6e 6c  r attributes-onl
37a20 79 20 69 6e 63 6c 75 73 69 6f 6e 0a 0a 0a 73 75  y inclusion...su
37a30 70 70 6f 72 74 2e 66 6f 63 75 73 69 6e 20 3d 20  pport.focusin = 
37a40 22 6f 6e 66 6f 63 75 73 69 6e 22 20 69 6e 20 77  "onfocusin" in w
37a50 69 6e 64 6f 77 3b 0a 0a 0a 76 61 72 20 72 66 6f  indow;...var rfo
37a60 63 75 73 4d 6f 72 70 68 20 3d 20 2f 5e 28 3f 3a  cusMorph = /^(?:
37a70 66 6f 63 75 73 69 6e 66 6f 63 75 73 7c 66 6f 63  focusinfocus|foc
37a80 75 73 6f 75 74 62 6c 75 72 29 24 2f 2c 0a 09 73  usoutblur)$/,..s
37a90 74 6f 70 50 72 6f 70 61 67 61 74 69 6f 6e 43 61  topPropagationCa
37aa0 6c 6c 62 61 63 6b 20 3d 20 66 75 6e 63 74 69 6f  llback = functio
37ab0 6e 28 20 65 20 29 20 7b 0a 09 09 65 2e 73 74 6f  n( e ) {...e.sto
37ac0 70 50 72 6f 70 61 67 61 74 69 6f 6e 28 29 3b 0a  pPropagation();.
37ad0 09 7d 3b 0a 0a 6a 51 75 65 72 79 2e 65 78 74 65  .};..jQuery.exte
37ae0 6e 64 28 20 6a 51 75 65 72 79 2e 65 76 65 6e 74  nd( jQuery.event
37af0 2c 20 7b 0a 0a 09 74 72 69 67 67 65 72 3a 20 66  , {...trigger: f
37b00 75 6e 63 74 69 6f 6e 28 20 65 76 65 6e 74 2c 20  unction( event, 
37b10 64 61 74 61 2c 20 65 6c 65 6d 2c 20 6f 6e 6c 79  data, elem, only
37b20 48 61 6e 64 6c 65 72 73 20 29 20 7b 0a 0a 09 09  Handlers ) {....
37b30 76 61 72 20 69 2c 20 63 75 72 2c 20 74 6d 70 2c  var i, cur, tmp,
37b40 20 62 75 62 62 6c 65 54 79 70 65 2c 20 6f 6e 74   bubbleType, ont
37b50 79 70 65 2c 20 68 61 6e 64 6c 65 2c 20 73 70 65  ype, handle, spe
37b60 63 69 61 6c 2c 20 6c 61 73 74 45 6c 65 6d 65 6e  cial, lastElemen
37b70 74 2c 0a 09 09 09 65 76 65 6e 74 50 61 74 68 20  t,....eventPath 
37b80 3d 20 5b 20 65 6c 65 6d 20 7c 7c 20 64 6f 63 75  = [ elem || docu
37b90 6d 65 6e 74 20 5d 2c 0a 09 09 09 74 79 70 65 20  ment ],....type 
37ba0 3d 20 68 61 73 4f 77 6e 2e 63 61 6c 6c 28 20 65  = hasOwn.call( e
37bb0 76 65 6e 74 2c 20 22 74 79 70 65 22 20 29 20 3f  vent, "type" ) ?
37bc0 20 65 76 65 6e 74 2e 74 79 70 65 20 3a 20 65 76   event.type : ev
37bd0 65 6e 74 2c 0a 09 09 09 6e 61 6d 65 73 70 61 63  ent,....namespac
37be0 65 73 20 3d 20 68 61 73 4f 77 6e 2e 63 61 6c 6c  es = hasOwn.call
37bf0 28 20 65 76 65 6e 74 2c 20 22 6e 61 6d 65 73 70  ( event, "namesp
37c00 61 63 65 22 20 29 20 3f 20 65 76 65 6e 74 2e 6e  ace" ) ? event.n
37c10 61 6d 65 73 70 61 63 65 2e 73 70 6c 69 74 28 20  amespace.split( 
37c20 22 2e 22 20 29 20 3a 20 5b 5d 3b 0a 0a 09 09 63  "." ) : [];....c
37c30 75 72 20 3d 20 6c 61 73 74 45 6c 65 6d 65 6e 74  ur = lastElement
37c40 20 3d 20 74 6d 70 20 3d 20 65 6c 65 6d 20 3d 20   = tmp = elem = 
37c50 65 6c 65 6d 20 7c 7c 20 64 6f 63 75 6d 65 6e 74  elem || document
37c60 3b 0a 0a 09 09 2f 2f 20 44 6f 6e 27 74 20 64 6f  ;....// Don't do
37c70 20 65 76 65 6e 74 73 20 6f 6e 20 74 65 78 74 20   events on text 
37c80 61 6e 64 20 63 6f 6d 6d 65 6e 74 20 6e 6f 64 65  and comment node
37c90 73 0a 09 09 69 66 20 28 20 65 6c 65 6d 2e 6e 6f  s...if ( elem.no
37ca0 64 65 54 79 70 65 20 3d 3d 3d 20 33 20 7c 7c 20  deType === 3 || 
37cb0 65 6c 65 6d 2e 6e 6f 64 65 54 79 70 65 20 3d 3d  elem.nodeType ==
37cc0 3d 20 38 20 29 20 7b 0a 09 09 09 72 65 74 75 72  = 8 ) {....retur
37cd0 6e 3b 0a 09 09 7d 0a 0a 09 09 2f 2f 20 66 6f 63  n;...}....// foc
37ce0 75 73 2f 62 6c 75 72 20 6d 6f 72 70 68 73 20 74  us/blur morphs t
37cf0 6f 20 66 6f 63 75 73 69 6e 2f 6f 75 74 3b 20 65  o focusin/out; e
37d00 6e 73 75 72 65 20 77 65 27 72 65 20 6e 6f 74 20  nsure we're not 
37d10 66 69 72 69 6e 67 20 74 68 65 6d 20 72 69 67 68  firing them righ
37d20 74 20 6e 6f 77 0a 09 09 69 66 20 28 20 72 66 6f  t now...if ( rfo
37d30 63 75 73 4d 6f 72 70 68 2e 74 65 73 74 28 20 74  cusMorph.test( t
37d40 79 70 65 20 2b 20 6a 51 75 65 72 79 2e 65 76 65  ype + jQuery.eve
37d50 6e 74 2e 74 72 69 67 67 65 72 65 64 20 29 20 29  nt.triggered ) )
37d60 20 7b 0a 09 09 09 72 65 74 75 72 6e 3b 0a 09 09   {....return;...
37d70 7d 0a 0a 09 09 69 66 20 28 20 74 79 70 65 2e 69  }....if ( type.i
37d80 6e 64 65 78 4f 66 28 20 22 2e 22 20 29 20 3e 20  ndexOf( "." ) > 
37d90 2d 31 20 29 20 7b 0a 0a 09 09 09 2f 2f 20 4e 61  -1 ) {.....// Na
37da0 6d 65 73 70 61 63 65 64 20 74 72 69 67 67 65 72  mespaced trigger
37db0 3b 20 63 72 65 61 74 65 20 61 20 72 65 67 65 78  ; create a regex
37dc0 70 20 74 6f 20 6d 61 74 63 68 20 65 76 65 6e 74  p to match event
37dd0 20 74 79 70 65 20 69 6e 20 68 61 6e 64 6c 65 28   type in handle(
37de0 29 0a 09 09 09 6e 61 6d 65 73 70 61 63 65 73 20  )....namespaces 
37df0 3d 20 74 79 70 65 2e 73 70 6c 69 74 28 20 22 2e  = type.split( ".
37e00 22 20 29 3b 0a 09 09 09 74 79 70 65 20 3d 20 6e  " );....type = n
37e10 61 6d 65 73 70 61 63 65 73 2e 73 68 69 66 74 28  amespaces.shift(
37e20 29 3b 0a 09 09 09 6e 61 6d 65 73 70 61 63 65 73  );....namespaces
37e30 2e 73 6f 72 74 28 29 3b 0a 09 09 7d 0a 09 09 6f  .sort();...}...o
37e40 6e 74 79 70 65 20 3d 20 74 79 70 65 2e 69 6e 64  ntype = type.ind
37e50 65 78 4f 66 28 20 22 3a 22 20 29 20 3c 20 30 20  exOf( ":" ) < 0 
37e60 26 26 20 22 6f 6e 22 20 2b 20 74 79 70 65 3b 0a  && "on" + type;.
37e70 0a 09 09 2f 2f 20 43 61 6c 6c 65 72 20 63 61 6e  ...// Caller can
37e80 20 70 61 73 73 20 69 6e 20 61 20 6a 51 75 65 72   pass in a jQuer
37e90 79 2e 45 76 65 6e 74 20 6f 62 6a 65 63 74 2c 20  y.Event object, 
37ea0 4f 62 6a 65 63 74 2c 20 6f 72 20 6a 75 73 74 20  Object, or just 
37eb0 61 6e 20 65 76 65 6e 74 20 74 79 70 65 20 73 74  an event type st
37ec0 72 69 6e 67 0a 09 09 65 76 65 6e 74 20 3d 20 65  ring...event = e
37ed0 76 65 6e 74 5b 20 6a 51 75 65 72 79 2e 65 78 70  vent[ jQuery.exp
37ee0 61 6e 64 6f 20 5d 20 3f 0a 09 09 09 65 76 65 6e  ando ] ?....even
37ef0 74 20 3a 0a 09 09 09 6e 65 77 20 6a 51 75 65 72  t :....new jQuer
37f00 79 2e 45 76 65 6e 74 28 20 74 79 70 65 2c 20 74  y.Event( type, t
37f10 79 70 65 6f 66 20 65 76 65 6e 74 20 3d 3d 3d 20  ypeof event === 
37f20 22 6f 62 6a 65 63 74 22 20 26 26 20 65 76 65 6e  "object" && even
37f30 74 20 29 3b 0a 0a 09 09 2f 2f 20 54 72 69 67 67  t );....// Trigg
37f40 65 72 20 62 69 74 6d 61 73 6b 3a 20 26 20 31 20  er bitmask: & 1 
37f50 66 6f 72 20 6e 61 74 69 76 65 20 68 61 6e 64 6c  for native handl
37f60 65 72 73 3b 20 26 20 32 20 66 6f 72 20 6a 51 75  ers; & 2 for jQu
37f70 65 72 79 20 28 61 6c 77 61 79 73 20 74 72 75 65  ery (always true
37f80 29 0a 09 09 65 76 65 6e 74 2e 69 73 54 72 69 67  )...event.isTrig
37f90 67 65 72 20 3d 20 6f 6e 6c 79 48 61 6e 64 6c 65  ger = onlyHandle
37fa0 72 73 20 3f 20 32 20 3a 20 33 3b 0a 09 09 65 76  rs ? 2 : 3;...ev
37fb0 65 6e 74 2e 6e 61 6d 65 73 70 61 63 65 20 3d 20  ent.namespace = 
37fc0 6e 61 6d 65 73 70 61 63 65 73 2e 6a 6f 69 6e 28  namespaces.join(
37fd0 20 22 2e 22 20 29 3b 0a 09 09 65 76 65 6e 74 2e   "." );...event.
37fe0 72 6e 61 6d 65 73 70 61 63 65 20 3d 20 65 76 65  rnamespace = eve
37ff0 6e 74 2e 6e 61 6d 65 73 70 61 63 65 20 3f 0a 09  nt.namespace ?..
38000 09 09 6e 65 77 20 52 65 67 45 78 70 28 20 22 28  ..new RegExp( "(
38010 5e 7c 5c 5c 2e 29 22 20 2b 20 6e 61 6d 65 73 70  ^|\\.)" + namesp
38020 61 63 65 73 2e 6a 6f 69 6e 28 20 22 5c 5c 2e 28  aces.join( "\\.(
38030 3f 3a 2e 2a 5c 5c 2e 7c 29 22 20 29 20 2b 20 22  ?:.*\\.|)" ) + "
38040 28 5c 5c 2e 7c 24 29 22 20 29 20 3a 0a 09 09 09  (\\.|$)" ) :....
38050 6e 75 6c 6c 3b 0a 0a 09 09 2f 2f 20 43 6c 65 61  null;....// Clea
38060 6e 20 75 70 20 74 68 65 20 65 76 65 6e 74 20 69  n up the event i
38070 6e 20 63 61 73 65 20 69 74 20 69 73 20 62 65 69  n case it is bei
38080 6e 67 20 72 65 75 73 65 64 0a 09 09 65 76 65 6e  ng reused...even
38090 74 2e 72 65 73 75 6c 74 20 3d 20 75 6e 64 65 66  t.result = undef
380a0 69 6e 65 64 3b 0a 09 09 69 66 20 28 20 21 65 76  ined;...if ( !ev
380b0 65 6e 74 2e 74 61 72 67 65 74 20 29 20 7b 0a 09  ent.target ) {..
380c0 09 09 65 76 65 6e 74 2e 74 61 72 67 65 74 20 3d  ..event.target =
380d0 20 65 6c 65 6d 3b 0a 09 09 7d 0a 0a 09 09 2f 2f   elem;...}....//
380e0 20 43 6c 6f 6e 65 20 61 6e 79 20 69 6e 63 6f 6d   Clone any incom
380f0 69 6e 67 20 64 61 74 61 20 61 6e 64 20 70 72 65  ing data and pre
38100 70 65 6e 64 20 74 68 65 20 65 76 65 6e 74 2c 20  pend the event, 
38110 63 72 65 61 74 69 6e 67 20 74 68 65 20 68 61 6e  creating the han
38120 64 6c 65 72 20 61 72 67 20 6c 69 73 74 0a 09 09  dler arg list...
38130 64 61 74 61 20 3d 20 64 61 74 61 20 3d 3d 20 6e  data = data == n
38140 75 6c 6c 20 3f 0a 09 09 09 5b 20 65 76 65 6e 74  ull ?....[ event
38150 20 5d 20 3a 0a 09 09 09 6a 51 75 65 72 79 2e 6d   ] :....jQuery.m
38160 61 6b 65 41 72 72 61 79 28 20 64 61 74 61 2c 20  akeArray( data, 
38170 5b 20 65 76 65 6e 74 20 5d 20 29 3b 0a 0a 09 09  [ event ] );....
38180 2f 2f 20 41 6c 6c 6f 77 20 73 70 65 63 69 61 6c  // Allow special
38190 20 65 76 65 6e 74 73 20 74 6f 20 64 72 61 77 20   events to draw 
381a0 6f 75 74 73 69 64 65 20 74 68 65 20 6c 69 6e 65  outside the line
381b0 73 0a 09 09 73 70 65 63 69 61 6c 20 3d 20 6a 51  s...special = jQ
381c0 75 65 72 79 2e 65 76 65 6e 74 2e 73 70 65 63 69  uery.event.speci
381d0 61 6c 5b 20 74 79 70 65 20 5d 20 7c 7c 20 7b 7d  al[ type ] || {}
381e0 3b 0a 09 09 69 66 20 28 20 21 6f 6e 6c 79 48 61  ;...if ( !onlyHa
381f0 6e 64 6c 65 72 73 20 26 26 20 73 70 65 63 69 61  ndlers && specia
38200 6c 2e 74 72 69 67 67 65 72 20 26 26 20 73 70 65  l.trigger && spe
38210 63 69 61 6c 2e 74 72 69 67 67 65 72 2e 61 70 70  cial.trigger.app
38220 6c 79 28 20 65 6c 65 6d 2c 20 64 61 74 61 20 29  ly( elem, data )
38230 20 3d 3d 3d 20 66 61 6c 73 65 20 29 20 7b 0a 09   === false ) {..
38240 09 09 72 65 74 75 72 6e 3b 0a 09 09 7d 0a 0a 09  ..return;...}...
38250 09 2f 2f 20 44 65 74 65 72 6d 69 6e 65 20 65 76  .// Determine ev
38260 65 6e 74 20 70 72 6f 70 61 67 61 74 69 6f 6e 20  ent propagation 
38270 70 61 74 68 20 69 6e 20 61 64 76 61 6e 63 65 2c  path in advance,
38280 20 70 65 72 20 57 33 43 20 65 76 65 6e 74 73 20   per W3C events 
38290 73 70 65 63 20 28 23 39 39 35 31 29 0a 09 09 2f  spec (#9951).../
382a0 2f 20 42 75 62 62 6c 65 20 75 70 20 74 6f 20 64  / Bubble up to d
382b0 6f 63 75 6d 65 6e 74 2c 20 74 68 65 6e 20 74 6f  ocument, then to
382c0 20 77 69 6e 64 6f 77 3b 20 77 61 74 63 68 20 66   window; watch f
382d0 6f 72 20 61 20 67 6c 6f 62 61 6c 20 6f 77 6e 65  or a global owne
382e0 72 44 6f 63 75 6d 65 6e 74 20 76 61 72 20 28 23  rDocument var (#
382f0 39 37 32 34 29 0a 09 09 69 66 20 28 20 21 6f 6e  9724)...if ( !on
38300 6c 79 48 61 6e 64 6c 65 72 73 20 26 26 20 21 73  lyHandlers && !s
38310 70 65 63 69 61 6c 2e 6e 6f 42 75 62 62 6c 65 20  pecial.noBubble 
38320 26 26 20 21 69 73 57 69 6e 64 6f 77 28 20 65 6c  && !isWindow( el
38330 65 6d 20 29 20 29 20 7b 0a 0a 09 09 09 62 75 62  em ) ) {.....bub
38340 62 6c 65 54 79 70 65 20 3d 20 73 70 65 63 69 61  bleType = specia
38350 6c 2e 64 65 6c 65 67 61 74 65 54 79 70 65 20 7c  l.delegateType |
38360 7c 20 74 79 70 65 3b 0a 09 09 09 69 66 20 28 20  | type;....if ( 
38370 21 72 66 6f 63 75 73 4d 6f 72 70 68 2e 74 65 73  !rfocusMorph.tes
38380 74 28 20 62 75 62 62 6c 65 54 79 70 65 20 2b 20  t( bubbleType + 
38390 74 79 70 65 20 29 20 29 20 7b 0a 09 09 09 09 63  type ) ) {.....c
383a0 75 72 20 3d 20 63 75 72 2e 70 61 72 65 6e 74 4e  ur = cur.parentN
383b0 6f 64 65 3b 0a 09 09 09 7d 0a 09 09 09 66 6f 72  ode;....}....for
383c0 20 28 20 3b 20 63 75 72 3b 20 63 75 72 20 3d 20   ( ; cur; cur = 
383d0 63 75 72 2e 70 61 72 65 6e 74 4e 6f 64 65 20 29  cur.parentNode )
383e0 20 7b 0a 09 09 09 09 65 76 65 6e 74 50 61 74 68   {.....eventPath
383f0 2e 70 75 73 68 28 20 63 75 72 20 29 3b 0a 09 09  .push( cur );...
38400 09 09 74 6d 70 20 3d 20 63 75 72 3b 0a 09 09 09  ..tmp = cur;....
38410 7d 0a 0a 09 09 09 2f 2f 20 4f 6e 6c 79 20 61 64  }.....// Only ad
38420 64 20 77 69 6e 64 6f 77 20 69 66 20 77 65 20 67  d window if we g
38430 6f 74 20 74 6f 20 64 6f 63 75 6d 65 6e 74 20 28  ot to document (
38440 65 2e 67 2e 2c 20 6e 6f 74 20 70 6c 61 69 6e 20  e.g., not plain 
38450 6f 62 6a 20 6f 72 20 64 65 74 61 63 68 65 64 20  obj or detached 
38460 44 4f 4d 29 0a 09 09 09 69 66 20 28 20 74 6d 70  DOM)....if ( tmp
38470 20 3d 3d 3d 20 28 20 65 6c 65 6d 2e 6f 77 6e 65   === ( elem.owne
38480 72 44 6f 63 75 6d 65 6e 74 20 7c 7c 20 64 6f 63  rDocument || doc
38490 75 6d 65 6e 74 20 29 20 29 20 7b 0a 09 09 09 09  ument ) ) {.....
384a0 65 76 65 6e 74 50 61 74 68 2e 70 75 73 68 28 20  eventPath.push( 
384b0 74 6d 70 2e 64 65 66 61 75 6c 74 56 69 65 77 20  tmp.defaultView 
384c0 7c 7c 20 74 6d 70 2e 70 61 72 65 6e 74 57 69 6e  || tmp.parentWin
384d0 64 6f 77 20 7c 7c 20 77 69 6e 64 6f 77 20 29 3b  dow || window );
384e0 0a 09 09 09 7d 0a 09 09 7d 0a 0a 09 09 2f 2f 20  ....}...}....// 
384f0 46 69 72 65 20 68 61 6e 64 6c 65 72 73 20 6f 6e  Fire handlers on
38500 20 74 68 65 20 65 76 65 6e 74 20 70 61 74 68 0a   the event path.
38510 09 09 69 20 3d 20 30 3b 0a 09 09 77 68 69 6c 65  ..i = 0;...while
38520 20 28 20 28 20 63 75 72 20 3d 20 65 76 65 6e 74   ( ( cur = event
38530 50 61 74 68 5b 20 69 2b 2b 20 5d 20 29 20 26 26  Path[ i++ ] ) &&
38540 20 21 65 76 65 6e 74 2e 69 73 50 72 6f 70 61 67   !event.isPropag
38550 61 74 69 6f 6e 53 74 6f 70 70 65 64 28 29 20 29  ationStopped() )
38560 20 7b 0a 09 09 09 6c 61 73 74 45 6c 65 6d 65 6e   {....lastElemen
38570 74 20 3d 20 63 75 72 3b 0a 09 09 09 65 76 65 6e  t = cur;....even
38580 74 2e 74 79 70 65 20 3d 20 69 20 3e 20 31 20 3f  t.type = i > 1 ?
38590 0a 09 09 09 09 62 75 62 62 6c 65 54 79 70 65 20  .....bubbleType 
385a0 3a 0a 09 09 09 09 73 70 65 63 69 61 6c 2e 62 69  :.....special.bi
385b0 6e 64 54 79 70 65 20 7c 7c 20 74 79 70 65 3b 0a  ndType || type;.
385c0 0a 09 09 09 2f 2f 20 6a 51 75 65 72 79 20 68 61  ....// jQuery ha
385d0 6e 64 6c 65 72 0a 09 09 09 68 61 6e 64 6c 65 20  ndler....handle 
385e0 3d 20 28 0a 09 09 09 09 09 64 61 74 61 50 72 69  = (......dataPri
385f0 76 2e 67 65 74 28 20 63 75 72 2c 20 22 65 76 65  v.get( cur, "eve
38600 6e 74 73 22 20 29 20 7c 7c 20 4f 62 6a 65 63 74  nts" ) || Object
38610 2e 63 72 65 61 74 65 28 20 6e 75 6c 6c 20 29 0a  .create( null ).
38620 09 09 09 09 29 5b 20 65 76 65 6e 74 2e 74 79 70  ....)[ event.typ
38630 65 20 5d 20 26 26 0a 09 09 09 09 64 61 74 61 50  e ] &&.....dataP
38640 72 69 76 2e 67 65 74 28 20 63 75 72 2c 20 22 68  riv.get( cur, "h
38650 61 6e 64 6c 65 22 20 29 3b 0a 09 09 09 69 66 20  andle" );....if 
38660 28 20 68 61 6e 64 6c 65 20 29 20 7b 0a 09 09 09  ( handle ) {....
38670 09 68 61 6e 64 6c 65 2e 61 70 70 6c 79 28 20 63  .handle.apply( c
38680 75 72 2c 20 64 61 74 61 20 29 3b 0a 09 09 09 7d  ur, data );....}
38690 0a 0a 09 09 09 2f 2f 20 4e 61 74 69 76 65 20 68  .....// Native h
386a0 61 6e 64 6c 65 72 0a 09 09 09 68 61 6e 64 6c 65  andler....handle
386b0 20 3d 20 6f 6e 74 79 70 65 20 26 26 20 63 75 72   = ontype && cur
386c0 5b 20 6f 6e 74 79 70 65 20 5d 3b 0a 09 09 09 69  [ ontype ];....i
386d0 66 20 28 20 68 61 6e 64 6c 65 20 26 26 20 68 61  f ( handle && ha
386e0 6e 64 6c 65 2e 61 70 70 6c 79 20 26 26 20 61 63  ndle.apply && ac
386f0 63 65 70 74 44 61 74 61 28 20 63 75 72 20 29 20  ceptData( cur ) 
38700 29 20 7b 0a 09 09 09 09 65 76 65 6e 74 2e 72 65  ) {.....event.re
38710 73 75 6c 74 20 3d 20 68 61 6e 64 6c 65 2e 61 70  sult = handle.ap
38720 70 6c 79 28 20 63 75 72 2c 20 64 61 74 61 20 29  ply( cur, data )
38730 3b 0a 09 09 09 09 69 66 20 28 20 65 76 65 6e 74  ;.....if ( event
38740 2e 72 65 73 75 6c 74 20 3d 3d 3d 20 66 61 6c 73  .result === fals
38750 65 20 29 20 7b 0a 09 09 09 09 09 65 76 65 6e 74  e ) {......event
38760 2e 70 72 65 76 65 6e 74 44 65 66 61 75 6c 74 28  .preventDefault(
38770 29 3b 0a 09 09 09 09 7d 0a 09 09 09 7d 0a 09 09  );.....}....}...
38780 7d 0a 09 09 65 76 65 6e 74 2e 74 79 70 65 20 3d  }...event.type =
38790 20 74 79 70 65 3b 0a 0a 09 09 2f 2f 20 49 66 20   type;....// If 
387a0 6e 6f 62 6f 64 79 20 70 72 65 76 65 6e 74 65 64  nobody prevented
387b0 20 74 68 65 20 64 65 66 61 75 6c 74 20 61 63 74   the default act
387c0 69 6f 6e 2c 20 64 6f 20 69 74 20 6e 6f 77 0a 09  ion, do it now..
387d0 09 69 66 20 28 20 21 6f 6e 6c 79 48 61 6e 64 6c  .if ( !onlyHandl
387e0 65 72 73 20 26 26 20 21 65 76 65 6e 74 2e 69 73  ers && !event.is
387f0 44 65 66 61 75 6c 74 50 72 65 76 65 6e 74 65 64  DefaultPrevented
38800 28 29 20 29 20 7b 0a 0a 09 09 09 69 66 20 28 20  () ) {.....if ( 
38810 28 20 21 73 70 65 63 69 61 6c 2e 5f 64 65 66 61  ( !special._defa
38820 75 6c 74 20 7c 7c 0a 09 09 09 09 73 70 65 63 69  ult ||.....speci
38830 61 6c 2e 5f 64 65 66 61 75 6c 74 2e 61 70 70 6c  al._default.appl
38840 79 28 20 65 76 65 6e 74 50 61 74 68 2e 70 6f 70  y( eventPath.pop
38850 28 29 2c 20 64 61 74 61 20 29 20 3d 3d 3d 20 66  (), data ) === f
38860 61 6c 73 65 20 29 20 26 26 0a 09 09 09 09 61 63  alse ) &&.....ac
38870 63 65 70 74 44 61 74 61 28 20 65 6c 65 6d 20 29  ceptData( elem )
38880 20 29 20 7b 0a 0a 09 09 09 09 2f 2f 20 43 61 6c   ) {......// Cal
38890 6c 20 61 20 6e 61 74 69 76 65 20 44 4f 4d 20 6d  l a native DOM m
388a0 65 74 68 6f 64 20 6f 6e 20 74 68 65 20 74 61 72  ethod on the tar
388b0 67 65 74 20 77 69 74 68 20 74 68 65 20 73 61 6d  get with the sam
388c0 65 20 6e 61 6d 65 20 61 73 20 74 68 65 20 65 76  e name as the ev
388d0 65 6e 74 2e 0a 09 09 09 09 2f 2f 20 44 6f 6e 27  ent......// Don'
388e0 74 20 64 6f 20 64 65 66 61 75 6c 74 20 61 63 74  t do default act
388f0 69 6f 6e 73 20 6f 6e 20 77 69 6e 64 6f 77 2c 20  ions on window, 
38900 74 68 61 74 27 73 20 77 68 65 72 65 20 67 6c 6f  that's where glo
38910 62 61 6c 20 76 61 72 69 61 62 6c 65 73 20 62 65  bal variables be
38920 20 28 23 36 31 37 30 29 0a 09 09 09 09 69 66 20   (#6170).....if 
38930 28 20 6f 6e 74 79 70 65 20 26 26 20 69 73 46 75  ( ontype && isFu
38940 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 5b 20 74 79  nction( elem[ ty
38950 70 65 20 5d 20 29 20 26 26 20 21 69 73 57 69 6e  pe ] ) && !isWin
38960 64 6f 77 28 20 65 6c 65 6d 20 29 20 29 20 7b 0a  dow( elem ) ) {.
38970 0a 09 09 09 09 09 2f 2f 20 44 6f 6e 27 74 20 72  ......// Don't r
38980 65 2d 74 72 69 67 67 65 72 20 61 6e 20 6f 6e 46  e-trigger an onF
38990 4f 4f 20 65 76 65 6e 74 20 77 68 65 6e 20 77 65  OO event when we
389a0 20 63 61 6c 6c 20 69 74 73 20 46 4f 4f 28 29 20   call its FOO() 
389b0 6d 65 74 68 6f 64 0a 09 09 09 09 09 74 6d 70 20  method......tmp 
389c0 3d 20 65 6c 65 6d 5b 20 6f 6e 74 79 70 65 20 5d  = elem[ ontype ]
389d0 3b 0a 0a 09 09 09 09 09 69 66 20 28 20 74 6d 70  ;.......if ( tmp
389e0 20 29 20 7b 0a 09 09 09 09 09 09 65 6c 65 6d 5b   ) {.......elem[
389f0 20 6f 6e 74 79 70 65 20 5d 20 3d 20 6e 75 6c 6c   ontype ] = null
38a00 3b 0a 09 09 09 09 09 7d 0a 0a 09 09 09 09 09 2f  ;......}......./
38a10 2f 20 50 72 65 76 65 6e 74 20 72 65 2d 74 72 69  / Prevent re-tri
38a20 67 67 65 72 69 6e 67 20 6f 66 20 74 68 65 20 73  ggering of the s
38a30 61 6d 65 20 65 76 65 6e 74 2c 20 73 69 6e 63 65  ame event, since
38a40 20 77 65 20 61 6c 72 65 61 64 79 20 62 75 62 62   we already bubb
38a50 6c 65 64 20 69 74 20 61 62 6f 76 65 0a 09 09 09  led it above....
38a60 09 09 6a 51 75 65 72 79 2e 65 76 65 6e 74 2e 74  ..jQuery.event.t
38a70 72 69 67 67 65 72 65 64 20 3d 20 74 79 70 65 3b  riggered = type;
38a80 0a 0a 09 09 09 09 09 69 66 20 28 20 65 76 65 6e  .......if ( even
38a90 74 2e 69 73 50 72 6f 70 61 67 61 74 69 6f 6e 53  t.isPropagationS
38aa0 74 6f 70 70 65 64 28 29 20 29 20 7b 0a 09 09 09  topped() ) {....
38ab0 09 09 09 6c 61 73 74 45 6c 65 6d 65 6e 74 2e 61  ...lastElement.a
38ac0 64 64 45 76 65 6e 74 4c 69 73 74 65 6e 65 72 28  ddEventListener(
38ad0 20 74 79 70 65 2c 20 73 74 6f 70 50 72 6f 70 61   type, stopPropa
38ae0 67 61 74 69 6f 6e 43 61 6c 6c 62 61 63 6b 20 29  gationCallback )
38af0 3b 0a 09 09 09 09 09 7d 0a 0a 09 09 09 09 09 65  ;......}.......e
38b00 6c 65 6d 5b 20 74 79 70 65 20 5d 28 29 3b 0a 0a  lem[ type ]();..
38b10 09 09 09 09 09 69 66 20 28 20 65 76 65 6e 74 2e  .....if ( event.
38b20 69 73 50 72 6f 70 61 67 61 74 69 6f 6e 53 74 6f  isPropagationSto
38b30 70 70 65 64 28 29 20 29 20 7b 0a 09 09 09 09 09  pped() ) {......
38b40 09 6c 61 73 74 45 6c 65 6d 65 6e 74 2e 72 65 6d  .lastElement.rem
38b50 6f 76 65 45 76 65 6e 74 4c 69 73 74 65 6e 65 72  oveEventListener
38b60 28 20 74 79 70 65 2c 20 73 74 6f 70 50 72 6f 70  ( type, stopProp
38b70 61 67 61 74 69 6f 6e 43 61 6c 6c 62 61 63 6b 20  agationCallback 
38b80 29 3b 0a 09 09 09 09 09 7d 0a 0a 09 09 09 09 09  );......}.......
38b90 6a 51 75 65 72 79 2e 65 76 65 6e 74 2e 74 72 69  jQuery.event.tri
38ba0 67 67 65 72 65 64 20 3d 20 75 6e 64 65 66 69 6e  ggered = undefin
38bb0 65 64 3b 0a 0a 09 09 09 09 09 69 66 20 28 20 74  ed;.......if ( t
38bc0 6d 70 20 29 20 7b 0a 09 09 09 09 09 09 65 6c 65  mp ) {.......ele
38bd0 6d 5b 20 6f 6e 74 79 70 65 20 5d 20 3d 20 74 6d  m[ ontype ] = tm
38be0 70 3b 0a 09 09 09 09 09 7d 0a 09 09 09 09 7d 0a  p;......}.....}.
38bf0 09 09 09 7d 0a 09 09 7d 0a 0a 09 09 72 65 74 75  ...}...}....retu
38c00 72 6e 20 65 76 65 6e 74 2e 72 65 73 75 6c 74 3b  rn event.result;
38c10 0a 09 7d 2c 0a 0a 09 2f 2f 20 50 69 67 67 79 62  ..},...// Piggyb
38c20 61 63 6b 20 6f 6e 20 61 20 64 6f 6e 6f 72 20 65  ack on a donor e
38c30 76 65 6e 74 20 74 6f 20 73 69 6d 75 6c 61 74 65  vent to simulate
38c40 20 61 20 64 69 66 66 65 72 65 6e 74 20 6f 6e 65   a different one
38c50 0a 09 2f 2f 20 55 73 65 64 20 6f 6e 6c 79 20 66  ..// Used only f
38c60 6f 72 20 60 66 6f 63 75 73 28 69 6e 20 7c 20 6f  or `focus(in | o
38c70 75 74 29 60 20 65 76 65 6e 74 73 0a 09 73 69 6d  ut)` events..sim
38c80 75 6c 61 74 65 3a 20 66 75 6e 63 74 69 6f 6e 28  ulate: function(
38c90 20 74 79 70 65 2c 20 65 6c 65 6d 2c 20 65 76 65   type, elem, eve
38ca0 6e 74 20 29 20 7b 0a 09 09 76 61 72 20 65 20 3d  nt ) {...var e =
38cb0 20 6a 51 75 65 72 79 2e 65 78 74 65 6e 64 28 0a   jQuery.extend(.
38cc0 09 09 09 6e 65 77 20 6a 51 75 65 72 79 2e 45 76  ...new jQuery.Ev
38cd0 65 6e 74 28 29 2c 0a 09 09 09 65 76 65 6e 74 2c  ent(),....event,
38ce0 0a 09 09 09 7b 0a 09 09 09 09 74 79 70 65 3a 20  ....{.....type: 
38cf0 74 79 70 65 2c 0a 09 09 09 09 69 73 53 69 6d 75  type,.....isSimu
38d00 6c 61 74 65 64 3a 20 74 72 75 65 0a 09 09 09 7d  lated: true....}
38d10 0a 09 09 29 3b 0a 0a 09 09 6a 51 75 65 72 79 2e  ...);....jQuery.
38d20 65 76 65 6e 74 2e 74 72 69 67 67 65 72 28 20 65  event.trigger( e
38d30 2c 20 6e 75 6c 6c 2c 20 65 6c 65 6d 20 29 3b 0a  , null, elem );.
38d40 09 7d 0a 0a 7d 20 29 3b 0a 0a 6a 51 75 65 72 79  .}..} );..jQuery
38d50 2e 66 6e 2e 65 78 74 65 6e 64 28 20 7b 0a 0a 09  .fn.extend( {...
38d60 74 72 69 67 67 65 72 3a 20 66 75 6e 63 74 69 6f  trigger: functio
38d70 6e 28 20 74 79 70 65 2c 20 64 61 74 61 20 29 20  n( type, data ) 
38d80 7b 0a 09 09 72 65 74 75 72 6e 20 74 68 69 73 2e  {...return this.
38d90 65 61 63 68 28 20 66 75 6e 63 74 69 6f 6e 28 29  each( function()
38da0 20 7b 0a 09 09 09 6a 51 75 65 72 79 2e 65 76 65   {....jQuery.eve
38db0 6e 74 2e 74 72 69 67 67 65 72 28 20 74 79 70 65  nt.trigger( type
38dc0 2c 20 64 61 74 61 2c 20 74 68 69 73 20 29 3b 0a  , data, this );.
38dd0 09 09 7d 20 29 3b 0a 09 7d 2c 0a 09 74 72 69 67  ..} );..},..trig
38de0 67 65 72 48 61 6e 64 6c 65 72 3a 20 66 75 6e 63  gerHandler: func
38df0 74 69 6f 6e 28 20 74 79 70 65 2c 20 64 61 74 61  tion( type, data
38e00 20 29 20 7b 0a 09 09 76 61 72 20 65 6c 65 6d 20   ) {...var elem 
38e10 3d 20 74 68 69 73 5b 20 30 20 5d 3b 0a 09 09 69  = this[ 0 ];...i
38e20 66 20 28 20 65 6c 65 6d 20 29 20 7b 0a 09 09 09  f ( elem ) {....
38e30 72 65 74 75 72 6e 20 6a 51 75 65 72 79 2e 65 76  return jQuery.ev
38e40 65 6e 74 2e 74 72 69 67 67 65 72 28 20 74 79 70  ent.trigger( typ
38e50 65 2c 20 64 61 74 61 2c 20 65 6c 65 6d 2c 20 74  e, data, elem, t
38e60 72 75 65 20 29 3b 0a 09 09 7d 0a 09 7d 0a 7d 20  rue );...}..}.} 
38e70 29 3b 0a 0a 0a 2f 2f 20 53 75 70 70 6f 72 74 3a  );...// Support:
38e80 20 46 69 72 65 66 6f 78 20 3c 3d 34 34 0a 2f 2f   Firefox <=44.//
38e90 20 46 69 72 65 66 6f 78 20 64 6f 65 73 6e 27 74   Firefox doesn't
38ea0 20 68 61 76 65 20 66 6f 63 75 73 28 69 6e 20 7c   have focus(in |
38eb0 20 6f 75 74 29 20 65 76 65 6e 74 73 0a 2f 2f 20   out) events.// 
38ec0 52 65 6c 61 74 65 64 20 74 69 63 6b 65 74 20 2d  Related ticket -
38ed0 20 68 74 74 70 73 3a 2f 2f 62 75 67 7a 69 6c 6c   https://bugzill
38ee0 61 2e 6d 6f 7a 69 6c 6c 61 2e 6f 72 67 2f 73 68  a.mozilla.org/sh
38ef0 6f 77 5f 62 75 67 2e 63 67 69 3f 69 64 3d 36 38  ow_bug.cgi?id=68
38f00 37 37 38 37 0a 2f 2f 0a 2f 2f 20 53 75 70 70 6f  7787.//.// Suppo
38f10 72 74 3a 20 43 68 72 6f 6d 65 20 3c 3d 34 38 20  rt: Chrome <=48 
38f20 2d 20 34 39 2c 20 53 61 66 61 72 69 20 3c 3d 39  - 49, Safari <=9
38f30 2e 30 20 2d 20 39 2e 31 0a 2f 2f 20 66 6f 63 75  .0 - 9.1.// focu
38f40 73 28 69 6e 20 7c 20 6f 75 74 29 20 65 76 65 6e  s(in | out) even
38f50 74 73 20 66 69 72 65 20 61 66 74 65 72 20 66 6f  ts fire after fo
38f60 63 75 73 20 26 20 62 6c 75 72 20 65 76 65 6e 74  cus & blur event
38f70 73 2c 0a 2f 2f 20 77 68 69 63 68 20 69 73 20 73  s,.// which is s
38f80 70 65 63 20 76 69 6f 6c 61 74 69 6f 6e 20 2d 20  pec violation - 
38f90 68 74 74 70 3a 2f 2f 77 77 77 2e 77 33 2e 6f 72  http://www.w3.or
38fa0 67 2f 54 52 2f 44 4f 4d 2d 4c 65 76 65 6c 2d 33  g/TR/DOM-Level-3
38fb0 2d 45 76 65 6e 74 73 2f 23 65 76 65 6e 74 73 2d  -Events/#events-
38fc0 66 6f 63 75 73 65 76 65 6e 74 2d 65 76 65 6e 74  focusevent-event
38fd0 2d 6f 72 64 65 72 0a 2f 2f 20 52 65 6c 61 74 65  -order.// Relate
38fe0 64 20 74 69 63 6b 65 74 20 2d 20 68 74 74 70 73  d ticket - https
38ff0 3a 2f 2f 62 75 67 73 2e 63 68 72 6f 6d 69 75 6d  ://bugs.chromium
39000 2e 6f 72 67 2f 70 2f 63 68 72 6f 6d 69 75 6d 2f  .org/p/chromium/
39010 69 73 73 75 65 73 2f 64 65 74 61 69 6c 3f 69 64  issues/detail?id
39020 3d 34 34 39 38 35 37 0a 69 66 20 28 20 21 73 75  =449857.if ( !su
39030 70 70 6f 72 74 2e 66 6f 63 75 73 69 6e 20 29 20  pport.focusin ) 
39040 7b 0a 09 6a 51 75 65 72 79 2e 65 61 63 68 28 20  {..jQuery.each( 
39050 7b 20 66 6f 63 75 73 3a 20 22 66 6f 63 75 73 69  { focus: "focusi
39060 6e 22 2c 20 62 6c 75 72 3a 20 22 66 6f 63 75 73  n", blur: "focus
39070 6f 75 74 22 20 7d 2c 20 66 75 6e 63 74 69 6f 6e  out" }, function
39080 28 20 6f 72 69 67 2c 20 66 69 78 20 29 20 7b 0a  ( orig, fix ) {.
39090 0a 09 09 2f 2f 20 41 74 74 61 63 68 20 61 20 73  ...// Attach a s
390a0 69 6e 67 6c 65 20 63 61 70 74 75 72 69 6e 67 20  ingle capturing 
390b0 68 61 6e 64 6c 65 72 20 6f 6e 20 74 68 65 20 64  handler on the d
390c0 6f 63 75 6d 65 6e 74 20 77 68 69 6c 65 20 73 6f  ocument while so
390d0 6d 65 6f 6e 65 20 77 61 6e 74 73 20 66 6f 63 75  meone wants focu
390e0 73 69 6e 2f 66 6f 63 75 73 6f 75 74 0a 09 09 76  sin/focusout...v
390f0 61 72 20 68 61 6e 64 6c 65 72 20 3d 20 66 75 6e  ar handler = fun
39100 63 74 69 6f 6e 28 20 65 76 65 6e 74 20 29 20 7b  ction( event ) {
39110 0a 09 09 09 6a 51 75 65 72 79 2e 65 76 65 6e 74  ....jQuery.event
39120 2e 73 69 6d 75 6c 61 74 65 28 20 66 69 78 2c 20  .simulate( fix, 
39130 65 76 65 6e 74 2e 74 61 72 67 65 74 2c 20 6a 51  event.target, jQ
39140 75 65 72 79 2e 65 76 65 6e 74 2e 66 69 78 28 20  uery.event.fix( 
39150 65 76 65 6e 74 20 29 20 29 3b 0a 09 09 7d 3b 0a  event ) );...};.
39160 0a 09 09 6a 51 75 65 72 79 2e 65 76 65 6e 74 2e  ...jQuery.event.
39170 73 70 65 63 69 61 6c 5b 20 66 69 78 20 5d 20 3d  special[ fix ] =
39180 20 7b 0a 09 09 09 73 65 74 75 70 3a 20 66 75 6e   {....setup: fun
39190 63 74 69 6f 6e 28 29 20 7b 0a 0a 09 09 09 09 2f  ction() {....../
391a0 2f 20 48 61 6e 64 6c 65 3a 20 72 65 67 75 6c 61  / Handle: regula
391b0 72 20 6e 6f 64 65 73 20 28 76 69 61 20 60 74 68  r nodes (via `th
391c0 69 73 2e 6f 77 6e 65 72 44 6f 63 75 6d 65 6e 74  is.ownerDocument
391d0 60 29 2c 20 77 69 6e 64 6f 77 0a 09 09 09 09 2f  `), window...../
391e0 2f 20 28 76 69 61 20 60 74 68 69 73 2e 64 6f 63  / (via `this.doc
391f0 75 6d 65 6e 74 60 29 20 26 20 64 6f 63 75 6d 65  ument`) & docume
39200 6e 74 20 28 76 69 61 20 60 74 68 69 73 60 29 2e  nt (via `this`).
39210 0a 09 09 09 09 76 61 72 20 64 6f 63 20 3d 20 74  .....var doc = t
39220 68 69 73 2e 6f 77 6e 65 72 44 6f 63 75 6d 65 6e  his.ownerDocumen
39230 74 20 7c 7c 20 74 68 69 73 2e 64 6f 63 75 6d 65  t || this.docume
39240 6e 74 20 7c 7c 20 74 68 69 73 2c 0a 09 09 09 09  nt || this,.....
39250 09 61 74 74 61 63 68 65 73 20 3d 20 64 61 74 61  .attaches = data
39260 50 72 69 76 2e 61 63 63 65 73 73 28 20 64 6f 63  Priv.access( doc
39270 2c 20 66 69 78 20 29 3b 0a 0a 09 09 09 09 69 66  , fix );......if
39280 20 28 20 21 61 74 74 61 63 68 65 73 20 29 20 7b   ( !attaches ) {
39290 0a 09 09 09 09 09 64 6f 63 2e 61 64 64 45 76 65  ......doc.addEve
392a0 6e 74 4c 69 73 74 65 6e 65 72 28 20 6f 72 69 67  ntListener( orig
392b0 2c 20 68 61 6e 64 6c 65 72 2c 20 74 72 75 65 20  , handler, true 
392c0 29 3b 0a 09 09 09 09 7d 0a 09 09 09 09 64 61 74  );.....}.....dat
392d0 61 50 72 69 76 2e 61 63 63 65 73 73 28 20 64 6f  aPriv.access( do
392e0 63 2c 20 66 69 78 2c 20 28 20 61 74 74 61 63 68  c, fix, ( attach
392f0 65 73 20 7c 7c 20 30 20 29 20 2b 20 31 20 29 3b  es || 0 ) + 1 );
39300 0a 09 09 09 7d 2c 0a 09 09 09 74 65 61 72 64 6f  ....},....teardo
39310 77 6e 3a 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b  wn: function() {
39320 0a 09 09 09 09 76 61 72 20 64 6f 63 20 3d 20 74  .....var doc = t
39330 68 69 73 2e 6f 77 6e 65 72 44 6f 63 75 6d 65 6e  his.ownerDocumen
39340 74 20 7c 7c 20 74 68 69 73 2e 64 6f 63 75 6d 65  t || this.docume
39350 6e 74 20 7c 7c 20 74 68 69 73 2c 0a 09 09 09 09  nt || this,.....
39360 09 61 74 74 61 63 68 65 73 20 3d 20 64 61 74 61  .attaches = data
39370 50 72 69 76 2e 61 63 63 65 73 73 28 20 64 6f 63  Priv.access( doc
39380 2c 20 66 69 78 20 29 20 2d 20 31 3b 0a 0a 09 09  , fix ) - 1;....
39390 09 09 69 66 20 28 20 21 61 74 74 61 63 68 65 73  ..if ( !attaches
393a0 20 29 20 7b 0a 09 09 09 09 09 64 6f 63 2e 72 65   ) {......doc.re
393b0 6d 6f 76 65 45 76 65 6e 74 4c 69 73 74 65 6e 65  moveEventListene
393c0 72 28 20 6f 72 69 67 2c 20 68 61 6e 64 6c 65 72  r( orig, handler
393d0 2c 20 74 72 75 65 20 29 3b 0a 09 09 09 09 09 64  , true );......d
393e0 61 74 61 50 72 69 76 2e 72 65 6d 6f 76 65 28 20  ataPriv.remove( 
393f0 64 6f 63 2c 20 66 69 78 20 29 3b 0a 0a 09 09 09  doc, fix );.....
39400 09 7d 20 65 6c 73 65 20 7b 0a 09 09 09 09 09 64  .} else {......d
39410 61 74 61 50 72 69 76 2e 61 63 63 65 73 73 28 20  ataPriv.access( 
39420 64 6f 63 2c 20 66 69 78 2c 20 61 74 74 61 63 68  doc, fix, attach
39430 65 73 20 29 3b 0a 09 09 09 09 7d 0a 09 09 09 7d  es );.....}....}
39440 0a 09 09 7d 3b 0a 09 7d 20 29 3b 0a 7d 0a 76 61  ...};..} );.}.va
39450 72 20 6c 6f 63 61 74 69 6f 6e 20 3d 20 77 69 6e  r location = win
39460 64 6f 77 2e 6c 6f 63 61 74 69 6f 6e 3b 0a 0a 76  dow.location;..v
39470 61 72 20 6e 6f 6e 63 65 20 3d 20 7b 20 67 75 69  ar nonce = { gui
39480 64 3a 20 44 61 74 65 2e 6e 6f 77 28 29 20 7d 3b  d: Date.now() };
39490 0a 0a 76 61 72 20 72 71 75 65 72 79 20 3d 20 28  ..var rquery = (
394a0 20 2f 5c 3f 2f 20 29 3b 0a 0a 0a 0a 2f 2f 20 43   /\?/ );....// C
394b0 72 6f 73 73 2d 62 72 6f 77 73 65 72 20 78 6d 6c  ross-browser xml
394c0 20 70 61 72 73 69 6e 67 0a 6a 51 75 65 72 79 2e   parsing.jQuery.
394d0 70 61 72 73 65 58 4d 4c 20 3d 20 66 75 6e 63 74  parseXML = funct
394e0 69 6f 6e 28 20 64 61 74 61 20 29 20 7b 0a 09 76  ion( data ) {..v
394f0 61 72 20 78 6d 6c 3b 0a 09 69 66 20 28 20 21 64  ar xml;..if ( !d
39500 61 74 61 20 7c 7c 20 74 79 70 65 6f 66 20 64 61  ata || typeof da
39510 74 61 20 21 3d 3d 20 22 73 74 72 69 6e 67 22 20  ta !== "string" 
39520 29 20 7b 0a 09 09 72 65 74 75 72 6e 20 6e 75 6c  ) {...return nul
39530 6c 3b 0a 09 7d 0a 0a 09 2f 2f 20 53 75 70 70 6f  l;..}...// Suppo
39540 72 74 3a 20 49 45 20 39 20 2d 20 31 31 20 6f 6e  rt: IE 9 - 11 on
39550 6c 79 0a 09 2f 2f 20 49 45 20 74 68 72 6f 77 73  ly..// IE throws
39560 20 6f 6e 20 70 61 72 73 65 46 72 6f 6d 53 74 72   on parseFromStr
39570 69 6e 67 20 77 69 74 68 20 69 6e 76 61 6c 69 64  ing with invalid
39580 20 69 6e 70 75 74 2e 0a 09 74 72 79 20 7b 0a 09   input...try {..
39590 09 78 6d 6c 20 3d 20 28 20 6e 65 77 20 77 69 6e  .xml = ( new win
395a0 64 6f 77 2e 44 4f 4d 50 61 72 73 65 72 28 29 20  dow.DOMParser() 
395b0 29 2e 70 61 72 73 65 46 72 6f 6d 53 74 72 69 6e  ).parseFromStrin
395c0 67 28 20 64 61 74 61 2c 20 22 74 65 78 74 2f 78  g( data, "text/x
395d0 6d 6c 22 20 29 3b 0a 09 7d 20 63 61 74 63 68 20  ml" );..} catch 
395e0 28 20 65 20 29 20 7b 0a 09 09 78 6d 6c 20 3d 20  ( e ) {...xml = 
395f0 75 6e 64 65 66 69 6e 65 64 3b 0a 09 7d 0a 0a 09  undefined;..}...
39600 69 66 20 28 20 21 78 6d 6c 20 7c 7c 20 78 6d 6c  if ( !xml || xml
39610 2e 67 65 74 45 6c 65 6d 65 6e 74 73 42 79 54 61  .getElementsByTa
39620 67 4e 61 6d 65 28 20 22 70 61 72 73 65 72 65 72  gName( "parserer
39630 72 6f 72 22 20 29 2e 6c 65 6e 67 74 68 20 29 20  ror" ).length ) 
39640 7b 0a 09 09 6a 51 75 65 72 79 2e 65 72 72 6f 72  {...jQuery.error
39650 28 20 22 49 6e 76 61 6c 69 64 20 58 4d 4c 3a 20  ( "Invalid XML: 
39660 22 20 2b 20 64 61 74 61 20 29 3b 0a 09 7d 0a 09  " + data );..}..
39670 72 65 74 75 72 6e 20 78 6d 6c 3b 0a 7d 3b 0a 0a  return xml;.};..
39680 0a 76 61 72 0a 09 72 62 72 61 63 6b 65 74 20 3d  .var..rbracket =
39690 20 2f 5c 5b 5c 5d 24 2f 2c 0a 09 72 43 52 4c 46   /\[\]$/,..rCRLF
396a0 20 3d 20 2f 5c 72 3f 5c 6e 2f 67 2c 0a 09 72 73   = /\r?\n/g,..rs
396b0 75 62 6d 69 74 74 65 72 54 79 70 65 73 20 3d 20  ubmitterTypes = 
396c0 2f 5e 28 3f 3a 73 75 62 6d 69 74 7c 62 75 74 74  /^(?:submit|butt
396d0 6f 6e 7c 69 6d 61 67 65 7c 72 65 73 65 74 7c 66  on|image|reset|f
396e0 69 6c 65 29 24 2f 69 2c 0a 09 72 73 75 62 6d 69  ile)$/i,..rsubmi
396f0 74 74 61 62 6c 65 20 3d 20 2f 5e 28 3f 3a 69 6e  ttable = /^(?:in
39700 70 75 74 7c 73 65 6c 65 63 74 7c 74 65 78 74 61  put|select|texta
39710 72 65 61 7c 6b 65 79 67 65 6e 29 2f 69 3b 0a 0a  rea|keygen)/i;..
39720 66 75 6e 63 74 69 6f 6e 20 62 75 69 6c 64 50 61  function buildPa
39730 72 61 6d 73 28 20 70 72 65 66 69 78 2c 20 6f 62  rams( prefix, ob
39740 6a 2c 20 74 72 61 64 69 74 69 6f 6e 61 6c 2c 20  j, traditional, 
39750 61 64 64 20 29 20 7b 0a 09 76 61 72 20 6e 61 6d  add ) {..var nam
39760 65 3b 0a 0a 09 69 66 20 28 20 41 72 72 61 79 2e  e;...if ( Array.
39770 69 73 41 72 72 61 79 28 20 6f 62 6a 20 29 20 29  isArray( obj ) )
39780 20 7b 0a 0a 09 09 2f 2f 20 53 65 72 69 61 6c 69   {....// Seriali
39790 7a 65 20 61 72 72 61 79 20 69 74 65 6d 2e 0a 09  ze array item...
397a0 09 6a 51 75 65 72 79 2e 65 61 63 68 28 20 6f 62  .jQuery.each( ob
397b0 6a 2c 20 66 75 6e 63 74 69 6f 6e 28 20 69 2c 20  j, function( i, 
397c0 76 20 29 20 7b 0a 09 09 09 69 66 20 28 20 74 72  v ) {....if ( tr
397d0 61 64 69 74 69 6f 6e 61 6c 20 7c 7c 20 72 62 72  aditional || rbr
397e0 61 63 6b 65 74 2e 74 65 73 74 28 20 70 72 65 66  acket.test( pref
397f0 69 78 20 29 20 29 20 7b 0a 0a 09 09 09 09 2f 2f  ix ) ) {......//
39800 20 54 72 65 61 74 20 65 61 63 68 20 61 72 72 61   Treat each arra
39810 79 20 69 74 65 6d 20 61 73 20 61 20 73 63 61 6c  y item as a scal
39820 61 72 2e 0a 09 09 09 09 61 64 64 28 20 70 72 65  ar......add( pre
39830 66 69 78 2c 20 76 20 29 3b 0a 0a 09 09 09 7d 20  fix, v );.....} 
39840 65 6c 73 65 20 7b 0a 0a 09 09 09 09 2f 2f 20 49  else {......// I
39850 74 65 6d 20 69 73 20 6e 6f 6e 2d 73 63 61 6c 61  tem is non-scala
39860 72 20 28 61 72 72 61 79 20 6f 72 20 6f 62 6a 65  r (array or obje
39870 63 74 29 2c 20 65 6e 63 6f 64 65 20 69 74 73 20  ct), encode its 
39880 6e 75 6d 65 72 69 63 20 69 6e 64 65 78 2e 0a 09  numeric index...
39890 09 09 09 62 75 69 6c 64 50 61 72 61 6d 73 28 0a  ...buildParams(.
398a0 09 09 09 09 09 70 72 65 66 69 78 20 2b 20 22 5b  .....prefix + "[
398b0 22 20 2b 20 28 20 74 79 70 65 6f 66 20 76 20 3d  " + ( typeof v =
398c0 3d 3d 20 22 6f 62 6a 65 63 74 22 20 26 26 20 76  == "object" && v
398d0 20 21 3d 20 6e 75 6c 6c 20 3f 20 69 20 3a 20 22   != null ? i : "
398e0 22 20 29 20 2b 20 22 5d 22 2c 0a 09 09 09 09 09  " ) + "]",......
398f0 76 2c 0a 09 09 09 09 09 74 72 61 64 69 74 69 6f  v,......traditio
39900 6e 61 6c 2c 0a 09 09 09 09 09 61 64 64 0a 09 09  nal,......add...
39910 09 09 29 3b 0a 09 09 09 7d 0a 09 09 7d 20 29 3b  ..);....}...} );
39920 0a 0a 09 7d 20 65 6c 73 65 20 69 66 20 28 20 21  ...} else if ( !
39930 74 72 61 64 69 74 69 6f 6e 61 6c 20 26 26 20 74  traditional && t
39940 6f 54 79 70 65 28 20 6f 62 6a 20 29 20 3d 3d 3d  oType( obj ) ===
39950 20 22 6f 62 6a 65 63 74 22 20 29 20 7b 0a 0a 09   "object" ) {...
39960 09 2f 2f 20 53 65 72 69 61 6c 69 7a 65 20 6f 62  .// Serialize ob
39970 6a 65 63 74 20 69 74 65 6d 2e 0a 09 09 66 6f 72  ject item....for
39980 20 28 20 6e 61 6d 65 20 69 6e 20 6f 62 6a 20 29   ( name in obj )
39990 20 7b 0a 09 09 09 62 75 69 6c 64 50 61 72 61 6d   {....buildParam
399a0 73 28 20 70 72 65 66 69 78 20 2b 20 22 5b 22 20  s( prefix + "[" 
399b0 2b 20 6e 61 6d 65 20 2b 20 22 5d 22 2c 20 6f 62  + name + "]", ob
399c0 6a 5b 20 6e 61 6d 65 20 5d 2c 20 74 72 61 64 69  j[ name ], tradi
399d0 74 69 6f 6e 61 6c 2c 20 61 64 64 20 29 3b 0a 09  tional, add );..
399e0 09 7d 0a 0a 09 7d 20 65 6c 73 65 20 7b 0a 0a 09  .}...} else {...
399f0 09 2f 2f 20 53 65 72 69 61 6c 69 7a 65 20 73 63  .// Serialize sc
39a00 61 6c 61 72 20 69 74 65 6d 2e 0a 09 09 61 64 64  alar item....add
39a10 28 20 70 72 65 66 69 78 2c 20 6f 62 6a 20 29 3b  ( prefix, obj );
39a20 0a 09 7d 0a 7d 0a 0a 2f 2f 20 53 65 72 69 61 6c  ..}.}..// Serial
39a30 69 7a 65 20 61 6e 20 61 72 72 61 79 20 6f 66 20  ize an array of 
39a40 66 6f 72 6d 20 65 6c 65 6d 65 6e 74 73 20 6f 72  form elements or
39a50 20 61 20 73 65 74 20 6f 66 0a 2f 2f 20 6b 65 79   a set of.// key
39a60 2f 76 61 6c 75 65 73 20 69 6e 74 6f 20 61 20 71  /values into a q
39a70 75 65 72 79 20 73 74 72 69 6e 67 0a 6a 51 75 65  uery string.jQue
39a80 72 79 2e 70 61 72 61 6d 20 3d 20 66 75 6e 63 74  ry.param = funct
39a90 69 6f 6e 28 20 61 2c 20 74 72 61 64 69 74 69 6f  ion( a, traditio
39aa0 6e 61 6c 20 29 20 7b 0a 09 76 61 72 20 70 72 65  nal ) {..var pre
39ab0 66 69 78 2c 0a 09 09 73 20 3d 20 5b 5d 2c 0a 09  fix,...s = [],..
39ac0 09 61 64 64 20 3d 20 66 75 6e 63 74 69 6f 6e 28  .add = function(
39ad0 20 6b 65 79 2c 20 76 61 6c 75 65 4f 72 46 75 6e   key, valueOrFun
39ae0 63 74 69 6f 6e 20 29 20 7b 0a 0a 09 09 09 2f 2f  ction ) {.....//
39af0 20 49 66 20 76 61 6c 75 65 20 69 73 20 61 20 66   If value is a f
39b00 75 6e 63 74 69 6f 6e 2c 20 69 6e 76 6f 6b 65 20  unction, invoke 
39b10 69 74 20 61 6e 64 20 75 73 65 20 69 74 73 20 72  it and use its r
39b20 65 74 75 72 6e 20 76 61 6c 75 65 0a 09 09 09 76  eturn value....v
39b30 61 72 20 76 61 6c 75 65 20 3d 20 69 73 46 75 6e  ar value = isFun
39b40 63 74 69 6f 6e 28 20 76 61 6c 75 65 4f 72 46 75  ction( valueOrFu
39b50 6e 63 74 69 6f 6e 20 29 20 3f 0a 09 09 09 09 76  nction ) ?.....v
39b60 61 6c 75 65 4f 72 46 75 6e 63 74 69 6f 6e 28 29  alueOrFunction()
39b70 20 3a 0a 09 09 09 09 76 61 6c 75 65 4f 72 46 75   :.....valueOrFu
39b80 6e 63 74 69 6f 6e 3b 0a 0a 09 09 09 73 5b 20 73  nction;.....s[ s
39b90 2e 6c 65 6e 67 74 68 20 5d 20 3d 20 65 6e 63 6f  .length ] = enco
39ba0 64 65 55 52 49 43 6f 6d 70 6f 6e 65 6e 74 28 20  deURIComponent( 
39bb0 6b 65 79 20 29 20 2b 20 22 3d 22 20 2b 0a 09 09  key ) + "=" +...
39bc0 09 09 65 6e 63 6f 64 65 55 52 49 43 6f 6d 70 6f  ..encodeURICompo
39bd0 6e 65 6e 74 28 20 76 61 6c 75 65 20 3d 3d 20 6e  nent( value == n
39be0 75 6c 6c 20 3f 20 22 22 20 3a 20 76 61 6c 75 65  ull ? "" : value
39bf0 20 29 3b 0a 09 09 7d 3b 0a 0a 09 69 66 20 28 20   );...};...if ( 
39c00 61 20 3d 3d 20 6e 75 6c 6c 20 29 20 7b 0a 09 09  a == null ) {...
39c10 72 65 74 75 72 6e 20 22 22 3b 0a 09 7d 0a 0a 09  return "";..}...
39c20 2f 2f 20 49 66 20 61 6e 20 61 72 72 61 79 20 77  // If an array w
39c30 61 73 20 70 61 73 73 65 64 20 69 6e 2c 20 61 73  as passed in, as
39c40 73 75 6d 65 20 74 68 61 74 20 69 74 20 69 73 20  sume that it is 
39c50 61 6e 20 61 72 72 61 79 20 6f 66 20 66 6f 72 6d  an array of form
39c60 20 65 6c 65 6d 65 6e 74 73 2e 0a 09 69 66 20 28   elements...if (
39c70 20 41 72 72 61 79 2e 69 73 41 72 72 61 79 28 20   Array.isArray( 
39c80 61 20 29 20 7c 7c 20 28 20 61 2e 6a 71 75 65 72  a ) || ( a.jquer
39c90 79 20 26 26 20 21 6a 51 75 65 72 79 2e 69 73 50  y && !jQuery.isP
39ca0 6c 61 69 6e 4f 62 6a 65 63 74 28 20 61 20 29 20  lainObject( a ) 
39cb0 29 20 29 20 7b 0a 0a 09 09 2f 2f 20 53 65 72 69  ) ) {....// Seri
39cc0 61 6c 69 7a 65 20 74 68 65 20 66 6f 72 6d 20 65  alize the form e
39cd0 6c 65 6d 65 6e 74 73 0a 09 09 6a 51 75 65 72 79  lements...jQuery
39ce0 2e 65 61 63 68 28 20 61 2c 20 66 75 6e 63 74 69  .each( a, functi
39cf0 6f 6e 28 29 20 7b 0a 09 09 09 61 64 64 28 20 74  on() {....add( t
39d00 68 69 73 2e 6e 61 6d 65 2c 20 74 68 69 73 2e 76  his.name, this.v
39d10 61 6c 75 65 20 29 3b 0a 09 09 7d 20 29 3b 0a 0a  alue );...} );..
39d20 09 7d 20 65 6c 73 65 20 7b 0a 0a 09 09 2f 2f 20  .} else {....// 
39d30 49 66 20 74 72 61 64 69 74 69 6f 6e 61 6c 2c 20  If traditional, 
39d40 65 6e 63 6f 64 65 20 74 68 65 20 22 6f 6c 64 22  encode the "old"
39d50 20 77 61 79 20 28 74 68 65 20 77 61 79 20 31 2e   way (the way 1.
39d60 33 2e 32 20 6f 72 20 6f 6c 64 65 72 0a 09 09 2f  3.2 or older.../
39d70 2f 20 64 69 64 20 69 74 29 2c 20 6f 74 68 65 72  / did it), other
39d80 77 69 73 65 20 65 6e 63 6f 64 65 20 70 61 72 61  wise encode para
39d90 6d 73 20 72 65 63 75 72 73 69 76 65 6c 79 2e 0a  ms recursively..
39da0 09 09 66 6f 72 20 28 20 70 72 65 66 69 78 20 69  ..for ( prefix i
39db0 6e 20 61 20 29 20 7b 0a 09 09 09 62 75 69 6c 64  n a ) {....build
39dc0 50 61 72 61 6d 73 28 20 70 72 65 66 69 78 2c 20  Params( prefix, 
39dd0 61 5b 20 70 72 65 66 69 78 20 5d 2c 20 74 72 61  a[ prefix ], tra
39de0 64 69 74 69 6f 6e 61 6c 2c 20 61 64 64 20 29 3b  ditional, add );
39df0 0a 09 09 7d 0a 09 7d 0a 0a 09 2f 2f 20 52 65 74  ...}..}...// Ret
39e00 75 72 6e 20 74 68 65 20 72 65 73 75 6c 74 69 6e  urn the resultin
39e10 67 20 73 65 72 69 61 6c 69 7a 61 74 69 6f 6e 0a  g serialization.
39e20 09 72 65 74 75 72 6e 20 73 2e 6a 6f 69 6e 28 20  .return s.join( 
39e30 22 26 22 20 29 3b 0a 7d 3b 0a 0a 6a 51 75 65 72  "&" );.};..jQuer
39e40 79 2e 66 6e 2e 65 78 74 65 6e 64 28 20 7b 0a 09  y.fn.extend( {..
39e50 73 65 72 69 61 6c 69 7a 65 3a 20 66 75 6e 63 74  serialize: funct
39e60 69 6f 6e 28 29 20 7b 0a 09 09 72 65 74 75 72 6e  ion() {...return
39e70 20 6a 51 75 65 72 79 2e 70 61 72 61 6d 28 20 74   jQuery.param( t
39e80 68 69 73 2e 73 65 72 69 61 6c 69 7a 65 41 72 72  his.serializeArr
39e90 61 79 28 29 20 29 3b 0a 09 7d 2c 0a 09 73 65 72  ay() );..},..ser
39ea0 69 61 6c 69 7a 65 41 72 72 61 79 3a 20 66 75 6e  ializeArray: fun
39eb0 63 74 69 6f 6e 28 29 20 7b 0a 09 09 72 65 74 75  ction() {...retu
39ec0 72 6e 20 74 68 69 73 2e 6d 61 70 28 20 66 75 6e  rn this.map( fun
39ed0 63 74 69 6f 6e 28 29 20 7b 0a 0a 09 09 09 2f 2f  ction() {.....//
39ee0 20 43 61 6e 20 61 64 64 20 70 72 6f 70 48 6f 6f   Can add propHoo
39ef0 6b 20 66 6f 72 20 22 65 6c 65 6d 65 6e 74 73 22  k for "elements"
39f00 20 74 6f 20 66 69 6c 74 65 72 20 6f 72 20 61 64   to filter or ad
39f10 64 20 66 6f 72 6d 20 65 6c 65 6d 65 6e 74 73 0a  d form elements.
39f20 09 09 09 76 61 72 20 65 6c 65 6d 65 6e 74 73 20  ...var elements 
39f30 3d 20 6a 51 75 65 72 79 2e 70 72 6f 70 28 20 74  = jQuery.prop( t
39f40 68 69 73 2c 20 22 65 6c 65 6d 65 6e 74 73 22 20  his, "elements" 
39f50 29 3b 0a 09 09 09 72 65 74 75 72 6e 20 65 6c 65  );....return ele
39f60 6d 65 6e 74 73 20 3f 20 6a 51 75 65 72 79 2e 6d  ments ? jQuery.m
39f70 61 6b 65 41 72 72 61 79 28 20 65 6c 65 6d 65 6e  akeArray( elemen
39f80 74 73 20 29 20 3a 20 74 68 69 73 3b 0a 09 09 7d  ts ) : this;...}
39f90 20 29 0a 09 09 2e 66 69 6c 74 65 72 28 20 66 75   )....filter( fu
39fa0 6e 63 74 69 6f 6e 28 29 20 7b 0a 09 09 09 76 61  nction() {....va
39fb0 72 20 74 79 70 65 20 3d 20 74 68 69 73 2e 74 79  r type = this.ty
39fc0 70 65 3b 0a 0a 09 09 09 2f 2f 20 55 73 65 20 2e  pe;.....// Use .
39fd0 69 73 28 20 22 3a 64 69 73 61 62 6c 65 64 22 20  is( ":disabled" 
39fe0 29 20 73 6f 20 74 68 61 74 20 66 69 65 6c 64 73  ) so that fields
39ff0 65 74 5b 64 69 73 61 62 6c 65 64 5d 20 77 6f 72  et[disabled] wor
3a000 6b 73 0a 09 09 09 72 65 74 75 72 6e 20 74 68 69  ks....return thi
3a010 73 2e 6e 61 6d 65 20 26 26 20 21 6a 51 75 65 72  s.name && !jQuer
3a020 79 28 20 74 68 69 73 20 29 2e 69 73 28 20 22 3a  y( this ).is( ":
3a030 64 69 73 61 62 6c 65 64 22 20 29 20 26 26 0a 09  disabled" ) &&..
3a040 09 09 09 72 73 75 62 6d 69 74 74 61 62 6c 65 2e  ...rsubmittable.
3a050 74 65 73 74 28 20 74 68 69 73 2e 6e 6f 64 65 4e  test( this.nodeN
3a060 61 6d 65 20 29 20 26 26 20 21 72 73 75 62 6d 69  ame ) && !rsubmi
3a070 74 74 65 72 54 79 70 65 73 2e 74 65 73 74 28 20  tterTypes.test( 
3a080 74 79 70 65 20 29 20 26 26 0a 09 09 09 09 28 20  type ) &&.....( 
3a090 74 68 69 73 2e 63 68 65 63 6b 65 64 20 7c 7c 20  this.checked || 
3a0a0 21 72 63 68 65 63 6b 61 62 6c 65 54 79 70 65 2e  !rcheckableType.
3a0b0 74 65 73 74 28 20 74 79 70 65 20 29 20 29 3b 0a  test( type ) );.
3a0c0 09 09 7d 20 29 0a 09 09 2e 6d 61 70 28 20 66 75  ..} )....map( fu
3a0d0 6e 63 74 69 6f 6e 28 20 5f 69 2c 20 65 6c 65 6d  nction( _i, elem
3a0e0 20 29 20 7b 0a 09 09 09 76 61 72 20 76 61 6c 20   ) {....var val 
3a0f0 3d 20 6a 51 75 65 72 79 28 20 74 68 69 73 20 29  = jQuery( this )
3a100 2e 76 61 6c 28 29 3b 0a 0a 09 09 09 69 66 20 28  .val();.....if (
3a110 20 76 61 6c 20 3d 3d 20 6e 75 6c 6c 20 29 20 7b   val == null ) {
3a120 0a 09 09 09 09 72 65 74 75 72 6e 20 6e 75 6c 6c  .....return null
3a130 3b 0a 09 09 09 7d 0a 0a 09 09 09 69 66 20 28 20  ;....}.....if ( 
3a140 41 72 72 61 79 2e 69 73 41 72 72 61 79 28 20 76  Array.isArray( v
3a150 61 6c 20 29 20 29 20 7b 0a 09 09 09 09 72 65 74  al ) ) {.....ret
3a160 75 72 6e 20 6a 51 75 65 72 79 2e 6d 61 70 28 20  urn jQuery.map( 
3a170 76 61 6c 2c 20 66 75 6e 63 74 69 6f 6e 28 20 76  val, function( v
3a180 61 6c 20 29 20 7b 0a 09 09 09 09 09 72 65 74 75  al ) {......retu
3a190 72 6e 20 7b 20 6e 61 6d 65 3a 20 65 6c 65 6d 2e  rn { name: elem.
3a1a0 6e 61 6d 65 2c 20 76 61 6c 75 65 3a 20 76 61 6c  name, value: val
3a1b0 2e 72 65 70 6c 61 63 65 28 20 72 43 52 4c 46 2c  .replace( rCRLF,
3a1c0 20 22 5c 72 5c 6e 22 20 29 20 7d 3b 0a 09 09 09   "\r\n" ) };....
3a1d0 09 7d 20 29 3b 0a 09 09 09 7d 0a 0a 09 09 09 72  .} );....}.....r
3a1e0 65 74 75 72 6e 20 7b 20 6e 61 6d 65 3a 20 65 6c  eturn { name: el
3a1f0 65 6d 2e 6e 61 6d 65 2c 20 76 61 6c 75 65 3a 20  em.name, value: 
3a200 76 61 6c 2e 72 65 70 6c 61 63 65 28 20 72 43 52  val.replace( rCR
3a210 4c 46 2c 20 22 5c 72 5c 6e 22 20 29 20 7d 3b 0a  LF, "\r\n" ) };.
3a220 09 09 7d 20 29 2e 67 65 74 28 29 3b 0a 09 7d 0a  ..} ).get();..}.
3a230 7d 20 29 3b 0a 0a 0a 76 61 72 0a 09 72 32 30 20  } );...var..r20 
3a240 3d 20 2f 25 32 30 2f 67 2c 0a 09 72 68 61 73 68  = /%20/g,..rhash
3a250 20 3d 20 2f 23 2e 2a 24 2f 2c 0a 09 72 61 6e 74   = /#.*$/,..rant
3a260 69 43 61 63 68 65 20 3d 20 2f 28 5b 3f 26 5d 29  iCache = /([?&])
3a270 5f 3d 5b 5e 26 5d 2a 2f 2c 0a 09 72 68 65 61 64  _=[^&]*/,..rhead
3a280 65 72 73 20 3d 20 2f 5e 28 2e 2a 3f 29 3a 5b 20  ers = /^(.*?):[ 
3a290 5c 74 5d 2a 28 5b 5e 5c 72 5c 6e 5d 2a 29 24 2f  \t]*([^\r\n]*)$/
3a2a0 6d 67 2c 0a 0a 09 2f 2f 20 23 37 36 35 33 2c 20  mg,...// #7653, 
3a2b0 23 38 31 32 35 2c 20 23 38 31 35 32 3a 20 6c 6f  #8125, #8152: lo
3a2c0 63 61 6c 20 70 72 6f 74 6f 63 6f 6c 20 64 65 74  cal protocol det
3a2d0 65 63 74 69 6f 6e 0a 09 72 6c 6f 63 61 6c 50 72  ection..rlocalPr
3a2e0 6f 74 6f 63 6f 6c 20 3d 20 2f 5e 28 3f 3a 61 62  otocol = /^(?:ab
3a2f0 6f 75 74 7c 61 70 70 7c 61 70 70 2d 73 74 6f 72  out|app|app-stor
3a300 61 67 65 7c 2e 2b 2d 65 78 74 65 6e 73 69 6f 6e  age|.+-extension
3a310 7c 66 69 6c 65 7c 72 65 73 7c 77 69 64 67 65 74  |file|res|widget
3a320 29 3a 24 2f 2c 0a 09 72 6e 6f 43 6f 6e 74 65 6e  ):$/,..rnoConten
3a330 74 20 3d 20 2f 5e 28 3f 3a 47 45 54 7c 48 45 41  t = /^(?:GET|HEA
3a340 44 29 24 2f 2c 0a 09 72 70 72 6f 74 6f 63 6f 6c  D)$/,..rprotocol
3a350 20 3d 20 2f 5e 5c 2f 5c 2f 2f 2c 0a 0a 09 2f 2a   = /^\/\//,.../*
3a360 20 50 72 65 66 69 6c 74 65 72 73 0a 09 20 2a 20   Prefilters.. * 
3a370 31 29 20 54 68 65 79 20 61 72 65 20 75 73 65 66  1) They are usef
3a380 75 6c 20 74 6f 20 69 6e 74 72 6f 64 75 63 65 20  ul to introduce 
3a390 63 75 73 74 6f 6d 20 64 61 74 61 54 79 70 65 73  custom dataTypes
3a3a0 20 28 73 65 65 20 61 6a 61 78 2f 6a 73 6f 6e 70   (see ajax/jsonp
3a3b0 2e 6a 73 20 66 6f 72 20 61 6e 20 65 78 61 6d 70  .js for an examp
3a3c0 6c 65 29 0a 09 20 2a 20 32 29 20 54 68 65 73 65  le).. * 2) These
3a3d0 20 61 72 65 20 63 61 6c 6c 65 64 3a 0a 09 20 2a   are called:.. *
3a3e0 20 20 20 20 2d 20 42 45 46 4f 52 45 20 61 73 6b      - BEFORE ask
3a3f0 69 6e 67 20 66 6f 72 20 61 20 74 72 61 6e 73 70  ing for a transp
3a400 6f 72 74 0a 09 20 2a 20 20 20 20 2d 20 41 46 54  ort.. *    - AFT
3a410 45 52 20 70 61 72 61 6d 20 73 65 72 69 61 6c 69  ER param seriali
3a420 7a 61 74 69 6f 6e 20 28 73 2e 64 61 74 61 20 69  zation (s.data i
3a430 73 20 61 20 73 74 72 69 6e 67 20 69 66 20 73 2e  s a string if s.
3a440 70 72 6f 63 65 73 73 44 61 74 61 20 69 73 20 74  processData is t
3a450 72 75 65 29 0a 09 20 2a 20 33 29 20 6b 65 79 20  rue).. * 3) key 
3a460 69 73 20 74 68 65 20 64 61 74 61 54 79 70 65 0a  is the dataType.
3a470 09 20 2a 20 34 29 20 74 68 65 20 63 61 74 63 68  . * 4) the catch
3a480 61 6c 6c 20 73 79 6d 62 6f 6c 20 22 2a 22 20 63  all symbol "*" c
3a490 61 6e 20 62 65 20 75 73 65 64 0a 09 20 2a 20 35  an be used.. * 5
3a4a0 29 20 65 78 65 63 75 74 69 6f 6e 20 77 69 6c 6c  ) execution will
3a4b0 20 73 74 61 72 74 20 77 69 74 68 20 74 72 61 6e   start with tran
3a4c0 73 70 6f 72 74 20 64 61 74 61 54 79 70 65 20 61  sport dataType a
3a4d0 6e 64 20 54 48 45 4e 20 63 6f 6e 74 69 6e 75 65  nd THEN continue
3a4e0 20 64 6f 77 6e 20 74 6f 20 22 2a 22 20 69 66 20   down to "*" if 
3a4f0 6e 65 65 64 65 64 0a 09 20 2a 2f 0a 09 70 72 65  needed.. */..pre
3a500 66 69 6c 74 65 72 73 20 3d 20 7b 7d 2c 0a 0a 09  filters = {},...
3a510 2f 2a 20 54 72 61 6e 73 70 6f 72 74 73 20 62 69  /* Transports bi
3a520 6e 64 69 6e 67 73 0a 09 20 2a 20 31 29 20 6b 65  ndings.. * 1) ke
3a530 79 20 69 73 20 74 68 65 20 64 61 74 61 54 79 70  y is the dataTyp
3a540 65 0a 09 20 2a 20 32 29 20 74 68 65 20 63 61 74  e.. * 2) the cat
3a550 63 68 61 6c 6c 20 73 79 6d 62 6f 6c 20 22 2a 22  chall symbol "*"
3a560 20 63 61 6e 20 62 65 20 75 73 65 64 0a 09 20 2a   can be used.. *
3a570 20 33 29 20 73 65 6c 65 63 74 69 6f 6e 20 77 69   3) selection wi
3a580 6c 6c 20 73 74 61 72 74 20 77 69 74 68 20 74 72  ll start with tr
3a590 61 6e 73 70 6f 72 74 20 64 61 74 61 54 79 70 65  ansport dataType
3a5a0 20 61 6e 64 20 54 48 45 4e 20 67 6f 20 74 6f 20   and THEN go to 
3a5b0 22 2a 22 20 69 66 20 6e 65 65 64 65 64 0a 09 20  "*" if needed.. 
3a5c0 2a 2f 0a 09 74 72 61 6e 73 70 6f 72 74 73 20 3d  */..transports =
3a5d0 20 7b 7d 2c 0a 0a 09 2f 2f 20 41 76 6f 69 64 20   {},...// Avoid 
3a5e0 63 6f 6d 6d 65 6e 74 2d 70 72 6f 6c 6f 67 20 63  comment-prolog c
3a5f0 68 61 72 20 73 65 71 75 65 6e 63 65 20 28 23 31  har sequence (#1
3a600 30 30 39 38 29 3b 20 6d 75 73 74 20 61 70 70 65  0098); must appe
3a610 61 73 65 20 6c 69 6e 74 20 61 6e 64 20 65 76 61  ase lint and eva
3a620 64 65 20 63 6f 6d 70 72 65 73 73 69 6f 6e 0a 09  de compression..
3a630 61 6c 6c 54 79 70 65 73 20 3d 20 22 2a 2f 22 2e  allTypes = "*/".
3a640 63 6f 6e 63 61 74 28 20 22 2a 22 20 29 2c 0a 0a  concat( "*" ),..
3a650 09 2f 2f 20 41 6e 63 68 6f 72 20 74 61 67 20 66  .// Anchor tag f
3a660 6f 72 20 70 61 72 73 69 6e 67 20 74 68 65 20 64  or parsing the d
3a670 6f 63 75 6d 65 6e 74 20 6f 72 69 67 69 6e 0a 09  ocument origin..
3a680 6f 72 69 67 69 6e 41 6e 63 68 6f 72 20 3d 20 64  originAnchor = d
3a690 6f 63 75 6d 65 6e 74 2e 63 72 65 61 74 65 45 6c  ocument.createEl
3a6a0 65 6d 65 6e 74 28 20 22 61 22 20 29 3b 0a 09 6f  ement( "a" );..o
3a6b0 72 69 67 69 6e 41 6e 63 68 6f 72 2e 68 72 65 66  riginAnchor.href
3a6c0 20 3d 20 6c 6f 63 61 74 69 6f 6e 2e 68 72 65 66   = location.href
3a6d0 3b 0a 0a 2f 2f 20 42 61 73 65 20 22 63 6f 6e 73  ;..// Base "cons
3a6e0 74 72 75 63 74 6f 72 22 20 66 6f 72 20 6a 51 75  tructor" for jQu
3a6f0 65 72 79 2e 61 6a 61 78 50 72 65 66 69 6c 74 65  ery.ajaxPrefilte
3a700 72 20 61 6e 64 20 6a 51 75 65 72 79 2e 61 6a 61  r and jQuery.aja
3a710 78 54 72 61 6e 73 70 6f 72 74 0a 66 75 6e 63 74  xTransport.funct
3a720 69 6f 6e 20 61 64 64 54 6f 50 72 65 66 69 6c 74  ion addToPrefilt
3a730 65 72 73 4f 72 54 72 61 6e 73 70 6f 72 74 73 28  ersOrTransports(
3a740 20 73 74 72 75 63 74 75 72 65 20 29 20 7b 0a 0a   structure ) {..
3a750 09 2f 2f 20 64 61 74 61 54 79 70 65 45 78 70 72  .// dataTypeExpr
3a760 65 73 73 69 6f 6e 20 69 73 20 6f 70 74 69 6f 6e  ession is option
3a770 61 6c 20 61 6e 64 20 64 65 66 61 75 6c 74 73 20  al and defaults 
3a780 74 6f 20 22 2a 22 0a 09 72 65 74 75 72 6e 20 66  to "*"..return f
3a790 75 6e 63 74 69 6f 6e 28 20 64 61 74 61 54 79 70  unction( dataTyp
3a7a0 65 45 78 70 72 65 73 73 69 6f 6e 2c 20 66 75 6e  eExpression, fun
3a7b0 63 20 29 20 7b 0a 0a 09 09 69 66 20 28 20 74 79  c ) {....if ( ty
3a7c0 70 65 6f 66 20 64 61 74 61 54 79 70 65 45 78 70  peof dataTypeExp
3a7d0 72 65 73 73 69 6f 6e 20 21 3d 3d 20 22 73 74 72  ression !== "str
3a7e0 69 6e 67 22 20 29 20 7b 0a 09 09 09 66 75 6e 63  ing" ) {....func
3a7f0 20 3d 20 64 61 74 61 54 79 70 65 45 78 70 72 65   = dataTypeExpre
3a800 73 73 69 6f 6e 3b 0a 09 09 09 64 61 74 61 54 79  ssion;....dataTy
3a810 70 65 45 78 70 72 65 73 73 69 6f 6e 20 3d 20 22  peExpression = "
3a820 2a 22 3b 0a 09 09 7d 0a 0a 09 09 76 61 72 20 64  *";...}....var d
3a830 61 74 61 54 79 70 65 2c 0a 09 09 09 69 20 3d 20  ataType,....i = 
3a840 30 2c 0a 09 09 09 64 61 74 61 54 79 70 65 73 20  0,....dataTypes 
3a850 3d 20 64 61 74 61 54 79 70 65 45 78 70 72 65 73  = dataTypeExpres
3a860 73 69 6f 6e 2e 74 6f 4c 6f 77 65 72 43 61 73 65  sion.toLowerCase
3a870 28 29 2e 6d 61 74 63 68 28 20 72 6e 6f 74 68 74  ().match( rnotht
3a880 6d 6c 77 68 69 74 65 20 29 20 7c 7c 20 5b 5d 3b  mlwhite ) || [];
3a890 0a 0a 09 09 69 66 20 28 20 69 73 46 75 6e 63 74  ....if ( isFunct
3a8a0 69 6f 6e 28 20 66 75 6e 63 20 29 20 29 20 7b 0a  ion( func ) ) {.
3a8b0 0a 09 09 09 2f 2f 20 46 6f 72 20 65 61 63 68 20  ....// For each 
3a8c0 64 61 74 61 54 79 70 65 20 69 6e 20 74 68 65 20  dataType in the 
3a8d0 64 61 74 61 54 79 70 65 45 78 70 72 65 73 73 69  dataTypeExpressi
3a8e0 6f 6e 0a 09 09 09 77 68 69 6c 65 20 28 20 28 20  on....while ( ( 
3a8f0 64 61 74 61 54 79 70 65 20 3d 20 64 61 74 61 54  dataType = dataT
3a900 79 70 65 73 5b 20 69 2b 2b 20 5d 20 29 20 29 20  ypes[ i++ ] ) ) 
3a910 7b 0a 0a 09 09 09 09 2f 2f 20 50 72 65 70 65 6e  {......// Prepen
3a920 64 20 69 66 20 72 65 71 75 65 73 74 65 64 0a 09  d if requested..
3a930 09 09 09 69 66 20 28 20 64 61 74 61 54 79 70 65  ...if ( dataType
3a940 5b 20 30 20 5d 20 3d 3d 3d 20 22 2b 22 20 29 20  [ 0 ] === "+" ) 
3a950 7b 0a 09 09 09 09 09 64 61 74 61 54 79 70 65 20  {......dataType 
3a960 3d 20 64 61 74 61 54 79 70 65 2e 73 6c 69 63 65  = dataType.slice
3a970 28 20 31 20 29 20 7c 7c 20 22 2a 22 3b 0a 09 09  ( 1 ) || "*";...
3a980 09 09 09 28 20 73 74 72 75 63 74 75 72 65 5b 20  ...( structure[ 
3a990 64 61 74 61 54 79 70 65 20 5d 20 3d 20 73 74 72  dataType ] = str
3a9a0 75 63 74 75 72 65 5b 20 64 61 74 61 54 79 70 65  ucture[ dataType
3a9b0 20 5d 20 7c 7c 20 5b 5d 20 29 2e 75 6e 73 68 69   ] || [] ).unshi
3a9c0 66 74 28 20 66 75 6e 63 20 29 3b 0a 0a 09 09 09  ft( func );.....
3a9d0 09 2f 2f 20 4f 74 68 65 72 77 69 73 65 20 61 70  .// Otherwise ap
3a9e0 70 65 6e 64 0a 09 09 09 09 7d 20 65 6c 73 65 20  pend.....} else 
3a9f0 7b 0a 09 09 09 09 09 28 20 73 74 72 75 63 74 75  {......( structu
3aa00 72 65 5b 20 64 61 74 61 54 79 70 65 20 5d 20 3d  re[ dataType ] =
3aa10 20 73 74 72 75 63 74 75 72 65 5b 20 64 61 74 61   structure[ data
3aa20 54 79 70 65 20 5d 20 7c 7c 20 5b 5d 20 29 2e 70  Type ] || [] ).p
3aa30 75 73 68 28 20 66 75 6e 63 20 29 3b 0a 09 09 09  ush( func );....
3aa40 09 7d 0a 09 09 09 7d 0a 09 09 7d 0a 09 7d 3b 0a  .}....}...}..};.
3aa50 7d 0a 0a 2f 2f 20 42 61 73 65 20 69 6e 73 70 65  }..// Base inspe
3aa60 63 74 69 6f 6e 20 66 75 6e 63 74 69 6f 6e 20 66  ction function f
3aa70 6f 72 20 70 72 65 66 69 6c 74 65 72 73 20 61 6e  or prefilters an
3aa80 64 20 74 72 61 6e 73 70 6f 72 74 73 0a 66 75 6e  d transports.fun
3aa90 63 74 69 6f 6e 20 69 6e 73 70 65 63 74 50 72 65  ction inspectPre
3aaa0 66 69 6c 74 65 72 73 4f 72 54 72 61 6e 73 70 6f  filtersOrTranspo
3aab0 72 74 73 28 20 73 74 72 75 63 74 75 72 65 2c 20  rts( structure, 
3aac0 6f 70 74 69 6f 6e 73 2c 20 6f 72 69 67 69 6e 61  options, origina
3aad0 6c 4f 70 74 69 6f 6e 73 2c 20 6a 71 58 48 52 20  lOptions, jqXHR 
3aae0 29 20 7b 0a 0a 09 76 61 72 20 69 6e 73 70 65 63  ) {...var inspec
3aaf0 74 65 64 20 3d 20 7b 7d 2c 0a 09 09 73 65 65 6b  ted = {},...seek
3ab00 69 6e 67 54 72 61 6e 73 70 6f 72 74 20 3d 20 28  ingTransport = (
3ab10 20 73 74 72 75 63 74 75 72 65 20 3d 3d 3d 20 74   structure === t
3ab20 72 61 6e 73 70 6f 72 74 73 20 29 3b 0a 0a 09 66  ransports );...f
3ab30 75 6e 63 74 69 6f 6e 20 69 6e 73 70 65 63 74 28  unction inspect(
3ab40 20 64 61 74 61 54 79 70 65 20 29 20 7b 0a 09 09   dataType ) {...
3ab50 76 61 72 20 73 65 6c 65 63 74 65 64 3b 0a 09 09  var selected;...
3ab60 69 6e 73 70 65 63 74 65 64 5b 20 64 61 74 61 54  inspected[ dataT
3ab70 79 70 65 20 5d 20 3d 20 74 72 75 65 3b 0a 09 09  ype ] = true;...
3ab80 6a 51 75 65 72 79 2e 65 61 63 68 28 20 73 74 72  jQuery.each( str
3ab90 75 63 74 75 72 65 5b 20 64 61 74 61 54 79 70 65  ucture[ dataType
3aba0 20 5d 20 7c 7c 20 5b 5d 2c 20 66 75 6e 63 74 69   ] || [], functi
3abb0 6f 6e 28 20 5f 2c 20 70 72 65 66 69 6c 74 65 72  on( _, prefilter
3abc0 4f 72 46 61 63 74 6f 72 79 20 29 20 7b 0a 09 09  OrFactory ) {...
3abd0 09 76 61 72 20 64 61 74 61 54 79 70 65 4f 72 54  .var dataTypeOrT
3abe0 72 61 6e 73 70 6f 72 74 20 3d 20 70 72 65 66 69  ransport = prefi
3abf0 6c 74 65 72 4f 72 46 61 63 74 6f 72 79 28 20 6f  lterOrFactory( o
3ac00 70 74 69 6f 6e 73 2c 20 6f 72 69 67 69 6e 61 6c  ptions, original
3ac10 4f 70 74 69 6f 6e 73 2c 20 6a 71 58 48 52 20 29  Options, jqXHR )
3ac20 3b 0a 09 09 09 69 66 20 28 20 74 79 70 65 6f 66  ;....if ( typeof
3ac30 20 64 61 74 61 54 79 70 65 4f 72 54 72 61 6e 73   dataTypeOrTrans
3ac40 70 6f 72 74 20 3d 3d 3d 20 22 73 74 72 69 6e 67  port === "string
3ac50 22 20 26 26 0a 09 09 09 09 21 73 65 65 6b 69 6e  " &&.....!seekin
3ac60 67 54 72 61 6e 73 70 6f 72 74 20 26 26 20 21 69  gTransport && !i
3ac70 6e 73 70 65 63 74 65 64 5b 20 64 61 74 61 54 79  nspected[ dataTy
3ac80 70 65 4f 72 54 72 61 6e 73 70 6f 72 74 20 5d 20  peOrTransport ] 
3ac90 29 20 7b 0a 0a 09 09 09 09 6f 70 74 69 6f 6e 73  ) {......options
3aca0 2e 64 61 74 61 54 79 70 65 73 2e 75 6e 73 68 69  .dataTypes.unshi
3acb0 66 74 28 20 64 61 74 61 54 79 70 65 4f 72 54 72  ft( dataTypeOrTr
3acc0 61 6e 73 70 6f 72 74 20 29 3b 0a 09 09 09 09 69  ansport );.....i
3acd0 6e 73 70 65 63 74 28 20 64 61 74 61 54 79 70 65  nspect( dataType
3ace0 4f 72 54 72 61 6e 73 70 6f 72 74 20 29 3b 0a 09  OrTransport );..
3acf0 09 09 09 72 65 74 75 72 6e 20 66 61 6c 73 65 3b  ...return false;
3ad00 0a 09 09 09 7d 20 65 6c 73 65 20 69 66 20 28 20  ....} else if ( 
3ad10 73 65 65 6b 69 6e 67 54 72 61 6e 73 70 6f 72 74  seekingTransport
3ad20 20 29 20 7b 0a 09 09 09 09 72 65 74 75 72 6e 20   ) {.....return 
3ad30 21 28 20 73 65 6c 65 63 74 65 64 20 3d 20 64 61  !( selected = da
3ad40 74 61 54 79 70 65 4f 72 54 72 61 6e 73 70 6f 72  taTypeOrTranspor
3ad50 74 20 29 3b 0a 09 09 09 7d 0a 09 09 7d 20 29 3b  t );....}...} );
3ad60 0a 09 09 72 65 74 75 72 6e 20 73 65 6c 65 63 74  ...return select
3ad70 65 64 3b 0a 09 7d 0a 0a 09 72 65 74 75 72 6e 20  ed;..}...return 
3ad80 69 6e 73 70 65 63 74 28 20 6f 70 74 69 6f 6e 73  inspect( options
3ad90 2e 64 61 74 61 54 79 70 65 73 5b 20 30 20 5d 20  .dataTypes[ 0 ] 
3ada0 29 20 7c 7c 20 21 69 6e 73 70 65 63 74 65 64 5b  ) || !inspected[
3adb0 20 22 2a 22 20 5d 20 26 26 20 69 6e 73 70 65 63   "*" ] && inspec
3adc0 74 28 20 22 2a 22 20 29 3b 0a 7d 0a 0a 2f 2f 20  t( "*" );.}..// 
3add0 41 20 73 70 65 63 69 61 6c 20 65 78 74 65 6e 64  A special extend
3ade0 20 66 6f 72 20 61 6a 61 78 20 6f 70 74 69 6f 6e   for ajax option
3adf0 73 0a 2f 2f 20 74 68 61 74 20 74 61 6b 65 73 20  s.// that takes 
3ae00 22 66 6c 61 74 22 20 6f 70 74 69 6f 6e 73 20 28  "flat" options (
3ae10 6e 6f 74 20 74 6f 20 62 65 20 64 65 65 70 20 65  not to be deep e
3ae20 78 74 65 6e 64 65 64 29 0a 2f 2f 20 46 69 78 65  xtended).// Fixe
3ae30 73 20 23 39 38 38 37 0a 66 75 6e 63 74 69 6f 6e  s #9887.function
3ae40 20 61 6a 61 78 45 78 74 65 6e 64 28 20 74 61 72   ajaxExtend( tar
3ae50 67 65 74 2c 20 73 72 63 20 29 20 7b 0a 09 76 61  get, src ) {..va
3ae60 72 20 6b 65 79 2c 20 64 65 65 70 2c 0a 09 09 66  r key, deep,...f
3ae70 6c 61 74 4f 70 74 69 6f 6e 73 20 3d 20 6a 51 75  latOptions = jQu
3ae80 65 72 79 2e 61 6a 61 78 53 65 74 74 69 6e 67 73  ery.ajaxSettings
3ae90 2e 66 6c 61 74 4f 70 74 69 6f 6e 73 20 7c 7c 20  .flatOptions || 
3aea0 7b 7d 3b 0a 0a 09 66 6f 72 20 28 20 6b 65 79 20  {};...for ( key 
3aeb0 69 6e 20 73 72 63 20 29 20 7b 0a 09 09 69 66 20  in src ) {...if 
3aec0 28 20 73 72 63 5b 20 6b 65 79 20 5d 20 21 3d 3d  ( src[ key ] !==
3aed0 20 75 6e 64 65 66 69 6e 65 64 20 29 20 7b 0a 09   undefined ) {..
3aee0 09 09 28 20 66 6c 61 74 4f 70 74 69 6f 6e 73 5b  ..( flatOptions[
3aef0 20 6b 65 79 20 5d 20 3f 20 74 61 72 67 65 74 20   key ] ? target 
3af00 3a 20 28 20 64 65 65 70 20 7c 7c 20 28 20 64 65  : ( deep || ( de
3af10 65 70 20 3d 20 7b 7d 20 29 20 29 20 29 5b 20 6b  ep = {} ) ) )[ k
3af20 65 79 20 5d 20 3d 20 73 72 63 5b 20 6b 65 79 20  ey ] = src[ key 
3af30 5d 3b 0a 09 09 7d 0a 09 7d 0a 09 69 66 20 28 20  ];...}..}..if ( 
3af40 64 65 65 70 20 29 20 7b 0a 09 09 6a 51 75 65 72  deep ) {...jQuer
3af50 79 2e 65 78 74 65 6e 64 28 20 74 72 75 65 2c 20  y.extend( true, 
3af60 74 61 72 67 65 74 2c 20 64 65 65 70 20 29 3b 0a  target, deep );.
3af70 09 7d 0a 0a 09 72 65 74 75 72 6e 20 74 61 72 67  .}...return targ
3af80 65 74 3b 0a 7d 0a 0a 2f 2a 20 48 61 6e 64 6c 65  et;.}../* Handle
3af90 73 20 72 65 73 70 6f 6e 73 65 73 20 74 6f 20 61  s responses to a
3afa0 6e 20 61 6a 61 78 20 72 65 71 75 65 73 74 3a 0a  n ajax request:.
3afb0 20 2a 20 2d 20 66 69 6e 64 73 20 74 68 65 20 72   * - finds the r
3afc0 69 67 68 74 20 64 61 74 61 54 79 70 65 20 28 6d  ight dataType (m
3afd0 65 64 69 61 74 65 73 20 62 65 74 77 65 65 6e 20  ediates between 
3afe0 63 6f 6e 74 65 6e 74 2d 74 79 70 65 20 61 6e 64  content-type and
3aff0 20 65 78 70 65 63 74 65 64 20 64 61 74 61 54 79   expected dataTy
3b000 70 65 29 0a 20 2a 20 2d 20 72 65 74 75 72 6e 73  pe). * - returns
3b010 20 74 68 65 20 63 6f 72 72 65 73 70 6f 6e 64 69   the correspondi
3b020 6e 67 20 72 65 73 70 6f 6e 73 65 0a 20 2a 2f 0a  ng response. */.
3b030 66 75 6e 63 74 69 6f 6e 20 61 6a 61 78 48 61 6e  function ajaxHan
3b040 64 6c 65 52 65 73 70 6f 6e 73 65 73 28 20 73 2c  dleResponses( s,
3b050 20 6a 71 58 48 52 2c 20 72 65 73 70 6f 6e 73 65   jqXHR, response
3b060 73 20 29 20 7b 0a 0a 09 76 61 72 20 63 74 2c 20  s ) {...var ct, 
3b070 74 79 70 65 2c 20 66 69 6e 61 6c 44 61 74 61 54  type, finalDataT
3b080 79 70 65 2c 20 66 69 72 73 74 44 61 74 61 54 79  ype, firstDataTy
3b090 70 65 2c 0a 09 09 63 6f 6e 74 65 6e 74 73 20 3d  pe,...contents =
3b0a0 20 73 2e 63 6f 6e 74 65 6e 74 73 2c 0a 09 09 64   s.contents,...d
3b0b0 61 74 61 54 79 70 65 73 20 3d 20 73 2e 64 61 74  ataTypes = s.dat
3b0c0 61 54 79 70 65 73 3b 0a 0a 09 2f 2f 20 52 65 6d  aTypes;...// Rem
3b0d0 6f 76 65 20 61 75 74 6f 20 64 61 74 61 54 79 70  ove auto dataTyp
3b0e0 65 20 61 6e 64 20 67 65 74 20 63 6f 6e 74 65 6e  e and get conten
3b0f0 74 2d 74 79 70 65 20 69 6e 20 74 68 65 20 70 72  t-type in the pr
3b100 6f 63 65 73 73 0a 09 77 68 69 6c 65 20 28 20 64  ocess..while ( d
3b110 61 74 61 54 79 70 65 73 5b 20 30 20 5d 20 3d 3d  ataTypes[ 0 ] ==
3b120 3d 20 22 2a 22 20 29 20 7b 0a 09 09 64 61 74 61  = "*" ) {...data
3b130 54 79 70 65 73 2e 73 68 69 66 74 28 29 3b 0a 09  Types.shift();..
3b140 09 69 66 20 28 20 63 74 20 3d 3d 3d 20 75 6e 64  .if ( ct === und
3b150 65 66 69 6e 65 64 20 29 20 7b 0a 09 09 09 63 74  efined ) {....ct
3b160 20 3d 20 73 2e 6d 69 6d 65 54 79 70 65 20 7c 7c   = s.mimeType ||
3b170 20 6a 71 58 48 52 2e 67 65 74 52 65 73 70 6f 6e   jqXHR.getRespon
3b180 73 65 48 65 61 64 65 72 28 20 22 43 6f 6e 74 65  seHeader( "Conte
3b190 6e 74 2d 54 79 70 65 22 20 29 3b 0a 09 09 7d 0a  nt-Type" );...}.
3b1a0 09 7d 0a 0a 09 2f 2f 20 43 68 65 63 6b 20 69 66  .}...// Check if
3b1b0 20 77 65 27 72 65 20 64 65 61 6c 69 6e 67 20 77   we're dealing w
3b1c0 69 74 68 20 61 20 6b 6e 6f 77 6e 20 63 6f 6e 74  ith a known cont
3b1d0 65 6e 74 2d 74 79 70 65 0a 09 69 66 20 28 20 63  ent-type..if ( c
3b1e0 74 20 29 20 7b 0a 09 09 66 6f 72 20 28 20 74 79  t ) {...for ( ty
3b1f0 70 65 20 69 6e 20 63 6f 6e 74 65 6e 74 73 20 29  pe in contents )
3b200 20 7b 0a 09 09 09 69 66 20 28 20 63 6f 6e 74 65   {....if ( conte
3b210 6e 74 73 5b 20 74 79 70 65 20 5d 20 26 26 20 63  nts[ type ] && c
3b220 6f 6e 74 65 6e 74 73 5b 20 74 79 70 65 20 5d 2e  ontents[ type ].
3b230 74 65 73 74 28 20 63 74 20 29 20 29 20 7b 0a 09  test( ct ) ) {..
3b240 09 09 09 64 61 74 61 54 79 70 65 73 2e 75 6e 73  ...dataTypes.uns
3b250 68 69 66 74 28 20 74 79 70 65 20 29 3b 0a 09 09  hift( type );...
3b260 09 09 62 72 65 61 6b 3b 0a 09 09 09 7d 0a 09 09  ..break;....}...
3b270 7d 0a 09 7d 0a 0a 09 2f 2f 20 43 68 65 63 6b 20  }..}...// Check 
3b280 74 6f 20 73 65 65 20 69 66 20 77 65 20 68 61 76  to see if we hav
3b290 65 20 61 20 72 65 73 70 6f 6e 73 65 20 66 6f 72  e a response for
3b2a0 20 74 68 65 20 65 78 70 65 63 74 65 64 20 64 61   the expected da
3b2b0 74 61 54 79 70 65 0a 09 69 66 20 28 20 64 61 74  taType..if ( dat
3b2c0 61 54 79 70 65 73 5b 20 30 20 5d 20 69 6e 20 72  aTypes[ 0 ] in r
3b2d0 65 73 70 6f 6e 73 65 73 20 29 20 7b 0a 09 09 66  esponses ) {...f
3b2e0 69 6e 61 6c 44 61 74 61 54 79 70 65 20 3d 20 64  inalDataType = d
3b2f0 61 74 61 54 79 70 65 73 5b 20 30 20 5d 3b 0a 09  ataTypes[ 0 ];..
3b300 7d 20 65 6c 73 65 20 7b 0a 0a 09 09 2f 2f 20 54  } else {....// T
3b310 72 79 20 63 6f 6e 76 65 72 74 69 62 6c 65 20 64  ry convertible d
3b320 61 74 61 54 79 70 65 73 0a 09 09 66 6f 72 20 28  ataTypes...for (
3b330 20 74 79 70 65 20 69 6e 20 72 65 73 70 6f 6e 73   type in respons
3b340 65 73 20 29 20 7b 0a 09 09 09 69 66 20 28 20 21  es ) {....if ( !
3b350 64 61 74 61 54 79 70 65 73 5b 20 30 20 5d 20 7c  dataTypes[ 0 ] |
3b360 7c 20 73 2e 63 6f 6e 76 65 72 74 65 72 73 5b 20  | s.converters[ 
3b370 74 79 70 65 20 2b 20 22 20 22 20 2b 20 64 61 74  type + " " + dat
3b380 61 54 79 70 65 73 5b 20 30 20 5d 20 5d 20 29 20  aTypes[ 0 ] ] ) 
3b390 7b 0a 09 09 09 09 66 69 6e 61 6c 44 61 74 61 54  {.....finalDataT
3b3a0 79 70 65 20 3d 20 74 79 70 65 3b 0a 09 09 09 09  ype = type;.....
3b3b0 62 72 65 61 6b 3b 0a 09 09 09 7d 0a 09 09 09 69  break;....}....i
3b3c0 66 20 28 20 21 66 69 72 73 74 44 61 74 61 54 79  f ( !firstDataTy
3b3d0 70 65 20 29 20 7b 0a 09 09 09 09 66 69 72 73 74  pe ) {.....first
3b3e0 44 61 74 61 54 79 70 65 20 3d 20 74 79 70 65 3b  DataType = type;
3b3f0 0a 09 09 09 7d 0a 09 09 7d 0a 0a 09 09 2f 2f 20  ....}...}....// 
3b400 4f 72 20 6a 75 73 74 20 75 73 65 20 66 69 72 73  Or just use firs
3b410 74 20 6f 6e 65 0a 09 09 66 69 6e 61 6c 44 61 74  t one...finalDat
3b420 61 54 79 70 65 20 3d 20 66 69 6e 61 6c 44 61 74  aType = finalDat
3b430 61 54 79 70 65 20 7c 7c 20 66 69 72 73 74 44 61  aType || firstDa
3b440 74 61 54 79 70 65 3b 0a 09 7d 0a 0a 09 2f 2f 20  taType;..}...// 
3b450 49 66 20 77 65 20 66 6f 75 6e 64 20 61 20 64 61  If we found a da
3b460 74 61 54 79 70 65 0a 09 2f 2f 20 57 65 20 61 64  taType..// We ad
3b470 64 20 74 68 65 20 64 61 74 61 54 79 70 65 20 74  d the dataType t
3b480 6f 20 74 68 65 20 6c 69 73 74 20 69 66 20 6e 65  o the list if ne
3b490 65 64 65 64 0a 09 2f 2f 20 61 6e 64 20 72 65 74  eded..// and ret
3b4a0 75 72 6e 20 74 68 65 20 63 6f 72 72 65 73 70 6f  urn the correspo
3b4b0 6e 64 69 6e 67 20 72 65 73 70 6f 6e 73 65 0a 09  nding response..
3b4c0 69 66 20 28 20 66 69 6e 61 6c 44 61 74 61 54 79  if ( finalDataTy
3b4d0 70 65 20 29 20 7b 0a 09 09 69 66 20 28 20 66 69  pe ) {...if ( fi
3b4e0 6e 61 6c 44 61 74 61 54 79 70 65 20 21 3d 3d 20  nalDataType !== 
3b4f0 64 61 74 61 54 79 70 65 73 5b 20 30 20 5d 20 29  dataTypes[ 0 ] )
3b500 20 7b 0a 09 09 09 64 61 74 61 54 79 70 65 73 2e   {....dataTypes.
3b510 75 6e 73 68 69 66 74 28 20 66 69 6e 61 6c 44 61  unshift( finalDa
3b520 74 61 54 79 70 65 20 29 3b 0a 09 09 7d 0a 09 09  taType );...}...
3b530 72 65 74 75 72 6e 20 72 65 73 70 6f 6e 73 65 73  return responses
3b540 5b 20 66 69 6e 61 6c 44 61 74 61 54 79 70 65 20  [ finalDataType 
3b550 5d 3b 0a 09 7d 0a 7d 0a 0a 2f 2a 20 43 68 61 69  ];..}.}../* Chai
3b560 6e 20 63 6f 6e 76 65 72 73 69 6f 6e 73 20 67 69  n conversions gi
3b570 76 65 6e 20 74 68 65 20 72 65 71 75 65 73 74 20  ven the request 
3b580 61 6e 64 20 74 68 65 20 6f 72 69 67 69 6e 61 6c  and the original
3b590 20 72 65 73 70 6f 6e 73 65 0a 20 2a 20 41 6c 73   response. * Als
3b5a0 6f 20 73 65 74 73 20 74 68 65 20 72 65 73 70 6f  o sets the respo
3b5b0 6e 73 65 58 58 58 20 66 69 65 6c 64 73 20 6f 6e  nseXXX fields on
3b5c0 20 74 68 65 20 6a 71 58 48 52 20 69 6e 73 74 61   the jqXHR insta
3b5d0 6e 63 65 0a 20 2a 2f 0a 66 75 6e 63 74 69 6f 6e  nce. */.function
3b5e0 20 61 6a 61 78 43 6f 6e 76 65 72 74 28 20 73 2c   ajaxConvert( s,
3b5f0 20 72 65 73 70 6f 6e 73 65 2c 20 6a 71 58 48 52   response, jqXHR
3b600 2c 20 69 73 53 75 63 63 65 73 73 20 29 20 7b 0a  , isSuccess ) {.
3b610 09 76 61 72 20 63 6f 6e 76 32 2c 20 63 75 72 72  .var conv2, curr
3b620 65 6e 74 2c 20 63 6f 6e 76 2c 20 74 6d 70 2c 20  ent, conv, tmp, 
3b630 70 72 65 76 2c 0a 09 09 63 6f 6e 76 65 72 74 65  prev,...converte
3b640 72 73 20 3d 20 7b 7d 2c 0a 0a 09 09 2f 2f 20 57  rs = {},....// W
3b650 6f 72 6b 20 77 69 74 68 20 61 20 63 6f 70 79 20  ork with a copy 
3b660 6f 66 20 64 61 74 61 54 79 70 65 73 20 69 6e 20  of dataTypes in 
3b670 63 61 73 65 20 77 65 20 6e 65 65 64 20 74 6f 20  case we need to 
3b680 6d 6f 64 69 66 79 20 69 74 20 66 6f 72 20 63 6f  modify it for co
3b690 6e 76 65 72 73 69 6f 6e 0a 09 09 64 61 74 61 54  nversion...dataT
3b6a0 79 70 65 73 20 3d 20 73 2e 64 61 74 61 54 79 70  ypes = s.dataTyp
3b6b0 65 73 2e 73 6c 69 63 65 28 29 3b 0a 0a 09 2f 2f  es.slice();...//
3b6c0 20 43 72 65 61 74 65 20 63 6f 6e 76 65 72 74 65   Create converte
3b6d0 72 73 20 6d 61 70 20 77 69 74 68 20 6c 6f 77 65  rs map with lowe
3b6e0 72 63 61 73 65 64 20 6b 65 79 73 0a 09 69 66 20  rcased keys..if 
3b6f0 28 20 64 61 74 61 54 79 70 65 73 5b 20 31 20 5d  ( dataTypes[ 1 ]
3b700 20 29 20 7b 0a 09 09 66 6f 72 20 28 20 63 6f 6e   ) {...for ( con
3b710 76 20 69 6e 20 73 2e 63 6f 6e 76 65 72 74 65 72  v in s.converter
3b720 73 20 29 20 7b 0a 09 09 09 63 6f 6e 76 65 72 74  s ) {....convert
3b730 65 72 73 5b 20 63 6f 6e 76 2e 74 6f 4c 6f 77 65  ers[ conv.toLowe
3b740 72 43 61 73 65 28 29 20 5d 20 3d 20 73 2e 63 6f  rCase() ] = s.co
3b750 6e 76 65 72 74 65 72 73 5b 20 63 6f 6e 76 20 5d  nverters[ conv ]
3b760 3b 0a 09 09 7d 0a 09 7d 0a 0a 09 63 75 72 72 65  ;...}..}...curre
3b770 6e 74 20 3d 20 64 61 74 61 54 79 70 65 73 2e 73  nt = dataTypes.s
3b780 68 69 66 74 28 29 3b 0a 0a 09 2f 2f 20 43 6f 6e  hift();...// Con
3b790 76 65 72 74 20 74 6f 20 65 61 63 68 20 73 65 71  vert to each seq
3b7a0 75 65 6e 74 69 61 6c 20 64 61 74 61 54 79 70 65  uential dataType
3b7b0 0a 09 77 68 69 6c 65 20 28 20 63 75 72 72 65 6e  ..while ( curren
3b7c0 74 20 29 20 7b 0a 0a 09 09 69 66 20 28 20 73 2e  t ) {....if ( s.
3b7d0 72 65 73 70 6f 6e 73 65 46 69 65 6c 64 73 5b 20  responseFields[ 
3b7e0 63 75 72 72 65 6e 74 20 5d 20 29 20 7b 0a 09 09  current ] ) {...
3b7f0 09 6a 71 58 48 52 5b 20 73 2e 72 65 73 70 6f 6e  .jqXHR[ s.respon
3b800 73 65 46 69 65 6c 64 73 5b 20 63 75 72 72 65 6e  seFields[ curren
3b810 74 20 5d 20 5d 20 3d 20 72 65 73 70 6f 6e 73 65  t ] ] = response
3b820 3b 0a 09 09 7d 0a 0a 09 09 2f 2f 20 41 70 70 6c  ;...}....// Appl
3b830 79 20 74 68 65 20 64 61 74 61 46 69 6c 74 65 72  y the dataFilter
3b840 20 69 66 20 70 72 6f 76 69 64 65 64 0a 09 09 69   if provided...i
3b850 66 20 28 20 21 70 72 65 76 20 26 26 20 69 73 53  f ( !prev && isS
3b860 75 63 63 65 73 73 20 26 26 20 73 2e 64 61 74 61  uccess && s.data
3b870 46 69 6c 74 65 72 20 29 20 7b 0a 09 09 09 72 65  Filter ) {....re
3b880 73 70 6f 6e 73 65 20 3d 20 73 2e 64 61 74 61 46  sponse = s.dataF
3b890 69 6c 74 65 72 28 20 72 65 73 70 6f 6e 73 65 2c  ilter( response,
3b8a0 20 73 2e 64 61 74 61 54 79 70 65 20 29 3b 0a 09   s.dataType );..
3b8b0 09 7d 0a 0a 09 09 70 72 65 76 20 3d 20 63 75 72  .}....prev = cur
3b8c0 72 65 6e 74 3b 0a 09 09 63 75 72 72 65 6e 74 20  rent;...current 
3b8d0 3d 20 64 61 74 61 54 79 70 65 73 2e 73 68 69 66  = dataTypes.shif
3b8e0 74 28 29 3b 0a 0a 09 09 69 66 20 28 20 63 75 72  t();....if ( cur
3b8f0 72 65 6e 74 20 29 20 7b 0a 0a 09 09 09 2f 2f 20  rent ) {.....// 
3b900 54 68 65 72 65 27 73 20 6f 6e 6c 79 20 77 6f 72  There's only wor
3b910 6b 20 74 6f 20 64 6f 20 69 66 20 63 75 72 72 65  k to do if curre
3b920 6e 74 20 64 61 74 61 54 79 70 65 20 69 73 20 6e  nt dataType is n
3b930 6f 6e 2d 61 75 74 6f 0a 09 09 09 69 66 20 28 20  on-auto....if ( 
3b940 63 75 72 72 65 6e 74 20 3d 3d 3d 20 22 2a 22 20  current === "*" 
3b950 29 20 7b 0a 0a 09 09 09 09 63 75 72 72 65 6e 74  ) {......current
3b960 20 3d 20 70 72 65 76 3b 0a 0a 09 09 09 2f 2f 20   = prev;.....// 
3b970 43 6f 6e 76 65 72 74 20 72 65 73 70 6f 6e 73 65  Convert response
3b980 20 69 66 20 70 72 65 76 20 64 61 74 61 54 79 70   if prev dataTyp
3b990 65 20 69 73 20 6e 6f 6e 2d 61 75 74 6f 20 61 6e  e is non-auto an
3b9a0 64 20 64 69 66 66 65 72 73 20 66 72 6f 6d 20 63  d differs from c
3b9b0 75 72 72 65 6e 74 0a 09 09 09 7d 20 65 6c 73 65  urrent....} else
3b9c0 20 69 66 20 28 20 70 72 65 76 20 21 3d 3d 20 22   if ( prev !== "
3b9d0 2a 22 20 26 26 20 70 72 65 76 20 21 3d 3d 20 63  *" && prev !== c
3b9e0 75 72 72 65 6e 74 20 29 20 7b 0a 0a 09 09 09 09  urrent ) {......
3b9f0 2f 2f 20 53 65 65 6b 20 61 20 64 69 72 65 63 74  // Seek a direct
3ba00 20 63 6f 6e 76 65 72 74 65 72 0a 09 09 09 09 63   converter.....c
3ba10 6f 6e 76 20 3d 20 63 6f 6e 76 65 72 74 65 72 73  onv = converters
3ba20 5b 20 70 72 65 76 20 2b 20 22 20 22 20 2b 20 63  [ prev + " " + c
3ba30 75 72 72 65 6e 74 20 5d 20 7c 7c 20 63 6f 6e 76  urrent ] || conv
3ba40 65 72 74 65 72 73 5b 20 22 2a 20 22 20 2b 20 63  erters[ "* " + c
3ba50 75 72 72 65 6e 74 20 5d 3b 0a 0a 09 09 09 09 2f  urrent ];....../
3ba60 2f 20 49 66 20 6e 6f 6e 65 20 66 6f 75 6e 64 2c  / If none found,
3ba70 20 73 65 65 6b 20 61 20 70 61 69 72 0a 09 09 09   seek a pair....
3ba80 09 69 66 20 28 20 21 63 6f 6e 76 20 29 20 7b 0a  .if ( !conv ) {.
3ba90 09 09 09 09 09 66 6f 72 20 28 20 63 6f 6e 76 32  .....for ( conv2
3baa0 20 69 6e 20 63 6f 6e 76 65 72 74 65 72 73 20 29   in converters )
3bab0 20 7b 0a 0a 09 09 09 09 09 09 2f 2f 20 49 66 20   {........// If 
3bac0 63 6f 6e 76 32 20 6f 75 74 70 75 74 73 20 63 75  conv2 outputs cu
3bad0 72 72 65 6e 74 0a 09 09 09 09 09 09 74 6d 70 20  rrent.......tmp 
3bae0 3d 20 63 6f 6e 76 32 2e 73 70 6c 69 74 28 20 22  = conv2.split( "
3baf0 20 22 20 29 3b 0a 09 09 09 09 09 09 69 66 20 28   " );.......if (
3bb00 20 74 6d 70 5b 20 31 20 5d 20 3d 3d 3d 20 63 75   tmp[ 1 ] === cu
3bb10 72 72 65 6e 74 20 29 20 7b 0a 0a 09 09 09 09 09  rrent ) {.......
3bb20 09 09 2f 2f 20 49 66 20 70 72 65 76 20 63 61 6e  ..// If prev can
3bb30 20 62 65 20 63 6f 6e 76 65 72 74 65 64 20 74 6f   be converted to
3bb40 20 61 63 63 65 70 74 65 64 20 69 6e 70 75 74 0a   accepted input.
3bb50 09 09 09 09 09 09 09 63 6f 6e 76 20 3d 20 63 6f  .......conv = co
3bb60 6e 76 65 72 74 65 72 73 5b 20 70 72 65 76 20 2b  nverters[ prev +
3bb70 20 22 20 22 20 2b 20 74 6d 70 5b 20 30 20 5d 20   " " + tmp[ 0 ] 
3bb80 5d 20 7c 7c 0a 09 09 09 09 09 09 09 09 63 6f 6e  ] ||.........con
3bb90 76 65 72 74 65 72 73 5b 20 22 2a 20 22 20 2b 20  verters[ "* " + 
3bba0 74 6d 70 5b 20 30 20 5d 20 5d 3b 0a 09 09 09 09  tmp[ 0 ] ];.....
3bbb0 09 09 09 69 66 20 28 20 63 6f 6e 76 20 29 20 7b  ...if ( conv ) {
3bbc0 0a 0a 09 09 09 09 09 09 09 09 2f 2f 20 43 6f 6e  ..........// Con
3bbd0 64 65 6e 73 65 20 65 71 75 69 76 61 6c 65 6e 63  dense equivalenc
3bbe0 65 20 63 6f 6e 76 65 72 74 65 72 73 0a 09 09 09  e converters....
3bbf0 09 09 09 09 09 69 66 20 28 20 63 6f 6e 76 20 3d  .....if ( conv =
3bc00 3d 3d 20 74 72 75 65 20 29 20 7b 0a 09 09 09 09  == true ) {.....
3bc10 09 09 09 09 09 63 6f 6e 76 20 3d 20 63 6f 6e 76  .....conv = conv
3bc20 65 72 74 65 72 73 5b 20 63 6f 6e 76 32 20 5d 3b  erters[ conv2 ];
3bc30 0a 0a 09 09 09 09 09 09 09 09 2f 2f 20 4f 74 68  ..........// Oth
3bc40 65 72 77 69 73 65 2c 20 69 6e 73 65 72 74 20 74  erwise, insert t
3bc50 68 65 20 69 6e 74 65 72 6d 65 64 69 61 74 65 20  he intermediate 
3bc60 64 61 74 61 54 79 70 65 0a 09 09 09 09 09 09 09  dataType........
3bc70 09 7d 20 65 6c 73 65 20 69 66 20 28 20 63 6f 6e  .} else if ( con
3bc80 76 65 72 74 65 72 73 5b 20 63 6f 6e 76 32 20 5d  verters[ conv2 ]
3bc90 20 21 3d 3d 20 74 72 75 65 20 29 20 7b 0a 09 09   !== true ) {...
3bca0 09 09 09 09 09 09 09 63 75 72 72 65 6e 74 20 3d  .......current =
3bcb0 20 74 6d 70 5b 20 30 20 5d 3b 0a 09 09 09 09 09   tmp[ 0 ];......
3bcc0 09 09 09 09 64 61 74 61 54 79 70 65 73 2e 75 6e  ....dataTypes.un
3bcd0 73 68 69 66 74 28 20 74 6d 70 5b 20 31 20 5d 20  shift( tmp[ 1 ] 
3bce0 29 3b 0a 09 09 09 09 09 09 09 09 7d 0a 09 09 09  );.........}....
3bcf0 09 09 09 09 09 62 72 65 61 6b 3b 0a 09 09 09 09  .....break;.....
3bd00 09 09 09 7d 0a 09 09 09 09 09 09 7d 0a 09 09 09  ...}.......}....
3bd10 09 09 7d 0a 09 09 09 09 7d 0a 0a 09 09 09 09 2f  ..}.....}....../
3bd20 2f 20 41 70 70 6c 79 20 63 6f 6e 76 65 72 74 65  / Apply converte
3bd30 72 20 28 69 66 20 6e 6f 74 20 61 6e 20 65 71 75  r (if not an equ
3bd40 69 76 61 6c 65 6e 63 65 29 0a 09 09 09 09 69 66  ivalence).....if
3bd50 20 28 20 63 6f 6e 76 20 21 3d 3d 20 74 72 75 65   ( conv !== true
3bd60 20 29 20 7b 0a 0a 09 09 09 09 09 2f 2f 20 55 6e   ) {.......// Un
3bd70 6c 65 73 73 20 65 72 72 6f 72 73 20 61 72 65 20  less errors are 
3bd80 61 6c 6c 6f 77 65 64 20 74 6f 20 62 75 62 62 6c  allowed to bubbl
3bd90 65 2c 20 63 61 74 63 68 20 61 6e 64 20 72 65 74  e, catch and ret
3bda0 75 72 6e 20 74 68 65 6d 0a 09 09 09 09 09 69 66  urn them......if
3bdb0 20 28 20 63 6f 6e 76 20 26 26 20 73 2e 74 68 72   ( conv && s.thr
3bdc0 6f 77 73 20 29 20 7b 0a 09 09 09 09 09 09 72 65  ows ) {.......re
3bdd0 73 70 6f 6e 73 65 20 3d 20 63 6f 6e 76 28 20 72  sponse = conv( r
3bde0 65 73 70 6f 6e 73 65 20 29 3b 0a 09 09 09 09 09  esponse );......
3bdf0 7d 20 65 6c 73 65 20 7b 0a 09 09 09 09 09 09 74  } else {.......t
3be00 72 79 20 7b 0a 09 09 09 09 09 09 09 72 65 73 70  ry {........resp
3be10 6f 6e 73 65 20 3d 20 63 6f 6e 76 28 20 72 65 73  onse = conv( res
3be20 70 6f 6e 73 65 20 29 3b 0a 09 09 09 09 09 09 7d  ponse );.......}
3be30 20 63 61 74 63 68 20 28 20 65 20 29 20 7b 0a 09   catch ( e ) {..
3be40 09 09 09 09 09 09 72 65 74 75 72 6e 20 7b 0a 09  ......return {..
3be50 09 09 09 09 09 09 09 73 74 61 74 65 3a 20 22 70  .......state: "p
3be60 61 72 73 65 72 65 72 72 6f 72 22 2c 0a 09 09 09  arsererror",....
3be70 09 09 09 09 09 65 72 72 6f 72 3a 20 63 6f 6e 76  .....error: conv
3be80 20 3f 20 65 20 3a 20 22 4e 6f 20 63 6f 6e 76 65   ? e : "No conve
3be90 72 73 69 6f 6e 20 66 72 6f 6d 20 22 20 2b 20 70  rsion from " + p
3bea0 72 65 76 20 2b 20 22 20 74 6f 20 22 20 2b 20 63  rev + " to " + c
3beb0 75 72 72 65 6e 74 0a 09 09 09 09 09 09 09 7d 3b  urrent........};
3bec0 0a 09 09 09 09 09 09 7d 0a 09 09 09 09 09 7d 0a  .......}......}.
3bed0 09 09 09 09 7d 0a 09 09 09 7d 0a 09 09 7d 0a 09  ....}....}...}..
3bee0 7d 0a 0a 09 72 65 74 75 72 6e 20 7b 20 73 74 61  }...return { sta
3bef0 74 65 3a 20 22 73 75 63 63 65 73 73 22 2c 20 64  te: "success", d
3bf00 61 74 61 3a 20 72 65 73 70 6f 6e 73 65 20 7d 3b  ata: response };
3bf10 0a 7d 0a 0a 6a 51 75 65 72 79 2e 65 78 74 65 6e  .}..jQuery.exten
3bf20 64 28 20 7b 0a 0a 09 2f 2f 20 43 6f 75 6e 74 65  d( {...// Counte
3bf30 72 20 66 6f 72 20 68 6f 6c 64 69 6e 67 20 74 68  r for holding th
3bf40 65 20 6e 75 6d 62 65 72 20 6f 66 20 61 63 74 69  e number of acti
3bf50 76 65 20 71 75 65 72 69 65 73 0a 09 61 63 74 69  ve queries..acti
3bf60 76 65 3a 20 30 2c 0a 0a 09 2f 2f 20 4c 61 73 74  ve: 0,...// Last
3bf70 2d 4d 6f 64 69 66 69 65 64 20 68 65 61 64 65 72  -Modified header
3bf80 20 63 61 63 68 65 20 66 6f 72 20 6e 65 78 74 20   cache for next 
3bf90 72 65 71 75 65 73 74 0a 09 6c 61 73 74 4d 6f 64  request..lastMod
3bfa0 69 66 69 65 64 3a 20 7b 7d 2c 0a 09 65 74 61 67  ified: {},..etag
3bfb0 3a 20 7b 7d 2c 0a 0a 09 61 6a 61 78 53 65 74 74  : {},...ajaxSett
3bfc0 69 6e 67 73 3a 20 7b 0a 09 09 75 72 6c 3a 20 6c  ings: {...url: l
3bfd0 6f 63 61 74 69 6f 6e 2e 68 72 65 66 2c 0a 09 09  ocation.href,...
3bfe0 74 79 70 65 3a 20 22 47 45 54 22 2c 0a 09 09 69  type: "GET",...i
3bff0 73 4c 6f 63 61 6c 3a 20 72 6c 6f 63 61 6c 50 72  sLocal: rlocalPr
3c000 6f 74 6f 63 6f 6c 2e 74 65 73 74 28 20 6c 6f 63  otocol.test( loc
3c010 61 74 69 6f 6e 2e 70 72 6f 74 6f 63 6f 6c 20 29  ation.protocol )
3c020 2c 0a 09 09 67 6c 6f 62 61 6c 3a 20 74 72 75 65  ,...global: true
3c030 2c 0a 09 09 70 72 6f 63 65 73 73 44 61 74 61 3a  ,...processData:
3c040 20 74 72 75 65 2c 0a 09 09 61 73 79 6e 63 3a 20   true,...async: 
3c050 74 72 75 65 2c 0a 09 09 63 6f 6e 74 65 6e 74 54  true,...contentT
3c060 79 70 65 3a 20 22 61 70 70 6c 69 63 61 74 69 6f  ype: "applicatio
3c070 6e 2f 78 2d 77 77 77 2d 66 6f 72 6d 2d 75 72 6c  n/x-www-form-url
3c080 65 6e 63 6f 64 65 64 3b 20 63 68 61 72 73 65 74  encoded; charset
3c090 3d 55 54 46 2d 38 22 2c 0a 0a 09 09 2f 2a 0a 09  =UTF-8",..../*..
3c0a0 09 74 69 6d 65 6f 75 74 3a 20 30 2c 0a 09 09 64  .timeout: 0,...d
3c0b0 61 74 61 3a 20 6e 75 6c 6c 2c 0a 09 09 64 61 74  ata: null,...dat
3c0c0 61 54 79 70 65 3a 20 6e 75 6c 6c 2c 0a 09 09 75  aType: null,...u
3c0d0 73 65 72 6e 61 6d 65 3a 20 6e 75 6c 6c 2c 0a 09  sername: null,..
3c0e0 09 70 61 73 73 77 6f 72 64 3a 20 6e 75 6c 6c 2c  .password: null,
3c0f0 0a 09 09 63 61 63 68 65 3a 20 6e 75 6c 6c 2c 0a  ...cache: null,.
3c100 09 09 74 68 72 6f 77 73 3a 20 66 61 6c 73 65 2c  ..throws: false,
3c110 0a 09 09 74 72 61 64 69 74 69 6f 6e 61 6c 3a 20  ...traditional: 
3c120 66 61 6c 73 65 2c 0a 09 09 68 65 61 64 65 72 73  false,...headers
3c130 3a 20 7b 7d 2c 0a 09 09 2a 2f 0a 0a 09 09 61 63  : {},...*/....ac
3c140 63 65 70 74 73 3a 20 7b 0a 09 09 09 22 2a 22 3a  cepts: {...."*":
3c150 20 61 6c 6c 54 79 70 65 73 2c 0a 09 09 09 74 65   allTypes,....te
3c160 78 74 3a 20 22 74 65 78 74 2f 70 6c 61 69 6e 22  xt: "text/plain"
3c170 2c 0a 09 09 09 68 74 6d 6c 3a 20 22 74 65 78 74  ,....html: "text
3c180 2f 68 74 6d 6c 22 2c 0a 09 09 09 78 6d 6c 3a 20  /html",....xml: 
3c190 22 61 70 70 6c 69 63 61 74 69 6f 6e 2f 78 6d 6c  "application/xml
3c1a0 2c 20 74 65 78 74 2f 78 6d 6c 22 2c 0a 09 09 09  , text/xml",....
3c1b0 6a 73 6f 6e 3a 20 22 61 70 70 6c 69 63 61 74 69  json: "applicati
3c1c0 6f 6e 2f 6a 73 6f 6e 2c 20 74 65 78 74 2f 6a 61  on/json, text/ja
3c1d0 76 61 73 63 72 69 70 74 22 0a 09 09 7d 2c 0a 0a  vascript"...},..
3c1e0 09 09 63 6f 6e 74 65 6e 74 73 3a 20 7b 0a 09 09  ..contents: {...
3c1f0 09 78 6d 6c 3a 20 2f 5c 62 78 6d 6c 5c 62 2f 2c  .xml: /\bxml\b/,
3c200 0a 09 09 09 68 74 6d 6c 3a 20 2f 5c 62 68 74 6d  ....html: /\bhtm
3c210 6c 2f 2c 0a 09 09 09 6a 73 6f 6e 3a 20 2f 5c 62  l/,....json: /\b
3c220 6a 73 6f 6e 5c 62 2f 0a 09 09 7d 2c 0a 0a 09 09  json\b/...},....
3c230 72 65 73 70 6f 6e 73 65 46 69 65 6c 64 73 3a 20  responseFields: 
3c240 7b 0a 09 09 09 78 6d 6c 3a 20 22 72 65 73 70 6f  {....xml: "respo
3c250 6e 73 65 58 4d 4c 22 2c 0a 09 09 09 74 65 78 74  nseXML",....text
3c260 3a 20 22 72 65 73 70 6f 6e 73 65 54 65 78 74 22  : "responseText"
3c270 2c 0a 09 09 09 6a 73 6f 6e 3a 20 22 72 65 73 70  ,....json: "resp
3c280 6f 6e 73 65 4a 53 4f 4e 22 0a 09 09 7d 2c 0a 0a  onseJSON"...},..
3c290 09 09 2f 2f 20 44 61 74 61 20 63 6f 6e 76 65 72  ..// Data conver
3c2a0 74 65 72 73 0a 09 09 2f 2f 20 4b 65 79 73 20 73  ters...// Keys s
3c2b0 65 70 61 72 61 74 65 20 73 6f 75 72 63 65 20 28  eparate source (
3c2c0 6f 72 20 63 61 74 63 68 61 6c 6c 20 22 2a 22 29  or catchall "*")
3c2d0 20 61 6e 64 20 64 65 73 74 69 6e 61 74 69 6f 6e   and destination
3c2e0 20 74 79 70 65 73 20 77 69 74 68 20 61 20 73 69   types with a si
3c2f0 6e 67 6c 65 20 73 70 61 63 65 0a 09 09 63 6f 6e  ngle space...con
3c300 76 65 72 74 65 72 73 3a 20 7b 0a 0a 09 09 09 2f  verters: {...../
3c310 2f 20 43 6f 6e 76 65 72 74 20 61 6e 79 74 68 69  / Convert anythi
3c320 6e 67 20 74 6f 20 74 65 78 74 0a 09 09 09 22 2a  ng to text...."*
3c330 20 74 65 78 74 22 3a 20 53 74 72 69 6e 67 2c 0a   text": String,.
3c340 0a 09 09 09 2f 2f 20 54 65 78 74 20 74 6f 20 68  ....// Text to h
3c350 74 6d 6c 20 28 74 72 75 65 20 3d 20 6e 6f 20 74  tml (true = no t
3c360 72 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 29 0a 09  ransformation)..
3c370 09 09 22 74 65 78 74 20 68 74 6d 6c 22 3a 20 74  .."text html": t
3c380 72 75 65 2c 0a 0a 09 09 09 2f 2f 20 45 76 61 6c  rue,.....// Eval
3c390 75 61 74 65 20 74 65 78 74 20 61 73 20 61 20 6a  uate text as a j
3c3a0 73 6f 6e 20 65 78 70 72 65 73 73 69 6f 6e 0a 09  son expression..
3c3b0 09 09 22 74 65 78 74 20 6a 73 6f 6e 22 3a 20 4a  .."text json": J
3c3c0 53 4f 4e 2e 70 61 72 73 65 2c 0a 0a 09 09 09 2f  SON.parse,...../
3c3d0 2f 20 50 61 72 73 65 20 74 65 78 74 20 61 73 20  / Parse text as 
3c3e0 78 6d 6c 0a 09 09 09 22 74 65 78 74 20 78 6d 6c  xml...."text xml
3c3f0 22 3a 20 6a 51 75 65 72 79 2e 70 61 72 73 65 58  ": jQuery.parseX
3c400 4d 4c 0a 09 09 7d 2c 0a 0a 09 09 2f 2f 20 46 6f  ML...},....// Fo
3c410 72 20 6f 70 74 69 6f 6e 73 20 74 68 61 74 20 73  r options that s
3c420 68 6f 75 6c 64 6e 27 74 20 62 65 20 64 65 65 70  houldn't be deep
3c430 20 65 78 74 65 6e 64 65 64 3a 0a 09 09 2f 2f 20   extended:...// 
3c440 79 6f 75 20 63 61 6e 20 61 64 64 20 79 6f 75 72  you can add your
3c450 20 6f 77 6e 20 63 75 73 74 6f 6d 20 6f 70 74 69   own custom opti
3c460 6f 6e 73 20 68 65 72 65 20 69 66 0a 09 09 2f 2f  ons here if...//
3c470 20 61 6e 64 20 77 68 65 6e 20 79 6f 75 20 63 72   and when you cr
3c480 65 61 74 65 20 6f 6e 65 20 74 68 61 74 20 73 68  eate one that sh
3c490 6f 75 6c 64 6e 27 74 20 62 65 0a 09 09 2f 2f 20  ouldn't be...// 
3c4a0 64 65 65 70 20 65 78 74 65 6e 64 65 64 20 28 73  deep extended (s
3c4b0 65 65 20 61 6a 61 78 45 78 74 65 6e 64 29 0a 09  ee ajaxExtend)..
3c4c0 09 66 6c 61 74 4f 70 74 69 6f 6e 73 3a 20 7b 0a  .flatOptions: {.
3c4d0 09 09 09 75 72 6c 3a 20 74 72 75 65 2c 0a 09 09  ...url: true,...
3c4e0 09 63 6f 6e 74 65 78 74 3a 20 74 72 75 65 0a 09  .context: true..
3c4f0 09 7d 0a 09 7d 2c 0a 0a 09 2f 2f 20 43 72 65 61  .}..},...// Crea
3c500 74 65 73 20 61 20 66 75 6c 6c 20 66 6c 65 64 67  tes a full fledg
3c510 65 64 20 73 65 74 74 69 6e 67 73 20 6f 62 6a 65  ed settings obje
3c520 63 74 20 69 6e 74 6f 20 74 61 72 67 65 74 0a 09  ct into target..
3c530 2f 2f 20 77 69 74 68 20 62 6f 74 68 20 61 6a 61  // with both aja
3c540 78 53 65 74 74 69 6e 67 73 20 61 6e 64 20 73 65  xSettings and se
3c550 74 74 69 6e 67 73 20 66 69 65 6c 64 73 2e 0a 09  ttings fields...
3c560 2f 2f 20 49 66 20 74 61 72 67 65 74 20 69 73 20  // If target is 
3c570 6f 6d 69 74 74 65 64 2c 20 77 72 69 74 65 73 20  omitted, writes 
3c580 69 6e 74 6f 20 61 6a 61 78 53 65 74 74 69 6e 67  into ajaxSetting
3c590 73 2e 0a 09 61 6a 61 78 53 65 74 75 70 3a 20 66  s...ajaxSetup: f
3c5a0 75 6e 63 74 69 6f 6e 28 20 74 61 72 67 65 74 2c  unction( target,
3c5b0 20 73 65 74 74 69 6e 67 73 20 29 20 7b 0a 09 09   settings ) {...
3c5c0 72 65 74 75 72 6e 20 73 65 74 74 69 6e 67 73 20  return settings 
3c5d0 3f 0a 0a 09 09 09 2f 2f 20 42 75 69 6c 64 69 6e  ?.....// Buildin
3c5e0 67 20 61 20 73 65 74 74 69 6e 67 73 20 6f 62 6a  g a settings obj
3c5f0 65 63 74 0a 09 09 09 61 6a 61 78 45 78 74 65 6e  ect....ajaxExten
3c600 64 28 20 61 6a 61 78 45 78 74 65 6e 64 28 20 74  d( ajaxExtend( t
3c610 61 72 67 65 74 2c 20 6a 51 75 65 72 79 2e 61 6a  arget, jQuery.aj
3c620 61 78 53 65 74 74 69 6e 67 73 20 29 2c 20 73 65  axSettings ), se
3c630 74 74 69 6e 67 73 20 29 20 3a 0a 0a 09 09 09 2f  ttings ) :...../
3c640 2f 20 45 78 74 65 6e 64 69 6e 67 20 61 6a 61 78  / Extending ajax
3c650 53 65 74 74 69 6e 67 73 0a 09 09 09 61 6a 61 78  Settings....ajax
3c660 45 78 74 65 6e 64 28 20 6a 51 75 65 72 79 2e 61  Extend( jQuery.a
3c670 6a 61 78 53 65 74 74 69 6e 67 73 2c 20 74 61 72  jaxSettings, tar
3c680 67 65 74 20 29 3b 0a 09 7d 2c 0a 0a 09 61 6a 61  get );..},...aja
3c690 78 50 72 65 66 69 6c 74 65 72 3a 20 61 64 64 54  xPrefilter: addT
3c6a0 6f 50 72 65 66 69 6c 74 65 72 73 4f 72 54 72 61  oPrefiltersOrTra
3c6b0 6e 73 70 6f 72 74 73 28 20 70 72 65 66 69 6c 74  nsports( prefilt
3c6c0 65 72 73 20 29 2c 0a 09 61 6a 61 78 54 72 61 6e  ers ),..ajaxTran
3c6d0 73 70 6f 72 74 3a 20 61 64 64 54 6f 50 72 65 66  sport: addToPref
3c6e0 69 6c 74 65 72 73 4f 72 54 72 61 6e 73 70 6f 72  iltersOrTranspor
3c6f0 74 73 28 20 74 72 61 6e 73 70 6f 72 74 73 20 29  ts( transports )
3c700 2c 0a 0a 09 2f 2f 20 4d 61 69 6e 20 6d 65 74 68  ,...// Main meth
3c710 6f 64 0a 09 61 6a 61 78 3a 20 66 75 6e 63 74 69  od..ajax: functi
3c720 6f 6e 28 20 75 72 6c 2c 20 6f 70 74 69 6f 6e 73  on( url, options
3c730 20 29 20 7b 0a 0a 09 09 2f 2f 20 49 66 20 75 72   ) {....// If ur
3c740 6c 20 69 73 20 61 6e 20 6f 62 6a 65 63 74 2c 20  l is an object, 
3c750 73 69 6d 75 6c 61 74 65 20 70 72 65 2d 31 2e 35  simulate pre-1.5
3c760 20 73 69 67 6e 61 74 75 72 65 0a 09 09 69 66 20   signature...if 
3c770 28 20 74 79 70 65 6f 66 20 75 72 6c 20 3d 3d 3d  ( typeof url ===
3c780 20 22 6f 62 6a 65 63 74 22 20 29 20 7b 0a 09 09   "object" ) {...
3c790 09 6f 70 74 69 6f 6e 73 20 3d 20 75 72 6c 3b 0a  .options = url;.
3c7a0 09 09 09 75 72 6c 20 3d 20 75 6e 64 65 66 69 6e  ...url = undefin
3c7b0 65 64 3b 0a 09 09 7d 0a 0a 09 09 2f 2f 20 46 6f  ed;...}....// Fo
3c7c0 72 63 65 20 6f 70 74 69 6f 6e 73 20 74 6f 20 62  rce options to b
3c7d0 65 20 61 6e 20 6f 62 6a 65 63 74 0a 09 09 6f 70  e an object...op
3c7e0 74 69 6f 6e 73 20 3d 20 6f 70 74 69 6f 6e 73 20  tions = options 
3c7f0 7c 7c 20 7b 7d 3b 0a 0a 09 09 76 61 72 20 74 72  || {};....var tr
3c800 61 6e 73 70 6f 72 74 2c 0a 0a 09 09 09 2f 2f 20  ansport,.....// 
3c810 55 52 4c 20 77 69 74 68 6f 75 74 20 61 6e 74 69  URL without anti
3c820 2d 63 61 63 68 65 20 70 61 72 61 6d 0a 09 09 09  -cache param....
3c830 63 61 63 68 65 55 52 4c 2c 0a 0a 09 09 09 2f 2f  cacheURL,.....//
3c840 20 52 65 73 70 6f 6e 73 65 20 68 65 61 64 65 72   Response header
3c850 73 0a 09 09 09 72 65 73 70 6f 6e 73 65 48 65 61  s....responseHea
3c860 64 65 72 73 53 74 72 69 6e 67 2c 0a 09 09 09 72  dersString,....r
3c870 65 73 70 6f 6e 73 65 48 65 61 64 65 72 73 2c 0a  esponseHeaders,.
3c880 0a 09 09 09 2f 2f 20 74 69 6d 65 6f 75 74 20 68  ....// timeout h
3c890 61 6e 64 6c 65 0a 09 09 09 74 69 6d 65 6f 75 74  andle....timeout
3c8a0 54 69 6d 65 72 2c 0a 0a 09 09 09 2f 2f 20 55 72  Timer,.....// Ur
3c8b0 6c 20 63 6c 65 61 6e 75 70 20 76 61 72 0a 09 09  l cleanup var...
3c8c0 09 75 72 6c 41 6e 63 68 6f 72 2c 0a 0a 09 09 09  .urlAnchor,.....
3c8d0 2f 2f 20 52 65 71 75 65 73 74 20 73 74 61 74 65  // Request state
3c8e0 20 28 62 65 63 6f 6d 65 73 20 66 61 6c 73 65 20   (becomes false 
3c8f0 75 70 6f 6e 20 73 65 6e 64 20 61 6e 64 20 74 72  upon send and tr
3c900 75 65 20 75 70 6f 6e 20 63 6f 6d 70 6c 65 74 69  ue upon completi
3c910 6f 6e 29 0a 09 09 09 63 6f 6d 70 6c 65 74 65 64  on)....completed
3c920 2c 0a 0a 09 09 09 2f 2f 20 54 6f 20 6b 6e 6f 77  ,.....// To know
3c930 20 69 66 20 67 6c 6f 62 61 6c 20 65 76 65 6e 74   if global event
3c940 73 20 61 72 65 20 74 6f 20 62 65 20 64 69 73 70  s are to be disp
3c950 61 74 63 68 65 64 0a 09 09 09 66 69 72 65 47 6c  atched....fireGl
3c960 6f 62 61 6c 73 2c 0a 0a 09 09 09 2f 2f 20 4c 6f  obals,.....// Lo
3c970 6f 70 20 76 61 72 69 61 62 6c 65 0a 09 09 09 69  op variable....i
3c980 2c 0a 0a 09 09 09 2f 2f 20 75 6e 63 61 63 68 65  ,.....// uncache
3c990 64 20 70 61 72 74 20 6f 66 20 74 68 65 20 75 72  d part of the ur
3c9a0 6c 0a 09 09 09 75 6e 63 61 63 68 65 64 2c 0a 0a  l....uncached,..
3c9b0 09 09 09 2f 2f 20 43 72 65 61 74 65 20 74 68 65  ...// Create the
3c9c0 20 66 69 6e 61 6c 20 6f 70 74 69 6f 6e 73 20 6f   final options o
3c9d0 62 6a 65 63 74 0a 09 09 09 73 20 3d 20 6a 51 75  bject....s = jQu
3c9e0 65 72 79 2e 61 6a 61 78 53 65 74 75 70 28 20 7b  ery.ajaxSetup( {
3c9f0 7d 2c 20 6f 70 74 69 6f 6e 73 20 29 2c 0a 0a 09  }, options ),...
3ca00 09 09 2f 2f 20 43 61 6c 6c 62 61 63 6b 73 20 63  ..// Callbacks c
3ca10 6f 6e 74 65 78 74 0a 09 09 09 63 61 6c 6c 62 61  ontext....callba
3ca20 63 6b 43 6f 6e 74 65 78 74 20 3d 20 73 2e 63 6f  ckContext = s.co
3ca30 6e 74 65 78 74 20 7c 7c 20 73 2c 0a 0a 09 09 09  ntext || s,.....
3ca40 2f 2f 20 43 6f 6e 74 65 78 74 20 66 6f 72 20 67  // Context for g
3ca50 6c 6f 62 61 6c 20 65 76 65 6e 74 73 20 69 73 20  lobal events is 
3ca60 63 61 6c 6c 62 61 63 6b 43 6f 6e 74 65 78 74 20  callbackContext 
3ca70 69 66 20 69 74 20 69 73 20 61 20 44 4f 4d 20 6e  if it is a DOM n
3ca80 6f 64 65 20 6f 72 20 6a 51 75 65 72 79 20 63 6f  ode or jQuery co
3ca90 6c 6c 65 63 74 69 6f 6e 0a 09 09 09 67 6c 6f 62  llection....glob
3caa0 61 6c 45 76 65 6e 74 43 6f 6e 74 65 78 74 20 3d  alEventContext =
3cab0 20 73 2e 63 6f 6e 74 65 78 74 20 26 26 0a 09 09   s.context &&...
3cac0 09 09 28 20 63 61 6c 6c 62 61 63 6b 43 6f 6e 74  ..( callbackCont
3cad0 65 78 74 2e 6e 6f 64 65 54 79 70 65 20 7c 7c 20  ext.nodeType || 
3cae0 63 61 6c 6c 62 61 63 6b 43 6f 6e 74 65 78 74 2e  callbackContext.
3caf0 6a 71 75 65 72 79 20 29 20 3f 0a 09 09 09 09 09  jquery ) ?......
3cb00 6a 51 75 65 72 79 28 20 63 61 6c 6c 62 61 63 6b  jQuery( callback
3cb10 43 6f 6e 74 65 78 74 20 29 20 3a 0a 09 09 09 09  Context ) :.....
3cb20 09 6a 51 75 65 72 79 2e 65 76 65 6e 74 2c 0a 0a  .jQuery.event,..
3cb30 09 09 09 2f 2f 20 44 65 66 65 72 72 65 64 73 0a  ...// Deferreds.
3cb40 09 09 09 64 65 66 65 72 72 65 64 20 3d 20 6a 51  ...deferred = jQ
3cb50 75 65 72 79 2e 44 65 66 65 72 72 65 64 28 29 2c  uery.Deferred(),
3cb60 0a 09 09 09 63 6f 6d 70 6c 65 74 65 44 65 66 65  ....completeDefe
3cb70 72 72 65 64 20 3d 20 6a 51 75 65 72 79 2e 43 61  rred = jQuery.Ca
3cb80 6c 6c 62 61 63 6b 73 28 20 22 6f 6e 63 65 20 6d  llbacks( "once m
3cb90 65 6d 6f 72 79 22 20 29 2c 0a 0a 09 09 09 2f 2f  emory" ),.....//
3cba0 20 53 74 61 74 75 73 2d 64 65 70 65 6e 64 65 6e   Status-dependen
3cbb0 74 20 63 61 6c 6c 62 61 63 6b 73 0a 09 09 09 73  t callbacks....s
3cbc0 74 61 74 75 73 43 6f 64 65 20 3d 20 73 2e 73 74  tatusCode = s.st
3cbd0 61 74 75 73 43 6f 64 65 20 7c 7c 20 7b 7d 2c 0a  atusCode || {},.
3cbe0 0a 09 09 09 2f 2f 20 48 65 61 64 65 72 73 20 28  ....// Headers (
3cbf0 74 68 65 79 20 61 72 65 20 73 65 6e 74 20 61 6c  they are sent al
3cc00 6c 20 61 74 20 6f 6e 63 65 29 0a 09 09 09 72 65  l at once)....re
3cc10 71 75 65 73 74 48 65 61 64 65 72 73 20 3d 20 7b  questHeaders = {
3cc20 7d 2c 0a 09 09 09 72 65 71 75 65 73 74 48 65 61  },....requestHea
3cc30 64 65 72 73 4e 61 6d 65 73 20 3d 20 7b 7d 2c 0a  dersNames = {},.
3cc40 0a 09 09 09 2f 2f 20 44 65 66 61 75 6c 74 20 61  ....// Default a
3cc50 62 6f 72 74 20 6d 65 73 73 61 67 65 0a 09 09 09  bort message....
3cc60 73 74 72 41 62 6f 72 74 20 3d 20 22 63 61 6e 63  strAbort = "canc
3cc70 65 6c 65 64 22 2c 0a 0a 09 09 09 2f 2f 20 46 61  eled",.....// Fa
3cc80 6b 65 20 78 68 72 0a 09 09 09 6a 71 58 48 52 20  ke xhr....jqXHR 
3cc90 3d 20 7b 0a 09 09 09 09 72 65 61 64 79 53 74 61  = {.....readySta
3cca0 74 65 3a 20 30 2c 0a 0a 09 09 09 09 2f 2f 20 42  te: 0,......// B
3ccb0 75 69 6c 64 73 20 68 65 61 64 65 72 73 20 68 61  uilds headers ha
3ccc0 73 68 74 61 62 6c 65 20 69 66 20 6e 65 65 64 65  shtable if neede
3ccd0 64 0a 09 09 09 09 67 65 74 52 65 73 70 6f 6e 73  d.....getRespons
3cce0 65 48 65 61 64 65 72 3a 20 66 75 6e 63 74 69 6f  eHeader: functio
3ccf0 6e 28 20 6b 65 79 20 29 20 7b 0a 09 09 09 09 09  n( key ) {......
3cd00 76 61 72 20 6d 61 74 63 68 3b 0a 09 09 09 09 09  var match;......
3cd10 69 66 20 28 20 63 6f 6d 70 6c 65 74 65 64 20 29  if ( completed )
3cd20 20 7b 0a 09 09 09 09 09 09 69 66 20 28 20 21 72   {.......if ( !r
3cd30 65 73 70 6f 6e 73 65 48 65 61 64 65 72 73 20 29  esponseHeaders )
3cd40 20 7b 0a 09 09 09 09 09 09 09 72 65 73 70 6f 6e   {........respon
3cd50 73 65 48 65 61 64 65 72 73 20 3d 20 7b 7d 3b 0a  seHeaders = {};.
3cd60 09 09 09 09 09 09 09 77 68 69 6c 65 20 28 20 28  .......while ( (
3cd70 20 6d 61 74 63 68 20 3d 20 72 68 65 61 64 65 72   match = rheader
3cd80 73 2e 65 78 65 63 28 20 72 65 73 70 6f 6e 73 65  s.exec( response
3cd90 48 65 61 64 65 72 73 53 74 72 69 6e 67 20 29 20  HeadersString ) 
3cda0 29 20 29 20 7b 0a 09 09 09 09 09 09 09 09 72 65  ) ) {.........re
3cdb0 73 70 6f 6e 73 65 48 65 61 64 65 72 73 5b 20 6d  sponseHeaders[ m
3cdc0 61 74 63 68 5b 20 31 20 5d 2e 74 6f 4c 6f 77 65  atch[ 1 ].toLowe
3cdd0 72 43 61 73 65 28 29 20 2b 20 22 20 22 20 5d 20  rCase() + " " ] 
3cde0 3d 0a 09 09 09 09 09 09 09 09 09 28 20 72 65 73  =..........( res
3cdf0 70 6f 6e 73 65 48 65 61 64 65 72 73 5b 20 6d 61  ponseHeaders[ ma
3ce00 74 63 68 5b 20 31 20 5d 2e 74 6f 4c 6f 77 65 72  tch[ 1 ].toLower
3ce10 43 61 73 65 28 29 20 2b 20 22 20 22 20 5d 20 7c  Case() + " " ] |
3ce20 7c 20 5b 5d 20 29 0a 09 09 09 09 09 09 09 09 09  | [] )..........
3ce30 09 2e 63 6f 6e 63 61 74 28 20 6d 61 74 63 68 5b  ..concat( match[
3ce40 20 32 20 5d 20 29 3b 0a 09 09 09 09 09 09 09 7d   2 ] );........}
3ce50 0a 09 09 09 09 09 09 7d 0a 09 09 09 09 09 09 6d  .......}.......m
3ce60 61 74 63 68 20 3d 20 72 65 73 70 6f 6e 73 65 48  atch = responseH
3ce70 65 61 64 65 72 73 5b 20 6b 65 79 2e 74 6f 4c 6f  eaders[ key.toLo
3ce80 77 65 72 43 61 73 65 28 29 20 2b 20 22 20 22 20  werCase() + " " 
3ce90 5d 3b 0a 09 09 09 09 09 7d 0a 09 09 09 09 09 72  ];......}......r
3cea0 65 74 75 72 6e 20 6d 61 74 63 68 20 3d 3d 20 6e  eturn match == n
3ceb0 75 6c 6c 20 3f 20 6e 75 6c 6c 20 3a 20 6d 61 74  ull ? null : mat
3cec0 63 68 2e 6a 6f 69 6e 28 20 22 2c 20 22 20 29 3b  ch.join( ", " );
3ced0 0a 09 09 09 09 7d 2c 0a 0a 09 09 09 09 2f 2f 20  .....},......// 
3cee0 52 61 77 20 73 74 72 69 6e 67 0a 09 09 09 09 67  Raw string.....g
3cef0 65 74 41 6c 6c 52 65 73 70 6f 6e 73 65 48 65 61  etAllResponseHea
3cf00 64 65 72 73 3a 20 66 75 6e 63 74 69 6f 6e 28 29  ders: function()
3cf10 20 7b 0a 09 09 09 09 09 72 65 74 75 72 6e 20 63   {......return c
3cf20 6f 6d 70 6c 65 74 65 64 20 3f 20 72 65 73 70 6f  ompleted ? respo
3cf30 6e 73 65 48 65 61 64 65 72 73 53 74 72 69 6e 67  nseHeadersString
3cf40 20 3a 20 6e 75 6c 6c 3b 0a 09 09 09 09 7d 2c 0a   : null;.....},.
3cf50 0a 09 09 09 09 2f 2f 20 43 61 63 68 65 73 20 74  .....// Caches t
3cf60 68 65 20 68 65 61 64 65 72 0a 09 09 09 09 73 65  he header.....se
3cf70 74 52 65 71 75 65 73 74 48 65 61 64 65 72 3a 20  tRequestHeader: 
3cf80 66 75 6e 63 74 69 6f 6e 28 20 6e 61 6d 65 2c 20  function( name, 
3cf90 76 61 6c 75 65 20 29 20 7b 0a 09 09 09 09 09 69  value ) {......i
3cfa0 66 20 28 20 63 6f 6d 70 6c 65 74 65 64 20 3d 3d  f ( completed ==
3cfb0 20 6e 75 6c 6c 20 29 20 7b 0a 09 09 09 09 09 09   null ) {.......
3cfc0 6e 61 6d 65 20 3d 20 72 65 71 75 65 73 74 48 65  name = requestHe
3cfd0 61 64 65 72 73 4e 61 6d 65 73 5b 20 6e 61 6d 65  adersNames[ name
3cfe0 2e 74 6f 4c 6f 77 65 72 43 61 73 65 28 29 20 5d  .toLowerCase() ]
3cff0 20 3d 0a 09 09 09 09 09 09 09 72 65 71 75 65 73   =........reques
3d000 74 48 65 61 64 65 72 73 4e 61 6d 65 73 5b 20 6e  tHeadersNames[ n
3d010 61 6d 65 2e 74 6f 4c 6f 77 65 72 43 61 73 65 28  ame.toLowerCase(
3d020 29 20 5d 20 7c 7c 20 6e 61 6d 65 3b 0a 09 09 09  ) ] || name;....
3d030 09 09 09 72 65 71 75 65 73 74 48 65 61 64 65 72  ...requestHeader
3d040 73 5b 20 6e 61 6d 65 20 5d 20 3d 20 76 61 6c 75  s[ name ] = valu
3d050 65 3b 0a 09 09 09 09 09 7d 0a 09 09 09 09 09 72  e;......}......r
3d060 65 74 75 72 6e 20 74 68 69 73 3b 0a 09 09 09 09  eturn this;.....
3d070 7d 2c 0a 0a 09 09 09 09 2f 2f 20 4f 76 65 72 72  },......// Overr
3d080 69 64 65 73 20 72 65 73 70 6f 6e 73 65 20 63 6f  ides response co
3d090 6e 74 65 6e 74 2d 74 79 70 65 20 68 65 61 64 65  ntent-type heade
3d0a0 72 0a 09 09 09 09 6f 76 65 72 72 69 64 65 4d 69  r.....overrideMi
3d0b0 6d 65 54 79 70 65 3a 20 66 75 6e 63 74 69 6f 6e  meType: function
3d0c0 28 20 74 79 70 65 20 29 20 7b 0a 09 09 09 09 09  ( type ) {......
3d0d0 69 66 20 28 20 63 6f 6d 70 6c 65 74 65 64 20 3d  if ( completed =
3d0e0 3d 20 6e 75 6c 6c 20 29 20 7b 0a 09 09 09 09 09  = null ) {......
3d0f0 09 73 2e 6d 69 6d 65 54 79 70 65 20 3d 20 74 79  .s.mimeType = ty
3d100 70 65 3b 0a 09 09 09 09 09 7d 0a 09 09 09 09 09  pe;......}......
3d110 72 65 74 75 72 6e 20 74 68 69 73 3b 0a 09 09 09  return this;....
3d120 09 7d 2c 0a 0a 09 09 09 09 2f 2f 20 53 74 61 74  .},......// Stat
3d130 75 73 2d 64 65 70 65 6e 64 65 6e 74 20 63 61 6c  us-dependent cal
3d140 6c 62 61 63 6b 73 0a 09 09 09 09 73 74 61 74 75  lbacks.....statu
3d150 73 43 6f 64 65 3a 20 66 75 6e 63 74 69 6f 6e 28  sCode: function(
3d160 20 6d 61 70 20 29 20 7b 0a 09 09 09 09 09 76 61   map ) {......va
3d170 72 20 63 6f 64 65 3b 0a 09 09 09 09 09 69 66 20  r code;......if 
3d180 28 20 6d 61 70 20 29 20 7b 0a 09 09 09 09 09 09  ( map ) {.......
3d190 69 66 20 28 20 63 6f 6d 70 6c 65 74 65 64 20 29  if ( completed )
3d1a0 20 7b 0a 0a 09 09 09 09 09 09 09 2f 2f 20 45 78   {.........// Ex
3d1b0 65 63 75 74 65 20 74 68 65 20 61 70 70 72 6f 70  ecute the approp
3d1c0 72 69 61 74 65 20 63 61 6c 6c 62 61 63 6b 73 0a  riate callbacks.
3d1d0 09 09 09 09 09 09 09 6a 71 58 48 52 2e 61 6c 77  .......jqXHR.alw
3d1e0 61 79 73 28 20 6d 61 70 5b 20 6a 71 58 48 52 2e  ays( map[ jqXHR.
3d1f0 73 74 61 74 75 73 20 5d 20 29 3b 0a 09 09 09 09  status ] );.....
3d200 09 09 7d 20 65 6c 73 65 20 7b 0a 0a 09 09 09 09  ..} else {......
3d210 09 09 09 2f 2f 20 4c 61 7a 79 2d 61 64 64 20 74  ...// Lazy-add t
3d220 68 65 20 6e 65 77 20 63 61 6c 6c 62 61 63 6b 73  he new callbacks
3d230 20 69 6e 20 61 20 77 61 79 20 74 68 61 74 20 70   in a way that p
3d240 72 65 73 65 72 76 65 73 20 6f 6c 64 20 6f 6e 65  reserves old one
3d250 73 0a 09 09 09 09 09 09 09 66 6f 72 20 28 20 63  s........for ( c
3d260 6f 64 65 20 69 6e 20 6d 61 70 20 29 20 7b 0a 09  ode in map ) {..
3d270 09 09 09 09 09 09 09 73 74 61 74 75 73 43 6f 64  .......statusCod
3d280 65 5b 20 63 6f 64 65 20 5d 20 3d 20 5b 20 73 74  e[ code ] = [ st
3d290 61 74 75 73 43 6f 64 65 5b 20 63 6f 64 65 20 5d  atusCode[ code ]
3d2a0 2c 20 6d 61 70 5b 20 63 6f 64 65 20 5d 20 5d 3b  , map[ code ] ];
3d2b0 0a 09 09 09 09 09 09 09 7d 0a 09 09 09 09 09 09  ........}.......
3d2c0 7d 0a 09 09 09 09 09 7d 0a 09 09 09 09 09 72 65  }......}......re
3d2d0 74 75 72 6e 20 74 68 69 73 3b 0a 09 09 09 09 7d  turn this;.....}
3d2e0 2c 0a 0a 09 09 09 09 2f 2f 20 43 61 6e 63 65 6c  ,......// Cancel
3d2f0 20 74 68 65 20 72 65 71 75 65 73 74 0a 09 09 09   the request....
3d300 09 61 62 6f 72 74 3a 20 66 75 6e 63 74 69 6f 6e  .abort: function
3d310 28 20 73 74 61 74 75 73 54 65 78 74 20 29 20 7b  ( statusText ) {
3d320 0a 09 09 09 09 09 76 61 72 20 66 69 6e 61 6c 54  ......var finalT
3d330 65 78 74 20 3d 20 73 74 61 74 75 73 54 65 78 74  ext = statusText
3d340 20 7c 7c 20 73 74 72 41 62 6f 72 74 3b 0a 09 09   || strAbort;...
3d350 09 09 09 69 66 20 28 20 74 72 61 6e 73 70 6f 72  ...if ( transpor
3d360 74 20 29 20 7b 0a 09 09 09 09 09 09 74 72 61 6e  t ) {.......tran
3d370 73 70 6f 72 74 2e 61 62 6f 72 74 28 20 66 69 6e  sport.abort( fin
3d380 61 6c 54 65 78 74 20 29 3b 0a 09 09 09 09 09 7d  alText );......}
3d390 0a 09 09 09 09 09 64 6f 6e 65 28 20 30 2c 20 66  ......done( 0, f
3d3a0 69 6e 61 6c 54 65 78 74 20 29 3b 0a 09 09 09 09  inalText );.....
3d3b0 09 72 65 74 75 72 6e 20 74 68 69 73 3b 0a 09 09  .return this;...
3d3c0 09 09 7d 0a 09 09 09 7d 3b 0a 0a 09 09 2f 2f 20  ..}....};....// 
3d3d0 41 74 74 61 63 68 20 64 65 66 65 72 72 65 64 73  Attach deferreds
3d3e0 0a 09 09 64 65 66 65 72 72 65 64 2e 70 72 6f 6d  ...deferred.prom
3d3f0 69 73 65 28 20 6a 71 58 48 52 20 29 3b 0a 0a 09  ise( jqXHR );...
3d400 09 2f 2f 20 41 64 64 20 70 72 6f 74 6f 63 6f 6c  .// Add protocol
3d410 20 69 66 20 6e 6f 74 20 70 72 6f 76 69 64 65 64   if not provided
3d420 20 28 70 72 65 66 69 6c 74 65 72 73 20 6d 69 67   (prefilters mig
3d430 68 74 20 65 78 70 65 63 74 20 69 74 29 0a 09 09  ht expect it)...
3d440 2f 2f 20 48 61 6e 64 6c 65 20 66 61 6c 73 79 20  // Handle falsy 
3d450 75 72 6c 20 69 6e 20 74 68 65 20 73 65 74 74 69  url in the setti
3d460 6e 67 73 20 6f 62 6a 65 63 74 20 28 23 31 30 30  ngs object (#100
3d470 39 33 3a 20 63 6f 6e 73 69 73 74 65 6e 63 79 20  93: consistency 
3d480 77 69 74 68 20 6f 6c 64 20 73 69 67 6e 61 74 75  with old signatu
3d490 72 65 29 0a 09 09 2f 2f 20 57 65 20 61 6c 73 6f  re)...// We also
3d4a0 20 75 73 65 20 74 68 65 20 75 72 6c 20 70 61 72   use the url par
3d4b0 61 6d 65 74 65 72 20 69 66 20 61 76 61 69 6c 61  ameter if availa
3d4c0 62 6c 65 0a 09 09 73 2e 75 72 6c 20 3d 20 28 20  ble...s.url = ( 
3d4d0 28 20 75 72 6c 20 7c 7c 20 73 2e 75 72 6c 20 7c  ( url || s.url |
3d4e0 7c 20 6c 6f 63 61 74 69 6f 6e 2e 68 72 65 66 20  | location.href 
3d4f0 29 20 2b 20 22 22 20 29 0a 09 09 09 2e 72 65 70  ) + "" ).....rep
3d500 6c 61 63 65 28 20 72 70 72 6f 74 6f 63 6f 6c 2c  lace( rprotocol,
3d510 20 6c 6f 63 61 74 69 6f 6e 2e 70 72 6f 74 6f 63   location.protoc
3d520 6f 6c 20 2b 20 22 2f 2f 22 20 29 3b 0a 0a 09 09  ol + "//" );....
3d530 2f 2f 20 41 6c 69 61 73 20 6d 65 74 68 6f 64 20  // Alias method 
3d540 6f 70 74 69 6f 6e 20 74 6f 20 74 79 70 65 20 61  option to type a
3d550 73 20 70 65 72 20 74 69 63 6b 65 74 20 23 31 32  s per ticket #12
3d560 30 30 34 0a 09 09 73 2e 74 79 70 65 20 3d 20 6f  004...s.type = o
3d570 70 74 69 6f 6e 73 2e 6d 65 74 68 6f 64 20 7c 7c  ptions.method ||
3d580 20 6f 70 74 69 6f 6e 73 2e 74 79 70 65 20 7c 7c   options.type ||
3d590 20 73 2e 6d 65 74 68 6f 64 20 7c 7c 20 73 2e 74   s.method || s.t
3d5a0 79 70 65 3b 0a 0a 09 09 2f 2f 20 45 78 74 72 61  ype;....// Extra
3d5b0 63 74 20 64 61 74 61 54 79 70 65 73 20 6c 69 73  ct dataTypes lis
3d5c0 74 0a 09 09 73 2e 64 61 74 61 54 79 70 65 73 20  t...s.dataTypes 
3d5d0 3d 20 28 20 73 2e 64 61 74 61 54 79 70 65 20 7c  = ( s.dataType |
3d5e0 7c 20 22 2a 22 20 29 2e 74 6f 4c 6f 77 65 72 43  | "*" ).toLowerC
3d5f0 61 73 65 28 29 2e 6d 61 74 63 68 28 20 72 6e 6f  ase().match( rno
3d600 74 68 74 6d 6c 77 68 69 74 65 20 29 20 7c 7c 20  thtmlwhite ) || 
3d610 5b 20 22 22 20 5d 3b 0a 0a 09 09 2f 2f 20 41 20  [ "" ];....// A 
3d620 63 72 6f 73 73 2d 64 6f 6d 61 69 6e 20 72 65 71  cross-domain req
3d630 75 65 73 74 20 69 73 20 69 6e 20 6f 72 64 65 72  uest is in order
3d640 20 77 68 65 6e 20 74 68 65 20 6f 72 69 67 69 6e   when the origin
3d650 20 64 6f 65 73 6e 27 74 20 6d 61 74 63 68 20 74   doesn't match t
3d660 68 65 20 63 75 72 72 65 6e 74 20 6f 72 69 67 69  he current origi
3d670 6e 2e 0a 09 09 69 66 20 28 20 73 2e 63 72 6f 73  n....if ( s.cros
3d680 73 44 6f 6d 61 69 6e 20 3d 3d 20 6e 75 6c 6c 20  sDomain == null 
3d690 29 20 7b 0a 09 09 09 75 72 6c 41 6e 63 68 6f 72  ) {....urlAnchor
3d6a0 20 3d 20 64 6f 63 75 6d 65 6e 74 2e 63 72 65 61   = document.crea
3d6b0 74 65 45 6c 65 6d 65 6e 74 28 20 22 61 22 20 29  teElement( "a" )
3d6c0 3b 0a 0a 09 09 09 2f 2f 20 53 75 70 70 6f 72 74  ;.....// Support
3d6d0 3a 20 49 45 20 3c 3d 38 20 2d 20 31 31 2c 20 45  : IE <=8 - 11, E
3d6e0 64 67 65 20 31 32 20 2d 20 31 35 0a 09 09 09 2f  dge 12 - 15..../
3d6f0 2f 20 49 45 20 74 68 72 6f 77 73 20 65 78 63 65  / IE throws exce
3d700 70 74 69 6f 6e 20 6f 6e 20 61 63 63 65 73 73 69  ption on accessi
3d710 6e 67 20 74 68 65 20 68 72 65 66 20 70 72 6f 70  ng the href prop
3d720 65 72 74 79 20 69 66 20 75 72 6c 20 69 73 20 6d  erty if url is m
3d730 61 6c 66 6f 72 6d 65 64 2c 0a 09 09 09 2f 2f 20  alformed,....// 
3d740 65 2e 67 2e 20 68 74 74 70 3a 2f 2f 65 78 61 6d  e.g. http://exam
3d750 70 6c 65 2e 63 6f 6d 3a 38 30 78 2f 0a 09 09 09  ple.com:80x/....
3d760 74 72 79 20 7b 0a 09 09 09 09 75 72 6c 41 6e 63  try {.....urlAnc
3d770 68 6f 72 2e 68 72 65 66 20 3d 20 73 2e 75 72 6c  hor.href = s.url
3d780 3b 0a 0a 09 09 09 09 2f 2f 20 53 75 70 70 6f 72  ;......// Suppor
3d790 74 3a 20 49 45 20 3c 3d 38 20 2d 20 31 31 20 6f  t: IE <=8 - 11 o
3d7a0 6e 6c 79 0a 09 09 09 09 2f 2f 20 41 6e 63 68 6f  nly.....// Ancho
3d7b0 72 27 73 20 68 6f 73 74 20 70 72 6f 70 65 72 74  r's host propert
3d7c0 79 20 69 73 6e 27 74 20 63 6f 72 72 65 63 74 6c  y isn't correctl
3d7d0 79 20 73 65 74 20 77 68 65 6e 20 73 2e 75 72 6c  y set when s.url
3d7e0 20 69 73 20 72 65 6c 61 74 69 76 65 0a 09 09 09   is relative....
3d7f0 09 75 72 6c 41 6e 63 68 6f 72 2e 68 72 65 66 20  .urlAnchor.href 
3d800 3d 20 75 72 6c 41 6e 63 68 6f 72 2e 68 72 65 66  = urlAnchor.href
3d810 3b 0a 09 09 09 09 73 2e 63 72 6f 73 73 44 6f 6d  ;.....s.crossDom
3d820 61 69 6e 20 3d 20 6f 72 69 67 69 6e 41 6e 63 68  ain = originAnch
3d830 6f 72 2e 70 72 6f 74 6f 63 6f 6c 20 2b 20 22 2f  or.protocol + "/
3d840 2f 22 20 2b 20 6f 72 69 67 69 6e 41 6e 63 68 6f  /" + originAncho
3d850 72 2e 68 6f 73 74 20 21 3d 3d 0a 09 09 09 09 09  r.host !==......
3d860 75 72 6c 41 6e 63 68 6f 72 2e 70 72 6f 74 6f 63  urlAnchor.protoc
3d870 6f 6c 20 2b 20 22 2f 2f 22 20 2b 20 75 72 6c 41  ol + "//" + urlA
3d880 6e 63 68 6f 72 2e 68 6f 73 74 3b 0a 09 09 09 7d  nchor.host;....}
3d890 20 63 61 74 63 68 20 28 20 65 20 29 20 7b 0a 0a   catch ( e ) {..
3d8a0 09 09 09 09 2f 2f 20 49 66 20 74 68 65 72 65 20  ....// If there 
3d8b0 69 73 20 61 6e 20 65 72 72 6f 72 20 70 61 72 73  is an error pars
3d8c0 69 6e 67 20 74 68 65 20 55 52 4c 2c 20 61 73 73  ing the URL, ass
3d8d0 75 6d 65 20 69 74 20 69 73 20 63 72 6f 73 73 44  ume it is crossD
3d8e0 6f 6d 61 69 6e 2c 0a 09 09 09 09 2f 2f 20 69 74  omain,.....// it
3d8f0 20 63 61 6e 20 62 65 20 72 65 6a 65 63 74 65 64   can be rejected
3d900 20 62 79 20 74 68 65 20 74 72 61 6e 73 70 6f 72   by the transpor
3d910 74 20 69 66 20 69 74 20 69 73 20 69 6e 76 61 6c  t if it is inval
3d920 69 64 0a 09 09 09 09 73 2e 63 72 6f 73 73 44 6f  id.....s.crossDo
3d930 6d 61 69 6e 20 3d 20 74 72 75 65 3b 0a 09 09 09  main = true;....
3d940 7d 0a 09 09 7d 0a 0a 09 09 2f 2f 20 43 6f 6e 76  }...}....// Conv
3d950 65 72 74 20 64 61 74 61 20 69 66 20 6e 6f 74 20  ert data if not 
3d960 61 6c 72 65 61 64 79 20 61 20 73 74 72 69 6e 67  already a string
3d970 0a 09 09 69 66 20 28 20 73 2e 64 61 74 61 20 26  ...if ( s.data &
3d980 26 20 73 2e 70 72 6f 63 65 73 73 44 61 74 61 20  & s.processData 
3d990 26 26 20 74 79 70 65 6f 66 20 73 2e 64 61 74 61  && typeof s.data
3d9a0 20 21 3d 3d 20 22 73 74 72 69 6e 67 22 20 29 20   !== "string" ) 
3d9b0 7b 0a 09 09 09 73 2e 64 61 74 61 20 3d 20 6a 51  {....s.data = jQ
3d9c0 75 65 72 79 2e 70 61 72 61 6d 28 20 73 2e 64 61  uery.param( s.da
3d9d0 74 61 2c 20 73 2e 74 72 61 64 69 74 69 6f 6e 61  ta, s.traditiona
3d9e0 6c 20 29 3b 0a 09 09 7d 0a 0a 09 09 2f 2f 20 41  l );...}....// A
3d9f0 70 70 6c 79 20 70 72 65 66 69 6c 74 65 72 73 0a  pply prefilters.
3da00 09 09 69 6e 73 70 65 63 74 50 72 65 66 69 6c 74  ..inspectPrefilt
3da10 65 72 73 4f 72 54 72 61 6e 73 70 6f 72 74 73 28  ersOrTransports(
3da20 20 70 72 65 66 69 6c 74 65 72 73 2c 20 73 2c 20   prefilters, s, 
3da30 6f 70 74 69 6f 6e 73 2c 20 6a 71 58 48 52 20 29  options, jqXHR )
3da40 3b 0a 0a 09 09 2f 2f 20 49 66 20 72 65 71 75 65  ;....// If reque
3da50 73 74 20 77 61 73 20 61 62 6f 72 74 65 64 20 69  st was aborted i
3da60 6e 73 69 64 65 20 61 20 70 72 65 66 69 6c 74 65  nside a prefilte
3da70 72 2c 20 73 74 6f 70 20 74 68 65 72 65 0a 09 09  r, stop there...
3da80 69 66 20 28 20 63 6f 6d 70 6c 65 74 65 64 20 29  if ( completed )
3da90 20 7b 0a 09 09 09 72 65 74 75 72 6e 20 6a 71 58   {....return jqX
3daa0 48 52 3b 0a 09 09 7d 0a 0a 09 09 2f 2f 20 57 65  HR;...}....// We
3dab0 20 63 61 6e 20 66 69 72 65 20 67 6c 6f 62 61 6c   can fire global
3dac0 20 65 76 65 6e 74 73 20 61 73 20 6f 66 20 6e 6f   events as of no
3dad0 77 20 69 66 20 61 73 6b 65 64 20 74 6f 0a 09 09  w if asked to...
3dae0 2f 2f 20 44 6f 6e 27 74 20 66 69 72 65 20 65 76  // Don't fire ev
3daf0 65 6e 74 73 20 69 66 20 6a 51 75 65 72 79 2e 65  ents if jQuery.e
3db00 76 65 6e 74 20 69 73 20 75 6e 64 65 66 69 6e 65  vent is undefine
3db10 64 20 69 6e 20 61 6e 20 41 4d 44 2d 75 73 61 67  d in an AMD-usag
3db20 65 20 73 63 65 6e 61 72 69 6f 20 28 23 31 35 31  e scenario (#151
3db30 31 38 29 0a 09 09 66 69 72 65 47 6c 6f 62 61 6c  18)...fireGlobal
3db40 73 20 3d 20 6a 51 75 65 72 79 2e 65 76 65 6e 74  s = jQuery.event
3db50 20 26 26 20 73 2e 67 6c 6f 62 61 6c 3b 0a 0a 09   && s.global;...
3db60 09 2f 2f 20 57 61 74 63 68 20 66 6f 72 20 61 20  .// Watch for a 
3db70 6e 65 77 20 73 65 74 20 6f 66 20 72 65 71 75 65  new set of reque
3db80 73 74 73 0a 09 09 69 66 20 28 20 66 69 72 65 47  sts...if ( fireG
3db90 6c 6f 62 61 6c 73 20 26 26 20 6a 51 75 65 72 79  lobals && jQuery
3dba0 2e 61 63 74 69 76 65 2b 2b 20 3d 3d 3d 20 30 20  .active++ === 0 
3dbb0 29 20 7b 0a 09 09 09 6a 51 75 65 72 79 2e 65 76  ) {....jQuery.ev
3dbc0 65 6e 74 2e 74 72 69 67 67 65 72 28 20 22 61 6a  ent.trigger( "aj
3dbd0 61 78 53 74 61 72 74 22 20 29 3b 0a 09 09 7d 0a  axStart" );...}.
3dbe0 0a 09 09 2f 2f 20 55 70 70 65 72 63 61 73 65 20  ...// Uppercase 
3dbf0 74 68 65 20 74 79 70 65 0a 09 09 73 2e 74 79 70  the type...s.typ
3dc00 65 20 3d 20 73 2e 74 79 70 65 2e 74 6f 55 70 70  e = s.type.toUpp
3dc10 65 72 43 61 73 65 28 29 3b 0a 0a 09 09 2f 2f 20  erCase();....// 
3dc20 44 65 74 65 72 6d 69 6e 65 20 69 66 20 72 65 71  Determine if req
3dc30 75 65 73 74 20 68 61 73 20 63 6f 6e 74 65 6e 74  uest has content
3dc40 0a 09 09 73 2e 68 61 73 43 6f 6e 74 65 6e 74 20  ...s.hasContent 
3dc50 3d 20 21 72 6e 6f 43 6f 6e 74 65 6e 74 2e 74 65  = !rnoContent.te
3dc60 73 74 28 20 73 2e 74 79 70 65 20 29 3b 0a 0a 09  st( s.type );...
3dc70 09 2f 2f 20 53 61 76 65 20 74 68 65 20 55 52 4c  .// Save the URL
3dc80 20 69 6e 20 63 61 73 65 20 77 65 27 72 65 20 74   in case we're t
3dc90 6f 79 69 6e 67 20 77 69 74 68 20 74 68 65 20 49  oying with the I
3dca0 66 2d 4d 6f 64 69 66 69 65 64 2d 53 69 6e 63 65  f-Modified-Since
3dcb0 0a 09 09 2f 2f 20 61 6e 64 2f 6f 72 20 49 66 2d  ...// and/or If-
3dcc0 4e 6f 6e 65 2d 4d 61 74 63 68 20 68 65 61 64 65  None-Match heade
3dcd0 72 20 6c 61 74 65 72 20 6f 6e 0a 09 09 2f 2f 20  r later on...// 
3dce0 52 65 6d 6f 76 65 20 68 61 73 68 20 74 6f 20 73  Remove hash to s
3dcf0 69 6d 70 6c 69 66 79 20 75 72 6c 20 6d 61 6e 69  implify url mani
3dd00 70 75 6c 61 74 69 6f 6e 0a 09 09 63 61 63 68 65  pulation...cache
3dd10 55 52 4c 20 3d 20 73 2e 75 72 6c 2e 72 65 70 6c  URL = s.url.repl
3dd20 61 63 65 28 20 72 68 61 73 68 2c 20 22 22 20 29  ace( rhash, "" )
3dd30 3b 0a 0a 09 09 2f 2f 20 4d 6f 72 65 20 6f 70 74  ;....// More opt
3dd40 69 6f 6e 73 20 68 61 6e 64 6c 69 6e 67 20 66 6f  ions handling fo
3dd50 72 20 72 65 71 75 65 73 74 73 20 77 69 74 68 20  r requests with 
3dd60 6e 6f 20 63 6f 6e 74 65 6e 74 0a 09 09 69 66 20  no content...if 
3dd70 28 20 21 73 2e 68 61 73 43 6f 6e 74 65 6e 74 20  ( !s.hasContent 
3dd80 29 20 7b 0a 0a 09 09 09 2f 2f 20 52 65 6d 65 6d  ) {.....// Remem
3dd90 62 65 72 20 74 68 65 20 68 61 73 68 20 73 6f 20  ber the hash so 
3dda0 77 65 20 63 61 6e 20 70 75 74 20 69 74 20 62 61  we can put it ba
3ddb0 63 6b 0a 09 09 09 75 6e 63 61 63 68 65 64 20 3d  ck....uncached =
3ddc0 20 73 2e 75 72 6c 2e 73 6c 69 63 65 28 20 63 61   s.url.slice( ca
3ddd0 63 68 65 55 52 4c 2e 6c 65 6e 67 74 68 20 29 3b  cheURL.length );
3dde0 0a 0a 09 09 09 2f 2f 20 49 66 20 64 61 74 61 20  .....// If data 
3ddf0 69 73 20 61 76 61 69 6c 61 62 6c 65 20 61 6e 64  is available and
3de00 20 73 68 6f 75 6c 64 20 62 65 20 70 72 6f 63 65   should be proce
3de10 73 73 65 64 2c 20 61 70 70 65 6e 64 20 64 61 74  ssed, append dat
3de20 61 20 74 6f 20 75 72 6c 0a 09 09 09 69 66 20 28  a to url....if (
3de30 20 73 2e 64 61 74 61 20 26 26 20 28 20 73 2e 70   s.data && ( s.p
3de40 72 6f 63 65 73 73 44 61 74 61 20 7c 7c 20 74 79  rocessData || ty
3de50 70 65 6f 66 20 73 2e 64 61 74 61 20 3d 3d 3d 20  peof s.data === 
3de60 22 73 74 72 69 6e 67 22 20 29 20 29 20 7b 0a 09  "string" ) ) {..
3de70 09 09 09 63 61 63 68 65 55 52 4c 20 2b 3d 20 28  ...cacheURL += (
3de80 20 72 71 75 65 72 79 2e 74 65 73 74 28 20 63 61   rquery.test( ca
3de90 63 68 65 55 52 4c 20 29 20 3f 20 22 26 22 20 3a  cheURL ) ? "&" :
3dea0 20 22 3f 22 20 29 20 2b 20 73 2e 64 61 74 61 3b   "?" ) + s.data;
3deb0 0a 0a 09 09 09 09 2f 2f 20 23 39 36 38 32 3a 20  ......// #9682: 
3dec0 72 65 6d 6f 76 65 20 64 61 74 61 20 73 6f 20 74  remove data so t
3ded0 68 61 74 20 69 74 27 73 20 6e 6f 74 20 75 73 65  hat it's not use
3dee0 64 20 69 6e 20 61 6e 20 65 76 65 6e 74 75 61 6c  d in an eventual
3def0 20 72 65 74 72 79 0a 09 09 09 09 64 65 6c 65 74   retry.....delet
3df00 65 20 73 2e 64 61 74 61 3b 0a 09 09 09 7d 0a 0a  e s.data;....}..
3df10 09 09 09 2f 2f 20 41 64 64 20 6f 72 20 75 70 64  ...// Add or upd
3df20 61 74 65 20 61 6e 74 69 2d 63 61 63 68 65 20 70  ate anti-cache p
3df30 61 72 61 6d 20 69 66 20 6e 65 65 64 65 64 0a 09  aram if needed..
3df40 09 09 69 66 20 28 20 73 2e 63 61 63 68 65 20 3d  ..if ( s.cache =
3df50 3d 3d 20 66 61 6c 73 65 20 29 20 7b 0a 09 09 09  == false ) {....
3df60 09 63 61 63 68 65 55 52 4c 20 3d 20 63 61 63 68  .cacheURL = cach
3df70 65 55 52 4c 2e 72 65 70 6c 61 63 65 28 20 72 61  eURL.replace( ra
3df80 6e 74 69 43 61 63 68 65 2c 20 22 24 31 22 20 29  ntiCache, "$1" )
3df90 3b 0a 09 09 09 09 75 6e 63 61 63 68 65 64 20 3d  ;.....uncached =
3dfa0 20 28 20 72 71 75 65 72 79 2e 74 65 73 74 28 20   ( rquery.test( 
3dfb0 63 61 63 68 65 55 52 4c 20 29 20 3f 20 22 26 22  cacheURL ) ? "&"
3dfc0 20 3a 20 22 3f 22 20 29 20 2b 20 22 5f 3d 22 20   : "?" ) + "_=" 
3dfd0 2b 20 28 20 6e 6f 6e 63 65 2e 67 75 69 64 2b 2b  + ( nonce.guid++
3dfe0 20 29 20 2b 0a 09 09 09 09 09 75 6e 63 61 63 68   ) +......uncach
3dff0 65 64 3b 0a 09 09 09 7d 0a 0a 09 09 09 2f 2f 20  ed;....}.....// 
3e000 50 75 74 20 68 61 73 68 20 61 6e 64 20 61 6e 74  Put hash and ant
3e010 69 2d 63 61 63 68 65 20 6f 6e 20 74 68 65 20 55  i-cache on the U
3e020 52 4c 20 74 68 61 74 20 77 69 6c 6c 20 62 65 20  RL that will be 
3e030 72 65 71 75 65 73 74 65 64 20 28 67 68 2d 31 37  requested (gh-17
3e040 33 32 29 0a 09 09 09 73 2e 75 72 6c 20 3d 20 63  32)....s.url = c
3e050 61 63 68 65 55 52 4c 20 2b 20 75 6e 63 61 63 68  acheURL + uncach
3e060 65 64 3b 0a 0a 09 09 2f 2f 20 43 68 61 6e 67 65  ed;....// Change
3e070 20 27 25 32 30 27 20 74 6f 20 27 2b 27 20 69 66   '%20' to '+' if
3e080 20 74 68 69 73 20 69 73 20 65 6e 63 6f 64 65 64   this is encoded
3e090 20 66 6f 72 6d 20 62 6f 64 79 20 63 6f 6e 74 65   form body conte
3e0a0 6e 74 20 28 67 68 2d 32 36 35 38 29 0a 09 09 7d  nt (gh-2658)...}
3e0b0 20 65 6c 73 65 20 69 66 20 28 20 73 2e 64 61 74   else if ( s.dat
3e0c0 61 20 26 26 20 73 2e 70 72 6f 63 65 73 73 44 61  a && s.processDa
3e0d0 74 61 20 26 26 0a 09 09 09 28 20 73 2e 63 6f 6e  ta &&....( s.con
3e0e0 74 65 6e 74 54 79 70 65 20 7c 7c 20 22 22 20 29  tentType || "" )
3e0f0 2e 69 6e 64 65 78 4f 66 28 20 22 61 70 70 6c 69  .indexOf( "appli
3e100 63 61 74 69 6f 6e 2f 78 2d 77 77 77 2d 66 6f 72  cation/x-www-for
3e110 6d 2d 75 72 6c 65 6e 63 6f 64 65 64 22 20 29 20  m-urlencoded" ) 
3e120 3d 3d 3d 20 30 20 29 20 7b 0a 09 09 09 73 2e 64  === 0 ) {....s.d
3e130 61 74 61 20 3d 20 73 2e 64 61 74 61 2e 72 65 70  ata = s.data.rep
3e140 6c 61 63 65 28 20 72 32 30 2c 20 22 2b 22 20 29  lace( r20, "+" )
3e150 3b 0a 09 09 7d 0a 0a 09 09 2f 2f 20 53 65 74 20  ;...}....// Set 
3e160 74 68 65 20 49 66 2d 4d 6f 64 69 66 69 65 64 2d  the If-Modified-
3e170 53 69 6e 63 65 20 61 6e 64 2f 6f 72 20 49 66 2d  Since and/or If-
3e180 4e 6f 6e 65 2d 4d 61 74 63 68 20 68 65 61 64 65  None-Match heade
3e190 72 2c 20 69 66 20 69 6e 20 69 66 4d 6f 64 69 66  r, if in ifModif
3e1a0 69 65 64 20 6d 6f 64 65 2e 0a 09 09 69 66 20 28  ied mode....if (
3e1b0 20 73 2e 69 66 4d 6f 64 69 66 69 65 64 20 29 20   s.ifModified ) 
3e1c0 7b 0a 09 09 09 69 66 20 28 20 6a 51 75 65 72 79  {....if ( jQuery
3e1d0 2e 6c 61 73 74 4d 6f 64 69 66 69 65 64 5b 20 63  .lastModified[ c
3e1e0 61 63 68 65 55 52 4c 20 5d 20 29 20 7b 0a 09 09  acheURL ] ) {...
3e1f0 09 09 6a 71 58 48 52 2e 73 65 74 52 65 71 75 65  ..jqXHR.setReque
3e200 73 74 48 65 61 64 65 72 28 20 22 49 66 2d 4d 6f  stHeader( "If-Mo
3e210 64 69 66 69 65 64 2d 53 69 6e 63 65 22 2c 20 6a  dified-Since", j
3e220 51 75 65 72 79 2e 6c 61 73 74 4d 6f 64 69 66 69  Query.lastModifi
3e230 65 64 5b 20 63 61 63 68 65 55 52 4c 20 5d 20 29  ed[ cacheURL ] )
3e240 3b 0a 09 09 09 7d 0a 09 09 09 69 66 20 28 20 6a  ;....}....if ( j
3e250 51 75 65 72 79 2e 65 74 61 67 5b 20 63 61 63 68  Query.etag[ cach
3e260 65 55 52 4c 20 5d 20 29 20 7b 0a 09 09 09 09 6a  eURL ] ) {.....j
3e270 71 58 48 52 2e 73 65 74 52 65 71 75 65 73 74 48  qXHR.setRequestH
3e280 65 61 64 65 72 28 20 22 49 66 2d 4e 6f 6e 65 2d  eader( "If-None-
3e290 4d 61 74 63 68 22 2c 20 6a 51 75 65 72 79 2e 65  Match", jQuery.e
3e2a0 74 61 67 5b 20 63 61 63 68 65 55 52 4c 20 5d 20  tag[ cacheURL ] 
3e2b0 29 3b 0a 09 09 09 7d 0a 09 09 7d 0a 0a 09 09 2f  );....}...}..../
3e2c0 2f 20 53 65 74 20 74 68 65 20 63 6f 72 72 65 63  / Set the correc
3e2d0 74 20 68 65 61 64 65 72 2c 20 69 66 20 64 61 74  t header, if dat
3e2e0 61 20 69 73 20 62 65 69 6e 67 20 73 65 6e 74 0a  a is being sent.
3e2f0 09 09 69 66 20 28 20 73 2e 64 61 74 61 20 26 26  ..if ( s.data &&
3e300 20 73 2e 68 61 73 43 6f 6e 74 65 6e 74 20 26 26   s.hasContent &&
3e310 20 73 2e 63 6f 6e 74 65 6e 74 54 79 70 65 20 21   s.contentType !
3e320 3d 3d 20 66 61 6c 73 65 20 7c 7c 20 6f 70 74 69  == false || opti
3e330 6f 6e 73 2e 63 6f 6e 74 65 6e 74 54 79 70 65 20  ons.contentType 
3e340 29 20 7b 0a 09 09 09 6a 71 58 48 52 2e 73 65 74  ) {....jqXHR.set
3e350 52 65 71 75 65 73 74 48 65 61 64 65 72 28 20 22  RequestHeader( "
3e360 43 6f 6e 74 65 6e 74 2d 54 79 70 65 22 2c 20 73  Content-Type", s
3e370 2e 63 6f 6e 74 65 6e 74 54 79 70 65 20 29 3b 0a  .contentType );.
3e380 09 09 7d 0a 0a 09 09 2f 2f 20 53 65 74 20 74 68  ..}....// Set th
3e390 65 20 41 63 63 65 70 74 73 20 68 65 61 64 65 72  e Accepts header
3e3a0 20 66 6f 72 20 74 68 65 20 73 65 72 76 65 72 2c   for the server,
3e3b0 20 64 65 70 65 6e 64 69 6e 67 20 6f 6e 20 74 68   depending on th
3e3c0 65 20 64 61 74 61 54 79 70 65 0a 09 09 6a 71 58  e dataType...jqX
3e3d0 48 52 2e 73 65 74 52 65 71 75 65 73 74 48 65 61  HR.setRequestHea
3e3e0 64 65 72 28 0a 09 09 09 22 41 63 63 65 70 74 22  der(...."Accept"
3e3f0 2c 0a 09 09 09 73 2e 64 61 74 61 54 79 70 65 73  ,....s.dataTypes
3e400 5b 20 30 20 5d 20 26 26 20 73 2e 61 63 63 65 70  [ 0 ] && s.accep
3e410 74 73 5b 20 73 2e 64 61 74 61 54 79 70 65 73 5b  ts[ s.dataTypes[
3e420 20 30 20 5d 20 5d 20 3f 0a 09 09 09 09 73 2e 61   0 ] ] ?.....s.a
3e430 63 63 65 70 74 73 5b 20 73 2e 64 61 74 61 54 79  ccepts[ s.dataTy
3e440 70 65 73 5b 20 30 20 5d 20 5d 20 2b 0a 09 09 09  pes[ 0 ] ] +....
3e450 09 09 28 20 73 2e 64 61 74 61 54 79 70 65 73 5b  ..( s.dataTypes[
3e460 20 30 20 5d 20 21 3d 3d 20 22 2a 22 20 3f 20 22   0 ] !== "*" ? "
3e470 2c 20 22 20 2b 20 61 6c 6c 54 79 70 65 73 20 2b  , " + allTypes +
3e480 20 22 3b 20 71 3d 30 2e 30 31 22 20 3a 20 22 22   "; q=0.01" : ""
3e490 20 29 20 3a 0a 09 09 09 09 73 2e 61 63 63 65 70   ) :.....s.accep
3e4a0 74 73 5b 20 22 2a 22 20 5d 0a 09 09 29 3b 0a 0a  ts[ "*" ]...);..
3e4b0 09 09 2f 2f 20 43 68 65 63 6b 20 66 6f 72 20 68  ..// Check for h
3e4c0 65 61 64 65 72 73 20 6f 70 74 69 6f 6e 0a 09 09  eaders option...
3e4d0 66 6f 72 20 28 20 69 20 69 6e 20 73 2e 68 65 61  for ( i in s.hea
3e4e0 64 65 72 73 20 29 20 7b 0a 09 09 09 6a 71 58 48  ders ) {....jqXH
3e4f0 52 2e 73 65 74 52 65 71 75 65 73 74 48 65 61 64  R.setRequestHead
3e500 65 72 28 20 69 2c 20 73 2e 68 65 61 64 65 72 73  er( i, s.headers
3e510 5b 20 69 20 5d 20 29 3b 0a 09 09 7d 0a 0a 09 09  [ i ] );...}....
3e520 2f 2f 20 41 6c 6c 6f 77 20 63 75 73 74 6f 6d 20  // Allow custom 
3e530 68 65 61 64 65 72 73 2f 6d 69 6d 65 74 79 70 65  headers/mimetype
3e540 73 20 61 6e 64 20 65 61 72 6c 79 20 61 62 6f 72  s and early abor
3e550 74 0a 09 09 69 66 20 28 20 73 2e 62 65 66 6f 72  t...if ( s.befor
3e560 65 53 65 6e 64 20 26 26 0a 09 09 09 28 20 73 2e  eSend &&....( s.
3e570 62 65 66 6f 72 65 53 65 6e 64 2e 63 61 6c 6c 28  beforeSend.call(
3e580 20 63 61 6c 6c 62 61 63 6b 43 6f 6e 74 65 78 74   callbackContext
3e590 2c 20 6a 71 58 48 52 2c 20 73 20 29 20 3d 3d 3d  , jqXHR, s ) ===
3e5a0 20 66 61 6c 73 65 20 7c 7c 20 63 6f 6d 70 6c 65   false || comple
3e5b0 74 65 64 20 29 20 29 20 7b 0a 0a 09 09 09 2f 2f  ted ) ) {.....//
3e5c0 20 41 62 6f 72 74 20 69 66 20 6e 6f 74 20 64 6f   Abort if not do
3e5d0 6e 65 20 61 6c 72 65 61 64 79 20 61 6e 64 20 72  ne already and r
3e5e0 65 74 75 72 6e 0a 09 09 09 72 65 74 75 72 6e 20  eturn....return 
3e5f0 6a 71 58 48 52 2e 61 62 6f 72 74 28 29 3b 0a 09  jqXHR.abort();..
3e600 09 7d 0a 0a 09 09 2f 2f 20 41 62 6f 72 74 69 6e  .}....// Abortin
3e610 67 20 69 73 20 6e 6f 20 6c 6f 6e 67 65 72 20 61  g is no longer a
3e620 20 63 61 6e 63 65 6c 6c 61 74 69 6f 6e 0a 09 09   cancellation...
3e630 73 74 72 41 62 6f 72 74 20 3d 20 22 61 62 6f 72  strAbort = "abor
3e640 74 22 3b 0a 0a 09 09 2f 2f 20 49 6e 73 74 61 6c  t";....// Instal
3e650 6c 20 63 61 6c 6c 62 61 63 6b 73 20 6f 6e 20 64  l callbacks on d
3e660 65 66 65 72 72 65 64 73 0a 09 09 63 6f 6d 70 6c  eferreds...compl
3e670 65 74 65 44 65 66 65 72 72 65 64 2e 61 64 64 28  eteDeferred.add(
3e680 20 73 2e 63 6f 6d 70 6c 65 74 65 20 29 3b 0a 09   s.complete );..
3e690 09 6a 71 58 48 52 2e 64 6f 6e 65 28 20 73 2e 73  .jqXHR.done( s.s
3e6a0 75 63 63 65 73 73 20 29 3b 0a 09 09 6a 71 58 48  uccess );...jqXH
3e6b0 52 2e 66 61 69 6c 28 20 73 2e 65 72 72 6f 72 20  R.fail( s.error 
3e6c0 29 3b 0a 0a 09 09 2f 2f 20 47 65 74 20 74 72 61  );....// Get tra
3e6d0 6e 73 70 6f 72 74 0a 09 09 74 72 61 6e 73 70 6f  nsport...transpo
3e6e0 72 74 20 3d 20 69 6e 73 70 65 63 74 50 72 65 66  rt = inspectPref
3e6f0 69 6c 74 65 72 73 4f 72 54 72 61 6e 73 70 6f 72  iltersOrTranspor
3e700 74 73 28 20 74 72 61 6e 73 70 6f 72 74 73 2c 20  ts( transports, 
3e710 73 2c 20 6f 70 74 69 6f 6e 73 2c 20 6a 71 58 48  s, options, jqXH
3e720 52 20 29 3b 0a 0a 09 09 2f 2f 20 49 66 20 6e 6f  R );....// If no
3e730 20 74 72 61 6e 73 70 6f 72 74 2c 20 77 65 20 61   transport, we a
3e740 75 74 6f 2d 61 62 6f 72 74 0a 09 09 69 66 20 28  uto-abort...if (
3e750 20 21 74 72 61 6e 73 70 6f 72 74 20 29 20 7b 0a   !transport ) {.
3e760 09 09 09 64 6f 6e 65 28 20 2d 31 2c 20 22 4e 6f  ...done( -1, "No
3e770 20 54 72 61 6e 73 70 6f 72 74 22 20 29 3b 0a 09   Transport" );..
3e780 09 7d 20 65 6c 73 65 20 7b 0a 09 09 09 6a 71 58  .} else {....jqX
3e790 48 52 2e 72 65 61 64 79 53 74 61 74 65 20 3d 20  HR.readyState = 
3e7a0 31 3b 0a 0a 09 09 09 2f 2f 20 53 65 6e 64 20 67  1;.....// Send g
3e7b0 6c 6f 62 61 6c 20 65 76 65 6e 74 0a 09 09 09 69  lobal event....i
3e7c0 66 20 28 20 66 69 72 65 47 6c 6f 62 61 6c 73 20  f ( fireGlobals 
3e7d0 29 20 7b 0a 09 09 09 09 67 6c 6f 62 61 6c 45 76  ) {.....globalEv
3e7e0 65 6e 74 43 6f 6e 74 65 78 74 2e 74 72 69 67 67  entContext.trigg
3e7f0 65 72 28 20 22 61 6a 61 78 53 65 6e 64 22 2c 20  er( "ajaxSend", 
3e800 5b 20 6a 71 58 48 52 2c 20 73 20 5d 20 29 3b 0a  [ jqXHR, s ] );.
3e810 09 09 09 7d 0a 0a 09 09 09 2f 2f 20 49 66 20 72  ...}.....// If r
3e820 65 71 75 65 73 74 20 77 61 73 20 61 62 6f 72 74  equest was abort
3e830 65 64 20 69 6e 73 69 64 65 20 61 6a 61 78 53 65  ed inside ajaxSe
3e840 6e 64 2c 20 73 74 6f 70 20 74 68 65 72 65 0a 09  nd, stop there..
3e850 09 09 69 66 20 28 20 63 6f 6d 70 6c 65 74 65 64  ..if ( completed
3e860 20 29 20 7b 0a 09 09 09 09 72 65 74 75 72 6e 20   ) {.....return 
3e870 6a 71 58 48 52 3b 0a 09 09 09 7d 0a 0a 09 09 09  jqXHR;....}.....
3e880 2f 2f 20 54 69 6d 65 6f 75 74 0a 09 09 09 69 66  // Timeout....if
3e890 20 28 20 73 2e 61 73 79 6e 63 20 26 26 20 73 2e   ( s.async && s.
3e8a0 74 69 6d 65 6f 75 74 20 3e 20 30 20 29 20 7b 0a  timeout > 0 ) {.
3e8b0 09 09 09 09 74 69 6d 65 6f 75 74 54 69 6d 65 72  ....timeoutTimer
3e8c0 20 3d 20 77 69 6e 64 6f 77 2e 73 65 74 54 69 6d   = window.setTim
3e8d0 65 6f 75 74 28 20 66 75 6e 63 74 69 6f 6e 28 29  eout( function()
3e8e0 20 7b 0a 09 09 09 09 09 6a 71 58 48 52 2e 61 62   {......jqXHR.ab
3e8f0 6f 72 74 28 20 22 74 69 6d 65 6f 75 74 22 20 29  ort( "timeout" )
3e900 3b 0a 09 09 09 09 7d 2c 20 73 2e 74 69 6d 65 6f  ;.....}, s.timeo
3e910 75 74 20 29 3b 0a 09 09 09 7d 0a 0a 09 09 09 74  ut );....}.....t
3e920 72 79 20 7b 0a 09 09 09 09 63 6f 6d 70 6c 65 74  ry {.....complet
3e930 65 64 20 3d 20 66 61 6c 73 65 3b 0a 09 09 09 09  ed = false;.....
3e940 74 72 61 6e 73 70 6f 72 74 2e 73 65 6e 64 28 20  transport.send( 
3e950 72 65 71 75 65 73 74 48 65 61 64 65 72 73 2c 20  requestHeaders, 
3e960 64 6f 6e 65 20 29 3b 0a 09 09 09 7d 20 63 61 74  done );....} cat
3e970 63 68 20 28 20 65 20 29 20 7b 0a 0a 09 09 09 09  ch ( e ) {......
3e980 2f 2f 20 52 65 74 68 72 6f 77 20 70 6f 73 74 2d  // Rethrow post-
3e990 63 6f 6d 70 6c 65 74 69 6f 6e 20 65 78 63 65 70  completion excep
3e9a0 74 69 6f 6e 73 0a 09 09 09 09 69 66 20 28 20 63  tions.....if ( c
3e9b0 6f 6d 70 6c 65 74 65 64 20 29 20 7b 0a 09 09 09  ompleted ) {....
3e9c0 09 09 74 68 72 6f 77 20 65 3b 0a 09 09 09 09 7d  ..throw e;.....}
3e9d0 0a 0a 09 09 09 09 2f 2f 20 50 72 6f 70 61 67 61  ......// Propaga
3e9e0 74 65 20 6f 74 68 65 72 73 20 61 73 20 72 65 73  te others as res
3e9f0 75 6c 74 73 0a 09 09 09 09 64 6f 6e 65 28 20 2d  ults.....done( -
3ea00 31 2c 20 65 20 29 3b 0a 09 09 09 7d 0a 09 09 7d  1, e );....}...}
3ea10 0a 0a 09 09 2f 2f 20 43 61 6c 6c 62 61 63 6b 20  ....// Callback 
3ea20 66 6f 72 20 77 68 65 6e 20 65 76 65 72 79 74 68  for when everyth
3ea30 69 6e 67 20 69 73 20 64 6f 6e 65 0a 09 09 66 75  ing is done...fu
3ea40 6e 63 74 69 6f 6e 20 64 6f 6e 65 28 20 73 74 61  nction done( sta
3ea50 74 75 73 2c 20 6e 61 74 69 76 65 53 74 61 74 75  tus, nativeStatu
3ea60 73 54 65 78 74 2c 20 72 65 73 70 6f 6e 73 65 73  sText, responses
3ea70 2c 20 68 65 61 64 65 72 73 20 29 20 7b 0a 09 09  , headers ) {...
3ea80 09 76 61 72 20 69 73 53 75 63 63 65 73 73 2c 20  .var isSuccess, 
3ea90 73 75 63 63 65 73 73 2c 20 65 72 72 6f 72 2c 20  success, error, 
3eaa0 72 65 73 70 6f 6e 73 65 2c 20 6d 6f 64 69 66 69  response, modifi
3eab0 65 64 2c 0a 09 09 09 09 73 74 61 74 75 73 54 65  ed,.....statusTe
3eac0 78 74 20 3d 20 6e 61 74 69 76 65 53 74 61 74 75  xt = nativeStatu
3ead0 73 54 65 78 74 3b 0a 0a 09 09 09 2f 2f 20 49 67  sText;.....// Ig
3eae0 6e 6f 72 65 20 72 65 70 65 61 74 20 69 6e 76 6f  nore repeat invo
3eaf0 63 61 74 69 6f 6e 73 0a 09 09 09 69 66 20 28 20  cations....if ( 
3eb00 63 6f 6d 70 6c 65 74 65 64 20 29 20 7b 0a 09 09  completed ) {...
3eb10 09 09 72 65 74 75 72 6e 3b 0a 09 09 09 7d 0a 0a  ..return;....}..
3eb20 09 09 09 63 6f 6d 70 6c 65 74 65 64 20 3d 20 74  ...completed = t
3eb30 72 75 65 3b 0a 0a 09 09 09 2f 2f 20 43 6c 65 61  rue;.....// Clea
3eb40 72 20 74 69 6d 65 6f 75 74 20 69 66 20 69 74 20  r timeout if it 
3eb50 65 78 69 73 74 73 0a 09 09 09 69 66 20 28 20 74  exists....if ( t
3eb60 69 6d 65 6f 75 74 54 69 6d 65 72 20 29 20 7b 0a  imeoutTimer ) {.
3eb70 09 09 09 09 77 69 6e 64 6f 77 2e 63 6c 65 61 72  ....window.clear
3eb80 54 69 6d 65 6f 75 74 28 20 74 69 6d 65 6f 75 74  Timeout( timeout
3eb90 54 69 6d 65 72 20 29 3b 0a 09 09 09 7d 0a 0a 09  Timer );....}...
3eba0 09 09 2f 2f 20 44 65 72 65 66 65 72 65 6e 63 65  ..// Dereference
3ebb0 20 74 72 61 6e 73 70 6f 72 74 20 66 6f 72 20 65   transport for e
3ebc0 61 72 6c 79 20 67 61 72 62 61 67 65 20 63 6f 6c  arly garbage col
3ebd0 6c 65 63 74 69 6f 6e 0a 09 09 09 2f 2f 20 28 6e  lection....// (n
3ebe0 6f 20 6d 61 74 74 65 72 20 68 6f 77 20 6c 6f 6e  o matter how lon
3ebf0 67 20 74 68 65 20 6a 71 58 48 52 20 6f 62 6a 65  g the jqXHR obje
3ec00 63 74 20 77 69 6c 6c 20 62 65 20 75 73 65 64 29  ct will be used)
3ec10 0a 09 09 09 74 72 61 6e 73 70 6f 72 74 20 3d 20  ....transport = 
3ec20 75 6e 64 65 66 69 6e 65 64 3b 0a 0a 09 09 09 2f  undefined;...../
3ec30 2f 20 43 61 63 68 65 20 72 65 73 70 6f 6e 73 65  / Cache response
3ec40 20 68 65 61 64 65 72 73 0a 09 09 09 72 65 73 70   headers....resp
3ec50 6f 6e 73 65 48 65 61 64 65 72 73 53 74 72 69 6e  onseHeadersStrin
3ec60 67 20 3d 20 68 65 61 64 65 72 73 20 7c 7c 20 22  g = headers || "
3ec70 22 3b 0a 0a 09 09 09 2f 2f 20 53 65 74 20 72 65  ";.....// Set re
3ec80 61 64 79 53 74 61 74 65 0a 09 09 09 6a 71 58 48  adyState....jqXH
3ec90 52 2e 72 65 61 64 79 53 74 61 74 65 20 3d 20 73  R.readyState = s
3eca0 74 61 74 75 73 20 3e 20 30 20 3f 20 34 20 3a 20  tatus > 0 ? 4 : 
3ecb0 30 3b 0a 0a 09 09 09 2f 2f 20 44 65 74 65 72 6d  0;.....// Determ
3ecc0 69 6e 65 20 69 66 20 73 75 63 63 65 73 73 66 75  ine if successfu
3ecd0 6c 0a 09 09 09 69 73 53 75 63 63 65 73 73 20 3d  l....isSuccess =
3ece0 20 73 74 61 74 75 73 20 3e 3d 20 32 30 30 20 26   status >= 200 &
3ecf0 26 20 73 74 61 74 75 73 20 3c 20 33 30 30 20 7c  & status < 300 |
3ed00 7c 20 73 74 61 74 75 73 20 3d 3d 3d 20 33 30 34  | status === 304
3ed10 3b 0a 0a 09 09 09 2f 2f 20 47 65 74 20 72 65 73  ;.....// Get res
3ed20 70 6f 6e 73 65 20 64 61 74 61 0a 09 09 09 69 66  ponse data....if
3ed30 20 28 20 72 65 73 70 6f 6e 73 65 73 20 29 20 7b   ( responses ) {
3ed40 0a 09 09 09 09 72 65 73 70 6f 6e 73 65 20 3d 20  .....response = 
3ed50 61 6a 61 78 48 61 6e 64 6c 65 52 65 73 70 6f 6e  ajaxHandleRespon
3ed60 73 65 73 28 20 73 2c 20 6a 71 58 48 52 2c 20 72  ses( s, jqXHR, r
3ed70 65 73 70 6f 6e 73 65 73 20 29 3b 0a 09 09 09 7d  esponses );....}
3ed80 0a 0a 09 09 09 2f 2f 20 55 73 65 20 61 20 6e 6f  .....// Use a no
3ed90 6f 70 20 63 6f 6e 76 65 72 74 65 72 20 66 6f 72  op converter for
3eda0 20 6d 69 73 73 69 6e 67 20 73 63 72 69 70 74 0a   missing script.
3edb0 09 09 09 69 66 20 28 20 21 69 73 53 75 63 63 65  ...if ( !isSucce
3edc0 73 73 20 26 26 20 6a 51 75 65 72 79 2e 69 6e 41  ss && jQuery.inA
3edd0 72 72 61 79 28 20 22 73 63 72 69 70 74 22 2c 20  rray( "script", 
3ede0 73 2e 64 61 74 61 54 79 70 65 73 20 29 20 3e 20  s.dataTypes ) > 
3edf0 2d 31 20 29 20 7b 0a 09 09 09 09 73 2e 63 6f 6e  -1 ) {.....s.con
3ee00 76 65 72 74 65 72 73 5b 20 22 74 65 78 74 20 73  verters[ "text s
3ee10 63 72 69 70 74 22 20 5d 20 3d 20 66 75 6e 63 74  cript" ] = funct
3ee20 69 6f 6e 28 29 20 7b 7d 3b 0a 09 09 09 7d 0a 0a  ion() {};....}..
3ee30 09 09 09 2f 2f 20 43 6f 6e 76 65 72 74 20 6e 6f  ...// Convert no
3ee40 20 6d 61 74 74 65 72 20 77 68 61 74 20 28 74 68   matter what (th
3ee50 61 74 20 77 61 79 20 72 65 73 70 6f 6e 73 65 58  at way responseX
3ee60 58 58 20 66 69 65 6c 64 73 20 61 72 65 20 61 6c  XX fields are al
3ee70 77 61 79 73 20 73 65 74 29 0a 09 09 09 72 65 73  ways set)....res
3ee80 70 6f 6e 73 65 20 3d 20 61 6a 61 78 43 6f 6e 76  ponse = ajaxConv
3ee90 65 72 74 28 20 73 2c 20 72 65 73 70 6f 6e 73 65  ert( s, response
3eea0 2c 20 6a 71 58 48 52 2c 20 69 73 53 75 63 63 65  , jqXHR, isSucce
3eeb0 73 73 20 29 3b 0a 0a 09 09 09 2f 2f 20 49 66 20  ss );.....// If 
3eec0 73 75 63 63 65 73 73 66 75 6c 2c 20 68 61 6e 64  successful, hand
3eed0 6c 65 20 74 79 70 65 20 63 68 61 69 6e 69 6e 67  le type chaining
3eee0 0a 09 09 09 69 66 20 28 20 69 73 53 75 63 63 65  ....if ( isSucce
3eef0 73 73 20 29 20 7b 0a 0a 09 09 09 09 2f 2f 20 53  ss ) {......// S
3ef00 65 74 20 74 68 65 20 49 66 2d 4d 6f 64 69 66 69  et the If-Modifi
3ef10 65 64 2d 53 69 6e 63 65 20 61 6e 64 2f 6f 72 20  ed-Since and/or 
3ef20 49 66 2d 4e 6f 6e 65 2d 4d 61 74 63 68 20 68 65  If-None-Match he
3ef30 61 64 65 72 2c 20 69 66 20 69 6e 20 69 66 4d 6f  ader, if in ifMo
3ef40 64 69 66 69 65 64 20 6d 6f 64 65 2e 0a 09 09 09  dified mode.....
3ef50 09 69 66 20 28 20 73 2e 69 66 4d 6f 64 69 66 69  .if ( s.ifModifi
3ef60 65 64 20 29 20 7b 0a 09 09 09 09 09 6d 6f 64 69  ed ) {......modi
3ef70 66 69 65 64 20 3d 20 6a 71 58 48 52 2e 67 65 74  fied = jqXHR.get
3ef80 52 65 73 70 6f 6e 73 65 48 65 61 64 65 72 28 20  ResponseHeader( 
3ef90 22 4c 61 73 74 2d 4d 6f 64 69 66 69 65 64 22 20  "Last-Modified" 
3efa0 29 3b 0a 09 09 09 09 09 69 66 20 28 20 6d 6f 64  );......if ( mod
3efb0 69 66 69 65 64 20 29 20 7b 0a 09 09 09 09 09 09  ified ) {.......
3efc0 6a 51 75 65 72 79 2e 6c 61 73 74 4d 6f 64 69 66  jQuery.lastModif
3efd0 69 65 64 5b 20 63 61 63 68 65 55 52 4c 20 5d 20  ied[ cacheURL ] 
3efe0 3d 20 6d 6f 64 69 66 69 65 64 3b 0a 09 09 09 09  = modified;.....
3eff0 09 7d 0a 09 09 09 09 09 6d 6f 64 69 66 69 65 64  .}......modified
3f000 20 3d 20 6a 71 58 48 52 2e 67 65 74 52 65 73 70   = jqXHR.getResp
3f010 6f 6e 73 65 48 65 61 64 65 72 28 20 22 65 74 61  onseHeader( "eta
3f020 67 22 20 29 3b 0a 09 09 09 09 09 69 66 20 28 20  g" );......if ( 
3f030 6d 6f 64 69 66 69 65 64 20 29 20 7b 0a 09 09 09  modified ) {....
3f040 09 09 09 6a 51 75 65 72 79 2e 65 74 61 67 5b 20  ...jQuery.etag[ 
3f050 63 61 63 68 65 55 52 4c 20 5d 20 3d 20 6d 6f 64  cacheURL ] = mod
3f060 69 66 69 65 64 3b 0a 09 09 09 09 09 7d 0a 09 09  ified;......}...
3f070 09 09 7d 0a 0a 09 09 09 09 2f 2f 20 69 66 20 6e  ..}......// if n
3f080 6f 20 63 6f 6e 74 65 6e 74 0a 09 09 09 09 69 66  o content.....if
3f090 20 28 20 73 74 61 74 75 73 20 3d 3d 3d 20 32 30   ( status === 20
3f0a0 34 20 7c 7c 20 73 2e 74 79 70 65 20 3d 3d 3d 20  4 || s.type === 
3f0b0 22 48 45 41 44 22 20 29 20 7b 0a 09 09 09 09 09  "HEAD" ) {......
3f0c0 73 74 61 74 75 73 54 65 78 74 20 3d 20 22 6e 6f  statusText = "no
3f0d0 63 6f 6e 74 65 6e 74 22 3b 0a 0a 09 09 09 09 2f  content";....../
3f0e0 2f 20 69 66 20 6e 6f 74 20 6d 6f 64 69 66 69 65  / if not modifie
3f0f0 64 0a 09 09 09 09 7d 20 65 6c 73 65 20 69 66 20  d.....} else if 
3f100 28 20 73 74 61 74 75 73 20 3d 3d 3d 20 33 30 34  ( status === 304
3f110 20 29 20 7b 0a 09 09 09 09 09 73 74 61 74 75 73   ) {......status
3f120 54 65 78 74 20 3d 20 22 6e 6f 74 6d 6f 64 69 66  Text = "notmodif
3f130 69 65 64 22 3b 0a 0a 09 09 09 09 2f 2f 20 49 66  ied";......// If
3f140 20 77 65 20 68 61 76 65 20 64 61 74 61 2c 20 6c   we have data, l
3f150 65 74 27 73 20 63 6f 6e 76 65 72 74 20 69 74 0a  et's convert it.
3f160 09 09 09 09 7d 20 65 6c 73 65 20 7b 0a 09 09 09  ....} else {....
3f170 09 09 73 74 61 74 75 73 54 65 78 74 20 3d 20 72  ..statusText = r
3f180 65 73 70 6f 6e 73 65 2e 73 74 61 74 65 3b 0a 09  esponse.state;..
3f190 09 09 09 09 73 75 63 63 65 73 73 20 3d 20 72 65  ....success = re
3f1a0 73 70 6f 6e 73 65 2e 64 61 74 61 3b 0a 09 09 09  sponse.data;....
3f1b0 09 09 65 72 72 6f 72 20 3d 20 72 65 73 70 6f 6e  ..error = respon
3f1c0 73 65 2e 65 72 72 6f 72 3b 0a 09 09 09 09 09 69  se.error;......i
3f1d0 73 53 75 63 63 65 73 73 20 3d 20 21 65 72 72 6f  sSuccess = !erro
3f1e0 72 3b 0a 09 09 09 09 7d 0a 09 09 09 7d 20 65 6c  r;.....}....} el
3f1f0 73 65 20 7b 0a 0a 09 09 09 09 2f 2f 20 45 78 74  se {......// Ext
3f200 72 61 63 74 20 65 72 72 6f 72 20 66 72 6f 6d 20  ract error from 
3f210 73 74 61 74 75 73 54 65 78 74 20 61 6e 64 20 6e  statusText and n
3f220 6f 72 6d 61 6c 69 7a 65 20 66 6f 72 20 6e 6f 6e  ormalize for non
3f230 2d 61 62 6f 72 74 73 0a 09 09 09 09 65 72 72 6f  -aborts.....erro
3f240 72 20 3d 20 73 74 61 74 75 73 54 65 78 74 3b 0a  r = statusText;.
3f250 09 09 09 09 69 66 20 28 20 73 74 61 74 75 73 20  ....if ( status 
3f260 7c 7c 20 21 73 74 61 74 75 73 54 65 78 74 20 29  || !statusText )
3f270 20 7b 0a 09 09 09 09 09 73 74 61 74 75 73 54 65   {......statusTe
3f280 78 74 20 3d 20 22 65 72 72 6f 72 22 3b 0a 09 09  xt = "error";...
3f290 09 09 09 69 66 20 28 20 73 74 61 74 75 73 20 3c  ...if ( status <
3f2a0 20 30 20 29 20 7b 0a 09 09 09 09 09 09 73 74 61   0 ) {.......sta
3f2b0 74 75 73 20 3d 20 30 3b 0a 09 09 09 09 09 7d 0a  tus = 0;......}.
3f2c0 09 09 09 09 7d 0a 09 09 09 7d 0a 0a 09 09 09 2f  ....}....}...../
3f2d0 2f 20 53 65 74 20 64 61 74 61 20 66 6f 72 20 74  / Set data for t
3f2e0 68 65 20 66 61 6b 65 20 78 68 72 20 6f 62 6a 65  he fake xhr obje
3f2f0 63 74 0a 09 09 09 6a 71 58 48 52 2e 73 74 61 74  ct....jqXHR.stat
3f300 75 73 20 3d 20 73 74 61 74 75 73 3b 0a 09 09 09  us = status;....
3f310 6a 71 58 48 52 2e 73 74 61 74 75 73 54 65 78 74  jqXHR.statusText
3f320 20 3d 20 28 20 6e 61 74 69 76 65 53 74 61 74 75   = ( nativeStatu
3f330 73 54 65 78 74 20 7c 7c 20 73 74 61 74 75 73 54  sText || statusT
3f340 65 78 74 20 29 20 2b 20 22 22 3b 0a 0a 09 09 09  ext ) + "";.....
3f350 2f 2f 20 53 75 63 63 65 73 73 2f 45 72 72 6f 72  // Success/Error
3f360 0a 09 09 09 69 66 20 28 20 69 73 53 75 63 63 65  ....if ( isSucce
3f370 73 73 20 29 20 7b 0a 09 09 09 09 64 65 66 65 72  ss ) {.....defer
3f380 72 65 64 2e 72 65 73 6f 6c 76 65 57 69 74 68 28  red.resolveWith(
3f390 20 63 61 6c 6c 62 61 63 6b 43 6f 6e 74 65 78 74   callbackContext
3f3a0 2c 20 5b 20 73 75 63 63 65 73 73 2c 20 73 74 61  , [ success, sta
3f3b0 74 75 73 54 65 78 74 2c 20 6a 71 58 48 52 20 5d  tusText, jqXHR ]
3f3c0 20 29 3b 0a 09 09 09 7d 20 65 6c 73 65 20 7b 0a   );....} else {.
3f3d0 09 09 09 09 64 65 66 65 72 72 65 64 2e 72 65 6a  ....deferred.rej
3f3e0 65 63 74 57 69 74 68 28 20 63 61 6c 6c 62 61 63  ectWith( callbac
3f3f0 6b 43 6f 6e 74 65 78 74 2c 20 5b 20 6a 71 58 48  kContext, [ jqXH
3f400 52 2c 20 73 74 61 74 75 73 54 65 78 74 2c 20 65  R, statusText, e
3f410 72 72 6f 72 20 5d 20 29 3b 0a 09 09 09 7d 0a 0a  rror ] );....}..
3f420 09 09 09 2f 2f 20 53 74 61 74 75 73 2d 64 65 70  ...// Status-dep
3f430 65 6e 64 65 6e 74 20 63 61 6c 6c 62 61 63 6b 73  endent callbacks
3f440 0a 09 09 09 6a 71 58 48 52 2e 73 74 61 74 75 73  ....jqXHR.status
3f450 43 6f 64 65 28 20 73 74 61 74 75 73 43 6f 64 65  Code( statusCode
3f460 20 29 3b 0a 09 09 09 73 74 61 74 75 73 43 6f 64   );....statusCod
3f470 65 20 3d 20 75 6e 64 65 66 69 6e 65 64 3b 0a 0a  e = undefined;..
3f480 09 09 09 69 66 20 28 20 66 69 72 65 47 6c 6f 62  ...if ( fireGlob
3f490 61 6c 73 20 29 20 7b 0a 09 09 09 09 67 6c 6f 62  als ) {.....glob
3f4a0 61 6c 45 76 65 6e 74 43 6f 6e 74 65 78 74 2e 74  alEventContext.t
3f4b0 72 69 67 67 65 72 28 20 69 73 53 75 63 63 65 73  rigger( isSucces
3f4c0 73 20 3f 20 22 61 6a 61 78 53 75 63 63 65 73 73  s ? "ajaxSuccess
3f4d0 22 20 3a 20 22 61 6a 61 78 45 72 72 6f 72 22 2c  " : "ajaxError",
3f4e0 0a 09 09 09 09 09 5b 20 6a 71 58 48 52 2c 20 73  ......[ jqXHR, s
3f4f0 2c 20 69 73 53 75 63 63 65 73 73 20 3f 20 73 75  , isSuccess ? su
3f500 63 63 65 73 73 20 3a 20 65 72 72 6f 72 20 5d 20  ccess : error ] 
3f510 29 3b 0a 09 09 09 7d 0a 0a 09 09 09 2f 2f 20 43  );....}.....// C
3f520 6f 6d 70 6c 65 74 65 0a 09 09 09 63 6f 6d 70 6c  omplete....compl
3f530 65 74 65 44 65 66 65 72 72 65 64 2e 66 69 72 65  eteDeferred.fire
3f540 57 69 74 68 28 20 63 61 6c 6c 62 61 63 6b 43 6f  With( callbackCo
3f550 6e 74 65 78 74 2c 20 5b 20 6a 71 58 48 52 2c 20  ntext, [ jqXHR, 
3f560 73 74 61 74 75 73 54 65 78 74 20 5d 20 29 3b 0a  statusText ] );.
3f570 0a 09 09 09 69 66 20 28 20 66 69 72 65 47 6c 6f  ....if ( fireGlo
3f580 62 61 6c 73 20 29 20 7b 0a 09 09 09 09 67 6c 6f  bals ) {.....glo
3f590 62 61 6c 45 76 65 6e 74 43 6f 6e 74 65 78 74 2e  balEventContext.
3f5a0 74 72 69 67 67 65 72 28 20 22 61 6a 61 78 43 6f  trigger( "ajaxCo
3f5b0 6d 70 6c 65 74 65 22 2c 20 5b 20 6a 71 58 48 52  mplete", [ jqXHR
3f5c0 2c 20 73 20 5d 20 29 3b 0a 0a 09 09 09 09 2f 2f  , s ] );......//
3f5d0 20 48 61 6e 64 6c 65 20 74 68 65 20 67 6c 6f 62   Handle the glob
3f5e0 61 6c 20 41 4a 41 58 20 63 6f 75 6e 74 65 72 0a  al AJAX counter.
3f5f0 09 09 09 09 69 66 20 28 20 21 28 20 2d 2d 6a 51  ....if ( !( --jQ
3f600 75 65 72 79 2e 61 63 74 69 76 65 20 29 20 29 20  uery.active ) ) 
3f610 7b 0a 09 09 09 09 09 6a 51 75 65 72 79 2e 65 76  {......jQuery.ev
3f620 65 6e 74 2e 74 72 69 67 67 65 72 28 20 22 61 6a  ent.trigger( "aj
3f630 61 78 53 74 6f 70 22 20 29 3b 0a 09 09 09 09 7d  axStop" );.....}
3f640 0a 09 09 09 7d 0a 09 09 7d 0a 0a 09 09 72 65 74  ....}...}....ret
3f650 75 72 6e 20 6a 71 58 48 52 3b 0a 09 7d 2c 0a 0a  urn jqXHR;..},..
3f660 09 67 65 74 4a 53 4f 4e 3a 20 66 75 6e 63 74 69  .getJSON: functi
3f670 6f 6e 28 20 75 72 6c 2c 20 64 61 74 61 2c 20 63  on( url, data, c
3f680 61 6c 6c 62 61 63 6b 20 29 20 7b 0a 09 09 72 65  allback ) {...re
3f690 74 75 72 6e 20 6a 51 75 65 72 79 2e 67 65 74 28  turn jQuery.get(
3f6a0 20 75 72 6c 2c 20 64 61 74 61 2c 20 63 61 6c 6c   url, data, call
3f6b0 62 61 63 6b 2c 20 22 6a 73 6f 6e 22 20 29 3b 0a  back, "json" );.
3f6c0 09 7d 2c 0a 0a 09 67 65 74 53 63 72 69 70 74 3a  .},...getScript:
3f6d0 20 66 75 6e 63 74 69 6f 6e 28 20 75 72 6c 2c 20   function( url, 
3f6e0 63 61 6c 6c 62 61 63 6b 20 29 20 7b 0a 09 09 72  callback ) {...r
3f6f0 65 74 75 72 6e 20 6a 51 75 65 72 79 2e 67 65 74  eturn jQuery.get
3f700 28 20 75 72 6c 2c 20 75 6e 64 65 66 69 6e 65 64  ( url, undefined
3f710 2c 20 63 61 6c 6c 62 61 63 6b 2c 20 22 73 63 72  , callback, "scr
3f720 69 70 74 22 20 29 3b 0a 09 7d 0a 7d 20 29 3b 0a  ipt" );..}.} );.
3f730 0a 6a 51 75 65 72 79 2e 65 61 63 68 28 20 5b 20  .jQuery.each( [ 
3f740 22 67 65 74 22 2c 20 22 70 6f 73 74 22 20 5d 2c  "get", "post" ],
3f750 20 66 75 6e 63 74 69 6f 6e 28 20 5f 69 2c 20 6d   function( _i, m
3f760 65 74 68 6f 64 20 29 20 7b 0a 09 6a 51 75 65 72  ethod ) {..jQuer
3f770 79 5b 20 6d 65 74 68 6f 64 20 5d 20 3d 20 66 75  y[ method ] = fu
3f780 6e 63 74 69 6f 6e 28 20 75 72 6c 2c 20 64 61 74  nction( url, dat
3f790 61 2c 20 63 61 6c 6c 62 61 63 6b 2c 20 74 79 70  a, callback, typ
3f7a0 65 20 29 20 7b 0a 0a 09 09 2f 2f 20 53 68 69 66  e ) {....// Shif
3f7b0 74 20 61 72 67 75 6d 65 6e 74 73 20 69 66 20 64  t arguments if d
3f7c0 61 74 61 20 61 72 67 75 6d 65 6e 74 20 77 61 73  ata argument was
3f7d0 20 6f 6d 69 74 74 65 64 0a 09 09 69 66 20 28 20   omitted...if ( 
3f7e0 69 73 46 75 6e 63 74 69 6f 6e 28 20 64 61 74 61  isFunction( data
3f7f0 20 29 20 29 20 7b 0a 09 09 09 74 79 70 65 20 3d   ) ) {....type =
3f800 20 74 79 70 65 20 7c 7c 20 63 61 6c 6c 62 61 63   type || callbac
3f810 6b 3b 0a 09 09 09 63 61 6c 6c 62 61 63 6b 20 3d  k;....callback =
3f820 20 64 61 74 61 3b 0a 09 09 09 64 61 74 61 20 3d   data;....data =
3f830 20 75 6e 64 65 66 69 6e 65 64 3b 0a 09 09 7d 0a   undefined;...}.
3f840 0a 09 09 2f 2f 20 54 68 65 20 75 72 6c 20 63 61  ...// The url ca
3f850 6e 20 62 65 20 61 6e 20 6f 70 74 69 6f 6e 73 20  n be an options 
3f860 6f 62 6a 65 63 74 20 28 77 68 69 63 68 20 74 68  object (which th
3f870 65 6e 20 6d 75 73 74 20 68 61 76 65 20 2e 75 72  en must have .ur
3f880 6c 29 0a 09 09 72 65 74 75 72 6e 20 6a 51 75 65  l)...return jQue
3f890 72 79 2e 61 6a 61 78 28 20 6a 51 75 65 72 79 2e  ry.ajax( jQuery.
3f8a0 65 78 74 65 6e 64 28 20 7b 0a 09 09 09 75 72 6c  extend( {....url
3f8b0 3a 20 75 72 6c 2c 0a 09 09 09 74 79 70 65 3a 20  : url,....type: 
3f8c0 6d 65 74 68 6f 64 2c 0a 09 09 09 64 61 74 61 54  method,....dataT
3f8d0 79 70 65 3a 20 74 79 70 65 2c 0a 09 09 09 64 61  ype: type,....da
3f8e0 74 61 3a 20 64 61 74 61 2c 0a 09 09 09 73 75 63  ta: data,....suc
3f8f0 63 65 73 73 3a 20 63 61 6c 6c 62 61 63 6b 0a 09  cess: callback..
3f900 09 7d 2c 20 6a 51 75 65 72 79 2e 69 73 50 6c 61  .}, jQuery.isPla
3f910 69 6e 4f 62 6a 65 63 74 28 20 75 72 6c 20 29 20  inObject( url ) 
3f920 26 26 20 75 72 6c 20 29 20 29 3b 0a 09 7d 3b 0a  && url ) );..};.
3f930 7d 20 29 3b 0a 0a 6a 51 75 65 72 79 2e 61 6a 61  } );..jQuery.aja
3f940 78 50 72 65 66 69 6c 74 65 72 28 20 66 75 6e 63  xPrefilter( func
3f950 74 69 6f 6e 28 20 73 20 29 20 7b 0a 09 76 61 72  tion( s ) {..var
3f960 20 69 3b 0a 09 66 6f 72 20 28 20 69 20 69 6e 20   i;..for ( i in 
3f970 73 2e 68 65 61 64 65 72 73 20 29 20 7b 0a 09 09  s.headers ) {...
3f980 69 66 20 28 20 69 2e 74 6f 4c 6f 77 65 72 43 61  if ( i.toLowerCa
3f990 73 65 28 29 20 3d 3d 3d 20 22 63 6f 6e 74 65 6e  se() === "conten
3f9a0 74 2d 74 79 70 65 22 20 29 20 7b 0a 09 09 09 73  t-type" ) {....s
3f9b0 2e 63 6f 6e 74 65 6e 74 54 79 70 65 20 3d 20 73  .contentType = s
3f9c0 2e 68 65 61 64 65 72 73 5b 20 69 20 5d 20 7c 7c  .headers[ i ] ||
3f9d0 20 22 22 3b 0a 09 09 7d 0a 09 7d 0a 7d 20 29 3b   "";...}..}.} );
3f9e0 0a 0a 0a 6a 51 75 65 72 79 2e 5f 65 76 61 6c 55  ...jQuery._evalU
3f9f0 72 6c 20 3d 20 66 75 6e 63 74 69 6f 6e 28 20 75  rl = function( u
3fa00 72 6c 2c 20 6f 70 74 69 6f 6e 73 2c 20 64 6f 63  rl, options, doc
3fa10 20 29 20 7b 0a 09 72 65 74 75 72 6e 20 6a 51 75   ) {..return jQu
3fa20 65 72 79 2e 61 6a 61 78 28 20 7b 0a 09 09 75 72  ery.ajax( {...ur
3fa30 6c 3a 20 75 72 6c 2c 0a 0a 09 09 2f 2f 20 4d 61  l: url,....// Ma
3fa40 6b 65 20 74 68 69 73 20 65 78 70 6c 69 63 69 74  ke this explicit
3fa50 2c 20 73 69 6e 63 65 20 75 73 65 72 20 63 61 6e  , since user can
3fa60 20 6f 76 65 72 72 69 64 65 20 74 68 69 73 20 74   override this t
3fa70 68 72 6f 75 67 68 20 61 6a 61 78 53 65 74 75 70  hrough ajaxSetup
3fa80 20 28 23 31 31 32 36 34 29 0a 09 09 74 79 70 65   (#11264)...type
3fa90 3a 20 22 47 45 54 22 2c 0a 09 09 64 61 74 61 54  : "GET",...dataT
3faa0 79 70 65 3a 20 22 73 63 72 69 70 74 22 2c 0a 09  ype: "script",..
3fab0 09 63 61 63 68 65 3a 20 74 72 75 65 2c 0a 09 09  .cache: true,...
3fac0 61 73 79 6e 63 3a 20 66 61 6c 73 65 2c 0a 09 09  async: false,...
3fad0 67 6c 6f 62 61 6c 3a 20 66 61 6c 73 65 2c 0a 0a  global: false,..
3fae0 09 09 2f 2f 20 4f 6e 6c 79 20 65 76 61 6c 75 61  ..// Only evalua
3faf0 74 65 20 74 68 65 20 72 65 73 70 6f 6e 73 65 20  te the response 
3fb00 69 66 20 69 74 20 69 73 20 73 75 63 63 65 73 73  if it is success
3fb10 66 75 6c 20 28 67 68 2d 34 31 32 36 29 0a 09 09  ful (gh-4126)...
3fb20 2f 2f 20 64 61 74 61 46 69 6c 74 65 72 20 69 73  // dataFilter is
3fb30 20 6e 6f 74 20 69 6e 76 6f 6b 65 64 20 66 6f 72   not invoked for
3fb40 20 66 61 69 6c 75 72 65 20 72 65 73 70 6f 6e 73   failure respons
3fb50 65 73 2c 20 73 6f 20 75 73 69 6e 67 20 69 74 20  es, so using it 
3fb60 69 6e 73 74 65 61 64 0a 09 09 2f 2f 20 6f 66 20  instead...// of 
3fb70 74 68 65 20 64 65 66 61 75 6c 74 20 63 6f 6e 76  the default conv
3fb80 65 72 74 65 72 20 69 73 20 6b 6c 75 64 67 79 20  erter is kludgy 
3fb90 62 75 74 20 69 74 20 77 6f 72 6b 73 2e 0a 09 09  but it works....
3fba0 63 6f 6e 76 65 72 74 65 72 73 3a 20 7b 0a 09 09  converters: {...
3fbb0 09 22 74 65 78 74 20 73 63 72 69 70 74 22 3a 20  ."text script": 
3fbc0 66 75 6e 63 74 69 6f 6e 28 29 20 7b 7d 0a 09 09  function() {}...
3fbd0 7d 2c 0a 09 09 64 61 74 61 46 69 6c 74 65 72 3a  },...dataFilter:
3fbe0 20 66 75 6e 63 74 69 6f 6e 28 20 72 65 73 70 6f   function( respo
3fbf0 6e 73 65 20 29 20 7b 0a 09 09 09 6a 51 75 65 72  nse ) {....jQuer
3fc00 79 2e 67 6c 6f 62 61 6c 45 76 61 6c 28 20 72 65  y.globalEval( re
3fc10 73 70 6f 6e 73 65 2c 20 6f 70 74 69 6f 6e 73 2c  sponse, options,
3fc20 20 64 6f 63 20 29 3b 0a 09 09 7d 0a 09 7d 20 29   doc );...}..} )
3fc30 3b 0a 7d 3b 0a 0a 0a 6a 51 75 65 72 79 2e 66 6e  ;.};...jQuery.fn
3fc40 2e 65 78 74 65 6e 64 28 20 7b 0a 09 77 72 61 70  .extend( {..wrap
3fc50 41 6c 6c 3a 20 66 75 6e 63 74 69 6f 6e 28 20 68  All: function( h
3fc60 74 6d 6c 20 29 20 7b 0a 09 09 76 61 72 20 77 72  tml ) {...var wr
3fc70 61 70 3b 0a 0a 09 09 69 66 20 28 20 74 68 69 73  ap;....if ( this
3fc80 5b 20 30 20 5d 20 29 20 7b 0a 09 09 09 69 66 20  [ 0 ] ) {....if 
3fc90 28 20 69 73 46 75 6e 63 74 69 6f 6e 28 20 68 74  ( isFunction( ht
3fca0 6d 6c 20 29 20 29 20 7b 0a 09 09 09 09 68 74 6d  ml ) ) {.....htm
3fcb0 6c 20 3d 20 68 74 6d 6c 2e 63 61 6c 6c 28 20 74  l = html.call( t
3fcc0 68 69 73 5b 20 30 20 5d 20 29 3b 0a 09 09 09 7d  his[ 0 ] );....}
3fcd0 0a 0a 09 09 09 2f 2f 20 54 68 65 20 65 6c 65 6d  .....// The elem
3fce0 65 6e 74 73 20 74 6f 20 77 72 61 70 20 74 68 65  ents to wrap the
3fcf0 20 74 61 72 67 65 74 20 61 72 6f 75 6e 64 0a 09   target around..
3fd00 09 09 77 72 61 70 20 3d 20 6a 51 75 65 72 79 28  ..wrap = jQuery(
3fd10 20 68 74 6d 6c 2c 20 74 68 69 73 5b 20 30 20 5d   html, this[ 0 ]
3fd20 2e 6f 77 6e 65 72 44 6f 63 75 6d 65 6e 74 20 29  .ownerDocument )
3fd30 2e 65 71 28 20 30 20 29 2e 63 6c 6f 6e 65 28 20  .eq( 0 ).clone( 
3fd40 74 72 75 65 20 29 3b 0a 0a 09 09 09 69 66 20 28  true );.....if (
3fd50 20 74 68 69 73 5b 20 30 20 5d 2e 70 61 72 65 6e   this[ 0 ].paren
3fd60 74 4e 6f 64 65 20 29 20 7b 0a 09 09 09 09 77 72  tNode ) {.....wr
3fd70 61 70 2e 69 6e 73 65 72 74 42 65 66 6f 72 65 28  ap.insertBefore(
3fd80 20 74 68 69 73 5b 20 30 20 5d 20 29 3b 0a 09 09   this[ 0 ] );...
3fd90 09 7d 0a 0a 09 09 09 77 72 61 70 2e 6d 61 70 28  .}.....wrap.map(
3fda0 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09 09   function() {...
3fdb0 09 09 76 61 72 20 65 6c 65 6d 20 3d 20 74 68 69  ..var elem = thi
3fdc0 73 3b 0a 0a 09 09 09 09 77 68 69 6c 65 20 28 20  s;......while ( 
3fdd0 65 6c 65 6d 2e 66 69 72 73 74 45 6c 65 6d 65 6e  elem.firstElemen
3fde0 74 43 68 69 6c 64 20 29 20 7b 0a 09 09 09 09 09  tChild ) {......
3fdf0 65 6c 65 6d 20 3d 20 65 6c 65 6d 2e 66 69 72 73  elem = elem.firs
3fe00 74 45 6c 65 6d 65 6e 74 43 68 69 6c 64 3b 0a 09  tElementChild;..
3fe10 09 09 09 7d 0a 0a 09 09 09 09 72 65 74 75 72 6e  ...}......return
3fe20 20 65 6c 65 6d 3b 0a 09 09 09 7d 20 29 2e 61 70   elem;....} ).ap
3fe30 70 65 6e 64 28 20 74 68 69 73 20 29 3b 0a 09 09  pend( this );...
3fe40 7d 0a 0a 09 09 72 65 74 75 72 6e 20 74 68 69 73  }....return this
3fe50 3b 0a 09 7d 2c 0a 0a 09 77 72 61 70 49 6e 6e 65  ;..},...wrapInne
3fe60 72 3a 20 66 75 6e 63 74 69 6f 6e 28 20 68 74 6d  r: function( htm
3fe70 6c 20 29 20 7b 0a 09 09 69 66 20 28 20 69 73 46  l ) {...if ( isF
3fe80 75 6e 63 74 69 6f 6e 28 20 68 74 6d 6c 20 29 20  unction( html ) 
3fe90 29 20 7b 0a 09 09 09 72 65 74 75 72 6e 20 74 68  ) {....return th
3fea0 69 73 2e 65 61 63 68 28 20 66 75 6e 63 74 69 6f  is.each( functio
3feb0 6e 28 20 69 20 29 20 7b 0a 09 09 09 09 6a 51 75  n( i ) {.....jQu
3fec0 65 72 79 28 20 74 68 69 73 20 29 2e 77 72 61 70  ery( this ).wrap
3fed0 49 6e 6e 65 72 28 20 68 74 6d 6c 2e 63 61 6c 6c  Inner( html.call
3fee0 28 20 74 68 69 73 2c 20 69 20 29 20 29 3b 0a 09  ( this, i ) );..
3fef0 09 09 7d 20 29 3b 0a 09 09 7d 0a 0a 09 09 72 65  ..} );...}....re
3ff00 74 75 72 6e 20 74 68 69 73 2e 65 61 63 68 28 20  turn this.each( 
3ff10 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09 09 09  function() {....
3ff20 76 61 72 20 73 65 6c 66 20 3d 20 6a 51 75 65 72  var self = jQuer
3ff30 79 28 20 74 68 69 73 20 29 2c 0a 09 09 09 09 63  y( this ),.....c
3ff40 6f 6e 74 65 6e 74 73 20 3d 20 73 65 6c 66 2e 63  ontents = self.c
3ff50 6f 6e 74 65 6e 74 73 28 29 3b 0a 0a 09 09 09 69  ontents();.....i
3ff60 66 20 28 20 63 6f 6e 74 65 6e 74 73 2e 6c 65 6e  f ( contents.len
3ff70 67 74 68 20 29 20 7b 0a 09 09 09 09 63 6f 6e 74  gth ) {.....cont
3ff80 65 6e 74 73 2e 77 72 61 70 41 6c 6c 28 20 68 74  ents.wrapAll( ht
3ff90 6d 6c 20 29 3b 0a 0a 09 09 09 7d 20 65 6c 73 65  ml );.....} else
3ffa0 20 7b 0a 09 09 09 09 73 65 6c 66 2e 61 70 70 65   {.....self.appe
3ffb0 6e 64 28 20 68 74 6d 6c 20 29 3b 0a 09 09 09 7d  nd( html );....}
3ffc0 0a 09 09 7d 20 29 3b 0a 09 7d 2c 0a 0a 09 77 72  ...} );..},...wr
3ffd0 61 70 3a 20 66 75 6e 63 74 69 6f 6e 28 20 68 74  ap: function( ht
3ffe0 6d 6c 20 29 20 7b 0a 09 09 76 61 72 20 68 74 6d  ml ) {...var htm
3fff0 6c 49 73 46 75 6e 63 74 69 6f 6e 20 3d 20 69 73  lIsFunction = is
40000 46 75 6e 63 74 69 6f 6e 28 20 68 74 6d 6c 20 29  Function( html )
40010 3b 0a 0a 09 09 72 65 74 75 72 6e 20 74 68 69 73  ;....return this
40020 2e 65 61 63 68 28 20 66 75 6e 63 74 69 6f 6e 28  .each( function(
40030 20 69 20 29 20 7b 0a 09 09 09 6a 51 75 65 72 79   i ) {....jQuery
40040 28 20 74 68 69 73 20 29 2e 77 72 61 70 41 6c 6c  ( this ).wrapAll
40050 28 20 68 74 6d 6c 49 73 46 75 6e 63 74 69 6f 6e  ( htmlIsFunction
40060 20 3f 20 68 74 6d 6c 2e 63 61 6c 6c 28 20 74 68   ? html.call( th
40070 69 73 2c 20 69 20 29 20 3a 20 68 74 6d 6c 20 29  is, i ) : html )
40080 3b 0a 09 09 7d 20 29 3b 0a 09 7d 2c 0a 0a 09 75  ;...} );..},...u
40090 6e 77 72 61 70 3a 20 66 75 6e 63 74 69 6f 6e 28  nwrap: function(
400a0 20 73 65 6c 65 63 74 6f 72 20 29 20 7b 0a 09 09   selector ) {...
400b0 74 68 69 73 2e 70 61 72 65 6e 74 28 20 73 65 6c  this.parent( sel
400c0 65 63 74 6f 72 20 29 2e 6e 6f 74 28 20 22 62 6f  ector ).not( "bo
400d0 64 79 22 20 29 2e 65 61 63 68 28 20 66 75 6e 63  dy" ).each( func
400e0 74 69 6f 6e 28 29 20 7b 0a 09 09 09 6a 51 75 65  tion() {....jQue
400f0 72 79 28 20 74 68 69 73 20 29 2e 72 65 70 6c 61  ry( this ).repla
40100 63 65 57 69 74 68 28 20 74 68 69 73 2e 63 68 69  ceWith( this.chi
40110 6c 64 4e 6f 64 65 73 20 29 3b 0a 09 09 7d 20 29  ldNodes );...} )
40120 3b 0a 09 09 72 65 74 75 72 6e 20 74 68 69 73 3b  ;...return this;
40130 0a 09 7d 0a 7d 20 29 3b 0a 0a 0a 6a 51 75 65 72  ..}.} );...jQuer
40140 79 2e 65 78 70 72 2e 70 73 65 75 64 6f 73 2e 68  y.expr.pseudos.h
40150 69 64 64 65 6e 20 3d 20 66 75 6e 63 74 69 6f 6e  idden = function
40160 28 20 65 6c 65 6d 20 29 20 7b 0a 09 72 65 74 75  ( elem ) {..retu
40170 72 6e 20 21 6a 51 75 65 72 79 2e 65 78 70 72 2e  rn !jQuery.expr.
40180 70 73 65 75 64 6f 73 2e 76 69 73 69 62 6c 65 28  pseudos.visible(
40190 20 65 6c 65 6d 20 29 3b 0a 7d 3b 0a 6a 51 75 65   elem );.};.jQue
401a0 72 79 2e 65 78 70 72 2e 70 73 65 75 64 6f 73 2e  ry.expr.pseudos.
401b0 76 69 73 69 62 6c 65 20 3d 20 66 75 6e 63 74 69  visible = functi
401c0 6f 6e 28 20 65 6c 65 6d 20 29 20 7b 0a 09 72 65  on( elem ) {..re
401d0 74 75 72 6e 20 21 21 28 20 65 6c 65 6d 2e 6f 66  turn !!( elem.of
401e0 66 73 65 74 57 69 64 74 68 20 7c 7c 20 65 6c 65  fsetWidth || ele
401f0 6d 2e 6f 66 66 73 65 74 48 65 69 67 68 74 20 7c  m.offsetHeight |
40200 7c 20 65 6c 65 6d 2e 67 65 74 43 6c 69 65 6e 74  | elem.getClient
40210 52 65 63 74 73 28 29 2e 6c 65 6e 67 74 68 20 29  Rects().length )
40220 3b 0a 7d 3b 0a 0a 0a 0a 0a 6a 51 75 65 72 79 2e  ;.};.....jQuery.
40230 61 6a 61 78 53 65 74 74 69 6e 67 73 2e 78 68 72  ajaxSettings.xhr
40240 20 3d 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a   = function() {.
40250 09 74 72 79 20 7b 0a 09 09 72 65 74 75 72 6e 20  .try {...return 
40260 6e 65 77 20 77 69 6e 64 6f 77 2e 58 4d 4c 48 74  new window.XMLHt
40270 74 70 52 65 71 75 65 73 74 28 29 3b 0a 09 7d 20  tpRequest();..} 
40280 63 61 74 63 68 20 28 20 65 20 29 20 7b 7d 0a 7d  catch ( e ) {}.}
40290 3b 0a 0a 76 61 72 20 78 68 72 53 75 63 63 65 73  ;..var xhrSucces
402a0 73 53 74 61 74 75 73 20 3d 20 7b 0a 0a 09 09 2f  sStatus = {..../
402b0 2f 20 46 69 6c 65 20 70 72 6f 74 6f 63 6f 6c 20  / File protocol 
402c0 61 6c 77 61 79 73 20 79 69 65 6c 64 73 20 73 74  always yields st
402d0 61 74 75 73 20 63 6f 64 65 20 30 2c 20 61 73 73  atus code 0, ass
402e0 75 6d 65 20 32 30 30 0a 09 09 30 3a 20 32 30 30  ume 200...0: 200
402f0 2c 0a 0a 09 09 2f 2f 20 53 75 70 70 6f 72 74 3a  ,....// Support:
40300 20 49 45 20 3c 3d 39 20 6f 6e 6c 79 0a 09 09 2f   IE <=9 only.../
40310 2f 20 23 31 34 35 30 3a 20 73 6f 6d 65 74 69 6d  / #1450: sometim
40320 65 73 20 49 45 20 72 65 74 75 72 6e 73 20 31 32  es IE returns 12
40330 32 33 20 77 68 65 6e 20 69 74 20 73 68 6f 75 6c  23 when it shoul
40340 64 20 62 65 20 32 30 34 0a 09 09 31 32 32 33 3a  d be 204...1223:
40350 20 32 30 34 0a 09 7d 2c 0a 09 78 68 72 53 75 70   204..},..xhrSup
40360 70 6f 72 74 65 64 20 3d 20 6a 51 75 65 72 79 2e  ported = jQuery.
40370 61 6a 61 78 53 65 74 74 69 6e 67 73 2e 78 68 72  ajaxSettings.xhr
40380 28 29 3b 0a 0a 73 75 70 70 6f 72 74 2e 63 6f 72  ();..support.cor
40390 73 20 3d 20 21 21 78 68 72 53 75 70 70 6f 72 74  s = !!xhrSupport
403a0 65 64 20 26 26 20 28 20 22 77 69 74 68 43 72 65  ed && ( "withCre
403b0 64 65 6e 74 69 61 6c 73 22 20 69 6e 20 78 68 72  dentials" in xhr
403c0 53 75 70 70 6f 72 74 65 64 20 29 3b 0a 73 75 70  Supported );.sup
403d0 70 6f 72 74 2e 61 6a 61 78 20 3d 20 78 68 72 53  port.ajax = xhrS
403e0 75 70 70 6f 72 74 65 64 20 3d 20 21 21 78 68 72  upported = !!xhr
403f0 53 75 70 70 6f 72 74 65 64 3b 0a 0a 6a 51 75 65  Supported;..jQue
40400 72 79 2e 61 6a 61 78 54 72 61 6e 73 70 6f 72 74  ry.ajaxTransport
40410 28 20 66 75 6e 63 74 69 6f 6e 28 20 6f 70 74 69  ( function( opti
40420 6f 6e 73 20 29 20 7b 0a 09 76 61 72 20 63 61 6c  ons ) {..var cal
40430 6c 62 61 63 6b 2c 20 65 72 72 6f 72 43 61 6c 6c  lback, errorCall
40440 62 61 63 6b 3b 0a 0a 09 2f 2f 20 43 72 6f 73 73  back;...// Cross
40450 20 64 6f 6d 61 69 6e 20 6f 6e 6c 79 20 61 6c 6c   domain only all
40460 6f 77 65 64 20 69 66 20 73 75 70 70 6f 72 74 65  owed if supporte
40470 64 20 74 68 72 6f 75 67 68 20 58 4d 4c 48 74 74  d through XMLHtt
40480 70 52 65 71 75 65 73 74 0a 09 69 66 20 28 20 73  pRequest..if ( s
40490 75 70 70 6f 72 74 2e 63 6f 72 73 20 7c 7c 20 78  upport.cors || x
404a0 68 72 53 75 70 70 6f 72 74 65 64 20 26 26 20 21  hrSupported && !
404b0 6f 70 74 69 6f 6e 73 2e 63 72 6f 73 73 44 6f 6d  options.crossDom
404c0 61 69 6e 20 29 20 7b 0a 09 09 72 65 74 75 72 6e  ain ) {...return
404d0 20 7b 0a 09 09 09 73 65 6e 64 3a 20 66 75 6e 63   {....send: func
404e0 74 69 6f 6e 28 20 68 65 61 64 65 72 73 2c 20 63  tion( headers, c
404f0 6f 6d 70 6c 65 74 65 20 29 20 7b 0a 09 09 09 09  omplete ) {.....
40500 76 61 72 20 69 2c 0a 09 09 09 09 09 78 68 72 20  var i,......xhr 
40510 3d 20 6f 70 74 69 6f 6e 73 2e 78 68 72 28 29 3b  = options.xhr();
40520 0a 0a 09 09 09 09 78 68 72 2e 6f 70 65 6e 28 0a  ......xhr.open(.
40530 09 09 09 09 09 6f 70 74 69 6f 6e 73 2e 74 79 70  .....options.typ
40540 65 2c 0a 09 09 09 09 09 6f 70 74 69 6f 6e 73 2e  e,......options.
40550 75 72 6c 2c 0a 09 09 09 09 09 6f 70 74 69 6f 6e  url,......option
40560 73 2e 61 73 79 6e 63 2c 0a 09 09 09 09 09 6f 70  s.async,......op
40570 74 69 6f 6e 73 2e 75 73 65 72 6e 61 6d 65 2c 0a  tions.username,.
40580 09 09 09 09 09 6f 70 74 69 6f 6e 73 2e 70 61 73  .....options.pas
40590 73 77 6f 72 64 0a 09 09 09 09 29 3b 0a 0a 09 09  sword.....);....
405a0 09 09 2f 2f 20 41 70 70 6c 79 20 63 75 73 74 6f  ..// Apply custo
405b0 6d 20 66 69 65 6c 64 73 20 69 66 20 70 72 6f 76  m fields if prov
405c0 69 64 65 64 0a 09 09 09 09 69 66 20 28 20 6f 70  ided.....if ( op
405d0 74 69 6f 6e 73 2e 78 68 72 46 69 65 6c 64 73 20  tions.xhrFields 
405e0 29 20 7b 0a 09 09 09 09 09 66 6f 72 20 28 20 69  ) {......for ( i
405f0 20 69 6e 20 6f 70 74 69 6f 6e 73 2e 78 68 72 46   in options.xhrF
40600 69 65 6c 64 73 20 29 20 7b 0a 09 09 09 09 09 09  ields ) {.......
40610 78 68 72 5b 20 69 20 5d 20 3d 20 6f 70 74 69 6f  xhr[ i ] = optio
40620 6e 73 2e 78 68 72 46 69 65 6c 64 73 5b 20 69 20  ns.xhrFields[ i 
40630 5d 3b 0a 09 09 09 09 09 7d 0a 09 09 09 09 7d 0a  ];......}.....}.
40640 0a 09 09 09 09 2f 2f 20 4f 76 65 72 72 69 64 65  .....// Override
40650 20 6d 69 6d 65 20 74 79 70 65 20 69 66 20 6e 65   mime type if ne
40660 65 64 65 64 0a 09 09 09 09 69 66 20 28 20 6f 70  eded.....if ( op
40670 74 69 6f 6e 73 2e 6d 69 6d 65 54 79 70 65 20 26  tions.mimeType &
40680 26 20 78 68 72 2e 6f 76 65 72 72 69 64 65 4d 69  & xhr.overrideMi
40690 6d 65 54 79 70 65 20 29 20 7b 0a 09 09 09 09 09  meType ) {......
406a0 78 68 72 2e 6f 76 65 72 72 69 64 65 4d 69 6d 65  xhr.overrideMime
406b0 54 79 70 65 28 20 6f 70 74 69 6f 6e 73 2e 6d 69  Type( options.mi
406c0 6d 65 54 79 70 65 20 29 3b 0a 09 09 09 09 7d 0a  meType );.....}.
406d0 0a 09 09 09 09 2f 2f 20 58 2d 52 65 71 75 65 73  .....// X-Reques
406e0 74 65 64 2d 57 69 74 68 20 68 65 61 64 65 72 0a  ted-With header.
406f0 09 09 09 09 2f 2f 20 46 6f 72 20 63 72 6f 73 73  ....// For cross
40700 2d 64 6f 6d 61 69 6e 20 72 65 71 75 65 73 74 73  -domain requests
40710 2c 20 73 65 65 69 6e 67 20 61 73 20 63 6f 6e 64  , seeing as cond
40720 69 74 69 6f 6e 73 20 66 6f 72 20 61 20 70 72 65  itions for a pre
40730 66 6c 69 67 68 74 20 61 72 65 0a 09 09 09 09 2f  flight are...../
40740 2f 20 61 6b 69 6e 20 74 6f 20 61 20 6a 69 67 73  / akin to a jigs
40750 61 77 20 70 75 7a 7a 6c 65 2c 20 77 65 20 73 69  aw puzzle, we si
40760 6d 70 6c 79 20 6e 65 76 65 72 20 73 65 74 20 69  mply never set i
40770 74 20 74 6f 20 62 65 20 73 75 72 65 2e 0a 09 09  t to be sure....
40780 09 09 2f 2f 20 28 69 74 20 63 61 6e 20 61 6c 77  ..// (it can alw
40790 61 79 73 20 62 65 20 73 65 74 20 6f 6e 20 61 20  ays be set on a 
407a0 70 65 72 2d 72 65 71 75 65 73 74 20 62 61 73 69  per-request basi
407b0 73 20 6f 72 20 65 76 65 6e 20 75 73 69 6e 67 20  s or even using 
407c0 61 6a 61 78 53 65 74 75 70 29 0a 09 09 09 09 2f  ajaxSetup)...../
407d0 2f 20 46 6f 72 20 73 61 6d 65 2d 64 6f 6d 61 69  / For same-domai
407e0 6e 20 72 65 71 75 65 73 74 73 2c 20 77 6f 6e 27  n requests, won'
407f0 74 20 63 68 61 6e 67 65 20 68 65 61 64 65 72 20  t change header 
40800 69 66 20 61 6c 72 65 61 64 79 20 70 72 6f 76 69  if already provi
40810 64 65 64 2e 0a 09 09 09 09 69 66 20 28 20 21 6f  ded......if ( !o
40820 70 74 69 6f 6e 73 2e 63 72 6f 73 73 44 6f 6d 61  ptions.crossDoma
40830 69 6e 20 26 26 20 21 68 65 61 64 65 72 73 5b 20  in && !headers[ 
40840 22 58 2d 52 65 71 75 65 73 74 65 64 2d 57 69 74  "X-Requested-Wit
40850 68 22 20 5d 20 29 20 7b 0a 09 09 09 09 09 68 65  h" ] ) {......he
40860 61 64 65 72 73 5b 20 22 58 2d 52 65 71 75 65 73  aders[ "X-Reques
40870 74 65 64 2d 57 69 74 68 22 20 5d 20 3d 20 22 58  ted-With" ] = "X
40880 4d 4c 48 74 74 70 52 65 71 75 65 73 74 22 3b 0a  MLHttpRequest";.
40890 09 09 09 09 7d 0a 0a 09 09 09 09 2f 2f 20 53 65  ....}......// Se
408a0 74 20 68 65 61 64 65 72 73 0a 09 09 09 09 66 6f  t headers.....fo
408b0 72 20 28 20 69 20 69 6e 20 68 65 61 64 65 72 73  r ( i in headers
408c0 20 29 20 7b 0a 09 09 09 09 09 78 68 72 2e 73 65   ) {......xhr.se
408d0 74 52 65 71 75 65 73 74 48 65 61 64 65 72 28 20  tRequestHeader( 
408e0 69 2c 20 68 65 61 64 65 72 73 5b 20 69 20 5d 20  i, headers[ i ] 
408f0 29 3b 0a 09 09 09 09 7d 0a 0a 09 09 09 09 2f 2f  );.....}......//
40900 20 43 61 6c 6c 62 61 63 6b 0a 09 09 09 09 63 61   Callback.....ca
40910 6c 6c 62 61 63 6b 20 3d 20 66 75 6e 63 74 69 6f  llback = functio
40920 6e 28 20 74 79 70 65 20 29 20 7b 0a 09 09 09 09  n( type ) {.....
40930 09 72 65 74 75 72 6e 20 66 75 6e 63 74 69 6f 6e  .return function
40940 28 29 20 7b 0a 09 09 09 09 09 09 69 66 20 28 20  () {.......if ( 
40950 63 61 6c 6c 62 61 63 6b 20 29 20 7b 0a 09 09 09  callback ) {....
40960 09 09 09 09 63 61 6c 6c 62 61 63 6b 20 3d 20 65  ....callback = e
40970 72 72 6f 72 43 61 6c 6c 62 61 63 6b 20 3d 20 78  rrorCallback = x
40980 68 72 2e 6f 6e 6c 6f 61 64 20 3d 0a 09 09 09 09  hr.onload =.....
40990 09 09 09 09 78 68 72 2e 6f 6e 65 72 72 6f 72 20  ....xhr.onerror 
409a0 3d 20 78 68 72 2e 6f 6e 61 62 6f 72 74 20 3d 20  = xhr.onabort = 
409b0 78 68 72 2e 6f 6e 74 69 6d 65 6f 75 74 20 3d 0a  xhr.ontimeout =.
409c0 09 09 09 09 09 09 09 09 09 78 68 72 2e 6f 6e 72  .........xhr.onr
409d0 65 61 64 79 73 74 61 74 65 63 68 61 6e 67 65 20  eadystatechange 
409e0 3d 20 6e 75 6c 6c 3b 0a 0a 09 09 09 09 09 09 09  = null;.........
409f0 69 66 20 28 20 74 79 70 65 20 3d 3d 3d 20 22 61  if ( type === "a
40a00 62 6f 72 74 22 20 29 20 7b 0a 09 09 09 09 09 09  bort" ) {.......
40a10 09 09 78 68 72 2e 61 62 6f 72 74 28 29 3b 0a 09  ..xhr.abort();..
40a20 09 09 09 09 09 09 7d 20 65 6c 73 65 20 69 66 20  ......} else if 
40a30 28 20 74 79 70 65 20 3d 3d 3d 20 22 65 72 72 6f  ( type === "erro
40a40 72 22 20 29 20 7b 0a 0a 09 09 09 09 09 09 09 09  r" ) {..........
40a50 2f 2f 20 53 75 70 70 6f 72 74 3a 20 49 45 20 3c  // Support: IE <
40a60 3d 39 20 6f 6e 6c 79 0a 09 09 09 09 09 09 09 09  =9 only.........
40a70 2f 2f 20 4f 6e 20 61 20 6d 61 6e 75 61 6c 20 6e  // On a manual n
40a80 61 74 69 76 65 20 61 62 6f 72 74 2c 20 49 45 39  ative abort, IE9
40a90 20 74 68 72 6f 77 73 0a 09 09 09 09 09 09 09 09   throws.........
40aa0 2f 2f 20 65 72 72 6f 72 73 20 6f 6e 20 61 6e 79  // errors on any
40ab0 20 70 72 6f 70 65 72 74 79 20 61 63 63 65 73 73   property access
40ac0 20 74 68 61 74 20 69 73 20 6e 6f 74 20 72 65 61   that is not rea
40ad0 64 79 53 74 61 74 65 0a 09 09 09 09 09 09 09 09  dyState.........
40ae0 69 66 20 28 20 74 79 70 65 6f 66 20 78 68 72 2e  if ( typeof xhr.
40af0 73 74 61 74 75 73 20 21 3d 3d 20 22 6e 75 6d 62  status !== "numb
40b00 65 72 22 20 29 20 7b 0a 09 09 09 09 09 09 09 09  er" ) {.........
40b10 09 63 6f 6d 70 6c 65 74 65 28 20 30 2c 20 22 65  .complete( 0, "e
40b20 72 72 6f 72 22 20 29 3b 0a 09 09 09 09 09 09 09  rror" );........
40b30 09 7d 20 65 6c 73 65 20 7b 0a 09 09 09 09 09 09  .} else {.......
40b40 09 09 09 63 6f 6d 70 6c 65 74 65 28 0a 0a 09 09  ...complete(....
40b50 09 09 09 09 09 09 09 09 2f 2f 20 46 69 6c 65 3a  ........// File:
40b60 20 70 72 6f 74 6f 63 6f 6c 20 61 6c 77 61 79 73   protocol always
40b70 20 79 69 65 6c 64 73 20 73 74 61 74 75 73 20 30   yields status 0
40b80 3b 20 73 65 65 20 23 38 36 30 35 2c 20 23 31 34  ; see #8605, #14
40b90 32 30 37 0a 09 09 09 09 09 09 09 09 09 09 78 68  207...........xh
40ba0 72 2e 73 74 61 74 75 73 2c 0a 09 09 09 09 09 09  r.status,.......
40bb0 09 09 09 09 78 68 72 2e 73 74 61 74 75 73 54 65  ....xhr.statusTe
40bc0 78 74 0a 09 09 09 09 09 09 09 09 09 29 3b 0a 09  xt..........);..
40bd0 09 09 09 09 09 09 09 7d 0a 09 09 09 09 09 09 09  .......}........
40be0 7d 20 65 6c 73 65 20 7b 0a 09 09 09 09 09 09 09  } else {........
40bf0 09 63 6f 6d 70 6c 65 74 65 28 0a 09 09 09 09 09  .complete(......
40c00 09 09 09 09 78 68 72 53 75 63 63 65 73 73 53 74  ....xhrSuccessSt
40c10 61 74 75 73 5b 20 78 68 72 2e 73 74 61 74 75 73  atus[ xhr.status
40c20 20 5d 20 7c 7c 20 78 68 72 2e 73 74 61 74 75 73   ] || xhr.status
40c30 2c 0a 09 09 09 09 09 09 09 09 09 78 68 72 2e 73  ,..........xhr.s
40c40 74 61 74 75 73 54 65 78 74 2c 0a 0a 09 09 09 09  tatusText,......
40c50 09 09 09 09 09 2f 2f 20 53 75 70 70 6f 72 74 3a  .....// Support:
40c60 20 49 45 20 3c 3d 39 20 6f 6e 6c 79 0a 09 09 09   IE <=9 only....
40c70 09 09 09 09 09 09 2f 2f 20 49 45 39 20 68 61 73  ......// IE9 has
40c80 20 6e 6f 20 58 48 52 32 20 62 75 74 20 74 68 72   no XHR2 but thr
40c90 6f 77 73 20 6f 6e 20 62 69 6e 61 72 79 20 28 74  ows on binary (t
40ca0 72 61 63 2d 31 31 34 32 36 29 0a 09 09 09 09 09  rac-11426)......
40cb0 09 09 09 09 2f 2f 20 46 6f 72 20 58 48 52 32 20  ....// For XHR2 
40cc0 6e 6f 6e 2d 74 65 78 74 2c 20 6c 65 74 20 74 68  non-text, let th
40cd0 65 20 63 61 6c 6c 65 72 20 68 61 6e 64 6c 65 20  e caller handle 
40ce0 69 74 20 28 67 68 2d 32 34 39 38 29 0a 09 09 09  it (gh-2498)....
40cf0 09 09 09 09 09 09 28 20 78 68 72 2e 72 65 73 70  ......( xhr.resp
40d00 6f 6e 73 65 54 79 70 65 20 7c 7c 20 22 74 65 78  onseType || "tex
40d10 74 22 20 29 20 21 3d 3d 20 22 74 65 78 74 22 20  t" ) !== "text" 
40d20 20 7c 7c 0a 09 09 09 09 09 09 09 09 09 74 79 70   ||..........typ
40d30 65 6f 66 20 78 68 72 2e 72 65 73 70 6f 6e 73 65  eof xhr.response
40d40 54 65 78 74 20 21 3d 3d 20 22 73 74 72 69 6e 67  Text !== "string
40d50 22 20 3f 0a 09 09 09 09 09 09 09 09 09 09 7b 20  " ?...........{ 
40d60 62 69 6e 61 72 79 3a 20 78 68 72 2e 72 65 73 70  binary: xhr.resp
40d70 6f 6e 73 65 20 7d 20 3a 0a 09 09 09 09 09 09 09  onse } :........
40d80 09 09 09 7b 20 74 65 78 74 3a 20 78 68 72 2e 72  ...{ text: xhr.r
40d90 65 73 70 6f 6e 73 65 54 65 78 74 20 7d 2c 0a 09  esponseText },..
40da0 09 09 09 09 09 09 09 09 78 68 72 2e 67 65 74 41  ........xhr.getA
40db0 6c 6c 52 65 73 70 6f 6e 73 65 48 65 61 64 65 72  llResponseHeader
40dc0 73 28 29 0a 09 09 09 09 09 09 09 09 29 3b 0a 09  s().........);..
40dd0 09 09 09 09 09 09 7d 0a 09 09 09 09 09 09 7d 0a  ......}.......}.
40de0 09 09 09 09 09 7d 3b 0a 09 09 09 09 7d 3b 0a 0a  .....};.....};..
40df0 09 09 09 09 2f 2f 20 4c 69 73 74 65 6e 20 74 6f  ....// Listen to
40e00 20 65 76 65 6e 74 73 0a 09 09 09 09 78 68 72 2e   events.....xhr.
40e10 6f 6e 6c 6f 61 64 20 3d 20 63 61 6c 6c 62 61 63  onload = callbac
40e20 6b 28 29 3b 0a 09 09 09 09 65 72 72 6f 72 43 61  k();.....errorCa
40e30 6c 6c 62 61 63 6b 20 3d 20 78 68 72 2e 6f 6e 65  llback = xhr.one
40e40 72 72 6f 72 20 3d 20 78 68 72 2e 6f 6e 74 69 6d  rror = xhr.ontim
40e50 65 6f 75 74 20 3d 20 63 61 6c 6c 62 61 63 6b 28  eout = callback(
40e60 20 22 65 72 72 6f 72 22 20 29 3b 0a 0a 09 09 09   "error" );.....
40e70 09 2f 2f 20 53 75 70 70 6f 72 74 3a 20 49 45 20  .// Support: IE 
40e80 39 20 6f 6e 6c 79 0a 09 09 09 09 2f 2f 20 55 73  9 only.....// Us
40e90 65 20 6f 6e 72 65 61 64 79 73 74 61 74 65 63 68  e onreadystatech
40ea0 61 6e 67 65 20 74 6f 20 72 65 70 6c 61 63 65 20  ange to replace 
40eb0 6f 6e 61 62 6f 72 74 0a 09 09 09 09 2f 2f 20 74  onabort.....// t
40ec0 6f 20 68 61 6e 64 6c 65 20 75 6e 63 61 75 67 68  o handle uncaugh
40ed0 74 20 61 62 6f 72 74 73 0a 09 09 09 09 69 66 20  t aborts.....if 
40ee0 28 20 78 68 72 2e 6f 6e 61 62 6f 72 74 20 21 3d  ( xhr.onabort !=
40ef0 3d 20 75 6e 64 65 66 69 6e 65 64 20 29 20 7b 0a  = undefined ) {.
40f00 09 09 09 09 09 78 68 72 2e 6f 6e 61 62 6f 72 74  .....xhr.onabort
40f10 20 3d 20 65 72 72 6f 72 43 61 6c 6c 62 61 63 6b   = errorCallback
40f20 3b 0a 09 09 09 09 7d 20 65 6c 73 65 20 7b 0a 09  ;.....} else {..
40f30 09 09 09 09 78 68 72 2e 6f 6e 72 65 61 64 79 73  ....xhr.onreadys
40f40 74 61 74 65 63 68 61 6e 67 65 20 3d 20 66 75 6e  tatechange = fun
40f50 63 74 69 6f 6e 28 29 20 7b 0a 0a 09 09 09 09 09  ction() {.......
40f60 09 2f 2f 20 43 68 65 63 6b 20 72 65 61 64 79 53  .// Check readyS
40f70 74 61 74 65 20 62 65 66 6f 72 65 20 74 69 6d 65  tate before time
40f80 6f 75 74 20 61 73 20 69 74 20 63 68 61 6e 67 65  out as it change
40f90 73 0a 09 09 09 09 09 09 69 66 20 28 20 78 68 72  s.......if ( xhr
40fa0 2e 72 65 61 64 79 53 74 61 74 65 20 3d 3d 3d 20  .readyState === 
40fb0 34 20 29 20 7b 0a 0a 09 09 09 09 09 09 09 2f 2f  4 ) {.........//
40fc0 20 41 6c 6c 6f 77 20 6f 6e 65 72 72 6f 72 20 74   Allow onerror t
40fd0 6f 20 62 65 20 63 61 6c 6c 65 64 20 66 69 72 73  o be called firs
40fe0 74 2c 0a 09 09 09 09 09 09 09 2f 2f 20 62 75 74  t,........// but
40ff0 20 74 68 61 74 20 77 69 6c 6c 20 6e 6f 74 20 68   that will not h
41000 61 6e 64 6c 65 20 61 20 6e 61 74 69 76 65 20 61  andle a native a
41010 62 6f 72 74 0a 09 09 09 09 09 09 09 2f 2f 20 41  bort........// A
41020 6c 73 6f 2c 20 73 61 76 65 20 65 72 72 6f 72 43  lso, save errorC
41030 61 6c 6c 62 61 63 6b 20 74 6f 20 61 20 76 61 72  allback to a var
41040 69 61 62 6c 65 0a 09 09 09 09 09 09 09 2f 2f 20  iable........// 
41050 61 73 20 78 68 72 2e 6f 6e 65 72 72 6f 72 20 63  as xhr.onerror c
41060 61 6e 6e 6f 74 20 62 65 20 61 63 63 65 73 73 65  annot be accesse
41070 64 0a 09 09 09 09 09 09 09 77 69 6e 64 6f 77 2e  d........window.
41080 73 65 74 54 69 6d 65 6f 75 74 28 20 66 75 6e 63  setTimeout( func
41090 74 69 6f 6e 28 29 20 7b 0a 09 09 09 09 09 09 09  tion() {........
410a0 09 69 66 20 28 20 63 61 6c 6c 62 61 63 6b 20 29  .if ( callback )
410b0 20 7b 0a 09 09 09 09 09 09 09 09 09 65 72 72 6f   {..........erro
410c0 72 43 61 6c 6c 62 61 63 6b 28 29 3b 0a 09 09 09  rCallback();....
410d0 09 09 09 09 09 7d 0a 09 09 09 09 09 09 09 7d 20  .....}........} 
410e0 29 3b 0a 09 09 09 09 09 09 7d 0a 09 09 09 09 09  );.......}......
410f0 7d 3b 0a 09 09 09 09 7d 0a 0a 09 09 09 09 2f 2f  };.....}......//
41100 20 43 72 65 61 74 65 20 74 68 65 20 61 62 6f 72   Create the abor
41110 74 20 63 61 6c 6c 62 61 63 6b 0a 09 09 09 09 63  t callback.....c
41120 61 6c 6c 62 61 63 6b 20 3d 20 63 61 6c 6c 62 61  allback = callba
41130 63 6b 28 20 22 61 62 6f 72 74 22 20 29 3b 0a 0a  ck( "abort" );..
41140 09 09 09 09 74 72 79 20 7b 0a 0a 09 09 09 09 09  ....try {.......
41150 2f 2f 20 44 6f 20 73 65 6e 64 20 74 68 65 20 72  // Do send the r
41160 65 71 75 65 73 74 20 28 74 68 69 73 20 6d 61 79  equest (this may
41170 20 72 61 69 73 65 20 61 6e 20 65 78 63 65 70 74   raise an except
41180 69 6f 6e 29 0a 09 09 09 09 09 78 68 72 2e 73 65  ion)......xhr.se
41190 6e 64 28 20 6f 70 74 69 6f 6e 73 2e 68 61 73 43  nd( options.hasC
411a0 6f 6e 74 65 6e 74 20 26 26 20 6f 70 74 69 6f 6e  ontent && option
411b0 73 2e 64 61 74 61 20 7c 7c 20 6e 75 6c 6c 20 29  s.data || null )
411c0 3b 0a 09 09 09 09 7d 20 63 61 74 63 68 20 28 20  ;.....} catch ( 
411d0 65 20 29 20 7b 0a 0a 09 09 09 09 09 2f 2f 20 23  e ) {.......// #
411e0 31 34 36 38 33 3a 20 4f 6e 6c 79 20 72 65 74 68  14683: Only reth
411f0 72 6f 77 20 69 66 20 74 68 69 73 20 68 61 73 6e  row if this hasn
41200 27 74 20 62 65 65 6e 20 6e 6f 74 69 66 69 65 64  't been notified
41210 20 61 73 20 61 6e 20 65 72 72 6f 72 20 79 65 74   as an error yet
41220 0a 09 09 09 09 09 69 66 20 28 20 63 61 6c 6c 62  ......if ( callb
41230 61 63 6b 20 29 20 7b 0a 09 09 09 09 09 09 74 68  ack ) {.......th
41240 72 6f 77 20 65 3b 0a 09 09 09 09 09 7d 0a 09 09  row e;......}...
41250 09 09 7d 0a 09 09 09 7d 2c 0a 0a 09 09 09 61 62  ..}....},.....ab
41260 6f 72 74 3a 20 66 75 6e 63 74 69 6f 6e 28 29 20  ort: function() 
41270 7b 0a 09 09 09 09 69 66 20 28 20 63 61 6c 6c 62  {.....if ( callb
41280 61 63 6b 20 29 20 7b 0a 09 09 09 09 09 63 61 6c  ack ) {......cal
41290 6c 62 61 63 6b 28 29 3b 0a 09 09 09 09 7d 0a 09  lback();.....}..
412a0 09 09 7d 0a 09 09 7d 3b 0a 09 7d 0a 7d 20 29 3b  ..}...};..}.} );
412b0 0a 0a 0a 0a 0a 2f 2f 20 50 72 65 76 65 6e 74 20  .....// Prevent 
412c0 61 75 74 6f 2d 65 78 65 63 75 74 69 6f 6e 20 6f  auto-execution o
412d0 66 20 73 63 72 69 70 74 73 20 77 68 65 6e 20 6e  f scripts when n
412e0 6f 20 65 78 70 6c 69 63 69 74 20 64 61 74 61 54  o explicit dataT
412f0 79 70 65 20 77 61 73 20 70 72 6f 76 69 64 65 64  ype was provided
41300 20 28 53 65 65 20 67 68 2d 32 34 33 32 29 0a 6a   (See gh-2432).j
41310 51 75 65 72 79 2e 61 6a 61 78 50 72 65 66 69 6c  Query.ajaxPrefil
41320 74 65 72 28 20 66 75 6e 63 74 69 6f 6e 28 20 73  ter( function( s
41330 20 29 20 7b 0a 09 69 66 20 28 20 73 2e 63 72 6f   ) {..if ( s.cro
41340 73 73 44 6f 6d 61 69 6e 20 29 20 7b 0a 09 09 73  ssDomain ) {...s
41350 2e 63 6f 6e 74 65 6e 74 73 2e 73 63 72 69 70 74  .contents.script
41360 20 3d 20 66 61 6c 73 65 3b 0a 09 7d 0a 7d 20 29   = false;..}.} )
41370 3b 0a 0a 2f 2f 20 49 6e 73 74 61 6c 6c 20 73 63  ;..// Install sc
41380 72 69 70 74 20 64 61 74 61 54 79 70 65 0a 6a 51  ript dataType.jQ
41390 75 65 72 79 2e 61 6a 61 78 53 65 74 75 70 28 20  uery.ajaxSetup( 
413a0 7b 0a 09 61 63 63 65 70 74 73 3a 20 7b 0a 09 09  {..accepts: {...
413b0 73 63 72 69 70 74 3a 20 22 74 65 78 74 2f 6a 61  script: "text/ja
413c0 76 61 73 63 72 69 70 74 2c 20 61 70 70 6c 69 63  vascript, applic
413d0 61 74 69 6f 6e 2f 6a 61 76 61 73 63 72 69 70 74  ation/javascript
413e0 2c 20 22 20 2b 0a 09 09 09 22 61 70 70 6c 69 63  , " +...."applic
413f0 61 74 69 6f 6e 2f 65 63 6d 61 73 63 72 69 70 74  ation/ecmascript
41400 2c 20 61 70 70 6c 69 63 61 74 69 6f 6e 2f 78 2d  , application/x-
41410 65 63 6d 61 73 63 72 69 70 74 22 0a 09 7d 2c 0a  ecmascript"..},.
41420 09 63 6f 6e 74 65 6e 74 73 3a 20 7b 0a 09 09 73  .contents: {...s
41430 63 72 69 70 74 3a 20 2f 5c 62 28 3f 3a 6a 61 76  cript: /\b(?:jav
41440 61 7c 65 63 6d 61 29 73 63 72 69 70 74 5c 62 2f  a|ecma)script\b/
41450 0a 09 7d 2c 0a 09 63 6f 6e 76 65 72 74 65 72 73  ..},..converters
41460 3a 20 7b 0a 09 09 22 74 65 78 74 20 73 63 72 69  : {..."text scri
41470 70 74 22 3a 20 66 75 6e 63 74 69 6f 6e 28 20 74  pt": function( t
41480 65 78 74 20 29 20 7b 0a 09 09 09 6a 51 75 65 72  ext ) {....jQuer
41490 79 2e 67 6c 6f 62 61 6c 45 76 61 6c 28 20 74 65  y.globalEval( te
414a0 78 74 20 29 3b 0a 09 09 09 72 65 74 75 72 6e 20  xt );....return 
414b0 74 65 78 74 3b 0a 09 09 7d 0a 09 7d 0a 7d 20 29  text;...}..}.} )
414c0 3b 0a 0a 2f 2f 20 48 61 6e 64 6c 65 20 63 61 63  ;..// Handle cac
414d0 68 65 27 73 20 73 70 65 63 69 61 6c 20 63 61 73  he's special cas
414e0 65 20 61 6e 64 20 63 72 6f 73 73 44 6f 6d 61 69  e and crossDomai
414f0 6e 0a 6a 51 75 65 72 79 2e 61 6a 61 78 50 72 65  n.jQuery.ajaxPre
41500 66 69 6c 74 65 72 28 20 22 73 63 72 69 70 74 22  filter( "script"
41510 2c 20 66 75 6e 63 74 69 6f 6e 28 20 73 20 29 20  , function( s ) 
41520 7b 0a 09 69 66 20 28 20 73 2e 63 61 63 68 65 20  {..if ( s.cache 
41530 3d 3d 3d 20 75 6e 64 65 66 69 6e 65 64 20 29 20  === undefined ) 
41540 7b 0a 09 09 73 2e 63 61 63 68 65 20 3d 20 66 61  {...s.cache = fa
41550 6c 73 65 3b 0a 09 7d 0a 09 69 66 20 28 20 73 2e  lse;..}..if ( s.
41560 63 72 6f 73 73 44 6f 6d 61 69 6e 20 29 20 7b 0a  crossDomain ) {.
41570 09 09 73 2e 74 79 70 65 20 3d 20 22 47 45 54 22  ..s.type = "GET"
41580 3b 0a 09 7d 0a 7d 20 29 3b 0a 0a 2f 2f 20 42 69  ;..}.} );..// Bi
41590 6e 64 20 73 63 72 69 70 74 20 74 61 67 20 68 61  nd script tag ha
415a0 63 6b 20 74 72 61 6e 73 70 6f 72 74 0a 6a 51 75  ck transport.jQu
415b0 65 72 79 2e 61 6a 61 78 54 72 61 6e 73 70 6f 72  ery.ajaxTranspor
415c0 74 28 20 22 73 63 72 69 70 74 22 2c 20 66 75 6e  t( "script", fun
415d0 63 74 69 6f 6e 28 20 73 20 29 20 7b 0a 0a 09 2f  ction( s ) {.../
415e0 2f 20 54 68 69 73 20 74 72 61 6e 73 70 6f 72 74  / This transport
415f0 20 6f 6e 6c 79 20 64 65 61 6c 73 20 77 69 74 68   only deals with
41600 20 63 72 6f 73 73 20 64 6f 6d 61 69 6e 20 6f 72   cross domain or
41610 20 66 6f 72 63 65 64 2d 62 79 2d 61 74 74 72 73   forced-by-attrs
41620 20 72 65 71 75 65 73 74 73 0a 09 69 66 20 28 20   requests..if ( 
41630 73 2e 63 72 6f 73 73 44 6f 6d 61 69 6e 20 7c 7c  s.crossDomain ||
41640 20 73 2e 73 63 72 69 70 74 41 74 74 72 73 20 29   s.scriptAttrs )
41650 20 7b 0a 09 09 76 61 72 20 73 63 72 69 70 74 2c   {...var script,
41660 20 63 61 6c 6c 62 61 63 6b 3b 0a 09 09 72 65 74   callback;...ret
41670 75 72 6e 20 7b 0a 09 09 09 73 65 6e 64 3a 20 66  urn {....send: f
41680 75 6e 63 74 69 6f 6e 28 20 5f 2c 20 63 6f 6d 70  unction( _, comp
41690 6c 65 74 65 20 29 20 7b 0a 09 09 09 09 73 63 72  lete ) {.....scr
416a0 69 70 74 20 3d 20 6a 51 75 65 72 79 28 20 22 3c  ipt = jQuery( "<
416b0 73 63 72 69 70 74 3e 22 20 29 0a 09 09 09 09 09  script>" )......
416c0 2e 61 74 74 72 28 20 73 2e 73 63 72 69 70 74 41  .attr( s.scriptA
416d0 74 74 72 73 20 7c 7c 20 7b 7d 20 29 0a 09 09 09  ttrs || {} )....
416e0 09 09 2e 70 72 6f 70 28 20 7b 20 63 68 61 72 73  ...prop( { chars
416f0 65 74 3a 20 73 2e 73 63 72 69 70 74 43 68 61 72  et: s.scriptChar
41700 73 65 74 2c 20 73 72 63 3a 20 73 2e 75 72 6c 20  set, src: s.url 
41710 7d 20 29 0a 09 09 09 09 09 2e 6f 6e 28 20 22 6c  } ).......on( "l
41720 6f 61 64 20 65 72 72 6f 72 22 2c 20 63 61 6c 6c  oad error", call
41730 62 61 63 6b 20 3d 20 66 75 6e 63 74 69 6f 6e 28  back = function(
41740 20 65 76 74 20 29 20 7b 0a 09 09 09 09 09 09 73   evt ) {.......s
41750 63 72 69 70 74 2e 72 65 6d 6f 76 65 28 29 3b 0a  cript.remove();.
41760 09 09 09 09 09 09 63 61 6c 6c 62 61 63 6b 20 3d  ......callback =
41770 20 6e 75 6c 6c 3b 0a 09 09 09 09 09 09 69 66 20   null;.......if 
41780 28 20 65 76 74 20 29 20 7b 0a 09 09 09 09 09 09  ( evt ) {.......
41790 09 63 6f 6d 70 6c 65 74 65 28 20 65 76 74 2e 74  .complete( evt.t
417a0 79 70 65 20 3d 3d 3d 20 22 65 72 72 6f 72 22 20  ype === "error" 
417b0 3f 20 34 30 34 20 3a 20 32 30 30 2c 20 65 76 74  ? 404 : 200, evt
417c0 2e 74 79 70 65 20 29 3b 0a 09 09 09 09 09 09 7d  .type );.......}
417d0 0a 09 09 09 09 09 7d 20 29 3b 0a 0a 09 09 09 09  ......} );......
417e0 2f 2f 20 55 73 65 20 6e 61 74 69 76 65 20 44 4f  // Use native DO
417f0 4d 20 6d 61 6e 69 70 75 6c 61 74 69 6f 6e 20 74  M manipulation t
41800 6f 20 61 76 6f 69 64 20 6f 75 72 20 64 6f 6d 4d  o avoid our domM
41810 61 6e 69 70 20 41 4a 41 58 20 74 72 69 63 6b 65  anip AJAX tricke
41820 72 79 0a 09 09 09 09 64 6f 63 75 6d 65 6e 74 2e  ry.....document.
41830 68 65 61 64 2e 61 70 70 65 6e 64 43 68 69 6c 64  head.appendChild
41840 28 20 73 63 72 69 70 74 5b 20 30 20 5d 20 29 3b  ( script[ 0 ] );
41850 0a 09 09 09 7d 2c 0a 09 09 09 61 62 6f 72 74 3a  ....},....abort:
41860 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09 09   function() {...
41870 09 09 69 66 20 28 20 63 61 6c 6c 62 61 63 6b 20  ..if ( callback 
41880 29 20 7b 0a 09 09 09 09 09 63 61 6c 6c 62 61 63  ) {......callbac
41890 6b 28 29 3b 0a 09 09 09 09 7d 0a 09 09 09 7d 0a  k();.....}....}.
418a0 09 09 7d 3b 0a 09 7d 0a 7d 20 29 3b 0a 0a 0a 0a  ..};..}.} );....
418b0 0a 76 61 72 20 6f 6c 64 43 61 6c 6c 62 61 63 6b  .var oldCallback
418c0 73 20 3d 20 5b 5d 2c 0a 09 72 6a 73 6f 6e 70 20  s = [],..rjsonp 
418d0 3d 20 2f 28 3d 29 5c 3f 28 3f 3d 26 7c 24 29 7c  = /(=)\?(?=&|$)|
418e0 5c 3f 5c 3f 2f 3b 0a 0a 2f 2f 20 44 65 66 61 75  \?\?/;..// Defau
418f0 6c 74 20 6a 73 6f 6e 70 20 73 65 74 74 69 6e 67  lt jsonp setting
41900 73 0a 6a 51 75 65 72 79 2e 61 6a 61 78 53 65 74  s.jQuery.ajaxSet
41910 75 70 28 20 7b 0a 09 6a 73 6f 6e 70 3a 20 22 63  up( {..jsonp: "c
41920 61 6c 6c 62 61 63 6b 22 2c 0a 09 6a 73 6f 6e 70  allback",..jsonp
41930 43 61 6c 6c 62 61 63 6b 3a 20 66 75 6e 63 74 69  Callback: functi
41940 6f 6e 28 29 20 7b 0a 09 09 76 61 72 20 63 61 6c  on() {...var cal
41950 6c 62 61 63 6b 20 3d 20 6f 6c 64 43 61 6c 6c 62  lback = oldCallb
41960 61 63 6b 73 2e 70 6f 70 28 29 20 7c 7c 20 28 20  acks.pop() || ( 
41970 6a 51 75 65 72 79 2e 65 78 70 61 6e 64 6f 20 2b  jQuery.expando +
41980 20 22 5f 22 20 2b 20 28 20 6e 6f 6e 63 65 2e 67   "_" + ( nonce.g
41990 75 69 64 2b 2b 20 29 20 29 3b 0a 09 09 74 68 69  uid++ ) );...thi
419a0 73 5b 20 63 61 6c 6c 62 61 63 6b 20 5d 20 3d 20  s[ callback ] = 
419b0 74 72 75 65 3b 0a 09 09 72 65 74 75 72 6e 20 63  true;...return c
419c0 61 6c 6c 62 61 63 6b 3b 0a 09 7d 0a 7d 20 29 3b  allback;..}.} );
419d0 0a 0a 2f 2f 20 44 65 74 65 63 74 2c 20 6e 6f 72  ..// Detect, nor
419e0 6d 61 6c 69 7a 65 20 6f 70 74 69 6f 6e 73 20 61  malize options a
419f0 6e 64 20 69 6e 73 74 61 6c 6c 20 63 61 6c 6c 62  nd install callb
41a00 61 63 6b 73 20 66 6f 72 20 6a 73 6f 6e 70 20 72  acks for jsonp r
41a10 65 71 75 65 73 74 73 0a 6a 51 75 65 72 79 2e 61  equests.jQuery.a
41a20 6a 61 78 50 72 65 66 69 6c 74 65 72 28 20 22 6a  jaxPrefilter( "j
41a30 73 6f 6e 20 6a 73 6f 6e 70 22 2c 20 66 75 6e 63  son jsonp", func
41a40 74 69 6f 6e 28 20 73 2c 20 6f 72 69 67 69 6e 61  tion( s, origina
41a50 6c 53 65 74 74 69 6e 67 73 2c 20 6a 71 58 48 52  lSettings, jqXHR
41a60 20 29 20 7b 0a 0a 09 76 61 72 20 63 61 6c 6c 62   ) {...var callb
41a70 61 63 6b 4e 61 6d 65 2c 20 6f 76 65 72 77 72 69  ackName, overwri
41a80 74 74 65 6e 2c 20 72 65 73 70 6f 6e 73 65 43 6f  tten, responseCo
41a90 6e 74 61 69 6e 65 72 2c 0a 09 09 6a 73 6f 6e 50  ntainer,...jsonP
41aa0 72 6f 70 20 3d 20 73 2e 6a 73 6f 6e 70 20 21 3d  rop = s.jsonp !=
41ab0 3d 20 66 61 6c 73 65 20 26 26 20 28 20 72 6a 73  = false && ( rjs
41ac0 6f 6e 70 2e 74 65 73 74 28 20 73 2e 75 72 6c 20  onp.test( s.url 
41ad0 29 20 3f 0a 09 09 09 22 75 72 6c 22 20 3a 0a 09  ) ?...."url" :..
41ae0 09 09 74 79 70 65 6f 66 20 73 2e 64 61 74 61 20  ..typeof s.data 
41af0 3d 3d 3d 20 22 73 74 72 69 6e 67 22 20 26 26 0a  === "string" &&.
41b00 09 09 09 09 28 20 73 2e 63 6f 6e 74 65 6e 74 54  ....( s.contentT
41b10 79 70 65 20 7c 7c 20 22 22 20 29 0a 09 09 09 09  ype || "" ).....
41b20 09 2e 69 6e 64 65 78 4f 66 28 20 22 61 70 70 6c  ..indexOf( "appl
41b30 69 63 61 74 69 6f 6e 2f 78 2d 77 77 77 2d 66 6f  ication/x-www-fo
41b40 72 6d 2d 75 72 6c 65 6e 63 6f 64 65 64 22 20 29  rm-urlencoded" )
41b50 20 3d 3d 3d 20 30 20 26 26 0a 09 09 09 09 72 6a   === 0 &&.....rj
41b60 73 6f 6e 70 2e 74 65 73 74 28 20 73 2e 64 61 74  sonp.test( s.dat
41b70 61 20 29 20 26 26 20 22 64 61 74 61 22 0a 09 09  a ) && "data"...
41b80 29 3b 0a 0a 09 2f 2f 20 48 61 6e 64 6c 65 20 69  );...// Handle i
41b90 66 66 20 74 68 65 20 65 78 70 65 63 74 65 64 20  ff the expected 
41ba0 64 61 74 61 20 74 79 70 65 20 69 73 20 22 6a 73  data type is "js
41bb0 6f 6e 70 22 20 6f 72 20 77 65 20 68 61 76 65 20  onp" or we have 
41bc0 61 20 70 61 72 61 6d 65 74 65 72 20 74 6f 20 73  a parameter to s
41bd0 65 74 0a 09 69 66 20 28 20 6a 73 6f 6e 50 72 6f  et..if ( jsonPro
41be0 70 20 7c 7c 20 73 2e 64 61 74 61 54 79 70 65 73  p || s.dataTypes
41bf0 5b 20 30 20 5d 20 3d 3d 3d 20 22 6a 73 6f 6e 70  [ 0 ] === "jsonp
41c00 22 20 29 20 7b 0a 0a 09 09 2f 2f 20 47 65 74 20  " ) {....// Get 
41c10 63 61 6c 6c 62 61 63 6b 20 6e 61 6d 65 2c 20 72  callback name, r
41c20 65 6d 65 6d 62 65 72 69 6e 67 20 70 72 65 65 78  emembering preex
41c30 69 73 74 69 6e 67 20 76 61 6c 75 65 20 61 73 73  isting value ass
41c40 6f 63 69 61 74 65 64 20 77 69 74 68 20 69 74 0a  ociated with it.
41c50 09 09 63 61 6c 6c 62 61 63 6b 4e 61 6d 65 20 3d  ..callbackName =
41c60 20 73 2e 6a 73 6f 6e 70 43 61 6c 6c 62 61 63 6b   s.jsonpCallback
41c70 20 3d 20 69 73 46 75 6e 63 74 69 6f 6e 28 20 73   = isFunction( s
41c80 2e 6a 73 6f 6e 70 43 61 6c 6c 62 61 63 6b 20 29  .jsonpCallback )
41c90 20 3f 0a 09 09 09 73 2e 6a 73 6f 6e 70 43 61 6c   ?....s.jsonpCal
41ca0 6c 62 61 63 6b 28 29 20 3a 0a 09 09 09 73 2e 6a  lback() :....s.j
41cb0 73 6f 6e 70 43 61 6c 6c 62 61 63 6b 3b 0a 0a 09  sonpCallback;...
41cc0 09 2f 2f 20 49 6e 73 65 72 74 20 63 61 6c 6c 62  .// Insert callb
41cd0 61 63 6b 20 69 6e 74 6f 20 75 72 6c 20 6f 72 20  ack into url or 
41ce0 66 6f 72 6d 20 64 61 74 61 0a 09 09 69 66 20 28  form data...if (
41cf0 20 6a 73 6f 6e 50 72 6f 70 20 29 20 7b 0a 09 09   jsonProp ) {...
41d00 09 73 5b 20 6a 73 6f 6e 50 72 6f 70 20 5d 20 3d  .s[ jsonProp ] =
41d10 20 73 5b 20 6a 73 6f 6e 50 72 6f 70 20 5d 2e 72   s[ jsonProp ].r
41d20 65 70 6c 61 63 65 28 20 72 6a 73 6f 6e 70 2c 20  eplace( rjsonp, 
41d30 22 24 31 22 20 2b 20 63 61 6c 6c 62 61 63 6b 4e  "$1" + callbackN
41d40 61 6d 65 20 29 3b 0a 09 09 7d 20 65 6c 73 65 20  ame );...} else 
41d50 69 66 20 28 20 73 2e 6a 73 6f 6e 70 20 21 3d 3d  if ( s.jsonp !==
41d60 20 66 61 6c 73 65 20 29 20 7b 0a 09 09 09 73 2e   false ) {....s.
41d70 75 72 6c 20 2b 3d 20 28 20 72 71 75 65 72 79 2e  url += ( rquery.
41d80 74 65 73 74 28 20 73 2e 75 72 6c 20 29 20 3f 20  test( s.url ) ? 
41d90 22 26 22 20 3a 20 22 3f 22 20 29 20 2b 20 73 2e  "&" : "?" ) + s.
41da0 6a 73 6f 6e 70 20 2b 20 22 3d 22 20 2b 20 63 61  jsonp + "=" + ca
41db0 6c 6c 62 61 63 6b 4e 61 6d 65 3b 0a 09 09 7d 0a  llbackName;...}.
41dc0 0a 09 09 2f 2f 20 55 73 65 20 64 61 74 61 20 63  ...// Use data c
41dd0 6f 6e 76 65 72 74 65 72 20 74 6f 20 72 65 74 72  onverter to retr
41de0 69 65 76 65 20 6a 73 6f 6e 20 61 66 74 65 72 20  ieve json after 
41df0 73 63 72 69 70 74 20 65 78 65 63 75 74 69 6f 6e  script execution
41e00 0a 09 09 73 2e 63 6f 6e 76 65 72 74 65 72 73 5b  ...s.converters[
41e10 20 22 73 63 72 69 70 74 20 6a 73 6f 6e 22 20 5d   "script json" ]
41e20 20 3d 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a   = function() {.
41e30 09 09 09 69 66 20 28 20 21 72 65 73 70 6f 6e 73  ...if ( !respons
41e40 65 43 6f 6e 74 61 69 6e 65 72 20 29 20 7b 0a 09  eContainer ) {..
41e50 09 09 09 6a 51 75 65 72 79 2e 65 72 72 6f 72 28  ...jQuery.error(
41e60 20 63 61 6c 6c 62 61 63 6b 4e 61 6d 65 20 2b 20   callbackName + 
41e70 22 20 77 61 73 20 6e 6f 74 20 63 61 6c 6c 65 64  " was not called
41e80 22 20 29 3b 0a 09 09 09 7d 0a 09 09 09 72 65 74  " );....}....ret
41e90 75 72 6e 20 72 65 73 70 6f 6e 73 65 43 6f 6e 74  urn responseCont
41ea0 61 69 6e 65 72 5b 20 30 20 5d 3b 0a 09 09 7d 3b  ainer[ 0 ];...};
41eb0 0a 0a 09 09 2f 2f 20 46 6f 72 63 65 20 6a 73 6f  ....// Force jso
41ec0 6e 20 64 61 74 61 54 79 70 65 0a 09 09 73 2e 64  n dataType...s.d
41ed0 61 74 61 54 79 70 65 73 5b 20 30 20 5d 20 3d 20  ataTypes[ 0 ] = 
41ee0 22 6a 73 6f 6e 22 3b 0a 0a 09 09 2f 2f 20 49 6e  "json";....// In
41ef0 73 74 61 6c 6c 20 63 61 6c 6c 62 61 63 6b 0a 09  stall callback..
41f00 09 6f 76 65 72 77 72 69 74 74 65 6e 20 3d 20 77  .overwritten = w
41f10 69 6e 64 6f 77 5b 20 63 61 6c 6c 62 61 63 6b 4e  indow[ callbackN
41f20 61 6d 65 20 5d 3b 0a 09 09 77 69 6e 64 6f 77 5b  ame ];...window[
41f30 20 63 61 6c 6c 62 61 63 6b 4e 61 6d 65 20 5d 20   callbackName ] 
41f40 3d 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a 09  = function() {..
41f50 09 09 72 65 73 70 6f 6e 73 65 43 6f 6e 74 61 69  ..responseContai
41f60 6e 65 72 20 3d 20 61 72 67 75 6d 65 6e 74 73 3b  ner = arguments;
41f70 0a 09 09 7d 3b 0a 0a 09 09 2f 2f 20 43 6c 65 61  ...};....// Clea
41f80 6e 2d 75 70 20 66 75 6e 63 74 69 6f 6e 20 28 66  n-up function (f
41f90 69 72 65 73 20 61 66 74 65 72 20 63 6f 6e 76 65  ires after conve
41fa0 72 74 65 72 73 29 0a 09 09 6a 71 58 48 52 2e 61  rters)...jqXHR.a
41fb0 6c 77 61 79 73 28 20 66 75 6e 63 74 69 6f 6e 28  lways( function(
41fc0 29 20 7b 0a 0a 09 09 09 2f 2f 20 49 66 20 70 72  ) {.....// If pr
41fd0 65 76 69 6f 75 73 20 76 61 6c 75 65 20 64 69 64  evious value did
41fe0 6e 27 74 20 65 78 69 73 74 20 2d 20 72 65 6d 6f  n't exist - remo
41ff0 76 65 20 69 74 0a 09 09 09 69 66 20 28 20 6f 76  ve it....if ( ov
42000 65 72 77 72 69 74 74 65 6e 20 3d 3d 3d 20 75 6e  erwritten === un
42010 64 65 66 69 6e 65 64 20 29 20 7b 0a 09 09 09 09  defined ) {.....
42020 6a 51 75 65 72 79 28 20 77 69 6e 64 6f 77 20 29  jQuery( window )
42030 2e 72 65 6d 6f 76 65 50 72 6f 70 28 20 63 61 6c  .removeProp( cal
42040 6c 62 61 63 6b 4e 61 6d 65 20 29 3b 0a 0a 09 09  lbackName );....
42050 09 2f 2f 20 4f 74 68 65 72 77 69 73 65 20 72 65  .// Otherwise re
42060 73 74 6f 72 65 20 70 72 65 65 78 69 73 74 69 6e  store preexistin
42070 67 20 76 61 6c 75 65 0a 09 09 09 7d 20 65 6c 73  g value....} els
42080 65 20 7b 0a 09 09 09 09 77 69 6e 64 6f 77 5b 20  e {.....window[ 
42090 63 61 6c 6c 62 61 63 6b 4e 61 6d 65 20 5d 20 3d  callbackName ] =
420a0 20 6f 76 65 72 77 72 69 74 74 65 6e 3b 0a 09 09   overwritten;...
420b0 09 7d 0a 0a 09 09 09 2f 2f 20 53 61 76 65 20 62  .}.....// Save b
420c0 61 63 6b 20 61 73 20 66 72 65 65 0a 09 09 09 69  ack as free....i
420d0 66 20 28 20 73 5b 20 63 61 6c 6c 62 61 63 6b 4e  f ( s[ callbackN
420e0 61 6d 65 20 5d 20 29 20 7b 0a 0a 09 09 09 09 2f  ame ] ) {....../
420f0 2f 20 4d 61 6b 65 20 73 75 72 65 20 74 68 61 74  / Make sure that
42100 20 72 65 2d 75 73 69 6e 67 20 74 68 65 20 6f 70   re-using the op
42110 74 69 6f 6e 73 20 64 6f 65 73 6e 27 74 20 73 63  tions doesn't sc
42120 72 65 77 20 74 68 69 6e 67 73 20 61 72 6f 75 6e  rew things aroun
42130 64 0a 09 09 09 09 73 2e 6a 73 6f 6e 70 43 61 6c  d.....s.jsonpCal
42140 6c 62 61 63 6b 20 3d 20 6f 72 69 67 69 6e 61 6c  lback = original
42150 53 65 74 74 69 6e 67 73 2e 6a 73 6f 6e 70 43 61  Settings.jsonpCa
42160 6c 6c 62 61 63 6b 3b 0a 0a 09 09 09 09 2f 2f 20  llback;......// 
42170 53 61 76 65 20 74 68 65 20 63 61 6c 6c 62 61 63  Save the callbac
42180 6b 20 6e 61 6d 65 20 66 6f 72 20 66 75 74 75 72  k name for futur
42190 65 20 75 73 65 0a 09 09 09 09 6f 6c 64 43 61 6c  e use.....oldCal
421a0 6c 62 61 63 6b 73 2e 70 75 73 68 28 20 63 61 6c  lbacks.push( cal
421b0 6c 62 61 63 6b 4e 61 6d 65 20 29 3b 0a 09 09 09  lbackName );....
421c0 7d 0a 0a 09 09 09 2f 2f 20 43 61 6c 6c 20 69 66  }.....// Call if
421d0 20 69 74 20 77 61 73 20 61 20 66 75 6e 63 74 69   it was a functi
421e0 6f 6e 20 61 6e 64 20 77 65 20 68 61 76 65 20 61  on and we have a
421f0 20 72 65 73 70 6f 6e 73 65 0a 09 09 09 69 66 20   response....if 
42200 28 20 72 65 73 70 6f 6e 73 65 43 6f 6e 74 61 69  ( responseContai
42210 6e 65 72 20 26 26 20 69 73 46 75 6e 63 74 69 6f  ner && isFunctio
42220 6e 28 20 6f 76 65 72 77 72 69 74 74 65 6e 20 29  n( overwritten )
42230 20 29 20 7b 0a 09 09 09 09 6f 76 65 72 77 72 69   ) {.....overwri
42240 74 74 65 6e 28 20 72 65 73 70 6f 6e 73 65 43 6f  tten( responseCo
42250 6e 74 61 69 6e 65 72 5b 20 30 20 5d 20 29 3b 0a  ntainer[ 0 ] );.
42260 09 09 09 7d 0a 0a 09 09 09 72 65 73 70 6f 6e 73  ...}.....respons
42270 65 43 6f 6e 74 61 69 6e 65 72 20 3d 20 6f 76 65  eContainer = ove
42280 72 77 72 69 74 74 65 6e 20 3d 20 75 6e 64 65 66  rwritten = undef
42290 69 6e 65 64 3b 0a 09 09 7d 20 29 3b 0a 0a 09 09  ined;...} );....
422a0 2f 2f 20 44 65 6c 65 67 61 74 65 20 74 6f 20 73  // Delegate to s
422b0 63 72 69 70 74 0a 09 09 72 65 74 75 72 6e 20 22  cript...return "
422c0 73 63 72 69 70 74 22 3b 0a 09 7d 0a 7d 20 29 3b  script";..}.} );
422d0 0a 0a 0a 0a 0a 2f 2f 20 53 75 70 70 6f 72 74 3a  .....// Support:
422e0 20 53 61 66 61 72 69 20 38 20 6f 6e 6c 79 0a 2f   Safari 8 only./
422f0 2f 20 49 6e 20 53 61 66 61 72 69 20 38 20 64 6f  / In Safari 8 do
42300 63 75 6d 65 6e 74 73 20 63 72 65 61 74 65 64 20  cuments created 
42310 76 69 61 20 64 6f 63 75 6d 65 6e 74 2e 69 6d 70  via document.imp
42320 6c 65 6d 65 6e 74 61 74 69 6f 6e 2e 63 72 65 61  lementation.crea
42330 74 65 48 54 4d 4c 44 6f 63 75 6d 65 6e 74 0a 2f  teHTMLDocument./
42340 2f 20 63 6f 6c 6c 61 70 73 65 20 73 69 62 6c 69  / collapse sibli
42350 6e 67 20 66 6f 72 6d 73 3a 20 74 68 65 20 73 65  ng forms: the se
42360 63 6f 6e 64 20 6f 6e 65 20 62 65 63 6f 6d 65 73  cond one becomes
42370 20 61 20 63 68 69 6c 64 20 6f 66 20 74 68 65 20   a child of the 
42380 66 69 72 73 74 20 6f 6e 65 2e 0a 2f 2f 20 42 65  first one..// Be
42390 63 61 75 73 65 20 6f 66 20 74 68 61 74 2c 20 74  cause of that, t
423a0 68 69 73 20 73 65 63 75 72 69 74 79 20 6d 65 61  his security mea
423b0 73 75 72 65 20 68 61 73 20 74 6f 20 62 65 20 64  sure has to be d
423c0 69 73 61 62 6c 65 64 20 69 6e 20 53 61 66 61 72  isabled in Safar
423d0 69 20 38 2e 0a 2f 2f 20 68 74 74 70 73 3a 2f 2f  i 8..// https://
423e0 62 75 67 73 2e 77 65 62 6b 69 74 2e 6f 72 67 2f  bugs.webkit.org/
423f0 73 68 6f 77 5f 62 75 67 2e 63 67 69 3f 69 64 3d  show_bug.cgi?id=
42400 31 33 37 33 33 37 0a 73 75 70 70 6f 72 74 2e 63  137337.support.c
42410 72 65 61 74 65 48 54 4d 4c 44 6f 63 75 6d 65 6e  reateHTMLDocumen
42420 74 20 3d 20 28 20 66 75 6e 63 74 69 6f 6e 28 29  t = ( function()
42430 20 7b 0a 09 76 61 72 20 62 6f 64 79 20 3d 20 64   {..var body = d
42440 6f 63 75 6d 65 6e 74 2e 69 6d 70 6c 65 6d 65 6e  ocument.implemen
42450 74 61 74 69 6f 6e 2e 63 72 65 61 74 65 48 54 4d  tation.createHTM
42460 4c 44 6f 63 75 6d 65 6e 74 28 20 22 22 20 29 2e  LDocument( "" ).
42470 62 6f 64 79 3b 0a 09 62 6f 64 79 2e 69 6e 6e 65  body;..body.inne
42480 72 48 54 4d 4c 20 3d 20 22 3c 66 6f 72 6d 3e 3c  rHTML = "<form><
42490 2f 66 6f 72 6d 3e 3c 66 6f 72 6d 3e 3c 2f 66 6f  /form><form></fo
424a0 72 6d 3e 22 3b 0a 09 72 65 74 75 72 6e 20 62 6f  rm>";..return bo
424b0 64 79 2e 63 68 69 6c 64 4e 6f 64 65 73 2e 6c 65  dy.childNodes.le
424c0 6e 67 74 68 20 3d 3d 3d 20 32 3b 0a 7d 20 29 28  ngth === 2;.} )(
424d0 29 3b 0a 0a 0a 2f 2f 20 41 72 67 75 6d 65 6e 74  );...// Argument
424e0 20 22 64 61 74 61 22 20 73 68 6f 75 6c 64 20 62   "data" should b
424f0 65 20 73 74 72 69 6e 67 20 6f 66 20 68 74 6d 6c  e string of html
42500 0a 2f 2f 20 63 6f 6e 74 65 78 74 20 28 6f 70 74  .// context (opt
42510 69 6f 6e 61 6c 29 3a 20 49 66 20 73 70 65 63 69  ional): If speci
42520 66 69 65 64 2c 20 74 68 65 20 66 72 61 67 6d 65  fied, the fragme
42530 6e 74 20 77 69 6c 6c 20 62 65 20 63 72 65 61 74  nt will be creat
42540 65 64 20 69 6e 20 74 68 69 73 20 63 6f 6e 74 65  ed in this conte
42550 78 74 2c 0a 2f 2f 20 64 65 66 61 75 6c 74 73 20  xt,.// defaults 
42560 74 6f 20 64 6f 63 75 6d 65 6e 74 0a 2f 2f 20 6b  to document.// k
42570 65 65 70 53 63 72 69 70 74 73 20 28 6f 70 74 69  eepScripts (opti
42580 6f 6e 61 6c 29 3a 20 49 66 20 74 72 75 65 2c 20  onal): If true, 
42590 77 69 6c 6c 20 69 6e 63 6c 75 64 65 20 73 63 72  will include scr
425a0 69 70 74 73 20 70 61 73 73 65 64 20 69 6e 20 74  ipts passed in t
425b0 68 65 20 68 74 6d 6c 20 73 74 72 69 6e 67 0a 6a  he html string.j
425c0 51 75 65 72 79 2e 70 61 72 73 65 48 54 4d 4c 20  Query.parseHTML 
425d0 3d 20 66 75 6e 63 74 69 6f 6e 28 20 64 61 74 61  = function( data
425e0 2c 20 63 6f 6e 74 65 78 74 2c 20 6b 65 65 70 53  , context, keepS
425f0 63 72 69 70 74 73 20 29 20 7b 0a 09 69 66 20 28  cripts ) {..if (
42600 20 74 79 70 65 6f 66 20 64 61 74 61 20 21 3d 3d   typeof data !==
42610 20 22 73 74 72 69 6e 67 22 20 29 20 7b 0a 09 09   "string" ) {...
42620 72 65 74 75 72 6e 20 5b 5d 3b 0a 09 7d 0a 09 69  return [];..}..i
42630 66 20 28 20 74 79 70 65 6f 66 20 63 6f 6e 74 65  f ( typeof conte
42640 78 74 20 3d 3d 3d 20 22 62 6f 6f 6c 65 61 6e 22  xt === "boolean"
42650 20 29 20 7b 0a 09 09 6b 65 65 70 53 63 72 69 70   ) {...keepScrip
42660 74 73 20 3d 20 63 6f 6e 74 65 78 74 3b 0a 09 09  ts = context;...
42670 63 6f 6e 74 65 78 74 20 3d 20 66 61 6c 73 65 3b  context = false;
42680 0a 09 7d 0a 0a 09 76 61 72 20 62 61 73 65 2c 20  ..}...var base, 
42690 70 61 72 73 65 64 2c 20 73 63 72 69 70 74 73 3b  parsed, scripts;
426a0 0a 0a 09 69 66 20 28 20 21 63 6f 6e 74 65 78 74  ...if ( !context
426b0 20 29 20 7b 0a 0a 09 09 2f 2f 20 53 74 6f 70 20   ) {....// Stop 
426c0 73 63 72 69 70 74 73 20 6f 72 20 69 6e 6c 69 6e  scripts or inlin
426d0 65 20 65 76 65 6e 74 20 68 61 6e 64 6c 65 72 73  e event handlers
426e0 20 66 72 6f 6d 20 62 65 69 6e 67 20 65 78 65 63   from being exec
426f0 75 74 65 64 20 69 6d 6d 65 64 69 61 74 65 6c 79  uted immediately
42700 0a 09 09 2f 2f 20 62 79 20 75 73 69 6e 67 20 64  ...// by using d
42710 6f 63 75 6d 65 6e 74 2e 69 6d 70 6c 65 6d 65 6e  ocument.implemen
42720 74 61 74 69 6f 6e 0a 09 09 69 66 20 28 20 73 75  tation...if ( su
42730 70 70 6f 72 74 2e 63 72 65 61 74 65 48 54 4d 4c  pport.createHTML
42740 44 6f 63 75 6d 65 6e 74 20 29 20 7b 0a 09 09 09  Document ) {....
42750 63 6f 6e 74 65 78 74 20 3d 20 64 6f 63 75 6d 65  context = docume
42760 6e 74 2e 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f  nt.implementatio
42770 6e 2e 63 72 65 61 74 65 48 54 4d 4c 44 6f 63 75  n.createHTMLDocu
42780 6d 65 6e 74 28 20 22 22 20 29 3b 0a 0a 09 09 09  ment( "" );.....
42790 2f 2f 20 53 65 74 20 74 68 65 20 62 61 73 65 20  // Set the base 
427a0 68 72 65 66 20 66 6f 72 20 74 68 65 20 63 72 65  href for the cre
427b0 61 74 65 64 20 64 6f 63 75 6d 65 6e 74 0a 09 09  ated document...
427c0 09 2f 2f 20 73 6f 20 61 6e 79 20 70 61 72 73 65  .// so any parse
427d0 64 20 65 6c 65 6d 65 6e 74 73 20 77 69 74 68 20  d elements with 
427e0 55 52 4c 73 0a 09 09 09 2f 2f 20 61 72 65 20 62  URLs....// are b
427f0 61 73 65 64 20 6f 6e 20 74 68 65 20 64 6f 63 75  ased on the docu
42800 6d 65 6e 74 27 73 20 55 52 4c 20 28 67 68 2d 32  ment's URL (gh-2
42810 39 36 35 29 0a 09 09 09 62 61 73 65 20 3d 20 63  965)....base = c
42820 6f 6e 74 65 78 74 2e 63 72 65 61 74 65 45 6c 65  ontext.createEle
42830 6d 65 6e 74 28 20 22 62 61 73 65 22 20 29 3b 0a  ment( "base" );.
42840 09 09 09 62 61 73 65 2e 68 72 65 66 20 3d 20 64  ...base.href = d
42850 6f 63 75 6d 65 6e 74 2e 6c 6f 63 61 74 69 6f 6e  ocument.location
42860 2e 68 72 65 66 3b 0a 09 09 09 63 6f 6e 74 65 78  .href;....contex
42870 74 2e 68 65 61 64 2e 61 70 70 65 6e 64 43 68 69  t.head.appendChi
42880 6c 64 28 20 62 61 73 65 20 29 3b 0a 09 09 7d 20  ld( base );...} 
42890 65 6c 73 65 20 7b 0a 09 09 09 63 6f 6e 74 65 78  else {....contex
428a0 74 20 3d 20 64 6f 63 75 6d 65 6e 74 3b 0a 09 09  t = document;...
428b0 7d 0a 09 7d 0a 0a 09 70 61 72 73 65 64 20 3d 20  }..}...parsed = 
428c0 72 73 69 6e 67 6c 65 54 61 67 2e 65 78 65 63 28  rsingleTag.exec(
428d0 20 64 61 74 61 20 29 3b 0a 09 73 63 72 69 70 74   data );..script
428e0 73 20 3d 20 21 6b 65 65 70 53 63 72 69 70 74 73  s = !keepScripts
428f0 20 26 26 20 5b 5d 3b 0a 0a 09 2f 2f 20 53 69 6e   && [];...// Sin
42900 67 6c 65 20 74 61 67 0a 09 69 66 20 28 20 70 61  gle tag..if ( pa
42910 72 73 65 64 20 29 20 7b 0a 09 09 72 65 74 75 72  rsed ) {...retur
42920 6e 20 5b 20 63 6f 6e 74 65 78 74 2e 63 72 65 61  n [ context.crea
42930 74 65 45 6c 65 6d 65 6e 74 28 20 70 61 72 73 65  teElement( parse
42940 64 5b 20 31 20 5d 20 29 20 5d 3b 0a 09 7d 0a 0a  d[ 1 ] ) ];..}..
42950 09 70 61 72 73 65 64 20 3d 20 62 75 69 6c 64 46  .parsed = buildF
42960 72 61 67 6d 65 6e 74 28 20 5b 20 64 61 74 61 20  ragment( [ data 
42970 5d 2c 20 63 6f 6e 74 65 78 74 2c 20 73 63 72 69  ], context, scri
42980 70 74 73 20 29 3b 0a 0a 09 69 66 20 28 20 73 63  pts );...if ( sc
42990 72 69 70 74 73 20 26 26 20 73 63 72 69 70 74 73  ripts && scripts
429a0 2e 6c 65 6e 67 74 68 20 29 20 7b 0a 09 09 6a 51  .length ) {...jQ
429b0 75 65 72 79 28 20 73 63 72 69 70 74 73 20 29 2e  uery( scripts ).
429c0 72 65 6d 6f 76 65 28 29 3b 0a 09 7d 0a 0a 09 72  remove();..}...r
429d0 65 74 75 72 6e 20 6a 51 75 65 72 79 2e 6d 65 72  eturn jQuery.mer
429e0 67 65 28 20 5b 5d 2c 20 70 61 72 73 65 64 2e 63  ge( [], parsed.c
429f0 68 69 6c 64 4e 6f 64 65 73 20 29 3b 0a 7d 3b 0a  hildNodes );.};.
42a00 0a 0a 2f 2a 2a 0a 20 2a 20 4c 6f 61 64 20 61 20  ../**. * Load a 
42a10 75 72 6c 20 69 6e 74 6f 20 61 20 70 61 67 65 0a  url into a page.
42a20 20 2a 2f 0a 6a 51 75 65 72 79 2e 66 6e 2e 6c 6f   */.jQuery.fn.lo
42a30 61 64 20 3d 20 66 75 6e 63 74 69 6f 6e 28 20 75  ad = function( u
42a40 72 6c 2c 20 70 61 72 61 6d 73 2c 20 63 61 6c 6c  rl, params, call
42a50 62 61 63 6b 20 29 20 7b 0a 09 76 61 72 20 73 65  back ) {..var se
42a60 6c 65 63 74 6f 72 2c 20 74 79 70 65 2c 20 72 65  lector, type, re
42a70 73 70 6f 6e 73 65 2c 0a 09 09 73 65 6c 66 20 3d  sponse,...self =
42a80 20 74 68 69 73 2c 0a 09 09 6f 66 66 20 3d 20 75   this,...off = u
42a90 72 6c 2e 69 6e 64 65 78 4f 66 28 20 22 20 22 20  rl.indexOf( " " 
42aa0 29 3b 0a 0a 09 69 66 20 28 20 6f 66 66 20 3e 20  );...if ( off > 
42ab0 2d 31 20 29 20 7b 0a 09 09 73 65 6c 65 63 74 6f  -1 ) {...selecto
42ac0 72 20 3d 20 73 74 72 69 70 41 6e 64 43 6f 6c 6c  r = stripAndColl
42ad0 61 70 73 65 28 20 75 72 6c 2e 73 6c 69 63 65 28  apse( url.slice(
42ae0 20 6f 66 66 20 29 20 29 3b 0a 09 09 75 72 6c 20   off ) );...url 
42af0 3d 20 75 72 6c 2e 73 6c 69 63 65 28 20 30 2c 20  = url.slice( 0, 
42b00 6f 66 66 20 29 3b 0a 09 7d 0a 0a 09 2f 2f 20 49  off );..}...// I
42b10 66 20 69 74 27 73 20 61 20 66 75 6e 63 74 69 6f  f it's a functio
42b20 6e 0a 09 69 66 20 28 20 69 73 46 75 6e 63 74 69  n..if ( isFuncti
42b30 6f 6e 28 20 70 61 72 61 6d 73 20 29 20 29 20 7b  on( params ) ) {
42b40 0a 0a 09 09 2f 2f 20 57 65 20 61 73 73 75 6d 65  ....// We assume
42b50 20 74 68 61 74 20 69 74 27 73 20 74 68 65 20 63   that it's the c
42b60 61 6c 6c 62 61 63 6b 0a 09 09 63 61 6c 6c 62 61  allback...callba
42b70 63 6b 20 3d 20 70 61 72 61 6d 73 3b 0a 09 09 70  ck = params;...p
42b80 61 72 61 6d 73 20 3d 20 75 6e 64 65 66 69 6e 65  arams = undefine
42b90 64 3b 0a 0a 09 2f 2f 20 4f 74 68 65 72 77 69 73  d;...// Otherwis
42ba0 65 2c 20 62 75 69 6c 64 20 61 20 70 61 72 61 6d  e, build a param
42bb0 20 73 74 72 69 6e 67 0a 09 7d 20 65 6c 73 65 20   string..} else 
42bc0 69 66 20 28 20 70 61 72 61 6d 73 20 26 26 20 74  if ( params && t
42bd0 79 70 65 6f 66 20 70 61 72 61 6d 73 20 3d 3d 3d  ypeof params ===
42be0 20 22 6f 62 6a 65 63 74 22 20 29 20 7b 0a 09 09   "object" ) {...
42bf0 74 79 70 65 20 3d 20 22 50 4f 53 54 22 3b 0a 09  type = "POST";..
42c00 7d 0a 0a 09 2f 2f 20 49 66 20 77 65 20 68 61 76  }...// If we hav
42c10 65 20 65 6c 65 6d 65 6e 74 73 20 74 6f 20 6d 6f  e elements to mo
42c20 64 69 66 79 2c 20 6d 61 6b 65 20 74 68 65 20 72  dify, make the r
42c30 65 71 75 65 73 74 0a 09 69 66 20 28 20 73 65 6c  equest..if ( sel
42c40 66 2e 6c 65 6e 67 74 68 20 3e 20 30 20 29 20 7b  f.length > 0 ) {
42c50 0a 09 09 6a 51 75 65 72 79 2e 61 6a 61 78 28 20  ...jQuery.ajax( 
42c60 7b 0a 09 09 09 75 72 6c 3a 20 75 72 6c 2c 0a 0a  {....url: url,..
42c70 09 09 09 2f 2f 20 49 66 20 22 74 79 70 65 22 20  ...// If "type" 
42c80 76 61 72 69 61 62 6c 65 20 69 73 20 75 6e 64 65  variable is unde
42c90 66 69 6e 65 64 2c 20 74 68 65 6e 20 22 47 45 54  fined, then "GET
42ca0 22 20 6d 65 74 68 6f 64 20 77 69 6c 6c 20 62 65  " method will be
42cb0 20 75 73 65 64 2e 0a 09 09 09 2f 2f 20 4d 61 6b   used.....// Mak
42cc0 65 20 76 61 6c 75 65 20 6f 66 20 74 68 69 73 20  e value of this 
42cd0 66 69 65 6c 64 20 65 78 70 6c 69 63 69 74 20 73  field explicit s
42ce0 69 6e 63 65 0a 09 09 09 2f 2f 20 75 73 65 72 20  ince....// user 
42cf0 63 61 6e 20 6f 76 65 72 72 69 64 65 20 69 74 20  can override it 
42d00 74 68 72 6f 75 67 68 20 61 6a 61 78 53 65 74 75  through ajaxSetu
42d10 70 20 6d 65 74 68 6f 64 0a 09 09 09 74 79 70 65  p method....type
42d20 3a 20 74 79 70 65 20 7c 7c 20 22 47 45 54 22 2c  : type || "GET",
42d30 0a 09 09 09 64 61 74 61 54 79 70 65 3a 20 22 68  ....dataType: "h
42d40 74 6d 6c 22 2c 0a 09 09 09 64 61 74 61 3a 20 70  tml",....data: p
42d50 61 72 61 6d 73 0a 09 09 7d 20 29 2e 64 6f 6e 65  arams...} ).done
42d60 28 20 66 75 6e 63 74 69 6f 6e 28 20 72 65 73 70  ( function( resp
42d70 6f 6e 73 65 54 65 78 74 20 29 20 7b 0a 0a 09 09  onseText ) {....
42d80 09 2f 2f 20 53 61 76 65 20 72 65 73 70 6f 6e 73  .// Save respons
42d90 65 20 66 6f 72 20 75 73 65 20 69 6e 20 63 6f 6d  e for use in com
42da0 70 6c 65 74 65 20 63 61 6c 6c 62 61 63 6b 0a 09  plete callback..
42db0 09 09 72 65 73 70 6f 6e 73 65 20 3d 20 61 72 67  ..response = arg
42dc0 75 6d 65 6e 74 73 3b 0a 0a 09 09 09 73 65 6c 66  uments;.....self
42dd0 2e 68 74 6d 6c 28 20 73 65 6c 65 63 74 6f 72 20  .html( selector 
42de0 3f 0a 0a 09 09 09 09 2f 2f 20 49 66 20 61 20 73  ?......// If a s
42df0 65 6c 65 63 74 6f 72 20 77 61 73 20 73 70 65 63  elector was spec
42e00 69 66 69 65 64 2c 20 6c 6f 63 61 74 65 20 74 68  ified, locate th
42e10 65 20 72 69 67 68 74 20 65 6c 65 6d 65 6e 74 73  e right elements
42e20 20 69 6e 20 61 20 64 75 6d 6d 79 20 64 69 76 0a   in a dummy div.
42e30 09 09 09 09 2f 2f 20 45 78 63 6c 75 64 65 20 73  ....// Exclude s
42e40 63 72 69 70 74 73 20 74 6f 20 61 76 6f 69 64 20  cripts to avoid 
42e50 49 45 20 27 50 65 72 6d 69 73 73 69 6f 6e 20 44  IE 'Permission D
42e60 65 6e 69 65 64 27 20 65 72 72 6f 72 73 0a 09 09  enied' errors...
42e70 09 09 6a 51 75 65 72 79 28 20 22 3c 64 69 76 3e  ..jQuery( "<div>
42e80 22 20 29 2e 61 70 70 65 6e 64 28 20 6a 51 75 65  " ).append( jQue
42e90 72 79 2e 70 61 72 73 65 48 54 4d 4c 28 20 72 65  ry.parseHTML( re
42ea0 73 70 6f 6e 73 65 54 65 78 74 20 29 20 29 2e 66  sponseText ) ).f
42eb0 69 6e 64 28 20 73 65 6c 65 63 74 6f 72 20 29 20  ind( selector ) 
42ec0 3a 0a 0a 09 09 09 09 2f 2f 20 4f 74 68 65 72 77  :......// Otherw
42ed0 69 73 65 20 75 73 65 20 74 68 65 20 66 75 6c 6c  ise use the full
42ee0 20 72 65 73 75 6c 74 0a 09 09 09 09 72 65 73 70   result.....resp
42ef0 6f 6e 73 65 54 65 78 74 20 29 3b 0a 0a 09 09 2f  onseText );..../
42f00 2f 20 49 66 20 74 68 65 20 72 65 71 75 65 73 74  / If the request
42f10 20 73 75 63 63 65 65 64 73 2c 20 74 68 69 73 20   succeeds, this 
42f20 66 75 6e 63 74 69 6f 6e 20 67 65 74 73 20 22 64  function gets "d
42f30 61 74 61 22 2c 20 22 73 74 61 74 75 73 22 2c 20  ata", "status", 
42f40 22 6a 71 58 48 52 22 0a 09 09 2f 2f 20 62 75 74  "jqXHR"...// but
42f50 20 74 68 65 79 20 61 72 65 20 69 67 6e 6f 72 65   they are ignore
42f60 64 20 62 65 63 61 75 73 65 20 72 65 73 70 6f 6e  d because respon
42f70 73 65 20 77 61 73 20 73 65 74 20 61 62 6f 76 65  se was set above
42f80 2e 0a 09 09 2f 2f 20 49 66 20 69 74 20 66 61 69  ....// If it fai
42f90 6c 73 2c 20 74 68 69 73 20 66 75 6e 63 74 69 6f  ls, this functio
42fa0 6e 20 67 65 74 73 20 22 6a 71 58 48 52 22 2c 20  n gets "jqXHR", 
42fb0 22 73 74 61 74 75 73 22 2c 20 22 65 72 72 6f 72  "status", "error
42fc0 22 0a 09 09 7d 20 29 2e 61 6c 77 61 79 73 28 20  "...} ).always( 
42fd0 63 61 6c 6c 62 61 63 6b 20 26 26 20 66 75 6e 63  callback && func
42fe0 74 69 6f 6e 28 20 6a 71 58 48 52 2c 20 73 74 61  tion( jqXHR, sta
42ff0 74 75 73 20 29 20 7b 0a 09 09 09 73 65 6c 66 2e  tus ) {....self.
43000 65 61 63 68 28 20 66 75 6e 63 74 69 6f 6e 28 29  each( function()
43010 20 7b 0a 09 09 09 09 63 61 6c 6c 62 61 63 6b 2e   {.....callback.
43020 61 70 70 6c 79 28 20 74 68 69 73 2c 20 72 65 73  apply( this, res
43030 70 6f 6e 73 65 20 7c 7c 20 5b 20 6a 71 58 48 52  ponse || [ jqXHR
43040 2e 72 65 73 70 6f 6e 73 65 54 65 78 74 2c 20 73  .responseText, s
43050 74 61 74 75 73 2c 20 6a 71 58 48 52 20 5d 20 29  tatus, jqXHR ] )
43060 3b 0a 09 09 09 7d 20 29 3b 0a 09 09 7d 20 29 3b  ;....} );...} );
43070 0a 09 7d 0a 0a 09 72 65 74 75 72 6e 20 74 68 69  ..}...return thi
43080 73 3b 0a 7d 3b 0a 0a 0a 0a 0a 6a 51 75 65 72 79  s;.};.....jQuery
43090 2e 65 78 70 72 2e 70 73 65 75 64 6f 73 2e 61 6e  .expr.pseudos.an
430a0 69 6d 61 74 65 64 20 3d 20 66 75 6e 63 74 69 6f  imated = functio
430b0 6e 28 20 65 6c 65 6d 20 29 20 7b 0a 09 72 65 74  n( elem ) {..ret
430c0 75 72 6e 20 6a 51 75 65 72 79 2e 67 72 65 70 28  urn jQuery.grep(
430d0 20 6a 51 75 65 72 79 2e 74 69 6d 65 72 73 2c 20   jQuery.timers, 
430e0 66 75 6e 63 74 69 6f 6e 28 20 66 6e 20 29 20 7b  function( fn ) {
430f0 0a 09 09 72 65 74 75 72 6e 20 65 6c 65 6d 20 3d  ...return elem =
43100 3d 3d 20 66 6e 2e 65 6c 65 6d 3b 0a 09 7d 20 29  == fn.elem;..} )
43110 2e 6c 65 6e 67 74 68 3b 0a 7d 3b 0a 0a 0a 0a 0a  .length;.};.....
43120 6a 51 75 65 72 79 2e 6f 66 66 73 65 74 20 3d 20  jQuery.offset = 
43130 7b 0a 09 73 65 74 4f 66 66 73 65 74 3a 20 66 75  {..setOffset: fu
43140 6e 63 74 69 6f 6e 28 20 65 6c 65 6d 2c 20 6f 70  nction( elem, op
43150 74 69 6f 6e 73 2c 20 69 20 29 20 7b 0a 09 09 76  tions, i ) {...v
43160 61 72 20 63 75 72 50 6f 73 69 74 69 6f 6e 2c 20  ar curPosition, 
43170 63 75 72 4c 65 66 74 2c 20 63 75 72 43 53 53 54  curLeft, curCSST
43180 6f 70 2c 20 63 75 72 54 6f 70 2c 20 63 75 72 4f  op, curTop, curO
43190 66 66 73 65 74 2c 20 63 75 72 43 53 53 4c 65 66  ffset, curCSSLef
431a0 74 2c 20 63 61 6c 63 75 6c 61 74 65 50 6f 73 69  t, calculatePosi
431b0 74 69 6f 6e 2c 0a 09 09 09 70 6f 73 69 74 69 6f  tion,....positio
431c0 6e 20 3d 20 6a 51 75 65 72 79 2e 63 73 73 28 20  n = jQuery.css( 
431d0 65 6c 65 6d 2c 20 22 70 6f 73 69 74 69 6f 6e 22  elem, "position"
431e0 20 29 2c 0a 09 09 09 63 75 72 45 6c 65 6d 20 3d   ),....curElem =
431f0 20 6a 51 75 65 72 79 28 20 65 6c 65 6d 20 29 2c   jQuery( elem ),
43200 0a 09 09 09 70 72 6f 70 73 20 3d 20 7b 7d 3b 0a  ....props = {};.
43210 0a 09 09 2f 2f 20 53 65 74 20 70 6f 73 69 74 69  ...// Set positi
43220 6f 6e 20 66 69 72 73 74 2c 20 69 6e 2d 63 61 73  on first, in-cas
43230 65 20 74 6f 70 2f 6c 65 66 74 20 61 72 65 20 73  e top/left are s
43240 65 74 20 65 76 65 6e 20 6f 6e 20 73 74 61 74 69  et even on stati
43250 63 20 65 6c 65 6d 0a 09 09 69 66 20 28 20 70 6f  c elem...if ( po
43260 73 69 74 69 6f 6e 20 3d 3d 3d 20 22 73 74 61 74  sition === "stat
43270 69 63 22 20 29 20 7b 0a 09 09 09 65 6c 65 6d 2e  ic" ) {....elem.
43280 73 74 79 6c 65 2e 70 6f 73 69 74 69 6f 6e 20 3d  style.position =
43290 20 22 72 65 6c 61 74 69 76 65 22 3b 0a 09 09 7d   "relative";...}
432a0 0a 0a 09 09 63 75 72 4f 66 66 73 65 74 20 3d 20  ....curOffset = 
432b0 63 75 72 45 6c 65 6d 2e 6f 66 66 73 65 74 28 29  curElem.offset()
432c0 3b 0a 09 09 63 75 72 43 53 53 54 6f 70 20 3d 20  ;...curCSSTop = 
432d0 6a 51 75 65 72 79 2e 63 73 73 28 20 65 6c 65 6d  jQuery.css( elem
432e0 2c 20 22 74 6f 70 22 20 29 3b 0a 09 09 63 75 72  , "top" );...cur
432f0 43 53 53 4c 65 66 74 20 3d 20 6a 51 75 65 72 79  CSSLeft = jQuery
43300 2e 63 73 73 28 20 65 6c 65 6d 2c 20 22 6c 65 66  .css( elem, "lef
43310 74 22 20 29 3b 0a 09 09 63 61 6c 63 75 6c 61 74  t" );...calculat
43320 65 50 6f 73 69 74 69 6f 6e 20 3d 20 28 20 70 6f  ePosition = ( po
43330 73 69 74 69 6f 6e 20 3d 3d 3d 20 22 61 62 73 6f  sition === "abso
43340 6c 75 74 65 22 20 7c 7c 20 70 6f 73 69 74 69 6f  lute" || positio
43350 6e 20 3d 3d 3d 20 22 66 69 78 65 64 22 20 29 20  n === "fixed" ) 
43360 26 26 0a 09 09 09 28 20 63 75 72 43 53 53 54 6f  &&....( curCSSTo
43370 70 20 2b 20 63 75 72 43 53 53 4c 65 66 74 20 29  p + curCSSLeft )
43380 2e 69 6e 64 65 78 4f 66 28 20 22 61 75 74 6f 22  .indexOf( "auto"
43390 20 29 20 3e 20 2d 31 3b 0a 0a 09 09 2f 2f 20 4e   ) > -1;....// N
433a0 65 65 64 20 74 6f 20 62 65 20 61 62 6c 65 20 74  eed to be able t
433b0 6f 20 63 61 6c 63 75 6c 61 74 65 20 70 6f 73 69  o calculate posi
433c0 74 69 6f 6e 20 69 66 20 65 69 74 68 65 72 0a 09  tion if either..
433d0 09 2f 2f 20 74 6f 70 20 6f 72 20 6c 65 66 74 20  .// top or left 
433e0 69 73 20 61 75 74 6f 20 61 6e 64 20 70 6f 73 69  is auto and posi
433f0 74 69 6f 6e 20 69 73 20 65 69 74 68 65 72 20 61  tion is either a
43400 62 73 6f 6c 75 74 65 20 6f 72 20 66 69 78 65 64  bsolute or fixed
43410 0a 09 09 69 66 20 28 20 63 61 6c 63 75 6c 61 74  ...if ( calculat
43420 65 50 6f 73 69 74 69 6f 6e 20 29 20 7b 0a 09 09  ePosition ) {...
43430 09 63 75 72 50 6f 73 69 74 69 6f 6e 20 3d 20 63  .curPosition = c
43440 75 72 45 6c 65 6d 2e 70 6f 73 69 74 69 6f 6e 28  urElem.position(
43450 29 3b 0a 09 09 09 63 75 72 54 6f 70 20 3d 20 63  );....curTop = c
43460 75 72 50 6f 73 69 74 69 6f 6e 2e 74 6f 70 3b 0a  urPosition.top;.
43470 09 09 09 63 75 72 4c 65 66 74 20 3d 20 63 75 72  ...curLeft = cur
43480 50 6f 73 69 74 69 6f 6e 2e 6c 65 66 74 3b 0a 0a  Position.left;..
43490 09 09 7d 20 65 6c 73 65 20 7b 0a 09 09 09 63 75  ..} else {....cu
434a0 72 54 6f 70 20 3d 20 70 61 72 73 65 46 6c 6f 61  rTop = parseFloa
434b0 74 28 20 63 75 72 43 53 53 54 6f 70 20 29 20 7c  t( curCSSTop ) |
434c0 7c 20 30 3b 0a 09 09 09 63 75 72 4c 65 66 74 20  | 0;....curLeft 
434d0 3d 20 70 61 72 73 65 46 6c 6f 61 74 28 20 63 75  = parseFloat( cu
434e0 72 43 53 53 4c 65 66 74 20 29 20 7c 7c 20 30 3b  rCSSLeft ) || 0;
434f0 0a 09 09 7d 0a 0a 09 09 69 66 20 28 20 69 73 46  ...}....if ( isF
43500 75 6e 63 74 69 6f 6e 28 20 6f 70 74 69 6f 6e 73  unction( options
43510 20 29 20 29 20 7b 0a 0a 09 09 09 2f 2f 20 55 73   ) ) {.....// Us
43520 65 20 6a 51 75 65 72 79 2e 65 78 74 65 6e 64 20  e jQuery.extend 
43530 68 65 72 65 20 74 6f 20 61 6c 6c 6f 77 20 6d 6f  here to allow mo
43540 64 69 66 69 63 61 74 69 6f 6e 20 6f 66 20 63 6f  dification of co
43550 6f 72 64 69 6e 61 74 65 73 20 61 72 67 75 6d 65  ordinates argume
43560 6e 74 20 28 67 68 2d 31 38 34 38 29 0a 09 09 09  nt (gh-1848)....
43570 6f 70 74 69 6f 6e 73 20 3d 20 6f 70 74 69 6f 6e  options = option
43580 73 2e 63 61 6c 6c 28 20 65 6c 65 6d 2c 20 69 2c  s.call( elem, i,
43590 20 6a 51 75 65 72 79 2e 65 78 74 65 6e 64 28 20   jQuery.extend( 
435a0 7b 7d 2c 20 63 75 72 4f 66 66 73 65 74 20 29 20  {}, curOffset ) 
435b0 29 3b 0a 09 09 7d 0a 0a 09 09 69 66 20 28 20 6f  );...}....if ( o
435c0 70 74 69 6f 6e 73 2e 74 6f 70 20 21 3d 20 6e 75  ptions.top != nu
435d0 6c 6c 20 29 20 7b 0a 09 09 09 70 72 6f 70 73 2e  ll ) {....props.
435e0 74 6f 70 20 3d 20 28 20 6f 70 74 69 6f 6e 73 2e  top = ( options.
435f0 74 6f 70 20 2d 20 63 75 72 4f 66 66 73 65 74 2e  top - curOffset.
43600 74 6f 70 20 29 20 2b 20 63 75 72 54 6f 70 3b 0a  top ) + curTop;.
43610 09 09 7d 0a 09 09 69 66 20 28 20 6f 70 74 69 6f  ..}...if ( optio
43620 6e 73 2e 6c 65 66 74 20 21 3d 20 6e 75 6c 6c 20  ns.left != null 
43630 29 20 7b 0a 09 09 09 70 72 6f 70 73 2e 6c 65 66  ) {....props.lef
43640 74 20 3d 20 28 20 6f 70 74 69 6f 6e 73 2e 6c 65  t = ( options.le
43650 66 74 20 2d 20 63 75 72 4f 66 66 73 65 74 2e 6c  ft - curOffset.l
43660 65 66 74 20 29 20 2b 20 63 75 72 4c 65 66 74 3b  eft ) + curLeft;
43670 0a 09 09 7d 0a 0a 09 09 69 66 20 28 20 22 75 73  ...}....if ( "us
43680 69 6e 67 22 20 69 6e 20 6f 70 74 69 6f 6e 73 20  ing" in options 
43690 29 20 7b 0a 09 09 09 6f 70 74 69 6f 6e 73 2e 75  ) {....options.u
436a0 73 69 6e 67 2e 63 61 6c 6c 28 20 65 6c 65 6d 2c  sing.call( elem,
436b0 20 70 72 6f 70 73 20 29 3b 0a 0a 09 09 7d 20 65   props );....} e
436c0 6c 73 65 20 7b 0a 09 09 09 69 66 20 28 20 74 79  lse {....if ( ty
436d0 70 65 6f 66 20 70 72 6f 70 73 2e 74 6f 70 20 3d  peof props.top =
436e0 3d 3d 20 22 6e 75 6d 62 65 72 22 20 29 20 7b 0a  == "number" ) {.
436f0 09 09 09 09 70 72 6f 70 73 2e 74 6f 70 20 2b 3d  ....props.top +=
43700 20 22 70 78 22 3b 0a 09 09 09 7d 0a 09 09 09 69   "px";....}....i
43710 66 20 28 20 74 79 70 65 6f 66 20 70 72 6f 70 73  f ( typeof props
43720 2e 6c 65 66 74 20 3d 3d 3d 20 22 6e 75 6d 62 65  .left === "numbe
43730 72 22 20 29 20 7b 0a 09 09 09 09 70 72 6f 70 73  r" ) {.....props
43740 2e 6c 65 66 74 20 2b 3d 20 22 70 78 22 3b 0a 09  .left += "px";..
43750 09 09 7d 0a 09 09 09 63 75 72 45 6c 65 6d 2e 63  ..}....curElem.c
43760 73 73 28 20 70 72 6f 70 73 20 29 3b 0a 09 09 7d  ss( props );...}
43770 0a 09 7d 0a 7d 3b 0a 0a 6a 51 75 65 72 79 2e 66  ..}.};..jQuery.f
43780 6e 2e 65 78 74 65 6e 64 28 20 7b 0a 0a 09 2f 2f  n.extend( {...//
43790 20 6f 66 66 73 65 74 28 29 20 72 65 6c 61 74 65   offset() relate
437a0 73 20 61 6e 20 65 6c 65 6d 65 6e 74 27 73 20 62  s an element's b
437b0 6f 72 64 65 72 20 62 6f 78 20 74 6f 20 74 68 65  order box to the
437c0 20 64 6f 63 75 6d 65 6e 74 20 6f 72 69 67 69 6e   document origin
437d0 0a 09 6f 66 66 73 65 74 3a 20 66 75 6e 63 74 69  ..offset: functi
437e0 6f 6e 28 20 6f 70 74 69 6f 6e 73 20 29 20 7b 0a  on( options ) {.
437f0 0a 09 09 2f 2f 20 50 72 65 73 65 72 76 65 20 63  ...// Preserve c
43800 68 61 69 6e 69 6e 67 20 66 6f 72 20 73 65 74 74  haining for sett
43810 65 72 0a 09 09 69 66 20 28 20 61 72 67 75 6d 65  er...if ( argume
43820 6e 74 73 2e 6c 65 6e 67 74 68 20 29 20 7b 0a 09  nts.length ) {..
43830 09 09 72 65 74 75 72 6e 20 6f 70 74 69 6f 6e 73  ..return options
43840 20 3d 3d 3d 20 75 6e 64 65 66 69 6e 65 64 20 3f   === undefined ?
43850 0a 09 09 09 09 74 68 69 73 20 3a 0a 09 09 09 09  .....this :.....
43860 74 68 69 73 2e 65 61 63 68 28 20 66 75 6e 63 74  this.each( funct
43870 69 6f 6e 28 20 69 20 29 20 7b 0a 09 09 09 09 09  ion( i ) {......
43880 6a 51 75 65 72 79 2e 6f 66 66 73 65 74 2e 73 65  jQuery.offset.se
43890 74 4f 66 66 73 65 74 28 20 74 68 69 73 2c 20 6f  tOffset( this, o
438a0 70 74 69 6f 6e 73 2c 20 69 20 29 3b 0a 09 09 09  ptions, i );....
438b0 09 7d 20 29 3b 0a 09 09 7d 0a 0a 09 09 76 61 72  .} );...}....var
438c0 20 72 65 63 74 2c 20 77 69 6e 2c 0a 09 09 09 65   rect, win,....e
438d0 6c 65 6d 20 3d 20 74 68 69 73 5b 20 30 20 5d 3b  lem = this[ 0 ];
438e0 0a 0a 09 09 69 66 20 28 20 21 65 6c 65 6d 20 29  ....if ( !elem )
438f0 20 7b 0a 09 09 09 72 65 74 75 72 6e 3b 0a 09 09   {....return;...
43900 7d 0a 0a 09 09 2f 2f 20 52 65 74 75 72 6e 20 7a  }....// Return z
43910 65 72 6f 73 20 66 6f 72 20 64 69 73 63 6f 6e 6e  eros for disconn
43920 65 63 74 65 64 20 61 6e 64 20 68 69 64 64 65 6e  ected and hidden
43930 20 28 64 69 73 70 6c 61 79 3a 20 6e 6f 6e 65 29   (display: none)
43940 20 65 6c 65 6d 65 6e 74 73 20 28 67 68 2d 32 33   elements (gh-23
43950 31 30 29 0a 09 09 2f 2f 20 53 75 70 70 6f 72 74  10)...// Support
43960 3a 20 49 45 20 3c 3d 31 31 20 6f 6e 6c 79 0a 09  : IE <=11 only..
43970 09 2f 2f 20 52 75 6e 6e 69 6e 67 20 67 65 74 42  .// Running getB
43980 6f 75 6e 64 69 6e 67 43 6c 69 65 6e 74 52 65 63  oundingClientRec
43990 74 20 6f 6e 20 61 0a 09 09 2f 2f 20 64 69 73 63  t on a...// disc
439a0 6f 6e 6e 65 63 74 65 64 20 6e 6f 64 65 20 69 6e  onnected node in
439b0 20 49 45 20 74 68 72 6f 77 73 20 61 6e 20 65 72   IE throws an er
439c0 72 6f 72 0a 09 09 69 66 20 28 20 21 65 6c 65 6d  ror...if ( !elem
439d0 2e 67 65 74 43 6c 69 65 6e 74 52 65 63 74 73 28  .getClientRects(
439e0 29 2e 6c 65 6e 67 74 68 20 29 20 7b 0a 09 09 09  ).length ) {....
439f0 72 65 74 75 72 6e 20 7b 20 74 6f 70 3a 20 30 2c  return { top: 0,
43a00 20 6c 65 66 74 3a 20 30 20 7d 3b 0a 09 09 7d 0a   left: 0 };...}.
43a10 0a 09 09 2f 2f 20 47 65 74 20 64 6f 63 75 6d 65  ...// Get docume
43a20 6e 74 2d 72 65 6c 61 74 69 76 65 20 70 6f 73 69  nt-relative posi
43a30 74 69 6f 6e 20 62 79 20 61 64 64 69 6e 67 20 76  tion by adding v
43a40 69 65 77 70 6f 72 74 20 73 63 72 6f 6c 6c 20 74  iewport scroll t
43a50 6f 20 76 69 65 77 70 6f 72 74 2d 72 65 6c 61 74  o viewport-relat
43a60 69 76 65 20 67 42 43 52 0a 09 09 72 65 63 74 20  ive gBCR...rect 
43a70 3d 20 65 6c 65 6d 2e 67 65 74 42 6f 75 6e 64 69  = elem.getBoundi
43a80 6e 67 43 6c 69 65 6e 74 52 65 63 74 28 29 3b 0a  ngClientRect();.
43a90 09 09 77 69 6e 20 3d 20 65 6c 65 6d 2e 6f 77 6e  ..win = elem.own
43aa0 65 72 44 6f 63 75 6d 65 6e 74 2e 64 65 66 61 75  erDocument.defau
43ab0 6c 74 56 69 65 77 3b 0a 09 09 72 65 74 75 72 6e  ltView;...return
43ac0 20 7b 0a 09 09 09 74 6f 70 3a 20 72 65 63 74 2e   {....top: rect.
43ad0 74 6f 70 20 2b 20 77 69 6e 2e 70 61 67 65 59 4f  top + win.pageYO
43ae0 66 66 73 65 74 2c 0a 09 09 09 6c 65 66 74 3a 20  ffset,....left: 
43af0 72 65 63 74 2e 6c 65 66 74 20 2b 20 77 69 6e 2e  rect.left + win.
43b00 70 61 67 65 58 4f 66 66 73 65 74 0a 09 09 7d 3b  pageXOffset...};
43b10 0a 09 7d 2c 0a 0a 09 2f 2f 20 70 6f 73 69 74 69  ..},...// positi
43b20 6f 6e 28 29 20 72 65 6c 61 74 65 73 20 61 6e 20  on() relates an 
43b30 65 6c 65 6d 65 6e 74 27 73 20 6d 61 72 67 69 6e  element's margin
43b40 20 62 6f 78 20 74 6f 20 69 74 73 20 6f 66 66 73   box to its offs
43b50 65 74 20 70 61 72 65 6e 74 27 73 20 70 61 64 64  et parent's padd
43b60 69 6e 67 20 62 6f 78 0a 09 2f 2f 20 54 68 69 73  ing box..// This
43b70 20 63 6f 72 72 65 73 70 6f 6e 64 73 20 74 6f 20   corresponds to 
43b80 74 68 65 20 62 65 68 61 76 69 6f 72 20 6f 66 20  the behavior of 
43b90 43 53 53 20 61 62 73 6f 6c 75 74 65 20 70 6f 73  CSS absolute pos
43ba0 69 74 69 6f 6e 69 6e 67 0a 09 70 6f 73 69 74 69  itioning..positi
43bb0 6f 6e 3a 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b  on: function() {
43bc0 0a 09 09 69 66 20 28 20 21 74 68 69 73 5b 20 30  ...if ( !this[ 0
43bd0 20 5d 20 29 20 7b 0a 09 09 09 72 65 74 75 72 6e   ] ) {....return
43be0 3b 0a 09 09 7d 0a 0a 09 09 76 61 72 20 6f 66 66  ;...}....var off
43bf0 73 65 74 50 61 72 65 6e 74 2c 20 6f 66 66 73 65  setParent, offse
43c00 74 2c 20 64 6f 63 2c 0a 09 09 09 65 6c 65 6d 20  t, doc,....elem 
43c10 3d 20 74 68 69 73 5b 20 30 20 5d 2c 0a 09 09 09  = this[ 0 ],....
43c20 70 61 72 65 6e 74 4f 66 66 73 65 74 20 3d 20 7b  parentOffset = {
43c30 20 74 6f 70 3a 20 30 2c 20 6c 65 66 74 3a 20 30   top: 0, left: 0
43c40 20 7d 3b 0a 0a 09 09 2f 2f 20 70 6f 73 69 74 69   };....// positi
43c50 6f 6e 3a 66 69 78 65 64 20 65 6c 65 6d 65 6e 74  on:fixed element
43c60 73 20 61 72 65 20 6f 66 66 73 65 74 20 66 72 6f  s are offset fro
43c70 6d 20 74 68 65 20 76 69 65 77 70 6f 72 74 2c 20  m the viewport, 
43c80 77 68 69 63 68 20 69 74 73 65 6c 66 20 61 6c 77  which itself alw
43c90 61 79 73 20 68 61 73 20 7a 65 72 6f 20 6f 66 66  ays has zero off
43ca0 73 65 74 0a 09 09 69 66 20 28 20 6a 51 75 65 72  set...if ( jQuer
43cb0 79 2e 63 73 73 28 20 65 6c 65 6d 2c 20 22 70 6f  y.css( elem, "po
43cc0 73 69 74 69 6f 6e 22 20 29 20 3d 3d 3d 20 22 66  sition" ) === "f
43cd0 69 78 65 64 22 20 29 20 7b 0a 0a 09 09 09 2f 2f  ixed" ) {.....//
43ce0 20 41 73 73 75 6d 65 20 70 6f 73 69 74 69 6f 6e   Assume position
43cf0 3a 66 69 78 65 64 20 69 6d 70 6c 69 65 73 20 61  :fixed implies a
43d00 76 61 69 6c 61 62 69 6c 69 74 79 20 6f 66 20 67  vailability of g
43d10 65 74 42 6f 75 6e 64 69 6e 67 43 6c 69 65 6e 74  etBoundingClient
43d20 52 65 63 74 0a 09 09 09 6f 66 66 73 65 74 20 3d  Rect....offset =
43d30 20 65 6c 65 6d 2e 67 65 74 42 6f 75 6e 64 69 6e   elem.getBoundin
43d40 67 43 6c 69 65 6e 74 52 65 63 74 28 29 3b 0a 0a  gClientRect();..
43d50 09 09 7d 20 65 6c 73 65 20 7b 0a 09 09 09 6f 66  ..} else {....of
43d60 66 73 65 74 20 3d 20 74 68 69 73 2e 6f 66 66 73  fset = this.offs
43d70 65 74 28 29 3b 0a 0a 09 09 09 2f 2f 20 41 63 63  et();.....// Acc
43d80 6f 75 6e 74 20 66 6f 72 20 74 68 65 20 2a 72 65  ount for the *re
43d90 61 6c 2a 20 6f 66 66 73 65 74 20 70 61 72 65 6e  al* offset paren
43da0 74 2c 20 77 68 69 63 68 20 63 61 6e 20 62 65 20  t, which can be 
43db0 74 68 65 20 64 6f 63 75 6d 65 6e 74 20 6f 72 20  the document or 
43dc0 69 74 73 20 72 6f 6f 74 20 65 6c 65 6d 65 6e 74  its root element
43dd0 0a 09 09 09 2f 2f 20 77 68 65 6e 20 61 20 73 74  ....// when a st
43de0 61 74 69 63 61 6c 6c 79 20 70 6f 73 69 74 69 6f  atically positio
43df0 6e 65 64 20 65 6c 65 6d 65 6e 74 20 69 73 20 69  ned element is i
43e00 64 65 6e 74 69 66 69 65 64 0a 09 09 09 64 6f 63  dentified....doc
43e10 20 3d 20 65 6c 65 6d 2e 6f 77 6e 65 72 44 6f 63   = elem.ownerDoc
43e20 75 6d 65 6e 74 3b 0a 09 09 09 6f 66 66 73 65 74  ument;....offset
43e30 50 61 72 65 6e 74 20 3d 20 65 6c 65 6d 2e 6f 66  Parent = elem.of
43e40 66 73 65 74 50 61 72 65 6e 74 20 7c 7c 20 64 6f  fsetParent || do
43e50 63 2e 64 6f 63 75 6d 65 6e 74 45 6c 65 6d 65 6e  c.documentElemen
43e60 74 3b 0a 09 09 09 77 68 69 6c 65 20 28 20 6f 66  t;....while ( of
43e70 66 73 65 74 50 61 72 65 6e 74 20 26 26 0a 09 09  fsetParent &&...
43e80 09 09 28 20 6f 66 66 73 65 74 50 61 72 65 6e 74  ..( offsetParent
43e90 20 3d 3d 3d 20 64 6f 63 2e 62 6f 64 79 20 7c 7c   === doc.body ||
43ea0 20 6f 66 66 73 65 74 50 61 72 65 6e 74 20 3d 3d   offsetParent ==
43eb0 3d 20 64 6f 63 2e 64 6f 63 75 6d 65 6e 74 45 6c  = doc.documentEl
43ec0 65 6d 65 6e 74 20 29 20 26 26 0a 09 09 09 09 6a  ement ) &&.....j
43ed0 51 75 65 72 79 2e 63 73 73 28 20 6f 66 66 73 65  Query.css( offse
43ee0 74 50 61 72 65 6e 74 2c 20 22 70 6f 73 69 74 69  tParent, "positi
43ef0 6f 6e 22 20 29 20 3d 3d 3d 20 22 73 74 61 74 69  on" ) === "stati
43f00 63 22 20 29 20 7b 0a 0a 09 09 09 09 6f 66 66 73  c" ) {......offs
43f10 65 74 50 61 72 65 6e 74 20 3d 20 6f 66 66 73 65  etParent = offse
43f20 74 50 61 72 65 6e 74 2e 70 61 72 65 6e 74 4e 6f  tParent.parentNo
43f30 64 65 3b 0a 09 09 09 7d 0a 09 09 09 69 66 20 28  de;....}....if (
43f40 20 6f 66 66 73 65 74 50 61 72 65 6e 74 20 26 26   offsetParent &&
43f50 20 6f 66 66 73 65 74 50 61 72 65 6e 74 20 21 3d   offsetParent !=
43f60 3d 20 65 6c 65 6d 20 26 26 20 6f 66 66 73 65 74  = elem && offset
43f70 50 61 72 65 6e 74 2e 6e 6f 64 65 54 79 70 65 20  Parent.nodeType 
43f80 3d 3d 3d 20 31 20 29 20 7b 0a 0a 09 09 09 09 2f  === 1 ) {....../
43f90 2f 20 49 6e 63 6f 72 70 6f 72 61 74 65 20 62 6f  / Incorporate bo
43fa0 72 64 65 72 73 20 69 6e 74 6f 20 69 74 73 20 6f  rders into its o
43fb0 66 66 73 65 74 2c 20 73 69 6e 63 65 20 74 68 65  ffset, since the
43fc0 79 20 61 72 65 20 6f 75 74 73 69 64 65 20 69 74  y are outside it
43fd0 73 20 63 6f 6e 74 65 6e 74 20 6f 72 69 67 69 6e  s content origin
43fe0 0a 09 09 09 09 70 61 72 65 6e 74 4f 66 66 73 65  .....parentOffse
43ff0 74 20 3d 20 6a 51 75 65 72 79 28 20 6f 66 66 73  t = jQuery( offs
44000 65 74 50 61 72 65 6e 74 20 29 2e 6f 66 66 73 65  etParent ).offse
44010 74 28 29 3b 0a 09 09 09 09 70 61 72 65 6e 74 4f  t();.....parentO
44020 66 66 73 65 74 2e 74 6f 70 20 2b 3d 20 6a 51 75  ffset.top += jQu
44030 65 72 79 2e 63 73 73 28 20 6f 66 66 73 65 74 50  ery.css( offsetP
44040 61 72 65 6e 74 2c 20 22 62 6f 72 64 65 72 54 6f  arent, "borderTo
44050 70 57 69 64 74 68 22 2c 20 74 72 75 65 20 29 3b  pWidth", true );
44060 0a 09 09 09 09 70 61 72 65 6e 74 4f 66 66 73 65  .....parentOffse
44070 74 2e 6c 65 66 74 20 2b 3d 20 6a 51 75 65 72 79  t.left += jQuery
44080 2e 63 73 73 28 20 6f 66 66 73 65 74 50 61 72 65  .css( offsetPare
44090 6e 74 2c 20 22 62 6f 72 64 65 72 4c 65 66 74 57  nt, "borderLeftW
440a0 69 64 74 68 22 2c 20 74 72 75 65 20 29 3b 0a 09  idth", true );..
440b0 09 09 7d 0a 09 09 7d 0a 0a 09 09 2f 2f 20 53 75  ..}...}....// Su
440c0 62 74 72 61 63 74 20 70 61 72 65 6e 74 20 6f 66  btract parent of
440d0 66 73 65 74 73 20 61 6e 64 20 65 6c 65 6d 65 6e  fsets and elemen
440e0 74 20 6d 61 72 67 69 6e 73 0a 09 09 72 65 74 75  t margins...retu
440f0 72 6e 20 7b 0a 09 09 09 74 6f 70 3a 20 6f 66 66  rn {....top: off
44100 73 65 74 2e 74 6f 70 20 2d 20 70 61 72 65 6e 74  set.top - parent
44110 4f 66 66 73 65 74 2e 74 6f 70 20 2d 20 6a 51 75  Offset.top - jQu
44120 65 72 79 2e 63 73 73 28 20 65 6c 65 6d 2c 20 22  ery.css( elem, "
44130 6d 61 72 67 69 6e 54 6f 70 22 2c 20 74 72 75 65  marginTop", true
44140 20 29 2c 0a 09 09 09 6c 65 66 74 3a 20 6f 66 66   ),....left: off
44150 73 65 74 2e 6c 65 66 74 20 2d 20 70 61 72 65 6e  set.left - paren
44160 74 4f 66 66 73 65 74 2e 6c 65 66 74 20 2d 20 6a  tOffset.left - j
44170 51 75 65 72 79 2e 63 73 73 28 20 65 6c 65 6d 2c  Query.css( elem,
44180 20 22 6d 61 72 67 69 6e 4c 65 66 74 22 2c 20 74   "marginLeft", t
44190 72 75 65 20 29 0a 09 09 7d 3b 0a 09 7d 2c 0a 0a  rue )...};..},..
441a0 09 2f 2f 20 54 68 69 73 20 6d 65 74 68 6f 64 20  .// This method 
441b0 77 69 6c 6c 20 72 65 74 75 72 6e 20 64 6f 63 75  will return docu
441c0 6d 65 6e 74 45 6c 65 6d 65 6e 74 20 69 6e 20 74  mentElement in t
441d0 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 63 61 73  he following cas
441e0 65 73 3a 0a 09 2f 2f 20 31 29 20 46 6f 72 20 74  es:..// 1) For t
441f0 68 65 20 65 6c 65 6d 65 6e 74 20 69 6e 73 69 64  he element insid
44200 65 20 74 68 65 20 69 66 72 61 6d 65 20 77 69 74  e the iframe wit
44210 68 6f 75 74 20 6f 66 66 73 65 74 50 61 72 65 6e  hout offsetParen
44220 74 2c 20 74 68 69 73 20 6d 65 74 68 6f 64 20 77  t, this method w
44230 69 6c 6c 20 72 65 74 75 72 6e 0a 09 2f 2f 20 20  ill return..//  
44240 20 20 64 6f 63 75 6d 65 6e 74 45 6c 65 6d 65 6e    documentElemen
44250 74 20 6f 66 20 74 68 65 20 70 61 72 65 6e 74 20  t of the parent 
44260 77 69 6e 64 6f 77 0a 09 2f 2f 20 32 29 20 46 6f  window..// 2) Fo
44270 72 20 74 68 65 20 68 69 64 64 65 6e 20 6f 72 20  r the hidden or 
44280 64 65 74 61 63 68 65 64 20 65 6c 65 6d 65 6e 74  detached element
44290 0a 09 2f 2f 20 33 29 20 46 6f 72 20 62 6f 64 79  ..// 3) For body
442a0 20 6f 72 20 68 74 6d 6c 20 65 6c 65 6d 65 6e 74   or html element
442b0 2c 20 69 2e 65 2e 20 69 6e 20 63 61 73 65 20 6f  , i.e. in case o
442c0 66 20 74 68 65 20 68 74 6d 6c 20 6e 6f 64 65 20  f the html node 
442d0 2d 20 69 74 20 77 69 6c 6c 20 72 65 74 75 72 6e  - it will return
442e0 20 69 74 73 65 6c 66 0a 09 2f 2f 0a 09 2f 2f 20   itself..//..// 
442f0 62 75 74 20 74 68 6f 73 65 20 65 78 63 65 70 74  but those except
44300 69 6f 6e 73 20 77 65 72 65 20 6e 65 76 65 72 20  ions were never 
44310 70 72 65 73 65 6e 74 65 64 20 61 73 20 61 20 72  presented as a r
44320 65 61 6c 20 6c 69 66 65 20 75 73 65 2d 63 61 73  eal life use-cas
44330 65 73 0a 09 2f 2f 20 61 6e 64 20 6d 69 67 68 74  es..// and might
44340 20 62 65 20 63 6f 6e 73 69 64 65 72 65 64 20 61   be considered a
44350 73 20 6d 6f 72 65 20 70 72 65 66 65 72 61 62 6c  s more preferabl
44360 65 20 72 65 73 75 6c 74 73 2e 0a 09 2f 2f 0a 09  e results...//..
44370 2f 2f 20 54 68 69 73 20 6c 6f 67 69 63 2c 20 68  // This logic, h
44380 6f 77 65 76 65 72 2c 20 69 73 20 6e 6f 74 20 67  owever, is not g
44390 75 61 72 61 6e 74 65 65 64 20 61 6e 64 20 63 61  uaranteed and ca
443a0 6e 20 63 68 61 6e 67 65 20 61 74 20 61 6e 79 20  n change at any 
443b0 70 6f 69 6e 74 20 69 6e 20 74 68 65 20 66 75 74  point in the fut
443c0 75 72 65 0a 09 6f 66 66 73 65 74 50 61 72 65 6e  ure..offsetParen
443d0 74 3a 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a  t: function() {.
443e0 09 09 72 65 74 75 72 6e 20 74 68 69 73 2e 6d 61  ..return this.ma
443f0 70 28 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a  p( function() {.
44400 09 09 09 76 61 72 20 6f 66 66 73 65 74 50 61 72  ...var offsetPar
44410 65 6e 74 20 3d 20 74 68 69 73 2e 6f 66 66 73 65  ent = this.offse
44420 74 50 61 72 65 6e 74 3b 0a 0a 09 09 09 77 68 69  tParent;.....whi
44430 6c 65 20 28 20 6f 66 66 73 65 74 50 61 72 65 6e  le ( offsetParen
44440 74 20 26 26 20 6a 51 75 65 72 79 2e 63 73 73 28  t && jQuery.css(
44450 20 6f 66 66 73 65 74 50 61 72 65 6e 74 2c 20 22   offsetParent, "
44460 70 6f 73 69 74 69 6f 6e 22 20 29 20 3d 3d 3d 20  position" ) === 
44470 22 73 74 61 74 69 63 22 20 29 20 7b 0a 09 09 09  "static" ) {....
44480 09 6f 66 66 73 65 74 50 61 72 65 6e 74 20 3d 20  .offsetParent = 
44490 6f 66 66 73 65 74 50 61 72 65 6e 74 2e 6f 66 66  offsetParent.off
444a0 73 65 74 50 61 72 65 6e 74 3b 0a 09 09 09 7d 0a  setParent;....}.
444b0 0a 09 09 09 72 65 74 75 72 6e 20 6f 66 66 73 65  ....return offse
444c0 74 50 61 72 65 6e 74 20 7c 7c 20 64 6f 63 75 6d  tParent || docum
444d0 65 6e 74 45 6c 65 6d 65 6e 74 3b 0a 09 09 7d 20  entElement;...} 
444e0 29 3b 0a 09 7d 0a 7d 20 29 3b 0a 0a 2f 2f 20 43  );..}.} );..// C
444f0 72 65 61 74 65 20 73 63 72 6f 6c 6c 4c 65 66 74  reate scrollLeft
44500 20 61 6e 64 20 73 63 72 6f 6c 6c 54 6f 70 20 6d   and scrollTop m
44510 65 74 68 6f 64 73 0a 6a 51 75 65 72 79 2e 65 61  ethods.jQuery.ea
44520 63 68 28 20 7b 20 73 63 72 6f 6c 6c 4c 65 66 74  ch( { scrollLeft
44530 3a 20 22 70 61 67 65 58 4f 66 66 73 65 74 22 2c  : "pageXOffset",
44540 20 73 63 72 6f 6c 6c 54 6f 70 3a 20 22 70 61 67   scrollTop: "pag
44550 65 59 4f 66 66 73 65 74 22 20 7d 2c 20 66 75 6e  eYOffset" }, fun
44560 63 74 69 6f 6e 28 20 6d 65 74 68 6f 64 2c 20 70  ction( method, p
44570 72 6f 70 20 29 20 7b 0a 09 76 61 72 20 74 6f 70  rop ) {..var top
44580 20 3d 20 22 70 61 67 65 59 4f 66 66 73 65 74 22   = "pageYOffset"
44590 20 3d 3d 3d 20 70 72 6f 70 3b 0a 0a 09 6a 51 75   === prop;...jQu
445a0 65 72 79 2e 66 6e 5b 20 6d 65 74 68 6f 64 20 5d  ery.fn[ method ]
445b0 20 3d 20 66 75 6e 63 74 69 6f 6e 28 20 76 61 6c   = function( val
445c0 20 29 20 7b 0a 09 09 72 65 74 75 72 6e 20 61 63   ) {...return ac
445d0 63 65 73 73 28 20 74 68 69 73 2c 20 66 75 6e 63  cess( this, func
445e0 74 69 6f 6e 28 20 65 6c 65 6d 2c 20 6d 65 74 68  tion( elem, meth
445f0 6f 64 2c 20 76 61 6c 20 29 20 7b 0a 0a 09 09 09  od, val ) {.....
44600 2f 2f 20 43 6f 61 6c 65 73 63 65 20 64 6f 63 75  // Coalesce docu
44610 6d 65 6e 74 73 20 61 6e 64 20 77 69 6e 64 6f 77  ments and window
44620 73 0a 09 09 09 76 61 72 20 77 69 6e 3b 0a 09 09  s....var win;...
44630 09 69 66 20 28 20 69 73 57 69 6e 64 6f 77 28 20  .if ( isWindow( 
44640 65 6c 65 6d 20 29 20 29 20 7b 0a 09 09 09 09 77  elem ) ) {.....w
44650 69 6e 20 3d 20 65 6c 65 6d 3b 0a 09 09 09 7d 20  in = elem;....} 
44660 65 6c 73 65 20 69 66 20 28 20 65 6c 65 6d 2e 6e  else if ( elem.n
44670 6f 64 65 54 79 70 65 20 3d 3d 3d 20 39 20 29 20  odeType === 9 ) 
44680 7b 0a 09 09 09 09 77 69 6e 20 3d 20 65 6c 65 6d  {.....win = elem
44690 2e 64 65 66 61 75 6c 74 56 69 65 77 3b 0a 09 09  .defaultView;...
446a0 09 7d 0a 0a 09 09 09 69 66 20 28 20 76 61 6c 20  .}.....if ( val 
446b0 3d 3d 3d 20 75 6e 64 65 66 69 6e 65 64 20 29 20  === undefined ) 
446c0 7b 0a 09 09 09 09 72 65 74 75 72 6e 20 77 69 6e  {.....return win
446d0 20 3f 20 77 69 6e 5b 20 70 72 6f 70 20 5d 20 3a   ? win[ prop ] :
446e0 20 65 6c 65 6d 5b 20 6d 65 74 68 6f 64 20 5d 3b   elem[ method ];
446f0 0a 09 09 09 7d 0a 0a 09 09 09 69 66 20 28 20 77  ....}.....if ( w
44700 69 6e 20 29 20 7b 0a 09 09 09 09 77 69 6e 2e 73  in ) {.....win.s
44710 63 72 6f 6c 6c 54 6f 28 0a 09 09 09 09 09 21 74  crollTo(......!t
44720 6f 70 20 3f 20 76 61 6c 20 3a 20 77 69 6e 2e 70  op ? val : win.p
44730 61 67 65 58 4f 66 66 73 65 74 2c 0a 09 09 09 09  ageXOffset,.....
44740 09 74 6f 70 20 3f 20 76 61 6c 20 3a 20 77 69 6e  .top ? val : win
44750 2e 70 61 67 65 59 4f 66 66 73 65 74 0a 09 09 09  .pageYOffset....
44760 09 29 3b 0a 0a 09 09 09 7d 20 65 6c 73 65 20 7b  .);.....} else {
44770 0a 09 09 09 09 65 6c 65 6d 5b 20 6d 65 74 68 6f  .....elem[ metho
44780 64 20 5d 20 3d 20 76 61 6c 3b 0a 09 09 09 7d 0a  d ] = val;....}.
44790 09 09 7d 2c 20 6d 65 74 68 6f 64 2c 20 76 61 6c  ..}, method, val
447a0 2c 20 61 72 67 75 6d 65 6e 74 73 2e 6c 65 6e 67  , arguments.leng
447b0 74 68 20 29 3b 0a 09 7d 3b 0a 7d 20 29 3b 0a 0a  th );..};.} );..
447c0 2f 2f 20 53 75 70 70 6f 72 74 3a 20 53 61 66 61  // Support: Safa
447d0 72 69 20 3c 3d 37 20 2d 20 39 2e 31 2c 20 43 68  ri <=7 - 9.1, Ch
447e0 72 6f 6d 65 20 3c 3d 33 37 20 2d 20 34 39 0a 2f  rome <=37 - 49./
447f0 2f 20 41 64 64 20 74 68 65 20 74 6f 70 2f 6c 65  / Add the top/le
44800 66 74 20 63 73 73 48 6f 6f 6b 73 20 75 73 69 6e  ft cssHooks usin
44810 67 20 6a 51 75 65 72 79 2e 66 6e 2e 70 6f 73 69  g jQuery.fn.posi
44820 74 69 6f 6e 0a 2f 2f 20 57 65 62 6b 69 74 20 62  tion.// Webkit b
44830 75 67 3a 20 68 74 74 70 73 3a 2f 2f 62 75 67 73  ug: https://bugs
44840 2e 77 65 62 6b 69 74 2e 6f 72 67 2f 73 68 6f 77  .webkit.org/show
44850 5f 62 75 67 2e 63 67 69 3f 69 64 3d 32 39 30 38  _bug.cgi?id=2908
44860 34 0a 2f 2f 20 42 6c 69 6e 6b 20 62 75 67 3a 20  4.// Blink bug: 
44870 68 74 74 70 73 3a 2f 2f 62 75 67 73 2e 63 68 72  https://bugs.chr
44880 6f 6d 69 75 6d 2e 6f 72 67 2f 70 2f 63 68 72 6f  omium.org/p/chro
44890 6d 69 75 6d 2f 69 73 73 75 65 73 2f 64 65 74 61  mium/issues/deta
448a0 69 6c 3f 69 64 3d 35 38 39 33 34 37 0a 2f 2f 20  il?id=589347.// 
448b0 67 65 74 43 6f 6d 70 75 74 65 64 53 74 79 6c 65  getComputedStyle
448c0 20 72 65 74 75 72 6e 73 20 70 65 72 63 65 6e 74   returns percent
448d0 20 77 68 65 6e 20 73 70 65 63 69 66 69 65 64 20   when specified 
448e0 66 6f 72 20 74 6f 70 2f 6c 65 66 74 2f 62 6f 74  for top/left/bot
448f0 74 6f 6d 2f 72 69 67 68 74 3b 0a 2f 2f 20 72 61  tom/right;.// ra
44900 74 68 65 72 20 74 68 61 6e 20 6d 61 6b 65 20 74  ther than make t
44910 68 65 20 63 73 73 20 6d 6f 64 75 6c 65 20 64 65  he css module de
44920 70 65 6e 64 20 6f 6e 20 74 68 65 20 6f 66 66 73  pend on the offs
44930 65 74 20 6d 6f 64 75 6c 65 2c 20 6a 75 73 74 20  et module, just 
44940 63 68 65 63 6b 20 66 6f 72 20 69 74 20 68 65 72  check for it her
44950 65 0a 6a 51 75 65 72 79 2e 65 61 63 68 28 20 5b  e.jQuery.each( [
44960 20 22 74 6f 70 22 2c 20 22 6c 65 66 74 22 20 5d   "top", "left" ]
44970 2c 20 66 75 6e 63 74 69 6f 6e 28 20 5f 69 2c 20  , function( _i, 
44980 70 72 6f 70 20 29 20 7b 0a 09 6a 51 75 65 72 79  prop ) {..jQuery
44990 2e 63 73 73 48 6f 6f 6b 73 5b 20 70 72 6f 70 20  .cssHooks[ prop 
449a0 5d 20 3d 20 61 64 64 47 65 74 48 6f 6f 6b 49 66  ] = addGetHookIf
449b0 28 20 73 75 70 70 6f 72 74 2e 70 69 78 65 6c 50  ( support.pixelP
449c0 6f 73 69 74 69 6f 6e 2c 0a 09 09 66 75 6e 63 74  osition,...funct
449d0 69 6f 6e 28 20 65 6c 65 6d 2c 20 63 6f 6d 70 75  ion( elem, compu
449e0 74 65 64 20 29 20 7b 0a 09 09 09 69 66 20 28 20  ted ) {....if ( 
449f0 63 6f 6d 70 75 74 65 64 20 29 20 7b 0a 09 09 09  computed ) {....
44a00 09 63 6f 6d 70 75 74 65 64 20 3d 20 63 75 72 43  .computed = curC
44a10 53 53 28 20 65 6c 65 6d 2c 20 70 72 6f 70 20 29  SS( elem, prop )
44a20 3b 0a 0a 09 09 09 09 2f 2f 20 49 66 20 63 75 72  ;......// If cur
44a30 43 53 53 20 72 65 74 75 72 6e 73 20 70 65 72 63  CSS returns perc
44a40 65 6e 74 61 67 65 2c 20 66 61 6c 6c 62 61 63 6b  entage, fallback
44a50 20 74 6f 20 6f 66 66 73 65 74 0a 09 09 09 09 72   to offset.....r
44a60 65 74 75 72 6e 20 72 6e 75 6d 6e 6f 6e 70 78 2e  eturn rnumnonpx.
44a70 74 65 73 74 28 20 63 6f 6d 70 75 74 65 64 20 29  test( computed )
44a80 20 3f 0a 09 09 09 09 09 6a 51 75 65 72 79 28 20   ?......jQuery( 
44a90 65 6c 65 6d 20 29 2e 70 6f 73 69 74 69 6f 6e 28  elem ).position(
44aa0 29 5b 20 70 72 6f 70 20 5d 20 2b 20 22 70 78 22  )[ prop ] + "px"
44ab0 20 3a 0a 09 09 09 09 09 63 6f 6d 70 75 74 65 64   :......computed
44ac0 3b 0a 09 09 09 7d 0a 09 09 7d 0a 09 29 3b 0a 7d  ;....}...}..);.}
44ad0 20 29 3b 0a 0a 0a 2f 2f 20 43 72 65 61 74 65 20   );...// Create 
44ae0 69 6e 6e 65 72 48 65 69 67 68 74 2c 20 69 6e 6e  innerHeight, inn
44af0 65 72 57 69 64 74 68 2c 20 68 65 69 67 68 74 2c  erWidth, height,
44b00 20 77 69 64 74 68 2c 20 6f 75 74 65 72 48 65 69   width, outerHei
44b10 67 68 74 20 61 6e 64 20 6f 75 74 65 72 57 69 64  ght and outerWid
44b20 74 68 20 6d 65 74 68 6f 64 73 0a 6a 51 75 65 72  th methods.jQuer
44b30 79 2e 65 61 63 68 28 20 7b 20 48 65 69 67 68 74  y.each( { Height
44b40 3a 20 22 68 65 69 67 68 74 22 2c 20 57 69 64 74  : "height", Widt
44b50 68 3a 20 22 77 69 64 74 68 22 20 7d 2c 20 66 75  h: "width" }, fu
44b60 6e 63 74 69 6f 6e 28 20 6e 61 6d 65 2c 20 74 79  nction( name, ty
44b70 70 65 20 29 20 7b 0a 09 6a 51 75 65 72 79 2e 65  pe ) {..jQuery.e
44b80 61 63 68 28 20 7b 20 70 61 64 64 69 6e 67 3a 20  ach( { padding: 
44b90 22 69 6e 6e 65 72 22 20 2b 20 6e 61 6d 65 2c 20  "inner" + name, 
44ba0 63 6f 6e 74 65 6e 74 3a 20 74 79 70 65 2c 20 22  content: type, "
44bb0 22 3a 20 22 6f 75 74 65 72 22 20 2b 20 6e 61 6d  ": "outer" + nam
44bc0 65 20 7d 2c 0a 09 09 66 75 6e 63 74 69 6f 6e 28  e },...function(
44bd0 20 64 65 66 61 75 6c 74 45 78 74 72 61 2c 20 66   defaultExtra, f
44be0 75 6e 63 4e 61 6d 65 20 29 20 7b 0a 0a 09 09 2f  uncName ) {..../
44bf0 2f 20 4d 61 72 67 69 6e 20 69 73 20 6f 6e 6c 79  / Margin is only
44c00 20 66 6f 72 20 6f 75 74 65 72 48 65 69 67 68 74   for outerHeight
44c10 2c 20 6f 75 74 65 72 57 69 64 74 68 0a 09 09 6a  , outerWidth...j
44c20 51 75 65 72 79 2e 66 6e 5b 20 66 75 6e 63 4e 61  Query.fn[ funcNa
44c30 6d 65 20 5d 20 3d 20 66 75 6e 63 74 69 6f 6e 28  me ] = function(
44c40 20 6d 61 72 67 69 6e 2c 20 76 61 6c 75 65 20 29   margin, value )
44c50 20 7b 0a 09 09 09 76 61 72 20 63 68 61 69 6e 61   {....var chaina
44c60 62 6c 65 20 3d 20 61 72 67 75 6d 65 6e 74 73 2e  ble = arguments.
44c70 6c 65 6e 67 74 68 20 26 26 20 28 20 64 65 66 61  length && ( defa
44c80 75 6c 74 45 78 74 72 61 20 7c 7c 20 74 79 70 65  ultExtra || type
44c90 6f 66 20 6d 61 72 67 69 6e 20 21 3d 3d 20 22 62  of margin !== "b
44ca0 6f 6f 6c 65 61 6e 22 20 29 2c 0a 09 09 09 09 65  oolean" ),.....e
44cb0 78 74 72 61 20 3d 20 64 65 66 61 75 6c 74 45 78  xtra = defaultEx
44cc0 74 72 61 20 7c 7c 20 28 20 6d 61 72 67 69 6e 20  tra || ( margin 
44cd0 3d 3d 3d 20 74 72 75 65 20 7c 7c 20 76 61 6c 75  === true || valu
44ce0 65 20 3d 3d 3d 20 74 72 75 65 20 3f 20 22 6d 61  e === true ? "ma
44cf0 72 67 69 6e 22 20 3a 20 22 62 6f 72 64 65 72 22  rgin" : "border"
44d00 20 29 3b 0a 0a 09 09 09 72 65 74 75 72 6e 20 61   );.....return a
44d10 63 63 65 73 73 28 20 74 68 69 73 2c 20 66 75 6e  ccess( this, fun
44d20 63 74 69 6f 6e 28 20 65 6c 65 6d 2c 20 74 79 70  ction( elem, typ
44d30 65 2c 20 76 61 6c 75 65 20 29 20 7b 0a 09 09 09  e, value ) {....
44d40 09 76 61 72 20 64 6f 63 3b 0a 0a 09 09 09 09 69  .var doc;......i
44d50 66 20 28 20 69 73 57 69 6e 64 6f 77 28 20 65 6c  f ( isWindow( el
44d60 65 6d 20 29 20 29 20 7b 0a 0a 09 09 09 09 09 2f  em ) ) {......./
44d70 2f 20 24 28 20 77 69 6e 64 6f 77 20 29 2e 6f 75  / $( window ).ou
44d80 74 65 72 57 69 64 74 68 2f 48 65 69 67 68 74 20  terWidth/Height 
44d90 72 65 74 75 72 6e 20 77 2f 68 20 69 6e 63 6c 75  return w/h inclu
44da0 64 69 6e 67 20 73 63 72 6f 6c 6c 62 61 72 73 20  ding scrollbars 
44db0 28 67 68 2d 31 37 32 39 29 0a 09 09 09 09 09 72  (gh-1729)......r
44dc0 65 74 75 72 6e 20 66 75 6e 63 4e 61 6d 65 2e 69  eturn funcName.i
44dd0 6e 64 65 78 4f 66 28 20 22 6f 75 74 65 72 22 20  ndexOf( "outer" 
44de0 29 20 3d 3d 3d 20 30 20 3f 0a 09 09 09 09 09 09  ) === 0 ?.......
44df0 65 6c 65 6d 5b 20 22 69 6e 6e 65 72 22 20 2b 20  elem[ "inner" + 
44e00 6e 61 6d 65 20 5d 20 3a 0a 09 09 09 09 09 09 65  name ] :.......e
44e10 6c 65 6d 2e 64 6f 63 75 6d 65 6e 74 2e 64 6f 63  lem.document.doc
44e20 75 6d 65 6e 74 45 6c 65 6d 65 6e 74 5b 20 22 63  umentElement[ "c
44e30 6c 69 65 6e 74 22 20 2b 20 6e 61 6d 65 20 5d 3b  lient" + name ];
44e40 0a 09 09 09 09 7d 0a 0a 09 09 09 09 2f 2f 20 47  .....}......// G
44e50 65 74 20 64 6f 63 75 6d 65 6e 74 20 77 69 64 74  et document widt
44e60 68 20 6f 72 20 68 65 69 67 68 74 0a 09 09 09 09  h or height.....
44e70 69 66 20 28 20 65 6c 65 6d 2e 6e 6f 64 65 54 79  if ( elem.nodeTy
44e80 70 65 20 3d 3d 3d 20 39 20 29 20 7b 0a 09 09 09  pe === 9 ) {....
44e90 09 09 64 6f 63 20 3d 20 65 6c 65 6d 2e 64 6f 63  ..doc = elem.doc
44ea0 75 6d 65 6e 74 45 6c 65 6d 65 6e 74 3b 0a 0a 09  umentElement;...
44eb0 09 09 09 09 2f 2f 20 45 69 74 68 65 72 20 73 63  ....// Either sc
44ec0 72 6f 6c 6c 5b 57 69 64 74 68 2f 48 65 69 67 68  roll[Width/Heigh
44ed0 74 5d 20 6f 72 20 6f 66 66 73 65 74 5b 57 69 64  t] or offset[Wid
44ee0 74 68 2f 48 65 69 67 68 74 5d 20 6f 72 20 63 6c  th/Height] or cl
44ef0 69 65 6e 74 5b 57 69 64 74 68 2f 48 65 69 67 68  ient[Width/Heigh
44f00 74 5d 2c 0a 09 09 09 09 09 2f 2f 20 77 68 69 63  t],......// whic
44f10 68 65 76 65 72 20 69 73 20 67 72 65 61 74 65 73  hever is greates
44f20 74 0a 09 09 09 09 09 72 65 74 75 72 6e 20 4d 61  t......return Ma
44f30 74 68 2e 6d 61 78 28 0a 09 09 09 09 09 09 65 6c  th.max(.......el
44f40 65 6d 2e 62 6f 64 79 5b 20 22 73 63 72 6f 6c 6c  em.body[ "scroll
44f50 22 20 2b 20 6e 61 6d 65 20 5d 2c 20 64 6f 63 5b  " + name ], doc[
44f60 20 22 73 63 72 6f 6c 6c 22 20 2b 20 6e 61 6d 65   "scroll" + name
44f70 20 5d 2c 0a 09 09 09 09 09 09 65 6c 65 6d 2e 62   ],.......elem.b
44f80 6f 64 79 5b 20 22 6f 66 66 73 65 74 22 20 2b 20  ody[ "offset" + 
44f90 6e 61 6d 65 20 5d 2c 20 64 6f 63 5b 20 22 6f 66  name ], doc[ "of
44fa0 66 73 65 74 22 20 2b 20 6e 61 6d 65 20 5d 2c 0a  fset" + name ],.
44fb0 09 09 09 09 09 09 64 6f 63 5b 20 22 63 6c 69 65  ......doc[ "clie
44fc0 6e 74 22 20 2b 20 6e 61 6d 65 20 5d 0a 09 09 09  nt" + name ]....
44fd0 09 09 29 3b 0a 09 09 09 09 7d 0a 0a 09 09 09 09  ..);.....}......
44fe0 72 65 74 75 72 6e 20 76 61 6c 75 65 20 3d 3d 3d  return value ===
44ff0 20 75 6e 64 65 66 69 6e 65 64 20 3f 0a 0a 09 09   undefined ?....
45000 09 09 09 2f 2f 20 47 65 74 20 77 69 64 74 68 20  ...// Get width 
45010 6f 72 20 68 65 69 67 68 74 20 6f 6e 20 74 68 65  or height on the
45020 20 65 6c 65 6d 65 6e 74 2c 20 72 65 71 75 65 73   element, reques
45030 74 69 6e 67 20 62 75 74 20 6e 6f 74 20 66 6f 72  ting but not for
45040 63 69 6e 67 20 70 61 72 73 65 46 6c 6f 61 74 0a  cing parseFloat.
45050 09 09 09 09 09 6a 51 75 65 72 79 2e 63 73 73 28  .....jQuery.css(
45060 20 65 6c 65 6d 2c 20 74 79 70 65 2c 20 65 78 74   elem, type, ext
45070 72 61 20 29 20 3a 0a 0a 09 09 09 09 09 2f 2f 20  ra ) :.......// 
45080 53 65 74 20 77 69 64 74 68 20 6f 72 20 68 65 69  Set width or hei
45090 67 68 74 20 6f 6e 20 74 68 65 20 65 6c 65 6d 65  ght on the eleme
450a0 6e 74 0a 09 09 09 09 09 6a 51 75 65 72 79 2e 73  nt......jQuery.s
450b0 74 79 6c 65 28 20 65 6c 65 6d 2c 20 74 79 70 65  tyle( elem, type
450c0 2c 20 76 61 6c 75 65 2c 20 65 78 74 72 61 20 29  , value, extra )
450d0 3b 0a 09 09 09 7d 2c 20 74 79 70 65 2c 20 63 68  ;....}, type, ch
450e0 61 69 6e 61 62 6c 65 20 3f 20 6d 61 72 67 69 6e  ainable ? margin
450f0 20 3a 20 75 6e 64 65 66 69 6e 65 64 2c 20 63 68   : undefined, ch
45100 61 69 6e 61 62 6c 65 20 29 3b 0a 09 09 7d 3b 0a  ainable );...};.
45110 09 7d 20 29 3b 0a 7d 20 29 3b 0a 0a 0a 6a 51 75  .} );.} );...jQu
45120 65 72 79 2e 65 61 63 68 28 20 5b 0a 09 22 61 6a  ery.each( [.."aj
45130 61 78 53 74 61 72 74 22 2c 0a 09 22 61 6a 61 78  axStart",.."ajax
45140 53 74 6f 70 22 2c 0a 09 22 61 6a 61 78 43 6f 6d  Stop",.."ajaxCom
45150 70 6c 65 74 65 22 2c 0a 09 22 61 6a 61 78 45 72  plete",.."ajaxEr
45160 72 6f 72 22 2c 0a 09 22 61 6a 61 78 53 75 63 63  ror",.."ajaxSucc
45170 65 73 73 22 2c 0a 09 22 61 6a 61 78 53 65 6e 64  ess",.."ajaxSend
45180 22 0a 5d 2c 20 66 75 6e 63 74 69 6f 6e 28 20 5f  ".], function( _
45190 69 2c 20 74 79 70 65 20 29 20 7b 0a 09 6a 51 75  i, type ) {..jQu
451a0 65 72 79 2e 66 6e 5b 20 74 79 70 65 20 5d 20 3d  ery.fn[ type ] =
451b0 20 66 75 6e 63 74 69 6f 6e 28 20 66 6e 20 29 20   function( fn ) 
451c0 7b 0a 09 09 72 65 74 75 72 6e 20 74 68 69 73 2e  {...return this.
451d0 6f 6e 28 20 74 79 70 65 2c 20 66 6e 20 29 3b 0a  on( type, fn );.
451e0 09 7d 3b 0a 7d 20 29 3b 0a 0a 0a 0a 0a 6a 51 75  .};.} );.....jQu
451f0 65 72 79 2e 66 6e 2e 65 78 74 65 6e 64 28 20 7b  ery.fn.extend( {
45200 0a 0a 09 62 69 6e 64 3a 20 66 75 6e 63 74 69 6f  ...bind: functio
45210 6e 28 20 74 79 70 65 73 2c 20 64 61 74 61 2c 20  n( types, data, 
45220 66 6e 20 29 20 7b 0a 09 09 72 65 74 75 72 6e 20  fn ) {...return 
45230 74 68 69 73 2e 6f 6e 28 20 74 79 70 65 73 2c 20  this.on( types, 
45240 6e 75 6c 6c 2c 20 64 61 74 61 2c 20 66 6e 20 29  null, data, fn )
45250 3b 0a 09 7d 2c 0a 09 75 6e 62 69 6e 64 3a 20 66  ;..},..unbind: f
45260 75 6e 63 74 69 6f 6e 28 20 74 79 70 65 73 2c 20  unction( types, 
45270 66 6e 20 29 20 7b 0a 09 09 72 65 74 75 72 6e 20  fn ) {...return 
45280 74 68 69 73 2e 6f 66 66 28 20 74 79 70 65 73 2c  this.off( types,
45290 20 6e 75 6c 6c 2c 20 66 6e 20 29 3b 0a 09 7d 2c   null, fn );..},
452a0 0a 0a 09 64 65 6c 65 67 61 74 65 3a 20 66 75 6e  ...delegate: fun
452b0 63 74 69 6f 6e 28 20 73 65 6c 65 63 74 6f 72 2c  ction( selector,
452c0 20 74 79 70 65 73 2c 20 64 61 74 61 2c 20 66 6e   types, data, fn
452d0 20 29 20 7b 0a 09 09 72 65 74 75 72 6e 20 74 68   ) {...return th
452e0 69 73 2e 6f 6e 28 20 74 79 70 65 73 2c 20 73 65  is.on( types, se
452f0 6c 65 63 74 6f 72 2c 20 64 61 74 61 2c 20 66 6e  lector, data, fn
45300 20 29 3b 0a 09 7d 2c 0a 09 75 6e 64 65 6c 65 67   );..},..undeleg
45310 61 74 65 3a 20 66 75 6e 63 74 69 6f 6e 28 20 73  ate: function( s
45320 65 6c 65 63 74 6f 72 2c 20 74 79 70 65 73 2c 20  elector, types, 
45330 66 6e 20 29 20 7b 0a 0a 09 09 2f 2f 20 28 20 6e  fn ) {....// ( n
45340 61 6d 65 73 70 61 63 65 20 29 20 6f 72 20 28 20  amespace ) or ( 
45350 73 65 6c 65 63 74 6f 72 2c 20 74 79 70 65 73 20  selector, types 
45360 5b 2c 20 66 6e 5d 20 29 0a 09 09 72 65 74 75 72  [, fn] )...retur
45370 6e 20 61 72 67 75 6d 65 6e 74 73 2e 6c 65 6e 67  n arguments.leng
45380 74 68 20 3d 3d 3d 20 31 20 3f 0a 09 09 09 74 68  th === 1 ?....th
45390 69 73 2e 6f 66 66 28 20 73 65 6c 65 63 74 6f 72  is.off( selector
453a0 2c 20 22 2a 2a 22 20 29 20 3a 0a 09 09 09 74 68  , "**" ) :....th
453b0 69 73 2e 6f 66 66 28 20 74 79 70 65 73 2c 20 73  is.off( types, s
453c0 65 6c 65 63 74 6f 72 20 7c 7c 20 22 2a 2a 22 2c  elector || "**",
453d0 20 66 6e 20 29 3b 0a 09 7d 2c 0a 0a 09 68 6f 76   fn );..},...hov
453e0 65 72 3a 20 66 75 6e 63 74 69 6f 6e 28 20 66 6e  er: function( fn
453f0 4f 76 65 72 2c 20 66 6e 4f 75 74 20 29 20 7b 0a  Over, fnOut ) {.
45400 09 09 72 65 74 75 72 6e 20 74 68 69 73 2e 6d 6f  ..return this.mo
45410 75 73 65 65 6e 74 65 72 28 20 66 6e 4f 76 65 72  useenter( fnOver
45420 20 29 2e 6d 6f 75 73 65 6c 65 61 76 65 28 20 66   ).mouseleave( f
45430 6e 4f 75 74 20 7c 7c 20 66 6e 4f 76 65 72 20 29  nOut || fnOver )
45440 3b 0a 09 7d 0a 7d 20 29 3b 0a 0a 6a 51 75 65 72  ;..}.} );..jQuer
45450 79 2e 65 61 63 68 28 20 28 20 22 62 6c 75 72 20  y.each( ( "blur 
45460 66 6f 63 75 73 20 66 6f 63 75 73 69 6e 20 66 6f  focus focusin fo
45470 63 75 73 6f 75 74 20 72 65 73 69 7a 65 20 73 63  cusout resize sc
45480 72 6f 6c 6c 20 63 6c 69 63 6b 20 64 62 6c 63 6c  roll click dblcl
45490 69 63 6b 20 22 20 2b 0a 09 22 6d 6f 75 73 65 64  ick " +.."moused
454a0 6f 77 6e 20 6d 6f 75 73 65 75 70 20 6d 6f 75 73  own mouseup mous
454b0 65 6d 6f 76 65 20 6d 6f 75 73 65 6f 76 65 72 20  emove mouseover 
454c0 6d 6f 75 73 65 6f 75 74 20 6d 6f 75 73 65 65 6e  mouseout mouseen
454d0 74 65 72 20 6d 6f 75 73 65 6c 65 61 76 65 20 22  ter mouseleave "
454e0 20 2b 0a 09 22 63 68 61 6e 67 65 20 73 65 6c 65   +.."change sele
454f0 63 74 20 73 75 62 6d 69 74 20 6b 65 79 64 6f 77  ct submit keydow
45500 6e 20 6b 65 79 70 72 65 73 73 20 6b 65 79 75 70  n keypress keyup
45510 20 63 6f 6e 74 65 78 74 6d 65 6e 75 22 20 29 2e   contextmenu" ).
45520 73 70 6c 69 74 28 20 22 20 22 20 29 2c 0a 09 66  split( " " ),..f
45530 75 6e 63 74 69 6f 6e 28 20 5f 69 2c 20 6e 61 6d  unction( _i, nam
45540 65 20 29 20 7b 0a 0a 09 09 2f 2f 20 48 61 6e 64  e ) {....// Hand
45550 6c 65 20 65 76 65 6e 74 20 62 69 6e 64 69 6e 67  le event binding
45560 0a 09 09 6a 51 75 65 72 79 2e 66 6e 5b 20 6e 61  ...jQuery.fn[ na
45570 6d 65 20 5d 20 3d 20 66 75 6e 63 74 69 6f 6e 28  me ] = function(
45580 20 64 61 74 61 2c 20 66 6e 20 29 20 7b 0a 09 09   data, fn ) {...
45590 09 72 65 74 75 72 6e 20 61 72 67 75 6d 65 6e 74  .return argument
455a0 73 2e 6c 65 6e 67 74 68 20 3e 20 30 20 3f 0a 09  s.length > 0 ?..
455b0 09 09 09 74 68 69 73 2e 6f 6e 28 20 6e 61 6d 65  ...this.on( name
455c0 2c 20 6e 75 6c 6c 2c 20 64 61 74 61 2c 20 66 6e  , null, data, fn
455d0 20 29 20 3a 0a 09 09 09 09 74 68 69 73 2e 74 72   ) :.....this.tr
455e0 69 67 67 65 72 28 20 6e 61 6d 65 20 29 3b 0a 09  igger( name );..
455f0 09 7d 3b 0a 09 7d 20 29 3b 0a 0a 0a 0a 0a 2f 2f  .};..} );.....//
45600 20 53 75 70 70 6f 72 74 3a 20 41 6e 64 72 6f 69   Support: Androi
45610 64 20 3c 3d 34 2e 30 20 6f 6e 6c 79 0a 2f 2f 20  d <=4.0 only.// 
45620 4d 61 6b 65 20 73 75 72 65 20 77 65 20 74 72 69  Make sure we tri
45630 6d 20 42 4f 4d 20 61 6e 64 20 4e 42 53 50 0a 76  m BOM and NBSP.v
45640 61 72 20 72 74 72 69 6d 20 3d 20 2f 5e 5b 5c 73  ar rtrim = /^[\s
45650 5c 75 46 45 46 46 5c 78 41 30 5d 2b 7c 5b 5c 73  \uFEFF\xA0]+|[\s
45660 5c 75 46 45 46 46 5c 78 41 30 5d 2b 24 2f 67 3b  \uFEFF\xA0]+$/g;
45670 0a 0a 2f 2f 20 42 69 6e 64 20 61 20 66 75 6e 63  ..// Bind a func
45680 74 69 6f 6e 20 74 6f 20 61 20 63 6f 6e 74 65 78  tion to a contex
45690 74 2c 20 6f 70 74 69 6f 6e 61 6c 6c 79 20 70 61  t, optionally pa
456a0 72 74 69 61 6c 6c 79 20 61 70 70 6c 79 69 6e 67  rtially applying
456b0 20 61 6e 79 0a 2f 2f 20 61 72 67 75 6d 65 6e 74   any.// argument
456c0 73 2e 0a 2f 2f 20 6a 51 75 65 72 79 2e 70 72 6f  s..// jQuery.pro
456d0 78 79 20 69 73 20 64 65 70 72 65 63 61 74 65 64  xy is deprecated
456e0 20 74 6f 20 70 72 6f 6d 6f 74 65 20 73 74 61 6e   to promote stan
456f0 64 61 72 64 73 20 28 73 70 65 63 69 66 69 63 61  dards (specifica
45700 6c 6c 79 20 46 75 6e 63 74 69 6f 6e 23 62 69 6e  lly Function#bin
45710 64 29 0a 2f 2f 20 48 6f 77 65 76 65 72 2c 20 69  d).// However, i
45720 74 20 69 73 20 6e 6f 74 20 73 6c 61 74 65 64 20  t is not slated 
45730 66 6f 72 20 72 65 6d 6f 76 61 6c 20 61 6e 79 20  for removal any 
45740 74 69 6d 65 20 73 6f 6f 6e 0a 6a 51 75 65 72 79  time soon.jQuery
45750 2e 70 72 6f 78 79 20 3d 20 66 75 6e 63 74 69 6f  .proxy = functio
45760 6e 28 20 66 6e 2c 20 63 6f 6e 74 65 78 74 20 29  n( fn, context )
45770 20 7b 0a 09 76 61 72 20 74 6d 70 2c 20 61 72 67   {..var tmp, arg
45780 73 2c 20 70 72 6f 78 79 3b 0a 0a 09 69 66 20 28  s, proxy;...if (
45790 20 74 79 70 65 6f 66 20 63 6f 6e 74 65 78 74 20   typeof context 
457a0 3d 3d 3d 20 22 73 74 72 69 6e 67 22 20 29 20 7b  === "string" ) {
457b0 0a 09 09 74 6d 70 20 3d 20 66 6e 5b 20 63 6f 6e  ...tmp = fn[ con
457c0 74 65 78 74 20 5d 3b 0a 09 09 63 6f 6e 74 65 78  text ];...contex
457d0 74 20 3d 20 66 6e 3b 0a 09 09 66 6e 20 3d 20 74  t = fn;...fn = t
457e0 6d 70 3b 0a 09 7d 0a 0a 09 2f 2f 20 51 75 69 63  mp;..}...// Quic
457f0 6b 20 63 68 65 63 6b 20 74 6f 20 64 65 74 65 72  k check to deter
45800 6d 69 6e 65 20 69 66 20 74 61 72 67 65 74 20 69  mine if target i
45810 73 20 63 61 6c 6c 61 62 6c 65 2c 20 69 6e 20 74  s callable, in t
45820 68 65 20 73 70 65 63 0a 09 2f 2f 20 74 68 69 73  he spec..// this
45830 20 74 68 72 6f 77 73 20 61 20 54 79 70 65 45 72   throws a TypeEr
45840 72 6f 72 2c 20 62 75 74 20 77 65 20 77 69 6c 6c  ror, but we will
45850 20 6a 75 73 74 20 72 65 74 75 72 6e 20 75 6e 64   just return und
45860 65 66 69 6e 65 64 2e 0a 09 69 66 20 28 20 21 69  efined...if ( !i
45870 73 46 75 6e 63 74 69 6f 6e 28 20 66 6e 20 29 20  sFunction( fn ) 
45880 29 20 7b 0a 09 09 72 65 74 75 72 6e 20 75 6e 64  ) {...return und
45890 65 66 69 6e 65 64 3b 0a 09 7d 0a 0a 09 2f 2f 20  efined;..}...// 
458a0 53 69 6d 75 6c 61 74 65 64 20 62 69 6e 64 0a 09  Simulated bind..
458b0 61 72 67 73 20 3d 20 73 6c 69 63 65 2e 63 61 6c  args = slice.cal
458c0 6c 28 20 61 72 67 75 6d 65 6e 74 73 2c 20 32 20  l( arguments, 2 
458d0 29 3b 0a 09 70 72 6f 78 79 20 3d 20 66 75 6e 63  );..proxy = func
458e0 74 69 6f 6e 28 29 20 7b 0a 09 09 72 65 74 75 72  tion() {...retur
458f0 6e 20 66 6e 2e 61 70 70 6c 79 28 20 63 6f 6e 74  n fn.apply( cont
45900 65 78 74 20 7c 7c 20 74 68 69 73 2c 20 61 72 67  ext || this, arg
45910 73 2e 63 6f 6e 63 61 74 28 20 73 6c 69 63 65 2e  s.concat( slice.
45920 63 61 6c 6c 28 20 61 72 67 75 6d 65 6e 74 73 20  call( arguments 
45930 29 20 29 20 29 3b 0a 09 7d 3b 0a 0a 09 2f 2f 20  ) ) );..};...// 
45940 53 65 74 20 74 68 65 20 67 75 69 64 20 6f 66 20  Set the guid of 
45950 75 6e 69 71 75 65 20 68 61 6e 64 6c 65 72 20 74  unique handler t
45960 6f 20 74 68 65 20 73 61 6d 65 20 6f 66 20 6f 72  o the same of or
45970 69 67 69 6e 61 6c 20 68 61 6e 64 6c 65 72 2c 20  iginal handler, 
45980 73 6f 20 69 74 20 63 61 6e 20 62 65 20 72 65 6d  so it can be rem
45990 6f 76 65 64 0a 09 70 72 6f 78 79 2e 67 75 69 64  oved..proxy.guid
459a0 20 3d 20 66 6e 2e 67 75 69 64 20 3d 20 66 6e 2e   = fn.guid = fn.
459b0 67 75 69 64 20 7c 7c 20 6a 51 75 65 72 79 2e 67  guid || jQuery.g
459c0 75 69 64 2b 2b 3b 0a 0a 09 72 65 74 75 72 6e 20  uid++;...return 
459d0 70 72 6f 78 79 3b 0a 7d 3b 0a 0a 6a 51 75 65 72  proxy;.};..jQuer
459e0 79 2e 68 6f 6c 64 52 65 61 64 79 20 3d 20 66 75  y.holdReady = fu
459f0 6e 63 74 69 6f 6e 28 20 68 6f 6c 64 20 29 20 7b  nction( hold ) {
45a00 0a 09 69 66 20 28 20 68 6f 6c 64 20 29 20 7b 0a  ..if ( hold ) {.
45a10 09 09 6a 51 75 65 72 79 2e 72 65 61 64 79 57 61  ..jQuery.readyWa
45a20 69 74 2b 2b 3b 0a 09 7d 20 65 6c 73 65 20 7b 0a  it++;..} else {.
45a30 09 09 6a 51 75 65 72 79 2e 72 65 61 64 79 28 20  ..jQuery.ready( 
45a40 74 72 75 65 20 29 3b 0a 09 7d 0a 7d 3b 0a 6a 51  true );..}.};.jQ
45a50 75 65 72 79 2e 69 73 41 72 72 61 79 20 3d 20 41  uery.isArray = A
45a60 72 72 61 79 2e 69 73 41 72 72 61 79 3b 0a 6a 51  rray.isArray;.jQ
45a70 75 65 72 79 2e 70 61 72 73 65 4a 53 4f 4e 20 3d  uery.parseJSON =
45a80 20 4a 53 4f 4e 2e 70 61 72 73 65 3b 0a 6a 51 75   JSON.parse;.jQu
45a90 65 72 79 2e 6e 6f 64 65 4e 61 6d 65 20 3d 20 6e  ery.nodeName = n
45aa0 6f 64 65 4e 61 6d 65 3b 0a 6a 51 75 65 72 79 2e  odeName;.jQuery.
45ab0 69 73 46 75 6e 63 74 69 6f 6e 20 3d 20 69 73 46  isFunction = isF
45ac0 75 6e 63 74 69 6f 6e 3b 0a 6a 51 75 65 72 79 2e  unction;.jQuery.
45ad0 69 73 57 69 6e 64 6f 77 20 3d 20 69 73 57 69 6e  isWindow = isWin
45ae0 64 6f 77 3b 0a 6a 51 75 65 72 79 2e 63 61 6d 65  dow;.jQuery.came
45af0 6c 43 61 73 65 20 3d 20 63 61 6d 65 6c 43 61 73  lCase = camelCas
45b00 65 3b 0a 6a 51 75 65 72 79 2e 74 79 70 65 20 3d  e;.jQuery.type =
45b10 20 74 6f 54 79 70 65 3b 0a 0a 6a 51 75 65 72 79   toType;..jQuery
45b20 2e 6e 6f 77 20 3d 20 44 61 74 65 2e 6e 6f 77 3b  .now = Date.now;
45b30 0a 0a 6a 51 75 65 72 79 2e 69 73 4e 75 6d 65 72  ..jQuery.isNumer
45b40 69 63 20 3d 20 66 75 6e 63 74 69 6f 6e 28 20 6f  ic = function( o
45b50 62 6a 20 29 20 7b 0a 0a 09 2f 2f 20 41 73 20 6f  bj ) {...// As o
45b60 66 20 6a 51 75 65 72 79 20 33 2e 30 2c 20 69 73  f jQuery 3.0, is
45b70 4e 75 6d 65 72 69 63 20 69 73 20 6c 69 6d 69 74  Numeric is limit
45b80 65 64 20 74 6f 0a 09 2f 2f 20 73 74 72 69 6e 67  ed to..// string
45b90 73 20 61 6e 64 20 6e 75 6d 62 65 72 73 20 28 70  s and numbers (p
45ba0 72 69 6d 69 74 69 76 65 73 20 6f 72 20 6f 62 6a  rimitives or obj
45bb0 65 63 74 73 29 0a 09 2f 2f 20 74 68 61 74 20 63  ects)..// that c
45bc0 61 6e 20 62 65 20 63 6f 65 72 63 65 64 20 74 6f  an be coerced to
45bd0 20 66 69 6e 69 74 65 20 6e 75 6d 62 65 72 73 20   finite numbers 
45be0 28 67 68 2d 32 36 36 32 29 0a 09 76 61 72 20 74  (gh-2662)..var t
45bf0 79 70 65 20 3d 20 6a 51 75 65 72 79 2e 74 79 70  ype = jQuery.typ
45c00 65 28 20 6f 62 6a 20 29 3b 0a 09 72 65 74 75 72  e( obj );..retur
45c10 6e 20 28 20 74 79 70 65 20 3d 3d 3d 20 22 6e 75  n ( type === "nu
45c20 6d 62 65 72 22 20 7c 7c 20 74 79 70 65 20 3d 3d  mber" || type ==
45c30 3d 20 22 73 74 72 69 6e 67 22 20 29 20 26 26 0a  = "string" ) &&.
45c40 0a 09 09 2f 2f 20 70 61 72 73 65 46 6c 6f 61 74  ...// parseFloat
45c50 20 4e 61 4e 73 20 6e 75 6d 65 72 69 63 2d 63 61   NaNs numeric-ca
45c60 73 74 20 66 61 6c 73 65 20 70 6f 73 69 74 69 76  st false positiv
45c70 65 73 20 28 22 22 29 0a 09 09 2f 2f 20 2e 2e 2e  es ("")...// ...
45c80 62 75 74 20 6d 69 73 69 6e 74 65 72 70 72 65 74  but misinterpret
45c90 73 20 6c 65 61 64 69 6e 67 2d 6e 75 6d 62 65 72  s leading-number
45ca0 20 73 74 72 69 6e 67 73 2c 20 70 61 72 74 69 63   strings, partic
45cb0 75 6c 61 72 6c 79 20 68 65 78 20 6c 69 74 65 72  ularly hex liter
45cc0 61 6c 73 20 28 22 30 78 2e 2e 2e 22 29 0a 09 09  als ("0x...")...
45cd0 2f 2f 20 73 75 62 74 72 61 63 74 69 6f 6e 20 66  // subtraction f
45ce0 6f 72 63 65 73 20 69 6e 66 69 6e 69 74 69 65 73  orces infinities
45cf0 20 74 6f 20 4e 61 4e 0a 09 09 21 69 73 4e 61 4e   to NaN...!isNaN
45d00 28 20 6f 62 6a 20 2d 20 70 61 72 73 65 46 6c 6f  ( obj - parseFlo
45d10 61 74 28 20 6f 62 6a 20 29 20 29 3b 0a 7d 3b 0a  at( obj ) );.};.
45d20 0a 6a 51 75 65 72 79 2e 74 72 69 6d 20 3d 20 66  .jQuery.trim = f
45d30 75 6e 63 74 69 6f 6e 28 20 74 65 78 74 20 29 20  unction( text ) 
45d40 7b 0a 09 72 65 74 75 72 6e 20 74 65 78 74 20 3d  {..return text =
45d50 3d 20 6e 75 6c 6c 20 3f 0a 09 09 22 22 20 3a 0a  = null ?..."" :.
45d60 09 09 28 20 74 65 78 74 20 2b 20 22 22 20 29 2e  ..( text + "" ).
45d70 72 65 70 6c 61 63 65 28 20 72 74 72 69 6d 2c 20  replace( rtrim, 
45d80 22 22 20 29 3b 0a 7d 3b 0a 0a 0a 0a 2f 2f 20 52  "" );.};....// R
45d90 65 67 69 73 74 65 72 20 61 73 20 61 20 6e 61 6d  egister as a nam
45da0 65 64 20 41 4d 44 20 6d 6f 64 75 6c 65 2c 20 73  ed AMD module, s
45db0 69 6e 63 65 20 6a 51 75 65 72 79 20 63 61 6e 20  ince jQuery can 
45dc0 62 65 20 63 6f 6e 63 61 74 65 6e 61 74 65 64 20  be concatenated 
45dd0 77 69 74 68 20 6f 74 68 65 72 0a 2f 2f 20 66 69  with other.// fi
45de0 6c 65 73 20 74 68 61 74 20 6d 61 79 20 75 73 65  les that may use
45df0 20 64 65 66 69 6e 65 2c 20 62 75 74 20 6e 6f 74   define, but not
45e00 20 76 69 61 20 61 20 70 72 6f 70 65 72 20 63 6f   via a proper co
45e10 6e 63 61 74 65 6e 61 74 69 6f 6e 20 73 63 72 69  ncatenation scri
45e20 70 74 20 74 68 61 74 0a 2f 2f 20 75 6e 64 65 72  pt that.// under
45e30 73 74 61 6e 64 73 20 61 6e 6f 6e 79 6d 6f 75 73  stands anonymous
45e40 20 41 4d 44 20 6d 6f 64 75 6c 65 73 2e 20 41 20   AMD modules. A 
45e50 6e 61 6d 65 64 20 41 4d 44 20 69 73 20 73 61 66  named AMD is saf
45e60 65 73 74 20 61 6e 64 20 6d 6f 73 74 20 72 6f 62  est and most rob
45e70 75 73 74 0a 2f 2f 20 77 61 79 20 74 6f 20 72 65  ust.// way to re
45e80 67 69 73 74 65 72 2e 20 4c 6f 77 65 72 63 61 73  gister. Lowercas
45e90 65 20 6a 71 75 65 72 79 20 69 73 20 75 73 65 64  e jquery is used
45ea0 20 62 65 63 61 75 73 65 20 41 4d 44 20 6d 6f 64   because AMD mod
45eb0 75 6c 65 20 6e 61 6d 65 73 20 61 72 65 0a 2f 2f  ule names are.//
45ec0 20 64 65 72 69 76 65 64 20 66 72 6f 6d 20 66 69   derived from fi
45ed0 6c 65 20 6e 61 6d 65 73 2c 20 61 6e 64 20 6a 51  le names, and jQ
45ee0 75 65 72 79 20 69 73 20 6e 6f 72 6d 61 6c 6c 79  uery is normally
45ef0 20 64 65 6c 69 76 65 72 65 64 20 69 6e 20 61 20   delivered in a 
45f00 6c 6f 77 65 72 63 61 73 65 0a 2f 2f 20 66 69 6c  lowercase.// fil
45f10 65 20 6e 61 6d 65 2e 20 44 6f 20 74 68 69 73 20  e name. Do this 
45f20 61 66 74 65 72 20 63 72 65 61 74 69 6e 67 20 74  after creating t
45f30 68 65 20 67 6c 6f 62 61 6c 20 73 6f 20 74 68 61  he global so tha
45f40 74 20 69 66 20 61 6e 20 41 4d 44 20 6d 6f 64 75  t if an AMD modu
45f50 6c 65 20 77 61 6e 74 73 0a 2f 2f 20 74 6f 20 63  le wants.// to c
45f60 61 6c 6c 20 6e 6f 43 6f 6e 66 6c 69 63 74 20 74  all noConflict t
45f70 6f 20 68 69 64 65 20 74 68 69 73 20 76 65 72 73  o hide this vers
45f80 69 6f 6e 20 6f 66 20 6a 51 75 65 72 79 2c 20 69  ion of jQuery, i
45f90 74 20 77 69 6c 6c 20 77 6f 72 6b 2e 0a 0a 2f 2f  t will work...//
45fa0 20 4e 6f 74 65 20 74 68 61 74 20 66 6f 72 20 6d   Note that for m
45fb0 61 78 69 6d 75 6d 20 70 6f 72 74 61 62 69 6c 69  aximum portabili
45fc0 74 79 2c 20 6c 69 62 72 61 72 69 65 73 20 74 68  ty, libraries th
45fd0 61 74 20 61 72 65 20 6e 6f 74 20 6a 51 75 65 72  at are not jQuer
45fe0 79 20 73 68 6f 75 6c 64 0a 2f 2f 20 64 65 63 6c  y should.// decl
45ff0 61 72 65 20 74 68 65 6d 73 65 6c 76 65 73 20 61  are themselves a
46000 73 20 61 6e 6f 6e 79 6d 6f 75 73 20 6d 6f 64 75  s anonymous modu
46010 6c 65 73 2c 20 61 6e 64 20 61 76 6f 69 64 20 73  les, and avoid s
46020 65 74 74 69 6e 67 20 61 20 67 6c 6f 62 61 6c 20  etting a global 
46030 69 66 20 61 6e 0a 2f 2f 20 41 4d 44 20 6c 6f 61  if an.// AMD loa
46040 64 65 72 20 69 73 20 70 72 65 73 65 6e 74 2e 20  der is present. 
46050 6a 51 75 65 72 79 20 69 73 20 61 20 73 70 65 63  jQuery is a spec
46060 69 61 6c 20 63 61 73 65 2e 20 46 6f 72 20 6d 6f  ial case. For mo
46070 72 65 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 2c 20  re information, 
46080 73 65 65 0a 2f 2f 20 68 74 74 70 73 3a 2f 2f 67  see.// https://g
46090 69 74 68 75 62 2e 63 6f 6d 2f 6a 72 62 75 72 6b  ithub.com/jrburk
460a0 65 2f 72 65 71 75 69 72 65 6a 73 2f 77 69 6b 69  e/requirejs/wiki
460b0 2f 55 70 64 61 74 69 6e 67 2d 65 78 69 73 74 69  /Updating-existi
460c0 6e 67 2d 6c 69 62 72 61 72 69 65 73 23 77 69 6b  ng-libraries#wik
460d0 69 2d 61 6e 6f 6e 0a 0a 69 66 20 28 20 74 79 70  i-anon..if ( typ
460e0 65 6f 66 20 64 65 66 69 6e 65 20 3d 3d 3d 20 22  eof define === "
460f0 66 75 6e 63 74 69 6f 6e 22 20 26 26 20 64 65 66  function" && def
46100 69 6e 65 2e 61 6d 64 20 29 20 7b 0a 09 64 65 66  ine.amd ) {..def
46110 69 6e 65 28 20 22 6a 71 75 65 72 79 22 2c 20 5b  ine( "jquery", [
46120 5d 2c 20 66 75 6e 63 74 69 6f 6e 28 29 20 7b 0a  ], function() {.
46130 09 09 72 65 74 75 72 6e 20 6a 51 75 65 72 79 3b  ..return jQuery;
46140 0a 09 7d 20 29 3b 0a 7d 0a 0a 0a 0a 0a 76 61 72  ..} );.}.....var
46150 0a 0a 09 2f 2f 20 4d 61 70 20 6f 76 65 72 20 6a  ...// Map over j
46160 51 75 65 72 79 20 69 6e 20 63 61 73 65 20 6f 66  Query in case of
46170 20 6f 76 65 72 77 72 69 74 65 0a 09 5f 6a 51 75   overwrite.._jQu
46180 65 72 79 20 3d 20 77 69 6e 64 6f 77 2e 6a 51 75  ery = window.jQu
46190 65 72 79 2c 0a 0a 09 2f 2f 20 4d 61 70 20 6f 76  ery,...// Map ov
461a0 65 72 20 74 68 65 20 24 20 69 6e 20 63 61 73 65  er the $ in case
461b0 20 6f 66 20 6f 76 65 72 77 72 69 74 65 0a 09 5f   of overwrite.._
461c0 24 20 3d 20 77 69 6e 64 6f 77 2e 24 3b 0a 0a 6a  $ = window.$;..j
461d0 51 75 65 72 79 2e 6e 6f 43 6f 6e 66 6c 69 63 74  Query.noConflict
461e0 20 3d 20 66 75 6e 63 74 69 6f 6e 28 20 64 65 65   = function( dee
461f0 70 20 29 20 7b 0a 09 69 66 20 28 20 77 69 6e 64  p ) {..if ( wind
46200 6f 77 2e 24 20 3d 3d 3d 20 6a 51 75 65 72 79 20  ow.$ === jQuery 
46210 29 20 7b 0a 09 09 77 69 6e 64 6f 77 2e 24 20 3d  ) {...window.$ =
46220 20 5f 24 3b 0a 09 7d 0a 0a 09 69 66 20 28 20 64   _$;..}...if ( d
46230 65 65 70 20 26 26 20 77 69 6e 64 6f 77 2e 6a 51  eep && window.jQ
46240 75 65 72 79 20 3d 3d 3d 20 6a 51 75 65 72 79 20  uery === jQuery 
46250 29 20 7b 0a 09 09 77 69 6e 64 6f 77 2e 6a 51 75  ) {...window.jQu
46260 65 72 79 20 3d 20 5f 6a 51 75 65 72 79 3b 0a 09  ery = _jQuery;..
46270 7d 0a 0a 09 72 65 74 75 72 6e 20 6a 51 75 65 72  }...return jQuer
46280 79 3b 0a 7d 3b 0a 0a 2f 2f 20 45 78 70 6f 73 65  y;.};..// Expose
46290 20 6a 51 75 65 72 79 20 61 6e 64 20 24 20 69 64   jQuery and $ id
462a0 65 6e 74 69 66 69 65 72 73 2c 20 65 76 65 6e 20  entifiers, even 
462b0 69 6e 20 41 4d 44 0a 2f 2f 20 28 23 37 31 30 32  in AMD.// (#7102
462c0 23 63 6f 6d 6d 65 6e 74 3a 31 30 2c 20 68 74 74  #comment:10, htt
462d0 70 73 3a 2f 2f 67 69 74 68 75 62 2e 63 6f 6d 2f  ps://github.com/
462e0 6a 71 75 65 72 79 2f 6a 71 75 65 72 79 2f 70 75  jquery/jquery/pu
462f0 6c 6c 2f 35 35 37 29 0a 2f 2f 20 61 6e 64 20 43  ll/557).// and C
46300 6f 6d 6d 6f 6e 4a 53 20 66 6f 72 20 62 72 6f 77  ommonJS for brow
46310 73 65 72 20 65 6d 75 6c 61 74 6f 72 73 20 28 23  ser emulators (#
46320 31 33 35 36 36 29 0a 69 66 20 28 20 74 79 70 65  13566).if ( type
46330 6f 66 20 6e 6f 47 6c 6f 62 61 6c 20 3d 3d 3d 20  of noGlobal === 
46340 22 75 6e 64 65 66 69 6e 65 64 22 20 29 20 7b 0a  "undefined" ) {.
46350 09 77 69 6e 64 6f 77 2e 6a 51 75 65 72 79 20 3d  .window.jQuery =
46360 20 77 69 6e 64 6f 77 2e 24 20 3d 20 6a 51 75 65   window.$ = jQue
46370 72 79 3b 0a 7d 0a 0a 0a 0a 0a 72 65 74 75 72 6e  ry;.}.....return
46380 20 6a 51 75 65 72 79 3b 0a 7d 20 29 3b 0a         jQuery;.} );.