jquery-extras

Contains jQuery with a bunch of useful extras

Αυτός ο κώδικας δεν πρέπει να εγκατασταθεί άμεσα. Είναι μια βιβλιοθήκη για άλλους κώδικες που περιλαμβάνεται μέσω της οδηγίας meta // @require https://update.greatest.deepsurf.us/scripts/12083/71338/jquery-extras.js

  1. // ==UserScript==
  2. // @name jquery-extras
  3. // @version 0.2.0
  4. // @description Contains jQuery with a bunch of useful extras
  5. // ==/UserScript==
  6.  
  7.  
  8. (function webpackUniversalModuleDefinition(root, factory) {
  9. if(typeof exports === 'object' && typeof module === 'object')
  10. module.exports = factory();
  11. else if(typeof define === 'function' && define.amd)
  12. define([], factory);
  13. else if(typeof exports === 'object')
  14. exports["$"] = factory();
  15. else
  16. root["$"] = factory();
  17. })(this, function() {
  18. return /******/ (function(modules) { // webpackBootstrap
  19. /******/ // The module cache
  20. /******/ var installedModules = {};
  21. /******/
  22. /******/ // The require function
  23. /******/ function __webpack_require__(moduleId) {
  24. /******/
  25. /******/ // Check if module is in cache
  26. /******/ if(installedModules[moduleId])
  27. /******/ return installedModules[moduleId].exports;
  28. /******/
  29. /******/ // Create a new module (and put it into the cache)
  30. /******/ var module = installedModules[moduleId] = {
  31. /******/ exports: {},
  32. /******/ id: moduleId,
  33. /******/ loaded: false
  34. /******/ };
  35. /******/
  36. /******/ // Execute the module function
  37. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  38. /******/
  39. /******/ // Flag the module as loaded
  40. /******/ module.loaded = true;
  41. /******/
  42. /******/ // Return the exports of the module
  43. /******/ return module.exports;
  44. /******/ }
  45. /******/
  46. /******/
  47. /******/ // expose the modules object (__webpack_modules__)
  48. /******/ __webpack_require__.m = modules;
  49. /******/
  50. /******/ // expose the module cache
  51. /******/ __webpack_require__.c = installedModules;
  52. /******/
  53. /******/ // __webpack_public_path__
  54. /******/ __webpack_require__.p = "http://localhost:9000/";
  55. /******/
  56. /******/ // Load entry module and return exports
  57. /******/ return __webpack_require__(0);
  58. /******/ })
  59. /************************************************************************/
  60. /******/ ([
  61. /* 0 */
  62. /*!***************************!*\
  63. !*** multi jquery-extras ***!
  64. \***************************/
  65. /***/ function(module, exports, __webpack_require__) {
  66.  
  67. module.exports = __webpack_require__(/*! ./entries/jquery */1);
  68.  
  69.  
  70. /***/ },
  71. /* 1 */
  72. /*!*********************************!*\
  73. !*** ./entries/jquery/index.js ***!
  74. \*********************************/
  75. /***/ function(module, exports, __webpack_require__) {
  76.  
  77. /* WEBPACK VAR INJECTION */(function(jQuery) {'use strict';
  78. var _Object$assign = __webpack_require__(/*! babel-runtime/core-js/object/assign */ 3)['default'];
  79. var _interopRequireDefault = __webpack_require__(/*! babel-runtime/helpers/interop-require-default */ 16)['default'];
  80. Object.defineProperty(exports, '__esModule', {
  81. value: true
  82. });
  83. var _jquery = __webpack_require__(/*! jquery */ 2);
  84. var _jquery2 = _interopRequireDefault(_jquery);
  85. __webpack_require__(/*! jquery-extras */ 17);
  86. var _webSelectorObserver = __webpack_require__(/*! web/selector-observer */ 22);
  87. var _webSelectorObserver2 = _interopRequireDefault(_webSelectorObserver);
  88. // ----------------------------------------------------------------------------
  89. jQuery.fn.observe = function (selector, onAdded, onRemoved) {
  90. var options = typeof selector === 'object' ? selector : {
  91. selector: selector,
  92. onAdded: onAdded,
  93. onRemoved: onRemoved
  94. };
  95. _Object$assign(options, {
  96. targets: [this.get()]
  97. });
  98. this.data('observer', new _webSelectorObserver2['default'](options));
  99. return this;
  100. };
  101. // ----------------------------------------------------------------------------
  102.  
  103. exports['default'] = _jquery2['default'];
  104. module.exports = exports['default'];
  105. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! jquery */ 2)))
  106.  
  107. /***/ },
  108. /* 2 */
  109. /*!*********************************!*\
  110. !*** ./~/jquery/dist/jquery.js ***!
  111. \*********************************/
  112. /***/ function(module, exports, __webpack_require__) {
  113.  
  114. var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
  115. * jQuery JavaScript Library v2.1.4
  116. * http://jquery.com/
  117. *
  118. * Includes Sizzle.js
  119. * http://sizzlejs.com/
  120. *
  121. * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
  122. * Released under the MIT license
  123. * http://jquery.org/license
  124. *
  125. * Date: 2015-04-28T16:01Z
  126. */
  127. (function( global, factory ) {
  128. if ( typeof module === "object" && typeof module.exports === "object" ) {
  129. // For CommonJS and CommonJS-like environments where a proper `window`
  130. // is present, execute the factory and get jQuery.
  131. // For environments that do not have a `window` with a `document`
  132. // (such as Node.js), expose a factory as module.exports.
  133. // This accentuates the need for the creation of a real `window`.
  134. // e.g. var jQuery = require("jquery")(window);
  135. // See ticket #14549 for more info.
  136. module.exports = global.document ?
  137. factory( global, true ) :
  138. function( w ) {
  139. if ( !w.document ) {
  140. throw new Error( "jQuery requires a window with a document" );
  141. }
  142. return factory( w );
  143. };
  144. } else {
  145. factory( global );
  146. }
  147. // Pass this if window is not defined yet
  148. }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
  149. // Support: Firefox 18+
  150. // Can't be in strict mode, several libs including ASP.NET trace
  151. // the stack via arguments.caller.callee and Firefox dies if
  152. // you try to trace through "use strict" call chains. (#13335)
  153. //
  154. var arr = [];
  155. var slice = arr.slice;
  156. var concat = arr.concat;
  157. var push = arr.push;
  158. var indexOf = arr.indexOf;
  159. var class2type = {};
  160. var toString = class2type.toString;
  161. var hasOwn = class2type.hasOwnProperty;
  162. var support = {};
  163. var
  164. // Use the correct document accordingly with window argument (sandbox)
  165. document = window.document,
  166. version = "2.1.4",
  167. // Define a local copy of jQuery
  168. jQuery = function( selector, context ) {
  169. // The jQuery object is actually just the init constructor 'enhanced'
  170. // Need init if jQuery is called (just allow error to be thrown if not included)
  171. return new jQuery.fn.init( selector, context );
  172. },
  173. // Support: Android<4.1
  174. // Make sure we trim BOM and NBSP
  175. rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
  176. // Matches dashed string for camelizing
  177. rmsPrefix = /^-ms-/,
  178. rdashAlpha = /-([\da-z])/gi,
  179. // Used by jQuery.camelCase as callback to replace()
  180. fcamelCase = function( all, letter ) {
  181. return letter.toUpperCase();
  182. };
  183. jQuery.fn = jQuery.prototype = {
  184. // The current version of jQuery being used
  185. jquery: version,
  186. constructor: jQuery,
  187. // Start with an empty selector
  188. selector: "",
  189. // The default length of a jQuery object is 0
  190. length: 0,
  191. toArray: function() {
  192. return slice.call( this );
  193. },
  194. // Get the Nth element in the matched element set OR
  195. // Get the whole matched element set as a clean array
  196. get: function( num ) {
  197. return num != null ?
  198. // Return just the one element from the set
  199. ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
  200. // Return all the elements in a clean array
  201. slice.call( this );
  202. },
  203. // Take an array of elements and push it onto the stack
  204. // (returning the new matched element set)
  205. pushStack: function( elems ) {
  206. // Build a new jQuery matched element set
  207. var ret = jQuery.merge( this.constructor(), elems );
  208. // Add the old object onto the stack (as a reference)
  209. ret.prevObject = this;
  210. ret.context = this.context;
  211. // Return the newly-formed element set
  212. return ret;
  213. },
  214. // Execute a callback for every element in the matched set.
  215. // (You can seed the arguments with an array of args, but this is
  216. // only used internally.)
  217. each: function( callback, args ) {
  218. return jQuery.each( this, callback, args );
  219. },
  220. map: function( callback ) {
  221. return this.pushStack( jQuery.map(this, function( elem, i ) {
  222. return callback.call( elem, i, elem );
  223. }));
  224. },
  225. slice: function() {
  226. return this.pushStack( slice.apply( this, arguments ) );
  227. },
  228. first: function() {
  229. return this.eq( 0 );
  230. },
  231. last: function() {
  232. return this.eq( -1 );
  233. },
  234. eq: function( i ) {
  235. var len = this.length,
  236. j = +i + ( i < 0 ? len : 0 );
  237. return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
  238. },
  239. end: function() {
  240. return this.prevObject || this.constructor(null);
  241. },
  242. // For internal use only.
  243. // Behaves like an Array's method, not like a jQuery method.
  244. push: push,
  245. sort: arr.sort,
  246. splice: arr.splice
  247. };
  248. jQuery.extend = jQuery.fn.extend = function() {
  249. var options, name, src, copy, copyIsArray, clone,
  250. target = arguments[0] || {},
  251. i = 1,
  252. length = arguments.length,
  253. deep = false;
  254. // Handle a deep copy situation
  255. if ( typeof target === "boolean" ) {
  256. deep = target;
  257. // Skip the boolean and the target
  258. target = arguments[ i ] || {};
  259. i++;
  260. }
  261. // Handle case when target is a string or something (possible in deep copy)
  262. if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
  263. target = {};
  264. }
  265. // Extend jQuery itself if only one argument is passed
  266. if ( i === length ) {
  267. target = this;
  268. i--;
  269. }
  270. for ( ; i < length; i++ ) {
  271. // Only deal with non-null/undefined values
  272. if ( (options = arguments[ i ]) != null ) {
  273. // Extend the base object
  274. for ( name in options ) {
  275. src = target[ name ];
  276. copy = options[ name ];
  277. // Prevent never-ending loop
  278. if ( target === copy ) {
  279. continue;
  280. }
  281. // Recurse if we're merging plain objects or arrays
  282. if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
  283. if ( copyIsArray ) {
  284. copyIsArray = false;
  285. clone = src && jQuery.isArray(src) ? src : [];
  286. } else {
  287. clone = src && jQuery.isPlainObject(src) ? src : {};
  288. }
  289. // Never move original objects, clone them
  290. target[ name ] = jQuery.extend( deep, clone, copy );
  291. // Don't bring in undefined values
  292. } else if ( copy !== undefined ) {
  293. target[ name ] = copy;
  294. }
  295. }
  296. }
  297. }
  298. // Return the modified object
  299. return target;
  300. };
  301. jQuery.extend({
  302. // Unique for each copy of jQuery on the page
  303. expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
  304. // Assume jQuery is ready without the ready module
  305. isReady: true,
  306. error: function( msg ) {
  307. throw new Error( msg );
  308. },
  309. noop: function() {},
  310. isFunction: function( obj ) {
  311. return jQuery.type(obj) === "function";
  312. },
  313. isArray: Array.isArray,
  314. isWindow: function( obj ) {
  315. return obj != null && obj === obj.window;
  316. },
  317. isNumeric: function( obj ) {
  318. // parseFloat NaNs numeric-cast false positives (null|true|false|"")
  319. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  320. // subtraction forces infinities to NaN
  321. // adding 1 corrects loss of precision from parseFloat (#15100)
  322. return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0;
  323. },
  324. isPlainObject: function( obj ) {
  325. // Not plain objects:
  326. // - Any object or value whose internal [[Class]] property is not "[object Object]"
  327. // - DOM nodes
  328. // - window
  329. if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
  330. return false;
  331. }
  332. if ( obj.constructor &&
  333. !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
  334. return false;
  335. }
  336. // If the function hasn't returned already, we're confident that
  337. // |obj| is a plain object, created by {} or constructed with new Object
  338. return true;
  339. },
  340. isEmptyObject: function( obj ) {
  341. var name;
  342. for ( name in obj ) {
  343. return false;
  344. }
  345. return true;
  346. },
  347. type: function( obj ) {
  348. if ( obj == null ) {
  349. return obj + "";
  350. }
  351. // Support: Android<4.0, iOS<6 (functionish RegExp)
  352. return typeof obj === "object" || typeof obj === "function" ?
  353. class2type[ toString.call(obj) ] || "object" :
  354. typeof obj;
  355. },
  356. // Evaluates a script in a global context
  357. globalEval: function( code ) {
  358. var script,
  359. indirect = eval;
  360. code = jQuery.trim( code );
  361. if ( code ) {
  362. // If the code includes a valid, prologue position
  363. // strict mode pragma, execute code by injecting a
  364. // script tag into the document.
  365. if ( code.indexOf("use strict") === 1 ) {
  366. script = document.createElement("script");
  367. script.text = code;
  368. document.head.appendChild( script ).parentNode.removeChild( script );
  369. } else {
  370. // Otherwise, avoid the DOM node creation, insertion
  371. // and removal by using an indirect global eval
  372. indirect( code );
  373. }
  374. }
  375. },
  376. // Convert dashed to camelCase; used by the css and data modules
  377. // Support: IE9-11+
  378. // Microsoft forgot to hump their vendor prefix (#9572)
  379. camelCase: function( string ) {
  380. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  381. },
  382. nodeName: function( elem, name ) {
  383. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  384. },
  385. // args is for internal usage only
  386. each: function( obj, callback, args ) {
  387. var value,
  388. i = 0,
  389. length = obj.length,
  390. isArray = isArraylike( obj );
  391. if ( args ) {
  392. if ( isArray ) {
  393. for ( ; i < length; i++ ) {
  394. value = callback.apply( obj[ i ], args );
  395. if ( value === false ) {
  396. break;
  397. }
  398. }
  399. } else {
  400. for ( i in obj ) {
  401. value = callback.apply( obj[ i ], args );
  402. if ( value === false ) {
  403. break;
  404. }
  405. }
  406. }
  407. // A special, fast, case for the most common use of each
  408. } else {
  409. if ( isArray ) {
  410. for ( ; i < length; i++ ) {
  411. value = callback.call( obj[ i ], i, obj[ i ] );
  412. if ( value === false ) {
  413. break;
  414. }
  415. }
  416. } else {
  417. for ( i in obj ) {
  418. value = callback.call( obj[ i ], i, obj[ i ] );
  419. if ( value === false ) {
  420. break;
  421. }
  422. }
  423. }
  424. }
  425. return obj;
  426. },
  427. // Support: Android<4.1
  428. trim: function( text ) {
  429. return text == null ?
  430. "" :
  431. ( text + "" ).replace( rtrim, "" );
  432. },
  433. // results is for internal usage only
  434. makeArray: function( arr, results ) {
  435. var ret = results || [];
  436. if ( arr != null ) {
  437. if ( isArraylike( Object(arr) ) ) {
  438. jQuery.merge( ret,
  439. typeof arr === "string" ?
  440. [ arr ] : arr
  441. );
  442. } else {
  443. push.call( ret, arr );
  444. }
  445. }
  446. return ret;
  447. },
  448. inArray: function( elem, arr, i ) {
  449. return arr == null ? -1 : indexOf.call( arr, elem, i );
  450. },
  451. merge: function( first, second ) {
  452. var len = +second.length,
  453. j = 0,
  454. i = first.length;
  455. for ( ; j < len; j++ ) {
  456. first[ i++ ] = second[ j ];
  457. }
  458. first.length = i;
  459. return first;
  460. },
  461. grep: function( elems, callback, invert ) {
  462. var callbackInverse,
  463. matches = [],
  464. i = 0,
  465. length = elems.length,
  466. callbackExpect = !invert;
  467. // Go through the array, only saving the items
  468. // that pass the validator function
  469. for ( ; i < length; i++ ) {
  470. callbackInverse = !callback( elems[ i ], i );
  471. if ( callbackInverse !== callbackExpect ) {
  472. matches.push( elems[ i ] );
  473. }
  474. }
  475. return matches;
  476. },
  477. // arg is for internal usage only
  478. map: function( elems, callback, arg ) {
  479. var value,
  480. i = 0,
  481. length = elems.length,
  482. isArray = isArraylike( elems ),
  483. ret = [];
  484. // Go through the array, translating each of the items to their new values
  485. if ( isArray ) {
  486. for ( ; i < length; i++ ) {
  487. value = callback( elems[ i ], i, arg );
  488. if ( value != null ) {
  489. ret.push( value );
  490. }
  491. }
  492. // Go through every key on the object,
  493. } else {
  494. for ( i in elems ) {
  495. value = callback( elems[ i ], i, arg );
  496. if ( value != null ) {
  497. ret.push( value );
  498. }
  499. }
  500. }
  501. // Flatten any nested arrays
  502. return concat.apply( [], ret );
  503. },
  504. // A global GUID counter for objects
  505. guid: 1,
  506. // Bind a function to a context, optionally partially applying any
  507. // arguments.
  508. proxy: function( fn, context ) {
  509. var tmp, args, proxy;
  510. if ( typeof context === "string" ) {
  511. tmp = fn[ context ];
  512. context = fn;
  513. fn = tmp;
  514. }
  515. // Quick check to determine if target is callable, in the spec
  516. // this throws a TypeError, but we will just return undefined.
  517. if ( !jQuery.isFunction( fn ) ) {
  518. return undefined;
  519. }
  520. // Simulated bind
  521. args = slice.call( arguments, 2 );
  522. proxy = function() {
  523. return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  524. };
  525. // Set the guid of unique handler to the same of original handler, so it can be removed
  526. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  527. return proxy;
  528. },
  529. now: Date.now,
  530. // jQuery.support is not used in Core but other projects attach their
  531. // properties to it so it needs to exist.
  532. support: support
  533. });
  534. // Populate the class2type map
  535. jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
  536. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  537. });
  538. function isArraylike( obj ) {
  539. // Support: iOS 8.2 (not reproducible in simulator)
  540. // `in` check used to prevent JIT error (gh-2145)
  541. // hasOwn isn't used here due to false negatives
  542. // regarding Nodelist length in IE
  543. var length = "length" in obj && obj.length,
  544. type = jQuery.type( obj );
  545. if ( type === "function" || jQuery.isWindow( obj ) ) {
  546. return false;
  547. }
  548. if ( obj.nodeType === 1 && length ) {
  549. return true;
  550. }
  551. return type === "array" || length === 0 ||
  552. typeof length === "number" && length > 0 && ( length - 1 ) in obj;
  553. }
  554. var Sizzle =
  555. /*!
  556. * Sizzle CSS Selector Engine v2.2.0-pre
  557. * http://sizzlejs.com/
  558. *
  559. * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors
  560. * Released under the MIT license
  561. * http://jquery.org/license
  562. *
  563. * Date: 2014-12-16
  564. */
  565. (function( window ) {
  566. var i,
  567. support,
  568. Expr,
  569. getText,
  570. isXML,
  571. tokenize,
  572. compile,
  573. select,
  574. outermostContext,
  575. sortInput,
  576. hasDuplicate,
  577. // Local document vars
  578. setDocument,
  579. document,
  580. docElem,
  581. documentIsHTML,
  582. rbuggyQSA,
  583. rbuggyMatches,
  584. matches,
  585. contains,
  586. // Instance-specific data
  587. expando = "sizzle" + 1 * new Date(),
  588. preferredDoc = window.document,
  589. dirruns = 0,
  590. done = 0,
  591. classCache = createCache(),
  592. tokenCache = createCache(),
  593. compilerCache = createCache(),
  594. sortOrder = function( a, b ) {
  595. if ( a === b ) {
  596. hasDuplicate = true;
  597. }
  598. return 0;
  599. },
  600. // General-purpose constants
  601. MAX_NEGATIVE = 1 << 31,
  602. // Instance methods
  603. hasOwn = ({}).hasOwnProperty,
  604. arr = [],
  605. pop = arr.pop,
  606. push_native = arr.push,
  607. push = arr.push,
  608. slice = arr.slice,
  609. // Use a stripped-down indexOf as it's faster than native
  610. // http://jsperf.com/thor-indexof-vs-for/5
  611. indexOf = function( list, elem ) {
  612. var i = 0,
  613. len = list.length;
  614. for ( ; i < len; i++ ) {
  615. if ( list[i] === elem ) {
  616. return i;
  617. }
  618. }
  619. return -1;
  620. },
  621. booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
  622. // Regular expressions
  623. // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
  624. whitespace = "[\\x20\\t\\r\\n\\f]",
  625. // http://www.w3.org/TR/css3-syntax/#characters
  626. characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
  627. // Loosely modeled on CSS identifier characters
  628. // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
  629. // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
  630. identifier = characterEncoding.replace( "w", "w#" ),
  631. // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
  632. attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
  633. // Operator (capture 2)
  634. "*([*^$|!~]?=)" + whitespace +
  635. // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
  636. "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
  637. "*\\]",
  638. pseudos = ":(" + characterEncoding + ")(?:\\((" +
  639. // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  640. // 1. quoted (capture 3; capture 4 or capture 5)
  641. "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  642. // 2. simple (capture 6)
  643. "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  644. // 3. anything else (capture 2)
  645. ".*" +
  646. ")\\)|)",
  647. // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  648. rwhitespace = new RegExp( whitespace + "+", "g" ),
  649. rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
  650. rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  651. rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
  652. rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
  653. rpseudo = new RegExp( pseudos ),
  654. ridentifier = new RegExp( "^" + identifier + "$" ),
  655. matchExpr = {
  656. "ID": new RegExp( "^#(" + characterEncoding + ")" ),
  657. "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
  658. "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
  659. "ATTR": new RegExp( "^" + attributes ),
  660. "PSEUDO": new RegExp( "^" + pseudos ),
  661. "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
  662. "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
  663. "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  664. "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
  665. // For use in libraries implementing .is()
  666. // We use this for POS matching in `select`
  667. "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
  668. whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  669. },
  670. rinputs = /^(?:input|select|textarea|button)$/i,
  671. rheader = /^h\d$/i,
  672. rnative = /^[^{]+\{\s*\[native \w/,
  673. // Easily-parseable/retrievable ID or TAG or CLASS selectors
  674. rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  675. rsibling = /[+~]/,
  676. rescape = /'|\\/g,
  677. // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  678. runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
  679. funescape = function( _, escaped, escapedWhitespace ) {
  680. var high = "0x" + escaped - 0x10000;
  681. // NaN means non-codepoint
  682. // Support: Firefox<24
  683. // Workaround erroneous numeric interpretation of +"0x"
  684. return high !== high || escapedWhitespace ?
  685. escaped :
  686. high < 0 ?
  687. // BMP codepoint
  688. String.fromCharCode( high + 0x10000 ) :
  689. // Supplemental Plane codepoint (surrogate pair)
  690. String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  691. },
  692. // Used for iframes
  693. // See setDocument()
  694. // Removing the function wrapper causes a "Permission Denied"
  695. // error in IE
  696. unloadHandler = function() {
  697. setDocument();
  698. };
  699. // Optimize for push.apply( _, NodeList )
  700. try {
  701. push.apply(
  702. (arr = slice.call( preferredDoc.childNodes )),
  703. preferredDoc.childNodes
  704. );
  705. // Support: Android<4.0
  706. // Detect silently failing push.apply
  707. arr[ preferredDoc.childNodes.length ].nodeType;
  708. } catch ( e ) {
  709. push = { apply: arr.length ?
  710. // Leverage slice if possible
  711. function( target, els ) {
  712. push_native.apply( target, slice.call(els) );
  713. } :
  714. // Support: IE<9
  715. // Otherwise append directly
  716. function( target, els ) {
  717. var j = target.length,
  718. i = 0;
  719. // Can't trust NodeList.length
  720. while ( (target[j++] = els[i++]) ) {}
  721. target.length = j - 1;
  722. }
  723. };
  724. }
  725. function Sizzle( selector, context, results, seed ) {
  726. var match, elem, m, nodeType,
  727. // QSA vars
  728. i, groups, old, nid, newContext, newSelector;
  729. if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
  730. setDocument( context );
  731. }
  732. context = context || document;
  733. results = results || [];
  734. nodeType = context.nodeType;
  735. if ( typeof selector !== "string" || !selector ||
  736. nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
  737. return results;
  738. }
  739. if ( !seed && documentIsHTML ) {
  740. // Try to shortcut find operations when possible (e.g., not under DocumentFragment)
  741. if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
  742. // Speed-up: Sizzle("#ID")
  743. if ( (m = match[1]) ) {
  744. if ( nodeType === 9 ) {
  745. elem = context.getElementById( m );
  746. // Check parentNode to catch when Blackberry 4.6 returns
  747. // nodes that are no longer in the document (jQuery #6963)
  748. if ( elem && elem.parentNode ) {
  749. // Handle the case where IE, Opera, and Webkit return items
  750. // by name instead of ID
  751. if ( elem.id === m ) {
  752. results.push( elem );
  753. return results;
  754. }
  755. } else {
  756. return results;
  757. }
  758. } else {
  759. // Context is not a document
  760. if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
  761. contains( context, elem ) && elem.id === m ) {
  762. results.push( elem );
  763. return results;
  764. }
  765. }
  766. // Speed-up: Sizzle("TAG")
  767. } else if ( match[2] ) {
  768. push.apply( results, context.getElementsByTagName( selector ) );
  769. return results;
  770. // Speed-up: Sizzle(".CLASS")
  771. } else if ( (m = match[3]) && support.getElementsByClassName ) {
  772. push.apply( results, context.getElementsByClassName( m ) );
  773. return results;
  774. }
  775. }
  776. // QSA path
  777. if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
  778. nid = old = expando;
  779. newContext = context;
  780. newSelector = nodeType !== 1 && selector;
  781. // qSA works strangely on Element-rooted queries
  782. // We can work around this by specifying an extra ID on the root
  783. // and working up from there (Thanks to Andrew Dupont for the technique)
  784. // IE 8 doesn't work on object elements
  785. if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
  786. groups = tokenize( selector );
  787. if ( (old = context.getAttribute("id")) ) {
  788. nid = old.replace( rescape, "\\$&" );
  789. } else {
  790. context.setAttribute( "id", nid );
  791. }
  792. nid = "[id='" + nid + "'] ";
  793. i = groups.length;
  794. while ( i-- ) {
  795. groups[i] = nid + toSelector( groups[i] );
  796. }
  797. newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
  798. newSelector = groups.join(",");
  799. }
  800. if ( newSelector ) {
  801. try {
  802. push.apply( results,
  803. newContext.querySelectorAll( newSelector )
  804. );
  805. return results;
  806. } catch(qsaError) {
  807. } finally {
  808. if ( !old ) {
  809. context.removeAttribute("id");
  810. }
  811. }
  812. }
  813. }
  814. }
  815. // All others
  816. return select( selector.replace( rtrim, "$1" ), context, results, seed );
  817. }
  818. /**
  819. * Create key-value caches of limited size
  820. * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
  821. * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  822. * deleting the oldest entry
  823. */
  824. function createCache() {
  825. var keys = [];
  826. function cache( key, value ) {
  827. // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
  828. if ( keys.push( key + " " ) > Expr.cacheLength ) {
  829. // Only keep the most recent entries
  830. delete cache[ keys.shift() ];
  831. }
  832. return (cache[ key + " " ] = value);
  833. }
  834. return cache;
  835. }
  836. /**
  837. * Mark a function for special use by Sizzle
  838. * @param {Function} fn The function to mark
  839. */
  840. function markFunction( fn ) {
  841. fn[ expando ] = true;
  842. return fn;
  843. }
  844. /**
  845. * Support testing using an element
  846. * @param {Function} fn Passed the created div and expects a boolean result
  847. */
  848. function assert( fn ) {
  849. var div = document.createElement("div");
  850. try {
  851. return !!fn( div );
  852. } catch (e) {
  853. return false;
  854. } finally {
  855. // Remove from its parent by default
  856. if ( div.parentNode ) {
  857. div.parentNode.removeChild( div );
  858. }
  859. // release memory in IE
  860. div = null;
  861. }
  862. }
  863. /**
  864. * Adds the same handler for all of the specified attrs
  865. * @param {String} attrs Pipe-separated list of attributes
  866. * @param {Function} handler The method that will be applied
  867. */
  868. function addHandle( attrs, handler ) {
  869. var arr = attrs.split("|"),
  870. i = attrs.length;
  871. while ( i-- ) {
  872. Expr.attrHandle[ arr[i] ] = handler;
  873. }
  874. }
  875. /**
  876. * Checks document order of two siblings
  877. * @param {Element} a
  878. * @param {Element} b
  879. * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
  880. */
  881. function siblingCheck( a, b ) {
  882. var cur = b && a,
  883. diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
  884. ( ~b.sourceIndex || MAX_NEGATIVE ) -
  885. ( ~a.sourceIndex || MAX_NEGATIVE );
  886. // Use IE sourceIndex if available on both nodes
  887. if ( diff ) {
  888. return diff;
  889. }
  890. // Check if b follows a
  891. if ( cur ) {
  892. while ( (cur = cur.nextSibling) ) {
  893. if ( cur === b ) {
  894. return -1;
  895. }
  896. }
  897. }
  898. return a ? 1 : -1;
  899. }
  900. /**
  901. * Returns a function to use in pseudos for input types
  902. * @param {String} type
  903. */
  904. function createInputPseudo( type ) {
  905. return function( elem ) {
  906. var name = elem.nodeName.toLowerCase();
  907. return name === "input" && elem.type === type;
  908. };
  909. }
  910. /**
  911. * Returns a function to use in pseudos for buttons
  912. * @param {String} type
  913. */
  914. function createButtonPseudo( type ) {
  915. return function( elem ) {
  916. var name = elem.nodeName.toLowerCase();
  917. return (name === "input" || name === "button") && elem.type === type;
  918. };
  919. }
  920. /**
  921. * Returns a function to use in pseudos for positionals
  922. * @param {Function} fn
  923. */
  924. function createPositionalPseudo( fn ) {
  925. return markFunction(function( argument ) {
  926. argument = +argument;
  927. return markFunction(function( seed, matches ) {
  928. var j,
  929. matchIndexes = fn( [], seed.length, argument ),
  930. i = matchIndexes.length;
  931. // Match elements found at the specified indexes
  932. while ( i-- ) {
  933. if ( seed[ (j = matchIndexes[i]) ] ) {
  934. seed[j] = !(matches[j] = seed[j]);
  935. }
  936. }
  937. });
  938. });
  939. }
  940. /**
  941. * Checks a node for validity as a Sizzle context
  942. * @param {Element|Object=} context
  943. * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  944. */
  945. function testContext( context ) {
  946. return context && typeof context.getElementsByTagName !== "undefined" && context;
  947. }
  948. // Expose support vars for convenience
  949. support = Sizzle.support = {};
  950. /**
  951. * Detects XML nodes
  952. * @param {Element|Object} elem An element or a document
  953. * @returns {Boolean} True iff elem is a non-HTML XML node
  954. */
  955. isXML = Sizzle.isXML = function( elem ) {
  956. // documentElement is verified for cases where it doesn't yet exist
  957. // (such as loading iframes in IE - #4833)
  958. var documentElement = elem && (elem.ownerDocument || elem).documentElement;
  959. return documentElement ? documentElement.nodeName !== "HTML" : false;
  960. };
  961. /**
  962. * Sets document-related variables once based on the current document
  963. * @param {Element|Object} [doc] An element or document object to use to set the document
  964. * @returns {Object} Returns the current document
  965. */
  966. setDocument = Sizzle.setDocument = function( node ) {
  967. var hasCompare, parent,
  968. doc = node ? node.ownerDocument || node : preferredDoc;
  969. // If no document and documentElement is available, return
  970. if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
  971. return document;
  972. }
  973. // Set our document
  974. document = doc;
  975. docElem = doc.documentElement;
  976. parent = doc.defaultView;
  977. // Support: IE>8
  978. // If iframe document is assigned to "document" variable and if iframe has been reloaded,
  979. // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
  980. // IE6-8 do not support the defaultView property so parent will be undefined
  981. if ( parent && parent !== parent.top ) {
  982. // IE11 does not have attachEvent, so all must suffer
  983. if ( parent.addEventListener ) {
  984. parent.addEventListener( "unload", unloadHandler, false );
  985. } else if ( parent.attachEvent ) {
  986. parent.attachEvent( "onunload", unloadHandler );
  987. }
  988. }
  989. /* Support tests
  990. ---------------------------------------------------------------------- */
  991. documentIsHTML = !isXML( doc );
  992. /* Attributes
  993. ---------------------------------------------------------------------- */
  994. // Support: IE<8
  995. // Verify that getAttribute really returns attributes and not properties
  996. // (excepting IE8 booleans)
  997. support.attributes = assert(function( div ) {
  998. div.className = "i";
  999. return !div.getAttribute("className");
  1000. });
  1001. /* getElement(s)By*
  1002. ---------------------------------------------------------------------- */
  1003. // Check if getElementsByTagName("*") returns only elements
  1004. support.getElementsByTagName = assert(function( div ) {
  1005. div.appendChild( doc.createComment("") );
  1006. return !div.getElementsByTagName("*").length;
  1007. });
  1008. // Support: IE<9
  1009. support.getElementsByClassName = rnative.test( doc.getElementsByClassName );
  1010. // Support: IE<10
  1011. // Check if getElementById returns elements by name
  1012. // The broken getElementById methods don't pick up programatically-set names,
  1013. // so use a roundabout getElementsByName test
  1014. support.getById = assert(function( div ) {
  1015. docElem.appendChild( div ).id = expando;
  1016. return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
  1017. });
  1018. // ID find and filter
  1019. if ( support.getById ) {
  1020. Expr.find["ID"] = function( id, context ) {
  1021. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  1022. var m = context.getElementById( id );
  1023. // Check parentNode to catch when Blackberry 4.6 returns
  1024. // nodes that are no longer in the document #6963
  1025. return m && m.parentNode ? [ m ] : [];
  1026. }
  1027. };
  1028. Expr.filter["ID"] = function( id ) {
  1029. var attrId = id.replace( runescape, funescape );
  1030. return function( elem ) {
  1031. return elem.getAttribute("id") === attrId;
  1032. };
  1033. };
  1034. } else {
  1035. // Support: IE6/7
  1036. // getElementById is not reliable as a find shortcut
  1037. delete Expr.find["ID"];
  1038. Expr.filter["ID"] = function( id ) {
  1039. var attrId = id.replace( runescape, funescape );
  1040. return function( elem ) {
  1041. var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
  1042. return node && node.value === attrId;
  1043. };
  1044. };
  1045. }
  1046. // Tag
  1047. Expr.find["TAG"] = support.getElementsByTagName ?
  1048. function( tag, context ) {
  1049. if ( typeof context.getElementsByTagName !== "undefined" ) {
  1050. return context.getElementsByTagName( tag );
  1051. // DocumentFragment nodes don't have gEBTN
  1052. } else if ( support.qsa ) {
  1053. return context.querySelectorAll( tag );
  1054. }
  1055. } :
  1056. function( tag, context ) {
  1057. var elem,
  1058. tmp = [],
  1059. i = 0,
  1060. // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
  1061. results = context.getElementsByTagName( tag );
  1062. // Filter out possible comments
  1063. if ( tag === "*" ) {
  1064. while ( (elem = results[i++]) ) {
  1065. if ( elem.nodeType === 1 ) {
  1066. tmp.push( elem );
  1067. }
  1068. }
  1069. return tmp;
  1070. }
  1071. return results;
  1072. };
  1073. // Class
  1074. Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
  1075. if ( documentIsHTML ) {
  1076. return context.getElementsByClassName( className );
  1077. }
  1078. };
  1079. /* QSA/matchesSelector
  1080. ---------------------------------------------------------------------- */
  1081. // QSA and matchesSelector support
  1082. // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
  1083. rbuggyMatches = [];
  1084. // qSa(:focus) reports false when true (Chrome 21)
  1085. // We allow this because of a bug in IE8/9 that throws an error
  1086. // whenever `document.activeElement` is accessed on an iframe
  1087. // So, we allow :focus to pass through QSA all the time to avoid the IE error
  1088. // See http://bugs.jquery.com/ticket/13378
  1089. rbuggyQSA = [];
  1090. if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
  1091. // Build QSA regex
  1092. // Regex strategy adopted from Diego Perini
  1093. assert(function( div ) {
  1094. // Select is set to empty string on purpose
  1095. // This is to test IE's treatment of not explicitly
  1096. // setting a boolean content attribute,
  1097. // since its presence should be enough
  1098. // http://bugs.jquery.com/ticket/12359
  1099. docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" +
  1100. "<select id='" + expando + "-\f]' msallowcapture=''>" +
  1101. "<option selected=''></option></select>";
  1102. // Support: IE8, Opera 11-12.16
  1103. // Nothing should be selected when empty strings follow ^= or $= or *=
  1104. // The test attribute must be unknown in Opera but "safe" for WinRT
  1105. // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
  1106. if ( div.querySelectorAll("[msallowcapture^='']").length ) {
  1107. rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
  1108. }
  1109. // Support: IE8
  1110. // Boolean attributes and "value" are not treated correctly
  1111. if ( !div.querySelectorAll("[selected]").length ) {
  1112. rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  1113. }
  1114. // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+
  1115. if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
  1116. rbuggyQSA.push("~=");
  1117. }
  1118. // Webkit/Opera - :checked should return selected option elements
  1119. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  1120. // IE8 throws error here and will not see later tests
  1121. if ( !div.querySelectorAll(":checked").length ) {
  1122. rbuggyQSA.push(":checked");
  1123. }
  1124. // Support: Safari 8+, iOS 8+
  1125. // https://bugs.webkit.org/show_bug.cgi?id=136851
  1126. // In-page `selector#id sibing-combinator selector` fails
  1127. if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
  1128. rbuggyQSA.push(".#.+[+~]");
  1129. }
  1130. });
  1131. assert(function( div ) {
  1132. // Support: Windows 8 Native Apps
  1133. // The type and name attributes are restricted during .innerHTML assignment
  1134. var input = doc.createElement("input");
  1135. input.setAttribute( "type", "hidden" );
  1136. div.appendChild( input ).setAttribute( "name", "D" );
  1137. // Support: IE8
  1138. // Enforce case-sensitivity of name attribute
  1139. if ( div.querySelectorAll("[name=d]").length ) {
  1140. rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
  1141. }
  1142. // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
  1143. // IE8 throws error here and will not see later tests
  1144. if ( !div.querySelectorAll(":enabled").length ) {
  1145. rbuggyQSA.push( ":enabled", ":disabled" );
  1146. }
  1147. // Opera 10-11 does not throw on post-comma invalid pseudos
  1148. div.querySelectorAll("*,:x");
  1149. rbuggyQSA.push(",.*:");
  1150. });
  1151. }
  1152. if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
  1153. docElem.webkitMatchesSelector ||
  1154. docElem.mozMatchesSelector ||
  1155. docElem.oMatchesSelector ||
  1156. docElem.msMatchesSelector) )) ) {
  1157. assert(function( div ) {
  1158. // Check to see if it's possible to do matchesSelector
  1159. // on a disconnected node (IE 9)
  1160. support.disconnectedMatch = matches.call( div, "div" );
  1161. // This should fail with an exception
  1162. // Gecko does not error, returns false instead
  1163. matches.call( div, "[s!='']:x" );
  1164. rbuggyMatches.push( "!=", pseudos );
  1165. });
  1166. }
  1167. rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
  1168. rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
  1169. /* Contains
  1170. ---------------------------------------------------------------------- */
  1171. hasCompare = rnative.test( docElem.compareDocumentPosition );
  1172. // Element contains another
  1173. // Purposefully does not implement inclusive descendent
  1174. // As in, an element does not contain itself
  1175. contains = hasCompare || rnative.test( docElem.contains ) ?
  1176. function( a, b ) {
  1177. var adown = a.nodeType === 9 ? a.documentElement : a,
  1178. bup = b && b.parentNode;
  1179. return a === bup || !!( bup && bup.nodeType === 1 && (
  1180. adown.contains ?
  1181. adown.contains( bup ) :
  1182. a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  1183. ));
  1184. } :
  1185. function( a, b ) {
  1186. if ( b ) {
  1187. while ( (b = b.parentNode) ) {
  1188. if ( b === a ) {
  1189. return true;
  1190. }
  1191. }
  1192. }
  1193. return false;
  1194. };
  1195. /* Sorting
  1196. ---------------------------------------------------------------------- */
  1197. // Document order sorting
  1198. sortOrder = hasCompare ?
  1199. function( a, b ) {
  1200. // Flag for duplicate removal
  1201. if ( a === b ) {
  1202. hasDuplicate = true;
  1203. return 0;
  1204. }
  1205. // Sort on method existence if only one input has compareDocumentPosition
  1206. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  1207. if ( compare ) {
  1208. return compare;
  1209. }
  1210. // Calculate position if both inputs belong to the same document
  1211. compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
  1212. a.compareDocumentPosition( b ) :
  1213. // Otherwise we know they are disconnected
  1214. 1;
  1215. // Disconnected nodes
  1216. if ( compare & 1 ||
  1217. (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
  1218. // Choose the first element that is related to our preferred document
  1219. if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
  1220. return -1;
  1221. }
  1222. if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
  1223. return 1;
  1224. }
  1225. // Maintain original order
  1226. return sortInput ?
  1227. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  1228. 0;
  1229. }
  1230. return compare & 4 ? -1 : 1;
  1231. } :
  1232. function( a, b ) {
  1233. // Exit early if the nodes are identical
  1234. if ( a === b ) {
  1235. hasDuplicate = true;
  1236. return 0;
  1237. }
  1238. var cur,
  1239. i = 0,
  1240. aup = a.parentNode,
  1241. bup = b.parentNode,
  1242. ap = [ a ],
  1243. bp = [ b ];
  1244. // Parentless nodes are either documents or disconnected
  1245. if ( !aup || !bup ) {
  1246. return a === doc ? -1 :
  1247. b === doc ? 1 :
  1248. aup ? -1 :
  1249. bup ? 1 :
  1250. sortInput ?
  1251. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  1252. 0;
  1253. // If the nodes are siblings, we can do a quick check
  1254. } else if ( aup === bup ) {
  1255. return siblingCheck( a, b );
  1256. }
  1257. // Otherwise we need full lists of their ancestors for comparison
  1258. cur = a;
  1259. while ( (cur = cur.parentNode) ) {
  1260. ap.unshift( cur );
  1261. }
  1262. cur = b;
  1263. while ( (cur = cur.parentNode) ) {
  1264. bp.unshift( cur );
  1265. }
  1266. // Walk down the tree looking for a discrepancy
  1267. while ( ap[i] === bp[i] ) {
  1268. i++;
  1269. }
  1270. return i ?
  1271. // Do a sibling check if the nodes have a common ancestor
  1272. siblingCheck( ap[i], bp[i] ) :
  1273. // Otherwise nodes in our document sort first
  1274. ap[i] === preferredDoc ? -1 :
  1275. bp[i] === preferredDoc ? 1 :
  1276. 0;
  1277. };
  1278. return doc;
  1279. };
  1280. Sizzle.matches = function( expr, elements ) {
  1281. return Sizzle( expr, null, null, elements );
  1282. };
  1283. Sizzle.matchesSelector = function( elem, expr ) {
  1284. // Set document vars if needed
  1285. if ( ( elem.ownerDocument || elem ) !== document ) {
  1286. setDocument( elem );
  1287. }
  1288. // Make sure that attribute selectors are quoted
  1289. expr = expr.replace( rattributeQuotes, "='$1']" );
  1290. if ( support.matchesSelector && documentIsHTML &&
  1291. ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
  1292. ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
  1293. try {
  1294. var ret = matches.call( elem, expr );
  1295. // IE 9's matchesSelector returns false on disconnected nodes
  1296. if ( ret || support.disconnectedMatch ||
  1297. // As well, disconnected nodes are said to be in a document
  1298. // fragment in IE 9
  1299. elem.document && elem.document.nodeType !== 11 ) {
  1300. return ret;
  1301. }
  1302. } catch (e) {}
  1303. }
  1304. return Sizzle( expr, document, null, [ elem ] ).length > 0;
  1305. };
  1306. Sizzle.contains = function( context, elem ) {
  1307. // Set document vars if needed
  1308. if ( ( context.ownerDocument || context ) !== document ) {
  1309. setDocument( context );
  1310. }
  1311. return contains( context, elem );
  1312. };
  1313. Sizzle.attr = function( elem, name ) {
  1314. // Set document vars if needed
  1315. if ( ( elem.ownerDocument || elem ) !== document ) {
  1316. setDocument( elem );
  1317. }
  1318. var fn = Expr.attrHandle[ name.toLowerCase() ],
  1319. // Don't get fooled by Object.prototype properties (jQuery #13807)
  1320. val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  1321. fn( elem, name, !documentIsHTML ) :
  1322. undefined;
  1323. return val !== undefined ?
  1324. val :
  1325. support.attributes || !documentIsHTML ?
  1326. elem.getAttribute( name ) :
  1327. (val = elem.getAttributeNode(name)) && val.specified ?
  1328. val.value :
  1329. null;
  1330. };
  1331. Sizzle.error = function( msg ) {
  1332. throw new Error( "Syntax error, unrecognized expression: " + msg );
  1333. };
  1334. /**
  1335. * Document sorting and removing duplicates
  1336. * @param {ArrayLike} results
  1337. */
  1338. Sizzle.uniqueSort = function( results ) {
  1339. var elem,
  1340. duplicates = [],
  1341. j = 0,
  1342. i = 0;
  1343. // Unless we *know* we can detect duplicates, assume their presence
  1344. hasDuplicate = !support.detectDuplicates;
  1345. sortInput = !support.sortStable && results.slice( 0 );
  1346. results.sort( sortOrder );
  1347. if ( hasDuplicate ) {
  1348. while ( (elem = results[i++]) ) {
  1349. if ( elem === results[ i ] ) {
  1350. j = duplicates.push( i );
  1351. }
  1352. }
  1353. while ( j-- ) {
  1354. results.splice( duplicates[ j ], 1 );
  1355. }
  1356. }
  1357. // Clear input after sorting to release objects
  1358. // See https://github.com/jquery/sizzle/pull/225
  1359. sortInput = null;
  1360. return results;
  1361. };
  1362. /**
  1363. * Utility function for retrieving the text value of an array of DOM nodes
  1364. * @param {Array|Element} elem
  1365. */
  1366. getText = Sizzle.getText = function( elem ) {
  1367. var node,
  1368. ret = "",
  1369. i = 0,
  1370. nodeType = elem.nodeType;
  1371. if ( !nodeType ) {
  1372. // If no nodeType, this is expected to be an array
  1373. while ( (node = elem[i++]) ) {
  1374. // Do not traverse comment nodes
  1375. ret += getText( node );
  1376. }
  1377. } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
  1378. // Use textContent for elements
  1379. // innerText usage removed for consistency of new lines (jQuery #11153)
  1380. if ( typeof elem.textContent === "string" ) {
  1381. return elem.textContent;
  1382. } else {
  1383. // Traverse its children
  1384. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  1385. ret += getText( elem );
  1386. }
  1387. }
  1388. } else if ( nodeType === 3 || nodeType === 4 ) {
  1389. return elem.nodeValue;
  1390. }
  1391. // Do not include comment or processing instruction nodes
  1392. return ret;
  1393. };
  1394. Expr = Sizzle.selectors = {
  1395. // Can be adjusted by the user
  1396. cacheLength: 50,
  1397. createPseudo: markFunction,
  1398. match: matchExpr,
  1399. attrHandle: {},
  1400. find: {},
  1401. relative: {
  1402. ">": { dir: "parentNode", first: true },
  1403. " ": { dir: "parentNode" },
  1404. "+": { dir: "previousSibling", first: true },
  1405. "~": { dir: "previousSibling" }
  1406. },
  1407. preFilter: {
  1408. "ATTR": function( match ) {
  1409. match[1] = match[1].replace( runescape, funescape );
  1410. // Move the given value to match[3] whether quoted or unquoted
  1411. match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
  1412. if ( match[2] === "~=" ) {
  1413. match[3] = " " + match[3] + " ";
  1414. }
  1415. return match.slice( 0, 4 );
  1416. },
  1417. "CHILD": function( match ) {
  1418. /* matches from matchExpr["CHILD"]
  1419. 1 type (only|nth|...)
  1420. 2 what (child|of-type)
  1421. 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  1422. 4 xn-component of xn+y argument ([+-]?\d*n|)
  1423. 5 sign of xn-component
  1424. 6 x of xn-component
  1425. 7 sign of y-component
  1426. 8 y of y-component
  1427. */
  1428. match[1] = match[1].toLowerCase();
  1429. if ( match[1].slice( 0, 3 ) === "nth" ) {
  1430. // nth-* requires argument
  1431. if ( !match[3] ) {
  1432. Sizzle.error( match[0] );
  1433. }
  1434. // numeric x and y parameters for Expr.filter.CHILD
  1435. // remember that false/true cast respectively to 0/1
  1436. match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
  1437. match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
  1438. // other types prohibit arguments
  1439. } else if ( match[3] ) {
  1440. Sizzle.error( match[0] );
  1441. }
  1442. return match;
  1443. },
  1444. "PSEUDO": function( match ) {
  1445. var excess,
  1446. unquoted = !match[6] && match[2];
  1447. if ( matchExpr["CHILD"].test( match[0] ) ) {
  1448. return null;
  1449. }
  1450. // Accept quoted arguments as-is
  1451. if ( match[3] ) {
  1452. match[2] = match[4] || match[5] || "";
  1453. // Strip excess characters from unquoted arguments
  1454. } else if ( unquoted && rpseudo.test( unquoted ) &&
  1455. // Get excess from tokenize (recursively)
  1456. (excess = tokenize( unquoted, true )) &&
  1457. // advance to the next closing parenthesis
  1458. (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
  1459. // excess is a negative index
  1460. match[0] = match[0].slice( 0, excess );
  1461. match[2] = unquoted.slice( 0, excess );
  1462. }
  1463. // Return only captures needed by the pseudo filter method (type and argument)
  1464. return match.slice( 0, 3 );
  1465. }
  1466. },
  1467. filter: {
  1468. "TAG": function( nodeNameSelector ) {
  1469. var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  1470. return nodeNameSelector === "*" ?
  1471. function() { return true; } :
  1472. function( elem ) {
  1473. return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
  1474. };
  1475. },
  1476. "CLASS": function( className ) {
  1477. var pattern = classCache[ className + " " ];
  1478. return pattern ||
  1479. (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
  1480. classCache( className, function( elem ) {
  1481. return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
  1482. });
  1483. },
  1484. "ATTR": function( name, operator, check ) {
  1485. return function( elem ) {
  1486. var result = Sizzle.attr( elem, name );
  1487. if ( result == null ) {
  1488. return operator === "!=";
  1489. }
  1490. if ( !operator ) {
  1491. return true;
  1492. }
  1493. result += "";
  1494. return operator === "=" ? result === check :
  1495. operator === "!=" ? result !== check :
  1496. operator === "^=" ? check && result.indexOf( check ) === 0 :
  1497. operator === "*=" ? check && result.indexOf( check ) > -1 :
  1498. operator === "$=" ? check && result.slice( -check.length ) === check :
  1499. operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
  1500. operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
  1501. false;
  1502. };
  1503. },
  1504. "CHILD": function( type, what, argument, first, last ) {
  1505. var simple = type.slice( 0, 3 ) !== "nth",
  1506. forward = type.slice( -4 ) !== "last",
  1507. ofType = what === "of-type";
  1508. return first === 1 && last === 0 ?
  1509. // Shortcut for :nth-*(n)
  1510. function( elem ) {
  1511. return !!elem.parentNode;
  1512. } :
  1513. function( elem, context, xml ) {
  1514. var cache, outerCache, node, diff, nodeIndex, start,
  1515. dir = simple !== forward ? "nextSibling" : "previousSibling",
  1516. parent = elem.parentNode,
  1517. name = ofType && elem.nodeName.toLowerCase(),
  1518. useCache = !xml && !ofType;
  1519. if ( parent ) {
  1520. // :(first|last|only)-(child|of-type)
  1521. if ( simple ) {
  1522. while ( dir ) {
  1523. node = elem;
  1524. while ( (node = node[ dir ]) ) {
  1525. if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
  1526. return false;
  1527. }
  1528. }
  1529. // Reverse direction for :only-* (if we haven't yet done so)
  1530. start = dir = type === "only" && !start && "nextSibling";
  1531. }
  1532. return true;
  1533. }
  1534. start = [ forward ? parent.firstChild : parent.lastChild ];
  1535. // non-xml :nth-child(...) stores cache data on `parent`
  1536. if ( forward && useCache ) {
  1537. // Seek `elem` from a previously-cached index
  1538. outerCache = parent[ expando ] || (parent[ expando ] = {});
  1539. cache = outerCache[ type ] || [];
  1540. nodeIndex = cache[0] === dirruns && cache[1];
  1541. diff = cache[0] === dirruns && cache[2];
  1542. node = nodeIndex && parent.childNodes[ nodeIndex ];
  1543. while ( (node = ++nodeIndex && node && node[ dir ] ||
  1544. // Fallback to seeking `elem` from the start
  1545. (diff = nodeIndex = 0) || start.pop()) ) {
  1546. // When found, cache indexes on `parent` and break
  1547. if ( node.nodeType === 1 && ++diff && node === elem ) {
  1548. outerCache[ type ] = [ dirruns, nodeIndex, diff ];
  1549. break;
  1550. }
  1551. }
  1552. // Use previously-cached element index if available
  1553. } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
  1554. diff = cache[1];
  1555. // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
  1556. } else {
  1557. // Use the same loop as above to seek `elem` from the start
  1558. while ( (node = ++nodeIndex && node && node[ dir ] ||
  1559. (diff = nodeIndex = 0) || start.pop()) ) {
  1560. if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
  1561. // Cache the index of each encountered element
  1562. if ( useCache ) {
  1563. (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
  1564. }
  1565. if ( node === elem ) {
  1566. break;
  1567. }
  1568. }
  1569. }
  1570. }
  1571. // Incorporate the offset, then check against cycle size
  1572. diff -= last;
  1573. return diff === first || ( diff % first === 0 && diff / first >= 0 );
  1574. }
  1575. };
  1576. },
  1577. "PSEUDO": function( pseudo, argument ) {
  1578. // pseudo-class names are case-insensitive
  1579. // http://www.w3.org/TR/selectors/#pseudo-classes
  1580. // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  1581. // Remember that setFilters inherits from pseudos
  1582. var args,
  1583. fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  1584. Sizzle.error( "unsupported pseudo: " + pseudo );
  1585. // The user may use createPseudo to indicate that
  1586. // arguments are needed to create the filter function
  1587. // just as Sizzle does
  1588. if ( fn[ expando ] ) {
  1589. return fn( argument );
  1590. }
  1591. // But maintain support for old signatures
  1592. if ( fn.length > 1 ) {
  1593. args = [ pseudo, pseudo, "", argument ];
  1594. return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  1595. markFunction(function( seed, matches ) {
  1596. var idx,
  1597. matched = fn( seed, argument ),
  1598. i = matched.length;
  1599. while ( i-- ) {
  1600. idx = indexOf( seed, matched[i] );
  1601. seed[ idx ] = !( matches[ idx ] = matched[i] );
  1602. }
  1603. }) :
  1604. function( elem ) {
  1605. return fn( elem, 0, args );
  1606. };
  1607. }
  1608. return fn;
  1609. }
  1610. },
  1611. pseudos: {
  1612. // Potentially complex pseudos
  1613. "not": markFunction(function( selector ) {
  1614. // Trim the selector passed to compile
  1615. // to avoid treating leading and trailing
  1616. // spaces as combinators
  1617. var input = [],
  1618. results = [],
  1619. matcher = compile( selector.replace( rtrim, "$1" ) );
  1620. return matcher[ expando ] ?
  1621. markFunction(function( seed, matches, context, xml ) {
  1622. var elem,
  1623. unmatched = matcher( seed, null, xml, [] ),
  1624. i = seed.length;
  1625. // Match elements unmatched by `matcher`
  1626. while ( i-- ) {
  1627. if ( (elem = unmatched[i]) ) {
  1628. seed[i] = !(matches[i] = elem);
  1629. }
  1630. }
  1631. }) :
  1632. function( elem, context, xml ) {
  1633. input[0] = elem;
  1634. matcher( input, null, xml, results );
  1635. // Don't keep the element (issue #299)
  1636. input[0] = null;
  1637. return !results.pop();
  1638. };
  1639. }),
  1640. "has": markFunction(function( selector ) {
  1641. return function( elem ) {
  1642. return Sizzle( selector, elem ).length > 0;
  1643. };
  1644. }),
  1645. "contains": markFunction(function( text ) {
  1646. text = text.replace( runescape, funescape );
  1647. return function( elem ) {
  1648. return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
  1649. };
  1650. }),
  1651. // "Whether an element is represented by a :lang() selector
  1652. // is based solely on the element's language value
  1653. // being equal to the identifier C,
  1654. // or beginning with the identifier C immediately followed by "-".
  1655. // The matching of C against the element's language value is performed case-insensitively.
  1656. // The identifier C does not have to be a valid language name."
  1657. // http://www.w3.org/TR/selectors/#lang-pseudo
  1658. "lang": markFunction( function( lang ) {
  1659. // lang value must be a valid identifier
  1660. if ( !ridentifier.test(lang || "") ) {
  1661. Sizzle.error( "unsupported lang: " + lang );
  1662. }
  1663. lang = lang.replace( runescape, funescape ).toLowerCase();
  1664. return function( elem ) {
  1665. var elemLang;
  1666. do {
  1667. if ( (elemLang = documentIsHTML ?
  1668. elem.lang :
  1669. elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
  1670. elemLang = elemLang.toLowerCase();
  1671. return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  1672. }
  1673. } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
  1674. return false;
  1675. };
  1676. }),
  1677. // Miscellaneous
  1678. "target": function( elem ) {
  1679. var hash = window.location && window.location.hash;
  1680. return hash && hash.slice( 1 ) === elem.id;
  1681. },
  1682. "root": function( elem ) {
  1683. return elem === docElem;
  1684. },
  1685. "focus": function( elem ) {
  1686. return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
  1687. },
  1688. // Boolean properties
  1689. "enabled": function( elem ) {
  1690. return elem.disabled === false;
  1691. },
  1692. "disabled": function( elem ) {
  1693. return elem.disabled === true;
  1694. },
  1695. "checked": function( elem ) {
  1696. // In CSS3, :checked should return both checked and selected elements
  1697. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  1698. var nodeName = elem.nodeName.toLowerCase();
  1699. return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
  1700. },
  1701. "selected": function( elem ) {
  1702. // Accessing this property makes selected-by-default
  1703. // options in Safari work properly
  1704. if ( elem.parentNode ) {
  1705. elem.parentNode.selectedIndex;
  1706. }
  1707. return elem.selected === true;
  1708. },
  1709. // Contents
  1710. "empty": function( elem ) {
  1711. // http://www.w3.org/TR/selectors/#empty-pseudo
  1712. // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  1713. // but not by others (comment: 8; processing instruction: 7; etc.)
  1714. // nodeType < 6 works because attributes (2) do not appear as children
  1715. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  1716. if ( elem.nodeType < 6 ) {
  1717. return false;
  1718. }
  1719. }
  1720. return true;
  1721. },
  1722. "parent": function( elem ) {
  1723. return !Expr.pseudos["empty"]( elem );
  1724. },
  1725. // Element/input types
  1726. "header": function( elem ) {
  1727. return rheader.test( elem.nodeName );
  1728. },
  1729. "input": function( elem ) {
  1730. return rinputs.test( elem.nodeName );
  1731. },
  1732. "button": function( elem ) {
  1733. var name = elem.nodeName.toLowerCase();
  1734. return name === "input" && elem.type === "button" || name === "button";
  1735. },
  1736. "text": function( elem ) {
  1737. var attr;
  1738. return elem.nodeName.toLowerCase() === "input" &&
  1739. elem.type === "text" &&
  1740. // Support: IE<8
  1741. // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
  1742. ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
  1743. },
  1744. // Position-in-collection
  1745. "first": createPositionalPseudo(function() {
  1746. return [ 0 ];
  1747. }),
  1748. "last": createPositionalPseudo(function( matchIndexes, length ) {
  1749. return [ length - 1 ];
  1750. }),
  1751. "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
  1752. return [ argument < 0 ? argument + length : argument ];
  1753. }),
  1754. "even": createPositionalPseudo(function( matchIndexes, length ) {
  1755. var i = 0;
  1756. for ( ; i < length; i += 2 ) {
  1757. matchIndexes.push( i );
  1758. }
  1759. return matchIndexes;
  1760. }),
  1761. "odd": createPositionalPseudo(function( matchIndexes, length ) {
  1762. var i = 1;
  1763. for ( ; i < length; i += 2 ) {
  1764. matchIndexes.push( i );
  1765. }
  1766. return matchIndexes;
  1767. }),
  1768. "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  1769. var i = argument < 0 ? argument + length : argument;
  1770. for ( ; --i >= 0; ) {
  1771. matchIndexes.push( i );
  1772. }
  1773. return matchIndexes;
  1774. }),
  1775. "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  1776. var i = argument < 0 ? argument + length : argument;
  1777. for ( ; ++i < length; ) {
  1778. matchIndexes.push( i );
  1779. }
  1780. return matchIndexes;
  1781. })
  1782. }
  1783. };
  1784. Expr.pseudos["nth"] = Expr.pseudos["eq"];
  1785. // Add button/input type pseudos
  1786. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  1787. Expr.pseudos[ i ] = createInputPseudo( i );
  1788. }
  1789. for ( i in { submit: true, reset: true } ) {
  1790. Expr.pseudos[ i ] = createButtonPseudo( i );
  1791. }
  1792. // Easy API for creating new setFilters
  1793. function setFilters() {}
  1794. setFilters.prototype = Expr.filters = Expr.pseudos;
  1795. Expr.setFilters = new setFilters();
  1796. tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
  1797. var matched, match, tokens, type,
  1798. soFar, groups, preFilters,
  1799. cached = tokenCache[ selector + " " ];
  1800. if ( cached ) {
  1801. return parseOnly ? 0 : cached.slice( 0 );
  1802. }
  1803. soFar = selector;
  1804. groups = [];
  1805. preFilters = Expr.preFilter;
  1806. while ( soFar ) {
  1807. // Comma and first run
  1808. if ( !matched || (match = rcomma.exec( soFar )) ) {
  1809. if ( match ) {
  1810. // Don't consume trailing commas as valid
  1811. soFar = soFar.slice( match[0].length ) || soFar;
  1812. }
  1813. groups.push( (tokens = []) );
  1814. }
  1815. matched = false;
  1816. // Combinators
  1817. if ( (match = rcombinators.exec( soFar )) ) {
  1818. matched = match.shift();
  1819. tokens.push({
  1820. value: matched,
  1821. // Cast descendant combinators to space
  1822. type: match[0].replace( rtrim, " " )
  1823. });
  1824. soFar = soFar.slice( matched.length );
  1825. }
  1826. // Filters
  1827. for ( type in Expr.filter ) {
  1828. if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
  1829. (match = preFilters[ type ]( match ))) ) {
  1830. matched = match.shift();
  1831. tokens.push({
  1832. value: matched,
  1833. type: type,
  1834. matches: match
  1835. });
  1836. soFar = soFar.slice( matched.length );
  1837. }
  1838. }
  1839. if ( !matched ) {
  1840. break;
  1841. }
  1842. }
  1843. // Return the length of the invalid excess
  1844. // if we're just parsing
  1845. // Otherwise, throw an error or return tokens
  1846. return parseOnly ?
  1847. soFar.length :
  1848. soFar ?
  1849. Sizzle.error( selector ) :
  1850. // Cache the tokens
  1851. tokenCache( selector, groups ).slice( 0 );
  1852. };
  1853. function toSelector( tokens ) {
  1854. var i = 0,
  1855. len = tokens.length,
  1856. selector = "";
  1857. for ( ; i < len; i++ ) {
  1858. selector += tokens[i].value;
  1859. }
  1860. return selector;
  1861. }
  1862. function addCombinator( matcher, combinator, base ) {
  1863. var dir = combinator.dir,
  1864. checkNonElements = base && dir === "parentNode",
  1865. doneName = done++;
  1866. return combinator.first ?
  1867. // Check against closest ancestor/preceding element
  1868. function( elem, context, xml ) {
  1869. while ( (elem = elem[ dir ]) ) {
  1870. if ( elem.nodeType === 1 || checkNonElements ) {
  1871. return matcher( elem, context, xml );
  1872. }
  1873. }
  1874. } :
  1875. // Check against all ancestor/preceding elements
  1876. function( elem, context, xml ) {
  1877. var oldCache, outerCache,
  1878. newCache = [ dirruns, doneName ];
  1879. // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
  1880. if ( xml ) {
  1881. while ( (elem = elem[ dir ]) ) {
  1882. if ( elem.nodeType === 1 || checkNonElements ) {
  1883. if ( matcher( elem, context, xml ) ) {
  1884. return true;
  1885. }
  1886. }
  1887. }
  1888. } else {
  1889. while ( (elem = elem[ dir ]) ) {
  1890. if ( elem.nodeType === 1 || checkNonElements ) {
  1891. outerCache = elem[ expando ] || (elem[ expando ] = {});
  1892. if ( (oldCache = outerCache[ dir ]) &&
  1893. oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  1894. // Assign to newCache so results back-propagate to previous elements
  1895. return (newCache[ 2 ] = oldCache[ 2 ]);
  1896. } else {
  1897. // Reuse newcache so results back-propagate to previous elements
  1898. outerCache[ dir ] = newCache;
  1899. // A match means we're done; a fail means we have to keep checking
  1900. if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
  1901. return true;
  1902. }
  1903. }
  1904. }
  1905. }
  1906. }
  1907. };
  1908. }
  1909. function elementMatcher( matchers ) {
  1910. return matchers.length > 1 ?
  1911. function( elem, context, xml ) {
  1912. var i = matchers.length;
  1913. while ( i-- ) {
  1914. if ( !matchers[i]( elem, context, xml ) ) {
  1915. return false;
  1916. }
  1917. }
  1918. return true;
  1919. } :
  1920. matchers[0];
  1921. }
  1922. function multipleContexts( selector, contexts, results ) {
  1923. var i = 0,
  1924. len = contexts.length;
  1925. for ( ; i < len; i++ ) {
  1926. Sizzle( selector, contexts[i], results );
  1927. }
  1928. return results;
  1929. }
  1930. function condense( unmatched, map, filter, context, xml ) {
  1931. var elem,
  1932. newUnmatched = [],
  1933. i = 0,
  1934. len = unmatched.length,
  1935. mapped = map != null;
  1936. for ( ; i < len; i++ ) {
  1937. if ( (elem = unmatched[i]) ) {
  1938. if ( !filter || filter( elem, context, xml ) ) {
  1939. newUnmatched.push( elem );
  1940. if ( mapped ) {
  1941. map.push( i );
  1942. }
  1943. }
  1944. }
  1945. }
  1946. return newUnmatched;
  1947. }
  1948. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  1949. if ( postFilter && !postFilter[ expando ] ) {
  1950. postFilter = setMatcher( postFilter );
  1951. }
  1952. if ( postFinder && !postFinder[ expando ] ) {
  1953. postFinder = setMatcher( postFinder, postSelector );
  1954. }
  1955. return markFunction(function( seed, results, context, xml ) {
  1956. var temp, i, elem,
  1957. preMap = [],
  1958. postMap = [],
  1959. preexisting = results.length,
  1960. // Get initial elements from seed or context
  1961. elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
  1962. // Prefilter to get matcher input, preserving a map for seed-results synchronization
  1963. matcherIn = preFilter && ( seed || !selector ) ?
  1964. condense( elems, preMap, preFilter, context, xml ) :
  1965. elems,
  1966. matcherOut = matcher ?
  1967. // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
  1968. postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  1969. // ...intermediate processing is necessary
  1970. [] :
  1971. // ...otherwise use results directly
  1972. results :
  1973. matcherIn;
  1974. // Find primary matches
  1975. if ( matcher ) {
  1976. matcher( matcherIn, matcherOut, context, xml );
  1977. }
  1978. // Apply postFilter
  1979. if ( postFilter ) {
  1980. temp = condense( matcherOut, postMap );
  1981. postFilter( temp, [], context, xml );
  1982. // Un-match failing elements by moving them back to matcherIn
  1983. i = temp.length;
  1984. while ( i-- ) {
  1985. if ( (elem = temp[i]) ) {
  1986. matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
  1987. }
  1988. }
  1989. }
  1990. if ( seed ) {
  1991. if ( postFinder || preFilter ) {
  1992. if ( postFinder ) {
  1993. // Get the final matcherOut by condensing this intermediate into postFinder contexts
  1994. temp = [];
  1995. i = matcherOut.length;
  1996. while ( i-- ) {
  1997. if ( (elem = matcherOut[i]) ) {
  1998. // Restore matcherIn since elem is not yet a final match
  1999. temp.push( (matcherIn[i] = elem) );
  2000. }
  2001. }
  2002. postFinder( null, (matcherOut = []), temp, xml );
  2003. }
  2004. // Move matched elements from seed to results to keep them synchronized
  2005. i = matcherOut.length;
  2006. while ( i-- ) {
  2007. if ( (elem = matcherOut[i]) &&
  2008. (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
  2009. seed[temp] = !(results[temp] = elem);
  2010. }
  2011. }
  2012. }
  2013. // Add elements to results, through postFinder if defined
  2014. } else {
  2015. matcherOut = condense(
  2016. matcherOut === results ?
  2017. matcherOut.splice( preexisting, matcherOut.length ) :
  2018. matcherOut
  2019. );
  2020. if ( postFinder ) {
  2021. postFinder( null, results, matcherOut, xml );
  2022. } else {
  2023. push.apply( results, matcherOut );
  2024. }
  2025. }
  2026. });
  2027. }
  2028. function matcherFromTokens( tokens ) {
  2029. var checkContext, matcher, j,
  2030. len = tokens.length,
  2031. leadingRelative = Expr.relative[ tokens[0].type ],
  2032. implicitRelative = leadingRelative || Expr.relative[" "],
  2033. i = leadingRelative ? 1 : 0,
  2034. // The foundational matcher ensures that elements are reachable from top-level context(s)
  2035. matchContext = addCombinator( function( elem ) {
  2036. return elem === checkContext;
  2037. }, implicitRelative, true ),
  2038. matchAnyContext = addCombinator( function( elem ) {
  2039. return indexOf( checkContext, elem ) > -1;
  2040. }, implicitRelative, true ),
  2041. matchers = [ function( elem, context, xml ) {
  2042. var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
  2043. (checkContext = context).nodeType ?
  2044. matchContext( elem, context, xml ) :
  2045. matchAnyContext( elem, context, xml ) );
  2046. // Avoid hanging onto element (issue #299)
  2047. checkContext = null;
  2048. return ret;
  2049. } ];
  2050. for ( ; i < len; i++ ) {
  2051. if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
  2052. matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
  2053. } else {
  2054. matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
  2055. // Return special upon seeing a positional matcher
  2056. if ( matcher[ expando ] ) {
  2057. // Find the next relative operator (if any) for proper handling
  2058. j = ++i;
  2059. for ( ; j < len; j++ ) {
  2060. if ( Expr.relative[ tokens[j].type ] ) {
  2061. break;
  2062. }
  2063. }
  2064. return setMatcher(
  2065. i > 1 && elementMatcher( matchers ),
  2066. i > 1 && toSelector(
  2067. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  2068. tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
  2069. ).replace( rtrim, "$1" ),
  2070. matcher,
  2071. i < j && matcherFromTokens( tokens.slice( i, j ) ),
  2072. j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
  2073. j < len && toSelector( tokens )
  2074. );
  2075. }
  2076. matchers.push( matcher );
  2077. }
  2078. }
  2079. return elementMatcher( matchers );
  2080. }
  2081. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  2082. var bySet = setMatchers.length > 0,
  2083. byElement = elementMatchers.length > 0,
  2084. superMatcher = function( seed, context, xml, results, outermost ) {
  2085. var elem, j, matcher,
  2086. matchedCount = 0,
  2087. i = "0",
  2088. unmatched = seed && [],
  2089. setMatched = [],
  2090. contextBackup = outermostContext,
  2091. // We must always have either seed elements or outermost context
  2092. elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
  2093. // Use integer dirruns iff this is the outermost matcher
  2094. dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
  2095. len = elems.length;
  2096. if ( outermost ) {
  2097. outermostContext = context !== document && context;
  2098. }
  2099. // Add elements passing elementMatchers directly to results
  2100. // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
  2101. // Support: IE<9, Safari
  2102. // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
  2103. for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
  2104. if ( byElement && elem ) {
  2105. j = 0;
  2106. while ( (matcher = elementMatchers[j++]) ) {
  2107. if ( matcher( elem, context, xml ) ) {
  2108. results.push( elem );
  2109. break;
  2110. }
  2111. }
  2112. if ( outermost ) {
  2113. dirruns = dirrunsUnique;
  2114. }
  2115. }
  2116. // Track unmatched elements for set filters
  2117. if ( bySet ) {
  2118. // They will have gone through all possible matchers
  2119. if ( (elem = !matcher && elem) ) {
  2120. matchedCount--;
  2121. }
  2122. // Lengthen the array for every element, matched or not
  2123. if ( seed ) {
  2124. unmatched.push( elem );
  2125. }
  2126. }
  2127. }
  2128. // Apply set filters to unmatched elements
  2129. matchedCount += i;
  2130. if ( bySet && i !== matchedCount ) {
  2131. j = 0;
  2132. while ( (matcher = setMatchers[j++]) ) {
  2133. matcher( unmatched, setMatched, context, xml );
  2134. }
  2135. if ( seed ) {
  2136. // Reintegrate element matches to eliminate the need for sorting
  2137. if ( matchedCount > 0 ) {
  2138. while ( i-- ) {
  2139. if ( !(unmatched[i] || setMatched[i]) ) {
  2140. setMatched[i] = pop.call( results );
  2141. }
  2142. }
  2143. }
  2144. // Discard index placeholder values to get only actual matches
  2145. setMatched = condense( setMatched );
  2146. }
  2147. // Add matches to results
  2148. push.apply( results, setMatched );
  2149. // Seedless set matches succeeding multiple successful matchers stipulate sorting
  2150. if ( outermost && !seed && setMatched.length > 0 &&
  2151. ( matchedCount + setMatchers.length ) > 1 ) {
  2152. Sizzle.uniqueSort( results );
  2153. }
  2154. }
  2155. // Override manipulation of globals by nested matchers
  2156. if ( outermost ) {
  2157. dirruns = dirrunsUnique;
  2158. outermostContext = contextBackup;
  2159. }
  2160. return unmatched;
  2161. };
  2162. return bySet ?
  2163. markFunction( superMatcher ) :
  2164. superMatcher;
  2165. }
  2166. compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
  2167. var i,
  2168. setMatchers = [],
  2169. elementMatchers = [],
  2170. cached = compilerCache[ selector + " " ];
  2171. if ( !cached ) {
  2172. // Generate a function of recursive functions that can be used to check each element
  2173. if ( !match ) {
  2174. match = tokenize( selector );
  2175. }
  2176. i = match.length;
  2177. while ( i-- ) {
  2178. cached = matcherFromTokens( match[i] );
  2179. if ( cached[ expando ] ) {
  2180. setMatchers.push( cached );
  2181. } else {
  2182. elementMatchers.push( cached );
  2183. }
  2184. }
  2185. // Cache the compiled function
  2186. cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
  2187. // Save selector and tokenization
  2188. cached.selector = selector;
  2189. }
  2190. return cached;
  2191. };
  2192. /**
  2193. * A low-level selection function that works with Sizzle's compiled
  2194. * selector functions
  2195. * @param {String|Function} selector A selector or a pre-compiled
  2196. * selector function built with Sizzle.compile
  2197. * @param {Element} context
  2198. * @param {Array} [results]
  2199. * @param {Array} [seed] A set of elements to match against
  2200. */
  2201. select = Sizzle.select = function( selector, context, results, seed ) {
  2202. var i, tokens, token, type, find,
  2203. compiled = typeof selector === "function" && selector,
  2204. match = !seed && tokenize( (selector = compiled.selector || selector) );
  2205. results = results || [];
  2206. // Try to minimize operations if there is no seed and only one group
  2207. if ( match.length === 1 ) {
  2208. // Take a shortcut and set the context if the root selector is an ID
  2209. tokens = match[0] = match[0].slice( 0 );
  2210. if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
  2211. support.getById && context.nodeType === 9 && documentIsHTML &&
  2212. Expr.relative[ tokens[1].type ] ) {
  2213. context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
  2214. if ( !context ) {
  2215. return results;
  2216. // Precompiled matchers will still verify ancestry, so step up a level
  2217. } else if ( compiled ) {
  2218. context = context.parentNode;
  2219. }
  2220. selector = selector.slice( tokens.shift().value.length );
  2221. }
  2222. // Fetch a seed set for right-to-left matching
  2223. i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
  2224. while ( i-- ) {
  2225. token = tokens[i];
  2226. // Abort if we hit a combinator
  2227. if ( Expr.relative[ (type = token.type) ] ) {
  2228. break;
  2229. }
  2230. if ( (find = Expr.find[ type ]) ) {
  2231. // Search, expanding context for leading sibling combinators
  2232. if ( (seed = find(
  2233. token.matches[0].replace( runescape, funescape ),
  2234. rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
  2235. )) ) {
  2236. // If seed is empty or no tokens remain, we can return early
  2237. tokens.splice( i, 1 );
  2238. selector = seed.length && toSelector( tokens );
  2239. if ( !selector ) {
  2240. push.apply( results, seed );
  2241. return results;
  2242. }
  2243. break;
  2244. }
  2245. }
  2246. }
  2247. }
  2248. // Compile and execute a filtering function if one is not provided
  2249. // Provide `match` to avoid retokenization if we modified the selector above
  2250. ( compiled || compile( selector, match ) )(
  2251. seed,
  2252. context,
  2253. !documentIsHTML,
  2254. results,
  2255. rsibling.test( selector ) && testContext( context.parentNode ) || context
  2256. );
  2257. return results;
  2258. };
  2259. // One-time assignments
  2260. // Sort stability
  2261. support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
  2262. // Support: Chrome 14-35+
  2263. // Always assume duplicates if they aren't passed to the comparison function
  2264. support.detectDuplicates = !!hasDuplicate;
  2265. // Initialize against the default document
  2266. setDocument();
  2267. // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
  2268. // Detached nodes confoundingly follow *each other*
  2269. support.sortDetached = assert(function( div1 ) {
  2270. // Should return 1, but returns 4 (following)
  2271. return div1.compareDocumentPosition( document.createElement("div") ) & 1;
  2272. });
  2273. // Support: IE<8
  2274. // Prevent attribute/property "interpolation"
  2275. // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
  2276. if ( !assert(function( div ) {
  2277. div.innerHTML = "<a href='#'></a>";
  2278. return div.firstChild.getAttribute("href") === "#" ;
  2279. }) ) {
  2280. addHandle( "type|href|height|width", function( elem, name, isXML ) {
  2281. if ( !isXML ) {
  2282. return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
  2283. }
  2284. });
  2285. }
  2286. // Support: IE<9
  2287. // Use defaultValue in place of getAttribute("value")
  2288. if ( !support.attributes || !assert(function( div ) {
  2289. div.innerHTML = "<input/>";
  2290. div.firstChild.setAttribute( "value", "" );
  2291. return div.firstChild.getAttribute( "value" ) === "";
  2292. }) ) {
  2293. addHandle( "value", function( elem, name, isXML ) {
  2294. if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
  2295. return elem.defaultValue;
  2296. }
  2297. });
  2298. }
  2299. // Support: IE<9
  2300. // Use getAttributeNode to fetch booleans when getAttribute lies
  2301. if ( !assert(function( div ) {
  2302. return div.getAttribute("disabled") == null;
  2303. }) ) {
  2304. addHandle( booleans, function( elem, name, isXML ) {
  2305. var val;
  2306. if ( !isXML ) {
  2307. return elem[ name ] === true ? name.toLowerCase() :
  2308. (val = elem.getAttributeNode( name )) && val.specified ?
  2309. val.value :
  2310. null;
  2311. }
  2312. });
  2313. }
  2314. return Sizzle;
  2315. })( window );
  2316. jQuery.find = Sizzle;
  2317. jQuery.expr = Sizzle.selectors;
  2318. jQuery.expr[":"] = jQuery.expr.pseudos;
  2319. jQuery.unique = Sizzle.uniqueSort;
  2320. jQuery.text = Sizzle.getText;
  2321. jQuery.isXMLDoc = Sizzle.isXML;
  2322. jQuery.contains = Sizzle.contains;
  2323. var rneedsContext = jQuery.expr.match.needsContext;
  2324. var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
  2325. var risSimple = /^.[^:#\[\.,]*$/;
  2326. // Implement the identical functionality for filter and not
  2327. function winnow( elements, qualifier, not ) {
  2328. if ( jQuery.isFunction( qualifier ) ) {
  2329. return jQuery.grep( elements, function( elem, i ) {
  2330. /* jshint -W018 */
  2331. return !!qualifier.call( elem, i, elem ) !== not;
  2332. });
  2333. }
  2334. if ( qualifier.nodeType ) {
  2335. return jQuery.grep( elements, function( elem ) {
  2336. return ( elem === qualifier ) !== not;
  2337. });
  2338. }
  2339. if ( typeof qualifier === "string" ) {
  2340. if ( risSimple.test( qualifier ) ) {
  2341. return jQuery.filter( qualifier, elements, not );
  2342. }
  2343. qualifier = jQuery.filter( qualifier, elements );
  2344. }
  2345. return jQuery.grep( elements, function( elem ) {
  2346. return ( indexOf.call( qualifier, elem ) >= 0 ) !== not;
  2347. });
  2348. }
  2349. jQuery.filter = function( expr, elems, not ) {
  2350. var elem = elems[ 0 ];
  2351. if ( not ) {
  2352. expr = ":not(" + expr + ")";
  2353. }
  2354. return elems.length === 1 && elem.nodeType === 1 ?
  2355. jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
  2356. jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  2357. return elem.nodeType === 1;
  2358. }));
  2359. };
  2360. jQuery.fn.extend({
  2361. find: function( selector ) {
  2362. var i,
  2363. len = this.length,
  2364. ret = [],
  2365. self = this;
  2366. if ( typeof selector !== "string" ) {
  2367. return this.pushStack( jQuery( selector ).filter(function() {
  2368. for ( i = 0; i < len; i++ ) {
  2369. if ( jQuery.contains( self[ i ], this ) ) {
  2370. return true;
  2371. }
  2372. }
  2373. }) );
  2374. }
  2375. for ( i = 0; i < len; i++ ) {
  2376. jQuery.find( selector, self[ i ], ret );
  2377. }
  2378. // Needed because $( selector, context ) becomes $( context ).find( selector )
  2379. ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
  2380. ret.selector = this.selector ? this.selector + " " + selector : selector;
  2381. return ret;
  2382. },
  2383. filter: function( selector ) {
  2384. return this.pushStack( winnow(this, selector || [], false) );
  2385. },
  2386. not: function( selector ) {
  2387. return this.pushStack( winnow(this, selector || [], true) );
  2388. },
  2389. is: function( selector ) {
  2390. return !!winnow(
  2391. this,
  2392. // If this is a positional/relative selector, check membership in the returned set
  2393. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  2394. typeof selector === "string" && rneedsContext.test( selector ) ?
  2395. jQuery( selector ) :
  2396. selector || [],
  2397. false
  2398. ).length;
  2399. }
  2400. });
  2401. // Initialize a jQuery object
  2402. // A central reference to the root jQuery(document)
  2403. var rootjQuery,
  2404. // A simple way to check for HTML strings
  2405. // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
  2406. // Strict HTML recognition (#11290: must start with <)
  2407. rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
  2408. init = jQuery.fn.init = function( selector, context ) {
  2409. var match, elem;
  2410. // HANDLE: $(""), $(null), $(undefined), $(false)
  2411. if ( !selector ) {
  2412. return this;
  2413. }
  2414. // Handle HTML strings
  2415. if ( typeof selector === "string" ) {
  2416. if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) {
  2417. // Assume that strings that start and end with <> are HTML and skip the regex check
  2418. match = [ null, selector, null ];
  2419. } else {
  2420. match = rquickExpr.exec( selector );
  2421. }
  2422. // Match html or make sure no context is specified for #id
  2423. if ( match && (match[1] || !context) ) {
  2424. // HANDLE: $(html) -> $(array)
  2425. if ( match[1] ) {
  2426. context = context instanceof jQuery ? context[0] : context;
  2427. // Option to run scripts is true for back-compat
  2428. // Intentionally let the error be thrown if parseHTML is not present
  2429. jQuery.merge( this, jQuery.parseHTML(
  2430. match[1],
  2431. context && context.nodeType ? context.ownerDocument || context : document,
  2432. true
  2433. ) );
  2434. // HANDLE: $(html, props)
  2435. if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
  2436. for ( match in context ) {
  2437. // Properties of context are called as methods if possible
  2438. if ( jQuery.isFunction( this[ match ] ) ) {
  2439. this[ match ]( context[ match ] );
  2440. // ...and otherwise set as attributes
  2441. } else {
  2442. this.attr( match, context[ match ] );
  2443. }
  2444. }
  2445. }
  2446. return this;
  2447. // HANDLE: $(#id)
  2448. } else {
  2449. elem = document.getElementById( match[2] );
  2450. // Support: Blackberry 4.6
  2451. // gEBID returns nodes no longer in the document (#6963)
  2452. if ( elem && elem.parentNode ) {
  2453. // Inject the element directly into the jQuery object
  2454. this.length = 1;
  2455. this[0] = elem;
  2456. }
  2457. this.context = document;
  2458. this.selector = selector;
  2459. return this;
  2460. }
  2461. // HANDLE: $(expr, $(...))
  2462. } else if ( !context || context.jquery ) {
  2463. return ( context || rootjQuery ).find( selector );
  2464. // HANDLE: $(expr, context)
  2465. // (which is just equivalent to: $(context).find(expr)
  2466. } else {
  2467. return this.constructor( context ).find( selector );
  2468. }
  2469. // HANDLE: $(DOMElement)
  2470. } else if ( selector.nodeType ) {
  2471. this.context = this[0] = selector;
  2472. this.length = 1;
  2473. return this;
  2474. // HANDLE: $(function)
  2475. // Shortcut for document ready
  2476. } else if ( jQuery.isFunction( selector ) ) {
  2477. return typeof rootjQuery.ready !== "undefined" ?
  2478. rootjQuery.ready( selector ) :
  2479. // Execute immediately if ready is not present
  2480. selector( jQuery );
  2481. }
  2482. if ( selector.selector !== undefined ) {
  2483. this.selector = selector.selector;
  2484. this.context = selector.context;
  2485. }
  2486. return jQuery.makeArray( selector, this );
  2487. };
  2488. // Give the init function the jQuery prototype for later instantiation
  2489. init.prototype = jQuery.fn;
  2490. // Initialize central reference
  2491. rootjQuery = jQuery( document );
  2492. var rparentsprev = /^(?:parents|prev(?:Until|All))/,
  2493. // Methods guaranteed to produce a unique set when starting from a unique set
  2494. guaranteedUnique = {
  2495. children: true,
  2496. contents: true,
  2497. next: true,
  2498. prev: true
  2499. };
  2500. jQuery.extend({
  2501. dir: function( elem, dir, until ) {
  2502. var matched = [],
  2503. truncate = until !== undefined;
  2504. while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) {
  2505. if ( elem.nodeType === 1 ) {
  2506. if ( truncate && jQuery( elem ).is( until ) ) {
  2507. break;
  2508. }
  2509. matched.push( elem );
  2510. }
  2511. }
  2512. return matched;
  2513. },
  2514. sibling: function( n, elem ) {
  2515. var matched = [];
  2516. for ( ; n; n = n.nextSibling ) {
  2517. if ( n.nodeType === 1 && n !== elem ) {
  2518. matched.push( n );
  2519. }
  2520. }
  2521. return matched;
  2522. }
  2523. });
  2524. jQuery.fn.extend({
  2525. has: function( target ) {
  2526. var targets = jQuery( target, this ),
  2527. l = targets.length;
  2528. return this.filter(function() {
  2529. var i = 0;
  2530. for ( ; i < l; i++ ) {
  2531. if ( jQuery.contains( this, targets[i] ) ) {
  2532. return true;
  2533. }
  2534. }
  2535. });
  2536. },
  2537. closest: function( selectors, context ) {
  2538. var cur,
  2539. i = 0,
  2540. l = this.length,
  2541. matched = [],
  2542. pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
  2543. jQuery( selectors, context || this.context ) :
  2544. 0;
  2545. for ( ; i < l; i++ ) {
  2546. for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
  2547. // Always skip document fragments
  2548. if ( cur.nodeType < 11 && (pos ?
  2549. pos.index(cur) > -1 :
  2550. // Don't pass non-elements to Sizzle
  2551. cur.nodeType === 1 &&
  2552. jQuery.find.matchesSelector(cur, selectors)) ) {
  2553. matched.push( cur );
  2554. break;
  2555. }
  2556. }
  2557. }
  2558. return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
  2559. },
  2560. // Determine the position of an element within the set
  2561. index: function( elem ) {
  2562. // No argument, return index in parent
  2563. if ( !elem ) {
  2564. return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
  2565. }
  2566. // Index in selector
  2567. if ( typeof elem === "string" ) {
  2568. return indexOf.call( jQuery( elem ), this[ 0 ] );
  2569. }
  2570. // Locate the position of the desired element
  2571. return indexOf.call( this,
  2572. // If it receives a jQuery object, the first element is used
  2573. elem.jquery ? elem[ 0 ] : elem
  2574. );
  2575. },
  2576. add: function( selector, context ) {
  2577. return this.pushStack(
  2578. jQuery.unique(
  2579. jQuery.merge( this.get(), jQuery( selector, context ) )
  2580. )
  2581. );
  2582. },
  2583. addBack: function( selector ) {
  2584. return this.add( selector == null ?
  2585. this.prevObject : this.prevObject.filter(selector)
  2586. );
  2587. }
  2588. });
  2589. function sibling( cur, dir ) {
  2590. while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {}
  2591. return cur;
  2592. }
  2593. jQuery.each({
  2594. parent: function( elem ) {
  2595. var parent = elem.parentNode;
  2596. return parent && parent.nodeType !== 11 ? parent : null;
  2597. },
  2598. parents: function( elem ) {
  2599. return jQuery.dir( elem, "parentNode" );
  2600. },
  2601. parentsUntil: function( elem, i, until ) {
  2602. return jQuery.dir( elem, "parentNode", until );
  2603. },
  2604. next: function( elem ) {
  2605. return sibling( elem, "nextSibling" );
  2606. },
  2607. prev: function( elem ) {
  2608. return sibling( elem, "previousSibling" );
  2609. },
  2610. nextAll: function( elem ) {
  2611. return jQuery.dir( elem, "nextSibling" );
  2612. },
  2613. prevAll: function( elem ) {
  2614. return jQuery.dir( elem, "previousSibling" );
  2615. },
  2616. nextUntil: function( elem, i, until ) {
  2617. return jQuery.dir( elem, "nextSibling", until );
  2618. },
  2619. prevUntil: function( elem, i, until ) {
  2620. return jQuery.dir( elem, "previousSibling", until );
  2621. },
  2622. siblings: function( elem ) {
  2623. return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
  2624. },
  2625. children: function( elem ) {
  2626. return jQuery.sibling( elem.firstChild );
  2627. },
  2628. contents: function( elem ) {
  2629. return elem.contentDocument || jQuery.merge( [], elem.childNodes );
  2630. }
  2631. }, function( name, fn ) {
  2632. jQuery.fn[ name ] = function( until, selector ) {
  2633. var matched = jQuery.map( this, fn, until );
  2634. if ( name.slice( -5 ) !== "Until" ) {
  2635. selector = until;
  2636. }
  2637. if ( selector && typeof selector === "string" ) {
  2638. matched = jQuery.filter( selector, matched );
  2639. }
  2640. if ( this.length > 1 ) {
  2641. // Remove duplicates
  2642. if ( !guaranteedUnique[ name ] ) {
  2643. jQuery.unique( matched );
  2644. }
  2645. // Reverse order for parents* and prev-derivatives
  2646. if ( rparentsprev.test( name ) ) {
  2647. matched.reverse();
  2648. }
  2649. }
  2650. return this.pushStack( matched );
  2651. };
  2652. });
  2653. var rnotwhite = (/\S+/g);
  2654. // String to Object options format cache
  2655. var optionsCache = {};
  2656. // Convert String-formatted options into Object-formatted ones and store in cache
  2657. function createOptions( options ) {
  2658. var object = optionsCache[ options ] = {};
  2659. jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
  2660. object[ flag ] = true;
  2661. });
  2662. return object;
  2663. }
  2664. /*
  2665. * Create a callback list using the following parameters:
  2666. *
  2667. * options: an optional list of space-separated options that will change how
  2668. * the callback list behaves or a more traditional option object
  2669. *
  2670. * By default a callback list will act like an event callback list and can be
  2671. * "fired" multiple times.
  2672. *
  2673. * Possible options:
  2674. *
  2675. * once: will ensure the callback list can only be fired once (like a Deferred)
  2676. *
  2677. * memory: will keep track of previous values and will call any callback added
  2678. * after the list has been fired right away with the latest "memorized"
  2679. * values (like a Deferred)
  2680. *
  2681. * unique: will ensure a callback can only be added once (no duplicate in the list)
  2682. *
  2683. * stopOnFalse: interrupt callings when a callback returns false
  2684. *
  2685. */
  2686. jQuery.Callbacks = function( options ) {
  2687. // Convert options from String-formatted to Object-formatted if needed
  2688. // (we check in cache first)
  2689. options = typeof options === "string" ?
  2690. ( optionsCache[ options ] || createOptions( options ) ) :
  2691. jQuery.extend( {}, options );
  2692. var // Last fire value (for non-forgettable lists)
  2693. memory,
  2694. // Flag to know if list was already fired
  2695. fired,
  2696. // Flag to know if list is currently firing
  2697. firing,
  2698. // First callback to fire (used internally by add and fireWith)
  2699. firingStart,
  2700. // End of the loop when firing
  2701. firingLength,
  2702. // Index of currently firing callback (modified by remove if needed)
  2703. firingIndex,
  2704. // Actual callback list
  2705. list = [],
  2706. // Stack of fire calls for repeatable lists
  2707. stack = !options.once && [],
  2708. // Fire callbacks
  2709. fire = function( data ) {
  2710. memory = options.memory && data;
  2711. fired = true;
  2712. firingIndex = firingStart || 0;
  2713. firingStart = 0;
  2714. firingLength = list.length;
  2715. firing = true;
  2716. for ( ; list && firingIndex < firingLength; firingIndex++ ) {
  2717. if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
  2718. memory = false; // To prevent further calls using add
  2719. break;
  2720. }
  2721. }
  2722. firing = false;
  2723. if ( list ) {
  2724. if ( stack ) {
  2725. if ( stack.length ) {
  2726. fire( stack.shift() );
  2727. }
  2728. } else if ( memory ) {
  2729. list = [];
  2730. } else {
  2731. self.disable();
  2732. }
  2733. }
  2734. },
  2735. // Actual Callbacks object
  2736. self = {
  2737. // Add a callback or a collection of callbacks to the list
  2738. add: function() {
  2739. if ( list ) {
  2740. // First, we save the current length
  2741. var start = list.length;
  2742. (function add( args ) {
  2743. jQuery.each( args, function( _, arg ) {
  2744. var type = jQuery.type( arg );
  2745. if ( type === "function" ) {
  2746. if ( !options.unique || !self.has( arg ) ) {
  2747. list.push( arg );
  2748. }
  2749. } else if ( arg && arg.length && type !== "string" ) {
  2750. // Inspect recursively
  2751. add( arg );
  2752. }
  2753. });
  2754. })( arguments );
  2755. // Do we need to add the callbacks to the
  2756. // current firing batch?
  2757. if ( firing ) {
  2758. firingLength = list.length;
  2759. // With memory, if we're not firing then
  2760. // we should call right away
  2761. } else if ( memory ) {
  2762. firingStart = start;
  2763. fire( memory );
  2764. }
  2765. }
  2766. return this;
  2767. },
  2768. // Remove a callback from the list
  2769. remove: function() {
  2770. if ( list ) {
  2771. jQuery.each( arguments, function( _, arg ) {
  2772. var index;
  2773. while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  2774. list.splice( index, 1 );
  2775. // Handle firing indexes
  2776. if ( firing ) {
  2777. if ( index <= firingLength ) {
  2778. firingLength--;
  2779. }
  2780. if ( index <= firingIndex ) {
  2781. firingIndex--;
  2782. }
  2783. }
  2784. }
  2785. });
  2786. }
  2787. return this;
  2788. },
  2789. // Check if a given callback is in the list.
  2790. // If no argument is given, return whether or not list has callbacks attached.
  2791. has: function( fn ) {
  2792. return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
  2793. },
  2794. // Remove all callbacks from the list
  2795. empty: function() {
  2796. list = [];
  2797. firingLength = 0;
  2798. return this;
  2799. },
  2800. // Have the list do nothing anymore
  2801. disable: function() {
  2802. list = stack = memory = undefined;
  2803. return this;
  2804. },
  2805. // Is it disabled?
  2806. disabled: function() {
  2807. return !list;
  2808. },
  2809. // Lock the list in its current state
  2810. lock: function() {
  2811. stack = undefined;
  2812. if ( !memory ) {
  2813. self.disable();
  2814. }
  2815. return this;
  2816. },
  2817. // Is it locked?
  2818. locked: function() {
  2819. return !stack;
  2820. },
  2821. // Call all callbacks with the given context and arguments
  2822. fireWith: function( context, args ) {
  2823. if ( list && ( !fired || stack ) ) {
  2824. args = args || [];
  2825. args = [ context, args.slice ? args.slice() : args ];
  2826. if ( firing ) {
  2827. stack.push( args );
  2828. } else {
  2829. fire( args );
  2830. }
  2831. }
  2832. return this;
  2833. },
  2834. // Call all the callbacks with the given arguments
  2835. fire: function() {
  2836. self.fireWith( this, arguments );
  2837. return this;
  2838. },
  2839. // To know if the callbacks have already been called at least once
  2840. fired: function() {
  2841. return !!fired;
  2842. }
  2843. };
  2844. return self;
  2845. };
  2846. jQuery.extend({
  2847. Deferred: function( func ) {
  2848. var tuples = [
  2849. // action, add listener, listener list, final state
  2850. [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
  2851. [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
  2852. [ "notify", "progress", jQuery.Callbacks("memory") ]
  2853. ],
  2854. state = "pending",
  2855. promise = {
  2856. state: function() {
  2857. return state;
  2858. },
  2859. always: function() {
  2860. deferred.done( arguments ).fail( arguments );
  2861. return this;
  2862. },
  2863. then: function( /* fnDone, fnFail, fnProgress */ ) {
  2864. var fns = arguments;
  2865. return jQuery.Deferred(function( newDefer ) {
  2866. jQuery.each( tuples, function( i, tuple ) {
  2867. var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
  2868. // deferred[ done | fail | progress ] for forwarding actions to newDefer
  2869. deferred[ tuple[1] ](function() {
  2870. var returned = fn && fn.apply( this, arguments );
  2871. if ( returned && jQuery.isFunction( returned.promise ) ) {
  2872. returned.promise()
  2873. .done( newDefer.resolve )
  2874. .fail( newDefer.reject )
  2875. .progress( newDefer.notify );
  2876. } else {
  2877. newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
  2878. }
  2879. });
  2880. });
  2881. fns = null;
  2882. }).promise();
  2883. },
  2884. // Get a promise for this deferred
  2885. // If obj is provided, the promise aspect is added to the object
  2886. promise: function( obj ) {
  2887. return obj != null ? jQuery.extend( obj, promise ) : promise;
  2888. }
  2889. },
  2890. deferred = {};
  2891. // Keep pipe for back-compat
  2892. promise.pipe = promise.then;
  2893. // Add list-specific methods
  2894. jQuery.each( tuples, function( i, tuple ) {
  2895. var list = tuple[ 2 ],
  2896. stateString = tuple[ 3 ];
  2897. // promise[ done | fail | progress ] = list.add
  2898. promise[ tuple[1] ] = list.add;
  2899. // Handle state
  2900. if ( stateString ) {
  2901. list.add(function() {
  2902. // state = [ resolved | rejected ]
  2903. state = stateString;
  2904. // [ reject_list | resolve_list ].disable; progress_list.lock
  2905. }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
  2906. }
  2907. // deferred[ resolve | reject | notify ]
  2908. deferred[ tuple[0] ] = function() {
  2909. deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
  2910. return this;
  2911. };
  2912. deferred[ tuple[0] + "With" ] = list.fireWith;
  2913. });
  2914. // Make the deferred a promise
  2915. promise.promise( deferred );
  2916. // Call given func if any
  2917. if ( func ) {
  2918. func.call( deferred, deferred );
  2919. }
  2920. // All done!
  2921. return deferred;
  2922. },
  2923. // Deferred helper
  2924. when: function( subordinate /* , ..., subordinateN */ ) {
  2925. var i = 0,
  2926. resolveValues = slice.call( arguments ),
  2927. length = resolveValues.length,
  2928. // the count of uncompleted subordinates
  2929. remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
  2930. // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
  2931. deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
  2932. // Update function for both resolve and progress values
  2933. updateFunc = function( i, contexts, values ) {
  2934. return function( value ) {
  2935. contexts[ i ] = this;
  2936. values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
  2937. if ( values === progressValues ) {
  2938. deferred.notifyWith( contexts, values );
  2939. } else if ( !( --remaining ) ) {
  2940. deferred.resolveWith( contexts, values );
  2941. }
  2942. };
  2943. },
  2944. progressValues, progressContexts, resolveContexts;
  2945. // Add listeners to Deferred subordinates; treat others as resolved
  2946. if ( length > 1 ) {
  2947. progressValues = new Array( length );
  2948. progressContexts = new Array( length );
  2949. resolveContexts = new Array( length );
  2950. for ( ; i < length; i++ ) {
  2951. if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
  2952. resolveValues[ i ].promise()
  2953. .done( updateFunc( i, resolveContexts, resolveValues ) )
  2954. .fail( deferred.reject )
  2955. .progress( updateFunc( i, progressContexts, progressValues ) );
  2956. } else {
  2957. --remaining;
  2958. }
  2959. }
  2960. }
  2961. // If we're not waiting on anything, resolve the master
  2962. if ( !remaining ) {
  2963. deferred.resolveWith( resolveContexts, resolveValues );
  2964. }
  2965. return deferred.promise();
  2966. }
  2967. });
  2968. // The deferred used on DOM ready
  2969. var readyList;
  2970. jQuery.fn.ready = function( fn ) {
  2971. // Add the callback
  2972. jQuery.ready.promise().done( fn );
  2973. return this;
  2974. };
  2975. jQuery.extend({
  2976. // Is the DOM ready to be used? Set to true once it occurs.
  2977. isReady: false,
  2978. // A counter to track how many items to wait for before
  2979. // the ready event fires. See #6781
  2980. readyWait: 1,
  2981. // Hold (or release) the ready event
  2982. holdReady: function( hold ) {
  2983. if ( hold ) {
  2984. jQuery.readyWait++;
  2985. } else {
  2986. jQuery.ready( true );
  2987. }
  2988. },
  2989. // Handle when the DOM is ready
  2990. ready: function( wait ) {
  2991. // Abort if there are pending holds or we're already ready
  2992. if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
  2993. return;
  2994. }
  2995. // Remember that the DOM is ready
  2996. jQuery.isReady = true;
  2997. // If a normal DOM Ready event fired, decrement, and wait if need be
  2998. if ( wait !== true && --jQuery.readyWait > 0 ) {
  2999. return;
  3000. }
  3001. // If there are functions bound, to execute
  3002. readyList.resolveWith( document, [ jQuery ] );
  3003. // Trigger any bound ready events
  3004. if ( jQuery.fn.triggerHandler ) {
  3005. jQuery( document ).triggerHandler( "ready" );
  3006. jQuery( document ).off( "ready" );
  3007. }
  3008. }
  3009. });
  3010. /**
  3011. * The ready event handler and self cleanup method
  3012. */
  3013. function completed() {
  3014. document.removeEventListener( "DOMContentLoaded", completed, false );
  3015. window.removeEventListener( "load", completed, false );
  3016. jQuery.ready();
  3017. }
  3018. jQuery.ready.promise = function( obj ) {
  3019. if ( !readyList ) {
  3020. readyList = jQuery.Deferred();
  3021. // Catch cases where $(document).ready() is called after the browser event has already occurred.
  3022. // We once tried to use readyState "interactive" here, but it caused issues like the one
  3023. // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
  3024. if ( document.readyState === "complete" ) {
  3025. // Handle it asynchronously to allow scripts the opportunity to delay ready
  3026. setTimeout( jQuery.ready );
  3027. } else {
  3028. // Use the handy event callback
  3029. document.addEventListener( "DOMContentLoaded", completed, false );
  3030. // A fallback to window.onload, that will always work
  3031. window.addEventListener( "load", completed, false );
  3032. }
  3033. }
  3034. return readyList.promise( obj );
  3035. };
  3036. // Kick off the DOM ready check even if the user does not
  3037. jQuery.ready.promise();
  3038. // Multifunctional method to get and set values of a collection
  3039. // The value/s can optionally be executed if it's a function
  3040. var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
  3041. var i = 0,
  3042. len = elems.length,
  3043. bulk = key == null;
  3044. // Sets many values
  3045. if ( jQuery.type( key ) === "object" ) {
  3046. chainable = true;
  3047. for ( i in key ) {
  3048. jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
  3049. }
  3050. // Sets one value
  3051. } else if ( value !== undefined ) {
  3052. chainable = true;
  3053. if ( !jQuery.isFunction( value ) ) {
  3054. raw = true;
  3055. }
  3056. if ( bulk ) {
  3057. // Bulk operations run against the entire set
  3058. if ( raw ) {
  3059. fn.call( elems, value );
  3060. fn = null;
  3061. // ...except when executing function values
  3062. } else {
  3063. bulk = fn;
  3064. fn = function( elem, key, value ) {
  3065. return bulk.call( jQuery( elem ), value );
  3066. };
  3067. }
  3068. }
  3069. if ( fn ) {
  3070. for ( ; i < len; i++ ) {
  3071. fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
  3072. }
  3073. }
  3074. }
  3075. return chainable ?
  3076. elems :
  3077. // Gets
  3078. bulk ?
  3079. fn.call( elems ) :
  3080. len ? fn( elems[0], key ) : emptyGet;
  3081. };
  3082. /**
  3083. * Determines whether an object can have data
  3084. */
  3085. jQuery.acceptData = function( owner ) {
  3086. // Accepts only:
  3087. // - Node
  3088. // - Node.ELEMENT_NODE
  3089. // - Node.DOCUMENT_NODE
  3090. // - Object
  3091. // - Any
  3092. /* jshint -W018 */
  3093. return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
  3094. };
  3095. function Data() {
  3096. // Support: Android<4,
  3097. // Old WebKit does not have Object.preventExtensions/freeze method,
  3098. // return new empty object instead with no [[set]] accessor
  3099. Object.defineProperty( this.cache = {}, 0, {
  3100. get: function() {
  3101. return {};
  3102. }
  3103. });
  3104. this.expando = jQuery.expando + Data.uid++;
  3105. }
  3106. Data.uid = 1;
  3107. Data.accepts = jQuery.acceptData;
  3108. Data.prototype = {
  3109. key: function( owner ) {
  3110. // We can accept data for non-element nodes in modern browsers,
  3111. // but we should not, see #8335.
  3112. // Always return the key for a frozen object.
  3113. if ( !Data.accepts( owner ) ) {
  3114. return 0;
  3115. }
  3116. var descriptor = {},
  3117. // Check if the owner object already has a cache key
  3118. unlock = owner[ this.expando ];
  3119. // If not, create one
  3120. if ( !unlock ) {
  3121. unlock = Data.uid++;
  3122. // Secure it in a non-enumerable, non-writable property
  3123. try {
  3124. descriptor[ this.expando ] = { value: unlock };
  3125. Object.defineProperties( owner, descriptor );
  3126. // Support: Android<4
  3127. // Fallback to a less secure definition
  3128. } catch ( e ) {
  3129. descriptor[ this.expando ] = unlock;
  3130. jQuery.extend( owner, descriptor );
  3131. }
  3132. }
  3133. // Ensure the cache object
  3134. if ( !this.cache[ unlock ] ) {
  3135. this.cache[ unlock ] = {};
  3136. }
  3137. return unlock;
  3138. },
  3139. set: function( owner, data, value ) {
  3140. var prop,
  3141. // There may be an unlock assigned to this node,
  3142. // if there is no entry for this "owner", create one inline
  3143. // and set the unlock as though an owner entry had always existed
  3144. unlock = this.key( owner ),
  3145. cache = this.cache[ unlock ];
  3146. // Handle: [ owner, key, value ] args
  3147. if ( typeof data === "string" ) {
  3148. cache[ data ] = value;
  3149. // Handle: [ owner, { properties } ] args
  3150. } else {
  3151. // Fresh assignments by object are shallow copied
  3152. if ( jQuery.isEmptyObject( cache ) ) {
  3153. jQuery.extend( this.cache[ unlock ], data );
  3154. // Otherwise, copy the properties one-by-one to the cache object
  3155. } else {
  3156. for ( prop in data ) {
  3157. cache[ prop ] = data[ prop ];
  3158. }
  3159. }
  3160. }
  3161. return cache;
  3162. },
  3163. get: function( owner, key ) {
  3164. // Either a valid cache is found, or will be created.
  3165. // New caches will be created and the unlock returned,
  3166. // allowing direct access to the newly created
  3167. // empty data object. A valid owner object must be provided.
  3168. var cache = this.cache[ this.key( owner ) ];
  3169. return key === undefined ?
  3170. cache : cache[ key ];
  3171. },
  3172. access: function( owner, key, value ) {
  3173. var stored;
  3174. // In cases where either:
  3175. //
  3176. // 1. No key was specified
  3177. // 2. A string key was specified, but no value provided
  3178. //
  3179. // Take the "read" path and allow the get method to determine
  3180. // which value to return, respectively either:
  3181. //
  3182. // 1. The entire cache object
  3183. // 2. The data stored at the key
  3184. //
  3185. if ( key === undefined ||
  3186. ((key && typeof key === "string") && value === undefined) ) {
  3187. stored = this.get( owner, key );
  3188. return stored !== undefined ?
  3189. stored : this.get( owner, jQuery.camelCase(key) );
  3190. }
  3191. // [*]When the key is not a string, or both a key and value
  3192. // are specified, set or extend (existing objects) with either:
  3193. //
  3194. // 1. An object of properties
  3195. // 2. A key and value
  3196. //
  3197. this.set( owner, key, value );
  3198. // Since the "set" path can have two possible entry points
  3199. // return the expected data based on which path was taken[*]
  3200. return value !== undefined ? value : key;
  3201. },
  3202. remove: function( owner, key ) {
  3203. var i, name, camel,
  3204. unlock = this.key( owner ),
  3205. cache = this.cache[ unlock ];
  3206. if ( key === undefined ) {
  3207. this.cache[ unlock ] = {};
  3208. } else {
  3209. // Support array or space separated string of keys
  3210. if ( jQuery.isArray( key ) ) {
  3211. // If "name" is an array of keys...
  3212. // When data is initially created, via ("key", "val") signature,
  3213. // keys will be converted to camelCase.
  3214. // Since there is no way to tell _how_ a key was added, remove
  3215. // both plain key and camelCase key. #12786
  3216. // This will only penalize the array argument path.
  3217. name = key.concat( key.map( jQuery.camelCase ) );
  3218. } else {
  3219. camel = jQuery.camelCase( key );
  3220. // Try the string as a key before any manipulation
  3221. if ( key in cache ) {
  3222. name = [ key, camel ];
  3223. } else {
  3224. // If a key with the spaces exists, use it.
  3225. // Otherwise, create an array by matching non-whitespace
  3226. name = camel;
  3227. name = name in cache ?
  3228. [ name ] : ( name.match( rnotwhite ) || [] );
  3229. }
  3230. }
  3231. i = name.length;
  3232. while ( i-- ) {
  3233. delete cache[ name[ i ] ];
  3234. }
  3235. }
  3236. },
  3237. hasData: function( owner ) {
  3238. return !jQuery.isEmptyObject(
  3239. this.cache[ owner[ this.expando ] ] || {}
  3240. );
  3241. },
  3242. discard: function( owner ) {
  3243. if ( owner[ this.expando ] ) {
  3244. delete this.cache[ owner[ this.expando ] ];
  3245. }
  3246. }
  3247. };
  3248. var data_priv = new Data();
  3249. var data_user = new Data();
  3250. // Implementation Summary
  3251. //
  3252. // 1. Enforce API surface and semantic compatibility with 1.9.x branch
  3253. // 2. Improve the module's maintainability by reducing the storage
  3254. // paths to a single mechanism.
  3255. // 3. Use the same single mechanism to support "private" and "user" data.
  3256. // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
  3257. // 5. Avoid exposing implementation details on user objects (eg. expando properties)
  3258. // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
  3259. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  3260. rmultiDash = /([A-Z])/g;
  3261. function dataAttr( elem, key, data ) {
  3262. var name;
  3263. // If nothing was found internally, try to fetch any
  3264. // data from the HTML5 data-* attribute
  3265. if ( data === undefined && elem.nodeType === 1 ) {
  3266. name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
  3267. data = elem.getAttribute( name );
  3268. if ( typeof data === "string" ) {
  3269. try {
  3270. data = data === "true" ? true :
  3271. data === "false" ? false :
  3272. data === "null" ? null :
  3273. // Only convert to a number if it doesn't change the string
  3274. +data + "" === data ? +data :
  3275. rbrace.test( data ) ? jQuery.parseJSON( data ) :
  3276. data;
  3277. } catch( e ) {}
  3278. // Make sure we set the data so it isn't changed later
  3279. data_user.set( elem, key, data );
  3280. } else {
  3281. data = undefined;
  3282. }
  3283. }
  3284. return data;
  3285. }
  3286. jQuery.extend({
  3287. hasData: function( elem ) {
  3288. return data_user.hasData( elem ) || data_priv.hasData( elem );
  3289. },
  3290. data: function( elem, name, data ) {
  3291. return data_user.access( elem, name, data );
  3292. },
  3293. removeData: function( elem, name ) {
  3294. data_user.remove( elem, name );
  3295. },
  3296. // TODO: Now that all calls to _data and _removeData have been replaced
  3297. // with direct calls to data_priv methods, these can be deprecated.
  3298. _data: function( elem, name, data ) {
  3299. return data_priv.access( elem, name, data );
  3300. },
  3301. _removeData: function( elem, name ) {
  3302. data_priv.remove( elem, name );
  3303. }
  3304. });
  3305. jQuery.fn.extend({
  3306. data: function( key, value ) {
  3307. var i, name, data,
  3308. elem = this[ 0 ],
  3309. attrs = elem && elem.attributes;
  3310. // Gets all values
  3311. if ( key === undefined ) {
  3312. if ( this.length ) {
  3313. data = data_user.get( elem );
  3314. if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) {
  3315. i = attrs.length;
  3316. while ( i-- ) {
  3317. // Support: IE11+
  3318. // The attrs elements can be null (#14894)
  3319. if ( attrs[ i ] ) {
  3320. name = attrs[ i ].name;
  3321. if ( name.indexOf( "data-" ) === 0 ) {
  3322. name = jQuery.camelCase( name.slice(5) );
  3323. dataAttr( elem, name, data[ name ] );
  3324. }
  3325. }
  3326. }
  3327. data_priv.set( elem, "hasDataAttrs", true );
  3328. }
  3329. }
  3330. return data;
  3331. }
  3332. // Sets multiple values
  3333. if ( typeof key === "object" ) {
  3334. return this.each(function() {
  3335. data_user.set( this, key );
  3336. });
  3337. }
  3338. return access( this, function( value ) {
  3339. var data,
  3340. camelKey = jQuery.camelCase( key );
  3341. // The calling jQuery object (element matches) is not empty
  3342. // (and therefore has an element appears at this[ 0 ]) and the
  3343. // `value` parameter was not undefined. An empty jQuery object
  3344. // will result in `undefined` for elem = this[ 0 ] which will
  3345. // throw an exception if an attempt to read a data cache is made.
  3346. if ( elem && value === undefined ) {
  3347. // Attempt to get data from the cache
  3348. // with the key as-is
  3349. data = data_user.get( elem, key );
  3350. if ( data !== undefined ) {
  3351. return data;
  3352. }
  3353. // Attempt to get data from the cache
  3354. // with the key camelized
  3355. data = data_user.get( elem, camelKey );
  3356. if ( data !== undefined ) {
  3357. return data;
  3358. }
  3359. // Attempt to "discover" the data in
  3360. // HTML5 custom data-* attrs
  3361. data = dataAttr( elem, camelKey, undefined );
  3362. if ( data !== undefined ) {
  3363. return data;
  3364. }
  3365. // We tried really hard, but the data doesn't exist.
  3366. return;
  3367. }
  3368. // Set the data...
  3369. this.each(function() {
  3370. // First, attempt to store a copy or reference of any
  3371. // data that might've been store with a camelCased key.
  3372. var data = data_user.get( this, camelKey );
  3373. // For HTML5 data-* attribute interop, we have to
  3374. // store property names with dashes in a camelCase form.
  3375. // This might not apply to all properties...*
  3376. data_user.set( this, camelKey, value );
  3377. // *... In the case of properties that might _actually_
  3378. // have dashes, we need to also store a copy of that
  3379. // unchanged property.
  3380. if ( key.indexOf("-") !== -1 && data !== undefined ) {
  3381. data_user.set( this, key, value );
  3382. }
  3383. });
  3384. }, null, value, arguments.length > 1, null, true );
  3385. },
  3386. removeData: function( key ) {
  3387. return this.each(function() {
  3388. data_user.remove( this, key );
  3389. });
  3390. }
  3391. });
  3392. jQuery.extend({
  3393. queue: function( elem, type, data ) {
  3394. var queue;
  3395. if ( elem ) {
  3396. type = ( type || "fx" ) + "queue";
  3397. queue = data_priv.get( elem, type );
  3398. // Speed up dequeue by getting out quickly if this is just a lookup
  3399. if ( data ) {
  3400. if ( !queue || jQuery.isArray( data ) ) {
  3401. queue = data_priv.access( elem, type, jQuery.makeArray(data) );
  3402. } else {
  3403. queue.push( data );
  3404. }
  3405. }
  3406. return queue || [];
  3407. }
  3408. },
  3409. dequeue: function( elem, type ) {
  3410. type = type || "fx";
  3411. var queue = jQuery.queue( elem, type ),
  3412. startLength = queue.length,
  3413. fn = queue.shift(),
  3414. hooks = jQuery._queueHooks( elem, type ),
  3415. next = function() {
  3416. jQuery.dequeue( elem, type );
  3417. };
  3418. // If the fx queue is dequeued, always remove the progress sentinel
  3419. if ( fn === "inprogress" ) {
  3420. fn = queue.shift();
  3421. startLength--;
  3422. }
  3423. if ( fn ) {
  3424. // Add a progress sentinel to prevent the fx queue from being
  3425. // automatically dequeued
  3426. if ( type === "fx" ) {
  3427. queue.unshift( "inprogress" );
  3428. }
  3429. // Clear up the last queue stop function
  3430. delete hooks.stop;
  3431. fn.call( elem, next, hooks );
  3432. }
  3433. if ( !startLength && hooks ) {
  3434. hooks.empty.fire();
  3435. }
  3436. },
  3437. // Not public - generate a queueHooks object, or return the current one
  3438. _queueHooks: function( elem, type ) {
  3439. var key = type + "queueHooks";
  3440. return data_priv.get( elem, key ) || data_priv.access( elem, key, {
  3441. empty: jQuery.Callbacks("once memory").add(function() {
  3442. data_priv.remove( elem, [ type + "queue", key ] );
  3443. })
  3444. });
  3445. }
  3446. });
  3447. jQuery.fn.extend({
  3448. queue: function( type, data ) {
  3449. var setter = 2;
  3450. if ( typeof type !== "string" ) {
  3451. data = type;
  3452. type = "fx";
  3453. setter--;
  3454. }
  3455. if ( arguments.length < setter ) {
  3456. return jQuery.queue( this[0], type );
  3457. }
  3458. return data === undefined ?
  3459. this :
  3460. this.each(function() {
  3461. var queue = jQuery.queue( this, type, data );
  3462. // Ensure a hooks for this queue
  3463. jQuery._queueHooks( this, type );
  3464. if ( type === "fx" && queue[0] !== "inprogress" ) {
  3465. jQuery.dequeue( this, type );
  3466. }
  3467. });
  3468. },
  3469. dequeue: function( type ) {
  3470. return this.each(function() {
  3471. jQuery.dequeue( this, type );
  3472. });
  3473. },
  3474. clearQueue: function( type ) {
  3475. return this.queue( type || "fx", [] );
  3476. },
  3477. // Get a promise resolved when queues of a certain type
  3478. // are emptied (fx is the type by default)
  3479. promise: function( type, obj ) {
  3480. var tmp,
  3481. count = 1,
  3482. defer = jQuery.Deferred(),
  3483. elements = this,
  3484. i = this.length,
  3485. resolve = function() {
  3486. if ( !( --count ) ) {
  3487. defer.resolveWith( elements, [ elements ] );
  3488. }
  3489. };
  3490. if ( typeof type !== "string" ) {
  3491. obj = type;
  3492. type = undefined;
  3493. }
  3494. type = type || "fx";
  3495. while ( i-- ) {
  3496. tmp = data_priv.get( elements[ i ], type + "queueHooks" );
  3497. if ( tmp && tmp.empty ) {
  3498. count++;
  3499. tmp.empty.add( resolve );
  3500. }
  3501. }
  3502. resolve();
  3503. return defer.promise( obj );
  3504. }
  3505. });
  3506. var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
  3507. var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
  3508. var isHidden = function( elem, el ) {
  3509. // isHidden might be called from jQuery#filter function;
  3510. // in that case, element will be second argument
  3511. elem = el || elem;
  3512. return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
  3513. };
  3514. var rcheckableType = (/^(?:checkbox|radio)$/i);
  3515. (function() {
  3516. var fragment = document.createDocumentFragment(),
  3517. div = fragment.appendChild( document.createElement( "div" ) ),
  3518. input = document.createElement( "input" );
  3519. // Support: Safari<=5.1
  3520. // Check state lost if the name is set (#11217)
  3521. // Support: Windows Web Apps (WWA)
  3522. // `name` and `type` must use .setAttribute for WWA (#14901)
  3523. input.setAttribute( "type", "radio" );
  3524. input.setAttribute( "checked", "checked" );
  3525. input.setAttribute( "name", "t" );
  3526. div.appendChild( input );
  3527. // Support: Safari<=5.1, Android<4.2
  3528. // Older WebKit doesn't clone checked state correctly in fragments
  3529. support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
  3530. // Support: IE<=11+
  3531. // Make sure textarea (and checkbox) defaultValue is properly cloned
  3532. div.innerHTML = "<textarea>x</textarea>";
  3533. support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
  3534. })();
  3535. var strundefined = typeof undefined;
  3536. support.focusinBubbles = "onfocusin" in window;
  3537. var
  3538. rkeyEvent = /^key/,
  3539. rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
  3540. rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
  3541. rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
  3542. function returnTrue() {
  3543. return true;
  3544. }
  3545. function returnFalse() {
  3546. return false;
  3547. }
  3548. function safeActiveElement() {
  3549. try {
  3550. return document.activeElement;
  3551. } catch ( err ) { }
  3552. }
  3553. /*
  3554. * Helper functions for managing events -- not part of the public interface.
  3555. * Props to Dean Edwards' addEvent library for many of the ideas.
  3556. */
  3557. jQuery.event = {
  3558. global: {},
  3559. add: function( elem, types, handler, data, selector ) {
  3560. var handleObjIn, eventHandle, tmp,
  3561. events, t, handleObj,
  3562. special, handlers, type, namespaces, origType,
  3563. elemData = data_priv.get( elem );
  3564. // Don't attach events to noData or text/comment nodes (but allow plain objects)
  3565. if ( !elemData ) {
  3566. return;
  3567. }
  3568. // Caller can pass in an object of custom data in lieu of the handler
  3569. if ( handler.handler ) {
  3570. handleObjIn = handler;
  3571. handler = handleObjIn.handler;
  3572. selector = handleObjIn.selector;
  3573. }
  3574. // Make sure that the handler has a unique ID, used to find/remove it later
  3575. if ( !handler.guid ) {
  3576. handler.guid = jQuery.guid++;
  3577. }
  3578. // Init the element's event structure and main handler, if this is the first
  3579. if ( !(events = elemData.events) ) {
  3580. events = elemData.events = {};
  3581. }
  3582. if ( !(eventHandle = elemData.handle) ) {
  3583. eventHandle = elemData.handle = function( e ) {
  3584. // Discard the second event of a jQuery.event.trigger() and
  3585. // when an event is called after a page has unloaded
  3586. return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ?
  3587. jQuery.event.dispatch.apply( elem, arguments ) : undefined;
  3588. };
  3589. }
  3590. // Handle multiple events separated by a space
  3591. types = ( types || "" ).match( rnotwhite ) || [ "" ];
  3592. t = types.length;
  3593. while ( t-- ) {
  3594. tmp = rtypenamespace.exec( types[t] ) || [];
  3595. type = origType = tmp[1];
  3596. namespaces = ( tmp[2] || "" ).split( "." ).sort();
  3597. // There *must* be a type, no attaching namespace-only handlers
  3598. if ( !type ) {
  3599. continue;
  3600. }
  3601. // If event changes its type, use the special event handlers for the changed type
  3602. special = jQuery.event.special[ type ] || {};
  3603. // If selector defined, determine special event api type, otherwise given type
  3604. type = ( selector ? special.delegateType : special.bindType ) || type;
  3605. // Update special based on newly reset type
  3606. special = jQuery.event.special[ type ] || {};
  3607. // handleObj is passed to all event handlers
  3608. handleObj = jQuery.extend({
  3609. type: type,
  3610. origType: origType,
  3611. data: data,
  3612. handler: handler,
  3613. guid: handler.guid,
  3614. selector: selector,
  3615. needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
  3616. namespace: namespaces.join(".")
  3617. }, handleObjIn );
  3618. // Init the event handler queue if we're the first
  3619. if ( !(handlers = events[ type ]) ) {
  3620. handlers = events[ type ] = [];
  3621. handlers.delegateCount = 0;
  3622. // Only use addEventListener if the special events handler returns false
  3623. if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  3624. if ( elem.addEventListener ) {
  3625. elem.addEventListener( type, eventHandle, false );
  3626. }
  3627. }
  3628. }
  3629. if ( special.add ) {
  3630. special.add.call( elem, handleObj );
  3631. if ( !handleObj.handler.guid ) {
  3632. handleObj.handler.guid = handler.guid;
  3633. }
  3634. }
  3635. // Add to the element's handler list, delegates in front
  3636. if ( selector ) {
  3637. handlers.splice( handlers.delegateCount++, 0, handleObj );
  3638. } else {
  3639. handlers.push( handleObj );
  3640. }
  3641. // Keep track of which events have ever been used, for event optimization
  3642. jQuery.event.global[ type ] = true;
  3643. }
  3644. },
  3645. // Detach an event or set of events from an element
  3646. remove: function( elem, types, handler, selector, mappedTypes ) {
  3647. var j, origCount, tmp,
  3648. events, t, handleObj,
  3649. special, handlers, type, namespaces, origType,
  3650. elemData = data_priv.hasData( elem ) && data_priv.get( elem );
  3651. if ( !elemData || !(events = elemData.events) ) {
  3652. return;
  3653. }
  3654. // Once for each type.namespace in types; type may be omitted
  3655. types = ( types || "" ).match( rnotwhite ) || [ "" ];
  3656. t = types.length;
  3657. while ( t-- ) {
  3658. tmp = rtypenamespace.exec( types[t] ) || [];
  3659. type = origType = tmp[1];
  3660. namespaces = ( tmp[2] || "" ).split( "." ).sort();
  3661. // Unbind all events (on this namespace, if provided) for the element
  3662. if ( !type ) {
  3663. for ( type in events ) {
  3664. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  3665. }
  3666. continue;
  3667. }
  3668. special = jQuery.event.special[ type ] || {};
  3669. type = ( selector ? special.delegateType : special.bindType ) || type;
  3670. handlers = events[ type ] || [];
  3671. tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
  3672. // Remove matching events
  3673. origCount = j = handlers.length;
  3674. while ( j-- ) {
  3675. handleObj = handlers[ j ];
  3676. if ( ( mappedTypes || origType === handleObj.origType ) &&
  3677. ( !handler || handler.guid === handleObj.guid ) &&
  3678. ( !tmp || tmp.test( handleObj.namespace ) ) &&
  3679. ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
  3680. handlers.splice( j, 1 );
  3681. if ( handleObj.selector ) {
  3682. handlers.delegateCount--;
  3683. }
  3684. if ( special.remove ) {
  3685. special.remove.call( elem, handleObj );
  3686. }
  3687. }
  3688. }
  3689. // Remove generic event handler if we removed something and no more handlers exist
  3690. // (avoids potential for endless recursion during removal of special event handlers)
  3691. if ( origCount && !handlers.length ) {
  3692. if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
  3693. jQuery.removeEvent( elem, type, elemData.handle );
  3694. }
  3695. delete events[ type ];
  3696. }
  3697. }
  3698. // Remove the expando if it's no longer used
  3699. if ( jQuery.isEmptyObject( events ) ) {
  3700. delete elemData.handle;
  3701. data_priv.remove( elem, "events" );
  3702. }
  3703. },
  3704. trigger: function( event, data, elem, onlyHandlers ) {
  3705. var i, cur, tmp, bubbleType, ontype, handle, special,
  3706. eventPath = [ elem || document ],
  3707. type = hasOwn.call( event, "type" ) ? event.type : event,
  3708. namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
  3709. cur = tmp = elem = elem || document;
  3710. // Don't do events on text and comment nodes
  3711. if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  3712. return;
  3713. }
  3714. // focus/blur morphs to focusin/out; ensure we're not firing them right now
  3715. if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
  3716. return;
  3717. }
  3718. if ( type.indexOf(".") >= 0 ) {
  3719. // Namespaced trigger; create a regexp to match event type in handle()
  3720. namespaces = type.split(".");
  3721. type = namespaces.shift();
  3722. namespaces.sort();
  3723. }
  3724. ontype = type.indexOf(":") < 0 && "on" + type;
  3725. // Caller can pass in a jQuery.Event object, Object, or just an event type string
  3726. event = event[ jQuery.expando ] ?
  3727. event :
  3728. new jQuery.Event( type, typeof event === "object" && event );
  3729. // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
  3730. event.isTrigger = onlyHandlers ? 2 : 3;
  3731. event.namespace = namespaces.join(".");
  3732. event.namespace_re = event.namespace ?
  3733. new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
  3734. null;
  3735. // Clean up the event in case it is being reused
  3736. event.result = undefined;
  3737. if ( !event.target ) {
  3738. event.target = elem;
  3739. }
  3740. // Clone any incoming data and prepend the event, creating the handler arg list
  3741. data = data == null ?
  3742. [ event ] :
  3743. jQuery.makeArray( data, [ event ] );
  3744. // Allow special events to draw outside the lines
  3745. special = jQuery.event.special[ type ] || {};
  3746. if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
  3747. return;
  3748. }
  3749. // Determine event propagation path in advance, per W3C events spec (#9951)
  3750. // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
  3751. if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
  3752. bubbleType = special.delegateType || type;
  3753. if ( !rfocusMorph.test( bubbleType + type ) ) {
  3754. cur = cur.parentNode;
  3755. }
  3756. for ( ; cur; cur = cur.parentNode ) {
  3757. eventPath.push( cur );
  3758. tmp = cur;
  3759. }
  3760. // Only add window if we got to document (e.g., not plain obj or detached DOM)
  3761. if ( tmp === (elem.ownerDocument || document) ) {
  3762. eventPath.push( tmp.defaultView || tmp.parentWindow || window );
  3763. }
  3764. }
  3765. // Fire handlers on the event path
  3766. i = 0;
  3767. while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
  3768. event.type = i > 1 ?
  3769. bubbleType :
  3770. special.bindType || type;
  3771. // jQuery handler
  3772. handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" );
  3773. if ( handle ) {
  3774. handle.apply( cur, data );
  3775. }
  3776. // Native handler
  3777. handle = ontype && cur[ ontype ];
  3778. if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
  3779. event.result = handle.apply( cur, data );
  3780. if ( event.result === false ) {
  3781. event.preventDefault();
  3782. }
  3783. }
  3784. }
  3785. event.type = type;
  3786. // If nobody prevented the default action, do it now
  3787. if ( !onlyHandlers && !event.isDefaultPrevented() ) {
  3788. if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
  3789. jQuery.acceptData( elem ) ) {
  3790. // Call a native DOM method on the target with the same name name as the event.
  3791. // Don't do default actions on window, that's where global variables be (#6170)
  3792. if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
  3793. // Don't re-trigger an onFOO event when we call its FOO() method
  3794. tmp = elem[ ontype ];
  3795. if ( tmp ) {
  3796. elem[ ontype ] = null;
  3797. }
  3798. // Prevent re-triggering of the same event, since we already bubbled it above
  3799. jQuery.event.triggered = type;
  3800. elem[ type ]();
  3801. jQuery.event.triggered = undefined;
  3802. if ( tmp ) {
  3803. elem[ ontype ] = tmp;
  3804. }
  3805. }
  3806. }
  3807. }
  3808. return event.result;
  3809. },
  3810. dispatch: function( event ) {
  3811. // Make a writable jQuery.Event from the native event object
  3812. event = jQuery.event.fix( event );
  3813. var i, j, ret, matched, handleObj,
  3814. handlerQueue = [],
  3815. args = slice.call( arguments ),
  3816. handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [],
  3817. special = jQuery.event.special[ event.type ] || {};
  3818. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  3819. args[0] = event;
  3820. event.delegateTarget = this;
  3821. // Call the preDispatch hook for the mapped type, and let it bail if desired
  3822. if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
  3823. return;
  3824. }
  3825. // Determine handlers
  3826. handlerQueue = jQuery.event.handlers.call( this, event, handlers );
  3827. // Run delegates first; they may want to stop propagation beneath us
  3828. i = 0;
  3829. while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
  3830. event.currentTarget = matched.elem;
  3831. j = 0;
  3832. while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
  3833. // Triggered event must either 1) have no namespace, or 2) have namespace(s)
  3834. // a subset or equal to those in the bound event (both can have no namespace).
  3835. if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
  3836. event.handleObj = handleObj;
  3837. event.data = handleObj.data;
  3838. ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
  3839. .apply( matched.elem, args );
  3840. if ( ret !== undefined ) {
  3841. if ( (event.result = ret) === false ) {
  3842. event.preventDefault();
  3843. event.stopPropagation();
  3844. }
  3845. }
  3846. }
  3847. }
  3848. }
  3849. // Call the postDispatch hook for the mapped type
  3850. if ( special.postDispatch ) {
  3851. special.postDispatch.call( this, event );
  3852. }
  3853. return event.result;
  3854. },
  3855. handlers: function( event, handlers ) {
  3856. var i, matches, sel, handleObj,
  3857. handlerQueue = [],
  3858. delegateCount = handlers.delegateCount,
  3859. cur = event.target;
  3860. // Find delegate handlers
  3861. // Black-hole SVG <use> instance trees (#13180)
  3862. // Avoid non-left-click bubbling in Firefox (#3861)
  3863. if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
  3864. for ( ; cur !== this; cur = cur.parentNode || this ) {
  3865. // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
  3866. if ( cur.disabled !== true || event.type !== "click" ) {
  3867. matches = [];
  3868. for ( i = 0; i < delegateCount; i++ ) {
  3869. handleObj = handlers[ i ];
  3870. // Don't conflict with Object.prototype properties (#13203)
  3871. sel = handleObj.selector + " ";
  3872. if ( matches[ sel ] === undefined ) {
  3873. matches[ sel ] = handleObj.needsContext ?
  3874. jQuery( sel, this ).index( cur ) >= 0 :
  3875. jQuery.find( sel, this, null, [ cur ] ).length;
  3876. }
  3877. if ( matches[ sel ] ) {
  3878. matches.push( handleObj );
  3879. }
  3880. }
  3881. if ( matches.length ) {
  3882. handlerQueue.push({ elem: cur, handlers: matches });
  3883. }
  3884. }
  3885. }
  3886. }
  3887. // Add the remaining (directly-bound) handlers
  3888. if ( delegateCount < handlers.length ) {
  3889. handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
  3890. }
  3891. return handlerQueue;
  3892. },
  3893. // Includes some event props shared by KeyEvent and MouseEvent
  3894. props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
  3895. fixHooks: {},
  3896. keyHooks: {
  3897. props: "char charCode key keyCode".split(" "),
  3898. filter: function( event, original ) {
  3899. // Add which for key events
  3900. if ( event.which == null ) {
  3901. event.which = original.charCode != null ? original.charCode : original.keyCode;
  3902. }
  3903. return event;
  3904. }
  3905. },
  3906. mouseHooks: {
  3907. props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
  3908. filter: function( event, original ) {
  3909. var eventDoc, doc, body,
  3910. button = original.button;
  3911. // Calculate pageX/Y if missing and clientX/Y available
  3912. if ( event.pageX == null && original.clientX != null ) {
  3913. eventDoc = event.target.ownerDocument || document;
  3914. doc = eventDoc.documentElement;
  3915. body = eventDoc.body;
  3916. event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
  3917. event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
  3918. }
  3919. // Add which for click: 1 === left; 2 === middle; 3 === right
  3920. // Note: button is not normalized, so don't use it
  3921. if ( !event.which && button !== undefined ) {
  3922. event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
  3923. }
  3924. return event;
  3925. }
  3926. },
  3927. fix: function( event ) {
  3928. if ( event[ jQuery.expando ] ) {
  3929. return event;
  3930. }
  3931. // Create a writable copy of the event object and normalize some properties
  3932. var i, prop, copy,
  3933. type = event.type,
  3934. originalEvent = event,
  3935. fixHook = this.fixHooks[ type ];
  3936. if ( !fixHook ) {
  3937. this.fixHooks[ type ] = fixHook =
  3938. rmouseEvent.test( type ) ? this.mouseHooks :
  3939. rkeyEvent.test( type ) ? this.keyHooks :
  3940. {};
  3941. }
  3942. copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
  3943. event = new jQuery.Event( originalEvent );
  3944. i = copy.length;
  3945. while ( i-- ) {
  3946. prop = copy[ i ];
  3947. event[ prop ] = originalEvent[ prop ];
  3948. }
  3949. // Support: Cordova 2.5 (WebKit) (#13255)
  3950. // All events should have a target; Cordova deviceready doesn't
  3951. if ( !event.target ) {
  3952. event.target = document;
  3953. }
  3954. // Support: Safari 6.0+, Chrome<28
  3955. // Target should not be a text node (#504, #13143)
  3956. if ( event.target.nodeType === 3 ) {
  3957. event.target = event.target.parentNode;
  3958. }
  3959. return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
  3960. },
  3961. special: {
  3962. load: {
  3963. // Prevent triggered image.load events from bubbling to window.load
  3964. noBubble: true
  3965. },
  3966. focus: {
  3967. // Fire native event if possible so blur/focus sequence is correct
  3968. trigger: function() {
  3969. if ( this !== safeActiveElement() && this.focus ) {
  3970. this.focus();
  3971. return false;
  3972. }
  3973. },
  3974. delegateType: "focusin"
  3975. },
  3976. blur: {
  3977. trigger: function() {
  3978. if ( this === safeActiveElement() && this.blur ) {
  3979. this.blur();
  3980. return false;
  3981. }
  3982. },
  3983. delegateType: "focusout"
  3984. },
  3985. click: {
  3986. // For checkbox, fire native event so checked state will be right
  3987. trigger: function() {
  3988. if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
  3989. this.click();
  3990. return false;
  3991. }
  3992. },
  3993. // For cross-browser consistency, don't fire native .click() on links
  3994. _default: function( event ) {
  3995. return jQuery.nodeName( event.target, "a" );
  3996. }
  3997. },
  3998. beforeunload: {
  3999. postDispatch: function( event ) {
  4000. // Support: Firefox 20+
  4001. // Firefox doesn't alert if the returnValue field is not set.
  4002. if ( event.result !== undefined && event.originalEvent ) {
  4003. event.originalEvent.returnValue = event.result;
  4004. }
  4005. }
  4006. }
  4007. },
  4008. simulate: function( type, elem, event, bubble ) {
  4009. // Piggyback on a donor event to simulate a different one.
  4010. // Fake originalEvent to avoid donor's stopPropagation, but if the
  4011. // simulated event prevents default then we do the same on the donor.
  4012. var e = jQuery.extend(
  4013. new jQuery.Event(),
  4014. event,
  4015. {
  4016. type: type,
  4017. isSimulated: true,
  4018. originalEvent: {}
  4019. }
  4020. );
  4021. if ( bubble ) {
  4022. jQuery.event.trigger( e, null, elem );
  4023. } else {
  4024. jQuery.event.dispatch.call( elem, e );
  4025. }
  4026. if ( e.isDefaultPrevented() ) {
  4027. event.preventDefault();
  4028. }
  4029. }
  4030. };
  4031. jQuery.removeEvent = function( elem, type, handle ) {
  4032. if ( elem.removeEventListener ) {
  4033. elem.removeEventListener( type, handle, false );
  4034. }
  4035. };
  4036. jQuery.Event = function( src, props ) {
  4037. // Allow instantiation without the 'new' keyword
  4038. if ( !(this instanceof jQuery.Event) ) {
  4039. return new jQuery.Event( src, props );
  4040. }
  4041. // Event object
  4042. if ( src && src.type ) {
  4043. this.originalEvent = src;
  4044. this.type = src.type;
  4045. // Events bubbling up the document may have been marked as prevented
  4046. // by a handler lower down the tree; reflect the correct value.
  4047. this.isDefaultPrevented = src.defaultPrevented ||
  4048. src.defaultPrevented === undefined &&
  4049. // Support: Android<4.0
  4050. src.returnValue === false ?
  4051. returnTrue :
  4052. returnFalse;
  4053. // Event type
  4054. } else {
  4055. this.type = src;
  4056. }
  4057. // Put explicitly provided properties onto the event object
  4058. if ( props ) {
  4059. jQuery.extend( this, props );
  4060. }
  4061. // Create a timestamp if incoming event doesn't have one
  4062. this.timeStamp = src && src.timeStamp || jQuery.now();
  4063. // Mark it as fixed
  4064. this[ jQuery.expando ] = true;
  4065. };
  4066. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  4067. // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  4068. jQuery.Event.prototype = {
  4069. isDefaultPrevented: returnFalse,
  4070. isPropagationStopped: returnFalse,
  4071. isImmediatePropagationStopped: returnFalse,
  4072. preventDefault: function() {
  4073. var e = this.originalEvent;
  4074. this.isDefaultPrevented = returnTrue;
  4075. if ( e && e.preventDefault ) {
  4076. e.preventDefault();
  4077. }
  4078. },
  4079. stopPropagation: function() {
  4080. var e = this.originalEvent;
  4081. this.isPropagationStopped = returnTrue;
  4082. if ( e && e.stopPropagation ) {
  4083. e.stopPropagation();
  4084. }
  4085. },
  4086. stopImmediatePropagation: function() {
  4087. var e = this.originalEvent;
  4088. this.isImmediatePropagationStopped = returnTrue;
  4089. if ( e && e.stopImmediatePropagation ) {
  4090. e.stopImmediatePropagation();
  4091. }
  4092. this.stopPropagation();
  4093. }
  4094. };
  4095. // Create mouseenter/leave events using mouseover/out and event-time checks
  4096. // Support: Chrome 15+
  4097. jQuery.each({
  4098. mouseenter: "mouseover",
  4099. mouseleave: "mouseout",
  4100. pointerenter: "pointerover",
  4101. pointerleave: "pointerout"
  4102. }, function( orig, fix ) {
  4103. jQuery.event.special[ orig ] = {
  4104. delegateType: fix,
  4105. bindType: fix,
  4106. handle: function( event ) {
  4107. var ret,
  4108. target = this,
  4109. related = event.relatedTarget,
  4110. handleObj = event.handleObj;
  4111. // For mousenter/leave call the handler if related is outside the target.
  4112. // NB: No relatedTarget if the mouse left/entered the browser window
  4113. if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
  4114. event.type = handleObj.origType;
  4115. ret = handleObj.handler.apply( this, arguments );
  4116. event.type = fix;
  4117. }
  4118. return ret;
  4119. }
  4120. };
  4121. });
  4122. // Support: Firefox, Chrome, Safari
  4123. // Create "bubbling" focus and blur events
  4124. if ( !support.focusinBubbles ) {
  4125. jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
  4126. // Attach a single capturing handler on the document while someone wants focusin/focusout
  4127. var handler = function( event ) {
  4128. jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
  4129. };
  4130. jQuery.event.special[ fix ] = {
  4131. setup: function() {
  4132. var doc = this.ownerDocument || this,
  4133. attaches = data_priv.access( doc, fix );
  4134. if ( !attaches ) {
  4135. doc.addEventListener( orig, handler, true );
  4136. }
  4137. data_priv.access( doc, fix, ( attaches || 0 ) + 1 );
  4138. },
  4139. teardown: function() {
  4140. var doc = this.ownerDocument || this,
  4141. attaches = data_priv.access( doc, fix ) - 1;
  4142. if ( !attaches ) {
  4143. doc.removeEventListener( orig, handler, true );
  4144. data_priv.remove( doc, fix );
  4145. } else {
  4146. data_priv.access( doc, fix, attaches );
  4147. }
  4148. }
  4149. };
  4150. });
  4151. }
  4152. jQuery.fn.extend({
  4153. on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
  4154. var origFn, type;
  4155. // Types can be a map of types/handlers
  4156. if ( typeof types === "object" ) {
  4157. // ( types-Object, selector, data )
  4158. if ( typeof selector !== "string" ) {
  4159. // ( types-Object, data )
  4160. data = data || selector;
  4161. selector = undefined;
  4162. }
  4163. for ( type in types ) {
  4164. this.on( type, selector, data, types[ type ], one );
  4165. }
  4166. return this;
  4167. }
  4168. if ( data == null && fn == null ) {
  4169. // ( types, fn )
  4170. fn = selector;
  4171. data = selector = undefined;
  4172. } else if ( fn == null ) {
  4173. if ( typeof selector === "string" ) {
  4174. // ( types, selector, fn )
  4175. fn = data;
  4176. data = undefined;
  4177. } else {
  4178. // ( types, data, fn )
  4179. fn = data;
  4180. data = selector;
  4181. selector = undefined;
  4182. }
  4183. }
  4184. if ( fn === false ) {
  4185. fn = returnFalse;
  4186. } else if ( !fn ) {
  4187. return this;
  4188. }
  4189. if ( one === 1 ) {
  4190. origFn = fn;
  4191. fn = function( event ) {
  4192. // Can use an empty set, since event contains the info
  4193. jQuery().off( event );
  4194. return origFn.apply( this, arguments );
  4195. };
  4196. // Use same guid so caller can remove using origFn
  4197. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  4198. }
  4199. return this.each( function() {
  4200. jQuery.event.add( this, types, fn, data, selector );
  4201. });
  4202. },
  4203. one: function( types, selector, data, fn ) {
  4204. return this.on( types, selector, data, fn, 1 );
  4205. },
  4206. off: function( types, selector, fn ) {
  4207. var handleObj, type;
  4208. if ( types && types.preventDefault && types.handleObj ) {
  4209. // ( event ) dispatched jQuery.Event
  4210. handleObj = types.handleObj;
  4211. jQuery( types.delegateTarget ).off(
  4212. handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
  4213. handleObj.selector,
  4214. handleObj.handler
  4215. );
  4216. return this;
  4217. }
  4218. if ( typeof types === "object" ) {
  4219. // ( types-object [, selector] )
  4220. for ( type in types ) {
  4221. this.off( type, selector, types[ type ] );
  4222. }
  4223. return this;
  4224. }
  4225. if ( selector === false || typeof selector === "function" ) {
  4226. // ( types [, fn] )
  4227. fn = selector;
  4228. selector = undefined;
  4229. }
  4230. if ( fn === false ) {
  4231. fn = returnFalse;
  4232. }
  4233. return this.each(function() {
  4234. jQuery.event.remove( this, types, fn, selector );
  4235. });
  4236. },
  4237. trigger: function( type, data ) {
  4238. return this.each(function() {
  4239. jQuery.event.trigger( type, data, this );
  4240. });
  4241. },
  4242. triggerHandler: function( type, data ) {
  4243. var elem = this[0];
  4244. if ( elem ) {
  4245. return jQuery.event.trigger( type, data, elem, true );
  4246. }
  4247. }
  4248. });
  4249. var
  4250. rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
  4251. rtagName = /<([\w:]+)/,
  4252. rhtml = /<|&#?\w+;/,
  4253. rnoInnerhtml = /<(?:script|style|link)/i,
  4254. // checked="checked" or checked
  4255. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  4256. rscriptType = /^$|\/(?:java|ecma)script/i,
  4257. rscriptTypeMasked = /^true\/(.*)/,
  4258. rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
  4259. // We have to close these tags to support XHTML (#13200)
  4260. wrapMap = {
  4261. // Support: IE9
  4262. option: [ 1, "<select multiple='multiple'>", "</select>" ],
  4263. thead: [ 1, "<table>", "</table>" ],
  4264. col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
  4265. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  4266. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  4267. _default: [ 0, "", "" ]
  4268. };
  4269. // Support: IE9
  4270. wrapMap.optgroup = wrapMap.option;
  4271. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  4272. wrapMap.th = wrapMap.td;
  4273. // Support: 1.x compatibility
  4274. // Manipulating tables requires a tbody
  4275. function manipulationTarget( elem, content ) {
  4276. return jQuery.nodeName( elem, "table" ) &&
  4277. jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
  4278. elem.getElementsByTagName("tbody")[0] ||
  4279. elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
  4280. elem;
  4281. }
  4282. // Replace/restore the type attribute of script elements for safe DOM manipulation
  4283. function disableScript( elem ) {
  4284. elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
  4285. return elem;
  4286. }
  4287. function restoreScript( elem ) {
  4288. var match = rscriptTypeMasked.exec( elem.type );
  4289. if ( match ) {
  4290. elem.type = match[ 1 ];
  4291. } else {
  4292. elem.removeAttribute("type");
  4293. }
  4294. return elem;
  4295. }
  4296. // Mark scripts as having already been evaluated
  4297. function setGlobalEval( elems, refElements ) {
  4298. var i = 0,
  4299. l = elems.length;
  4300. for ( ; i < l; i++ ) {
  4301. data_priv.set(
  4302. elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" )
  4303. );
  4304. }
  4305. }
  4306. function cloneCopyEvent( src, dest ) {
  4307. var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
  4308. if ( dest.nodeType !== 1 ) {
  4309. return;
  4310. }
  4311. // 1. Copy private data: events, handlers, etc.
  4312. if ( data_priv.hasData( src ) ) {
  4313. pdataOld = data_priv.access( src );
  4314. pdataCur = data_priv.set( dest, pdataOld );
  4315. events = pdataOld.events;
  4316. if ( events ) {
  4317. delete pdataCur.handle;
  4318. pdataCur.events = {};
  4319. for ( type in events ) {
  4320. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  4321. jQuery.event.add( dest, type, events[ type ][ i ] );
  4322. }
  4323. }
  4324. }
  4325. }
  4326. // 2. Copy user data
  4327. if ( data_user.hasData( src ) ) {
  4328. udataOld = data_user.access( src );
  4329. udataCur = jQuery.extend( {}, udataOld );
  4330. data_user.set( dest, udataCur );
  4331. }
  4332. }
  4333. function getAll( context, tag ) {
  4334. var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) :
  4335. context.querySelectorAll ? context.querySelectorAll( tag || "*" ) :
  4336. [];
  4337. return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
  4338. jQuery.merge( [ context ], ret ) :
  4339. ret;
  4340. }
  4341. // Fix IE bugs, see support tests
  4342. function fixInput( src, dest ) {
  4343. var nodeName = dest.nodeName.toLowerCase();
  4344. // Fails to persist the checked state of a cloned checkbox or radio button.
  4345. if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
  4346. dest.checked = src.checked;
  4347. // Fails to return the selected option to the default selected state when cloning options
  4348. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  4349. dest.defaultValue = src.defaultValue;
  4350. }
  4351. }
  4352. jQuery.extend({
  4353. clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  4354. var i, l, srcElements, destElements,
  4355. clone = elem.cloneNode( true ),
  4356. inPage = jQuery.contains( elem.ownerDocument, elem );
  4357. // Fix IE cloning issues
  4358. if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
  4359. !jQuery.isXMLDoc( elem ) ) {
  4360. // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
  4361. destElements = getAll( clone );
  4362. srcElements = getAll( elem );
  4363. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  4364. fixInput( srcElements[ i ], destElements[ i ] );
  4365. }
  4366. }
  4367. // Copy the events from the original to the clone
  4368. if ( dataAndEvents ) {
  4369. if ( deepDataAndEvents ) {
  4370. srcElements = srcElements || getAll( elem );
  4371. destElements = destElements || getAll( clone );
  4372. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  4373. cloneCopyEvent( srcElements[ i ], destElements[ i ] );
  4374. }
  4375. } else {
  4376. cloneCopyEvent( elem, clone );
  4377. }
  4378. }
  4379. // Preserve script evaluation history
  4380. destElements = getAll( clone, "script" );
  4381. if ( destElements.length > 0 ) {
  4382. setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
  4383. }
  4384. // Return the cloned set
  4385. return clone;
  4386. },
  4387. buildFragment: function( elems, context, scripts, selection ) {
  4388. var elem, tmp, tag, wrap, contains, j,
  4389. fragment = context.createDocumentFragment(),
  4390. nodes = [],
  4391. i = 0,
  4392. l = elems.length;
  4393. for ( ; i < l; i++ ) {
  4394. elem = elems[ i ];
  4395. if ( elem || elem === 0 ) {
  4396. // Add nodes directly
  4397. if ( jQuery.type( elem ) === "object" ) {
  4398. // Support: QtWebKit, PhantomJS
  4399. // push.apply(_, arraylike) throws on ancient WebKit
  4400. jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
  4401. // Convert non-html into a text node
  4402. } else if ( !rhtml.test( elem ) ) {
  4403. nodes.push( context.createTextNode( elem ) );
  4404. // Convert html into DOM nodes
  4405. } else {
  4406. tmp = tmp || fragment.appendChild( context.createElement("div") );
  4407. // Deserialize a standard representation
  4408. tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
  4409. wrap = wrapMap[ tag ] || wrapMap._default;
  4410. tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[ 2 ];
  4411. // Descend through wrappers to the right content
  4412. j = wrap[ 0 ];
  4413. while ( j-- ) {
  4414. tmp = tmp.lastChild;
  4415. }
  4416. // Support: QtWebKit, PhantomJS
  4417. // push.apply(_, arraylike) throws on ancient WebKit
  4418. jQuery.merge( nodes, tmp.childNodes );
  4419. // Remember the top-level container
  4420. tmp = fragment.firstChild;
  4421. // Ensure the created nodes are orphaned (#12392)
  4422. tmp.textContent = "";
  4423. }
  4424. }
  4425. }
  4426. // Remove wrapper from fragment
  4427. fragment.textContent = "";
  4428. i = 0;
  4429. while ( (elem = nodes[ i++ ]) ) {
  4430. // #4087 - If origin and destination elements are the same, and this is
  4431. // that element, do not do anything
  4432. if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
  4433. continue;
  4434. }
  4435. contains = jQuery.contains( elem.ownerDocument, elem );
  4436. // Append to fragment
  4437. tmp = getAll( fragment.appendChild( elem ), "script" );
  4438. // Preserve script evaluation history
  4439. if ( contains ) {
  4440. setGlobalEval( tmp );
  4441. }
  4442. // Capture executables
  4443. if ( scripts ) {
  4444. j = 0;
  4445. while ( (elem = tmp[ j++ ]) ) {
  4446. if ( rscriptType.test( elem.type || "" ) ) {
  4447. scripts.push( elem );
  4448. }
  4449. }
  4450. }
  4451. }
  4452. return fragment;
  4453. },
  4454. cleanData: function( elems ) {
  4455. var data, elem, type, key,
  4456. special = jQuery.event.special,
  4457. i = 0;
  4458. for ( ; (elem = elems[ i ]) !== undefined; i++ ) {
  4459. if ( jQuery.acceptData( elem ) ) {
  4460. key = elem[ data_priv.expando ];
  4461. if ( key && (data = data_priv.cache[ key ]) ) {
  4462. if ( data.events ) {
  4463. for ( type in data.events ) {
  4464. if ( special[ type ] ) {
  4465. jQuery.event.remove( elem, type );
  4466. // This is a shortcut to avoid jQuery.event.remove's overhead
  4467. } else {
  4468. jQuery.removeEvent( elem, type, data.handle );
  4469. }
  4470. }
  4471. }
  4472. if ( data_priv.cache[ key ] ) {
  4473. // Discard any remaining `private` data
  4474. delete data_priv.cache[ key ];
  4475. }
  4476. }
  4477. }
  4478. // Discard any remaining `user` data
  4479. delete data_user.cache[ elem[ data_user.expando ] ];
  4480. }
  4481. }
  4482. });
  4483. jQuery.fn.extend({
  4484. text: function( value ) {
  4485. return access( this, function( value ) {
  4486. return value === undefined ?
  4487. jQuery.text( this ) :
  4488. this.empty().each(function() {
  4489. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  4490. this.textContent = value;
  4491. }
  4492. });
  4493. }, null, value, arguments.length );
  4494. },
  4495. append: function() {
  4496. return this.domManip( arguments, function( elem ) {
  4497. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  4498. var target = manipulationTarget( this, elem );
  4499. target.appendChild( elem );
  4500. }
  4501. });
  4502. },
  4503. prepend: function() {
  4504. return this.domManip( arguments, function( elem ) {
  4505. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  4506. var target = manipulationTarget( this, elem );
  4507. target.insertBefore( elem, target.firstChild );
  4508. }
  4509. });
  4510. },
  4511. before: function() {
  4512. return this.domManip( arguments, function( elem ) {
  4513. if ( this.parentNode ) {
  4514. this.parentNode.insertBefore( elem, this );
  4515. }
  4516. });
  4517. },
  4518. after: function() {
  4519. return this.domManip( arguments, function( elem ) {
  4520. if ( this.parentNode ) {
  4521. this.parentNode.insertBefore( elem, this.nextSibling );
  4522. }
  4523. });
  4524. },
  4525. remove: function( selector, keepData /* Internal Use Only */ ) {
  4526. var elem,
  4527. elems = selector ? jQuery.filter( selector, this ) : this,
  4528. i = 0;
  4529. for ( ; (elem = elems[i]) != null; i++ ) {
  4530. if ( !keepData && elem.nodeType === 1 ) {
  4531. jQuery.cleanData( getAll( elem ) );
  4532. }
  4533. if ( elem.parentNode ) {
  4534. if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
  4535. setGlobalEval( getAll( elem, "script" ) );
  4536. }
  4537. elem.parentNode.removeChild( elem );
  4538. }
  4539. }
  4540. return this;
  4541. },
  4542. empty: function() {
  4543. var elem,
  4544. i = 0;
  4545. for ( ; (elem = this[i]) != null; i++ ) {
  4546. if ( elem.nodeType === 1 ) {
  4547. // Prevent memory leaks
  4548. jQuery.cleanData( getAll( elem, false ) );
  4549. // Remove any remaining nodes
  4550. elem.textContent = "";
  4551. }
  4552. }
  4553. return this;
  4554. },
  4555. clone: function( dataAndEvents, deepDataAndEvents ) {
  4556. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  4557. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  4558. return this.map(function() {
  4559. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  4560. });
  4561. },
  4562. html: function( value ) {
  4563. return access( this, function( value ) {
  4564. var elem = this[ 0 ] || {},
  4565. i = 0,
  4566. l = this.length;
  4567. if ( value === undefined && elem.nodeType === 1 ) {
  4568. return elem.innerHTML;
  4569. }
  4570. // See if we can take a shortcut and just use innerHTML
  4571. if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  4572. !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
  4573. value = value.replace( rxhtmlTag, "<$1></$2>" );
  4574. try {
  4575. for ( ; i < l; i++ ) {
  4576. elem = this[ i ] || {};
  4577. // Remove element nodes and prevent memory leaks
  4578. if ( elem.nodeType === 1 ) {
  4579. jQuery.cleanData( getAll( elem, false ) );
  4580. elem.innerHTML = value;
  4581. }
  4582. }
  4583. elem = 0;
  4584. // If using innerHTML throws an exception, use the fallback method
  4585. } catch( e ) {}
  4586. }
  4587. if ( elem ) {
  4588. this.empty().append( value );
  4589. }
  4590. }, null, value, arguments.length );
  4591. },
  4592. replaceWith: function() {
  4593. var arg = arguments[ 0 ];
  4594. // Make the changes, replacing each context element with the new content
  4595. this.domManip( arguments, function( elem ) {
  4596. arg = this.parentNode;
  4597. jQuery.cleanData( getAll( this ) );
  4598. if ( arg ) {
  4599. arg.replaceChild( elem, this );
  4600. }
  4601. });
  4602. // Force removal if there was no new content (e.g., from empty arguments)
  4603. return arg && (arg.length || arg.nodeType) ? this : this.remove();
  4604. },
  4605. detach: function( selector ) {
  4606. return this.remove( selector, true );
  4607. },
  4608. domManip: function( args, callback ) {
  4609. // Flatten any nested arrays
  4610. args = concat.apply( [], args );
  4611. var fragment, first, scripts, hasScripts, node, doc,
  4612. i = 0,
  4613. l = this.length,
  4614. set = this,
  4615. iNoClone = l - 1,
  4616. value = args[ 0 ],
  4617. isFunction = jQuery.isFunction( value );
  4618. // We can't cloneNode fragments that contain checked, in WebKit
  4619. if ( isFunction ||
  4620. ( l > 1 && typeof value === "string" &&
  4621. !support.checkClone && rchecked.test( value ) ) ) {
  4622. return this.each(function( index ) {
  4623. var self = set.eq( index );
  4624. if ( isFunction ) {
  4625. args[ 0 ] = value.call( this, index, self.html() );
  4626. }
  4627. self.domManip( args, callback );
  4628. });
  4629. }
  4630. if ( l ) {
  4631. fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
  4632. first = fragment.firstChild;
  4633. if ( fragment.childNodes.length === 1 ) {
  4634. fragment = first;
  4635. }
  4636. if ( first ) {
  4637. scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
  4638. hasScripts = scripts.length;
  4639. // Use the original fragment for the last item instead of the first because it can end up
  4640. // being emptied incorrectly in certain situations (#8070).
  4641. for ( ; i < l; i++ ) {
  4642. node = fragment;
  4643. if ( i !== iNoClone ) {
  4644. node = jQuery.clone( node, true, true );
  4645. // Keep references to cloned scripts for later restoration
  4646. if ( hasScripts ) {
  4647. // Support: QtWebKit
  4648. // jQuery.merge because push.apply(_, arraylike) throws
  4649. jQuery.merge( scripts, getAll( node, "script" ) );
  4650. }
  4651. }
  4652. callback.call( this[ i ], node, i );
  4653. }
  4654. if ( hasScripts ) {
  4655. doc = scripts[ scripts.length - 1 ].ownerDocument;
  4656. // Reenable scripts
  4657. jQuery.map( scripts, restoreScript );
  4658. // Evaluate executable scripts on first document insertion
  4659. for ( i = 0; i < hasScripts; i++ ) {
  4660. node = scripts[ i ];
  4661. if ( rscriptType.test( node.type || "" ) &&
  4662. !data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
  4663. if ( node.src ) {
  4664. // Optional AJAX dependency, but won't run scripts if not present
  4665. if ( jQuery._evalUrl ) {
  4666. jQuery._evalUrl( node.src );
  4667. }
  4668. } else {
  4669. jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) );
  4670. }
  4671. }
  4672. }
  4673. }
  4674. }
  4675. }
  4676. return this;
  4677. }
  4678. });
  4679. jQuery.each({
  4680. appendTo: "append",
  4681. prependTo: "prepend",
  4682. insertBefore: "before",
  4683. insertAfter: "after",
  4684. replaceAll: "replaceWith"
  4685. }, function( name, original ) {
  4686. jQuery.fn[ name ] = function( selector ) {
  4687. var elems,
  4688. ret = [],
  4689. insert = jQuery( selector ),
  4690. last = insert.length - 1,
  4691. i = 0;
  4692. for ( ; i <= last; i++ ) {
  4693. elems = i === last ? this : this.clone( true );
  4694. jQuery( insert[ i ] )[ original ]( elems );
  4695. // Support: QtWebKit
  4696. // .get() because push.apply(_, arraylike) throws
  4697. push.apply( ret, elems.get() );
  4698. }
  4699. return this.pushStack( ret );
  4700. };
  4701. });
  4702. var iframe,
  4703. elemdisplay = {};
  4704. /**
  4705. * Retrieve the actual display of a element
  4706. * @param {String} name nodeName of the element
  4707. * @param {Object} doc Document object
  4708. */
  4709. // Called only from within defaultDisplay
  4710. function actualDisplay( name, doc ) {
  4711. var style,
  4712. elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
  4713. // getDefaultComputedStyle might be reliably used only on attached element
  4714. display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
  4715. // Use of this method is a temporary fix (more like optimization) until something better comes along,
  4716. // since it was removed from specification and supported only in FF
  4717. style.display : jQuery.css( elem[ 0 ], "display" );
  4718. // We don't have any data stored on the element,
  4719. // so use "detach" method as fast way to get rid of the element
  4720. elem.detach();
  4721. return display;
  4722. }
  4723. /**
  4724. * Try to determine the default display value of an element
  4725. * @param {String} nodeName
  4726. */
  4727. function defaultDisplay( nodeName ) {
  4728. var doc = document,
  4729. display = elemdisplay[ nodeName ];
  4730. if ( !display ) {
  4731. display = actualDisplay( nodeName, doc );
  4732. // If the simple way fails, read from inside an iframe
  4733. if ( display === "none" || !display ) {
  4734. // Use the already-created iframe if possible
  4735. iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
  4736. // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
  4737. doc = iframe[ 0 ].contentDocument;
  4738. // Support: IE
  4739. doc.write();
  4740. doc.close();
  4741. display = actualDisplay( nodeName, doc );
  4742. iframe.detach();
  4743. }
  4744. // Store the correct default display
  4745. elemdisplay[ nodeName ] = display;
  4746. }
  4747. return display;
  4748. }
  4749. var rmargin = (/^margin/);
  4750. var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
  4751. var getStyles = function( elem ) {
  4752. // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
  4753. // IE throws on elements created in popups
  4754. // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
  4755. if ( elem.ownerDocument.defaultView.opener ) {
  4756. return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
  4757. }
  4758. return window.getComputedStyle( elem, null );
  4759. };
  4760. function curCSS( elem, name, computed ) {
  4761. var width, minWidth, maxWidth, ret,
  4762. style = elem.style;
  4763. computed = computed || getStyles( elem );
  4764. // Support: IE9
  4765. // getPropertyValue is only needed for .css('filter') (#12537)
  4766. if ( computed ) {
  4767. ret = computed.getPropertyValue( name ) || computed[ name ];
  4768. }
  4769. if ( computed ) {
  4770. if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
  4771. ret = jQuery.style( elem, name );
  4772. }
  4773. // Support: iOS < 6
  4774. // A tribute to the "awesome hack by Dean Edwards"
  4775. // iOS < 6 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
  4776. // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
  4777. if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
  4778. // Remember the original values
  4779. width = style.width;
  4780. minWidth = style.minWidth;
  4781. maxWidth = style.maxWidth;
  4782. // Put in the new values to get a computed value out
  4783. style.minWidth = style.maxWidth = style.width = ret;
  4784. ret = computed.width;
  4785. // Revert the changed values
  4786. style.width = width;
  4787. style.minWidth = minWidth;
  4788. style.maxWidth = maxWidth;
  4789. }
  4790. }
  4791. return ret !== undefined ?
  4792. // Support: IE
  4793. // IE returns zIndex value as an integer.
  4794. ret + "" :
  4795. ret;
  4796. }
  4797. function addGetHookIf( conditionFn, hookFn ) {
  4798. // Define the hook, we'll check on the first run if it's really needed.
  4799. return {
  4800. get: function() {
  4801. if ( conditionFn() ) {
  4802. // Hook not needed (or it's not possible to use it due
  4803. // to missing dependency), remove it.
  4804. delete this.get;
  4805. return;
  4806. }
  4807. // Hook needed; redefine it so that the support test is not executed again.
  4808. return (this.get = hookFn).apply( this, arguments );
  4809. }
  4810. };
  4811. }
  4812. (function() {
  4813. var pixelPositionVal, boxSizingReliableVal,
  4814. docElem = document.documentElement,
  4815. container = document.createElement( "div" ),
  4816. div = document.createElement( "div" );
  4817. if ( !div.style ) {
  4818. return;
  4819. }
  4820. // Support: IE9-11+
  4821. // Style of cloned element affects source element cloned (#8908)
  4822. div.style.backgroundClip = "content-box";
  4823. div.cloneNode( true ).style.backgroundClip = "";
  4824. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  4825. container.style.cssText = "border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;" +
  4826. "position:absolute";
  4827. container.appendChild( div );
  4828. // Executing both pixelPosition & boxSizingReliable tests require only one layout
  4829. // so they're executed at the same time to save the second computation.
  4830. function computePixelPositionAndBoxSizingReliable() {
  4831. div.style.cssText =
  4832. // Support: Firefox<29, Android 2.3
  4833. // Vendor-prefix box-sizing
  4834. "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
  4835. "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
  4836. "border:1px;padding:1px;width:4px;position:absolute";
  4837. div.innerHTML = "";
  4838. docElem.appendChild( container );
  4839. var divStyle = window.getComputedStyle( div, null );
  4840. pixelPositionVal = divStyle.top !== "1%";
  4841. boxSizingReliableVal = divStyle.width === "4px";
  4842. docElem.removeChild( container );
  4843. }
  4844. // Support: node.js jsdom
  4845. // Don't assume that getComputedStyle is a property of the global object
  4846. if ( window.getComputedStyle ) {
  4847. jQuery.extend( support, {
  4848. pixelPosition: function() {
  4849. // This test is executed only once but we still do memoizing
  4850. // since we can use the boxSizingReliable pre-computing.
  4851. // No need to check if the test was already performed, though.
  4852. computePixelPositionAndBoxSizingReliable();
  4853. return pixelPositionVal;
  4854. },
  4855. boxSizingReliable: function() {
  4856. if ( boxSizingReliableVal == null ) {
  4857. computePixelPositionAndBoxSizingReliable();
  4858. }
  4859. return boxSizingReliableVal;
  4860. },
  4861. reliableMarginRight: function() {
  4862. // Support: Android 2.3
  4863. // Check if div with explicit width and no margin-right incorrectly
  4864. // gets computed margin-right based on width of container. (#3333)
  4865. // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
  4866. // This support function is only executed once so no memoizing is needed.
  4867. var ret,
  4868. marginDiv = div.appendChild( document.createElement( "div" ) );
  4869. // Reset CSS: box-sizing; display; margin; border; padding
  4870. marginDiv.style.cssText = div.style.cssText =
  4871. // Support: Firefox<29, Android 2.3
  4872. // Vendor-prefix box-sizing
  4873. "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
  4874. "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
  4875. marginDiv.style.marginRight = marginDiv.style.width = "0";
  4876. div.style.width = "1px";
  4877. docElem.appendChild( container );
  4878. ret = !parseFloat( window.getComputedStyle( marginDiv, null ).marginRight );
  4879. docElem.removeChild( container );
  4880. div.removeChild( marginDiv );
  4881. return ret;
  4882. }
  4883. });
  4884. }
  4885. })();
  4886. // A method for quickly swapping in/out CSS properties to get correct calculations.
  4887. jQuery.swap = function( elem, options, callback, args ) {
  4888. var ret, name,
  4889. old = {};
  4890. // Remember the old values, and insert the new ones
  4891. for ( name in options ) {
  4892. old[ name ] = elem.style[ name ];
  4893. elem.style[ name ] = options[ name ];
  4894. }
  4895. ret = callback.apply( elem, args || [] );
  4896. // Revert the old values
  4897. for ( name in options ) {
  4898. elem.style[ name ] = old[ name ];
  4899. }
  4900. return ret;
  4901. };
  4902. var
  4903. // Swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
  4904. // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
  4905. rdisplayswap = /^(none|table(?!-c[ea]).+)/,
  4906. rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
  4907. rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),
  4908. cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  4909. cssNormalTransform = {
  4910. letterSpacing: "0",
  4911. fontWeight: "400"
  4912. },
  4913. cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
  4914. // Return a css property mapped to a potentially vendor prefixed property
  4915. function vendorPropName( style, name ) {
  4916. // Shortcut for names that are not vendor prefixed
  4917. if ( name in style ) {
  4918. return name;
  4919. }
  4920. // Check for vendor prefixed names
  4921. var capName = name[0].toUpperCase() + name.slice(1),
  4922. origName = name,
  4923. i = cssPrefixes.length;
  4924. while ( i-- ) {
  4925. name = cssPrefixes[ i ] + capName;
  4926. if ( name in style ) {
  4927. return name;
  4928. }
  4929. }
  4930. return origName;
  4931. }
  4932. function setPositiveNumber( elem, value, subtract ) {
  4933. var matches = rnumsplit.exec( value );
  4934. return matches ?
  4935. // Guard against undefined "subtract", e.g., when used as in cssHooks
  4936. Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
  4937. value;
  4938. }
  4939. function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
  4940. var i = extra === ( isBorderBox ? "border" : "content" ) ?
  4941. // If we already have the right measurement, avoid augmentation
  4942. 4 :
  4943. // Otherwise initialize for horizontal or vertical properties
  4944. name === "width" ? 1 : 0,
  4945. val = 0;
  4946. for ( ; i < 4; i += 2 ) {
  4947. // Both box models exclude margin, so add it if we want it
  4948. if ( extra === "margin" ) {
  4949. val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
  4950. }
  4951. if ( isBorderBox ) {
  4952. // border-box includes padding, so remove it if we want content
  4953. if ( extra === "content" ) {
  4954. val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  4955. }
  4956. // At this point, extra isn't border nor margin, so remove border
  4957. if ( extra !== "margin" ) {
  4958. val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  4959. }
  4960. } else {
  4961. // At this point, extra isn't content, so add padding
  4962. val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  4963. // At this point, extra isn't content nor padding, so add border
  4964. if ( extra !== "padding" ) {
  4965. val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  4966. }
  4967. }
  4968. }
  4969. return val;
  4970. }
  4971. function getWidthOrHeight( elem, name, extra ) {
  4972. // Start with offset property, which is equivalent to the border-box value
  4973. var valueIsBorderBox = true,
  4974. val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
  4975. styles = getStyles( elem ),
  4976. isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
  4977. // Some non-html elements return undefined for offsetWidth, so check for null/undefined
  4978. // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
  4979. // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
  4980. if ( val <= 0 || val == null ) {
  4981. // Fall back to computed then uncomputed css if necessary
  4982. val = curCSS( elem, name, styles );
  4983. if ( val < 0 || val == null ) {
  4984. val = elem.style[ name ];
  4985. }
  4986. // Computed unit is not pixels. Stop here and return.
  4987. if ( rnumnonpx.test(val) ) {
  4988. return val;
  4989. }
  4990. // Check for style in case a browser which returns unreliable values
  4991. // for getComputedStyle silently falls back to the reliable elem.style
  4992. valueIsBorderBox = isBorderBox &&
  4993. ( support.boxSizingReliable() || val === elem.style[ name ] );
  4994. // Normalize "", auto, and prepare for extra
  4995. val = parseFloat( val ) || 0;
  4996. }
  4997. // Use the active box-sizing model to add/subtract irrelevant styles
  4998. return ( val +
  4999. augmentWidthOrHeight(
  5000. elem,
  5001. name,
  5002. extra || ( isBorderBox ? "border" : "content" ),
  5003. valueIsBorderBox,
  5004. styles
  5005. )
  5006. ) + "px";
  5007. }
  5008. function showHide( elements, show ) {
  5009. var display, elem, hidden,
  5010. values = [],
  5011. index = 0,
  5012. length = elements.length;
  5013. for ( ; index < length; index++ ) {
  5014. elem = elements[ index ];
  5015. if ( !elem.style ) {
  5016. continue;
  5017. }
  5018. values[ index ] = data_priv.get( elem, "olddisplay" );
  5019. display = elem.style.display;
  5020. if ( show ) {
  5021. // Reset the inline display of this element to learn if it is
  5022. // being hidden by cascaded rules or not
  5023. if ( !values[ index ] && display === "none" ) {
  5024. elem.style.display = "";
  5025. }
  5026. // Set elements which have been overridden with display: none
  5027. // in a stylesheet to whatever the default browser style is
  5028. // for such an element
  5029. if ( elem.style.display === "" && isHidden( elem ) ) {
  5030. values[ index ] = data_priv.access( elem, "olddisplay", defaultDisplay(elem.nodeName) );
  5031. }
  5032. } else {
  5033. hidden = isHidden( elem );
  5034. if ( display !== "none" || !hidden ) {
  5035. data_priv.set( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
  5036. }
  5037. }
  5038. }
  5039. // Set the display of most of the elements in a second loop
  5040. // to avoid the constant reflow
  5041. for ( index = 0; index < length; index++ ) {
  5042. elem = elements[ index ];
  5043. if ( !elem.style ) {
  5044. continue;
  5045. }
  5046. if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
  5047. elem.style.display = show ? values[ index ] || "" : "none";
  5048. }
  5049. }
  5050. return elements;
  5051. }
  5052. jQuery.extend({
  5053. // Add in style property hooks for overriding the default
  5054. // behavior of getting and setting a style property
  5055. cssHooks: {
  5056. opacity: {
  5057. get: function( elem, computed ) {
  5058. if ( computed ) {
  5059. // We should always get a number back from opacity
  5060. var ret = curCSS( elem, "opacity" );
  5061. return ret === "" ? "1" : ret;
  5062. }
  5063. }
  5064. }
  5065. },
  5066. // Don't automatically add "px" to these possibly-unitless properties
  5067. cssNumber: {
  5068. "columnCount": true,
  5069. "fillOpacity": true,
  5070. "flexGrow": true,
  5071. "flexShrink": true,
  5072. "fontWeight": true,
  5073. "lineHeight": true,
  5074. "opacity": true,
  5075. "order": true,
  5076. "orphans": true,
  5077. "widows": true,
  5078. "zIndex": true,
  5079. "zoom": true
  5080. },
  5081. // Add in properties whose names you wish to fix before
  5082. // setting or getting the value
  5083. cssProps: {
  5084. "float": "cssFloat"
  5085. },
  5086. // Get and set the style property on a DOM Node
  5087. style: function( elem, name, value, extra ) {
  5088. // Don't set styles on text and comment nodes
  5089. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  5090. return;
  5091. }
  5092. // Make sure that we're working with the right name
  5093. var ret, type, hooks,
  5094. origName = jQuery.camelCase( name ),
  5095. style = elem.style;
  5096. name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
  5097. // Gets hook for the prefixed version, then unprefixed version
  5098. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  5099. // Check if we're setting a value
  5100. if ( value !== undefined ) {
  5101. type = typeof value;
  5102. // Convert "+=" or "-=" to relative numbers (#7345)
  5103. if ( type === "string" && (ret = rrelNum.exec( value )) ) {
  5104. value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
  5105. // Fixes bug #9237
  5106. type = "number";
  5107. }
  5108. // Make sure that null and NaN values aren't set (#7116)
  5109. if ( value == null || value !== value ) {
  5110. return;
  5111. }
  5112. // If a number, add 'px' to the (except for certain CSS properties)
  5113. if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
  5114. value += "px";
  5115. }
  5116. // Support: IE9-11+
  5117. // background-* props affect original clone's values
  5118. if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
  5119. style[ name ] = "inherit";
  5120. }
  5121. // If a hook was provided, use that value, otherwise just set the specified value
  5122. if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
  5123. style[ name ] = value;
  5124. }
  5125. } else {
  5126. // If a hook was provided get the non-computed value from there
  5127. if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
  5128. return ret;
  5129. }
  5130. // Otherwise just get the value from the style object
  5131. return style[ name ];
  5132. }
  5133. },
  5134. css: function( elem, name, extra, styles ) {
  5135. var val, num, hooks,
  5136. origName = jQuery.camelCase( name );
  5137. // Make sure that we're working with the right name
  5138. name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
  5139. // Try prefixed name followed by the unprefixed name
  5140. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  5141. // If a hook was provided get the computed value from there
  5142. if ( hooks && "get" in hooks ) {
  5143. val = hooks.get( elem, true, extra );
  5144. }
  5145. // Otherwise, if a way to get the computed value exists, use that
  5146. if ( val === undefined ) {
  5147. val = curCSS( elem, name, styles );
  5148. }
  5149. // Convert "normal" to computed value
  5150. if ( val === "normal" && name in cssNormalTransform ) {
  5151. val = cssNormalTransform[ name ];
  5152. }
  5153. // Make numeric if forced or a qualifier was provided and val looks numeric
  5154. if ( extra === "" || extra ) {
  5155. num = parseFloat( val );
  5156. return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
  5157. }
  5158. return val;
  5159. }
  5160. });
  5161. jQuery.each([ "height", "width" ], function( i, name ) {
  5162. jQuery.cssHooks[ name ] = {
  5163. get: function( elem, computed, extra ) {
  5164. if ( computed ) {
  5165. // Certain elements can have dimension info if we invisibly show them
  5166. // but it must have a current display style that would benefit
  5167. return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ?
  5168. jQuery.swap( elem, cssShow, function() {
  5169. return getWidthOrHeight( elem, name, extra );
  5170. }) :
  5171. getWidthOrHeight( elem, name, extra );
  5172. }
  5173. },
  5174. set: function( elem, value, extra ) {
  5175. var styles = extra && getStyles( elem );
  5176. return setPositiveNumber( elem, value, extra ?
  5177. augmentWidthOrHeight(
  5178. elem,
  5179. name,
  5180. extra,
  5181. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  5182. styles
  5183. ) : 0
  5184. );
  5185. }
  5186. };
  5187. });
  5188. // Support: Android 2.3
  5189. jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
  5190. function( elem, computed ) {
  5191. if ( computed ) {
  5192. return jQuery.swap( elem, { "display": "inline-block" },
  5193. curCSS, [ elem, "marginRight" ] );
  5194. }
  5195. }
  5196. );
  5197. // These hooks are used by animate to expand properties
  5198. jQuery.each({
  5199. margin: "",
  5200. padding: "",
  5201. border: "Width"
  5202. }, function( prefix, suffix ) {
  5203. jQuery.cssHooks[ prefix + suffix ] = {
  5204. expand: function( value ) {
  5205. var i = 0,
  5206. expanded = {},
  5207. // Assumes a single number if not a string
  5208. parts = typeof value === "string" ? value.split(" ") : [ value ];
  5209. for ( ; i < 4; i++ ) {
  5210. expanded[ prefix + cssExpand[ i ] + suffix ] =
  5211. parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
  5212. }
  5213. return expanded;
  5214. }
  5215. };
  5216. if ( !rmargin.test( prefix ) ) {
  5217. jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
  5218. }
  5219. });
  5220. jQuery.fn.extend({
  5221. css: function( name, value ) {
  5222. return access( this, function( elem, name, value ) {
  5223. var styles, len,
  5224. map = {},
  5225. i = 0;
  5226. if ( jQuery.isArray( name ) ) {
  5227. styles = getStyles( elem );
  5228. len = name.length;
  5229. for ( ; i < len; i++ ) {
  5230. map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
  5231. }
  5232. return map;
  5233. }
  5234. return value !== undefined ?
  5235. jQuery.style( elem, name, value ) :
  5236. jQuery.css( elem, name );
  5237. }, name, value, arguments.length > 1 );
  5238. },
  5239. show: function() {
  5240. return showHide( this, true );
  5241. },
  5242. hide: function() {
  5243. return showHide( this );
  5244. },
  5245. toggle: function( state ) {
  5246. if ( typeof state === "boolean" ) {
  5247. return state ? this.show() : this.hide();
  5248. }
  5249. return this.each(function() {
  5250. if ( isHidden( this ) ) {
  5251. jQuery( this ).show();
  5252. } else {
  5253. jQuery( this ).hide();
  5254. }
  5255. });
  5256. }
  5257. });
  5258. function Tween( elem, options, prop, end, easing ) {
  5259. return new Tween.prototype.init( elem, options, prop, end, easing );
  5260. }
  5261. jQuery.Tween = Tween;
  5262. Tween.prototype = {
  5263. constructor: Tween,
  5264. init: function( elem, options, prop, end, easing, unit ) {
  5265. this.elem = elem;
  5266. this.prop = prop;
  5267. this.easing = easing || "swing";
  5268. this.options = options;
  5269. this.start = this.now = this.cur();
  5270. this.end = end;
  5271. this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
  5272. },
  5273. cur: function() {
  5274. var hooks = Tween.propHooks[ this.prop ];
  5275. return hooks && hooks.get ?
  5276. hooks.get( this ) :
  5277. Tween.propHooks._default.get( this );
  5278. },
  5279. run: function( percent ) {
  5280. var eased,
  5281. hooks = Tween.propHooks[ this.prop ];
  5282. if ( this.options.duration ) {
  5283. this.pos = eased = jQuery.easing[ this.easing ](
  5284. percent, this.options.duration * percent, 0, 1, this.options.duration
  5285. );
  5286. } else {
  5287. this.pos = eased = percent;
  5288. }
  5289. this.now = ( this.end - this.start ) * eased + this.start;
  5290. if ( this.options.step ) {
  5291. this.options.step.call( this.elem, this.now, this );
  5292. }
  5293. if ( hooks && hooks.set ) {
  5294. hooks.set( this );
  5295. } else {
  5296. Tween.propHooks._default.set( this );
  5297. }
  5298. return this;
  5299. }
  5300. };
  5301. Tween.prototype.init.prototype = Tween.prototype;
  5302. Tween.propHooks = {
  5303. _default: {
  5304. get: function( tween ) {
  5305. var result;
  5306. if ( tween.elem[ tween.prop ] != null &&
  5307. (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
  5308. return tween.elem[ tween.prop ];
  5309. }
  5310. // Passing an empty string as a 3rd parameter to .css will automatically
  5311. // attempt a parseFloat and fallback to a string if the parse fails.
  5312. // Simple values such as "10px" are parsed to Float;
  5313. // complex values such as "rotate(1rad)" are returned as-is.
  5314. result = jQuery.css( tween.elem, tween.prop, "" );
  5315. // Empty strings, null, undefined and "auto" are converted to 0.
  5316. return !result || result === "auto" ? 0 : result;
  5317. },
  5318. set: function( tween ) {
  5319. // Use step hook for back compat.
  5320. // Use cssHook if its there.
  5321. // Use .style if available and use plain properties where available.
  5322. if ( jQuery.fx.step[ tween.prop ] ) {
  5323. jQuery.fx.step[ tween.prop ]( tween );
  5324. } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
  5325. jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
  5326. } else {
  5327. tween.elem[ tween.prop ] = tween.now;
  5328. }
  5329. }
  5330. }
  5331. };
  5332. // Support: IE9
  5333. // Panic based approach to setting things on disconnected nodes
  5334. Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
  5335. set: function( tween ) {
  5336. if ( tween.elem.nodeType && tween.elem.parentNode ) {
  5337. tween.elem[ tween.prop ] = tween.now;
  5338. }
  5339. }
  5340. };
  5341. jQuery.easing = {
  5342. linear: function( p ) {
  5343. return p;
  5344. },
  5345. swing: function( p ) {
  5346. return 0.5 - Math.cos( p * Math.PI ) / 2;
  5347. }
  5348. };
  5349. jQuery.fx = Tween.prototype.init;
  5350. // Back Compat <1.8 extension point
  5351. jQuery.fx.step = {};
  5352. var
  5353. fxNow, timerId,
  5354. rfxtypes = /^(?:toggle|show|hide)$/,
  5355. rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ),
  5356. rrun = /queueHooks$/,
  5357. animationPrefilters = [ defaultPrefilter ],
  5358. tweeners = {
  5359. "*": [ function( prop, value ) {
  5360. var tween = this.createTween( prop, value ),
  5361. target = tween.cur(),
  5362. parts = rfxnum.exec( value ),
  5363. unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
  5364. // Starting value computation is required for potential unit mismatches
  5365. start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
  5366. rfxnum.exec( jQuery.css( tween.elem, prop ) ),
  5367. scale = 1,
  5368. maxIterations = 20;
  5369. if ( start && start[ 3 ] !== unit ) {
  5370. // Trust units reported by jQuery.css
  5371. unit = unit || start[ 3 ];
  5372. // Make sure we update the tween properties later on
  5373. parts = parts || [];
  5374. // Iteratively approximate from a nonzero starting point
  5375. start = +target || 1;
  5376. do {
  5377. // If previous iteration zeroed out, double until we get *something*.
  5378. // Use string for doubling so we don't accidentally see scale as unchanged below
  5379. scale = scale || ".5";
  5380. // Adjust and apply
  5381. start = start / scale;
  5382. jQuery.style( tween.elem, prop, start + unit );
  5383. // Update scale, tolerating zero or NaN from tween.cur(),
  5384. // break the loop if scale is unchanged or perfect, or if we've just had enough
  5385. } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
  5386. }
  5387. // Update tween properties
  5388. if ( parts ) {
  5389. start = tween.start = +start || +target || 0;
  5390. tween.unit = unit;
  5391. // If a +=/-= token was provided, we're doing a relative animation
  5392. tween.end = parts[ 1 ] ?
  5393. start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
  5394. +parts[ 2 ];
  5395. }
  5396. return tween;
  5397. } ]
  5398. };
  5399. // Animations created synchronously will run synchronously
  5400. function createFxNow() {
  5401. setTimeout(function() {
  5402. fxNow = undefined;
  5403. });
  5404. return ( fxNow = jQuery.now() );
  5405. }
  5406. // Generate parameters to create a standard animation
  5407. function genFx( type, includeWidth ) {
  5408. var which,
  5409. i = 0,
  5410. attrs = { height: type };
  5411. // If we include width, step value is 1 to do all cssExpand values,
  5412. // otherwise step value is 2 to skip over Left and Right
  5413. includeWidth = includeWidth ? 1 : 0;
  5414. for ( ; i < 4 ; i += 2 - includeWidth ) {
  5415. which = cssExpand[ i ];
  5416. attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
  5417. }
  5418. if ( includeWidth ) {
  5419. attrs.opacity = attrs.width = type;
  5420. }
  5421. return attrs;
  5422. }
  5423. function createTween( value, prop, animation ) {
  5424. var tween,
  5425. collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
  5426. index = 0,
  5427. length = collection.length;
  5428. for ( ; index < length; index++ ) {
  5429. if ( (tween = collection[ index ].call( animation, prop, value )) ) {
  5430. // We're done with this property
  5431. return tween;
  5432. }
  5433. }
  5434. }
  5435. function defaultPrefilter( elem, props, opts ) {
  5436. /* jshint validthis: true */
  5437. var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
  5438. anim = this,
  5439. orig = {},
  5440. style = elem.style,
  5441. hidden = elem.nodeType && isHidden( elem ),
  5442. dataShow = data_priv.get( elem, "fxshow" );
  5443. // Handle queue: false promises
  5444. if ( !opts.queue ) {
  5445. hooks = jQuery._queueHooks( elem, "fx" );
  5446. if ( hooks.unqueued == null ) {
  5447. hooks.unqueued = 0;
  5448. oldfire = hooks.empty.fire;
  5449. hooks.empty.fire = function() {
  5450. if ( !hooks.unqueued ) {
  5451. oldfire();
  5452. }
  5453. };
  5454. }
  5455. hooks.unqueued++;
  5456. anim.always(function() {
  5457. // Ensure the complete handler is called before this completes
  5458. anim.always(function() {
  5459. hooks.unqueued--;
  5460. if ( !jQuery.queue( elem, "fx" ).length ) {
  5461. hooks.empty.fire();
  5462. }
  5463. });
  5464. });
  5465. }
  5466. // Height/width overflow pass
  5467. if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
  5468. // Make sure that nothing sneaks out
  5469. // Record all 3 overflow attributes because IE9-10 do not
  5470. // change the overflow attribute when overflowX and
  5471. // overflowY are set to the same value
  5472. opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
  5473. // Set display property to inline-block for height/width
  5474. // animations on inline elements that are having width/height animated
  5475. display = jQuery.css( elem, "display" );
  5476. // Test default display if display is currently "none"
  5477. checkDisplay = display === "none" ?
  5478. data_priv.get( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
  5479. if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
  5480. style.display = "inline-block";
  5481. }
  5482. }
  5483. if ( opts.overflow ) {
  5484. style.overflow = "hidden";
  5485. anim.always(function() {
  5486. style.overflow = opts.overflow[ 0 ];
  5487. style.overflowX = opts.overflow[ 1 ];
  5488. style.overflowY = opts.overflow[ 2 ];
  5489. });
  5490. }
  5491. // show/hide pass
  5492. for ( prop in props ) {
  5493. value = props[ prop ];
  5494. if ( rfxtypes.exec( value ) ) {
  5495. delete props[ prop ];
  5496. toggle = toggle || value === "toggle";
  5497. if ( value === ( hidden ? "hide" : "show" ) ) {
  5498. // If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
  5499. if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
  5500. hidden = true;
  5501. } else {
  5502. continue;
  5503. }
  5504. }
  5505. orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
  5506. // Any non-fx value stops us from restoring the original display value
  5507. } else {
  5508. display = undefined;
  5509. }
  5510. }
  5511. if ( !jQuery.isEmptyObject( orig ) ) {
  5512. if ( dataShow ) {
  5513. if ( "hidden" in dataShow ) {
  5514. hidden = dataShow.hidden;
  5515. }
  5516. } else {
  5517. dataShow = data_priv.access( elem, "fxshow", {} );
  5518. }
  5519. // Store state if its toggle - enables .stop().toggle() to "reverse"
  5520. if ( toggle ) {
  5521. dataShow.hidden = !hidden;
  5522. }
  5523. if ( hidden ) {
  5524. jQuery( elem ).show();
  5525. } else {
  5526. anim.done(function() {
  5527. jQuery( elem ).hide();
  5528. });
  5529. }
  5530. anim.done(function() {
  5531. var prop;
  5532. data_priv.remove( elem, "fxshow" );
  5533. for ( prop in orig ) {
  5534. jQuery.style( elem, prop, orig[ prop ] );
  5535. }
  5536. });
  5537. for ( prop in orig ) {
  5538. tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
  5539. if ( !( prop in dataShow ) ) {
  5540. dataShow[ prop ] = tween.start;
  5541. if ( hidden ) {
  5542. tween.end = tween.start;
  5543. tween.start = prop === "width" || prop === "height" ? 1 : 0;
  5544. }
  5545. }
  5546. }
  5547. // If this is a noop like .hide().hide(), restore an overwritten display value
  5548. } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) {
  5549. style.display = display;
  5550. }
  5551. }
  5552. function propFilter( props, specialEasing ) {
  5553. var index, name, easing, value, hooks;
  5554. // camelCase, specialEasing and expand cssHook pass
  5555. for ( index in props ) {
  5556. name = jQuery.camelCase( index );
  5557. easing = specialEasing[ name ];
  5558. value = props[ index ];
  5559. if ( jQuery.isArray( value ) ) {
  5560. easing = value[ 1 ];
  5561. value = props[ index ] = value[ 0 ];
  5562. }
  5563. if ( index !== name ) {
  5564. props[ name ] = value;
  5565. delete props[ index ];
  5566. }
  5567. hooks = jQuery.cssHooks[ name ];
  5568. if ( hooks && "expand" in hooks ) {
  5569. value = hooks.expand( value );
  5570. delete props[ name ];
  5571. // Not quite $.extend, this won't overwrite existing keys.
  5572. // Reusing 'index' because we have the correct "name"
  5573. for ( index in value ) {
  5574. if ( !( index in props ) ) {
  5575. props[ index ] = value[ index ];
  5576. specialEasing[ index ] = easing;
  5577. }
  5578. }
  5579. } else {
  5580. specialEasing[ name ] = easing;
  5581. }
  5582. }
  5583. }
  5584. function Animation( elem, properties, options ) {
  5585. var result,
  5586. stopped,
  5587. index = 0,
  5588. length = animationPrefilters.length,
  5589. deferred = jQuery.Deferred().always( function() {
  5590. // Don't match elem in the :animated selector
  5591. delete tick.elem;
  5592. }),
  5593. tick = function() {
  5594. if ( stopped ) {
  5595. return false;
  5596. }
  5597. var currentTime = fxNow || createFxNow(),
  5598. remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
  5599. // Support: Android 2.3
  5600. // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
  5601. temp = remaining / animation.duration || 0,
  5602. percent = 1 - temp,
  5603. index = 0,
  5604. length = animation.tweens.length;
  5605. for ( ; index < length ; index++ ) {
  5606. animation.tweens[ index ].run( percent );
  5607. }
  5608. deferred.notifyWith( elem, [ animation, percent, remaining ]);
  5609. if ( percent < 1 && length ) {
  5610. return remaining;
  5611. } else {
  5612. deferred.resolveWith( elem, [ animation ] );
  5613. return false;
  5614. }
  5615. },
  5616. animation = deferred.promise({
  5617. elem: elem,
  5618. props: jQuery.extend( {}, properties ),
  5619. opts: jQuery.extend( true, { specialEasing: {} }, options ),
  5620. originalProperties: properties,
  5621. originalOptions: options,
  5622. startTime: fxNow || createFxNow(),
  5623. duration: options.duration,
  5624. tweens: [],
  5625. createTween: function( prop, end ) {
  5626. var tween = jQuery.Tween( elem, animation.opts, prop, end,
  5627. animation.opts.specialEasing[ prop ] || animation.opts.easing );
  5628. animation.tweens.push( tween );
  5629. return tween;
  5630. },
  5631. stop: function( gotoEnd ) {
  5632. var index = 0,
  5633. // If we are going to the end, we want to run all the tweens
  5634. // otherwise we skip this part
  5635. length = gotoEnd ? animation.tweens.length : 0;
  5636. if ( stopped ) {
  5637. return this;
  5638. }
  5639. stopped = true;
  5640. for ( ; index < length ; index++ ) {
  5641. animation.tweens[ index ].run( 1 );
  5642. }
  5643. // Resolve when we played the last frame; otherwise, reject
  5644. if ( gotoEnd ) {
  5645. deferred.resolveWith( elem, [ animation, gotoEnd ] );
  5646. } else {
  5647. deferred.rejectWith( elem, [ animation, gotoEnd ] );
  5648. }
  5649. return this;
  5650. }
  5651. }),
  5652. props = animation.props;
  5653. propFilter( props, animation.opts.specialEasing );
  5654. for ( ; index < length ; index++ ) {
  5655. result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
  5656. if ( result ) {
  5657. return result;
  5658. }
  5659. }
  5660. jQuery.map( props, createTween, animation );
  5661. if ( jQuery.isFunction( animation.opts.start ) ) {
  5662. animation.opts.start.call( elem, animation );
  5663. }
  5664. jQuery.fx.timer(
  5665. jQuery.extend( tick, {
  5666. elem: elem,
  5667. anim: animation,
  5668. queue: animation.opts.queue
  5669. })
  5670. );
  5671. // attach callbacks from options
  5672. return animation.progress( animation.opts.progress )
  5673. .done( animation.opts.done, animation.opts.complete )
  5674. .fail( animation.opts.fail )
  5675. .always( animation.opts.always );
  5676. }
  5677. jQuery.Animation = jQuery.extend( Animation, {
  5678. tweener: function( props, callback ) {
  5679. if ( jQuery.isFunction( props ) ) {
  5680. callback = props;
  5681. props = [ "*" ];
  5682. } else {
  5683. props = props.split(" ");
  5684. }
  5685. var prop,
  5686. index = 0,
  5687. length = props.length;
  5688. for ( ; index < length ; index++ ) {
  5689. prop = props[ index ];
  5690. tweeners[ prop ] = tweeners[ prop ] || [];
  5691. tweeners[ prop ].unshift( callback );
  5692. }
  5693. },
  5694. prefilter: function( callback, prepend ) {
  5695. if ( prepend ) {
  5696. animationPrefilters.unshift( callback );
  5697. } else {
  5698. animationPrefilters.push( callback );
  5699. }
  5700. }
  5701. });
  5702. jQuery.speed = function( speed, easing, fn ) {
  5703. var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
  5704. complete: fn || !fn && easing ||
  5705. jQuery.isFunction( speed ) && speed,
  5706. duration: speed,
  5707. easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
  5708. };
  5709. opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
  5710. opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
  5711. // Normalize opt.queue - true/undefined/null -> "fx"
  5712. if ( opt.queue == null || opt.queue === true ) {
  5713. opt.queue = "fx";
  5714. }
  5715. // Queueing
  5716. opt.old = opt.complete;
  5717. opt.complete = function() {
  5718. if ( jQuery.isFunction( opt.old ) ) {
  5719. opt.old.call( this );
  5720. }
  5721. if ( opt.queue ) {
  5722. jQuery.dequeue( this, opt.queue );
  5723. }
  5724. };
  5725. return opt;
  5726. };
  5727. jQuery.fn.extend({
  5728. fadeTo: function( speed, to, easing, callback ) {
  5729. // Show any hidden elements after setting opacity to 0
  5730. return this.filter( isHidden ).css( "opacity", 0 ).show()
  5731. // Animate to the value specified
  5732. .end().animate({ opacity: to }, speed, easing, callback );
  5733. },
  5734. animate: function( prop, speed, easing, callback ) {
  5735. var empty = jQuery.isEmptyObject( prop ),
  5736. optall = jQuery.speed( speed, easing, callback ),
  5737. doAnimation = function() {
  5738. // Operate on a copy of prop so per-property easing won't be lost
  5739. var anim = Animation( this, jQuery.extend( {}, prop ), optall );
  5740. // Empty animations, or finishing resolves immediately
  5741. if ( empty || data_priv.get( this, "finish" ) ) {
  5742. anim.stop( true );
  5743. }
  5744. };
  5745. doAnimation.finish = doAnimation;
  5746. return empty || optall.queue === false ?
  5747. this.each( doAnimation ) :
  5748. this.queue( optall.queue, doAnimation );
  5749. },
  5750. stop: function( type, clearQueue, gotoEnd ) {
  5751. var stopQueue = function( hooks ) {
  5752. var stop = hooks.stop;
  5753. delete hooks.stop;
  5754. stop( gotoEnd );
  5755. };
  5756. if ( typeof type !== "string" ) {
  5757. gotoEnd = clearQueue;
  5758. clearQueue = type;
  5759. type = undefined;
  5760. }
  5761. if ( clearQueue && type !== false ) {
  5762. this.queue( type || "fx", [] );
  5763. }
  5764. return this.each(function() {
  5765. var dequeue = true,
  5766. index = type != null && type + "queueHooks",
  5767. timers = jQuery.timers,
  5768. data = data_priv.get( this );
  5769. if ( index ) {
  5770. if ( data[ index ] && data[ index ].stop ) {
  5771. stopQueue( data[ index ] );
  5772. }
  5773. } else {
  5774. for ( index in data ) {
  5775. if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
  5776. stopQueue( data[ index ] );
  5777. }
  5778. }
  5779. }
  5780. for ( index = timers.length; index--; ) {
  5781. if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
  5782. timers[ index ].anim.stop( gotoEnd );
  5783. dequeue = false;
  5784. timers.splice( index, 1 );
  5785. }
  5786. }
  5787. // Start the next in the queue if the last step wasn't forced.
  5788. // Timers currently will call their complete callbacks, which
  5789. // will dequeue but only if they were gotoEnd.
  5790. if ( dequeue || !gotoEnd ) {
  5791. jQuery.dequeue( this, type );
  5792. }
  5793. });
  5794. },
  5795. finish: function( type ) {
  5796. if ( type !== false ) {
  5797. type = type || "fx";
  5798. }
  5799. return this.each(function() {
  5800. var index,
  5801. data = data_priv.get( this ),
  5802. queue = data[ type + "queue" ],
  5803. hooks = data[ type + "queueHooks" ],
  5804. timers = jQuery.timers,
  5805. length = queue ? queue.length : 0;
  5806. // Enable finishing flag on private data
  5807. data.finish = true;
  5808. // Empty the queue first
  5809. jQuery.queue( this, type, [] );
  5810. if ( hooks && hooks.stop ) {
  5811. hooks.stop.call( this, true );
  5812. }
  5813. // Look for any active animations, and finish them
  5814. for ( index = timers.length; index--; ) {
  5815. if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
  5816. timers[ index ].anim.stop( true );
  5817. timers.splice( index, 1 );
  5818. }
  5819. }
  5820. // Look for any animations in the old queue and finish them
  5821. for ( index = 0; index < length; index++ ) {
  5822. if ( queue[ index ] && queue[ index ].finish ) {
  5823. queue[ index ].finish.call( this );
  5824. }
  5825. }
  5826. // Turn off finishing flag
  5827. delete data.finish;
  5828. });
  5829. }
  5830. });
  5831. jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
  5832. var cssFn = jQuery.fn[ name ];
  5833. jQuery.fn[ name ] = function( speed, easing, callback ) {
  5834. return speed == null || typeof speed === "boolean" ?
  5835. cssFn.apply( this, arguments ) :
  5836. this.animate( genFx( name, true ), speed, easing, callback );
  5837. };
  5838. });
  5839. // Generate shortcuts for custom animations
  5840. jQuery.each({
  5841. slideDown: genFx("show"),
  5842. slideUp: genFx("hide"),
  5843. slideToggle: genFx("toggle"),
  5844. fadeIn: { opacity: "show" },
  5845. fadeOut: { opacity: "hide" },
  5846. fadeToggle: { opacity: "toggle" }
  5847. }, function( name, props ) {
  5848. jQuery.fn[ name ] = function( speed, easing, callback ) {
  5849. return this.animate( props, speed, easing, callback );
  5850. };
  5851. });
  5852. jQuery.timers = [];
  5853. jQuery.fx.tick = function() {
  5854. var timer,
  5855. i = 0,
  5856. timers = jQuery.timers;
  5857. fxNow = jQuery.now();
  5858. for ( ; i < timers.length; i++ ) {
  5859. timer = timers[ i ];
  5860. // Checks the timer has not already been removed
  5861. if ( !timer() && timers[ i ] === timer ) {
  5862. timers.splice( i--, 1 );
  5863. }
  5864. }
  5865. if ( !timers.length ) {
  5866. jQuery.fx.stop();
  5867. }
  5868. fxNow = undefined;
  5869. };
  5870. jQuery.fx.timer = function( timer ) {
  5871. jQuery.timers.push( timer );
  5872. if ( timer() ) {
  5873. jQuery.fx.start();
  5874. } else {
  5875. jQuery.timers.pop();
  5876. }
  5877. };
  5878. jQuery.fx.interval = 13;
  5879. jQuery.fx.start = function() {
  5880. if ( !timerId ) {
  5881. timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
  5882. }
  5883. };
  5884. jQuery.fx.stop = function() {
  5885. clearInterval( timerId );
  5886. timerId = null;
  5887. };
  5888. jQuery.fx.speeds = {
  5889. slow: 600,
  5890. fast: 200,
  5891. // Default speed
  5892. _default: 400
  5893. };
  5894. // Based off of the plugin by Clint Helfers, with permission.
  5895. // http://blindsignals.com/index.php/2009/07/jquery-delay/
  5896. jQuery.fn.delay = function( time, type ) {
  5897. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  5898. type = type || "fx";
  5899. return this.queue( type, function( next, hooks ) {
  5900. var timeout = setTimeout( next, time );
  5901. hooks.stop = function() {
  5902. clearTimeout( timeout );
  5903. };
  5904. });
  5905. };
  5906. (function() {
  5907. var input = document.createElement( "input" ),
  5908. select = document.createElement( "select" ),
  5909. opt = select.appendChild( document.createElement( "option" ) );
  5910. input.type = "checkbox";
  5911. // Support: iOS<=5.1, Android<=4.2+
  5912. // Default value for a checkbox should be "on"
  5913. support.checkOn = input.value !== "";
  5914. // Support: IE<=11+
  5915. // Must access selectedIndex to make default options select
  5916. support.optSelected = opt.selected;
  5917. // Support: Android<=2.3
  5918. // Options inside disabled selects are incorrectly marked as disabled
  5919. select.disabled = true;
  5920. support.optDisabled = !opt.disabled;
  5921. // Support: IE<=11+
  5922. // An input loses its value after becoming a radio
  5923. input = document.createElement( "input" );
  5924. input.value = "t";
  5925. input.type = "radio";
  5926. support.radioValue = input.value === "t";
  5927. })();
  5928. var nodeHook, boolHook,
  5929. attrHandle = jQuery.expr.attrHandle;
  5930. jQuery.fn.extend({
  5931. attr: function( name, value ) {
  5932. return access( this, jQuery.attr, name, value, arguments.length > 1 );
  5933. },
  5934. removeAttr: function( name ) {
  5935. return this.each(function() {
  5936. jQuery.removeAttr( this, name );
  5937. });
  5938. }
  5939. });
  5940. jQuery.extend({
  5941. attr: function( elem, name, value ) {
  5942. var hooks, ret,
  5943. nType = elem.nodeType;
  5944. // don't get/set attributes on text, comment and attribute nodes
  5945. if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
  5946. return;
  5947. }
  5948. // Fallback to prop when attributes are not supported
  5949. if ( typeof elem.getAttribute === strundefined ) {
  5950. return jQuery.prop( elem, name, value );
  5951. }
  5952. // All attributes are lowercase
  5953. // Grab necessary hook if one is defined
  5954. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  5955. name = name.toLowerCase();
  5956. hooks = jQuery.attrHooks[ name ] ||
  5957. ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
  5958. }
  5959. if ( value !== undefined ) {
  5960. if ( value === null ) {
  5961. jQuery.removeAttr( elem, name );
  5962. } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
  5963. return ret;
  5964. } else {
  5965. elem.setAttribute( name, value + "" );
  5966. return value;
  5967. }
  5968. } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
  5969. return ret;
  5970. } else {
  5971. ret = jQuery.find.attr( elem, name );
  5972. // Non-existent attributes return null, we normalize to undefined
  5973. return ret == null ?
  5974. undefined :
  5975. ret;
  5976. }
  5977. },
  5978. removeAttr: function( elem, value ) {
  5979. var name, propName,
  5980. i = 0,
  5981. attrNames = value && value.match( rnotwhite );
  5982. if ( attrNames && elem.nodeType === 1 ) {
  5983. while ( (name = attrNames[i++]) ) {
  5984. propName = jQuery.propFix[ name ] || name;
  5985. // Boolean attributes get special treatment (#10870)
  5986. if ( jQuery.expr.match.bool.test( name ) ) {
  5987. // Set corresponding property to false
  5988. elem[ propName ] = false;
  5989. }
  5990. elem.removeAttribute( name );
  5991. }
  5992. }
  5993. },
  5994. attrHooks: {
  5995. type: {
  5996. set: function( elem, value ) {
  5997. if ( !support.radioValue && value === "radio" &&
  5998. jQuery.nodeName( elem, "input" ) ) {
  5999. var val = elem.value;
  6000. elem.setAttribute( "type", value );
  6001. if ( val ) {
  6002. elem.value = val;
  6003. }
  6004. return value;
  6005. }
  6006. }
  6007. }
  6008. }
  6009. });
  6010. // Hooks for boolean attributes
  6011. boolHook = {
  6012. set: function( elem, value, name ) {
  6013. if ( value === false ) {
  6014. // Remove boolean attributes when set to false
  6015. jQuery.removeAttr( elem, name );
  6016. } else {
  6017. elem.setAttribute( name, name );
  6018. }
  6019. return name;
  6020. }
  6021. };
  6022. jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
  6023. var getter = attrHandle[ name ] || jQuery.find.attr;
  6024. attrHandle[ name ] = function( elem, name, isXML ) {
  6025. var ret, handle;
  6026. if ( !isXML ) {
  6027. // Avoid an infinite loop by temporarily removing this function from the getter
  6028. handle = attrHandle[ name ];
  6029. attrHandle[ name ] = ret;
  6030. ret = getter( elem, name, isXML ) != null ?
  6031. name.toLowerCase() :
  6032. null;
  6033. attrHandle[ name ] = handle;
  6034. }
  6035. return ret;
  6036. };
  6037. });
  6038. var rfocusable = /^(?:input|select|textarea|button)$/i;
  6039. jQuery.fn.extend({
  6040. prop: function( name, value ) {
  6041. return access( this, jQuery.prop, name, value, arguments.length > 1 );
  6042. },
  6043. removeProp: function( name ) {
  6044. return this.each(function() {
  6045. delete this[ jQuery.propFix[ name ] || name ];
  6046. });
  6047. }
  6048. });
  6049. jQuery.extend({
  6050. propFix: {
  6051. "for": "htmlFor",
  6052. "class": "className"
  6053. },
  6054. prop: function( elem, name, value ) {
  6055. var ret, hooks, notxml,
  6056. nType = elem.nodeType;
  6057. // Don't get/set properties on text, comment and attribute nodes
  6058. if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
  6059. return;
  6060. }
  6061. notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
  6062. if ( notxml ) {
  6063. // Fix name and attach hooks
  6064. name = jQuery.propFix[ name ] || name;
  6065. hooks = jQuery.propHooks[ name ];
  6066. }
  6067. if ( value !== undefined ) {
  6068. return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
  6069. ret :
  6070. ( elem[ name ] = value );
  6071. } else {
  6072. return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
  6073. ret :
  6074. elem[ name ];
  6075. }
  6076. },
  6077. propHooks: {
  6078. tabIndex: {
  6079. get: function( elem ) {
  6080. return elem.hasAttribute( "tabindex" ) || rfocusable.test( elem.nodeName ) || elem.href ?
  6081. elem.tabIndex :
  6082. -1;
  6083. }
  6084. }
  6085. }
  6086. });
  6087. if ( !support.optSelected ) {
  6088. jQuery.propHooks.selected = {
  6089. get: function( elem ) {
  6090. var parent = elem.parentNode;
  6091. if ( parent && parent.parentNode ) {
  6092. parent.parentNode.selectedIndex;
  6093. }
  6094. return null;
  6095. }
  6096. };
  6097. }
  6098. jQuery.each([
  6099. "tabIndex",
  6100. "readOnly",
  6101. "maxLength",
  6102. "cellSpacing",
  6103. "cellPadding",
  6104. "rowSpan",
  6105. "colSpan",
  6106. "useMap",
  6107. "frameBorder",
  6108. "contentEditable"
  6109. ], function() {
  6110. jQuery.propFix[ this.toLowerCase() ] = this;
  6111. });
  6112. var rclass = /[\t\r\n\f]/g;
  6113. jQuery.fn.extend({
  6114. addClass: function( value ) {
  6115. var classes, elem, cur, clazz, j, finalValue,
  6116. proceed = typeof value === "string" && value,
  6117. i = 0,
  6118. len = this.length;
  6119. if ( jQuery.isFunction( value ) ) {
  6120. return this.each(function( j ) {
  6121. jQuery( this ).addClass( value.call( this, j, this.className ) );
  6122. });
  6123. }
  6124. if ( proceed ) {
  6125. // The disjunction here is for better compressibility (see removeClass)
  6126. classes = ( value || "" ).match( rnotwhite ) || [];
  6127. for ( ; i < len; i++ ) {
  6128. elem = this[ i ];
  6129. cur = elem.nodeType === 1 && ( elem.className ?
  6130. ( " " + elem.className + " " ).replace( rclass, " " ) :
  6131. " "
  6132. );
  6133. if ( cur ) {
  6134. j = 0;
  6135. while ( (clazz = classes[j++]) ) {
  6136. if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
  6137. cur += clazz + " ";
  6138. }
  6139. }
  6140. // only assign if different to avoid unneeded rendering.
  6141. finalValue = jQuery.trim( cur );
  6142. if ( elem.className !== finalValue ) {
  6143. elem.className = finalValue;
  6144. }
  6145. }
  6146. }
  6147. }
  6148. return this;
  6149. },
  6150. removeClass: function( value ) {
  6151. var classes, elem, cur, clazz, j, finalValue,
  6152. proceed = arguments.length === 0 || typeof value === "string" && value,
  6153. i = 0,
  6154. len = this.length;
  6155. if ( jQuery.isFunction( value ) ) {
  6156. return this.each(function( j ) {
  6157. jQuery( this ).removeClass( value.call( this, j, this.className ) );
  6158. });
  6159. }
  6160. if ( proceed ) {
  6161. classes = ( value || "" ).match( rnotwhite ) || [];
  6162. for ( ; i < len; i++ ) {
  6163. elem = this[ i ];
  6164. // This expression is here for better compressibility (see addClass)
  6165. cur = elem.nodeType === 1 && ( elem.className ?
  6166. ( " " + elem.className + " " ).replace( rclass, " " ) :
  6167. ""
  6168. );
  6169. if ( cur ) {
  6170. j = 0;
  6171. while ( (clazz = classes[j++]) ) {
  6172. // Remove *all* instances
  6173. while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
  6174. cur = cur.replace( " " + clazz + " ", " " );
  6175. }
  6176. }
  6177. // Only assign if different to avoid unneeded rendering.
  6178. finalValue = value ? jQuery.trim( cur ) : "";
  6179. if ( elem.className !== finalValue ) {
  6180. elem.className = finalValue;
  6181. }
  6182. }
  6183. }
  6184. }
  6185. return this;
  6186. },
  6187. toggleClass: function( value, stateVal ) {
  6188. var type = typeof value;
  6189. if ( typeof stateVal === "boolean" && type === "string" ) {
  6190. return stateVal ? this.addClass( value ) : this.removeClass( value );
  6191. }
  6192. if ( jQuery.isFunction( value ) ) {
  6193. return this.each(function( i ) {
  6194. jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
  6195. });
  6196. }
  6197. return this.each(function() {
  6198. if ( type === "string" ) {
  6199. // Toggle individual class names
  6200. var className,
  6201. i = 0,
  6202. self = jQuery( this ),
  6203. classNames = value.match( rnotwhite ) || [];
  6204. while ( (className = classNames[ i++ ]) ) {
  6205. // Check each className given, space separated list
  6206. if ( self.hasClass( className ) ) {
  6207. self.removeClass( className );
  6208. } else {
  6209. self.addClass( className );
  6210. }
  6211. }
  6212. // Toggle whole class name
  6213. } else if ( type === strundefined || type === "boolean" ) {
  6214. if ( this.className ) {
  6215. // store className if set
  6216. data_priv.set( this, "__className__", this.className );
  6217. }
  6218. // If the element has a class name or if we're passed `false`,
  6219. // then remove the whole classname (if there was one, the above saved it).
  6220. // Otherwise bring back whatever was previously saved (if anything),
  6221. // falling back to the empty string if nothing was stored.
  6222. this.className = this.className || value === false ? "" : data_priv.get( this, "__className__" ) || "";
  6223. }
  6224. });
  6225. },
  6226. hasClass: function( selector ) {
  6227. var className = " " + selector + " ",
  6228. i = 0,
  6229. l = this.length;
  6230. for ( ; i < l; i++ ) {
  6231. if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
  6232. return true;
  6233. }
  6234. }
  6235. return false;
  6236. }
  6237. });
  6238. var rreturn = /\r/g;
  6239. jQuery.fn.extend({
  6240. val: function( value ) {
  6241. var hooks, ret, isFunction,
  6242. elem = this[0];
  6243. if ( !arguments.length ) {
  6244. if ( elem ) {
  6245. hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
  6246. if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
  6247. return ret;
  6248. }
  6249. ret = elem.value;
  6250. return typeof ret === "string" ?
  6251. // Handle most common string cases
  6252. ret.replace(rreturn, "") :
  6253. // Handle cases where value is null/undef or number
  6254. ret == null ? "" : ret;
  6255. }
  6256. return;
  6257. }
  6258. isFunction = jQuery.isFunction( value );
  6259. return this.each(function( i ) {
  6260. var val;
  6261. if ( this.nodeType !== 1 ) {
  6262. return;
  6263. }
  6264. if ( isFunction ) {
  6265. val = value.call( this, i, jQuery( this ).val() );
  6266. } else {
  6267. val = value;
  6268. }
  6269. // Treat null/undefined as ""; convert numbers to string
  6270. if ( val == null ) {
  6271. val = "";
  6272. } else if ( typeof val === "number" ) {
  6273. val += "";
  6274. } else if ( jQuery.isArray( val ) ) {
  6275. val = jQuery.map( val, function( value ) {
  6276. return value == null ? "" : value + "";
  6277. });
  6278. }
  6279. hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
  6280. // If set returns undefined, fall back to normal setting
  6281. if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
  6282. this.value = val;
  6283. }
  6284. });
  6285. }
  6286. });
  6287. jQuery.extend({
  6288. valHooks: {
  6289. option: {
  6290. get: function( elem ) {
  6291. var val = jQuery.find.attr( elem, "value" );
  6292. return val != null ?
  6293. val :
  6294. // Support: IE10-11+
  6295. // option.text throws exceptions (#14686, #14858)
  6296. jQuery.trim( jQuery.text( elem ) );
  6297. }
  6298. },
  6299. select: {
  6300. get: function( elem ) {
  6301. var value, option,
  6302. options = elem.options,
  6303. index = elem.selectedIndex,
  6304. one = elem.type === "select-one" || index < 0,
  6305. values = one ? null : [],
  6306. max = one ? index + 1 : options.length,
  6307. i = index < 0 ?
  6308. max :
  6309. one ? index : 0;
  6310. // Loop through all the selected options
  6311. for ( ; i < max; i++ ) {
  6312. option = options[ i ];
  6313. // IE6-9 doesn't update selected after form reset (#2551)
  6314. if ( ( option.selected || i === index ) &&
  6315. // Don't return options that are disabled or in a disabled optgroup
  6316. ( support.optDisabled ? !option.disabled : option.getAttribute( "disabled" ) === null ) &&
  6317. ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
  6318. // Get the specific value for the option
  6319. value = jQuery( option ).val();
  6320. // We don't need an array for one selects
  6321. if ( one ) {
  6322. return value;
  6323. }
  6324. // Multi-Selects return an array
  6325. values.push( value );
  6326. }
  6327. }
  6328. return values;
  6329. },
  6330. set: function( elem, value ) {
  6331. var optionSet, option,
  6332. options = elem.options,
  6333. values = jQuery.makeArray( value ),
  6334. i = options.length;
  6335. while ( i-- ) {
  6336. option = options[ i ];
  6337. if ( (option.selected = jQuery.inArray( option.value, values ) >= 0) ) {
  6338. optionSet = true;
  6339. }
  6340. }
  6341. // Force browsers to behave consistently when non-matching value is set
  6342. if ( !optionSet ) {
  6343. elem.selectedIndex = -1;
  6344. }
  6345. return values;
  6346. }
  6347. }
  6348. }
  6349. });
  6350. // Radios and checkboxes getter/setter
  6351. jQuery.each([ "radio", "checkbox" ], function() {
  6352. jQuery.valHooks[ this ] = {
  6353. set: function( elem, value ) {
  6354. if ( jQuery.isArray( value ) ) {
  6355. return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
  6356. }
  6357. }
  6358. };
  6359. if ( !support.checkOn ) {
  6360. jQuery.valHooks[ this ].get = function( elem ) {
  6361. return elem.getAttribute("value") === null ? "on" : elem.value;
  6362. };
  6363. }
  6364. });
  6365. // Return jQuery for attributes-only inclusion
  6366. jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
  6367. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  6368. "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
  6369. // Handle event binding
  6370. jQuery.fn[ name ] = function( data, fn ) {
  6371. return arguments.length > 0 ?
  6372. this.on( name, null, data, fn ) :
  6373. this.trigger( name );
  6374. };
  6375. });
  6376. jQuery.fn.extend({
  6377. hover: function( fnOver, fnOut ) {
  6378. return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  6379. },
  6380. bind: function( types, data, fn ) {
  6381. return this.on( types, null, data, fn );
  6382. },
  6383. unbind: function( types, fn ) {
  6384. return this.off( types, null, fn );
  6385. },
  6386. delegate: function( selector, types, data, fn ) {
  6387. return this.on( types, selector, data, fn );
  6388. },
  6389. undelegate: function( selector, types, fn ) {
  6390. // ( namespace ) or ( selector, types [, fn] )
  6391. return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
  6392. }
  6393. });
  6394. var nonce = jQuery.now();
  6395. var rquery = (/\?/);
  6396. // Support: Android 2.3
  6397. // Workaround failure to string-cast null input
  6398. jQuery.parseJSON = function( data ) {
  6399. return JSON.parse( data + "" );
  6400. };
  6401. // Cross-browser xml parsing
  6402. jQuery.parseXML = function( data ) {
  6403. var xml, tmp;
  6404. if ( !data || typeof data !== "string" ) {
  6405. return null;
  6406. }
  6407. // Support: IE9
  6408. try {
  6409. tmp = new DOMParser();
  6410. xml = tmp.parseFromString( data, "text/xml" );
  6411. } catch ( e ) {
  6412. xml = undefined;
  6413. }
  6414. if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
  6415. jQuery.error( "Invalid XML: " + data );
  6416. }
  6417. return xml;
  6418. };
  6419. var
  6420. rhash = /#.*$/,
  6421. rts = /([?&])_=[^&]*/,
  6422. rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
  6423. // #7653, #8125, #8152: local protocol detection
  6424. rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
  6425. rnoContent = /^(?:GET|HEAD)$/,
  6426. rprotocol = /^\/\//,
  6427. rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
  6428. /* Prefilters
  6429. * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
  6430. * 2) These are called:
  6431. * - BEFORE asking for a transport
  6432. * - AFTER param serialization (s.data is a string if s.processData is true)
  6433. * 3) key is the dataType
  6434. * 4) the catchall symbol "*" can be used
  6435. * 5) execution will start with transport dataType and THEN continue down to "*" if needed
  6436. */
  6437. prefilters = {},
  6438. /* Transports bindings
  6439. * 1) key is the dataType
  6440. * 2) the catchall symbol "*" can be used
  6441. * 3) selection will start with transport dataType and THEN go to "*" if needed
  6442. */
  6443. transports = {},
  6444. // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
  6445. allTypes = "*/".concat( "*" ),
  6446. // Document location
  6447. ajaxLocation = window.location.href,
  6448. // Segment location into parts
  6449. ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
  6450. // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
  6451. function addToPrefiltersOrTransports( structure ) {
  6452. // dataTypeExpression is optional and defaults to "*"
  6453. return function( dataTypeExpression, func ) {
  6454. if ( typeof dataTypeExpression !== "string" ) {
  6455. func = dataTypeExpression;
  6456. dataTypeExpression = "*";
  6457. }
  6458. var dataType,
  6459. i = 0,
  6460. dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
  6461. if ( jQuery.isFunction( func ) ) {
  6462. // For each dataType in the dataTypeExpression
  6463. while ( (dataType = dataTypes[i++]) ) {
  6464. // Prepend if requested
  6465. if ( dataType[0] === "+" ) {
  6466. dataType = dataType.slice( 1 ) || "*";
  6467. (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
  6468. // Otherwise append
  6469. } else {
  6470. (structure[ dataType ] = structure[ dataType ] || []).push( func );
  6471. }
  6472. }
  6473. }
  6474. };
  6475. }
  6476. // Base inspection function for prefilters and transports
  6477. function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
  6478. var inspected = {},
  6479. seekingTransport = ( structure === transports );
  6480. function inspect( dataType ) {
  6481. var selected;
  6482. inspected[ dataType ] = true;
  6483. jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
  6484. var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
  6485. if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
  6486. options.dataTypes.unshift( dataTypeOrTransport );
  6487. inspect( dataTypeOrTransport );
  6488. return false;
  6489. } else if ( seekingTransport ) {
  6490. return !( selected = dataTypeOrTransport );
  6491. }
  6492. });
  6493. return selected;
  6494. }
  6495. return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
  6496. }
  6497. // A special extend for ajax options
  6498. // that takes "flat" options (not to be deep extended)
  6499. // Fixes #9887
  6500. function ajaxExtend( target, src ) {
  6501. var key, deep,
  6502. flatOptions = jQuery.ajaxSettings.flatOptions || {};
  6503. for ( key in src ) {
  6504. if ( src[ key ] !== undefined ) {
  6505. ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
  6506. }
  6507. }
  6508. if ( deep ) {
  6509. jQuery.extend( true, target, deep );
  6510. }
  6511. return target;
  6512. }
  6513. /* Handles responses to an ajax request:
  6514. * - finds the right dataType (mediates between content-type and expected dataType)
  6515. * - returns the corresponding response
  6516. */
  6517. function ajaxHandleResponses( s, jqXHR, responses ) {
  6518. var ct, type, finalDataType, firstDataType,
  6519. contents = s.contents,
  6520. dataTypes = s.dataTypes;
  6521. // Remove auto dataType and get content-type in the process
  6522. while ( dataTypes[ 0 ] === "*" ) {
  6523. dataTypes.shift();
  6524. if ( ct === undefined ) {
  6525. ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
  6526. }
  6527. }
  6528. // Check if we're dealing with a known content-type
  6529. if ( ct ) {
  6530. for ( type in contents ) {
  6531. if ( contents[ type ] && contents[ type ].test( ct ) ) {
  6532. dataTypes.unshift( type );
  6533. break;
  6534. }
  6535. }
  6536. }
  6537. // Check to see if we have a response for the expected dataType
  6538. if ( dataTypes[ 0 ] in responses ) {
  6539. finalDataType = dataTypes[ 0 ];
  6540. } else {
  6541. // Try convertible dataTypes
  6542. for ( type in responses ) {
  6543. if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
  6544. finalDataType = type;
  6545. break;
  6546. }
  6547. if ( !firstDataType ) {
  6548. firstDataType = type;
  6549. }
  6550. }
  6551. // Or just use first one
  6552. finalDataType = finalDataType || firstDataType;
  6553. }
  6554. // If we found a dataType
  6555. // We add the dataType to the list if needed
  6556. // and return the corresponding response
  6557. if ( finalDataType ) {
  6558. if ( finalDataType !== dataTypes[ 0 ] ) {
  6559. dataTypes.unshift( finalDataType );
  6560. }
  6561. return responses[ finalDataType ];
  6562. }
  6563. }
  6564. /* Chain conversions given the request and the original response
  6565. * Also sets the responseXXX fields on the jqXHR instance
  6566. */
  6567. function ajaxConvert( s, response, jqXHR, isSuccess ) {
  6568. var conv2, current, conv, tmp, prev,
  6569. converters = {},
  6570. // Work with a copy of dataTypes in case we need to modify it for conversion
  6571. dataTypes = s.dataTypes.slice();
  6572. // Create converters map with lowercased keys
  6573. if ( dataTypes[ 1 ] ) {
  6574. for ( conv in s.converters ) {
  6575. converters[ conv.toLowerCase() ] = s.converters[ conv ];
  6576. }
  6577. }
  6578. current = dataTypes.shift();
  6579. // Convert to each sequential dataType
  6580. while ( current ) {
  6581. if ( s.responseFields[ current ] ) {
  6582. jqXHR[ s.responseFields[ current ] ] = response;
  6583. }
  6584. // Apply the dataFilter if provided
  6585. if ( !prev && isSuccess && s.dataFilter ) {
  6586. response = s.dataFilter( response, s.dataType );
  6587. }
  6588. prev = current;
  6589. current = dataTypes.shift();
  6590. if ( current ) {
  6591. // There's only work to do if current dataType is non-auto
  6592. if ( current === "*" ) {
  6593. current = prev;
  6594. // Convert response if prev dataType is non-auto and differs from current
  6595. } else if ( prev !== "*" && prev !== current ) {
  6596. // Seek a direct converter
  6597. conv = converters[ prev + " " + current ] || converters[ "* " + current ];
  6598. // If none found, seek a pair
  6599. if ( !conv ) {
  6600. for ( conv2 in converters ) {
  6601. // If conv2 outputs current
  6602. tmp = conv2.split( " " );
  6603. if ( tmp[ 1 ] === current ) {
  6604. // If prev can be converted to accepted input
  6605. conv = converters[ prev + " " + tmp[ 0 ] ] ||
  6606. converters[ "* " + tmp[ 0 ] ];
  6607. if ( conv ) {
  6608. // Condense equivalence converters
  6609. if ( conv === true ) {
  6610. conv = converters[ conv2 ];
  6611. // Otherwise, insert the intermediate dataType
  6612. } else if ( converters[ conv2 ] !== true ) {
  6613. current = tmp[ 0 ];
  6614. dataTypes.unshift( tmp[ 1 ] );
  6615. }
  6616. break;
  6617. }
  6618. }
  6619. }
  6620. }
  6621. // Apply converter (if not an equivalence)
  6622. if ( conv !== true ) {
  6623. // Unless errors are allowed to bubble, catch and return them
  6624. if ( conv && s[ "throws" ] ) {
  6625. response = conv( response );
  6626. } else {
  6627. try {
  6628. response = conv( response );
  6629. } catch ( e ) {
  6630. return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
  6631. }
  6632. }
  6633. }
  6634. }
  6635. }
  6636. }
  6637. return { state: "success", data: response };
  6638. }
  6639. jQuery.extend({
  6640. // Counter for holding the number of active queries
  6641. active: 0,
  6642. // Last-Modified header cache for next request
  6643. lastModified: {},
  6644. etag: {},
  6645. ajaxSettings: {
  6646. url: ajaxLocation,
  6647. type: "GET",
  6648. isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
  6649. global: true,
  6650. processData: true,
  6651. async: true,
  6652. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  6653. /*
  6654. timeout: 0,
  6655. data: null,
  6656. dataType: null,
  6657. username: null,
  6658. password: null,
  6659. cache: null,
  6660. throws: false,
  6661. traditional: false,
  6662. headers: {},
  6663. */
  6664. accepts: {
  6665. "*": allTypes,
  6666. text: "text/plain",
  6667. html: "text/html",
  6668. xml: "application/xml, text/xml",
  6669. json: "application/json, text/javascript"
  6670. },
  6671. contents: {
  6672. xml: /xml/,
  6673. html: /html/,
  6674. json: /json/
  6675. },
  6676. responseFields: {
  6677. xml: "responseXML",
  6678. text: "responseText",
  6679. json: "responseJSON"
  6680. },
  6681. // Data converters
  6682. // Keys separate source (or catchall "*") and destination types with a single space
  6683. converters: {
  6684. // Convert anything to text
  6685. "* text": String,
  6686. // Text to html (true = no transformation)
  6687. "text html": true,
  6688. // Evaluate text as a json expression
  6689. "text json": jQuery.parseJSON,
  6690. // Parse text as xml
  6691. "text xml": jQuery.parseXML
  6692. },
  6693. // For options that shouldn't be deep extended:
  6694. // you can add your own custom options here if
  6695. // and when you create one that shouldn't be
  6696. // deep extended (see ajaxExtend)
  6697. flatOptions: {
  6698. url: true,
  6699. context: true
  6700. }
  6701. },
  6702. // Creates a full fledged settings object into target
  6703. // with both ajaxSettings and settings fields.
  6704. // If target is omitted, writes into ajaxSettings.
  6705. ajaxSetup: function( target, settings ) {
  6706. return settings ?
  6707. // Building a settings object
  6708. ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
  6709. // Extending ajaxSettings
  6710. ajaxExtend( jQuery.ajaxSettings, target );
  6711. },
  6712. ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
  6713. ajaxTransport: addToPrefiltersOrTransports( transports ),
  6714. // Main method
  6715. ajax: function( url, options ) {
  6716. // If url is an object, simulate pre-1.5 signature
  6717. if ( typeof url === "object" ) {
  6718. options = url;
  6719. url = undefined;
  6720. }
  6721. // Force options to be an object
  6722. options = options || {};
  6723. var transport,
  6724. // URL without anti-cache param
  6725. cacheURL,
  6726. // Response headers
  6727. responseHeadersString,
  6728. responseHeaders,
  6729. // timeout handle
  6730. timeoutTimer,
  6731. // Cross-domain detection vars
  6732. parts,
  6733. // To know if global events are to be dispatched
  6734. fireGlobals,
  6735. // Loop variable
  6736. i,
  6737. // Create the final options object
  6738. s = jQuery.ajaxSetup( {}, options ),
  6739. // Callbacks context
  6740. callbackContext = s.context || s,
  6741. // Context for global events is callbackContext if it is a DOM node or jQuery collection
  6742. globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
  6743. jQuery( callbackContext ) :
  6744. jQuery.event,
  6745. // Deferreds
  6746. deferred = jQuery.Deferred(),
  6747. completeDeferred = jQuery.Callbacks("once memory"),
  6748. // Status-dependent callbacks
  6749. statusCode = s.statusCode || {},
  6750. // Headers (they are sent all at once)
  6751. requestHeaders = {},
  6752. requestHeadersNames = {},
  6753. // The jqXHR state
  6754. state = 0,
  6755. // Default abort message
  6756. strAbort = "canceled",
  6757. // Fake xhr
  6758. jqXHR = {
  6759. readyState: 0,
  6760. // Builds headers hashtable if needed
  6761. getResponseHeader: function( key ) {
  6762. var match;
  6763. if ( state === 2 ) {
  6764. if ( !responseHeaders ) {
  6765. responseHeaders = {};
  6766. while ( (match = rheaders.exec( responseHeadersString )) ) {
  6767. responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
  6768. }
  6769. }
  6770. match = responseHeaders[ key.toLowerCase() ];
  6771. }
  6772. return match == null ? null : match;
  6773. },
  6774. // Raw string
  6775. getAllResponseHeaders: function() {
  6776. return state === 2 ? responseHeadersString : null;
  6777. },
  6778. // Caches the header
  6779. setRequestHeader: function( name, value ) {
  6780. var lname = name.toLowerCase();
  6781. if ( !state ) {
  6782. name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
  6783. requestHeaders[ name ] = value;
  6784. }
  6785. return this;
  6786. },
  6787. // Overrides response content-type header
  6788. overrideMimeType: function( type ) {
  6789. if ( !state ) {
  6790. s.mimeType = type;
  6791. }
  6792. return this;
  6793. },
  6794. // Status-dependent callbacks
  6795. statusCode: function( map ) {
  6796. var code;
  6797. if ( map ) {
  6798. if ( state < 2 ) {
  6799. for ( code in map ) {
  6800. // Lazy-add the new callback in a way that preserves old ones
  6801. statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
  6802. }
  6803. } else {
  6804. // Execute the appropriate callbacks
  6805. jqXHR.always( map[ jqXHR.status ] );
  6806. }
  6807. }
  6808. return this;
  6809. },
  6810. // Cancel the request
  6811. abort: function( statusText ) {
  6812. var finalText = statusText || strAbort;
  6813. if ( transport ) {
  6814. transport.abort( finalText );
  6815. }
  6816. done( 0, finalText );
  6817. return this;
  6818. }
  6819. };
  6820. // Attach deferreds
  6821. deferred.promise( jqXHR ).complete = completeDeferred.add;
  6822. jqXHR.success = jqXHR.done;
  6823. jqXHR.error = jqXHR.fail;
  6824. // Remove hash character (#7531: and string promotion)
  6825. // Add protocol if not provided (prefilters might expect it)
  6826. // Handle falsy url in the settings object (#10093: consistency with old signature)
  6827. // We also use the url parameter if available
  6828. s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" )
  6829. .replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
  6830. // Alias method option to type as per ticket #12004
  6831. s.type = options.method || options.type || s.method || s.type;
  6832. // Extract dataTypes list
  6833. s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
  6834. // A cross-domain request is in order when we have a protocol:host:port mismatch
  6835. if ( s.crossDomain == null ) {
  6836. parts = rurl.exec( s.url.toLowerCase() );
  6837. s.crossDomain = !!( parts &&
  6838. ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
  6839. ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
  6840. ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
  6841. );
  6842. }
  6843. // Convert data if not already a string
  6844. if ( s.data && s.processData && typeof s.data !== "string" ) {
  6845. s.data = jQuery.param( s.data, s.traditional );
  6846. }
  6847. // Apply prefilters
  6848. inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
  6849. // If request was aborted inside a prefilter, stop there
  6850. if ( state === 2 ) {
  6851. return jqXHR;
  6852. }
  6853. // We can fire global events as of now if asked to
  6854. // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
  6855. fireGlobals = jQuery.event && s.global;
  6856. // Watch for a new set of requests
  6857. if ( fireGlobals && jQuery.active++ === 0 ) {
  6858. jQuery.event.trigger("ajaxStart");
  6859. }
  6860. // Uppercase the type
  6861. s.type = s.type.toUpperCase();
  6862. // Determine if request has content
  6863. s.hasContent = !rnoContent.test( s.type );
  6864. // Save the URL in case we're toying with the If-Modified-Since
  6865. // and/or If-None-Match header later on
  6866. cacheURL = s.url;
  6867. // More options handling for requests with no content
  6868. if ( !s.hasContent ) {
  6869. // If data is available, append data to url
  6870. if ( s.data ) {
  6871. cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
  6872. // #9682: remove data so that it's not used in an eventual retry
  6873. delete s.data;
  6874. }
  6875. // Add anti-cache in url if needed
  6876. if ( s.cache === false ) {
  6877. s.url = rts.test( cacheURL ) ?
  6878. // If there is already a '_' parameter, set its value
  6879. cacheURL.replace( rts, "$1_=" + nonce++ ) :
  6880. // Otherwise add one to the end
  6881. cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
  6882. }
  6883. }
  6884. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  6885. if ( s.ifModified ) {
  6886. if ( jQuery.lastModified[ cacheURL ] ) {
  6887. jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
  6888. }
  6889. if ( jQuery.etag[ cacheURL ] ) {
  6890. jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
  6891. }
  6892. }
  6893. // Set the correct header, if data is being sent
  6894. if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
  6895. jqXHR.setRequestHeader( "Content-Type", s.contentType );
  6896. }
  6897. // Set the Accepts header for the server, depending on the dataType
  6898. jqXHR.setRequestHeader(
  6899. "Accept",
  6900. s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
  6901. s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
  6902. s.accepts[ "*" ]
  6903. );
  6904. // Check for headers option
  6905. for ( i in s.headers ) {
  6906. jqXHR.setRequestHeader( i, s.headers[ i ] );
  6907. }
  6908. // Allow custom headers/mimetypes and early abort
  6909. if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
  6910. // Abort if not done already and return
  6911. return jqXHR.abort();
  6912. }
  6913. // Aborting is no longer a cancellation
  6914. strAbort = "abort";
  6915. // Install callbacks on deferreds
  6916. for ( i in { success: 1, error: 1, complete: 1 } ) {
  6917. jqXHR[ i ]( s[ i ] );
  6918. }
  6919. // Get transport
  6920. transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
  6921. // If no transport, we auto-abort
  6922. if ( !transport ) {
  6923. done( -1, "No Transport" );
  6924. } else {
  6925. jqXHR.readyState = 1;
  6926. // Send global event
  6927. if ( fireGlobals ) {
  6928. globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
  6929. }
  6930. // Timeout
  6931. if ( s.async && s.timeout > 0 ) {
  6932. timeoutTimer = setTimeout(function() {
  6933. jqXHR.abort("timeout");
  6934. }, s.timeout );
  6935. }
  6936. try {
  6937. state = 1;
  6938. transport.send( requestHeaders, done );
  6939. } catch ( e ) {
  6940. // Propagate exception as error if not done
  6941. if ( state < 2 ) {
  6942. done( -1, e );
  6943. // Simply rethrow otherwise
  6944. } else {
  6945. throw e;
  6946. }
  6947. }
  6948. }
  6949. // Callback for when everything is done
  6950. function done( status, nativeStatusText, responses, headers ) {
  6951. var isSuccess, success, error, response, modified,
  6952. statusText = nativeStatusText;
  6953. // Called once
  6954. if ( state === 2 ) {
  6955. return;
  6956. }
  6957. // State is "done" now
  6958. state = 2;
  6959. // Clear timeout if it exists
  6960. if ( timeoutTimer ) {
  6961. clearTimeout( timeoutTimer );
  6962. }
  6963. // Dereference transport for early garbage collection
  6964. // (no matter how long the jqXHR object will be used)
  6965. transport = undefined;
  6966. // Cache response headers
  6967. responseHeadersString = headers || "";
  6968. // Set readyState
  6969. jqXHR.readyState = status > 0 ? 4 : 0;
  6970. // Determine if successful
  6971. isSuccess = status >= 200 && status < 300 || status === 304;
  6972. // Get response data
  6973. if ( responses ) {
  6974. response = ajaxHandleResponses( s, jqXHR, responses );
  6975. }
  6976. // Convert no matter what (that way responseXXX fields are always set)
  6977. response = ajaxConvert( s, response, jqXHR, isSuccess );
  6978. // If successful, handle type chaining
  6979. if ( isSuccess ) {
  6980. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  6981. if ( s.ifModified ) {
  6982. modified = jqXHR.getResponseHeader("Last-Modified");
  6983. if ( modified ) {
  6984. jQuery.lastModified[ cacheURL ] = modified;
  6985. }
  6986. modified = jqXHR.getResponseHeader("etag");
  6987. if ( modified ) {
  6988. jQuery.etag[ cacheURL ] = modified;
  6989. }
  6990. }
  6991. // if no content
  6992. if ( status === 204 || s.type === "HEAD" ) {
  6993. statusText = "nocontent";
  6994. // if not modified
  6995. } else if ( status === 304 ) {
  6996. statusText = "notmodified";
  6997. // If we have data, let's convert it
  6998. } else {
  6999. statusText = response.state;
  7000. success = response.data;
  7001. error = response.error;
  7002. isSuccess = !error;
  7003. }
  7004. } else {
  7005. // Extract error from statusText and normalize for non-aborts
  7006. error = statusText;
  7007. if ( status || !statusText ) {
  7008. statusText = "error";
  7009. if ( status < 0 ) {
  7010. status = 0;
  7011. }
  7012. }
  7013. }
  7014. // Set data for the fake xhr object
  7015. jqXHR.status = status;
  7016. jqXHR.statusText = ( nativeStatusText || statusText ) + "";
  7017. // Success/Error
  7018. if ( isSuccess ) {
  7019. deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
  7020. } else {
  7021. deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
  7022. }
  7023. // Status-dependent callbacks
  7024. jqXHR.statusCode( statusCode );
  7025. statusCode = undefined;
  7026. if ( fireGlobals ) {
  7027. globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
  7028. [ jqXHR, s, isSuccess ? success : error ] );
  7029. }
  7030. // Complete
  7031. completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
  7032. if ( fireGlobals ) {
  7033. globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
  7034. // Handle the global AJAX counter
  7035. if ( !( --jQuery.active ) ) {
  7036. jQuery.event.trigger("ajaxStop");
  7037. }
  7038. }
  7039. }
  7040. return jqXHR;
  7041. },
  7042. getJSON: function( url, data, callback ) {
  7043. return jQuery.get( url, data, callback, "json" );
  7044. },
  7045. getScript: function( url, callback ) {
  7046. return jQuery.get( url, undefined, callback, "script" );
  7047. }
  7048. });
  7049. jQuery.each( [ "get", "post" ], function( i, method ) {
  7050. jQuery[ method ] = function( url, data, callback, type ) {
  7051. // Shift arguments if data argument was omitted
  7052. if ( jQuery.isFunction( data ) ) {
  7053. type = type || callback;
  7054. callback = data;
  7055. data = undefined;
  7056. }
  7057. return jQuery.ajax({
  7058. url: url,
  7059. type: method,
  7060. dataType: type,
  7061. data: data,
  7062. success: callback
  7063. });
  7064. };
  7065. });
  7066. jQuery._evalUrl = function( url ) {
  7067. return jQuery.ajax({
  7068. url: url,
  7069. type: "GET",
  7070. dataType: "script",
  7071. async: false,
  7072. global: false,
  7073. "throws": true
  7074. });
  7075. };
  7076. jQuery.fn.extend({
  7077. wrapAll: function( html ) {
  7078. var wrap;
  7079. if ( jQuery.isFunction( html ) ) {
  7080. return this.each(function( i ) {
  7081. jQuery( this ).wrapAll( html.call(this, i) );
  7082. });
  7083. }
  7084. if ( this[ 0 ] ) {
  7085. // The elements to wrap the target around
  7086. wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
  7087. if ( this[ 0 ].parentNode ) {
  7088. wrap.insertBefore( this[ 0 ] );
  7089. }
  7090. wrap.map(function() {
  7091. var elem = this;
  7092. while ( elem.firstElementChild ) {
  7093. elem = elem.firstElementChild;
  7094. }
  7095. return elem;
  7096. }).append( this );
  7097. }
  7098. return this;
  7099. },
  7100. wrapInner: function( html ) {
  7101. if ( jQuery.isFunction( html ) ) {
  7102. return this.each(function( i ) {
  7103. jQuery( this ).wrapInner( html.call(this, i) );
  7104. });
  7105. }
  7106. return this.each(function() {
  7107. var self = jQuery( this ),
  7108. contents = self.contents();
  7109. if ( contents.length ) {
  7110. contents.wrapAll( html );
  7111. } else {
  7112. self.append( html );
  7113. }
  7114. });
  7115. },
  7116. wrap: function( html ) {
  7117. var isFunction = jQuery.isFunction( html );
  7118. return this.each(function( i ) {
  7119. jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
  7120. });
  7121. },
  7122. unwrap: function() {
  7123. return this.parent().each(function() {
  7124. if ( !jQuery.nodeName( this, "body" ) ) {
  7125. jQuery( this ).replaceWith( this.childNodes );
  7126. }
  7127. }).end();
  7128. }
  7129. });
  7130. jQuery.expr.filters.hidden = function( elem ) {
  7131. // Support: Opera <= 12.12
  7132. // Opera reports offsetWidths and offsetHeights less than zero on some elements
  7133. return elem.offsetWidth <= 0 && elem.offsetHeight <= 0;
  7134. };
  7135. jQuery.expr.filters.visible = function( elem ) {
  7136. return !jQuery.expr.filters.hidden( elem );
  7137. };
  7138. var r20 = /%20/g,
  7139. rbracket = /\[\]$/,
  7140. rCRLF = /\r?\n/g,
  7141. rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
  7142. rsubmittable = /^(?:input|select|textarea|keygen)/i;
  7143. function buildParams( prefix, obj, traditional, add ) {
  7144. var name;
  7145. if ( jQuery.isArray( obj ) ) {
  7146. // Serialize array item.
  7147. jQuery.each( obj, function( i, v ) {
  7148. if ( traditional || rbracket.test( prefix ) ) {
  7149. // Treat each array item as a scalar.
  7150. add( prefix, v );
  7151. } else {
  7152. // Item is non-scalar (array or object), encode its numeric index.
  7153. buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
  7154. }
  7155. });
  7156. } else if ( !traditional && jQuery.type( obj ) === "object" ) {
  7157. // Serialize object item.
  7158. for ( name in obj ) {
  7159. buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  7160. }
  7161. } else {
  7162. // Serialize scalar item.
  7163. add( prefix, obj );
  7164. }
  7165. }
  7166. // Serialize an array of form elements or a set of
  7167. // key/values into a query string
  7168. jQuery.param = function( a, traditional ) {
  7169. var prefix,
  7170. s = [],
  7171. add = function( key, value ) {
  7172. // If value is a function, invoke it and return its value
  7173. value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
  7174. s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
  7175. };
  7176. // Set traditional to true for jQuery <= 1.3.2 behavior.
  7177. if ( traditional === undefined ) {
  7178. traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
  7179. }
  7180. // If an array was passed in, assume that it is an array of form elements.
  7181. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  7182. // Serialize the form elements
  7183. jQuery.each( a, function() {
  7184. add( this.name, this.value );
  7185. });
  7186. } else {
  7187. // If traditional, encode the "old" way (the way 1.3.2 or older
  7188. // did it), otherwise encode params recursively.
  7189. for ( prefix in a ) {
  7190. buildParams( prefix, a[ prefix ], traditional, add );
  7191. }
  7192. }
  7193. // Return the resulting serialization
  7194. return s.join( "&" ).replace( r20, "+" );
  7195. };
  7196. jQuery.fn.extend({
  7197. serialize: function() {
  7198. return jQuery.param( this.serializeArray() );
  7199. },
  7200. serializeArray: function() {
  7201. return this.map(function() {
  7202. // Can add propHook for "elements" to filter or add form elements
  7203. var elements = jQuery.prop( this, "elements" );
  7204. return elements ? jQuery.makeArray( elements ) : this;
  7205. })
  7206. .filter(function() {
  7207. var type = this.type;
  7208. // Use .is( ":disabled" ) so that fieldset[disabled] works
  7209. return this.name && !jQuery( this ).is( ":disabled" ) &&
  7210. rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
  7211. ( this.checked || !rcheckableType.test( type ) );
  7212. })
  7213. .map(function( i, elem ) {
  7214. var val = jQuery( this ).val();
  7215. return val == null ?
  7216. null :
  7217. jQuery.isArray( val ) ?
  7218. jQuery.map( val, function( val ) {
  7219. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  7220. }) :
  7221. { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  7222. }).get();
  7223. }
  7224. });
  7225. jQuery.ajaxSettings.xhr = function() {
  7226. try {
  7227. return new XMLHttpRequest();
  7228. } catch( e ) {}
  7229. };
  7230. var xhrId = 0,
  7231. xhrCallbacks = {},
  7232. xhrSuccessStatus = {
  7233. // file protocol always yields status code 0, assume 200
  7234. 0: 200,
  7235. // Support: IE9
  7236. // #1450: sometimes IE returns 1223 when it should be 204
  7237. 1223: 204
  7238. },
  7239. xhrSupported = jQuery.ajaxSettings.xhr();
  7240. // Support: IE9
  7241. // Open requests must be manually aborted on unload (#5280)
  7242. // See https://support.microsoft.com/kb/2856746 for more info
  7243. if ( window.attachEvent ) {
  7244. window.attachEvent( "onunload", function() {
  7245. for ( var key in xhrCallbacks ) {
  7246. xhrCallbacks[ key ]();
  7247. }
  7248. });
  7249. }
  7250. support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
  7251. support.ajax = xhrSupported = !!xhrSupported;
  7252. jQuery.ajaxTransport(function( options ) {
  7253. var callback;
  7254. // Cross domain only allowed if supported through XMLHttpRequest
  7255. if ( support.cors || xhrSupported && !options.crossDomain ) {
  7256. return {
  7257. send: function( headers, complete ) {
  7258. var i,
  7259. xhr = options.xhr(),
  7260. id = ++xhrId;
  7261. xhr.open( options.type, options.url, options.async, options.username, options.password );
  7262. // Apply custom fields if provided
  7263. if ( options.xhrFields ) {
  7264. for ( i in options.xhrFields ) {
  7265. xhr[ i ] = options.xhrFields[ i ];
  7266. }
  7267. }
  7268. // Override mime type if needed
  7269. if ( options.mimeType && xhr.overrideMimeType ) {
  7270. xhr.overrideMimeType( options.mimeType );
  7271. }
  7272. // X-Requested-With header
  7273. // For cross-domain requests, seeing as conditions for a preflight are
  7274. // akin to a jigsaw puzzle, we simply never set it to be sure.
  7275. // (it can always be set on a per-request basis or even using ajaxSetup)
  7276. // For same-domain requests, won't change header if already provided.
  7277. if ( !options.crossDomain && !headers["X-Requested-With"] ) {
  7278. headers["X-Requested-With"] = "XMLHttpRequest";
  7279. }
  7280. // Set headers
  7281. for ( i in headers ) {
  7282. xhr.setRequestHeader( i, headers[ i ] );
  7283. }
  7284. // Callback
  7285. callback = function( type ) {
  7286. return function() {
  7287. if ( callback ) {
  7288. delete xhrCallbacks[ id ];
  7289. callback = xhr.onload = xhr.onerror = null;
  7290. if ( type === "abort" ) {
  7291. xhr.abort();
  7292. } else if ( type === "error" ) {
  7293. complete(
  7294. // file: protocol always yields status 0; see #8605, #14207
  7295. xhr.status,
  7296. xhr.statusText
  7297. );
  7298. } else {
  7299. complete(
  7300. xhrSuccessStatus[ xhr.status ] || xhr.status,
  7301. xhr.statusText,
  7302. // Support: IE9
  7303. // Accessing binary-data responseText throws an exception
  7304. // (#11426)
  7305. typeof xhr.responseText === "string" ? {
  7306. text: xhr.responseText
  7307. } : undefined,
  7308. xhr.getAllResponseHeaders()
  7309. );
  7310. }
  7311. }
  7312. };
  7313. };
  7314. // Listen to events
  7315. xhr.onload = callback();
  7316. xhr.onerror = callback("error");
  7317. // Create the abort callback
  7318. callback = xhrCallbacks[ id ] = callback("abort");
  7319. try {
  7320. // Do send the request (this may raise an exception)
  7321. xhr.send( options.hasContent && options.data || null );
  7322. } catch ( e ) {
  7323. // #14683: Only rethrow if this hasn't been notified as an error yet
  7324. if ( callback ) {
  7325. throw e;
  7326. }
  7327. }
  7328. },
  7329. abort: function() {
  7330. if ( callback ) {
  7331. callback();
  7332. }
  7333. }
  7334. };
  7335. }
  7336. });
  7337. // Install script dataType
  7338. jQuery.ajaxSetup({
  7339. accepts: {
  7340. script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
  7341. },
  7342. contents: {
  7343. script: /(?:java|ecma)script/
  7344. },
  7345. converters: {
  7346. "text script": function( text ) {
  7347. jQuery.globalEval( text );
  7348. return text;
  7349. }
  7350. }
  7351. });
  7352. // Handle cache's special case and crossDomain
  7353. jQuery.ajaxPrefilter( "script", function( s ) {
  7354. if ( s.cache === undefined ) {
  7355. s.cache = false;
  7356. }
  7357. if ( s.crossDomain ) {
  7358. s.type = "GET";
  7359. }
  7360. });
  7361. // Bind script tag hack transport
  7362. jQuery.ajaxTransport( "script", function( s ) {
  7363. // This transport only deals with cross domain requests
  7364. if ( s.crossDomain ) {
  7365. var script, callback;
  7366. return {
  7367. send: function( _, complete ) {
  7368. script = jQuery("<script>").prop({
  7369. async: true,
  7370. charset: s.scriptCharset,
  7371. src: s.url
  7372. }).on(
  7373. "load error",
  7374. callback = function( evt ) {
  7375. script.remove();
  7376. callback = null;
  7377. if ( evt ) {
  7378. complete( evt.type === "error" ? 404 : 200, evt.type );
  7379. }
  7380. }
  7381. );
  7382. document.head.appendChild( script[ 0 ] );
  7383. },
  7384. abort: function() {
  7385. if ( callback ) {
  7386. callback();
  7387. }
  7388. }
  7389. };
  7390. }
  7391. });
  7392. var oldCallbacks = [],
  7393. rjsonp = /(=)\?(?=&|$)|\?\?/;
  7394. // Default jsonp settings
  7395. jQuery.ajaxSetup({
  7396. jsonp: "callback",
  7397. jsonpCallback: function() {
  7398. var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
  7399. this[ callback ] = true;
  7400. return callback;
  7401. }
  7402. });
  7403. // Detect, normalize options and install callbacks for jsonp requests
  7404. jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
  7405. var callbackName, overwritten, responseContainer,
  7406. jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
  7407. "url" :
  7408. typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
  7409. );
  7410. // Handle iff the expected data type is "jsonp" or we have a parameter to set
  7411. if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
  7412. // Get callback name, remembering preexisting value associated with it
  7413. callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
  7414. s.jsonpCallback() :
  7415. s.jsonpCallback;
  7416. // Insert callback into url or form data
  7417. if ( jsonProp ) {
  7418. s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
  7419. } else if ( s.jsonp !== false ) {
  7420. s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
  7421. }
  7422. // Use data converter to retrieve json after script execution
  7423. s.converters["script json"] = function() {
  7424. if ( !responseContainer ) {
  7425. jQuery.error( callbackName + " was not called" );
  7426. }
  7427. return responseContainer[ 0 ];
  7428. };
  7429. // force json dataType
  7430. s.dataTypes[ 0 ] = "json";
  7431. // Install callback
  7432. overwritten = window[ callbackName ];
  7433. window[ callbackName ] = function() {
  7434. responseContainer = arguments;
  7435. };
  7436. // Clean-up function (fires after converters)
  7437. jqXHR.always(function() {
  7438. // Restore preexisting value
  7439. window[ callbackName ] = overwritten;
  7440. // Save back as free
  7441. if ( s[ callbackName ] ) {
  7442. // make sure that re-using the options doesn't screw things around
  7443. s.jsonpCallback = originalSettings.jsonpCallback;
  7444. // save the callback name for future use
  7445. oldCallbacks.push( callbackName );
  7446. }
  7447. // Call if it was a function and we have a response
  7448. if ( responseContainer && jQuery.isFunction( overwritten ) ) {
  7449. overwritten( responseContainer[ 0 ] );
  7450. }
  7451. responseContainer = overwritten = undefined;
  7452. });
  7453. // Delegate to script
  7454. return "script";
  7455. }
  7456. });
  7457. // data: string of html
  7458. // context (optional): If specified, the fragment will be created in this context, defaults to document
  7459. // keepScripts (optional): If true, will include scripts passed in the html string
  7460. jQuery.parseHTML = function( data, context, keepScripts ) {
  7461. if ( !data || typeof data !== "string" ) {
  7462. return null;
  7463. }
  7464. if ( typeof context === "boolean" ) {
  7465. keepScripts = context;
  7466. context = false;
  7467. }
  7468. context = context || document;
  7469. var parsed = rsingleTag.exec( data ),
  7470. scripts = !keepScripts && [];
  7471. // Single tag
  7472. if ( parsed ) {
  7473. return [ context.createElement( parsed[1] ) ];
  7474. }
  7475. parsed = jQuery.buildFragment( [ data ], context, scripts );
  7476. if ( scripts && scripts.length ) {
  7477. jQuery( scripts ).remove();
  7478. }
  7479. return jQuery.merge( [], parsed.childNodes );
  7480. };
  7481. // Keep a copy of the old load method
  7482. var _load = jQuery.fn.load;
  7483. /**
  7484. * Load a url into a page
  7485. */
  7486. jQuery.fn.load = function( url, params, callback ) {
  7487. if ( typeof url !== "string" && _load ) {
  7488. return _load.apply( this, arguments );
  7489. }
  7490. var selector, type, response,
  7491. self = this,
  7492. off = url.indexOf(" ");
  7493. if ( off >= 0 ) {
  7494. selector = jQuery.trim( url.slice( off ) );
  7495. url = url.slice( 0, off );
  7496. }
  7497. // If it's a function
  7498. if ( jQuery.isFunction( params ) ) {
  7499. // We assume that it's the callback
  7500. callback = params;
  7501. params = undefined;
  7502. // Otherwise, build a param string
  7503. } else if ( params && typeof params === "object" ) {
  7504. type = "POST";
  7505. }
  7506. // If we have elements to modify, make the request
  7507. if ( self.length > 0 ) {
  7508. jQuery.ajax({
  7509. url: url,
  7510. // if "type" variable is undefined, then "GET" method will be used
  7511. type: type,
  7512. dataType: "html",
  7513. data: params
  7514. }).done(function( responseText ) {
  7515. // Save response for use in complete callback
  7516. response = arguments;
  7517. self.html( selector ?
  7518. // If a selector was specified, locate the right elements in a dummy div
  7519. // Exclude scripts to avoid IE 'Permission Denied' errors
  7520. jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
  7521. // Otherwise use the full result
  7522. responseText );
  7523. }).complete( callback && function( jqXHR, status ) {
  7524. self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
  7525. });
  7526. }
  7527. return this;
  7528. };
  7529. // Attach a bunch of functions for handling common AJAX events
  7530. jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
  7531. jQuery.fn[ type ] = function( fn ) {
  7532. return this.on( type, fn );
  7533. };
  7534. });
  7535. jQuery.expr.filters.animated = function( elem ) {
  7536. return jQuery.grep(jQuery.timers, function( fn ) {
  7537. return elem === fn.elem;
  7538. }).length;
  7539. };
  7540. var docElem = window.document.documentElement;
  7541. /**
  7542. * Gets a window from an element
  7543. */
  7544. function getWindow( elem ) {
  7545. return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
  7546. }
  7547. jQuery.offset = {
  7548. setOffset: function( elem, options, i ) {
  7549. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
  7550. position = jQuery.css( elem, "position" ),
  7551. curElem = jQuery( elem ),
  7552. props = {};
  7553. // Set position first, in-case top/left are set even on static elem
  7554. if ( position === "static" ) {
  7555. elem.style.position = "relative";
  7556. }
  7557. curOffset = curElem.offset();
  7558. curCSSTop = jQuery.css( elem, "top" );
  7559. curCSSLeft = jQuery.css( elem, "left" );
  7560. calculatePosition = ( position === "absolute" || position === "fixed" ) &&
  7561. ( curCSSTop + curCSSLeft ).indexOf("auto") > -1;
  7562. // Need to be able to calculate position if either
  7563. // top or left is auto and position is either absolute or fixed
  7564. if ( calculatePosition ) {
  7565. curPosition = curElem.position();
  7566. curTop = curPosition.top;
  7567. curLeft = curPosition.left;
  7568. } else {
  7569. curTop = parseFloat( curCSSTop ) || 0;
  7570. curLeft = parseFloat( curCSSLeft ) || 0;
  7571. }
  7572. if ( jQuery.isFunction( options ) ) {
  7573. options = options.call( elem, i, curOffset );
  7574. }
  7575. if ( options.top != null ) {
  7576. props.top = ( options.top - curOffset.top ) + curTop;
  7577. }
  7578. if ( options.left != null ) {
  7579. props.left = ( options.left - curOffset.left ) + curLeft;
  7580. }
  7581. if ( "using" in options ) {
  7582. options.using.call( elem, props );
  7583. } else {
  7584. curElem.css( props );
  7585. }
  7586. }
  7587. };
  7588. jQuery.fn.extend({
  7589. offset: function( options ) {
  7590. if ( arguments.length ) {
  7591. return options === undefined ?
  7592. this :
  7593. this.each(function( i ) {
  7594. jQuery.offset.setOffset( this, options, i );
  7595. });
  7596. }
  7597. var docElem, win,
  7598. elem = this[ 0 ],
  7599. box = { top: 0, left: 0 },
  7600. doc = elem && elem.ownerDocument;
  7601. if ( !doc ) {
  7602. return;
  7603. }
  7604. docElem = doc.documentElement;
  7605. // Make sure it's not a disconnected DOM node
  7606. if ( !jQuery.contains( docElem, elem ) ) {
  7607. return box;
  7608. }
  7609. // Support: BlackBerry 5, iOS 3 (original iPhone)
  7610. // If we don't have gBCR, just use 0,0 rather than error
  7611. if ( typeof elem.getBoundingClientRect !== strundefined ) {
  7612. box = elem.getBoundingClientRect();
  7613. }
  7614. win = getWindow( doc );
  7615. return {
  7616. top: box.top + win.pageYOffset - docElem.clientTop,
  7617. left: box.left + win.pageXOffset - docElem.clientLeft
  7618. };
  7619. },
  7620. position: function() {
  7621. if ( !this[ 0 ] ) {
  7622. return;
  7623. }
  7624. var offsetParent, offset,
  7625. elem = this[ 0 ],
  7626. parentOffset = { top: 0, left: 0 };
  7627. // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
  7628. if ( jQuery.css( elem, "position" ) === "fixed" ) {
  7629. // Assume getBoundingClientRect is there when computed position is fixed
  7630. offset = elem.getBoundingClientRect();
  7631. } else {
  7632. // Get *real* offsetParent
  7633. offsetParent = this.offsetParent();
  7634. // Get correct offsets
  7635. offset = this.offset();
  7636. if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
  7637. parentOffset = offsetParent.offset();
  7638. }
  7639. // Add offsetParent borders
  7640. parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
  7641. parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
  7642. }
  7643. // Subtract parent offsets and element margins
  7644. return {
  7645. top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
  7646. left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
  7647. };
  7648. },
  7649. offsetParent: function() {
  7650. return this.map(function() {
  7651. var offsetParent = this.offsetParent || docElem;
  7652. while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {
  7653. offsetParent = offsetParent.offsetParent;
  7654. }
  7655. return offsetParent || docElem;
  7656. });
  7657. }
  7658. });
  7659. // Create scrollLeft and scrollTop methods
  7660. jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
  7661. var top = "pageYOffset" === prop;
  7662. jQuery.fn[ method ] = function( val ) {
  7663. return access( this, function( elem, method, val ) {
  7664. var win = getWindow( elem );
  7665. if ( val === undefined ) {
  7666. return win ? win[ prop ] : elem[ method ];
  7667. }
  7668. if ( win ) {
  7669. win.scrollTo(
  7670. !top ? val : window.pageXOffset,
  7671. top ? val : window.pageYOffset
  7672. );
  7673. } else {
  7674. elem[ method ] = val;
  7675. }
  7676. }, method, val, arguments.length, null );
  7677. };
  7678. });
  7679. // Support: Safari<7+, Chrome<37+
  7680. // Add the top/left cssHooks using jQuery.fn.position
  7681. // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
  7682. // Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280
  7683. // getComputedStyle returns percent when specified for top/left/bottom/right;
  7684. // rather than make the css module depend on the offset module, just check for it here
  7685. jQuery.each( [ "top", "left" ], function( i, prop ) {
  7686. jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
  7687. function( elem, computed ) {
  7688. if ( computed ) {
  7689. computed = curCSS( elem, prop );
  7690. // If curCSS returns percentage, fallback to offset
  7691. return rnumnonpx.test( computed ) ?
  7692. jQuery( elem ).position()[ prop ] + "px" :
  7693. computed;
  7694. }
  7695. }
  7696. );
  7697. });
  7698. // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
  7699. jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
  7700. jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
  7701. // Margin is only for outerHeight, outerWidth
  7702. jQuery.fn[ funcName ] = function( margin, value ) {
  7703. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  7704. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  7705. return access( this, function( elem, type, value ) {
  7706. var doc;
  7707. if ( jQuery.isWindow( elem ) ) {
  7708. // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
  7709. // isn't a whole lot we can do. See pull request at this URL for discussion:
  7710. // https://github.com/jquery/jquery/pull/764
  7711. return elem.document.documentElement[ "client" + name ];
  7712. }
  7713. // Get document width or height
  7714. if ( elem.nodeType === 9 ) {
  7715. doc = elem.documentElement;
  7716. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
  7717. // whichever is greatest
  7718. return Math.max(
  7719. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  7720. elem.body[ "offset" + name ], doc[ "offset" + name ],
  7721. doc[ "client" + name ]
  7722. );
  7723. }
  7724. return value === undefined ?
  7725. // Get width or height on the element, requesting but not forcing parseFloat
  7726. jQuery.css( elem, type, extra ) :
  7727. // Set width or height on the element
  7728. jQuery.style( elem, type, value, extra );
  7729. }, type, chainable ? margin : undefined, chainable, null );
  7730. };
  7731. });
  7732. });
  7733. // The number of elements contained in the matched element set
  7734. jQuery.fn.size = function() {
  7735. return this.length;
  7736. };
  7737. jQuery.fn.andSelf = jQuery.fn.addBack;
  7738. // Register as a named AMD module, since jQuery can be concatenated with other
  7739. // files that may use define, but not via a proper concatenation script that
  7740. // understands anonymous AMD modules. A named AMD is safest and most robust
  7741. // way to register. Lowercase jquery is used because AMD module names are
  7742. // derived from file names, and jQuery is normally delivered in a lowercase
  7743. // file name. Do this after creating the global so that if an AMD module wants
  7744. // to call noConflict to hide this version of jQuery, it will work.
  7745. // Note that for maximum portability, libraries that are not jQuery should
  7746. // declare themselves as anonymous modules, and avoid setting a global if an
  7747. // AMD loader is present. jQuery is a special case. For more information, see
  7748. // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
  7749. if ( true ) {
  7750. !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() {
  7751. return jQuery;
  7752. }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  7753. }
  7754. var
  7755. // Map over jQuery in case of overwrite
  7756. _jQuery = window.jQuery,
  7757. // Map over the $ in case of overwrite
  7758. _$ = window.$;
  7759. jQuery.noConflict = function( deep ) {
  7760. if ( window.$ === jQuery ) {
  7761. window.$ = _$;
  7762. }
  7763. if ( deep && window.jQuery === jQuery ) {
  7764. window.jQuery = _jQuery;
  7765. }
  7766. return jQuery;
  7767. };
  7768. // Expose jQuery and $ identifiers, even in AMD
  7769. // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
  7770. // and CommonJS for browser emulators (#13566)
  7771. if ( typeof noGlobal === strundefined ) {
  7772. window.jQuery = window.$ = jQuery;
  7773. }
  7774. return jQuery;
  7775. }));
  7776.  
  7777.  
  7778. /***/ },
  7779. /* 3 */
  7780. /*!**************************************************!*\
  7781. !*** ./~/babel-runtime/core-js/object/assign.js ***!
  7782. \**************************************************/
  7783. /***/ function(module, exports, __webpack_require__) {
  7784.  
  7785. module.exports = { "default": __webpack_require__(/*! core-js/library/fn/object/assign */ 4), __esModule: true };
  7786.  
  7787. /***/ },
  7788. /* 4 */
  7789. /*!***************************************************************!*\
  7790. !*** ./~/babel-runtime/~/core-js/library/fn/object/assign.js ***!
  7791. \***************************************************************/
  7792. /***/ function(module, exports, __webpack_require__) {
  7793.  
  7794. __webpack_require__(/*! ../../modules/es6.object.assign */ 5);
  7795. module.exports = __webpack_require__(/*! ../../modules/$.core */ 8).Object.assign;
  7796.  
  7797. /***/ },
  7798. /* 5 */
  7799. /*!************************************************************************!*\
  7800. !*** ./~/babel-runtime/~/core-js/library/modules/es6.object.assign.js ***!
  7801. \************************************************************************/
  7802. /***/ function(module, exports, __webpack_require__) {
  7803.  
  7804. // 19.1.3.1 Object.assign(target, source)
  7805. var $def = __webpack_require__(/*! ./$.def */ 6);
  7806. $def($def.S, 'Object', {assign: __webpack_require__(/*! ./$.assign */ 9)});
  7807.  
  7808. /***/ },
  7809. /* 6 */
  7810. /*!************************************************************!*\
  7811. !*** ./~/babel-runtime/~/core-js/library/modules/$.def.js ***!
  7812. \************************************************************/
  7813. /***/ function(module, exports, __webpack_require__) {
  7814.  
  7815. var global = __webpack_require__(/*! ./$.global */ 7)
  7816. , core = __webpack_require__(/*! ./$.core */ 8)
  7817. , PROTOTYPE = 'prototype';
  7818. var ctx = function(fn, that){
  7819. return function(){
  7820. return fn.apply(that, arguments);
  7821. };
  7822. };
  7823. var $def = function(type, name, source){
  7824. var key, own, out, exp
  7825. , isGlobal = type & $def.G
  7826. , isProto = type & $def.P
  7827. , target = isGlobal ? global : type & $def.S
  7828. ? global[name] : (global[name] || {})[PROTOTYPE]
  7829. , exports = isGlobal ? core : core[name] || (core[name] = {});
  7830. if(isGlobal)source = name;
  7831. for(key in source){
  7832. // contains in native
  7833. own = !(type & $def.F) && target && key in target;
  7834. if(own && key in exports)continue;
  7835. // export native or passed
  7836. out = own ? target[key] : source[key];
  7837. // prevent global pollution for namespaces
  7838. if(isGlobal && typeof target[key] != 'function')exp = source[key];
  7839. // bind timers to global for call from export context
  7840. else if(type & $def.B && own)exp = ctx(out, global);
  7841. // wrap global constructors for prevent change them in library
  7842. else if(type & $def.W && target[key] == out)!function(C){
  7843. exp = function(param){
  7844. return this instanceof C ? new C(param) : C(param);
  7845. };
  7846. exp[PROTOTYPE] = C[PROTOTYPE];
  7847. }(out);
  7848. else exp = isProto && typeof out == 'function' ? ctx(Function.call, out) : out;
  7849. // export
  7850. exports[key] = exp;
  7851. if(isProto)(exports[PROTOTYPE] || (exports[PROTOTYPE] = {}))[key] = out;
  7852. }
  7853. };
  7854. // type bitmap
  7855. $def.F = 1; // forced
  7856. $def.G = 2; // global
  7857. $def.S = 4; // static
  7858. $def.P = 8; // proto
  7859. $def.B = 16; // bind
  7860. $def.W = 32; // wrap
  7861. module.exports = $def;
  7862.  
  7863. /***/ },
  7864. /* 7 */
  7865. /*!***************************************************************!*\
  7866. !*** ./~/babel-runtime/~/core-js/library/modules/$.global.js ***!
  7867. \***************************************************************/
  7868. /***/ function(module, exports) {
  7869.  
  7870. var global = typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();
  7871. module.exports = global;
  7872. if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef
  7873.  
  7874. /***/ },
  7875. /* 8 */
  7876. /*!*************************************************************!*\
  7877. !*** ./~/babel-runtime/~/core-js/library/modules/$.core.js ***!
  7878. \*************************************************************/
  7879. /***/ function(module, exports) {
  7880.  
  7881. var core = module.exports = {};
  7882. if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef
  7883.  
  7884. /***/ },
  7885. /* 9 */
  7886. /*!***************************************************************!*\
  7887. !*** ./~/babel-runtime/~/core-js/library/modules/$.assign.js ***!
  7888. \***************************************************************/
  7889. /***/ function(module, exports, __webpack_require__) {
  7890.  
  7891. // 19.1.2.1 Object.assign(target, source, ...)
  7892. var toObject = __webpack_require__(/*! ./$.to-object */ 10)
  7893. , IObject = __webpack_require__(/*! ./$.iobject */ 12)
  7894. , enumKeys = __webpack_require__(/*! ./$.enum-keys */ 14);
  7895. /* eslint-disable no-unused-vars */
  7896. module.exports = Object.assign || function assign(target, source){
  7897. /* eslint-enable no-unused-vars */
  7898. var T = toObject(target)
  7899. , l = arguments.length
  7900. , i = 1;
  7901. while(l > i){
  7902. var S = IObject(arguments[i++])
  7903. , keys = enumKeys(S)
  7904. , length = keys.length
  7905. , j = 0
  7906. , key;
  7907. while(length > j)T[key = keys[j++]] = S[key];
  7908. }
  7909. return T;
  7910. };
  7911.  
  7912. /***/ },
  7913. /* 10 */
  7914. /*!******************************************************************!*\
  7915. !*** ./~/babel-runtime/~/core-js/library/modules/$.to-object.js ***!
  7916. \******************************************************************/
  7917. /***/ function(module, exports, __webpack_require__) {
  7918.  
  7919. // 7.1.13 ToObject(argument)
  7920. var defined = __webpack_require__(/*! ./$.defined */ 11);
  7921. module.exports = function(it){
  7922. return Object(defined(it));
  7923. };
  7924.  
  7925. /***/ },
  7926. /* 11 */
  7927. /*!****************************************************************!*\
  7928. !*** ./~/babel-runtime/~/core-js/library/modules/$.defined.js ***!
  7929. \****************************************************************/
  7930. /***/ function(module, exports) {
  7931.  
  7932. // 7.2.1 RequireObjectCoercible(argument)
  7933. module.exports = function(it){
  7934. if(it == undefined)throw TypeError("Can't call method on " + it);
  7935. return it;
  7936. };
  7937.  
  7938. /***/ },
  7939. /* 12 */
  7940. /*!****************************************************************!*\
  7941. !*** ./~/babel-runtime/~/core-js/library/modules/$.iobject.js ***!
  7942. \****************************************************************/
  7943. /***/ function(module, exports, __webpack_require__) {
  7944.  
  7945. // indexed object, fallback for non-array-like ES3 strings
  7946. var cof = __webpack_require__(/*! ./$.cof */ 13);
  7947. module.exports = 0 in Object('z') ? Object : function(it){
  7948. return cof(it) == 'String' ? it.split('') : Object(it);
  7949. };
  7950.  
  7951. /***/ },
  7952. /* 13 */
  7953. /*!************************************************************!*\
  7954. !*** ./~/babel-runtime/~/core-js/library/modules/$.cof.js ***!
  7955. \************************************************************/
  7956. /***/ function(module, exports) {
  7957.  
  7958. var toString = {}.toString;
  7959. module.exports = function(it){
  7960. return toString.call(it).slice(8, -1);
  7961. };
  7962.  
  7963. /***/ },
  7964. /* 14 */
  7965. /*!******************************************************************!*\
  7966. !*** ./~/babel-runtime/~/core-js/library/modules/$.enum-keys.js ***!
  7967. \******************************************************************/
  7968. /***/ function(module, exports, __webpack_require__) {
  7969.  
  7970. // all enumerable object keys, includes symbols
  7971. var $ = __webpack_require__(/*! ./$ */ 15);
  7972. module.exports = function(it){
  7973. var keys = $.getKeys(it)
  7974. , getSymbols = $.getSymbols;
  7975. if(getSymbols){
  7976. var symbols = getSymbols(it)
  7977. , isEnum = $.isEnum
  7978. , i = 0
  7979. , key;
  7980. while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))keys.push(key);
  7981. }
  7982. return keys;
  7983. };
  7984.  
  7985. /***/ },
  7986. /* 15 */
  7987. /*!********************************************************!*\
  7988. !*** ./~/babel-runtime/~/core-js/library/modules/$.js ***!
  7989. \********************************************************/
  7990. /***/ function(module, exports) {
  7991.  
  7992. var $Object = Object;
  7993. module.exports = {
  7994. create: $Object.create,
  7995. getProto: $Object.getPrototypeOf,
  7996. isEnum: {}.propertyIsEnumerable,
  7997. getDesc: $Object.getOwnPropertyDescriptor,
  7998. setDesc: $Object.defineProperty,
  7999. setDescs: $Object.defineProperties,
  8000. getKeys: $Object.keys,
  8001. getNames: $Object.getOwnPropertyNames,
  8002. getSymbols: $Object.getOwnPropertySymbols,
  8003. each: [].forEach
  8004. };
  8005.  
  8006. /***/ },
  8007. /* 16 */
  8008. /*!************************************************************!*\
  8009. !*** ./~/babel-runtime/helpers/interop-require-default.js ***!
  8010. \************************************************************/
  8011. /***/ function(module, exports) {
  8012.  
  8013. "use strict";
  8014. exports["default"] = function (obj) {
  8015. return obj && obj.__esModule ? obj : {
  8016. "default": obj
  8017. };
  8018. };
  8019. exports.__esModule = true;
  8020.  
  8021. /***/ },
  8022. /* 17 */
  8023. /*!********************************************!*\
  8024. !*** ./src/scripts/jquery-extras/index.js ***!
  8025. \********************************************/
  8026. /***/ function(module, exports, __webpack_require__) {
  8027.  
  8028. /* WEBPACK VAR INJECTION */(function(process) {'use strict';
  8029. var _interopRequireDefault = __webpack_require__(/*! babel-runtime/helpers/interop-require-default */ 16)['default'];
  8030. var _jquery = __webpack_require__(/*! jquery */ 2);
  8031. var _jquery2 = _interopRequireDefault(_jquery);
  8032. __webpack_require__(/*! ./plugins */ 19);
  8033. // ----------------------------------------------------------------------------
  8034. _jquery2['default'].extras = {
  8035. _build_environment: process.env.NODE_ENV || 'development'
  8036. };
  8037. /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(/*! (webpack)/~/node-libs-browser/~/process/browser.js */ 18)))
  8038.  
  8039. /***/ },
  8040. /* 18 */
  8041. /*!**********************************************************!*\
  8042. !*** (webpack)/~/node-libs-browser/~/process/browser.js ***!
  8043. \**********************************************************/
  8044. /***/ function(module, exports) {
  8045.  
  8046. // shim for using process in browser
  8047. var process = module.exports = {};
  8048. var queue = [];
  8049. var draining = false;
  8050. var currentQueue;
  8051. var queueIndex = -1;
  8052. function cleanUpNextTick() {
  8053. draining = false;
  8054. if (currentQueue.length) {
  8055. queue = currentQueue.concat(queue);
  8056. } else {
  8057. queueIndex = -1;
  8058. }
  8059. if (queue.length) {
  8060. drainQueue();
  8061. }
  8062. }
  8063. function drainQueue() {
  8064. if (draining) {
  8065. return;
  8066. }
  8067. var timeout = setTimeout(cleanUpNextTick);
  8068. draining = true;
  8069. var len = queue.length;
  8070. while(len) {
  8071. currentQueue = queue;
  8072. queue = [];
  8073. while (++queueIndex < len) {
  8074. currentQueue[queueIndex].run();
  8075. }
  8076. queueIndex = -1;
  8077. len = queue.length;
  8078. }
  8079. currentQueue = null;
  8080. draining = false;
  8081. clearTimeout(timeout);
  8082. }
  8083. process.nextTick = function (fun) {
  8084. var args = new Array(arguments.length - 1);
  8085. if (arguments.length > 1) {
  8086. for (var i = 1; i < arguments.length; i++) {
  8087. args[i - 1] = arguments[i];
  8088. }
  8089. }
  8090. queue.push(new Item(fun, args));
  8091. if (queue.length === 1 && !draining) {
  8092. setTimeout(drainQueue, 0);
  8093. }
  8094. };
  8095. // v8 likes predictible objects
  8096. function Item(fun, array) {
  8097. this.fun = fun;
  8098. this.array = array;
  8099. }
  8100. Item.prototype.run = function () {
  8101. this.fun.apply(null, this.array);
  8102. };
  8103. process.title = 'browser';
  8104. process.browser = true;
  8105. process.env = {};
  8106. process.argv = [];
  8107. process.version = ''; // empty string to avoid regexp issues
  8108. process.versions = {};
  8109. function noop() {}
  8110. process.on = noop;
  8111. process.addListener = noop;
  8112. process.once = noop;
  8113. process.off = noop;
  8114. process.removeListener = noop;
  8115. process.removeAllListeners = noop;
  8116. process.emit = noop;
  8117. process.binding = function (name) {
  8118. throw new Error('process.binding is not supported');
  8119. };
  8120. // TODO(shtylman)
  8121. process.cwd = function () { return '/' };
  8122. process.chdir = function (dir) {
  8123. throw new Error('process.chdir is not supported');
  8124. };
  8125. process.umask = function() { return 0; };
  8126.  
  8127.  
  8128. /***/ },
  8129. /* 19 */
  8130. /*!****************************************************!*\
  8131. !*** ./src/scripts/jquery-extras/plugins/index.js ***!
  8132. \****************************************************/
  8133. /***/ function(module, exports, __webpack_require__) {
  8134.  
  8135. 'use strict';
  8136. __webpack_require__(/*! ./outer-html */ 20);
  8137. __webpack_require__(/*! ./sort */ 21);
  8138.  
  8139. /***/ },
  8140. /* 20 */
  8141. /*!*********************************************************!*\
  8142. !*** ./src/scripts/jquery-extras/plugins/outer-html.js ***!
  8143. \*********************************************************/
  8144. /***/ function(module, exports, __webpack_require__) {
  8145.  
  8146. 'use strict';
  8147. var _interopRequireDefault = __webpack_require__(/*! babel-runtime/helpers/interop-require-default */ 16)['default'];
  8148. var _jquery = __webpack_require__(/*! jquery */ 2);
  8149. var _jquery2 = _interopRequireDefault(_jquery);
  8150. // ----------------------------------------------------------------------------
  8151. _jquery2['default'].fn.extend({
  8152. outer: function outer() {
  8153. if (this.length > 0 && this[0].nodeName) {
  8154. return this[0].outerHTML;
  8155. }
  8156. }
  8157. });
  8158.  
  8159. /***/ },
  8160. /* 21 */
  8161. /*!***************************************************!*\
  8162. !*** ./src/scripts/jquery-extras/plugins/sort.js ***!
  8163. \***************************************************/
  8164. /***/ function(module, exports, __webpack_require__) {
  8165.  
  8166. 'use strict';
  8167. var _interopRequireDefault = __webpack_require__(/*! babel-runtime/helpers/interop-require-default */ 16)['default'];
  8168. var _jquery = __webpack_require__(/*! jquery */ 2);
  8169. var _jquery2 = _interopRequireDefault(_jquery);
  8170. // ----------------------------------------------------------------------------
  8171. _jquery2['default'].fn.extend({
  8172. sort: function sort(key) {
  8173. if (typeof key !== 'function') {
  8174. key = function (el) {
  8175. return el[key];
  8176. };
  8177. }
  8178. return this.each(function () {
  8179. var $container = (0, _jquery2['default'])(this),
  8180. $items = $container.children(),
  8181. items = $items.get();
  8182. items.sort(function (a, b) {
  8183. var av = key(a),
  8184. bv = key(b);
  8185. return typeof av === 'number' ? av - bv : av.localeCompare(bv);
  8186. });
  8187. $container.empty().append(items);
  8188. });
  8189. }
  8190. });
  8191. /*
  8192. 'use strict';
  8193.  
  8194. key = typeof key === 'function' ? key : el => el[key]
  8195.  
  8196. let $elem = $(this),
  8197. items = $elem.children().get()
  8198.  
  8199. items.sort((a, b) => {
  8200. let av = key(a),
  8201. bv = key(b)
  8202. return typeof av === 'number' ? av - bv : av.localeCompare(bv)
  8203. })
  8204.  
  8205. $elem
  8206. .empty()
  8207. .append(items)
  8208.  
  8209. return this
  8210. }
  8211.  
  8212. jQuery.fn.sort = function(key) {
  8213. 'use strict';
  8214.  
  8215. key = typeof key === 'function' ? key : function(el) { return el[key] }
  8216.  
  8217. var $elem = $(this),
  8218. items = $elem.children().get()
  8219.  
  8220. items.sort(function(a, b) {
  8221. var av = key(a),
  8222. bv = key(b)
  8223. return typeof av === 'number' ? av - bv : av.localeCompare(bv)
  8224. })
  8225.  
  8226. $elem
  8227. .empty()
  8228. .append(items)
  8229.  
  8230. return this
  8231. }
  8232. */
  8233.  
  8234. /***/ },
  8235. /* 22 */
  8236. /*!**********************************************!*\
  8237. !*** ./src/scripts/web/selector-observer.js ***!
  8238. \**********************************************/
  8239. /***/ function(module, exports, __webpack_require__) {
  8240.  
  8241. /* jshint asi: true, esnext: true */
  8242. 'use strict';
  8243. var _classCallCheck = __webpack_require__(/*! babel-runtime/helpers/class-call-check */ 23)['default'];
  8244. var _createClass = __webpack_require__(/*! babel-runtime/helpers/create-class */ 24)['default'];
  8245. var _toConsumableArray = __webpack_require__(/*! babel-runtime/helpers/to-consumable-array */ 27)['default'];
  8246. var _Object$assign = __webpack_require__(/*! babel-runtime/core-js/object/assign */ 3)['default'];
  8247. var _Array$from = __webpack_require__(/*! babel-runtime/core-js/array/from */ 28)['default'];
  8248. var _interopRequireDefault = __webpack_require__(/*! babel-runtime/helpers/interop-require-default */ 16)['default'];
  8249. Object.defineProperty(exports, '__esModule', {
  8250. value: true
  8251. });
  8252. var _nodeSet = __webpack_require__(/*! ./node-set */ 59);
  8253. var _nodeSet2 = _interopRequireDefault(_nodeSet);
  8254. var _funcDebounce = __webpack_require__(/*! ../func/debounce */ 89);
  8255. var _funcDebounce2 = _interopRequireDefault(_funcDebounce);
  8256. // ----------------------------------------------------------------------------
  8257. var NodeAddedChange = function NodeAddedChange(node) {
  8258. _classCallCheck(this, NodeAddedChange);
  8259. this.node = node;
  8260. }
  8261. // ----------------------------------------------------------------------------
  8262. ;
  8263. var SelectorObserver = (function () {
  8264. function SelectorObserver(selector, onAdded, onRemoved, onTextChanged, onAttributeChanged) {
  8265. var _this = this;
  8266. _classCallCheck(this, SelectorObserver);
  8267. _Object$assign(this, {
  8268. targets: [document.body],
  8269. selector: '.',
  8270. filterMovedElements: true,
  8271. applyToExisting: true,
  8272. selfOnly: false,
  8273. childrenOnly: false,
  8274. singleCallback: false,
  8275. debug: false
  8276. }, typeof selector === 'object' ? selector : { selector: selector, onAdded: onAdded, onRemoved: onRemoved, onTextChanged: onTextChanged, onAttributeChanged: onAttributeChanged });
  8277. this.targets = this._expandTargets(this.targets);
  8278. if (this.selector === '.') {
  8279. this.selfOnly = true;
  8280. } else if (this.selector.match(/^>\s*/)) {
  8281. this.childrenOnly = true;
  8282. this.selector = this.selector.replace(/^>\s*/, '');
  8283. }
  8284. if (this.debug) {
  8285. console.info(this.toString());
  8286. }
  8287. this.addedNodes = new _nodeSet2['default']();
  8288. this.removedNodes = new _nodeSet2['default']();
  8289. this.textChangedNodes = [];
  8290. this.attrChangedNodes = [];
  8291. this.observer = new MutationObserver(function (mutations) {
  8292. mutations.forEach(function (mutation) {
  8293. if (_this.debug) {
  8294. console.dir(mutation);
  8295. }
  8296. if (mutation.type === 'childList') {
  8297. _Array$from(mutation.addedNodes).forEach(function (node) {
  8298. if (node.nodeType === Document.TEXT_NODE) {
  8299. if (_this._matches(mutation.target)) {
  8300. _this.textChangedNodes.push({
  8301. node: mutation.target,
  8302. oldValue: '',
  8303. value: node.textContent
  8304. });
  8305. } else {
  8306. _this.addedNodes.add(_this._findInclusive(node));
  8307. }
  8308. }
  8309. });
  8310. _Array$from(mutation.removedNodes).forEach(function (node) {
  8311. _this.removedNodes.add(_this._findInclusive(node));
  8312. });
  8313. } else if (_this._matches(mutation.target)) {
  8314. if (mutation.type === 'characterData' && _this.onTextChanged) {
  8315. _this.textChangedNodes.push({
  8316. node: mutation.target,
  8317. oldValue: mutation.oldValue,
  8318. value: mutation.target.textContent
  8319. });
  8320. } else if (mutation.type === 'attributes' && _this.onAttributeChanged) {
  8321. _this.attrChangedNodes.push({
  8322. node: mutation.target,
  8323. attribute: mutation.attributeName,
  8324. namespace: mutation.attributeNamespace,
  8325. oldValue: mutation.oldValue,
  8326. value: mutation.target.getAttribute(mutation.attributeName)
  8327. });
  8328. }
  8329. }
  8330. });
  8331. _this.handle();
  8332. });
  8333. if (this.applyToExisting) {
  8334. var matchingNodes = this._getMatchingNodes();
  8335. if (this.onAdded) {
  8336. this._apply(matchingNodes, this.onAdded);
  8337. }
  8338. if (this.onTextChanged) {
  8339. this._apply(matchingNodes.map(function (node) {
  8340. return {
  8341. node: node,
  8342. oldValue: '',
  8343. value: node.textContent
  8344. };
  8345. }), this.onTextChanged);
  8346. }
  8347. }
  8348. this.observe();
  8349. }
  8350. _createClass(SelectorObserver, [{
  8351. key: 'toString',
  8352. value: function toString() {
  8353. var _this2 = this;
  8354. var al = function al(attrs) {
  8355. return attrs.split(' ').filter(function (a) {
  8356. return !!_this2[a];
  8357. }).join('+');
  8358. };
  8359. return 'SelectorObserver(selector: "' + this.selector + '", targets: ' + [].concat(_toConsumableArray(this.targets)).join(',') + ',\nhandlers: ' + al('onAdded onRemoved onTextChanged onAttributeChanged onMoved') + ',\noptions: ' + al('filterMovedElements applyToExisting selfOnly childrenOnly singleCallback debug') + ')';
  8360. }
  8361. }, {
  8362. key: 'observe',
  8363. value: function observe() {
  8364. var _this3 = this;
  8365. this.targets.forEach(function (target) {
  8366. _this3.observer.observe(target, {
  8367. childList: _this3.onAdded || _this3.onRemoved,
  8368. subtree: true, // this.onAdded || this.onRemoved,
  8369. attributes: _this3.onAttributeChanged,
  8370. attributeOldValue: _this3.onAttributeChanged,
  8371. characterData: _this3.onTextChanged,
  8372. characterDataOldValue: _this3.onTextChanged
  8373. });
  8374. });
  8375. }
  8376. }, {
  8377. key: 'disconnect',
  8378. value: function disconnect() {
  8379. this.observer.disconnect();
  8380. }
  8381. }, {
  8382. key: 'handle',
  8383. value: function handle() {
  8384. var matchedElements = this._getMatchingNodes();
  8385. if (this.debug) {
  8386. console.group('SelectorObserver.handle()');
  8387. console.info('matchedElements:', [].concat(_toConsumableArray(matchedElements)));
  8388. console.info('addedNodes:', [].concat(_toConsumableArray(this.addedNodes)));
  8389. console.info('removedNodes:', [].concat(_toConsumableArray(this.removedNodes)));
  8390. console.info('textChangedNodes:', this.textChangedNodes);
  8391. console.info('attributeChangedNodes:', this.attrChangedNodes);
  8392. console.groupEnd();
  8393. }
  8394. if (this.filterMovedElements) {
  8395. var moved = this.addedNodes.intersection(this.removedNodes);
  8396. if (moved.length) {
  8397. this.addedNodes.remove(moved);
  8398. this.removedNodes.remove(moved);
  8399. this._apply(matchedElements.intersection(moved), this.onMoved);
  8400. }
  8401. }
  8402. this._apply(matchedElements.intersection(this.addedNodes), this.onAdded);
  8403. this._apply(matchedElements.intersection(this.removedNodes), this.onRemoved);
  8404. function intersect(items) {
  8405. return items.filter(function (item) {
  8406. return matchedElements.has(item.node);
  8407. });
  8408. }
  8409. this._apply(intersect(this.textChangedNodes), this.onTextChanged);
  8410. this._apply(intersect(this.attrChangedNodes), this.onAttributeChanged);
  8411. this.addedNodes.take();
  8412. this.removedNodes.take();
  8413. this.textChangedNodes = [];
  8414. this.attrChangedNodes = [];
  8415. }
  8416. }, {
  8417. key: '_findInclusive',
  8418. value: function _findInclusive(node) {
  8419. var res = new _nodeSet2['default']();
  8420. if (node.nodeType === Document.ELEMENT_NODE) {
  8421. if (this._matches(node)) {
  8422. res.add(node);
  8423. }
  8424. res.add(node.querySelectorAll(this.selector));
  8425. }
  8426. return res;
  8427. }
  8428. }, {
  8429. key: '_matches',
  8430. value: function _matches(node) {
  8431. return node.matches(this.selector);
  8432. }
  8433. }, {
  8434. key: '_apply',
  8435. value: function _apply(nodes, func) {
  8436. if (typeof func !== 'function') {
  8437. return;
  8438. }
  8439. if (this.singleCallback) {
  8440. func(nodes);
  8441. } else {
  8442. nodes.forEach(function (node) {
  8443. func.call(typeof node === 'object' ? node.node : node, node);
  8444. });
  8445. }
  8446. }
  8447. }, {
  8448. key: '_expandTargets',
  8449. value: function _expandTargets(targets) {
  8450. var res = new _nodeSet2['default']();
  8451. if (typeof targets === 'string') {
  8452. res.add(document.querySelectorAll(targets));
  8453. } else if (targets instanceof NodeList) {
  8454. res.add(targets);
  8455. } else {
  8456. targets.forEach(function (target) {
  8457. if (typeof target === 'string') {
  8458. res.add(document.querySelectorAll(target));
  8459. } else {
  8460. res.add(target);
  8461. }
  8462. });
  8463. }
  8464. return res;
  8465. }
  8466. }, {
  8467. key: '_getMatchingNodes',
  8468. value: function _getMatchingNodes() {
  8469. var _this4 = this;
  8470. var nodes = new _nodeSet2['default']();
  8471. this.targets.forEach(function (target) {
  8472. if (_this4._matches(target)) {
  8473. nodes.add(target);
  8474. }
  8475. if (!_this4.selfOnly) {
  8476. if (_this4.childrenOnly) {
  8477. nodes.add(_Array$from(target.children).filter(function (n) {
  8478. return n.matches(_this4.selector);
  8479. }));
  8480. } else {
  8481. nodes.add(target.querySelectorAll(_this4.selector));
  8482. }
  8483. }
  8484. });
  8485. return nodes;
  8486. }
  8487. }]);
  8488. return SelectorObserver;
  8489. })();
  8490. exports['default'] = SelectorObserver;
  8491. SelectorObserver.prototype.handle = (0, _funcDebounce2['default'])(SelectorObserver.prototype.handle, 250);
  8492. // ----------------------------------------------------------------------------
  8493. if (typeof HTMLDocument !== 'undefined') {
  8494. HTMLDocument.prototype.observe = function (selector, onAdded, onRemoved) {
  8495. var options = typeof selector === 'object' ? selector : {
  8496. selector: selector,
  8497. onAdded: onAdded,
  8498. onRemoved: onRemoved
  8499. };
  8500. return new SelectorObserver(options);
  8501. };
  8502. }
  8503. if (typeof HTMLElement !== 'undefined') {
  8504. HTMLElement.prototype.observe = function (selector, onAdded, onRemoved) {
  8505. var options = typeof selector === 'object' ? selector : {
  8506. selector: selector,
  8507. onAdded: onAdded,
  8508. onRemoved: onRemoved
  8509. };
  8510. _Object$assign(options, {
  8511. targets: [this]
  8512. });
  8513. return new SelectorObserver(options);
  8514. };
  8515. }
  8516. module.exports = exports['default'];
  8517.  
  8518. /***/ },
  8519. /* 23 */
  8520. /*!*****************************************************!*\
  8521. !*** ./~/babel-runtime/helpers/class-call-check.js ***!
  8522. \*****************************************************/
  8523. /***/ function(module, exports) {
  8524.  
  8525. "use strict";
  8526. exports["default"] = function (instance, Constructor) {
  8527. if (!(instance instanceof Constructor)) {
  8528. throw new TypeError("Cannot call a class as a function");
  8529. }
  8530. };
  8531. exports.__esModule = true;
  8532.  
  8533. /***/ },
  8534. /* 24 */
  8535. /*!*************************************************!*\
  8536. !*** ./~/babel-runtime/helpers/create-class.js ***!
  8537. \*************************************************/
  8538. /***/ function(module, exports, __webpack_require__) {
  8539.  
  8540. "use strict";
  8541. var _Object$defineProperty = __webpack_require__(/*! babel-runtime/core-js/object/define-property */ 25)["default"];
  8542. exports["default"] = (function () {
  8543. function defineProperties(target, props) {
  8544. for (var i = 0; i < props.length; i++) {
  8545. var descriptor = props[i];
  8546. descriptor.enumerable = descriptor.enumerable || false;
  8547. descriptor.configurable = true;
  8548. if ("value" in descriptor) descriptor.writable = true;
  8549. _Object$defineProperty(target, descriptor.key, descriptor);
  8550. }
  8551. }
  8552. return function (Constructor, protoProps, staticProps) {
  8553. if (protoProps) defineProperties(Constructor.prototype, protoProps);
  8554. if (staticProps) defineProperties(Constructor, staticProps);
  8555. return Constructor;
  8556. };
  8557. })();
  8558. exports.__esModule = true;
  8559.  
  8560. /***/ },
  8561. /* 25 */
  8562. /*!***********************************************************!*\
  8563. !*** ./~/babel-runtime/core-js/object/define-property.js ***!
  8564. \***********************************************************/
  8565. /***/ function(module, exports, __webpack_require__) {
  8566.  
  8567. module.exports = { "default": __webpack_require__(/*! core-js/library/fn/object/define-property */ 26), __esModule: true };
  8568.  
  8569. /***/ },
  8570. /* 26 */
  8571. /*!************************************************************************!*\
  8572. !*** ./~/babel-runtime/~/core-js/library/fn/object/define-property.js ***!
  8573. \************************************************************************/
  8574. /***/ function(module, exports, __webpack_require__) {
  8575.  
  8576. var $ = __webpack_require__(/*! ../../modules/$ */ 15);
  8577. module.exports = function defineProperty(it, key, desc){
  8578. return $.setDesc(it, key, desc);
  8579. };
  8580.  
  8581. /***/ },
  8582. /* 27 */
  8583. /*!********************************************************!*\
  8584. !*** ./~/babel-runtime/helpers/to-consumable-array.js ***!
  8585. \********************************************************/
  8586. /***/ function(module, exports, __webpack_require__) {
  8587.  
  8588. "use strict";
  8589. var _Array$from = __webpack_require__(/*! babel-runtime/core-js/array/from */ 28)["default"];
  8590. exports["default"] = function (arr) {
  8591. if (Array.isArray(arr)) {
  8592. for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
  8593. return arr2;
  8594. } else {
  8595. return _Array$from(arr);
  8596. }
  8597. };
  8598. exports.__esModule = true;
  8599.  
  8600. /***/ },
  8601. /* 28 */
  8602. /*!***********************************************!*\
  8603. !*** ./~/babel-runtime/core-js/array/from.js ***!
  8604. \***********************************************/
  8605. /***/ function(module, exports, __webpack_require__) {
  8606.  
  8607. module.exports = { "default": __webpack_require__(/*! core-js/library/fn/array/from */ 29), __esModule: true };
  8608.  
  8609. /***/ },
  8610. /* 29 */
  8611. /*!************************************************************!*\
  8612. !*** ./~/babel-runtime/~/core-js/library/fn/array/from.js ***!
  8613. \************************************************************/
  8614. /***/ function(module, exports, __webpack_require__) {
  8615.  
  8616. __webpack_require__(/*! ../../modules/es6.string.iterator */ 30);
  8617. __webpack_require__(/*! ../../modules/es6.array.from */ 48);
  8618. module.exports = __webpack_require__(/*! ../../modules/$.core */ 8).Array.from;
  8619.  
  8620. /***/ },
  8621. /* 30 */
  8622. /*!**************************************************************************!*\
  8623. !*** ./~/babel-runtime/~/core-js/library/modules/es6.string.iterator.js ***!
  8624. \**************************************************************************/
  8625. /***/ function(module, exports, __webpack_require__) {
  8626.  
  8627. 'use strict';
  8628. var $at = __webpack_require__(/*! ./$.string-at */ 31)(true);
  8629. // 21.1.3.27 String.prototype[@@iterator]()
  8630. __webpack_require__(/*! ./$.iter-define */ 33)(String, 'String', function(iterated){
  8631. this._t = String(iterated); // target
  8632. this._i = 0; // next index
  8633. // 21.1.5.2.1 %StringIteratorPrototype%.next()
  8634. }, function(){
  8635. var O = this._t
  8636. , index = this._i
  8637. , point;
  8638. if(index >= O.length)return {value: undefined, done: true};
  8639. point = $at(O, index);
  8640. this._i += point.length;
  8641. return {value: point, done: false};
  8642. });
  8643.  
  8644. /***/ },
  8645. /* 31 */
  8646. /*!******************************************************************!*\
  8647. !*** ./~/babel-runtime/~/core-js/library/modules/$.string-at.js ***!
  8648. \******************************************************************/
  8649. /***/ function(module, exports, __webpack_require__) {
  8650.  
  8651. // true -> String#at
  8652. // false -> String#codePointAt
  8653. var toInteger = __webpack_require__(/*! ./$.to-integer */ 32)
  8654. , defined = __webpack_require__(/*! ./$.defined */ 11);
  8655. module.exports = function(TO_STRING){
  8656. return function(that, pos){
  8657. var s = String(defined(that))
  8658. , i = toInteger(pos)
  8659. , l = s.length
  8660. , a, b;
  8661. if(i < 0 || i >= l)return TO_STRING ? '' : undefined;
  8662. a = s.charCodeAt(i);
  8663. return a < 0xd800 || a > 0xdbff || i + 1 === l
  8664. || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
  8665. ? TO_STRING ? s.charAt(i) : a
  8666. : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
  8667. };
  8668. };
  8669.  
  8670. /***/ },
  8671. /* 32 */
  8672. /*!*******************************************************************!*\
  8673. !*** ./~/babel-runtime/~/core-js/library/modules/$.to-integer.js ***!
  8674. \*******************************************************************/
  8675. /***/ function(module, exports) {
  8676.  
  8677. // 7.1.4 ToInteger
  8678. var ceil = Math.ceil
  8679. , floor = Math.floor;
  8680. module.exports = function(it){
  8681. return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
  8682. };
  8683.  
  8684. /***/ },
  8685. /* 33 */
  8686. /*!********************************************************************!*\
  8687. !*** ./~/babel-runtime/~/core-js/library/modules/$.iter-define.js ***!
  8688. \********************************************************************/
  8689. /***/ function(module, exports, __webpack_require__) {
  8690.  
  8691. 'use strict';
  8692. var LIBRARY = __webpack_require__(/*! ./$.library */ 34)
  8693. , $def = __webpack_require__(/*! ./$.def */ 6)
  8694. , $redef = __webpack_require__(/*! ./$.redef */ 35)
  8695. , hide = __webpack_require__(/*! ./$.hide */ 36)
  8696. , has = __webpack_require__(/*! ./$.has */ 40)
  8697. , SYMBOL_ITERATOR = __webpack_require__(/*! ./$.wks */ 41)('iterator')
  8698. , Iterators = __webpack_require__(/*! ./$.iterators */ 44)
  8699. , FF_ITERATOR = '@@iterator'
  8700. , KEYS = 'keys'
  8701. , VALUES = 'values';
  8702. var returnThis = function(){ return this; };
  8703. module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCE){
  8704. __webpack_require__(/*! ./$.iter-create */ 45)(Constructor, NAME, next);
  8705. var createMethod = function(kind){
  8706. switch(kind){
  8707. case KEYS: return function keys(){ return new Constructor(this, kind); };
  8708. case VALUES: return function values(){ return new Constructor(this, kind); };
  8709. } return function entries(){ return new Constructor(this, kind); };
  8710. };
  8711. var TAG = NAME + ' Iterator'
  8712. , proto = Base.prototype
  8713. , _native = proto[SYMBOL_ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]
  8714. , _default = _native || createMethod(DEFAULT)
  8715. , methods, key;
  8716. // Fix native
  8717. if(_native){
  8718. var IteratorPrototype = __webpack_require__(/*! ./$ */ 15).getProto(_default.call(new Base));
  8719. // Set @@toStringTag to native iterators
  8720. __webpack_require__(/*! ./$.tag */ 46)(IteratorPrototype, TAG, true);
  8721. // FF fix
  8722. if(!LIBRARY && has(proto, FF_ITERATOR))hide(IteratorPrototype, SYMBOL_ITERATOR, returnThis);
  8723. }
  8724. // Define iterator
  8725. if(!LIBRARY || FORCE)hide(proto, SYMBOL_ITERATOR, _default);
  8726. // Plug for library
  8727. Iterators[NAME] = _default;
  8728. Iterators[TAG] = returnThis;
  8729. if(DEFAULT){
  8730. methods = {
  8731. keys: IS_SET ? _default : createMethod(KEYS),
  8732. values: DEFAULT == VALUES ? _default : createMethod(VALUES),
  8733. entries: DEFAULT != VALUES ? _default : createMethod('entries')
  8734. };
  8735. if(FORCE)for(key in methods){
  8736. if(!(key in proto))$redef(proto, key, methods[key]);
  8737. } else $def($def.P + $def.F * __webpack_require__(/*! ./$.iter-buggy */ 47), NAME, methods);
  8738. }
  8739. };
  8740.  
  8741. /***/ },
  8742. /* 34 */
  8743. /*!****************************************************************!*\
  8744. !*** ./~/babel-runtime/~/core-js/library/modules/$.library.js ***!
  8745. \****************************************************************/
  8746. /***/ function(module, exports) {
  8747.  
  8748. module.exports = true;
  8749.  
  8750. /***/ },
  8751. /* 35 */
  8752. /*!**************************************************************!*\
  8753. !*** ./~/babel-runtime/~/core-js/library/modules/$.redef.js ***!
  8754. \**************************************************************/
  8755. /***/ function(module, exports, __webpack_require__) {
  8756.  
  8757. module.exports = __webpack_require__(/*! ./$.hide */ 36);
  8758.  
  8759. /***/ },
  8760. /* 36 */
  8761. /*!*************************************************************!*\
  8762. !*** ./~/babel-runtime/~/core-js/library/modules/$.hide.js ***!
  8763. \*************************************************************/
  8764. /***/ function(module, exports, __webpack_require__) {
  8765.  
  8766. var $ = __webpack_require__(/*! ./$ */ 15)
  8767. , createDesc = __webpack_require__(/*! ./$.property-desc */ 37);
  8768. module.exports = __webpack_require__(/*! ./$.support-desc */ 38) ? function(object, key, value){
  8769. return $.setDesc(object, key, createDesc(1, value));
  8770. } : function(object, key, value){
  8771. object[key] = value;
  8772. return object;
  8773. };
  8774.  
  8775. /***/ },
  8776. /* 37 */
  8777. /*!**********************************************************************!*\
  8778. !*** ./~/babel-runtime/~/core-js/library/modules/$.property-desc.js ***!
  8779. \**********************************************************************/
  8780. /***/ function(module, exports) {
  8781.  
  8782. module.exports = function(bitmap, value){
  8783. return {
  8784. enumerable : !(bitmap & 1),
  8785. configurable: !(bitmap & 2),
  8786. writable : !(bitmap & 4),
  8787. value : value
  8788. };
  8789. };
  8790.  
  8791. /***/ },
  8792. /* 38 */
  8793. /*!*********************************************************************!*\
  8794. !*** ./~/babel-runtime/~/core-js/library/modules/$.support-desc.js ***!
  8795. \*********************************************************************/
  8796. /***/ function(module, exports, __webpack_require__) {
  8797.  
  8798. // Thank's IE8 for his funny defineProperty
  8799. module.exports = !__webpack_require__(/*! ./$.fails */ 39)(function(){
  8800. return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;
  8801. });
  8802.  
  8803. /***/ },
  8804. /* 39 */
  8805. /*!**************************************************************!*\
  8806. !*** ./~/babel-runtime/~/core-js/library/modules/$.fails.js ***!
  8807. \**************************************************************/
  8808. /***/ function(module, exports) {
  8809.  
  8810. module.exports = function(exec){
  8811. try {
  8812. return !!exec();
  8813. } catch(e){
  8814. return true;
  8815. }
  8816. };
  8817.  
  8818. /***/ },
  8819. /* 40 */
  8820. /*!************************************************************!*\
  8821. !*** ./~/babel-runtime/~/core-js/library/modules/$.has.js ***!
  8822. \************************************************************/
  8823. /***/ function(module, exports) {
  8824.  
  8825. var hasOwnProperty = {}.hasOwnProperty;
  8826. module.exports = function(it, key){
  8827. return hasOwnProperty.call(it, key);
  8828. };
  8829.  
  8830. /***/ },
  8831. /* 41 */
  8832. /*!************************************************************!*\
  8833. !*** ./~/babel-runtime/~/core-js/library/modules/$.wks.js ***!
  8834. \************************************************************/
  8835. /***/ function(module, exports, __webpack_require__) {
  8836.  
  8837. var store = __webpack_require__(/*! ./$.shared */ 42)('wks')
  8838. , Symbol = __webpack_require__(/*! ./$.global */ 7).Symbol;
  8839. module.exports = function(name){
  8840. return store[name] || (store[name] =
  8841. Symbol && Symbol[name] || (Symbol || __webpack_require__(/*! ./$.uid */ 43))('Symbol.' + name));
  8842. };
  8843.  
  8844. /***/ },
  8845. /* 42 */
  8846. /*!***************************************************************!*\
  8847. !*** ./~/babel-runtime/~/core-js/library/modules/$.shared.js ***!
  8848. \***************************************************************/
  8849. /***/ function(module, exports, __webpack_require__) {
  8850.  
  8851. var global = __webpack_require__(/*! ./$.global */ 7)
  8852. , SHARED = '__core-js_shared__'
  8853. , store = global[SHARED] || (global[SHARED] = {});
  8854. module.exports = function(key){
  8855. return store[key] || (store[key] = {});
  8856. };
  8857.  
  8858. /***/ },
  8859. /* 43 */
  8860. /*!************************************************************!*\
  8861. !*** ./~/babel-runtime/~/core-js/library/modules/$.uid.js ***!
  8862. \************************************************************/
  8863. /***/ function(module, exports) {
  8864.  
  8865. var id = 0
  8866. , px = Math.random();
  8867. module.exports = function(key){
  8868. return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
  8869. };
  8870.  
  8871. /***/ },
  8872. /* 44 */
  8873. /*!******************************************************************!*\
  8874. !*** ./~/babel-runtime/~/core-js/library/modules/$.iterators.js ***!
  8875. \******************************************************************/
  8876. /***/ function(module, exports) {
  8877.  
  8878. module.exports = {};
  8879.  
  8880. /***/ },
  8881. /* 45 */
  8882. /*!********************************************************************!*\
  8883. !*** ./~/babel-runtime/~/core-js/library/modules/$.iter-create.js ***!
  8884. \********************************************************************/
  8885. /***/ function(module, exports, __webpack_require__) {
  8886.  
  8887. 'use strict';
  8888. var $ = __webpack_require__(/*! ./$ */ 15)
  8889. , IteratorPrototype = {};
  8890. // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
  8891. __webpack_require__(/*! ./$.hide */ 36)(IteratorPrototype, __webpack_require__(/*! ./$.wks */ 41)('iterator'), function(){ return this; });
  8892. module.exports = function(Constructor, NAME, next){
  8893. Constructor.prototype = $.create(IteratorPrototype, {next: __webpack_require__(/*! ./$.property-desc */ 37)(1,next)});
  8894. __webpack_require__(/*! ./$.tag */ 46)(Constructor, NAME + ' Iterator');
  8895. };
  8896.  
  8897. /***/ },
  8898. /* 46 */
  8899. /*!************************************************************!*\
  8900. !*** ./~/babel-runtime/~/core-js/library/modules/$.tag.js ***!
  8901. \************************************************************/
  8902. /***/ function(module, exports, __webpack_require__) {
  8903.  
  8904. var has = __webpack_require__(/*! ./$.has */ 40)
  8905. , hide = __webpack_require__(/*! ./$.hide */ 36)
  8906. , TAG = __webpack_require__(/*! ./$.wks */ 41)('toStringTag');
  8907. module.exports = function(it, tag, stat){
  8908. if(it && !has(it = stat ? it : it.prototype, TAG))hide(it, TAG, tag);
  8909. };
  8910.  
  8911. /***/ },
  8912. /* 47 */
  8913. /*!*******************************************************************!*\
  8914. !*** ./~/babel-runtime/~/core-js/library/modules/$.iter-buggy.js ***!
  8915. \*******************************************************************/
  8916. /***/ function(module, exports) {
  8917.  
  8918. // Safari has buggy iterators w/o `next`
  8919. module.exports = 'keys' in [] && !('next' in [].keys());
  8920.  
  8921. /***/ },
  8922. /* 48 */
  8923. /*!*********************************************************************!*\
  8924. !*** ./~/babel-runtime/~/core-js/library/modules/es6.array.from.js ***!
  8925. \*********************************************************************/
  8926. /***/ function(module, exports, __webpack_require__) {
  8927.  
  8928. 'use strict';
  8929. var ctx = __webpack_require__(/*! ./$.ctx */ 49)
  8930. , $def = __webpack_require__(/*! ./$.def */ 6)
  8931. , toObject = __webpack_require__(/*! ./$.to-object */ 10)
  8932. , call = __webpack_require__(/*! ./$.iter-call */ 51)
  8933. , isArrayIter = __webpack_require__(/*! ./$.is-array-iter */ 54)
  8934. , toLength = __webpack_require__(/*! ./$.to-length */ 55)
  8935. , getIterFn = __webpack_require__(/*! ./core.get-iterator-method */ 56);
  8936. $def($def.S + $def.F * !__webpack_require__(/*! ./$.iter-detect */ 58)(function(iter){ Array.from(iter); }), 'Array', {
  8937. // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
  8938. from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){
  8939. var O = toObject(arrayLike)
  8940. , C = typeof this == 'function' ? this : Array
  8941. , mapfn = arguments[1]
  8942. , mapping = mapfn !== undefined
  8943. , index = 0
  8944. , iterFn = getIterFn(O)
  8945. , length, result, step, iterator;
  8946. if(mapping)mapfn = ctx(mapfn, arguments[2], 2);
  8947. // if object isn't iterable or it's array with default iterator - use simple case
  8948. if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){
  8949. for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){
  8950. result[index] = mapping ? call(iterator, mapfn, [step.value, index], true) : step.value;
  8951. }
  8952. } else {
  8953. for(result = new C(length = toLength(O.length)); length > index; index++){
  8954. result[index] = mapping ? mapfn(O[index], index) : O[index];
  8955. }
  8956. }
  8957. result.length = index;
  8958. return result;
  8959. }
  8960. });
  8961.  
  8962. /***/ },
  8963. /* 49 */
  8964. /*!************************************************************!*\
  8965. !*** ./~/babel-runtime/~/core-js/library/modules/$.ctx.js ***!
  8966. \************************************************************/
  8967. /***/ function(module, exports, __webpack_require__) {
  8968.  
  8969. // optional / simple context binding
  8970. var aFunction = __webpack_require__(/*! ./$.a-function */ 50);
  8971. module.exports = function(fn, that, length){
  8972. aFunction(fn);
  8973. if(that === undefined)return fn;
  8974. switch(length){
  8975. case 1: return function(a){
  8976. return fn.call(that, a);
  8977. };
  8978. case 2: return function(a, b){
  8979. return fn.call(that, a, b);
  8980. };
  8981. case 3: return function(a, b, c){
  8982. return fn.call(that, a, b, c);
  8983. };
  8984. } return function(/* ...args */){
  8985. return fn.apply(that, arguments);
  8986. };
  8987. };
  8988.  
  8989. /***/ },
  8990. /* 50 */
  8991. /*!*******************************************************************!*\
  8992. !*** ./~/babel-runtime/~/core-js/library/modules/$.a-function.js ***!
  8993. \*******************************************************************/
  8994. /***/ function(module, exports) {
  8995.  
  8996. module.exports = function(it){
  8997. if(typeof it != 'function')throw TypeError(it + ' is not a function!');
  8998. return it;
  8999. };
  9000.  
  9001. /***/ },
  9002. /* 51 */
  9003. /*!******************************************************************!*\
  9004. !*** ./~/babel-runtime/~/core-js/library/modules/$.iter-call.js ***!
  9005. \******************************************************************/
  9006. /***/ function(module, exports, __webpack_require__) {
  9007.  
  9008. // call something on iterator step with safe closing on error
  9009. var anObject = __webpack_require__(/*! ./$.an-object */ 52);
  9010. module.exports = function(iterator, fn, value, entries){
  9011. try {
  9012. return entries ? fn(anObject(value)[0], value[1]) : fn(value);
  9013. // 7.4.6 IteratorClose(iterator, completion)
  9014. } catch(e){
  9015. var ret = iterator['return'];
  9016. if(ret !== undefined)anObject(ret.call(iterator));
  9017. throw e;
  9018. }
  9019. };
  9020.  
  9021. /***/ },
  9022. /* 52 */
  9023. /*!******************************************************************!*\
  9024. !*** ./~/babel-runtime/~/core-js/library/modules/$.an-object.js ***!
  9025. \******************************************************************/
  9026. /***/ function(module, exports, __webpack_require__) {
  9027.  
  9028. var isObject = __webpack_require__(/*! ./$.is-object */ 53);
  9029. module.exports = function(it){
  9030. if(!isObject(it))throw TypeError(it + ' is not an object!');
  9031. return it;
  9032. };
  9033.  
  9034. /***/ },
  9035. /* 53 */
  9036. /*!******************************************************************!*\
  9037. !*** ./~/babel-runtime/~/core-js/library/modules/$.is-object.js ***!
  9038. \******************************************************************/
  9039. /***/ function(module, exports) {
  9040.  
  9041. // http://jsperf.com/core-js-isobject
  9042. module.exports = function(it){
  9043. return it !== null && (typeof it == 'object' || typeof it == 'function');
  9044. };
  9045.  
  9046. /***/ },
  9047. /* 54 */
  9048. /*!**********************************************************************!*\
  9049. !*** ./~/babel-runtime/~/core-js/library/modules/$.is-array-iter.js ***!
  9050. \**********************************************************************/
  9051. /***/ function(module, exports, __webpack_require__) {
  9052.  
  9053. // check on default Array iterator
  9054. var Iterators = __webpack_require__(/*! ./$.iterators */ 44)
  9055. , ITERATOR = __webpack_require__(/*! ./$.wks */ 41)('iterator');
  9056. module.exports = function(it){
  9057. return (Iterators.Array || Array.prototype[ITERATOR]) === it;
  9058. };
  9059.  
  9060. /***/ },
  9061. /* 55 */
  9062. /*!******************************************************************!*\
  9063. !*** ./~/babel-runtime/~/core-js/library/modules/$.to-length.js ***!
  9064. \******************************************************************/
  9065. /***/ function(module, exports, __webpack_require__) {
  9066.  
  9067. // 7.1.15 ToLength
  9068. var toInteger = __webpack_require__(/*! ./$.to-integer */ 32)
  9069. , min = Math.min;
  9070. module.exports = function(it){
  9071. return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
  9072. };
  9073.  
  9074. /***/ },
  9075. /* 56 */
  9076. /*!*******************************************************************************!*\
  9077. !*** ./~/babel-runtime/~/core-js/library/modules/core.get-iterator-method.js ***!
  9078. \*******************************************************************************/
  9079. /***/ function(module, exports, __webpack_require__) {
  9080.  
  9081. var classof = __webpack_require__(/*! ./$.classof */ 57)
  9082. , ITERATOR = __webpack_require__(/*! ./$.wks */ 41)('iterator')
  9083. , Iterators = __webpack_require__(/*! ./$.iterators */ 44);
  9084. module.exports = __webpack_require__(/*! ./$.core */ 8).getIteratorMethod = function(it){
  9085. if(it != undefined)return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)];
  9086. };
  9087.  
  9088. /***/ },
  9089. /* 57 */
  9090. /*!****************************************************************!*\
  9091. !*** ./~/babel-runtime/~/core-js/library/modules/$.classof.js ***!
  9092. \****************************************************************/
  9093. /***/ function(module, exports, __webpack_require__) {
  9094.  
  9095. // getting tag from 19.1.3.6 Object.prototype.toString()
  9096. var cof = __webpack_require__(/*! ./$.cof */ 13)
  9097. , TAG = __webpack_require__(/*! ./$.wks */ 41)('toStringTag')
  9098. // ES3 wrong here
  9099. , ARG = cof(function(){ return arguments; }()) == 'Arguments';
  9100. module.exports = function(it){
  9101. var O, T, B;
  9102. return it === undefined ? 'Undefined' : it === null ? 'Null'
  9103. // @@toStringTag case
  9104. : typeof (T = (O = Object(it))[TAG]) == 'string' ? T
  9105. // builtinTag case
  9106. : ARG ? cof(O)
  9107. // ES3 arguments fallback
  9108. : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
  9109. };
  9110.  
  9111. /***/ },
  9112. /* 58 */
  9113. /*!********************************************************************!*\
  9114. !*** ./~/babel-runtime/~/core-js/library/modules/$.iter-detect.js ***!
  9115. \********************************************************************/
  9116. /***/ function(module, exports, __webpack_require__) {
  9117.  
  9118. var SYMBOL_ITERATOR = __webpack_require__(/*! ./$.wks */ 41)('iterator')
  9119. , SAFE_CLOSING = false;
  9120. try {
  9121. var riter = [7][SYMBOL_ITERATOR]();
  9122. riter['return'] = function(){ SAFE_CLOSING = true; };
  9123. Array.from(riter, function(){ throw 2; });
  9124. } catch(e){ /* empty */ }
  9125. module.exports = function(exec){
  9126. if(!SAFE_CLOSING)return false;
  9127. var safe = false;
  9128. try {
  9129. var arr = [7]
  9130. , iter = arr[SYMBOL_ITERATOR]();
  9131. iter.next = function(){ safe = true; };
  9132. arr[SYMBOL_ITERATOR] = function(){ return iter; };
  9133. exec(arr);
  9134. } catch(e){ /* empty */ }
  9135. return safe;
  9136. };
  9137.  
  9138. /***/ },
  9139. /* 59 */
  9140. /*!*************************************!*\
  9141. !*** ./src/scripts/web/node-set.js ***!
  9142. \*************************************/
  9143. /***/ function(module, exports, __webpack_require__) {
  9144.  
  9145. // ----------------------------------------------------------------------------
  9146. "use strict";
  9147. var _get = __webpack_require__(/*! babel-runtime/helpers/get */ 60)["default"];
  9148. var _inherits = __webpack_require__(/*! babel-runtime/helpers/inherits */ 66)["default"];
  9149. var _createClass = __webpack_require__(/*! babel-runtime/helpers/create-class */ 24)["default"];
  9150. var _classCallCheck = __webpack_require__(/*! babel-runtime/helpers/class-call-check */ 23)["default"];
  9151. var _toConsumableArray = __webpack_require__(/*! babel-runtime/helpers/to-consumable-array */ 27)["default"];
  9152. var _Array$from = __webpack_require__(/*! babel-runtime/core-js/array/from */ 28)["default"];
  9153. var _Set2 = __webpack_require__(/*! babel-runtime/core-js/set */ 73)["default"];
  9154. Object.defineProperty(exports, "__esModule", {
  9155. value: true
  9156. });
  9157. var NodeSet = (function (_Set) {
  9158. _inherits(NodeSet, _Set);
  9159. function NodeSet() {
  9160. _classCallCheck(this, NodeSet);
  9161. _get(Object.getPrototypeOf(NodeSet.prototype), "constructor", this).call(this);
  9162. this.add.apply(this, arguments);
  9163. }
  9164. _createClass(NodeSet, [{
  9165. key: "add",
  9166. value: function add() {
  9167. var _this = this;
  9168. for (var _len = arguments.length, items = Array(_len), _key = 0; _key < _len; _key++) {
  9169. items[_key] = arguments[_key];
  9170. }
  9171. items.forEach(function (item) {
  9172. if (Array.isArray(item)) {
  9173. _this.add.apply(_this, _toConsumableArray(item));
  9174. } else if (item instanceof NodeSet) {
  9175. _this.add.apply(_this, _toConsumableArray(item));
  9176. } else if (item instanceof NodeList) {
  9177. _this.add.apply(_this, _toConsumableArray(_Array$from(item)));
  9178. } else {
  9179. _get(Object.getPrototypeOf(NodeSet.prototype), "add", _this).call(_this, item);
  9180. }
  9181. });
  9182. return this;
  9183. }
  9184. }, {
  9185. key: "remove",
  9186. value: function remove() {
  9187. var _this2 = this;
  9188. for (var _len2 = arguments.length, items = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
  9189. items[_key2] = arguments[_key2];
  9190. }
  9191. items.forEach(function (item) {
  9192. if (Array.isArray(item)) {
  9193. _this2.remove.apply(_this2, _toConsumableArray(item));
  9194. } else if (item instanceof NodeSet) {
  9195. _this2.remove.apply(_this2, _toConsumableArray(item));
  9196. } else if (item instanceof NodeList) {
  9197. _this2.remove.apply(_this2, _toConsumableArray(_Array$from(item)));
  9198. } else {
  9199. _get(Object.getPrototypeOf(NodeSet.prototype), "delete", _this2).call(_this2, item);
  9200. }
  9201. });
  9202. return this;
  9203. }
  9204. }, {
  9205. key: "intersection",
  9206. value: function intersection(other) {
  9207. var set = Array.isArray(other) ? new NodeSet([].concat(_toConsumableArray(other))) : other;
  9208. return new NodeSet([].concat(_toConsumableArray(this)).filter(function (v) {
  9209. return set.has(v);
  9210. }));
  9211. }
  9212. }, {
  9213. key: "forEach",
  9214. value: function forEach(func) {
  9215. [].concat(_toConsumableArray(this)).forEach(func);
  9216. return this;
  9217. }
  9218. }, {
  9219. key: "map",
  9220. value: function map(func) {
  9221. return [].concat(_toConsumableArray(this)).map(func);
  9222. }
  9223. }, {
  9224. key: "take",
  9225. value: function take() {
  9226. var items = [].concat(_toConsumableArray(this));
  9227. _get(Object.getPrototypeOf(NodeSet.prototype), "clear", this).call(this);
  9228. return items;
  9229. }
  9230. }, {
  9231. key: "length",
  9232. get: function get() {
  9233. return _get(Object.getPrototypeOf(NodeSet.prototype), "size", this);
  9234. }
  9235. }]);
  9236. return NodeSet;
  9237. })(_Set2);
  9238. exports["default"] = NodeSet;
  9239. module.exports = exports["default"];
  9240.  
  9241. /***/ },
  9242. /* 60 */
  9243. /*!****************************************!*\
  9244. !*** ./~/babel-runtime/helpers/get.js ***!
  9245. \****************************************/
  9246. /***/ function(module, exports, __webpack_require__) {
  9247.  
  9248. "use strict";
  9249. var _Object$getOwnPropertyDescriptor = __webpack_require__(/*! babel-runtime/core-js/object/get-own-property-descriptor */ 61)["default"];
  9250. exports["default"] = function get(_x, _x2, _x3) {
  9251. var _again = true;
  9252. _function: while (_again) {
  9253. var object = _x,
  9254. property = _x2,
  9255. receiver = _x3;
  9256. desc = parent = getter = undefined;
  9257. _again = false;
  9258. if (object === null) object = Function.prototype;
  9259. var desc = _Object$getOwnPropertyDescriptor(object, property);
  9260. if (desc === undefined) {
  9261. var parent = Object.getPrototypeOf(object);
  9262. if (parent === null) {
  9263. return undefined;
  9264. } else {
  9265. _x = parent;
  9266. _x2 = property;
  9267. _x3 = receiver;
  9268. _again = true;
  9269. continue _function;
  9270. }
  9271. } else if ("value" in desc) {
  9272. return desc.value;
  9273. } else {
  9274. var getter = desc.get;
  9275. if (getter === undefined) {
  9276. return undefined;
  9277. }
  9278. return getter.call(receiver);
  9279. }
  9280. }
  9281. };
  9282. exports.__esModule = true;
  9283.  
  9284. /***/ },
  9285. /* 61 */
  9286. /*!***********************************************************************!*\
  9287. !*** ./~/babel-runtime/core-js/object/get-own-property-descriptor.js ***!
  9288. \***********************************************************************/
  9289. /***/ function(module, exports, __webpack_require__) {
  9290.  
  9291. module.exports = { "default": __webpack_require__(/*! core-js/library/fn/object/get-own-property-descriptor */ 62), __esModule: true };
  9292.  
  9293. /***/ },
  9294. /* 62 */
  9295. /*!************************************************************************************!*\
  9296. !*** ./~/babel-runtime/~/core-js/library/fn/object/get-own-property-descriptor.js ***!
  9297. \************************************************************************************/
  9298. /***/ function(module, exports, __webpack_require__) {
  9299.  
  9300. var $ = __webpack_require__(/*! ../../modules/$ */ 15);
  9301. __webpack_require__(/*! ../../modules/es6.object.get-own-property-descriptor */ 63);
  9302. module.exports = function getOwnPropertyDescriptor(it, key){
  9303. return $.getDesc(it, key);
  9304. };
  9305.  
  9306. /***/ },
  9307. /* 63 */
  9308. /*!*********************************************************************************************!*\
  9309. !*** ./~/babel-runtime/~/core-js/library/modules/es6.object.get-own-property-descriptor.js ***!
  9310. \*********************************************************************************************/
  9311. /***/ function(module, exports, __webpack_require__) {
  9312.  
  9313. // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
  9314. var toIObject = __webpack_require__(/*! ./$.to-iobject */ 64);
  9315. __webpack_require__(/*! ./$.object-sap */ 65)('getOwnPropertyDescriptor', function($getOwnPropertyDescriptor){
  9316. return function getOwnPropertyDescriptor(it, key){
  9317. return $getOwnPropertyDescriptor(toIObject(it), key);
  9318. };
  9319. });
  9320.  
  9321. /***/ },
  9322. /* 64 */
  9323. /*!*******************************************************************!*\
  9324. !*** ./~/babel-runtime/~/core-js/library/modules/$.to-iobject.js ***!
  9325. \*******************************************************************/
  9326. /***/ function(module, exports, __webpack_require__) {
  9327.  
  9328. // to indexed object, toObject with fallback for non-array-like ES3 strings
  9329. var IObject = __webpack_require__(/*! ./$.iobject */ 12)
  9330. , defined = __webpack_require__(/*! ./$.defined */ 11);
  9331. module.exports = function(it){
  9332. return IObject(defined(it));
  9333. };
  9334.  
  9335. /***/ },
  9336. /* 65 */
  9337. /*!*******************************************************************!*\
  9338. !*** ./~/babel-runtime/~/core-js/library/modules/$.object-sap.js ***!
  9339. \*******************************************************************/
  9340. /***/ function(module, exports, __webpack_require__) {
  9341.  
  9342. // most Object methods by ES6 should accept primitives
  9343. module.exports = function(KEY, exec){
  9344. var $def = __webpack_require__(/*! ./$.def */ 6)
  9345. , fn = (__webpack_require__(/*! ./$.core */ 8).Object || {})[KEY] || Object[KEY]
  9346. , exp = {};
  9347. exp[KEY] = exec(fn);
  9348. $def($def.S + $def.F * __webpack_require__(/*! ./$.fails */ 39)(function(){ fn(1); }), 'Object', exp);
  9349. };
  9350.  
  9351. /***/ },
  9352. /* 66 */
  9353. /*!*********************************************!*\
  9354. !*** ./~/babel-runtime/helpers/inherits.js ***!
  9355. \*********************************************/
  9356. /***/ function(module, exports, __webpack_require__) {
  9357.  
  9358. "use strict";
  9359. var _Object$create = __webpack_require__(/*! babel-runtime/core-js/object/create */ 67)["default"];
  9360. var _Object$setPrototypeOf = __webpack_require__(/*! babel-runtime/core-js/object/set-prototype-of */ 69)["default"];
  9361. exports["default"] = function (subClass, superClass) {
  9362. if (typeof superClass !== "function" && superClass !== null) {
  9363. throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
  9364. }
  9365. subClass.prototype = _Object$create(superClass && superClass.prototype, {
  9366. constructor: {
  9367. value: subClass,
  9368. enumerable: false,
  9369. writable: true,
  9370. configurable: true
  9371. }
  9372. });
  9373. if (superClass) _Object$setPrototypeOf ? _Object$setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
  9374. };
  9375. exports.__esModule = true;
  9376.  
  9377. /***/ },
  9378. /* 67 */
  9379. /*!**************************************************!*\
  9380. !*** ./~/babel-runtime/core-js/object/create.js ***!
  9381. \**************************************************/
  9382. /***/ function(module, exports, __webpack_require__) {
  9383.  
  9384. module.exports = { "default": __webpack_require__(/*! core-js/library/fn/object/create */ 68), __esModule: true };
  9385.  
  9386. /***/ },
  9387. /* 68 */
  9388. /*!***************************************************************!*\
  9389. !*** ./~/babel-runtime/~/core-js/library/fn/object/create.js ***!
  9390. \***************************************************************/
  9391. /***/ function(module, exports, __webpack_require__) {
  9392.  
  9393. var $ = __webpack_require__(/*! ../../modules/$ */ 15);
  9394. module.exports = function create(P, D){
  9395. return $.create(P, D);
  9396. };
  9397.  
  9398. /***/ },
  9399. /* 69 */
  9400. /*!************************************************************!*\
  9401. !*** ./~/babel-runtime/core-js/object/set-prototype-of.js ***!
  9402. \************************************************************/
  9403. /***/ function(module, exports, __webpack_require__) {
  9404.  
  9405. module.exports = { "default": __webpack_require__(/*! core-js/library/fn/object/set-prototype-of */ 70), __esModule: true };
  9406.  
  9407. /***/ },
  9408. /* 70 */
  9409. /*!*************************************************************************!*\
  9410. !*** ./~/babel-runtime/~/core-js/library/fn/object/set-prototype-of.js ***!
  9411. \*************************************************************************/
  9412. /***/ function(module, exports, __webpack_require__) {
  9413.  
  9414. __webpack_require__(/*! ../../modules/es6.object.set-prototype-of */ 71);
  9415. module.exports = __webpack_require__(/*! ../../modules/$.core */ 8).Object.setPrototypeOf;
  9416.  
  9417. /***/ },
  9418. /* 71 */
  9419. /*!**********************************************************************************!*\
  9420. !*** ./~/babel-runtime/~/core-js/library/modules/es6.object.set-prototype-of.js ***!
  9421. \**********************************************************************************/
  9422. /***/ function(module, exports, __webpack_require__) {
  9423.  
  9424. // 19.1.3.19 Object.setPrototypeOf(O, proto)
  9425. var $def = __webpack_require__(/*! ./$.def */ 6);
  9426. $def($def.S, 'Object', {setPrototypeOf: __webpack_require__(/*! ./$.set-proto */ 72).set});
  9427.  
  9428. /***/ },
  9429. /* 72 */
  9430. /*!******************************************************************!*\
  9431. !*** ./~/babel-runtime/~/core-js/library/modules/$.set-proto.js ***!
  9432. \******************************************************************/
  9433. /***/ function(module, exports, __webpack_require__) {
  9434.  
  9435. // Works with __proto__ only. Old v8 can't work with null proto objects.
  9436. /* eslint-disable no-proto */
  9437. var getDesc = __webpack_require__(/*! ./$ */ 15).getDesc
  9438. , isObject = __webpack_require__(/*! ./$.is-object */ 53)
  9439. , anObject = __webpack_require__(/*! ./$.an-object */ 52);
  9440. var check = function(O, proto){
  9441. anObject(O);
  9442. if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!");
  9443. };
  9444. module.exports = {
  9445. set: Object.setPrototypeOf || ('__proto__' in {} // eslint-disable-line
  9446. ? function(buggy, set){
  9447. try {
  9448. set = __webpack_require__(/*! ./$.ctx */ 49)(Function.call, getDesc(Object.prototype, '__proto__').set, 2);
  9449. set({}, []);
  9450. } catch(e){ buggy = true; }
  9451. return function setPrototypeOf(O, proto){
  9452. check(O, proto);
  9453. if(buggy)O.__proto__ = proto;
  9454. else set(O, proto);
  9455. return O;
  9456. };
  9457. }()
  9458. : undefined),
  9459. check: check
  9460. };
  9461.  
  9462. /***/ },
  9463. /* 73 */
  9464. /*!****************************************!*\
  9465. !*** ./~/babel-runtime/core-js/set.js ***!
  9466. \****************************************/
  9467. /***/ function(module, exports, __webpack_require__) {
  9468.  
  9469. module.exports = { "default": __webpack_require__(/*! core-js/library/fn/set */ 74), __esModule: true };
  9470.  
  9471. /***/ },
  9472. /* 74 */
  9473. /*!*****************************************************!*\
  9474. !*** ./~/babel-runtime/~/core-js/library/fn/set.js ***!
  9475. \*****************************************************/
  9476. /***/ function(module, exports, __webpack_require__) {
  9477.  
  9478. __webpack_require__(/*! ../modules/es6.object.to-string */ 75);
  9479. __webpack_require__(/*! ../modules/es6.string.iterator */ 30);
  9480. __webpack_require__(/*! ../modules/web.dom.iterable */ 76);
  9481. __webpack_require__(/*! ../modules/es6.set */ 80);
  9482. __webpack_require__(/*! ../modules/es7.set.to-json */ 87);
  9483. module.exports = __webpack_require__(/*! ../modules/$.core */ 8).Set;
  9484.  
  9485. /***/ },
  9486. /* 75 */
  9487. /*!***************************************************************************!*\
  9488. !*** ./~/babel-runtime/~/core-js/library/modules/es6.object.to-string.js ***!
  9489. \***************************************************************************/
  9490. /***/ function(module, exports) {
  9491.  
  9492.  
  9493.  
  9494. /***/ },
  9495. /* 76 */
  9496. /*!***********************************************************************!*\
  9497. !*** ./~/babel-runtime/~/core-js/library/modules/web.dom.iterable.js ***!
  9498. \***********************************************************************/
  9499. /***/ function(module, exports, __webpack_require__) {
  9500.  
  9501. __webpack_require__(/*! ./es6.array.iterator */ 77);
  9502. var Iterators = __webpack_require__(/*! ./$.iterators */ 44);
  9503. Iterators.NodeList = Iterators.HTMLCollection = Iterators.Array;
  9504.  
  9505. /***/ },
  9506. /* 77 */
  9507. /*!*************************************************************************!*\
  9508. !*** ./~/babel-runtime/~/core-js/library/modules/es6.array.iterator.js ***!
  9509. \*************************************************************************/
  9510. /***/ function(module, exports, __webpack_require__) {
  9511.  
  9512. 'use strict';
  9513. var setUnscope = __webpack_require__(/*! ./$.unscope */ 78)
  9514. , step = __webpack_require__(/*! ./$.iter-step */ 79)
  9515. , Iterators = __webpack_require__(/*! ./$.iterators */ 44)
  9516. , toIObject = __webpack_require__(/*! ./$.to-iobject */ 64);
  9517. // 22.1.3.4 Array.prototype.entries()
  9518. // 22.1.3.13 Array.prototype.keys()
  9519. // 22.1.3.29 Array.prototype.values()
  9520. // 22.1.3.30 Array.prototype[@@iterator]()
  9521. __webpack_require__(/*! ./$.iter-define */ 33)(Array, 'Array', function(iterated, kind){
  9522. this._t = toIObject(iterated); // target
  9523. this._i = 0; // next index
  9524. this._k = kind; // kind
  9525. // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
  9526. }, function(){
  9527. var O = this._t
  9528. , kind = this._k
  9529. , index = this._i++;
  9530. if(!O || index >= O.length){
  9531. this._t = undefined;
  9532. return step(1);
  9533. }
  9534. if(kind == 'keys' )return step(0, index);
  9535. if(kind == 'values')return step(0, O[index]);
  9536. return step(0, [index, O[index]]);
  9537. }, 'values');
  9538. // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
  9539. Iterators.Arguments = Iterators.Array;
  9540. setUnscope('keys');
  9541. setUnscope('values');
  9542. setUnscope('entries');
  9543.  
  9544. /***/ },
  9545. /* 78 */
  9546. /*!****************************************************************!*\
  9547. !*** ./~/babel-runtime/~/core-js/library/modules/$.unscope.js ***!
  9548. \****************************************************************/
  9549. /***/ function(module, exports) {
  9550.  
  9551. module.exports = function(){ /* empty */ };
  9552.  
  9553. /***/ },
  9554. /* 79 */
  9555. /*!******************************************************************!*\
  9556. !*** ./~/babel-runtime/~/core-js/library/modules/$.iter-step.js ***!
  9557. \******************************************************************/
  9558. /***/ function(module, exports) {
  9559.  
  9560. module.exports = function(done, value){
  9561. return {value: value, done: !!done};
  9562. };
  9563.  
  9564. /***/ },
  9565. /* 80 */
  9566. /*!**************************************************************!*\
  9567. !*** ./~/babel-runtime/~/core-js/library/modules/es6.set.js ***!
  9568. \**************************************************************/
  9569. /***/ function(module, exports, __webpack_require__) {
  9570.  
  9571. 'use strict';
  9572. var strong = __webpack_require__(/*! ./$.collection-strong */ 81);
  9573. // 23.2 Set Objects
  9574. __webpack_require__(/*! ./$.collection */ 86)('Set', function(get){
  9575. return function Set(){ return get(this, arguments[0]); };
  9576. }, {
  9577. // 23.2.3.1 Set.prototype.add(value)
  9578. add: function add(value){
  9579. return strong.def(this, value = value === 0 ? 0 : value, value);
  9580. }
  9581. }, strong);
  9582.  
  9583. /***/ },
  9584. /* 81 */
  9585. /*!**************************************************************************!*\
  9586. !*** ./~/babel-runtime/~/core-js/library/modules/$.collection-strong.js ***!
  9587. \**************************************************************************/
  9588. /***/ function(module, exports, __webpack_require__) {
  9589.  
  9590. 'use strict';
  9591. var $ = __webpack_require__(/*! ./$ */ 15)
  9592. , hide = __webpack_require__(/*! ./$.hide */ 36)
  9593. , ctx = __webpack_require__(/*! ./$.ctx */ 49)
  9594. , species = __webpack_require__(/*! ./$.species */ 82)
  9595. , strictNew = __webpack_require__(/*! ./$.strict-new */ 83)
  9596. , defined = __webpack_require__(/*! ./$.defined */ 11)
  9597. , forOf = __webpack_require__(/*! ./$.for-of */ 84)
  9598. , step = __webpack_require__(/*! ./$.iter-step */ 79)
  9599. , ID = __webpack_require__(/*! ./$.uid */ 43)('id')
  9600. , $has = __webpack_require__(/*! ./$.has */ 40)
  9601. , isObject = __webpack_require__(/*! ./$.is-object */ 53)
  9602. , isExtensible = Object.isExtensible || isObject
  9603. , SUPPORT_DESC = __webpack_require__(/*! ./$.support-desc */ 38)
  9604. , SIZE = SUPPORT_DESC ? '_s' : 'size'
  9605. , id = 0;
  9606. var fastKey = function(it, create){
  9607. // return primitive with prefix
  9608. if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
  9609. if(!$has(it, ID)){
  9610. // can't set id to frozen object
  9611. if(!isExtensible(it))return 'F';
  9612. // not necessary to add id
  9613. if(!create)return 'E';
  9614. // add missing object id
  9615. hide(it, ID, ++id);
  9616. // return object id with prefix
  9617. } return 'O' + it[ID];
  9618. };
  9619. var getEntry = function(that, key){
  9620. // fast case
  9621. var index = fastKey(key), entry;
  9622. if(index !== 'F')return that._i[index];
  9623. // frozen object case
  9624. for(entry = that._f; entry; entry = entry.n){
  9625. if(entry.k == key)return entry;
  9626. }
  9627. };
  9628. module.exports = {
  9629. getConstructor: function(wrapper, NAME, IS_MAP, ADDER){
  9630. var C = wrapper(function(that, iterable){
  9631. strictNew(that, C, NAME);
  9632. that._i = $.create(null); // index
  9633. that._f = undefined; // first entry
  9634. that._l = undefined; // last entry
  9635. that[SIZE] = 0; // size
  9636. if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that);
  9637. });
  9638. __webpack_require__(/*! ./$.mix */ 85)(C.prototype, {
  9639. // 23.1.3.1 Map.prototype.clear()
  9640. // 23.2.3.2 Set.prototype.clear()
  9641. clear: function clear(){
  9642. for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){
  9643. entry.r = true;
  9644. if(entry.p)entry.p = entry.p.n = undefined;
  9645. delete data[entry.i];
  9646. }
  9647. that._f = that._l = undefined;
  9648. that[SIZE] = 0;
  9649. },
  9650. // 23.1.3.3 Map.prototype.delete(key)
  9651. // 23.2.3.4 Set.prototype.delete(value)
  9652. 'delete': function(key){
  9653. var that = this
  9654. , entry = getEntry(that, key);
  9655. if(entry){
  9656. var next = entry.n
  9657. , prev = entry.p;
  9658. delete that._i[entry.i];
  9659. entry.r = true;
  9660. if(prev)prev.n = next;
  9661. if(next)next.p = prev;
  9662. if(that._f == entry)that._f = next;
  9663. if(that._l == entry)that._l = prev;
  9664. that[SIZE]--;
  9665. } return !!entry;
  9666. },
  9667. // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
  9668. // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
  9669. forEach: function forEach(callbackfn /*, that = undefined */){
  9670. var f = ctx(callbackfn, arguments[1], 3)
  9671. , entry;
  9672. while(entry = entry ? entry.n : this._f){
  9673. f(entry.v, entry.k, this);
  9674. // revert to the last existing entry
  9675. while(entry && entry.r)entry = entry.p;
  9676. }
  9677. },
  9678. // 23.1.3.7 Map.prototype.has(key)
  9679. // 23.2.3.7 Set.prototype.has(value)
  9680. has: function has(key){
  9681. return !!getEntry(this, key);
  9682. }
  9683. });
  9684. if(SUPPORT_DESC)$.setDesc(C.prototype, 'size', {
  9685. get: function(){
  9686. return defined(this[SIZE]);
  9687. }
  9688. });
  9689. return C;
  9690. },
  9691. def: function(that, key, value){
  9692. var entry = getEntry(that, key)
  9693. , prev, index;
  9694. // change existing entry
  9695. if(entry){
  9696. entry.v = value;
  9697. // create new entry
  9698. } else {
  9699. that._l = entry = {
  9700. i: index = fastKey(key, true), // <- index
  9701. k: key, // <- key
  9702. v: value, // <- value
  9703. p: prev = that._l, // <- previous entry
  9704. n: undefined, // <- next entry
  9705. r: false // <- removed
  9706. };
  9707. if(!that._f)that._f = entry;
  9708. if(prev)prev.n = entry;
  9709. that[SIZE]++;
  9710. // add to index
  9711. if(index !== 'F')that._i[index] = entry;
  9712. } return that;
  9713. },
  9714. getEntry: getEntry,
  9715. setStrong: function(C, NAME, IS_MAP){
  9716. // add .keys, .values, .entries, [@@iterator]
  9717. // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
  9718. __webpack_require__(/*! ./$.iter-define */ 33)(C, NAME, function(iterated, kind){
  9719. this._t = iterated; // target
  9720. this._k = kind; // kind
  9721. this._l = undefined; // previous
  9722. }, function(){
  9723. var that = this
  9724. , kind = that._k
  9725. , entry = that._l;
  9726. // revert to the last existing entry
  9727. while(entry && entry.r)entry = entry.p;
  9728. // get next entry
  9729. if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){
  9730. // or finish the iteration
  9731. that._t = undefined;
  9732. return step(1);
  9733. }
  9734. // return step by kind
  9735. if(kind == 'keys' )return step(0, entry.k);
  9736. if(kind == 'values')return step(0, entry.v);
  9737. return step(0, [entry.k, entry.v]);
  9738. }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true);
  9739. // add [@@species], 23.1.2.2, 23.2.2.2
  9740. species(C);
  9741. species(__webpack_require__(/*! ./$.core */ 8)[NAME]); // for wrapper
  9742. }
  9743. };
  9744.  
  9745. /***/ },
  9746. /* 82 */
  9747. /*!****************************************************************!*\
  9748. !*** ./~/babel-runtime/~/core-js/library/modules/$.species.js ***!
  9749. \****************************************************************/
  9750. /***/ function(module, exports, __webpack_require__) {
  9751.  
  9752. 'use strict';
  9753. var $ = __webpack_require__(/*! ./$ */ 15)
  9754. , SPECIES = __webpack_require__(/*! ./$.wks */ 41)('species');
  9755. module.exports = function(C){
  9756. if(__webpack_require__(/*! ./$.support-desc */ 38) && !(SPECIES in C))$.setDesc(C, SPECIES, {
  9757. configurable: true,
  9758. get: function(){ return this; }
  9759. });
  9760. };
  9761.  
  9762. /***/ },
  9763. /* 83 */
  9764. /*!*******************************************************************!*\
  9765. !*** ./~/babel-runtime/~/core-js/library/modules/$.strict-new.js ***!
  9766. \*******************************************************************/
  9767. /***/ function(module, exports) {
  9768.  
  9769. module.exports = function(it, Constructor, name){
  9770. if(!(it instanceof Constructor))throw TypeError(name + ": use the 'new' operator!");
  9771. return it;
  9772. };
  9773.  
  9774. /***/ },
  9775. /* 84 */
  9776. /*!***************************************************************!*\
  9777. !*** ./~/babel-runtime/~/core-js/library/modules/$.for-of.js ***!
  9778. \***************************************************************/
  9779. /***/ function(module, exports, __webpack_require__) {
  9780.  
  9781. var ctx = __webpack_require__(/*! ./$.ctx */ 49)
  9782. , call = __webpack_require__(/*! ./$.iter-call */ 51)
  9783. , isArrayIter = __webpack_require__(/*! ./$.is-array-iter */ 54)
  9784. , anObject = __webpack_require__(/*! ./$.an-object */ 52)
  9785. , toLength = __webpack_require__(/*! ./$.to-length */ 55)
  9786. , getIterFn = __webpack_require__(/*! ./core.get-iterator-method */ 56);
  9787. module.exports = function(iterable, entries, fn, that){
  9788. var iterFn = getIterFn(iterable)
  9789. , f = ctx(fn, that, entries ? 2 : 1)
  9790. , index = 0
  9791. , length, step, iterator;
  9792. if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!');
  9793. // fast case for arrays with default iterator
  9794. if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){
  9795. entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
  9796. } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){
  9797. call(iterator, f, step.value, entries);
  9798. }
  9799. };
  9800.  
  9801. /***/ },
  9802. /* 85 */
  9803. /*!************************************************************!*\
  9804. !*** ./~/babel-runtime/~/core-js/library/modules/$.mix.js ***!
  9805. \************************************************************/
  9806. /***/ function(module, exports, __webpack_require__) {
  9807.  
  9808. var $redef = __webpack_require__(/*! ./$.redef */ 35);
  9809. module.exports = function(target, src){
  9810. for(var key in src)$redef(target, key, src[key]);
  9811. return target;
  9812. };
  9813.  
  9814. /***/ },
  9815. /* 86 */
  9816. /*!*******************************************************************!*\
  9817. !*** ./~/babel-runtime/~/core-js/library/modules/$.collection.js ***!
  9818. \*******************************************************************/
  9819. /***/ function(module, exports, __webpack_require__) {
  9820.  
  9821. 'use strict';
  9822. var $ = __webpack_require__(/*! ./$ */ 15)
  9823. , $def = __webpack_require__(/*! ./$.def */ 6)
  9824. , hide = __webpack_require__(/*! ./$.hide */ 36)
  9825. , BUGGY = __webpack_require__(/*! ./$.iter-buggy */ 47)
  9826. , forOf = __webpack_require__(/*! ./$.for-of */ 84)
  9827. , strictNew = __webpack_require__(/*! ./$.strict-new */ 83);
  9828. module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){
  9829. var Base = __webpack_require__(/*! ./$.global */ 7)[NAME]
  9830. , C = Base
  9831. , ADDER = IS_MAP ? 'set' : 'add'
  9832. , proto = C && C.prototype
  9833. , O = {};
  9834. if(!__webpack_require__(/*! ./$.support-desc */ 38) || typeof C != 'function'
  9835. || !(IS_WEAK || !BUGGY && proto.forEach && proto.entries)){
  9836. // create collection constructor
  9837. C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
  9838. __webpack_require__(/*! ./$.mix */ 85)(C.prototype, methods);
  9839. } else {
  9840. C = wrapper(function(target, iterable){
  9841. strictNew(target, C, NAME);
  9842. target._c = new Base;
  9843. if(iterable != undefined)forOf(iterable, IS_MAP, target[ADDER], target);
  9844. });
  9845. $.each.call('add,clear,delete,forEach,get,has,set,keys,values,entries'.split(','),function(KEY){
  9846. var chain = KEY == 'add' || KEY == 'set';
  9847. if(KEY in proto && !(IS_WEAK && KEY == 'clear'))hide(C.prototype, KEY, function(a, b){
  9848. var result = this._c[KEY](a === 0 ? 0 : a, b);
  9849. return chain ? this : result;
  9850. });
  9851. });
  9852. if('size' in proto)$.setDesc(C.prototype, 'size', {
  9853. get: function(){
  9854. return this._c.size;
  9855. }
  9856. });
  9857. }
  9858. __webpack_require__(/*! ./$.tag */ 46)(C, NAME);
  9859. O[NAME] = C;
  9860. $def($def.G + $def.W + $def.F, O);
  9861. if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP);
  9862. return C;
  9863. };
  9864.  
  9865. /***/ },
  9866. /* 87 */
  9867. /*!**********************************************************************!*\
  9868. !*** ./~/babel-runtime/~/core-js/library/modules/es7.set.to-json.js ***!
  9869. \**********************************************************************/
  9870. /***/ function(module, exports, __webpack_require__) {
  9871.  
  9872. // https://github.com/DavidBruant/Map-Set.prototype.toJSON
  9873. var $def = __webpack_require__(/*! ./$.def */ 6);
  9874. $def($def.P, 'Set', {toJSON: __webpack_require__(/*! ./$.collection-to-json */ 88)('Set')});
  9875.  
  9876. /***/ },
  9877. /* 88 */
  9878. /*!***************************************************************************!*\
  9879. !*** ./~/babel-runtime/~/core-js/library/modules/$.collection-to-json.js ***!
  9880. \***************************************************************************/
  9881. /***/ function(module, exports, __webpack_require__) {
  9882.  
  9883. // https://github.com/DavidBruant/Map-Set.prototype.toJSON
  9884. var forOf = __webpack_require__(/*! ./$.for-of */ 84)
  9885. , classof = __webpack_require__(/*! ./$.classof */ 57);
  9886. module.exports = function(NAME){
  9887. return function toJSON(){
  9888. if(classof(this) != NAME)throw TypeError(NAME + "#toJSON isn't generic");
  9889. var arr = [];
  9890. forOf(this, false, arr.push, arr);
  9891. return arr;
  9892. };
  9893. };
  9894.  
  9895. /***/ },
  9896. /* 89 */
  9897. /*!**************************************!*\
  9898. !*** ./src/scripts/func/debounce.js ***!
  9899. \**************************************/
  9900. /***/ function(module, exports) {
  9901.  
  9902. // ----------------------------------------------------------------------------
  9903. /**
  9904. * Wait until threshold ms has elapsed between function calls to
  9905. * call the function i.e. delay until after calls have stopped.
  9906. *
  9907. * If immediate, instead call the function on the first call, then
  9908. * ignore further calls until delay ms after further calls have
  9909. * stopped.
  9910. */
  9911. 'use strict';
  9912. Object.defineProperty(exports, '__esModule', {
  9913. value: true
  9914. });
  9915. exports['default'] = debounce;
  9916. function debounce(func, threshold, immediate) {
  9917. threshold = typeof threshold === 'number' ? threshold : 100;
  9918. var timeout = null;
  9919. return function debounced() {
  9920. for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
  9921. args[_key] = arguments[_key];
  9922. }
  9923. var fn = func.bind(this);
  9924. function afterthreshold() {
  9925. if (!immediate) {
  9926. fn.apply(undefined, args);
  9927. }
  9928. timeout = null;
  9929. }
  9930. var callNow = immediate && !timeout;
  9931. clearTimeout(timeout);
  9932. timeout = setTimeout(afterthreshold, threshold);
  9933. if (callNow) {
  9934. fn.apply(undefined, args);
  9935. }
  9936. };
  9937. }
  9938. module.exports = exports['default'];
  9939.  
  9940. /***/ }
  9941. /******/ ])
  9942. });
  9943. ;
  9944. //# sourceMappingURL=jquery-extras.js.map