1/*! 2 * jQuery JavaScript Library v2.2.2 3 * http://jquery.com/ 4 * 5 * Includes Sizzle.js 6 * http://sizzlejs.com/ 7 * 8 * Copyright jQuery Foundation and other contributors 9 * Released under the MIT license 10 * http://jquery.org/license 11 * 12 * Date: 2016-03-17T17:51Z 13 */ 14 15(function( global, factory ) { 16 17 if ( typeof module === "object" && typeof module.exports === "object" ) { 18 // For CommonJS and CommonJS-like environments where a proper `window` 19 // is present, execute the factory and get jQuery. 20 // For environments that do not have a `window` with a `document` 21 // (such as Node.js), expose a factory as module.exports. 22 // This accentuates the need for the creation of a real `window`. 23 // e.g. var jQuery = require("jquery")(window); 24 // See ticket #14549 for more info. 25 module.exports = global.document ? 26 factory( global, true ) : 27 function( w ) { 28 if ( !w.document ) { 29 throw new Error( "jQuery requires a window with a document" ); 30 } 31 return factory( w ); 32 }; 33 } else { 34 factory( global ); 35 } 36 37// Pass this if window is not defined yet 38}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { 39 40// Support: Firefox 18+ 41// Can't be in strict mode, several libs including ASP.NET trace 42// the stack via arguments.caller.callee and Firefox dies if 43// you try to trace through "use strict" call chains. (#13335) 44//"use strict"; 45var arr = []; 46 47var document = window.document; 48 49var slice = arr.slice; 50 51var concat = arr.concat; 52 53var push = arr.push; 54 55var indexOf = arr.indexOf; 56 57var class2type = {}; 58 59var toString = class2type.toString; 60 61var hasOwn = class2type.hasOwnProperty; 62 63var support = {}; 64 65 66 67var 68 version = "2.2.2
vendor: 132,342 bytes, lines 68-5008
68", 69 70 // Define a local copy of jQuery 71 jQuery = function( selector, context ) { 72 73 // The jQuery object is actually just the init constructor 'enhanced' 74 // Need init if jQuery is called (just allow error to be thrown if not included) 75 return new jQuery.fn.init( selector, context ); 76 }, 77 78 // Support: Android<4.1 79 // Make sure we trim BOM and NBSP 80 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, 81 82 // Matches dashed string for camelizing 83 rmsPrefix = /^-ms-/, 84 rdashAlpha = /-([\da-z])/gi, 85 86 // Used by jQuery.camelCase as callback to replace() 87 fcamelCase = function( all, letter ) { 88 return letter.toUpperCase(); 89 }; 90 91jQuery.fn = jQuery.prototype = { 92 93 // The current version of jQuery being used 94 jquery: version, 95 96 constructor: jQuery, 97 98 // Start with an empty selector 99 selector: "", 100 101 // The default length of a jQuery object is 0 102 length: 0, 103 104 toArray: function() { 105 return slice.call( this ); 106 }, 107 108 // Get the Nth element in the matched element set OR 109 // Get the whole matched element set as a clean array 110 get: function( num ) { 111 return num != null ? 112 113 // Return just the one element from the set 114 ( num < 0 ? this[ num + this.length ] : this[ num ] ) : 115 116 // Return all the elements in a clean array 117 slice.call( this ); 118 }, 119 120 // Take an array of elements and push it onto the stack 121 // (returning the new matched element set) 122 pushStack: function( elems ) { 123 124 // Build a new jQuery matched element set 125 var ret = jQuery.merge( this.constructor(), elems ); 126 127 // Add the old object onto the stack (as a reference) 128 ret.prevObject = this; 129 ret.context = this.context; 130 131 // Return the newly-formed element set 132 return ret; 133 }, 134 135 // Execute a callback for every element in the matched set. 136 each: function( callback ) { 137 return jQuery.each( this, callback ); 138 }, 139 140 map: function( callback ) { 141 return this.pushStack( jQuery.map( this, function( elem, i ) { 142 return callback.call( elem, i, elem ); 143 } ) ); 144 }, 145 146 slice: function() { 147 return this.pushStack( slice.apply( this, arguments ) ); 148 }, 149 150 first: function() { 151 return this.eq( 0 ); 152 }, 153 154 last: function() { 155 return this.eq( -1 ); 156 }, 157 158 eq: function( i ) { 159 var len = this.length, 160 j = +i + ( i < 0 ? len : 0 ); 161 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); 162 }, 163 164 end: function() { 165 return this.prevObject || this.constructor(); 166 }, 167 168 // For internal use only. 169 // Behaves like an Array's method, not like a jQuery method. 170 push: push, 171 sort: arr.sort, 172 splice: arr.splice 173}; 174 175jQuery.extend = jQuery.fn.extend = function() { 176 var options, name, src, copy, copyIsArray, clone, 177 target = arguments[ 0 ] || {}, 178 i = 1, 179 length = arguments.length, 180 deep = false; 181 182 // Handle a deep copy situation 183 if ( typeof target === "boolean" ) { 184 deep = target; 185 186 // Skip the boolean and the target 187 target = arguments[ i ] || {}; 188 i++; 189 } 190 191 // Handle case when target is a string or something (possible in deep copy) 192 if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { 193 target = {}; 194 } 195 196 // Extend jQuery itself if only one argument is passed 197 if ( i === length ) { 198 target = this; 199 i--; 200 } 201 202 for ( ; i < length; i++ ) { 203 204 // Only deal with non-null/undefined values 205 if ( ( options = arguments[ i ] ) != null ) { 206 207 // Extend the base object 208 for ( name in options ) { 209 src = target[ name ]; 210 copy = options[ name ]; 211 212 // Prevent never-ending loop 213 if ( target === copy ) { 214 continue; 215 } 216 217 // Recurse if we're merging plain objects or arrays 218 if ( deep && copy && ( jQuery.isPlainObject( copy ) || 219 ( copyIsArray = jQuery.isArray( copy ) ) ) ) { 220 221 if ( copyIsArray ) { 222 copyIsArray = false; 223 clone = src && jQuery.isArray( src ) ? src : []; 224 225 } else { 226 clone = src && jQuery.isPlainObject( src ) ? src : {}; 227 } 228 229 // Never move original objects, clone them 230 target[ name ] = jQuery.extend( deep, clone, copy ); 231 232 // Don't bring in undefined values 233 } else if ( copy !== undefined ) { 234 target[ name ] = copy; 235 } 236 } 237 } 238 } 239 240 // Return the modified object 241 return target; 242}; 243 244jQuery.extend( { 245 246 // Unique for each copy of jQuery on the page 247 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), 248 249 // Assume jQuery is ready without the ready module 250 isReady: true, 251 252 error: function( msg ) { 253 throw new Error( msg ); 254 }, 255 256 noop: function() {}, 257 258 isFunction: function( obj ) { 259 return jQuery.type( obj ) === "function"; 260 }, 261 262 isArray: Array.isArray, 263 264 isWindow: function( obj ) { 265 return obj != null && obj === obj.window; 266 }, 267 268 isNumeric: function( obj ) { 269 270 // parseFloat NaNs numeric-cast false positives (null|true|false|"") 271 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 272 // subtraction forces infinities to NaN 273 // adding 1 corrects loss of precision from parseFloat (#15100) 274 var realStringObj = obj && obj.toString(); 275 return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0; 276 }, 277 278 isPlainObject: function( obj ) { 279 var key; 280 281 // Not plain objects: 282 // - Any object or value whose internal [[Class]] property is not "[object Object]" 283 // - DOM nodes 284 // - window 285 if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { 286 return false; 287 } 288 289 // Not own constructor property must be Object 290 if ( obj.constructor && 291 !hasOwn.call( obj, "constructor" ) && 292 !hasOwn.call( obj.constructor.prototype || {}, "isPrototypeOf" ) ) { 293 return false; 294 } 295 296 // Own properties are enumerated firstly, so to speed up, 297 // if last one is own, then all properties are own 298 for ( key in obj ) {} 299 300 return key === undefined || hasOwn.call( obj, key ); 301 }, 302 303 isEmptyObject: function( obj ) { 304 var name; 305 for ( name in obj ) { 306 return false; 307 } 308 return true; 309 }, 310 311 type: function( obj ) { 312 if ( obj == null ) { 313 return obj + ""; 314 } 315 316 // Support: Android<4.0, iOS<6 (functionish RegExp) 317 return typeof obj === "object" || typeof obj === "function" ? 318 class2type[ toString.call( obj ) ] || "object" : 319 typeof obj; 320 }, 321 322 // Evaluates a script in a global context 323 globalEval: function( code ) { 324 var script, 325 indirect = eval; 326 327 code = jQuery.trim( code ); 328 329 if ( code ) { 330 331 // If the code includes a valid, prologue position 332 // strict mode pragma, execute code by injecting a 333 // script tag into the document. 334 if ( code.indexOf( "use strict" ) === 1 ) { 335 script = document.createElement( "script" ); 336 script.text = code; 337 document.head.appendChild( script ).parentNode.removeChild( script ); 338 } else { 339 340 // Otherwise, avoid the DOM node creation, insertion 341 // and removal by using an indirect global eval 342 343 indirect( code ); 344 } 345 } 346 }, 347 348 // Convert dashed to camelCase; used by the css and data modules 349 // Support: IE9-11+ 350 // Microsoft forgot to hump their vendor prefix (#9572) 351 camelCase: function( string ) { 352 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 353 }, 354 355 nodeName: function( elem, name ) { 356 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 357 }, 358 359 each: function( obj, callback ) { 360 var length, i = 0; 361 362 if ( isArrayLike( obj ) ) { 363 length = obj.length; 364 for ( ; i < length; i++ ) { 365 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 366 break; 367 } 368 } 369 } else { 370 for ( i in obj ) { 371 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 372 break; 373 } 374 } 375 } 376 377 return obj; 378 }, 379 380 // Support: Android<4.1 381 trim: function( text ) { 382 return text == null ? 383 "" : 384 ( text + "" ).replace( rtrim, "" ); 385 }, 386 387 // results is for internal usage only 388 makeArray: function( arr, results ) { 389 var ret = results || []; 390 391 if ( arr != null ) { 392 if ( isArrayLike( Object( arr ) ) ) { 393 jQuery.merge( ret, 394 typeof arr === "string" ? 395 [ arr ] : arr 396 ); 397 } else { 398 push.call( ret, arr ); 399 } 400 } 401 402 return ret; 403 }, 404 405 inArray: function( elem, arr, i ) { 406 return arr == null ? -1 : indexOf.call( arr, elem, i ); 407 }, 408 409 merge: function( first, second ) { 410 var len = +second.length, 411 j = 0, 412 i = first.length; 413 414 for ( ; j < len; j++ ) { 415 first[ i++ ] = second[ j ]; 416 } 417 418 first.length = i; 419 420 return first; 421 }, 422 423 grep: function( elems, callback, invert ) { 424 var callbackInverse, 425 matches = [], 426 i = 0, 427 length = elems.length, 428 callbackExpect = !invert; 429 430 // Go through the array, only saving the items 431 // that pass the validator function 432 for ( ; i < length; i++ ) { 433 callbackInverse = !callback( elems[ i ], i ); 434 if ( callbackInverse !== callbackExpect ) { 435 matches.push( elems[ i ] ); 436 } 437 } 438 439 return matches; 440 }, 441 442 // arg is for internal usage only 443 map: function( elems, callback, arg ) { 444 var length, value, 445 i = 0, 446 ret = []; 447 448 // Go through the array, translating each of the items to their new values 449 if ( isArrayLike( elems ) ) { 450 length = elems.length; 451 for ( ; i < length; i++ ) { 452 value = callback( elems[ i ], i, arg ); 453 454 if ( value != null ) { 455 ret.push( value ); 456 } 457 } 458 459 // Go through every key on the object, 460 } else { 461 for ( i in elems ) { 462 value = callback( elems[ i ], i, arg ); 463 464 if ( value != null ) { 465 ret.push( value ); 466 } 467 } 468 } 469 470 // Flatten any nested arrays 471 return concat.apply( [], ret ); 472 }, 473 474 // A global GUID counter for objects 475 guid: 1, 476 477 // Bind a function to a context, optionally partially applying any 478 // arguments. 479 proxy: function( fn, context ) { 480 var tmp, args, proxy; 481 482 if ( typeof context === "string" ) { 483 tmp = fn[ context ]; 484 context = fn; 485 fn = tmp; 486 } 487 488 // Quick check to determine if target is callable, in the spec 489 // this throws a TypeError, but we will just return undefined. 490 if ( !jQuery.isFunction( fn ) ) { 491 return undefined; 492 } 493 494 // Simulated bind 495 args = slice.call( arguments, 2 ); 496 proxy = function() { 497 return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); 498 }; 499 500 // Set the guid of unique handler to the same of original handler, so it can be removed 501 proxy.guid = fn.guid = fn.guid || jQuery.guid++; 502 503 return proxy; 504 }, 505 506 now: Date.now, 507 508 // jQuery.support is not used in Core but other projects attach their 509 // properties to it so it needs to exist. 510 support: support 511} ); 512 513// JSHint would error on this code due to the Symbol not being defined in ES5. 514// Defining this global in .jshintrc would create a danger of using the global 515// unguarded in another place, it seems safer to just disable JSHint for these 516// three lines. 517/* jshint ignore: start */ 518if ( typeof Symbol === "function" ) { 519 jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; 520} 521/* jshint ignore: end */ 522 523// Populate the class2type map 524jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), 525function( i, name ) { 526 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 527} ); 528 529function isArrayLike( obj ) { 530 531 // Support: iOS 8.2 (not reproducible in simulator) 532 // `in` check used to prevent JIT error (gh-2145) 533 // hasOwn isn't used here due to false negatives 534 // regarding Nodelist length in IE 535 var length = !!obj && "length" in obj && obj.length, 536 type = jQuery.type( obj ); 537 538 if ( type === "function" || jQuery.isWindow( obj ) ) { 539 return false; 540 } 541 542 return type === "array" || length === 0 || 543 typeof length === "number" && length > 0 && ( length - 1 ) in obj; 544} 545var Sizzle = 546/*! 547 * Sizzle CSS Selector Engine v2.2.1 548 * http://sizzlejs.com/ 549 * 550 * Copyright jQuery Foundation and other contributors 551 * Released under the MIT license 552 * http://jquery.org/license 553 * 554 * Date: 2015-10-17 555 */ 556(function( window ) { 557 558var i, 559 support, 560 Expr, 561 getText, 562 isXML, 563 tokenize, 564 compile, 565 select, 566 outermostContext, 567 sortInput, 568 hasDuplicate, 569 570 // Local document vars 571 setDocument, 572 document, 573 docElem, 574 documentIsHTML, 575 rbuggyQSA, 576 rbuggyMatches, 577 matches, 578 contains, 579 580 // Instance-specific data 581 expando = "sizzle" + 1 * new Date(), 582 preferredDoc = window.document, 583 dirruns = 0, 584 done = 0, 585 classCache = createCache(), 586 tokenCache = createCache(), 587 compilerCache = createCache(), 588 sortOrder = function( a, b ) { 589 if ( a === b ) { 590 hasDuplicate = true; 591 } 592 return 0; 593 }, 594 595 // General-purpose constants 596 MAX_NEGATIVE = 1 << 31, 597 598 // Instance methods 599 hasOwn = ({}).hasOwnProperty, 600 arr = [], 601 pop = arr.pop, 602 push_native = arr.push, 603 push = arr.push, 604 slice = arr.slice, 605 // Use a stripped-down indexOf as it's faster than native 606 // http://jsperf.com/thor-indexof-vs-for/5 607 indexOf = function( list, elem ) { 608 var i = 0, 609 len = list.length; 610 for ( ; i < len; i++ ) { 611 if ( list[i] === elem ) { 612 return i; 613 } 614 } 615 return -1; 616 }, 617 618 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", 619 620 // Regular expressions 621 622 // http://www.w3.org/TR/css3-selectors/#whitespace 623 whitespace = "[\\x20\\t\\r\\n\\f]", 624 625 // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier 626 identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", 627 628 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors 629 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + 630 // Operator (capture 2) 631 "*([*^$|!~]?=)" + whitespace + 632 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" 633 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + 634 "*\\]", 635 636 pseudos = ":(" + identifier + ")(?:\\((" + 637 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: 638 // 1. quoted (capture 3; capture 4 or capture 5) 639 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + 640 // 2. simple (capture 6) 641 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + 642 // 3. anything else (capture 2) 643 ".*" + 644 ")\\)|)", 645 646 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 647 rwhitespace = new RegExp( whitespace + "+", "g" ), 648 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), 649 650 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), 651 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), 652 653 rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), 654 655 rpseudo = new RegExp( pseudos ), 656 ridentifier = new RegExp( "^" + identifier + "$" ), 657 658 matchExpr = { 659 "ID": new RegExp( "^#(" + identifier + ")" ), 660 "CLASS": new RegExp( "^\\.(" + identifier + ")" ), 661 "TAG": new RegExp( "^(" + identifier + "|[*])" ), 662 "ATTR": new RegExp( "^" + attributes ), 663 "PSEUDO": new RegExp( "^" + pseudos ), 664 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + 665 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + 666 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), 667 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), 668 // For use in libraries implementing .is() 669 // We use this for POS matching in `select` 670 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + 671 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) 672 }, 673 674 rinputs = /^(?:input|select|textarea|button)$/i, 675 rheader = /^h\d$/i, 676 677 rnative = /^[^{]+\{\s*\[native \w/, 678 679 // Easily-parseable/retrievable ID or TAG or CLASS selectors 680 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 681 682 rsibling = /[+~]/, 683 rescape = /'|\\/g, 684 685 // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters 686 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), 687 funescape = function( _, escaped, escapedWhitespace ) { 688 var high = "0x" + escaped - 0x10000; 689 // NaN means non-codepoint 690 // Support: Firefox<24 691 // Workaround erroneous numeric interpretation of +"0x" 692 return high !== high || escapedWhitespace ? 693 escaped : 694 high < 0 ? 695 // BMP codepoint 696 String.fromCharCode( high + 0x10000 ) : 697 // Supplemental Plane codepoint (surrogate pair) 698 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 699 }, 700 701 // Used for iframes 702 // See setDocument() 703 // Removing the function wrapper causes a "Permission Denied" 704 // error in IE 705 unloadHandler = function() { 706 setDocument(); 707 }; 708 709// Optimize for push.apply( _, NodeList ) 710try { 711 push.apply( 712 (arr = slice.call( preferredDoc.childNodes )), 713 preferredDoc.childNodes 714 ); 715 // Support: Android<4.0 716 // Detect silently failing push.apply 717 arr[ preferredDoc.childNodes.length ].nodeType; 718} catch ( e ) { 719 push = { apply: arr.length ? 720 721 // Leverage slice if possible 722 function( target, els ) { 723 push_native.apply( target, slice.call(els) ); 724 } : 725 726 // Support: IE<9 727 // Otherwise append directly 728 function( target, els ) { 729 var j = target.length, 730 i = 0; 731 // Can't trust NodeList.length 732 while ( (target[j++] = els[i++]) ) {} 733 target.length = j - 1; 734 } 735 }; 736} 737 738function Sizzle( selector, context, results, seed ) { 739 var m, i, elem, nid, nidselect, match, groups, newSelector, 740 newContext = context && context.ownerDocument, 741 742 // nodeType defaults to 9, since context defaults to document 743 nodeType = context ? context.nodeType : 9; 744 745 results = results || []; 746 747 // Return early from calls with invalid selector or context 748 if ( typeof selector !== "string" || !selector || 749 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { 750 751 return results; 752 } 753 754 // Try to shortcut find operations (as opposed to filters) in HTML documents 755 if ( !seed ) { 756 757 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { 758 setDocument( context ); 759 } 760 context = context || document; 761 762 if ( documentIsHTML ) { 763 764 // If the selector is sufficiently simple, try using a "get*By*" DOM method 765 // (excepting DocumentFragment context, where the methods don't exist) 766 if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { 767 768 // ID selector 769 if ( (m = match[1]) ) { 770 771 // Document context 772 if ( nodeType === 9 ) { 773 if ( (elem = context.getElementById( m )) ) { 774 775 // Support: IE, Opera, Webkit 776 // TODO: identify versions 777 // getElementById can match elements by name instead of ID 778 if ( elem.id === m ) { 779 results.push( elem ); 780 return results; 781 } 782 } else { 783 return results; 784 } 785 786 // Element context 787 } else { 788 789 // Support: IE, Opera, Webkit 790 // TODO: identify versions 791 // getElementById can match elements by name instead of ID 792 if ( newContext && (elem = newContext.getElementById( m )) && 793 contains( context, elem ) && 794 elem.id === m ) { 795 796 results.push( elem ); 797 return results; 798 } 799 } 800 801 // Type selector 802 } else if ( match[2] ) { 803 push.apply( results, context.getElementsByTagName( selector ) ); 804 return results; 805 806 // Class selector 807 } else if ( (m = match[3]) && support.getElementsByClassName && 808 context.getElementsByClassName ) { 809 810 push.apply( results, context.getElementsByClassName( m ) ); 811 return results; 812 } 813 } 814 815 // Take advantage of querySelectorAll 816 if ( support.qsa && 817 !compilerCache[ selector + " " ] && 818 (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { 819 820 if ( nodeType !== 1 ) { 821 newContext = context; 822 newSelector = selector; 823 824 // qSA looks outside Element context, which is not what we want 825 // Thanks to Andrew Dupont for this workaround technique 826 // Support: IE <=8 827 // Exclude object elements 828 } else if ( context.nodeName.toLowerCase() !== "object" ) { 829 830 // Capture the context ID, setting it first if necessary 831 if ( (nid = context.getAttribute( "id" )) ) { 832 nid = nid.replace( rescape, "\\$&" ); 833 } else { 834 context.setAttribute( "id", (nid = expando) ); 835 } 836 837 // Prefix every selector in the list 838 groups = tokenize( selector ); 839 i = groups.length; 840 nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']"; 841 while ( i-- ) { 842 groups[i] = nidselect + " " + toSelector( groups[i] ); 843 } 844 newSelector = groups.join( "," ); 845 846 // Expand context for sibling selectors 847 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || 848 context; 849 } 850 851 if ( newSelector ) { 852 try { 853 push.apply( results, 854 newContext.querySelectorAll( newSelector ) 855 ); 856 return results; 857 } catch ( qsaError ) { 858 } finally { 859 if ( nid === expando ) { 860 context.removeAttribute( "id" ); 861 } 862 } 863 } 864 } 865 } 866 } 867 868 // All others 869 return select( selector.replace( rtrim, "$1" ), context, results, seed ); 870} 871 872/** 873 * Create key-value caches of limited size 874 * @returns {function(string, object)} Returns the Object data after storing it on itself with 875 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 876 * deleting the oldest entry 877 */ 878function createCache() { 879 var keys = []; 880 881 function cache( key, value ) { 882 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) 883 if ( keys.push( key + " " ) > Expr.cacheLength ) { 884 // Only keep the most recent entries 885 delete cache[ keys.shift() ]; 886 } 887 return (cache[ key + " " ] = value); 888 } 889 return cache; 890} 891 892/** 893 * Mark a function for special use by Sizzle 894 * @param {Function} fn The function to mark 895 */ 896function markFunction( fn ) { 897 fn[ expando ] = true; 898 return fn; 899} 900 901/** 902 * Support testing using an element 903 * @param {Function} fn Passed the created div and expects a boolean result 904 */ 905function assert( fn ) { 906 var div = document.createElement("div"); 907 908 try { 909 return !!fn( div ); 910 } catch (e) { 911 return false; 912 } finally { 913 // Remove from its parent by default 914 if ( div.parentNode ) { 915 div.parentNode.removeChild( div ); 916 } 917 // release memory in IE 918 div = null; 919 } 920} 921 922/** 923 * Adds the same handler for all of the specified attrs 924 * @param {String} attrs Pipe-separated list of attributes 925 * @param {Function} handler The method that will be applied 926 */ 927function addHandle( attrs, handler ) { 928 var arr = attrs.split("|"), 929 i = arr.length; 930 931 while ( i-- ) { 932 Expr.attrHandle[ arr[i] ] = handler; 933 } 934} 935 936/** 937 * Checks document order of two siblings 938 * @param {Element} a 939 * @param {Element} b 940 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b 941 */ 942function siblingCheck( a, b ) { 943 var cur = b && a, 944 diff = cur && a.nodeType === 1 && b.nodeType === 1 && 945 ( ~b.sourceIndex || MAX_NEGATIVE ) - 946 ( ~a.sourceIndex || MAX_NEGATIVE ); 947 948 // Use IE sourceIndex if available on both nodes 949 if ( diff ) { 950 return diff; 951 } 952 953 // Check if b follows a 954 if ( cur ) { 955 while ( (cur = cur.nextSibling) ) { 956 if ( cur === b ) { 957 return -1; 958 } 959 } 960 } 961 962 return a ? 1 : -1; 963} 964 965/** 966 * Returns a function to use in pseudos for input types 967 * @param {String} type 968 */ 969function createInputPseudo( type ) { 970 return function( elem ) { 971 var name = elem.nodeName.toLowerCase(); 972 return name === "input" && elem.type === type; 973 }; 974} 975 976/** 977 * Returns a function to use in pseudos for buttons 978 * @param {String} type 979 */ 980function createButtonPseudo( type ) { 981 return function( elem ) { 982 var name = elem.nodeName.toLowerCase(); 983 return (name === "input" || name === "button") && elem.type === type; 984 }; 985} 986 987/** 988 * Returns a function to use in pseudos for positionals 989 * @param {Function} fn 990 */ 991function createPositionalPseudo( fn ) { 992 return markFunction(function( argument ) { 993 argument = +argument; 994 return markFunction(function( seed, matches ) { 995 var j, 996 matchIndexes = fn( [], seed.length, argument ), 997 i = matchIndexes.length; 998 999 // Match elements found at the specified indexes 1000 while ( i-- ) { 1001 if ( seed[ (j = matchIndexes[i]) ] ) { 1002 seed[j] = !(matches[j] = seed[j]); 1003 } 1004 } 1005 }); 1006 }); 1007} 1008 1009/** 1010 * Checks a node for validity as a Sizzle context 1011 * @param {Element|Object=} context 1012 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value 1013 */ 1014function testContext( context ) { 1015 return context && typeof context.getElementsByTagName !== "undefined" && context; 1016} 1017 1018// Expose support vars for convenience 1019support = Sizzle.support = {}; 1020 1021/** 1022 * Detects XML nodes 1023 * @param {Element|Object} elem An element or a document 1024 * @returns {Boolean} True iff elem is a non-HTML XML node 1025 */ 1026isXML = Sizzle.isXML = function( elem ) { 1027 // documentElement is verified for cases where it doesn't yet exist 1028 // (such as loading iframes in IE - #4833) 1029 var documentElement = elem && (elem.ownerDocument || elem).documentElement; 1030 return documentElement ? documentElement.nodeName !== "HTML" : false; 1031}; 1032 1033/** 1034 * Sets document-related variables once based on the current document 1035 * @param {Element|Object} [doc] An element or document object to use to set the document 1036 * @returns {Object} Returns the current document 1037 */ 1038setDocument = Sizzle.setDocument = function( node ) { 1039 var hasCompare, parent, 1040 doc = node ? node.ownerDocument || node : preferredDoc; 1041 1042 // Return early if doc is invalid or already selected 1043 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { 1044 return document; 1045 } 1046 1047 // Update global variables 1048 document = doc; 1049 docElem = document.documentElement; 1050 documentIsHTML = !isXML( document ); 1051 1052 // Support: IE 9-11, Edge 1053 // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) 1054 if ( (parent = document.defaultView) && parent.top !== parent ) { 1055 // Support: IE 11 1056 if ( parent.addEventListener ) { 1057 parent.addEventListener( "unload", unloadHandler, false ); 1058 1059 // Support: IE 9 - 10 only 1060 } else if ( parent.attachEvent ) { 1061 parent.attachEvent( "onunload", unloadHandler ); 1062 } 1063 } 1064 1065 /* Attributes 1066 ---------------------------------------------------------------------- */ 1067 1068 // Support: IE<8 1069 // Verify that getAttribute really returns attributes and not properties 1070 // (excepting IE8 booleans) 1071 support.attributes = assert(function( div ) { 1072 div.className = "i"; 1073 return !div.getAttribute("className"); 1074 }); 1075 1076 /* getElement(s)By* 1077 ---------------------------------------------------------------------- */ 1078 1079 // Check if getElementsByTagName("*") returns only elements 1080 support.getElementsByTagName = assert(function( div ) { 1081 div.appendChild( document.createComment("") ); 1082 return !div.getElementsByTagName("*").length; 1083 }); 1084 1085 // Support: IE<9 1086 support.getElementsByClassName = rnative.test( document.getElementsByClassName ); 1087 1088 // Support: IE<10 1089 // Check if getElementById returns elements by name 1090 // The broken getElementById methods don't pick up programatically-set names, 1091 // so use a roundabout getElementsByName test 1092 support.getById = assert(function( div ) { 1093 docElem.appendChild( div ).id = expando; 1094 return !document.getElementsByName || !document.getElementsByName( expando ).length; 1095 }); 1096 1097 // ID find and filter 1098 if ( support.getById ) { 1099 Expr.find["ID"] = function( id, context ) { 1100 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 1101 var m = context.getElementById( id ); 1102 return m ? [ m ] : []; 1103 } 1104 }; 1105 Expr.filter["ID"] = function( id ) { 1106 var attrId = id.replace( runescape, funescape ); 1107 return function( elem ) { 1108 return elem.getAttribute("id") === attrId; 1109 }; 1110 }; 1111 } else { 1112 // Support: IE6/7 1113 // getElementById is not reliable as a find shortcut 1114 delete Expr.find["ID"]; 1115 1116 Expr.filter["ID"] = function( id ) { 1117 var attrId = id.replace( runescape, funescape ); 1118 return function( elem ) { 1119 var node = typeof elem.getAttributeNode !== "undefined" && 1120 elem.getAttributeNode("id"); 1121 return node && node.value === attrId; 1122 }; 1123 }; 1124 } 1125 1126 // Tag 1127 Expr.find["TAG"] = support.getElementsByTagName ? 1128 function( tag, context ) { 1129 if ( typeof context.getElementsByTagName !== "undefined" ) { 1130 return context.getElementsByTagName( tag ); 1131 1132 // DocumentFragment nodes don't have gEBTN 1133 } else if ( support.qsa ) { 1134 return context.querySelectorAll( tag ); 1135 } 1136 } : 1137 1138 function( tag, context ) { 1139 var elem, 1140 tmp = [], 1141 i = 0, 1142 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too 1143 results = context.getElementsByTagName( tag ); 1144 1145 // Filter out possible comments 1146 if ( tag === "*" ) { 1147 while ( (elem = results[i++]) ) { 1148 if ( elem.nodeType === 1 ) { 1149 tmp.push( elem ); 1150 } 1151 } 1152 1153 return tmp; 1154 } 1155 return results; 1156 }; 1157 1158 // Class 1159 Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { 1160 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { 1161 return context.getElementsByClassName( className ); 1162 } 1163 }; 1164 1165 /* QSA/matchesSelector 1166 ---------------------------------------------------------------------- */ 1167 1168 // QSA and matchesSelector support 1169 1170 // matchesSelector(:active) reports false when true (IE9/Opera 11.5) 1171 rbuggyMatches = []; 1172 1173 // qSa(:focus) reports false when true (Chrome 21) 1174 // We allow this because of a bug in IE8/9 that throws an error 1175 // whenever `document.activeElement` is accessed on an iframe 1176 // So, we allow :focus to pass through QSA all the time to avoid the IE error 1177 // See http://bugs.jquery.com/ticket/13378 1178 rbuggyQSA = []; 1179 1180 if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { 1181 // Build QSA regex 1182 // Regex strategy adopted from Diego Perini 1183 assert(function( div ) { 1184 // Select is set to empty string on purpose 1185 // This is to test IE's treatment of not explicitly 1186 // setting a boolean content attribute, 1187 // since its presence should be enough 1188 // http://bugs.jquery.com/ticket/12359 1189 docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" + 1190 "<select id='" + expando + "-\r\\' msallowcapture=''>" + 1191 "<option selected=''></option></select>"; 1192 1193 // Support: IE8, Opera 11-12.16 1194 // Nothing should be selected when empty strings follow ^= or $= or *= 1195 // The test attribute must be unknown in Opera but "safe" for WinRT 1196 // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section 1197 if ( div.querySelectorAll("[msallowcapture^='']").length ) { 1198 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); 1199 } 1200 1201 // Support: IE8 1202 // Boolean attributes and "value" are not treated correctly 1203 if ( !div.querySelectorAll("[selected]").length ) { 1204 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); 1205 } 1206 1207 // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ 1208 if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { 1209 rbuggyQSA.push("~="); 1210 } 1211 1212 // Webkit/Opera - :checked should return selected option elements 1213 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 1214 // IE8 throws error here and will not see later tests 1215 if ( !div.querySelectorAll(":checked").length ) { 1216 rbuggyQSA.push(":checked"); 1217 } 1218 1219 // Support: Safari 8+, iOS 8+ 1220 // https://bugs.webkit.org/show_bug.cgi?id=136851 1221 // In-page `selector#id sibing-combinator selector` fails 1222 if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) { 1223 rbuggyQSA.push(".#.+[+~]"); 1224 } 1225 }); 1226 1227 assert(function( div ) { 1228 // Support: Windows 8 Native Apps 1229 // The type and name attributes are restricted during .innerHTML assignment 1230 var input = document.createElement("input"); 1231 input.setAttribute( "type", "hidden" ); 1232 div.appendChild( input ).setAttribute( "name", "D" ); 1233 1234 // Support: IE8 1235 // Enforce case-sensitivity of name attribute 1236 if ( div.querySelectorAll("[name=d]").length ) { 1237 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); 1238 } 1239 1240 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) 1241 // IE8 throws error here and will not see later tests 1242 if ( !div.querySelectorAll(":enabled").length ) { 1243 rbuggyQSA.push( ":enabled", ":disabled" ); 1244 } 1245 1246 // Opera 10-11 does not throw on post-comma invalid pseudos 1247 div.querySelectorAll("*,:x"); 1248 rbuggyQSA.push(",.*:"); 1249 }); 1250 } 1251 1252 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || 1253 docElem.webkitMatchesSelector || 1254 docElem.mozMatchesSelector || 1255 docElem.oMatchesSelector || 1256 docElem.msMatchesSelector) )) ) { 1257 1258 assert(function( div ) { 1259 // Check to see if it's possible to do matchesSelector 1260 // on a disconnected node (IE 9) 1261 support.disconnectedMatch = matches.call( div, "div" ); 1262 1263 // This should fail with an exception 1264 // Gecko does not error, returns false instead 1265 matches.call( div, "[s!='']:x" ); 1266 rbuggyMatches.push( "!=", pseudos ); 1267 }); 1268 } 1269 1270 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); 1271 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); 1272 1273 /* Contains 1274 ---------------------------------------------------------------------- */ 1275 hasCompare = rnative.test( docElem.compareDocumentPosition ); 1276 1277 // Element contains another 1278 // Purposefully self-exclusive 1279 // As in, an element does not contain itself 1280 contains = hasCompare || rnative.test( docElem.contains ) ? 1281 function( a, b ) { 1282 var adown = a.nodeType === 9 ? a.documentElement : a, 1283 bup = b && b.parentNode; 1284 return a === bup || !!( bup && bup.nodeType === 1 && ( 1285 adown.contains ? 1286 adown.contains( bup ) : 1287 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 1288 )); 1289 } : 1290 function( a, b ) { 1291 if ( b ) { 1292 while ( (b = b.parentNode) ) { 1293 if ( b === a ) { 1294 return true; 1295 } 1296 } 1297 } 1298 return false; 1299 }; 1300 1301 /* Sorting 1302 ---------------------------------------------------------------------- */ 1303 1304 // Document order sorting 1305 sortOrder = hasCompare ? 1306 function( a, b ) { 1307 1308 // Flag for duplicate removal 1309 if ( a === b ) { 1310 hasDuplicate = true; 1311 return 0; 1312 } 1313 1314 // Sort on method existence if only one input has compareDocumentPosition 1315 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 1316 if ( compare ) { 1317 return compare; 1318 } 1319 1320 // Calculate position if both inputs belong to the same document 1321 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? 1322 a.compareDocumentPosition( b ) : 1323 1324 // Otherwise we know they are disconnected 1325 1; 1326 1327 // Disconnected nodes 1328 if ( compare & 1 || 1329 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { 1330 1331 // Choose the first element that is related to our preferred document 1332 if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { 1333 return -1; 1334 } 1335 if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { 1336 return 1; 1337 } 1338 1339 // Maintain original order 1340 return sortInput ? 1341 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 1342 0; 1343 } 1344 1345 return compare & 4 ? -1 : 1; 1346 } : 1347 function( a, b ) { 1348 // Exit early if the nodes are identical 1349 if ( a === b ) { 1350 hasDuplicate = true; 1351 return 0; 1352 } 1353 1354 var cur, 1355 i = 0, 1356 aup = a.parentNode, 1357 bup = b.parentNode, 1358 ap = [ a ], 1359 bp = [ b ]; 1360 1361 // Parentless nodes are either documents or disconnected 1362 if ( !aup || !bup ) { 1363 return a === document ? -1 : 1364 b === document ? 1 : 1365 aup ? -1 : 1366 bup ? 1 : 1367 sortInput ? 1368 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 1369 0; 1370 1371 // If the nodes are siblings, we can do a quick check 1372 } else if ( aup === bup ) { 1373 return siblingCheck( a, b ); 1374 } 1375 1376 // Otherwise we need full lists of their ancestors for comparison 1377 cur = a; 1378 while ( (cur = cur.parentNode) ) { 1379 ap.unshift( cur ); 1380 } 1381 cur = b; 1382 while ( (cur = cur.parentNode) ) { 1383 bp.unshift( cur ); 1384 } 1385 1386 // Walk down the tree looking for a discrepancy 1387 while ( ap[i] === bp[i] ) { 1388 i++; 1389 } 1390 1391 return i ? 1392 // Do a sibling check if the nodes have a common ancestor 1393 siblingCheck( ap[i], bp[i] ) : 1394 1395 // Otherwise nodes in our document sort first 1396 ap[i] === preferredDoc ? -1 : 1397 bp[i] === preferredDoc ? 1 : 1398 0; 1399 }; 1400 1401 return document; 1402}; 1403 1404Sizzle.matches = function( expr, elements ) { 1405 return Sizzle( expr, null, null, elements ); 1406}; 1407 1408Sizzle.matchesSelector = function( elem, expr ) { 1409 // Set document vars if needed 1410 if ( ( elem.ownerDocument || elem ) !== document ) { 1411 setDocument( elem ); 1412 } 1413 1414 // Make sure that attribute selectors are quoted 1415 expr = expr.replace( rattributeQuotes, "='$1']" ); 1416 1417 if ( support.matchesSelector && documentIsHTML && 1418 !compilerCache[ expr + " " ] && 1419 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && 1420 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { 1421 1422 try { 1423 var ret = matches.call( elem, expr ); 1424 1425 // IE 9's matchesSelector returns false on disconnected nodes 1426 if ( ret || support.disconnectedMatch || 1427 // As well, disconnected nodes are said to be in a document 1428 // fragment in IE 9 1429 elem.document && elem.document.nodeType !== 11 ) { 1430 return ret; 1431 } 1432 } catch (e) {} 1433 } 1434 1435 return Sizzle( expr, document, null, [ elem ] ).length > 0; 1436}; 1437 1438Sizzle.contains = function( context, elem ) { 1439 // Set document vars if needed 1440 if ( ( context.ownerDocument || context ) !== document ) { 1441 setDocument( context ); 1442 } 1443 return contains( context, elem ); 1444}; 1445 1446Sizzle.attr = function( elem, name ) { 1447 // Set document vars if needed 1448 if ( ( elem.ownerDocument || elem ) !== document ) { 1449 setDocument( elem ); 1450 } 1451 1452 var fn = Expr.attrHandle[ name.toLowerCase() ], 1453 // Don't get fooled by Object.prototype properties (jQuery #13807) 1454 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? 1455 fn( elem, name, !documentIsHTML ) : 1456 undefined; 1457 1458 return val !== undefined ? 1459 val : 1460 support.attributes || !documentIsHTML ? 1461 elem.getAttribute( name ) : 1462 (val = elem.getAttributeNode(name)) && val.specified ? 1463 val.value : 1464 null; 1465}; 1466 1467Sizzle.error = function( msg ) { 1468 throw new Error( "Syntax error, unrecognized expression: " + msg ); 1469}; 1470 1471/** 1472 * Document sorting and removing duplicates 1473 * @param {ArrayLike} results 1474 */ 1475Sizzle.uniqueSort = function( results ) { 1476 var elem, 1477 duplicates = [], 1478 j = 0, 1479 i = 0; 1480 1481 // Unless we *know* we can detect duplicates, assume their presence 1482 hasDuplicate = !support.detectDuplicates; 1483 sortInput = !support.sortStable && results.slice( 0 ); 1484 results.sort( sortOrder ); 1485 1486 if ( hasDuplicate ) { 1487 while ( (elem = results[i++]) ) { 1488 if ( elem === results[ i ] ) { 1489 j = duplicates.push( i ); 1490 } 1491 } 1492 while ( j-- ) { 1493 results.splice( duplicates[ j ], 1 ); 1494 } 1495 } 1496 1497 // Clear input after sorting to release objects 1498 // See https://github.com/jquery/sizzle/pull/225 1499 sortInput = null; 1500 1501 return results; 1502}; 1503 1504/** 1505 * Utility function for retrieving the text value of an array of DOM nodes 1506 * @param {Array|Element} elem 1507 */ 1508getText = Sizzle.getText = function( elem ) { 1509 var node, 1510 ret = "", 1511 i = 0, 1512 nodeType = elem.nodeType; 1513 1514 if ( !nodeType ) { 1515 // If no nodeType, this is expected to be an array 1516 while ( (node = elem[i++]) ) { 1517 // Do not traverse comment nodes 1518 ret += getText( node ); 1519 } 1520 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { 1521 // Use textContent for elements 1522 // innerText usage removed for consistency of new lines (jQuery #11153) 1523 if ( typeof elem.textContent === "string" ) { 1524 return elem.textContent; 1525 } else { 1526 // Traverse its children 1527 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 1528 ret += getText( elem ); 1529 } 1530 } 1531 } else if ( nodeType === 3 || nodeType === 4 ) { 1532 return elem.nodeValue; 1533 } 1534 // Do not include comment or processing instruction nodes 1535 1536 return ret; 1537}; 1538 1539Expr = Sizzle.selectors = { 1540 1541 // Can be adjusted by the user 1542 cacheLength: 50, 1543 1544 createPseudo: markFunction, 1545 1546 match: matchExpr, 1547 1548 attrHandle: {}, 1549 1550 find: {}, 1551 1552 relative: { 1553 ">": { dir: "parentNode", first: true }, 1554 " ": { dir: "parentNode" }, 1555 "+": { dir: "previousSibling", first: true }, 1556 "~": { dir: "previousSibling" } 1557 }, 1558 1559 preFilter: { 1560 "ATTR": function( match ) { 1561 match[1] = match[1].replace( runescape, funescape ); 1562 1563 // Move the given value to match[3] whether quoted or unquoted 1564 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); 1565 1566 if ( match[2] === "~=" ) { 1567 match[3] = " " + match[3] + " "; 1568 } 1569 1570 return match.slice( 0, 4 ); 1571 }, 1572 1573 "CHILD": function( match ) { 1574 /* matches from matchExpr["CHILD"] 1575 1 type (only|nth|...) 1576 2 what (child|of-type) 1577 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 1578 4 xn-component of xn+y argument ([+-]?\d*n|) 1579 5 sign of xn-component 1580 6 x of xn-component 1581 7 sign of y-component 1582 8 y of y-component 1583 */ 1584 match[1] = match[1].toLowerCase(); 1585 1586 if ( match[1].slice( 0, 3 ) === "nth" ) { 1587 // nth-* requires argument 1588 if ( !match[3] ) { 1589 Sizzle.error( match[0] ); 1590 } 1591 1592 // numeric x and y parameters for Expr.filter.CHILD 1593 // remember that false/true cast respectively to 0/1 1594 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); 1595 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); 1596 1597 // other types prohibit arguments 1598 } else if ( match[3] ) { 1599 Sizzle.error( match[0] ); 1600 } 1601 1602 return match; 1603 }, 1604 1605 "PSEUDO": function( match ) { 1606 var excess, 1607 unquoted = !match[6] && match[2]; 1608 1609 if ( matchExpr["CHILD"].test( match[0] ) ) { 1610 return null; 1611 } 1612 1613 // Accept quoted arguments as-is 1614 if ( match[3] ) { 1615 match[2] = match[4] || match[5] || ""; 1616 1617 // Strip excess characters from unquoted arguments 1618 } else if ( unquoted && rpseudo.test( unquoted ) && 1619 // Get excess from tokenize (recursively) 1620 (excess = tokenize( unquoted, true )) && 1621 // advance to the next closing parenthesis 1622 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { 1623 1624 // excess is a negative index 1625 match[0] = match[0].slice( 0, excess ); 1626 match[2] = unquoted.slice( 0, excess ); 1627 } 1628 1629 // Return only captures needed by the pseudo filter method (type and argument) 1630 return match.slice( 0, 3 ); 1631 } 1632 }, 1633 1634 filter: { 1635 1636 "TAG": function( nodeNameSelector ) { 1637 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); 1638 return nodeNameSelector === "*" ? 1639 function() { return true; } : 1640 function( elem ) { 1641 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; 1642 }; 1643 }, 1644 1645 "CLASS": function( className ) { 1646 var pattern = classCache[ className + " " ]; 1647 1648 return pattern || 1649 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && 1650 classCache( className, function( elem ) { 1651 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); 1652 }); 1653 }, 1654 1655 "ATTR": function( name, operator, check ) { 1656 return function( elem ) { 1657 var result = Sizzle.attr( elem, name ); 1658 1659 if ( result == null ) { 1660 return operator === "!="; 1661 } 1662 if ( !operator ) { 1663 return true; 1664 } 1665 1666 result += ""; 1667 1668 return operator === "=" ? result === check : 1669 operator === "!=" ? result !== check : 1670 operator === "^=" ? check && result.indexOf( check ) === 0 : 1671 operator === "*=" ? check && result.indexOf( check ) > -1 : 1672 operator === "$=" ? check && result.slice( -check.length ) === check : 1673 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : 1674 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : 1675 false; 1676 }; 1677 }, 1678 1679 "CHILD": function( type, what, argument, first, last ) { 1680 var simple = type.slice( 0, 3 ) !== "nth", 1681 forward = type.slice( -4 ) !== "last", 1682 ofType = what === "of-type"; 1683 1684 return first === 1 && last === 0 ? 1685 1686 // Shortcut for :nth-*(n) 1687 function( elem ) { 1688 return !!elem.parentNode; 1689 } : 1690 1691 function( elem, context, xml ) { 1692 var cache, uniqueCache, outerCache, node, nodeIndex, start, 1693 dir = simple !== forward ? "nextSibling" : "previousSibling", 1694 parent = elem.parentNode, 1695 name = ofType && elem.nodeName.toLowerCase(), 1696 useCache = !xml && !ofType, 1697 diff = false; 1698 1699 if ( parent ) { 1700 1701 // :(first|last|only)-(child|of-type) 1702 if ( simple ) { 1703 while ( dir ) { 1704 node = elem; 1705 while ( (node = node[ dir ]) ) { 1706 if ( ofType ? 1707 node.nodeName.toLowerCase() === name : 1708 node.nodeType === 1 ) { 1709 1710 return false; 1711 } 1712 } 1713 // Reverse direction for :only-* (if we haven't yet done so) 1714 start = dir = type === "only" && !start && "nextSibling"; 1715 } 1716 return true; 1717 } 1718 1719 start = [ forward ? parent.firstChild : parent.lastChild ]; 1720 1721 // non-xml :nth-child(...) stores cache data on `parent` 1722 if ( forward && useCache ) { 1723 1724 // Seek `elem` from a previously-cached index 1725 1726 // ...in a gzip-friendly way 1727 node = parent; 1728 outerCache = node[ expando ] || (node[ expando ] = {}); 1729 1730 // Support: IE <9 only 1731 // Defend against cloned attroperties (jQuery gh-1709) 1732 uniqueCache = outerCache[ node.uniqueID ] || 1733 (outerCache[ node.uniqueID ] = {}); 1734 1735 cache = uniqueCache[ type ] || []; 1736 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 1737 diff = nodeIndex && cache[ 2 ]; 1738 node = nodeIndex && parent.childNodes[ nodeIndex ]; 1739 1740 while ( (node = ++nodeIndex && node && node[ dir ] || 1741 1742 // Fallback to seeking `elem` from the start 1743 (diff = nodeIndex = 0) || start.pop()) ) { 1744 1745 // When found, cache indexes on `parent` and break 1746 if ( node.nodeType === 1 && ++diff && node === elem ) { 1747 uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; 1748 break; 1749 } 1750 } 1751 1752 } else { 1753 // Use previously-cached element index if available 1754 if ( useCache ) { 1755 // ...in a gzip-friendly way 1756 node = elem; 1757 outerCache = node[ expando ] || (node[ expando ] = {}); 1758 1759 // Support: IE <9 only 1760 // Defend against cloned attroperties (jQuery gh-1709) 1761 uniqueCache = outerCache[ node.uniqueID ] || 1762 (outerCache[ node.uniqueID ] = {}); 1763 1764 cache = uniqueCache[ type ] || []; 1765 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 1766 diff = nodeIndex; 1767 } 1768 1769 // xml :nth-child(...) 1770 // or :nth-last-child(...) or :nth(-last)?-of-type(...) 1771 if ( diff === false ) { 1772 // Use the same loop as above to seek `elem` from the start 1773 while ( (node = ++nodeIndex && node && node[ dir ] || 1774 (diff = nodeIndex = 0) || start.pop()) ) { 1775 1776 if ( ( ofType ? 1777 node.nodeName.toLowerCase() === name : 1778 node.nodeType === 1 ) && 1779 ++diff ) { 1780 1781 // Cache the index of each encountered element 1782 if ( useCache ) { 1783 outerCache = node[ expando ] || (node[ expando ] = {}); 1784 1785 // Support: IE <9 only 1786 // Defend against cloned attroperties (jQuery gh-1709) 1787 uniqueCache = outerCache[ node.uniqueID ] || 1788 (outerCache[ node.uniqueID ] = {}); 1789 1790 uniqueCache[ type ] = [ dirruns, diff ]; 1791 } 1792 1793 if ( node === elem ) { 1794 break; 1795 } 1796 } 1797 } 1798 } 1799 } 1800 1801 // Incorporate the offset, then check against cycle size 1802 diff -= last; 1803 return diff === first || ( diff % first === 0 && diff / first >= 0 ); 1804 } 1805 }; 1806 }, 1807 1808 "PSEUDO": function( pseudo, argument ) { 1809 // pseudo-class names are case-insensitive 1810 // http://www.w3.org/TR/selectors/#pseudo-classes 1811 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 1812 // Remember that setFilters inherits from pseudos 1813 var args, 1814 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || 1815 Sizzle.error( "unsupported pseudo: " + pseudo ); 1816 1817 // The user may use createPseudo to indicate that 1818 // arguments are needed to create the filter function 1819 // just as Sizzle does 1820 if ( fn[ expando ] ) { 1821 return fn( argument ); 1822 } 1823 1824 // But maintain support for old signatures 1825 if ( fn.length > 1 ) { 1826 args = [ pseudo, pseudo, "", argument ]; 1827 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? 1828 markFunction(function( seed, matches ) { 1829 var idx, 1830 matched = fn( seed, argument ), 1831 i = matched.length; 1832 while ( i-- ) { 1833 idx = indexOf( seed, matched[i] ); 1834 seed[ idx ] = !( matches[ idx ] = matched[i] ); 1835 } 1836 }) : 1837 function( elem ) { 1838 return fn( elem, 0, args ); 1839 }; 1840 } 1841 1842 return fn; 1843 } 1844 }, 1845 1846 pseudos: { 1847 // Potentially complex pseudos 1848 "not": markFunction(function( selector ) { 1849 // Trim the selector passed to compile 1850 // to avoid treating leading and trailing 1851 // spaces as combinators 1852 var input = [], 1853 results = [], 1854 matcher = compile( selector.replace( rtrim, "$1" ) ); 1855 1856 return matcher[ expando ] ? 1857 markFunction(function( seed, matches, context, xml ) { 1858 var elem, 1859 unmatched = matcher( seed, null, xml, [] ), 1860 i = seed.length; 1861 1862 // Match elements unmatched by `matcher` 1863 while ( i-- ) { 1864 if ( (elem = unmatched[i]) ) { 1865 seed[i] = !(matches[i] = elem); 1866 } 1867 } 1868 }) : 1869 function( elem, context, xml ) { 1870 input[0] = elem; 1871 matcher( input, null, xml, results ); 1872 // Don't keep the element (issue #299) 1873 input[0] = null; 1874 return !results.pop(); 1875 }; 1876 }), 1877 1878 "has": markFunction(function( selector ) { 1879 return function( elem ) { 1880 return Sizzle( selector, elem ).length > 0; 1881 }; 1882 }), 1883 1884 "contains": markFunction(function( text ) { 1885 text = text.replace( runescape, funescape ); 1886 return function( elem ) { 1887 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; 1888 }; 1889 }), 1890 1891 // "Whether an element is represented by a :lang() selector 1892 // is based solely on the element's language value 1893 // being equal to the identifier C, 1894 // or beginning with the identifier C immediately followed by "-". 1895 // The matching of C against the element's language value is performed case-insensitively. 1896 // The identifier C does not have to be a valid language name." 1897 // http://www.w3.org/TR/selectors/#lang-pseudo 1898 "lang": markFunction( function( lang ) { 1899 // lang value must be a valid identifier 1900 if ( !ridentifier.test(lang || "") ) { 1901 Sizzle.error( "unsupported lang: " + lang ); 1902 } 1903 lang = lang.replace( runescape, funescape ).toLowerCase(); 1904 return function( elem ) { 1905 var elemLang; 1906 do { 1907 if ( (elemLang = documentIsHTML ? 1908 elem.lang : 1909 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { 1910 1911 elemLang = elemLang.toLowerCase(); 1912 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 1913 } 1914 } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); 1915 return false; 1916 }; 1917 }), 1918 1919 // Miscellaneous 1920 "target": function( elem ) { 1921 var hash = window.location && window.location.hash; 1922 return hash && hash.slice( 1 ) === elem.id; 1923 }, 1924 1925 "root": function( elem ) { 1926 return elem === docElem; 1927 }, 1928 1929 "focus": function( elem ) { 1930 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); 1931 }, 1932 1933 // Boolean properties 1934 "enabled": function( elem ) { 1935 return elem.disabled === false; 1936 }, 1937 1938 "disabled": function( elem ) { 1939 return elem.disabled === true; 1940 }, 1941 1942 "checked": function( elem ) { 1943 // In CSS3, :checked should return both checked and selected elements 1944 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 1945 var nodeName = elem.nodeName.toLowerCase(); 1946 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); 1947 }, 1948 1949 "selected": function( elem ) { 1950 // Accessing this property makes selected-by-default 1951 // options in Safari work properly 1952 if ( elem.parentNode ) { 1953 elem.parentNode.selectedIndex; 1954 } 1955 1956 return elem.selected === true; 1957 }, 1958 1959 // Contents 1960 "empty": function( elem ) { 1961 // http://www.w3.org/TR/selectors/#empty-pseudo 1962 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), 1963 // but not by others (comment: 8; processing instruction: 7; etc.) 1964 // nodeType < 6 works because attributes (2) do not appear as children 1965 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 1966 if ( elem.nodeType < 6 ) { 1967 return false; 1968 } 1969 } 1970 return true; 1971 }, 1972 1973 "parent": function( elem ) { 1974 return !Expr.pseudos["empty"]( elem ); 1975 }, 1976 1977 // Element/input types 1978 "header": function( elem ) { 1979 return rheader.test( elem.nodeName ); 1980 }, 1981 1982 "input": function( elem ) { 1983 return rinputs.test( elem.nodeName ); 1984 }, 1985 1986 "button": function( elem ) { 1987 var name = elem.nodeName.toLowerCase(); 1988 return name === "input" && elem.type === "button" || name === "button"; 1989 }, 1990 1991 "text": function( elem ) { 1992 var attr; 1993 return elem.nodeName.toLowerCase() === "input" && 1994 elem.type === "text" && 1995 1996 // Support: IE<8 1997 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" 1998 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); 1999 }, 2000 2001 // Position-in-collection 2002 "first": createPositionalPseudo(function() { 2003 return [ 0 ]; 2004 }), 2005 2006 "last": createPositionalPseudo(function( matchIndexes, length ) { 2007 return [ length - 1 ]; 2008 }), 2009 2010 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { 2011 return [ argument < 0 ? argument + length : argument ]; 2012 }), 2013 2014 "even": createPositionalPseudo(function( matchIndexes, length ) { 2015 var i = 0; 2016 for ( ; i < length; i += 2 ) { 2017 matchIndexes.push( i ); 2018 } 2019 return matchIndexes; 2020 }), 2021 2022 "odd": createPositionalPseudo(function( matchIndexes, length ) { 2023 var i = 1; 2024 for ( ; i < length; i += 2 ) { 2025 matchIndexes.push( i ); 2026 } 2027 return matchIndexes; 2028 }), 2029 2030 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { 2031 var i = argument < 0 ? argument + length : argument; 2032 for ( ; --i >= 0; ) { 2033 matchIndexes.push( i ); 2034 } 2035 return matchIndexes; 2036 }), 2037 2038 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { 2039 var i = argument < 0 ? argument + length : argument; 2040 for ( ; ++i < length; ) { 2041 matchIndexes.push( i ); 2042 } 2043 return matchIndexes; 2044 }) 2045 } 2046}; 2047 2048Expr.pseudos["nth"] = Expr.pseudos["eq"]; 2049 2050// Add button/input type pseudos 2051for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { 2052 Expr.pseudos[ i ] = createInputPseudo( i ); 2053} 2054for ( i in { submit: true, reset: true } ) { 2055 Expr.pseudos[ i ] = createButtonPseudo( i ); 2056} 2057 2058// Easy API for creating new setFilters 2059function setFilters() {} 2060setFilters.prototype = Expr.filters = Expr.pseudos; 2061Expr.setFilters = new setFilters(); 2062 2063tokenize = Sizzle.tokenize = function( selector, parseOnly ) { 2064 var matched, match, tokens, type, 2065 soFar, groups, preFilters, 2066 cached = tokenCache[ selector + " " ]; 2067 2068 if ( cached ) { 2069 return parseOnly ? 0 : cached.slice( 0 ); 2070 } 2071 2072 soFar = selector; 2073 groups = []; 2074 preFilters = Expr.preFilter; 2075 2076 while ( soFar ) { 2077 2078 // Comma and first run 2079 if ( !matched || (match = rcomma.exec( soFar )) ) { 2080 if ( match ) { 2081 // Don't consume trailing commas as valid 2082 soFar = soFar.slice( match[0].length ) || soFar; 2083 } 2084 groups.push( (tokens = []) ); 2085 } 2086 2087 matched = false; 2088 2089 // Combinators 2090 if ( (match = rcombinators.exec( soFar )) ) { 2091 matched = match.shift(); 2092 tokens.push({ 2093 value: matched, 2094 // Cast descendant combinators to space 2095 type: match[0].replace( rtrim, " " ) 2096 }); 2097 soFar = soFar.slice( matched.length ); 2098 } 2099 2100 // Filters 2101 for ( type in Expr.filter ) { 2102 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || 2103 (match = preFilters[ type ]( match ))) ) { 2104 matched = match.shift(); 2105 tokens.push({ 2106 value: matched, 2107 type: type, 2108 matches: match 2109 }); 2110 soFar = soFar.slice( matched.length ); 2111 } 2112 } 2113 2114 if ( !matched ) { 2115 break; 2116 } 2117 } 2118 2119 // Return the length of the invalid excess 2120 // if we're just parsing 2121 // Otherwise, throw an error or return tokens 2122 return parseOnly ? 2123 soFar.length : 2124 soFar ? 2125 Sizzle.error( selector ) : 2126 // Cache the tokens 2127 tokenCache( selector, groups ).slice( 0 ); 2128}; 2129 2130function toSelector( tokens ) { 2131 var i = 0, 2132 len = tokens.length, 2133 selector = ""; 2134 for ( ; i < len; i++ ) { 2135 selector += tokens[i].value; 2136 } 2137 return selector; 2138} 2139 2140function addCombinator( matcher, combinator, base ) { 2141 var dir = combinator.dir, 2142 checkNonElements = base && dir === "parentNode", 2143 doneName = done++; 2144 2145 return combinator.first ? 2146 // Check against closest ancestor/preceding element 2147 function( elem, context, xml ) { 2148 while ( (elem = elem[ dir ]) ) { 2149 if ( elem.nodeType === 1 || checkNonElements ) { 2150 return matcher( elem, context, xml ); 2151 } 2152 } 2153 } : 2154 2155 // Check against all ancestor/preceding elements 2156 function( elem, context, xml ) { 2157 var oldCache, uniqueCache, outerCache, 2158 newCache = [ dirruns, doneName ]; 2159 2160 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching 2161 if ( xml ) { 2162 while ( (elem = elem[ dir ]) ) { 2163 if ( elem.nodeType === 1 || checkNonElements ) { 2164 if ( matcher( elem, context, xml ) ) { 2165 return true; 2166 } 2167 } 2168 } 2169 } else { 2170 while ( (elem = elem[ dir ]) ) { 2171 if ( elem.nodeType === 1 || checkNonElements ) { 2172 outerCache = elem[ expando ] || (elem[ expando ] = {}); 2173 2174 // Support: IE <9 only 2175 // Defend against cloned attroperties (jQuery gh-1709) 2176 uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); 2177 2178 if ( (oldCache = uniqueCache[ dir ]) && 2179 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { 2180 2181 // Assign to newCache so results back-propagate to previous elements 2182 return (newCache[ 2 ] = oldCache[ 2 ]); 2183 } else { 2184 // Reuse newcache so results back-propagate to previous elements 2185 uniqueCache[ dir ] = newCache; 2186 2187 // A match means we're done; a fail means we have to keep checking 2188 if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { 2189 return true; 2190 } 2191 } 2192 } 2193 } 2194 } 2195 }; 2196} 2197 2198function elementMatcher( matchers ) { 2199 return matchers.length > 1 ? 2200 function( elem, context, xml ) { 2201 var i = matchers.length; 2202 while ( i-- ) { 2203 if ( !matchers[i]( elem, context, xml ) ) { 2204 return false; 2205 } 2206 } 2207 return true; 2208 } : 2209 matchers[0]; 2210} 2211 2212function multipleContexts( selector, contexts, results ) { 2213 var i = 0, 2214 len = contexts.length; 2215 for ( ; i < len; i++ ) { 2216 Sizzle( selector, contexts[i], results ); 2217 } 2218 return results; 2219} 2220 2221function condense( unmatched, map, filter, context, xml ) { 2222 var elem, 2223 newUnmatched = [], 2224 i = 0, 2225 len = unmatched.length, 2226 mapped = map != null; 2227 2228 for ( ; i < len; i++ ) { 2229 if ( (elem = unmatched[i]) ) { 2230 if ( !filter || filter( elem, context, xml ) ) { 2231 newUnmatched.push( elem ); 2232 if ( mapped ) { 2233 map.push( i ); 2234 } 2235 } 2236 } 2237 } 2238 2239 return newUnmatched; 2240} 2241 2242function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { 2243 if ( postFilter && !postFilter[ expando ] ) { 2244 postFilter = setMatcher( postFilter ); 2245 } 2246 if ( postFinder && !postFinder[ expando ] ) { 2247 postFinder = setMatcher( postFinder, postSelector ); 2248 } 2249 return markFunction(function( seed, results, context, xml ) { 2250 var temp, i, elem, 2251 preMap = [], 2252 postMap = [], 2253 preexisting = results.length, 2254 2255 // Get initial elements from seed or context 2256 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), 2257 2258 // Prefilter to get matcher input, preserving a map for seed-results synchronization 2259 matcherIn = preFilter && ( seed || !selector ) ? 2260 condense( elems, preMap, preFilter, context, xml ) : 2261 elems, 2262 2263 matcherOut = matcher ? 2264 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, 2265 postFinder || ( seed ? preFilter : preexisting || postFilter ) ? 2266 2267 // ...intermediate processing is necessary 2268 [] : 2269 2270 // ...otherwise use results directly 2271 results : 2272 matcherIn; 2273 2274 // Find primary matches 2275 if ( matcher ) { 2276 matcher( matcherIn, matcherOut, context, xml ); 2277 } 2278 2279 // Apply postFilter 2280 if ( postFilter ) { 2281 temp = condense( matcherOut, postMap ); 2282 postFilter( temp, [], context, xml ); 2283 2284 // Un-match failing elements by moving them back to matcherIn 2285 i = temp.length; 2286 while ( i-- ) { 2287 if ( (elem = temp[i]) ) { 2288 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); 2289 } 2290 } 2291 } 2292 2293 if ( seed ) { 2294 if ( postFinder || preFilter ) { 2295 if ( postFinder ) { 2296 // Get the final matcherOut by condensing this intermediate into postFinder contexts 2297 temp = []; 2298 i = matcherOut.length; 2299 while ( i-- ) { 2300 if ( (elem = matcherOut[i]) ) { 2301 // Restore matcherIn since elem is not yet a final match 2302 temp.push( (matcherIn[i] = elem) ); 2303 } 2304 } 2305 postFinder( null, (matcherOut = []), temp, xml ); 2306 } 2307 2308 // Move matched elements from seed to results to keep them synchronized 2309 i = matcherOut.length; 2310 while ( i-- ) { 2311 if ( (elem = matcherOut[i]) && 2312 (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { 2313 2314 seed[temp] = !(results[temp] = elem); 2315 } 2316 } 2317 } 2318 2319 // Add elements to results, through postFinder if defined 2320 } else { 2321 matcherOut = condense( 2322 matcherOut === results ? 2323 matcherOut.splice( preexisting, matcherOut.length ) : 2324 matcherOut 2325 ); 2326 if ( postFinder ) { 2327 postFinder( null, results, matcherOut, xml ); 2328 } else { 2329 push.apply( results, matcherOut ); 2330 } 2331 } 2332 }); 2333} 2334 2335function matcherFromTokens( tokens ) { 2336 var checkContext, matcher, j, 2337 len = tokens.length, 2338 leadingRelative = Expr.relative[ tokens[0].type ], 2339 implicitRelative = leadingRelative || Expr.relative[" "], 2340 i = leadingRelative ? 1 : 0, 2341 2342 // The foundational matcher ensures that elements are reachable from top-level context(s) 2343 matchContext = addCombinator( function( elem ) { 2344 return elem === checkContext; 2345 }, implicitRelative, true ), 2346 matchAnyContext = addCombinator( function( elem ) { 2347 return indexOf( checkContext, elem ) > -1; 2348 }, implicitRelative, true ), 2349 matchers = [ function( elem, context, xml ) { 2350 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( 2351 (checkContext = context).nodeType ? 2352 matchContext( elem, context, xml ) : 2353 matchAnyContext( elem, context, xml ) ); 2354 // Avoid hanging onto element (issue #299) 2355 checkContext = null; 2356 return ret; 2357 } ]; 2358 2359 for ( ; i < len; i++ ) { 2360 if ( (matcher = Expr.relative[ tokens[i].type ]) ) { 2361 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; 2362 } else { 2363 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); 2364 2365 // Return special upon seeing a positional matcher 2366 if ( matcher[ expando ] ) { 2367 // Find the next relative operator (if any) for proper handling 2368 j = ++i; 2369 for ( ; j < len; j++ ) { 2370 if ( Expr.relative[ tokens[j].type ] ) { 2371 break; 2372 } 2373 } 2374 return setMatcher( 2375 i > 1 && elementMatcher( matchers ), 2376 i > 1 && toSelector( 2377 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 2378 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) 2379 ).replace( rtrim, "$1" ), 2380 matcher, 2381 i < j && matcherFromTokens( tokens.slice( i, j ) ), 2382 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), 2383 j < len && toSelector( tokens ) 2384 ); 2385 } 2386 matchers.push( matcher ); 2387 } 2388 } 2389 2390 return elementMatcher( matchers ); 2391} 2392 2393function matcherFromGroupMatchers( elementMatchers, setMatchers ) { 2394 var bySet = setMatchers.length > 0, 2395 byElement = elementMatchers.length > 0, 2396 superMatcher = function( seed, context, xml, results, outermost ) { 2397 var elem, j, matcher, 2398 matchedCount = 0, 2399 i = "0", 2400 unmatched = seed && [], 2401 setMatched = [], 2402 contextBackup = outermostContext, 2403 // We must always have either seed elements or outermost context 2404 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), 2405 // Use integer dirruns iff this is the outermost matcher 2406 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), 2407 len = elems.length; 2408 2409 if ( outermost ) { 2410 outermostContext = context === document || context || outermost; 2411 } 2412 2413 // Add elements passing elementMatchers directly to results 2414 // Support: IE<9, Safari 2415 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id 2416 for ( ; i !== len && (elem = elems[i]) != null; i++ ) { 2417 if ( byElement && elem ) { 2418 j = 0; 2419 if ( !context && elem.ownerDocument !== document ) { 2420 setDocument( elem ); 2421 xml = !documentIsHTML; 2422 } 2423 while ( (matcher = elementMatchers[j++]) ) { 2424 if ( matcher( elem, context || document, xml) ) { 2425 results.push( elem ); 2426 break; 2427 } 2428 } 2429 if ( outermost ) { 2430 dirruns = dirrunsUnique; 2431 } 2432 } 2433 2434 // Track unmatched elements for set filters 2435 if ( bySet ) { 2436 // They will have gone through all possible matchers 2437 if ( (elem = !matcher && elem) ) { 2438 matchedCount--; 2439 } 2440 2441 // Lengthen the array for every element, matched or not 2442 if ( seed ) { 2443 unmatched.push( elem ); 2444 } 2445 } 2446 } 2447 2448 // `i` is now the count of elements visited above, and adding it to `matchedCount` 2449 // makes the latter nonnegative. 2450 matchedCount += i; 2451 2452 // Apply set filters to unmatched elements 2453 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` 2454 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have 2455 // no element matchers and no seed. 2456 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that 2457 // case, which will result in a "00" `matchedCount` that differs from `i` but is also 2458 // numerically zero. 2459 if ( bySet && i !== matchedCount ) { 2460 j = 0; 2461 while ( (matcher = setMatchers[j++]) ) { 2462 matcher( unmatched, setMatched, context, xml ); 2463 } 2464 2465 if ( seed ) { 2466 // Reintegrate element matches to eliminate the need for sorting 2467 if ( matchedCount > 0 ) { 2468 while ( i-- ) { 2469 if ( !(unmatched[i] || setMatched[i]) ) { 2470 setMatched[i] = pop.call( results ); 2471 } 2472 } 2473 } 2474 2475 // Discard index placeholder values to get only actual matches 2476 setMatched = condense( setMatched ); 2477 } 2478 2479 // Add matches to results 2480 push.apply( results, setMatched ); 2481 2482 // Seedless set matches succeeding multiple successful matchers stipulate sorting 2483 if ( outermost && !seed && setMatched.length > 0 && 2484 ( matchedCount + setMatchers.length ) > 1 ) { 2485 2486 Sizzle.uniqueSort( results ); 2487 } 2488 } 2489 2490 // Override manipulation of globals by nested matchers 2491 if ( outermost ) { 2492 dirruns = dirrunsUnique; 2493 outermostContext = contextBackup; 2494 } 2495 2496 return unmatched; 2497 }; 2498 2499 return bySet ? 2500 markFunction( superMatcher ) : 2501 superMatcher; 2502} 2503 2504compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { 2505 var i, 2506 setMatchers = [], 2507 elementMatchers = [], 2508 cached = compilerCache[ selector + " " ]; 2509 2510 if ( !cached ) { 2511 // Generate a function of recursive functions that can be used to check each element 2512 if ( !match ) { 2513 match = tokenize( selector ); 2514 } 2515 i = match.length; 2516 while ( i-- ) { 2517 cached = matcherFromTokens( match[i] ); 2518 if ( cached[ expando ] ) { 2519 setMatchers.push( cached ); 2520 } else { 2521 elementMatchers.push( cached ); 2522 } 2523 } 2524 2525 // Cache the compiled function 2526 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); 2527 2528 // Save selector and tokenization 2529 cached.selector = selector; 2530 } 2531 return cached; 2532}; 2533 2534/** 2535 * A low-level selection function that works with Sizzle's compiled 2536 * selector functions 2537 * @param {String|Function} selector A selector or a pre-compiled 2538 * selector function built with Sizzle.compile 2539 * @param {Element} context 2540 * @param {Array} [results] 2541 * @param {Array} [seed] A set of elements to match against 2542 */ 2543select = Sizzle.select = function( selector, context, results, seed ) { 2544 var i, tokens, token, type, find, 2545 compiled = typeof selector === "function" && selector, 2546 match = !seed && tokenize( (selector = compiled.selector || selector) ); 2547 2548 results = results || []; 2549 2550 // Try to minimize operations if there is only one selector in the list and no seed 2551 // (the latter of which guarantees us context) 2552 if ( match.length === 1 ) { 2553 2554 // Reduce context if the leading compound selector is an ID 2555 tokens = match[0] = match[0].slice( 0 ); 2556 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && 2557 support.getById && context.nodeType === 9 && documentIsHTML && 2558 Expr.relative[ tokens[1].type ] ) { 2559 2560 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; 2561 if ( !context ) { 2562 return results; 2563 2564 // Precompiled matchers will still verify ancestry, so step up a level 2565 } else if ( compiled ) { 2566 context = context.parentNode; 2567 } 2568 2569 selector = selector.slice( tokens.shift().value.length ); 2570 } 2571 2572 // Fetch a seed set for right-to-left matching 2573 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; 2574 while ( i-- ) { 2575 token = tokens[i]; 2576 2577 // Abort if we hit a combinator 2578 if ( Expr.relative[ (type = token.type) ] ) { 2579 break; 2580 } 2581 if ( (find = Expr.find[ type ]) ) { 2582 // Search, expanding context for leading sibling combinators 2583 if ( (seed = find( 2584 token.matches[0].replace( runescape, funescape ), 2585 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context 2586 )) ) { 2587 2588 // If seed is empty or no tokens remain, we can return early 2589 tokens.splice( i, 1 ); 2590 selector = seed.length && toSelector( tokens ); 2591 if ( !selector ) { 2592 push.apply( results, seed ); 2593 return results; 2594 } 2595 2596 break; 2597 } 2598 } 2599 } 2600 } 2601 2602 // Compile and execute a filtering function if one is not provided 2603 // Provide `match` to avoid retokenization if we modified the selector above 2604 ( compiled || compile( selector, match ) )( 2605 seed, 2606 context, 2607 !documentIsHTML, 2608 results, 2609 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context 2610 ); 2611 return results; 2612}; 2613 2614// One-time assignments 2615 2616// Sort stability 2617support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; 2618 2619// Support: Chrome 14-35+ 2620// Always assume duplicates if they aren't passed to the comparison function 2621support.detectDuplicates = !!hasDuplicate; 2622 2623// Initialize against the default document 2624setDocument(); 2625 2626// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) 2627// Detached nodes confoundingly follow *each other* 2628support.sortDetached = assert(function( div1 ) { 2629 // Should return 1, but returns 4 (following) 2630 return div1.compareDocumentPosition( document.createElement("div") ) & 1; 2631}); 2632 2633// Support: IE<8 2634// Prevent attribute/property "interpolation" 2635// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx 2636if ( !assert(function( div ) { 2637 div.innerHTML = "<a href='#'></a>"; 2638 return div.firstChild.getAttribute("href") === "#" ; 2639}) ) { 2640 addHandle( "type|href|height|width", function( elem, name, isXML ) { 2641 if ( !isXML ) { 2642 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); 2643 } 2644 }); 2645} 2646 2647// Support: IE<9 2648// Use defaultValue in place of getAttribute("value") 2649if ( !support.attributes || !assert(function( div ) { 2650 div.innerHTML = "<input/>"; 2651 div.firstChild.setAttribute( "value", "" ); 2652 return div.firstChild.getAttribute( "value" ) === ""; 2653}) ) { 2654 addHandle( "value", function( elem, name, isXML ) { 2655 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { 2656 return elem.defaultValue; 2657 } 2658 }); 2659} 2660 2661// Support: IE<9 2662// Use getAttributeNode to fetch booleans when getAttribute lies 2663if ( !assert(function( div ) { 2664 return div.getAttribute("disabled") == null; 2665}) ) { 2666 addHandle( booleans, function( elem, name, isXML ) { 2667 var val; 2668 if ( !isXML ) { 2669 return elem[ name ] === true ? name.toLowerCase() : 2670 (val = elem.getAttributeNode( name )) && val.specified ? 2671 val.value : 2672 null; 2673 } 2674 }); 2675} 2676 2677return Sizzle; 2678 2679})( window ); 2680 2681 2682 2683jQuery.find = Sizzle; 2684jQuery.expr = Sizzle.selectors; 2685jQuery.expr[ ":" ] = jQuery.expr.pseudos; 2686jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; 2687jQuery.text = Sizzle.getText; 2688jQuery.isXMLDoc = Sizzle.isXML; 2689jQuery.contains = Sizzle.contains; 2690 2691 2692 2693var dir = function( elem, dir, until ) { 2694 var matched = [], 2695 truncate = until !== undefined; 2696 2697 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { 2698 if ( elem.nodeType === 1 ) { 2699 if ( truncate && jQuery( elem ).is( until ) ) { 2700 break; 2701 } 2702 matched.push( elem ); 2703 } 2704 } 2705 return matched; 2706}; 2707 2708 2709var siblings = function( n, elem ) { 2710 var matched = []; 2711 2712 for ( ; n; n = n.nextSibling ) { 2713 if ( n.nodeType === 1 && n !== elem ) { 2714 matched.push( n ); 2715 } 2716 } 2717 2718 return matched; 2719}; 2720 2721 2722var rneedsContext = jQuery.expr.match.needsContext; 2723 2724var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ ); 2725 2726 2727 2728var risSimple = /^.[^:#\[\.,]*$/; 2729 2730// Implement the identical functionality for filter and not 2731function winnow( elements, qualifier, not ) { 2732 if ( jQuery.isFunction( qualifier ) ) { 2733 return jQuery.grep( elements, function( elem, i ) { 2734 /* jshint -W018 */ 2735 return !!qualifier.call( elem, i, elem ) !== not; 2736 } ); 2737 2738 } 2739 2740 if ( qualifier.nodeType ) { 2741 return jQuery.grep( elements, function( elem ) { 2742 return ( elem === qualifier ) !== not; 2743 } ); 2744 2745 } 2746 2747 if ( typeof qualifier === "string" ) { 2748 if ( risSimple.test( qualifier ) ) { 2749 return jQuery.filter( qualifier, elements, not ); 2750 } 2751 2752 qualifier = jQuery.filter( qualifier, elements ); 2753 } 2754 2755 return jQuery.grep( elements, function( elem ) { 2756 return ( indexOf.call( qualifier, elem ) > -1 ) !== not; 2757 } ); 2758} 2759 2760jQuery.filter = function( expr, elems, not ) { 2761 var elem = elems[ 0 ]; 2762 2763 if ( not ) { 2764 expr = ":not(" + expr + ")"; 2765 } 2766 2767 return elems.length === 1 && elem.nodeType === 1 ? 2768 jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : 2769 jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { 2770 return elem.nodeType === 1; 2771 } ) ); 2772}; 2773 2774jQuery.fn.extend( { 2775 find: function( selector ) { 2776 var i, 2777 len = this.length, 2778 ret = [], 2779 self = this; 2780 2781 if ( typeof selector !== "string" ) { 2782 return this.pushStack( jQuery( selector ).filter( function() { 2783 for ( i = 0; i < len; i++ ) { 2784 if ( jQuery.contains( self[ i ], this ) ) { 2785 return true; 2786 } 2787 } 2788 } ) ); 2789 } 2790 2791 for ( i = 0; i < len; i++ ) { 2792 jQuery.find( selector, self[ i ], ret ); 2793 } 2794 2795 // Needed because $( selector, context ) becomes $( context ).find( selector ) 2796 ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); 2797 ret.selector = this.selector ? this.selector + " " + selector : selector; 2798 return ret; 2799 }, 2800 filter: function( selector ) { 2801 return this.pushStack( winnow( this, selector || [], false ) ); 2802 }, 2803 not: function( selector ) { 2804 return this.pushStack( winnow( this, selector || [], true ) ); 2805 }, 2806 is: function( selector ) { 2807 return !!winnow( 2808 this, 2809 2810 // If this is a positional/relative selector, check membership in the returned set 2811 // so $("p:first").is("p:last") won't return true for a doc with two "p". 2812 typeof selector === "string" && rneedsContext.test( selector ) ? 2813 jQuery( selector ) : 2814 selector || [], 2815 false 2816 ).length; 2817 } 2818} ); 2819 2820 2821// Initialize a jQuery object 2822 2823 2824// A central reference to the root jQuery(document) 2825var rootjQuery, 2826 2827 // A simple way to check for HTML strings 2828 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) 2829 // Strict HTML recognition (#11290: must start with <) 2830 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, 2831 2832 init = jQuery.fn.init = function( selector, context, root ) { 2833 var match, elem; 2834 2835 // HANDLE: $(""), $(null), $(undefined), $(false) 2836 if ( !selector ) { 2837 return this; 2838 } 2839 2840 // Method init() accepts an alternate rootjQuery 2841 // so migrate can support jQuery.sub (gh-2101) 2842 root = root || rootjQuery; 2843 2844 // Handle HTML strings 2845 if ( typeof selector === "string" ) { 2846 if ( selector[ 0 ] === "<" && 2847 selector[ selector.length - 1 ] === ">" && 2848 selector.length >= 3 ) { 2849 2850 // Assume that strings that start and end with <> are HTML and skip the regex check 2851 match = [ null, selector, null ]; 2852 2853 } else { 2854 match = rquickExpr.exec( selector ); 2855 } 2856 2857 // Match html or make sure no context is specified for #id 2858 if ( match && ( match[ 1 ] || !context ) ) { 2859 2860 // HANDLE: $(html) -> $(array) 2861 if ( match[ 1 ] ) { 2862 context = context instanceof jQuery ? context[ 0 ] : context; 2863 2864 // Option to run scripts is true for back-compat 2865 // Intentionally let the error be thrown if parseHTML is not present 2866 jQuery.merge( this, jQuery.parseHTML( 2867 match[ 1 ], 2868 context && context.nodeType ? context.ownerDocument || context : document, 2869 true 2870 ) ); 2871 2872 // HANDLE: $(html, props) 2873 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { 2874 for ( match in context ) { 2875 2876 // Properties of context are called as methods if possible 2877 if ( jQuery.isFunction( this[ match ] ) ) { 2878 this[ match ]( context[ match ] ); 2879 2880 // ...and otherwise set as attributes 2881 } else { 2882 this.attr( match, context[ match ] ); 2883 } 2884 } 2885 } 2886 2887 return this; 2888 2889 // HANDLE: $(#id) 2890 } else { 2891 elem = document.getElementById( match[ 2 ] ); 2892 2893 // Support: Blackberry 4.6 2894 // gEBID returns nodes no longer in the document (#6963) 2895 if ( elem && elem.parentNode ) { 2896 2897 // Inject the element directly into the jQuery object 2898 this.length = 1; 2899 this[ 0 ] = elem; 2900 } 2901 2902 this.context = document; 2903 this.selector = selector; 2904 return this; 2905 } 2906 2907 // HANDLE: $(expr, $(...)) 2908 } else if ( !context || context.jquery ) { 2909 return ( context || root ).find( selector ); 2910 2911 // HANDLE: $(expr, context) 2912 // (which is just equivalent to: $(context).find(expr) 2913 } else { 2914 return this.constructor( context ).find( selector ); 2915 } 2916 2917 // HANDLE: $(DOMElement) 2918 } else if ( selector.nodeType ) { 2919 this.context = this[ 0 ] = selector; 2920 this.length = 1; 2921 return this; 2922 2923 // HANDLE: $(function) 2924 // Shortcut for document ready 2925 } else if ( jQuery.isFunction( selector ) ) { 2926 return root.ready !== undefined ? 2927 root.ready( selector ) : 2928 2929 // Execute immediately if ready is not present 2930 selector( jQuery ); 2931 } 2932 2933 if ( selector.selector !== undefined ) { 2934 this.selector = selector.selector; 2935 this.context = selector.context; 2936 } 2937 2938 return jQuery.makeArray( selector, this ); 2939 }; 2940 2941// Give the init function the jQuery prototype for later instantiation 2942init.prototype = jQuery.fn; 2943 2944// Initialize central reference 2945rootjQuery = jQuery( document ); 2946 2947 2948var rparentsprev = /^(?:parents|prev(?:Until|All))/, 2949 2950 // Methods guaranteed to produce a unique set when starting from a unique set 2951 guaranteedUnique = { 2952 children: true, 2953 contents: true, 2954 next: true, 2955 prev: true 2956 }; 2957 2958jQuery.fn.extend( { 2959 has: function( target ) { 2960 var targets = jQuery( target, this ), 2961 l = targets.length; 2962 2963 return this.filter( function() { 2964 var i = 0; 2965 for ( ; i < l; i++ ) { 2966 if ( jQuery.contains( this, targets[ i ] ) ) { 2967 return true; 2968 } 2969 } 2970 } ); 2971 }, 2972 2973 closest: function( selectors, context ) { 2974 var cur, 2975 i = 0, 2976 l = this.length, 2977 matched = [], 2978 pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? 2979 jQuery( selectors, context || this.context ) : 2980 0; 2981 2982 for ( ; i < l; i++ ) { 2983 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { 2984 2985 // Always skip document fragments 2986 if ( cur.nodeType < 11 && ( pos ? 2987 pos.index( cur ) > -1 : 2988 2989 // Don't pass non-elements to Sizzle 2990 cur.nodeType === 1 && 2991 jQuery.find.matchesSelector( cur, selectors ) ) ) { 2992 2993 matched.push( cur ); 2994 break; 2995 } 2996 } 2997 } 2998 2999 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); 3000 }, 3001 3002 // Determine the position of an element within the set 3003 index: function( elem ) { 3004 3005 // No argument, return index in parent 3006 if ( !elem ) { 3007 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; 3008 } 3009 3010 // Index in selector 3011 if ( typeof elem === "string" ) { 3012 return indexOf.call( jQuery( elem ), this[ 0 ] ); 3013 } 3014 3015 // Locate the position of the desired element 3016 return indexOf.call( this, 3017 3018 // If it receives a jQuery object, the first element is used 3019 elem.jquery ? elem[ 0 ] : elem 3020 ); 3021 }, 3022 3023 add: function( selector, context ) { 3024 return this.pushStack( 3025 jQuery.uniqueSort( 3026 jQuery.merge( this.get(), jQuery( selector, context ) ) 3027 ) 3028 ); 3029 }, 3030 3031 addBack: function( selector ) { 3032 return this.add( selector == null ? 3033 this.prevObject : this.prevObject.filter( selector ) 3034 ); 3035 } 3036} ); 3037 3038function sibling( cur, dir ) { 3039 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} 3040 return cur; 3041} 3042 3043jQuery.each( { 3044 parent: function( elem ) { 3045 var parent = elem.parentNode; 3046 return parent && parent.nodeType !== 11 ? parent : null; 3047 }, 3048 parents: function( elem ) { 3049 return dir( elem, "parentNode" ); 3050 }, 3051 parentsUntil: function( elem, i, until ) { 3052 return dir( elem, "parentNode", until ); 3053 }, 3054 next: function( elem ) { 3055 return sibling( elem, "nextSibling" ); 3056 }, 3057 prev: function( elem ) { 3058 return sibling( elem, "previousSibling" ); 3059 }, 3060 nextAll: function( elem ) { 3061 return dir( elem, "nextSibling" ); 3062 }, 3063 prevAll: function( elem ) { 3064 return dir( elem, "previousSibling" ); 3065 }, 3066 nextUntil: function( elem, i, until ) { 3067 return dir( elem, "nextSibling", until ); 3068 }, 3069 prevUntil: function( elem, i, until ) { 3070 return dir( elem, "previousSibling", until ); 3071 }, 3072 siblings: function( elem ) { 3073 return siblings( ( elem.parentNode || {} ).firstChild, elem ); 3074 }, 3075 children: function( elem ) { 3076 return siblings( elem.firstChild ); 3077 }, 3078 contents: function( elem ) { 3079 return elem.contentDocument || jQuery.merge( [], elem.childNodes ); 3080 } 3081}, function( name, fn ) { 3082 jQuery.fn[ name ] = function( until, selector ) { 3083 var matched = jQuery.map( this, fn, until ); 3084 3085 if ( name.slice( -5 ) !== "Until" ) { 3086 selector = until; 3087 } 3088 3089 if ( selector && typeof selector === "string" ) { 3090 matched = jQuery.filter( selector, matched ); 3091 } 3092 3093 if ( this.length > 1 ) { 3094 3095 // Remove duplicates 3096 if ( !guaranteedUnique[ name ] ) { 3097 jQuery.uniqueSort( matched ); 3098 } 3099 3100 // Reverse order for parents* and prev-derivatives 3101 if ( rparentsprev.test( name ) ) { 3102 matched.reverse(); 3103 } 3104 } 3105 3106 return this.pushStack( matched ); 3107 }; 3108} ); 3109var rnotwhite = ( /\S+/g ); 3110 3111 3112 3113// Convert String-formatted options into Object-formatted ones 3114function createOptions( options ) { 3115 var object = {}; 3116 jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { 3117 object[ flag ] = true; 3118 } ); 3119 return object; 3120} 3121 3122/* 3123 * Create a callback list using the following parameters: 3124 * 3125 * options: an optional list of space-separated options that will change how 3126 * the callback list behaves or a more traditional option object 3127 * 3128 * By default a callback list will act like an event callback list and can be 3129 * "fired" multiple times. 3130 * 3131 * Possible options: 3132 * 3133 * once: will ensure the callback list can only be fired once (like a Deferred) 3134 * 3135 * memory: will keep track of previous values and will call any callback added 3136 * after the list has been fired right away with the latest "memorized" 3137 * values (like a Deferred) 3138 * 3139 * unique: will ensure a callback can only be added once (no duplicate in the list) 3140 * 3141 * stopOnFalse: interrupt callings when a callback returns false 3142 * 3143 */ 3144jQuery.Callbacks = function( options ) { 3145 3146 // Convert options from String-formatted to Object-formatted if needed 3147 // (we check in cache first) 3148 options = typeof options === "string" ? 3149 createOptions( options ) : 3150 jQuery.extend( {}, options ); 3151 3152 var // Flag to know if list is currently firing 3153 firing, 3154 3155 // Last fire value for non-forgettable lists 3156 memory, 3157 3158 // Flag to know if list was already fired 3159 fired, 3160 3161 // Flag to prevent firing 3162 locked, 3163 3164 // Actual callback list 3165 list = [], 3166 3167 // Queue of execution data for repeatable lists 3168 queue = [], 3169 3170 // Index of currently firing callback (modified by add/remove as needed) 3171 firingIndex = -1, 3172 3173 // Fire callbacks 3174 fire = function() { 3175 3176 // Enforce single-firing 3177 locked = options.once; 3178 3179 // Execute callbacks for all pending executions, 3180 // respecting firingIndex overrides and runtime changes 3181 fired = firing = true; 3182 for ( ; queue.length; firingIndex = -1 ) { 3183 memory = queue.shift(); 3184 while ( ++firingIndex < list.length ) { 3185 3186 // Run callback and check for early termination 3187 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && 3188 options.stopOnFalse ) { 3189 3190 // Jump to end and forget the data so .add doesn't re-fire 3191 firingIndex = list.length; 3192 memory = false; 3193 } 3194 } 3195 } 3196 3197 // Forget the data if we're done with it 3198 if ( !options.memory ) { 3199 memory = false; 3200 } 3201 3202 firing = false; 3203 3204 // Clean up if we're done firing for good 3205 if ( locked ) { 3206 3207 // Keep an empty list if we have data for future add calls 3208 if ( memory ) { 3209 list = []; 3210 3211 // Otherwise, this object is spent 3212 } else { 3213 list = ""; 3214 } 3215 } 3216 }, 3217 3218 // Actual Callbacks object 3219 self = { 3220 3221 // Add a callback or a collection of callbacks to the list 3222 add: function() { 3223 if ( list ) { 3224 3225 // If we have memory from a past run, we should fire after adding 3226 if ( memory && !firing ) { 3227 firingIndex = list.length - 1; 3228 queue.push( memory ); 3229 } 3230 3231 ( function add( args ) { 3232 jQuery.each( args, function( _, arg ) { 3233 if ( jQuery.isFunction( arg ) ) { 3234 if ( !options.unique || !self.has( arg ) ) { 3235 list.push( arg ); 3236 } 3237 } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { 3238 3239 // Inspect recursively 3240 add( arg ); 3241 } 3242 } ); 3243 } )( arguments ); 3244 3245 if ( memory && !firing ) { 3246 fire(); 3247 } 3248 } 3249 return this; 3250 }, 3251 3252 // Remove a callback from the list 3253 remove: function() { 3254 jQuery.each( arguments, function( _, arg ) { 3255 var index; 3256 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { 3257 list.splice( index, 1 ); 3258 3259 // Handle firing indexes 3260 if ( index <= firingIndex ) { 3261 firingIndex--; 3262 } 3263 } 3264 } ); 3265 return this; 3266 }, 3267 3268 // Check if a given callback is in the list. 3269 // If no argument is given, return whether or not list has callbacks attached. 3270 has: function( fn ) { 3271 return fn ? 3272 jQuery.inArray( fn, list ) > -1 : 3273 list.length > 0; 3274 }, 3275 3276 // Remove all callbacks from the list 3277 empty: function() { 3278 if ( list ) { 3279 list = []; 3280 } 3281 return this; 3282 }, 3283 3284 // Disable .fire and .add 3285 // Abort any current/pending executions 3286 // Clear all callbacks and values 3287 disable: function() { 3288 locked = queue = []; 3289 list = memory = ""; 3290 return this; 3291 }, 3292 disabled: function() { 3293 return !list; 3294 }, 3295 3296 // Disable .fire 3297 // Also disable .add unless we have memory (since it would have no effect) 3298 // Abort any pending executions 3299 lock: function() { 3300 locked = queue = []; 3301 if ( !memory ) { 3302 list = memory = ""; 3303 } 3304 return this; 3305 }, 3306 locked: function() { 3307 return !!locked; 3308 }, 3309 3310 // Call all callbacks with the given context and arguments 3311 fireWith: function( context, args ) { 3312 if ( !locked ) { 3313 args = args || []; 3314 args = [ context, args.slice ? args.slice() : args ]; 3315 queue.push( args ); 3316 if ( !firing ) { 3317 fire(); 3318 } 3319 } 3320 return this; 3321 }, 3322 3323 // Call all the callbacks with the given arguments 3324 fire: function() { 3325 self.fireWith( this, arguments ); 3326 return this; 3327 }, 3328 3329 // To know if the callbacks have already been called at least once 3330 fired: function() { 3331 return !!fired; 3332 } 3333 }; 3334 3335 return self; 3336}; 3337 3338 3339jQuery.extend( { 3340 3341 Deferred: function( func ) { 3342 var tuples = [ 3343 3344 // action, add listener, listener list, final state 3345 [ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ], 3346 [ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ], 3347 [ "notify", "progress", jQuery.Callbacks( "memory" ) ] 3348 ], 3349 state = "pending", 3350 promise = { 3351 state: function() { 3352 return state; 3353 }, 3354 always: function() { 3355 deferred.done( arguments ).fail( arguments ); 3356 return this; 3357 }, 3358 then: function( /* fnDone, fnFail, fnProgress */ ) { 3359 var fns = arguments; 3360 return jQuery.Deferred( function( newDefer ) { 3361 jQuery.each( tuples, function( i, tuple ) { 3362 var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; 3363 3364 // deferred[ done | fail | progress ] for forwarding actions to newDefer 3365 deferred[ tuple[ 1 ] ]( function() { 3366 var returned = fn && fn.apply( this, arguments ); 3367 if ( returned && jQuery.isFunction( returned.promise ) ) { 3368 returned.promise() 3369 .progress( newDefer.notify ) 3370 .done( newDefer.resolve ) 3371 .fail( newDefer.reject ); 3372 } else { 3373 newDefer[ tuple[ 0 ] + "With" ]( 3374 this === promise ? newDefer.promise() : this, 3375 fn ? [ returned ] : arguments 3376 ); 3377 } 3378 } ); 3379 } ); 3380 fns = null; 3381 } ).promise(); 3382 }, 3383 3384 // Get a promise for this deferred 3385 // If obj is provided, the promise aspect is added to the object 3386 promise: function( obj ) { 3387 return obj != null ? jQuery.extend( obj, promise ) : promise; 3388 } 3389 }, 3390 deferred = {}; 3391 3392 // Keep pipe for back-compat 3393 promise.pipe = promise.then; 3394 3395 // Add list-specific methods 3396 jQuery.each( tuples, function( i, tuple ) { 3397 var list = tuple[ 2 ], 3398 stateString = tuple[ 3 ]; 3399 3400 // promise[ done | fail | progress ] = list.add 3401 promise[ tuple[ 1 ] ] = list.add; 3402 3403 // Handle state 3404 if ( stateString ) { 3405 list.add( function() { 3406 3407 // state = [ resolved | rejected ] 3408 state = stateString; 3409 3410 // [ reject_list | resolve_list ].disable; progress_list.lock 3411 }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); 3412 } 3413 3414 // deferred[ resolve | reject | notify ] 3415 deferred[ tuple[ 0 ] ] = function() { 3416 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments ); 3417 return this; 3418 }; 3419 deferred[ tuple[ 0 ] + "With" ] = list.fireWith; 3420 } ); 3421 3422 // Make the deferred a promise 3423 promise.promise( deferred ); 3424 3425 // Call given func if any 3426 if ( func ) { 3427 func.call( deferred, deferred ); 3428 } 3429 3430 // All done! 3431 return deferred; 3432 }, 3433 3434 // Deferred helper 3435 when: function( subordinate /* , ..., subordinateN */ ) { 3436 var i = 0, 3437 resolveValues = slice.call( arguments ), 3438 length = resolveValues.length, 3439 3440 // the count of uncompleted subordinates 3441 remaining = length !== 1 || 3442 ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, 3443 3444 // the master Deferred. 3445 // If resolveValues consist of only a single Deferred, just use that. 3446 deferred = remaining === 1 ? subordinate : jQuery.Deferred(), 3447 3448 // Update function for both resolve and progress values 3449 updateFunc = function( i, contexts, values ) { 3450 return function( value ) { 3451 contexts[ i ] = this; 3452 values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; 3453 if ( values === progressValues ) { 3454 deferred.notifyWith( contexts, values ); 3455 } else if ( !( --remaining ) ) { 3456 deferred.resolveWith( contexts, values ); 3457 } 3458 }; 3459 }, 3460 3461 progressValues, progressContexts, resolveContexts; 3462 3463 // Add listeners to Deferred subordinates; treat others as resolved 3464 if ( length > 1 ) { 3465 progressValues = new Array( length ); 3466 progressContexts = new Array( length ); 3467 resolveContexts = new Array( length ); 3468 for ( ; i < length; i++ ) { 3469 if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { 3470 resolveValues[ i ].promise() 3471 .progress( updateFunc( i, progressContexts, progressValues ) ) 3472 .done( updateFunc( i, resolveContexts, resolveValues ) ) 3473 .fail( deferred.reject ); 3474 } else { 3475 --remaining; 3476 } 3477 } 3478 } 3479 3480 // If we're not waiting on anything, resolve the master 3481 if ( !remaining ) { 3482 deferred.resolveWith( resolveContexts, resolveValues ); 3483 } 3484 3485 return deferred.promise(); 3486 } 3487} ); 3488 3489 3490// The deferred used on DOM ready 3491var readyList; 3492 3493jQuery.fn.ready = function( fn ) { 3494 3495 // Add the callback 3496 jQuery.ready.promise().done( fn ); 3497 3498 return this; 3499}; 3500 3501jQuery.extend( { 3502 3503 // Is the DOM ready to be used? Set to true once it occurs. 3504 isReady: false, 3505 3506 // A counter to track how many items to wait for before 3507 // the ready event fires. See #6781 3508 readyWait: 1, 3509 3510 // Hold (or release) the ready event 3511 holdReady: function( hold ) { 3512 if ( hold ) { 3513 jQuery.readyWait++; 3514 } else { 3515 jQuery.ready( true ); 3516 } 3517 }, 3518 3519 // Handle when the DOM is ready 3520 ready: function( wait ) { 3521 3522 // Abort if there are pending holds or we're already ready 3523 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { 3524 return; 3525 } 3526 3527 // Remember that the DOM is ready 3528 jQuery.isReady = true; 3529 3530 // If a normal DOM Ready event fired, decrement, and wait if need be 3531 if ( wait !== true && --jQuery.readyWait > 0 ) { 3532 return; 3533 } 3534 3535 // If there are functions bound, to execute 3536 readyList.resolveWith( document, [ jQuery ] ); 3537 3538 // Trigger any bound ready events 3539 if ( jQuery.fn.triggerHandler ) { 3540 jQuery( document ).triggerHandler( "ready" ); 3541 jQuery( document ).off( "ready" ); 3542 } 3543 } 3544} ); 3545 3546/** 3547 * The ready event handler and self cleanup method 3548 */ 3549function completed() { 3550 document.removeEventListener( "DOMContentLoaded", completed ); 3551 window.removeEventListener( "load", completed ); 3552 jQuery.ready(); 3553} 3554 3555jQuery.ready.promise = function( obj ) { 3556 if ( !readyList ) { 3557 3558 readyList = jQuery.Deferred(); 3559 3560 // Catch cases where $(document).ready() is called 3561 // after the browser event has already occurred. 3562 // Support: IE9-10 only 3563 // Older IE sometimes signals "interactive" too soon 3564 if ( document.readyState === "complete" || 3565 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { 3566 3567 // Handle it asynchronously to allow scripts the opportunity to delay ready 3568 window.setTimeout( jQuery.ready ); 3569 3570 } else { 3571 3572 // Use the handy event callback 3573 document.addEventListener( "DOMContentLoaded", completed ); 3574 3575 // A fallback to window.onload, that will always work 3576 window.addEventListener( "load", completed ); 3577 } 3578 } 3579 return readyList.promise( obj ); 3580}; 3581 3582// Kick off the DOM ready check even if the user does not 3583jQuery.ready.promise(); 3584 3585 3586 3587 3588// Multifunctional method to get and set values of a collection 3589// The value/s can optionally be executed if it's a function 3590var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 3591 var i = 0, 3592 len = elems.length, 3593 bulk = key == null; 3594 3595 // Sets many values 3596 if ( jQuery.type( key ) === "object" ) { 3597 chainable = true; 3598 for ( i in key ) { 3599 access( elems, fn, i, key[ i ], true, emptyGet, raw ); 3600 } 3601 3602 // Sets one value 3603 } else if ( value !== undefined ) { 3604 chainable = true; 3605 3606 if ( !jQuery.isFunction( value ) ) { 3607 raw = true; 3608 } 3609 3610 if ( bulk ) { 3611 3612 // Bulk operations run against the entire set 3613 if ( raw ) { 3614 fn.call( elems, value ); 3615 fn = null; 3616 3617 // ...except when executing function values 3618 } else { 3619 bulk = fn; 3620 fn = function( elem, key, value ) { 3621 return bulk.call( jQuery( elem ), value ); 3622 }; 3623 } 3624 } 3625 3626 if ( fn ) { 3627 for ( ; i < len; i++ ) { 3628 fn( 3629 elems[ i ], key, raw ? 3630 value : 3631 value.call( elems[ i ], i, fn( elems[ i ], key ) ) 3632 ); 3633 } 3634 } 3635 } 3636 3637 return chainable ? 3638 elems : 3639 3640 // Gets 3641 bulk ? 3642 fn.call( elems ) : 3643 len ? fn( elems[ 0 ], key ) : emptyGet; 3644}; 3645var acceptData = function( owner ) { 3646 3647 // Accepts only: 3648 // - Node 3649 // - Node.ELEMENT_NODE 3650 // - Node.DOCUMENT_NODE 3651 // - Object 3652 // - Any 3653 /* jshint -W018 */ 3654 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); 3655}; 3656 3657 3658 3659 3660function Data() { 3661 this.expando = jQuery.expando + Data.uid++; 3662} 3663 3664Data.uid = 1; 3665 3666Data.prototype = { 3667 3668 register: function( owner, initial ) { 3669 var value = initial || {}; 3670 3671 // If it is a node unlikely to be stringify-ed or looped over 3672 // use plain assignment 3673 if ( owner.nodeType ) { 3674 owner[ this.expando ] = value; 3675 3676 // Otherwise secure it in a non-enumerable, non-writable property 3677 // configurability must be true to allow the property to be 3678 // deleted with the delete operator 3679 } else { 3680 Object.defineProperty( owner, this.expando, { 3681 value: value, 3682 writable: true, 3683 configurable: true 3684 } ); 3685 } 3686 return owner[ this.expando ]; 3687 }, 3688 cache: function( owner ) { 3689 3690 // We can accept data for non-element nodes in modern browsers, 3691 // but we should not, see #8335. 3692 // Always return an empty object. 3693 if ( !acceptData( owner ) ) { 3694 return {}; 3695 } 3696 3697 // Check if the owner object already has a cache 3698 var value = owner[ this.expando ]; 3699 3700 // If not, create one 3701 if ( !value ) { 3702 value = {}; 3703 3704 // We can accept data for non-element nodes in modern browsers, 3705 // but we should not, see #8335. 3706 // Always return an empty object. 3707 if ( acceptData( owner ) ) { 3708 3709 // If it is a node unlikely to be stringify-ed or looped over 3710 // use plain assignment 3711 if ( owner.nodeType ) { 3712 owner[ this.expando ] = value; 3713 3714 // Otherwise secure it in a non-enumerable property 3715 // configurable must be true to allow the property to be 3716 // deleted when data is removed 3717 } else { 3718 Object.defineProperty( owner, this.expando, { 3719 value: value, 3720 configurable: true 3721 } ); 3722 } 3723 } 3724 } 3725 3726 return value; 3727 }, 3728 set: function( owner, data, value ) { 3729 var prop, 3730 cache = this.cache( owner ); 3731 3732 // Handle: [ owner, key, value ] args 3733 if ( typeof data === "string" ) { 3734 cache[ data ] = value; 3735 3736 // Handle: [ owner, { properties } ] args 3737 } else { 3738 3739 // Copy the properties one-by-one to the cache object 3740 for ( prop in data ) { 3741 cache[ prop ] = data[ prop ]; 3742 } 3743 } 3744 return cache; 3745 }, 3746 get: function( owner, key ) { 3747 return key === undefined ? 3748 this.cache( owner ) : 3749 owner[ this.expando ] && owner[ this.expando ][ key ]; 3750 }, 3751 access: function( owner, key, value ) { 3752 var stored; 3753 3754 // In cases where either: 3755 // 3756 // 1. No key was specified 3757 // 2. A string key was specified, but no value provided 3758 // 3759 // Take the "read" path and allow the get method to determine 3760 // which value to return, respectively either: 3761 // 3762 // 1. The entire cache object 3763 // 2. The data stored at the key 3764 // 3765 if ( key === undefined || 3766 ( ( key && typeof key === "string" ) && value === undefined ) ) { 3767 3768 stored = this.get( owner, key ); 3769 3770 return stored !== undefined ? 3771 stored : this.get( owner, jQuery.camelCase( key ) ); 3772 } 3773 3774 // When the key is not a string, or both a key and value 3775 // are specified, set or extend (existing objects) with either: 3776 // 3777 // 1. An object of properties 3778 // 2. A key and value 3779 // 3780 this.set( owner, key, value ); 3781 3782 // Since the "set" path can have two possible entry points 3783 // return the expected data based on which path was taken[*] 3784 return value !== undefined ? value : key; 3785 }, 3786 remove: function( owner, key ) { 3787 var i, name, camel, 3788 cache = owner[ this.expando ]; 3789 3790 if ( cache === undefined ) { 3791 return; 3792 } 3793 3794 if ( key === undefined ) { 3795 this.register( owner ); 3796 3797 } else { 3798 3799 // Support array or space separated string of keys 3800 if ( jQuery.isArray( key ) ) { 3801 3802 // If "name" is an array of keys... 3803 // When data is initially created, via ("key", "val") signature, 3804 // keys will be converted to camelCase. 3805 // Since there is no way to tell _how_ a key was added, remove 3806 // both plain key and camelCase key. #12786 3807 // This will only penalize the array argument path. 3808 name = key.concat( key.map( jQuery.camelCase ) ); 3809 } else { 3810 camel = jQuery.camelCase( key ); 3811 3812 // Try the string as a key before any manipulation 3813 if ( key in cache ) { 3814 name = [ key, camel ]; 3815 } else { 3816 3817 // If a key with the spaces exists, use it. 3818 // Otherwise, create an array by matching non-whitespace 3819 name = camel; 3820 name = name in cache ? 3821 [ name ] : ( name.match( rnotwhite ) || [] ); 3822 } 3823 } 3824 3825 i = name.length; 3826 3827 while ( i-- ) { 3828 delete cache[ name[ i ] ]; 3829 } 3830 } 3831 3832 // Remove the expando if there's no more data 3833 if ( key === undefined || jQuery.isEmptyObject( cache ) ) { 3834 3835 // Support: Chrome <= 35-45+ 3836 // Webkit & Blink performance suffers when deleting properties 3837 // from DOM nodes, so set to undefined instead 3838 // https://code.google.com/p/chromium/issues/detail?id=378607 3839 if ( owner.nodeType ) { 3840 owner[ this.expando ] = undefined; 3841 } else { 3842 delete owner[ this.expando ]; 3843 } 3844 } 3845 }, 3846 hasData: function( owner ) { 3847 var cache = owner[ this.expando ]; 3848 return cache !== undefined && !jQuery.isEmptyObject( cache ); 3849 } 3850}; 3851var dataPriv = new Data(); 3852 3853var dataUser = new Data(); 3854 3855 3856 3857// Implementation Summary 3858// 3859// 1. Enforce API surface and semantic compatibility with 1.9.x branch 3860// 2. Improve the module's maintainability by reducing the storage 3861// paths to a single mechanism. 3862// 3. Use the same single mechanism to support "private" and "user" data. 3863// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) 3864// 5. Avoid exposing implementation details on user objects (eg. expando properties) 3865// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 3866 3867var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 3868 rmultiDash = /[A-Z]/g; 3869 3870function dataAttr( elem, key, data ) { 3871 var name; 3872 3873 // If nothing was found internally, try to fetch any 3874 // data from the HTML5 data-* attribute 3875 if ( data === undefined && elem.nodeType === 1 ) { 3876 name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); 3877 data = elem.getAttribute( name ); 3878 3879 if ( typeof data === "string" ) { 3880 try { 3881 data = data === "true" ? true : 3882 data === "false" ? false : 3883 data === "null" ? null : 3884 3885 // Only convert to a number if it doesn't change the string 3886 +data + "" === data ? +data : 3887 rbrace.test( data ) ? jQuery.parseJSON( data ) : 3888 data; 3889 } catch ( e ) {} 3890 3891 // Make sure we set the data so it isn't changed later 3892 dataUser.set( elem, key, data ); 3893 } else { 3894 data = undefined; 3895 } 3896 } 3897 return data; 3898} 3899 3900jQuery.extend( { 3901 hasData: function( elem ) { 3902 return dataUser.hasData( elem ) || dataPriv.hasData( elem ); 3903 }, 3904 3905 data: function( elem, name, data ) { 3906 return dataUser.access( elem, name, data ); 3907 }, 3908 3909 removeData: function( elem, name ) { 3910 dataUser.remove( elem, name ); 3911 }, 3912 3913 // TODO: Now that all calls to _data and _removeData have been replaced 3914 // with direct calls to dataPriv methods, these can be deprecated. 3915 _data: function( elem, name, data ) { 3916 return dataPriv.access( elem, name, data ); 3917 }, 3918 3919 _removeData: function( elem, name ) { 3920 dataPriv.remove( elem, name ); 3921 } 3922} ); 3923 3924jQuery.fn.extend( { 3925 data: function( key, value ) { 3926 var i, name, data, 3927 elem = this[ 0 ], 3928 attrs = elem && elem.attributes; 3929 3930 // Gets all values 3931 if ( key === undefined ) { 3932 if ( this.length ) { 3933 data = dataUser.get( elem ); 3934 3935 if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { 3936 i = attrs.length; 3937 while ( i-- ) { 3938 3939 // Support: IE11+ 3940 // The attrs elements can be null (#14894) 3941 if ( attrs[ i ] ) { 3942 name = attrs[ i ].name; 3943 if ( name.indexOf( "data-" ) === 0 ) { 3944 name = jQuery.camelCase( name.slice( 5 ) ); 3945 dataAttr( elem, name, data[ name ] ); 3946 } 3947 } 3948 } 3949 dataPriv.set( elem, "hasDataAttrs", true ); 3950 } 3951 } 3952 3953 return data; 3954 } 3955 3956 // Sets multiple values 3957 if ( typeof key === "object" ) { 3958 return this.each( function() { 3959 dataUser.set( this, key ); 3960 } ); 3961 } 3962 3963 return access( this, function( value ) { 3964 var data, camelKey; 3965 3966 // The calling jQuery object (element matches) is not empty 3967 // (and therefore has an element appears at this[ 0 ]) and the 3968 // `value` parameter was not undefined. An empty jQuery object 3969 // will result in `undefined` for elem = this[ 0 ] which will 3970 // throw an exception if an attempt to read a data cache is made. 3971 if ( elem && value === undefined ) { 3972 3973 // Attempt to get data from the cache 3974 // with the key as-is 3975 data = dataUser.get( elem, key ) || 3976 3977 // Try to find dashed key if it exists (gh-2779) 3978 // This is for 2.2.x only 3979 dataUser.get( elem, key.replace( rmultiDash, "-$&" ).toLowerCase() ); 3980 3981 if ( data !== undefined ) { 3982 return data; 3983 } 3984 3985 camelKey = jQuery.camelCase( key ); 3986 3987 // Attempt to get data from the cache 3988 // with the key camelized 3989 data = dataUser.get( elem, camelKey ); 3990 if ( data !== undefined ) { 3991 return data; 3992 } 3993 3994 // Attempt to "discover" the data in 3995 // HTML5 custom data-* attrs 3996 data = dataAttr( elem, camelKey, undefined ); 3997 if ( data !== undefined ) { 3998 return data; 3999 } 4000 4001 // We tried really hard, but the data doesn't exist. 4002 return; 4003 } 4004 4005 // Set the data... 4006 camelKey = jQuery.camelCase( key ); 4007 this.each( function() { 4008 4009 // First, attempt to store a copy or reference of any 4010 // data that might've been store with a camelCased key. 4011 var data = dataUser.get( this, camelKey ); 4012 4013 // For HTML5 data-* attribute interop, we have to 4014 // store property names with dashes in a camelCase form. 4015 // This might not apply to all properties...* 4016 dataUser.set( this, camelKey, value ); 4017 4018 // *... In the case of properties that might _actually_ 4019 // have dashes, we need to also store a copy of that 4020 // unchanged property. 4021 if ( key.indexOf( "-" ) > -1 && data !== undefined ) { 4022 dataUser.set( this, key, value ); 4023 } 4024 } ); 4025 }, null, value, arguments.length > 1, null, true ); 4026 }, 4027 4028 removeData: function( key ) { 4029 return this.each( function() { 4030 dataUser.remove( this, key ); 4031 } ); 4032 } 4033} ); 4034 4035 4036jQuery.extend( { 4037 queue: function( elem, type, data ) { 4038 var queue; 4039 4040 if ( elem ) { 4041 type = ( type || "fx" ) + "queue"; 4042 queue = dataPriv.get( elem, type ); 4043 4044 // Speed up dequeue by getting out quickly if this is just a lookup 4045 if ( data ) { 4046 if ( !queue || jQuery.isArray( data ) ) { 4047 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); 4048 } else { 4049 queue.push( data ); 4050 } 4051 } 4052 return queue || []; 4053 } 4054 }, 4055 4056 dequeue: function( elem, type ) { 4057 type = type || "fx"; 4058 4059 var queue = jQuery.queue( elem, type ), 4060 startLength = queue.length, 4061 fn = queue.shift(), 4062 hooks = jQuery._queueHooks( elem, type ), 4063 next = function() { 4064 jQuery.dequeue( elem, type ); 4065 }; 4066 4067 // If the fx queue is dequeued, always remove the progress sentinel 4068 if ( fn === "inprogress" ) { 4069 fn = queue.shift(); 4070 startLength--; 4071 } 4072 4073 if ( fn ) { 4074 4075 // Add a progress sentinel to prevent the fx queue from being 4076 // automatically dequeued 4077 if ( type === "fx" ) { 4078 queue.unshift( "inprogress" ); 4079 } 4080 4081 // Clear up the last queue stop function 4082 delete hooks.stop; 4083 fn.call( elem, next, hooks ); 4084 } 4085 4086 if ( !startLength && hooks ) { 4087 hooks.empty.fire(); 4088 } 4089 }, 4090 4091 // Not public - generate a queueHooks object, or return the current one 4092 _queueHooks: function( elem, type ) { 4093 var key = type + "queueHooks"; 4094 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { 4095 empty: jQuery.Callbacks( "once memory" ).add( function() { 4096 dataPriv.remove( elem, [ type + "queue", key ] ); 4097 } ) 4098 } ); 4099 } 4100} ); 4101 4102jQuery.fn.extend( { 4103 queue: function( type, data ) { 4104 var setter = 2; 4105 4106 if ( typeof type !== "string" ) { 4107 data = type; 4108 type = "fx"; 4109 setter--; 4110 } 4111 4112 if ( arguments.length < setter ) { 4113 return jQuery.queue( this[ 0 ], type ); 4114 } 4115 4116 return data === undefined ? 4117 this : 4118 this.each( function() { 4119 var queue = jQuery.queue( this, type, data ); 4120 4121 // Ensure a hooks for this queue 4122 jQuery._queueHooks( this, type ); 4123 4124 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { 4125 jQuery.dequeue( this, type ); 4126 } 4127 } ); 4128 }, 4129 dequeue: function( type ) { 4130 return this.each( function() { 4131 jQuery.dequeue( this, type ); 4132 } ); 4133 }, 4134 clearQueue: function( type ) { 4135 return this.queue( type || "fx", [] ); 4136 }, 4137 4138 // Get a promise resolved when queues of a certain type 4139 // are emptied (fx is the type by default) 4140 promise: function( type, obj ) { 4141 var tmp, 4142 count = 1, 4143 defer = jQuery.Deferred(), 4144 elements = this, 4145 i = this.length, 4146 resolve = function() { 4147 if ( !( --count ) ) { 4148 defer.resolveWith( elements, [ elements ] ); 4149 } 4150 }; 4151 4152 if ( typeof type !== "string" ) { 4153 obj = type; 4154 type = undefined; 4155 } 4156 type = type || "fx"; 4157 4158 while ( i-- ) { 4159 tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); 4160 if ( tmp && tmp.empty ) { 4161 count++; 4162 tmp.empty.add( resolve ); 4163 } 4164 } 4165 resolve(); 4166 return defer.promise( obj ); 4167 } 4168} ); 4169var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; 4170 4171var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); 4172 4173 4174var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; 4175 4176var isHidden = function( elem, el ) { 4177 4178 // isHidden might be called from jQuery#filter function; 4179 // in that case, element will be second argument 4180 elem = el || elem; 4181 return jQuery.css( elem, "display" ) === "none" || 4182 !jQuery.contains( elem.ownerDocument, elem ); 4183 }; 4184 4185 4186 4187function adjustCSS( elem, prop, valueParts, tween ) { 4188 var adjusted, 4189 scale = 1, 4190 maxIterations = 20, 4191 currentValue = tween ? 4192 function() { return tween.cur(); } : 4193 function() { return jQuery.css( elem, prop, "" ); }, 4194 initial = currentValue(), 4195 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), 4196 4197 // Starting value computation is required for potential unit mismatches 4198 initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && 4199 rcssNum.exec( jQuery.css( elem, prop ) ); 4200 4201 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { 4202 4203 // Trust units reported by jQuery.css 4204 unit = unit || initialInUnit[ 3 ]; 4205 4206 // Make sure we update the tween properties later on 4207 valueParts = valueParts || []; 4208 4209 // Iteratively approximate from a nonzero starting point 4210 initialInUnit = +initial || 1; 4211 4212 do { 4213 4214 // If previous iteration zeroed out, double until we get *something*. 4215 // Use string for doubling so we don't accidentally see scale as unchanged below 4216 scale = scale || ".5"; 4217 4218 // Adjust and apply 4219 initialInUnit = initialInUnit / scale; 4220 jQuery.style( elem, prop, initialInUnit + unit ); 4221 4222 // Update scale, tolerating zero or NaN from tween.cur() 4223 // Break the loop if scale is unchanged or perfect, or if we've just had enough. 4224 } while ( 4225 scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations 4226 ); 4227 } 4228 4229 if ( valueParts ) { 4230 initialInUnit = +initialInUnit || +initial || 0; 4231 4232 // Apply relative offset (+=/-=) if specified 4233 adjusted = valueParts[ 1 ] ? 4234 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : 4235 +valueParts[ 2 ]; 4236 if ( tween ) { 4237 tween.unit = unit; 4238 tween.start = initialInUnit; 4239 tween.end = adjusted; 4240 } 4241 } 4242 return adjusted; 4243} 4244var rcheckableType = ( /^(?:checkbox|radio)$/i ); 4245 4246var rtagName = ( /<([\w:-]+)/ ); 4247 4248var rscriptType = ( /^$|\/(?:java|ecma)script/i ); 4249 4250 4251 4252// We have to close these tags to support XHTML (#13200) 4253var wrapMap = { 4254 4255 // Support: IE9 4256 option: [ 1, "<select multiple='multiple'>", "</select>" ], 4257 4258 // XHTML parsers do not magically insert elements in the 4259 // same way that tag soup parsers do. So we cannot shorten 4260 // this by omitting <tbody> or other required elements. 4261 thead: [ 1, "<table>", "</table>" ], 4262 col: [ 2, "<table><colgroup>", "</colgroup></table>" ], 4263 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 4264 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 4265 4266 _default: [ 0, "", "" ] 4267}; 4268 4269// Support: IE9 4270wrapMap.optgroup = wrapMap.option; 4271 4272wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 4273wrapMap.th = wrapMap.td; 4274 4275 4276function getAll( context, tag ) { 4277 4278 // Support: IE9-11+ 4279 // Use typeof to avoid zero-argument method invocation on host objects (#15151) 4280 var ret = typeof context.getElementsByTagName !== "undefined" ? 4281 context.getElementsByTagName( tag || "*" ) : 4282 typeof context.querySelectorAll !== "undefined" ? 4283 context.querySelectorAll( tag || "*" ) : 4284 []; 4285 4286 return tag === undefined || tag && jQuery.nodeName( context, tag ) ? 4287 jQuery.merge( [ context ], ret ) : 4288 ret; 4289} 4290 4291 4292// Mark scripts as having already been evaluated 4293function setGlobalEval( elems, refElements ) { 4294 var i = 0, 4295 l = elems.length; 4296 4297 for ( ; i < l; i++ ) { 4298 dataPriv.set( 4299 elems[ i ], 4300 "globalEval", 4301 !refElements || dataPriv.get( refElements[ i ], "globalEval" ) 4302 ); 4303 } 4304} 4305 4306 4307var rhtml = /<|&#?\w+;/; 4308 4309function buildFragment( elems, context, scripts, selection, ignored ) { 4310 var elem, tmp, tag, wrap, contains, j, 4311 fragment = context.createDocumentFragment(), 4312 nodes = [], 4313 i = 0, 4314 l = elems.length; 4315 4316 for ( ; i < l; i++ ) { 4317 elem = elems[ i ]; 4318 4319 if ( elem || elem === 0 ) { 4320 4321 // Add nodes directly 4322 if ( jQuery.type( elem ) === "object" ) { 4323 4324 // Support: Android<4.1, PhantomJS<2 4325 // push.apply(_, arraylike) throws on ancient WebKit 4326 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 4327 4328 // Convert non-html into a text node 4329 } else if ( !rhtml.test( elem ) ) { 4330 nodes.push( context.createTextNode( elem ) ); 4331 4332 // Convert html into DOM nodes 4333 } else { 4334 tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); 4335 4336 // Deserialize a standard representation 4337 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); 4338 wrap = wrapMap[ tag ] || wrapMap._default; 4339 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; 4340 4341 // Descend through wrappers to the right content 4342 j = wrap[ 0 ]; 4343 while ( j-- ) { 4344 tmp = tmp.lastChild; 4345 } 4346 4347 // Support: Android<4.1, PhantomJS<2 4348 // push.apply(_, arraylike) throws on ancient WebKit 4349 jQuery.merge( nodes, tmp.childNodes ); 4350 4351 // Remember the top-level container 4352 tmp = fragment.firstChild; 4353 4354 // Ensure the created nodes are orphaned (#12392) 4355 tmp.textContent = ""; 4356 } 4357 } 4358 } 4359 4360 // Remove wrapper from fragment 4361 fragment.textContent = ""; 4362 4363 i = 0; 4364 while ( ( elem = nodes[ i++ ] ) ) { 4365 4366 // Skip elements already in the context collection (trac-4087) 4367 if ( selection && jQuery.inArray( elem, selection ) > -1 ) { 4368 if ( ignored ) { 4369 ignored.push( elem ); 4370 } 4371 continue; 4372 } 4373 4374 contains = jQuery.contains( elem.ownerDocument, elem ); 4375 4376 // Append to fragment 4377 tmp = getAll( fragment.appendChild( elem ), "script" ); 4378 4379 // Preserve script evaluation history 4380 if ( contains ) { 4381 setGlobalEval( tmp ); 4382 } 4383 4384 // Capture executables 4385 if ( scripts ) { 4386 j = 0; 4387 while ( ( elem = tmp[ j++ ] ) ) { 4388 if ( rscriptType.test( elem.type || "" ) ) { 4389 scripts.push( elem ); 4390 } 4391 } 4392 } 4393 } 4394 4395 return fragment; 4396} 4397 4398 4399( function() { 4400 var fragment = document.createDocumentFragment(), 4401 div = fragment.appendChild( document.createElement( "div" ) ), 4402 input = document.createElement( "input" ); 4403 4404 // Support: Android 4.0-4.3, Safari<=5.1 4405 // Check state lost if the name is set (#11217) 4406 // Support: Windows Web Apps (WWA) 4407 // `name` and `type` must use .setAttribute for WWA (#14901) 4408 input.setAttribute( "type", "radio" ); 4409 input.setAttribute( "checked", "checked" ); 4410 input.setAttribute( "name", "t" ); 4411 4412 div.appendChild( input ); 4413 4414 // Support: Safari<=5.1, Android<4.2 4415 // Older WebKit doesn't clone checked state correctly in fragments 4416 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; 4417 4418 // Support: IE<=11+ 4419 // Make sure textarea (and checkbox) defaultValue is properly cloned 4420 div.innerHTML = "<textarea>x</textarea>"; 4421 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 4422} )(); 4423 4424 4425var 4426 rkeyEvent = /^key/, 4427 rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, 4428 rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 4429 4430function returnTrue() { 4431 return true; 4432} 4433 4434function returnFalse() { 4435 return false; 4436} 4437 4438// Support: IE9 4439// See #13393 for more info 4440function safeActiveElement() { 4441 try { 4442 return document.activeElement; 4443 } catch ( err ) { } 4444} 4445 4446function on( elem, types, selector, data, fn, one ) { 4447 var origFn, type; 4448 4449 // Types can be a map of types/handlers 4450 if ( typeof types === "object" ) { 4451 4452 // ( types-Object, selector, data ) 4453 if ( typeof selector !== "string" ) { 4454 4455 // ( types-Object, data ) 4456 data = data || selector; 4457 selector = undefined; 4458 } 4459 for ( type in types ) { 4460 on( elem, type, selector, data, types[ type ], one ); 4461 } 4462 return elem; 4463 } 4464 4465 if ( data == null && fn == null ) { 4466 4467 // ( types, fn ) 4468 fn = selector; 4469 data = selector = undefined; 4470 } else if ( fn == null ) { 4471 if ( typeof selector === "string" ) { 4472 4473 // ( types, selector, fn ) 4474 fn = data; 4475 data = undefined; 4476 } else { 4477 4478 // ( types, data, fn ) 4479 fn = data; 4480 data = selector; 4481 selector = undefined; 4482 } 4483 } 4484 if ( fn === false ) { 4485 fn = returnFalse; 4486 } else if ( !fn ) { 4487 return elem; 4488 } 4489 4490 if ( one === 1 ) { 4491 origFn = fn; 4492 fn = function( event ) { 4493 4494 // Can use an empty set, since event contains the info 4495 jQuery().off( event ); 4496 return origFn.apply( this, arguments ); 4497 }; 4498 4499 // Use same guid so caller can remove using origFn 4500 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); 4501 } 4502 return elem.each( function() { 4503 jQuery.event.add( this, types, fn, data, selector ); 4504 } ); 4505} 4506 4507/* 4508 * Helper functions for managing events -- not part of the public interface. 4509 * Props to Dean Edwards' addEvent library for many of the ideas. 4510 */ 4511jQuery.event = { 4512 4513 global: {}, 4514 4515 add: function( elem, types, handler, data, selector ) { 4516 4517 var handleObjIn, eventHandle, tmp, 4518 events, t, handleObj, 4519 special, handlers, type, namespaces, origType, 4520 elemData = dataPriv.get( elem ); 4521 4522 // Don't attach events to noData or text/comment nodes (but allow plain objects) 4523 if ( !elemData ) { 4524 return; 4525 } 4526 4527 // Caller can pass in an object of custom data in lieu of the handler 4528 if ( handler.handler ) { 4529 handleObjIn = handler; 4530 handler = handleObjIn.handler; 4531 selector = handleObjIn.selector; 4532 } 4533 4534 // Make sure that the handler has a unique ID, used to find/remove it later 4535 if ( !handler.guid ) { 4536 handler.guid = jQuery.guid++; 4537 } 4538 4539 // Init the element's event structure and main handler, if this is the first 4540 if ( !( events = elemData.events ) ) { 4541 events = elemData.events = {}; 4542 } 4543 if ( !( eventHandle = elemData.handle ) ) { 4544 eventHandle = elemData.handle = function( e ) { 4545 4546 // Discard the second event of a jQuery.event.trigger() and 4547 // when an event is called after a page has unloaded 4548 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? 4549 jQuery.event.dispatch.apply( elem, arguments ) : undefined; 4550 }; 4551 } 4552 4553 // Handle multiple events separated by a space 4554 types = ( types || "" ).match( rnotwhite ) || [ "" ]; 4555 t = types.length; 4556 while ( t-- ) { 4557 tmp = rtypenamespace.exec( types[ t ] ) || []; 4558 type = origType = tmp[ 1 ]; 4559 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 4560 4561 // There *must* be a type, no attaching namespace-only handlers 4562 if ( !type ) { 4563 continue; 4564 } 4565 4566 // If event changes its type, use the special event handlers for the changed type 4567 special = jQuery.event.special[ type ] || {}; 4568 4569 // If selector defined, determine special event api type, otherwise given type 4570 type = ( selector ? special.delegateType : special.bindType ) || type; 4571 4572 // Update special based on newly reset type 4573 special = jQuery.event.special[ type ] || {}; 4574 4575 // handleObj is passed to all event handlers 4576 handleObj = jQuery.extend( { 4577 type: type, 4578 origType: origType, 4579 data: data, 4580 handler: handler, 4581 guid: handler.guid, 4582 selector: selector, 4583 needsContext: selector && jQuery.expr.match.needsContext.test( selector ), 4584 namespace: namespaces.join( "." ) 4585 }, handleObjIn ); 4586 4587 // Init the event handler queue if we're the first 4588 if ( !( handlers = events[ type ] ) ) { 4589 handlers = events[ type ] = []; 4590 handlers.delegateCount = 0; 4591 4592 // Only use addEventListener if the special events handler returns false 4593 if ( !special.setup || 4594 special.setup.call( elem, data, namespaces, eventHandle ) === false ) { 4595 4596 if ( elem.addEventListener ) { 4597 elem.addEventListener( type, eventHandle ); 4598 } 4599 } 4600 } 4601 4602 if ( special.add ) { 4603 special.add.call( elem, handleObj ); 4604 4605 if ( !handleObj.handler.guid ) { 4606 handleObj.handler.guid = handler.guid; 4607 } 4608 } 4609 4610 // Add to the element's handler list, delegates in front 4611 if ( selector ) { 4612 handlers.splice( handlers.delegateCount++, 0, handleObj ); 4613 } else { 4614 handlers.push( handleObj ); 4615 } 4616 4617 // Keep track of which events have ever been used, for event optimization 4618 jQuery.event.global[ type ] = true; 4619 } 4620 4621 }, 4622 4623 // Detach an event or set of events from an element 4624 remove: function( elem, types, handler, selector, mappedTypes ) { 4625 4626 var j, origCount, tmp, 4627 events, t, handleObj, 4628 special, handlers, type, namespaces, origType, 4629 elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); 4630 4631 if ( !elemData || !( events = elemData.events ) ) { 4632 return; 4633 } 4634 4635 // Once for each type.namespace in types; type may be omitted 4636 types = ( types || "" ).match( rnotwhite ) || [ "" ]; 4637 t = types.length; 4638 while ( t-- ) { 4639 tmp = rtypenamespace.exec( types[ t ] ) || []; 4640 type = origType = tmp[ 1 ]; 4641 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 4642 4643 // Unbind all events (on this namespace, if provided) for the element 4644 if ( !type ) { 4645 for ( type in events ) { 4646 jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); 4647 } 4648 continue; 4649 } 4650 4651 special = jQuery.event.special[ type ] || {}; 4652 type = ( selector ? special.delegateType : special.bindType ) || type; 4653 handlers = events[ type ] || []; 4654 tmp = tmp[ 2 ] && 4655 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); 4656 4657 // Remove matching events 4658 origCount = j = handlers.length; 4659 while ( j-- ) { 4660 handleObj = handlers[ j ]; 4661 4662 if ( ( mappedTypes || origType === handleObj.origType ) && 4663 ( !handler || handler.guid === handleObj.guid ) && 4664 ( !tmp || tmp.test( handleObj.namespace ) ) && 4665 ( !selector || selector === handleObj.selector || 4666 selector === "**" && handleObj.selector ) ) { 4667 handlers.splice( j, 1 ); 4668 4669 if ( handleObj.selector ) { 4670 handlers.delegateCount--; 4671 } 4672 if ( special.remove ) { 4673 special.remove.call( elem, handleObj ); 4674 } 4675 } 4676 } 4677 4678 // Remove generic event handler if we removed something and no more handlers exist 4679 // (avoids potential for endless recursion during removal of special event handlers) 4680 if ( origCount && !handlers.length ) { 4681 if ( !special.teardown || 4682 special.teardown.call( elem, namespaces, elemData.handle ) === false ) { 4683 4684 jQuery.removeEvent( elem, type, elemData.handle ); 4685 } 4686 4687 delete events[ type ]; 4688 } 4689 } 4690 4691 // Remove data and the expando if it's no longer used 4692 if ( jQuery.isEmptyObject( events ) ) { 4693 dataPriv.remove( elem, "handle events" ); 4694 } 4695 }, 4696 4697 dispatch: function( event ) { 4698 4699 // Make a writable jQuery.Event from the native event object 4700 event = jQuery.event.fix( event ); 4701 4702 var i, j, ret, matched, handleObj, 4703 handlerQueue = [], 4704 args = slice.call( arguments ), 4705 handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [], 4706 special = jQuery.event.special[ event.type ] || {}; 4707 4708 // Use the fix-ed jQuery.Event rather than the (read-only) native event 4709 args[ 0 ] = event; 4710 event.delegateTarget = this; 4711 4712 // Call the preDispatch hook for the mapped type, and let it bail if desired 4713 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { 4714 return; 4715 } 4716 4717 // Determine handlers 4718 handlerQueue = jQuery.event.handlers.call( this, event, handlers ); 4719 4720 // Run delegates first; they may want to stop propagation beneath us 4721 i = 0; 4722 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { 4723 event.currentTarget = matched.elem; 4724 4725 j = 0; 4726 while ( ( handleObj = matched.handlers[ j++ ] ) && 4727 !event.isImmediatePropagationStopped() ) { 4728 4729 // Triggered event must either 1) have no namespace, or 2) have namespace(s) 4730 // a subset or equal to those in the bound event (both can have no namespace). 4731 if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { 4732 4733 event.handleObj = handleObj; 4734 event.data = handleObj.data; 4735 4736 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || 4737 handleObj.handler ).apply( matched.elem, args ); 4738 4739 if ( ret !== undefined ) { 4740 if ( ( event.result = ret ) === false ) { 4741 event.preventDefault(); 4742 event.stopPropagation(); 4743 } 4744 } 4745 } 4746 } 4747 } 4748 4749 // Call the postDispatch hook for the mapped type 4750 if ( special.postDispatch ) { 4751 special.postDispatch.call( this, event ); 4752 } 4753 4754 return event.result; 4755 }, 4756 4757 handlers: function( event, handlers ) { 4758 var i, matches, sel, handleObj, 4759 handlerQueue = [], 4760 delegateCount = handlers.delegateCount, 4761 cur = event.target; 4762 4763 // Support (at least): Chrome, IE9 4764 // Find delegate handlers 4765 // Black-hole SVG <use> instance trees (#13180) 4766 // 4767 // Support: Firefox<=42+ 4768 // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343) 4769 if ( delegateCount && cur.nodeType && 4770 ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) { 4771 4772 for ( ; cur !== this; cur = cur.parentNode || this ) { 4773 4774 // Don't check non-elements (#13208) 4775 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) 4776 if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) { 4777 matches = []; 4778 for ( i = 0; i < delegateCount; i++ ) { 4779 handleObj = handlers[ i ]; 4780 4781 // Don't conflict with Object.prototype properties (#13203) 4782 sel = handleObj.selector + " "; 4783 4784 if ( matches[ sel ] === undefined ) { 4785 matches[ sel ] = handleObj.needsContext ? 4786 jQuery( sel, this ).index( cur ) > -1 : 4787 jQuery.find( sel, this, null, [ cur ] ).length; 4788 } 4789 if ( matches[ sel ] ) { 4790 matches.push( handleObj ); 4791 } 4792 } 4793 if ( matches.length ) { 4794 handlerQueue.push( { elem: cur, handlers: matches } ); 4795 } 4796 } 4797 } 4798 } 4799 4800 // Add the remaining (directly-bound) handlers 4801 if ( delegateCount < handlers.length ) { 4802 handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } ); 4803 } 4804 4805 return handlerQueue; 4806 }, 4807 4808 // Includes some event props shared by KeyEvent and MouseEvent 4809 props: ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " + 4810 "metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ), 4811 4812 fixHooks: {}, 4813 4814 keyHooks: { 4815 props: "char charCode key keyCode".split( " " ), 4816 filter: function( event, original ) { 4817 4818 // Add which for key events 4819 if ( event.which == null ) { 4820 event.which = original.charCode != null ? original.charCode : original.keyCode; 4821 } 4822 4823 return event; 4824 } 4825 }, 4826 4827 mouseHooks: { 4828 props: ( "button buttons clientX clientY offsetX offsetY pageX pageY " + 4829 "screenX screenY toElement" ).split( " " ), 4830 filter: function( event, original ) { 4831 var eventDoc, doc, body, 4832 button = original.button; 4833 4834 // Calculate pageX/Y if missing and clientX/Y available 4835 if ( event.pageX == null && original.clientX != null ) { 4836 eventDoc = event.target.ownerDocument || document; 4837 doc = eventDoc.documentElement; 4838 body = eventDoc.body; 4839 4840 event.pageX = original.clientX + 4841 ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - 4842 ( doc && doc.clientLeft || body && body.clientLeft || 0 ); 4843 event.pageY = original.clientY + 4844 ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - 4845 ( doc && doc.clientTop || body && body.clientTop || 0 ); 4846 } 4847 4848 // Add which for click: 1 === left; 2 === middle; 3 === right 4849 // Note: button is not normalized, so don't use it 4850 if ( !event.which && button !== undefined ) { 4851 event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); 4852 } 4853 4854 return event; 4855 } 4856 }, 4857 4858 fix: function( event ) { 4859 if ( event[ jQuery.expando ] ) { 4860 return event; 4861 } 4862 4863 // Create a writable copy of the event object and normalize some properties 4864 var i, prop, copy, 4865 type = event.type, 4866 originalEvent = event, 4867 fixHook = this.fixHooks[ type ]; 4868 4869 if ( !fixHook ) { 4870 this.fixHooks[ type ] = fixHook = 4871 rmouseEvent.test( type ) ? this.mouseHooks : 4872 rkeyEvent.test( type ) ? this.keyHooks : 4873 {}; 4874 } 4875 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; 4876 4877 event = new jQuery.Event( originalEvent ); 4878 4879 i = copy.length; 4880 while ( i-- ) { 4881 prop = copy[ i ]; 4882 event[ prop ] = originalEvent[ prop ]; 4883 } 4884 4885 // Support: Cordova 2.5 (WebKit) (#13255) 4886 // All events should have a target; Cordova deviceready doesn't 4887 if ( !event.target ) { 4888 event.target = document; 4889 } 4890 4891 // Support: Safari 6.0+, Chrome<28 4892 // Target should not be a text node (#504, #13143) 4893 if ( event.target.nodeType === 3 ) { 4894 event.target = event.target.parentNode; 4895 } 4896 4897 return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; 4898 }, 4899 4900 special: { 4901 load: { 4902 4903 // Prevent triggered image.load events from bubbling to window.load 4904 noBubble: true 4905 }, 4906 focus: { 4907 4908 // Fire native event if possible so blur/focus sequence is correct 4909 trigger: function() { 4910 if ( this !== safeActiveElement() && this.focus ) { 4911 this.focus(); 4912 return false; 4913 } 4914 }, 4915 delegateType: "focusin" 4916 }, 4917 blur: { 4918 trigger: function() { 4919 if ( this === safeActiveElement() && this.blur ) { 4920 this.blur(); 4921 return false; 4922 } 4923 }, 4924 delegateType: "focusout" 4925 }, 4926 click: { 4927 4928 // For checkbox, fire native event so checked state will be right 4929 trigger: function() { 4930 if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) { 4931 this.click(); 4932 return false; 4933 } 4934 }, 4935 4936 // For cross-browser consistency, don't fire native .click() on links 4937 _default: function( event ) { 4938 return jQuery.nodeName( event.target, "a" ); 4939 } 4940 }, 4941 4942 beforeunload: { 4943 postDispatch: function( event ) { 4944 4945 // Support: Firefox 20+ 4946 // Firefox doesn't alert if the returnValue field is not set. 4947 if ( event.result !== undefined && event.originalEvent ) { 4948 event.originalEvent.returnValue = event.result; 4949 } 4950 } 4951 } 4952 } 4953}; 4954 4955jQuery.removeEvent = function( elem, type, handle ) { 4956 4957 // This "if" is needed for plain objects 4958 if ( elem.removeEventListener ) { 4959 elem.removeEventListener( type, handle ); 4960 } 4961}; 4962 4963jQuery.Event = function( src, props ) { 4964 4965 // Allow instantiation without the 'new' keyword 4966 if ( !( this instanceof jQuery.Event ) ) { 4967 return new jQuery.Event( src, props ); 4968 } 4969 4970 // Event object 4971 if ( src && src.type ) { 4972 this.originalEvent = src; 4973 this.type = src.type; 4974 4975 // Events bubbling up the document may have been marked as prevented 4976 // by a handler lower down the tree; reflect the correct value. 4977 this.isDefaultPrevented = src.defaultPrevented || 4978 src.defaultPrevented === undefined && 4979 4980 // Support: Android<4.0 4981 src.returnValue === false ? 4982 returnTrue : 4983 returnFalse; 4984 4985 // Event type 4986 } else { 4987 this.type = src; 4988 } 4989 4990 // Put explicitly provided properties onto the event object 4991 if ( props ) { 4992 jQuery.extend( this, props ); 4993 } 4994 4995 // Create a timestamp if incoming event doesn't have one 4996 this.timeStamp = src && src.timeStamp || jQuery.now(); 4997 4998 // Mark it as fixed 4999 this[ jQuery.expando ] = true; 5000}; 5001 5002// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 5003// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 5004jQuery.Event.prototype = { 5005 constructor: jQuery.Event, 5006 isDefaultPrevented: returnFalse, 5007 isPropagationStopped: returnFalse, 5008 isImmediatePropagationStopped: returnFalse,
5009 5010 preventDefault: function() { 5011 var e = this.originalEvent; 5012 5013 this.isDefaultPrevented = returnTrue; 5014 5015 if ( e ) { 5016 e.preventDefault(); 5017 } 5018 }, 5019 stopPropagation: function() { 5020 var e = this.originalEvent; 5021 5022 this.isPropagationStopped = returnTrue; 5023 5024 if ( e ) { 5025 e.stopPropagation(); 5026 } 5027 }, 5028 stopImmediatePropagation: function() { 5029 var e = this.originalEvent; 5030 5031 this.isImmediatePropagationStopped = returnTrue; 5032 5033 if ( e
vendor: 24,946 bytes, lines 5033-5964
5033 ) { 5034 e.stopImmediatePropagation(); 5035 } 5036 5037 this.stopPropagation(); 5038 } 5039}; 5040 5041// Create mouseenter/leave events using mouseover/out and event-time checks 5042// so that event delegation works in jQuery. 5043// Do the same for pointerenter/pointerleave and pointerover/pointerout 5044// 5045// Support: Safari 7 only 5046// Safari sends mouseenter too often; see: 5047// https://code.google.com/p/chromium/issues/detail?id=470258 5048// for the description of the bug (it existed in older Chrome versions as well). 5049jQuery.each( { 5050 mouseenter: "mouseover", 5051 mouseleave: "mouseout", 5052 pointerenter: "pointerover", 5053 pointerleave: "pointerout" 5054}, function( orig, fix ) { 5055 jQuery.event.special[ orig ] = { 5056 delegateType: fix, 5057 bindType: fix, 5058 5059 handle: function( event ) { 5060 var ret, 5061 target = this, 5062 related = event.relatedTarget, 5063 handleObj = event.handleObj; 5064 5065 // For mouseenter/leave call the handler if related is outside the target. 5066 // NB: No relatedTarget if the mouse left/entered the browser window 5067 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { 5068 event.type = handleObj.origType; 5069 ret = handleObj.handler.apply( this, arguments ); 5070 event.type = fix; 5071 } 5072 return ret; 5073 } 5074 }; 5075} ); 5076 5077jQuery.fn.extend( { 5078 on: function( types, selector, data, fn ) { 5079 return on( this, types, selector, data, fn ); 5080 }, 5081 one: function( types, selector, data, fn ) { 5082 return on( this, types, selector, data, fn, 1 ); 5083 }, 5084 off: function( types, selector, fn ) { 5085 var handleObj, type; 5086 if ( types && types.preventDefault && types.handleObj ) { 5087 5088 // ( event ) dispatched jQuery.Event 5089 handleObj = types.handleObj; 5090 jQuery( types.delegateTarget ).off( 5091 handleObj.namespace ? 5092 handleObj.origType + "." + handleObj.namespace : 5093 handleObj.origType, 5094 handleObj.selector, 5095 handleObj.handler 5096 ); 5097 return this; 5098 } 5099 if ( typeof types === "object" ) { 5100 5101 // ( types-object [, selector] ) 5102 for ( type in types ) { 5103 this.off( type, selector, types[ type ] ); 5104 } 5105 return this; 5106 } 5107 if ( selector === false || typeof selector === "function" ) { 5108 5109 // ( types [, fn] ) 5110 fn = selector; 5111 selector = undefined; 5112 } 5113 if ( fn === false ) { 5114 fn = returnFalse; 5115 } 5116 return this.each( function() { 5117 jQuery.event.remove( this, types, fn, selector ); 5118 } ); 5119 } 5120} ); 5121 5122 5123var 5124 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, 5125 5126 // Support: IE 10-11, Edge 10240+ 5127 // In IE/Edge using regex groups here causes severe slowdowns. 5128 // See https://connect.microsoft.com/IE/feedback/details/1736512/ 5129 rnoInnerhtml = /<script|<style|<link/i, 5130 5131 // checked="checked" or checked 5132 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 5133 rscriptTypeMasked = /^true\/(.*)/, 5134 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g; 5135 5136// Manipulating tables requires a tbody 5137function manipulationTarget( elem, content ) { 5138 return jQuery.nodeName( elem, "table" ) && 5139 jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? 5140 5141 elem.getElementsByTagName( "tbody" )[ 0 ] || 5142 elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) : 5143 elem; 5144} 5145 5146// Replace/restore the type attribute of script elements for safe DOM manipulation 5147function disableScript( elem ) { 5148 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; 5149 return elem; 5150} 5151function restoreScript( elem ) { 5152 var match = rscriptTypeMasked.exec( elem.type ); 5153 5154 if ( match ) { 5155 elem.type = match[ 1 ]; 5156 } else { 5157 elem.removeAttribute( "type" ); 5158 } 5159 5160 return elem; 5161} 5162 5163function cloneCopyEvent( src, dest ) { 5164 var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; 5165 5166 if ( dest.nodeType !== 1 ) { 5167 return; 5168 } 5169 5170 // 1. Copy private data: events, handlers, etc. 5171 if ( dataPriv.hasData( src ) ) { 5172 pdataOld = dataPriv.access( src ); 5173 pdataCur = dataPriv.set( dest, pdataOld ); 5174 events = pdataOld.events; 5175 5176 if ( events ) { 5177 delete pdataCur.handle; 5178 pdataCur.events = {}; 5179 5180 for ( type in events ) { 5181 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 5182 jQuery.event.add( dest, type, events[ type ][ i ] ); 5183 } 5184 } 5185 } 5186 } 5187 5188 // 2. Copy user data 5189 if ( dataUser.hasData( src ) ) { 5190 udataOld = dataUser.access( src ); 5191 udataCur = jQuery.extend( {}, udataOld ); 5192 5193 dataUser.set( dest, udataCur ); 5194 } 5195} 5196 5197// Fix IE bugs, see support tests 5198function fixInput( src, dest ) { 5199 var nodeName = dest.nodeName.toLowerCase(); 5200 5201 // Fails to persist the checked state of a cloned checkbox or radio button. 5202 if ( nodeName === "input" && rcheckableType.test( src.type ) ) { 5203 dest.checked = src.checked; 5204 5205 // Fails to return the selected option to the default selected state when cloning options 5206 } else if ( nodeName === "input" || nodeName === "textarea" ) { 5207 dest.defaultValue = src.defaultValue; 5208 } 5209} 5210 5211function domManip( collection, args, callback, ignored ) { 5212 5213 // Flatten any nested arrays 5214 args = concat.apply( [], args ); 5215 5216 var fragment, first, scripts, hasScripts, node, doc, 5217 i = 0, 5218 l = collection.length, 5219 iNoClone = l - 1, 5220 value = args[ 0 ], 5221 isFunction = jQuery.isFunction( value ); 5222 5223 // We can't cloneNode fragments that contain checked, in WebKit 5224 if ( isFunction || 5225 ( l > 1 && typeof value === "string" && 5226 !support.checkClone && rchecked.test( value ) ) ) { 5227 return collection.each( function( index ) { 5228 var self = collection.eq( index ); 5229 if ( isFunction ) { 5230 args[ 0 ] = value.call( this, index, self.html() ); 5231 } 5232 domManip( self, args, callback, ignored ); 5233 } ); 5234 } 5235 5236 if ( l ) { 5237 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); 5238 first = fragment.firstChild; 5239 5240 if ( fragment.childNodes.length === 1 ) { 5241 fragment = first; 5242 } 5243 5244 // Require either new content or an interest in ignored elements to invoke the callback 5245 if ( first || ignored ) { 5246 scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); 5247 hasScripts = scripts.length; 5248 5249 // Use the original fragment for the last item 5250 // instead of the first because it can end up 5251 // being emptied incorrectly in certain situations (#8070). 5252 for ( ; i < l; i++ ) { 5253 node = fragment; 5254 5255 if ( i !== iNoClone ) { 5256 node = jQuery.clone( node, true, true ); 5257 5258 // Keep references to cloned scripts for later restoration 5259 if ( hasScripts ) { 5260 5261 // Support: Android<4.1, PhantomJS<2 5262 // push.apply(_, arraylike) throws on ancient WebKit 5263 jQuery.merge( scripts, getAll( node, "script" ) ); 5264 } 5265 } 5266 5267 callback.call( collection[ i ], node, i ); 5268 } 5269 5270 if ( hasScripts ) { 5271 doc = scripts[ scripts.length - 1 ].ownerDocument; 5272 5273 // Reenable scripts 5274 jQuery.map( scripts, restoreScript ); 5275 5276 // Evaluate executable scripts on first document insertion 5277 for ( i = 0; i < hasScripts; i++ ) { 5278 node = scripts[ i ]; 5279 if ( rscriptType.test( node.type || "" ) && 5280 !dataPriv.access( node, "globalEval" ) && 5281 jQuery.contains( doc, node ) ) { 5282 5283 if ( node.src ) { 5284 5285 // Optional AJAX dependency, but won't run scripts if not present 5286 if ( jQuery._evalUrl ) { 5287 jQuery._evalUrl( node.src ); 5288 } 5289 } else { 5290 jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) ); 5291 } 5292 } 5293 } 5294 } 5295 } 5296 } 5297 5298 return collection; 5299} 5300 5301function remove( elem, selector, keepData ) { 5302 var node, 5303 nodes = selector ? jQuery.filter( selector, elem ) : elem, 5304 i = 0; 5305 5306 for ( ; ( node = nodes[ i ] ) != null; i++ ) { 5307 if ( !keepData && node.nodeType === 1 ) { 5308 jQuery.cleanData( getAll( node ) ); 5309 } 5310 5311 if ( node.parentNode ) { 5312 if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { 5313 setGlobalEval( getAll( node, "script" ) ); 5314 } 5315 node.parentNode.removeChild( node ); 5316 } 5317 } 5318 5319 return elem; 5320} 5321 5322jQuery.extend( { 5323 htmlPrefilter: function( html ) { 5324 return html.replace( rxhtmlTag, "<$1></$2>" ); 5325 }, 5326 5327 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 5328 var i, l, srcElements, destElements, 5329 clone = elem.cloneNode( true ), 5330 inPage = jQuery.contains( elem.ownerDocument, elem ); 5331 5332 // Fix IE cloning issues 5333 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && 5334 !jQuery.isXMLDoc( elem ) ) { 5335 5336 // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 5337 destElements = getAll( clone ); 5338 srcElements = getAll( elem ); 5339 5340 for ( i = 0, l = srcElements.length; i < l; i++ ) { 5341 fixInput( srcElements[ i ], destElements[ i ] ); 5342 } 5343 } 5344 5345 // Copy the events from the original to the clone 5346 if ( dataAndEvents ) { 5347 if ( deepDataAndEvents ) { 5348 srcElements = srcElements || getAll( elem ); 5349 destElements = destElements || getAll( clone ); 5350 5351 for ( i = 0, l = srcElements.length; i < l; i++ ) { 5352 cloneCopyEvent( srcElements[ i ], destElements[ i ] ); 5353 } 5354 } else { 5355 cloneCopyEvent( elem, clone ); 5356 } 5357 } 5358 5359 // Preserve script evaluation history 5360 destElements = getAll( clone, "script" ); 5361 if ( destElements.length > 0 ) { 5362 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); 5363 } 5364 5365 // Return the cloned set 5366 return clone; 5367 }, 5368 5369 cleanData: function( elems ) { 5370 var data, elem, type, 5371 special = jQuery.event.special, 5372 i = 0; 5373 5374 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { 5375 if ( acceptData( elem ) ) { 5376 if ( ( data = elem[ dataPriv.expando ] ) ) { 5377 if ( data.events ) { 5378 for ( type in data.events ) { 5379 if ( special[ type ] ) { 5380 jQuery.event.remove( elem, type ); 5381 5382 // This is a shortcut to avoid jQuery.event.remove's overhead 5383 } else { 5384 jQuery.removeEvent( elem, type, data.handle ); 5385 } 5386 } 5387 } 5388 5389 // Support: Chrome <= 35-45+ 5390 // Assign undefined instead of using delete, see Data#remove 5391 elem[ dataPriv.expando ] = undefined; 5392 } 5393 if ( elem[ dataUser.expando ] ) { 5394 5395 // Support: Chrome <= 35-45+ 5396 // Assign undefined instead of using delete, see Data#remove 5397 elem[ dataUser.expando ] = undefined; 5398 } 5399 } 5400 } 5401 } 5402} ); 5403 5404jQuery.fn.extend( { 5405 5406 // Keep domManip exposed until 3.0 (gh-2225) 5407 domManip: domManip, 5408 5409 detach: function( selector ) { 5410 return remove( this, selector, true ); 5411 }, 5412 5413 remove: function( selector ) { 5414 return remove( this, selector ); 5415 }, 5416 5417 text: function( value ) { 5418 return access( this, function( value ) { 5419 return value === undefined ? 5420 jQuery.text( this ) : 5421 this.empty().each( function() { 5422 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 5423 this.textContent = value; 5424 } 5425 } ); 5426 }, null, value, arguments.length ); 5427 }, 5428 5429 append: function() { 5430 return domManip( this, arguments, function( elem ) { 5431 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 5432 var target = manipulationTarget( this, elem ); 5433 target.appendChild( elem ); 5434 } 5435 } ); 5436 }, 5437 5438 prepend: function() { 5439 return domManip( this, arguments, function( elem ) { 5440 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 5441 var target = manipulationTarget( this, elem ); 5442 target.insertBefore( elem, target.firstChild ); 5443 } 5444 } ); 5445 }, 5446 5447 before: function() { 5448 return domManip( this, arguments, function( elem ) { 5449 if ( this.parentNode ) { 5450 this.parentNode.insertBefore( elem, this ); 5451 } 5452 } ); 5453 }, 5454 5455 after: function() { 5456 return domManip( this, arguments, function( elem ) { 5457 if ( this.parentNode ) { 5458 this.parentNode.insertBefore( elem, this.nextSibling ); 5459 } 5460 } ); 5461 }, 5462 5463 empty: function() { 5464 var elem, 5465 i = 0; 5466 5467 for ( ; ( elem = this[ i ] ) != null; i++ ) { 5468 if ( elem.nodeType === 1 ) { 5469 5470 // Prevent memory leaks 5471 jQuery.cleanData( getAll( elem, false ) ); 5472 5473 // Remove any remaining nodes 5474 elem.textContent = ""; 5475 } 5476 } 5477 5478 return this; 5479 }, 5480 5481 clone: function( dataAndEvents, deepDataAndEvents ) { 5482 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 5483 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 5484 5485 return this.map( function() { 5486 return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); 5487 } ); 5488 }, 5489 5490 html: function( value ) { 5491 return access( this, function( value ) { 5492 var elem = this[ 0 ] || {}, 5493 i = 0, 5494 l = this.length; 5495 5496 if ( value === undefined && elem.nodeType === 1 ) { 5497 return elem.innerHTML; 5498 } 5499 5500 // See if we can take a shortcut and just use innerHTML 5501 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 5502 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { 5503 5504 value = jQuery.htmlPrefilter( value ); 5505 5506 try { 5507 for ( ; i < l; i++ ) { 5508 elem = this[ i ] || {}; 5509 5510 // Remove element nodes and prevent memory leaks 5511 if ( elem.nodeType === 1 ) { 5512 jQuery.cleanData( getAll( elem, false ) ); 5513 elem.innerHTML = value; 5514 } 5515 } 5516 5517 elem = 0; 5518 5519 // If using innerHTML throws an exception, use the fallback method 5520 } catch ( e ) {} 5521 } 5522 5523 if ( elem ) { 5524 this.empty().append( value ); 5525 } 5526 }, null, value, arguments.length ); 5527 }, 5528 5529 replaceWith: function() { 5530 var ignored = []; 5531 5532 // Make the changes, replacing each non-ignored context element with the new content 5533 return domManip( this, arguments, function( elem ) { 5534 var parent = this.parentNode; 5535 5536 if ( jQuery.inArray( this, ignored ) < 0 ) { 5537 jQuery.cleanData( getAll( this ) ); 5538 if ( parent ) { 5539 parent.replaceChild( elem, this ); 5540 } 5541 } 5542 5543 // Force callback invocation 5544 }, ignored ); 5545 } 5546} ); 5547 5548jQuery.each( { 5549 appendTo: "append", 5550 prependTo: "prepend", 5551 insertBefore: "before", 5552 insertAfter: "after", 5553 replaceAll: "replaceWith" 5554}, function( name, original ) { 5555 jQuery.fn[ name ] = function( selector ) { 5556 var elems, 5557 ret = [], 5558 insert = jQuery( selector ), 5559 last = insert.length - 1, 5560 i = 0; 5561 5562 for ( ; i <= last; i++ ) { 5563 elems = i === last ? this : this.clone( true ); 5564 jQuery( insert[ i ] )[ original ]( elems ); 5565 5566 // Support: QtWebKit 5567 // .get() because push.apply(_, arraylike) throws 5568 push.apply( ret, elems.get() ); 5569 } 5570 5571 return this.pushStack( ret ); 5572 }; 5573} ); 5574 5575 5576var iframe, 5577 elemdisplay = { 5578 5579 // Support: Firefox 5580 // We have to pre-define these values for FF (#10227) 5581 HTML: "block", 5582 BODY: "block" 5583 }; 5584 5585/** 5586 * Retrieve the actual display of a element 5587 * @param {String} name nodeName of the element 5588 * @param {Object} doc Document object 5589 */ 5590 5591// Called only from within defaultDisplay 5592function actualDisplay( name, doc ) { 5593 var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), 5594 5595 display = jQuery.css( elem[ 0 ], "display" ); 5596 5597 // We don't have any data stored on the element, 5598 // so use "detach" method as fast way to get rid of the element 5599 elem.detach(); 5600 5601 return display; 5602} 5603 5604/** 5605 * Try to determine the default display value of an element 5606 * @param {String} nodeName 5607 */ 5608function defaultDisplay( nodeName ) { 5609 var doc = document, 5610 display = elemdisplay[ nodeName ]; 5611 5612 if ( !display ) { 5613 display = actualDisplay( nodeName, doc ); 5614 5615 // If the simple way fails, read from inside an iframe 5616 if ( display === "none" || !display ) { 5617 5618 // Use the already-created iframe if possible 5619 iframe = ( iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" ) ) 5620 .appendTo( doc.documentElement ); 5621 5622 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse 5623 doc = iframe[ 0 ].contentDocument; 5624 5625 // Support: IE 5626 doc.write(); 5627 doc.close(); 5628 5629 display = actualDisplay( nodeName, doc ); 5630 iframe.detach(); 5631 } 5632 5633 // Store the correct default display 5634 elemdisplay[ nodeName ] = display; 5635 } 5636 5637 return display; 5638} 5639var rmargin = ( /^margin/ ); 5640 5641var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 5642 5643var getStyles = function( elem ) { 5644 5645 // Support: IE<=11+, Firefox<=30+ (#15098, #14150) 5646 // IE throws on elements created in popups 5647 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 5648 var view = elem.ownerDocument.defaultView; 5649 5650 if ( !view || !view.opener ) { 5651 view = window; 5652 } 5653 5654 return view.getComputedStyle( elem ); 5655 }; 5656 5657var swap = function( elem, options, callback, args ) { 5658 var ret, name, 5659 old = {}; 5660 5661 // Remember the old values, and insert the new ones 5662 for ( name in options ) { 5663 old[ name ] = elem.style[ name ]; 5664 elem.style[ name ] = options[ name ]; 5665 } 5666 5667 ret = callback.apply( elem, args || [] ); 5668 5669 // Revert the old values 5670 for ( name in options ) { 5671 elem.style[ name ] = old[ name ]; 5672 } 5673 5674 return ret; 5675}; 5676 5677 5678var documentElement = document.documentElement; 5679 5680 5681 5682( function() { 5683 var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal, 5684 container = document.createElement( "div" ), 5685 div = document.createElement( "div" ); 5686 5687 // Finish early in limited (non-browser) environments 5688 if ( !div.style ) { 5689 return; 5690 } 5691 5692 // Support: IE9-11+ 5693 // Style of cloned element affects source element cloned (#8908) 5694 div.style.backgroundClip = "content-box"; 5695 div.cloneNode( true ).style.backgroundClip = ""; 5696 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 5697 5698 container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" + 5699 "padding:0;margin-top:1px;position:absolute"; 5700 container.appendChild( div ); 5701 5702 // Executing both pixelPosition & boxSizingReliable tests require only one layout 5703 // so they're executed at the same time to save the second computation. 5704 function computeStyleTests() { 5705 div.style.cssText = 5706 5707 // Support: Firefox<29, Android 2.3 5708 // Vendor-prefix box-sizing 5709 "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;" + 5710 "position:relative;display:block;" + 5711 "margin:auto;border:1px;padding:1px;" + 5712 "top:1%;width:50%"; 5713 div.innerHTML = ""; 5714 documentElement.appendChild( container ); 5715 5716 var divStyle = window.getComputedStyle( div ); 5717 pixelPositionVal = divStyle.top !== "1%"; 5718 reliableMarginLeftVal = divStyle.marginLeft === "2px"; 5719 boxSizingReliableVal = divStyle.width === "4px"; 5720 5721 // Support: Android 4.0 - 4.3 only 5722 // Some styles come back with percentage values, even though they shouldn't 5723 div.style.marginRight = "50%"; 5724 pixelMarginRightVal = divStyle.marginRight === "4px"; 5725 5726 documentElement.removeChild( container ); 5727 } 5728 5729 jQuery.extend( support, { 5730 pixelPosition: function() { 5731 5732 // This test is executed only once but we still do memoizing 5733 // since we can use the boxSizingReliable pre-computing. 5734 // No need to check if the test was already performed, though. 5735 computeStyleTests(); 5736 return pixelPositionVal; 5737 }, 5738 boxSizingReliable: function() { 5739 if ( boxSizingReliableVal == null ) { 5740 computeStyleTests(); 5741 } 5742 return boxSizingReliableVal; 5743 }, 5744 pixelMarginRight: function() { 5745 5746 // Support: Android 4.0-4.3 5747 // We're checking for boxSizingReliableVal here instead of pixelMarginRightVal 5748 // since that compresses better and they're computed together anyway. 5749 if ( boxSizingReliableVal == null ) { 5750 computeStyleTests(); 5751 } 5752 return pixelMarginRightVal; 5753 }, 5754 reliableMarginLeft: function() { 5755 5756 // Support: IE <=8 only, Android 4.0 - 4.3 only, Firefox <=3 - 37 5757 if ( boxSizingReliableVal == null ) { 5758 computeStyleTests(); 5759 } 5760 return reliableMarginLeftVal; 5761 }, 5762 reliableMarginRight: function() { 5763 5764 // Support: Android 2.3 5765 // Check if div with explicit width and no margin-right incorrectly 5766 // gets computed margin-right based on width of container. (#3333) 5767 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right 5768 // This support function is only executed once so no memoizing is needed. 5769 var ret, 5770 marginDiv = div.appendChild( document.createElement( "div" ) ); 5771 5772 // Reset CSS: box-sizing; display; margin; border; padding 5773 marginDiv.style.cssText = div.style.cssText = 5774 5775 // Support: Android 2.3 5776 // Vendor-prefix box-sizing 5777 "-webkit-box-sizing:content-box;box-sizing:content-box;" + 5778 "display:block;margin:0;border:0;padding:0"; 5779 marginDiv.style.marginRight = marginDiv.style.width = "0"; 5780 div.style.width = "1px"; 5781 documentElement.appendChild( container ); 5782 5783 ret = !parseFloat( window.getComputedStyle( marginDiv ).marginRight ); 5784 5785 documentElement.removeChild( container ); 5786 div.removeChild( marginDiv ); 5787 5788 return ret; 5789 } 5790 } ); 5791} )(); 5792 5793 5794function curCSS( elem, name, computed ) { 5795 var width, minWidth, maxWidth, ret, 5796 style = elem.style; 5797 5798 computed = computed || getStyles( elem ); 5799 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined; 5800 5801 // Support: Opera 12.1x only 5802 // Fall back to style even without computed 5803 // computed is undefined for elems on document fragments 5804 if ( ( ret === "" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) { 5805 ret = jQuery.style( elem, name ); 5806 } 5807 5808 // Support: IE9 5809 // getPropertyValue is only needed for .css('filter') (#12537) 5810 if ( computed ) { 5811 5812 // A tribute to the "awesome hack by Dean Edwards" 5813 // Android Browser returns percentage for some values, 5814 // but width seems to be reliably pixels. 5815 // This is against the CSSOM draft spec: 5816 // http://dev.w3.org/csswg/cssom/#resolved-values 5817 if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) { 5818 5819 // Remember the original values 5820 width = style.width; 5821 minWidth = style.minWidth; 5822 maxWidth = style.maxWidth; 5823 5824 // Put in the new values to get a computed value out 5825 style.minWidth = style.maxWidth = style.width = ret; 5826 ret = computed.width; 5827 5828 // Revert the changed values 5829 style.width = width; 5830 style.minWidth = minWidth; 5831 style.maxWidth = maxWidth; 5832 } 5833 } 5834 5835 return ret !== undefined ? 5836 5837 // Support: IE9-11+ 5838 // IE returns zIndex value as an integer. 5839 ret + "" : 5840 ret; 5841} 5842 5843 5844function addGetHookIf( conditionFn, hookFn ) { 5845 5846 // Define the hook, we'll check on the first run if it's really needed. 5847 return { 5848 get: function() { 5849 if ( conditionFn() ) { 5850 5851 // Hook not needed (or it's not possible to use it due 5852 // to missing dependency), remove it. 5853 delete this.get; 5854 return; 5855 } 5856 5857 // Hook needed; redefine it so that the support test is not executed again. 5858 return ( this.get = hookFn ).apply( this, arguments ); 5859 } 5860 }; 5861} 5862 5863 5864var 5865 5866 // Swappable if display is none or starts with table 5867 // except "table", "table-cell", or "table-caption" 5868 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display 5869 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 5870 5871 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 5872 cssNormalTransform = { 5873 letterSpacing: "0", 5874 fontWeight: "400" 5875 }, 5876 5877 cssPrefixes = [ "Webkit", "O", "Moz", "ms" ], 5878 emptyStyle = document.createElement( "div" ).style; 5879 5880// Return a css property mapped to a potentially vendor prefixed property 5881function vendorPropName( name ) { 5882 5883 // Shortcut for names that are not vendor prefixed 5884 if ( name in emptyStyle ) { 5885 return name; 5886 } 5887 5888 // Check for vendor prefixed names 5889 var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), 5890 i = cssPrefixes.length; 5891 5892 while ( i-- ) { 5893 name = cssPrefixes[ i ] + capName; 5894 if ( name in emptyStyle ) { 5895 return name; 5896 } 5897 } 5898} 5899 5900function setPositiveNumber( elem, value, subtract ) { 5901 5902 // Any relative (+/-) values have already been 5903 // normalized at this point 5904 var matches = rcssNum.exec( value ); 5905 return matches ? 5906 5907 // Guard against undefined "subtract", e.g., when used as in cssHooks 5908 Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : 5909 value; 5910} 5911 5912function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { 5913 var i = extra === ( isBorderBox ? "border" : "content" ) ? 5914 5915 // If we already have the right measurement, avoid augmentation 5916 4 : 5917 5918 // Otherwise initialize for horizontal or vertical properties 5919 name === "width" ? 1 : 0, 5920 5921 val = 0; 5922 5923 for ( ; i < 4; i += 2 ) { 5924 5925 // Both box models exclude margin, so add it if we want it 5926 if ( extra === "margin" ) { 5927 val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); 5928 } 5929 5930 if ( isBorderBox ) { 5931 5932 // border-box includes padding, so remove it if we want content 5933 if ( extra === "content" ) { 5934 val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 5935 } 5936 5937 // At this point, extra isn't border nor margin, so remove border 5938 if ( extra !== "margin" ) { 5939 val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 5940 } 5941 } else { 5942 5943 // At this point, extra isn't content, so add padding 5944 val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 5945 5946 // At this point, extra isn't content nor padding, so add border 5947 if ( extra !== "padding" ) { 5948 val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 5949 } 5950 } 5951 } 5952 5953 return val; 5954} 5955 5956function getWidthOrHeight( elem, name, extra ) { 5957 5958 // Start with offset property, which is equivalent to the border-box value 5959 var valueIsBorderBox = true, 5960 val = name === "width" ? elem.offsetWidth : elem.offsetHeight, 5961 styles = getStyles( elem ), 5962 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; 5963 5964 // S
5964upport: IE11 only 5965 // In IE 11 fullscreen elements inside of an iframe have 5966 // 100x too small dimensions (gh-1764). 5967 if ( document.msFullscreenElement && window.top !== window ) { 5968 5969 // Support: IE11 only 5970 // Running getBoundingClientRect on a disconnected node 5971 // in IE throws an error. 5972 if ( elem.getClientRects().length ) { 5973 val = Math.round( elem.getBoundingClientRect()[ name ] * 100 ); 5974 } 5975 }
vendor: 47,683 bytes, lines 5975-7867
5975 5976 5977 // Some non-html elements return undefined for offsetWidth, so check for null/undefined 5978 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 5979 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 5980 if ( val <= 0 || val == null ) { 5981 5982 // Fall back to computed then uncomputed css if necessary 5983 val = curCSS( elem, name, styles ); 5984 if ( val < 0 || val == null ) { 5985 val = elem.style[ name ]; 5986 } 5987 5988 // Computed unit is not pixels. Stop here and return. 5989 if ( rnumnonpx.test( val ) ) { 5990 return val; 5991 } 5992 5993 // Check for style in case a browser which returns unreliable values 5994 // for getComputedStyle silently falls back to the reliable elem.style 5995 valueIsBorderBox = isBorderBox && 5996 ( support.boxSizingReliable() || val === elem.style[ name ] ); 5997 5998 // Normalize "", auto, and prepare for extra 5999 val = parseFloat( val ) || 0; 6000 } 6001 6002 // Use the active box-sizing model to add/subtract irrelevant styles 6003 return ( val + 6004 augmentWidthOrHeight( 6005 elem, 6006 name, 6007 extra || ( isBorderBox ? "border" : "content" ), 6008 valueIsBorderBox, 6009 styles 6010 ) 6011 ) + "px"; 6012} 6013 6014function showHide( elements, show ) { 6015 var display, elem, hidden, 6016 values = [], 6017 index = 0, 6018 length = elements.length; 6019 6020 for ( ; index < length; index++ ) { 6021 elem = elements[ index ]; 6022 if ( !elem.style ) { 6023 continue; 6024 } 6025 6026 values[ index ] = dataPriv.get( elem, "olddisplay" ); 6027 display = elem.style.display; 6028 if ( show ) { 6029 6030 // Reset the inline display of this element to learn if it is 6031 // being hidden by cascaded rules or not 6032 if ( !values[ index ] && display === "none" ) { 6033 elem.style.display = ""; 6034 } 6035 6036 // Set elements which have been overridden with display: none 6037 // in a stylesheet to whatever the default browser style is 6038 // for such an element 6039 if ( elem.style.display === "" && isHidden( elem ) ) { 6040 values[ index ] = dataPriv.access( 6041 elem, 6042 "olddisplay", 6043 defaultDisplay( elem.nodeName ) 6044 ); 6045 } 6046 } else { 6047 hidden = isHidden( elem ); 6048 6049 if ( display !== "none" || !hidden ) { 6050 dataPriv.set( 6051 elem, 6052 "olddisplay", 6053 hidden ? display : jQuery.css( elem, "display" ) 6054 ); 6055 } 6056 } 6057 } 6058 6059 // Set the display of most of the elements in a second loop 6060 // to avoid the constant reflow 6061 for ( index = 0; index < length; index++ ) { 6062 elem = elements[ index ]; 6063 if ( !elem.style ) { 6064 continue; 6065 } 6066 if ( !show || elem.style.display === "none" || elem.style.display === "" ) { 6067 elem.style.display = show ? values[ index ] || "" : "none"; 6068 } 6069 } 6070 6071 return elements; 6072} 6073 6074jQuery.extend( { 6075 6076 // Add in style property hooks for overriding the default 6077 // behavior of getting and setting a style property 6078 cssHooks: { 6079 opacity: { 6080 get: function( elem, computed ) { 6081 if ( computed ) { 6082 6083 // We should always get a number back from opacity 6084 var ret = curCSS( elem, "opacity" ); 6085 return ret === "" ? "1" : ret; 6086 } 6087 } 6088 } 6089 }, 6090 6091 // Don't automatically add "px" to these possibly-unitless properties 6092 cssNumber: { 6093 "animationIterationCount": true, 6094 "columnCount": true, 6095 "fillOpacity": true, 6096 "flexGrow": true, 6097 "flexShrink": true, 6098 "fontWeight": true, 6099 "lineHeight": true, 6100 "opacity": true, 6101 "order": true, 6102 "orphans": true, 6103 "widows": true, 6104 "zIndex": true, 6105 "zoom": true 6106 }, 6107 6108 // Add in properties whose names you wish to fix before 6109 // setting or getting the value 6110 cssProps: { 6111 "float": "cssFloat" 6112 }, 6113 6114 // Get and set the style property on a DOM Node 6115 style: function( elem, name, value, extra ) { 6116 6117 // Don't set styles on text and comment nodes 6118 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 6119 return; 6120 } 6121 6122 // Make sure that we're working with the right name 6123 var ret, type, hooks, 6124 origName = jQuery.camelCase( name ), 6125 style = elem.style; 6126 6127 name = jQuery.cssProps[ origName ] || 6128 ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName ); 6129 6130 // Gets hook for the prefixed version, then unprefixed version 6131 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 6132 6133 // Check if we're setting a value 6134 if ( value !== undefined ) { 6135 type = typeof value; 6136 6137 // Convert "+=" or "-=" to relative numbers (#7345) 6138 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { 6139 value = adjustCSS( elem, name, ret ); 6140 6141 // Fixes bug #9237 6142 type = "number"; 6143 } 6144 6145 // Make sure that null and NaN values aren't set (#7116) 6146 if ( value == null || value !== value ) { 6147 return; 6148 } 6149 6150 // If a number was passed in, add the unit (except for certain CSS properties) 6151 if ( type === "number" ) { 6152 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); 6153 } 6154 6155 // Support: IE9-11+ 6156 // background-* props affect original clone's values 6157 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { 6158 style[ name ] = "inherit"; 6159 } 6160 6161 // If a hook was provided, use that value, otherwise just set the specified value 6162 if ( !hooks || !( "set" in hooks ) || 6163 ( value = hooks.set( elem, value, extra ) ) !== undefined ) { 6164 6165 style[ name ] = value; 6166 } 6167 6168 } else { 6169 6170 // If a hook was provided get the non-computed value from there 6171 if ( hooks && "get" in hooks && 6172 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { 6173 6174 return ret; 6175 } 6176 6177 // Otherwise just get the value from the style object 6178 return style[ name ]; 6179 } 6180 }, 6181 6182 css: function( elem, name, extra, styles ) { 6183 var val, num, hooks, 6184 origName = jQuery.camelCase( name ); 6185 6186 // Make sure that we're working with the right name 6187 name = jQuery.cssProps[ origName ] || 6188 ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName ); 6189 6190 // Try prefixed name followed by the unprefixed name 6191 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 6192 6193 // If a hook was provided get the computed value from there 6194 if ( hooks && "get" in hooks ) { 6195 val = hooks.get( elem, true, extra ); 6196 } 6197 6198 // Otherwise, if a way to get the computed value exists, use that 6199 if ( val === undefined ) { 6200 val = curCSS( elem, name, styles ); 6201 } 6202 6203 // Convert "normal" to computed value 6204 if ( val === "normal" && name in cssNormalTransform ) { 6205 val = cssNormalTransform[ name ]; 6206 } 6207 6208 // Make numeric if forced or a qualifier was provided and val looks numeric 6209 if ( extra === "" || extra ) { 6210 num = parseFloat( val ); 6211 return extra === true || isFinite( num ) ? num || 0 : val; 6212 } 6213 return val; 6214 } 6215} ); 6216 6217jQuery.each( [ "height", "width" ], function( i, name ) { 6218 jQuery.cssHooks[ name ] = { 6219 get: function( elem, computed, extra ) { 6220 if ( computed ) { 6221 6222 // Certain elements can have dimension info if we invisibly show them 6223 // but it must have a current display style that would benefit 6224 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && 6225 elem.offsetWidth === 0 ? 6226 swap( elem, cssShow, function() { 6227 return getWidthOrHeight( elem, name, extra ); 6228 } ) : 6229 getWidthOrHeight( elem, name, extra ); 6230 } 6231 }, 6232 6233 set: function( elem, value, extra ) { 6234 var matches, 6235 styles = extra && getStyles( elem ), 6236 subtract = extra && augmentWidthOrHeight( 6237 elem, 6238 name, 6239 extra, 6240 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 6241 styles 6242 ); 6243 6244 // Convert to pixels if value adjustment is needed 6245 if ( subtract && ( matches = rcssNum.exec( value ) ) && 6246 ( matches[ 3 ] || "px" ) !== "px" ) { 6247 6248 elem.style[ name ] = value; 6249 value = jQuery.css( elem, name ); 6250 } 6251 6252 return setPositiveNumber( elem, value, subtract ); 6253 } 6254 }; 6255} ); 6256 6257jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, 6258 function( elem, computed ) { 6259 if ( computed ) { 6260 return ( parseFloat( curCSS( elem, "marginLeft" ) ) || 6261 elem.getBoundingClientRect().left - 6262 swap( elem, { marginLeft: 0 }, function() { 6263 return elem.getBoundingClientRect().left; 6264 } ) 6265 ) + "px"; 6266 } 6267 } 6268); 6269 6270// Support: Android 2.3 6271jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight, 6272 function( elem, computed ) { 6273 if ( computed ) { 6274 return swap( elem, { "display": "inline-block" }, 6275 curCSS, [ elem, "marginRight" ] ); 6276 } 6277 } 6278); 6279 6280// These hooks are used by animate to expand properties 6281jQuery.each( { 6282 margin: "", 6283 padding: "", 6284 border: "Width" 6285}, function( prefix, suffix ) { 6286 jQuery.cssHooks[ prefix + suffix ] = { 6287 expand: function( value ) { 6288 var i = 0, 6289 expanded = {}, 6290 6291 // Assumes a single number if not a string 6292 parts = typeof value === "string" ? value.split( " " ) : [ value ]; 6293 6294 for ( ; i < 4; i++ ) { 6295 expanded[ prefix + cssExpand[ i ] + suffix ] = 6296 parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 6297 } 6298 6299 return expanded; 6300 } 6301 }; 6302 6303 if ( !rmargin.test( prefix ) ) { 6304 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; 6305 } 6306} ); 6307 6308jQuery.fn.extend( { 6309 css: function( name, value ) { 6310 return access( this, function( elem, name, value ) { 6311 var styles, len, 6312 map = {}, 6313 i = 0; 6314 6315 if ( jQuery.isArray( name ) ) { 6316 styles = getStyles( elem ); 6317 len = name.length; 6318 6319 for ( ; i < len; i++ ) { 6320 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); 6321 } 6322 6323 return map; 6324 } 6325 6326 return value !== undefined ? 6327 jQuery.style( elem, name, value ) : 6328 jQuery.css( elem, name ); 6329 }, name, value, arguments.length > 1 ); 6330 }, 6331 show: function() { 6332 return showHide( this, true ); 6333 }, 6334 hide: function() { 6335 return showHide( this ); 6336 }, 6337 toggle: function( state ) { 6338 if ( typeof state === "boolean" ) { 6339 return state ? this.show() : this.hide(); 6340 } 6341 6342 return this.each( function() { 6343 if ( isHidden( this ) ) { 6344 jQuery( this ).show(); 6345 } else { 6346 jQuery( this ).hide(); 6347 } 6348 } ); 6349 } 6350} ); 6351 6352 6353function Tween( elem, options, prop, end, easing ) { 6354 return new Tween.prototype.init( elem, options, prop, end, easing ); 6355} 6356jQuery.Tween = Tween; 6357 6358Tween.prototype = { 6359 constructor: Tween, 6360 init: function( elem, options, prop, end, easing, unit ) { 6361 this.elem = elem; 6362 this.prop = prop; 6363 this.easing = easing || jQuery.easing._default; 6364 this.options = options; 6365 this.start = this.now = this.cur(); 6366 this.end = end; 6367 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 6368 }, 6369 cur: function() { 6370 var hooks = Tween.propHooks[ this.prop ]; 6371 6372 return hooks && hooks.get ? 6373 hooks.get( this ) : 6374 Tween.propHooks._default.get( this ); 6375 }, 6376 run: function( percent ) { 6377 var eased, 6378 hooks = Tween.propHooks[ this.prop ]; 6379 6380 if ( this.options.duration ) { 6381 this.pos = eased = jQuery.easing[ this.easing ]( 6382 percent, this.options.duration * percent, 0, 1, this.options.duration 6383 ); 6384 } else { 6385 this.pos = eased = percent; 6386 } 6387 this.now = ( this.end - this.start ) * eased + this.start; 6388 6389 if ( this.options.step ) { 6390 this.options.step.call( this.elem, this.now, this ); 6391 } 6392 6393 if ( hooks && hooks.set ) { 6394 hooks.set( this ); 6395 } else { 6396 Tween.propHooks._default.set( this ); 6397 } 6398 return this; 6399 } 6400}; 6401 6402Tween.prototype.init.prototype = Tween.prototype; 6403 6404Tween.propHooks = { 6405 _default: { 6406 get: function( tween ) { 6407 var result; 6408 6409 // Use a property on the element directly when it is not a DOM element, 6410 // or when there is no matching style property that exists. 6411 if ( tween.elem.nodeType !== 1 || 6412 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { 6413 return tween.elem[ tween.prop ]; 6414 } 6415 6416 // Passing an empty string as a 3rd parameter to .css will automatically 6417 // attempt a parseFloat and fallback to a string if the parse fails. 6418 // Simple values such as "10px" are parsed to Float; 6419 // complex values such as "rotate(1rad)" are returned as-is. 6420 result = jQuery.css( tween.elem, tween.prop, "" ); 6421 6422 // Empty strings, null, undefined and "auto" are converted to 0. 6423 return !result || result === "auto" ? 0 : result; 6424 }, 6425 set: function( tween ) { 6426 6427 // Use step hook for back compat. 6428 // Use cssHook if its there. 6429 // Use .style if available and use plain properties where available. 6430 if ( jQuery.fx.step[ tween.prop ] ) { 6431 jQuery.fx.step[ tween.prop ]( tween ); 6432 } else if ( tween.elem.nodeType === 1 && 6433 ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || 6434 jQuery.cssHooks[ tween.prop ] ) ) { 6435 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); 6436 } else { 6437 tween.elem[ tween.prop ] = tween.now; 6438 } 6439 } 6440 } 6441}; 6442 6443// Support: IE9 6444// Panic based approach to setting things on disconnected nodes 6445Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 6446 set: function( tween ) { 6447 if ( tween.elem.nodeType && tween.elem.parentNode ) { 6448 tween.elem[ tween.prop ] = tween.now; 6449 } 6450 } 6451}; 6452 6453jQuery.easing = { 6454 linear: function( p ) { 6455 return p; 6456 }, 6457 swing: function( p ) { 6458 return 0.5 - Math.cos( p * Math.PI ) / 2; 6459 }, 6460 _default: "swing" 6461}; 6462 6463jQuery.fx = Tween.prototype.init; 6464 6465// Back Compat <1.8 extension point 6466jQuery.fx.step = {}; 6467 6468 6469 6470 6471var 6472 fxNow, timerId, 6473 rfxtypes = /^(?:toggle|show|hide)$/, 6474 rrun = /queueHooks$/; 6475 6476// Animations created synchronously will run synchronously 6477function createFxNow() { 6478 window.setTimeout( function() { 6479 fxNow = undefined; 6480 } ); 6481 return ( fxNow = jQuery.now() ); 6482} 6483 6484// Generate parameters to create a standard animation 6485function genFx( type, includeWidth ) { 6486 var which, 6487 i = 0, 6488 attrs = { height: type }; 6489 6490 // If we include width, step value is 1 to do all cssExpand values, 6491 // otherwise step value is 2 to skip over Left and Right 6492 includeWidth = includeWidth ? 1 : 0; 6493 for ( ; i < 4 ; i += 2 - includeWidth ) { 6494 which = cssExpand[ i ]; 6495 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; 6496 } 6497 6498 if ( includeWidth ) { 6499 attrs.opacity = attrs.width = type; 6500 } 6501 6502 return attrs; 6503} 6504 6505function createTween( value, prop, animation ) { 6506 var tween, 6507 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), 6508 index = 0, 6509 length = collection.length; 6510 for ( ; index < length; index++ ) { 6511 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { 6512 6513 // We're done with this property 6514 return tween; 6515 } 6516 } 6517} 6518 6519function defaultPrefilter( elem, props, opts ) { 6520 /* jshint validthis: true */ 6521 var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay, 6522 anim = this, 6523 orig = {}, 6524 style = elem.style, 6525 hidden = elem.nodeType && isHidden( elem ), 6526 dataShow = dataPriv.get( elem, "fxshow" ); 6527 6528 // Handle queue: false promises 6529 if ( !opts.queue ) { 6530 hooks = jQuery._queueHooks( elem, "fx" ); 6531 if ( hooks.unqueued == null ) { 6532 hooks.unqueued = 0; 6533 oldfire = hooks.empty.fire; 6534 hooks.empty.fire = function() { 6535 if ( !hooks.unqueued ) { 6536 oldfire(); 6537 } 6538 }; 6539 } 6540 hooks.unqueued++; 6541 6542 anim.always( function() { 6543 6544 // Ensure the complete handler is called before this completes 6545 anim.always( function() { 6546 hooks.unqueued--; 6547 if ( !jQuery.queue( elem, "fx" ).length ) { 6548 hooks.empty.fire(); 6549 } 6550 } ); 6551 } ); 6552 } 6553 6554 // Height/width overflow pass 6555 if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { 6556 6557 // Make sure that nothing sneaks out 6558 // Record all 3 overflow attributes because IE9-10 do not 6559 // change the overflow attribute when overflowX and 6560 // overflowY are set to the same value 6561 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; 6562 6563 // Set display property to inline-block for height/width 6564 // animations on inline elements that are having width/height animated 6565 display = jQuery.css( elem, "display" ); 6566 6567 // Test default display if display is currently "none" 6568 checkDisplay = display === "none" ? 6569 dataPriv.get( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display; 6570 6571 if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) { 6572 style.display = "inline-block"; 6573 } 6574 } 6575 6576 if ( opts.overflow ) { 6577 style.overflow = "hidden"; 6578 anim.always( function() { 6579 style.overflow = opts.overflow[ 0 ]; 6580 style.overflowX = opts.overflow[ 1 ]; 6581 style.overflowY = opts.overflow[ 2 ]; 6582 } ); 6583 } 6584 6585 // show/hide pass 6586 for ( prop in props ) { 6587 value = props[ prop ]; 6588 if ( rfxtypes.exec( value ) ) { 6589 delete props[ prop ]; 6590 toggle = toggle || value === "toggle"; 6591 if ( value === ( hidden ? "hide" : "show" ) ) { 6592 6593 // If there is dataShow left over from a stopped hide or show 6594 // and we are going to proceed with show, we should pretend to be hidden 6595 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { 6596 hidden = true; 6597 } else { 6598 continue; 6599 } 6600 } 6601 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); 6602 6603 // Any non-fx value stops us from restoring the original display value 6604 } else { 6605 display = undefined; 6606 } 6607 } 6608 6609 if ( !jQuery.isEmptyObject( orig ) ) { 6610 if ( dataShow ) { 6611 if ( "hidden" in dataShow ) { 6612 hidden = dataShow.hidden; 6613 } 6614 } else { 6615 dataShow = dataPriv.access( elem, "fxshow", {} ); 6616 } 6617 6618 // Store state if its toggle - enables .stop().toggle() to "reverse" 6619 if ( toggle ) { 6620 dataShow.hidden = !hidden; 6621 } 6622 if ( hidden ) { 6623 jQuery( elem ).show(); 6624 } else { 6625 anim.done( function() { 6626 jQuery( elem ).hide(); 6627 } ); 6628 } 6629 anim.done( function() { 6630 var prop; 6631 6632 dataPriv.remove( elem, "fxshow" ); 6633 for ( prop in orig ) { 6634 jQuery.style( elem, prop, orig[ prop ] ); 6635 } 6636 } ); 6637 for ( prop in orig ) { 6638 tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); 6639 6640 if ( !( prop in dataShow ) ) { 6641 dataShow[ prop ] = tween.start; 6642 if ( hidden ) { 6643 tween.end = tween.start; 6644 tween.start = prop === "width" || prop === "height" ? 1 : 0; 6645 } 6646 } 6647 } 6648 6649 // If this is a noop like .hide().hide(), restore an overwritten display value 6650 } else if ( ( display === "none" ? defaultDisplay( elem.nodeName ) : display ) === "inline" ) { 6651 style.display = display; 6652 } 6653} 6654 6655function propFilter( props, specialEasing ) { 6656 var index, name, easing, value, hooks; 6657 6658 // camelCase, specialEasing and expand cssHook pass 6659 for ( index in props ) { 6660 name = jQuery.camelCase( index ); 6661 easing = specialEasing[ name ]; 6662 value = props[ index ]; 6663 if ( jQuery.isArray( value ) ) { 6664 easing = value[ 1 ]; 6665 value = props[ index ] = value[ 0 ]; 6666 } 6667 6668 if ( index !== name ) { 6669 props[ name ] = value; 6670 delete props[ index ]; 6671 } 6672 6673 hooks = jQuery.cssHooks[ name ]; 6674 if ( hooks && "expand" in hooks ) { 6675 value = hooks.expand( value ); 6676 delete props[ name ]; 6677 6678 // Not quite $.extend, this won't overwrite existing keys. 6679 // Reusing 'index' because we have the correct "name" 6680 for ( index in value ) { 6681 if ( !( index in props ) ) { 6682 props[ index ] = value[ index ]; 6683 specialEasing[ index ] = easing; 6684 } 6685 } 6686 } else { 6687 specialEasing[ name ] = easing; 6688 } 6689 } 6690} 6691 6692function Animation( elem, properties, options ) { 6693 var result, 6694 stopped, 6695 index = 0, 6696 length = Animation.prefilters.length, 6697 deferred = jQuery.Deferred().always( function() { 6698 6699 // Don't match elem in the :animated selector 6700 delete tick.elem; 6701 } ), 6702 tick = function() { 6703 if ( stopped ) { 6704 return false; 6705 } 6706 var currentTime = fxNow || createFxNow(), 6707 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), 6708 6709 // Support: Android 2.3 6710 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) 6711 temp = remaining / animation.duration || 0, 6712 percent = 1 - temp, 6713 index = 0, 6714 length = animation.tweens.length; 6715 6716 for ( ; index < length ; index++ ) { 6717 animation.tweens[ index ].run( percent ); 6718 } 6719 6720 deferred.notifyWith( elem, [ animation, percent, remaining ] ); 6721 6722 if ( percent < 1 && length ) { 6723 return remaining; 6724 } else { 6725 deferred.resolveWith( elem, [ animation ] ); 6726 return false; 6727 } 6728 }, 6729 animation = deferred.promise( { 6730 elem: elem, 6731 props: jQuery.extend( {}, properties ), 6732 opts: jQuery.extend( true, { 6733 specialEasing: {}, 6734 easing: jQuery.easing._default 6735 }, options ), 6736 originalProperties: properties, 6737 originalOptions: options, 6738 startTime: fxNow || createFxNow(), 6739 duration: options.duration, 6740 tweens: [], 6741 createTween: function( prop, end ) { 6742 var tween = jQuery.Tween( elem, animation.opts, prop, end, 6743 animation.opts.specialEasing[ prop ] || animation.opts.easing ); 6744 animation.tweens.push( tween ); 6745 return tween; 6746 }, 6747 stop: function( gotoEnd ) { 6748 var index = 0, 6749 6750 // If we are going to the end, we want to run all the tweens 6751 // otherwise we skip this part 6752 length = gotoEnd ? animation.tweens.length : 0; 6753 if ( stopped ) { 6754 return this; 6755 } 6756 stopped = true; 6757 for ( ; index < length ; index++ ) { 6758 animation.tweens[ index ].run( 1 ); 6759 } 6760 6761 // Resolve when we played the last frame; otherwise, reject 6762 if ( gotoEnd ) { 6763 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 6764 deferred.resolveWith( elem, [ animation, gotoEnd ] ); 6765 } else { 6766 deferred.rejectWith( elem, [ animation, gotoEnd ] ); 6767 } 6768 return this; 6769 } 6770 } ), 6771 props = animation.props; 6772 6773 propFilter( props, animation.opts.specialEasing ); 6774 6775 for ( ; index < length ; index++ ) { 6776 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); 6777 if ( result ) { 6778 if ( jQuery.isFunction( result.stop ) ) { 6779 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = 6780 jQuery.proxy( result.stop, result ); 6781 } 6782 return result; 6783 } 6784 } 6785 6786 jQuery.map( props, createTween, animation ); 6787 6788 if ( jQuery.isFunction( animation.opts.start ) ) { 6789 animation.opts.start.call( elem, animation ); 6790 } 6791 6792 jQuery.fx.timer( 6793 jQuery.extend( tick, { 6794 elem: elem, 6795 anim: animation, 6796 queue: animation.opts.queue 6797 } ) 6798 ); 6799 6800 // attach callbacks from options 6801 return animation.progress( animation.opts.progress ) 6802 .done( animation.opts.done, animation.opts.complete ) 6803 .fail( animation.opts.fail ) 6804 .always( animation.opts.always ); 6805} 6806 6807jQuery.Animation = jQuery.extend( Animation, { 6808 tweeners: { 6809 "*": [ function( prop, value ) { 6810 var tween = this.createTween( prop, value ); 6811 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); 6812 return tween; 6813 } ] 6814 }, 6815 6816 tweener: function( props, callback ) { 6817 if ( jQuery.isFunction( props ) ) { 6818 callback = props; 6819 props = [ "*" ]; 6820 } else { 6821 props = props.match( rnotwhite ); 6822 } 6823 6824 var prop, 6825 index = 0, 6826 length = props.length; 6827 6828 for ( ; index < length ; index++ ) { 6829 prop = props[ index ]; 6830 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; 6831 Animation.tweeners[ prop ].unshift( callback ); 6832 } 6833 }, 6834 6835 prefilters: [ defaultPrefilter ], 6836 6837 prefilter: function( callback, prepend ) { 6838 if ( prepend ) { 6839 Animation.prefilters.unshift( callback ); 6840 } else { 6841 Animation.prefilters.push( callback ); 6842 } 6843 } 6844} ); 6845 6846jQuery.speed = function( speed, easing, fn ) { 6847 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { 6848 complete: fn || !fn && easing || 6849 jQuery.isFunction( speed ) && speed, 6850 duration: speed, 6851 easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing 6852 }; 6853 6854 opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? 6855 opt.duration : opt.duration in jQuery.fx.speeds ? 6856 jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; 6857 6858 // Normalize opt.queue - true/undefined/null -> "fx" 6859 if ( opt.queue == null || opt.queue === true ) { 6860 opt.queue = "fx"; 6861 } 6862 6863 // Queueing 6864 opt.old = opt.complete; 6865 6866 opt.complete = function() { 6867 if ( jQuery.isFunction( opt.old ) ) { 6868 opt.old.call( this ); 6869 } 6870 6871 if ( opt.queue ) { 6872 jQuery.dequeue( this, opt.queue ); 6873 } 6874 }; 6875 6876 return opt; 6877}; 6878 6879jQuery.fn.extend( { 6880 fadeTo: function( speed, to, easing, callback ) { 6881 6882 // Show any hidden elements after setting opacity to 0 6883 return this.filter( isHidden ).css( "opacity", 0 ).show() 6884 6885 // Animate to the value specified 6886 .end().animate( { opacity: to }, speed, easing, callback ); 6887 }, 6888 animate: function( prop, speed, easing, callback ) { 6889 var empty = jQuery.isEmptyObject( prop ), 6890 optall = jQuery.speed( speed, easing, callback ), 6891 doAnimation = function() { 6892 6893 // Operate on a copy of prop so per-property easing won't be lost 6894 var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 6895 6896 // Empty animations, or finishing resolves immediately 6897 if ( empty || dataPriv.get( this, "finish" ) ) { 6898 anim.stop( true ); 6899 } 6900 }; 6901 doAnimation.finish = doAnimation; 6902 6903 return empty || optall.queue === false ? 6904 this.each( doAnimation ) : 6905 this.queue( optall.queue, doAnimation ); 6906 }, 6907 stop: function( type, clearQueue, gotoEnd ) { 6908 var stopQueue = function( hooks ) { 6909 var stop = hooks.stop; 6910 delete hooks.stop; 6911 stop( gotoEnd ); 6912 }; 6913 6914 if ( typeof type !== "string" ) { 6915 gotoEnd = clearQueue; 6916 clearQueue = type; 6917 type = undefined; 6918 } 6919 if ( clearQueue && type !== false ) { 6920 this.queue( type || "fx", [] ); 6921 } 6922 6923 return this.each( function() { 6924 var dequeue = true, 6925 index = type != null && type + "queueHooks", 6926 timers = jQuery.timers, 6927 data = dataPriv.get( this ); 6928 6929 if ( index ) { 6930 if ( data[ index ] && data[ index ].stop ) { 6931 stopQueue( data[ index ] ); 6932 } 6933 } else { 6934 for ( index in data ) { 6935 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { 6936 stopQueue( data[ index ] ); 6937 } 6938 } 6939 } 6940 6941 for ( index = timers.length; index--; ) { 6942 if ( timers[ index ].elem === this && 6943 ( type == null || timers[ index ].queue === type ) ) { 6944 6945 timers[ index ].anim.stop( gotoEnd ); 6946 dequeue = false; 6947 timers.splice( index, 1 ); 6948 } 6949 } 6950 6951 // Start the next in the queue if the last step wasn't forced. 6952 // Timers currently will call their complete callbacks, which 6953 // will dequeue but only if they were gotoEnd. 6954 if ( dequeue || !gotoEnd ) { 6955 jQuery.dequeue( this, type ); 6956 } 6957 } ); 6958 }, 6959 finish: function( type ) { 6960 if ( type !== false ) { 6961 type = type || "fx"; 6962 } 6963 return this.each( function() { 6964 var index, 6965 data = dataPriv.get( this ), 6966 queue = data[ type + "queue" ], 6967 hooks = data[ type + "queueHooks" ], 6968 timers = jQuery.timers, 6969 length = queue ? queue.length : 0; 6970 6971 // Enable finishing flag on private data 6972 data.finish = true; 6973 6974 // Empty the queue first 6975 jQuery.queue( this, type, [] ); 6976 6977 if ( hooks && hooks.stop ) { 6978 hooks.stop.call( this, true ); 6979 } 6980 6981 // Look for any active animations, and finish them 6982 for ( index = timers.length; index--; ) { 6983 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 6984 timers[ index ].anim.stop( true ); 6985 timers.splice( index, 1 ); 6986 } 6987 } 6988 6989 // Look for any animations in the old queue and finish them 6990 for ( index = 0; index < length; index++ ) { 6991 if ( queue[ index ] && queue[ index ].finish ) { 6992 queue[ index ].finish.call( this ); 6993 } 6994 } 6995 6996 // Turn off finishing flag 6997 delete data.finish; 6998 } ); 6999 } 7000} ); 7001 7002jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { 7003 var cssFn = jQuery.fn[ name ]; 7004 jQuery.fn[ name ] = function( speed, easing, callback ) { 7005 return speed == null || typeof speed === "boolean" ? 7006 cssFn.apply( this, arguments ) : 7007 this.animate( genFx( name, true ), speed, easing, callback ); 7008 }; 7009} ); 7010 7011// Generate shortcuts for custom animations 7012jQuery.each( { 7013 slideDown: genFx( "show" ), 7014 slideUp: genFx( "hide" ), 7015 slideToggle: genFx( "toggle" ), 7016 fadeIn: { opacity: "show" }, 7017 fadeOut: { opacity: "hide" }, 7018 fadeToggle: { opacity: "toggle" } 7019}, function( name, props ) { 7020 jQuery.fn[ name ] = function( speed, easing, callback ) { 7021 return this.animate( props, speed, easing, callback ); 7022 }; 7023} ); 7024 7025jQuery.timers = []; 7026jQuery.fx.tick = function() { 7027 var timer, 7028 i = 0, 7029 timers = jQuery.timers; 7030 7031 fxNow = jQuery.now(); 7032 7033 for ( ; i < timers.length; i++ ) { 7034 timer = timers[ i ]; 7035 7036 // Checks the timer has not already been removed 7037 if ( !timer() && timers[ i ] === timer ) { 7038 timers.splice( i--, 1 ); 7039 } 7040 } 7041 7042 if ( !timers.length ) { 7043 jQuery.fx.stop(); 7044 } 7045 fxNow = undefined; 7046}; 7047 7048jQuery.fx.timer = function( timer ) { 7049 jQuery.timers.push( timer ); 7050 if ( timer() ) { 7051 jQuery.fx.start(); 7052 } else { 7053 jQuery.timers.pop(); 7054 } 7055}; 7056 7057jQuery.fx.interval = 13; 7058jQuery.fx.start = function() { 7059 if ( !timerId ) { 7060 timerId = window.setInterval( jQuery.fx.tick, jQuery.fx.interval ); 7061 } 7062}; 7063 7064jQuery.fx.stop = function() { 7065 window.clearInterval( timerId ); 7066 7067 timerId = null; 7068}; 7069 7070jQuery.fx.speeds = { 7071 slow: 600, 7072 fast: 200, 7073 7074 // Default speed 7075 _default: 400 7076}; 7077 7078 7079// Based off of the plugin by Clint Helfers, with permission. 7080// http://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ 7081jQuery.fn.delay = function( time, type ) { 7082 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 7083 type = type || "fx"; 7084 7085 return this.queue( type, function( next, hooks ) { 7086 var timeout = window.setTimeout( next, time ); 7087 hooks.stop = function() { 7088 window.clearTimeout( timeout ); 7089 }; 7090 } ); 7091}; 7092 7093 7094( function() { 7095 var input = document.createElement( "input" ), 7096 select = document.createElement( "select" ), 7097 opt = select.appendChild( document.createElement( "option" ) ); 7098 7099 input.type = "checkbox"; 7100 7101 // Support: iOS<=5.1, Android<=4.2+ 7102 // Default value for a checkbox should be "on" 7103 support.checkOn = input.value !== ""; 7104 7105 // Support: IE<=11+ 7106 // Must access selectedIndex to make default options select 7107 support.optSelected = opt.selected; 7108 7109 // Support: Android<=2.3 7110 // Options inside disabled selects are incorrectly marked as disabled 7111 select.disabled = true; 7112 support.optDisabled = !opt.disabled; 7113 7114 // Support: IE<=11+ 7115 // An input loses its value after becoming a radio 7116 input = document.createElement( "input" ); 7117 input.value = "t"; 7118 input.type = "radio"; 7119 support.radioValue = input.value === "t"; 7120} )(); 7121 7122 7123var boolHook, 7124 attrHandle = jQuery.expr.attrHandle; 7125 7126jQuery.fn.extend( { 7127 attr: function( name, value ) { 7128 return access( this, jQuery.attr, name, value, arguments.length > 1 ); 7129 }, 7130 7131 removeAttr: function( name ) { 7132 return this.each( function() { 7133 jQuery.removeAttr( this, name ); 7134 } ); 7135 } 7136} ); 7137 7138jQuery.extend( { 7139 attr: function( elem, name, value ) { 7140 var ret, hooks, 7141 nType = elem.nodeType; 7142 7143 // Don't get/set attributes on text, comment and attribute nodes 7144 if ( nType === 3 || nType === 8 || nType === 2 ) { 7145 return; 7146 } 7147 7148 // Fallback to prop when attributes are not supported 7149 if ( typeof elem.getAttribute === "undefined" ) { 7150 return jQuery.prop( elem, name, value ); 7151 } 7152 7153 // All attributes are lowercase 7154 // Grab necessary hook if one is defined 7155 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 7156 name = name.toLowerCase(); 7157 hooks = jQuery.attrHooks[ name ] || 7158 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); 7159 } 7160 7161 if ( value !== undefined ) { 7162 if ( value === null ) { 7163 jQuery.removeAttr( elem, name ); 7164 return; 7165 } 7166 7167 if ( hooks && "set" in hooks && 7168 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 7169 return ret; 7170 } 7171 7172 elem.setAttribute( name, value + "" ); 7173 return value; 7174 } 7175 7176 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 7177 return ret; 7178 } 7179 7180 ret = jQuery.find.attr( elem, name ); 7181 7182 // Non-existent attributes return null, we normalize to undefined 7183 return ret == null ? undefined : ret; 7184 }, 7185 7186 attrHooks: { 7187 type: { 7188 set: function( elem, value ) { 7189 if ( !support.radioValue && value === "radio" && 7190 jQuery.nodeName( elem, "input" ) ) { 7191 var val = elem.value; 7192 elem.setAttribute( "type", value ); 7193 if ( val ) { 7194 elem.value = val; 7195 } 7196 return value; 7197 } 7198 } 7199 } 7200 }, 7201 7202 removeAttr: function( elem, value ) { 7203 var name, propName, 7204 i = 0, 7205 attrNames = value && value.match( rnotwhite ); 7206 7207 if ( attrNames && elem.nodeType === 1 ) { 7208 while ( ( name = attrNames[ i++ ] ) ) { 7209 propName = jQuery.propFix[ name ] || name; 7210 7211 // Boolean attributes get special treatment (#10870) 7212 if ( jQuery.expr.match.bool.test( name ) ) { 7213 7214 // Set corresponding property to false 7215 elem[ propName ] = false; 7216 } 7217 7218 elem.removeAttribute( name ); 7219 } 7220 } 7221 } 7222} ); 7223 7224// Hooks for boolean attributes 7225boolHook = { 7226 set: function( elem, value, name ) { 7227 if ( value === false ) { 7228 7229 // Remove boolean attributes when set to false 7230 jQuery.removeAttr( elem, name ); 7231 } else { 7232 elem.setAttribute( name, name ); 7233 } 7234 return name; 7235 } 7236}; 7237jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { 7238 var getter = attrHandle[ name ] || jQuery.find.attr; 7239 7240 attrHandle[ name ] = function( elem, name, isXML ) { 7241 var ret, handle; 7242 if ( !isXML ) { 7243 7244 // Avoid an infinite loop by temporarily removing this function from the getter 7245 handle = attrHandle[ name ]; 7246 attrHandle[ name ] = ret; 7247 ret = getter( elem, name, isXML ) != null ? 7248 name.toLowerCase() : 7249 null; 7250 attrHandle[ name ] = handle; 7251 } 7252 return ret; 7253 }; 7254} ); 7255 7256 7257 7258 7259var rfocusable = /^(?:input|select|textarea|button)$/i, 7260 rclickable = /^(?:a|area)$/i; 7261 7262jQuery.fn.extend( { 7263 prop: function( name, value ) { 7264 return access( this, jQuery.prop, name, value, arguments.length > 1 ); 7265 }, 7266 7267 removeProp: function( name ) { 7268 return this.each( function() { 7269 delete this[ jQuery.propFix[ name ] || name ]; 7270 } ); 7271 } 7272} ); 7273 7274jQuery.extend( { 7275 prop: function( elem, name, value ) { 7276 var ret, hooks, 7277 nType = elem.nodeType; 7278 7279 // Don't get/set properties on text, comment and attribute nodes 7280 if ( nType === 3 || nType === 8 || nType === 2 ) { 7281 return; 7282 } 7283 7284 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 7285 7286 // Fix name and attach hooks 7287 name = jQuery.propFix[ name ] || name; 7288 hooks = jQuery.propHooks[ name ]; 7289 } 7290 7291 if ( value !== undefined ) { 7292 if ( hooks && "set" in hooks && 7293 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 7294 return ret; 7295 } 7296 7297 return ( elem[ name ] = value ); 7298 } 7299 7300 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 7301 return ret; 7302 } 7303 7304 return elem[ name ]; 7305 }, 7306 7307 propHooks: { 7308 tabIndex: { 7309 get: function( elem ) { 7310 7311 // elem.tabIndex doesn't always return the 7312 // correct value when it hasn't been explicitly set 7313 // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ 7314 // Use proper attribute retrieval(#12072) 7315 var tabindex = jQuery.find.attr( elem, "tabindex" ); 7316 7317 return tabindex ? 7318 parseInt( tabindex, 10 ) : 7319 rfocusable.test( elem.nodeName ) || 7320 rclickable.test( elem.nodeName ) && elem.href ? 7321 0 : 7322 -1; 7323 } 7324 } 7325 }, 7326 7327 propFix: { 7328 "for": "htmlFor", 7329 "class": "className" 7330 } 7331} ); 7332 7333// Support: IE <=11 only 7334// Accessing the selectedIndex property 7335// forces the browser to respect setting selected 7336// on the option 7337// The getter ensures a default option is selected 7338// when in an optgroup 7339if ( !support.optSelected ) { 7340 jQuery.propHooks.selected = { 7341 get: function( elem ) { 7342 var parent = elem.parentNode; 7343 if ( parent && parent.parentNode ) { 7344 parent.parentNode.selectedIndex; 7345 } 7346 return null; 7347 }, 7348 set: function( elem ) { 7349 var parent = elem.parentNode; 7350 if ( parent ) { 7351 parent.selectedIndex; 7352 7353 if ( parent.parentNode ) { 7354 parent.parentNode.selectedIndex; 7355 } 7356 } 7357 } 7358 }; 7359} 7360 7361jQuery.each( [ 7362 "tabIndex", 7363 "readOnly", 7364 "maxLength", 7365 "cellSpacing", 7366 "cellPadding", 7367 "rowSpan", 7368 "colSpan", 7369 "useMap", 7370 "frameBorder", 7371 "contentEditable" 7372], function() { 7373 jQuery.propFix[ this.toLowerCase() ] = this; 7374} ); 7375 7376 7377 7378 7379var rclass = /[\t\r\n\f]/g; 7380 7381function getClass( elem ) { 7382 return elem.getAttribute && elem.getAttribute( "class" ) || ""; 7383} 7384 7385jQuery.fn.extend( { 7386 addClass: function( value ) { 7387 var classes, elem, cur, curValue, clazz, j, finalValue, 7388 i = 0; 7389 7390 if ( jQuery.isFunction( value ) ) { 7391 return this.each( function( j ) { 7392 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); 7393 } ); 7394 } 7395 7396 if ( typeof value === "string" && value ) { 7397 classes = value.match( rnotwhite ) || []; 7398 7399 while ( ( elem = this[ i++ ] ) ) { 7400 curValue = getClass( elem ); 7401 cur = elem.nodeType === 1 && 7402 ( " " + curValue + " " ).replace( rclass, " " ); 7403 7404 if ( cur ) { 7405 j = 0; 7406 while ( ( clazz = classes[ j++ ] ) ) { 7407 if ( cur.indexOf( " " + clazz + " " ) < 0 ) { 7408 cur += clazz + " "; 7409 } 7410 } 7411 7412 // Only assign if different to avoid unneeded rendering. 7413 finalValue = jQuery.trim( cur ); 7414 if ( curValue !== finalValue ) { 7415 elem.setAttribute( "class", finalValue ); 7416 } 7417 } 7418 } 7419 } 7420 7421 return this; 7422 }, 7423 7424 removeClass: function( value ) { 7425 var classes, elem, cur, curValue, clazz, j, finalValue, 7426 i = 0; 7427 7428 if ( jQuery.isFunction( value ) ) { 7429 return this.each( function( j ) { 7430 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); 7431 } ); 7432 } 7433 7434 if ( !arguments.length ) { 7435 return this.attr( "class", "" ); 7436 } 7437 7438 if ( typeof value === "string" && value ) { 7439 classes = value.match( rnotwhite ) || []; 7440 7441 while ( ( elem = this[ i++ ] ) ) { 7442 curValue = getClass( elem ); 7443 7444 // This expression is here for better compressibility (see addClass) 7445 cur = elem.nodeType === 1 && 7446 ( " " + curValue + " " ).replace( rclass, " " ); 7447 7448 if ( cur ) { 7449 j = 0; 7450 while ( ( clazz = classes[ j++ ] ) ) { 7451 7452 // Remove *all* instances 7453 while ( cur.indexOf( " " + clazz + " " ) > -1 ) { 7454 cur = cur.replace( " " + clazz + " ", " " ); 7455 } 7456 } 7457 7458 // Only assign if different to avoid unneeded rendering. 7459 finalValue = jQuery.trim( cur ); 7460 if ( curValue !== finalValue ) { 7461 elem.setAttribute( "class", finalValue ); 7462 } 7463 } 7464 } 7465 } 7466 7467 return this; 7468 }, 7469 7470 toggleClass: function( value, stateVal ) { 7471 var type = typeof value; 7472 7473 if ( typeof stateVal === "boolean" && type === "string" ) { 7474 return stateVal ? this.addClass( value ) : this.removeClass( value ); 7475 } 7476 7477 if ( jQuery.isFunction( value ) ) { 7478 return this.each( function( i ) { 7479 jQuery( this ).toggleClass( 7480 value.call( this, i, getClass( this ), stateVal ), 7481 stateVal 7482 ); 7483 } ); 7484 } 7485 7486 return this.each( function() { 7487 var className, i, self, classNames; 7488 7489 if ( type === "string" ) { 7490 7491 // Toggle individual class names 7492 i = 0; 7493 self = jQuery( this ); 7494 classNames = value.match( rnotwhite ) || []; 7495 7496 while ( ( className = classNames[ i++ ] ) ) { 7497 7498 // Check each className given, space separated list 7499 if ( self.hasClass( className ) ) { 7500 self.removeClass( className ); 7501 } else { 7502 self.addClass( className ); 7503 } 7504 } 7505 7506 // Toggle whole class name 7507 } else if ( value === undefined || type === "boolean" ) { 7508 className = getClass( this ); 7509 if ( className ) { 7510 7511 // Store className if set 7512 dataPriv.set( this, "__className__", className ); 7513 } 7514 7515 // If the element has a class name or if we're passed `false`, 7516 // then remove the whole classname (if there was one, the above saved it). 7517 // Otherwise bring back whatever was previously saved (if anything), 7518 // falling back to the empty string if nothing was stored. 7519 if ( this.setAttribute ) { 7520 this.setAttribute( "class", 7521 className || value === false ? 7522 "" : 7523 dataPriv.get( this, "__className__" ) || "" 7524 ); 7525 } 7526 } 7527 } ); 7528 }, 7529 7530 hasClass: function( selector ) { 7531 var className, elem, 7532 i = 0; 7533 7534 className = " " + selector + " "; 7535 while ( ( elem = this[ i++ ] ) ) { 7536 if ( elem.nodeType === 1 && 7537 ( " " + getClass( elem ) + " " ).replace( rclass, " " ) 7538 .indexOf( className ) > -1 7539 ) { 7540 return true; 7541 } 7542 } 7543 7544 return false; 7545 } 7546} ); 7547 7548 7549 7550 7551var rreturn = /\r/g, 7552 rspaces = /[\x20\t\r\n\f]+/g; 7553 7554jQuery.fn.extend( { 7555 val: function( value ) { 7556 var hooks, ret, isFunction, 7557 elem = this[ 0 ]; 7558 7559 if ( !arguments.length ) { 7560 if ( elem ) { 7561 hooks = jQuery.valHooks[ elem.type ] || 7562 jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 7563 7564 if ( hooks && 7565 "get" in hooks && 7566 ( ret = hooks.get( elem, "value" ) ) !== undefined 7567 ) { 7568 return ret; 7569 } 7570 7571 ret = elem.value; 7572 7573 return typeof ret === "string" ? 7574 7575 // Handle most common string cases 7576 ret.replace( rreturn, "" ) : 7577 7578 // Handle cases where value is null/undef or number 7579 ret == null ? "" : ret; 7580 } 7581 7582 return; 7583 } 7584 7585 isFunction = jQuery.isFunction( value ); 7586 7587 return this.each( function( i ) { 7588 var val; 7589 7590 if ( this.nodeType !== 1 ) { 7591 return; 7592 } 7593 7594 if ( isFunction ) { 7595 val = value.call( this, i, jQuery( this ).val() ); 7596 } else { 7597 val = value; 7598 } 7599 7600 // Treat null/undefined as ""; convert numbers to string 7601 if ( val == null ) { 7602 val = ""; 7603 7604 } else if ( typeof val === "number" ) { 7605 val += ""; 7606 7607 } else if ( jQuery.isArray( val ) ) { 7608 val = jQuery.map( val, function( value ) { 7609 return value == null ? "" : value + ""; 7610 } ); 7611 } 7612 7613 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 7614 7615 // If set returns undefined, fall back to normal setting 7616 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { 7617 this.value = val; 7618 } 7619 } ); 7620 } 7621} ); 7622 7623jQuery.extend( { 7624 valHooks: { 7625 option: { 7626 get: function( elem ) { 7627 7628 var val = jQuery.find.attr( elem, "value" ); 7629 return val != null ? 7630 val : 7631 7632 // Support: IE10-11+ 7633 // option.text throws exceptions (#14686, #14858) 7634 // Strip and collapse whitespace 7635 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace 7636 jQuery.trim( jQuery.text( elem ) ).replace( rspaces, " " ); 7637 } 7638 }, 7639 select: { 7640 get: function( elem ) { 7641 var value, option, 7642 options = elem.options, 7643 index = elem.selectedIndex, 7644 one = elem.type === "select-one" || index < 0, 7645 values = one ? null : [], 7646 max = one ? index + 1 : options.length, 7647 i = index < 0 ? 7648 max : 7649 one ? index : 0; 7650 7651 // Loop through all the selected options 7652 for ( ; i < max; i++ ) { 7653 option = options[ i ]; 7654 7655 // IE8-9 doesn't update selected after form reset (#2551) 7656 if ( ( option.selected || i === index ) && 7657 7658 // Don't return options that are disabled or in a disabled optgroup 7659 ( support.optDisabled ? 7660 !option.disabled : option.getAttribute( "disabled" ) === null ) && 7661 ( !option.parentNode.disabled || 7662 !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { 7663 7664 // Get the specific value for the option 7665 value = jQuery( option ).val(); 7666 7667 // We don't need an array for one selects 7668 if ( one ) { 7669 return value; 7670 } 7671 7672 // Multi-Selects return an array 7673 values.push( value ); 7674 } 7675 } 7676 7677 return values; 7678 }, 7679 7680 set: function( elem, value ) { 7681 var optionSet, option, 7682 options = elem.options, 7683 values = jQuery.makeArray( value ), 7684 i = options.length; 7685 7686 while ( i-- ) { 7687 option = options[ i ]; 7688 if ( option.selected = 7689 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 7690 ) { 7691 optionSet = true; 7692 } 7693 } 7694 7695 // Force browsers to behave consistently when non-matching value is set 7696 if ( !optionSet ) { 7697 elem.selectedIndex = -1; 7698 } 7699 return values; 7700 } 7701 } 7702 } 7703} ); 7704 7705// Radios and checkboxes getter/setter 7706jQuery.each( [ "radio", "checkbox" ], function() { 7707 jQuery.valHooks[ this ] = { 7708 set: function( elem, value ) { 7709 if ( jQuery.isArray( value ) ) { 7710 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); 7711 } 7712 } 7713 }; 7714 if ( !support.checkOn ) { 7715 jQuery.valHooks[ this ].get = function( elem ) { 7716 return elem.getAttribute( "value" ) === null ? "on" : elem.value; 7717 }; 7718 } 7719} ); 7720 7721 7722 7723 7724// Return jQuery for attributes-only inclusion 7725 7726 7727var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/; 7728 7729jQuery.extend( jQuery.event, { 7730 7731 trigger: function( event, data, elem, onlyHandlers ) { 7732 7733 var i, cur, tmp, bubbleType, ontype, handle, special, 7734 eventPath = [ elem || document ], 7735 type = hasOwn.call( event, "type" ) ? event.type : event, 7736 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; 7737 7738 cur = tmp = elem = elem || document; 7739 7740 // Don't do events on text and comment nodes 7741 if ( elem.nodeType === 3 || elem.nodeType === 8 ) { 7742 return; 7743 } 7744 7745 // focus/blur morphs to focusin/out; ensure we're not firing them right now 7746 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { 7747 return; 7748 } 7749 7750 if ( type.indexOf( "." ) > -1 ) { 7751 7752 // Namespaced trigger; create a regexp to match event type in handle() 7753 namespaces = type.split( "." ); 7754 type = namespaces.shift(); 7755 namespaces.sort(); 7756 } 7757 ontype = type.indexOf( ":" ) < 0 && "on" + type; 7758 7759 // Caller can pass in a jQuery.Event object, Object, or just an event type string 7760 event = event[ jQuery.expando ] ? 7761 event : 7762 new jQuery.Event( type, typeof event === "object" && event ); 7763 7764 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) 7765 event.isTrigger = onlyHandlers ? 2 : 3; 7766 event.namespace = namespaces.join( "." ); 7767 event.rnamespace = event.namespace ? 7768 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : 7769 null; 7770 7771 // Clean up the event in case it is being reused 7772 event.result = undefined; 7773 if ( !event.target ) { 7774 event.target = elem; 7775 } 7776 7777 // Clone any incoming data and prepend the event, creating the handler arg list 7778 data = data == null ? 7779 [ event ] : 7780 jQuery.makeArray( data, [ event ] ); 7781 7782 // Allow special events to draw outside the lines 7783 special = jQuery.event.special[ type ] || {}; 7784 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { 7785 return; 7786 } 7787 7788 // Determine event propagation path in advance, per W3C events spec (#9951) 7789 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) 7790 if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { 7791 7792 bubbleType = special.delegateType || type; 7793 if ( !rfocusMorph.test( bubbleType + type ) ) { 7794 cur = cur.parentNode; 7795 } 7796 for ( ; cur; cur = cur.parentNode ) { 7797 eventPath.push( cur ); 7798 tmp = cur; 7799 } 7800 7801 // Only add window if we got to document (e.g., not plain obj or detached DOM) 7802 if ( tmp === ( elem.ownerDocument || document ) ) { 7803 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 7804 } 7805 } 7806 7807 // Fire handlers on the event path 7808 i = 0; 7809 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { 7810 7811 event.type = i > 1 ? 7812 bubbleType : 7813 special.bindType || type; 7814 7815 // jQuery handler 7816 handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] && 7817 dataPriv.get( cur, "handle" ); 7818 if ( handle ) { 7819 handle.apply( cur, data ); 7820 } 7821 7822 // Native handler 7823 handle = ontype && cur[ ontype ]; 7824 if ( handle && handle.apply && acceptData( cur ) ) { 7825 event.result = handle.apply( cur, data ); 7826 if ( event.result === false ) { 7827 event.preventDefault(); 7828 } 7829 } 7830 } 7831 event.type = type; 7832 7833 // If nobody prevented the default action, do it now 7834 if ( !onlyHandlers && !event.isDefaultPrevented() ) { 7835 7836 if ( ( !special._default || 7837 special._default.apply( eventPath.pop(), data ) === false ) && 7838 acceptData( elem ) ) { 7839 7840 // Call a native DOM method on the target with the same name name as the event. 7841 // Don't do default actions on window, that's where global variables be (#6170) 7842 if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) { 7843 7844 // Don't re-trigger an onFOO event when we call its FOO() method 7845 tmp = elem[ ontype ]; 7846 7847 if ( tmp ) { 7848 elem[ ontype ] = null; 7849 } 7850 7851 // Prevent re-triggering of the same event, since we already bubbled it above 7852 jQuery.event.triggered = type; 7853 elem[ type ](); 7854 jQuery.event.triggered = undefined; 7855 7856 if ( tmp ) { 7857 elem[ ontype ] = tmp; 7858 } 7859 } 7860 } 7861 } 7862 7863 return event.result; 7864 }, 7865 7866 // Piggyback on a donor event to simulate a different one 7867
7867simulate: function( type, elem, event ) { 7868 var e = jQuery.extend( 7869 new jQuery.Event(), 7870 event, 7871 { 7872 type: type, 7873 isSimulated: true 7874 7875 // Previously, `originalEvent: {}` was set here, so stopPropagation call 7876 // would not be triggered on donor event, since in our own 7877 // jQuery.event.stopPropagation function we had a check for existence of 7878 // originalEvent.stopPropagation method, so, consequently it would be a noop. 7879 // 7880 // But now, this "simulate" function is used only for events 7881 // for which stopPropagation() is noop, so there is no need for that anymore. 7882 // 7883 // For the 1.x branch though, guard for "click" and "submit" 7884 // events is still used, but was moved to jQuery.event.stopPropagation function 7885 // because `originalEvent` should point to the original event for the constancy 7886 // with other events and for more focused logic 7887 } 7888 ); 7889 7890 jQuery.event.trigger( e, null, elem ); 7891 7892 if ( e.isDefaultPrevented() ) { 7893 event.preventDefault(); 7894 }
vendor: 40,185 bytes, lines 7894-9478
7894 7895 } 7896 7897} ); 7898 7899jQuery.fn.extend( { 7900 7901 trigger: function( type, data ) { 7902 return this.each( function() { 7903 jQuery.event.trigger( type, data, this ); 7904 } ); 7905 }, 7906 triggerHandler: function( type, data ) { 7907 var elem = this[ 0 ]; 7908 if ( elem ) { 7909 return jQuery.event.trigger( type, data, elem, true ); 7910 } 7911 } 7912} ); 7913 7914 7915jQuery.each( ( "blur focus focusin focusout load resize scroll unload click dblclick " + 7916 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 7917 "change select submit keydown keypress keyup error contextmenu" ).split( " " ), 7918 function( i, name ) { 7919 7920 // Handle event binding 7921 jQuery.fn[ name ] = function( data, fn ) { 7922 return arguments.length > 0 ? 7923 this.on( name, null, data, fn ) : 7924 this.trigger( name ); 7925 }; 7926} ); 7927 7928jQuery.fn.extend( { 7929 hover: function( fnOver, fnOut ) { 7930 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 7931 } 7932} ); 7933 7934 7935 7936 7937support.focusin = "onfocusin" in window; 7938 7939 7940// Support: Firefox 7941// Firefox doesn't have focus(in | out) events 7942// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 7943// 7944// Support: Chrome, Safari 7945// focus(in | out) events fire after focus & blur events, 7946// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order 7947// Related ticket - https://code.google.com/p/chromium/issues/detail?id=449857 7948if ( !support.focusin ) { 7949 jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { 7950 7951 // Attach a single capturing handler on the document while someone wants focusin/focusout 7952 var handler = function( event ) { 7953 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); 7954 }; 7955 7956 jQuery.event.special[ fix ] = { 7957 setup: function() { 7958 var doc = this.ownerDocument || this, 7959 attaches = dataPriv.access( doc, fix ); 7960 7961 if ( !attaches ) { 7962 doc.addEventListener( orig, handler, true ); 7963 } 7964 dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); 7965 }, 7966 teardown: function() { 7967 var doc = this.ownerDocument || this, 7968 attaches = dataPriv.access( doc, fix ) - 1; 7969 7970 if ( !attaches ) { 7971 doc.removeEventListener( orig, handler, true ); 7972 dataPriv.remove( doc, fix ); 7973 7974 } else { 7975 dataPriv.access( doc, fix, attaches ); 7976 } 7977 } 7978 }; 7979 } ); 7980} 7981var location = window.location; 7982 7983var nonce = jQuery.now(); 7984 7985var rquery = ( /\?/ ); 7986 7987 7988 7989// Support: Android 2.3 7990// Workaround failure to string-cast null input 7991jQuery.parseJSON = function( data ) { 7992 return JSON.parse( data + "" ); 7993}; 7994 7995 7996// Cross-browser xml parsing 7997jQuery.parseXML = function( data ) { 7998 var xml; 7999 if ( !data || typeof data !== "string" ) { 8000 return null; 8001 } 8002 8003 // Support: IE9 8004 try { 8005 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); 8006 } catch ( e ) { 8007 xml = undefined; 8008 } 8009 8010 if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { 8011 jQuery.error( "Invalid XML: " + data ); 8012 } 8013 return xml; 8014}; 8015 8016 8017var 8018 rhash = /#.*$/, 8019 rts = /([?&])_=[^&]*/, 8020 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, 8021 8022 // #7653, #8125, #8152: local protocol detection 8023 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 8024 rnoContent = /^(?:GET|HEAD)$/, 8025 rprotocol = /^\/\//, 8026 8027 /* Prefilters 8028 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 8029 * 2) These are called: 8030 * - BEFORE asking for a transport 8031 * - AFTER param serialization (s.data is a string if s.processData is true) 8032 * 3) key is the dataType 8033 * 4) the catchall symbol "*" can be used 8034 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 8035 */ 8036 prefilters = {}, 8037 8038 /* Transports bindings 8039 * 1) key is the dataType 8040 * 2) the catchall symbol "*" can be used 8041 * 3) selection will start with transport dataType and THEN go to "*" if needed 8042 */ 8043 transports = {}, 8044 8045 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression 8046 allTypes = "*/".concat( "*" ), 8047 8048 // Anchor tag for parsing the document origin 8049 originAnchor = document.createElement( "a" ); 8050 originAnchor.href = location.href; 8051 8052// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 8053function addToPrefiltersOrTransports( structure ) { 8054 8055 // dataTypeExpression is optional and defaults to "*" 8056 return function( dataTypeExpression, func ) { 8057 8058 if ( typeof dataTypeExpression !== "string" ) { 8059 func = dataTypeExpression; 8060 dataTypeExpression = "*"; 8061 } 8062 8063 var dataType, 8064 i = 0, 8065 dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || []; 8066 8067 if ( jQuery.isFunction( func ) ) { 8068 8069 // For each dataType in the dataTypeExpression 8070 while ( ( dataType = dataTypes[ i++ ] ) ) { 8071 8072 // Prepend if requested 8073 if ( dataType[ 0 ] === "+" ) { 8074 dataType = dataType.slice( 1 ) || "*"; 8075 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); 8076 8077 // Otherwise append 8078 } else { 8079 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); 8080 } 8081 } 8082 } 8083 }; 8084} 8085 8086// Base inspection function for prefilters and transports 8087function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { 8088 8089 var inspected = {}, 8090 seekingTransport = ( structure === transports ); 8091 8092 function inspect( dataType ) { 8093 var selected; 8094 inspected[ dataType ] = true; 8095 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { 8096 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); 8097 if ( typeof dataTypeOrTransport === "string" && 8098 !seekingTransport && !inspected[ dataTypeOrTransport ] ) { 8099 8100 options.dataTypes.unshift( dataTypeOrTransport ); 8101 inspect( dataTypeOrTransport ); 8102 return false; 8103 } else if ( seekingTransport ) { 8104 return !( selected = dataTypeOrTransport ); 8105 } 8106 } ); 8107 return selected; 8108 } 8109 8110 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); 8111} 8112 8113// A special extend for ajax options 8114// that takes "flat" options (not to be deep extended) 8115// Fixes #9887 8116function ajaxExtend( target, src ) { 8117 var key, deep, 8118 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 8119 8120 for ( key in src ) { 8121 if ( src[ key ] !== undefined ) { 8122 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; 8123 } 8124 } 8125 if ( deep ) { 8126 jQuery.extend( true, target, deep ); 8127 } 8128 8129 return target; 8130} 8131 8132/* Handles responses to an ajax request: 8133 * - finds the right dataType (mediates between content-type and expected dataType) 8134 * - returns the corresponding response 8135 */ 8136function ajaxHandleResponses( s, jqXHR, responses ) { 8137 8138 var ct, type, finalDataType, firstDataType, 8139 contents = s.contents, 8140 dataTypes = s.dataTypes; 8141 8142 // Remove auto dataType and get content-type in the process 8143 while ( dataTypes[ 0 ] === "*" ) { 8144 dataTypes.shift(); 8145 if ( ct === undefined ) { 8146 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); 8147 } 8148 } 8149 8150 // Check if we're dealing with a known content-type 8151 if ( ct ) { 8152 for ( type in contents ) { 8153 if ( contents[ type ] && contents[ type ].test( ct ) ) { 8154 dataTypes.unshift( type ); 8155 break; 8156 } 8157 } 8158 } 8159 8160 // Check to see if we have a response for the expected dataType 8161 if ( dataTypes[ 0 ] in responses ) { 8162 finalDataType = dataTypes[ 0 ]; 8163 } else { 8164 8165 // Try convertible dataTypes 8166 for ( type in responses ) { 8167 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { 8168 finalDataType = type; 8169 break; 8170 } 8171 if ( !firstDataType ) { 8172 firstDataType = type; 8173 } 8174 } 8175 8176 // Or just use first one 8177 finalDataType = finalDataType || firstDataType; 8178 } 8179 8180 // If we found a dataType 8181 // We add the dataType to the list if needed 8182 // and return the corresponding response 8183 if ( finalDataType ) { 8184 if ( finalDataType !== dataTypes[ 0 ] ) { 8185 dataTypes.unshift( finalDataType ); 8186 } 8187 return responses[ finalDataType ]; 8188 } 8189} 8190 8191/* Chain conversions given the request and the original response 8192 * Also sets the responseXXX fields on the jqXHR instance 8193 */ 8194function ajaxConvert( s, response, jqXHR, isSuccess ) { 8195 var conv2, current, conv, tmp, prev, 8196 converters = {}, 8197 8198 // Work with a copy of dataTypes in case we need to modify it for conversion 8199 dataTypes = s.dataTypes.slice(); 8200 8201 // Create converters map with lowercased keys 8202 if ( dataTypes[ 1 ] ) { 8203 for ( conv in s.converters ) { 8204 converters[ conv.toLowerCase() ] = s.converters[ conv ]; 8205 } 8206 } 8207 8208 current = dataTypes.shift(); 8209 8210 // Convert to each sequential dataType 8211 while ( current ) { 8212 8213 if ( s.responseFields[ current ] ) { 8214 jqXHR[ s.responseFields[ current ] ] = response; 8215 } 8216 8217 // Apply the dataFilter if provided 8218 if ( !prev && isSuccess && s.dataFilter ) { 8219 response = s.dataFilter( response, s.dataType ); 8220 } 8221 8222 prev = current; 8223 current = dataTypes.shift(); 8224 8225 if ( current ) { 8226 8227 // There's only work to do if current dataType is non-auto 8228 if ( current === "*" ) { 8229 8230 current = prev; 8231 8232 // Convert response if prev dataType is non-auto and differs from current 8233 } else if ( prev !== "*" && prev !== current ) { 8234 8235 // Seek a direct converter 8236 conv = converters[ prev + " " + current ] || converters[ "* " + current ]; 8237 8238 // If none found, seek a pair 8239 if ( !conv ) { 8240 for ( conv2 in converters ) { 8241 8242 // If conv2 outputs current 8243 tmp = conv2.split( " " ); 8244 if ( tmp[ 1 ] === current ) { 8245 8246 // If prev can be converted to accepted input 8247 conv = converters[ prev + " " + tmp[ 0 ] ] || 8248 converters[ "* " + tmp[ 0 ] ]; 8249 if ( conv ) { 8250 8251 // Condense equivalence converters 8252 if ( conv === true ) { 8253 conv = converters[ conv2 ]; 8254 8255 // Otherwise, insert the intermediate dataType 8256 } else if ( converters[ conv2 ] !== true ) { 8257 current = tmp[ 0 ]; 8258 dataTypes.unshift( tmp[ 1 ] ); 8259 } 8260 break; 8261 } 8262 } 8263 } 8264 } 8265 8266 // Apply converter (if not an equivalence) 8267 if ( conv !== true ) { 8268 8269 // Unless errors are allowed to bubble, catch and return them 8270 if ( conv && s.throws ) { 8271 response = conv( response ); 8272 } else { 8273 try { 8274 response = conv( response ); 8275 } catch ( e ) { 8276 return { 8277 state: "parsererror", 8278 error: conv ? e : "No conversion from " + prev + " to " + current 8279 }; 8280 } 8281 } 8282 } 8283 } 8284 } 8285 } 8286 8287 return { state: "success", data: response }; 8288} 8289 8290jQuery.extend( { 8291 8292 // Counter for holding the number of active queries 8293 active: 0, 8294 8295 // Last-Modified header cache for next request 8296 lastModified: {}, 8297 etag: {}, 8298 8299 ajaxSettings: { 8300 url: location.href, 8301 type: "GET", 8302 isLocal: rlocalProtocol.test( location.protocol ), 8303 global: true, 8304 processData: true, 8305 async: true, 8306 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 8307 /* 8308 timeout: 0, 8309 data: null, 8310 dataType: null, 8311 username: null, 8312 password: null, 8313 cache: null, 8314 throws: false, 8315 traditional: false, 8316 headers: {}, 8317 */ 8318 8319 accepts: { 8320 "*": allTypes, 8321 text: "text/plain", 8322 html: "text/html", 8323 xml: "application/xml, text/xml", 8324 json: "application/json, text/javascript" 8325 }, 8326 8327 contents: { 8328 xml: /\bxml\b/, 8329 html: /\bhtml/, 8330 json: /\bjson\b/ 8331 }, 8332 8333 responseFields: { 8334 xml: "responseXML", 8335 text: "responseText", 8336 json: "responseJSON" 8337 }, 8338 8339 // Data converters 8340 // Keys separate source (or catchall "*") and destination types with a single space 8341 converters: { 8342 8343 // Convert anything to text 8344 "* text": String, 8345 8346 // Text to html (true = no transformation) 8347 "text html": true, 8348 8349 // Evaluate text as a json expression 8350 "text json": jQuery.parseJSON, 8351 8352 // Parse text as xml 8353 "text xml": jQuery.parseXML 8354 }, 8355 8356 // For options that shouldn't be deep extended: 8357 // you can add your own custom options here if 8358 // and when you create one that shouldn't be 8359 // deep extended (see ajaxExtend) 8360 flatOptions: { 8361 url: true, 8362 context: true 8363 } 8364 }, 8365 8366 // Creates a full fledged settings object into target 8367 // with both ajaxSettings and settings fields. 8368 // If target is omitted, writes into ajaxSettings. 8369 ajaxSetup: function( target, settings ) { 8370 return settings ? 8371 8372 // Building a settings object 8373 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : 8374 8375 // Extending ajaxSettings 8376 ajaxExtend( jQuery.ajaxSettings, target ); 8377 }, 8378 8379 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), 8380 ajaxTransport: addToPrefiltersOrTransports( transports ), 8381 8382 // Main method 8383 ajax: function( url, options ) { 8384 8385 // If url is an object, simulate pre-1.5 signature 8386 if ( typeof url === "object" ) { 8387 options = url; 8388 url = undefined; 8389 } 8390 8391 // Force options to be an object 8392 options = options || {}; 8393 8394 var transport, 8395 8396 // URL without anti-cache param 8397 cacheURL, 8398 8399 // Response headers 8400 responseHeadersString, 8401 responseHeaders, 8402 8403 // timeout handle 8404 timeoutTimer, 8405 8406 // Url cleanup var 8407 urlAnchor, 8408 8409 // To know if global events are to be dispatched 8410 fireGlobals, 8411 8412 // Loop variable 8413 i, 8414 8415 // Create the final options object 8416 s = jQuery.ajaxSetup( {}, options ), 8417 8418 // Callbacks context 8419 callbackContext = s.context || s, 8420 8421 // Context for global events is callbackContext if it is a DOM node or jQuery collection 8422 globalEventContext = s.context && 8423 ( callbackContext.nodeType || callbackContext.jquery ) ? 8424 jQuery( callbackContext ) : 8425 jQuery.event, 8426 8427 // Deferreds 8428 deferred = jQuery.Deferred(), 8429 completeDeferred = jQuery.Callbacks( "once memory" ), 8430 8431 // Status-dependent callbacks 8432 statusCode = s.statusCode || {}, 8433 8434 // Headers (they are sent all at once) 8435 requestHeaders = {}, 8436 requestHeadersNames = {}, 8437 8438 // The jqXHR state 8439 state = 0, 8440 8441 // Default abort message 8442 strAbort = "canceled", 8443 8444 // Fake xhr 8445 jqXHR = { 8446 readyState: 0, 8447 8448 // Builds headers hashtable if needed 8449 getResponseHeader: function( key ) { 8450 var match; 8451 if ( state === 2 ) { 8452 if ( !responseHeaders ) { 8453 responseHeaders = {}; 8454 while ( ( match = rheaders.exec( responseHeadersString ) ) ) { 8455 responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ]; 8456 } 8457 } 8458 match = responseHeaders[ key.toLowerCase() ]; 8459 } 8460 return match == null ? null : match; 8461 }, 8462 8463 // Raw string 8464 getAllResponseHeaders: function() { 8465 return state === 2 ? responseHeadersString : null; 8466 }, 8467 8468 // Caches the header 8469 setRequestHeader: function( name, value ) { 8470 var lname = name.toLowerCase(); 8471 if ( !state ) { 8472 name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; 8473 requestHeaders[ name ] = value; 8474 } 8475 return this; 8476 }, 8477 8478 // Overrides response content-type header 8479 overrideMimeType: function( type ) { 8480 if ( !state ) { 8481 s.mimeType = type; 8482 } 8483 return this; 8484 }, 8485 8486 // Status-dependent callbacks 8487 statusCode: function( map ) { 8488 var code; 8489 if ( map ) { 8490 if ( state < 2 ) { 8491 for ( code in map ) { 8492 8493 // Lazy-add the new callback in a way that preserves old ones 8494 statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; 8495 } 8496 } else { 8497 8498 // Execute the appropriate callbacks 8499 jqXHR.always( map[ jqXHR.status ] ); 8500 } 8501 } 8502 return this; 8503 }, 8504 8505 // Cancel the request 8506 abort: function( statusText ) { 8507 var finalText = statusText || strAbort; 8508 if ( transport ) { 8509 transport.abort( finalText ); 8510 } 8511 done( 0, finalText ); 8512 return this; 8513 } 8514 }; 8515 8516 // Attach deferreds 8517 deferred.promise( jqXHR ).complete = completeDeferred.add; 8518 jqXHR.success = jqXHR.done; 8519 jqXHR.error = jqXHR.fail; 8520 8521 // Remove hash character (#7531: and string promotion) 8522 // Add protocol if not provided (prefilters might expect it) 8523 // Handle falsy url in the settings object (#10093: consistency with old signature) 8524 // We also use the url parameter if available 8525 s.url = ( ( url || s.url || location.href ) + "" ).replace( rhash, "" ) 8526 .replace( rprotocol, location.protocol + "//" ); 8527 8528 // Alias method option to type as per ticket #12004 8529 s.type = options.method || options.type || s.method || s.type; 8530 8531 // Extract dataTypes list 8532 s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ]; 8533 8534 // A cross-domain request is in order when the origin doesn't match the current origin. 8535 if ( s.crossDomain == null ) { 8536 urlAnchor = document.createElement( "a" ); 8537 8538 // Support: IE8-11+ 8539 // IE throws exception if url is malformed, e.g. http://example.com:80x/ 8540 try { 8541 urlAnchor.href = s.url; 8542 8543 // Support: IE8-11+ 8544 // Anchor's host property isn't correctly set when s.url is relative 8545 urlAnchor.href = urlAnchor.href; 8546 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== 8547 urlAnchor.protocol + "//" + urlAnchor.host; 8548 } catch ( e ) { 8549 8550 // If there is an error parsing the URL, assume it is crossDomain, 8551 // it can be rejected by the transport if it is invalid 8552 s.crossDomain = true; 8553 } 8554 } 8555 8556 // Convert data if not already a string 8557 if ( s.data && s.processData && typeof s.data !== "string" ) { 8558 s.data = jQuery.param( s.data, s.traditional ); 8559 } 8560 8561 // Apply prefilters 8562 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 8563 8564 // If request was aborted inside a prefilter, stop there 8565 if ( state === 2 ) { 8566 return jqXHR; 8567 } 8568 8569 // We can fire global events as of now if asked to 8570 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) 8571 fireGlobals = jQuery.event && s.global; 8572 8573 // Watch for a new set of requests 8574 if ( fireGlobals && jQuery.active++ === 0 ) { 8575 jQuery.event.trigger( "ajaxStart" ); 8576 } 8577 8578 // Uppercase the type 8579 s.type = s.type.toUpperCase(); 8580 8581 // Determine if request has content 8582 s.hasContent = !rnoContent.test( s.type ); 8583 8584 // Save the URL in case we're toying with the If-Modified-Since 8585 // and/or If-None-Match header later on 8586 cacheURL = s.url; 8587 8588 // More options handling for requests with no content 8589 if ( !s.hasContent ) { 8590 8591 // If data is available, append data to url 8592 if ( s.data ) { 8593 cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); 8594 8595 // #9682: remove data so that it's not used in an eventual retry 8596 delete s.data; 8597 } 8598 8599 // Add anti-cache in url if needed 8600 if ( s.cache === false ) { 8601 s.url = rts.test( cacheURL ) ? 8602 8603 // If there is already a '_' parameter, set its value 8604 cacheURL.replace( rts, "$1_=" + nonce++ ) : 8605 8606 // Otherwise add one to the end 8607 cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++; 8608 } 8609 } 8610 8611 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 8612 if ( s.ifModified ) { 8613 if ( jQuery.lastModified[ cacheURL ] ) { 8614 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); 8615 } 8616 if ( jQuery.etag[ cacheURL ] ) { 8617 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); 8618 } 8619 } 8620 8621 // Set the correct header, if data is being sent 8622 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { 8623 jqXHR.setRequestHeader( "Content-Type", s.contentType ); 8624 } 8625 8626 // Set the Accepts header for the server, depending on the dataType 8627 jqXHR.setRequestHeader( 8628 "Accept", 8629 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? 8630 s.accepts[ s.dataTypes[ 0 ] ] + 8631 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 8632 s.accepts[ "*" ] 8633 ); 8634 8635 // Check for headers option 8636 for ( i in s.headers ) { 8637 jqXHR.setRequestHeader( i, s.headers[ i ] ); 8638 } 8639 8640 // Allow custom headers/mimetypes and early abort 8641 if ( s.beforeSend && 8642 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { 8643 8644 // Abort if not done already and return 8645 return jqXHR.abort(); 8646 } 8647 8648 // Aborting is no longer a cancellation 8649 strAbort = "abort"; 8650 8651 // Install callbacks on deferreds 8652 for ( i in { success: 1, error: 1, complete: 1 } ) { 8653 jqXHR[ i ]( s[ i ] ); 8654 } 8655 8656 // Get transport 8657 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); 8658 8659 // If no transport, we auto-abort 8660 if ( !transport ) { 8661 done( -1, "No Transport" ); 8662 } else { 8663 jqXHR.readyState = 1; 8664 8665 // Send global event 8666 if ( fireGlobals ) { 8667 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); 8668 } 8669 8670 // If request was aborted inside ajaxSend, stop there 8671 if ( state === 2 ) { 8672 return jqXHR; 8673 } 8674 8675 // Timeout 8676 if ( s.async && s.timeout > 0 ) { 8677 timeoutTimer = window.setTimeout( function() { 8678 jqXHR.abort( "timeout" ); 8679 }, s.timeout ); 8680 } 8681 8682 try { 8683 state = 1; 8684 transport.send( requestHeaders, done ); 8685 } catch ( e ) { 8686 8687 // Propagate exception as error if not done 8688 if ( state < 2 ) { 8689 done( -1, e ); 8690 8691 // Simply rethrow otherwise 8692 } else { 8693 throw e; 8694 } 8695 } 8696 } 8697 8698 // Callback for when everything is done 8699 function done( status, nativeStatusText, responses, headers ) { 8700 var isSuccess, success, error, response, modified, 8701 statusText = nativeStatusText; 8702 8703 // Called once 8704 if ( state === 2 ) { 8705 return; 8706 } 8707 8708 // State is "done" now 8709 state = 2; 8710 8711 // Clear timeout if it exists 8712 if ( timeoutTimer ) { 8713 window.clearTimeout( timeoutTimer ); 8714 } 8715 8716 // Dereference transport for early garbage collection 8717 // (no matter how long the jqXHR object will be used) 8718 transport = undefined; 8719 8720 // Cache response headers 8721 responseHeadersString = headers || ""; 8722 8723 // Set readyState 8724 jqXHR.readyState = status > 0 ? 4 : 0; 8725 8726 // Determine if successful 8727 isSuccess = status >= 200 && status < 300 || status === 304; 8728 8729 // Get response data 8730 if ( responses ) { 8731 response = ajaxHandleResponses( s, jqXHR, responses ); 8732 } 8733 8734 // Convert no matter what (that way responseXXX fields are always set) 8735 response = ajaxConvert( s, response, jqXHR, isSuccess ); 8736 8737 // If successful, handle type chaining 8738 if ( isSuccess ) { 8739 8740 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 8741 if ( s.ifModified ) { 8742 modified = jqXHR.getResponseHeader( "Last-Modified" ); 8743 if ( modified ) { 8744 jQuery.lastModified[ cacheURL ] = modified; 8745 } 8746 modified = jqXHR.getResponseHeader( "etag" ); 8747 if ( modified ) { 8748 jQuery.etag[ cacheURL ] = modified; 8749 } 8750 } 8751 8752 // if no content 8753 if ( status === 204 || s.type === "HEAD" ) { 8754 statusText = "nocontent"; 8755 8756 // if not modified 8757 } else if ( status === 304 ) { 8758 statusText = "notmodified"; 8759 8760 // If we have data, let's convert it 8761 } else { 8762 statusText = response.state; 8763 success = response.data; 8764 error = response.error; 8765 isSuccess = !error; 8766 } 8767 } else { 8768 8769 // Extract error from statusText and normalize for non-aborts 8770 error = statusText; 8771 if ( status || !statusText ) { 8772 statusText = "error"; 8773 if ( status < 0 ) { 8774 status = 0; 8775 } 8776 } 8777 } 8778 8779 // Set data for the fake xhr object 8780 jqXHR.status = status; 8781 jqXHR.statusText = ( nativeStatusText || statusText ) + ""; 8782 8783 // Success/Error 8784 if ( isSuccess ) { 8785 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); 8786 } else { 8787 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); 8788 } 8789 8790 // Status-dependent callbacks 8791 jqXHR.statusCode( statusCode ); 8792 statusCode = undefined; 8793 8794 if ( fireGlobals ) { 8795 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", 8796 [ jqXHR, s, isSuccess ? success : error ] ); 8797 } 8798 8799 // Complete 8800 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); 8801 8802 if ( fireGlobals ) { 8803 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 8804 8805 // Handle the global AJAX counter 8806 if ( !( --jQuery.active ) ) { 8807 jQuery.event.trigger( "ajaxStop" ); 8808 } 8809 } 8810 } 8811 8812 return jqXHR; 8813 }, 8814 8815 getJSON: function( url, data, callback ) { 8816 return jQuery.get( url, data, callback, "json" ); 8817 }, 8818 8819 getScript: function( url, callback ) { 8820 return jQuery.get( url, undefined, callback, "script" ); 8821 } 8822} ); 8823 8824jQuery.each( [ "get", "post" ], function( i, method ) { 8825 jQuery[ method ] = function( url, data, callback, type ) { 8826 8827 // Shift arguments if data argument was omitted 8828 if ( jQuery.isFunction( data ) ) { 8829 type = type || callback; 8830 callback = data; 8831 data = undefined; 8832 } 8833 8834 // The url can be an options object (which then must have .url) 8835 return jQuery.ajax( jQuery.extend( { 8836 url: url, 8837 type: method, 8838 dataType: type, 8839 data: data, 8840 success: callback 8841 }, jQuery.isPlainObject( url ) && url ) ); 8842 }; 8843} ); 8844 8845 8846jQuery._evalUrl = function( url ) { 8847 return jQuery.ajax( { 8848 url: url, 8849 8850 // Make this explicit, since user can override this through ajaxSetup (#11264) 8851 type: "GET", 8852 dataType: "script", 8853 async: false, 8854 global: false, 8855 "throws": true 8856 } ); 8857}; 8858 8859 8860jQuery.fn.extend( { 8861 wrapAll: function( html ) { 8862 var wrap; 8863 8864 if ( jQuery.isFunction( html ) ) { 8865 return this.each( function( i ) { 8866 jQuery( this ).wrapAll( html.call( this, i ) ); 8867 } ); 8868 } 8869 8870 if ( this[ 0 ] ) { 8871 8872 // The elements to wrap the target around 8873 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); 8874 8875 if ( this[ 0 ].parentNode ) { 8876 wrap.insertBefore( this[ 0 ] ); 8877 } 8878 8879 wrap.map( function() { 8880 var elem = this; 8881 8882 while ( elem.firstElementChild ) { 8883 elem = elem.firstElementChild; 8884 } 8885 8886 return elem; 8887 } ).append( this ); 8888 } 8889 8890 return this; 8891 }, 8892 8893 wrapInner: function( html ) { 8894 if ( jQuery.isFunction( html ) ) { 8895 return this.each( function( i ) { 8896 jQuery( this ).wrapInner( html.call( this, i ) ); 8897 } ); 8898 } 8899 8900 return this.each( function() { 8901 var self = jQuery( this ), 8902 contents = self.contents(); 8903 8904 if ( contents.length ) { 8905 contents.wrapAll( html ); 8906 8907 } else { 8908 self.append( html ); 8909 } 8910 } ); 8911 }, 8912 8913 wrap: function( html ) { 8914 var isFunction = jQuery.isFunction( html ); 8915 8916 return this.each( function( i ) { 8917 jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html ); 8918 } ); 8919 }, 8920 8921 unwrap: function() { 8922 return this.parent().each( function() { 8923 if ( !jQuery.nodeName( this, "body" ) ) { 8924 jQuery( this ).replaceWith( this.childNodes ); 8925 } 8926 } ).end(); 8927 } 8928} ); 8929 8930 8931jQuery.expr.filters.hidden = function( elem ) { 8932 return !jQuery.expr.filters.visible( elem ); 8933}; 8934jQuery.expr.filters.visible = function( elem ) { 8935 8936 // Support: Opera <= 12.12 8937 // Opera reports offsetWidths and offsetHeights less than zero on some elements 8938 // Use OR instead of AND as the element is not visible if either is true 8939 // See tickets #10406 and #13132 8940 return elem.offsetWidth > 0 || elem.offsetHeight > 0 || elem.getClientRects().length > 0; 8941}; 8942 8943 8944 8945 8946var r20 = /%20/g, 8947 rbracket = /\[\]$/, 8948 rCRLF = /\r?\n/g, 8949 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 8950 rsubmittable = /^(?:input|select|textarea|keygen)/i; 8951 8952function buildParams( prefix, obj, traditional, add ) { 8953 var name; 8954 8955 if ( jQuery.isArray( obj ) ) { 8956 8957 // Serialize array item. 8958 jQuery.each( obj, function( i, v ) { 8959 if ( traditional || rbracket.test( prefix ) ) { 8960 8961 // Treat each array item as a scalar. 8962 add( prefix, v ); 8963 8964 } else { 8965 8966 // Item is non-scalar (array or object), encode its numeric index. 8967 buildParams( 8968 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", 8969 v, 8970 traditional, 8971 add 8972 ); 8973 } 8974 } ); 8975 8976 } else if ( !traditional && jQuery.type( obj ) === "object" ) { 8977 8978 // Serialize object item. 8979 for ( name in obj ) { 8980 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 8981 } 8982 8983 } else { 8984 8985 // Serialize scalar item. 8986 add( prefix, obj ); 8987 } 8988} 8989 8990// Serialize an array of form elements or a set of 8991// key/values into a query string 8992jQuery.param = function( a, traditional ) { 8993 var prefix, 8994 s = [], 8995 add = function( key, value ) { 8996 8997 // If value is a function, invoke it and return its value 8998 value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); 8999 s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); 9000 }; 9001 9002 // Set traditional to true for jQuery <= 1.3.2 behavior. 9003 if ( traditional === undefined ) { 9004 traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; 9005 } 9006 9007 // If an array was passed in, assume that it is an array of form elements. 9008 if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 9009 9010 // Serialize the form elements 9011 jQuery.each( a, function() { 9012 add( this.name, this.value ); 9013 } ); 9014 9015 } else { 9016 9017 // If traditional, encode the "old" way (the way 1.3.2 or older 9018 // did it), otherwise encode params recursively. 9019 for ( prefix in a ) { 9020 buildParams( prefix, a[ prefix ], traditional, add ); 9021 } 9022 } 9023 9024 // Return the resulting serialization 9025 return s.join( "&" ).replace( r20, "+" ); 9026}; 9027 9028jQuery.fn.extend( { 9029 serialize: function() { 9030 return jQuery.param( this.serializeArray() ); 9031 }, 9032 serializeArray: function() { 9033 return this.map( function() { 9034 9035 // Can add propHook for "elements" to filter or add form elements 9036 var elements = jQuery.prop( this, "elements" ); 9037 return elements ? jQuery.makeArray( elements ) : this; 9038 } ) 9039 .filter( function() { 9040 var type = this.type; 9041 9042 // Use .is( ":disabled" ) so that fieldset[disabled] works 9043 return this.name && !jQuery( this ).is( ":disabled" ) && 9044 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 9045 ( this.checked || !rcheckableType.test( type ) ); 9046 } ) 9047 .map( function( i, elem ) { 9048 var val = jQuery( this ).val(); 9049 9050 return val == null ? 9051 null : 9052 jQuery.isArray( val ) ? 9053 jQuery.map( val, function( val ) { 9054 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 9055 } ) : 9056 { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 9057 } ).get(); 9058 } 9059} ); 9060 9061 9062jQuery.ajaxSettings.xhr = function() { 9063 try { 9064 return new window.XMLHttpRequest(); 9065 } catch ( e ) {} 9066}; 9067 9068var xhrSuccessStatus = { 9069 9070 // File protocol always yields status code 0, assume 200 9071 0: 200, 9072 9073 // Support: IE9 9074 // #1450: sometimes IE returns 1223 when it should be 204 9075 1223: 204 9076 }, 9077 xhrSupported = jQuery.ajaxSettings.xhr(); 9078 9079support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 9080support.ajax = xhrSupported = !!xhrSupported; 9081 9082jQuery.ajaxTransport( function( options ) { 9083 var callback, errorCallback; 9084 9085 // Cross domain only allowed if supported through XMLHttpRequest 9086 if ( support.cors || xhrSupported && !options.crossDomain ) { 9087 return { 9088 send: function( headers, complete ) { 9089 var i, 9090 xhr = options.xhr(); 9091 9092 xhr.open( 9093 options.type, 9094 options.url, 9095 options.async, 9096 options.username, 9097 options.password 9098 ); 9099 9100 // Apply custom fields if provided 9101 if ( options.xhrFields ) { 9102 for ( i in options.xhrFields ) { 9103 xhr[ i ] = options.xhrFields[ i ]; 9104 } 9105 } 9106 9107 // Override mime type if needed 9108 if ( options.mimeType && xhr.overrideMimeType ) { 9109 xhr.overrideMimeType( options.mimeType ); 9110 } 9111 9112 // X-Requested-With header 9113 // For cross-domain requests, seeing as conditions for a preflight are 9114 // akin to a jigsaw puzzle, we simply never set it to be sure. 9115 // (it can always be set on a per-request basis or even using ajaxSetup) 9116 // For same-domain requests, won't change header if already provided. 9117 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { 9118 headers[ "X-Requested-With" ] = "XMLHttpRequest"; 9119 } 9120 9121 // Set headers 9122 for ( i in headers ) { 9123 xhr.setRequestHeader( i, headers[ i ] ); 9124 } 9125 9126 // Callback 9127 callback = function( type ) { 9128 return function() { 9129 if ( callback ) { 9130 callback = errorCallback = xhr.onload = 9131 xhr.onerror = xhr.onabort = xhr.onreadystatechange = null; 9132 9133 if ( type === "abort" ) { 9134 xhr.abort(); 9135 } else if ( type === "error" ) { 9136 9137 // Support: IE9 9138 // On a manual native abort, IE9 throws 9139 // errors on any property access that is not readyState 9140 if ( typeof xhr.status !== "number" ) { 9141 complete( 0, "error" ); 9142 } else { 9143 complete( 9144 9145 // File: protocol always yields status 0; see #8605, #14207 9146 xhr.status, 9147 xhr.statusText 9148 ); 9149 } 9150 } else { 9151 complete( 9152 xhrSuccessStatus[ xhr.status ] || xhr.status, 9153 xhr.statusText, 9154 9155 // Support: IE9 only 9156 // IE9 has no XHR2 but throws on binary (trac-11426) 9157 // For XHR2 non-text, let the caller handle it (gh-2498) 9158 ( xhr.responseType || "text" ) !== "text" || 9159 typeof xhr.responseText !== "string" ? 9160 { binary: xhr.response } : 9161 { text: xhr.responseText }, 9162 xhr.getAllResponseHeaders() 9163 ); 9164 } 9165 } 9166 }; 9167 }; 9168 9169 // Listen to events 9170 xhr.onload = callback(); 9171 errorCallback = xhr.onerror = callback( "error" ); 9172 9173 // Support: IE9 9174 // Use onreadystatechange to replace onabort 9175 // to handle uncaught aborts 9176 if ( xhr.onabort !== undefined ) { 9177 xhr.onabort = errorCallback; 9178 } else { 9179 xhr.onreadystatechange = function() { 9180 9181 // Check readyState before timeout as it changes 9182 if ( xhr.readyState === 4 ) { 9183 9184 // Allow onerror to be called first, 9185 // but that will not handle a native abort 9186 // Also, save errorCallback to a variable 9187 // as xhr.onerror cannot be accessed 9188 window.setTimeout( function() { 9189 if ( callback ) { 9190 errorCallback(); 9191 } 9192 } ); 9193 } 9194 }; 9195 } 9196 9197 // Create the abort callback 9198 callback = callback( "abort" ); 9199 9200 try { 9201 9202 // Do send the request (this may raise an exception) 9203 xhr.send( options.hasContent && options.data || null ); 9204 } catch ( e ) { 9205 9206 // #14683: Only rethrow if this hasn't been notified as an error yet 9207 if ( callback ) { 9208 throw e; 9209 } 9210 } 9211 }, 9212 9213 abort: function() { 9214 if ( callback ) { 9215 callback(); 9216 } 9217 } 9218 }; 9219 } 9220} ); 9221 9222 9223 9224 9225// Install script dataType 9226jQuery.ajaxSetup( { 9227 accepts: { 9228 script: "text/javascript, application/javascript, " + 9229 "application/ecmascript, application/x-ecmascript" 9230 }, 9231 contents: { 9232 script: /\b(?:java|ecma)script\b/ 9233 }, 9234 converters: { 9235 "text script": function( text ) { 9236 jQuery.globalEval( text ); 9237 return text; 9238 } 9239 } 9240} ); 9241 9242// Handle cache's special case and crossDomain 9243jQuery.ajaxPrefilter( "script", function( s ) { 9244 if ( s.cache === undefined ) { 9245 s.cache = false; 9246 } 9247 if ( s.crossDomain ) { 9248 s.type = "GET"; 9249 } 9250} ); 9251 9252// Bind script tag hack transport 9253jQuery.ajaxTransport( "script", function( s ) { 9254 9255 // This transport only deals with cross domain requests 9256 if ( s.crossDomain ) { 9257 var script, callback; 9258 return { 9259 send: function( _, complete ) { 9260 script = jQuery( "<script>" ).prop( { 9261 charset: s.scriptCharset, 9262 src: s.url 9263 } ).on( 9264 "load error", 9265 callback = function( evt ) { 9266 script.remove(); 9267 callback = null; 9268 if ( evt ) { 9269 complete( evt.type === "error" ? 404 : 200, evt.type ); 9270 } 9271 } 9272 ); 9273 9274 // Use native DOM manipulation to avoid our domManip AJAX trickery 9275 document.head.appendChild( script[ 0 ] ); 9276 }, 9277 abort: function() { 9278 if ( callback ) { 9279 callback(); 9280 } 9281 } 9282 }; 9283 } 9284} ); 9285 9286 9287 9288 9289var oldCallbacks = [], 9290 rjsonp = /(=)\?(?=&|$)|\?\?/; 9291 9292// Default jsonp settings 9293jQuery.ajaxSetup( { 9294 jsonp: "callback", 9295 jsonpCallback: function() { 9296 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); 9297 this[ callback ] = true; 9298 return callback; 9299 } 9300} ); 9301 9302// Detect, normalize options and install callbacks for jsonp requests 9303jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 9304 9305 var callbackName, overwritten, responseContainer, 9306 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 9307 "url" : 9308 typeof s.data === "string" && 9309 ( s.contentType || "" ) 9310 .indexOf( "application/x-www-form-urlencoded" ) === 0 && 9311 rjsonp.test( s.data ) && "data" 9312 ); 9313 9314 // Handle iff the expected data type is "jsonp" or we have a parameter to set 9315 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 9316 9317 // Get callback name, remembering preexisting value associated with it 9318 callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? 9319 s.jsonpCallback() : 9320 s.jsonpCallback; 9321 9322 // Insert callback into url or form data 9323 if ( jsonProp ) { 9324 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 9325 } else if ( s.jsonp !== false ) { 9326 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 9327 } 9328 9329 // Use data converter to retrieve json after script execution 9330 s.converters[ "script json" ] = function() { 9331 if ( !responseContainer ) { 9332 jQuery.error( callbackName + " was not called" ); 9333 } 9334 return responseContainer[ 0 ]; 9335 }; 9336 9337 // Force json dataType 9338 s.dataTypes[ 0 ] = "json"; 9339 9340 // Install callback 9341 overwritten = window[ callbackName ]; 9342 window[ callbackName ] = function() { 9343 responseContainer = arguments; 9344 }; 9345 9346 // Clean-up function (fires after converters) 9347 jqXHR.always( function() { 9348 9349 // If previous value didn't exist - remove it 9350 if ( overwritten === undefined ) { 9351 jQuery( window ).removeProp( callbackName ); 9352 9353 // Otherwise restore preexisting value 9354 } else { 9355 window[ callbackName ] = overwritten; 9356 } 9357 9358 // Save back as free 9359 if ( s[ callbackName ] ) { 9360 9361 // Make sure that re-using the options doesn't screw things around 9362 s.jsonpCallback = originalSettings.jsonpCallback; 9363 9364 // Save the callback name for future use 9365 oldCallbacks.push( callbackName ); 9366 } 9367 9368 // Call if it was a function and we have a response 9369 if ( responseContainer && jQuery.isFunction( overwritten ) ) { 9370 overwritten( responseContainer[ 0 ] ); 9371 } 9372 9373 responseContainer = overwritten = undefined; 9374 } ); 9375 9376 // Delegate to script 9377 return "script"; 9378 } 9379} ); 9380 9381 9382 9383 9384// Argument "data" should be string of html 9385// context (optional): If specified, the fragment will be created in this context, 9386// defaults to document 9387// keepScripts (optional): If true, will include scripts passed in the html string 9388jQuery.parseHTML = function( data, context, keepScripts ) { 9389 if ( !data || typeof data !== "string" ) { 9390 return null; 9391 } 9392 if ( typeof context === "boolean" ) { 9393 keepScripts = context; 9394 context = false; 9395 } 9396 context = context || document; 9397 9398 var parsed = rsingleTag.exec( data ), 9399 scripts = !keepScripts && []; 9400 9401 // Single tag 9402 if ( parsed ) { 9403 return [ context.createElement( parsed[ 1 ] ) ]; 9404 } 9405 9406 parsed = buildFragment( [ data ], context, scripts ); 9407 9408 if ( scripts && scripts.length ) { 9409 jQuery( scripts ).remove(); 9410 } 9411 9412 return jQuery.merge( [], parsed.childNodes ); 9413}; 9414 9415 9416// Keep a copy of the old load method 9417var _load = jQuery.fn.load; 9418 9419/** 9420 * Load a url into a page 9421 */ 9422jQuery.fn.load = function( url, params, callback ) { 9423 if ( typeof url !== "string" && _load ) { 9424 return _load.apply( this, arguments ); 9425 } 9426 9427 var selector, type, response, 9428 self = this, 9429 off = url.indexOf( " " ); 9430 9431 if ( off > -1 ) { 9432 selector = jQuery.trim( url.slice( off ) ); 9433 url = url.slice( 0, off ); 9434 } 9435 9436 // If it's a function 9437 if ( jQuery.isFunction( params ) ) { 9438 9439 // We assume that it's the callback 9440 callback = params; 9441 params = undefined; 9442 9443 // Otherwise, build a param string 9444 } else if ( params && typeof params === "object" ) { 9445 type = "POST"; 9446 } 9447 9448 // If we have elements to modify, make the request 9449 if ( self.length > 0 ) { 9450 jQuery.ajax( { 9451 url: url, 9452 9453 // If "type" variable is undefined, then "GET" method will be used. 9454 // Make value of this field explicit since 9455 // user can override it through ajaxSetup method 9456 type: type || "GET", 9457 dataType: "html", 9458 data: params 9459 } ).done( function( responseText ) { 9460 9461 // Save response for use in complete callback 9462 response = arguments; 9463 9464 self.html( selector ? 9465 9466 // If a selector was specified, locate the right elements in a dummy div 9467 // Exclude scripts to avoid IE 'Permission Denied' errors 9468 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : 9469 9470 // Otherwise use the full result 9471 responseText ); 9472 9473 // If the request succeeds, this function gets "data", "status", "jqXHR" 9474 // but they are ignored because response was set above. 9475 // If it fails, this function gets "jqXHR", "status", "error" 9476 } ).always( callback && function( jqXHR, status ) { 9477 self.each( function() { 9478 callback.apply(
9478self
vendor: 9,974 bytes, lines 9478-9842
9478, response || [ jqXHR.responseText, status, jqXHR ] ); 9479 } ); 9480 } ); 9481 } 9482 9483 return this; 9484}; 9485 9486 9487 9488 9489// Attach a bunch of functions for handling common AJAX events 9490jQuery.each( [ 9491 "ajaxStart", 9492 "ajaxStop", 9493 "ajaxComplete", 9494 "ajaxError", 9495 "ajaxSuccess", 9496 "ajaxSend" 9497], function( i, type ) { 9498 jQuery.fn[ type ] = function( fn ) { 9499 return this.on( type, fn ); 9500 }; 9501} ); 9502 9503 9504 9505 9506jQuery.expr.filters.animated = function( elem ) { 9507 return jQuery.grep( jQuery.timers, function( fn ) { 9508 return elem === fn.elem; 9509 } ).length; 9510}; 9511 9512 9513 9514 9515/** 9516 * Gets a window from an element 9517 */ 9518function getWindow( elem ) { 9519 return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView; 9520} 9521 9522jQuery.offset = { 9523 setOffset: function( elem, options, i ) { 9524 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, 9525 position = jQuery.css( elem, "position" ), 9526 curElem = jQuery( elem ), 9527 props = {}; 9528 9529 // Set position first, in-case top/left are set even on static elem 9530 if ( position === "static" ) { 9531 elem.style.position = "relative"; 9532 } 9533 9534 curOffset = curElem.offset(); 9535 curCSSTop = jQuery.css( elem, "top" ); 9536 curCSSLeft = jQuery.css( elem, "left" ); 9537 calculatePosition = ( position === "absolute" || position === "fixed" ) && 9538 ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; 9539 9540 // Need to be able to calculate position if either 9541 // top or left is auto and position is either absolute or fixed 9542 if ( calculatePosition ) { 9543 curPosition = curElem.position(); 9544 curTop = curPosition.top; 9545 curLeft = curPosition.left; 9546 9547 } else { 9548 curTop = parseFloat( curCSSTop ) || 0; 9549 curLeft = parseFloat( curCSSLeft ) || 0; 9550 } 9551 9552 if ( jQuery.isFunction( options ) ) { 9553 9554 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) 9555 options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); 9556 } 9557 9558 if ( options.top != null ) { 9559 props.top = ( options.top - curOffset.top ) + curTop; 9560 } 9561 if ( options.left != null ) { 9562 props.left = ( options.left - curOffset.left ) + curLeft; 9563 } 9564 9565 if ( "using" in options ) { 9566 options.using.call( elem, props ); 9567 9568 } else { 9569 curElem.css( props ); 9570 } 9571 } 9572}; 9573 9574jQuery.fn.extend( { 9575 offset: function( options ) { 9576 if ( arguments.length ) { 9577 return options === undefined ? 9578 this : 9579 this.each( function( i ) { 9580 jQuery.offset.setOffset( this, options, i ); 9581 } ); 9582 } 9583 9584 var docElem, win, 9585 elem = this[ 0 ], 9586 box = { top: 0, left: 0 }, 9587 doc = elem && elem.ownerDocument; 9588 9589 if ( !doc ) { 9590 return; 9591 } 9592 9593 docElem = doc.documentElement; 9594 9595 // Make sure it's not a disconnected DOM node 9596 if ( !jQuery.contains( docElem, elem ) ) { 9597 return box; 9598 } 9599 9600 box = elem.getBoundingClientRect(); 9601 win = getWindow( doc ); 9602 return { 9603 top: box.top + win.pageYOffset - docElem.clientTop, 9604 left: box.left + win.pageXOffset - docElem.clientLeft 9605 }; 9606 }, 9607 9608 position: function() { 9609 if ( !this[ 0 ] ) { 9610 return; 9611 } 9612 9613 var offsetParent, offset, 9614 elem = this[ 0 ], 9615 parentOffset = { top: 0, left: 0 }; 9616 9617 // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, 9618 // because it is its only offset parent 9619 if ( jQuery.css( elem, "position" ) === "fixed" ) { 9620 9621 // Assume getBoundingClientRect is there when computed position is fixed 9622 offset = elem.getBoundingClientRect(); 9623 9624 } else { 9625 9626 // Get *real* offsetParent 9627 offsetParent = this.offsetParent(); 9628 9629 // Get correct offsets 9630 offset = this.offset(); 9631 if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { 9632 parentOffset = offsetParent.offset(); 9633 } 9634 9635 // Add offsetParent borders 9636 parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); 9637 parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); 9638 } 9639 9640 // Subtract parent offsets and element margins 9641 return { 9642 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), 9643 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) 9644 }; 9645 }, 9646 9647 // This method will return documentElement in the following cases: 9648 // 1) For the element inside the iframe without offsetParent, this method will return 9649 // documentElement of the parent window 9650 // 2) For the hidden or detached element 9651 // 3) For body or html element, i.e. in case of the html node - it will return itself 9652 // 9653 // but those exceptions were never presented as a real life use-cases 9654 // and might be considered as more preferable results. 9655 // 9656 // This logic, however, is not guaranteed and can change at any point in the future 9657 offsetParent: function() { 9658 return this.map( function() { 9659 var offsetParent = this.offsetParent; 9660 9661 while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { 9662 offsetParent = offsetParent.offsetParent; 9663 } 9664 9665 return offsetParent || documentElement; 9666 } ); 9667 } 9668} ); 9669 9670// Create scrollLeft and scrollTop methods 9671jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { 9672 var top = "pageYOffset" === prop; 9673 9674 jQuery.fn[ method ] = function( val ) { 9675 return access( this, function( elem, method, val ) { 9676 var win = getWindow( elem ); 9677 9678 if ( val === undefined ) { 9679 return win ? win[ prop ] : elem[ method ]; 9680 } 9681 9682 if ( win ) { 9683 win.scrollTo( 9684 !top ? val : win.pageXOffset, 9685 top ? val : win.pageYOffset 9686 ); 9687 9688 } else { 9689 elem[ method ] = val; 9690 } 9691 }, method, val, arguments.length ); 9692 }; 9693} ); 9694 9695// Support: Safari<7-8+, Chrome<37-44+ 9696// Add the top/left cssHooks using jQuery.fn.position 9697// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 9698// Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280 9699// getComputedStyle returns percent when specified for top/left/bottom/right; 9700// rather than make the css module depend on the offset module, just check for it here 9701jQuery.each( [ "top", "left" ], function( i, prop ) { 9702 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, 9703 function( elem, computed ) { 9704 if ( computed ) { 9705 computed = curCSS( elem, prop ); 9706 9707 // If curCSS returns percentage, fallback to offset 9708 return rnumnonpx.test( computed ) ? 9709 jQuery( elem ).position()[ prop ] + "px" : 9710 computed; 9711 } 9712 } 9713 ); 9714} ); 9715 9716 9717// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 9718jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { 9719 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, 9720 function( defaultExtra, funcName ) { 9721 9722 // Margin is only for outerHeight, outerWidth 9723 jQuery.fn[ funcName ] = function( margin, value ) { 9724 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 9725 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 9726 9727 return access( this, function( elem, type, value ) { 9728 var doc; 9729 9730 if ( jQuery.isWindow( elem ) ) { 9731 9732 // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there 9733 // isn't a whole lot we can do. See pull request at this URL for discussion: 9734 // https://github.com/jquery/jquery/pull/764 9735 return elem.document.documentElement[ "client" + name ]; 9736 } 9737 9738 // Get document width or height 9739 if ( elem.nodeType === 9 ) { 9740 doc = elem.documentElement; 9741 9742 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 9743 // whichever is greatest 9744 return Math.max( 9745 elem.body[ "scroll" + name ], doc[ "scroll" + name ], 9746 elem.body[ "offset" + name ], doc[ "offset" + name ], 9747 doc[ "client" + name ] 9748 ); 9749 } 9750 9751 return value === undefined ? 9752 9753 // Get width or height on the element, requesting but not forcing parseFloat 9754 jQuery.css( elem, type, extra ) : 9755 9756 // Set width or height on the element 9757 jQuery.style( elem, type, value, extra ); 9758 }, type, chainable ? margin : undefined, chainable, null ); 9759 }; 9760 } ); 9761} ); 9762 9763 9764jQuery.fn.extend( { 9765 9766 bind: function( types, data, fn ) { 9767 return this.on( types, null, data, fn ); 9768 }, 9769 unbind: function( types, fn ) { 9770 return this.off( types, null, fn ); 9771 }, 9772 9773 delegate: function( selector, types, data, fn ) { 9774 return this.on( types, selector, data, fn ); 9775 }, 9776 undelegate: function( selector, types, fn ) { 9777 9778 // ( namespace ) or ( selector, types [, fn] ) 9779 return arguments.length === 1 ? 9780 this.off( selector, "**" ) : 9781 this.off( types, selector || "**", fn ); 9782 }, 9783 size: function() { 9784 return this.length; 9785 } 9786} ); 9787 9788jQuery.fn.andSelf = jQuery.fn.addBack; 9789 9790 9791 9792 9793// Register as a named AMD module, since jQuery can be concatenated with other 9794// files that may use define, but not via a proper concatenation script that 9795// understands anonymous AMD modules. A named AMD is safest and most robust 9796// way to register. Lowercase jquery is used because AMD module names are 9797// derived from file names, and jQuery is normally delivered in a lowercase 9798// file name. Do this after creating the global so that if an AMD module wants 9799// to call noConflict to hide this version of jQuery, it will work. 9800 9801// Note that for maximum portability, libraries that are not jQuery should 9802// declare themselves as anonymous modules, and avoid setting a global if an 9803// AMD loader is present. jQuery is a special case. For more information, see 9804// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 9805 9806if ( typeof define === "function" && define.amd ) { 9807 define( "jquery", [], function() { 9808 return jQuery; 9809 } ); 9810} 9811 9812 9813 9814var 9815 9816 // Map over jQuery in case of overwrite 9817 _jQuery = window.jQuery, 9818 9819 // Map over the $ in case of overwrite 9820 _$ = window.$; 9821 9822jQuery.noConflict = function( deep ) { 9823 if ( window.$ === jQuery ) { 9824 window.$ = _$; 9825 } 9826 9827 if ( deep && window.jQuery === jQuery ) { 9828 window.jQuery = _jQuery; 9829 } 9830 9831 return jQuery; 9832}; 9833 9834// Expose jQuery and $ identifiers, even in AMD 9835// (#7102#comment:10, https://github.com/jquery/jquery/pull/557) 9836// and CommonJS for browser emulators (#13566) 9837if ( !noGlobal ) { 9838 window.jQuery = window.$ = jQuery; 9839} 9840 9841return jQuery; 9842}));
vendor: 4,169 bytes, lines 9843-9854
9843; 9844/*! 9845 * Bootstrap v3.3.7 (http://getbootstrap.com) 9846 * Copyright 2011-2017 Twitter, Inc. 9847 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 9848 */ 9849 9850/*! 9851 * Generated using the Bootstrap Customizer (https://getbootstrap.com/docs/3.3/customize/?id=bb62c4cb50ff4bcf1b82e6eef21ba1d5) 9852 * Config saved to config.json and https://gist.github.com/bb62c4cb50ff4bcf1b82e6eef21ba1d5 9853 */ 9854if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(t){"use strict";var e=t.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||e[0]>3)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var i=t(this),n=i.data("bs.alert");n||i.data("bs.alert",n=new o(this)),"string"==typeof e&&n[e].call(i)})}var i='[data-dismiss="alert"]',o=function(e){t(e).on("click",i,this.close)};o.VERSION="3.3.7",o.TRANSITION_DURATION=150,o.prototype.close=function(e){function i(){a.detach().trigger("closed.bs.alert").remove()}var n=t(this),s=n.attr("data-target");s||(s=n.attr("href"),s=s&&s.replace(/.*(?=#[^\s]*$)/,""));var a=t("#"===s?[]:s);e&&e.preventDefault(),a.length||(a=n.closest(".alert")),a.trigger(e=t.Event("close.bs.alert")),e.isDefaultPrevented()||(a.removeClass("in"),t.support.transition&&a.hasClass("fade")?a.one("bsTransitionEnd",i).emulateTransitionEnd(o.TRANSITION_DURATION):i())};var n=t.fn.alert;t.fn.alert=e,t.fn.alert.Constructor=o,t.fn.alert.noConflict=function(){return t.fn.alert=n,this},t(document).on("click.bs.alert.data-api",i,o.prototype.close)}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.button"),s="object"==typeof e&&e;n||o.data("bs.button",n=new i(this,s)),"toggle"==e?n.toggle():e&&n.setState(e)})}var i=function(e,o){this.$element=t(e),this.options=t.extend({},i.DEFAULTS,o),this.isLoading=!1};i.VERSION="3.3.7",i.DEFAULTS={loadingText:"loading..."},i.prototype.setState=function(e){var i="disabled",o=this.$element,n=o.is("input")?"val":"html",s=o.data();e+="Text",null==s.resetText&&o.data("resetText",o[n]()),setTimeout(t.proxy(function(){o[n](null==s[e]?this.options[e]:s[e]),"loadingText"==e?(this.isLoading=!0,o.addClass(i).attr(i,i).prop(i,!0)):this.isLoading&&(this.isLoading=!1,o.removeClass(i).removeAttr(i).prop(i,!1))},this),0)},i.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")?(i.prop("checked")&&(t=!1),e.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==i.prop("type")&&(i.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),i.prop("checked",this.$element.hasClass("active")),t&&i.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var o=t.fn.button;t.fn.button=e,t.fn.button.Constructor=i,t.fn.button.noConflict=function(){return t.fn.button=o,this},t(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(i){var o=t(i.target).closest(".btn");e.call(o,"toggle"),t(i.target).is('input[type="radio"], input[type="checkbox"]')||(i.preventDefault(),o.is("input,button")?o.trigger("focus"):o.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(e){t(e.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(e.type))})}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.carousel"),s=t.extend({},i.DEFAULTS,o.data(),"object"==typeof e&&e),a="string"==typeof e?e:s.slide;n||o.data("bs.carousel",n=new i(this,s)),"number"==typeof e?n.to(e):a?n[a]():s.interval&&n.pause().cycle()})}var i=function(e,i){this.$element=t(e),this.$indicators=this.$element.find(".carousel-indicators"),this.options=i,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("key
9854down.bs.carousel",t.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",t.proxy(this.pause,this)).on("mouseleave.bs.carousel",t.proxy(this.cycle,this))};i.VERSION="3.3.7",i.TRANSITION_DURATION=600,i.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},i.prototype.keydown=function(t){if(!/input|textarea/i.test(t.target.tagName)){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()}},i.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},i.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},i.prototype.getItemForDirection=function(t,e){var i=this.getItemIndex(e),o="prev"==t&&0===i||"next"==t&&i==this.$items.length-1;if(o&&!this.options.wrap)return e;var n="prev"==t?-1:1,s=(i+n)%this.$items.length;return this.$items.eq(s)},i.prototype.to=function(t){var e=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));return t>this.$items.length-1||0>t?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){e.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",this.$items.eq(t))},i.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},i.prototype.next=function(){return this.sliding?void 0:this.slide("next")},i.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},i.prototype.slide=function(e,o){var n=this.$element.find(".item.active"),s=o||this.getItemForDirection(e,n),a=this.interval,r="next"==e?"left":"right",l=this;if(s.hasClass("active"))return this.sliding=!1;var h=s[0],d=t.Event("slide.bs.carousel",{relatedTarget:h,direction:r});if(this.$element.trigger(d),!d.isDefaultPrevented()){if(this.sliding=!0,a&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var p=t(this.$indicators.children()[this.getItemIndex(s)]);p&&p.addClass("active")}var c=t.Event("slid.bs.carousel",{relatedTarget:h,direction:r});return t.support.transition&&this.$element.hasClass("slide")?(s.addClass(e),s[0].offsetWidth,n.addClass(r),s.addClass(r),n.one("bsTransitionEnd",function(){s.removeClass([e,r].join(" ")).addClass("active"),n.removeClass(["active",r].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger(c)},0)}).emulateTransitionEnd(i.TRANSITION_DURATION)):(n.removeClass("active"),s.addClass("active"),this.sliding=!1,this.$element.trigger(c)),a&&this.cycle(),this}};var o=t.fn.carousel;t.fn.carousel=e,t.fn.carousel.Constructor=i,t.fn.carousel.noConflict=function(){return t.fn.carousel=o,this};var n=function(i){var o,n=t(this),s=t(n.attr("data-target")||(o=n.attr("href"))&&o.replace(/.*(?=#[^\s]+$)/,""));if(s.hasClass("carousel")){var a=t.extend({},s.data(),n.data()),r=n.attr("data-slide-to");r&&(a.interval=!1),e.call(s,a),r&&s.data("bs.carousel").to(r),i.preventDefault()}};t(document).on("click.bs.carousel.data-api","[data-slide]",n).on("click.bs.carousel.data-api","[data-slide-to]",n),t(window).on("load",function(){t('[data-ride="carousel"]').each(function(){var i=t(this);e.call(i,i.data())})})}(jQuery),+function(t){"use strict";function e(e){var i=e.attr("data-target");i||(i=e.attr("href"),i=i&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var o=i&&t(i);return o&&o.length?o:e.parent()}function i(i){i&&3===i.which||(t(n).remove(),t(s).each(function(){var o=t(this),n=e(o),s={relatedTarget:this};n.hasClass("open")&&(i&&"click"==i.type&&/input|textarea/i.test(i.target.tagName)&&t.contains(n[0],i.target)||(n.trigger(i=t.Event("hide.bs.dropdown",s)),i.isDefaultPrevented()||(o.attr("aria-expanded","false"),n.removeClass("open").trigger(t.Event("hidden.bs.dropdown",s)))))}))}function o(e){return this.each(function(){var i=t(this),o=i.data("bs.dropdown");o||i.data("bs.dropdown",o=new a(this)),"string"==typeof e&&o[e].call(i)})}var n=".dropdown-backdrop",s='[data-toggle="dropdown"]',a=function(e){t(e).on("click.bs.dropdown",this.toggle)};a.VERSION="3.3.7",a.prototype.toggle=function(o){var n=t(this);if(!n.is(".disabled, :disabled")){var s=e(n),a=s.hasClass("open");if(i(),!a){"ontouchstart"in document.documentElement&&!s.closest(".
9854navbar-nav").length&&t(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(t(this)).on("click",i);var r={relatedTarget:this};if(s.trigger(o=t.Event("show.bs.dropdown",r)),o.isDefaultPrevented())return;n.trigger("focus").attr("aria-expanded","true"),s.toggleClass("open").trigger(t.Event("shown.bs.dropdown",r))}return!1}},a.prototype.keydown=function(i){if(/(38|40|27|32)/.test(i.which)&&!/input|textarea/i.test(i.target.tagName)){var o=t(this);if(i.preventDefault(),i.stopPropagation(),!o.is(".disabled, :disabled")){var n=e(o),a=n.hasClass("open");if(!a&&27!=i.which||a&&27==i.which)return 27==i.which&&n.find(s).trigger("focus"),o.trigger("click");var r=" li:not(.disabled):visible a",l=n.find(".dropdown-menu"+r);if(l.length){var h=l.index(i.target);38==i.which&&h>0&&h--,40==i.which&&h<l.length-1&&h++,~h||(h=0),l.eq(h).trigger("focus")}}}};var r=t.fn.dropdown;t.fn.dropdown=o,t.fn.dropdown.Constructor=a,t.fn.dropdown.noConflict=function(){return t.fn.dropdown=r,this},t(document).on("click.bs.dropdown.data-api",i).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.bs.dropdown.data-api",s,a.prototype.toggle).on("keydown.bs.dropdown.data-api",s,a.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",a.prototype.keydown)}(jQuery),+function(t){"use strict";function e(e,o){return this.each(function(){var n=t(this),s=n.data("bs.modal"),a=t.extend({},i.DEFAULTS,n.data(),"object"==typeof e&&e);s||n.data("bs.modal",s=new i(this,a)),"string"==typeof e?s[e](o):a.show&&s.show(o)})}var i=function(e,i){this.options=i,this.$body=t(document.body),this.$element=t(e),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,t.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};i.VERSION="3.3.7",i.TRANSITION_DURATION=300,i.BACKDROP_TRANSITION_DURATION=150,i.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},i.prototype.toggle=function(t){return this.isShown?this.hide():this.show(t)},i.prototype.show=function(e){var o=this,n=t.Event("show.bs.modal",{relatedTarget:e});this.$element.trigger(n),this.isShown||n.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',t.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){o.$element.one("mouseup.dismiss.bs.modal",function(e){t(e.target).is(o.$element)&&(o.ignoreBackdropClick=!0)})}),this.backdrop(function(){var n=t.support.transition&&o.$element.hasClass("fade");o.$element.parent().length||o.$element.appendTo(o.$body),o.$element.show().scrollTop(0),o.adjustDialog(),n&&o.$element[0].offsetWidth,o.$element.addClass("in"),o.enforceFocus();var s=t.Event("shown.bs.modal",{relatedTarget:e});n?o.$dialog.one("bsTransitionEnd",function(){o.$element.trigger("focus").trigger(s)}).emulateTransitionEnd(i.TRANSITION_DURATION):o.$element.trigger("focus").trigger(s)}))},i.prototype.hide=function(e){e&&e.preventDefault(),e=t.Event("hide.bs.modal"),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),t(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),t.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",t.proxy(this.hideModal,this)).emulateTransitionEnd(i.TRANSITION_DURATION):this.hideModal())},i.prototype.enforceFocus=function(){t(document).off("focusin.bs.modal").on("focusin.bs.modal",t.proxy(function(t){document===t.target||this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")},this))},i.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",t.proxy(function(t){27==t.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},i.prototype.resize=function(){this.isShown?t(window).on("resize.bs.modal",t.proxy(this.handleUpdate,this)):t(window).off("resize.bs.modal")},i.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.$body.removeClass("modal-open"),t.resetAdjustments(),t.resetScrollbar(),t.$element.trigger("hidden.bs.modal")})},i.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},i.prototype.backdrop=function(e){var o=this,n=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var s=t.support.transition&&n;if(this.$backdrop=t(document.createElement("div")).addClass("modal-backdrop "+n).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",t.proxy(function(t){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),s&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!e)return;s?this.$backdrop.one("bsTransitionEnd",e).emulateTransitionEnd(i.BACKDROP_TRANSITION_DURATION):e()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var a=function(){o.removeBackdrop(),e&&e()};t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",a).emulateTransitionEnd(i.BACKDROP_TRANSITION_DURATION):a()}else e&&e()},i.prototype.handleUpdate=function(){this.adjustDialog()},i.prototype.adjustDialog=function(){var t=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},i.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},i.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth<t,this.scrollbarWidth=this.measureScrollbar()},i.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"",this.bodyIsOverflowing&&this.$body.css("padding-right",t+this.scrollbarWidth)},i.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)},i.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var o=t.fn.modal;t.fn.modal=e,t.fn.modal.Constructor=i,t.fn.modal.noConflict=function(){return t.fn.modal=o,this},t(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(i){var o=t(this),n=o.attr("href"),s=t(o.attr("data-target")||n&&n.replace(/.*(?=#[^\s]+$)/,"")),a=s.data("bs.modal")?"toggle":t.extend({remote:!/#/.test(n)&&n},s.data(),o.data());o.is("a")&&i.preventDefault(),s.one("show.bs.modal",function(t){t.isDefaultPrevented()||s.one("hidden.bs.modal",function(){o.is(":visible")&&o.trigger("focus")})}),e.call(s,a,this)})}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.tooltip"),s="object"==typeof e&&e;!n&&/destroy|hide/.test(e)||(n||o.data("bs.tooltip",n=new i(this,s)),"string"==typeof e&&n[e]())})}var i=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",t,e)};i.VERSION="3.3.7",i.TRANSITION_DURATION=150,i.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},i.prototype.init=function(e,i,o){if(this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(o),this.$viewport=this.options.viewport&&t(t.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var n=this.options.trigger.split(" "),s=n.length;s--;){var a=n[s];if("click"==a)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=a){var r="hover"==a?"mouseenter":"focusin",l="hover"==a?"mouseleave":"focusout";this.$element.on(r+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},i.prototype.getDefaults=function(){return i.DEFAULTS},i.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},i.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,o){i[t]!=o&&(e[t]=o)}),e},i.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);
vendor: 10,708 bytes, line 9854
9854return i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),e instanceof t.Event&&(i.inState["focusin"==e.type?"focus":"hover"]=!0),i.tip().hasClass("in")||"in"==i.hoverState?void(i.hoverState="in"):(clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show())},i.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},i.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i)),e instanceof t.Event&&(i.inState["focusout"==e.type?"focus":"hover"]=!1),i.isInStateTrue()?void 0:(clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide())},i.prototype.show=function(){var e=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var o=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!o)return;var n=this,s=this.tip(),a=this.getUID(this.type);this.setContent(),s.attr("id",a),this.$element.attr("aria-describedby",a),this.options.animation&&s.addClass("fade");var r="function"==typeof this.options.placement?this.options.placement.call(this,s[0],this.$element[0]):this.options.placement,l=/\s?auto?\s?/i,h=l.test(r);h&&(r=r.replace(l,"")||"top"),s.detach().css({top:0,left:0,display:"block"}).addClass(r).data("bs."+this.type,this),this.options.container?s.appendTo(this.options.container):s.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var d=this.getPosition(),p=s[0].offsetWidth,c=s[0].offsetHeight;if(h){var f=r,u=this.getPosition(this.$viewport);r="bottom"==r&&d.bottom+c>u.bottom?"top":"top"==r&&d.top-c<u.top?"bottom":"right"==r&&d.right+p>u.width?"left":"left"==r&&d.left-p<u.left?"right":r,s.removeClass(f).addClass(r)}var g=this.getCalculatedOffset(r,d,p,c);this.applyPlacement(g,r);var v=function(){var t=n.hoverState;n.$element.trigger("shown.bs."+n.type),n.hoverState=null,"out"==t&&n.leave(n)};t.support.transition&&this.$tip.hasClass("fade")?s.one("bsTransitionEnd",v).emulateTransitionEnd(i.TRANSITION_DURATION):v()}},i.prototype.applyPlacement=function(e,i){var o=this.tip(),n=o[0].offsetWidth,s=o[0].offsetHeight,a=parseInt(o.css("margin-top"),10),r=parseInt(o.css("margin-left"),10);isNaN(a)&&(a=0),isNaN(r)&&(r=0),e.top+=a,e.left+=r,t.offset.setOffset(o[0],t.extend({using:function(t){o.css({top:Math.round(t.top),left:Math.round(t.left)})}},e),0),o.addClass("in");var l=o[0].offsetWidth,h=o[0].offsetHeight;"top"==i&&h!=s&&(e.top=e.top+s-h);var d=this.getViewportAdjustedDelta(i,e,l,h);d.left?e.left+=d.left:e.top+=d.top;var p=/top|bottom/.test(i),c=p?2*d.left-n+l:2*d.top-s+h,f=p?"offsetWidth":"offsetHeight";o.offset(e),this.replaceArrow(c,o[0][f],p)},i.prototype.replaceArrow=function(t,e,i){this.arrow().css(i?"left":"top",50*(1-t/e)+"%").css(i?"top":"left","")},i.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();t.find(".tooltip-inner")[this.options.html?"html":"text"](e),t.removeClass("fade in top bottom left right")},i.prototype.hide=function(e){function o(){"in"!=n.hoverState&&s.detach(),n.$element&&n.$element.removeAttr("aria-describedby").trigger("hidden.bs."+n.type),e&&e()}var n=this,s=t(this.$tip),a=t.Event("hide.bs."+this.type);return this.$element.trigger(a),a.isDefaultPrevented()?void 0:(s.removeClass("in"),t.support.transition&&s.hasClass("fade")?s.one("bsTransitionEnd",o).emulateTransitionEnd(i.TRANSITION_DURATION):o(),this.hoverState=null,this)},i.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},i.prototype.hasContent=function(){return this.getTitle()},i.prototype.getPosition=function(e){e=e||this.$element;var i=e[0],o="BODY"==i.tagName,n=i.getBoundingClientRect();null==n.width&&(n=t.extend({},n,{width:n.right-n.left,height:n.bottom-n.top}));var s=window.SVGElement&&i instanceof window.SVGElement,a=o?{top:0,left:0}:s?null:e.offset(),r={scroll:o?document.documentElement.scrollTop||document.body.scrollTop:e.scrollTop()},l=o?{width:t(window).width(),height:t(window).height()}:null;return t.extend({},n,r,l,a)},i.prototype.getCalculatedOffset=function(t,e,i,o){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-i/2}:"top"==t?{top:e.top-o,left:e.left+e.width/2-i/2}:"left"==t?{top:e.top+e.height/2-o/2,left:e.left-i}:{top:e.top+e.height/2-o/2,left:e.left+e.width}},i.prototype.getViewportAdjustedDelta=function(t,e,i,o){var n={top:0,left:0};if(!this.$viewport)return n;var s=this.options.viewport&&this.options.viewport.padding||0,a=this.getPosition(this.$viewport);if(/right|left/.test(t)){var r=e.top-s-a.scroll,l=e.top+s-a.scroll+o;r<a.top?n.top=a.top-r:l>a.top+a.height&&(n.top=a.top+a.height-l)}else{var h=e.left-s,d=e.left+s+i;h<a.left?n.left=a.left-h:d>a.right&&(n.left=a.left+a.width-d)}return n},i.prototype.getTitle=function(){var t,e=this.$element,i=this.options;return t=e.attr("data-original-title")||("function"==typeof i.title?i.title.call(e[0]):i.title)},i.prototype.getUID=function(t){do t+=~~(1e6*Math.random());while(document.getElementById(t));return t},i.prototype.tip=function(){if(!this.$tip&&(this.$tip=t(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},i.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},i.prototype.enable=function(){this.enabled=!0},i.prototype.disable=function(){this.enabled=!1},i.prototype.toggleEnabled=function(){this.enabled=!this.enabled},i.prototype.toggle=function(e){var i=this;e&&(i=t(e.currentTarget).data("bs."+this.type),i||(i=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,i))),e?(i.inState.click=!i.inState.click,i.isInStateTrue()?i.enter(i):i.leave(i)):i.tip().hasClass("in")?i.leave(i):i.enter(i)},i.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null,t.$element=null})};var o=t.fn.tooltip;t.fn.tooltip=e,t.fn.tooltip.Constructor=i,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=o,this}}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.popover"),s="object"==typeof e&&e;!n&&/destroy|hide/.test(e)||(n||o.data("bs.popover",n=new i(this,s)),"string"==typeof e&&n[e]())})}var i=function(t,e){this.init("popover",t,e)};if(!t.fn.tooltip)throw new Error("Popover requires tooltip.js");i.VERSION="3.3.7",i.DEFAULTS=t.extend({},t.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),i.prototype=t.extend({},t.fn.tooltip.Constructor.prototype),i.prototype.constructor=i,i.prototype.getDefaults=function(){return i.DEFAULTS},i.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](e),t.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof i?"html":"append":"text"](i),t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},i.prototype.hasContent=function(){return this.getTitle()||this.getContent()},i.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},i.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var o=t.fn.popover;t.fn.popover=e,t.fn.popover.Constructor=i,t.fn.popover.noConflict=function(){return t.fn.popover=o,this}}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.tab");n||o.data("bs.tab",n=new i(this)),"string"==typeof e&&n[e]()})}var i=function(e){this.element=t(e)};i.VERSION="3.3.7",i.TRANSITION_DURATION=150,i.prototype.show=function(){var e=this.element,i=e.closest("ul:not(.dropdown-menu)"),o=e.data("target");if(o||(o=e.attr("href"),o=o&&o.replace(/.*(?=#[^\s]*$)/,"")),!e.parent("li").hasClass("active")){var n=i.find(".active:last a"),s=t.Event("hide.bs.tab",{relatedTarget:e[0]}),a=t.Event("show.bs.tab",{relatedTarget:n[0]});if(n.trigger(s),e.trigger(a),!a.isDefaultPrevented()&&!s.isDefaultPrevented()){var r=t(o);this.activate(e.closest("li"),i),this.activate(r,r.parent(),function(){n.trigger({type:"hidden.bs.tab",relatedTarget:e[0]}),e.trigger({type:"shown.bs.tab",relatedTarget:n[0]})})}}},i.prototype.activate=function(e,o,n){function s(){a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),e.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),r?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu").length&&e.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),n&&n()}var a=o.find("> .active"),r=n&&t.support.transition&&(a.length&&a.hasClass("fade")||!!o.find("> .fade").length);a.length&&r?a.one("bsTransitionEnd",s).emulateTransitionEnd(i.TRANSITION_DURATION):s(),a.removeClass("in")};var o=t.fn.tab;t.fn.tab=e,t.fn.tab.Constructor=i,t.fn.tab.noConflict=function(){return t.fn.tab=o,this};var n=function(i){i.preventDefault(),e.call(t(this),"show")};t(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',n).on("click.bs.tab.data-api",'[data-toggle="pill"]',n)}(jQuery),+function(t){"use strict";function e(e){return this.each(function(){var o=t(this),n=o.data("bs.affix"),s="object"==typeof e&&e;n||o.data("bs.affix",n=new i(this,s)),"string"==typeof e&&n[e]()})}var i=function(e,o){this.options=t.extend({},i.DEFAULTS,o),this.$target=t(this.options.target).on("scroll.bs.affix.data-api",t.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",t.proxy(this.checkPositionWithEventLoop,this)),this.$element=t(e),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};i.VERSION="3.3.7",i.RESET="affix affix-top affix-bottom",i.DEFAULTS={offset:0,target:window}
vendor: 8,169 bytes, lines 9854-9855
9854,i.prototype.getState=function(t,e,i,o){var n=this.$target.scrollTop(),s=this.$element.offset(),a=this.$target.height();if(null!=i&&"top"==this.affixed)return i>n?"top":!1;if("bottom"==this.affixed)return null!=i?n+this.unpin<=s.top?!1:"bottom":t-o>=n+a?!1:"bottom";var r=null==this.affixed,l=r?n:s.top,h=r?a:e;return null!=i&&i>=n?"top":null!=o&&l+h>=t-o?"bottom":!1},i.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(i.RESET).addClass("affix");var t=this.$target.scrollTop(),e=this.$element.offset();return this.pinnedOffset=e.top-t},i.prototype.checkPositionWithEventLoop=function(){setTimeout(t.proxy(this.checkPosition,this),1)},i.prototype.checkPosition=function(){if(this.$element.is(":visible")){var e=this.$element.height(),o=this.options.offset,n=o.top,s=o.bottom,a=Math.max(t(document).height(),t(document.body).height());"object"!=typeof o&&(s=n=o),"function"==typeof n&&(n=o.top(this.$element)),"function"==typeof s&&(s=o.bottom(this.$element));var r=this.getState(a,e,n,s);if(this.affixed!=r){null!=this.unpin&&this.$element.css("top","");var l="affix"+(r?"-"+r:""),h=t.Event(l+".bs.affix");if(this.$element.trigger(h),h.isDefaultPrevented())return;this.affixed=r,this.unpin="bottom"==r?this.getPinnedOffset():null,this.$element.removeClass(i.RESET).addClass(l).trigger(l.replace("affix","affixed")+".bs.affix")}"bottom"==r&&this.$element.offset({top:a-e-s})}};var o=t.fn.affix;t.fn.affix=e,t.fn.affix.Constructor=i,t.fn.affix.noConflict=function(){return t.fn.affix=o,this},t(window).on("load",function(){t('[data-spy="affix"]').each(function(){var i=t(this),o=i.data();o.offset=o.offset||{},null!=o.offsetBottom&&(o.offset.bottom=o.offsetBottom),null!=o.offsetTop&&(o.offset.top=o.offsetTop),e.call(i,o)})})}(jQuery),+function(t){"use strict";function e(e){var i,o=e.attr("data-target")||(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return t(o)}function i(e){return this.each(function(){var i=t(this),n=i.data("bs.collapse"),s=t.extend({},o.DEFAULTS,i.data(),"object"==typeof e&&e);!n&&s.toggle&&/show|hide/.test(e)&&(s.toggle=!1),n||i.data("bs.collapse",n=new o(this,s)),"string"==typeof e&&n[e]()})}var o=function(e,i){this.$element=t(e),this.options=t.extend({},o.DEFAULTS,i),this.$trigger=t('[data-toggle="collapse"][href="#'+e.id+'"],[data-toggle="collapse"][data-target="#'+e.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};o.VERSION="3.3.7",o.TRANSITION_DURATION=350,o.DEFAULTS={toggle:!0},o.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},o.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var e,n=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(n&&n.length&&(e=n.data("bs.collapse"),e&&e.transitioning))){var s=t.Event("show.bs.collapse");if(this.$element.trigger(s),!s.isDefaultPrevented()){n&&n.length&&(i.call(n,"hide"),e||n.data("bs.collapse",null));var a=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[a](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var r=function(){this.$element.removeClass("collapsing").addClass("collapse in")[a](""),this.transitioning=0, 9855this.$element.trigger("shown.bs.collapse")};if(!t.support.transition)return r.call(this);var l=t.camelCase(["scroll",a].join("-"));this.$element.one("bsTransitionEnd",t.proxy(r,this)).emulateTransitionEnd(o.TRANSITION_DURATION)[a](this.$element[0][l])}}}},o.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var e=t.Event("hide.bs.collapse");if(this.$element.trigger(e),!e.isDefaultPrevented()){var i=this.dimension();this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var n=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return t.support.transition?void this.$element[i](0).one("bsTransitionEnd",t.proxy(n,this)).emulateTransitionEnd(o.TRANSITION_DURATION):n.call(this)}}},o.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},o.prototype.getParent=function(){return t(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(t.proxy(function(i,o){var n=t(o);this.addAriaAndCollapsedClass(e(n),n)},this)).end()},o.prototype.addAriaAndCollapsedClass=function(t,e){var i=t.hasClass("in");t.attr("aria-expanded",i),e.toggleClass("collapsed",!i).attr("aria-expanded",i)};var n=t.fn.collapse;t.fn.collapse=i,t.fn.collapse.Constructor=o,t.fn.collapse.noConflict=function(){return t.fn.collapse=n,this},t(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(o){var n=t(this);n.attr("data-target")||o.preventDefault();var s=e(n),a=s.data("bs.collapse"),r=a?"toggle":n.data();i.call(s,r)})}(jQuery),+function(t){"use strict";function e(i,o){this.$body=t(document.body),this.$scrollElement=t(t(i).is(document.body)?window:i),this.options=t.extend({},e.DEFAULTS,o),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",t.proxy(this.process,this)),this.refresh(),this.process()}function i(i){return this.each(function(){var o=t(this),n=o.data("bs.scrollspy"),s="object"==typeof i&&i;n||o.data("bs.scrollspy",n=new e(this,s)),"string"==typeof i&&n[i]()})}e.VERSION="3.3.7",e.DEFAULTS={offset:10},e.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},e.prototype.refresh=function(){var e=this,i="offset",o=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),t.isWindow(this.$scrollElement[0])||(i="position",o=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var e=t(this),n=e.data("target")||e.attr("href"),s=/^#./.test(n)&&t(n);return s&&s.length&&s.is(":visible")&&[[s[i]().top+o,n]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){e.offsets.push(this[0]),e.targets.push(this[1])})},e.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),o=this.options.offset+i-this.$scrollElement.height(),n=this.offsets,s=this.targets,a=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),e>=o)return a!=(t=s[s.length-1])&&this.activate(t);if(a&&e<n[0])return this.activeTarget=null,this.clear();for(t=n.length;t--;)a!=s[t]&&e>=n[t]&&(void 0===n[t+1]||e<n[t+1])&&this.activate(s[t])},e.prototype.activate=function(e){this.activeTarget=e,this.clear();var i=this.selector+'[data-target="'+e+'"],'+this.selector+'[href="'+e+'"]',o=t(i).parents("li").addClass("active");o.parent(".dropdown-menu").length&&(o=o.closest("li.dropdown").addClass("active")),o.trigger("activate.bs.scrollspy")},e.prototype.clear=function(){t(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var o=t.fn.scrollspy;t.fn.scrollspy=i,t.fn.scrollspy.Constructor=e,t.fn.scrollspy.noConflict=function(){return t.fn.scrollspy=o,this},t(window).on("load.bs.scrollspy.data-api",function(){t('[data-spy="scroll"]').each(function(){var e=t(this);i.call(e,e.data())})})}(jQuery),+function(t){"use strict";function e(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]};return!1}t.fn.emulateTransitionEnd=function(e){var i=!1,o=this;t(this).one("bsTransitionEnd",function(){i=!0});var n=function(){i||t(o).trigger(t.support.transition.end)};return setTimeout(n,e),this},t(function(){t.support.transition=e(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.supp
vendor: 8,907 bytes, lines 9855-10093
9855ort.transition.end,delegateType:t.support.transition.end,handle:function(e){return t(e.target).is(this)?e.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery);; 9856!function ($) { 9857 9858 "use strict"; 9859 9860 // TABCOLLAPSE CLASS DEFINITION 9861 // ====================== 9862 9863 var TabCollapse = function (el, options) { 9864 this.options = options; 9865 this.$tabs = $(el); 9866 9867 this._accordionVisible = false; //content is attached to tabs at first 9868 this._initAccordion(); 9869 this._checkStateOnResize(); 9870 9871 9872 // checkState() has gone to setTimeout for making it possible to attach listeners to 9873 // shown-accordion.bs.tabcollapse event on page load. 9874 // See https://github.com/flatlogic/bootstrap-tabcollapse/issues/23 9875 var that = this; 9876 setTimeout(function() { 9877 that.checkState(); 9878 }, 0); 9879 }; 9880 9881 TabCollapse.DEFAULTS = { 9882 accordionClass: 'visible-xs', 9883 tabsClass: 'hidden-xs', 9884 accordionTemplate: function(heading, groupId, parentId, active) { 9885 return '<div class="panel panel-default">' + 9886 ' <div class="panel-heading">' + 9887 ' <h4 class="panel-title">' + 9888 ' </h4>' + 9889 ' </div>' + 9890 ' <div id="' + groupId + '" class="panel-collapse collapse ' + (active ? 'in' : '') + '">' + 9891 ' <div class="panel-body js-tabcollapse-panel-body">' + 9892 ' </div>' + 9893 ' </div>' + 9894 '</div>' 9895 9896 } 9897 }; 9898 9899 TabCollapse.prototype.checkState = function(){ 9900 if (this.$tabs.is(':visible') && this._accordionVisible){ 9901 this.showTabs(); 9902 this._accordionVisible = false; 9903 } else if (this.$accordion.is(':visible') && !this._accordionVisible){ 9904 this.showAccordion(); 9905 this._accordionVisible = true; 9906 } 9907 }; 9908 9909 TabCollapse.prototype.showTabs = function(){ 9910 var view = this; 9911 this.$tabs.trigger($.Event('show-tabs.bs.tabcollapse')); 9912 9913 var $panelHeadings = this.$accordion.find('.js-tabcollapse-panel-heading').detach(); 9914 9915 $panelHeadings.each(function() { 9916 var $panelHeading = $(this), 9917 $parentLi = $panelHeading.data('bs.tabcollapse.parentLi'); 9918 9919 var $oldHeading = view._panelHeadingToTabHeading($panelHeading); 9920 9921 $parentLi.removeClass('active'); 9922 if ($parentLi.parent().hasClass('dropdown-menu') && !$parentLi.siblings('li').hasClass('active')) { 9923 $parentLi.parent().parent().removeClass('active'); 9924 } 9925 9926 if (!$oldHeading.hasClass('collapsed')) { 9927 $parentLi.addClass('active'); 9928 if ($parentLi.parent().hasClass('dropdown-menu')) { 9929 $parentLi.parent().parent().addClass('active'); 9930 } 9931 } else { 9932 $oldHeading.removeClass('collapsed'); 9933 } 9934 9935 $parentLi.append($panelHeading); 9936 }); 9937 9938 if (!$('li').hasClass('active')) { 9939 $('li').first().addClass('active') 9940 } 9941 9942 var $panelBodies = this.$accordion.find('.js-tabcollapse-panel-body'); 9943 $panelBodies.each(function(){ 9944 var $panelBody = $(this), 9945 $tabPane = $panelBody.data('bs.tabcollapse.tabpane'); 9946 $tabPane.append($panelBody.contents().detach()); 9947 }); 9948 this.$accordion.html(''); 9949 9950 if(this.options.updateLinks) { 9951 var $tabContents = this.getTabContentElement(); 9952 $tabContents.find('[data-toggle-was="tab"], [data-toggle-was="pill"]').each(function() { 9953 var $el = $(this); 9954 var href = $el.attr('href').replace(/-collapse$/g, ''); 9955 $el.attr({ 9956 'data-toggle': $el.attr('data-toggle-was'), 9957 'data-toggle-was': '', 9958 'data-parent': '', 9959 href: href 9960 }); 9961 }); 9962 } 9963 9964 this.$tabs.trigger($.Event('shown-tabs.bs.tabcollapse')); 9965 }; 9966 9967 TabCollapse.prototype.getTabContentElement = function(){ 9968 var $tabContents = $(this.options.tabContentSelector); 9969 if($tabContents.length === 0) { 9970 $tabContents = this.$tabs.siblings('.tab-content'); 9971 } 9972 return $tabContents; 9973 }; 9974 9975 TabCollapse.prototype.showAccordion = function(){ 9976 this.$tabs.trigger($.Event('show-accordion.bs.tabcollapse')); 9977 9978 var $headings = this.$tabs.find('li:not(.dropdown) [data-toggle="tab"], li:not(.dropdown) [data-toggle="pill"]'), 9979 view = this; 9980 $headings.each(function(){ 9981 var $heading = $(this), 9982 $parentLi = $heading.parent(); 9983 $heading.data('bs.tabcollapse.parentLi', $parentLi); 9984 view.$accordion.append(view._createAccordionGroup(view.$accordion.attr('id'), $heading.detach())); 9985 }); 9986 9987 if(this.options.updateLinks) { 9988 var parentId = this.$accordion.attr('id'); 9989 var $selector = this.$accordion.find('.js-tabcollapse-panel-body'); 9990 $selector.find('[data-toggle="tab"], [data-toggle="pill"]').each(function() { 9991 var $el = $(this); 9992 var href = $el.attr('href') + '-collapse'; 9993 $el.attr({ 9994 'data-toggle-was': $el.attr('data-toggle'), 9995 'data-toggle': 'collapse', 9996 'data-parent': '#' + parentId, 9997 href: href 9998 }); 9999 }); 10000 } 10001 10002 this.$tabs.trigger($.Event('shown-accordion.bs.tabcollapse')); 10003 }; 10004 10005 TabCollapse.prototype._panelHeadingToTabHeading = function($heading) { 10006 var href = $heading.attr('href').replace(/-collapse$/g, ''); 10007 $heading.attr({ 10008 'data-toggle': 'tab', 10009 'href': href, 10010 'data-parent': '' 10011 }); 10012 return $heading; 10013 }; 10014 10015 TabCollapse.prototype._tabHeadingToPanelHeading = function($heading, groupId, parentId, active) { 10016 $heading.addClass('js-tabcollapse-panel-heading ' + (active ? '' : 'collapsed')); 10017 $heading.attr({ 10018 'data-toggle': 'collapse', 10019 'data-parent': '#' + parentId, 10020 'href': '#' + groupId 10021 }); 10022 return $heading; 10023 }; 10024 10025 TabCollapse.prototype._checkStateOnResize = function(){ 10026 var view = this; 10027 $(window).resize(function(){ 10028 clearTimeout(view._resizeTimeout); 10029 view._resizeTimeout = setTimeout(function(){ 10030 view.checkState(); 10031 }, 100); 10032 }); 10033 }; 10034 10035 10036 TabCollapse.prototype._initAccordion = function(){ 10037 var randomString = function() { 10038 var result = "", 10039 possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; 10040 for( var i=0; i < 5; i++ ) { 10041 result += possible.charAt(Math.floor(Math.random() * possible.length)); 10042 } 10043 return result; 10044 }; 10045 10046 var srcId = this.$tabs.attr('id'), 10047 accordionId = (srcId ? srcId : randomString()) + '-accordion'; 10048 10049 this.$accordion = $('<div class="panel-group ' + this.options.accordionClass + '" id="' + accordionId +'"></div>'); 10050 this.$tabs.after(this.$accordion); 10051 this.$tabs.addClass(this.options.tabsClass); 10052 this.getTabContentElement().addClass(this.options.tabsClass); 10053 }; 10054 10055 TabCollapse.prototype._createAccordionGroup = function(parentId, $heading){ 10056 var tabSelector = $heading.attr('data-target'), 10057 active = $heading.data('bs.tabcollapse.parentLi').is('.active'); 10058 10059 if (!tabSelector) { 10060 tabSelector = $heading.attr('href'); 10061 tabSelector = tabSelector && tabSelector.replace(/.*(?=#[^\s]*$)/, ''); //strip for ie7 10062 } 10063 10064 var $tabPane = $(tabSelector), 10065 groupId = $tabPane.attr('id') + '-collapse', 10066 $panel = $(this.options.accordionTemplate($heading, groupId, parentId, active)); 10067 $panel.find('.panel-heading > .panel-title').append(this._tabHeadingToPanelHeading($heading, groupId, parentId, active)); 10068 $panel.find('.panel-body').append($tabPane.contents().detach()) 10069 .data('bs.tabcollapse.tabpane', $tabPane); 10070 10071 return $panel; 10072 }; 10073 10074 10075 10076 // TABCOLLAPSE PLUGIN DEFINITION 10077 // ======================= 10078 10079 $.fn.tabCollapse = function (option) { 10080 return this.each(function () { 10081 var $this = $(this); 10082 var data = $this.data('bs.tabcollapse'); 10083 var options = $.extend({}, TabCollapse.DEFAULTS, $this.data(), typeof option === 'object' && option); 10084 10085 if (!data) $this.data('bs.tabcollapse', new TabCollapse(this, options)); 10086 }); 10087 }; 10088 10089 $.fn.tabCollapse.Constructor = TabCollapse; 10090 10091 10092}(window.jQuery); 10093;
vendor: 43,881 bytes, lines 10094-10111
10094/* 10095 _ _ _ _ 10096 ___| (_) ___| | __ (_)___ 10097/ __| | |/ __| |/ / | / __| 10098\__ \ | | (__| < _ | \__ \ 10099|___/_|_|\___|_|\_(_)/ |___/ 10100 |__/ 10101 10102 Version: 1.9.0 10103 Author: Ken Wheeler 10104 Website: http://kenwheeler.github.io 10105 Docs: http://kenwheeler.github.io/slick 10106 Repo: http://github.com/kenwheeler/slick 10107 Issues: http://github.com/kenwheeler/slick/issues 10108 10109 */ 10110(function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)})(function(i){"use strict";var e=window.Slick||{};e=function(){function e(e,o){var s,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(e),appendDots:i(e),arrows:!0,asNavFor:null,prevArrow:'<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',nextArrow:'<button class="slick-next" aria-label="Next" type="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(e,t){return i('<button type="button" />').text(t+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,focusOnChange:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},n.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},i.extend(n,n.initials),n.activeBreakpoint=null,n.animType=null,n.animProp=null,n.breakpoints=[],n.breakpointSettings=[],n.cssTransitions=!1,n.focussed=!1,n.interrupted=!1,n.hidden="hidden",n.paused=!0,n.positionProp=null,n.respondTo=null,n.rowCount=1,n.shouldClick=!0,n.$slider=i(e),n.$slidesCache=null,n.transformType=null,n.transitionType=null,n.visibilityChange="visibilitychange",n.windowWidth=0,n.windowTimer=null,s=i(e).data("slick")||{},n.options=i.extend({},n.defaults,o,s),n.currentSlide=n.options.initialSlide,n.originalSettings=n.options,"undefined"!=typeof document.mozHidden?(n.hidden="mozHidden",n.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(n.hidden="webkitHidden",n.visibilityChange="webkitvisibilitychange"),n.autoPlay=i.proxy(n.autoPlay,n),n.autoPlayClear=i.proxy(n.autoPlayClear,n),n.autoPlayIterator=i.proxy(n.autoPlayIterator,n),n.changeSlide=i.proxy(n.changeSlide,n),n.clickHandler=i.proxy(n.clickHandler,n),n.selectHandler=i.proxy(n.selectHandler,n),n.setPosition=i.proxy(n.setPosition,n),n.swipeHandler=i.proxy(n.swipeHandler,n),n.dragHandler=i.proxy(n.dragHandler,n),n.keyHandler=i.proxy(n.keyHandler,n),n.instanceUid=t++,n.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,n.registerBreakpoints(),n.init(!0)}var t=0;return e}(),e.prototype.activateADA=function(){var i=this;i.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},e.prototype.addSlide=e.prototype.slickAdd=function(e,t,o){var s=this;if("boolean"==typeof t)o=t,t=null;else if(t<0||t>=s.slideCount)return!1;s.unload(),"number"==typeof t?0===t&&0===s.$slides.length?i(e).appendTo(s.$slideTrack):o?i(e).insertBefore(s.$slides.eq(t)):i(e).insertAfter(s.$slides.eq(t)):o===!0?i(e).prependTo(s.$slideTrack):i(e).appendTo(s.$slideTrack),s.$slides=s.$slideTrack.children(this.options.slide),s.$slideTrack.children(this.options.slide).detach(),s.$slideTrack.append(s.$slides),s.$slides.each(function(e,t){i(t).attr("data-slick-index",e)}),s.$slidesCache=s.$slides,s.reinit()},e.prototype.animateHeight=function(){var i=this;if(1===i.options.slidesToShow&&i.options.adaptiveHeight===!0&&i.options.vertical===!1){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.animate({height:e},i.options.speed)}},e.prototype.animateSlide=function(e,t){var o={},s=this;s.animateHeight(),s.options.rtl===!0&&s.options.vertical===!1&&(e=-e),s.transformsEnabled===!1?s.options.vertical===!1?s.$slideTrack.animate({left:e},s.options.speed,s.options.easing,t):s.$slideTrack.animate({top:e},s.options.speed,s.options.easing,t):s.cssTransitions===!1?(s.options.rtl===!0&&(s.currentLeft=-s.currentLeft),i({animStart:s.currentLeft}).animate({animStart:e},{duration:s.options.speed,easing:s.options.easing,step:function(i){i=Math.ceil(i),s.options.vertical===!1?(o[s.animType]="translate("+i+"px, 0px)",s.$slideTrack.css(o)):(o[s.animType]="translate(0px,"+i+"px)",s.$slideTrack.css(o))},complete:function(){t&&t.call()}})):(s.applyTransition(),e=Math.ceil(e),s.options.vertical===!1?o[s.animType]="translate3d("+e+"px, 0px, 0px)":o[s.animType]="translate3d(0px,"+e+"px, 0px)",s.$slideTrack.css(o),t&&setTimeout(function(){s.disableTransition(),t.call()},s.options.speed))},e.prototype.getNavTarget=function(){var e=this,t=e.options.asNavFor;return t&&null!==t&&(t=i(t).not(e.$slider)),t},e.prototype.asNavFor=function(e){var t=this,o=t.getNavTarget();null!==o&&"object"==typeof o&&o.each(function(){var t=i(this).slick("getSlick");t.unslicked||t.slideHandler(e,!0)})},e.prototype.applyTransition=function(i){var e=this,t={};e.options.fade===!1?t[e.transitionType]=e.transformType+" "+e.options.speed+"ms "+e.options.cssEase:t[e.transitionType]="opacity "+e.options.speed+"ms "+e.options.cssEase,e.options.fade===!1?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.autoPlay=function(){var i=this;i.autoPlayClear(),i.slideCount>i.options.slidesToShow&&(i.autoPlayTimer=setInterval(i.autoPlayIterator,i.options.autoplaySpeed))},e.prototype.autoPlayClear=function(){var i=this;i.autoPlayTimer&&clearInterval(i.autoPlayTimer)},e.prototype.autoPlayIterator=function(){var i=this,e=i.currentSlide+i.options.slidesToScroll;i.paused||i.interrupted||i.focussed||(i.options.infinite===!1&&(1===i.direction&&i.currentSlide+1===i.slideCount-1?i.direction=0:0===i.direction&&(e=i.currentSlide-i.options.slidesToScroll,i.currentSlide-1===0&&(i.direction=1))),i.slideHandler(e))},e.prototype.buildArrows=function(){var e=this;e.options.arrows===!0&&(e.$prevArrow=i(e.options.prevArrow).addClass("slick-arrow"),e.$nextArrow=i(e.options.nextArrow).addClass("slick-arrow"),e.slideCount>e.options.slidesToShow?(e.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.prependTo(e.options.appendArrows),e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.appendTo(e.options.appendArrows),e.options.infinite!==!0&&e.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):e.$prevArrow.add(e.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},e.prototype.buildDots=function(){var e,t,o=this;if(o.options.dots===!0&&o.slideCount>o.options.slidesToShow){for(o.$slider.addClass("slick-dotted"),t=i("<ul />").addClass(o.options.dotsClass),e=0;e<=o.getDotCount();e+=1)t.append(i("<li />").append(o.options.customPaging.call(this,o,e)));o.$dots=t.appendTo(o.options.appendDots),o.$dots.find("li").first().addClass("slick-active")}},e.prototype.buildOut=function(){var e=this;e.$slides=e.$slider.children(e.options.slide+":not(.slick-cloned)").addClass("slick-slide"),e.slideCount=e.$slides.length,e.$slides.each(function(e,t){i(t).attr("data-slick-index",e).data("originalStyling",i(t).attr("style")||"")}),e.$slider.addClass("slick-slider"),e.$slideTrack=0===e.slideCount?i('<div class="slick-track"/>').appendTo(e.$slider):e.$slides.wrapAll('<div class="slick-track"/>').parent(),e.$list=e.$slideTrack.wrap('<div class="slick-list"/>').parent(),e.$slideTrack.css("opacity",0),e.options.centerMode!==!0&&e.options.swipeToSlide!==!0||(e.options.slidesToScroll=1),i("img[data-lazy]",e.$slider).not("[src]").addClass("slick-loading"),e.setupInfinite(),e.buildArrows(),e.buildDots(),e.updateDots(),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),e.options.draggable===!0&&e.$list.addClass("draggable")},e.prototype.buildRows=function(){var i,e,t,o,s,n,r,l=this;if(o=document.createDocumentFragment(),n=l.$slider.children(),l.options.rows>0){for(r=l.options.slidesPerRow*l.options.rows,s=Math.ceil(n.length/r),i=0;i<s;i++){var d=document.createElement("div");for(e=0;e<l.options.rows;e++){var a=document.createElement("div");for(t=0;t<l.options.slidesPerRow;t++){var c=i*r+(e*l.options.slidesPerRow+t);n.get(c)&&a.appendChild(n.get(c))}d.appendChild(a)}o.appendChild(d)}l.$slider.empty().append(o),l.$slider.children().children().children().css({width:100/l.options.slidesPerRow+"%",display:"inline-block"})}},e.prototype.checkResponsive=function(e,t){var o,s,n,r=this,l=!1,d=r.$slider.width(),a=window.innerWidth||i(window).width();if("window"===r.respondTo?n=a:"slider"===r.respondTo?n=d:"min"===r.respondTo&&(n=Math.min(a,d)),r.options.responsive&&r.options.responsive.length&&null!==r.options.responsive){s=null;for(o in r.breakpoints)r.breakpoints.hasOwnProperty(o)&&(r.originalSettings.mobileFirst===!1?n<r.breakpoints[o]&&(s=r.breakpoints[o]):n>r.breakpoints[o]&&(s=r.breakpoints[o]));null!==s?null!==r.activeBreakpoint?(s!==r.activeBreakpoint||t)&&(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),e===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),e===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):null!==r.activeBreakpoint&&(r.activeBreakpoint=null,r.options=r.originalSettings,e===!0&&(r.currentSlide=r.options.initialSlide),r.refresh(e),l=s),e||l===!1||r.$slider.trigger("breakpoint",[r,l])}},e.prototype.changeSlide=function(e,t){var o,s,n,r=this,l=i(e.currentTarget);switch(l.is("a")&&e.preventDefault(),l.is("li")||(l=l.closest("li")),n=r.slideCount%r.options.slidesToScroll!==0,o=n?0:(r.slideCount-r.currentSlide)%r.options.slidesToScroll,e.data.message){case"previous":s=0===o?r.options.slidesToScroll:r.options.slidesToShow-o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide-s,!1,t);break;case"next":s=0===o?r.options.slidesToScroll:o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide+s,!1,t);break;case"index":var d=0===e.data.index?0:e.data.index||l.index()*r.options.slidesToScroll;r.slideHandler(r.checkNavigable(d),!1,t),l.children().trigger("focus");break;default:return}},e.prototype.checkNavigable=function(i){var e,t,o=this;if(e=o.getNavigableIndexes(),t=0,i>e[e.length-1])i=e[e.length-1];else for(var s in e){if(i<e[s]){i=t;break}t=e[s]}return i},e.prototype.cleanUpEvents=function(){var e=this;e.options.dots&&null!==e.$dots&&(i("li",e.$dots).off("click.slick",e.changeSlide).off("mouseenter.slick",i.proxy(e.interrupt,e,!0)).off("mouseleave.slick",i.proxy(e.interrupt,e,!1)),e.options.accessibility===!0&&e.$dots.off("keydown.slick",e.keyHandler)),e.$slider.off("focus.slick blur.slick"),e.options.arrows===!0&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow&&e.$prevArrow.off("click.slick",e.changeSlide),e.$nextArrow&&e.$nextArrow.off("click.slick",e.changeSlide),e.options.accessibility===!0&&(e.$prevArrow&&e.$prevArrow.off("keydown.slick",e.keyHandler),e.$nextArrow&&e.$nextArrow.off("keydown.slick",e.keyHandler))),e.$list.off("touchstart.slick mousedown.slick",e.swipeHandler),e.$list.off("touchmove.slick mousemove.slick",e.swipeHandler),e.$list.off("touchend.slick mouseup.slick",e.swipeHandler),e.$list.off("touchcancel.slick mouseleave.slick",e.swipeHandler),e.$list.off("click.slick",e.clickHandler),i(document).off(e.visibilityChange,e.visibility),e.cleanUpSlideEvents(),e.options.accessibility===!0&&e.$list.off("keydown.slick",e.keyHandler),e.options.focusOnSelect===!0&&i(e.$slideTrack).children().off("click.slick",e.selectHandler),i(window).off("orientationchange.slick.slick-"+e.instanceUid,e.orientationChange),i(window).off("resize.slick.slick-"+e.instanceUid,e.resize),i("[draggable!=true]",e.$slideTrack).off("dragstart",e.preventDefault),i(window).off("load.slick.slick-"+e.instanceUid,e.setPosition)},e.prototype.cleanUpSlideEvents=function(){var e=this;e.$list.off("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.off("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.cleanUpRows=function(){var i,e=this;e.options.rows>0&&(i=e.$slides.children().children(),i.removeAttr("style"),e.$slider.empty().append(i))},e.prototype.clickHandler=function(i){var e=this;e.shouldClick===!1&&(i.stopImmediatePropagation(),i.stopPropagation(),i.preventDefault())},e.prototype.destroy=function(e){var t=this;t.autoPlayClear(),t.touchObject={},t.cleanUpEvents(),i(".slick-cloned",t.$slider).detach(),t.$dots&&t.$dots.remove(),t.$prevArrow&&t.$prevArrow.length&&(t.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.remove()),t.$nextArrow&&t.$nextArrow.length&&(t.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.remove()),t.$slides&&(t.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){i(this).attr("style",i(this).data("originalStyling"))}),t.$slideTrack.children(this.options.slide).detach(),t.$slideTrack.detach(),t.$list.detach(),t.$slider.append(t.$slides)),t.cleanUpRows(),t.$slider.removeClass("slick-slider"),t.$slider.removeClass("slick-initialized"),t.$slider.removeClass("slick-dotted"),t.unslicked=!0,e||t.$slider.trigger("destroy",[t])},e.prototype.disableTransition=function(i){var e=this,t={};t[e.transitionType]="",e.options.fade===!1?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.fadeSlide=function(i,e){var t=this;t.cssTransitions===!1?(t.$slides.eq(i).css({zIndex:t.options.zIndex}),t.$slides.eq(i).animate({opacity:1},t.options.speed,t.options.easing,e)):(t.applyTransition(i),t.$slides.eq(i).css({opacity:1,zIndex:t.options.zIndex}),e&&setTimeout(function(){t.disableTransition(i),e.call()},t.options.speed))},e.prototype.fadeSlideOut=function(i){var e=this;e.cssTransitions===!1?e.$slides.eq(i).animate({opacity:0,zIndex:e.options.zIndex-2},e.options.speed,e.options.easing):(e.applyTransition(i),e.$slides.eq(i).css({opacity:0,zIndex:e.options.zIndex-2}))},e.prototype.filterSlides=e.prototype.slickFilter=function(i){var e=this;null!==i&&(e.$slidesCache=e.$slides,e.unload(),e.$slideTrack.children(this.options.slide).detach(),e.$slidesCache.filter(i).appendTo(e.$slideTrack),e.reinit())},e.prototype.focusHandler=function(){var e=this;e.$slider.off("focus.slick blur.slick").on("focus.slick","*",function(t){var o=i(this);setTimeout(function(){e.options.pauseOnFocus&&o.is(":focus")&&(e.focussed=!0,e.autoPlay())},0)}).on("blur.slick","*",function(t){i(this);e.options.pauseOnFocus&&(e.focussed=!1,e.autoPlay())})},e.prototype.getCurrent=e.prototype.slickCurrentSlide=function(){var i=this;return i.currentSlide},e.prototype.getDotCount=function(){var i=this,e=0,t=0,o=0;if(i.options.infinite===!0)if(i.slideCount<=i.options.slidesToShow)++o;else for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else if(i.options.centerMode===!0)o=i.slideCount;else if(i.options.asNavFor)for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else o=1+Math.ceil((i.slideCount-i.options.slidesToShow)/i.options.slidesToScroll);return o-1},e.prototype.getLeft=function(i){var e,t,o,s,n=this,r=0;return n.slideOffset=0,t=n.$slides.first().outerHeight(!0),n.options.infinite===!0?(n.slideCount>n.options.slidesToShow&&(n.slideOffset=n.slideWidth*n.options.slidesToShow*-1,s=-1,n.options.vertical===!0&&n.options.centerMode===!0&&(2===n.options.slidesToShow?s=-1.5:1===n.options.slidesToShow&&(s=-2)),r=t*n.options.slidesToShow*s),n.slideCount%n.options.slidesToScroll!==0&&i+n.options.slidesToScroll>n.slideCount&&n.slideCount>n.options.slidesToShow&&(i>n.slideCount?(n.slideOffset=(n.options.slidesToShow-(i-n.slideCount))*n.slideWidth*-1,r=(n.options.slidesToShow-(i-n.slideCount))*t*-1):(n.slideOffset=n.slideCount%n.options.slidesToScroll*n.slideWidth*-1,r=n.slideCount%n.options.slidesToScroll*t*-1))):i+n.options.slidesToShow>n.slideCount&&(n.slideOffset=(i+n.options.slidesToShow-n.slideCount)*n.slideWidth,r=(i+n.options.slidesToShow-n.slideCount)*t),n.slideCount<=n.options.slidesToShow&&(n.slideOffset=0,r=0),n.options.centerMode===!0&&n.slideCount<=n.options.slidesToShow?n.slideOffset=n.slideWidth*Math.floor(n.options.slidesToShow)/2-n.slideWidth*n.slideCount/2:n.options.centerMode===!0&&n.options.infinite===!0?n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)-n.slideWidth:n.options.centerMode===!0&&(n.slideOffset=0,n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)),e=n.options.vertical===!1?i*n.slideWidth*-1+n.slideOffset:i*t*-1+r,n.options.variableWidth===!0&&(o=n.slideCount<=n.options.slidesToShow||n.options.infinite===!1?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow),e=n.options.rtl===!0?o[0]?(n.$slideTrack.width()-o[0].offsetLeft-o.width())*-1:0:o[0]?o[0].offsetLeft*-1:0,n.options.centerMode===!0&&(o=n.slideCount<=n.options.slidesToShow||n.options.infinite===!1?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow+1),e=n.options.rtl===!0?o[0]?(n.$slideTrack.width()-o[0].offsetLeft-o.width())*-1:0:o[0]?o[0].offsetLeft*-1:0,e+=(n.$list.width()-o.outerWidth())/2)),e},e.prototype.getOption=e.prototype.slickGetOption=function(i){var e=this;return e.options[i]},e.prototype.getNavigableIndexes=function(){var i,e=this,t=0,o=0,s=[];for(e.options.infinite===!1?i=e.slideCount:(t=e.options.slidesToScroll*-1,o=e.options.slidesToScroll*-1,i=2*e.slideCount);t<i;)s.push(t),t=o+e.options.slidesToScroll,o+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;return s},e.prototype.getSlick=function(){return this},e.prototype.getSlideCount=function(){var e,t,o,s,n=this;return s=n.options.centerMode===!0?Math.floor(n.$list.width()/2):0,o=n.swipeLeft*-1+s,n.options.swipeToSlide===!0?(n.$slideTrack.find(".slick-slide").each(function(e,s){var r,l,d;if(r=i(s).outerWidth(),l=s.offsetLeft,n.options.centerMode!==!0&&(l+=r/2),d=l+r,o<d)return t=s,!1}),e=Math.abs(i(t).attr("data-slick-index")-n.currentSlide)||1):n.options.slidesToScroll},e.prototype.goTo=e.prototype.slickGoTo=function(i,e){var t=this;t.changeSlide({data:{message:"index",index:parseInt(i)}},e)},e.prototype.init=function(e){var t=this;i(t.$slider).hasClass("slick-initialized")||(i(t.$slider).addClass("slick-initialized"),t.buildRows(),t.buildOut(),t.setProps(),t.startLoad(),t.loadSlider(),t.initializeEvents(),t.updateArrows(),t.updateDots(),t.checkResponsive(!0),t.focusHandler()),e&&t.$slider.trigger("init",[t]),t.options.accessibility===!0&&t.initADA(),t.options.autoplay&&(t.paused=!1,t.autoPlay())},e.prototype.initADA=function(){var e=this,t=Math.ceil(e.slideCount/e.options.slidesToShow),o=e.getNavigableIndexes().filter(function(i){return i>=0&&i<e.slideCount});e.$slides.add(e.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),null!==e.$dots&&(e.$slides.not(e.$slideTrack.find(".slick-cloned")).each(function(t){var s=o.indexOf(t);if(i(this).attr({role:"tabpanel",id:"slick-slide"+e.instanceUid+t,tabindex:-1}),s!==-1){var n="slick-slide-control"+e.instanceUid+s;i("#"+n).length&&i(this).attr({"aria-describedby":n})}}),e.$dots.attr("role","tablist").find("li").each(function(s){var n=o[s];i(this).attr({role:"presentation"}),i(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+e.instanceUid+s,"aria-controls":"slick-slide"+e.instanceUid+n,"aria-label":s+1+" of "+t,"aria-selected":null,tabindex:"-1"})}).eq(e.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end());for(var s=e.currentSlide,n=s+e.options.slidesToShow;s<n;s++)e.options.focusOnChange?e.$slides.eq(s).attr({tabindex:"0"}):e.$slides.eq(s).removeAttr("tabindex");e.activateADA()},e.prototype.initArrowEvents=function(){var i=this;i.options.arrows===!0&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},i.changeSlide),i.$nextArrow.off("click.slick").on("click.slick",{message:"next"},i.changeSlide),i.options.accessibility===!0&&(i.$prevArrow.on("keydown.slick",i.keyHandler),i.$nextArrow.on("keydown.slick",i.keyHandler)))},e.prototype.initDotEvents=function(){var e=this;e.options.dots===!0&&e.slideCount>e.options.slidesToShow&&(i("li",e.$dots).on("click.slick",{message:"index"},e.changeSlide),e.options.accessibility===!0&&e.$dots.on("keydown.slick",e.keyHandler)),e.options.dots===!0&&e.options.pauseOnDotsHover===!0&&e.slideCount>e.options.slidesToShow&&i("li",e.$dots).on("mouseenter.slick",i.proxy(e.interrupt,e,!0)).on("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.initSlideEvents=function(){var e=this;e.options.pauseOnHover&&(e.$list.on("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.on("mouseleave.slick",i.proxy(e.interrupt,e,!1)))},e.prototype.initializeEvents=function(){var e=this;e.initArrowEvents(),e.initDotEvents(),e.initSlideEvents(),e.$list.on("touchstart.slick mousedown.slick",{action:"start"},e.swipeHandler),e.$list.on("touchmove.slick mousemove.slick",{action:"move"},e.swipeHandler),e.$list.on("touchend.slick mouseup.slick",{action:"end"},e.swipeHandler),e.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},e.swipeHandler),e.$list.on("click.slick",e.clickHandler),i(document).on(e.visibilityChange,i.proxy(e.visibility,e)),e.options.accessibility===!0&&e.$list.on("keydown.slick",e.keyHandler),e.options.focusOnSelect===!0&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),i(window).on("orientationchange.slick.slick-"+e.instanceUid,i.proxy(e.orientationChange,e)),i(window).on("resize.slick.slick-"+e.instanceUid,i.proxy(e.resize,e)),i("[draggable!=true]",e.$slideTrack).on("dragstart",e.preventDefault),i(window).on("load.slick.slick-"+e.instanceUid,e.setPosition),i(e.setPosition)},e.prototype.initUI=function(){var i=this;i.options.arrows===!0&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.show(),i.$nextArrow.show()),i.options.dots===!0&&i.slideCount>i.options.slidesToShow&&i.$dots.show()},e.prototype.keyHandler=function(i){var e=this;i.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===i.keyCode&&e.options.accessibility===!0?e.changeSlide({data:{message:e.options.rtl===!0?"next":"previous"}}):39===i.keyCode&&e.options.accessibility===!0&&e.changeSlide({data:{message:e.options.rtl===!0?"previous":"next"}}))},e.prototype.lazyLoad=function(){function e(e){i("img[data-lazy]",e).each(function(){var e=i(this),t=i(this).attr("data-lazy"),o=i(this).attr("data-srcset"),s=i(this).attr("data-sizes")||r.$slider.attr("data-sizes"),n=document.createElement("img");n.onload=function(){e.animate({opacity:0},100,function(){o&&(e.attr("srcset",o),s&&e.attr("sizes",s)),e.attr("src",t).animate({opacity:1},200,function(){e.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")}),r.$slider.trigger("lazyLoaded",[r,e,t])})},n.onerror=function(){e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),r.$slider.trigger("lazyLoadError",[r,e,t])},n.src=t})}var t,o,s,n,r=this;if(r.options.centerMode===!0?r.options.infinite===!0?(s=r.currentSlide+(r.options.slidesToShow/2+1),n=s+r.options.slidesToShow+2):(s=Math.max(0,r.currentSlide-(r.options.slidesToShow/2+1)),n=2+(r.options.slidesToShow/2+1)+r.currentSlide):(s=r.options.infinite?r.options.slidesToShow+r.currentSlide:r.currentSlide,n=Math.ceil(s+r.options.slidesToShow),r.options.fade===!0&&(s>0&&s--,n<=r.slideCount&&n++)),t=r.$slider.find(".slick-slide").slice(s,n),"anticipated"===r.options.lazyLoad)for(var l=s-1,d=n,a=r.$slider.find(".slick-slide"),c=0;c<r.options.slidesToScroll;c++)l<0&&(l=r.slideCount-1),t=t.add(a.eq(l)),t=t.add(a.eq(d)),l--,d++;e(t),r.slideCount<=r.options.slidesToShow?(o=r.$slider.find(".slick-slide"),e(o)):r.currentSlide>=r.slideCount-r.options.slidesToShow?(o=r.$slider.find(".slick-cloned").slice(0,r.options.slidesToShow),e(o)):0===r.currentSlide&&(o=r.$slider.find(".slick-cloned").slice(r.options.slidesToShow*-1),e(o))},e.prototype.loadSlider=function(){var i=this;i.setPosition(),i.$slideTrack.css({opacity:1}),i.$slider.removeClass("slick-loading"),i.initUI(),"progressive"===i.options.lazyLoad&&i.progressiveLazyLoad()},e.prototype.next=e.prototype.slickNext=function(){var i=this;i.changeSlide({data:{message:"next"}})},e.prototype.orientationChange=function(){var i=this;i.checkResponsive(),i.setPosition()},e.prototype.pause=e.prototype.slickPause=function(){var i=this;i.autoPlayClear(),i.paused=!0},e.prototype.play=e.prototype.slickPlay=function(){var i=this;i.autoPlay(),i.options.autoplay=!0,i.paused=!1,i.focussed=!1,i.interrupted=!1},e.prototype.postSlide=function(e){var t=this;if(!t.unslicked&&(t.$slider.trigger("afterChange",[t,e]),t.animating=!1,t.slideCount>t.options.slidesToShow&&t.setPosition(),t.swipeLeft=null,t.options.autoplay&&t.autoPlay(),t.options.accessibility===!0&&(t.initADA(),t.options.focusOnChange))){var o=i(t.$slides.get(t.currentSlide));o.attr("tabindex",0).focus()}},e.prototype.prev=e.prototype.slickPrev=function(){var i=this;i.changeSlide({data:{message:"previous"}})},e.prototype.preventDefault=function(i){i.preventDefault()},e.prototype.progressiveLazyLoad=function(e){e=e||1;var t,o,s,n,r,l=this,d=i("img[data-lazy]",l.$slider);d.length?(t=d.first(),o=t.attr("data-lazy"),s=t.attr("data-srcset"),n=t.attr("data-sizes")||l.$slider.attr("data-sizes"),r=document.createElement("img"),r.onload=function(){s&&(t.attr("srcset",s),n&&t.attr("sizes",n)),t.attr("src",o).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"),l.options.adaptiveHeight===!0&&l.setPosition(),l.$slider.trigger("lazyLoaded",[l,t,o]),l.progressiveLazyLoad()},r.onerror=function(){e<3?setTimeout(function(){l.progressiveLazyLoad(e+1)},500):(t.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),l.$slider.trigger("lazyLoadError",[l,t,o]),l.progressiveLazyLoad())},r.src=o):l.$slider.trigger("allImagesLoaded",[l])},e.prototype.refresh=function(e){var t,o,s=this;o=s.slideCount-s.options.slidesToShow,!s.options.infinite&&s.currentSlide>o&&(s.currentSlide=o),s.slideCount<=s.options.slidesToShow&&(s.currentSlide=0),t=s.currentSlide,s.destroy(!0),i.extend(s,s.initials,{currentSlide:t}),s.init(),e||s.changeSlide({data:{message:"index",index:t}},!1)},e.prototype.registerBreakpoints=function(){var e,t,o,s=this,n=s.options.responsive||null;if("array"===i.type(n)&&n.length){s.respondTo=s.options.respondTo||"window";for(e in n)if(o=s.breakpoints.length-1,n.hasOwnProperty(e)){for(t=n[e].breakpoint;o>=0;)s.breakpoints[o]&&s.breakpoints[o]===t&&s.breakpoints.splice(o,1),o--;s.breakpoints.push(t),s.breakpointSettings[t]=n[e].settings}s.breakpoints.sort(function(i,e){return s.options.mobileFirst?i-e:e-i})}},e.prototype.reinit=function(){var e=this;e.$slides=e.$slideTrack.children(e.options.slide).addClass("slick-slide"),e.slideCount=e.$slides.length,e.currentSlide>=e.slideCount&&0!==e.currentSlide&&(e.currentSlide=e.currentSlide-e.options.slidesToScroll),e.slideCount<=e.options.slidesToShow&&(e.currentSlide=0),e.registerBreakpoints(),e.setProps(),e.setupInfinite(),e.buildArrows(),e.updateArrows(),e.initArrowEvents(),e.buildDots(),e.updateDots(),e.initDotEvents(),e.cleanUpSlideEvents(),e.initSlideEvents(),e.checkResponsive(!1,!0),e.options.focusOnSelect===!0&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),e.setPosition(),e.focusHandler(),e.paused=!e.options.autoplay,e.autoPlay(),e.$slider.trigger("reInit",[e])},e.prototype.resize=function(){var e=this;i(window).width()!==e.windowWidth&&(clearTimeout(e.windowDelay),e.windowDelay=window.setTimeout(function(){e.windowWidth=i(window).width(),e.checkResponsive(),e.unslicked||e.setPosition()},50))},e.prototype.removeSlide=e.prototype.slickRemove=function(i,e,t){var o=this;return"boolean"==typeof i?(e=i,i=e===!0?0:o.slideCount-1):i=e===!0?--i:i,!(o.slideCount<1||i<0||i>o.slideCount-1)&&(o.unload(),t===!0?o.$slideTrack.children().remove():o.$slideTrack.children(this.options.slide).eq(i).remove(),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slidesCache=o.$slides,void o.reinit())},e.prototype.setCSS=function(i){var e,t,o=this,s={};o.options.rtl===!0&&(i=-i),e="left"==o.positionProp?Math.ceil(i)+"px":"0px",t="top"==o.positionProp?Math.ceil(i)+"px":"0px",s[o.positionProp]=i,o.transformsEnabled===!1?o.$slideTrack.css(s):(s={},o.cssTransitions===!1?(s[o.animType]="translate("+e+", "+t+")",o.$slideTrack.css(s)):(s[o.animType]="translate3d("+e+", "+t+", 0px)",o.$slideTrack.css(s)))},e.prototype.setDimensions=function(){var i=this;i.options.vertical===!1?i.options.centerMode===!0&&i.$list.css({padding:"0px "+i.options.centerPadding}):(i.$list.height(i.$slides.first().outerHeight(!0)*i.options.slidesToShow),i.options.centerMode===!0&&i.$list.css({padding:i.options.centerPadding+" 0px"})),i.listWidth=i.$list.width(),i.listHeight=i.$list.height(),i.options.vertical===!1&&i.options.variableWidth===!1?(i.slideWidth=Math.ceil(i.listWidth/i.options.slidesToShow),i.$slideTrack.width(Math.ceil(i.slideWidth*i.$slideTrack.children(".slick-slide").length))):i.options.variableWidth===!0?i.$slideTrack.width(5e3*i.slideCount):(i.slideWidth=Math.ceil(i.listWidth),i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0)*i.$slideTrack.children(".slick-slide").length)));var e=i.$slides.first().outerWidth(!0)-i.$slides.first().width();i.options.variableWidth===!1&&i.$slideTrack.children(".slick-slide").width(i.slideWidth-e)},e.prototype.setFade=function(){var e,t=this;t.$slides.each(function(o,s){e=t.slideWidth*o*-1,t.options.rtl===!0?i(s).css({position:"relative",right:e,top:0,zIndex:t.options.zIndex-2,opacity:0}):i(s).css({position:"relative",left:e,top:0,zIndex:t.options.zIndex-2,opacity:0})}),t.$slides.eq(t.currentSlide).css({zIndex:t.options.zIndex-1,opacity:1})},e.prototype.setHeight=function(){var i=this;if(1===i.options.slidesToShow&&i.options.adaptiveHeight===!0&&i.options.vertical===!1){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.css("height",e)}},e.prototype.setOption=e.prototype.slickSetOption=function(){var e,t,o,s,n,r=this,l=!1;if("object"===i.type(arguments[0])?(o=arguments[0],l=arguments[1],n="multiple"):"string"===i.type(arguments[0])&&(o=arguments[0],s=arguments[1],l=arguments[2],"responsive"===arguments[0]&&"array"===i.type(arguments[1])?n="responsive":"undefined"!=typeof arguments[1]&&(n="single")),"single"===n)r.options[o]=s;else if("multiple"===n)i.each(o,function(i,e){r.options[i]=e});else if("responsive"===n)for(t in s)if("array"!==i.type(r.options.responsive))r.options.responsive=[s[t]];else{for(e=r.options.responsive.length-1;e>=0;)r.options.responsive[e].breakpoint===s[t].breakpoint&&r.options.responsive.splice(e,1),e--;r.options.responsive.push(s[t])}l&&(r.unload(),r.reinit())},e.prototype.setPosition=function(){var i=this;i.setDimensions(),i.setHeight(),i.options.fade===!1?i.setCSS(i.getLeft(i.currentSlide)):i.setFade(),i.$slider.trigger("setPosition",[i])},e.prototype.setProps=function(){var i=this,e=document.body.style;i.positionProp=i.options.vertical===!0?"top":"left", 10111"top"===i.positionProp?i.$slider.addClass("slick-vertical"):i.$slider.removeClass("slick-vertical"),void 0===e.WebkitTransition&&void 0===e.MozTransition&&void 0===e.msTransition||i.options.useCSS===!0&&(i.cssTransitions=!0),i.options.fade&&("number"==typeof i.options.zIndex?i.options.zIndex<3&&(i.options.zIndex=3):i.options.zIndex=i.defaults.zIndex),void 0!==e.OTransform&&(i.animType="OTransform",i.transformType="-o-transform",i.transitionType="OTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.MozTransform&&(i.animType="MozTransform",i.transformType="-moz-transform",i.transitionType="MozTransition",void 0===e.perspectiveProperty&&void 0===e.MozPerspective&&(i.animType=!1)),void 0!==e.webkitTransform&&(i.animType="webkitTransform",i.transformType="-webkit-transform",i.transitionType="webkitTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.msTransform&&(i.animType="msTransform",i.transformType="-ms-transform",i.transitionType="msTransition",void 0===e.msTransform&&(i.animType=!1)),void 0!==e.transform&&i.animType!==!1&&(i.animType="transform",i.transformType="transform",i.transitionType="transition"),i.transformsEnabled=i.options.useTransform&&null!==i.animType&&i.animType!==!1},e.prototype.setSlideClasses=function(i){var e,t,o,s,n=this;if(t=n.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),n.$slides.eq(i).addClass("slick-current"),n.options.centerMode===!0){var r=n.options.slidesToShow%2===0?1:0;e=Math.floor(n.options.slidesToShow/2),n.options.infinite===!0&&(i>=e&&i<=n.slideCount-1-e?n.$slides.slice(i-e+r,i+e+1).addClass("slick-active").attr("aria-hidden","false"):(o=n.options.slidesToShow+i,t.slice(o-e+1+r,o+e+2).addClass("slick-active").attr("aria-hidden","false")),0===i?t.eq(t.length-1-n.options.slidesToShow).addClass("slick-center"):i===n.slideCount-1&&t.eq(n.options.slidesToShow).addClass("slick-center")),n.$slides.eq(i).addClass("slick-center")}else i>=0&&i<=n.slideCount-n.options.slidesToShow?n.$slides.slice(i,i+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):t.length<=n.options.slidesToShow?t.addClass("slick-active").attr("aria-hidden","false"):(s=n.slideCount%n.options.slidesToShow,o=n.options.infinite===!0?n.options.slidesToShow+i:i,n.options.slidesToShow==n.options.slidesToScroll&&n.slideCount-i<n.options.slidesToShow?t.slice(o-(n.options.slidesToShow-s),o+s).addClass("slick-active").attr("aria-hidden","false"):t.slice(o,o+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"));"ondemand"!==n.options.lazyLoad&&"anticipated"!==n.options.lazyLoad||n.lazyLoad()},e.prototype.setupInfinite=function(){var e,t,o,s=this;if(s.options.fade===!0&&(s.options.centerMode=!1),s.options.infinite===!0&&s.options.fade===!1&&(t=null,s.slideCount>s.options.slidesToShow)){for(o=s.options.centerMode===!0?s.options.slidesToShow+1:s.options.slidesToShow,e=s.slideCount;e>s.slideCount-o;e-=1)t=e-1,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t-s.slideCount).prependTo(s.$slideTrack).addClass("slick-cloned");for(e=0;e<o+s.slideCount;e+=1)t=e,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t+s.slideCount).appendTo(s.$slideTrack).addClass("slick-cloned");s.$slideTrack.find(".slick-cloned").find("[id]").each(function(){i(this).attr("id","")})}},e.prototype.interrupt=function(i){var e=this;i||e.autoPlay(),e.interrupted=i},e.prototype.selectHandler=function(e){var t=this,o=i(e.target).is(".slick-slide")?i(e.target):i(e.target).parents(".slick-slide"),s=parseInt(o.attr("data-slick-index"));return s||(s=0),t.slideCount<=t.options.slidesToShow?void t.slideHandler(s,!1,!0):void t.slideHandler(s)},e.prototype.slideHandler=function(i,e,t){var o,s,n,r,l,d=null,a=this;if(e=e||!1,!(a.animating===!0&&a.options.waitForAnimate===!0||a.options.fade===!0&&a.currentSlide===i))return e===!1&&a.asNavFor(i),o=i,d=a.getLeft(o),r=a.getLeft(a.currentSlide),a.currentLeft=null===a.swipeLeft?r:a.swipeLeft,a.options.infinite===!1&&a.options.centerMode===!1&&(i<0||i>a.getDotCount()*a.options.slidesToScroll)?void(a.options.fade===!1&&(o=a.currentSlide,t!==!0&&a.slideCount>a.options.slidesToShow?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o))):a.options.infinite===!1&&a.options.centerMode===!0&&(i<0||i>a.slideCount-a.options.slidesToScroll)?void(a.options.fade===!1&&(o=a.currentSlide,t!==!0&&a.slideCount>a.options.slidesToShow?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o))):(a.options.autoplay&&clearInterval(a.autoPlayTimer),s=o<0?a.slideCount%a.options.slidesToScroll!==0?a.slideCount-a.slideCount%a.options.slidesToScroll:a.slideCount+o:o>=a.slideCount?a.slideCount%a.options.slidesToScroll!==0?0:o-a.slideCount:o,a.animating=!0,a.$slider.trigger("beforeChange",[a,a.currentSlide,s]),n=a.currentSlide,a.currentSlide=s,a.setSlideClasses(a.currentSlide),a.options.asNavFor&&(l=a.getNavTarget(),l=l.slick("getSlick"),l.slideCount<=l.options.slidesToShow&&l.setSlideClasses(a.currentSlide)),a.updateDots(),a.updateArrows(),a.options.fade===!0?(t!==!0?(a.fadeSlideOut(n),a.fadeSlide(s,function(){a.postSlide(s)})):a.postSlide(s),void a.animateHeight()):void(t!==!0&&a.slideCount>a.options.slidesToShow?a.animateSlide(d,function(){a.postSlide(s)}):a.postSlide(s)))},e.prototype.startLoad=function(){var i=this;i.options.arrows===!0&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.hide(),i.$nextArrow.hide()),i.options.dots===!0&&i.slideCount>i.options.slidesToShow&&i.$dots.hide(),i.$slider.addClass("slick-loading")},e.prototype.swipeDirection=function(){var i,e,t,o,s=this;return i=s.touchObject.startX-s.touchObject.curX,e=s.touchObject.startY-s.touchObject.curY,t=Math.atan2(e,i),o=Math.round(180*t/Math.PI),o<0&&(o=360-Math.abs(o)),o<=45&&o>=0?s.options.rtl===!1?"left":"right":o<=360&&o>=315?s.options.rtl===!1?"left":"right":o>=135&&o<=225?s.options.rtl===!1?"right":"left":s.options.verticalSwiping===!0?o>=35&&o<=135?"down":"up":"vertical"},e.prototype.swipeEnd=function(i){var e,t,o=this;if(o.dragging=!1,o.swiping=!1,o.scrolling)return o.scrolling=!1,!1;if(o.interrupted=!1,o.shouldClick=!(o.touchObject.swipeLength>10),void 0===o.touchObject.curX)return!1;if(o.touchObject.edgeHit===!0&&o.$slider.trigger("edge",[o,o.swipeDirection()]),o.touchObject.swipeLength>=o.touchObject.minSwipe){switch(t=o.swipeDirection()){case"left":case"down":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide+o.getSlideCount()):o.currentSlide+o.getSlideCount(),o.currentDirection=0;break;case"right":case"up":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide-o.getSlideCount()):o.currentSlide-o.getSlideCount(),o.currentDirection=1}"vertical"!=t&&(o.slideHandler(e),o.touchObject={},o.$slider.trigger("swipe",[o,t]))}else o.touchObject.startX!==o.touchObject.curX&&(o.slideHandler(o.currentSlide),o.touchObject={})},e.prototype.swipeHandler=function(i){var e=this;if(!(e.options.swipe===!1||"ontouchend"in document&&e.options.swipe===!1||e.options.draggable===!1&&i.type.indexOf("mouse")!==-1))switch(e.touchObject.fingerCount=i.originalEvent&&void 0!==i.originalEvent.touches?i.originalEvent.touches.length:1,e.touchObject.minSwipe=e.listWidth/e.options.touchThreshold,e.options.verticalSwiping===!0&&(e.touchObject.minSwipe=e.listHeight/e.options.touchThreshold),i.data.action){case"start":e.swipeStart(i);break;case"move":e.swipeMove(i);break;case"end":e.swipeEnd(i)}},e.prototype.swipeMove=function(i){var e,t,o,s,n,r,l=this;return n=void 0!==i.originalEvent?i.originalEvent.touches:null,!(!l.dragging||l.scrolling||n&&1!==n.length)&&(e=l.getLeft(l.currentSlide),l.touchObject.curX=void 0!==n?n[0].pageX:i.clientX,l.touchObject.curY=void 0!==n?n[0].pageY:i.clientY,l.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(l.touchObject.curX-l.touchObject.startX,2))),r=Math.round(Math.sqrt(Math.pow(l.touchObject.curY-l.touchObject.startY,2))),!l.options.verticalSwiping&&!l.swiping&&r>4?(l.scrolling=!0,!1):(l.options.verticalSwiping===!0&&(l.touchObject.swipeLength=r),t=l.swipeDirection(),void 0!==i.originalEvent&&l.touchObject.swipeLength>4&&(l.swiping=!0,i.preventDefault()),s=(l.options.rtl===!1?1:-1)*(l.touchObject.curX>l.touchObject.startX?1:-1),l.options.verticalSwiping===!0&&(s=l.touchObject.curY>l.touchObject.startY?1:-1),o=l.touchObject.swipeLength,l.touchObject.edgeHit=!1,l.options.infinite===!1&&(0===l.currentSlide&&"right"===t||l.currentSlide>=l.getDotCount()&&"left"===t)&&(o=l.touchObject.swipeLength*l.options.edgeFriction,l.touchObject.edgeHit=!0),l.options.vertical===!1?l.swipeLeft=e+o*s:l.swipeLeft=e+o*(l.$list.height()/l.listWidth)*s,l.options.verticalSwiping===!0&&(l.swipeLeft=e+o*s),l.options.fade!==!0&&l.options.touchMove!==!1&&(l.animating===!0?(l.swipeLeft=null,!1):void l.setCSS(l.swipeLeft))))},e.prototype.swipeStart=function(i){var e,t=this;return t.interrupted=!0,1!==t.touchObject.fingerCount||t.slideCount<=t.options.slidesToShow?(t.touchObject={},!1):(void 0!==i.originalEvent&&void 0!==i.originalEvent.touches&&(e=i.originalEvent.touches[0]),t.touchObject.startX=t.touchObject.curX=void 0!==e?e.pageX:i.clientX,t.touchObject.startY=t.touchObject.curY=void 0!==e?e.pageY:i.clientY,void(t.dragging=!0))},e.prototype.unfilterSlides=e.prototype.slickUnfilter=function(){var i=this;null!==i.$slidesCache&&(i.unload(),i.$slideTrack.children(this.options.slide).detach(),i.$slidesCache.appendTo(i.$slideTrack),i.reinit())},e.prototype.unload=function(){var e=this;i(".slick-cloned",e.$slider).remove(),e.$dots&&e.$dots.remove(),e.$prevArrow&&e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.remove(),e.$nextArrow&&e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.remove(),e.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")},e.prototype.unslick=function(i){var e=this;e.$slider.trigger("unslick",[e,i]),e.destroy()},e.prototype.updateArrows=function(){var i,e=this;i=Math.floor(e.options.slidesToShow/2),e.options.arrows===!0&&e.slideCount>e.options.slidesToShow&&!e.options.infinite&&(e.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),e.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===e.currentSlide?(e.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),e.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):e.currentSlide>=e.slideCount-e.options.slidesToShow&&e.options.centerMode===!1?(e.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),e.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):e.currentSlide>=e.slideCount-1&&e.options.centerMode===!0&&(e.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),e.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},e.prototype.updateDots=function(){var i=this;null!==i.$dots&&(i.$dots.find("li").removeClass("slick-active").end(),i.$dots.find("li").eq(Math.floor(i.currentSlide/i.options.slidesToScroll)).addClass("slick-active"))},e.prototype.visibility=function(){var i=this;i.options.autoplay&&(document[i.hidden]?i.interrupted=!0:i.interrupted=!1)},i.fn.slick=function(){var i,t,o=this,s=arguments[0],n=Array.prototype.slice.call(arguments,1),r=o.length;for(i=0;i<r;i++)if("object"==typeof s||"undefined"==typeof s?o[i].slick=new e(o[i],s):t=o[i].slick[s].apply(o[i].slick,n),"undefined"!=typeof t)return t;return o}});
10111;
vendor: 45,479 bytes, lines 10112-10116
10112/* == jquery mousewheel plugin == Version: 3.1.13, License: MIT License (MIT) */ 10113!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}); 10114/* == malihu jquery custom scrollbar plugin == Version: 3.1.5, License: MIT License (MIT) */ 10115!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof module&&module.exports?module.exports=e:e(jQuery,window,document)}(function(e){!function(t){var o="function"==typeof define&&define.amd,a="undefined"!=typeof module&&module.exports,n="https:"==document.location.protocol?"https:":"http:",i="cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js";o||(a?require("jquery-mousewheel")(e):e.event.special.mousewheel||e("head").append(decodeURI("%3Cscript src="+n+"//"+i+"%3E%3C/script%3E"))),t()}(function(){var t,o="mCustomScrollbar",a="mCS",n=".mCustomScrollbar",i={setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:!0,alwaysShowScrollbar:0,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",deltaFactor:"auto",disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,documentTouchScroll:!0,advanced:{autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:"auto",autoUpdateTimeout:60},theme:"light",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},r=0,l={},s=window.attachEvent&&!window.addEventListener?1:0,c=!1,d=["mCSB_dragger_onDrag","mCSB_scrollTools_onDrag","mCS_img_loaded","mCS_disabled","mCS_destroyed","mCS_no_scrollbar","mCS-autoHide","mCS-dir-rtl","mCS_no_scrollbar_y","mCS_no_scrollbar_x","mCS_y_hidden","mCS_x_hidden","mCSB_draggerContainer","mCSB_buttonUp","mCSB_buttonDown","mCSB_buttonLeft","mCSB_buttonRight"],u={init:function(t){var t=e.extend(!0,{},i,t),o=f.call(this);if(t.live){var s=t.liveSelector||this.selector||n,c=e(s);if("off"===t.live)return void m(s);l[s]=setTimeout(function(){c.mCustomScrollbar(t),"once"===t.live&&c.length&&m(s)},500)}else m(s);return t.setWidth=t.set_width?t.set_width:t.setWidth,t.setHeight=t.set_height?t.set_height:t.setHeight,t.axis=t.horizontalScroll?"x":p(t.axis),t.scrollInertia=t.scrollInertia>0&&t.scrollInertia<17?17:t.scrollInertia,"object"!=typeof t.mouseWheel&&1==t.mouseWheel&&(t.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),t.mouseWheel.scrollAmount=t.mouseWheelPixels?t.mouseWheelPixels:t.mouseWheel.scrollAmount,t.mouseWheel.normalizeDelta=t.advanced.normalizeMouseWheelDelta?t.advanced.normalizeMouseWheelDelta:t.mouseWheel.normalizeDelta,t.scrollButtons.scrollType=g(t.scrollButtons.scrollType),h(t),e(o).each(function(){var o=e(this);if(!o.data(a)){o.data(a,{idx:++r,opt:t,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:o.css("direction"),cbOffsets:null,trigger:null,poll:{size:{o:0,n:0},img:{o:0,n:0},change:{o:0,n:0}}});var n=o.data(a),i=n.opt,l=o.data("mcs-axis"),s=o.data("mcs-scrollbar-position"),c=o.data("mcs-theme");l&&(i.axis=l),s&&(i.scrollbarPosition=s),c&&(i.theme=c,h(i)),v.call(this),n&&i.callbacks.onCreate&&"function"==typeof i.callbacks.onCreate&&i.callbacks.onCreate.call(this),e("#mCSB_"+n.idx+"_container img:not(."+d[2]+")").addClass(d[2]),u.update.call(null,o)}})},update:function(t,o){var n=t||f.call(this);return e(n).each(function(){var t=e(this);if(t.data(a)){var n=t.data(a),i=n.opt,r=e("#mCSB_"+n.idx+"_container"),l=e("#mCSB_"+n.idx),s=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")];if(!r.length)return;n.tweenRunning&&Q(t),o&&n&&i.callbacks.onBeforeUpdate&&"function"==typeof i.callbacks.onBeforeUpdate&&i.callbacks.onBeforeUpdate.call(this),t.hasClass(d[3])&&t.removeClass(d[3]),t.hasClass(d[4])&&t.removeClass(d[4]),l.css("max-height","none"),l.height()!==t.height()&&l.css("max-height",t.height()),_.call(this),"y"===i.axis||i.advanced.autoExpandHorizontalScroll||r.css("width",x(r)),n.overflowed=y.call(this),M.call(this),i.autoDraggerLength&&S.call(this),b.call(this),T.call(this);var c=[Math.abs(r[0].offsetTop),Math.abs(r[0].offsetLeft)];"x"!==i.axis&&(n.overflowed[0]?s[0].height()>s[0].parent().height()?B.call(this):(G(t,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}),n.contentReset.y=null):(B.call(this),"y"===i.axis?k.call(this):"yx"===i.axis&&n.overflowed[1]&&G(t,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==i.axis&&(n.overflowed[1]?s[1].width()>s[1].parent().width()?B.call(this):(G(t,c[1].toString(),{dir:"x",dur:0,overwrite:"none"}),n.contentReset.x=null):(B.call(this),"x"===i.axis?k.call(this):"yx"===i.axis&&n.overflowed[0]&&G(t,c[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),o&&n&&(2===o&&i.callbacks.onImageLoad&&"function"==typeof i.callbacks.onImageLoad?i.callbacks.onImageLoad.call(this):3===o&&i.callbacks.onSelectorChange&&"function"==typeof i.callbacks.onSelectorChange?i.callbacks.onSelectorChange.call(this):i.callbacks.onUpdate&&"function"==typeof i.callbacks.onUpdate&&i.callbacks.onUpdate.call(this)),N.call(this)}})},scrollTo:function(t,o){if("undefined"!=typeof t&&null!=t){var n=f.call(this);return e(n).each(function(){var n=e(this);if(n.data(a)){var i=n.data(a),r=i.opt,l={trigger:"external",scrollInertia:r.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},s=e.extend(!0,{},l,o),c=Y.call(this,t),d=s.scrollInertia>0&&s.scrollInertia<17?17:s.scrollInertia;c[0]=X.call(this,c[0],"y"),c[1]=X.call(this,c[1],"x"),s.moveDragger&&(c[0]*=i.scrollRatio.y,c[1]*=i.scrollRatio.x),s.dur=ne()?0:d,setTimeout(function(){null!==c[0]&&"undefined"!=typeof c[0]&&"x"!==r.axis&&i.overflowed[0]&&(s.dir="y",s.overwrite="all",G(n,c[0].toString(),s)),null!==c[1]&&"undefined"!=typeof c[1]&&"y"!==r.axis&&i.overflowed[1]&&(s.dir="x",s.overwrite="none",G(n,c[1].toString(),s))},s.timeout)}})}},stop:function(){var t=f.call(this);return e(t).each(function(){var t=e(this);t.data(a)&&Q(t)})},disable:function(t){var o=f.call(this);return e(o).each(function(){var o=e(this);if(o.data(a)){o.data(a);N.call(this,"remove"),k.call(this),t&&B.call(this),M.call(this,!0),o.addClass(d[3])}})},destroy:function(){var t=f.call(this);return e(t).each(function(){var n=e(this);if(n.data(a)){var i=n.data(a),r=i.opt,l=e("#mCSB_"+i.idx),s=e("#mCSB_"+i.idx+"_container"),c=e(".mCSB_"+i.idx+"_scrollbar");r.live&&m(r.liveSelector||e(t).selector),N.call(this,"remove"),k.call(this),B.call(this),n.removeData(a),$(this,"mcs"),c.remove(),s.find("img."+d[2]).removeClass(d[2]),l.replaceWith(s.contents()),n.removeClass(o+" _"+a+"_"+i.idx+" "+d[6]+" "+d[7]+" "+d[5]+" "+d[3]).addClass(d[4])}})}},f=function(){return"object"!=typeof e(this)||e(this).length<1?n:this},h=function(t){var o=["rounded","rounded-dark","rounded-dots","rounded-dots-dark"],a=["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"],n=["minimal","minimal-dark"],i=["minimal","minimal-dark"],r=["minimal","minimal-dark"];t.autoDraggerLength=e.inArray(t.theme,o)>-1?!1:t.autoDraggerLength,t.autoExpandScrollbar=e.inArray(t.theme,a)>-1?!1:t.autoExpandScrollbar,t.scrollButtons.enable=e.inArray(t.theme,n)>-1?!1:t.scrollButtons.enable,t.autoHideScrollbar=e.inArray(t.theme,i)>-1?!0:t.autoHideScrollbar,t.scrollbarPosition=e.inArray(t.theme,r)>-1?"outside":t.scrollbarPosition},m=function(e){l[e]&&(clearTimeout(l[e]),$(l,e))},p=function(e){return"yx"===e||"xy"===e||"auto"===e?"yx":"x"===e||"horizontal"===e?"x":"y"},g=function(e){return"stepped"===e||"pixels"===e||"step"===e||"click"===e?"stepped":"stepless"},v=function(){var t=e(this),n=t.data(a),i=n.opt,r=i.autoExpandScrollbar?" "+d[1]+"_expand":"",l=["<div id='mCSB_"+n.idx+"_scrollbar_vertical' class='mCSB_scrollTools mCSB_"+n.idx+"_scrollbar mCS-"+i.theme+" mCSB_scrollTools_vertical"+r+"'><div class='"+d[12]+"'><div id='mCSB_"+n.idx+"_dragger_vertical' class='mCSB_dragger' style='position:absolute;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>","<div id='mCSB_"+n.idx+"_scrollbar_horizontal' class='mCSB_scrollTools mCSB_"+n.idx+"_scrollbar mCS-"+i.theme+" mCSB_scrollTools_horizontal"+r+"'><div class='"+d[12]+"'><div id='mCSB_"+n.idx+"_dragger_horizontal' class='mCSB_dragger' style='position:absolute;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>"],s="yx"===i.axis?"mCSB_vertical_horizontal":"x"===i.axis?"mCSB_horizontal":"mCSB_vertical",c="yx"===i.axis?l[0]+l[1]:"x"===i.axis?l[1]:l[0],u="yx"===i.axis?"<div id='mCSB_"+n.idx+"_container_wrapper' class='mCSB_container_wrapper' />":"",f=i.autoHideScrollbar?" "+d[6]:"",h="x"!==i.axis&&"rtl"===n.langDir?" "+d[7]:"";i.setWidth&&t.css("width",i.setWidth),i.setHeight&&t.css("height",i.setHeight),i.setLeft="y"!==i.axis&&"rtl"===n.langDir?"989999px":i.setLeft,t.addClass(o+" _"+a+"_"+n.idx+f+h).wrapInner("<div id='mCSB_"+n.idx+"' class='mCustomScrollBox mCS-"+i.theme+" "+s+"'><div id='mCSB_"+n.idx+"_container' class='mCSB_container' style='position:relative; top:"+i.setTop+"; left:"+i.setLeft+";' dir='"+n.langDir+"' /></div>");var m=e("#mCSB_"+n.idx),p=e("#mCSB_"+n.idx+"_container");"y"===i.axis||i.advanced.autoExpandHorizontalScroll||p.css("width",x(p)),"outside"===i.scrollbarPosition?("static"===t.css("position")&&t.css("position","relative"),t.css("overflow","visible"),m.addClass("mCSB_outside").after(c)):(m.addClass("mCSB_inside").append(c),p.wrap(u)),w.call(this);var g=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")];g[0].css("min-height",g[0].height()),g[1].css("min-width",g[1].width())},x=function(t){var o=[t[0].scrollWidth,Math.max.apply(Math,t.children().map(function(){return e(this).outerWidth(!0)}).get())],a=t.parent().width();return o[0]>a?o[0]:o[1]>a?o[1]:"100%"},_=function(){var t=e(this),o=t.data(a),n=o.opt,i=e("#mCSB_"+o.idx+"_container");if(n.advanced.autoExpandHorizontalScroll&&"y"!==n.axis){i.css({width:"auto","min-width":0,"overflow-x":"scroll"});var r=Math.ceil(i[0].scrollWidth);3===n.advanced.autoExpandHorizontalScroll||2!==n.advanced.autoExpandHorizontalScroll&&r>i.parent().width()?i.css({width:r,"min-width":"100%","overflow-x":"inherit"}):i.css({"overflow-x":"inherit",position:"absolute"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:Math.ceil(i[0].getBoundingClientRect().right+.4)-Math.floor(i[0].getBoundingClientRect().left),"min-width":"100%",position:"relative"}).unwrap()}},w=function(){var t=e(this),o=t.data(a),n=o.opt,i=e(".mCSB_"+o.idx+"_scrollbar:first"),r=oe(n.scrollButtons.tabindex)?"tabindex='"+n.scrollButtons.tabindex+"'":"",l=["<a href='#' class='"+d[13]+"' "+r+" />","<a href='#' class='"+d[14]+"' "+r+" />","<a href='#' class='"+d[15]+"' "+r+" />","<a href='#' class='"+d[16]+"' "+r+" />"],s=["x"===n.axis?l[2]:l[0],"x"===n.axis?l[3]:l[1],l[2],l[3]];n.scrollButtons.enable&&i.prepend(s[0]).append(s[1]).next(".mCSB_scrollTools").prepend(s[2]).append(s[3])},S=function(){var t=e(this),o=t.data(a),n=e("#mCSB_"+o.idx),i=e("#mCSB_"+o.idx+"_container"),r=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")],l=[n.height()/i.outerHeight(!1),n.width()/i.outerWidth(!1)],c=[parseInt(r[0].css("min-height")),Math.round(l[0]*r[0].parent().height()),parseInt(r[1].css("min-width")),Math.round(l[1]*r[1].parent().width())],d=s&&c[1]<c[0]?c[0]:c[1],u=s&&c[3]<c[2]?c[2]:c[3];r[0].css({height:d,"max-height":r[0].parent().height()-10}).find(".mCSB_dragger_bar").css({"line-height":c[0]+"px"}),r[1].css({width:u,"max-width":r[1].parent().width()-10})},b=function(){var t=e(this),o=t.data(a),n=e("#mCSB_"+o.idx),i=e("#mCSB_"+o.idx+"_container"),r=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")],l=[i.outerHeight(!1)-n.height(),i.outerWidth(!1)-n.width()],s=[l[0]/(r[0].parent().height()-r[0].height()),l[1]/(r[1].parent().width()-r[1].width())];o.scrollRatio={y:s[0],x:s[1]}},C=function(e,t,o){var a=o?d[0]+"_expanded":"",n=e.closest(".mCSB_scrollTools");"active"===t?(e.toggleClass(d[0]+" "+a),n.toggleClass(d[1]),e[0]._draggable=e[0]._draggable?0:1):e[0]._draggable||("hide"===t?(e.removeClass(d[0]),n.removeClass(d[1])):(e.addClass(d[0]),n.addClass(d[1])))},y=function(){var t=e(this),o=t.data(a),n=e("#mCSB_"+o.idx),i=e("#mCSB_"+o.idx+"_container"),r=null==o.overflowed?i.height():i.outerHeight(!1),l=null==o.overflowed?i.width():i.outerWidth(!1),s=i[0].scrollHeight,c=i[0].scrollWidth;return s>r&&(r=s),c>l&&(l=c),[r>n.height(),l>n.width()]},B=function(){var t=e(this),o=t.data(a),n=o.opt,i=e("#mCSB_"+o.idx),r=e("#mCSB_"+o.idx+"_container"),l=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")];if(Q(t),("x"!==n.axis&&!o.overflowed[0]||"y"===n.axis&&o.overflowed[0])&&(l[0].add(r).css("top",0),G(t,"_resetY")),"y"!==n.axis&&!o.overflowed[1]||"x"===n.axis&&o.overflowed[1]){var s=dx=0;"rtl"===o.langDir&&(s=i.width()-r.outerWidth(!1),dx=Math.abs(s/o.scrollRatio.x)),r.css("left",s),l[1].css("left",dx),G(t,"_resetX")}},T=function(){function t(){r=setTimeout(function(){e.event.special.mousewheel?(clearTimeout(r),W.call(o[0])):t()},100)}var o=e(this),n=o.data(a),i=n.opt;if(!n.bindEvents){if(I.call(this),i.contentTouchScroll&&D.call(this),E.call(this),i.mouseWheel.enable){var r;t()}P.call(this),U.call(this),i.advanced.autoScrollOnFocus&&H.call(this),i.scrollButtons.enable&&F.call(this),i.keyboard.enable&&q.call(this),n.bindEvents=!0}},k=function(){var t=e(this),o=t.data(a),n=o.opt,i=a+"_"+o.idx,r=".mCSB_"+o.idx+"_scrollbar",l=e("#mCSB_"+o.idx+",#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,"+r+" ."+d[12]+",#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal,"+r+">a"),s=e("#mCSB_"+o.idx+"_container");n.advanced.releaseDraggableSelectors&&l.add(e(n.advanced.releaseDraggableSelectors)),n.advanced.extraDraggableSelectors&&l.add(e(n.advanced.extraDraggableSelectors)),o.bindEvents&&(e(document).add(e(!A()||top.document)).unbind("."+i),l.each(function(){e(this).unbind("."+i)}),clearTimeout(t[0]._focusTimeout),$(t[0],"_focusTimeout"),clearTimeout(o.sequential.step),$(o.sequential,"step"),clearTimeout(s[0].onCompleteTimeout),$(s[0],"onCompleteTimeout"),o.bindEvents=!1)},M=function(t){var o=e(this),n=o.data(a),i=n.opt,r=e("#mCSB_"+n.idx+"_container_wrapper"),l=r.length?r:e("#mCSB_"+n.idx+"_container"),s=[e("#mCSB_"+n.idx+"_scrollbar_vertical"),e("#mCSB_"+n.idx+"_scrollbar_horizontal")],c=[s[0].find(".mCSB_dragger"),s[1].find(".mCSB_dragger")];"x"!==i.axis&&(n.overflowed[0]&&!t?(s[0].add(c[0]).add(s[0].children("a")).css("display","block"),l.removeClass(d[8]+" "+d[10])):(i.alwaysShowScrollbar?(2!==i.alwaysShowScrollbar&&c[0].css("display","none"),l.removeClass(d[10])):(s[0].css("display","none"),l.addClass(d[10])),l.addClass(d[8]))),"y"!==i.axis&&(n.overflowed[1]&&!t?(s[1].add(c[1]).add(s[1].children("a")).css("display","block"),l.removeClass(d[9]+" "+d[11])):(i.alwaysShowScrollbar?(2!==i.alwaysShowScrollbar&&c[1].css("display","none"),l.removeClass(d[11])):(s[1].css("display","none"),l.addClass(d[11])),l.addClass(d[9]))),n.overflowed[0]||n.overflowed[1]?o.removeClass(d[5]):o.addClass(d[5])},O=function(t){var o=t.type,a=t.target.ownerDocument!==document&&null!==frameElement?[e(frameElement).offset().top,e(frameElement).offset().left]:null,n=A()&&t.target.ownerDocument!==top.document&&null!==frameElement?[e(t.view.frameElement).offset().top,e(t.view.frameElement).offset().left]:[0,0];switch(o){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return a?[t.originalEvent.pageY-a[0]+n[0],t.originalEvent.pageX-a[1]+n[1],!1]:[t.originalEvent.pageY,t.originalEvent.pageX,!1];case"touchstart":case"touchmove":case"touchend":var i=t.originalEvent.touches[0]||t.originalEvent.changedTouches[0],r=t.originalEvent.touches.length||t.originalEvent.changedTouches.length;return t.target.ownerDocument!==document?[i.screenY,i.screenX,r>1]:[i.pageY,i.pageX,r>1];default:return a?[t.pageY-a[0]+n[0],t.pageX-a[1]+n[1],!1]:[t.pageY,t.pageX,!1]}},I=function(){function t(e,t,a,n){if(h[0].idleTimer=d.scrollInertia<233?250:0,o.attr("id")===f[1])var i="x",s=(o[0].offsetLeft-t+n)*l.scrollRatio.x;else var i="y",s=(o[0].offsetTop-e+a)*l.scrollRatio.y;G(r,s.toString(),{dir:i,drag:!0})}var o,n,i,r=e(this),l=r.data(a),d=l.opt,u=a+"_"+l.idx,f=["mCSB_"+l.idx+"_dragger_vertical","mCSB_"+l.idx+"_dragger_horizontal"],h=e("#mCSB_"+l.idx+"_container"),m=e("#"+f[0]+",#"+f[1]),p=d.advanced.releaseDraggableSelectors?m.add(e(d.advanced.releaseDraggableSelectors)):m,g=d.advanced.extraDraggableSelectors?e(!A()||top.document).add(e(d.advanced.extraDraggableSelectors)):e(!A()||top.document);m.bind("contextmenu."+u,function(e){e.preventDefault()}).bind("mousedown."+u+" touchstart."+u+" pointerdown."+u+" MSPointerDown."+u,function(t){if(t.stopImmediatePropagation(),t.preventDefault(),ee(t)){c=!0,s&&(document.onselectstart=function(){return!1}),L.call(h,!1),Q(r),o=e(this);var a=o.offset(),l=O(t)[0]-a.top,u=O(t)[1]-a.left,f=o.height()+a.top,m=o.width()+a.left;f>l&&l>0&&m>u&&u>0&&(n=l,i=u),C(o,"active",d.autoExpandScrollbar)}}).bind("touchmove."+u,function(e){e.stopImmediatePropagation(),e.preventDefault();var a=o.offset(),r=O(e)[0]-a.top,l=O(e)[1]-a.left;t(n,i,r,l)}),e(document).add(g).bind("mousemove."+u+" pointermove."+u+" MSPointerMove."+u,function(e){if(o){var a=o.offset(),r=O(e)[0]-a.top,l=O(e)[1]-a.left;if(n===r&&i===l)return;t(n,i,r,l)}}).add(p).bind("mouseup."+u+" touchend."+u+" pointerup."+u+" MSPointerUp."+u,function(){o&&(C(o,"active",d.autoExpandScrollbar),o=null),c=!1,s&&(document.onselectstart=null),L.call(h,!0)})},D=function(){function o(e){if(!te(e)||c||O(e)[2])return void(t=0);t=1,b=0,C=0,d=1,y.removeClass("mCS_touch_action");var o=I.offset();u=O(e)[0]-o.top,f=O(e)[1]-o.left,z=[O(e)[0],O(e)[1]]}function n(e){if(te(e)&&!c&&!O(e)[2]&&(T.documentTouchScroll||e.preventDefault(),e.stopImmediatePropagation(),(!C||b)&&d)){g=K();var t=M.offset(),o=O(e)[0]-t.top,a=O(e)[1]-t.left,n="mcsLinearOut";if(E.push(o),W.push(a),z[2]=Math.abs(O(e)[0]-z[0]),z[3]=Math.abs(O(e)[1]-z[1]),B.overflowed[0])var i=D[0].parent().height()-D[0].height(),r=u-o>0&&o-u>-(i*B.scrollRatio.y)&&(2*z[3]<z[2]||"yx"===T.axis);if(B.overflowed[1])var l=D[1].parent().width()-D[1].width(),h=f-a>0&&a-f>-(l*B.scrollRatio.x)&&(2*z[2]<z[3]||"yx"===T.axis);r||h?(U||e.preventDefault(),b=1):(C=1,y.addClass("mCS_touch_action")),U&&e.preventDefault(),w="yx"===T.axis?[u-o,f-a]:"x"===T.axis?[null,f-a]:[u-o,null],I[0].idleTimer=250,B.overflowed[0]&&s(w[0],R,n,"y","all",!0),B.overflowed[1]&&s(w[1],R,n,"x",L,!0)}}function i(e){if(!te(e)||c||O(e)[2])return void(t=0);t=1,e.stopImmediatePropagation(),Q(y),p=K();var o=M.offset();h=O(e)[0]-o.top,m=O(e)[1]-o.left,E=[],W=[]}function r(e){if(te(e)&&!c&&!O(e)[2]){d=0,e.stopImmediatePropagation(),b=0,C=0,v=K();var t=M.offset(),o=O(e)[0]-t.top,a=O(e)[1]-t.left;if(!(v-g>30)){_=1e3/(v-p);var n="mcsEaseOut",i=2.5>_,r=i?[E[E.length-2],W[W.length-2]]:[0,0];x=i?[o-r[0],a-r[1]]:[o-h,a-m];var u=[Math.abs(x[0]),Math.abs(x[1])];_=i?[Math.abs(x[0]/4),Math.abs(x[1]/4)]:[_,_];var f=[Math.abs(I[0].offsetTop)-x[0]*l(u[0]/_[0],_[0]),Math.abs(I[0].offsetLeft)-x[1]*l(u[1]/_[1],_[1])];w="yx"===T.axis?[f[0],f[1]]:"x"===T.axis?[null,f[1]]:[f[0],null],S=[4*u[0]+T.scrollInertia,4*u[1]+T.scrollInertia];var y=parseInt(T.contentTouchScroll)||0;w[0]=u[0]>y?w[0]:0,w[1]=u[1]>y?w[1]:0,B.overflowed[0]&&s(w[0],S[0],n,"y",L,!1),B.overflowed[1]&&s(w[1],S[1],n,"x",L,!1)}}}function l(e,t){var o=[1.5*t,2*t,t/1.5,t/2];return e>90?t>4?o[0]:o[3]:e>60?t>3?o[3]:o[2]:e>30?t>8?o[1]:t>6?o[0]:t>4?t:o[2]:t>8?t:o[3]}function s(e,t,o,a,n,i){e&&G(y,e.toString(),{dur:t,scrollEasing:o,dir:a,overwrite:n,drag:i})}var d,u,f,h,m,p,g,v,x,_,w,S,b,C,y=e(this),B=y.data(a),T=B.opt,k=a+"_"+B.idx,M=e("#mCSB_"+B.idx),I=e("#mCSB_"+B.idx+"_container"),D=[e("#mCSB_"+B.idx+"_dragger_vertical"),e("#mCSB_"+B.idx+"_dragger_horizontal")],E=[],W=[],R=0,L="yx"===T.axis?"none":"all",z=[],P=I.find("iframe"),H=["touchstart."+k+" pointerdown."+k+" MSPointerDown."+k,"touchmove."+k+" pointermove."+k+" MSPointerMove."+k,"touchend."+k+" pointerup."+k+" MSPointerUp."+k],U=void 0!==document.body.style.touchAction&&""!==document.body.style.touchAction;I.bind(H[0],function(e){o(e)}).bind(H[1],function(e){n(e)}),M.bind(H[0],function(e){i(e)}).bind(H[2],function(e){r(e)}),P.length&&P.each(function(){e(this).bind("load",function(){A(this)&&e(this.contentDocument||this.contentWindow.document).bind(H[0],function(e){o(e),i(e)}).bind(H[1],function(e){n(e)}).bind(H[2],function(e){r(e)})})})},E=function(){function o(){return window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type?document.selection.createRange().text:0}function n(e,t,o){d.type=o&&i?"stepped":"stepless",d.scrollAmount=10,j(r,e,t,"mcsLinearOut",o?60:null)}var i,r=e(this),l=r.data(a),s=l.opt,d=l.sequential,u=a+"_"+l.idx,f=e("#mCSB_"+l.idx+"_container"),h=f.parent();f.bind("mousedown."+u,function(){t||i||(i=1,c=!0)}).add(document).bind("mousemove."+u,function(e){if(!t&&i&&o()){var a=f.offset(),r=O(e)[0]-a.top+f[0].offsetTop,c=O(e)[1]-a.left+f[0].offsetLeft;r>0&&r<h.height()&&c>0&&c<h.width()?d.step&&n("off",null,"stepped"):("x"!==s.axis&&l.overflowed[0]&&(0>r?n("on",38):r>h.height()&&n("on",40)),"y"!==s.axis&&l.overflowed[1]&&(0>c?n("on",37):c>h.width()&&n("on",39)))}}).bind("mouseup."+u+" dragend."+u,function(){t||(i&&(i=0,n("off",null)),c=!1)})},W=function(){function t(t,a){if(Q(o),!z(o,t.target)){var r="auto"!==i.mouseWheel.deltaFactor?parseInt(i.mouseWheel.deltaFactor):s&&t.deltaFactor<100?100:t.deltaFactor||100,d=i.scrollInertia;if("x"===i.axis||"x"===i.mouseWheel.axis)var u="x",f=[Math.round(r*n.scrollRatio.x),parseInt(i.mouseWheel.scrollAmount)],h="auto"!==i.mouseWheel.scrollAmount?f[1]:f[0]>=l.width()?.9*l.width():f[0],m=Math.abs(e("#mCSB_"+n.idx+"_container")[0].offsetLeft),p=c[1][0].offsetLeft,g=c[1].parent().width()-c[1].width(),v="y"===i.mouseWheel.axis?t.deltaY||a:t.deltaX;else var u="y",f=[Math.round(r*n.scrollRatio.y),parseInt(i.mouseWheel.scrollAmount)],h="auto"!==i.mouseWheel.scrollAmount?f[1]:f[0]>=l.height()?.9*l.height():f[0],m=Math.abs(e("#mCSB_"+n.idx+"_container")[0].offsetTop),p=c[0][0].offsetTop,g=c[0].parent().height()-c[0].height(),v=t.deltaY||a;"y"===u&&!n.overflowed[0]||"x"===u&&!n.overflowed[1]||((i.mouseWheel.invert||t.webkitDirectionInvertedFromDevice)&&(v=-v),i.mouseWheel.normalizeDelta&&(v=0>v?-1:1),(v>0&&0!==p||0>v&&p!==g||i.mouseWheel.preventDefault)&&(t.stopImmediatePropagation(),t.preventDefault()),t.deltaFactor<5&&!i.mouseWheel.normalizeDelta&&(h=t.deltaFactor,d=17),G(o,(m-v*h).toString(),{dir:u,dur:d}))}}if(e(this).data(a)){var o=e(this),n=o.data(a),i=n.opt,r=a+"_"+n.idx,l=e("#mCSB_"+n.idx),c=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")],d=e("#mCSB_"+n.idx+"_container").find("iframe");d.length&&d.each(function(){e(this).bind("load",function(){A(this)&&e(this.contentDocument||this.contentWindow.document).bind("mousewheel."+r,function(e,o){t(e,o)})})}),l.bind("mousewheel."+r,function(e,o){t(e,o)})}},R=new Object,A=function(t){var o=!1,a=!1,n=null;if(void 0===t?a="#empty":void 0!==e(t).attr("id")&&(a=e(t).attr("id")),a!==!1&&void 0!==R[a])return R[a];if(t){try{var i=t.contentDocument||t.contentWindow.document;n=i.body.innerHTML}catch(r){}o=null!==n}else{try{var i=top.document;n=i.body.innerHTML}catch(r){}o=null!==n}return a!==!1&&(R[a]=o),o},L=function(e){var t=this.find("iframe");if(t.length){var o=e?"auto":"none";t.css("pointer-events",o)}},z=function(t,o){var n=o.nodeName.toLowerCase(),i=t.data(a).opt.mouseWheel.disableOver,r=["select","textarea"];return e.inArray(n,i)>-1&&!(e.inArray(n,r)>-1&&!e(o).is(":focus"))},P=function(){var t,o=e(this),n=o.data(a),i=a+"_"+n.idx,r=e("#mCSB_"+n.idx+"_container"),l=r.parent(),s=e(".mCSB_"+n.idx+"_scrollbar ."+d[12]);s.bind("mousedown."+i+" touchstart."+i+" pointerdown."+i+" MSPointerDown."+i,function(o){c=!0,e(o.target).hasClass("mCSB_dragger")||(t=1)}).bind("touchend."+i+" pointerup."+i+" MSPointerUp."+i,function(){c=!1}).bind("click."+i,function(a){if(t&&(t=0,e(a.target).hasClass(d[12])||e(a.target).hasClass("mCSB_draggerRail"))){Q(o);var i=e(this),s=i.find(".mCSB_dragger");if(i.parent(".mCSB_scrollTools_horizontal").length>0){if(!n.overflowed[1])return;var c="x",u=a.pageX>s.offset().left?-1:1,f=Math.abs(r[0].offsetLeft)-u*(.9*l.width())}else{if(!n.overflowed[0])return;var c="y",u=a.pageY>s.offset().top?-1:1,f=Math.abs(r[0].offsetTop)-u*(.9*l.height())}G(o,f.toString(),{dir:c,scrollEasing:"mcsEaseInOut"})}})},H=function(){var t=e(this),o=t.data(a),n=o.opt,i=a+"_"+o.idx,r=e("#mCSB_"+o.idx+"_container"),l=r.parent();r.bind("focusin."+i,function(){var o=e(document.activeElement),a=r.find(".mCustomScrollBox").length,i=0;o.is(n.advanced.autoScrollOnFocus)&&(Q(t),clearTimeout(t[0]._focusTimeout),t[0]._focusTimer=a?(i+17)*a:0,t[0]._focusTimeout=setTimeout(function(){var e=[ae(o)[0],ae(o)[1]],a=[r[0].offsetTop,r[0].offsetLeft],s=[a[0]+e[0]>=0&&a[0]+e[0]<l.height()-o.outerHeight(!1),a[1]+e[1]>=0&&a[0]+e[1]<l.width()-o.outerWidth(!1)],c="yx"!==n.axis||s[0]||s[1]?"all":"none";"x"===n.axis||s[0]||G(t,e[0].toString(),{dir:"y",scrollEasing:"mcsEaseInOut",overwrite:c,dur:i}),"y"===n.axis||s[1]||G(t,e[1].toString(),{dir:"x",scrollEasing:"mcsEaseInOut",overwrite:c,dur:i})},t[0]._focusTimer))})},U=function(){var t=e(this),o=t.data(a),n=a+"_"+o.idx,i=e("#mCSB_"+o.idx+"_container").parent();i.bind("scroll."+n,function(){0===i.scrollTop()&&0===i.scrollLeft()||e(".mCSB_"+o.idx+"_scrollbar").css("visibility","hidden")})},F=function(){var t=e(this),o=t.data(a),n=o.opt,i=o.sequential,r=a+"_"+o.idx,l=".mCSB_"+o.idx+"_scrollbar",s=e(l+">a");s.bind("contextmenu."+r,function(e){e.preventDefault()}).bind("mousedown."+r+" touchstart."+r+" pointerdown."+r+" MSPointerDown."+r+" mouseup."+r+" touchend."+r+" pointerup."+r+" MSPointerUp."+r+" mouseout."+r+" pointerout."+r+" MSPointerOut."+r+" click."+r,function(a){function r(e,o){i.scrollAmount=n.scrollButtons.scrollAmount,j(t,e,o)}if(a.preventDefault(),ee(a)){var l=e(this).attr("class");switch(i.type=n.scrollButtons.scrollType,a.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===i.type)return;c=!0,o.tweenRunning=!1,r("on",l);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===i.type)return;c=!1,i.dir&&r("off",l);break;case"click":if("stepped"!==i.type||o.tweenRunning)return;r("on",l)}}})},q=function(){function t(t){function a(e,t){r.type=i.keyboard.scrollType,r.scrollAmount=i.keyboard.scrollAmount,"stepped"===r.type&&n.tweenRunning||j(o,e,t)}switch(t.type){case"blur":n.tweenRunning&&r.dir&&a("off",null);break;case"keydown":case"keyup":var l=t.keyCode?t.keyCode:t.which,s="on";if("x"!==i.axis&&(38===l||40===l)||"y"!==i.axis&&(37===l||39===l)){if((38===l||40===l)&&!n.overflowed[0]||(37===l||39===l)&&!n.overflowed[1])return;"keyup"===t.type&&(s="off"),e(document.activeElement).is(u)||(t.preventDefault(),t.stopImmediatePropagation(),a(s,l))}else if(33===l||34===l){if((n.overflowed[0]||n.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type){Q(o);var f=34===l?-1:1;if("x"===i.axis||"yx"===i.axis&&n.overflowed[1]&&!n.overflowed[0])var h="x",m=Math.abs(c[0].offsetLeft)-f*(.9*d.width());else var h="y",m=Math.abs(c[0].offsetTop)-f*(.9*d.height());G(o,m.toString(),{dir:h,scrollEasing:"mcsEaseInOut"})}}else if((35===l||36===l)&&!e(document.activeElement).is(u)&&((n.overflowed[0]||n.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type)){if("x"===i.axis||"yx"===i.axis&&n.overflowed[1]&&!n.overflowed[0])var h="x",m=35===l?Math.abs(d.width()-c.outerWidth(!1)):0;else var h="y",m=35===l?Math.abs(d.height()-c.outerHeight(!1)):0;G(o,m.toString(),{dir:h,scrollEasing:"mcsEaseInOut"})}}}var o=e(this),n=o.data(a),i=n.opt,r=n.sequential,l=a+"_"+n.idx,s=e("#mCSB_"+n.idx),c=e("#mCSB_"+n.idx+"_container"),d=c.parent(),u="input,textarea,select,datalist,keygen,[contenteditable='true']",f=c.find("iframe"),h=["blur."+l+" keydown."+l+" keyup."+l];f.length&&f.each(function(){e(this).bind("load",function(){A(this)&&e(this.contentDocument||this.contentWindow.document).bind(h[0],function(e){t(e)})})}),s.attr("tabindex","0").bind(h[0],function(e){t(e)})},j=function(t,o,n,i,r){function l(e){u.snapAmount&&(f.scrollAmount=u.snapAmount instanceof Array?"x"===f.dir[0]?u.snapAmount[1]:u.snapAmount[0]:u.snapAmount);var o="stepped"!==f.type,a=r?r:e?o?p/1.5:g:1e3/60,n=e?o?7.5:40:2.5,s=[Math.abs(h[0].offsetTop),Math.abs(h[0].offsetLeft)],d=[c.scrollRatio.y>10?10:c.scrollRatio.y,c.scrollRatio.x>10?10:c.scrollRatio.x],m="x"===f.dir[0]?s[1]+f.dir[1]*(d[1]*n):s[0]+f.dir[1]*(d[0]*n),v="x"===f.dir[0]?s[1]+f.dir[1]*parseInt(f.scrollAmount):s[0]+f.dir[1]*parseInt(f.scrollAmount),x="auto"!==f.scrollAmount?v:m,_=i?i:e?o?"mcsLinearOut":"mcsEaseInOut":"mcsLinear",w=!!e;return e&&17>a&&(x="x"===f.dir[0]?s[1]:s[0]),G(t,x.toString(),{dir:f.dir[0],scrollEasing:_,dur:a,onComplete:w}),e?void(f.dir=!1):(clearTimeout(f.step),void(f.step=setTimeout(function(){l()},a)))}function s(){clearTimeout(f.step),$(f,"step"),Q(t)}var c=t.data(a),u=c.opt,f=c.sequential,h=e("#mCSB_"+c.idx+"_container"),m="stepped"===f.type,p=u.scrollInertia<26?26:u.scrollInertia,g=u.scrollInertia<1?17:u.scrollInertia;switch(o){case"on":if(f.dir=[n===d[16]||n===d[15]||39===n||37===n?"x":"y",n===d[13]||n===d[15]||38===n||37===n?-1:1],Q(t),oe(n)&&"stepped"===f.type)return;l(m);break;case"off":s(),(m||c.tweenRunning&&f.dir)&&l(!0)}},Y=function(t){var o=e(this).data(a).opt,n=[];return"function"==typeof t&&(t=t()),t instanceof Array?n=t.length>1?[t[0],t[1]]:"x"===o.axis?[null,t[0]]:[t[0],null]:(n[0]=t.y?t.y:t.x||"x"===o.axis?null:t,n[1]=t.x?t.x:t.y||"y"===o.axis?null:t),"function"==typeof n[0]&&(n[0]=n[0]()),"function"==typeof n[1]&&(n[1]=n[1]()),n},X=function(t,o){if(null!=t&&"undefined"!=typeof t){var n=e(this),i=n.data(a),r=i.opt,l=e("#mCSB_"+i.idx+"_container"),s=l.parent(),c=typeof t;o||(o="x"===r.axis?"x":"y");var d="x"===o?l.outerWidth(!1)-s.width():l.outerHeight(!1)-s.height(),f="x"===o?l[0].offsetLeft:l[0].offsetTop,h="x"===o?"left":"top";switch(c){case"function":return t();case"object":var m=t.jquery?t:e(t);if(!m.length)return;return"x"===o?ae(m)[1]:ae(m)[0];case"string":case"number":if(oe(t))return Math.abs(t);if(-1!==t.indexOf("%"))return Math.abs(d*parseInt(t)/100);if(-1!==t.indexOf("-="))return Math.abs(f-parseInt(t.split("-=")[1]));if(-1!==t.indexOf("+=")){var p=f+parseInt(t.split("+=")[1]);return p>=0?0:Math.abs(p)}if(-1!==t.indexOf("px")&&oe(t.split("px")[0]))return Math.abs(t.split("px")[0]);if("top"===t||"left"===t)return 0;if("bottom"===t)return Math.abs(s.height()-l.outerHeight(!1));if("right"===t)return Math.abs(s.width()-l.outerWidth(!1));if("first"===t||"last"===t){var m=l.find(":"+t);return"x"===o?ae(m)[1]:ae(m)[0]}return e(t).length?"x"===o?ae(e(t))[1]:ae(e(t))[0]:(l.css(h,t),void u.update.call(null,n[0]))}}},N=function(t){function o(){return clearTimeout(f[0].autoUpdate),0===l.parents("html").length?void(l=null):void(f[0].autoUpdate=setTimeout(function(){return c.advanced.updateOnSelectorChange&&(s.poll.change.n=i(),s.poll.change.n!==s.poll.change.o)?(s.poll.change.o=s.poll.change.n,void r(3)):c.advanced.updateOnContentResize&&(s.poll.size.n=l[0].scrollHeight+l[0].scrollWidth+f[0].offsetHeight+l[0].offsetHeight+l[0].offsetWidth,s.poll.size.n!==s.poll.size.o)?(s.poll.size.o=s.poll.size.n,void r(1)):!c.advanced.updateOnImageLoad||"auto"===c.advanced.updateOnImageLoad&&"y"===c.axis||(s.poll.img.n=f.find("img").length,s.poll.img.n===s.poll.img.o)?void((c.advanced.updateOnSelectorChange||c.advanced.updateOnContentResize||c.advanced.updateOnImageLoad)&&o()):(s.poll.img.o=s.poll.img.n,void f.find("img").each(function(){n(this)}))},c.advanced.autoUpdateTimeout))}function n(t){function o(e,t){return function(){ 10116return t.apply(e,arguments)}}function a(){this.onload=null,e(t).addClass(d[2]),r(2)}if(e(t).hasClass(d[2]))return void r();var n=new Image;n.onload=o(n,a),n.src=t.src}function i(){c.advanced.updateOnSelectorChange===!0&&(c.advanced.updateOnSelectorChange="*");var e=0,t=f.find(c.advanced.updateOnSelectorChange);return c.advanced.updateOnSelectorChange&&t.length>0&&t.each(function(){e+=this.offsetHeight+this.offsetWidth}),e}function r(e){clearTimeout(f[0].autoUpdate),u.update.call(null,l[0],e)}var l=e(this),s=l.data(a),c=s.opt,f=e("#mCSB_"+s.idx+"_container");return t?(clearTimeout(f[0].autoUpdate),void $(f[0],"autoUpdate")):void o()},V=function(e,t,o){return Math.round(e/t)*t-o},Q=function(t){var o=t.data(a),n=e("#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal");n.each(function(){Z.call(this)})},G=function(t,o,n){function i(e){return s&&c.callbacks[e]&&"function"==typeof c.callbacks[e]}function r(){return[c.callbacks.alwaysTriggerOffsets||w>=S[0]+y,c.callbacks.alwaysTriggerOffsets||-B>=w]}function l(){var e=[h[0].offsetTop,h[0].offsetLeft],o=[x[0].offsetTop,x[0].offsetLeft],a=[h.outerHeight(!1),h.outerWidth(!1)],i=[f.height(),f.width()];t[0].mcs={content:h,top:e[0],left:e[1],draggerTop:o[0],draggerLeft:o[1],topPct:Math.round(100*Math.abs(e[0])/(Math.abs(a[0])-i[0])),leftPct:Math.round(100*Math.abs(e[1])/(Math.abs(a[1])-i[1])),direction:n.dir}}var s=t.data(a),c=s.opt,d={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:c.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},n=e.extend(d,n),u=[n.dur,n.drag?0:n.dur],f=e("#mCSB_"+s.idx),h=e("#mCSB_"+s.idx+"_container"),m=h.parent(),p=c.callbacks.onTotalScrollOffset?Y.call(t,c.callbacks.onTotalScrollOffset):[0,0],g=c.callbacks.onTotalScrollBackOffset?Y.call(t,c.callbacks.onTotalScrollBackOffset):[0,0];if(s.trigger=n.trigger,0===m.scrollTop()&&0===m.scrollLeft()||(e(".mCSB_"+s.idx+"_scrollbar").css("visibility","visible"),m.scrollTop(0).scrollLeft(0)),"_resetY"!==o||s.contentReset.y||(i("onOverflowYNone")&&c.callbacks.onOverflowYNone.call(t[0]),s.contentReset.y=1),"_resetX"!==o||s.contentReset.x||(i("onOverflowXNone")&&c.callbacks.onOverflowXNone.call(t[0]),s.contentReset.x=1),"_resetY"!==o&&"_resetX"!==o){if(!s.contentReset.y&&t[0].mcs||!s.overflowed[0]||(i("onOverflowY")&&c.callbacks.onOverflowY.call(t[0]),s.contentReset.x=null),!s.contentReset.x&&t[0].mcs||!s.overflowed[1]||(i("onOverflowX")&&c.callbacks.onOverflowX.call(t[0]),s.contentReset.x=null),c.snapAmount){var v=c.snapAmount instanceof Array?"x"===n.dir?c.snapAmount[1]:c.snapAmount[0]:c.snapAmount;o=V(o,v,c.snapOffset)}switch(n.dir){case"x":var x=e("#mCSB_"+s.idx+"_dragger_horizontal"),_="left",w=h[0].offsetLeft,S=[f.width()-h.outerWidth(!1),x.parent().width()-x.width()],b=[o,0===o?0:o/s.scrollRatio.x],y=p[1],B=g[1],T=y>0?y/s.scrollRatio.x:0,k=B>0?B/s.scrollRatio.x:0;break;case"y":var x=e("#mCSB_"+s.idx+"_dragger_vertical"),_="top",w=h[0].offsetTop,S=[f.height()-h.outerHeight(!1),x.parent().height()-x.height()],b=[o,0===o?0:o/s.scrollRatio.y],y=p[0],B=g[0],T=y>0?y/s.scrollRatio.y:0,k=B>0?B/s.scrollRatio.y:0}b[1]<0||0===b[0]&&0===b[1]?b=[0,0]:b[1]>=S[1]?b=[S[0],S[1]]:b[0]=-b[0],t[0].mcs||(l(),i("onInit")&&c.callbacks.onInit.call(t[0])),clearTimeout(h[0].onCompleteTimeout),J(x[0],_,Math.round(b[1]),u[1],n.scrollEasing),!s.tweenRunning&&(0===w&&b[0]>=0||w===S[0]&&b[0]<=S[0])||J(h[0],_,Math.round(b[0]),u[0],n.scrollEasing,n.overwrite,{onStart:function(){n.callbacks&&n.onStart&&!s.tweenRunning&&(i("onScrollStart")&&(l(),c.callbacks.onScrollStart.call(t[0])),s.tweenRunning=!0,C(x),s.cbOffsets=r())},onUpdate:function(){n.callbacks&&n.onUpdate&&i("whileScrolling")&&(l(),c.callbacks.whileScrolling.call(t[0]))},onComplete:function(){if(n.callbacks&&n.onComplete){"yx"===c.axis&&clearTimeout(h[0].onCompleteTimeout);var e=h[0].idleTimer||0;h[0].onCompleteTimeout=setTimeout(function(){i("onScroll")&&(l(),c.callbacks.onScroll.call(t[0])),i("onTotalScroll")&&b[1]>=S[1]-T&&s.cbOffsets[0]&&(l(),c.callbacks.onTotalScroll.call(t[0])),i("onTotalScrollBack")&&b[1]<=k&&s.cbOffsets[1]&&(l(),c.callbacks.onTotalScrollBack.call(t[0])),s.tweenRunning=!1,h[0].idleTimer=0,C(x,"hide")},e)}}})}},J=function(e,t,o,a,n,i,r){function l(){S.stop||(x||m.call(),x=K()-v,s(),x>=S.time&&(S.time=x>S.time?x+f-(x-S.time):x+f-1,S.time<x+1&&(S.time=x+1)),S.time<a?S.id=h(l):g.call())}function s(){a>0?(S.currVal=u(S.time,_,b,a,n),w[t]=Math.round(S.currVal)+"px"):w[t]=o+"px",p.call()}function c(){f=1e3/60,S.time=x+f,h=window.requestAnimationFrame?window.requestAnimationFrame:function(e){return s(),setTimeout(e,.01)},S.id=h(l)}function d(){null!=S.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(S.id):clearTimeout(S.id),S.id=null)}function u(e,t,o,a,n){switch(n){case"linear":case"mcsLinear":return o*e/a+t;case"mcsLinearOut":return e/=a,e--,o*Math.sqrt(1-e*e)+t;case"easeInOutSmooth":return e/=a/2,1>e?o/2*e*e+t:(e--,-o/2*(e*(e-2)-1)+t);case"easeInOutStrong":return e/=a/2,1>e?o/2*Math.pow(2,10*(e-1))+t:(e--,o/2*(-Math.pow(2,-10*e)+2)+t);case"easeInOut":case"mcsEaseInOut":return e/=a/2,1>e?o/2*e*e*e+t:(e-=2,o/2*(e*e*e+2)+t);case"easeOutSmooth":return e/=a,e--,-o*(e*e*e*e-1)+t;case"easeOutStrong":return o*(-Math.pow(2,-10*e/a)+1)+t;case"easeOut":case"mcsEaseOut":default:var i=(e/=a)*e,r=i*e;return t+o*(.499999999999997*r*i+-2.5*i*i+5.5*r+-6.5*i+4*e)}}e._mTween||(e._mTween={top:{},left:{}});var f,h,r=r||{},m=r.onStart||function(){},p=r.onUpdate||function(){},g=r.onComplete||function(){},v=K(),x=0,_=e.offsetTop,w=e.style,S=e._mTween[t];"left"===t&&(_=e.offsetLeft);var b=o-_;S.stop=0,"none"!==i&&d(),c()},K=function(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},Z=function(){var e=this;e._mTween||(e._mTween={top:{},left:{}});for(var t=["top","left"],o=0;o<t.length;o++){var a=t[o];e._mTween[a].id&&(window.requestAnimationFrame?window.cancelAnimationFrame(e._mTween[a].id):clearTimeout(e._mTween[a].id),e._mTween[a].id=null,e._mTween[a].stop=1)}},$=function(e,t){try{delete e[t]}catch(o){e[t]=null}},ee=function(e){return!(e.which&&1!==e.which)},te=function(e){var t=e.originalEvent.pointerType;return!(t&&"touch"!==t&&2!==t)},oe=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},ae=function(e){var t=e.parents(".mCSB_container");return[e.offset().top-t.offset().top,e.offset().left-t.offset().left]},ne=function(){function e(){var e=["webkit","moz","ms","o"];if("hidden"in document)return"hidden";for(var t=0;t<e.length;t++)if(e[t]+"Hidden"in document)return e[t]+"Hidden";return null}var t=e();return t?document[t]:!1};e.fn[o]=function(t){return u[t]?u[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist"):u.init.apply(this,arguments)},e[o]=function(t){return u[t]?u[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist"):u.init.apply(this,arguments)},e[o].defaults=i,window[o]=!0,e(window).bind("load",function(){e(n)[o](),e.extend(e.expr[":"],{mcsInView:e.expr[":"].mcsInView||function(t){var o,a,n=e(t),i=n.parents(".mCSB_container");if(i.length)return o=i.parent(),a=[i[0].offsetTop,i[0].offsetLeft],a[0]+ae(n)[0]>=0&&a[0]+ae(n)[0]<o.height()-n.outerHeight(!1)&&a[1]+ae(n)[1]>=0&&a[1]+ae(n)[1]<o.width()-n.outerWidth(!1)},mcsInSight:e.expr[":"].mcsInSight||function(t,o,a){var n,i,r,l,s=e(t),c=s.parents(".mCSB_container"),d="exact"===a[3]?[[1,0],[1,0]]:[[.9,.1],[.6,.4]];if(c.length)return n=[s.outerHeight(!1),s.outerWidth(!1)],r=[c[0].offsetTop+ae(s)[0],c[0].offsetLeft+ae(s)[1]],i=[c.parent()[0].offsetHeight,c.parent()[0].offsetWidth],l=[n[0]<i[0]?d[0]:d[1],n[1]<i[1]?d[0]:d[1]],r[0]-i[0]*l[0][0]<0&&r[0]+n[0]-i[0]*l[0][1]>=0&&r[1]-i[1]*l[1][0]<0&&r[1]+n[1]-i[1]*l[1][1]>=0},mcsOverflow:e.expr[":"].mcsOverflow||function(t){var o=e(t).data(a);if(o)return o.overflowed[0]||o.overflowed[1]}})})})});
10116; 10117// Menu Toggler 10118$('#menu-toggle').click(function () { 10119 $(this).toggleClass('open'); 10120 $('.main-nav').toggleClass('open'); 10121 $('.header-bottom').toggleClass('open'); 10122 $('.overylay-zoom').toggleClass('show'); 10123 $('body').toggleClass('overflow-hidden'); 10124}); 10125// Search Toggler 10126$('.btn-search-toggler').click(function () { 10127 $('.search-wrapper').addClass('open'); 10128 setTimeout(function () { 10129 $('.search-field').focus(); 10130 }, 400); 10131}); 10132 10133$('.btn-txt-clear').click(function () { 10134 $('.search-wrapper').removeClass('open'); 10135 // clear search field on box close 10136 if ($('.search-field').val() != "") { 10137 $('.search-field').val(''); 10138 } 10139}); 10140// for the search 10141$(".search-mobile").click(function(){ 10142 $('.search').addClass('expand'); 10143 $('.close').addClass('expand'); 10144 }); 10145 10146 $(".close").click(function(){ 10147 $('.search').removeClass('expand'); 10148 $(this).removeClass('expand'); 10149 }); 10150 10151$(window).load(function () { 10152 // Active Hover transision move 10153 var activeMenu = $('.main-nav').find('li.active'), 10154 activeWidth = activeMenu.width(), 10155 activePos = activeMenu.position(); 10156 $('.active-hover').css({ 10157 width: activeWidth - 30, 10158 left: activePos.left + 15, 10159 display: 'block' 10160 }); 10161 $('.main-nav>li').mouseenter(function () { 10162 var newHoverPos = $(this).position(), 10163 newHoverWidth = $(this).width(); 10164 $('.active-hover').css({ 10165 width: newHoverWidth - 30, 10166 left: newHoverPos.left + 15 10167 }); 10168 }); 10169 $('.main-nav>li').mouseleave(function () { 10170 $('.active-hover').css({ 10171 width: activeWidth - 30, 10172 left: activePos.left + 15 10173 }); 10174 }); 10175 /*$('.main-nav li.has-child>a').attr('href','javascript:void(0)');*/ 10176 10177 // Default tab collapse 10178 $('.tab-default').tabCollapse(); 10179}); 10180 10181$(document).ready(function () { 10182 // add class if tab length is 1 10183 var noTabs = $('.tab-default'); 10184 $(noTabs).each(function (e, v) { 10185 if ($(v).children().length < 2) { 10186 $(this).addClass('single-tab'); 10187 } 10188 }); 10189}); 10190 10191// convert img url to svg if it has svg class 10192$(document).ready(function () { 10193 function svg() { 10194 /* 10195 * Replace all SVG images with inline SVG 10196 */ 10197 $('img.svg').each(function () { 10198 var $img = $(this); 10199 var imgID = $img.attr('id'); 10200 var imgClass = $img.attr('class'); 10201 var imgURL = $img.attr('src'); 10202 10203 $.get(imgURL, function (data) { 10204 // Get the SVG tag, ignore the rest 10205 var $svg = $(data).find('svg'); 10206 10207 // Add replaced image's ID to the new SVG 10208 if (typeof imgID !== 'undefined') { 10209 $svg = $svg.attr('id', imgID); 10210 } 10211 // Add replaced image's classes to the new SVG 10212 if (typeof imgClass !== 'undefined') { 10213 $svg = $svg.attr('class', imgClass + ' replaced-svg'); 10214 } 10215 10216 // Remove any invalid XML tags as per http://validator.w3.org 10217 $svg = $svg.removeAttr('xmlns:a'); 10218 10219 // Replace image with new SVG 10220 $img.replaceWith($svg); 10221 10222 }, 'xml'); 10223 10224 }); 10225 } 10226 svg(); 10227});; 10228var windowWidth = $(window).width(); 10229 10230// heroslider 10231$('.hero-slide').slick({ 10232 infinite: true, 10233 dots: true, 10234 arrows: true, 10235 fade: true, 10236 autoplay: true, 10237 autoplaySpeed: 8000, 10238 speed: 500, 10239 nextArrow: '<button class="slick-next slick-arrow" aria-label="Previous" type="button" style="display: block;"><i class="fas fa-angle-right"></i></button>', 10240 prevArrow: '<button class="slick-prev slick-arrow" aria-label="Previous" type="button" style="display: block;"><i class="fas fa-angle-left"></i></button>', 10241 slidesToShow: 1 10242}); 10243 10244$('.notice-sliders').slick({ 10245 speed: 10000, 10246 autoplay: true, 10247 autoplaySpeed:0, 10248 cssEase: 'linear', 10249 dots: false, 10250 slidesToShow: 1, 10251 infinite:true, 10252 pauseOnHover: true,
10253 arrows: false 10254 10255}); 10256 10257// Custom scroll 10258$(".list-events-minister").mCustomScrollbar({ 10259 theme: "dark", 10260 scrollbarPosition: 'inside' 10261}); 10262 10263// init custom scroll for tab layout if screen size is greater than 767 10264function tabScrollInit() { 10265 var windowWidth = $(window).width(); 10266 if (windowWidth > 767) { 10267 $(".section-event-list .tab-default-content .tab-pane").mCustomScrollbar({ 10268 theme: "dark", 10269 scrollbarPosition: 'outside' 10270 }); 10271 10272 // Social Downdloads scroll 10273 $(".social-downloads-tab-content .tab-pane").mCustomScrollbar({ 10274 theme: "dark", 10275 scrollbarPosition: 'outside' 10276 }); 10277 } 10278} 10279tabScrollInit(); 10280 10281// Events Thumb Slider 10282$('.thumb-slide').slick({ 10283 slidesToShow: 1, 10284 slidesToScroll: 1, 10285 arrows: false, 10286 asNavFor: '.thumbnails' 10287}); 10288 10289$('.thumbnails').slick({ 10290 slidesToShow: 4, 10291 slidesToScroll: 1, 10292 asNavFor: '.thumb-slide', 10293 dots: false, 10294 arrows: false, 10295 variableWidth: true, 10296 focusOnSelect: true 10297}); 10298 10299$(window).resize(function () { 10300 tabScrollInit(); 10301}); 10302$('.slide-gallery').slick({ 10303 infinite: true, 10304 dots: false, 10305 slidesToShow: 4, 10306 autoplay: true, 10307 autoplaySpeed: 5000, 10308 speed: 500, 10309 nextArrow: '<button class="slick-next slick-arrow" aria-label="Previous" type="button" style="display: block;"><i class="fas fa-angle-right"></i></button>', 10310 prevArrow: '<button class="slick-prev slick-arrow" aria-label="Previous" type="button" style="display: block;"><i class="fas fa-angle-left"></i></button>', 10311 arrows: true 10312});; 10313$('.gallery-post').lightGallery({ 10314 thumbnail:false, 10315 10316}); ; 10317/*! lightgallery - v1.6.5 - 2017-11-16 10318* http://sachinchoolur.github.io/lightGallery/ 10319* Copyright (c) 2017 Sachin N; Licensed GPLv3 */ 10320/*! lightgallery - v1.6.5 - 2017-11-16 10321* http://sachinchoolur.github.io/lightGallery/ 10322* Copyright (c) 2017 Sachin N; Licensed GPLv3 */ 10323(function (root, factory) { 10324 if (typeof define === 'function' && define.amd) { 10325 // AMD. Register as an anonymous module unless amdModuleId is set 10326 define(['jquery'], function (a0) { 10327 return (factory(a0)); 10328 }); 10329 } else if (typeof exports === 'object') { 10330 // Node. Does not work with strict CommonJS, but 10331 // only CommonJS-like environments that support module.exports, 10332 // like Node. 10333 module.exports = factory(require('jquery')); 10334 } else { 10335 factory(root["jQuery"]); 10336 } 10337}(this, function ($) { 10338 10339(function() { 10340 'use strict'; 10341 10342 var defaults = { 10343 10344 mode: 'lg-slide', 10345 10346 // Ex : 'ease' 10347 cssEasing: 'ease', 10348 10349 //'for jquery animation' 10350 easing: 'linear', 10351 speed: 600, 10352 height: '100%', 10353 width: '100%', 10354 addClass: '', 10355 startClass: 'lg-start-zoom', 10356 backdropDuration: 150, 10357 hideBarsDelay: 6000, 10358 10359 useLeft: false, 10360 10361 closable: true, 10362 loop: true, 10363 escKey: true, 10364 keyPress: true, 10365 controls: true, 10366 slideEndAnimatoin: true, 10367 hideControlOnEnd: false, 10368 mousewheel: true, 10369 10370 getCaptionFromTitleOrAlt: true, 10371 10372 // .lg-item || '.lg-sub-html' 10373 appendSubHtmlTo: '.lg-sub-html', 10374 10375 subHtmlSelectorRelative: false, 10376 10377 /** 10378 * @desc number of preload slides 10379 * will exicute only after the current slide is fully loaded. 10380 * 10381 * @ex you clicked on 4th image and if preload = 1 then 3rd slide and 5th 10382 * slide will be loaded in the background after the 4th slide is fully loaded.. 10383 * if preload is 2 then 2nd 3rd 5th 6th slides will be preloaded.. ... ... 10384 * 10385 */ 10386 preload: 1, 10387 showAfterLoad: true, 10388 selector: '', 10389 selectWithin: '', 10390 nextHtml: '', 10391 prevHtml: '', 10392 10393 // 0, 1 10394 index: false, 10395 10396 iframeMaxWidth: '100%', 10397 10398 download: true, 10399 counter: true, 10400 appendCounterTo: '.lg-toolbar', 10401 10402 swipeThreshold: 50, 10403 enableSwipe: true, 10404 enableDrag: true, 10405
10406 dynamic: false, 10407 dynamicEl: [], 10408 galleryId: 1 10409 }; 10410 10411 function Plugin(element, options) { 10412 10413 // Current lightGallery element 10414 this.el = element; 10415 10416 // Current jquery element 10417 this.$el = $(element); 10418 10419 // lightGallery settings 10420 this.s = $.extend({}, defaults, options); 10421 10422 // When using dynamic mode, ensure dynamicEl is an array 10423 if (this.s.dynamic && this.s.dynamicEl !== 'undefined' && this.s.dynamicEl.constructor === Array && !this.s.dynamicEl.length) { 10424 throw ('When using dynamic mode, you must also define dynamicEl as an Array.'); 10425 } 10426 10427 // lightGallery modules 10428 this.modules = {}; 10429 10430 // false when lightgallery complete first slide; 10431 this.lGalleryOn = false; 10432 10433 this.lgBusy = false; 10434 10435 // Timeout function for hiding controls; 10436 this.hideBartimeout = false; 10437 10438 // To determine browser supports for touch events; 10439 this.isTouch = ('ontouchstart' in document.documentElement); 10440 10441 // Disable hideControlOnEnd if sildeEndAnimation is true 10442 if (this.s.slideEndAnimatoin) { 10443 this.s.hideControlOnEnd = false; 10444 } 10445 10446 // Gallery items 10447 if (this.s.dynamic) { 10448 this.$items = this.s.dynamicEl; 10449 } else { 10450 if (this.s.selector === 'this') { 10451 this.$items = this.$el; 10452 } else if (this.s.selector !== '') { 10453 if (this.s.selectWithin) { 10454 this.$items = $(this.s.selectWithin).find(this.s.selector); 10455 } else { 10456 this.$items = this.$el.find($(this.s.selector)); 10457 } 10458 } else { 10459 this.$items = this.$el.children(); 10460 } 10461 } 10462 10463 // .lg-item 10464 this.$slide = ''; 10465 10466 // .lg-outer 10467 this.$outer = ''; 10468 10469 this.init(); 10470 10471 return this; 10472 } 10473 10474 Plugin.prototype.init = function() { 10475 10476 var _this = this; 10477 10478 // s.preload should not be more than $item.length 10479 if (_this.s.preload > _this.$items.length) { 10480 _this.s.preload = _this.$items.length; 10481 } 10482 10483 // if dynamic option is enabled execute immediately 10484 var _hash = window.location.hash; 10485 if (_hash.indexOf('lg=' + this.s.galleryId) > 0) { 10486 10487 _this.index = parseInt(_hash.split('&slide=')[1], 10); 10488 10489 $('body').addClass('lg-from-hash'); 10490 if (!$('body').hasClass('lg-on')) { 10491 setTimeout(function() { 10492 _this.build(_this.index); 10493 }); 10494 10495 $('body').addClass('lg-on'); 10496 } 10497 } 10498 10499 if (_this.s.dynamic) { 10500 10501 _this.$el.trigger('onBeforeOpen.lg'); 10502 10503 _this.index = _this.s.index || 0; 10504 10505 // prevent accidental double execution 10506 if (!$('body').hasClass('lg-on')) { 10507 setTimeout(function() { 10508 _this.build(_this.index); 10509 $('body').addClass('lg-on'); 10510 }); 10511 } 10512 } else { 10513 10514 // Using different namespace for click because click event should not unbind if selector is same object('this') 10515 _this.$items.on('click.lgcustom', function(event) { 10516 10517 // For IE8 10518 try { 10519 event.preventDefault(); 10520 event.preventDefault(); 10521 } catch (er) { 10522 event.returnValue = false; 10523 } 10524 10525 _this.$el.trigger('onBeforeOpen.lg'); 10526 10527 _this.index = _this.s.index || _this.$items.index(this); 10528 10529 // prevent accidental double execution 10530 if (!$('body').hasClass('lg-on')) { 10531 _this.build(_this.index); 10532 $('body').addClass('lg-on'); 10533 } 10534 }); 10535 } 10536 10537 }; 10538 10539 Plugin.prototype.build = function(index) { 10540 10541 var _this = this; 10542 10543 _this.structure(); 10544 10545 // module constructor 10546 $.each($.fn.lightGallery.modules, function(key) { 10547 _this.modules[key] = new $.fn.lightGallery.modules[key](_this.el); 10548 }); 10549 10550 // initiate slide function 10551 _this.slide(index, false, false, false); 10552 10553 if (_this.s.keyPress) { 10554 _this.keyPress(); 10555 } 10556 10557 if (_this.$items.length > 1) { 10558 10559 _this.arrow(); 10560 10561 setTimeout(function() { 10562 _this.enableDrag(); 10563 _this.enableSwipe(); 10564 }, 50); 10565 10566 if (_this.s.mousewheel) { 10567 _this.mousewheel(); 10568 } 10569 } else { 10570 _this.$slide.on('click.lg', function() { 10571 _this.$el.trigger('onSlideClick.lg'); 10572 }); 10573 } 10574 10575 _this.counter(); 10576 10577 _this.closeGallery(); 10578 10579 _this.$el.trigger('onAfterOpen.lg'); 10580 10581 // Hide controllers if mouse doesn't move for some period
10582 _this.$outer.on('mousemove.lg click.lg touchstart.lg', function() { 10583 10584 _this.$outer.removeClass('lg-hide-items'); 10585 10586 clearTimeout(_this.hideBartimeout); 10587 10588 // Timeout will be cleared on each slide movement also 10589 _this.hideBartimeout = setTimeout(function() { 10590 _this.$outer.addClass('lg-hide-items'); 10591 }, _this.s.hideBarsDelay); 10592 10593 }); 10594 10595 _this.$outer.trigger('mousemove.lg'); 10596 10597 }; 10598 10599 Plugin.prototype.structure = function() { 10600 var list = ''; 10601 var controls = ''; 10602 var i = 0; 10603 var subHtmlCont = ''; 10604 var template; 10605 var _this = this; 10606 10607 $('body').append('<div class="lg-backdrop"></div>'); 10608 $('.lg-backdrop').css('transition-duration', this.s.backdropDuration + 'ms'); 10609 10610 // Create gallery items 10611 for (i = 0; i < this.$items.length; i++) { 10612 list += '<div class="lg-item"></div>'; 10613 } 10614 10615 // Create controlls 10616 if (this.s.controls && this.$items.length > 1) { 10617 controls = '<div class="lg-actions">' + 10618 '<button class="lg-prev lg-icon">' + this.s.prevHtml + '</button>' + 10619 '<button class="lg-next lg-icon">' + this.s.nextHtml + '</button>' + 10620 '</div>'; 10621 } 10622 10623 if (this.s.appendSubHtmlTo === '.lg-sub-html') { 10624 subHtmlCont = '<div class="lg-sub-html"></div>'; 10625 } 10626 10627 template = '<div class="lg-outer ' + this.s.addClass + ' ' + this.s.startClass + '">' + 10628 '<div class="lg" style="width:' + this.s.width + '; height:' + this.s.height + '">' + 10629 '<div class="lg-inner">' + list + '</div>' + 10630 '<div class="lg-toolbar lg-group">' + 10631 '<span class="lg-close lg-icon"></span>' + 10632 '</div>' + 10633 controls + 10634 subHtmlCont + 10635 '</div>' + 10636 '</div>'; 10637 10638 $('body').append(template); 10639 this.$outer = $('.lg-outer'); 10640 this.$slide = this.$outer.find('.lg-item'); 10641 10642 if (this.s.useLeft) { 10643 this.$outer.addClass('lg-use-left'); 10644 10645 // Set mode lg-slide if use left is true; 10646 this.s.mode = 'lg-slide'; 10647 } else { 10648 this.$outer.addClass('lg-use-css3'); 10649 } 10650 10651 // For fixed height gallery 10652 _this.setTop(); 10653 $(window).on('resize.lg orientationchange.lg', function() { 10654 setTimeout(function() { 10655 _this.setTop(); 10656 }, 100); 10657 }); 10658 10659 // add class lg-current to remove initial transition 10660 this.$slide.eq(this.index).addClass('lg-current'); 10661 10662 // add Class for css support and transition mode 10663 if (this.doCss()) { 10664 this.$outer.addClass('lg-css3'); 10665 } else { 10666 this.$outer.addClass('lg-css'); 10667 10668 // Set speed 0 because no animation will happen if browser doesn't support css3 10669 this.s.speed = 0; 10670 } 10671 10672 this.$outer.addClass(this.s.mode); 10673 10674 if (this.s.enableDrag && this.$items.length > 1) { 10675 this.$outer.addClass('lg-grab'); 10676 } 10677 10678 if (this.s.showAfterLoad) { 10679 this.$outer.addClass('lg-show-after-load'); 10680 } 10681 10682 if (this.doCss()) { 10683 var $inner = this.$outer.find('.lg-inner'); 10684 $inner.css('transition-timing-function', this.s.cssEasing); 10685 $inner.css('transition-duration', this.s.speed + 'ms'); 10686 } 10687 10688 setTimeout(function() { 10689 $('.lg-backdrop').addClass('in'); 10690 }); 10691 10692 setTimeout(function() { 10693 _this.$outer.addClass('lg-visible'); 10694 }, this.s.backdropDuration); 10695 10696 if (this.s.download) { 10697 this.$outer.find('.lg-toolbar').append('<a id="lg-download" target="_blank" download class="lg-download lg-icon"></a>'); 10698 } 10699 10700 // Store the current scroll top value to scroll back after closing the gallery.. 10701 this.prevScrollTop = $(window).scrollTop(); 10702 10703 }; 10704 10705 // For fixed height gallery 10706 Plugin.prototype.setTop = function() { 10707 if (this.s.height !== '100%') { 10708 var wH = $(window).height(); 10709 var top = (wH - parseInt(this.s.height, 10)) / 2; 10710 var $lGallery = this.$outer.find('.lg'); 10711 if (wH >= parseInt(this.s.height, 10)) { 10712 $lGallery.css('top', top + 'px'); 10713 } else { 10714 $lGallery.css('top', '0px'); 10715 } 10716 } 10717 }; 10718 10719 // Find css3 support 10720 Plugin.prototype.doCss = function() { 10721 // check for css animation support 10722 var support = function() { 10723 var transition = ['transition', 'MozTransition', 'WebkitTransition', 'OTransition', 'msTransition', 'KhtmlTransition']; 10724 var root = document.documentElement; 10725 var i = 0; 10726 for (i = 0; i < transition.length; i++) { 10727 if (transition[i] in root.style) { 10728 return true; 10729 } 10730 } 10731 }; 10732 10733 if (support()) { 10734 return true; 10735 } 10736 10737 return false; 10738 }; 10739 10740 /** 10741 * @desc Check the given src is video 10742 * @param {String} src 10743 * @return {Object} video type 10744 * Ex:{ youtube : ["//www.youtube.com/watch?v=c0asJgSyxcY", "c0asJgSyxcY"] } 10745 */ 10746 Plugin.prototype.isVideo = function(src, index) { 10747 10748 var html; 10749 if (this.s.dynamic) { 10750 html = this.s.dynamicEl[index].html; 10751 } else { 10752 html = this.$items.eq(index).attr('data-html'); 10753 } 10754 10755 if (!src) { 10756 if(html) { 10757 return { 10758 html5: true 10759 }; 10760 } else { 10761 console.error('lightGallery :- data-src is not pvovided on slide item ' + (index + 1) + '. Please make sure the selector property is properly configured. More info - http://sachinchoolur.github.io/lightGallery/demos/html-markup.html'); 10762 return false; 10763 } 10764 } 10765 10766 var youtube = src.match(/\/\/(?:www\.)?youtu(?:\.be|be\.com)\/(?:watch\?v=|embed\/)?([a-z0-9\-\_\%]+)/i); 10767 var vimeo = src.match(/\/\/(?:www\.)?vimeo.com\/([0-9a-z\-_]+)/i); 10768 var dailymotion = src.match(/\/\/(?:www\.)?dai.ly\/([0-9a-z\-_]+)/i); 10769 var vk = src.match(/\/\/(?:www\.)?(?:vk\.com|vkontakte\.ru)\/(?:video_ext\.php\?)(.*)/i); 10770 10771 if (youtube) { 10772 return { 10773 youtube: youtube 10774 }; 10775 } else if (vimeo) { 10776 return { 10777 vimeo: vimeo 10778 }; 10779 } else if (dailymotion) { 10780 return { 10781 dailymotion: dailymotion 10782 }; 10783 } else if (vk) { 10784 return { 10785 vk: vk 10786 }; 10787 } 10788 }; 10789 10790 /** 10791 * @desc Create image counter 10792 * Ex: 1/10 10793 */ 10794 Plugin.prototype.counter = function() { 10795 if (this.s.counter) { 10796 $(this.s.appendCounterTo).append('<div id="lg-counter"><span id="lg-counter-current">' + (parseInt(this.index, 10) + 1) + '</span> / <span id="lg-counter-all">' + this.$items.length + '</span></div>'); 10797 } 10798 }; 10799 10800 /** 10801 * @desc add sub-html into the slide 10802 * @param {Number} index - index of the slide 10803 */ 10804 Plugin.prototype.addHtml = function(index) { 10805 var subHtml = null; 10806 var subHtmlUrl; 10807 var $currentEle; 10808 if (this.s.dynamic) { 10809 if (this.s.dynamicEl[index].subHtmlUrl) { 10810 subHtmlUrl = this.s.dynamicEl[index].subHtmlUrl; 10811 } else { 10812 subHtml = this.s.dynamicEl[index].subHtml; 10813 } 10814 } else { 10815 $currentEle = this.$items.eq(index); 10816 if ($currentEle.attr('data-sub-html-url')) { 10817 subHtmlUrl = $currentEle.attr('data-sub-html-url'); 10818 } else { 10819 subHtml = $currentEle.attr('data-sub-html'); 10820 if (this.s.getCaptionFromTitleOrAlt && !subHtml) { 10821 subHtml = $currentEle.attr('title') || $currentEle.find('img').first().attr('alt'); 10822 } 10823 } 10824 } 10825 10826 if (!subHtmlUrl) { 10827 if (typeof subHtml !== 'undefined' && subHtml !== null) { 10828 10829 // get first letter of subhtml 10830 // if first letter starts with . or # get the html form the jQuery object 10831 var fL = subHtml.substring(0, 1); 10832 if (fL === '.' || fL === '#') { 10833 if (this.s.subHtmlSelectorRelative && !this.s.dynamic) { 10834 subHtml = $currentEle.find(subHtml).html(); 10835 } else { 10836 subHtml = $(subHtml).html(); 10837 } 10838 } 10839 } else { 10840 subHtml = ''; 10841 } 10842 } 10843 10844 if (this.s.appendSubHtmlTo === '.lg-sub-html') { 10845 10846 if (subHtmlUrl) { 10847 this.$outer.find(this.s.appendSubHtmlTo).load(subHtmlUrl); 10848 } else { 10849 this.$outer.find(this.s.appendSubHtmlTo).html(subHtml); 10850 } 10851 10852 } else { 10853 10854 if (subHtmlUrl) { 10855 this.$slide.eq(index).load(subHtmlUrl); 10856 } else { 10857 this.$slide.eq(index).append(subHtml); 10858 } 10859 } 10860 10861 // Add lg-empty-html class if title doesn't exist 10862 if (typeof subHtml !== 'undefined' && subHtml !== null) { 10863 if (subHtml === '') { 10864 this.$outer.find(this.s.appendSubHtmlTo).addClass('lg-empty-html'); 10865 } else { 10866 this.$outer.find(this.s.appendSubHtmlTo).removeClass('lg-empty-html'); 10867 } 10868 } 10869 10870 this.$el.trigger('onAfterAppendSubHtml.lg', [index]); 10871 }; 10872 10873 /** 10874 * @desc Preload slides 10875 * @param {Number} index - index of the slide 10876 */ 10877 Plugin.prototype.preload = function(index) { 10878 var i = 1; 10879 var j = 1; 10880 for (i = 1; i <= this.s.preload; i++) { 10881 if (i >= this.$items.length - index) { 10882 break; 10883 } 10884 10885 this.loadContent(index + i, false, 0); 10886 } 10887 10888 for (j = 1; j <= this.s.preload; j++) { 10889 if (index - j < 0) { 10890 break; 10891 } 10892 10893 this.loadContent(index - j, false, 0); 10894 } 10895 }; 10896 10897 /**
10898 * @desc Load slide content into slide. 10899 * @param {Number} index - index of the slide. 10900 * @param {Boolean} rec - if true call loadcontent() function again. 10901 * @param {Boolean} delay - delay for adding complete class. it is 0 except first time. 10902 */ 10903 Plugin.prototype.loadContent = function(index, rec, delay) { 10904 10905 var _this = this; 10906 var _hasPoster = false; 10907 var _$img; 10908 var _src; 10909 var _poster; 10910 var _srcset; 10911 var _sizes; 10912 var _html; 10913 var getResponsiveSrc = function(srcItms) { 10914 var rsWidth = []; 10915 var rsSrc = []; 10916 for (var i = 0; i < srcItms.length; i++) { 10917 var __src = srcItms[i].split(' '); 10918 10919 // Manage empty space 10920 if (__src[0] === '') { 10921 __src.splice(0, 1); 10922 } 10923 10924 rsSrc.push(__src[0]); 10925 rsWidth.push(__src[1]); 10926 } 10927 10928 var wWidth = $(window).width(); 10929 for (var j = 0; j < rsWidth.length; j++) { 10930 if (parseInt(rsWidth[j], 10) > wWidth) { 10931 _src = rsSrc[j]; 10932 break; 10933 } 10934 } 10935 }; 10936 10937 if (_this.s.dynamic) { 10938 10939 if (_this.s.dynamicEl[index].poster) { 10940 _hasPoster = true; 10941 _poster = _this.s.dynamicEl[index].poster; 10942 } 10943 10944 _html = _this.s.dynamicEl[index].html; 10945 _src = _this.s.dynamicEl[index].src; 10946 10947 if (_this.s.dynamicEl[index].responsive) { 10948 var srcDyItms = _this.s.dynamicEl[index].responsive.split(','); 10949 getResponsiveSrc(srcDyItms); 10950 } 10951 10952 _srcset = _this.s.dynamicEl[index].srcset; 10953 _sizes = _this.s.dynamicEl[index].sizes; 10954 10955 } else { 10956 10957 if (_this.$items.eq(index).attr('data-poster')) { 10958 _hasPoster = true; 10959 _poster = _this.$items.eq(index).attr('data-poster'); 10960 } 10961 10962 _html = _this.$items.eq(index).attr('data-html'); 10963 _src = _this.$items.eq(index).attr('href') || _this.$items.eq(index).attr('data-src'); 10964 10965 if (_this.$items.eq(index).attr('data-responsive')) { 10966 var srcItms = _this.$items.eq(index).attr('data-responsive').split(','); 10967 getResponsiveSrc(srcItms); 10968 } 10969 10970 _srcset = _this.$items.eq(index).attr('data-srcset'); 10971 _sizes = _this.$items.eq(index).attr('data-sizes'); 10972 10973 } 10974 10975 //if (_src || _srcset || _sizes || _poster) { 10976 10977 var iframe = false; 10978 if (_this.s.dynamic) { 10979 if (_this.s.dynamicEl[index].iframe) { 10980 iframe = true; 10981 } 10982 } else { 10983 if (_this.$items.eq(index).attr('data-iframe') === 'true') { 10984 iframe = true; 10985 } 10986 } 10987 10988 var _isVideo = _this.isVideo(_src, index); 10989 if (!_this.$slide.eq(index).hasClass('lg-loaded')) { 10990 if (iframe) { 10991 _this.$slide.eq(index).prepend('<div class="lg-video-cont lg-has-iframe" style="max-width:' + _this.s.iframeMaxWidth + '"><div class="lg-video"><iframe class="lg-object" frameborder="0" src="' + _src + '" allowfullscreen="true"></iframe></div></div>'); 10992 } else if (_hasPoster) { 10993 var videoClass = ''; 10994 if (_isVideo && _isVideo.youtube) { 10995 videoClass = 'lg-has-youtube'; 10996 } else if (_isVideo && _isVideo.vimeo) { 10997 videoClass = 'lg-has-vimeo'; 10998 } else { 10999 videoClass = 'lg-has-html5'; 11000 } 11001 11002 _this.$slide.eq(index).prepend('<div class="lg-video-cont ' + videoClass + ' "><div class="lg-video"><span class="lg-video-play"></span><img class="lg-object lg-has-poster" src="' + _poster + '" /></div></div>'); 11003 11004 } else if (_isVideo) { 11005 _this.$slide.eq(index).prepend('<div class="lg-video-cont "><div class="lg-video"></div></div>'); 11006 _this.$el.trigger('hasVideo.lg', [index, _src, _html]); 11007 } else { 11008 _this.$slide.eq(index).prepend('<div class="lg-img-wrap"><img class="lg-object lg-image" src="' + _src + '" /></div>'); 11009 } 11010 11011 _this.$el.trigger('onAferAppendSlide.lg', [index]); 11012 11013 _$img = _this.$slide.eq(index).find('.lg-object'); 11014 if (_sizes) { 11015 _$img.attr('sizes', _sizes); 11016 } 11017 11018 if (_srcset) { 11019 _$img.attr('srcset', _srcset); 11020 try { 11021 picturefill({ 11022 elements: [_$img[0]] 11023 }); 11024 } catch (e) { 11025 console.warn('lightGallery :- If you want srcset to be supported for older browser please include picturefil version 2 javascript library in your document.'); 11026 } 11027 } 11028 11029 if (this.s.appendSubHtmlTo !== '.lg-sub-html') { 11030 _this.addHtml(index); 11031 } 11032 11033 _this.$slide.eq(index).addClass('lg-loaded'); 11034 } 11035 11036 _this.$slide.eq(index).find('.lg-object').on('load.lg error.lg', function() { 11037 11038 // For first time add some delay for displaying the start animation. 11039 var _speed = 0; 11040
11041 // Do not change the delay value because it is required for zoom plugin. 11042 // If gallery opened from direct url (hash) speed value should be 0 11043 if (delay && !$('body').hasClass('lg-from-hash')) { 11044 _speed = delay; 11045 } 11046 11047 setTimeout(function() { 11048 _this.$slide.eq(index).addClass('lg-complete'); 11049 _this.$el.trigger('onSlideItemLoad.lg', [index, delay || 0]); 11050 }, _speed); 11051 11052 }); 11053 11054 // @todo check load state for html5 videos 11055 if (_isVideo && _isVideo.html5 && !_hasPoster) { 11056 _this.$slide.eq(index).addClass('lg-complete'); 11057 } 11058 11059 if (rec === true) { 11060 if (!_this.$slide.eq(index).hasClass('lg-complete')) { 11061 _this.$slide.eq(index).find('.lg-object').on('load.lg error.lg', function() { 11062 _this.preload(index); 11063 }); 11064 } else { 11065 _this.preload(index); 11066 } 11067 } 11068 11069 //} 11070 }; 11071 11072 /** 11073 * @desc slide function for lightgallery 11074 ** Slide() gets call on start 11075 ** ** Set lg.on true once slide() function gets called. 11076 ** Call loadContent() on slide() function inside setTimeout 11077 ** ** On first slide we do not want any animation like slide of fade 11078 ** ** So on first slide( if lg.on if false that is first slide) loadContent() should start loading immediately 11079 ** ** Else loadContent() should wait for the transition to complete. 11080 ** ** So set timeout s.speed + 50 11081 <=> ** loadContent() will load slide content in to the particular slide 11082 ** ** It has recursion (rec) parameter. if rec === true loadContent() will call preload() function. 11083 ** ** preload will execute only when the previous slide is fully loaded (images iframe) 11084 ** ** avoid simultaneous image load 11085 <=> ** Preload() will check for s.preload value and call loadContent() again accoring to preload value 11086 ** loadContent() <====> Preload(); 11087 11088 * @param {Number} index - index of the slide 11089 * @param {Boolean} fromTouch - true if slide function called via touch event or mouse drag 11090 * @param {Boolean} fromThumb - true if slide function called via thumbnail click 11091 * @param {String} direction - Direction of the slide(next/prev) 11092 */ 11093 Plugin.prototype.slide = function(index, fromTouch, fromThumb, direction) { 11094 11095 var _prevIndex = this.$outer.find('.lg-current').index(); 11096 var _this = this; 11097 11098 // Prevent if multiple call 11099 // Required for hsh plugin 11100 if (_this.lGalleryOn && (_prevIndex === index)) { 11101 return; 11102 } 11103 11104 var _length = this.$slide.length; 11105 var _time = _this.lGalleryOn ? this.s.speed : 0; 11106 11107 if (!_this.lgBusy) { 11108 11109 if (this.s.download) { 11110 var _src; 11111 if (_this.s.dynamic) { 11112 _src = _this.s.dynamicEl[index].downloadUrl !== false && (_this.s.dynamicEl[index].downloadUrl || _this.s.dynamicEl[index].src); 11113 } else { 11114 _src = _this.$items.eq(index).attr('data-download-url') !== 'false' && (_this.$items.eq(index).attr('data-download-url') || _this.$items.eq(index).attr('href') || _this.$items.eq(index).attr('data-src')); 11115 11116 } 11117 11118 if (_src) { 11119 $('#lg-download').attr('href', _src); 11120 _this.$outer.removeClass('lg-hide-download'); 11121 } else { 11122 _this.$outer.addClass('lg-hide-download'); 11123 } 11124 } 11125 11126 this.$el.trigger('onBeforeSlide.lg', [_prevIndex, index, fromTouch, fromThumb]); 11127 11128 _this.lgBusy = true; 11129 11130 clearTimeout(_this.hideBartimeout); 11131 11132 // Add title if this.s.appendSubHtmlTo === lg-sub-html 11133 if (this.s.appendSubHtmlTo === '.lg-sub-html') { 11134 11135 // wait for slide animation to complete 11136 setTimeout(function() { 11137 _this.addHtml(index); 11138 }, _time); 11139 } 11140 11141 this.arrowDisable(index); 11142 11143 if (!direction) { 11144 if (index < _prevIndex) { 11145 direction = 'prev'; 11146 } else if (index > _prevIndex) {
11147 direction = 'next'; 11148 } 11149 } 11150 11151 if (!fromTouch) { 11152 11153 // remove all transitions 11154 _this.$outer.addClass('lg-no-trans'); 11155 11156 this.$slide.removeClass('lg-prev-slide lg-next-slide'); 11157 11158 if (direction === 'prev') { 11159 11160 //prevslide 11161 this.$slide.eq(index).addClass('lg-prev-slide'); 11162 this.$slide.eq(_prevIndex).addClass('lg-next-slide'); 11163 } else { 11164 11165 // next slide 11166 this.$slide.eq(index).addClass('lg-next-slide'); 11167 this.$slide.eq(_prevIndex).addClass('lg-prev-slide'); 11168 } 11169 11170 // give 50 ms for browser to add/remove class 11171 setTimeout(function() { 11172 _this.$slide.removeClass('lg-current'); 11173 11174 //_this.$slide.eq(_prevIndex).removeClass('lg-current'); 11175 _this.$slide.eq(index).addClass('lg-current'); 11176 11177 // reset all transitions 11178 _this.$outer.removeClass('lg-no-trans'); 11179 }, 50); 11180 } else { 11181 11182 this.$slide.removeClass('lg-prev-slide lg-current lg-next-slide'); 11183 var touchPrev; 11184 var touchNext; 11185 if (_length > 2) { 11186 touchPrev = index - 1; 11187 touchNext = index + 1; 11188 11189 if ((index === 0) && (_prevIndex === _length - 1)) { 11190 11191 // next slide 11192 touchNext = 0; 11193 touchPrev = _length - 1; 11194 } else if ((index === _length - 1) && (_prevIndex === 0)) { 11195 11196 // prev slide 11197 touchNext = 0; 11198 touchPrev = _length - 1; 11199 } 11200 11201 } else { 11202 touchPrev = 0; 11203 touchNext = 1; 11204 } 11205 11206 if (direction === 'prev') { 11207 _this.$slide.eq(touchNext).addClass('lg-next-slide'); 11208 } else { 11209 _this.$slide.eq(touchPrev).addClass('lg-prev-slide'); 11210 } 11211 11212 _this.$slide.eq(index).addClass('lg-current'); 11213 } 11214 11215 if (_this.lGalleryOn) { 11216 setTimeout(function() { 11217 _this.loadContent(index, true, 0); 11218 }, this.s.speed + 50); 11219 11220 setTimeout(function() { 11221 _this.lgBusy = false; 11222 _this.$el.trigger('onAfterSlide.lg', [_prevIndex, index, fromTouch, fromThumb]); 11223 }, this.s.speed); 11224 11225 } else { 11226 _this.loadContent(index, true, _this.s.backdropDuration); 11227 11228 _this.lgBusy = false; 11229 _this.$el.trigger('onAfterSlide.lg', [_prevIndex, index, fromTouch, fromThumb]); 11230 } 11231 11232 _this.lGalleryOn = true; 11233 11234 if (this.s.counter) { 11235 $('#lg-counter-current').text(index + 1); 11236 } 11237 11238 } 11239 _this.index = index; 11240 11241 }; 11242 11243 /** 11244 * @desc Go to next slide 11245 * @param {Boolean} fromTouch - true if slide function called via touch event 11246 */ 11247 Plugin.prototype.goToNextSlide = function(fromTouch) { 11248 var _this = this; 11249 var _loop = _this.s.loop; 11250 if (fromTouch && _this.$slide.length < 3) { 11251 _loop = false; 11252 } 11253 11254 if (!_this.lgBusy) { 11255 if ((_this.index + 1) < _this.$slide.length) { 11256 _this.index++; 11257 _this.$el.trigger('onBeforeNextSlide.lg', [_this.index]); 11258 _this.slide(_this.index, fromTouch, false, 'next'); 11259 } else { 11260 if (_loop) { 11261 _this.index = 0; 11262 _this.$el.trigger('onBeforeNextSlide.lg', [_this.index]); 11263 _this.slide(_this.index, fromTouch, false, 'next'); 11264 } else if (_this.s.slideEndAnimatoin && !fromTouch) { 11265 _this.$outer.addClass('lg-right-end'); 11266 setTimeout(function() { 11267 _this.$outer.removeClass('lg-right-end'); 11268 }, 400); 11269 } 11270 } 11271 } 11272 }; 11273 11274 /** 11275 * @desc Go to previous slide 11276 * @param {Boolean} fromTouch - true if slide function called via touch event 11277 */ 11278 Plugin.prototype.goToPrevSlide = function(fromTouch) { 11279 var _this = this; 11280 var _loop = _this.s.loop; 11281 if (fromTouch && _this.$slide.length < 3) { 11282 _loop = false; 11283 } 11284 11285 if (!_this.lgBusy) { 11286 if (_this.index > 0) { 11287 _this.index--; 11288 _this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]); 11289 _this.slide(_this.index, fromTouch, false, 'prev'); 11290 } else { 11291 if (_loop) { 11292 _this.index = _this.$items.length - 1; 11293 _this.$el.trigger('onBeforePrevSlide.lg', [_this.index, fromTouch]); 11294 _this.slide(_this.index, fromTouch, false, 'prev'); 11295 } else if (_this.s.slideEndAnimatoin && !fromTouch) { 11296 _this.$outer.addClass('lg-left-end'); 11297 setTimeout(function() { 11298 _this.$outer.removeClass('lg-left-end'); 11299 }, 400); 11300 } 11301 } 11302 } 11303 }; 11304 11305 Plugin.prototype.keyPress = function() { 11306 var _this = this; 11307 if (this.$items.length > 1) { 11308 $(window).on('keyup.lg', function(e) { 11309 if (_this.$items.length > 1) { 11310 if (e.keyCode === 37) { 11311 e.preventDefault(); 11312 _this.goToPrevSlide(); 11313 } 11314 11315 if (e.keyCode === 39) { 11316 e.preventDefault(); 11317 _this.goToNextSlide(); 11318 } 11319 } 11320 }); 11321 } 11322 11323 $(window).on('keydown.lg', function(e) { 11324 if (_this.s.escKey === true && e.keyCode === 27) { 11325 e.preventDefault(); 11326 if (!_this.$outer.hasClass('lg-thumb-open')) { 11327 _this.destroy(); 11328 } else { 11329 _this.$outer.removeClass('lg-thumb-open'); 11330 } 11331 } 11332 }); 11333 }; 11334 11335 Plugin.prototype.arrow = function() { 11336 var _this = this; 11337 this.$outer.find('.lg-prev').on('click.lg', function() { 11338 _this.goToPrevSlide(); 11339 }); 11340 11341 this.$outer.find('.lg-next').on('click.lg', function() { 11342 _this.goToNextSlide(); 11343 }); 11344 }; 11345 11346 Plugin.prototype.arrowDisable = function(index) { 11347 11348 // Disable arrows if s.hideControlOnEnd is true 11349 if (!this.s.loop && this.s.hideControlOnEnd) { 11350 if ((index + 1) < this.$slide.length) { 11351 this.$outer.find('.lg-next').removeAttr('disabled').removeClass('disabled'); 11352 } else { 11353 this.$outer.find('.lg-next').attr('disabled', 'disabled').addClass('disabled'); 11354 } 11355 11356 if (index > 0) { 11357 this.$outer.find('.lg-prev').removeAttr('disabled').removeClass('disabled'); 11358 } else { 11359 this.$outer.find('.lg-prev').attr('disabled', 'disabled').addClass('disabled'); 11360 } 11361 } 11362 }; 11363 11364 Plugin.prototype.setTranslate = function($el, xValue, yValue) { 11365 // jQuery supports Automatic CSS prefixing since jQuery 1.8.0 11366 if (this.s.useLeft) { 11367 $el.css('left', xValue); 11368 } else { 11369 $el.css({ 11370 transform: 'translate3d(' + (xValue) + 'px, ' + yValue + 'px, 0px)' 11371 }); 11372 } 11373 }; 11374 11375 Plugin.prototype.touchMove = function(startCoords, endCoords) { 11376 11377 var distance = endCoords - startCoords; 11378 11379 if (Math.abs(distance) > 15) { 11380 // reset opacity and transition duration 11381 this.$outer.addClass('lg-dragging'); 11382 11383 // move current slide 11384 this.setTranslate(this.$slide.eq(this.index), distance, 0); 11385 11386 // move next and prev slide with current slide 11387 this.setTranslate($('.lg-prev-slide'), -this.$slide.eq(this.index).width() + distance, 0); 11388 this.setTranslate($('.lg-next-slide'), this.$slide.eq(this.index).width() + distance, 0); 11389 } 11390 }; 11391 11392 Plugin.prototype.touchEnd = function(distance) { 11393 var _this = this; 11394 11395 // keep slide animation for any mode while dragg/swipe 11396 if (_this.s.mode !== 'lg-slide') { 11397 _this.$outer.addClass('lg-slide'); 11398 } 11399 11400 this.$slide.not('.lg-current, .lg-prev-slide, .lg-next-slide').css('opacity', '0'); 11401 11402 // set transition duration 11403 setTimeout(function() { 11404 _this.$outer.removeClass('lg-dragging'); 11405 if ((distance < 0) && (Math.abs(distance) > _this.s.swipeThreshold)) { 11406 _this.goToNextSlide(true); 11407 } else if ((distance > 0) && (Math.abs(distance) > _this.s.swipeThreshold)) { 11408 _this.goToPrevSlide(true); 11409 } else if (Math.abs(distance) < 5) { 11410 11411 // Trigger click if distance is less than 5 pix 11412 _this.$el.trigger('onSlideClick.lg'); 11413 } 11414 11415 _this.$slide.removeAttr('style'); 11416 }); 11417 11418 // remove slide class once drag/swipe is completed if mode is not slide 11419 setTimeout(function() { 11420 if (!_this.$outer.hasClass('lg-dragging') && _this.s.mode !== 'lg-slide') { 11421 _this.$outer.removeClass('lg-slide'); 11422 } 11423 }, _this.s.speed + 100); 11424 11425 }; 11426 11427 Plugin.prototype.enableSwipe = function() { 11428 var _this = this; 11429 var startCoords = 0; 11430 var endCoords = 0; 11431 var isMoved = false; 11432 11433 if (_this.s.enableSwipe && _this.doCss()) { 11434 11435 _this.$slide.on('touchstart.lg', function(e) { 11436 if (!_this.$outer.hasClass('lg-zoomed') && !_this.lgBusy) { 11437 e.preventDefault(); 11438 _this.manageSwipeClass(); 11439 startCoords = e.originalEvent.targetTouches[0].pageX; 11440 } 11441 }); 11442 11443 _this.$slide.on('touchmove.lg', function(e) { 11444 if (!_this.$outer.hasClass('lg-zoomed')) { 11445 e.preventDefault(); 11446 endCoords = e.originalEvent.targetTouches[0].pageX; 11447 _this.touchMove(startCoords, endCoords);
11448 isMoved = true; 11449 } 11450 }); 11451 11452 _this.$slide.on('touchend.lg', function() { 11453 if (!_this.$outer.hasClass('lg-zoomed')) { 11454 if (isMoved) { 11455 isMoved = false; 11456 _this.touchEnd(endCoords - startCoords); 11457 } else { 11458 _this.$el.trigger('onSlideClick.lg'); 11459 } 11460 } 11461 }); 11462 } 11463 11464 }; 11465 11466 Plugin.prototype.enableDrag = function() { 11467 var _this = this; 11468 var startCoords = 0; 11469 var endCoords = 0; 11470 var isDraging = false; 11471 var isMoved = false; 11472 if (_this.s.enableDrag && _this.doCss()) { 11473 _this.$slide.on('mousedown.lg', function(e) { 11474 // execute only on .lg-object 11475 if (!_this.$outer.hasClass('lg-zoomed')) { 11476 if ($(e.target).hasClass('lg-object') || $(e.target).hasClass('lg-video-play')) { 11477 e.preventDefault(); 11478 11479 if (!_this.lgBusy) { 11480 _this.manageSwipeClass(); 11481 startCoords = e.pageX; 11482 isDraging = true; 11483 11484 // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723 11485 _this.$outer.scrollLeft += 1; 11486 _this.$outer.scrollLeft -= 1; 11487 11488 // * 11489 11490 _this.$outer.removeClass('lg-grab').addClass('lg-grabbing'); 11491 11492 _this.$el.trigger('onDragstart.lg'); 11493 } 11494 11495 } 11496 } 11497 }); 11498 11499 $(window).on('mousemove.lg', function(e) { 11500 if (isDraging) { 11501 isMoved = true; 11502 endCoords = e.pageX; 11503 _this.touchMove(startCoords, endCoords); 11504 _this.$el.trigger('onDragmove.lg'); 11505 } 11506 }); 11507 11508 $(window).on('mouseup.lg', function(e) { 11509 if (isMoved) { 11510 isMoved = false; 11511 _this.touchEnd(endCoords - startCoords); 11512 _this.$el.trigger('onDragend.lg'); 11513 } else if ($(e.target).hasClass('lg-object') || $(e.target).hasClass('lg-video-play')) { 11514 _this.$el.trigger('onSlideClick.lg'); 11515 } 11516 11517 // Prevent execution on click 11518 if (isDraging) { 11519 isDraging = false; 11520 _this.$outer.removeClass('lg-grabbing').addClass('lg-grab'); 11521 } 11522 }); 11523 11524 } 11525 }; 11526 11527 Plugin.prototype.manageSwipeClass = function() { 11528 var _touchNext = this.index + 1; 11529 var _touchPrev = this.index - 1; 11530 if (this.s.loop && this.$slide.length > 2) { 11531 if (this.index === 0) { 11532 _touchPrev = this.$slide.length - 1; 11533 } else if (this.index === this.$slide.length - 1) { 11534 _touchNext = 0; 11535 } 11536 } 11537 11538 this.$slide.removeClass('lg-next-slide lg-prev-slide'); 11539 if (_touchPrev > -1) { 11540 this.$slide.eq(_touchPrev).addClass('lg-prev-slide'); 11541 } 11542 11543 this.$slide.eq(_touchNext).addClass('lg-next-slide'); 11544 }; 11545 11546 Plugin.prototype.mousewheel = function() { 11547 var _this = this; 11548 _this.$outer.on('mousewheel.lg', function(e) { 11549 11550 if (!e.deltaY) { 11551 return; 11552 } 11553 11554 if (e.deltaY > 0) { 11555 _this.goToPrevSlide(); 11556 } else { 11557 _this.goToNextSlide(); 11558 } 11559 11560 e.preventDefault(); 11561 }); 11562 11563 }; 11564 11565 Plugin.prototype.closeGallery = function() { 11566 11567 var _this = this; 11568 var mousedown = false; 11569 this.$outer.find('.lg-close').on('click.lg', function() { 11570 _this.destroy(); 11571 }); 11572 11573 if (_this.s.closable) { 11574 11575 // If you drag the slide and release outside gallery gets close on chrome 11576 // for preventing this check mousedown and mouseup happened on .lg-item or lg-outer 11577 _this.$outer.on('mousedown.lg', function(e) { 11578 11579 if ($(e.target).is('.lg-outer') || $(e.target).is('.lg-item ') || $(e.target).is('.lg-img-wrap')) { 11580 mousedown = true; 11581 } else { 11582 mousedown = false; 11583 } 11584 11585 }); 11586 11587 _this.$outer.on('mouseup.lg', function(e) { 11588 11589 if ($(e.target).is('.lg-outer') || $(e.target).is('.lg-item ') || $(e.target).is('.lg-img-wrap') && mousedown) { 11590 if (!_this.$outer.hasClass('lg-dragging')) { 11591 _this.destroy(); 11592 } 11593 } 11594 11595 }); 11596 11597 } 11598 11599 }; 11600 11601 Plugin.prototype.destroy = function(d) { 11602 11603 var _this = this; 11604 11605 if (!d) { 11606 _this.$el.trigger('onBeforeClose.lg'); 11607 $(window).scrollTop(_this.prevScrollTop); 11608 } 11609 11610 11611 /** 11612 * if d is false or undefined destroy will only close the gallery 11613 * plugins instance remains with the element 11614 * 11615 * if d is true destroy will completely remove the plugin 11616 */ 11617 11618 if (d) { 11619 if (!_this.s.dynamic) { 11620 // only when not using dynamic mode is $items a jquery collection 11621 this.$items.off('click.lg click.lgcustom'); 11622 } 11623 11624 $.removeData(_this.el, 'lightGallery'); 11625 } 11626 11627 // Unbind all events added by lightGallery 11628 this.$el.off('.lg.tm'); 11629 11630 // Distroy all lightGallery modules 11631 $.each($.fn.lightGallery.modules, function(key) { 11632 if (_this.modules[key]) { 11633 _this.modules[key].destroy(); 11634 } 11635 }); 11636 11637 this.lGalleryOn = false; 11638 11639 clearTimeout(_this.hideBartimeout); 11640 this.hideBartimeout = false; 11641 $(window).off('.lg'); 11642 $('body').removeClass('lg-on lg-from-hash'); 11643 11644 if (_this.$outer) { 11645 _this.$outer.removeClass('lg-visible'); 11646 } 11647 11648 $('.lg-backdrop').removeClass('in'); 11649 11650 setTimeout(function() { 11651 if (_this.$outer) { 11652 _this.$outer.remove(); 11653 } 11654 11655 $('.lg-backdrop').remove(); 11656 11657 if (!d) { 11658 _this.$el.trigger('onCloseAfter.lg'); 11659 } 11660 11661 }, _this.s.backdropDuration + 50); 11662 }; 11663 11664 $.fn.lightGallery = function(options) { 11665 return this.each(function() { 11666 if (!$.data(this, 'lightGallery')) { 11667 $.data(this, 'lightGallery', new Plugin(this, options)); 11668 } else { 11669 try { 11670 $(this).data('lightGallery').init(); 11671 } catch (err) { 11672 console.error('lightGallery has not initiated properly'); 11673 } 11674 } 11675 }); 11676 }; 11677 11678 $.fn.lightGallery.modules = {}; 11679 11680})(); 11681 11682 11683})); 11684 11685/*! lg-autoplay - v1.0.4 - 2017-03-28 11686* http://sachinchoolur.github.io/lightGallery 11687* Copyright (c) 2017 Sachin N; Licensed GPLv3 */ 11688 11689(function (root, factory) { 11690 if (typeof define === 'function' && define.amd) { 11691 // AMD. Register as an anonymous module unless amdModuleId is set 11692 define(['jquery'], function (a0) { 11693 return (factory(a0)); 11694 });
vendor: 6,521 bytes, lines 11695-11901
11695 } else if (typeof exports === 'object') { 11696 // Node. Does not work with strict CommonJS, but 11697 // only CommonJS-like environments that support module.exports, 11698 // like Node. 11699 module.exports = factory(require('jquery')); 11700 } else { 11701 factory(jQuery); 11702 } 11703}(this, function ($) { 11704 11705 11706(function() { 11707 11708 'use strict'; 11709 11710 var defaults = { 11711 autoplay: false, 11712 pause: 5000, 11713 progressBar: true, 11714 fourceAutoplay: false, 11715 autoplayControls: true, 11716 appendAutoplayControlsTo: '.lg-toolbar' 11717 }; 11718 11719 /** 11720 * Creates the autoplay plugin. 11721 * @param {object} element - lightGallery element 11722 */ 11723 var Autoplay = function(element) { 11724 11725 this.core = $(element).data('lightGallery'); 11726 11727 this.$el = $(element); 11728 11729 // Execute only if items are above 1 11730 if (this.core.$items.length < 2) { 11731 return false; 11732 } 11733 11734 this.core.s = $.extend({}, defaults, this.core.s); 11735 this.interval = false; 11736 11737 // Identify if slide happened from autoplay 11738 this.fromAuto = true; 11739 11740 // Identify if autoplay canceled from touch/drag 11741 this.canceledOnTouch = false; 11742 11743 // save fourceautoplay value 11744 this.fourceAutoplayTemp = this.core.s.fourceAutoplay; 11745 11746 // do not allow progress bar if browser does not support css3 transitions 11747 if (!this.core.doCss()) { 11748 this.core.s.progressBar = false; 11749 } 11750 11751 this.init(); 11752 11753 return this; 11754 }; 11755 11756 Autoplay.prototype.init = function() { 11757 var _this = this; 11758 11759 // append autoplay controls 11760 if (_this.core.s.autoplayControls) { 11761 _this.controls(); 11762 } 11763 11764 // Create progress bar 11765 if (_this.core.s.progressBar) { 11766 _this.core.$outer.find('.lg').append('<div class="lg-progress-bar"><div class="lg-progress"></div></div>'); 11767 } 11768 11769 // set progress 11770 _this.progress(); 11771 11772 // Start autoplay 11773 if (_this.core.s.autoplay) { 11774 _this.$el.one('onSlideItemLoad.lg.tm', function() { 11775 _this.startlAuto(); 11776 }); 11777 } 11778 11779 // cancel interval on touchstart and dragstart 11780 _this.$el.on('onDragstart.lg.tm touchstart.lg.tm', function() { 11781 if (_this.interval) { 11782 _this.cancelAuto(); 11783 _this.canceledOnTouch = true; 11784 } 11785 }); 11786 11787 // restore autoplay if autoplay canceled from touchstart / dragstart 11788 _this.$el.on('onDragend.lg.tm touchend.lg.tm onSlideClick.lg.tm', function() { 11789 if (!_this.interval && _this.canceledOnTouch) { 11790 _this.startlAuto(); 11791 _this.canceledOnTouch = false; 11792 } 11793 }); 11794 11795 }; 11796 11797 Autoplay.prototype.progress = function() { 11798 11799 var _this = this; 11800 var _$progressBar; 11801 var _$progress; 11802 11803 _this.$el.on('onBeforeSlide.lg.tm', function() { 11804 11805 // start progress bar animation 11806 if (_this.core.s.progressBar && _this.fromAuto) { 11807 _$progressBar = _this.core.$outer.find('.lg-progress-bar'); 11808 _$progress = _this.core.$outer.find('.lg-progress'); 11809 if (_this.interval) { 11810 _$progress.removeAttr('style'); 11811 _$progressBar.removeClass('lg-start'); 11812 setTimeout(function() { 11813 _$progress.css('transition', 'width ' + (_this.core.s.speed + _this.core.s.pause) + 'ms ease 0s'); 11814 _$progressBar.addClass('lg-start'); 11815 }, 20); 11816 } 11817 } 11818 11819 // Remove setinterval if slide is triggered manually and fourceautoplay is false 11820 if (!_this.fromAuto && !_this.core.s.fourceAutoplay) { 11821 _this.cancelAuto(); 11822 } 11823 11824 _this.fromAuto = false; 11825 11826 }); 11827 }; 11828 11829 // Manage autoplay via play/stop buttons 11830 Autoplay.prototype.controls = function() { 11831 var _this = this; 11832 var _html = '<span class="lg-autoplay-button lg-icon"></span>'; 11833 11834 // Append autoplay controls 11835 $(this.core.s.appendAutoplayControlsTo).append(_html); 11836 11837 _this.core.$outer.find('.lg-autoplay-button').on('click.lg', function() { 11838 if ($(_this.core.$outer).hasClass('lg-show-autoplay')) { 11839 _this.cancelAuto(); 11840 _this.core.s.fourceAutoplay = false; 11841 } else { 11842 if (!_this.interval) { 11843 _this.startlAuto(); 11844 _this.core.s.fourceAutoplay = _this.fourceAutoplayTemp; 11845 } 11846 } 11847 }); 11848 }; 11849 11850 // Autostart gallery 11851 Autoplay.prototype.startlAuto = function() { 11852 var _this = this; 11853 11854 _this.core.$outer.find('.lg-progress').css('transition', 'width ' + (_this.core.s.speed + _this.core.s.pause) + 'ms ease 0s'); 11855 _this.core.$outer.addClass('lg-show-autoplay'); 11856 _this.core.$outer.find('.lg-progress-bar').addClass('lg-start'); 11857 11858 _this.interval = setInterval(function() { 11859 if (_this.core.index + 1 < _this.core.$items.length) { 11860 _this.core.index++; 11861 } else { 11862 _this.core.index = 0; 11863 } 11864 11865 _this.fromAuto = true; 11866 _this.core.slide(_this.core.index, false, false, 'next'); 11867 }, _this.core.s.speed + _this.core.s.pause); 11868 }; 11869 11870 // cancel Autostart 11871 Autoplay.prototype.cancelAuto = function() { 11872 clearInterval(this.interval); 11873 this.interval = false; 11874 this.core.$outer.find('.lg-progress').removeAttr('style'); 11875 this.core.$outer.removeClass('lg-show-autoplay'); 11876 this.core.$outer.find('.lg-progress-bar').removeClass('lg-start'); 11877 }; 11878 11879 Autoplay.prototype.destroy = function() { 11880 11881 this.cancelAuto(); 11882 this.core.$outer.find('.lg-progress-bar').remove(); 11883 }; 11884 11885 $.fn.lightGallery.modules.autoplay = Autoplay; 11886 11887})(); 11888 11889 11890})); 11891 11892/*! lg-fullscreen - v1.0.1 - 2016-09-30 11893* http://sachinchoolur.github.io/lightGallery 11894* Copyright (c) 2016 Sachin N; Licensed GPLv3 */ 11895 11896(function (root, factory) { 11897 if (typeof define === 'function' && define.amd) { 11898 // AMD. Register as an anonymous module unless amdModuleId is set 11899 define(['jquery'], function (a0) { 11900 return (factory(a0)); 11901 });
11902 } else if (typeof exports === 'object') { 11903 // Node. Does not work with strict CommonJS, but 11904 // only CommonJS-like environments that support module.exports, 11905 // like Node. 11906 module.exports = factory(require('jquery')); 11907 } else { 11908 factory(jQuery); 11909 } 11910}(this, function ($) { 11911 11912(function() { 11913 11914 'use strict'; 11915 11916 var defaults = { 11917 fullScreen: true 11918 }; 11919 11920 var Fullscreen = function(element) { 11921 11922 // get lightGallery core plugin data 11923 this.core = $(element).data('lightGallery'); 11924 11925 this.$el = $(element); 11926 11927 // extend module defalut settings with lightGallery core settings 11928 this.core.s = $.extend({}, defaults, this.core.s); 11929 11930 this.init(); 11931 11932 return this; 11933 }; 11934 11935 Fullscreen.prototype.init = function() { 11936 var fullScreen = ''; 11937 if (this.core.s.fullScreen) { 11938 11939 // check for fullscreen browser support 11940 if (!document.fullscreenEnabled && !document.webkitFullscreenEnabled && 11941 !document.mozFullScreenEnabled && !document.msFullscreenEnabled) { 11942 return; 11943 } else { 11944 fullScreen = '<span class="lg-fullscreen lg-icon"></span>'; 11945 this.core.$outer.find('.lg-toolbar').append(fullScreen); 11946 this.fullScreen(); 11947 } 11948 } 11949 }; 11950 11951 Fullscreen.prototype.requestFullscreen = function() { 11952 var el = document.documentElement; 11953 if (el.requestFullscreen) { 11954 el.requestFullscreen(); 11955 } else if (el.msRequestFullscreen) { 11956 el.msRequestFullscreen(); 11957 } else if (el.mozRequestFullScreen) { 11958 el.mozRequestFullScreen(); 11959 } else if (el.webkitRequestFullscreen) { 11960 el.webkitRequestFullscreen(); 11961 } 11962 }; 11963 11964 Fullscreen.prototype.exitFullscreen = function() { 11965 if (document.exitFullscreen) { 11966 document.exitFullscreen(); 11967 } else if (document.msExitFullscreen) { 11968 document.msExitFullscreen(); 11969 } else if (document.mozCancelFullScreen) { 11970 document.mozCancelFullScreen(); 11971 } else if (document.webkitExitFullscreen) { 11972 document.webkitExitFullscreen(); 11973 } 11974 }; 11975 11976 // https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Using_full_screen_mode 11977 Fullscreen.prototype.fullScreen = function() { 11978 var _this = this; 11979 11980 $(document).on('fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg', function() { 11981 _this.core.$outer.toggleClass('lg-fullscreen-on'); 11982 }); 11983 11984 this.core.$outer.find('.lg-fullscreen').on('click.lg', function() { 11985 if (!document.fullscreenElement && 11986 !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement) { 11987 _this.requestFullscreen(); 11988 } else { 11989 _this.exitFullscreen(); 11990 } 11991 }); 11992 11993 }; 11994 11995 Fullscreen.prototype.destroy = function() { 11996 11997 // exit from fullscreen if activated 11998 this.exitFullscreen(); 11999 12000 $(document).off('fullscreenchange.lg webkitfullscreenchange.lg mozfullscreenchange.lg MSFullscreenChange.lg'); 12001 }; 12002 12003 $.fn.lightGallery.modules.fullscreen = Fullscreen; 12004 12005})(); 12006 12007})); 12008 12009/*! lg-pager - v1.0.2 - 2017-01-22 12010* http://sachinchoolur.github.io/lightGallery 12011* Copyright (c) 2017 Sachin N; Licensed GPLv3 */ 12012 12013(function (root, factory) { 12014 if (typeof define === 'function' && define.amd) { 12015 // AMD. Register as an anonymous module unless amdModuleId is set 12016 define(['jquery'], function (a0) { 12017 return (factory(a0)); 12018 }); 12019 } else if (typeof exports === 'object') { 12020 // Node. Does not work with strict CommonJS, but 12021 // only CommonJS-like environments that support module.exports, 12022 // like Node. 12023 module.exports = factory(require('jquery')); 12024 } else { 12025 factory(jQuery); 12026 } 12027}(this, function ($) { 12028 12029(function() { 12030 12031 'use strict'; 12032 12033 var defaults = { 12034 pager: false 12035 }; 12036 12037 var Pager = function(element) { 12038 12039 this.core = $(element).data('lightGallery'); 12040 12041 this.$el = $(element); 12042 this.core.s = $.extend({}, defaults, this.core.s); 12043 if (this.core.s.pager && this.core.$items.length > 1) { 12044 this.init(); 12045 } 12046 12047 return this; 12048 }; 12049 12050 Pager.prototype.init = function() { 12051 var _this = this; 12052 var pagerList = ''; 12053 var $pagerCont; 12054 var $pagerOuter; 12055 var timeout; 12056 12057 _this.core.$outer.find('.lg').append('<div class="lg-pager-outer"></div>'); 12058 12059 if (_this.core.s.dynamic) { 12060 for (var i = 0; i < _this.core.s.dynamicEl.length; i++) { 12061 pagerList += '<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="' + _this.core.s.dynamicEl[i].thumb + '" /></div></span>'; 12062 } 12063 } else { 12064 _this.core.$items.each(function() { 12065 12066 if (!_this.core.s.exThumbImage) { 12067 pagerList += '<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="' + $(this).find('img').attr('src') + '" /></div></span>'; 12068 } else { 12069 pagerList += '<span class="lg-pager-cont"> <span class="lg-pager"></span><div class="lg-pager-thumb-cont"><span class="lg-caret"></span> <img src="' + $(this).attr(_this.core.s.exThumbImage) + '" /></div></span>'; 12070 } 12071 12072 }); 12073 } 12074 12075 $pagerOuter = _this.core.$outer.find('.lg-pager-outer'); 12076
vendor: 17,682 bytes, lines 12077-12603
12077 $pagerOuter.html(pagerList); 12078 12079 $pagerCont = _this.core.$outer.find('.lg-pager-cont'); 12080 $pagerCont.on('click.lg touchend.lg', function() { 12081 var _$this = $(this); 12082 _this.core.index = _$this.index(); 12083 _this.core.slide(_this.core.index, false, true, false); 12084 }); 12085 12086 $pagerOuter.on('mouseover.lg', function() { 12087 clearTimeout(timeout); 12088 $pagerOuter.addClass('lg-pager-hover'); 12089 }); 12090 12091 $pagerOuter.on('mouseout.lg', function() { 12092 timeout = setTimeout(function() { 12093 $pagerOuter.removeClass('lg-pager-hover'); 12094 }); 12095 }); 12096 12097 _this.core.$el.on('onBeforeSlide.lg.tm', function(e, prevIndex, index) { 12098 $pagerCont.removeClass('lg-pager-active'); 12099 $pagerCont.eq(index).addClass('lg-pager-active'); 12100 }); 12101 12102 }; 12103 12104 Pager.prototype.destroy = function() { 12105 12106 }; 12107 12108 $.fn.lightGallery.modules.pager = Pager; 12109 12110})(); 12111 12112 12113})); 12114 12115/*! lg-thumbnail - v1.1.0 - 2017-08-08 12116* http://sachinchoolur.github.io/lightGallery 12117* Copyright (c) 2017 Sachin N; Licensed GPLv3 */ 12118 12119(function (root, factory) { 12120 if (typeof define === 'function' && define.amd) { 12121 // AMD. Register as an anonymous module unless amdModuleId is set 12122 define(['jquery'], function (a0) { 12123 return (factory(a0)); 12124 }); 12125 } else if (typeof exports === 'object') { 12126 // Node. Does not work with strict CommonJS, but 12127 // only CommonJS-like environments that support module.exports, 12128 // like Node. 12129 module.exports = factory(require('jquery')); 12130 } else { 12131 factory(jQuery); 12132 } 12133}(this, function ($) { 12134 12135(function() { 12136 12137 'use strict'; 12138 12139 var defaults = { 12140 thumbnail: true, 12141 12142 animateThumb: true, 12143 currentPagerPosition: 'middle', 12144 12145 thumbWidth: 100, 12146 thumbHeight: '80px', 12147 thumbContHeight: 100, 12148 thumbMargin: 5, 12149 12150 exThumbImage: false, 12151 showThumbByDefault: true, 12152 toogleThumb: true, 12153 pullCaptionUp: true, 12154 12155 enableThumbDrag: true, 12156 enableThumbSwipe: true, 12157 swipeThreshold: 50, 12158 12159 loadYoutubeThumbnail: true, 12160 youtubeThumbSize: 1, 12161 12162 loadVimeoThumbnail: true, 12163 vimeoThumbSize: 'thumbnail_small', 12164 12165 loadDailymotionThumbnail: true 12166 }; 12167 12168 var Thumbnail = function(element) { 12169 12170 // get lightGallery core plugin data 12171 this.core = $(element).data('lightGallery'); 12172 12173 // extend module default settings with lightGallery core settings 12174 this.core.s = $.extend({}, defaults, this.core.s); 12175 12176 this.$el = $(element); 12177 this.$thumbOuter = null; 12178 this.thumbOuterWidth = 0; 12179 this.thumbTotalWidth = (this.core.$items.length * (this.core.s.thumbWidth + this.core.s.thumbMargin)); 12180 this.thumbIndex = this.core.index; 12181 12182 if (this.core.s.animateThumb) { 12183 this.core.s.thumbHeight = '100%'; 12184 } 12185 12186 // Thumbnail animation value 12187 this.left = 0; 12188 12189 this.init(); 12190 12191 return this; 12192 }; 12193 12194 Thumbnail.prototype.init = function() { 12195 var _this = this; 12196 if (this.core.s.thumbnail && this.core.$items.length > 1) { 12197 if (this.core.s.showThumbByDefault) { 12198 setTimeout(function(){ 12199 _this.core.$outer.addClass('lg-thumb-open'); 12200 }, 700); 12201 } 12202 12203 if (this.core.s.pullCaptionUp) { 12204 this.core.$outer.addClass('lg-pull-caption-up'); 12205 } 12206 12207 this.build(); 12208 if (this.core.s.animateThumb && this.core.doCss()) { 12209 if (this.core.s.enableThumbDrag) { 12210 this.enableThumbDrag(); 12211 } 12212 12213 if (this.core.s.enableThumbSwipe) { 12214 this.enableThumbSwipe(); 12215 } 12216 12217 this.thumbClickable = false; 12218 } else { 12219 this.thumbClickable = true; 12220 } 12221 12222 this.toogle(); 12223 this.thumbkeyPress(); 12224 } 12225 }; 12226 12227 Thumbnail.prototype.build = function() { 12228 var _this = this; 12229 var thumbList = ''; 12230 var vimeoErrorThumbSize = ''; 12231 var $thumb; 12232 var html = '<div class="lg-thumb-outer">' + 12233 '<div class="lg-thumb lg-group">' + 12234 '</div>' + 12235 '</div>'; 12236 12237 switch (this.core.s.vimeoThumbSize) { 12238 case 'thumbnail_large': 12239 vimeoErrorThumbSize = '640'; 12240 break; 12241 case 'thumbnail_medium': 12242 vimeoErrorThumbSize = '200x150'; 12243 break; 12244 case 'thumbnail_small': 12245 vimeoErrorThumbSize = '100x75'; 12246 } 12247 12248 _this.core.$outer.addClass('lg-has-thumb'); 12249 12250 _this.core.$outer.find('.lg').append(html); 12251 12252 _this.$thumbOuter = _this.core.$outer.find('.lg-thumb-outer'); 12253 _this.thumbOuterWidth = _this.$thumbOuter.width(); 12254 12255 if (_this.core.s.animateThumb) { 12256 _this.core.$outer.find('.lg-thumb').css({ 12257 width: _this.thumbTotalWidth + 'px', 12258 position: 'relative' 12259 }); 12260 } 12261 12262 if (this.core.s.animateThumb) { 12263 _this.$thumbOuter.css('height', _this.core.s.thumbContHeight + 'px'); 12264 } 12265 12266 function getThumb(src, thumb, index) { 12267 var isVideo = _this.core.isVideo(src, index) || {}; 12268 var thumbImg; 12269 var vimeoId = ''; 12270 12271 if (isVideo.youtube || isVideo.vimeo || isVideo.dailymotion) { 12272 if (isVideo.youtube) { 12273 if (_this.core.s.loadYoutubeThumbnail) { 12274 thumbImg = '//img.youtube.com/vi/' + isVideo.youtube[1] + '/' + _this.core.s.youtubeThumbSize + '.jpg'; 12275 } else { 12276 thumbImg = thumb; 12277 } 12278 } else if (isVideo.vimeo) { 12279 if (_this.core.s.loadVimeoThumbnail) { 12280 thumbImg = '//i.vimeocdn.com/video/error_' + vimeoErrorThumbSize + '.jpg'; 12281 vimeoId = isVideo.vimeo[1]; 12282 } else { 12283 thumbImg = thumb; 12284 } 12285 } else if (isVideo.dailymotion) { 12286 if (_this.core.s.loadDailymotionThumbnail) { 12287 thumbImg = '//www.dailymotion.com/thumbnail/video/' + isVideo.dailymotion[1]; 12288 } else { 12289 thumbImg = thumb; 12290 } 12291 } 12292 } else { 12293 thumbImg = thumb; 12294 } 12295 12296 thumbList += '<div data-vimeo-id="' + vimeoId + '" class="lg-thumb-item" style="width:' + _this.core.s.thumbWidth + 'px; height: ' + _this.core.s.thumbHeight + '; margin-right: ' + _this.core.s.thumbMargin + 'px"><img src="' + thumbImg + '" /></div>'; 12297 vimeoId = ''; 12298 } 12299 12300 if (_this.core.s.dynamic) { 12301 for (var i = 0; i < _this.core.s.dynamicEl.length; i++) { 12302 getThumb(_this.core.s.dynamicEl[i].src, _this.core.s.dynamicEl[i].thumb, i); 12303 } 12304 } else { 12305 _this.core.$items.each(function(i) { 12306 12307 if (!_this.core.s.exThumbImage) { 12308 getThumb($(this).attr('href') || $(this).attr('data-src'), $(this).find('img').attr('src'), i); 12309 } else { 12310 getThumb($(this).attr('href') || $(this).attr('data-src'), $(this).attr(_this.core.s.exThumbImage), i); 12311 } 12312 12313 }); 12314 } 12315 12316 _this.core.$outer.find('.lg-thumb').html(thumbList); 12317 12318 $thumb = _this.core.$outer.find('.lg-thumb-item'); 12319 12320 // Load vimeo thumbnails 12321 $thumb.each(function() { 12322 var $this = $(this); 12323 var vimeoVideoId = $this.attr('data-vimeo-id'); 12324 12325 if (vimeoVideoId) { 12326 $.getJSON('//www.vimeo.com/api/v2/video/' + vimeoVideoId + '.json?callback=?', { 12327 format: 'json' 12328 }, function(data) { 12329 $this.find('img').attr('src', data[0][_this.core.s.vimeoThumbSize]); 12330 }); 12331 } 12332 }); 12333 12334 // manage active class for thumbnail 12335 $thumb.eq(_this.core.index).addClass('active'); 12336 _this.core.$el.on('onBeforeSlide.lg.tm', function() { 12337 $thumb.removeClass('active'); 12338 $thumb.eq(_this.core.index).addClass('active'); 12339 }); 12340 12341 $thumb.on('click.lg touchend.lg', function() { 12342 var _$this = $(this); 12343 setTimeout(function() { 12344 12345 // In IE9 and bellow touch does not support 12346 // Go to slide if browser does not support css transitions 12347 if ((_this.thumbClickable && !_this.core.lgBusy) || !_this.core.doCss()) { 12348 _this.core.index = _$this.index(); 12349 _this.core.slide(_this.core.index, false, true, false); 12350 } 12351 }, 50); 12352 }); 12353 12354 _this.core.$el.on('onBeforeSlide.lg.tm', function() { 12355 _this.animateThumb(_this.core.index); 12356 }); 12357 12358 $(window).on('resize.lg.thumb orientationchange.lg.thumb', function() { 12359 setTimeout(function() { 12360 _this.animateThumb(_this.core.index); 12361 _this.thumbOuterWidth = _this.$thumbOuter.width(); 12362 }, 200); 12363 }); 12364 12365 }; 12366 12367 Thumbnail.prototype.setTranslate = function(value) { 12368 // jQuery supports Automatic CSS prefixing since jQuery 1.8.0 12369 this.core.$outer.find('.lg-thumb').css({ 12370 transform: 'translate3d(-' + (value) + 'px, 0px, 0px)' 12371 }); 12372 }; 12373 12374 Thumbnail.prototype.animateThumb = function(index) { 12375 var $thumb = this.core.$outer.find('.lg-thumb'); 12376 if (this.core.s.animateThumb) { 12377 var position; 12378 switch (this.core.s.currentPagerPosition) { 12379 case 'left': 12380 position = 0; 12381 break; 12382 case 'middle': 12383 position = (this.thumbOuterWidth / 2) - (this.core.s.thumbWidth / 2); 12384 break; 12385 case 'right': 12386 position = this.thumbOuterWidth - this.core.s.thumbWidth; 12387 } 12388 this.left = ((this.core.s.thumbWidth + this.core.s.thumbMargin) * index - 1) - position; 12389 if (this.left > (this.thumbTotalWidth - this.thumbOuterWidth)) { 12390 this.left = this.thumbTotalWidth - this.thumbOuterWidth; 12391 } 12392 12393 if (this.left < 0) { 12394 this.left = 0; 12395 } 12396 12397 if (this.core.lGalleryOn) { 12398 if (!$thumb.hasClass('on')) { 12399 this.core.$outer.find('.lg-thumb').css('transition-duration', this.core.s.speed + 'ms'); 12400 } 12401 12402 if (!this.core.doCss()) { 12403 $thumb.animate({ 12404 left: -this.left + 'px' 12405 }, this.core.s.speed); 12406 } 12407 } else { 12408 if (!this.core.doCss()) { 12409 $thumb.css('left', -this.left + 'px'); 12410 } 12411 } 12412 12413 this.setTranslate(this.left); 12414 12415 } 12416 }; 12417 12418 // Enable thumbnail dragging and swiping 12419 Thumbnail.prototype.enableThumbDrag = function() { 12420 12421 var _this = this; 12422 var startCoords = 0; 12423 var endCoords = 0; 12424 var isDraging = false; 12425 var isMoved = false; 12426 var tempLeft = 0; 12427 12428 _this.$thumbOuter.addClass('lg-grab'); 12429 12430 _this.core.$outer.find('.lg-thumb').on('mousedown.lg.thumb', function(e) { 12431 if (_this.thumbTotalWidth > _this.thumbOuterWidth) { 12432 // execute only on .lg-object 12433 e.preventDefault(); 12434 startCoords = e.pageX; 12435 isDraging = true; 12436 12437 // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723 12438 _this.core.$outer.scrollLeft += 1; 12439 _this.core.$outer.scrollLeft -= 1; 12440 12441 // * 12442 _this.thumbClickable = false; 12443 _this.$thumbOuter.removeClass('lg-grab').addClass('lg-grabbing'); 12444 } 12445 }); 12446 12447 $(window).on('mousemove.lg.thumb', function(e) { 12448 if (isDraging) { 12449 tempLeft = _this.left; 12450 isMoved = true; 12451 endCoords = e.pageX; 12452 12453 _this.$thumbOuter.addClass('lg-dragging'); 12454 12455 tempLeft = tempLeft - (endCoords - startCoords); 12456 12457 if (tempLeft > (_this.thumbTotalWidth - _this.thumbOuterWidth)) { 12458 tempLeft = _this.thumbTotalWidth - _this.thumbOuterWidth; 12459 } 12460 12461 if (tempLeft < 0) { 12462 tempLeft = 0; 12463 } 12464 12465 // move current slide 12466 _this.setTranslate(tempLeft); 12467 12468 } 12469 }); 12470 12471 $(window).on('mouseup.lg.thumb', function() { 12472 if (isMoved) { 12473 isMoved = false; 12474 _this.$thumbOuter.removeClass('lg-dragging'); 12475 12476 _this.left = tempLeft; 12477 12478 if (Math.abs(endCoords - startCoords) < _this.core.s.swipeThreshold) { 12479 _this.thumbClickable = true; 12480 } 12481 12482 } else { 12483 _this.thumbClickable = true; 12484 } 12485 12486 if (isDraging) { 12487 isDraging = false; 12488 _this.$thumbOuter.removeClass('lg-grabbing').addClass('lg-grab'); 12489 } 12490 }); 12491 12492 }; 12493 12494 Thumbnail.prototype.enableThumbSwipe = function() { 12495 var _this = this; 12496 var startCoords = 0; 12497 var endCoords = 0; 12498 var isMoved = false; 12499 var tempLeft = 0; 12500 12501 _this.core.$outer.find('.lg-thumb').on('touchstart.lg', function(e) { 12502 if (_this.thumbTotalWidth > _this.thumbOuterWidth) { 12503 e.preventDefault(); 12504 startCoords = e.originalEvent.targetTouches[0].pageX; 12505 _this.thumbClickable = false; 12506 } 12507 }); 12508 12509 _this.core.$outer.find('.lg-thumb').on('touchmove.lg', function(e) { 12510 if (_this.thumbTotalWidth > _this.thumbOuterWidth) { 12511 e.preventDefault(); 12512 endCoords = e.originalEvent.targetTouches[0].pageX; 12513 isMoved = true; 12514 12515 _this.$thumbOuter.addClass('lg-dragging'); 12516 12517 tempLeft = _this.left; 12518 12519 tempLeft = tempLeft - (endCoords - startCoords); 12520 12521 if (tempLeft > (_this.thumbTotalWidth - _this.thumbOuterWidth)) { 12522 tempLeft = _this.thumbTotalWidth - _this.thumbOuterWidth; 12523 } 12524 12525 if (tempLeft < 0) { 12526 tempLeft = 0; 12527 } 12528 12529 // move current slide 12530 _this.setTranslate(tempLeft); 12531 12532 } 12533 }); 12534 12535 _this.core.$outer.find('.lg-thumb').on('touchend.lg', function() { 12536 if (_this.thumbTotalWidth > _this.thumbOuterWidth) { 12537 12538 if (isMoved) { 12539 isMoved = false; 12540 _this.$thumbOuter.removeClass('lg-dragging'); 12541 if (Math.abs(endCoords - startCoords) < _this.core.s.swipeThreshold) { 12542 _this.thumbClickable = true; 12543 } 12544 12545 _this.left = tempLeft; 12546 } else { 12547 _this.thumbClickable = true; 12548 } 12549 } else { 12550 _this.thumbClickable = true; 12551 } 12552 }); 12553 12554 }; 12555 12556 Thumbnail.prototype.toogle = function() { 12557 var _this = this; 12558 if (_this.core.s.toogleThumb) { 12559 _this.core.$outer.addClass('lg-can-toggle'); 12560 _this.$thumbOuter.append('<span class="lg-toogle-thumb lg-icon"></span>'); 12561 _this.core.$outer.find('.lg-toogle-thumb').on('click.lg', function() { 12562 _this.core.$outer.toggleClass('lg-thumb-open'); 12563 }); 12564 } 12565 }; 12566 12567 Thumbnail.prototype.thumbkeyPress = function() { 12568 var _this = this; 12569 $(window).on('keydown.lg.thumb', function(e) { 12570 if (e.keyCode === 38) { 12571 e.preventDefault(); 12572 _this.core.$outer.addClass('lg-thumb-open'); 12573 } else if (e.keyCode === 40) { 12574 e.preventDefault(); 12575 _this.core.$outer.removeClass('lg-thumb-open'); 12576 } 12577 }); 12578 }; 12579 12580 Thumbnail.prototype.destroy = function() { 12581 if (this.core.s.thumbnail && this.core.$items.length > 1) { 12582 $(window).off('resize.lg.thumb orientationchange.lg.thumb keydown.lg.thumb'); 12583 this.$thumbOuter.remove(); 12584 this.core.$outer.removeClass('lg-has-thumb'); 12585 } 12586 }; 12587 12588 $.fn.lightGallery.modules.Thumbnail = Thumbnail; 12589 12590})(); 12591 12592})); 12593 12594/*! lg-video - v1.2.0 - 2017-11-16 12595* http://sachinchoolur.github.io/lightGallery 12596* Copyright (c) 2017 Sachin N; Licensed GPLv3 */ 12597 12598(function (root, factory) { 12599 if (typeof define === 'function' && define.amd) { 12600 // AMD. Register as an anonymous module unless amdModuleId is set 12601 define(['jquery'], function (a0) { 12602 return (factory(a0)); 12603 });
vendor: 13,454 bytes, lines 12604-12935
12604 } else if (typeof exports === 'object') { 12605 // Node. Does not work with strict CommonJS, but 12606 // only CommonJS-like environments that support module.exports, 12607 // like Node. 12608 module.exports = factory(require('jquery')); 12609 } else { 12610 factory(jQuery); 12611 } 12612}(this, function ($) { 12613 12614(function() { 12615 12616 'use strict'; 12617 12618 var defaults = { 12619 videoMaxWidth: '855px', 12620 12621 autoplayFirstVideo: true, 12622 12623 youtubePlayerParams: false, 12624 vimeoPlayerParams: false, 12625 dailymotionPlayerParams: false, 12626 vkPlayerParams: false, 12627 12628 videojs: false, 12629 videojsOptions: {} 12630 }; 12631 12632 var Video = function(element) { 12633 12634 this.core = $(element).data('lightGallery'); 12635 12636 this.$el = $(element); 12637 this.core.s = $.extend({}, defaults, this.core.s); 12638 this.videoLoaded = false; 12639 12640 this.init(); 12641 12642 return this; 12643 }; 12644 12645 Video.prototype.init = function() { 12646 var _this = this; 12647 12648 // Event triggered when video url found without poster 12649 _this.core.$el.on('hasVideo.lg.tm', onHasVideo.bind(this)); 12650 12651 // Set max width for video 12652 _this.core.$el.on('onAferAppendSlide.lg.tm', onAferAppendSlide.bind(this)); 12653 12654 if (_this.core.doCss() && (_this.core.$items.length > 1) && (_this.core.s.enableSwipe || _this.core.s.enableDrag)) { 12655 _this.core.$el.on('onSlideClick.lg.tm', function() { 12656 var $el = _this.core.$slide.eq(_this.core.index); 12657 _this.loadVideoOnclick($el); 12658 }); 12659 } else { 12660 12661 // For IE 9 and bellow 12662 _this.core.$slide.on('click.lg', function() { 12663 _this.loadVideoOnclick($(this)); 12664 }); 12665 } 12666 12667 _this.core.$el.on('onBeforeSlide.lg.tm', onBeforeSlide.bind(this)); 12668 12669 _this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex) { 12670 _this.core.$slide.eq(prevIndex).removeClass('lg-video-playing'); 12671 }); 12672 }; 12673 12674 Video.prototype.loadVideo = function(src, addClass, noPoster, index, html) { 12675 var video = ''; 12676 var autoplay = 1; 12677 var a = ''; 12678 var isVideo = this.core.isVideo(src, index) || {}; 12679 12680 // Enable autoplay based on setting for first video if poster doesn't exist 12681 if (noPoster) { 12682 if (this.videoLoaded) { 12683 autoplay = 0; 12684 } else { 12685 autoplay = this.core.s.autoplayFirstVideo ? 1 : 0; 12686 } 12687 } 12688 12689 if (isVideo.youtube) { 12690 12691 a = '?wmode=opaque&autoplay=' + autoplay + '&enablejsapi=1'; 12692 if (this.core.s.youtubePlayerParams) { 12693 a = a + '&' + $.param(this.core.s.youtubePlayerParams); 12694 } 12695 12696 video = '<iframe class="lg-video-object lg-youtube ' + addClass + '" width="560" height="315" src="//www.youtube.com/embed/' + isVideo.youtube[1] + a + '" frameborder="0" allowfullscreen></iframe>'; 12697 12698 } else if (isVideo.vimeo) { 12699 12700 a = '?autoplay=' + autoplay + '&api=1'; 12701 if (this.core.s.vimeoPlayerParams) { 12702 a = a + '&' + $.param(this.core.s.vimeoPlayerParams); 12703 } 12704 12705 video = '<iframe class="lg-video-object lg-vimeo ' + addClass + '" width="560" height="315" src="//player.vimeo.com/video/' + isVideo.vimeo[1] + a + '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>'; 12706 12707 } else if (isVideo.dailymotion) { 12708 12709 a = '?wmode=opaque&autoplay=' + autoplay + '&api=postMessage'; 12710 if (this.core.s.dailymotionPlayerParams) { 12711 a = a + '&' + $.param(this.core.s.dailymotionPlayerParams); 12712 } 12713 12714 video = '<iframe class="lg-video-object lg-dailymotion ' + addClass + '" width="560" height="315" src="//www.dailymotion.com/embed/video/' + isVideo.dailymotion[1] + a + '" frameborder="0" allowfullscreen></iframe>'; 12715 12716 } else if (isVideo.html5) { 12717 var fL = html.substring(0, 1); 12718 if (fL === '.' || fL === '#') { 12719 html = $(html).html(); 12720 } 12721 12722 video = html; 12723 12724 } else if (isVideo.vk) { 12725 12726 a = '&autoplay=' + autoplay; 12727 if (this.core.s.vkPlayerParams) { 12728 a = a + '&' + $.param(this.core.s.vkPlayerParams); 12729 } 12730 12731 video = '<iframe class="lg-video-object lg-vk ' + addClass + '" width="560" height="315" src="http://vk.com/video_ext.php?' + isVideo.vk[1] + a + '" frameborder="0" allowfullscreen></iframe>'; 12732 12733 } 12734 12735 return video; 12736 }; 12737 12738 Video.prototype.loadVideoOnclick = function($el){ 12739 12740 var _this = this; 12741 // check slide has poster 12742 if ($el.find('.lg-object').hasClass('lg-has-poster') && $el.find('.lg-object').is(':visible')) { 12743 12744 // check already video element present 12745 if (!$el.hasClass('lg-has-video')) { 12746 12747 $el.addClass('lg-video-playing lg-has-video'); 12748 12749 var _src; 12750 var _html; 12751 var _loadVideo = function(_src, _html) { 12752 12753 $el.find('.lg-video').append(_this.loadVideo(_src, '', false, _this.core.index, _html)); 12754 12755 if (_html) { 12756 if (_this.core.s.videojs) { 12757 try { 12758 videojs(_this.core.$slide.eq(_this.core.index).find('.lg-html5').get(0), _this.core.s.videojsOptions, function() { 12759 this.play(); 12760 }); 12761 } catch (e) { 12762 console.error('Make sure you have included videojs'); 12763 } 12764 } else { 12765 _this.core.$slide.eq(_this.core.index).find('.lg-html5').get(0).play(); 12766 } 12767 } 12768 12769 }; 12770 12771 if (_this.core.s.dynamic) { 12772 12773 _src = _this.core.s.dynamicEl[_this.core.index].src; 12774 _html = _this.core.s.dynamicEl[_this.core.index].html; 12775 12776 _loadVideo(_src, _html); 12777 12778 } else { 12779 12780 _src = _this.core.$items.eq(_this.core.index).attr('href') || _this.core.$items.eq(_this.core.index).attr('data-src'); 12781 _html = _this.core.$items.eq(_this.core.index).attr('data-html'); 12782 12783 _loadVideo(_src, _html); 12784 12785 } 12786 12787 var $tempImg = $el.find('.lg-object'); 12788 $el.find('.lg-video').append($tempImg); 12789 12790 // @todo loading icon for html5 videos also 12791 // for showing the loading indicator while loading video 12792 if (!$el.find('.lg-video-object').hasClass('lg-html5')) { 12793 $el.removeClass('lg-complete'); 12794 $el.find('.lg-video-object').on('load.lg error.lg', function() { 12795 $el.addClass('lg-complete'); 12796 }); 12797 } 12798 12799 } else { 12800 12801 var youtubePlayer = $el.find('.lg-youtube').get(0); 12802 var vimeoPlayer = $el.find('.lg-vimeo').get(0); 12803 var dailymotionPlayer = $el.find('.lg-dailymotion').get(0); 12804 var html5Player = $el.find('.lg-html5').get(0); 12805 if (youtubePlayer) { 12806 youtubePlayer.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*'); 12807 } else if (vimeoPlayer) { 12808 try { 12809 $f(vimeoPlayer).api('play'); 12810 } catch (e) { 12811 console.error('Make sure you have included froogaloop2 js'); 12812 } 12813 } else if (dailymotionPlayer) { 12814 dailymotionPlayer.contentWindow.postMessage('play', '*'); 12815 12816 } else if (html5Player) { 12817 if (_this.core.s.videojs) { 12818 try { 12819 videojs(html5Player).play(); 12820 } catch (e) { 12821 console.error('Make sure you have included videojs'); 12822 } 12823 } else { 12824 html5Player.play(); 12825 } 12826 } 12827 12828 $el.addClass('lg-video-playing'); 12829 12830 } 12831 } 12832 }; 12833 12834 Video.prototype.destroy = function() { 12835 this.videoLoaded = false; 12836 }; 12837 12838 function onHasVideo(event, index, src, html) { 12839 /*jshint validthis:true */ 12840 var _this = this; 12841 _this.core.$slide.eq(index).find('.lg-video').append(_this.loadVideo(src, 'lg-object', true, index, html)); 12842 if (html) { 12843 if (_this.core.s.videojs) { 12844 try { 12845 videojs(_this.core.$slide.eq(index).find('.lg-html5').get(0), _this.core.s.videojsOptions, function() { 12846 if (!_this.videoLoaded && _this.core.s.autoplayFirstVideo) { 12847 this.play(); 12848 } 12849 }); 12850 } catch (e) { 12851 console.error('Make sure you have included videojs'); 12852 } 12853 } else { 12854 if(!_this.videoLoaded && _this.core.s.autoplayFirstVideo) { 12855 _this.core.$slide.eq(index).find('.lg-html5').get(0).play(); 12856 } 12857 } 12858 } 12859 } 12860 12861 function onAferAppendSlide(event, index) { 12862 /*jshint validthis:true */ 12863 var $videoCont = this.core.$slide.eq(index).find('.lg-video-cont'); 12864 if (!$videoCont.hasClass('lg-has-iframe')) { 12865 $videoCont.css('max-width', this.core.s.videoMaxWidth); 12866 this.videoLoaded = true; 12867 } 12868 } 12869 12870 function onBeforeSlide(event, prevIndex, index) { 12871 /*jshint validthis:true */ 12872 var _this = this; 12873 12874 var $videoSlide = _this.core.$slide.eq(prevIndex); 12875 var youtubePlayer = $videoSlide.find('.lg-youtube').get(0); 12876 var vimeoPlayer = $videoSlide.find('.lg-vimeo').get(0); 12877 var dailymotionPlayer = $videoSlide.find('.lg-dailymotion').get(0); 12878 var vkPlayer = $videoSlide.find('.lg-vk').get(0); 12879 var html5Player = $videoSlide.find('.lg-html5').get(0); 12880 if (youtubePlayer) { 12881 youtubePlayer.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*'); 12882 } else if (vimeoPlayer) { 12883 try { 12884 $f(vimeoPlayer).api('pause'); 12885 } catch (e) { 12886 console.error('Make sure you have included froogaloop2 js'); 12887 } 12888 } else if (dailymotionPlayer) { 12889 dailymotionPlayer.contentWindow.postMessage('pause', '*'); 12890 12891 } else if (html5Player) { 12892 if (_this.core.s.videojs) { 12893 try { 12894 videojs(html5Player).pause(); 12895 } catch (e) { 12896 console.error('Make sure you have included videojs'); 12897 } 12898 } else { 12899 html5Player.pause(); 12900 } 12901 } if (vkPlayer) { 12902 $(vkPlayer).attr('src', $(vkPlayer).attr('src').replace('&autoplay', '&noplay')); 12903 } 12904 12905 var _src; 12906 if (_this.core.s.dynamic) { 12907 _src = _this.core.s.dynamicEl[index].src; 12908 } else { 12909 _src = _this.core.$items.eq(index).attr('href') || _this.core.$items.eq(index).attr('data-src'); 12910 12911 } 12912 12913 var _isVideo = _this.core.isVideo(_src, index) || {}; 12914 if (_isVideo.youtube || _isVideo.vimeo || _isVideo.dailymotion || _isVideo.vk) { 12915 _this.core.$outer.addClass('lg-hide-download'); 12916 } 12917 12918 } 12919 12920 $.fn.lightGallery.modules.video = Video; 12921 12922 })(); 12923 12924})); 12925 12926/*! lg-zoom - v1.1.0 - 2017-08-08 12927* http://sachinchoolur.github.io/lightGallery 12928* Copyright (c) 2017 Sachin N; Licensed GPLv3 */ 12929 12930(function (root, factory) { 12931 if (typeof define === 'function' && define.amd) { 12932 // AMD. Register as an anonymous module unless amdModuleId is set 12933 define(['jquery'], function (a0) { 12934 return (factory(a0)); 12935 });
vendor: 18,202 bytes, lines 12936-13463
12936 } else if (typeof exports === 'object') { 12937 // Node. Does not work with strict CommonJS, but 12938 // only CommonJS-like environments that support module.exports, 12939 // like Node. 12940 module.exports = factory(require('jquery')); 12941 } else { 12942 factory(jQuery); 12943 } 12944}(this, function ($) { 12945 12946(function() { 12947 12948 'use strict'; 12949 12950 var getUseLeft = function() { 12951 var useLeft = false; 12952 var isChrome = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./); 12953 if (isChrome && parseInt(isChrome[2], 10) < 54) { 12954 useLeft = true; 12955 } 12956 12957 return useLeft; 12958 }; 12959 12960 var defaults = { 12961 scale: 1, 12962 zoom: true, 12963 actualSize: true, 12964 enableZoomAfter: 300, 12965 useLeftForZoom: getUseLeft() 12966 }; 12967 12968 var Zoom = function(element) { 12969 12970 this.core = $(element).data('lightGallery'); 12971 12972 this.core.s = $.extend({}, defaults, this.core.s); 12973 12974 if (this.core.s.zoom && this.core.doCss()) { 12975 this.init(); 12976 12977 // Store the zoomable timeout value just to clear it while closing 12978 this.zoomabletimeout = false; 12979 12980 // Set the initial value center 12981 this.pageX = $(window).width() / 2; 12982 this.pageY = ($(window).height() / 2) + $(window).scrollTop(); 12983 } 12984 12985 return this; 12986 }; 12987 12988 Zoom.prototype.init = function() { 12989 12990 var _this = this; 12991 var zoomIcons = '<span id="lg-zoom-in" class="lg-icon"></span><span id="lg-zoom-out" class="lg-icon"></span>'; 12992 12993 if (_this.core.s.actualSize) { 12994 zoomIcons += '<span id="lg-actual-size" class="lg-icon"></span>'; 12995 } 12996 12997 if (_this.core.s.useLeftForZoom) { 12998 _this.core.$outer.addClass('lg-use-left-for-zoom'); 12999 } else { 13000 _this.core.$outer.addClass('lg-use-transition-for-zoom'); 13001 } 13002 13003 this.core.$outer.find('.lg-toolbar').append(zoomIcons); 13004 13005 // Add zoomable class 13006 _this.core.$el.on('onSlideItemLoad.lg.tm.zoom', function(event, index, delay) { 13007 13008 // delay will be 0 except first time 13009 var _speed = _this.core.s.enableZoomAfter + delay; 13010 13011 // set _speed value 0 if gallery opened from direct url and if it is first slide 13012 if ($('body').hasClass('lg-from-hash') && delay) { 13013 13014 // will execute only once 13015 _speed = 0; 13016 } else { 13017 13018 // Remove lg-from-hash to enable starting animation. 13019 $('body').removeClass('lg-from-hash'); 13020 } 13021 13022 _this.zoomabletimeout = setTimeout(function() { 13023 _this.core.$slide.eq(index).addClass('lg-zoomable'); 13024 }, _speed + 30); 13025 }); 13026 13027 var scale = 1; 13028 /** 13029 * @desc Image zoom 13030 * Translate the wrap and scale the image to get better user experience 13031 * 13032 * @param {String} scaleVal - Zoom decrement/increment value 13033 */ 13034 var zoom = function(scaleVal) { 13035 13036 var $image = _this.core.$outer.find('.lg-current .lg-image'); 13037 var _x; 13038 var _y; 13039 13040 // Find offset manually to avoid issue after zoom 13041 var offsetX = ($(window).width() - $image.prop('offsetWidth')) / 2; 13042 var offsetY = (($(window).height() - $image.prop('offsetHeight')) / 2) + $(window).scrollTop(); 13043 13044 _x = _this.pageX - offsetX; 13045 _y = _this.pageY - offsetY; 13046 13047 var x = (scaleVal - 1) * (_x); 13048 var y = (scaleVal - 1) * (_y); 13049 13050 $image.css('transform', 'scale3d(' + scaleVal + ', ' + scaleVal + ', 1)').attr('data-scale', scaleVal); 13051 13052 if (_this.core.s.useLeftForZoom) { 13053 $image.parent().css({ 13054 left: -x + 'px', 13055 top: -y + 'px' 13056 }).attr('data-x', x).attr('data-y', y); 13057 } else { 13058 $image.parent().css('transform', 'translate3d(-' + x + 'px, -' + y + 'px, 0)').attr('data-x', x).attr('data-y', y); 13059 } 13060 }; 13061 13062 var callScale = function() { 13063 if (scale > 1) { 13064 _this.core.$outer.addClass('lg-zoomed'); 13065 } else { 13066 _this.resetZoom(); 13067 } 13068 13069 if (scale < 1) { 13070 scale = 1; 13071 } 13072 13073 zoom(scale); 13074 }; 13075 13076 var actualSize = function(event, $image, index, fromIcon) { 13077 var w = $image.prop('offsetWidth'); 13078 var nw; 13079 if (_this.core.s.dynamic) { 13080 nw = _this.core.s.dynamicEl[index].width || $image[0].naturalWidth || w; 13081 } else { 13082 nw = _this.core.$items.eq(index).attr('data-width') || $image[0].naturalWidth || w; 13083 } 13084 13085 var _scale; 13086 13087 if (_this.core.$outer.hasClass('lg-zoomed')) { 13088 scale = 1; 13089 } else { 13090 if (nw > w) { 13091 _scale = nw / w; 13092 scale = _scale || 2; 13093 } 13094 } 13095 13096 if (fromIcon) { 13097 _this.pageX = $(window).width() / 2; 13098 _this.pageY = ($(window).height() / 2) + $(window).scrollTop(); 13099 } else { 13100 _this.pageX = event.pageX || event.originalEvent.targetTouches[0].pageX; 13101 _this.pageY = event.pageY || event.originalEvent.targetTouches[0].pageY; 13102 } 13103 13104 callScale(); 13105 setTimeout(function() { 13106 _this.core.$outer.removeClass('lg-grabbing').addClass('lg-grab'); 13107 }, 10); 13108 }; 13109 13110 var tapped = false; 13111 13112 // event triggered after appending slide content 13113 _this.core.$el.on('onAferAppendSlide.lg.tm.zoom', function(event, index) { 13114 13115 // Get the current element 13116 var $image = _this.core.$slide.eq(index).find('.lg-image'); 13117 13118 $image.on('dblclick', function(event) { 13119 actualSize(event, $image, index); 13120 }); 13121 13122 $image.on('touchstart', function(event) { 13123 if (!tapped) { 13124 tapped = setTimeout(function() { 13125 tapped = null; 13126 }, 300); 13127 } else { 13128 clearTimeout(tapped); 13129 tapped = null; 13130 actualSize(event, $image, index); 13131 } 13132 13133 event.preventDefault(); 13134 }); 13135 13136 }); 13137 13138 // Update zoom on resize and orientationchange 13139 $(window).on('resize.lg.zoom scroll.lg.zoom orientationchange.lg.zoom', function() { 13140 _this.pageX = $(window).width() / 2; 13141 _this.pageY = ($(window).height() / 2) + $(window).scrollTop(); 13142 zoom(scale); 13143 }); 13144 13145 $('#lg-zoom-out').on('click.lg', function() { 13146 if (_this.core.$outer.find('.lg-current .lg-image').length) { 13147 scale -= _this.core.s.scale; 13148 callScale(); 13149 } 13150 }); 13151 13152 $('#lg-zoom-in').on('click.lg', function() { 13153 if (_this.core.$outer.find('.lg-current .lg-image').length) { 13154 scale += _this.core.s.scale; 13155 callScale(); 13156 } 13157 }); 13158 13159 $('#lg-actual-size').on('click.lg', function(event) { 13160 actualSize(event, _this.core.$slide.eq(_this.core.index).find('.lg-image'), _this.core.index, true); 13161 }); 13162 13163 // Reset zoom on slide change 13164 _this.core.$el.on('onBeforeSlide.lg.tm', function() { 13165 scale = 1; 13166 _this.resetZoom(); 13167 }); 13168 13169 // Drag option after zoom 13170 _this.zoomDrag(); 13171 13172 _this.zoomSwipe(); 13173 13174 }; 13175 13176 // Reset zoom effect 13177 Zoom.prototype.resetZoom = function() { 13178 this.core.$outer.removeClass('lg-zoomed'); 13179 this.core.$slide.find('.lg-img-wrap').removeAttr('style data-x data-y'); 13180 this.core.$slide.find('.lg-image').removeAttr('style data-scale'); 13181 13182 // Reset pagx pagy values to center 13183 this.pageX = $(window).width() / 2; 13184 this.pageY = ($(window).height() / 2) + $(window).scrollTop(); 13185 }; 13186 13187 Zoom.prototype.zoomSwipe = function() { 13188 var _this = this; 13189 var startCoords = {}; 13190 var endCoords = {}; 13191 var isMoved = false; 13192 13193 // Allow x direction drag 13194 var allowX = false; 13195 13196 // Allow Y direction drag 13197 var allowY = false; 13198 13199 _this.core.$slide.on('touchstart.lg', function(e) { 13200 13201 if (_this.core.$outer.hasClass('lg-zoomed')) { 13202 var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object'); 13203 13204 allowY = $image.prop('offsetHeight') * $image.attr('data-scale') > _this.core.$outer.find('.lg').height(); 13205 allowX = $image.prop('offsetWidth') * $image.attr('data-scale') > _this.core.$outer.find('.lg').width(); 13206 if ((allowX || allowY)) { 13207 e.preventDefault(); 13208 startCoords = { 13209 x: e.originalEvent.targetTouches[0].pageX, 13210 y: e.originalEvent.targetTouches[0].pageY 13211 }; 13212 } 13213 } 13214 13215 }); 13216 13217 _this.core.$slide.on('touchmove.lg', function(e) { 13218 13219 if (_this.core.$outer.hasClass('lg-zoomed')) { 13220 13221 var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap'); 13222 var distanceX; 13223 var distanceY; 13224 13225 e.preventDefault(); 13226 isMoved = true; 13227 13228 endCoords = { 13229 x: e.originalEvent.targetTouches[0].pageX, 13230 y: e.originalEvent.targetTouches[0].pageY 13231 }; 13232 13233 // reset opacity and transition duration 13234 _this.core.$outer.addClass('lg-zoom-dragging'); 13235 13236 if (allowY) { 13237 distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y); 13238 } else { 13239 distanceY = -Math.abs(_$el.attr('data-y')); 13240 } 13241 13242 if (allowX) { 13243 distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x); 13244 } else { 13245 distanceX = -Math.abs(_$el.attr('data-x')); 13246 } 13247 13248 if ((Math.abs(endCoords.x - startCoords.x) > 15) || (Math.abs(endCoords.y - startCoords.y) > 15)) { 13249 13250 if (_this.core.s.useLeftForZoom) { 13251 _$el.css({ 13252 left: distanceX + 'px', 13253 top: distanceY + 'px' 13254 }); 13255 } else { 13256 _$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)'); 13257 } 13258 } 13259 13260 } 13261 13262 }); 13263 13264 _this.core.$slide.on('touchend.lg', function() { 13265 if (_this.core.$outer.hasClass('lg-zoomed')) { 13266 if (isMoved) { 13267 isMoved = false; 13268 _this.core.$outer.removeClass('lg-zoom-dragging'); 13269 _this.touchendZoom(startCoords, endCoords, allowX, allowY); 13270 13271 } 13272 } 13273 }); 13274 13275 }; 13276 13277 Zoom.prototype.zoomDrag = function() { 13278 13279 var _this = this; 13280 var startCoords = {}; 13281 var endCoords = {}; 13282 var isDraging = false; 13283 var isMoved = false; 13284 13285 // Allow x direction drag 13286 var allowX = false; 13287 13288 // Allow Y direction drag 13289 var allowY = false; 13290 13291 _this.core.$slide.on('mousedown.lg.zoom', function(e) { 13292 13293 // execute only on .lg-object 13294 var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object'); 13295 13296 allowY = $image.prop('offsetHeight') * $image.attr('data-scale') > _this.core.$outer.find('.lg').height(); 13297 allowX = $image.prop('offsetWidth') * $image.attr('data-scale') > _this.core.$outer.find('.lg').width(); 13298 13299 if (_this.core.$outer.hasClass('lg-zoomed')) { 13300 if ($(e.target).hasClass('lg-object') && (allowX || allowY)) { 13301 e.preventDefault(); 13302 startCoords = { 13303 x: e.pageX, 13304 y: e.pageY 13305 }; 13306 13307 isDraging = true; 13308 13309 // ** Fix for webkit cursor issue https://code.google.com/p/chromium/issues/detail?id=26723 13310 _this.core.$outer.scrollLeft += 1; 13311 _this.core.$outer.scrollLeft -= 1; 13312 13313 _this.core.$outer.removeClass('lg-grab').addClass('lg-grabbing'); 13314 } 13315 } 13316 }); 13317 13318 $(window).on('mousemove.lg.zoom', function(e) { 13319 if (isDraging) { 13320 var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap'); 13321 var distanceX; 13322 var distanceY; 13323 13324 isMoved = true; 13325 endCoords = { 13326 x: e.pageX, 13327 y: e.pageY 13328 }; 13329 13330 // reset opacity and transition duration 13331 _this.core.$outer.addClass('lg-zoom-dragging'); 13332 13333 if (allowY) { 13334 distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y); 13335 } else { 13336 distanceY = -Math.abs(_$el.attr('data-y')); 13337 } 13338 13339 if (allowX) { 13340 distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x); 13341 } else { 13342 distanceX = -Math.abs(_$el.attr('data-x')); 13343 } 13344 13345 if (_this.core.s.useLeftForZoom) { 13346 _$el.css({ 13347 left: distanceX + 'px', 13348 top: distanceY + 'px' 13349 }); 13350 } else { 13351 _$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)'); 13352 } 13353 } 13354 }); 13355 13356 $(window).on('mouseup.lg.zoom', function(e) { 13357 13358 if (isDraging) { 13359 isDraging = false; 13360 _this.core.$outer.removeClass('lg-zoom-dragging'); 13361 13362 // Fix for chrome mouse move on click 13363 if (isMoved && ((startCoords.x !== endCoords.x) || (startCoords.y !== endCoords.y))) { 13364 endCoords = { 13365 x: e.pageX, 13366 y: e.pageY 13367 }; 13368 _this.touchendZoom(startCoords, endCoords, allowX, allowY); 13369 13370 } 13371 13372 isMoved = false; 13373 } 13374 13375 _this.core.$outer.removeClass('lg-grabbing').addClass('lg-grab'); 13376 13377 }); 13378 }; 13379 13380 Zoom.prototype.touchendZoom = function(startCoords, endCoords, allowX, allowY) { 13381 13382 var _this = this; 13383 var _$el = _this.core.$slide.eq(_this.core.index).find('.lg-img-wrap'); 13384 var $image = _this.core.$slide.eq(_this.core.index).find('.lg-object'); 13385 var distanceX = (-Math.abs(_$el.attr('data-x'))) + (endCoords.x - startCoords.x); 13386 var distanceY = (-Math.abs(_$el.attr('data-y'))) + (endCoords.y - startCoords.y); 13387 var minY = (_this.core.$outer.find('.lg').height() - $image.prop('offsetHeight')) / 2; 13388 var maxY = Math.abs(($image.prop('offsetHeight') * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').height() + minY); 13389 var minX = (_this.core.$outer.find('.lg').width() - $image.prop('offsetWidth')) / 2; 13390 var maxX = Math.abs(($image.prop('offsetWidth') * Math.abs($image.attr('data-scale'))) - _this.core.$outer.find('.lg').width() + minX); 13391 13392 if ((Math.abs(endCoords.x - startCoords.x) > 15) || (Math.abs(endCoords.y - startCoords.y) > 15)) { 13393 if (allowY) { 13394 if (distanceY <= -maxY) { 13395 distanceY = -maxY; 13396 } else if (distanceY >= -minY) { 13397 distanceY = -minY; 13398 } 13399 } 13400 13401 if (allowX) { 13402 if (distanceX <= -maxX) { 13403 distanceX = -maxX; 13404 } else if (distanceX >= -minX) { 13405 distanceX = -minX; 13406 } 13407 } 13408 13409 if (allowY) { 13410 _$el.attr('data-y', Math.abs(distanceY)); 13411 } else { 13412 distanceY = -Math.abs(_$el.attr('data-y')); 13413 } 13414 13415 if (allowX) { 13416 _$el.attr('data-x', Math.abs(distanceX)); 13417 } else { 13418 distanceX = -Math.abs(_$el.attr('data-x')); 13419 } 13420 13421 if (_this.core.s.useLeftForZoom) { 13422 _$el.css({ 13423 left: distanceX + 'px', 13424 top: distanceY + 'px' 13425 }); 13426 } else { 13427 _$el.css('transform', 'translate3d(' + distanceX + 'px, ' + distanceY + 'px, 0)'); 13428 } 13429 13430 } 13431 }; 13432 13433 Zoom.prototype.destroy = function() { 13434 13435 var _this = this; 13436 13437 // Unbind all events added by lightGallery zoom plugin 13438 _this.core.$el.off('.lg.zoom'); 13439 $(window).off('.lg.zoom'); 13440 _this.core.$slide.off('.lg.zoom'); 13441 _this.core.$el.off('.lg.tm.zoom'); 13442 _this.resetZoom(); 13443 clearTimeout(_this.zoomabletimeout); 13444 _this.zoomabletimeout = false; 13445 }; 13446 13447 $.fn.lightGallery.modules.zoom = Zoom; 13448 13449})(); 13450 13451 13452})); 13453 13454/*! lg-hash - v1.0.3 - 2017-10-19 13455* http://sachinchoolur.github.io/lightGallery 13456* Copyright (c) 2017 Sachin N; Licensed GPLv3 */ 13457 13458(function (root, factory) { 13459 if (typeof define === 'function' && define.amd) { 13460 // AMD. Register as an anonymous module unless amdModuleId is set 13461 define(['jquery'], function (a0) { 13462 return (factory(a0)); 13463 });
13464 } else if (typeof exports === 'object') { 13465 // Node. Does not work with strict CommonJS, but 13466 // only CommonJS-like environments that support module.exports, 13467 // like Node. 13468 module.exports = factory(require('jquery')); 13469 } else { 13470 factory(jQuery); 13471 } 13472}(this, function ($) { 13473 13474(function() { 13475 13476 'use strict'; 13477 13478 var defaults = { 13479 hash: true 13480 }; 13481 13482 var Hash = function(element) { 13483 13484 this.core = $(element).data('lightGallery'); 13485 13486 this.core.s = $.extend({}, defaults, this.core.s); 13487 13488 if (this.core.s.hash) { 13489 this.oldHash = window.location.hash; 13490 this.init(); 13491 } 13492 13493 return this; 13494 }; 13495 13496 Hash.prototype.init = function() { 13497 var _this = this; 13498 var _hash; 13499 13500 // Change hash value on after each slide transition 13501 _this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex, index) { 13502 if (history.replaceState) { 13503 history.replaceState(null, null, window.location.pathname + '#lg=' + _this.core.s.galleryId + '&slide=' + index); 13504 } else { 13505 window.location.hash = 'lg=' + _this.core.s.galleryId + '&slide=' + index; 13506 } 13507 }); 13508 13509 // Listen hash change and change the slide according to slide value 13510 $(window).on('hashchange.lg.hash', function() { 13511 _hash = window.location.hash; 13512 var _idx = parseInt(_hash.split('&slide=')[1], 10); 13513 13514 // it galleryId doesn't exist in the url close the gallery 13515 if ((_hash.indexOf('lg=' + _this.core.s.galleryId) > -1)) { 13516 _this.core.slide(_idx, false, false); 13517 } else if (_this.core.lGalleryOn) { 13518 _this.core.destroy(); 13519 } 13520 13521 }); 13522 }; 13523 13524 Hash.prototype.destroy = function() { 13525 13526 if (!this.core.s.hash) { 13527 return; 13528 } 13529 13530 // Reset to old hash value 13531 if (this.oldHash && this.oldHash.indexOf('lg=' + this.core.s.galleryId) < 0) { 13532 if (history.replaceState) { 13533 history.replaceState(null, null, this.oldHash); 13534 } else { 13535 window.location.hash = this.oldHash; 13536 } 13537 } else { 13538 if (history.replaceState) { 13539 history.replaceState(null, document.title, window.location.pathname + window.location.search); 13540 } else { 13541 window.location.hash = ''; 13542 } 13543 } 13544 13545 this.core.$el.off('.lg.hash'); 13546 13547 }; 13548 13549 $.fn.lightGallery.modules.hash = Hash; 13550 13551})(); 13552 13553 13554})); 13555 13556/*! lg-share - v1.1.0 - 2017-10-03 13557* http://sachinchoolur.github.io/lightGallery 13558* Copyright (c) 2017 Sachin N; Licensed GPLv3 */ 13559 13560(function (root, factory) { 13561 if (typeof define === 'function' && define.amd) { 13562 // AMD. Register as an anonymous module unless amdModuleId is set 13563 define(['jquery'], function (a0) { 13564 return (factory(a0)); 13565 }); 13566 } else if (typeof exports === 'object') { 13567 // Node. Does not work with strict CommonJS, but 13568 // only CommonJS-like environments that support module.exports, 13569 // like Node. 13570 module.exports = factory(require('jquery')); 13571 } else { 13572 factory(jQuery); 13573 } 13574}(this, function ($) { 13575 13576(function() { 13577 13578 'use strict'; 13579 13580 var defaults = { 13581 share: true, 13582 facebook: true, 13583 facebookDropdownText: 'Facebook', 13584 twitter: true, 13585 twitterDropdownText: 'Twitter', 13586 googlePlus: true, 13587 googlePlusDropdownText: 'GooglePlus', 13588 pinterest: true, 13589 pinterestDropdownText: 'Pinterest' 13590 }; 13591 13592 var Share = function(element) { 13593 13594 this.core = $(element).data('lightGallery'); 13595 13596 this.core.s = $.extend({}, defaults, this.core.s); 13597 if (this.core.s.share) { 13598 this.init(); 13599 } 13600 13601 return this; 13602 }; 13603 13604 Share.prototype.init = function() { 13605 var _this = this; 13606 var shareHtml = '<span id="lg-share" class="lg-icon">' + 13607 '<ul class="lg-dropdown" style="position: absolute;">'; 13608 shareHtml += _this.core.s.facebook ? '<li><a id="lg-share-facebook" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">' + this.core.s.facebookDropdownText + '</span></a></li>' : ''; 13609 shareHtml += _this.core.s.twitter ? '<li><a id="lg-share-twitter" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">' + this.core.s.twitterDropdownText + '</span></a></li>' : ''; 13610 shareHtml += _this.core.s.googlePlus ? '<li><a id="lg-share-googleplus" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">' + this.core.s.googlePlusDropdownText + '</span></a></li>' : ''; 13611 shareHtml += _this.core.s.pinterest ? '<li><a id="lg-share-pinterest" target="_blank"><span class="lg-icon"></span><span class="lg-dropdown-text">' + this.core.s.pinterestDropdownText + '</span></a></li>' : ''; 13612 shareHtml += '</ul></span>'; 13613 13614 this.core.$outer.find('.lg-toolbar').append(shareHtml); 13615 this.core.$outer.find('.lg').append('<div id="lg-dropdown-overlay"></div>'); 13616 $('#lg-share').on('click.lg', function(){ 13617 _this.core.$outer.toggleClass('lg-dropdown-active'); 13618 }); 13619 13620 $('#lg-dropdown-overlay').on('click.lg', function(){ 13621 _this.core.$outer.removeClass('lg-dropdown-active'); 13622 }); 13623 13624 _this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex, index) { 13625 13626 setTimeout(function() { 13627 13628 $('#lg-share-facebook').attr('href', 'https://www.facebook.com/sharer/sharer.php?u=' + (encodeURIComponent(_this.get
13628SahreProps(index, 'facebookShareUrl') || window.location.href))); 13629 13630 $('#lg-share-twitter').attr('href', 'https://twitter.com/intent/tweet?text=' + _this.getSahreProps(index, 'tweetText') + '&url=' + (encodeURIComponent(_this.getSahreProps(index, 'twitterShareUrl') || window.location.href))); 13631 13632 $('#lg-share-googleplus').attr('href', 'https://plus.google.com/share?url=' + (encodeURIComponent(_this.getSahreProps(index, 'googleplusShareUrl') || window.location.href))); 13633 13634 $('#lg-share-pinterest').attr('href', 'http://www.pinterest.com/pin/create/button/?url=' + (encodeURIComponent(_this.getSahreProps(index, 'pinterestShareUrl') || window.location.href)) + '&media=' + encodeURIComponent(_this.getSahreProps(index, 'src')) + '&description=' + _this.getSahreProps(index, 'pinterestText')); 13635 13636 }, 100); 13637 }); 13638 }; 13639 13640 Share.prototype.getSahreProps = function(index, prop){ 13641 var shareProp = ''; 13642 if(this.core.s.dynamic) { 13643 shareProp = this.core.s.dynamicEl[index][prop]; 13644 } else { 13645 var _href = this.core.$items.eq(index).attr('href'); 13646 var _prop = this.core.$items.eq(index).data(prop); 13647 shareProp = prop === 'src' ? _href || _prop : _prop; 13648 } 13649 return shareProp; 13650 }; 13651 13652 Share.prototype.destroy = function() { 13653 13654 }; 13655 13656 $.fn.lightGallery.modules.share = Share; 13657 13658})(); 13659 13660 13661 13662})); 13663; 13664; 13665/* 13666* jQuery easyShare plugin 13667* Update on 04 april 2017 13668* Version 1.2 13669* 13670* Licensed under GPL <http://en.wikipedia.org/wiki/GNU_General_Public_License> 13671* Copyright (c) 2008, St?hane Litou <[email protected]> 13672* All rights reserved. 13673* 13674 This program is free software: you can redistribute it and/or modify 13675 it under the terms of the GNU General Public License as published by 13676 the Free Software Foundation, either version 3 of the License, or 13677 (at your option) any later version. 13678 13679 This program is distributed in the hope that it will be useful, 13680 but WITHOUT ANY WARRANTY; without even the implied warranty of 13681 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13682 GNU General Public License for more details. 13683 13684 You should have received a copy of the GNU General Public License 13685 along with this program. If not, see <http://www.gnu.org/licenses/>. 13686*/ 13687 13688(function($){ 13689$.fn.easyPaginate = function (options) { 13690 var defaults = { 13691 paginateElement: 'li', 13692 hashPage: 'page', 13693 elementsPerPage: 10, 13694 effect: 'default', 13695 slideOffset: 200, 13696 firstButton: true, 13697 firstButtonText: '<<', 13698 lastButton: true, 13699 lastButtonText: '>>', 13700 prevButton: true, 13701 prevButtonText: '<', 13702 nextButton: true, 13703 nextButtonText: '>' 13704 } 13705 13706 return this.each (function (instance) { 13707 13708 var plugin = {}; 13709 plugin.el = $(this); 13710 plugin.el.addClass('easyPaginateList'); 13711 13712 plugin.settings = { 13713 pages: 0, 13714 objElements: Object, 13715 currentPage: 1 13716 } 13717 13718 var getNbOfPages = function() { 13719 return Math.ceil(plugin.settings.objElements.length / plugin.settings.elementsPerPage); 13720 }; 13721 13722 var displayNav = function() { 13723 htmlNav = '<div class="easyPaginateNav">'; 13724 13725 if(plugin.settings.firstButton) { 13726 htmlNav += '<a href="#'+plugin.settings.hashPage+':1" title="First page" rel="1" class="first">'+plugin.settings.firstButtonText+'</a>'; 13727 } 13728 13729 if(plugin.settings.prevButton) { 13730 htmlNav += '<a href="" title="Previous" rel="" class="prev">'+plugin.settings.prevButtonText+'</a>'; 13731 } 13732 13733 for(i = 1;i <= plugin.settings.pages;i++) { 13734 htmlNav += '<a href="#'+plugin.settings.hashPage+':'+i+'" title="Page '+i+'" rel="'+i+'" class="page">'+i+'</a>'; 13735 }; 13736 13737 if(plugin.settings.nextButton) { 13738 htmlNav += '<a href="" title="Next" rel="" class="next">'+plugin.settings.nextButtonText+'</a>'; 13739 } 13740 13741 if(plugin.settings.lastButton) { 13742 htmlNav += '<a href="#'+plugin.settings.hashPage+':'+plugin.settings.pages+'" title="Last page" rel="'+plugin.settings.pages+'" class="last">'+plugin.settings.lastButtonText+'</a>'; 13743 } 13744 13745 htmlNav += '</div>'; 13746 plugin.nav = $(htmlNav); 13747 plugin.nav.css({ 13748 'width': plugin.el.width() 13749 }); 13750 plugin.el.after(plugin.nav); 13751 13752 var elSelector = '#' + plugin.el.get(0).id + ' + '; 13753 $(elSelector + ' .easyPaginateNav a.page,' 13754 + elSelector + ' .easyPaginateNav a.first,' 13755 + elSelector + ' .easyPaginateNav a.last').on('click', function(e) { 13756 e.preventDefault(); 13757 displayPage($(this).attr('rel')); 13758 }); 13759 13760 $(elSelector + ' .easyPaginateNav a.prev').on('click', function(e) { 13761 e.preventDefault(); 13762 page = plugin.settings.currentPage > 1?parseInt(plugin.settings.currentPage) - 1:1; 13763 displayPage(page); 13764 }); 13765 13766 $(elSelector + ' .easyPaginateNav a.next').on('click', function(e) { 13767 e.preventDefault(); 13768 page = plugin.settings.currentPage < plugin.settings.pages?parseInt(plugin.settings.currentPage) + 1:plugin.settings.pages; 13769 displayPage(page); 13770 }); 13771 }; 13772 13773 var displayPage = function(page, forceEffect) { 13774 if(plugin.settings.currentPage != page) { 13775 plugin.settings.currentPage = parseInt(page); 13776 offsetStart = (page - 1) * plugin.settings.elementsPerPage; 13777 offsetEnd = page * plugin.settings.elementsPerPage; 13778 if(typeof(forceEffect) != 'undefined') { 13779 eval("transition_"+forceEffect+"("+offsetStart+", "+offsetEnd+")"); 13780 }else { 13781 eval("transition_"+plugin.settings.effect+"("+offsetStart+", "+offsetEnd+")"); 13782 } 13783 13784 plugin.nav.find('.current').removeClass('current'); 13785 plugin.nav.find('a.page:eq('+(page - 1)+')').addClass('current'); 13786 13787 switch(plugin.settings.currentPage) { 13788 case 1: 13789 $('.easyPaginateNav a', plugin).removeClass('disabled'); 13790 $('.easyPaginateNav a.first, .easyPaginateNav a.prev', plugin).addClass('disabled'); 13791 break; 13792 case plugin.settings.pages: 13793 $('.easyPaginateNav a', plugin).removeClass('disabled'); 13794 $('.easyPaginateNav a.last, .easyPaginateNav a.next', plugin).addClass('disabled'); 13795 break; 13796 default: 13797 $('.easyPaginateNav a', plugin).removeClass('disabled'); 13798 break; 13799 } 13800 } 13801 }; 13802 13803 var transition_default = function(offsetStart, offsetEnd) { 13804 plugin.currentElements.hide(); 13805 plugin.currentElements = plugin.settings.objElements.slice(offsetStart, offsetEnd).clone(); 13806 plugin.el.html(plugin.currentElements); 13807 plugin.currentElements.show(); 13808 }; 13809 13810 var transition_fade = function(offsetStart, offsetEnd) { 13811 plugin.currentElements.fadeOut(); 13812 plugin.currentElements = plugin.settings.objElements.slice(offsetStart, offsetEnd).clone(); 13813 plugin.el.html(plugin.currentElements); 13814 plugin.currentElements.fadeIn(); 13815 }; 13816 13817 var transition_slide = function(offsetStart, offsetEnd) { 13818 plugin.currentElements.animate({ 13819 'margin-left': plugin.settings.slideOffset * -1, 13820 'opacity': 0 13821 }, function() { 13822 $(this).remove(); 13823 }); 13824 13825 plugin.currentElements = plugin.settings.objElements.slice(offsetStart, offsetEnd).clone(); 13826 plugin.currentElements.css({ 13827 'margin-left': plugin.settings.slideOffset, 13828 'display': 'block', 13829 'opacity': 0, 13830 'min-width': plugin.el.width() / 2 13831 }); 13832 plugin.el.html(plugin.currentElements); 13833 plugin.currentElements.animate({ 13834 'margin-left': 0, 13835 'opacity': 1 13836 }); 13837 }; 13838 13839 var transition_climb = function(offsetStart, offsetEnd) { 13840 plugin.currentElements.each(function(i) { 13841 var $objThis = $(this); 13842 setTimeout(function() { 13843 $objThis.animate({ 13844 'margin-left': plugin.settings.slideOffset * -1, 13845 'opacity': 0 13846 }, function() { 13847 $(this).remove(); 13848 }); 13849 }, i * 200); 13850 }); 13851 13852 plugin.currentElements = plugin.settings.objElements.slice(offsetStart, offsetEnd).clone(); 13853 plugin.currentElements.css({ 13854 'margin-left': plugin.settings.slideOffset, 13855 'display': 'block', 13856 'opacity': 0, 13857 'min-width': plugin.el.width() / 2 13858 }); 13859 plugin.el.html(plugin.currentElements); 13860 plugin.currentElements.each(function(i) { 13861 var $objThis = $(this); 13862 setTimeout(function() { 13863 $objThis.animate({ 13864 'margin-left': 0, 13865 'opacity': 1 13866 }); 13867 }, i * 200); 13868 }); 13869 }; 13870 13871 plugin.settings = $.extend({}, defaults, options); 13872 13873 plugin.currentElements = $([]); 13874 plugin.settings.objElements = plugin.el.find(plugin.settings.paginateElement); 13875 plugin.settings.pages = getNbOfPages(); 13876 if(plugin.settings.pages > 1) { 13877 plugin.el.html(); 13878 13879 // Here we go 13880 displayNav(); 13881 13882 page = 1; 13883 if(document.location.hash.indexOf('#'+plugin.settings.hashPage+':') != -1) { 13884 page = parseInt(document.location.hash.replace('#'+plugin.settings.hashPage+':', '')); 13885 if(page.length <= 0 || page < 1 || page > plugin.settings.pages) { 13886 page = 1; 13887 } 13888 } 13889 13890 displayPage(page, 'default'); 13891 } 13892 }); 13893}; 13894})(jQuery); 13895;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.