diff --git a/bower.json b/bower.json index 84dbd910..e9c3a252 100644 --- a/bower.json +++ b/bower.json @@ -26,7 +26,7 @@ ], "dependencies": { "h5p-php-library": "https://github.com/h5p/h5p-php-library.git", - "jquery": "~2.1.4", + "jquery": "~3.3.1", "toposort": "~1.0.1" } } diff --git a/dist/fonts/h5p-core-18.eot b/dist/fonts/h5p-core-18.eot new file mode 100755 index 00000000..eba9d6cc Binary files /dev/null and b/dist/fonts/h5p-core-18.eot differ diff --git a/dist/fonts/h5p-core-18.svg b/dist/fonts/h5p-core-18.svg new file mode 100755 index 00000000..13da36eb --- /dev/null +++ b/dist/fonts/h5p-core-18.svg @@ -0,0 +1,52 @@ + + + + + + +{ + "fontFamily": "h5p", + "description": "Font generated by IcoMoon.", + "majorVersion": 1, + "minorVersion": 1, + "version": "Version 1.1", + "fontId": "h5p", + "psName": "h5p", + "subFamily": "Regular", + "fullName": "h5p" +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dist/fonts/h5p-core-18.ttf b/dist/fonts/h5p-core-18.ttf new file mode 100755 index 00000000..37f845e0 Binary files /dev/null and b/dist/fonts/h5p-core-18.ttf differ diff --git a/dist/fonts/h5p-core-18.woff b/dist/fonts/h5p-core-18.woff new file mode 100755 index 00000000..8450f3d5 Binary files /dev/null and b/dist/fonts/h5p-core-18.woff differ diff --git a/dist/fonts/h5p.eot b/dist/fonts/h5p.eot deleted file mode 100644 index 2c68dc55..00000000 Binary files a/dist/fonts/h5p.eot and /dev/null differ diff --git a/dist/fonts/h5p.svg b/dist/fonts/h5p.svg deleted file mode 100644 index 20871539..00000000 --- a/dist/fonts/h5p.svg +++ /dev/null @@ -1,23 +0,0 @@ - - - -Generated by IcoMoon - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/dist/fonts/h5p.ttf b/dist/fonts/h5p.ttf deleted file mode 100644 index 81d242f3..00000000 Binary files a/dist/fonts/h5p.ttf and /dev/null differ diff --git a/dist/js/h5p-standalone-frame.js b/dist/js/h5p-standalone-frame.js index b9d3912f..1c107c0c 100644 --- a/dist/js/h5p-standalone-frame.js +++ b/dist/js/h5p-standalone-frame.js @@ -1,20 +1,22 @@ /*! - * jQuery JavaScript Library v2.1.4 - * http://jquery.com/ + * jQuery JavaScript Library v3.3.1 + * https://jquery.com/ * * Includes Sizzle.js - * http://sizzlejs.com/ + * https://sizzlejs.com/ * - * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors + * Copyright JS Foundation and other contributors * Released under the MIT license - * http://jquery.org/license + * https://jquery.org/license * - * Date: 2015-04-28T16:01Z + * Date: 2018-01-20T17:24Z */ +( function( global, factory ) { -(function( global, factory ) { + "use strict"; if ( typeof module === "object" && typeof module.exports === "object" ) { + // For CommonJS and CommonJS-like environments where a proper `window` // is present, execute the factory and get jQuery. // For environments that do not have a `window` with a `document` @@ -35,16 +37,20 @@ } // Pass this if window is not defined yet -}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { +} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { -// Support: Firefox 18+ -// Can't be in strict mode, several libs including ASP.NET trace -// the stack via arguments.caller.callee and Firefox dies if -// you try to trace through "use strict" call chains. (#13335) -// +// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 +// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode +// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common +// enough that all such attempts are guarded in a try block. +"use strict"; var arr = []; +var document = window.document; + +var getProto = Object.getPrototypeOf; + var slice = arr.slice; var concat = arr.concat; @@ -59,45 +65,91 @@ var toString = class2type.toString; var hasOwn = class2type.hasOwnProperty; +var fnToString = hasOwn.toString; + +var ObjectFunctionString = fnToString.call( Object ); + var support = {}; +var isFunction = function isFunction( obj ) { + + // Support: Chrome <=57, Firefox <=52 + // In some browsers, typeof returns "function" for HTML elements + // (i.e., `typeof document.createElement( "object" ) === "function"`). + // We don't want to classify *any* DOM node as a function. + return typeof obj === "function" && typeof obj.nodeType !== "number"; + }; + + +var isWindow = function isWindow( obj ) { + return obj != null && obj === obj.window; + }; + + + + + var preservedScriptAttributes = { + type: true, + src: true, + noModule: true + }; + + function DOMEval( code, doc, node ) { + doc = doc || document; + + var i, + script = doc.createElement( "script" ); + + script.text = code; + if ( node ) { + for ( i in preservedScriptAttributes ) { + if ( node[ i ] ) { + script[ i ] = node[ i ]; + } + } + } + doc.head.appendChild( script ).parentNode.removeChild( script ); + } + + +function toType( obj ) { + if ( obj == null ) { + return obj + ""; + } + + // Support: Android <=2.3 only (functionish RegExp) + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call( obj ) ] || "object" : + typeof obj; +} +/* global Symbol */ +// Defining this global in .eslintrc.json would create a danger of using the global +// unguarded in another place, it seems safer to define global only for this module -var - // Use the correct document accordingly with window argument (sandbox) - document = window.document, - version = "2.1.4", +var + version = "3.3.1", // Define a local copy of jQuery jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' // Need init if jQuery is called (just allow error to be thrown if not included) return new jQuery.fn.init( selector, context ); }, - // Support: Android<4.1 + // Support: Android <=4.0 only // Make sure we trim BOM and NBSP - rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, - - // Matches dashed string for camelizing - rmsPrefix = /^-ms-/, - rdashAlpha = /-([\da-z])/gi, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return letter.toUpperCase(); - }; + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; jQuery.fn = jQuery.prototype = { + // The current version of jQuery being used jquery: version, constructor: jQuery, - // Start with an empty selector - selector: "", - // The default length of a jQuery object is 0 length: 0, @@ -108,13 +160,14 @@ jQuery.fn = jQuery.prototype = { // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { - return num != null ? - // Return just the one element from the set - ( num < 0 ? this[ num + this.length ] : this[ num ] ) : + // Return all the elements in a clean array + if ( num == null ) { + return slice.call( this ); + } - // Return all the elements in a clean array - slice.call( this ); + // Return just the one element from the set + return num < 0 ? this[ num + this.length ] : this[ num ]; }, // Take an array of elements and push it onto the stack @@ -126,23 +179,20 @@ jQuery.fn = jQuery.prototype = { // Add the old object onto the stack (as a reference) ret.prevObject = this; - ret.context = this.context; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); + each: function( callback ) { + return jQuery.each( this, callback ); }, map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { + return this.pushStack( jQuery.map( this, function( elem, i ) { return callback.call( elem, i, elem ); - })); + } ) ); }, slice: function() { @@ -160,11 +210,11 @@ jQuery.fn = jQuery.prototype = { eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); + return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); }, end: function() { - return this.prevObject || this.constructor(null); + return this.prevObject || this.constructor(); }, // For internal use only. @@ -176,7 +226,7 @@ jQuery.fn = jQuery.prototype = { jQuery.extend = jQuery.fn.extend = function() { var options, name, src, copy, copyIsArray, clone, - target = arguments[0] || {}, + target = arguments[ 0 ] || {}, i = 1, length = arguments.length, deep = false; @@ -191,7 +241,7 @@ jQuery.extend = jQuery.fn.extend = function() { } // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + if ( typeof target !== "object" && !isFunction( target ) ) { target = {}; } @@ -202,8 +252,10 @@ jQuery.extend = jQuery.fn.extend = function() { } for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { + if ( ( options = arguments[ i ] ) != null ) { + // Extend the base object for ( name in options ) { src = target[ name ]; @@ -215,13 +267,15 @@ jQuery.extend = jQuery.fn.extend = function() { } // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { + if ( deep && copy && ( jQuery.isPlainObject( copy ) || + ( copyIsArray = Array.isArray( copy ) ) ) ) { + if ( copyIsArray ) { copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; + clone = src && Array.isArray( src ) ? src : []; } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; + clone = src && jQuery.isPlainObject( src ) ? src : {}; } // Never move original objects, clone them @@ -239,7 +293,8 @@ jQuery.extend = jQuery.fn.extend = function() { return target; }; -jQuery.extend({ +jQuery.extend( { + // Unique for each copy of jQuery on the page expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), @@ -252,138 +307,58 @@ jQuery.extend({ noop: function() {}, - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray, - - isWindow: function( obj ) { - return obj != null && obj === obj.window; - }, - - isNumeric: function( obj ) { - // parseFloat NaNs numeric-cast false positives (null|true|false|"") - // ...but misinterprets leading-number strings, particularly hex literals ("0x...") - // subtraction forces infinities to NaN - // adding 1 corrects loss of precision from parseFloat (#15100) - return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0; - }, - isPlainObject: function( obj ) { - // Not plain objects: - // - Any object or value whose internal [[Class]] property is not "[object Object]" - // - DOM nodes - // - window - if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + var proto, Ctor; + + // Detect obvious negatives + // Use toString instead of jQuery.type to catch host objects + if ( !obj || toString.call( obj ) !== "[object Object]" ) { return false; } - if ( obj.constructor && - !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) { - return false; + proto = getProto( obj ); + + // Objects with no prototype (e.g., `Object.create( null )`) are plain + if ( !proto ) { + return true; } - // If the function hasn't returned already, we're confident that - // |obj| is a plain object, created by {} or constructed with new Object - return true; + // Objects with prototype are plain iff they were constructed by a global Object function + Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; + return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; }, isEmptyObject: function( obj ) { + + /* eslint-disable no-unused-vars */ + // See https://github.com/eslint/eslint/issues/6125 var name; + for ( name in obj ) { return false; } return true; }, - type: function( obj ) { - if ( obj == null ) { - return obj + ""; - } - // Support: Android<4.0, iOS<6 (functionish RegExp) - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call(obj) ] || "object" : - typeof obj; - }, - // Evaluates a script in a global context globalEval: function( code ) { - var script, - indirect = eval; - - code = jQuery.trim( code ); - - if ( code ) { - // If the code includes a valid, prologue position - // strict mode pragma, execute code by injecting a - // script tag into the document. - if ( code.indexOf("use strict") === 1 ) { - script = document.createElement("script"); - script.text = code; - document.head.appendChild( script ).parentNode.removeChild( script ); - } else { - // Otherwise, avoid the DOM node creation, insertion - // and removal by using an indirect global eval - indirect( code ); - } - } - }, - - // Convert dashed to camelCase; used by the css and data modules - // Support: IE9-11+ - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + DOMEval( code ); }, - // args is for internal usage only - each: function( obj, callback, args ) { - var value, - i = 0, - length = obj.length, - isArray = isArraylike( obj ); - - if ( args ) { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.apply( obj[ i ], args ); + each: function( obj, callback ) { + var length, i = 0; - if ( value === false ) { - break; - } + if ( isArrayLike( obj ) ) { + length = obj.length; + for ( ; i < length; i++ ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; } } - - // A special, fast, case for the most common use of each } else { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } + for ( i in obj ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; } } } @@ -391,7 +366,7 @@ jQuery.extend({ return obj; }, - // Support: Android<4.1 + // Support: Android <=4.0 only trim: function( text ) { return text == null ? "" : @@ -403,7 +378,7 @@ jQuery.extend({ var ret = results || []; if ( arr != null ) { - if ( isArraylike( Object(arr) ) ) { + if ( isArrayLike( Object( arr ) ) ) { jQuery.merge( ret, typeof arr === "string" ? [ arr ] : arr @@ -420,6 +395,8 @@ jQuery.extend({ return arr == null ? -1 : indexOf.call( arr, elem, i ); }, + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit merge: function( first, second ) { var len = +second.length, j = 0, @@ -455,14 +432,13 @@ jQuery.extend({ // arg is for internal usage only map: function( elems, callback, arg ) { - var value, + var length, value, i = 0, - length = elems.length, - isArray = isArraylike( elems ), ret = []; // Go through the array, translating each of the items to their new values - if ( isArray ) { + if ( isArrayLike( elems ) ) { + length = elems.length; for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); @@ -489,77 +465,47 @@ jQuery.extend({ // A global GUID counter for objects guid: 1, - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - var tmp, args, proxy; - - if ( typeof context === "string" ) { - tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - args = slice.call( arguments, 2 ); - proxy = function() { - return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || jQuery.guid++; - - return proxy; - }, - - now: Date.now, - // jQuery.support is not used in Core but other projects attach their // properties to it so it needs to exist. support: support -}); +} ); + +if ( typeof Symbol === "function" ) { + jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; +} // Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), +function( i, name ) { class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); +} ); -function isArraylike( obj ) { +function isArrayLike( obj ) { - // Support: iOS 8.2 (not reproducible in simulator) + // Support: real iOS 8.2 only (not reproducible in simulator) // `in` check used to prevent JIT error (gh-2145) // hasOwn isn't used here due to false negatives // regarding Nodelist length in IE - var length = "length" in obj && obj.length, - type = jQuery.type( obj ); + var length = !!obj && "length" in obj && obj.length, + type = toType( obj ); - if ( type === "function" || jQuery.isWindow( obj ) ) { + if ( isFunction( obj ) || isWindow( obj ) ) { return false; } - if ( obj.nodeType === 1 && length ) { - return true; - } - return type === "array" || length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj; } var Sizzle = /*! - * Sizzle CSS Selector Engine v2.2.0-pre - * http://sizzlejs.com/ + * Sizzle CSS Selector Engine v2.3.3 + * https://sizzlejs.com/ * - * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors + * Copyright jQuery Foundation and other contributors * Released under the MIT license * http://jquery.org/license * - * Date: 2014-12-16 + * Date: 2016-08-08 */ (function( window ) { @@ -600,9 +546,6 @@ var i, return 0; }, - // General-purpose constants - MAX_NEGATIVE = 1 << 31, - // Instance methods hasOwn = ({}).hasOwnProperty, arr = [], @@ -611,7 +554,7 @@ var i, push = arr.push, slice = arr.slice, // Use a stripped-down indexOf as it's faster than native - // http://jsperf.com/thor-indexof-vs-for/5 + // https://jsperf.com/thor-indexof-vs-for/5 indexOf = function( list, elem ) { var i = 0, len = list.length; @@ -627,25 +570,21 @@ var i, // Regular expressions - // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace + // http://www.w3.org/TR/css3-selectors/#whitespace whitespace = "[\\x20\\t\\r\\n\\f]", - // http://www.w3.org/TR/css3-syntax/#characters - characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", - // Loosely modeled on CSS identifier characters - // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors - // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = characterEncoding.replace( "w", "w#" ), + // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+", // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + + attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + // Operator (capture 2) "*([*^$|!~]?=)" + whitespace + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]", - pseudos = ":(" + characterEncoding + ")(?:\\((" + + pseudos = ":(" + identifier + ")(?:\\((" + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: // 1. quoted (capture 3; capture 4 or capture 5) "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + @@ -668,9 +607,9 @@ var i, ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { - "ID": new RegExp( "^#(" + characterEncoding + ")" ), - "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), - "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), + "ID": new RegExp( "^#(" + identifier + ")" ), + "CLASS": new RegExp( "^\\.(" + identifier + ")" ), + "TAG": new RegExp( "^(" + identifier + "|[*])" ), "ATTR": new RegExp( "^" + attributes ), "PSEUDO": new RegExp( "^" + pseudos ), "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + @@ -692,9 +631,9 @@ var i, rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, - rescape = /'|\\/g, - // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + // CSS escapes + // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), funescape = function( _, escaped, escapedWhitespace ) { var high = "0x" + escaped - 0x10000; @@ -710,13 +649,39 @@ var i, String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }, + // CSS string/identifier serialization + // https://drafts.csswg.org/cssom/#common-serializing-idioms + rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, + fcssescape = function( ch, asCodePoint ) { + if ( asCodePoint ) { + + // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER + if ( ch === "\0" ) { + return "\uFFFD"; + } + + // Control characters and (dependent upon position) numbers get escaped as code points + return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; + } + + // Other potentially-special ASCII characters get backslash-escaped + return "\\" + ch; + }, + // Used for iframes // See setDocument() // Removing the function wrapper causes a "Permission Denied" // error in IE unloadHandler = function() { setDocument(); - }; + }, + + disabledAncestor = addCombinator( + function( elem ) { + return elem.disabled === true && ("form" in elem || "label" in elem); + }, + { dir: "parentNode", next: "legend" } + ); // Optimize for push.apply( _, NodeList ) try { @@ -748,103 +713,128 @@ try { } function Sizzle( selector, context, results, seed ) { - var match, elem, m, nodeType, - // QSA vars - i, groups, old, nid, newContext, newSelector; + var m, i, elem, nid, match, groups, newSelector, + newContext = context && context.ownerDocument, - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } + // nodeType defaults to 9, since context defaults to document + nodeType = context ? context.nodeType : 9; - context = context || document; results = results || []; - nodeType = context.nodeType; + // Return early from calls with invalid selector or context if ( typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { return results; } - if ( !seed && documentIsHTML ) { - - // Try to shortcut find operations when possible (e.g., not under DocumentFragment) - if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { - // Speed-up: Sizzle("#ID") - if ( (m = match[1]) ) { - if ( nodeType === 9 ) { - elem = context.getElementById( m ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document (jQuery #6963) - if ( elem && elem.parentNode ) { - // Handle the case where IE, Opera, and Webkit return items - // by name instead of ID - if ( elem.id === m ) { - results.push( elem ); + // Try to shortcut find operations (as opposed to filters) in HTML documents + if ( !seed ) { + + if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { + setDocument( context ); + } + context = context || document; + + if ( documentIsHTML ) { + + // If the selector is sufficiently simple, try using a "get*By*" DOM method + // (excepting DocumentFragment context, where the methods don't exist) + if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { + + // ID selector + if ( (m = match[1]) ) { + + // Document context + if ( nodeType === 9 ) { + if ( (elem = context.getElementById( m )) ) { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { return results; } + + // Element context } else { - return results; - } - } else { - // Context is not a document - if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && - contains( context, elem ) && elem.id === m ) { - results.push( elem ); - return results; + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( newContext && (elem = newContext.getElementById( m )) && + contains( context, elem ) && + elem.id === m ) { + + results.push( elem ); + return results; + } } - } - // Speed-up: Sizzle("TAG") - } else if ( match[2] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; + // Type selector + } else if ( match[2] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; - // Speed-up: Sizzle(".CLASS") - } else if ( (m = match[3]) && support.getElementsByClassName ) { - push.apply( results, context.getElementsByClassName( m ) ); - return results; + // Class selector + } else if ( (m = match[3]) && support.getElementsByClassName && + context.getElementsByClassName ) { + + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } } - } - // QSA path - if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { - nid = old = expando; - newContext = context; - newSelector = nodeType !== 1 && selector; + // Take advantage of querySelectorAll + if ( support.qsa && + !compilerCache[ selector + " " ] && + (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - groups = tokenize( selector ); + if ( nodeType !== 1 ) { + newContext = context; + newSelector = selector; - if ( (old = context.getAttribute("id")) ) { - nid = old.replace( rescape, "\\$&" ); - } else { - context.setAttribute( "id", nid ); - } - nid = "[id='" + nid + "'] "; + // qSA looks outside Element context, which is not what we want + // Thanks to Andrew Dupont for this workaround technique + // Support: IE <=8 + // Exclude object elements + } else if ( context.nodeName.toLowerCase() !== "object" ) { - i = groups.length; - while ( i-- ) { - groups[i] = nid + toSelector( groups[i] ); + // Capture the context ID, setting it first if necessary + if ( (nid = context.getAttribute( "id" )) ) { + nid = nid.replace( rcssescape, fcssescape ); + } else { + context.setAttribute( "id", (nid = expando) ); + } + + // Prefix every selector in the list + groups = tokenize( selector ); + i = groups.length; + while ( i-- ) { + groups[i] = "#" + nid + " " + toSelector( groups[i] ); + } + newSelector = groups.join( "," ); + + // Expand context for sibling selectors + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || + context; } - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; - newSelector = groups.join(","); - } - if ( newSelector ) { - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch(qsaError) { - } finally { - if ( !old ) { - context.removeAttribute("id"); + if ( newSelector ) { + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch ( qsaError ) { + } finally { + if ( nid === expando ) { + context.removeAttribute( "id" ); + } } } } @@ -857,7 +847,7 @@ function Sizzle( selector, context, results, seed ) { /** * Create key-value caches of limited size - * @returns {Function(string, Object)} Returns the Object data after storing it on itself with + * @returns {function(string, object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ @@ -886,22 +876,22 @@ function markFunction( fn ) { /** * Support testing using an element - * @param {Function} fn Passed the created div and expects a boolean result + * @param {Function} fn Passed the created element and returns a boolean result */ function assert( fn ) { - var div = document.createElement("div"); + var el = document.createElement("fieldset"); try { - return !!fn( div ); + return !!fn( el ); } catch (e) { return false; } finally { // Remove from its parent by default - if ( div.parentNode ) { - div.parentNode.removeChild( div ); + if ( el.parentNode ) { + el.parentNode.removeChild( el ); } // release memory in IE - div = null; + el = null; } } @@ -912,7 +902,7 @@ function assert( fn ) { */ function addHandle( attrs, handler ) { var arr = attrs.split("|"), - i = attrs.length; + i = arr.length; while ( i-- ) { Expr.attrHandle[ arr[i] ] = handler; @@ -928,8 +918,7 @@ function addHandle( attrs, handler ) { function siblingCheck( a, b ) { var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && - ( ~b.sourceIndex || MAX_NEGATIVE ) - - ( ~a.sourceIndex || MAX_NEGATIVE ); + a.sourceIndex - b.sourceIndex; // Use IE sourceIndex if available on both nodes if ( diff ) { @@ -970,6 +959,62 @@ function createButtonPseudo( type ) { }; } +/** + * Returns a function to use in pseudos for :enabled/:disabled + * @param {Boolean} disabled true for :disabled; false for :enabled + */ +function createDisabledPseudo( disabled ) { + + // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable + return function( elem ) { + + // Only certain elements can match :enabled or :disabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled + if ( "form" in elem ) { + + // Check for inherited disabledness on relevant non-disabled elements: + // * listed form-associated elements in a disabled fieldset + // https://html.spec.whatwg.org/multipage/forms.html#category-listed + // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled + // * option elements in a disabled optgroup + // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled + // All such elements have a "form" property. + if ( elem.parentNode && elem.disabled === false ) { + + // Option elements defer to a parent optgroup if present + if ( "label" in elem ) { + if ( "label" in elem.parentNode ) { + return elem.parentNode.disabled === disabled; + } else { + return elem.disabled === disabled; + } + } + + // Support: IE 6 - 11 + // Use the isDisabled shortcut property to check for disabled fieldset ancestors + return elem.isDisabled === disabled || + + // Where there is no isDisabled, check manually + /* jshint -W018 */ + elem.isDisabled !== !disabled && + disabledAncestor( elem ) === disabled; + } + + return elem.disabled === disabled; + + // Try to winnow out elements that can't be disabled before trusting the disabled property. + // Some victims get caught in our net (label, legend, menu, track), but it shouldn't + // even exist on them, let alone have a boolean value. + } else if ( "label" in elem ) { + return elem.disabled === disabled; + } + + // Remaining elements are neither :enabled nor :disabled + return false; + }; +} + /** * Returns a function to use in pseudos for positionals * @param {Function} fn @@ -1022,96 +1067,119 @@ isXML = Sizzle.isXML = function( elem ) { * @returns {Object} Returns the current document */ setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, parent, + var hasCompare, subWindow, doc = node ? node.ownerDocument || node : preferredDoc; - // If no document and documentElement is available, return + // Return early if doc is invalid or already selected if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } - // Set our document + // Update global variables document = doc; - docElem = doc.documentElement; - parent = doc.defaultView; + docElem = document.documentElement; + documentIsHTML = !isXML( document ); + + // Support: IE 9-11, Edge + // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) + if ( preferredDoc !== document && + (subWindow = document.defaultView) && subWindow.top !== subWindow ) { + + // Support: IE 11, Edge + if ( subWindow.addEventListener ) { + subWindow.addEventListener( "unload", unloadHandler, false ); - // Support: IE>8 - // If iframe document is assigned to "document" variable and if iframe has been reloaded, - // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 - // IE6-8 do not support the defaultView property so parent will be undefined - if ( parent && parent !== parent.top ) { - // IE11 does not have attachEvent, so all must suffer - if ( parent.addEventListener ) { - parent.addEventListener( "unload", unloadHandler, false ); - } else if ( parent.attachEvent ) { - parent.attachEvent( "onunload", unloadHandler ); + // Support: IE 9 - 10 only + } else if ( subWindow.attachEvent ) { + subWindow.attachEvent( "onunload", unloadHandler ); } } - /* Support tests - ---------------------------------------------------------------------- */ - documentIsHTML = !isXML( doc ); - /* Attributes ---------------------------------------------------------------------- */ // Support: IE<8 // Verify that getAttribute really returns attributes and not properties // (excepting IE8 booleans) - support.attributes = assert(function( div ) { - div.className = "i"; - return !div.getAttribute("className"); + support.attributes = assert(function( el ) { + el.className = "i"; + return !el.getAttribute("className"); }); /* getElement(s)By* ---------------------------------------------------------------------- */ // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert(function( div ) { - div.appendChild( doc.createComment("") ); - return !div.getElementsByTagName("*").length; + support.getElementsByTagName = assert(function( el ) { + el.appendChild( document.createComment("") ); + return !el.getElementsByTagName("*").length; }); // Support: IE<9 - support.getElementsByClassName = rnative.test( doc.getElementsByClassName ); + support.getElementsByClassName = rnative.test( document.getElementsByClassName ); // Support: IE<10 // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programatically-set names, + // The broken getElementById methods don't pick up programmatically-set names, // so use a roundabout getElementsByName test - support.getById = assert(function( div ) { - docElem.appendChild( div ).id = expando; - return !doc.getElementsByName || !doc.getElementsByName( expando ).length; + support.getById = assert(function( el ) { + docElem.appendChild( el ).id = expando; + return !document.getElementsByName || !document.getElementsByName( expando ).length; }); - // ID find and filter + // ID filter and find if ( support.getById ) { - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var m = context.getElementById( id ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [ m ] : []; - } - }; Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { return elem.getAttribute("id") === attrId; }; }; + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var elem = context.getElementById( id ); + return elem ? [ elem ] : []; + } + }; } else { - // Support: IE6/7 - // getElementById is not reliable as a find shortcut - delete Expr.find["ID"]; - Expr.filter["ID"] = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { - var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + var node = typeof elem.getAttributeNode !== "undefined" && + elem.getAttributeNode("id"); return node && node.value === attrId; }; }; + + // Support: IE 6 - 7 only + // getElementById is not reliable as a find shortcut + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var node, i, elems, + elem = context.getElementById( id ); + + if ( elem ) { + + // Verify the id attribute + node = elem.getAttributeNode("id"); + if ( node && node.value === id ) { + return [ elem ]; + } + + // Fall back on getElementsByName + elems = context.getElementsByName( id ); + i = 0; + while ( (elem = elems[i++]) ) { + node = elem.getAttributeNode("id"); + if ( node && node.value === id ) { + return [ elem ]; + } + } + } + + return []; + } + }; } // Tag @@ -1148,7 +1216,7 @@ setDocument = Sizzle.setDocument = function( node ) { // Class Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { - if ( documentIsHTML ) { + if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { return context.getElementsByClassName( className ); } }; @@ -1165,77 +1233,87 @@ setDocument = Sizzle.setDocument = function( node ) { // We allow this because of a bug in IE8/9 that throws an error // whenever `document.activeElement` is accessed on an iframe // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See http://bugs.jquery.com/ticket/13378 + // See https://bugs.jquery.com/ticket/13378 rbuggyQSA = []; - if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { + if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { // Build QSA regex // Regex strategy adopted from Diego Perini - assert(function( div ) { + assert(function( el ) { // Select is set to empty string on purpose // This is to test IE's treatment of not explicitly // setting a boolean content attribute, // since its presence should be enough - // http://bugs.jquery.com/ticket/12359 - docElem.appendChild( div ).innerHTML = "" + - "" + ""; // Support: IE8, Opera 11-12.16 // Nothing should be selected when empty strings follow ^= or $= or *= // The test attribute must be unknown in Opera but "safe" for WinRT - // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( div.querySelectorAll("[msallowcapture^='']").length ) { + // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section + if ( el.querySelectorAll("[msallowcapture^='']").length ) { rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); } // Support: IE8 // Boolean attributes and "value" are not treated correctly - if ( !div.querySelectorAll("[selected]").length ) { + if ( !el.querySelectorAll("[selected]").length ) { rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); } - // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+ - if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { + // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ + if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { rbuggyQSA.push("~="); } // Webkit/Opera - :checked should return selected option elements // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":checked").length ) { + if ( !el.querySelectorAll(":checked").length ) { rbuggyQSA.push(":checked"); } // Support: Safari 8+, iOS 8+ // https://bugs.webkit.org/show_bug.cgi?id=136851 - // In-page `selector#id sibing-combinator selector` fails - if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) { + // In-page `selector#id sibling-combinator selector` fails + if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { rbuggyQSA.push(".#.+[+~]"); } }); - assert(function( div ) { + assert(function( el ) { + el.innerHTML = "" + + ""; + // Support: Windows 8 Native Apps // The type and name attributes are restricted during .innerHTML assignment - var input = doc.createElement("input"); + var input = document.createElement("input"); input.setAttribute( "type", "hidden" ); - div.appendChild( input ).setAttribute( "name", "D" ); + el.appendChild( input ).setAttribute( "name", "D" ); // Support: IE8 // Enforce case-sensitivity of name attribute - if ( div.querySelectorAll("[name=d]").length ) { + if ( el.querySelectorAll("[name=d]").length ) { rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); } // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":enabled").length ) { + if ( el.querySelectorAll(":enabled").length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Support: IE9-11+ + // IE's :disabled selector does not pick up the children of disabled fieldsets + docElem.appendChild( el ).disabled = true; + if ( el.querySelectorAll(":disabled").length !== 2 ) { rbuggyQSA.push( ":enabled", ":disabled" ); } // Opera 10-11 does not throw on post-comma invalid pseudos - div.querySelectorAll("*,:x"); + el.querySelectorAll("*,:x"); rbuggyQSA.push(",.*:"); }); } @@ -1246,14 +1324,14 @@ setDocument = Sizzle.setDocument = function( node ) { docElem.oMatchesSelector || docElem.msMatchesSelector) )) ) { - assert(function( div ) { + assert(function( el ) { // Check to see if it's possible to do matchesSelector // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( div, "div" ); + support.disconnectedMatch = matches.call( el, "*" ); // This should fail with an exception // Gecko does not error, returns false instead - matches.call( div, "[s!='']:x" ); + matches.call( el, "[s!='']:x" ); rbuggyMatches.push( "!=", pseudos ); }); } @@ -1266,7 +1344,7 @@ setDocument = Sizzle.setDocument = function( node ) { hasCompare = rnative.test( docElem.compareDocumentPosition ); // Element contains another - // Purposefully does not implement inclusive descendent + // Purposefully self-exclusive // As in, an element does not contain itself contains = hasCompare || rnative.test( docElem.contains ) ? function( a, b ) { @@ -1320,10 +1398,10 @@ setDocument = Sizzle.setDocument = function( node ) { (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { // Choose the first element that is related to our preferred document - if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { + if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { return -1; } - if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { + if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { return 1; } @@ -1351,8 +1429,8 @@ setDocument = Sizzle.setDocument = function( node ) { // Parentless nodes are either documents or disconnected if ( !aup || !bup ) { - return a === doc ? -1 : - b === doc ? 1 : + return a === document ? -1 : + b === document ? 1 : aup ? -1 : bup ? 1 : sortInput ? @@ -1389,7 +1467,7 @@ setDocument = Sizzle.setDocument = function( node ) { 0; }; - return doc; + return document; }; Sizzle.matches = function( expr, elements ) { @@ -1406,6 +1484,7 @@ Sizzle.matchesSelector = function( elem, expr ) { expr = expr.replace( rattributeQuotes, "='$1']" ); if ( support.matchesSelector && documentIsHTML && + !compilerCache[ expr + " " ] && ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { @@ -1454,6 +1533,10 @@ Sizzle.attr = function( elem, name ) { null; }; +Sizzle.escape = function( sel ) { + return (sel + "").replace( rcssescape, fcssescape ); +}; + Sizzle.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; @@ -1679,11 +1762,12 @@ Expr = Sizzle.selectors = { } : function( elem, context, xml ) { - var cache, outerCache, node, diff, nodeIndex, start, + var cache, uniqueCache, outerCache, node, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType; + useCache = !xml && !ofType, + diff = false; if ( parent ) { @@ -1692,7 +1776,10 @@ Expr = Sizzle.selectors = { while ( dir ) { node = elem; while ( (node = node[ dir ]) ) { - if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { + if ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) { + return false; } } @@ -1706,11 +1793,21 @@ Expr = Sizzle.selectors = { // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { + // Seek `elem` from a previously-cached index - outerCache = parent[ expando ] || (parent[ expando ] = {}); - cache = outerCache[ type ] || []; - nodeIndex = cache[0] === dirruns && cache[1]; - diff = cache[0] === dirruns && cache[2]; + + // ...in a gzip-friendly way + node = parent; + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex && cache[ 2 ]; node = nodeIndex && parent.childNodes[ nodeIndex ]; while ( (node = ++nodeIndex && node && node[ dir ] || @@ -1720,29 +1817,55 @@ Expr = Sizzle.selectors = { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { - outerCache[ type ] = [ dirruns, nodeIndex, diff ]; + uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; break; } } - // Use previously-cached element index if available - } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { - diff = cache[1]; - - // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) } else { - // Use the same loop as above to seek `elem` from the start - while ( (node = ++nodeIndex && node && node[ dir ] || - (diff = nodeIndex = 0) || start.pop()) ) { + // Use previously-cached element index if available + if ( useCache ) { + // ...in a gzip-friendly way + node = elem; + outerCache = node[ expando ] || (node[ expando ] = {}); - if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { - // Cache the index of each encountered element - if ( useCache ) { - (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; - } + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); - if ( node === elem ) { - break; + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex; + } + + // xml :nth-child(...) + // or :nth-last-child(...) or :nth(-last)?-of-type(...) + if ( diff === false ) { + // Use the same loop as above to seek `elem` from the start + while ( (node = ++nodeIndex && node && node[ dir ] || + (diff = nodeIndex = 0) || start.pop()) ) { + + if ( ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) && + ++diff ) { + + // Cache the index of each encountered element + if ( useCache ) { + outerCache = node[ expando ] || (node[ expando ] = {}); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + (outerCache[ node.uniqueID ] = {}); + + uniqueCache[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } } } } @@ -1881,13 +2004,8 @@ Expr = Sizzle.selectors = { }, // Boolean properties - "enabled": function( elem ) { - return elem.disabled === false; - }, - - "disabled": function( elem ) { - return elem.disabled === true; - }, + "enabled": createDisabledPseudo( false ), + "disabled": createDisabledPseudo( true ), "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements @@ -2089,7 +2207,9 @@ function toSelector( tokens ) { function addCombinator( matcher, combinator, base ) { var dir = combinator.dir, - checkNonElements = base && dir === "parentNode", + skip = combinator.next, + key = skip || dir, + checkNonElements = base && key === "parentNode", doneName = done++; return combinator.first ? @@ -2100,14 +2220,15 @@ function addCombinator( matcher, combinator, base ) { return matcher( elem, context, xml ); } } + return false; } : // Check against all ancestor/preceding elements function( elem, context, xml ) { - var oldCache, outerCache, + var oldCache, uniqueCache, outerCache, newCache = [ dirruns, doneName ]; - // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching + // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching if ( xml ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { @@ -2120,14 +2241,21 @@ function addCombinator( matcher, combinator, base ) { while ( (elem = elem[ dir ]) ) { if ( elem.nodeType === 1 || checkNonElements ) { outerCache = elem[ expando ] || (elem[ expando ] = {}); - if ( (oldCache = outerCache[ dir ]) && + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); + + if ( skip && skip === elem.nodeName.toLowerCase() ) { + elem = elem[ dir ] || elem; + } else if ( (oldCache = uniqueCache[ key ]) && oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { // Assign to newCache so results back-propagate to previous elements return (newCache[ 2 ] = oldCache[ 2 ]); } else { // Reuse newcache so results back-propagate to previous elements - outerCache[ dir ] = newCache; + uniqueCache[ key ] = newCache; // A match means we're done; a fail means we have to keep checking if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { @@ -2137,6 +2265,7 @@ function addCombinator( matcher, combinator, base ) { } } } + return false; }; } @@ -2352,18 +2481,21 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) { len = elems.length; if ( outermost ) { - outermostContext = context !== document && context; + outermostContext = context === document || context || outermost; } // Add elements passing elementMatchers directly to results - // Keep `i` a string if there are no elements so `matchedCount` will be "00" below // Support: IE<9, Safari // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id for ( ; i !== len && (elem = elems[i]) != null; i++ ) { if ( byElement && elem ) { j = 0; + if ( !context && elem.ownerDocument !== document ) { + setDocument( elem ); + xml = !documentIsHTML; + } while ( (matcher = elementMatchers[j++]) ) { - if ( matcher( elem, context, xml ) ) { + if ( matcher( elem, context || document, xml) ) { results.push( elem ); break; } @@ -2387,8 +2519,17 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) { } } - // Apply set filters to unmatched elements + // `i` is now the count of elements visited above, and adding it to `matchedCount` + // makes the latter nonnegative. matchedCount += i; + + // Apply set filters to unmatched elements + // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` + // equals `i`), unless we didn't visit _any_ elements in the above loop because we have + // no element matchers and no seed. + // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that + // case, which will result in a "00" `matchedCount` that differs from `i` but is also + // numerically zero. if ( bySet && i !== matchedCount ) { j = 0; while ( (matcher = setMatchers[j++]) ) { @@ -2480,14 +2621,14 @@ select = Sizzle.select = function( selector, context, results, seed ) { results = results || []; - // Try to minimize operations if there is no seed and only one group + // Try to minimize operations if there is only one selector in the list and no seed + // (the latter of which guarantees us context) if ( match.length === 1 ) { - // Take a shortcut and set the context if the root selector is an ID + // Reduce context if the leading compound selector is an ID tokens = match[0] = match[0].slice( 0 ); if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && - support.getById && context.nodeType === 9 && documentIsHTML && - Expr.relative[ tokens[1].type ] ) { + context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[1].type ] ) { context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; if ( !context ) { @@ -2538,7 +2679,7 @@ select = Sizzle.select = function( selector, context, results, seed ) { context, !documentIsHTML, results, - rsibling.test( selector ) && testContext( context.parentNode ) || context + !context || rsibling.test( selector ) && testContext( context.parentNode ) || context ); return results; }; @@ -2557,17 +2698,17 @@ setDocument(); // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) // Detached nodes confoundingly follow *each other* -support.sortDetached = assert(function( div1 ) { +support.sortDetached = assert(function( el ) { // Should return 1, but returns 4 (following) - return div1.compareDocumentPosition( document.createElement("div") ) & 1; + return el.compareDocumentPosition( document.createElement("fieldset") ) & 1; }); // Support: IE<8 // Prevent attribute/property "interpolation" -// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert(function( div ) { - div.innerHTML = ""; - return div.firstChild.getAttribute("href") === "#" ; +// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !assert(function( el ) { + el.innerHTML = ""; + return el.firstChild.getAttribute("href") === "#" ; }) ) { addHandle( "type|href|height|width", function( elem, name, isXML ) { if ( !isXML ) { @@ -2578,10 +2719,10 @@ if ( !assert(function( div ) { // Support: IE<9 // Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert(function( div ) { - div.innerHTML = ""; - div.firstChild.setAttribute( "value", "" ); - return div.firstChild.getAttribute( "value" ) === ""; +if ( !support.attributes || !assert(function( el ) { + el.innerHTML = ""; + el.firstChild.setAttribute( "value", "" ); + return el.firstChild.getAttribute( "value" ) === ""; }) ) { addHandle( "value", function( elem, name, isXML ) { if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { @@ -2592,8 +2733,8 @@ if ( !support.attributes || !assert(function( div ) { // Support: IE<9 // Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert(function( div ) { - return div.getAttribute("disabled") == null; +if ( !assert(function( el ) { + return el.getAttribute("disabled") == null; }) ) { addHandle( booleans, function( elem, name, isXML ) { var val; @@ -2614,50 +2755,84 @@ return Sizzle; jQuery.find = Sizzle; jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.pseudos; -jQuery.unique = Sizzle.uniqueSort; + +// Deprecated +jQuery.expr[ ":" ] = jQuery.expr.pseudos; +jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; jQuery.text = Sizzle.getText; jQuery.isXMLDoc = Sizzle.isXML; jQuery.contains = Sizzle.contains; +jQuery.escapeSelector = Sizzle.escape; -var rneedsContext = jQuery.expr.match.needsContext; - -var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); - +var dir = function( elem, dir, until ) { + var matched = [], + truncate = until !== undefined; -var risSimple = /^.[^:#\[\.,]*$/; - -// Implement the identical functionality for filter and not + while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { + if ( elem.nodeType === 1 ) { + if ( truncate && jQuery( elem ).is( until ) ) { + break; + } + matched.push( elem ); + } + } + return matched; +}; + + +var siblings = function( n, elem ) { + var matched = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + matched.push( n ); + } + } + + return matched; +}; + + +var rneedsContext = jQuery.expr.match.needsContext; + + + +function nodeName( elem, name ) { + + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + +}; +var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); + + + +// Implement the identical functionality for filter and not function winnow( elements, qualifier, not ) { - if ( jQuery.isFunction( qualifier ) ) { + if ( isFunction( qualifier ) ) { return jQuery.grep( elements, function( elem, i ) { - /* jshint -W018 */ return !!qualifier.call( elem, i, elem ) !== not; - }); - + } ); } + // Single element if ( qualifier.nodeType ) { return jQuery.grep( elements, function( elem ) { return ( elem === qualifier ) !== not; - }); - + } ); } - if ( typeof qualifier === "string" ) { - if ( risSimple.test( qualifier ) ) { - return jQuery.filter( qualifier, elements, not ); - } - - qualifier = jQuery.filter( qualifier, elements ); + // Arraylike of elements (jQuery, arguments, Array) + if ( typeof qualifier !== "string" ) { + return jQuery.grep( elements, function( elem ) { + return ( indexOf.call( qualifier, elem ) > -1 ) !== not; + } ); } - return jQuery.grep( elements, function( elem ) { - return ( indexOf.call( qualifier, elem ) >= 0 ) !== not; - }); + // Filtered directly for both simple and complex selectors + return jQuery.filter( qualifier, elements, not ); } jQuery.filter = function( expr, elems, not ) { @@ -2667,44 +2842,44 @@ jQuery.filter = function( expr, elems, not ) { expr = ":not(" + expr + ")"; } - return elems.length === 1 && elem.nodeType === 1 ? - jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : - jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - })); + if ( elems.length === 1 && elem.nodeType === 1 ) { + return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; + } + + return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { + return elem.nodeType === 1; + } ) ); }; -jQuery.fn.extend({ +jQuery.fn.extend( { find: function( selector ) { - var i, + var i, ret, len = this.length, - ret = [], self = this; if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter(function() { + return this.pushStack( jQuery( selector ).filter( function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } - }) ); + } ) ); } + ret = this.pushStack( [] ); + for ( i = 0; i < len; i++ ) { jQuery.find( selector, self[ i ], ret ); } - // Needed because $( selector, context ) becomes $( context ).find( selector ) - ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); - ret.selector = this.selector ? this.selector + " " + selector : selector; - return ret; + return len > 1 ? jQuery.uniqueSort( ret ) : ret; }, filter: function( selector ) { - return this.pushStack( winnow(this, selector || [], false) ); + return this.pushStack( winnow( this, selector || [], false ) ); }, not: function( selector ) { - return this.pushStack( winnow(this, selector || [], true) ); + return this.pushStack( winnow( this, selector || [], true ) ); }, is: function( selector ) { return !!winnow( @@ -2718,7 +2893,7 @@ jQuery.fn.extend({ false ).length; } -}); +} ); // Initialize a jQuery object @@ -2730,9 +2905,10 @@ var rootjQuery, // A simple way to check for HTML strings // Prioritize #id over to avoid XSS via location.hash (#9521) // Strict HTML recognition (#11290: must start with <) - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, + // Shortcut simple #id case for speed + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, - init = jQuery.fn.init = function( selector, context ) { + init = jQuery.fn.init = function( selector, context, root ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) @@ -2740,9 +2916,16 @@ var rootjQuery, return this; } + // Method init() accepts an alternate rootjQuery + // so migrate can support jQuery.sub (gh-2101) + root = root || rootjQuery; + // Handle HTML strings if ( typeof selector === "string" ) { - if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) { + if ( selector[ 0 ] === "<" && + selector[ selector.length - 1 ] === ">" && + selector.length >= 3 ) { + // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; @@ -2751,25 +2934,26 @@ var rootjQuery, } // Match html or make sure no context is specified for #id - if ( match && (match[1] || !context) ) { + if ( match && ( match[ 1 ] || !context ) ) { // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; + if ( match[ 1 ] ) { + context = context instanceof jQuery ? context[ 0 ] : context; // Option to run scripts is true for back-compat // Intentionally let the error be thrown if parseHTML is not present jQuery.merge( this, jQuery.parseHTML( - match[1], + match[ 1 ], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) - if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { + if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { + // Properties of context are called as methods if possible - if ( jQuery.isFunction( this[ match ] ) ) { + if ( isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes @@ -2783,24 +2967,20 @@ var rootjQuery, // HANDLE: $(#id) } else { - elem = document.getElementById( match[2] ); + elem = document.getElementById( match[ 2 ] ); + + if ( elem ) { - // Support: Blackberry 4.6 - // gEBID returns nodes no longer in the document (#6963) - if ( elem && elem.parentNode ) { // Inject the element directly into the jQuery object + this[ 0 ] = elem; this.length = 1; - this[0] = elem; } - - this.context = document; - this.selector = selector; return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { - return ( context || rootjQuery ).find( selector ); + return ( context || root ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) @@ -2810,24 +2990,20 @@ var rootjQuery, // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { - this.context = this[0] = selector; + this[ 0 ] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return typeof rootjQuery.ready !== "undefined" ? - rootjQuery.ready( selector ) : + } else if ( isFunction( selector ) ) { + return root.ready !== undefined ? + root.ready( selector ) : + // Execute immediately if ready is not present selector( jQuery ); } - if ( selector.selector !== undefined ) { - this.selector = selector.selector; - this.context = selector.context; - } - return jQuery.makeArray( selector, this ); }; @@ -2839,6 +3015,7 @@ rootjQuery = jQuery( document ); var rparentsprev = /^(?:parents|prev(?:Until|All))/, + // Methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, @@ -2847,48 +3024,19 @@ var rparentsprev = /^(?:parents|prev(?:Until|All))/, prev: true }; -jQuery.extend({ - dir: function( elem, dir, until ) { - var matched = [], - truncate = until !== undefined; - - while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) { - if ( elem.nodeType === 1 ) { - if ( truncate && jQuery( elem ).is( until ) ) { - break; - } - matched.push( elem ); - } - } - return matched; - }, - - sibling: function( n, elem ) { - var matched = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - matched.push( n ); - } - } - - return matched; - } -}); - -jQuery.fn.extend({ +jQuery.fn.extend( { has: function( target ) { var targets = jQuery( target, this ), l = targets.length; - return this.filter(function() { + return this.filter( function() { var i = 0; for ( ; i < l; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { + if ( jQuery.contains( this, targets[ i ] ) ) { return true; } } - }); + } ); }, closest: function( selectors, context ) { @@ -2896,27 +3044,29 @@ jQuery.fn.extend({ i = 0, l = this.length, matched = [], - pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; + targets = typeof selectors !== "string" && jQuery( selectors ); - for ( ; i < l; i++ ) { - for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { - // Always skip document fragments - if ( cur.nodeType < 11 && (pos ? - pos.index(cur) > -1 : + // Positional selectors never match, since there's no _selection_ context + if ( !rneedsContext.test( selectors ) ) { + for ( ; i < l; i++ ) { + for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector(cur, selectors)) ) { + // Always skip document fragments + if ( cur.nodeType < 11 && ( targets ? + targets.index( cur ) > -1 : - matched.push( cur ); - break; + // Don't pass non-elements to Sizzle + cur.nodeType === 1 && + jQuery.find.matchesSelector( cur, selectors ) ) ) { + + matched.push( cur ); + break; + } } } } - return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); + return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); }, // Determine the position of an element within the set @@ -2942,7 +3092,7 @@ jQuery.fn.extend({ add: function( selector, context ) { return this.pushStack( - jQuery.unique( + jQuery.uniqueSort( jQuery.merge( this.get(), jQuery( selector, context ) ) ) ); @@ -2950,26 +3100,26 @@ jQuery.fn.extend({ addBack: function( selector ) { return this.add( selector == null ? - this.prevObject : this.prevObject.filter(selector) + this.prevObject : this.prevObject.filter( selector ) ); } -}); +} ); function sibling( cur, dir ) { - while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {} + while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} return cur; } -jQuery.each({ +jQuery.each( { parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); + return dir( elem, "parentNode" ); }, parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); + return dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); @@ -2978,25 +3128,36 @@ jQuery.each({ return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); + return dir( elem, "nextSibling" ); }, prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); + return dir( elem, "previousSibling" ); }, nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); + return dir( elem, "nextSibling", until ); }, prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); + return dir( elem, "previousSibling", until ); }, siblings: function( elem ) { - return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); + return siblings( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { - return jQuery.sibling( elem.firstChild ); + return siblings( elem.firstChild ); }, contents: function( elem ) { - return elem.contentDocument || jQuery.merge( [], elem.childNodes ); + if ( nodeName( elem, "iframe" ) ) { + return elem.contentDocument; + } + + // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only + // Treat the template element as a regular one in browsers that + // don't support it. + if ( nodeName( elem, "template" ) ) { + elem = elem.content || elem; + } + + return jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { @@ -3011,9 +3172,10 @@ jQuery.each({ } if ( this.length > 1 ) { + // Remove duplicates if ( !guaranteedUnique[ name ] ) { - jQuery.unique( matched ); + jQuery.uniqueSort( matched ); } // Reverse order for parents* and prev-derivatives @@ -3024,20 +3186,17 @@ jQuery.each({ return this.pushStack( matched ); }; -}); -var rnotwhite = (/\S+/g); +} ); +var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); -// String to Object options format cache -var optionsCache = {}; - -// Convert String-formatted options into Object-formatted ones and store in cache +// Convert String-formatted options into Object-formatted ones function createOptions( options ) { - var object = optionsCache[ options ] = {}; - jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { + var object = {}; + jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { object[ flag ] = true; - }); + } ); return object; } @@ -3068,156 +3227,186 @@ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? - ( optionsCache[ options ] || createOptions( options ) ) : + createOptions( options ) : jQuery.extend( {}, options ); - var // Last fire value (for non-forgettable lists) + var // Flag to know if list is currently firing + firing, + + // Last fire value for non-forgettable lists memory, + // Flag to know if list was already fired fired, - // Flag to know if list is currently firing - firing, - // First callback to fire (used internally by add and fireWith) - firingStart, - // End of the loop when firing - firingLength, - // Index of currently firing callback (modified by remove if needed) - firingIndex, + + // Flag to prevent firing + locked, + // Actual callback list list = [], - // Stack of fire calls for repeatable lists - stack = !options.once && [], + + // Queue of execution data for repeatable lists + queue = [], + + // Index of currently firing callback (modified by add/remove as needed) + firingIndex = -1, + // Fire callbacks - fire = function( data ) { - memory = options.memory && data; - fired = true; - firingIndex = firingStart || 0; - firingStart = 0; - firingLength = list.length; - firing = true; - for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { - memory = false; // To prevent further calls using add - break; + fire = function() { + + // Enforce single-firing + locked = locked || options.once; + + // Execute callbacks for all pending executions, + // respecting firingIndex overrides and runtime changes + fired = firing = true; + for ( ; queue.length; firingIndex = -1 ) { + memory = queue.shift(); + while ( ++firingIndex < list.length ) { + + // Run callback and check for early termination + if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && + options.stopOnFalse ) { + + // Jump to end and forget the data so .add doesn't re-fire + firingIndex = list.length; + memory = false; + } } } + + // Forget the data if we're done with it + if ( !options.memory ) { + memory = false; + } + firing = false; - if ( list ) { - if ( stack ) { - if ( stack.length ) { - fire( stack.shift() ); - } - } else if ( memory ) { + + // Clean up if we're done firing for good + if ( locked ) { + + // Keep an empty list if we have data for future add calls + if ( memory ) { list = []; + + // Otherwise, this object is spent } else { - self.disable(); + list = ""; } } }, + // Actual Callbacks object self = { + // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { - // First, we save the current length - var start = list.length; - (function add( args ) { + + // If we have memory from a past run, we should fire after adding + if ( memory && !firing ) { + firingIndex = list.length - 1; + queue.push( memory ); + } + + ( function add( args ) { jQuery.each( args, function( _, arg ) { - var type = jQuery.type( arg ); - if ( type === "function" ) { + if ( isFunction( arg ) ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } - } else if ( arg && arg.length && type !== "string" ) { + } else if ( arg && arg.length && toType( arg ) !== "string" ) { + // Inspect recursively add( arg ); } - }); - })( arguments ); - // Do we need to add the callbacks to the - // current firing batch? - if ( firing ) { - firingLength = list.length; - // With memory, if we're not firing then - // we should call right away - } else if ( memory ) { - firingStart = start; - fire( memory ); + } ); + } )( arguments ); + + if ( memory && !firing ) { + fire(); } } return this; }, + // Remove a callback from the list remove: function() { - if ( list ) { - jQuery.each( arguments, function( _, arg ) { - var index; - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - // Handle firing indexes - if ( firing ) { - if ( index <= firingLength ) { - firingLength--; - } - if ( index <= firingIndex ) { - firingIndex--; - } - } + jQuery.each( arguments, function( _, arg ) { + var index; + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + + // Handle firing indexes + if ( index <= firingIndex ) { + firingIndex--; } - }); - } + } + } ); return this; }, + // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { - return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); + return fn ? + jQuery.inArray( fn, list ) > -1 : + list.length > 0; }, + // Remove all callbacks from the list empty: function() { - list = []; - firingLength = 0; + if ( list ) { + list = []; + } return this; }, - // Have the list do nothing anymore + + // Disable .fire and .add + // Abort any current/pending executions + // Clear all callbacks and values disable: function() { - list = stack = memory = undefined; + locked = queue = []; + list = memory = ""; return this; }, - // Is it disabled? disabled: function() { return !list; }, - // Lock the list in its current state + + // Disable .fire + // Also disable .add unless we have memory (since it would have no effect) + // Abort any pending executions lock: function() { - stack = undefined; - if ( !memory ) { - self.disable(); + locked = queue = []; + if ( !memory && !firing ) { + list = memory = ""; } return this; }, - // Is it locked? locked: function() { - return !stack; + return !!locked; }, + // Call all callbacks with the given context and arguments fireWith: function( context, args ) { - if ( list && ( !fired || stack ) ) { + if ( !locked ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; - if ( firing ) { - stack.push( args ); - } else { - fire( args ); + queue.push( args ); + if ( !firing ) { + fire(); } } return this; }, + // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, + // To know if the callbacks have already been called at least once fired: function() { return !!fired; @@ -3228,14 +3417,59 @@ jQuery.Callbacks = function( options ) { }; -jQuery.extend({ +function Identity( v ) { + return v; +} +function Thrower( ex ) { + throw ex; +} + +function adoptValue( value, resolve, reject, noValue ) { + var method; + + try { + + // Check for promise aspect first to privilege synchronous behavior + if ( value && isFunction( ( method = value.promise ) ) ) { + method.call( value ).done( resolve ).fail( reject ); + + // Other thenables + } else if ( value && isFunction( ( method = value.then ) ) ) { + method.call( value, resolve, reject ); + + // Other non-thenables + } else { + + // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: + // * false: [ value ].slice( 0 ) => resolve( value ) + // * true: [ value ].slice( 1 ) => resolve() + resolve.apply( undefined, [ value ].slice( noValue ) ); + } + + // For Promises/A+, convert exceptions into rejections + // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in + // Deferred#then to conditionally suppress rejection. + } catch ( value ) { + + // Support: Android 4.0 only + // Strict mode functions invoked without .call/.apply get global-object context + reject.apply( undefined, [ value ] ); + } +} + +jQuery.extend( { Deferred: function( func ) { var tuples = [ - // action, add listener, listener list, final state - [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], - [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], - [ "notify", "progress", jQuery.Callbacks("memory") ] + + // action, add listener, callbacks, + // ... .then handlers, argument index, [final state] + [ "notify", "progress", jQuery.Callbacks( "memory" ), + jQuery.Callbacks( "memory" ), 2 ], + [ "resolve", "done", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 0, "resolved" ], + [ "reject", "fail", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 1, "rejected" ] ], state = "pending", promise = { @@ -3246,27 +3480,206 @@ jQuery.extend({ deferred.done( arguments ).fail( arguments ); return this; }, - then: function( /* fnDone, fnFail, fnProgress */ ) { + "catch": function( fn ) { + return promise.then( null, fn ); + }, + + // Keep pipe for back-compat + pipe: function( /* fnDone, fnFail, fnProgress */ ) { var fns = arguments; - return jQuery.Deferred(function( newDefer ) { + + return jQuery.Deferred( function( newDefer ) { jQuery.each( tuples, function( i, tuple ) { - var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; - // deferred[ done | fail | progress ] for forwarding actions to newDefer - deferred[ tuple[1] ](function() { + + // Map tuples (progress, done, fail) to arguments (done, fail, progress) + var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; + + // deferred.progress(function() { bind to newDefer or newDefer.notify }) + // deferred.done(function() { bind to newDefer or newDefer.resolve }) + // deferred.fail(function() { bind to newDefer or newDefer.reject }) + deferred[ tuple[ 1 ] ]( function() { var returned = fn && fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { + if ( returned && isFunction( returned.promise ) ) { returned.promise() + .progress( newDefer.notify ) .done( newDefer.resolve ) - .fail( newDefer.reject ) - .progress( newDefer.notify ); + .fail( newDefer.reject ); } else { - newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); + newDefer[ tuple[ 0 ] + "With" ]( + this, + fn ? [ returned ] : arguments + ); } - }); - }); + } ); + } ); fns = null; - }).promise(); + } ).promise(); + }, + then: function( onFulfilled, onRejected, onProgress ) { + var maxDepth = 0; + function resolve( depth, deferred, handler, special ) { + return function() { + var that = this, + args = arguments, + mightThrow = function() { + var returned, then; + + // Support: Promises/A+ section 2.3.3.3.3 + // https://promisesaplus.com/#point-59 + // Ignore double-resolution attempts + if ( depth < maxDepth ) { + return; + } + + returned = handler.apply( that, args ); + + // Support: Promises/A+ section 2.3.1 + // https://promisesaplus.com/#point-48 + if ( returned === deferred.promise() ) { + throw new TypeError( "Thenable self-resolution" ); + } + + // Support: Promises/A+ sections 2.3.3.1, 3.5 + // https://promisesaplus.com/#point-54 + // https://promisesaplus.com/#point-75 + // Retrieve `then` only once + then = returned && + + // Support: Promises/A+ section 2.3.4 + // https://promisesaplus.com/#point-64 + // Only check objects and functions for thenability + ( typeof returned === "object" || + typeof returned === "function" ) && + returned.then; + + // Handle a returned thenable + if ( isFunction( then ) ) { + + // Special processors (notify) just wait for resolution + if ( special ) { + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ) + ); + + // Normal processors (resolve) also hook into progress + } else { + + // ...and disregard older resolution values + maxDepth++; + + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ), + resolve( maxDepth, deferred, Identity, + deferred.notifyWith ) + ); + } + + // Handle all other returned values + } else { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Identity ) { + that = undefined; + args = [ returned ]; + } + + // Process the value(s) + // Default process is resolve + ( special || deferred.resolveWith )( that, args ); + } + }, + + // Only normal processors (resolve) catch and reject exceptions + process = special ? + mightThrow : + function() { + try { + mightThrow(); + } catch ( e ) { + + if ( jQuery.Deferred.exceptionHook ) { + jQuery.Deferred.exceptionHook( e, + process.stackTrace ); + } + + // Support: Promises/A+ section 2.3.3.3.4.1 + // https://promisesaplus.com/#point-61 + // Ignore post-resolution exceptions + if ( depth + 1 >= maxDepth ) { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Thrower ) { + that = undefined; + args = [ e ]; + } + + deferred.rejectWith( that, args ); + } + } + }; + + // Support: Promises/A+ section 2.3.3.3.1 + // https://promisesaplus.com/#point-57 + // Re-resolve promises immediately to dodge false rejection from + // subsequent errors + if ( depth ) { + process(); + } else { + + // Call an optional hook to record the stack, in case of exception + // since it's otherwise lost when execution goes async + if ( jQuery.Deferred.getStackHook ) { + process.stackTrace = jQuery.Deferred.getStackHook(); + } + window.setTimeout( process ); + } + }; + } + + return jQuery.Deferred( function( newDefer ) { + + // progress_handlers.add( ... ) + tuples[ 0 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onProgress ) ? + onProgress : + Identity, + newDefer.notifyWith + ) + ); + + // fulfilled_handlers.add( ... ) + tuples[ 1 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onFulfilled ) ? + onFulfilled : + Identity + ) + ); + + // rejected_handlers.add( ... ) + tuples[ 2 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onRejected ) ? + onRejected : + Thrower + ) + ); + } ).promise(); }, + // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { @@ -3275,34 +3688,60 @@ jQuery.extend({ }, deferred = {}; - // Keep pipe for back-compat - promise.pipe = promise.then; - // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], - stateString = tuple[ 3 ]; + stateString = tuple[ 5 ]; - // promise[ done | fail | progress ] = list.add - promise[ tuple[1] ] = list.add; + // promise.progress = list.add + // promise.done = list.add + // promise.fail = list.add + promise[ tuple[ 1 ] ] = list.add; // Handle state if ( stateString ) { - list.add(function() { - // state = [ resolved | rejected ] - state = stateString; + list.add( + function() { + + // state = "resolved" (i.e., fulfilled) + // state = "rejected" + state = stateString; + }, + + // rejected_callbacks.disable + // fulfilled_callbacks.disable + tuples[ 3 - i ][ 2 ].disable, + + // rejected_handlers.disable + // fulfilled_handlers.disable + tuples[ 3 - i ][ 3 ].disable, + + // progress_callbacks.lock + tuples[ 0 ][ 2 ].lock, - // [ reject_list | resolve_list ].disable; progress_list.lock - }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); + // progress_handlers.lock + tuples[ 0 ][ 3 ].lock + ); } - // deferred[ resolve | reject | notify ] - deferred[ tuple[0] ] = function() { - deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); + // progress_handlers.fire + // fulfilled_handlers.fire + // rejected_handlers.fire + list.add( tuple[ 3 ].fire ); + + // deferred.notify = function() { deferred.notifyWith(...) } + // deferred.resolve = function() { deferred.resolveWith(...) } + // deferred.reject = function() { deferred.rejectWith(...) } + deferred[ tuple[ 0 ] ] = function() { + deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); return this; }; - deferred[ tuple[0] + "With" ] = list.fireWith; - }); + + // deferred.notifyWith = list.fireWith + // deferred.resolveWith = list.fireWith + // deferred.rejectWith = list.fireWith + deferred[ tuple[ 0 ] + "With" ] = list.fireWith; + } ); // Make the deferred a promise promise.promise( deferred ); @@ -3317,70 +3756,101 @@ jQuery.extend({ }, // Deferred helper - when: function( subordinate /* , ..., subordinateN */ ) { - var i = 0, - resolveValues = slice.call( arguments ), - length = resolveValues.length, + when: function( singleValue ) { + var + + // count of uncompleted subordinates + remaining = arguments.length, + + // count of unprocessed arguments + i = remaining, - // the count of uncompleted subordinates - remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, + // subordinate fulfillment data + resolveContexts = Array( i ), + resolveValues = slice.call( arguments ), - // the master Deferred. If resolveValues consist of only a single Deferred, just use that. - deferred = remaining === 1 ? subordinate : jQuery.Deferred(), + // the master Deferred + master = jQuery.Deferred(), - // Update function for both resolve and progress values - updateFunc = function( i, contexts, values ) { + // subordinate callback factory + updateFunc = function( i ) { return function( value ) { - contexts[ i ] = this; - values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; - if ( values === progressValues ) { - deferred.notifyWith( contexts, values ); - } else if ( !( --remaining ) ) { - deferred.resolveWith( contexts, values ); + resolveContexts[ i ] = this; + resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; + if ( !( --remaining ) ) { + master.resolveWith( resolveContexts, resolveValues ); } }; - }, + }; - progressValues, progressContexts, resolveContexts; + // Single- and empty arguments are adopted like Promise.resolve + if ( remaining <= 1 ) { + adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, + !remaining ); - // Add listeners to Deferred subordinates; treat others as resolved - if ( length > 1 ) { - progressValues = new Array( length ); - progressContexts = new Array( length ); - resolveContexts = new Array( length ); - for ( ; i < length; i++ ) { - if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { - resolveValues[ i ].promise() - .done( updateFunc( i, resolveContexts, resolveValues ) ) - .fail( deferred.reject ) - .progress( updateFunc( i, progressContexts, progressValues ) ); - } else { - --remaining; - } + // Use .then() to unwrap secondary thenables (cf. gh-3000) + if ( master.state() === "pending" || + isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { + + return master.then(); } } - // If we're not waiting on anything, resolve the master - if ( !remaining ) { - deferred.resolveWith( resolveContexts, resolveValues ); + // Multiple arguments are aggregated like Promise.all array elements + while ( i-- ) { + adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); } - return deferred.promise(); + return master.promise(); } -}); +} ); + + +// These usually indicate a programmer mistake during development, +// warn about them ASAP rather than swallowing them by default. +var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; + +jQuery.Deferred.exceptionHook = function( error, stack ) { + + // Support: IE 8 - 9 only + // Console exists when dev tools are open, which can happen at any time + if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { + window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); + } +}; + + + + +jQuery.readyException = function( error ) { + window.setTimeout( function() { + throw error; + } ); +}; + + // The deferred used on DOM ready -var readyList; +var readyList = jQuery.Deferred(); jQuery.fn.ready = function( fn ) { - // Add the callback - jQuery.ready.promise().done( fn ); + + readyList + .then( fn ) + + // Wrap jQuery.readyException in a function so that the lookup + // happens at the time of error handling instead of callback + // registration. + .catch( function( error ) { + jQuery.readyException( error ); + } ); return this; }; -jQuery.extend({ +jQuery.extend( { + // Is the DOM ready to be used? Set to true once it occurs. isReady: false, @@ -3388,15 +3858,6 @@ jQuery.extend({ // the ready event fires. See #6781 readyWait: 1, - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - // Handle when the DOM is ready ready: function( wait ) { @@ -3415,77 +3876,64 @@ jQuery.extend({ // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.triggerHandler ) { - jQuery( document ).triggerHandler( "ready" ); - jQuery( document ).off( "ready" ); - } } -}); +} ); -/** - * The ready event handler and self cleanup method - */ +jQuery.ready.then = readyList.then; + +// The ready event handler and self cleanup method function completed() { - document.removeEventListener( "DOMContentLoaded", completed, false ); - window.removeEventListener( "load", completed, false ); + document.removeEventListener( "DOMContentLoaded", completed ); + window.removeEventListener( "load", completed ); jQuery.ready(); } -jQuery.ready.promise = function( obj ) { - if ( !readyList ) { - - readyList = jQuery.Deferred(); +// Catch cases where $(document).ready() is called +// after the browser event has already occurred. +// Support: IE <=9 - 10 only +// Older IE sometimes signals "interactive" too soon +if ( document.readyState === "complete" || + ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { - // Catch cases where $(document).ready() is called after the browser event has already occurred. - // We once tried to use readyState "interactive" here, but it caused issues like the one - // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - setTimeout( jQuery.ready ); + // Handle it asynchronously to allow scripts the opportunity to delay ready + window.setTimeout( jQuery.ready ); - } else { - - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed, false ); +} else { - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed, false ); - } - } - return readyList.promise( obj ); -}; + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed ); -// Kick off the DOM ready check even if the user does not -jQuery.ready.promise(); + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed ); +} // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function -var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { +var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, len = elems.length, bulk = key == null; // Sets many values - if ( jQuery.type( key ) === "object" ) { + if ( toType( key ) === "object" ) { chainable = true; for ( i in key ) { - jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); + access( elems, fn, i, key[ i ], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; - if ( !jQuery.isFunction( value ) ) { + if ( !isFunction( value ) ) { raw = true; } if ( bulk ) { + // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); @@ -3502,127 +3950,126 @@ var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGe if ( fn ) { for ( ; i < len; i++ ) { - fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); + fn( + elems[ i ], key, raw ? + value : + value.call( elems[ i ], i, fn( elems[ i ], key ) ) + ); } } } - return chainable ? - elems : + if ( chainable ) { + return elems; + } + + // Gets + if ( bulk ) { + return fn.call( elems ); + } - // Gets - bulk ? - fn.call( elems ) : - len ? fn( elems[0], key ) : emptyGet; + return len ? fn( elems[ 0 ], key ) : emptyGet; }; -/** - * Determines whether an object can have data - */ -jQuery.acceptData = function( owner ) { +// Matches dashed string for camelizing +var rmsPrefix = /^-ms-/, + rdashAlpha = /-([a-z])/g; + +// Used by camelCase as callback to replace() +function fcamelCase( all, letter ) { + return letter.toUpperCase(); +} + +// Convert dashed to camelCase; used by the css and data modules +// Support: IE <=9 - 11, Edge 12 - 15 +// Microsoft forgot to hump their vendor prefix (#9572) +function camelCase( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); +} +var acceptData = function( owner ) { + // Accepts only: // - Node // - Node.ELEMENT_NODE // - Node.DOCUMENT_NODE // - Object // - Any - /* jshint -W018 */ return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); }; -function Data() { - // Support: Android<4, - // Old WebKit does not have Object.preventExtensions/freeze method, - // return new empty object instead with no [[set]] accessor - Object.defineProperty( this.cache = {}, 0, { - get: function() { - return {}; - } - }); + +function Data() { this.expando = jQuery.expando + Data.uid++; } Data.uid = 1; -Data.accepts = jQuery.acceptData; Data.prototype = { - key: function( owner ) { - // We can accept data for non-element nodes in modern browsers, - // but we should not, see #8335. - // Always return the key for a frozen object. - if ( !Data.accepts( owner ) ) { - return 0; - } - var descriptor = {}, - // Check if the owner object already has a cache key - unlock = owner[ this.expando ]; - - // If not, create one - if ( !unlock ) { - unlock = Data.uid++; + cache: function( owner ) { - // Secure it in a non-enumerable, non-writable property - try { - descriptor[ this.expando ] = { value: unlock }; - Object.defineProperties( owner, descriptor ); + // Check if the owner object already has a cache + var value = owner[ this.expando ]; - // Support: Android<4 - // Fallback to a less secure definition - } catch ( e ) { - descriptor[ this.expando ] = unlock; - jQuery.extend( owner, descriptor ); + // If not, create one + if ( !value ) { + value = {}; + + // We can accept data for non-element nodes in modern browsers, + // but we should not, see #8335. + // Always return an empty object. + if ( acceptData( owner ) ) { + + // If it is a node unlikely to be stringify-ed or looped over + // use plain assignment + if ( owner.nodeType ) { + owner[ this.expando ] = value; + + // Otherwise secure it in a non-enumerable property + // configurable must be true to allow the property to be + // deleted when data is removed + } else { + Object.defineProperty( owner, this.expando, { + value: value, + configurable: true + } ); + } } } - // Ensure the cache object - if ( !this.cache[ unlock ] ) { - this.cache[ unlock ] = {}; - } - - return unlock; + return value; }, set: function( owner, data, value ) { var prop, - // There may be an unlock assigned to this node, - // if there is no entry for this "owner", create one inline - // and set the unlock as though an owner entry had always existed - unlock = this.key( owner ), - cache = this.cache[ unlock ]; + cache = this.cache( owner ); // Handle: [ owner, key, value ] args + // Always use camelCase key (gh-2257) if ( typeof data === "string" ) { - cache[ data ] = value; + cache[ camelCase( data ) ] = value; // Handle: [ owner, { properties } ] args } else { - // Fresh assignments by object are shallow copied - if ( jQuery.isEmptyObject( cache ) ) { - jQuery.extend( this.cache[ unlock ], data ); - // Otherwise, copy the properties one-by-one to the cache object - } else { - for ( prop in data ) { - cache[ prop ] = data[ prop ]; - } + + // Copy the properties one-by-one to the cache object + for ( prop in data ) { + cache[ camelCase( prop ) ] = data[ prop ]; } } return cache; }, get: function( owner, key ) { - // Either a valid cache is found, or will be created. - // New caches will be created and the unlock returned, - // allowing direct access to the newly created - // empty data object. A valid owner object must be provided. - var cache = this.cache[ this.key( owner ) ]; - return key === undefined ? - cache : cache[ key ]; + this.cache( owner ) : + + // Always use camelCase key (gh-2257) + owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; }, access: function( owner, key, value ) { - var stored; + // In cases where either: // // 1. No key was specified @@ -3635,15 +4082,12 @@ Data.prototype = { // 2. The data stored at the key // if ( key === undefined || - ((key && typeof key === "string") && value === undefined) ) { - - stored = this.get( owner, key ); + ( ( key && typeof key === "string" ) && value === undefined ) ) { - return stored !== undefined ? - stored : this.get( owner, jQuery.camelCase(key) ); + return this.get( owner, key ); } - // [*]When the key is not a string, or both a key and value + // When the key is not a string, or both a key and value // are specified, set or extend (existing objects) with either: // // 1. An object of properties @@ -3656,57 +4100,60 @@ Data.prototype = { return value !== undefined ? value : key; }, remove: function( owner, key ) { - var i, name, camel, - unlock = this.key( owner ), - cache = this.cache[ unlock ]; + var i, + cache = owner[ this.expando ]; - if ( key === undefined ) { - this.cache[ unlock ] = {}; + if ( cache === undefined ) { + return; + } + + if ( key !== undefined ) { - } else { // Support array or space separated string of keys - if ( jQuery.isArray( key ) ) { - // If "name" is an array of keys... - // When data is initially created, via ("key", "val") signature, - // keys will be converted to camelCase. - // Since there is no way to tell _how_ a key was added, remove - // both plain key and camelCase key. #12786 - // This will only penalize the array argument path. - name = key.concat( key.map( jQuery.camelCase ) ); + if ( Array.isArray( key ) ) { + + // If key is an array of keys... + // We always set camelCase keys, so remove that. + key = key.map( camelCase ); } else { - camel = jQuery.camelCase( key ); - // Try the string as a key before any manipulation - if ( key in cache ) { - name = [ key, camel ]; - } else { - // If a key with the spaces exists, use it. - // Otherwise, create an array by matching non-whitespace - name = camel; - name = name in cache ? - [ name ] : ( name.match( rnotwhite ) || [] ); - } + key = camelCase( key ); + + // If a key with the spaces exists, use it. + // Otherwise, create an array by matching non-whitespace + key = key in cache ? + [ key ] : + ( key.match( rnothtmlwhite ) || [] ); } - i = name.length; + i = key.length; + while ( i-- ) { - delete cache[ name[ i ] ]; + delete cache[ key[ i ] ]; + } + } + + // Remove the expando if there's no more data + if ( key === undefined || jQuery.isEmptyObject( cache ) ) { + + // Support: Chrome <=35 - 45 + // Webkit & Blink performance suffers when deleting properties + // from DOM nodes, so set to undefined instead + // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) + if ( owner.nodeType ) { + owner[ this.expando ] = undefined; + } else { + delete owner[ this.expando ]; } } }, hasData: function( owner ) { - return !jQuery.isEmptyObject( - this.cache[ owner[ this.expando ] ] || {} - ); - }, - discard: function( owner ) { - if ( owner[ this.expando ] ) { - delete this.cache[ owner[ this.expando ] ]; - } + var cache = owner[ this.expando ]; + return cache !== undefined && !jQuery.isEmptyObject( cache ); } }; -var data_priv = new Data(); +var dataPriv = new Data(); -var data_user = new Data(); +var dataUser = new Data(); @@ -3721,7 +4168,32 @@ var data_user = new Data(); // 6. Provide a clear path for implementation upgrade to WeakMap in 2014 var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /([A-Z])/g; + rmultiDash = /[A-Z]/g; + +function getData( data ) { + if ( data === "true" ) { + return true; + } + + if ( data === "false" ) { + return false; + } + + if ( data === "null" ) { + return null; + } + + // Only convert to a number if it doesn't change the string + if ( data === +data + "" ) { + return +data; + } + + if ( rbrace.test( data ) ) { + return JSON.parse( data ); + } + + return data; +} function dataAttr( elem, key, data ) { var name; @@ -3729,22 +4201,16 @@ function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { - name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); + name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - // Only convert to a number if it doesn't change the string - +data + "" === data ? +data : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} + data = getData( data ); + } catch ( e ) {} // Make sure we set the data so it isn't changed later - data_user.set( elem, key, data ); + dataUser.set( elem, key, data ); } else { data = undefined; } @@ -3752,31 +4218,31 @@ function dataAttr( elem, key, data ) { return data; } -jQuery.extend({ +jQuery.extend( { hasData: function( elem ) { - return data_user.hasData( elem ) || data_priv.hasData( elem ); + return dataUser.hasData( elem ) || dataPriv.hasData( elem ); }, data: function( elem, name, data ) { - return data_user.access( elem, name, data ); + return dataUser.access( elem, name, data ); }, removeData: function( elem, name ) { - data_user.remove( elem, name ); + dataUser.remove( elem, name ); }, // TODO: Now that all calls to _data and _removeData have been replaced - // with direct calls to data_priv methods, these can be deprecated. + // with direct calls to dataPriv methods, these can be deprecated. _data: function( elem, name, data ) { - return data_priv.access( elem, name, data ); + return dataPriv.access( elem, name, data ); }, _removeData: function( elem, name ) { - data_priv.remove( elem, name ); + dataPriv.remove( elem, name ); } -}); +} ); -jQuery.fn.extend({ +jQuery.fn.extend( { data: function( key, value ) { var i, name, data, elem = this[ 0 ], @@ -3785,23 +4251,23 @@ jQuery.fn.extend({ // Gets all values if ( key === undefined ) { if ( this.length ) { - data = data_user.get( elem ); + data = dataUser.get( elem ); - if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) { + if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { i = attrs.length; while ( i-- ) { - // Support: IE11+ + // Support: IE 11 only // The attrs elements can be null (#14894) if ( attrs[ i ] ) { name = attrs[ i ].name; if ( name.indexOf( "data-" ) === 0 ) { - name = jQuery.camelCase( name.slice(5) ); + name = camelCase( name.slice( 5 ) ); dataAttr( elem, name, data[ name ] ); } } } - data_priv.set( elem, "hasDataAttrs", true ); + dataPriv.set( elem, "hasDataAttrs", true ); } } @@ -3810,14 +4276,13 @@ jQuery.fn.extend({ // Sets multiple values if ( typeof key === "object" ) { - return this.each(function() { - data_user.set( this, key ); - }); + return this.each( function() { + dataUser.set( this, key ); + } ); } return access( this, function( value ) { - var data, - camelKey = jQuery.camelCase( key ); + var data; // The calling jQuery object (element matches) is not empty // (and therefore has an element appears at this[ 0 ]) and the @@ -3825,23 +4290,17 @@ jQuery.fn.extend({ // will result in `undefined` for elem = this[ 0 ] which will // throw an exception if an attempt to read a data cache is made. if ( elem && value === undefined ) { - // Attempt to get data from the cache - // with the key as-is - data = data_user.get( elem, key ); - if ( data !== undefined ) { - return data; - } // Attempt to get data from the cache - // with the key camelized - data = data_user.get( elem, camelKey ); + // The key will always be camelCased in Data + data = dataUser.get( elem, key ); if ( data !== undefined ) { return data; } // Attempt to "discover" the data in // HTML5 custom data-* attrs - data = dataAttr( elem, camelKey, undefined ); + data = dataAttr( elem, key ); if ( data !== undefined ) { return data; } @@ -3851,46 +4310,34 @@ jQuery.fn.extend({ } // Set the data... - this.each(function() { - // First, attempt to store a copy or reference of any - // data that might've been store with a camelCased key. - var data = data_user.get( this, camelKey ); - - // For HTML5 data-* attribute interop, we have to - // store property names with dashes in a camelCase form. - // This might not apply to all properties...* - data_user.set( this, camelKey, value ); - - // *... In the case of properties that might _actually_ - // have dashes, we need to also store a copy of that - // unchanged property. - if ( key.indexOf("-") !== -1 && data !== undefined ) { - data_user.set( this, key, value ); - } - }); + this.each( function() { + + // We always store the camelCased key + dataUser.set( this, key, value ); + } ); }, null, value, arguments.length > 1, null, true ); }, removeData: function( key ) { - return this.each(function() { - data_user.remove( this, key ); - }); + return this.each( function() { + dataUser.remove( this, key ); + } ); } -}); +} ); -jQuery.extend({ +jQuery.extend( { queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; - queue = data_priv.get( elem, type ); + queue = dataPriv.get( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { - if ( !queue || jQuery.isArray( data ) ) { - queue = data_priv.access( elem, type, jQuery.makeArray(data) ); + if ( !queue || Array.isArray( data ) ) { + queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); } else { queue.push( data ); } @@ -3937,15 +4384,15 @@ jQuery.extend({ // Not public - generate a queueHooks object, or return the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; - return data_priv.get( elem, key ) || data_priv.access( elem, key, { - empty: jQuery.Callbacks("once memory").add(function() { - data_priv.remove( elem, [ type + "queue", key ] ); - }) - }); + return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { + empty: jQuery.Callbacks( "once memory" ).add( function() { + dataPriv.remove( elem, [ type + "queue", key ] ); + } ) + } ); } -}); +} ); -jQuery.fn.extend({ +jQuery.fn.extend( { queue: function( type, data ) { var setter = 2; @@ -3956,30 +4403,31 @@ jQuery.fn.extend({ } if ( arguments.length < setter ) { - return jQuery.queue( this[0], type ); + return jQuery.queue( this[ 0 ], type ); } return data === undefined ? this : - this.each(function() { + this.each( function() { var queue = jQuery.queue( this, type, data ); // Ensure a hooks for this queue jQuery._queueHooks( this, type ); - if ( type === "fx" && queue[0] !== "inprogress" ) { + if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { jQuery.dequeue( this, type ); } - }); + } ); }, dequeue: function( type ) { - return this.each(function() { + return this.each( function() { jQuery.dequeue( this, type ); - }); + } ); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, + // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { @@ -4001,7 +4449,7 @@ jQuery.fn.extend({ type = type || "fx"; while ( i-- ) { - tmp = data_priv.get( elements[ i ], type + "queueHooks" ); + tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); @@ -4010,402 +4458,701 @@ jQuery.fn.extend({ resolve(); return defer.promise( obj ); } -}); -var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; +} ); +var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; + +var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); + var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; -var isHidden = function( elem, el ) { - // isHidden might be called from jQuery#filter function; +var isHiddenWithinTree = function( elem, el ) { + + // isHiddenWithinTree might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; - return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); - }; -var rcheckableType = (/^(?:checkbox|radio)$/i); + // Inline style trumps all + return elem.style.display === "none" || + elem.style.display === "" && + // Otherwise, check computed style + // Support: Firefox <=43 - 45 + // Disconnected elements can have computed display: none, so first confirm that elem is + // in the document. + jQuery.contains( elem.ownerDocument, elem ) && + jQuery.css( elem, "display" ) === "none"; + }; -(function() { - var fragment = document.createDocumentFragment(), - div = fragment.appendChild( document.createElement( "div" ) ), - input = document.createElement( "input" ); - - // Support: Safari<=5.1 - // Check state lost if the name is set (#11217) - // Support: Windows Web Apps (WWA) - // `name` and `type` must use .setAttribute for WWA (#14901) - input.setAttribute( "type", "radio" ); - input.setAttribute( "checked", "checked" ); - input.setAttribute( "name", "t" ); +var swap = function( elem, options, callback, args ) { + var ret, name, + old = {}; - div.appendChild( input ); + // Remember the old values, and insert the new ones + for ( name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } - // Support: Safari<=5.1, Android<4.2 - // Older WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + ret = callback.apply( elem, args || [] ); - // Support: IE<=11+ - // Make sure textarea (and checkbox) defaultValue is properly cloned - div.innerHTML = ""; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; -})(); -var strundefined = typeof undefined; + // Revert the old values + for ( name in options ) { + elem.style[ name ] = old[ name ]; + } + return ret; +}; -support.focusinBubbles = "onfocusin" in window; -var - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, - rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; +function adjustCSS( elem, prop, valueParts, tween ) { + var adjusted, scale, + maxIterations = 20, + currentValue = tween ? + function() { + return tween.cur(); + } : + function() { + return jQuery.css( elem, prop, "" ); + }, + initial = currentValue(), + unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), -function returnTrue() { - return true; -} + // Starting value computation is required for potential unit mismatches + initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && + rcssNum.exec( jQuery.css( elem, prop ) ); -function returnFalse() { - return false; -} + if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } -} + // Support: Firefox <=54 + // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) + initial = initial / 2; -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { + // Trust units reported by jQuery.css + unit = unit || initialInUnit[ 3 ]; - global: {}, + // Iteratively approximate from a nonzero starting point + initialInUnit = +initial || 1; - add: function( elem, types, handler, data, selector ) { + while ( maxIterations-- ) { - var handleObjIn, eventHandle, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = data_priv.get( elem ); + // Evaluate and update our best guess (doubling guesses that zero out). + // Finish if the scale equals or crosses 1 (making the old*new product non-positive). + jQuery.style( elem, prop, initialInUnit + unit ); + if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { + maxIterations = 0; + } + initialInUnit = initialInUnit / scale; - // Don't attach events to noData or text/comment nodes (but allow plain objects) - if ( !elemData ) { - return; } - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.selector; - } + initialInUnit = initialInUnit * 2; + jQuery.style( elem, prop, initialInUnit + unit ); - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } + // Make sure we update the tween properties later on + valueParts = valueParts || []; + } - // Init the element's event structure and main handler, if this is the first - if ( !(events = elemData.events) ) { - events = elemData.events = {}; - } - if ( !(eventHandle = elemData.handle) ) { - eventHandle = elemData.handle = function( e ) { - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ? - jQuery.event.dispatch.apply( elem, arguments ) : undefined; - }; + if ( valueParts ) { + initialInUnit = +initialInUnit || +initial || 0; + + // Apply relative offset (+=/-=) if specified + adjusted = valueParts[ 1 ] ? + initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : + +valueParts[ 2 ]; + if ( tween ) { + tween.unit = unit; + tween.start = initialInUnit; + tween.end = adjusted; } + } + return adjusted; +} - // Handle multiple events separated by a space - types = ( types || "" ).match( rnotwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - // There *must* be a type, no attaching namespace-only handlers - if ( !type ) { - continue; - } +var defaultDisplayMap = {}; - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; +function getDefaultDisplay( elem ) { + var temp, + doc = elem.ownerDocument, + nodeName = elem.nodeName, + display = defaultDisplayMap[ nodeName ]; - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; + if ( display ) { + return display; + } - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; + temp = doc.body.appendChild( doc.createElement( nodeName ) ); + display = jQuery.css( temp, "display" ); - // handleObj is passed to all event handlers - handleObj = jQuery.extend({ - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join(".") - }, handleObjIn ); + temp.parentNode.removeChild( temp ); - // Init the event handler queue if we're the first - if ( !(handlers = events[ type ]) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; + if ( display === "none" ) { + display = "block"; + } + defaultDisplayMap[ nodeName ] = display; - // Only use addEventListener if the special events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - } - } - } + return display; +} - if ( special.add ) { - special.add.call( elem, handleObj ); +function showHide( elements, show ) { + var display, elem, + values = [], + index = 0, + length = elements.length; - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; + // Determine new display value for elements that need to change + for ( ; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + + display = elem.style.display; + if ( show ) { + + // Since we force visibility upon cascade-hidden elements, an immediate (and slow) + // check is required in this first loop unless we have a nonempty display value (either + // inline or about-to-be-restored) + if ( display === "none" ) { + values[ index ] = dataPriv.get( elem, "display" ) || null; + if ( !values[ index ] ) { + elem.style.display = ""; } } + if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { + values[ index ] = getDefaultDisplay( elem ); + } + } else { + if ( display !== "none" ) { + values[ index ] = "none"; - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); + // Remember what we're overwriting + dataPriv.set( elem, "display", display ); } + } + } - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; + // Set the display of the elements in a second loop to avoid constant reflow + for ( index = 0; index < length; index++ ) { + if ( values[ index ] != null ) { + elements[ index ].style.display = values[ index ]; } + } + + return elements; +} +jQuery.fn.extend( { + show: function() { + return showHide( this, true ); + }, + hide: function() { + return showHide( this ); }, + toggle: function( state ) { + if ( typeof state === "boolean" ) { + return state ? this.show() : this.hide(); + } - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { + return this.each( function() { + if ( isHiddenWithinTree( this ) ) { + jQuery( this ).show(); + } else { + jQuery( this ).hide(); + } + } ); + } +} ); +var rcheckableType = ( /^(?:checkbox|radio)$/i ); - var j, origCount, tmp, - events, t, handleObj, - special, handlers, type, namespaces, origType, - elemData = data_priv.hasData( elem ) && data_priv.get( elem ); +var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]+)/i ); - if ( !elemData || !(events = elemData.events) ) { - return; - } +var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnotwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); +// We have to close these tags to support XHTML (#13200) +var wrapMap = { - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; + // Support: IE <=9 only + option: [ 1, "" ], - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); + // XHTML parsers do not magically insert elements in the + // same way that tag soup parsers do. So we cannot shorten + // this by omitting or other required elements. + thead: [ 1, "", "
" ], + col: [ 2, "", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } + _default: [ 0, "", "" ] +}; - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( origCount && !handlers.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - jQuery.removeEvent( elem, type, elemData.handle ); +// Support: IE <=9 only +wrapMap.optgroup = wrapMap.option; + +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + + +function getAll( context, tag ) { + + // Support: IE <=9 - 11 only + // Use typeof to avoid zero-argument method invocation on host objects (#15151) + var ret; + + if ( typeof context.getElementsByTagName !== "undefined" ) { + ret = context.getElementsByTagName( tag || "*" ); + + } else if ( typeof context.querySelectorAll !== "undefined" ) { + ret = context.querySelectorAll( tag || "*" ); + + } else { + ret = []; + } + + if ( tag === undefined || tag && nodeName( context, tag ) ) { + return jQuery.merge( [ context ], ret ); + } + + return ret; +} + + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + dataPriv.set( + elems[ i ], + "globalEval", + !refElements || dataPriv.get( refElements[ i ], "globalEval" ) + ); + } +} + + +var rhtml = /<|&#?\w+;/; + +function buildFragment( elems, context, scripts, selection, ignored ) { + var elem, tmp, tag, wrap, contains, j, + fragment = context.createDocumentFragment(), + nodes = [], + i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + elem = elems[ i ]; + + if ( elem || elem === 0 ) { + + // Add nodes directly + if ( toType( elem ) === "object" ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + + // Convert non-html into a text node + } else if ( !rhtml.test( elem ) ) { + nodes.push( context.createTextNode( elem ) ); + + // Convert html into DOM nodes + } else { + tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); + + // Deserialize a standard representation + tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; + + // Descend through wrappers to the right content + j = wrap[ 0 ]; + while ( j-- ) { + tmp = tmp.lastChild; } - delete events[ type ]; + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, tmp.childNodes ); + + // Remember the top-level container + tmp = fragment.firstChild; + + // Ensure the created nodes are orphaned (#12392) + tmp.textContent = ""; } } + } - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - delete elemData.handle; - data_priv.remove( elem, "events" ); - } - }, + // Remove wrapper from fragment + fragment.textContent = ""; - trigger: function( event, data, elem, onlyHandlers ) { + i = 0; + while ( ( elem = nodes[ i++ ] ) ) { - var i, cur, tmp, bubbleType, ontype, handle, special, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; + // Skip elements already in the context collection (trac-4087) + if ( selection && jQuery.inArray( elem, selection ) > -1 ) { + if ( ignored ) { + ignored.push( elem ); + } + continue; + } - cur = tmp = elem = elem || document; + contains = jQuery.contains( elem.ownerDocument, elem ); - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; + // Append to fragment + tmp = getAll( fragment.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( contains ) { + setGlobalEval( tmp ); } - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; + // Capture executables + if ( scripts ) { + j = 0; + while ( ( elem = tmp[ j++ ] ) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } } + } - if ( type.indexOf(".") >= 0 ) { - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); - type = namespaces.shift(); - namespaces.sort(); + return fragment; +} + + +( function() { + var fragment = document.createDocumentFragment(), + div = fragment.appendChild( document.createElement( "div" ) ), + input = document.createElement( "input" ); + + // Support: Android 4.0 - 4.3 only + // Check state lost if the name is set (#11217) + // Support: Windows Web Apps (WWA) + // `name` and `type` must use .setAttribute for WWA (#14901) + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + + // Support: Android <=4.1 only + // Older WebKit doesn't clone checked state correctly in fragments + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE <=11 only + // Make sure textarea (and checkbox) defaultValue is properly cloned + div.innerHTML = ""; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; +} )(); +var documentElement = document.documentElement; + + + +var + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, + rtypenamespace = /^([^.]*)(?:\.(.+)|)/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +// Support: IE <=9 only +// See #13393 for more info +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} + +function on( elem, types, selector, data, fn, one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + on( elem, type, selector, data, types[ type ], one ); } - ontype = type.indexOf(":") < 0 && "on" + type; + return elem; + } - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); + if ( data == null && fn == null ) { - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join("."); - event.namespace_re = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : - null; + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return elem; + } - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return elem.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + } ); +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + + var handleObjIn, eventHandle, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.get( elem ); + + // Don't attach events to noData or text/comment nodes (but allow plain objects) + if ( !elemData ) { return; } - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } + // Ensure that invalid selectors throw exceptions at attach time + // Evaluate against documentElement in case elem is a non-element node (e.g., document) + if ( selector ) { + jQuery.find.matchesSelector( documentElement, selector ); + } - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === (elem.ownerDocument || document) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; } - // Fire handlers on the event path - i = 0; - while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { + // Init the element's event structure and main handler, if this is the first + if ( !( events = elemData.events ) ) { + events = elemData.events = {}; + } + if ( !( eventHandle = elemData.handle ) ) { + eventHandle = elemData.handle = function( e ) { - event.type = i > 1 ? - bubbleType : - special.bindType || type; + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? + jQuery.event.dispatch.apply( elem, arguments ) : undefined; + }; + } - // jQuery handler - handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); + // Handle multiple events separated by a space + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; } - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && jQuery.acceptData( cur ) ) { - event.result = handle.apply( cur, data ); - if ( event.result === false ) { - event.preventDefault(); + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend( { + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join( "." ) + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !( handlers = events[ type ] ) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener if the special events handler returns false + if ( !special.setup || + special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle ); + } } } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; } - event.type = type; - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { + }, - if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && - jQuery.acceptData( elem ) ) { + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { - // Call a native DOM method on the target with the same name name as the event. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) { + var j, origCount, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; + if ( !elemData || !( events = elemData.events ) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[ 2 ] && + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || + selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); - if ( tmp ) { - elem[ ontype ] = null; + if ( handleObj.selector ) { + handlers.delegateCount--; } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - elem[ type ](); - jQuery.event.triggered = undefined; + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || + special.teardown.call( elem, namespaces, elemData.handle ) === false ) { - if ( tmp ) { - elem[ ontype ] = tmp; - } + jQuery.removeEvent( elem, type, elemData.handle ); } + + delete events[ type ]; } } - return event.result; + // Remove data and the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + dataPriv.remove( elem, "handle events" ); + } }, - dispatch: function( event ) { + dispatch: function( nativeEvent ) { // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( event ); + var event = jQuery.event.fix( nativeEvent ); - var i, j, ret, matched, handleObj, - handlerQueue = [], - args = slice.call( arguments ), - handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [], + var i, j, ret, matched, handleObj, handlerQueue, + args = new Array( arguments.length ), + handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[0] = event; + args[ 0 ] = event; + + for ( i = 1; i < arguments.length; i++ ) { + args[ i ] = arguments[ i ]; + } + event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired @@ -4418,24 +5165,25 @@ jQuery.event = { // Run delegates first; they may want to stop propagation beneath us i = 0; - while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { + while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; - while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { + while ( ( handleObj = matched.handlers[ j++ ] ) && + !event.isImmediatePropagationStopped() ) { // Triggered event must either 1) have no namespace, or 2) have namespace(s) // a subset or equal to those in the bound event (both can have no namespace). - if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { + if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; - ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) - .apply( matched.elem, args ); + ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || + handleObj.handler ).apply( matched.elem, args ); if ( ret !== undefined ) { - if ( (event.result = ret) === false ) { + if ( ( event.result = ret ) === false ) { event.preventDefault(); event.stopPropagation(); } @@ -4453,143 +5201,105 @@ jQuery.event = { }, handlers: function( event, handlers ) { - var i, matches, sel, handleObj, + var i, handleObj, sel, matchedHandlers, matchedSelectors, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Find delegate handlers - // Black-hole SVG instance trees (#13180) - // Avoid non-left-click bubbling in Firefox (#3861) - if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { + if ( delegateCount && + + // Support: IE <=9 + // Black-hole SVG instance trees (trac-13180) + cur.nodeType && + + // Support: Firefox <=42 + // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) + // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click + // Support: IE 11 only + // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) + !( event.type === "click" && event.button >= 1 ) ) { for ( ; cur !== this; cur = cur.parentNode || this ) { + // Don't check non-elements (#13208) // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.disabled !== true || event.type !== "click" ) { - matches = []; + if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { + matchedHandlers = []; + matchedSelectors = {}; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; // Don't conflict with Object.prototype properties (#13203) sel = handleObj.selector + " "; - if ( matches[ sel ] === undefined ) { - matches[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) >= 0 : + if ( matchedSelectors[ sel ] === undefined ) { + matchedSelectors[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) > -1 : jQuery.find( sel, this, null, [ cur ] ).length; } - if ( matches[ sel ] ) { - matches.push( handleObj ); + if ( matchedSelectors[ sel ] ) { + matchedHandlers.push( handleObj ); } } - if ( matches.length ) { - handlerQueue.push({ elem: cur, handlers: matches }); + if ( matchedHandlers.length ) { + handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); } } } } // Add the remaining (directly-bound) handlers + cur = this; if ( delegateCount < handlers.length ) { - handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); + handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); } return handlerQueue; }, - // Includes some event props shared by KeyEvent and MouseEvent - props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), - - fixHooks: {}, - - keyHooks: { - props: "char charCode key keyCode".split(" "), - filter: function( event, original ) { - - // Add which for key events - if ( event.which == null ) { - event.which = original.charCode != null ? original.charCode : original.keyCode; - } - - return event; - } - }, - - mouseHooks: { - props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "), - filter: function( event, original ) { - var eventDoc, doc, body, - button = original.button; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && original.clientX != null ) { - eventDoc = event.target.ownerDocument || document; - doc = eventDoc.documentElement; - body = eventDoc.body; + addProp: function( name, hook ) { + Object.defineProperty( jQuery.Event.prototype, name, { + enumerable: true, + configurable: true, - event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); - event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); - } + get: isFunction( hook ) ? + function() { + if ( this.originalEvent ) { + return hook( this.originalEvent ); + } + } : + function() { + if ( this.originalEvent ) { + return this.originalEvent[ name ]; + } + }, - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && button !== undefined ) { - event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); + set: function( value ) { + Object.defineProperty( this, name, { + enumerable: true, + configurable: true, + writable: true, + value: value + } ); } - - return event; - } + } ); }, - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // Create a writable copy of the event object and normalize some properties - var i, prop, copy, - type = event.type, - originalEvent = event, - fixHook = this.fixHooks[ type ]; - - if ( !fixHook ) { - this.fixHooks[ type ] = fixHook = - rmouseEvent.test( type ) ? this.mouseHooks : - rkeyEvent.test( type ) ? this.keyHooks : - {}; - } - copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; - - event = new jQuery.Event( originalEvent ); - - i = copy.length; - while ( i-- ) { - prop = copy[ i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Support: Cordova 2.5 (WebKit) (#13255) - // All events should have a target; Cordova deviceready doesn't - if ( !event.target ) { - event.target = document; - } - - // Support: Safari 6.0+, Chrome<28 - // Target should not be a text node (#504, #13143) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; + fix: function( originalEvent ) { + return originalEvent[ jQuery.expando ] ? + originalEvent : + new jQuery.Event( originalEvent ); }, special: { load: { + // Prevent triggered image.load events from bubbling to window.load noBubble: true }, focus: { + // Fire native event if possible so blur/focus sequence is correct trigger: function() { if ( this !== safeActiveElement() && this.focus ) { @@ -4609,9 +5319,10 @@ jQuery.event = { delegateType: "focusout" }, click: { + // For checkbox, fire native event so checked state will be right trigger: function() { - if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) { + if ( this.type === "checkbox" && this.click && nodeName( this, "input" ) ) { this.click(); return false; } @@ -4619,7 +5330,7 @@ jQuery.event = { // For cross-browser consistency, don't fire native .click() on links _default: function( event ) { - return jQuery.nodeName( event.target, "a" ); + return nodeName( event.target, "a" ); } }, @@ -4633,41 +5344,21 @@ jQuery.event = { } } } - }, - - simulate: function( type, elem, event, bubble ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true, - originalEvent: {} - } - ); - if ( bubble ) { - jQuery.event.trigger( e, null, elem ); - } else { - jQuery.event.dispatch.call( elem, e ); - } - if ( e.isDefaultPrevented() ) { - event.preventDefault(); - } } }; jQuery.removeEvent = function( elem, type, handle ) { + + // This "if" is needed for plain objects if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); + elem.removeEventListener( type, handle ); } }; jQuery.Event = function( src, props ) { + // Allow instantiation without the 'new' keyword - if ( !(this instanceof jQuery.Event) ) { + if ( !( this instanceof jQuery.Event ) ) { return new jQuery.Event( src, props ); } @@ -4680,11 +5371,22 @@ jQuery.Event = function( src, props ) { // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === undefined && - // Support: Android<4.0 + + // Support: Android <=2.3 only src.returnValue === false ? returnTrue : returnFalse; + // Create target properties + // Support: Safari <=6 - 7 only + // Target should not be a text node (#504, #13143) + this.target = ( src.target && src.target.nodeType === 3 ) ? + src.target.parentNode : + src.target; + + this.currentTarget = src.currentTarget; + this.relatedTarget = src.relatedTarget; + // Event type } else { this.type = src; @@ -4696,25 +5398,27 @@ jQuery.Event = function( src, props ) { } // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); + this.timeStamp = src && src.timeStamp || Date.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { + constructor: jQuery.Event, isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, + isSimulated: false, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; - if ( e && e.preventDefault ) { + if ( e && !this.isSimulated ) { e.preventDefault(); } }, @@ -4723,7 +5427,7 @@ jQuery.Event.prototype = { this.isPropagationStopped = returnTrue; - if ( e && e.stopPropagation ) { + if ( e && !this.isSimulated ) { e.stopPropagation(); } }, @@ -4732,7 +5436,7 @@ jQuery.Event.prototype = { this.isImmediatePropagationStopped = returnTrue; - if ( e && e.stopImmediatePropagation ) { + if ( e && !this.isSimulated ) { e.stopImmediatePropagation(); } @@ -4740,9 +5444,76 @@ jQuery.Event.prototype = { } }; +// Includes all common event props including KeyEvent and MouseEvent specific props +jQuery.each( { + altKey: true, + bubbles: true, + cancelable: true, + changedTouches: true, + ctrlKey: true, + detail: true, + eventPhase: true, + metaKey: true, + pageX: true, + pageY: true, + shiftKey: true, + view: true, + "char": true, + charCode: true, + key: true, + keyCode: true, + button: true, + buttons: true, + clientX: true, + clientY: true, + offsetX: true, + offsetY: true, + pointerId: true, + pointerType: true, + screenX: true, + screenY: true, + targetTouches: true, + toElement: true, + touches: true, + + which: function( event ) { + var button = event.button; + + // Add which for key events + if ( event.which == null && rkeyEvent.test( event.type ) ) { + return event.charCode != null ? event.charCode : event.keyCode; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { + if ( button & 1 ) { + return 1; + } + + if ( button & 2 ) { + return 3; + } + + if ( button & 4 ) { + return 2; + } + + return 0; + } + + return event.which; + } +}, jQuery.event.addProp ); + // Create mouseenter/leave events using mouseover/out and event-time checks -// Support: Chrome 15+ -jQuery.each({ +// so that event delegation works in jQuery. +// Do the same for pointerenter/pointerleave and pointerover/pointerout +// +// Support: Safari 7 only +// Safari sends mouseenter too often; see: +// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 +// for the description of the bug (it existed in older Chrome versions as well). +jQuery.each( { mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", @@ -4758,9 +5529,9 @@ jQuery.each({ related = event.relatedTarget, handleObj = event.handleObj; - // For mousenter/leave call the handler if related is outside the target. + // For mouseenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || (related !== target && !jQuery.contains( target, related )) ) { + if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; @@ -4768,115 +5539,33 @@ jQuery.each({ return ret; } }; -}); - -// Support: Firefox, Chrome, Safari -// Create "bubbling" focus and blur events -if ( !support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler on the document while someone wants focusin/focusout - var handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - var doc = this.ownerDocument || this, - attaches = data_priv.access( doc, fix ); - - if ( !attaches ) { - doc.addEventListener( orig, handler, true ); - } - data_priv.access( doc, fix, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this, - attaches = data_priv.access( doc, fix ) - 1; - - if ( !attaches ) { - doc.removeEventListener( orig, handler, true ); - data_priv.remove( doc, fix ); - - } else { - data_priv.access( doc, fix, attaches ); - } - } - }; - }); -} - -jQuery.fn.extend({ - - on: function( types, selector, data, fn, /*INTERNAL*/ one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - this.on( type, selector, data, types[ type ], one ); - } - return this; - } +} ); - if ( data == null && fn == null ) { - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return this; - } +jQuery.fn.extend( { - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return this.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - }); + on: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn ); }, one: function( types, selector, data, fn ) { - return this.on( types, selector, data, fn, 1 ); + return on( this, types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { + // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( - handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, + handleObj.namespace ? + handleObj.origType + "." + handleObj.namespace : + handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { + // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); @@ -4884,6 +5573,7 @@ jQuery.fn.extend({ return this; } if ( selector === false || typeof selector === "function" ) { + // ( types [, fn] ) fn = selector; selector = undefined; @@ -4891,96 +5581,57 @@ jQuery.fn.extend({ if ( fn === false ) { fn = returnFalse; } - return this.each(function() { + return this.each( function() { jQuery.event.remove( this, types, fn, selector ); - }); - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - triggerHandler: function( type, data ) { - var elem = this[0]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } + } ); } -}); +} ); var - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, - rtagName = /<([\w:]+)/, - rhtml = /<|&#?\w+;/, - rnoInnerhtml = /<(?:script|style|link)/i, - // checked="checked" or checked - rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, - rscriptType = /^$|\/(?:java|ecma)script/i, - rscriptTypeMasked = /^true\/(.*)/, - rcleanScript = /^\s*\s*$/g, - // We have to close these tags to support XHTML (#13200) - wrapMap = { + /* eslint-disable max-len */ - // Support: IE9 - option: [ 1, "" ], + // See https://github.com/eslint/eslint/issues/3229 + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi, - thead: [ 1, "", "
" ], - col: [ 2, "", "
" ], - tr: [ 2, "", "
" ], - td: [ 3, "", "
" ], - - _default: [ 0, "", "" ] - }; + /* eslint-enable */ -// Support: IE9 -wrapMap.optgroup = wrapMap.option; + // Support: IE <=10 - 11, Edge 12 - 13 only + // In IE/Edge using regex groups here causes severe slowdowns. + // See https://connect.microsoft.com/IE/feedback/details/1736512/ + rnoInnerhtml = /\s*$/g; -// Support: 1.x compatibility -// Manipulating tables requires a tbody +// Prefer a tbody over its parent table for containing new rows function manipulationTarget( elem, content ) { - return jQuery.nodeName( elem, "table" ) && - jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? + if ( nodeName( elem, "table" ) && + nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { + + return jQuery( elem ).children( "tbody" )[ 0 ] || elem; + } - elem.getElementsByTagName("tbody")[0] || - elem.appendChild( elem.ownerDocument.createElement("tbody") ) : - elem; + return elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { - elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type; + elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; return elem; } function restoreScript( elem ) { - var match = rscriptTypeMasked.exec( elem.type ); - - if ( match ) { - elem.type = match[ 1 ]; + if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { + elem.type = elem.type.slice( 5 ); } else { - elem.removeAttribute("type"); + elem.removeAttribute( "type" ); } return elem; } -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - data_priv.set( - elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" ) - ); - } -} - function cloneCopyEvent( src, dest ) { var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; @@ -4989,9 +5640,9 @@ function cloneCopyEvent( src, dest ) { } // 1. Copy private data: events, handlers, etc. - if ( data_priv.hasData( src ) ) { - pdataOld = data_priv.access( src ); - pdataCur = data_priv.set( dest, pdataOld ); + if ( dataPriv.hasData( src ) ) { + pdataOld = dataPriv.access( src ); + pdataCur = dataPriv.set( dest, pdataOld ); events = pdataOld.events; if ( events ) { @@ -5007,24 +5658,14 @@ function cloneCopyEvent( src, dest ) { } // 2. Copy user data - if ( data_user.hasData( src ) ) { - udataOld = data_user.access( src ); + if ( dataUser.hasData( src ) ) { + udataOld = dataUser.access( src ); udataCur = jQuery.extend( {}, udataOld ); - data_user.set( dest, udataCur ); + dataUser.set( dest, udataCur ); } } -function getAll( context, tag ) { - var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) : - context.querySelectorAll ? context.querySelectorAll( tag || "*" ) : - []; - - return tag === undefined || tag && jQuery.nodeName( context, tag ) ? - jQuery.merge( [ context ], ret ) : - ret; -} - // Fix IE bugs, see support tests function fixInput( src, dest ) { var nodeName = dest.nodeName.toLowerCase(); @@ -5039,145 +5680,172 @@ function fixInput( src, dest ) { } } -jQuery.extend({ - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var i, l, srcElements, destElements, - clone = elem.cloneNode( true ), - inPage = jQuery.contains( elem.ownerDocument, elem ); +function domManip( collection, args, callback, ignored ) { - // Fix IE cloning issues - if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && - !jQuery.isXMLDoc( elem ) ) { + // Flatten any nested arrays + args = concat.apply( [], args ); - // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 - destElements = getAll( clone ); - srcElements = getAll( elem ); + var fragment, first, scripts, hasScripts, node, doc, + i = 0, + l = collection.length, + iNoClone = l - 1, + value = args[ 0 ], + valueIsFunction = isFunction( value ); - for ( i = 0, l = srcElements.length; i < l; i++ ) { - fixInput( srcElements[ i ], destElements[ i ] ); + // We can't cloneNode fragments that contain checked, in WebKit + if ( valueIsFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return collection.each( function( index ) { + var self = collection.eq( index ); + if ( valueIsFunction ) { + args[ 0 ] = value.call( this, index, self.html() ); } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); + domManip( self, args, callback, ignored ); + } ); + } - for ( i = 0, l = srcElements.length; i < l; i++ ) { - cloneCopyEvent( srcElements[ i ], destElements[ i ] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } + if ( l ) { + fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); + first = fragment.firstChild; - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + if ( fragment.childNodes.length === 1 ) { + fragment = first; } - // Return the cloned set - return clone; - }, - - buildFragment: function( elems, context, scripts, selection ) { - var elem, tmp, tag, wrap, contains, j, - fragment = context.createDocumentFragment(), - nodes = [], - i = 0, - l = elems.length; + // Require either new content or an interest in ignored elements to invoke the callback + if ( first || ignored ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; - for ( ; i < l; i++ ) { - elem = elems[ i ]; + // Use the original fragment for the last item + // instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; - if ( elem || elem === 0 ) { + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); - // Add nodes directly - if ( jQuery.type( elem ) === "object" ) { - // Support: QtWebKit, PhantomJS - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } - // Convert html into DOM nodes - } else { - tmp = tmp || fragment.appendChild( context.createElement("div") ); + callback.call( collection[ i ], node, i ); + } - // Deserialize a standard representation - tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[ 2 ]; + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; - // Descend through wrappers to the right content - j = wrap[ 0 ]; - while ( j-- ) { - tmp = tmp.lastChild; - } + // Reenable scripts + jQuery.map( scripts, restoreScript ); - // Support: QtWebKit, PhantomJS - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, tmp.childNodes ); + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !dataPriv.access( node, "globalEval" ) && + jQuery.contains( doc, node ) ) { - // Remember the top-level container - tmp = fragment.firstChild; + if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { - // Ensure the created nodes are orphaned (#12392) - tmp.textContent = ""; + // Optional AJAX dependency, but won't run scripts if not present + if ( jQuery._evalUrl ) { + jQuery._evalUrl( node.src ); + } + } else { + DOMEval( node.textContent.replace( rcleanScript, "" ), doc, node ); + } + } } } } + } - // Remove wrapper from fragment - fragment.textContent = ""; + return collection; +} +function remove( elem, selector, keepData ) { + var node, + nodes = selector ? jQuery.filter( selector, elem ) : elem, i = 0; - while ( (elem = nodes[ i++ ]) ) { - // #4087 - If origin and destination elements are the same, and this is - // that element, do not do anything - if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { - continue; + for ( ; ( node = nodes[ i ] ) != null; i++ ) { + if ( !keepData && node.nodeType === 1 ) { + jQuery.cleanData( getAll( node ) ); + } + + if ( node.parentNode ) { + if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { + setGlobalEval( getAll( node, "script" ) ); } + node.parentNode.removeChild( node ); + } + } + + return elem; +} + +jQuery.extend( { + htmlPrefilter: function( html ) { + return html.replace( rxhtmlTag, "<$1>" ); + }, + + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var i, l, srcElements, destElements, + clone = elem.cloneNode( true ), + inPage = jQuery.contains( elem.ownerDocument, elem ); - contains = jQuery.contains( elem.ownerDocument, elem ); + // Fix IE cloning issues + if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && + !jQuery.isXMLDoc( elem ) ) { - // Append to fragment - tmp = getAll( fragment.appendChild( elem ), "script" ); + // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); - // Preserve script evaluation history - if ( contains ) { - setGlobalEval( tmp ); + for ( i = 0, l = srcElements.length; i < l; i++ ) { + fixInput( srcElements[ i ], destElements[ i ] ); } + } - // Capture executables - if ( scripts ) { - j = 0; - while ( (elem = tmp[ j++ ]) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + cloneCopyEvent( srcElements[ i ], destElements[ i ] ); } + } else { + cloneCopyEvent( elem, clone ); } } - return fragment; + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + // Return the cloned set + return clone; }, cleanData: function( elems ) { - var data, elem, type, key, + var data, elem, type, special = jQuery.event.special, i = 0; - for ( ; (elem = elems[ i ]) !== undefined; i++ ) { - if ( jQuery.acceptData( elem ) ) { - key = elem[ data_priv.expando ]; - - if ( key && (data = data_priv.cache[ key ]) ) { + for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { + if ( acceptData( elem ) ) { + if ( ( data = elem[ dataPriv.expando ] ) ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { @@ -5189,91 +5857,82 @@ jQuery.extend({ } } } - if ( data_priv.cache[ key ] ) { - // Discard any remaining `private` data - delete data_priv.cache[ key ]; - } + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataPriv.expando ] = undefined; + } + if ( elem[ dataUser.expando ] ) { + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataUser.expando ] = undefined; } } - // Discard any remaining `user` data - delete data_user.cache[ elem[ data_user.expando ] ]; } } -}); +} ); + +jQuery.fn.extend( { + detach: function( selector ) { + return remove( this, selector, true ); + }, + + remove: function( selector ) { + return remove( this, selector ); + }, -jQuery.fn.extend({ text: function( value ) { return access( this, function( value ) { return value === undefined ? jQuery.text( this ) : - this.empty().each(function() { + this.empty().each( function() { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { this.textContent = value; } - }); + } ); }, null, value, arguments.length ); }, append: function() { - return this.domManip( arguments, function( elem ) { + return domManip( this, arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.appendChild( elem ); } - }); + } ); }, prepend: function() { - return this.domManip( arguments, function( elem ) { + return domManip( this, arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.insertBefore( elem, target.firstChild ); } - }); + } ); }, before: function() { - return this.domManip( arguments, function( elem ) { + return domManip( this, arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } - }); + } ); }, after: function() { - return this.domManip( arguments, function( elem ) { + return domManip( this, arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } - }); - }, - - remove: function( selector, keepData /* Internal Use Only */ ) { - var elem, - elems = selector ? jQuery.filter( selector, this ) : this, - i = 0; - - for ( ; (elem = elems[i]) != null; i++ ) { - if ( !keepData && elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem ) ); - } - - if ( elem.parentNode ) { - if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { - setGlobalEval( getAll( elem, "script" ) ); - } - elem.parentNode.removeChild( elem ); - } - } - - return this; + } ); }, empty: function() { var elem, i = 0; - for ( ; (elem = this[i]) != null; i++ ) { + for ( ; ( elem = this[ i ] ) != null; i++ ) { if ( elem.nodeType === 1 ) { // Prevent memory leaks @@ -5291,9 +5950,9 @@ jQuery.fn.extend({ dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - return this.map(function() { + return this.map( function() { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - }); + } ); }, html: function( value ) { @@ -5310,7 +5969,7 @@ jQuery.fn.extend({ if ( typeof value === "string" && !rnoInnerhtml.test( value ) && !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { - value = value.replace( rxhtmlTag, "<$1>" ); + value = jQuery.htmlPrefilter( value ); try { for ( ; i < l; i++ ) { @@ -5326,7 +5985,7 @@ jQuery.fn.extend({ elem = 0; // If using innerHTML throws an exception, use the fallback method - } catch( e ) {} + } catch ( e ) {} } if ( elem ) { @@ -5336,115 +5995,25 @@ jQuery.fn.extend({ }, replaceWith: function() { - var arg = arguments[ 0 ]; - - // Make the changes, replacing each context element with the new content - this.domManip( arguments, function( elem ) { - arg = this.parentNode; - - jQuery.cleanData( getAll( this ) ); - - if ( arg ) { - arg.replaceChild( elem, this ); - } - }); - - // Force removal if there was no new content (e.g., from empty arguments) - return arg && (arg.length || arg.nodeType) ? this : this.remove(); - }, - - detach: function( selector ) { - return this.remove( selector, true ); - }, + var ignored = []; - domManip: function( args, callback ) { + // Make the changes, replacing each non-ignored context element with the new content + return domManip( this, arguments, function( elem ) { + var parent = this.parentNode; - // Flatten any nested arrays - args = concat.apply( [], args ); - - var fragment, first, scripts, hasScripts, node, doc, - i = 0, - l = this.length, - set = this, - iNoClone = l - 1, - value = args[ 0 ], - isFunction = jQuery.isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( isFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return this.each(function( index ) { - var self = set.eq( index ); - if ( isFunction ) { - args[ 0 ] = value.call( this, index, self.html() ); - } - self.domManip( args, callback ); - }); - } - - if ( l ) { - fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - if ( first ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - // Support: QtWebKit - // jQuery.merge because push.apply(_, arraylike) throws - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( this[ i ], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) { - - if ( node.src ) { - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl ) { - jQuery._evalUrl( node.src ); - } - } else { - jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) ); - } - } - } + if ( jQuery.inArray( this, ignored ) < 0 ) { + jQuery.cleanData( getAll( this ) ); + if ( parent ) { + parent.replaceChild( elem, this ); } } - } - return this; + // Force callback invocation + }, ignored ); } -}); +} ); -jQuery.each({ +jQuery.each( { appendTo: "append", prependTo: "prepend", insertBefore: "before", @@ -5462,117 +6031,152 @@ jQuery.each({ elems = i === last ? this : this.clone( true ); jQuery( insert[ i ] )[ original ]( elems ); - // Support: QtWebKit - // .get() because push.apply(_, arraylike) throws + // Support: Android <=4.0 only, PhantomJS 1 only + // .get() because push.apply(_, arraylike) throws on ancient WebKit push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; -}); +} ); +var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); + +var getStyles = function( elem ) { + // Support: IE <=11 only, Firefox <=30 (#15098, #14150) + // IE throws on elements created in popups + // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" + var view = elem.ownerDocument.defaultView; -var iframe, - elemdisplay = {}; + if ( !view || !view.opener ) { + view = window; + } -/** - * Retrieve the actual display of a element - * @param {String} name nodeName of the element - * @param {Object} doc Document object - */ -// Called only from within defaultDisplay -function actualDisplay( name, doc ) { - var style, - elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), + return view.getComputedStyle( elem ); + }; - // getDefaultComputedStyle might be reliably used only on attached element - display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? +var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); - // Use of this method is a temporary fix (more like optimization) until something better comes along, - // since it was removed from specification and supported only in FF - style.display : jQuery.css( elem[ 0 ], "display" ); - // We don't have any data stored on the element, - // so use "detach" method as fast way to get rid of the element - elem.detach(); - return display; -} +( function() { -/** - * Try to determine the default display value of an element - * @param {String} nodeName - */ -function defaultDisplay( nodeName ) { - var doc = document, - display = elemdisplay[ nodeName ]; + // Executing both pixelPosition & boxSizingReliable tests require only one layout + // so they're executed at the same time to save the second computation. + function computeStyleTests() { + + // This is a singleton, we need to execute it only once + if ( !div ) { + return; + } - if ( !display ) { - display = actualDisplay( nodeName, doc ); + container.style.cssText = "position:absolute;left:-11111px;width:60px;" + + "margin-top:1px;padding:0;border:0"; + div.style.cssText = + "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + + "margin:auto;border:1px;padding:1px;" + + "width:60%;top:1%"; + documentElement.appendChild( container ).appendChild( div ); + + var divStyle = window.getComputedStyle( div ); + pixelPositionVal = divStyle.top !== "1%"; - // If the simple way fails, read from inside an iframe - if ( display === "none" || !display ) { + // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 + reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; - // Use the already-created iframe if possible - iframe = (iframe || jQuery( "\n '),e.frameJs=e.frameJs||"dist/h5p-standalone-frame.min.js",e.frameCss=e.frameCss||"dist/css/h5p.css",e.h5pContent=e.h5pContent||"workspace",H5PIntegration.core={styles:[e.frameCss],scripts:[e.frameJs]},H5PIntegration.init(e.id,e.h5pContent)}}(H5P.jQuery),H5P.ContentType=function(e,t){function n(){}return n.prototype=new H5P.EventDispatcher,n.prototype.isRoot=function(){return e},n.prototype.getLibraryFilePath=function(e){return H5P.getLibraryPath(this.libraryInfo.versionedNameNoSpaces)+"/"+e},n};var H5P=H5P||{};H5P.Event=function(e,t,n){this.type=e,this.data=t;var r=!1,i=!1,o=!1;void 0===n&&(n={}),n.bubbles===!0&&(r=!0),n.external===!0&&(i=!0),this.preventBubbling=function(){r=!1},this.getBubbles=function(){return r},this.scheduleForExternal=function(){return i&&!o?(o=!0,!0):!1}},H5P.EventDispatcher=function(){function e(){var e=this,t={};this.on=function(n,r,i){if("function"!=typeof r)throw TypeError("listener must be a function");e.trigger("newListener",{type:n,listener:r});var o={listener:r,thisArg:i};t[n]?t[n].push(o):t[n]=[o]},this.once=function(t,n,r){if(!(n instanceof Function))throw TypeError("listener must be a function");var i=function(t){e.off(t.type,i),n.call(this,t)};e.on(t,i,r)},this.off=function(n,r){if(void 0!==r&&!(r instanceof Function))throw TypeError("listener must be a function");if(void 0!==t[n]){if(void 0===r)return delete t[n],void e.trigger("removeListener",n);for(var i=0;i0&&(this.data.statement.result.score.scaled=Math.round(e/t*1e4)/1e4))),"undefined"==typeof r?this.data.statement.result.completion="completed"===this.getVerb()||"answered"===this.getVerb():this.data.statement.result.completion=r,"undefined"!=typeof i&&(this.data.statement.result.success=i),n&&n.activityStartTime){var o=Math.round((Date.now()-n.activityStartTime)/10)/100;this.data.statement.result.duration="PT"+o+"S"}},H5P.XAPIEvent.prototype.setVerb=function(e){-1!==H5P.jQuery.inArray(e,H5P.XAPIEvent.allowedXAPIVerbs)?this.data.statement.verb={id:"http://adlnet.gov/expapi/verbs/"+e,display:{"en-US":e}}:void 0!==e.id&&(this.data.statement.verb=e)},H5P.XAPIEvent.prototype.getVerb=function(e){var t=this.data.statement;return"verb"in t?e===!0?t.verb:t.verb.id.slice(31):null},H5P.XAPIEvent.prototype.setObject=function(e){e.contentId&&(this.data.statement.object={id:this.getContentXAPIId(e),objectType:"Activity",definition:{extensions:{"http://h5p.org/x-api/h5p-local-content-id":e.contentId}}},e.subContentId?(this.data.statement.object.definition.extensions["http://h5p.org/x-api/h5p-subContentId"]=e.subContentId,"function"==typeof e.getTitle&&(this.data.statement.object.definition.name={"en-US":e.getTitle()})):H5PIntegration&&H5PIntegration.contents&&H5PIntegration.contents["cid-"+e.contentId].title&&(this.data.statement.object.definition.name={"en-US":H5P.createTitle(H5PIntegration.contents["cid-"+e.contentId].title)}))},H5P.XAPIEvent.prototype.setContext=function(e){if(e.parent&&(e.parent.contentId||e.parent.subContentId)){void 0===e.parent.subContentId?e.parent.contentId:e.parent.subContentId;this.data.statement.context={contextActivities:{parent:[{id:this.getContentXAPIId(e.parent),objectType:"Activity"}]}}}e.libraryInfo&&(void 0===this.data.statement.context&&(this.data.statement.context={contextActivities:{}}),this.data.statement.context.contextActivities.category=[{id:"http://h5p.org/libraries/"+e.libraryInfo.versionedNameNoSpaces,objectType:"Activity"}])},H5P.XAPIEvent.prototype.setActor=function(){if(void 0!==H5PIntegration.user)this.data.statement.actor={name:H5PIntegration.user.name,mbox:"mailto:"+H5PIntegration.user.mail,objectType:"Agent"};else{var e;try{localStorage.H5PUserUUID?e=localStorage.H5PUserUUID:(e=H5P.createUUID(),localStorage.H5PUserUUID=e)}catch(t){e="not-trackable-"+H5P.createUUID()}this.data.statement.actor={account:{name:e,homePage:H5PIntegration.siteUrl},objectType:"Agent"}}},H5P.XAPIEvent.prototype.getMaxScore=function(){return this.getVerifiedStatementValue(["result","score","max"])},H5P.XAPIEvent.prototype.getScore=function(){return this.getVerifiedStatementValue(["result","score","raw"])},H5P.XAPIEvent.prototype.getContentXAPIId=function(e){ -var t;return e.contentId&&H5PIntegration&&H5PIntegration.contents&&(t=H5PIntegration.contents["cid-"+e.contentId].url,e.subContentId&&(t+="?subContentId="+e.subContentId)),t},H5P.XAPIEvent.prototype.getVerifiedStatementValue=function(e){for(var t=this.data.statement,n=0;n6)&&(H5P.fullScreenBrowserPrefix="webkit")):document.documentElement.mozRequestFullScreen?H5P.fullScreenBrowserPrefix="moz":document.documentElement.msRequestFullscreen&&(H5P.fullScreenBrowserPrefix="ms"),H5P.DISABLE_NONE=0,H5P.DISABLE_FRAME=1,H5P.DISABLE_DOWNLOAD=2,H5P.DISABLE_EMBED=4,H5P.DISABLE_COPYRIGHT=8,H5P.DISABLE_ABOUT=16,H5P.opened={},H5P.init=function(e){void 0===H5P.$body&&(H5P.$body=H5P.jQuery(document.body)),void 0===H5P.canHasFullScreen&&(H5P.canHasFullScreen=H5P.isFramed&&H5P.externalEmbed!==!1?document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled?!0:!1:!0);H5P.jQuery(".h5p-content:not(.h5p-initialized)",e).each(function(){var e=H5P.jQuery(this).addClass("h5p-initialized"),t=H5P.jQuery('
').appendTo(e),n=e.data("content-id"),r=H5PIntegration.contents["cid-"+n];if(void 0===r)return H5P.error("No data for content id "+n+". Perhaps the library is gone?");var i={library:r.library,params:JSON.parse(r.jsonContent)};H5P.getUserData(n,"state",function(e,o){if(o)i.userDatas={state:o};else if(null===o&&H5PIntegration.saveFreq){delete r.contentUserData;var a=new H5P.Dialog("content-user-data-reset","Data Reset","

"+H5P.t("contentChanged")+"

"+H5P.t("startingOver")+'

OK
',t);H5P.jQuery(a).on("dialog-opened",function(e,t){var r=function(e){("click"===e.type||32===e.which)&&(a.close(),H5P.deleteUserData(n,"state",0))};t.find(".h5p-dialog-ok-button").click(r).keypress(r)}),a.open()}});var o=H5P.newRunnable(i,n,t,!0,{standalone:!0});1==r.fullScreen&&H5P.canHasFullScreen&&H5P.jQuery('
').prependTo(t).children().click(function(){H5P.fullScreen(t,o)});var a=H5P.jQuery('
    '),s=function(e,t,n){H5P.jQuery("
  • ",{"class":"h5p-button h5p-"+(n?n:e),role:"button",tabindex:0,title:H5P.t(e+"Description"),html:H5P.t(e),on:{click:t,keypress:function(e){32===e.which&&(t(),e.preventDefault())}},appendTo:a})};if(r.disable&H5P.DISABLE_DOWNLOAD||s("download",function(){window.location.href=r.exportUrl},"export"),!(r.disable&H5P.DISABLE_COPYRIGHT)){var c=H5P.getCopyrights(o,i.params,n);c&&s("copyrights",function(){var e=new H5P.Dialog("copyrights",H5P.t("copyrightInformation"),c,t);e.open()})}if(r.disable&H5P.DISABLE_EMBED||s("embed",function(){H5P.openEmbedDialog(a,r.embedCode,r.resizeCode,{width:e.width(),height:e.height()})}),r.disable&H5P.DISABLE_ABOUT||H5P.jQuery('
  • ').appendTo(a),r.disable&H5P.DISABLE_FRAME||!a.children().length?e.addClass("h5p-no-frame"):(a.insertAfter(t),e.addClass("h5p-frame")),H5P.opened[n]=new Date,H5P.on(o,"finish",function(e){void 0!==e.data&&H5P.setFinished(n,e.data.score,e.data.maxScore,e.data.time)}),H5P.on(o,"xAPI",H5P.xAPICompletedListener),H5PIntegration.saveFreq!==!1&&(o.getCurrentState instanceof Function||"function"==typeof o.getCurrentState)){var u,l=function(){var e=o.getCurrentState();void 0!==e&&H5P.setUserData(n,"state",e,{deleteOnChange:!0}),H5PIntegration.saveFreq&&(u=setTimeout(l,1e3*H5PIntegration.saveFreq))};H5PIntegration.saveFreq&&(u=setTimeout(l,1e3*H5PIntegration.saveFreq)),H5P.on(o,"xAPI",function(e){var t=e.getVerb();("completed"===t||"progressed"===t)&&(clearTimeout(u),u=setTimeout(l,3e3))})}if(H5P.isFramed){var d;if(H5P.externalEmbed===!1){var f=window.parent.document.getElementById("h5p-iframe-"+n),p=function(){if(!window.parent.H5P.isFullscreen){var e=f.parentElement.style.height;f.parentElement.style.height=f.parentElement.clientHeight+"px",f.style.height="1px",f.style.height=f.contentDocument.body.scrollHeight+"px",f.parentElement.style.height=e}};H5P.on(o,"resize",function(){clearTimeout(d),d=setTimeout(function(){p()},1)})}else if(H5P.communicator){var h=!1;H5P.communicator.on("ready",function(){H5P.communicator.send("hello")}),H5P.communicator.on("hello",function(){h=!0,document.body.style.height="auto",document.body.style.overflow="hidden",H5P.trigger(o,"resize")}),H5P.communicator.on("resizePrepared",function(e){H5P.communicator.send("resize",{scrollHeight:document.body.scrollHeight})}),H5P.communicator.on("resize",function(){H5P.trigger(o,"resize")}),H5P.on(o,"resize",function(){H5P.isFullscreen||(clearTimeout(d),d=setTimeout(function(){h?H5P.communicator.send("prepareResize",{scrollHeight:document.body.scrollHeight,clientHeight:document.body.clientHeight}):H5P.communicator.send("hello")},0))})}}H5P.isFramed&&H5P.externalEmbed!==!1||H5P.jQuery(window.parent).resize(function(){window.parent.H5P.isFullscreen?H5P.trigger(o,"resize"):H5P.trigger(o,"resize")}),H5P.instances.push(o),H5P.trigger(o,"resize")});H5P.jQuery("iframe.h5p-iframe:not(.h5p-initialized)",e).each(function(){var e=H5P.jQuery(this).addClass("h5p-initialized").data("content-id");this.contentDocument.open(),this.contentDocument.write(''+H5P.getHeadTags(e)+'
    '),this.contentDocument.close()})},H5P.getHeadTags=function(e){var t=function(e){for(var t="",n=0;n';return t},n=function(e){for(var t="",n=0;n';return t};return''+t(H5PIntegration.core.styles)+t(H5PIntegration.contents["cid-"+e].styles)+n(H5PIntegration.core.scripts)+n(H5PIntegration.contents["cid-"+e].scripts)+""},H5P.communicator=function(){function e(){var e=this,t={};window.addEventListener("message",function(e){window.parent===e.source&&"h5p"===e.data.context&&void 0!==t[e.data.action]&&t[e.data.action](e.data)},!1),e.on=function(e,n){t[e]=n},e.send=function(e,t){void 0===t&&(t={}),t.context="h5p",t.action=e,window.parent.postMessage(t,"*")}}return window.postMessage&&window.addEventListener?new e:void 0}(),H5P.semiFullScreen=function(e,t,n,r){H5P.fullScreen(e,t,n,r,!0)},H5P.fullScreen=function(e,t,n,r,i){if(void 0===H5P.exitFullScreen){if(H5P.isFramed&&H5P.externalEmbed===!1)return window.parent.H5P.fullScreen(e,t,n,H5P.$body.get(),i),H5P.isFullscreen=!0,H5P.exitFullScreen=function(){window.parent.H5P.exitFullScreen()},void H5P.on(t,"exitFullScreen",function(){H5P.isFullscreen=!1,H5P.exitFullScreen=void 0});var o,a,s=e;if(void 0===r)$body=H5P.$body;else{$body=H5P.jQuery(r),o=$body.add(e.get());var c="#h5p-iframe-"+e.parent().data("content-id");a=H5P.jQuery(c),e=a.parent()}o=e.add(H5P.$body).add(o);var u=function(e){o.addClass(e),void 0!==a&&a.css("height","")},l=function(){H5P.trigger(t,"resize"),H5P.trigger(t,"focus"),H5P.trigger(t,"enterFullScreen")},d=function(e){H5P.isFullscreen=!1,o.removeClass(e),H5P.trigger(t,"resize"),H5P.trigger(t,"focus"),H5P.exitFullScreen=void 0,void 0!==n&&n(),H5P.trigger(t,"exitFullScreen")};if(H5P.isFullscreen=!0,void 0===H5P.fullScreenBrowserPrefix||i===!0){if(H5P.isFramed)return;u("h5p-semi-fullscreen");var f,p=H5P.jQuery('
    ').appendTo(s.find(".h5p-content-controls")),h=H5P.exitFullScreen=function(){g?m.content=g:b.removeChild(m),p.remove(),$body.unbind("keyup",f),d("h5p-semi-fullscreen")};f=function(e){27===e.keyCode&&h()},p.click(h),$body.keyup(f);for(var g,m,v=document.getElementsByTagName("meta"),y=0;y-1?new u(e.params,t):new u(e.params,t,i),void 0===f.$&&(f.$=H5P.jQuery(f)),void 0===f.contentId&&(f.contentId=t),void 0===f.subContentId&&e.subContentId&&(f.subContentId=e.subContentId),void 0===f.parent&&i&&i.parent&&(f.parent=i.parent),void 0===f.libraryInfo&&(f.libraryInfo={versionedName:e.library,versionedNameNoSpaces:s+"-"+a[0]+"."+a[1],machineName:s,majorVersion:a[0],minorVersion:a[1]}),void 0!==n&&(n.toggleClass("h5p-standalone",d),f.attach(n),H5P.trigger(f,"domChanged",{$target:n,library:s,key:"newLibrary"},{bubbles:!0,external:!0}),void 0!==r&&r||H5P.trigger(f,"resize")),f},H5P.error=function(e){void 0!==window.console&&void 0!==console.error&&console.error(e.stack?e.stack:e)},H5P.t=function(e,t,n){if(void 0===n&&(n="H5P"),void 0===H5PIntegration.l10n[n])return'[Missing translation namespace "'+n+'"]';if(void 0===H5PIntegration.l10n[n][e])return'[Missing translation "'+e+'" in "'+n+'"]';var r=H5PIntegration.l10n[n][e];if(void 0!==t)for(var i in t)r=r.replace(i,t[i]);return r},H5P.Dialog=function(e,t,n,r){var i=this,o=H5P.jQuery('

    '+t+'

    '+n+'
    ').insertAfter(r).click(function(){i.close()}).children(".h5p-inner").click(function(){return!1}).find(".h5p-close").click(function(){i.close()}).end().find("a").click(function(e){e.stopPropagation()}).end().end();this.open=function(){setTimeout(function(){o.addClass("h5p-open"),H5P.jQuery(i).trigger("dialog-opened",[o])},1)},this.close=function(){o.removeClass("h5p-open"),setTimeout(function(){o.remove()},200)}},H5P.getCopyrights=function(e,t,n){var r;if(void 0!==e.getCopyrights)try{r=e.getCopyrights()}catch(i){}return void 0===r&&(r=new H5P.ContentCopyrights,H5P.findCopyrights(r,t,n)),void 0!==r&&(r=r.toString()),r},H5P.findCopyrights=function(e,t,n){for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(i instanceof Array)H5P.findCopyrights(e,i,n);else if(i instanceof Object)if(void 0===i.copyright||void 0===i.copyright.license||void 0===i.path||void 0===i.mime)H5P.findCopyrights(e,i,n);else{var o=new H5P.MediaCopyright(i.copyright);void 0!==i.width&&void 0!==i.height&&o.setThumbnail(new H5P.Thumbnail(H5P.getPath(i.path,n),i.width,i.height)),e.addMedia(o)}}},H5P.openEmbedDialog=function(e,t,n,r){var i=t+n,o=new H5P.Dialog("embed",H5P.t("embed"),''+H5P.t("size")+': × px
    '+H5P.t("showAdvanced")+'

    '+H5P.t("advancedHelp")+'

    ",e);H5P.jQuery(o).on("dialog-opened",function(e,t){var n=t.find(".h5p-inner"),o=n.find(".h5p-scroll-content"),a=o.outerHeight()-o.innerHeight(),s=function(){var e=n.height();o[0].scrollHeight+a>e?n.css("height",""):(n.css("height","auto"),e=n.height()),n.css("marginTop","-"+e/2+"px")},c=t.find(".h5p-embed-size:eq(0)"),u=t.find(".h5p-embed-size:eq(1)"),l=function(e,t){var n=parseFloat(e.val());return isNaN(n)?t:Math.ceil(n)},d=function(){t.find(".h5p-embed-code-container:first").val(i.replace(":w",l(c,r.width)).replace(":h",l(u,r.height)))};c.change(d),u.change(d),d(),t.find(".h5p-embed-code-container").each(function(e,t){H5P.jQuery(this).css("height",this.scrollHeight+"px").focus(function(){H5P.jQuery(this).select()})}),t.find(".h5p-embed-code-container").eq(0).select(),s();var f=function(){var e=H5P.jQuery(this),n=e.next();n.is(":visible")?(e.removeClass("h5p-open").text(H5P.t("showAdvanced")),n.hide()):(e.addClass("h5p-open").text(H5P.t("hideAdvanced")),n.show()),t.find(".h5p-embed-code-container").each(function(e,t){H5P.jQuery(this).css("height",this.scrollHeight+"px")}),s()};t.find(".h5p-expander").click(f).keypress(function(e){32===e.keyCode&&f.apply(this)})}),o.open()},H5P.ContentCopyrights=function(){var e,t=[],n=[];this.setLabel=function(t){e=t},this.addMedia=function(e){void 0!==e&&t.push(e)},this.addContent=function(e){void 0!==e&&n.push(e)},this.toString=function(){for(var r="",i=0;i"+e+""+r),r='
    '+r+"
    "),r}},H5P.MediaCopyright=function(e,t,n,r){var i,o=new H5P.DefinitionList,a=function(e){return void 0===t||void 0===t[e]?H5P.t(e):t[e]},s=function(e,t){return"license"===e?H5P.copyrightLicenses[t]:t};if(void 0!==e){for(var c in r)r.hasOwnProperty(c)&&(e[c]=r[c]);void 0===n&&(n=["title","author","year","source","license"]);for(var u=0;u'+e+"
    "),e)}},H5P.copyrightLicenses={U:"Undisclosed","CC BY":'Attribution 4.0',"CC BY-SA":'Attribution-ShareAlike 4.0',"CC BY-ND":'Attribution-NoDerivs 4.0',"CC BY-NC":'Attribution-NonCommercial 4.0',"CC BY-NC-SA":'Attribution-NonCommercial-ShareAlike 4.0',"CC BY-NC-ND":'Attribution-NonCommercial-NoDerivs 4.0',"GNU GPL":'General Public License v3',PD:"Public Domain","ODC PDDL":'Public Domain Dedication and Licence',"CC PDM":"Public Domain Mark",C:"Copyright"},H5P.Thumbnail=function(e,t,n){var r,i=100;void 0!==t&&(r=Math.round(i*(t/n))),this.toString=function(){return''+H5P.t("}},H5P.Field=function(e,t){this.getLabel=function(){return e},this.getValue=function(){return t}},H5P.DefinitionList=function(){var e=[];this.add=function(t){e.push(t)},this.size=function(){return e.length},this.get=function(t){return e[t]},this.toString=function(){for(var t="",n=0;n"+r.getLabel()+"
    "+r.getValue()+"
    "}return""===t?t:'
    '+t+"
    "}},H5P.Coords=function(e,t,n,r){return this instanceof H5P.Coords?(this.x=0,this.y=0,this.w=1,this.h=1,"object"==typeof e?(this.x=e.x,this.y=e.y,this.w=e.w,this.h=e.h):(void 0!==e&&(this.x=e),void 0!==t&&(this.y=t),void 0!==n&&(this.w=n),void 0!==r&&(this.h=r)),this):new H5P.Coords(e,t,n,r)},H5P.libraryFromString=function(e){var t=/(.+)\s(\d+)\.(\d+)$/g,n=t.exec(e);return null!==n?{machineName:n[1],majorVersion:n[2],minorVersion:n[3]}:!1},H5P.getLibraryPath=function(e){return(void 0!==H5PIntegration.libraryUrl?H5PIntegration.libraryUrl+"/":H5PIntegration.url+"/libraries/")+e},H5P.cloneObject=function(e,t){var n=e instanceof Array?[]:{};for(var r in e)e.hasOwnProperty(r)&&(void 0!==t&&t&&"object"==typeof e[r]?n[r]=H5P.cloneObject(e[r],t):n[r]=e[r]);return n},H5P.trim=function(e){return e.replace(/^\s+|\s+$/g,"")},H5P.jsLoaded=function(e){return H5PIntegration.loadedJs=H5PIntegration.loadedJs||[],-1!==H5P.jQuery.inArray(e,H5PIntegration.loadedJs)},H5P.cssLoaded=function(e){return H5PIntegration.loadedCss=H5PIntegration.loadedCss||[],-1!==H5P.jQuery.inArray(e,H5PIntegration.loadedCss)},H5P.shuffleArray=function(e){if(e instanceof Array){var t,n,r,i=e.length;if(0===i)return!1;for(;--i;)t=Math.floor(Math.random()*(i+1)),n=e[i],r=e[t],e[i]=r,e[t]=n;return e}},H5P.setFinished=function(e,t,n,r){if("number"==typeof t&&H5PIntegration.postUserStatistics===!0){var i=function(e){return Math.round(e.getTime()/1e3)};H5P.jQuery.post(H5PIntegration.ajax.setFinished,{contentId:e,score:t,maxScore:n,opened:i(H5P.opened[e]),finished:i(new Date),time:r,token:H5PIntegration.tokens.result})}},Array.prototype.indexOf||(Array.prototype.indexOf=function(e){for(var t=0;t
    ").text(e.replace(/(<([^>]+)>)/gi,"")).text();return n.length>t&&(n=n.substr(0,t-3)+"..."),n},function(e){function t(t,n,r,i,o,a,s,c){if(void 0===H5PIntegration.user)return void i("Not signed in.");var u={url:H5PIntegration.ajax.contentUserData.replace(":contentId",t).replace(":dataType",n).replace(":subContentId",r?r:0),dataType:"json",async:void 0===c?!0:c};void 0!==o?(u.type="POST",u.data={data:null===o?0:o,preload:a?1:0,invalidate:s?1:0,token:H5PIntegration.tokens.contentUserData}):u.type="GET",void 0!==i&&(u.error=function(e,t){i(t)},u.success=function(e){return e.success?e.data===!1||void 0===e.data?void i():void i(void 0,e.data):void i(e.message)}),e.ajax(u)}H5P.getUserData=function(e,n,r,i){i||(i=0),H5PIntegration.contents=H5PIntegration.contents||{};var o=H5PIntegration.contents["cid-"+e]||{},a=o.contentUserData;if(a&&a[i]&&void 0!==a[i][n]){if("RESET"===a[i][n])return void r(void 0,null);try{r(void 0,JSON.parse(a[i][n]))}catch(s){r(s)}}else t(e,n,i,function(e,t){if(e||void 0===t)return void r(e,t);void 0===o.contentUserData&&(o.contentUserData=a={}),void 0===a[i]&&(a[i]={}),a[i][n]=t;try{r(void 0,JSON.parse(t))}catch(s){r(s)}})},H5P.setUserData=function(e,n,r,i){var o=H5P.jQuery.extend(!0,{},{subContentId:0,preloaded:!0,deleteOnChange:!1,async:!0},i);try{r=JSON.stringify(r)}catch(a){return void(o.errorCallback&&o.errorCallback(a))}var s=H5PIntegration.contents["cid-"+e];void 0===s&&(s=H5PIntegration.contents["cid-"+e]={}),s.contentUserData||(s.contentUserData={});var c=s.contentUserData;void 0===c[o.subContentId]&&(c[o.subContentId]={}),r!==c[o.subContentId][n]&&(c[o.subContentId][n]=r,t(e,n,o.subContentId,function(e,t){o.errorCallback&&e&&o.errorCallback(e)},r,o.preloaded,o.deleteOnChange,o.async))},H5P.deleteUserData=function(e,n,r){r||(r=0);var i=H5PIntegration.contents["cid-"+e].contentUserData;i&&i[r]&&i[r][n]&&delete i[r][n],t(e,n,r,void 0,null)},e(document).ready(function(){if(H5P.preventInit||H5P.init(document.body),H5PIntegration.saveFreq!==!1){var e=0,t=function(){var t=(new Date).getTime();if(t-e>250){e=t;for(var n=0;n0)for(var n=t,r=Array.isArray(n),i=0,n=r?n:n[Symbol.iterator]();;){var o;if(r){if(i>=n.length)break;o=n[i++]}else{if(i=n.next(),i.done)break;o=i.value}var a=o;if("string"!=typeof a||!a)throw new TypeError("Dependency name must be given as a not empty string");this.edges.push([e,a])}else this.edges.push([e]);return this},e.prototype.sort=function(){for(var e=this,t=[],n=this.edges,r=Array.isArray(n),i=0,n=r?n:n[Symbol.iterator]();;){var o;if(r){if(i>=n.length)break;o=n[i++]}else{if(i=n.next(),i.done)break;o=i.value}for(var a=o,s=a,u=Array.isArray(s),c=0,s=u?s:s[Symbol.iterator]();;){var l;if(u){if(c>=s.length)break;l=s[c++]}else{if(c=s.next(),c.done)break;l=c.value}var d=l;-1===t.indexOf(d)&&t.push(d)}}for(var f=t.length,p=new Array(t.length),h=function x(n,r){if(0!==r.length&&-1!==r.indexOf(n))throw new Error("Cyclic dependency found. "+n+" is dependent of itself.\nDependency chain: "+r.join(" -> ")+" => "+n);var i=t.indexOf(n);if(-1!==i){var o=!1;t[i]=!1;for(var a=e.edges,s=Array.isArray(a),u=0,a=s?a:a[Symbol.iterator]();;){var c;if(s){if(u>=a.length)break;c=a[u++]}else{if(u=a.next(),u.done)break;c=u.value}var l=c;l[0]===n&&(o=o||r.concat([n]),x(l[1],o))}p[--f]=n}},g=0;g=v.length)break;b=v[y++]}else{if(y=v.next(),y.done)break;b=y.value}var a=b;a[0]===d&&h(a[1],[d])}p[--f]=d}}return p},e.prototype.clear=function(){return this.edges=[],this},e}();t.exports=r}),function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";function n(e,t,n){t=t||ae;var r,i=t.createElement("script");if(i.text=e,n)for(r in xe)n[r]&&(i[r]=n[r]);t.head.appendChild(i).parentNode.removeChild(i)}function r(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?fe[pe.call(e)]||"object":typeof e}function i(e){var t=!!e&&"length"in e&&e.length,n=r(e);return ye(e)||be(e)?!1:"array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e}function o(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}function a(e,t,n){return ye(t)?He.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?He.grep(e,function(e){return e===t!==n}):"string"!=typeof t?He.grep(e,function(e){return de.call(t,e)>-1!==n}):He.filter(t,e,n)}function s(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function u(e){var t={};return He.each(e.match(Le)||[],function(e,n){t[n]=!0}),t}function c(e){return e}function l(e){throw e}function d(e,t,n,r){var i;try{e&&ye(i=e.promise)?i.call(e).done(t).fail(n):e&&ye(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}function f(){ae.removeEventListener("DOMContentLoaded",f),e.removeEventListener("load",f),He.ready()}function p(e,t){return t.toUpperCase()}function h(e){return e.replace(Me,"ms-").replace(Be,p)}function g(){this.expando=He.expando+g.uid++}function v(e){return"true"===e?!0:"false"===e?!1:"null"===e?null:e===+e+""?+e:Ue.test(e)?JSON.parse(e):e}function m(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(ze,"-$&").toLowerCase(),n=e.getAttribute(r),"string"==typeof n){try{n=v(n)}catch(i){}$e.set(e,t,n)}else n=void 0;return n}function y(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return He.css(e,t,"")},u=s(),c=n&&n[3]||(He.cssNumber[t]?"":"px"),l=(He.cssNumber[t]||"px"!==c&&+u)&&We.exec(He.css(e,t));if(l&&l[3]!==c){for(u/=2,c=c||l[3],l=+u||1;a--;)He.style(e,t,l+c),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),l/=o;l=2*l,He.style(e,t,l+c),n=n||[]}return n&&(l=+l||+u||0,i=n[1]?l+(n[1]+1)*n[2]:+n[2],r&&(r.unit=c,r.start=l,r.end=i)),i}function b(e){var t,n=e.ownerDocument,r=e.nodeName,i=Je[r];return i?i:(t=n.body.appendChild(n.createElement(r)),i=He.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),Je[r]=i,i)}function x(e,t){for(var n,r,i=[],o=0,a=e.length;a>o;o++)r=e[o],r.style&&(n=r.style.display,t?("none"===n&&(i[o]=Ve.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&_e(r)&&(i[o]=b(r))):"none"!==n&&(i[o]="none",Ve.set(r,"display",n)));for(o=0;a>o;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}function P(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&o(e,t)?He.merge([e],n):n}function H(e,t){for(var n=0,r=e.length;r>n;n++)Ve.set(e[n],"globalEval",!t||Ve.get(t[n],"globalEval"))}function w(e,t,n,i,o){for(var a,s,u,c,l,d,f=t.createDocumentFragment(),p=[],h=0,g=e.length;g>h;h++)if(a=e[h],a||0===a)if("object"===r(a))He.merge(p,a.nodeType?[a]:a);else if(tt.test(a)){for(s=s||f.appendChild(t.createElement("div")),u=(Ke.exec(a)||["",""])[1].toLowerCase(),c=et[u]||et._default,s.innerHTML=c[1]+He.htmlPrefilter(a)+c[2],d=c[0];d--;)s=s.lastChild;He.merge(p,s.childNodes),s=f.firstChild,s.textContent=""}else p.push(t.createTextNode(a));for(f.textContent="",h=0;a=p[h++];)if(i&&He.inArray(a,i)>-1)o&&o.push(a);else if(l=He.contains(a.ownerDocument,a),s=P(f.appendChild(a),"script"),l&&H(s),n)for(d=0;a=s[d++];)Ze.test(a.type||"")&&n.push(a);return f}function C(){return!0}function T(){return!1}function S(){try{return ae.activeElement}catch(e){}}function E(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)E(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),i===!1)i=T;else if(!i)return e;return 1===o&&(a=i,i=function(e){return He().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=He.guid++)),e.each(function(){He.event.add(this,t,i,r,n)})}function A(e,t){return o(e,"table")&&o(11!==t.nodeType?t:t.firstChild,"tr")?He(e).children("tbody")[0]||e:e}function D(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function I(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function k(e,t){var n,r,i,o,a,s,u,c;if(1===t.nodeType){if(Ve.hasData(e)&&(o=Ve.access(e),a=Ve.set(t,o),c=o.events)){delete a.handle,a.events={};for(i in c)for(n=0,r=c[i].length;r>n;n++)He.event.add(t,i,c[i][n])}$e.hasData(e)&&(s=$e.access(e),u=He.extend({},s),$e.set(t,u))}}function j(e,t){var n=t.nodeName.toLowerCase();"input"===n&&Ge.test(e.type)?t.checked=e.checked:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}function N(e,t,r,i){t=ce.apply([],t);var o,a,s,u,c,l,d=0,f=e.length,p=f-1,h=t[0],g=ye(h);if(g||f>1&&"string"==typeof h&&!me.checkClone&&ut.test(h))return e.each(function(n){var o=e.eq(n);g&&(t[0]=h.call(this,n,o.html())),N(o,t,r,i)});if(f&&(o=w(t,e[0].ownerDocument,!1,e,i),a=o.firstChild,1===o.childNodes.length&&(o=a),a||i)){for(s=He.map(P(o,"script"),D),u=s.length;f>d;d++)c=o,d!==p&&(c=He.clone(c,!0,!0),u&&He.merge(s,P(c,"script"))),r.call(e[d],c,d);if(u)for(l=s[s.length-1].ownerDocument,He.map(s,I),d=0;u>d;d++)c=s[d],Ze.test(c.type||"")&&!Ve.access(c,"globalEval")&&He.contains(l,c)&&(c.src&&"module"!==(c.type||"").toLowerCase()?He._evalUrl&&He._evalUrl(c.src):n(c.textContent.replace(ct,""),l,c))}return e}function L(e,t,n){for(var r,i=t?He.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||He.cleanData(P(r)),r.parentNode&&(n&&He.contains(r.ownerDocument,r)&&H(P(r,"script")),r.parentNode.removeChild(r));return e}function q(e,t,n){var r,i,o,a,s=e.style;return n=n||dt(e),n&&(a=n.getPropertyValue(t)||n[t],""!==a||He.contains(e.ownerDocument,e)||(a=He.style(e,t)),!me.pixelBoxStyles()&<.test(a)&&ft.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function O(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function F(e){if(e in yt)return e;for(var t=e[0].toUpperCase()+e.slice(1),n=mt.length;n--;)if(e=mt[n]+t,e in yt)return e}function M(e){var t=He.cssProps[e];return t||(t=He.cssProps[e]=F(e)||e),t}function B(e,t,n){var r=We.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function R(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;4>a;a+=2)"margin"===n&&(u+=He.css(e,n+Qe[a],!0,i)),r?("content"===n&&(u-=He.css(e,"padding"+Qe[a],!0,i)),"margin"!==n&&(u-=He.css(e,"border"+Qe[a]+"Width",!0,i))):(u+=He.css(e,"padding"+Qe[a],!0,i),"padding"!==n?u+=He.css(e,"border"+Qe[a]+"Width",!0,i):s+=He.css(e,"border"+Qe[a]+"Width",!0,i));return!r&&o>=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))),u}function V(e,t,n){var r=dt(e),i=q(e,t,r),o="border-box"===He.css(e,"boxSizing",!1,r),a=o;if(lt.test(i)){if(!n)return i;i="auto"}return a=a&&(me.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===He.css(e,"display",!1,r))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),i=parseFloat(i)||0,i+R(e,t,n||(o?"border":"content"),a,r,i)+"px"}function $(e,t,n,r,i){return new $.prototype.init(e,t,n,r,i)}function U(){xt&&(ae.hidden===!1&&e.requestAnimationFrame?e.requestAnimationFrame(U):e.setTimeout(U,He.fx.interval),He.fx.tick())}function z(){return e.setTimeout(function(){bt=void 0}),bt=Date.now()}function X(e,t){var n,r=0,i={height:e};for(t=t?1:0;4>r;r+=2-t)n=Qe[r],i["margin"+n]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function W(e,t,n){for(var r,i=(Y.tweeners[t]||[]).concat(Y.tweeners["*"]),o=0,a=i.length;a>o;o++)if(r=i[o].call(n,t,e))return r}function Q(e,t,n){var r,i,o,a,s,u,c,l,d="width"in t||"height"in t,f=this,p={},h=e.style,g=e.nodeType&&_e(e),v=Ve.get(e,"fxshow");n.queue||(a=He._queueHooks(e,"fx"),null==a.unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,f.always(function(){f.always(function(){a.unqueued--,He.queue(e,"fx").length||a.empty.fire()})}));for(r in t)if(i=t[r],Pt.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}p[r]=v&&v[r]||He.style(e,r)}if(u=!He.isEmptyObject(t),u||!He.isEmptyObject(p)){d&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],c=v&&v.display,null==c&&(c=Ve.get(e,"display")),l=He.css(e,"display"),"none"===l&&(c?l=c:(x([e],!0),c=e.style.display||c,l=He.css(e,"display"),x([e]))),("inline"===l||"inline-block"===l&&null!=c)&&"none"===He.css(e,"float")&&(u||(f.done(function(){h.display=c}),null==c&&(l=h.display,c="none"===l?"":l)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",f.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1;for(r in p)u||(v?"hidden"in v&&(g=v.hidden):v=Ve.access(e,"fxshow",{display:c}),o&&(v.hidden=!g),g&&x([e],!0),f.done(function(){g||x([e]),Ve.remove(e,"fxshow");for(r in p)He.style(e,r,p[r])})),u=W(g?v[r]:0,r,f),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}}function _(e,t){var n,r,i,o,a;for(n in e)if(r=h(n),i=t[r],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=He.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function Y(e,t,n){var r,i,o=0,a=Y.prefilters.length,s=He.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=bt||z(),n=Math.max(0,c.startTime+c.duration-t),r=n/c.duration||0,o=1-r,a=0,u=c.tweens.length;u>a;a++)c.tweens[a].run(o);return s.notifyWith(e,[c,o,n]),1>o&&u?n:(u||s.notifyWith(e,[c,1,0]),s.resolveWith(e,[c]),!1)},c=s.promise({elem:e,props:He.extend({},t),opts:He.extend(!0,{specialEasing:{},easing:He.easing._default},n),originalProperties:t,originalOptions:n,startTime:bt||z(),duration:n.duration,tweens:[],createTween:function(t,n){var r=He.Tween(e,c.opts,t,n,c.opts.specialEasing[t]||c.opts.easing);return c.tweens.push(r),r},stop:function(t){var n=0,r=t?c.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)c.tweens[n].run(1);return t?(s.notifyWith(e,[c,1,0]),s.resolveWith(e,[c,t])):s.rejectWith(e,[c,t]),this}}),l=c.props;for(_(l,c.opts.specialEasing);a>o;o++)if(r=Y.prefilters[o].call(c,e,l,c.opts))return ye(r.stop)&&(He._queueHooks(c.elem,c.opts.queue).stop=r.stop.bind(r)),r;return He.map(l,W,c),ye(c.opts.start)&&c.opts.start.call(e,c),c.progress(c.opts.progress).done(c.opts.done,c.opts.complete).fail(c.opts.fail).always(c.opts.always),He.fx.timer(He.extend(u,{elem:e,anim:c,queue:c.opts.queue})),c}function J(e){var t=e.match(Le)||[];return t.join(" ")}function G(e){return e.getAttribute&&e.getAttribute("class")||""}function K(e){return Array.isArray(e)?e:"string"==typeof e?e.match(Le)||[]:[]}function Z(e,t,n,i){var o;if(Array.isArray(t))He.each(t,function(t,r){n||Nt.test(e)?i(e,r):Z(e+"["+("object"==typeof r&&null!=r?t:"")+"]",r,n,i)});else if(n||"object"!==r(t))i(e,t);else for(o in t)Z(e+"["+o+"]",t[o],n,i)}function ee(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(Le)||[];if(ye(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function te(e,t,n,r){function i(s){var u;return o[s]=!0,He.each(e[s]||[],function(e,s){var c=s(t,n,r);return"string"!=typeof c||a||o[c]?a?!(u=c):void 0:(t.dataTypes.unshift(c),i(c),!1)}),u}var o={},a=e===Xt;return i(t.dataTypes[0])||!o["*"]&&i("*")}function ne(e,t){var n,r,i=He.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&He.extend(!0,e,r),e}function re(e,t,n){for(var r,i,o,a,s=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}return o?(o!==u[0]&&u.unshift(o),n[o]):void 0}function ie(e,t,n,r){var i,o,a,s,u,c={},l=e.dataTypes.slice();if(l[1])for(a in e.converters)c[a.toLowerCase()]=e.converters[a];for(o=l.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=l.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(a=c[u+" "+o]||c["* "+o],!a)for(i in c)if(s=i.split(" "),s[1]===o&&(a=c[u+" "+s[0]]||c["* "+s[0]])){a===!0?a=c[i]:c[i]!==!0&&(o=s[0],l.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(d){return{state:"parsererror",error:a?d:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}var oe=[],ae=e.document,se=Object.getPrototypeOf,ue=oe.slice,ce=oe.concat,le=oe.push,de=oe.indexOf,fe={},pe=fe.toString,he=fe.hasOwnProperty,ge=he.toString,ve=ge.call(Object),me={},ye=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},be=function(e){return null!=e&&e===e.window},xe={type:!0,src:!0,noModule:!0},Pe="3.3.1",He=function(e,t){return new He.fn.init(e,t)},we=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;He.fn=He.prototype={jquery:Pe,constructor:He,length:0,toArray:function(){return ue.call(this)},get:function(e){return null==e?ue.call(this):0>e?this[e+this.length]:this[e]},pushStack:function(e){var t=He.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return He.each(this,e)},map:function(e){return this.pushStack(He.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(ue.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:le,sort:oe.sort,splice:oe.splice},He.extend=He.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,c=!1;for("boolean"==typeof a&&(c=a,a=arguments[s]||{},s++),"object"==typeof a||ye(a)||(a={}),s===u&&(a=this,s--);u>s;s++)if(null!=(e=arguments[s]))for(t in e)n=a[t],r=e[t],a!==r&&(c&&r&&(He.isPlainObject(r)||(i=Array.isArray(r)))?(i?(i=!1,o=n&&Array.isArray(n)?n:[]):o=n&&He.isPlainObject(n)?n:{},a[t]=He.extend(c,o,r)):void 0!==r&&(a[t]=r));return a},He.extend({expando:"jQuery"+(Pe+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return e&&"[object Object]"===pe.call(e)?(t=se(e))?(n=he.call(t,"constructor")&&t.constructor,"function"==typeof n&&ge.call(n)===ve):!0:!1},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e){n(e)},each:function(e,t){var n,r=0;if(i(e))for(n=e.length;n>r&&t.call(e[r],r,e[r])!==!1;r++);else for(r in e)if(t.call(e[r],r,e[r])===!1)break;return e},trim:function(e){return null==e?"":(e+"").replace(we,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(i(Object(e))?He.merge(n,"string"==typeof e?[e]:e):le.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:de.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;n>r;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r,i=[],o=0,a=e.length,s=!n;a>o;o++)r=!t(e[o],o),r!==s&&i.push(e[o]);return i},map:function(e,t,n){var r,o,a=0,s=[];if(i(e))for(r=e.length;r>a;a++)o=t(e[a],a,n),null!=o&&s.push(o);else for(a in e)o=t(e[a],a,n),null!=o&&s.push(o);return ce.apply([],s)},guid:1,support:me}),"function"==typeof Symbol&&(He.fn[Symbol.iterator]=oe[Symbol.iterator]),He.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){fe["[object "+t+"]"]=t.toLowerCase()});var Ce=function(e){function t(e,t,n,r){var i,o,a,s,u,c,l,f=t&&t.ownerDocument,h=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==h&&9!==h&&11!==h)return n;if(!r&&((t?t.ownerDocument||t:V)!==N&&j(t),t=t||N,q)){if(11!==h&&(u=me.exec(e)))if(i=u[1]){if(9===h){if(!(a=t.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&B(t,a)&&a.id===i)return n.push(a),n}else{if(u[2])return K.apply(n,t.getElementsByTagName(e)),n;if((i=u[3])&&H.getElementsByClassName&&t.getElementsByClassName)return K.apply(n,t.getElementsByClassName(i)),n}if(H.qsa&&!W[e+" "]&&(!O||!O.test(e))){if(1!==h)f=t,l=e;else if("object"!==t.nodeName.toLowerCase()){for((s=t.getAttribute("id"))?s=s.replace(Pe,He):t.setAttribute("id",s=R),c=S(e),o=c.length;o--;)c[o]="#"+s+" "+p(c[o]);l=c.join(","),f=ye.test(e)&&d(t.parentNode)||t}if(l)try{return K.apply(n,f.querySelectorAll(l)),n}catch(g){}finally{s===R&&t.removeAttribute("id")}}}return A(e.replace(se,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>w.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[R]=!0,e}function i(e){var t=N.createElement("fieldset");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=n.length;r--;)w.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function u(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return function(t){return"form"in t?t.parentNode&&t.disabled===!1?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&Ce(t)===e:t.disabled===e:"label"in t?t.disabled===e:!1}}function l(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function d(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function f(){}function p(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function h(e,t,n){var r=t.dir,i=t.next,o=i||r,a=n&&"parentNode"===o,s=U++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||a)return e(t,n,i);return!1}:function(t,n,u){var c,l,d,f=[$,s];if(u){for(;t=t[r];)if((1===t.nodeType||a)&&e(t,n,u))return!0}else for(;t=t[r];)if(1===t.nodeType||a)if(d=t[R]||(t[R]={}),l=d[t.uniqueID]||(d[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((c=l[o])&&c[0]===$&&c[1]===s)return f[2]=c[2];if(l[o]=f,f[2]=e(t,n,u))return!0}return!1}}function g(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function v(e,n,r){for(var i=0,o=n.length;o>i;i++)t(e,n[i],r);return r}function m(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,c=null!=t;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),c&&t.push(s));return a}function y(e,t,n,i,o,a){return i&&!i[R]&&(i=y(i)),o&&!o[R]&&(o=y(o,a)),r(function(r,a,s,u){var c,l,d,f=[],p=[],h=a.length,g=r||v(t||"*",s.nodeType?[s]:s,[]),y=!e||!r&&t?g:m(g,f,e,s,u),b=n?o||(r?e:h||i)?[]:a:y;if(n&&n(y,b,s,u),i)for(c=m(b,p),i(c,[],s,u),l=c.length;l--;)(d=c[l])&&(b[p[l]]=!(y[p[l]]=d));if(r){if(o||e){if(o){for(c=[],l=b.length;l--;)(d=b[l])&&c.push(y[l]=d);o(null,b=[],c,u)}for(l=b.length;l--;)(d=b[l])&&(c=o?ee(r,d):f[l])>-1&&(r[c]=!(a[c]=d))}}else b=m(b===a?b.splice(h,b.length):b),o?o(null,a,b,u):K.apply(a,b)})}function b(e){for(var t,n,r,i=e.length,o=w.relative[e[0].type],a=o||w.relative[" "],s=o?1:0,u=h(function(e){return e===t},a,!0),c=h(function(e){return ee(t,e)>-1},a,!0),l=[function(e,n,r){var i=!o&&(r||n!==D)||((t=n).nodeType?u(e,n,r):c(e,n,r));return t=null,i}];i>s;s++)if(n=w.relative[e[s].type])l=[h(g(l),n)];else{if(n=w.filter[e[s].type].apply(null,e[s].matches),n[R]){for(r=++s;i>r&&!w.relative[e[r].type];r++);return y(s>1&&g(l),s>1&&p(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(se,"$1"),n,r>s&&b(e.slice(s,r)),i>r&&b(e=e.slice(r)),i>r&&p(e))}l.push(n)}return g(l)}function x(e,n){var i=n.length>0,o=e.length>0,a=function(r,a,s,u,c){var l,d,f,p=0,h="0",g=r&&[],v=[],y=D,b=r||o&&w.find.TAG("*",c),x=$+=null==y?1:Math.random()||.1,P=b.length;for(c&&(D=a===N||a||c);h!==P&&null!=(l=b[h]);h++){if(o&&l){for(d=0,a||l.ownerDocument===N||(j(l),s=!q);f=e[d++];)if(f(l,a||N,s)){u.push(l);break}c&&($=x)}i&&((l=!f&&l)&&p--,r&&g.push(l))}if(p+=h,i&&h!==p){for(d=0;f=n[d++];)f(g,v,a,s);if(r){if(p>0)for(;h--;)g[h]||v[h]||(v[h]=J.call(u));v=m(v)}K.apply(u,v),c&&!r&&v.length>0&&p+n.length>1&&t.uniqueSort(u)}return c&&($=x,D=y),g};return i?r(a):a}var P,H,w,C,T,S,E,A,D,I,k,j,N,L,q,O,F,M,B,R="sizzle"+1*new Date,V=e.document,$=0,U=0,z=n(),X=n(),W=n(),Q=function(e,t){return e===t&&(k=!0),0},_={}.hasOwnProperty,Y=[],J=Y.pop,G=Y.push,K=Y.push,Z=Y.slice,ee=function(e,t){for(var n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1},te="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ne="[\\x20\\t\\r\\n\\f]",re="(?:\\\\.|[\\w-]|[^\x00-\\xa0])+",ie="\\["+ne+"*("+re+")(?:"+ne+"*([*^$|!~]?=)"+ne+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+re+"))|)"+ne+"*\\]",oe=":("+re+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ie+")*)|.*)\\)|)",ae=new RegExp(ne+"+","g"),se=new RegExp("^"+ne+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ne+"+$","g"),ue=new RegExp("^"+ne+"*,"+ne+"*"),ce=new RegExp("^"+ne+"*([>+~]|"+ne+")"+ne+"*"),le=new RegExp("="+ne+"*([^\\]'\"]*?)"+ne+"*\\]","g"),de=new RegExp(oe),fe=new RegExp("^"+re+"$"),pe={ID:new RegExp("^#("+re+")"),CLASS:new RegExp("^\\.("+re+")"),TAG:new RegExp("^("+re+"|[*])"),ATTR:new RegExp("^"+ie),PSEUDO:new RegExp("^"+oe),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ne+"*(even|odd|(([+-]|)(\\d*)n|)"+ne+"*(?:([+-]|)"+ne+"*(\\d+)|))"+ne+"*\\)|)","i"),bool:new RegExp("^(?:"+te+")$","i"),needsContext:new RegExp("^"+ne+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ne+"*((?:-\\d)?\\d*)"+ne+"*\\)|)(?=[^-]|$)","i")},he=/^(?:input|select|textarea|button)$/i,ge=/^h\d$/i,ve=/^[^{]+\{\s*\[native \w/,me=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ye=/[+~]/,be=new RegExp("\\\\([\\da-f]{1,6}"+ne+"?|("+ne+")|.)","ig"),xe=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},Pe=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,He=function(e,t){return t?"\x00"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},we=function(){j()},Ce=h(function(e){return e.disabled===!0&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{K.apply(Y=Z.call(V.childNodes),V.childNodes),Y[V.childNodes.length].nodeType}catch(Te){K={apply:Y.length?function(e,t){G.apply(e,Z.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}H=t.support={},T=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},j=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:V;return r!==N&&9===r.nodeType&&r.documentElement?(N=r,L=N.documentElement,q=!T(N),V!==N&&(n=N.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",we,!1):n.attachEvent&&n.attachEvent("onunload",we)),H.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),H.getElementsByTagName=i(function(e){return e.appendChild(N.createComment("")),!e.getElementsByTagName("*").length}),H.getElementsByClassName=ve.test(N.getElementsByClassName),H.getById=i(function(e){return L.appendChild(e).id=R,!N.getElementsByName||!N.getElementsByName(R).length}),H.getById?(w.filter.ID=function(e){var t=e.replace(be,xe);return function(e){return e.getAttribute("id")===t}},w.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&q){var n=t.getElementById(e);return n?[n]:[]}}):(w.filter.ID=function(e){var t=e.replace(be,xe);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},w.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&q){var n,r,i,o=t.getElementById(e);if(o){if(n=o.getAttributeNode("id"),n&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if(n=o.getAttributeNode("id"),n&&n.value===e)return[o]}return[]}}),w.find.TAG=H.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):H.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},w.find.CLASS=H.getElementsByClassName&&function(e,t){return"undefined"!=typeof t.getElementsByClassName&&q?t.getElementsByClassName(e):void 0},F=[],O=[],(H.qsa=ve.test(N.querySelectorAll))&&(i(function(e){L.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&O.push("[*^$]="+ne+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||O.push("\\["+ne+"*(?:value|"+te+")"),e.querySelectorAll("[id~="+R+"-]").length||O.push("~="),e.querySelectorAll(":checked").length||O.push(":checked"),e.querySelectorAll("a#"+R+"+*").length||O.push(".#.+[+~]")}),i(function(e){e.innerHTML="";var t=N.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&O.push("name"+ne+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&O.push(":enabled",":disabled"),L.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&O.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),O.push(",.*:")})),(H.matchesSelector=ve.test(M=L.matches||L.webkitMatchesSelector||L.mozMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&i(function(e){H.disconnectedMatch=M.call(e,"*"),M.call(e,"[s!='']:x"),F.push("!=",oe)}),O=O.length&&new RegExp(O.join("|")),F=F.length&&new RegExp(F.join("|")),t=ve.test(L.compareDocumentPosition),B=t||ve.test(L.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},Q=t?function(e,t){if(e===t)return k=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n?n:(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!H.sortDetached&&t.compareDocumentPosition(e)===n?e===N||e.ownerDocument===V&&B(V,e)?-1:t===N||t.ownerDocument===V&&B(V,t)?1:I?ee(I,e)-ee(I,t):0:4&n?-1:1)}:function(e,t){if(e===t)return k=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,s=[e],u=[t];if(!i||!o)return e===N?-1:t===N?1:i?-1:o?1:I?ee(I,e)-ee(I,t):0;if(i===o)return a(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;s[r]===u[r];)r++;return r?a(s[r],u[r]):s[r]===V?-1:u[r]===V?1:0},N):N},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==N&&j(e),n=n.replace(le,"='$1']"),H.matchesSelector&&q&&!W[n+" "]&&(!F||!F.test(n))&&(!O||!O.test(n)))try{var r=M.call(e,n);if(r||H.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(i){}return t(n,N,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==N&&j(e),B(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==N&&j(e);var n=w.attrHandle[t.toLowerCase()],r=n&&_.call(w.attrHandle,t.toLowerCase())?n(e,t,!q):void 0;return void 0!==r?r:H.attributes||!q?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.escape=function(e){return(e+"").replace(Pe,He)},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(k=!H.detectDuplicates,I=!H.sortStable&&e.slice(0),e.sort(Q),k){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return I=null,e},C=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=C(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=C(t);return n},w=t.selectors={cacheLength:50,createPseudo:r,match:pe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(be,xe),e[3]=(e[3]||e[4]||e[5]||"").replace(be,xe),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return pe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&de.test(n)&&(t=S(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(be,xe).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=z[e+" "];return t||(t=new RegExp("(^|"+ne+")"+e+"("+ne+"|$)"))&&z(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:n?(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(ae," ")+" ").indexOf(r)>-1:"|="===n?o===r||o.slice(0,r.length+1)===r+"-":!1):!0; +}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var c,l,d,f,p,h,g=o!==a?"nextSibling":"previousSibling",v=t.parentNode,m=s&&t.nodeName.toLowerCase(),y=!u&&!s,b=!1;if(v){if(o){for(;g;){for(f=t;f=f[g];)if(s?f.nodeName.toLowerCase()===m:1===f.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?v.firstChild:v.lastChild],a&&y){for(f=v,d=f[R]||(f[R]={}),l=d[f.uniqueID]||(d[f.uniqueID]={}),c=l[e]||[],p=c[0]===$&&c[1],b=p&&c[2],f=p&&v.childNodes[p];f=++p&&f&&f[g]||(b=p=0)||h.pop();)if(1===f.nodeType&&++b&&f===t){l[e]=[$,p,b];break}}else if(y&&(f=t,d=f[R]||(f[R]={}),l=d[f.uniqueID]||(d[f.uniqueID]={}),c=l[e]||[],p=c[0]===$&&c[1],b=p),b===!1)for(;(f=++p&&f&&f[g]||(b=p=0)||h.pop())&&((s?f.nodeName.toLowerCase()!==m:1!==f.nodeType)||!++b||(y&&(d=f[R]||(f[R]={}),l=d[f.uniqueID]||(d[f.uniqueID]={}),l[e]=[$,b]),f!==t)););return b-=i,b===r||b%r===0&&b/r>=0}}},PSEUDO:function(e,n){var i,o=w.pseudos[e]||w.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[R]?o(n):o.length>1?(i=[e,e,"",n],w.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=ee(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=E(e.replace(se,"$1"));return i[R]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(be,xe),function(t){return(t.textContent||t.innerText||C(t)).indexOf(e)>-1}}),lang:r(function(e){return fe.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(be,xe).toLowerCase(),function(t){var n;do if(n=q?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===L},focus:function(e){return e===N.activeElement&&(!N.hasFocus||N.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:c(!1),disabled:c(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!w.pseudos.empty(e)},header:function(e){return ge.test(e.nodeName)},input:function(e){return he.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:l(function(){return[0]}),last:l(function(e,t){return[t-1]}),eq:l(function(e,t,n){return[0>n?n+t:n]}),even:l(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:l(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:l(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:l(function(e,t,n){for(var r=0>n?n+t:n;++r2&&"ID"===(a=o[0]).type&&9===t.nodeType&&q&&w.relative[o[1].type]){if(t=(w.find.ID(a.matches[0].replace(be,xe),t)||[])[0],!t)return n;c&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=pe.needsContext.test(e)?0:o.length;i--&&(a=o[i],!w.relative[s=a.type]);)if((u=w.find[s])&&(r=u(a.matches[0].replace(be,xe),ye.test(o[0].type)&&d(t.parentNode)||t))){if(o.splice(i,1),e=r.length&&p(o),!e)return K.apply(n,r),n;break}}return(c||E(e,l))(r,t,!q,n,!t||ye.test(e)&&d(t.parentNode)||t),n},H.sortStable=R.split("").sort(Q).join("")===R,H.detectDuplicates=!!k,j(),H.sortDetached=i(function(e){return 1&e.compareDocumentPosition(N.createElement("fieldset"))}),i(function(e){return e.innerHTML="","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){return n?void 0:e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),H.attributes&&i(function(e){return e.innerHTML="",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){return n||"input"!==e.nodeName.toLowerCase()?void 0:e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(te,function(e,t,n){var r;return n?void 0:e[t]===!0?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(e);He.find=Ce,He.expr=Ce.selectors,He.expr[":"]=He.expr.pseudos,He.uniqueSort=He.unique=Ce.uniqueSort,He.text=Ce.getText,He.isXMLDoc=Ce.isXML,He.contains=Ce.contains,He.escapeSelector=Ce.escape;var Te=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&He(e).is(n))break;r.push(e)}return r},Se=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},Ee=He.expr.match.needsContext,Ae=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;He.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?He.find.matchesSelector(r,e)?[r]:[]:He.find.matches(e,He.grep(t,function(e){return 1===e.nodeType}))},He.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(He(e).filter(function(){for(t=0;r>t;t++)if(He.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;r>t;t++)He.find(e,i[t],n);return r>1?He.uniqueSort(n):n},filter:function(e){return this.pushStack(a(this,e||[],!1))},not:function(e){return this.pushStack(a(this,e||[],!0))},is:function(e){return!!a(this,"string"==typeof e&&Ee.test(e)?He(e):e||[],!1).length}});var De,Ie=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,ke=He.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||De,"string"==typeof e){if(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:Ie.exec(e),!r||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof He?t[0]:t,He.merge(this,He.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:ae,!0)),Ae.test(r[1])&&He.isPlainObject(t))for(r in t)ye(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return i=ae.getElementById(r[2]),i&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):ye(e)?void 0!==n.ready?n.ready(e):e(He):He.makeArray(e,this)};ke.prototype=He.fn,De=He(ae);var je=/^(?:parents|prev(?:Until|All))/,Ne={children:!0,contents:!0,next:!0,prev:!0};He.fn.extend({has:function(e){var t=He(e,this),n=t.length;return this.filter(function(){for(var e=0;n>e;e++)if(He.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&He(e);if(!Ee.test(e))for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&He.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?He.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?de.call(He(e),this[0]):de.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(He.uniqueSort(He.merge(this.get(),He(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),He.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return Te(e,"parentNode")},parentsUntil:function(e,t,n){return Te(e,"parentNode",n)},next:function(e){return s(e,"nextSibling")},prev:function(e){return s(e,"previousSibling")},nextAll:function(e){return Te(e,"nextSibling")},prevAll:function(e){return Te(e,"previousSibling")},nextUntil:function(e,t,n){return Te(e,"nextSibling",n)},prevUntil:function(e,t,n){return Te(e,"previousSibling",n)},siblings:function(e){return Se((e.parentNode||{}).firstChild,e)},children:function(e){return Se(e.firstChild)},contents:function(e){return o(e,"iframe")?e.contentDocument:(o(e,"template")&&(e=e.content||e),He.merge([],e.childNodes))}},function(e,t){He.fn[e]=function(n,r){var i=He.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=He.filter(r,i)),this.length>1&&(Ne[e]||He.uniqueSort(i),je.test(e)&&i.reverse()),this.pushStack(i)}});var Le=/[^\x20\t\r\n\f]+/g;He.Callbacks=function(e){e="string"==typeof e?u(e):He.extend({},e);var t,n,i,o,a=[],s=[],c=-1,l=function(){for(o=o||e.once,i=t=!0;s.length;c=-1)for(n=s.shift();++c-1;)a.splice(n,1),c>=n&&c--}),this},has:function(e){return e?He.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return o=s=[],a=n="",this},disabled:function(){return!a},lock:function(){return o=s=[],n||t||(a=n=""),this},locked:function(){return!!o},fireWith:function(e,n){return o||(n=n||[],n=[e,n.slice?n.slice():n],s.push(n),t||l()),this},fire:function(){return d.fireWith(this,arguments),this},fired:function(){return!!i}};return d},He.extend({Deferred:function(t){var n=[["notify","progress",He.Callbacks("memory"),He.Callbacks("memory"),2],["resolve","done",He.Callbacks("once memory"),He.Callbacks("once memory"),0,"resolved"],["reject","fail",He.Callbacks("once memory"),He.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},"catch":function(e){return i.then(null,e)},pipe:function(){var e=arguments;return He.Deferred(function(t){He.each(n,function(n,r){var i=ye(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&ye(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){function o(t,n,r,i){return function(){var s=this,u=arguments,d=function(){var e,d;if(!(a>t)){if(e=r.apply(s,u),e===n.promise())throw new TypeError("Thenable self-resolution");d=e&&("object"==typeof e||"function"==typeof e)&&e.then,ye(d)?i?d.call(e,o(a,n,c,i),o(a,n,l,i)):(a++,d.call(e,o(a,n,c,i),o(a,n,l,i),o(a,n,c,n.notifyWith))):(r!==c&&(s=void 0,u=[e]),(i||n.resolveWith)(s,u))}},f=i?d:function(){try{d()}catch(e){He.Deferred.exceptionHook&&He.Deferred.exceptionHook(e,f.stackTrace),t+1>=a&&(r!==l&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?f():(He.Deferred.getStackHook&&(f.stackTrace=He.Deferred.getStackHook()),e.setTimeout(f))}}var a=0;return He.Deferred(function(e){n[0][3].add(o(0,e,ye(i)?i:c,e.notifyWith)),n[1][3].add(o(0,e,ye(t)?t:c)),n[2][3].add(o(0,e,ye(r)?r:l))}).promise()},promise:function(e){return null!=e?He.extend(e,i):i}},o={};return He.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=ue.call(arguments),o=He.Deferred(),a=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?ue.call(arguments):n,--t||o.resolveWith(r,i)}};if(1>=t&&(d(e,o.done(a(n)).resolve,o.reject,!t),"pending"===o.state()||ye(i[n]&&i[n].then)))return o.then();for(;n--;)d(i[n],a(n),o.reject);return o.promise()}});var qe=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;He.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&qe.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},He.readyException=function(t){e.setTimeout(function(){throw t})};var Oe=He.Deferred();He.fn.ready=function(e){return Oe.then(e)["catch"](function(e){He.readyException(e)}),this},He.extend({isReady:!1,readyWait:1,ready:function(e){(e===!0?--He.readyWait:He.isReady)||(He.isReady=!0,e!==!0&&--He.readyWait>0||Oe.resolveWith(ae,[He]))}}),He.ready.then=Oe.then,"complete"===ae.readyState||"loading"!==ae.readyState&&!ae.documentElement.doScroll?e.setTimeout(He.ready):(ae.addEventListener("DOMContentLoaded",f),e.addEventListener("load",f));var Fe=function(e,t,n,i,o,a,s){var u=0,c=e.length,l=null==n;if("object"===r(n)){o=!0;for(u in n)Fe(e,t,u,n[u],!0,a,s)}else if(void 0!==i&&(o=!0,ye(i)||(s=!0),l&&(s?(t.call(e,i),t=null):(l=t,t=function(e,t,n){return l.call(He(e),n)})),t))for(;c>u;u++)t(e[u],n,s?i:i.call(e[u],u,t(e[u],n)));return o?e:l?t.call(e):c?t(e[0],n):a},Me=/^-ms-/,Be=/-([a-z])/g,Re=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};g.uid=1,g.prototype={cache:function(e){var t=e[this.expando];return t||(t={},Re(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[h(t)]=n;else for(r in t)i[h(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][h(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){Array.isArray(t)?t=t.map(h):(t=h(t),t=t in r?[t]:t.match(Le)||[]),n=t.length;for(;n--;)delete r[t[n]]}(void 0===t||He.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!He.isEmptyObject(t)}};var Ve=new g,$e=new g,Ue=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ze=/[A-Z]/g;He.extend({hasData:function(e){return $e.hasData(e)||Ve.hasData(e)},data:function(e,t,n){return $e.access(e,t,n)},removeData:function(e,t){$e.remove(e,t)},_data:function(e,t,n){return Ve.access(e,t,n)},_removeData:function(e,t){Ve.remove(e,t)}}),He.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=$e.get(o),1===o.nodeType&&!Ve.get(o,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&(r=a[n].name,0===r.indexOf("data-")&&(r=h(r.slice(5)),m(o,r,i[r])));Ve.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){$e.set(this,e)}):Fe(this,function(t){var n;if(o&&void 0===t){if(n=$e.get(o,e),void 0!==n)return n;if(n=m(o,e),void 0!==n)return n}else this.each(function(){$e.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){$e.remove(this,e)})}}),He.extend({queue:function(e,t,n){var r;return e?(t=(t||"fx")+"queue",r=Ve.get(e,t),n&&(!r||Array.isArray(n)?r=Ve.access(e,t,He.makeArray(n)):r.push(n)),r||[]):void 0},dequeue:function(e,t){t=t||"fx";var n=He.queue(e,t),r=n.length,i=n.shift(),o=He._queueHooks(e,t),a=function(){He.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Ve.get(e,n)||Ve.access(e,n,{empty:He.Callbacks("once memory").add(function(){Ve.remove(e,[t+"queue",n])})})}}),He.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]+)/i,Ze=/^$|^module$|\/(?:java|ecma)script/i,et={option:[1,""],thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};et.optgroup=et.option,et.tbody=et.tfoot=et.colgroup=et.caption=et.thead,et.th=et.td;var tt=/<|&#?\w+;/;!function(){var e=ae.createDocumentFragment(),t=e.appendChild(ae.createElement("div")),n=ae.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),me.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="",me.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var nt=ae.documentElement,rt=/^key/,it=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ot=/^([^.]*)(?:\.(.+)|)/;He.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,c,l,d,f,p,h,g,v=Ve.get(e);if(v)for(n.handler&&(o=n,n=o.handler,i=o.selector),i&&He.find.matchesSelector(nt,i),n.guid||(n.guid=He.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(t){return"undefined"!=typeof He&&He.event.triggered!==t.type?He.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(Le)||[""],c=t.length;c--;)s=ot.exec(t[c])||[],p=g=s[1],h=(s[2]||"").split(".").sort(),p&&(d=He.event.special[p]||{},p=(i?d.delegateType:d.bindType)||p,d=He.event.special[p]||{},l=He.extend({type:p,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&He.expr.match.needsContext.test(i),namespace:h.join(".")},o),(f=u[p])||(f=u[p]=[],f.delegateCount=0,d.setup&&d.setup.call(e,r,h,a)!==!1||e.addEventListener&&e.addEventListener(p,a)),d.add&&(d.add.call(e,l),l.handler.guid||(l.handler.guid=n.guid)),i?f.splice(f.delegateCount++,0,l):f.push(l),He.event.global[p]=!0)},remove:function(e,t,n,r,i){var o,a,s,u,c,l,d,f,p,h,g,v=Ve.hasData(e)&&Ve.get(e);if(v&&(u=v.events)){for(t=(t||"").match(Le)||[""],c=t.length;c--;)if(s=ot.exec(t[c])||[],p=g=s[1],h=(s[2]||"").split(".").sort(),p){for(d=He.event.special[p]||{},p=(r?d.delegateType:d.bindType)||p,f=u[p]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=f.length;o--;)l=f[o],!i&&g!==l.origType||n&&n.guid!==l.guid||s&&!s.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(f.splice(o,1),l.selector&&f.delegateCount--,d.remove&&d.remove.call(e,l));a&&!f.length&&(d.teardown&&d.teardown.call(e,h,v.handle)!==!1||He.removeEvent(e,p,v.handle),delete u[p])}else for(p in u)He.event.remove(e,p+t[c],n,r,!0);He.isEmptyObject(u)&&Ve.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=He.event.fix(e),u=new Array(arguments.length),c=(Ve.get(this,"events")||{})[s.type]||[],l=He.event.special[s.type]||{};for(u[0]=s,t=1;t=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||c.disabled!==!0)){for(o=[],a={},n=0;u>n;n++)r=t[n],i=r.selector+" ",void 0===a[i]&&(a[i]=r.needsContext?He(i,this).index(c)>-1:He.find(i,this,null,[c]).length),a[i]&&o.push(r);o.length&&s.push({elem:c,handlers:o})}return c=this,u\x20\t\r\n\f]*)[^>]*)\/>/gi,st=/\s*$/g;He.extend({htmlPrefilter:function(e){return e.replace(at,"<$1>")},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),u=He.contains(e.ownerDocument,e);if(!(me.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||He.isXMLDoc(e)))for(a=P(s),o=P(e),r=0,i=o.length;i>r;r++)j(o[r],a[r]);if(t)if(n)for(o=o||P(e),a=a||P(s),r=0,i=o.length;i>r;r++)k(o[r],a[r]);else k(e,s);return a=P(s,"script"),a.length>0&&H(a,!u&&P(e,"script")),s},cleanData:function(e){for(var t,n,r,i=He.event.special,o=0;void 0!==(n=e[o]);o++)if(Re(n)){if(t=n[Ve.expando]){if(t.events)for(r in t.events)i[r]?He.event.remove(n,r):He.removeEvent(n,r,t.handle);n[Ve.expando]=void 0}n[$e.expando]&&(n[$e.expando]=void 0)}}}),He.fn.extend({detach:function(e){return L(this,e,!0)},remove:function(e){return L(this,e)},text:function(e){return Fe(this,function(e){return void 0===e?He.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=e)})},null,e,arguments.length)},append:function(){return N(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=A(this,e);t.appendChild(e)}})},prepend:function(){return N(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=A(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return N(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return N(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(He.cleanData(P(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return He.clone(this,e,t)})},html:function(e){return Fe(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!st.test(e)&&!et[(Ke.exec(e)||["",""])[1].toLowerCase()]){e=He.htmlPrefilter(e);try{for(;r>n;n++)t=this[n]||{},1===t.nodeType&&(He.cleanData(P(t,!1)),t.innerHTML=e);t=0}catch(i){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return N(this,arguments,function(t){var n=this.parentNode;He.inArray(this,e)<0&&(He.cleanData(P(this)),n&&n.replaceChild(t,this))},e)}}),He.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){He.fn[e]=function(e){for(var n,r=[],i=He(e),o=i.length-1,a=0;o>=a;a++)n=a===o?this:this.clone(!0),He(i[a])[t](n),le.apply(r,n.get());return this.pushStack(r)}});var lt=new RegExp("^("+Xe+")(?!px)[a-z%]+$","i"),dt=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},ft=new RegExp(Qe.join("|"),"i");!function(){function t(){if(c){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",nt.appendChild(u).appendChild(c);var t=e.getComputedStyle(c);r="1%"!==t.top,s=12===n(t.marginLeft),c.style.right="60%",a=36===n(t.right),i=36===n(t.width),c.style.position="absolute",o=36===c.offsetWidth||"absolute",nt.removeChild(u),c=null}}function n(e){return Math.round(parseFloat(e))}var r,i,o,a,s,u=ae.createElement("div"),c=ae.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",me.clearCloneStyle="content-box"===c.style.backgroundClip,He.extend(me,{boxSizingReliable:function(){return t(),i},pixelBoxStyles:function(){return t(),a},pixelPosition:function(){return t(),r},reliableMarginLeft:function(){return t(),s},scrollboxSize:function(){return t(),o}}))}();var pt=/^(none|table(?!-c[ea]).+)/,ht=/^--/,gt={position:"absolute",visibility:"hidden",display:"block"},vt={letterSpacing:"0",fontWeight:"400"},mt=["Webkit","Moz","ms"],yt=ae.createElement("div").style;He.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=q(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=h(t),u=ht.test(t),c=e.style;return u||(t=M(s)),a=He.cssHooks[t]||He.cssHooks[s],void 0===n?a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:c[t]:(o=typeof n,"string"===o&&(i=We.exec(n))&&i[1]&&(n=y(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(He.cssNumber[s]?"":"px")),me.clearCloneStyle||""!==n||0!==t.indexOf("background")||(c[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?c.setProperty(t,n):c[t]=n)),void 0)}},css:function(e,t,n,r){var i,o,a,s=h(t),u=ht.test(t);return u||(t=M(s)),a=He.cssHooks[t]||He.cssHooks[s],a&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=q(e,t,r)),"normal"===i&&t in vt&&(i=vt[t]),""===n||n?(o=parseFloat(i),n===!0||isFinite(o)?o||0:i):i}}),He.each(["height","width"],function(e,t){He.cssHooks[t]={get:function(e,n,r){return n?!pt.test(He.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?V(e,t,r):Ye(e,gt,function(){return V(e,t,r)}):void 0},set:function(e,n,r){var i,o=dt(e),a="border-box"===He.css(e,"boxSizing",!1,o),s=r&&R(e,t,r,a,o);return a&&me.scrollboxSize()===o.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-R(e,t,"border",!1,o)-.5)),s&&(i=We.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=He.css(e,t)),B(e,n,s)}}}),He.cssHooks.marginLeft=O(me.reliableMarginLeft,function(e,t){return t?(parseFloat(q(e,"marginLeft"))||e.getBoundingClientRect().left-Ye(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px":void 0}),He.each({margin:"",padding:"",border:"Width"},function(e,t){He.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];4>r;r++)i[e+Qe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(He.cssHooks[e+t].set=B)}),He.fn.extend({css:function(e,t){return Fe(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=dt(e),i=t.length;i>a;a++)o[t[a]]=He.css(e,t[a],!1,r);return o}return void 0!==n?He.style(e,t,n):He.css(e,t)},e,t,arguments.length>1)}}),He.Tween=$,$.prototype={constructor:$,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||He.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(He.cssNumber[n]?"":"px")},cur:function(){var e=$.propHooks[this.prop];return e&&e.get?e.get(this):$.propHooks._default.get(this)},run:function(e){var t,n=$.propHooks[this.prop];return this.options.duration?this.pos=t=He.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):$.propHooks._default.set(this),this}},$.prototype.init.prototype=$.prototype,$.propHooks={ +_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=He.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){He.fx.step[e.prop]?He.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[He.cssProps[e.prop]]&&!He.cssHooks[e.prop]?e.elem[e.prop]=e.now:He.style(e.elem,e.prop,e.now+e.unit)}}},$.propHooks.scrollTop=$.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},He.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},He.fx=$.prototype.init,He.fx.step={};var bt,xt,Pt=/^(?:toggle|show|hide)$/,Ht=/queueHooks$/;He.Animation=He.extend(Y,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return y(n.elem,e,We.exec(t),n),n}]},tweener:function(e,t){ye(e)?(t=e,e=["*"]):e=e.match(Le);for(var n,r=0,i=e.length;i>r;r++)n=e[r],Y.tweeners[n]=Y.tweeners[n]||[],Y.tweeners[n].unshift(t)},prefilters:[Q],prefilter:function(e,t){t?Y.prefilters.unshift(e):Y.prefilters.push(e)}}),He.speed=function(e,t,n){var r=e&&"object"==typeof e?He.extend({},e):{complete:n||!n&&t||ye(e)&&e,duration:e,easing:n&&t||t&&!ye(t)&&t};return He.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in He.fx.speeds?r.duration=He.fx.speeds[r.duration]:r.duration=He.fx.speeds._default),(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){ye(r.old)&&r.old.call(this),r.queue&&He.dequeue(this,r.queue)},r},He.fn.extend({fadeTo:function(e,t,n,r){return this.filter(_e).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=He.isEmptyObject(e),o=He.speed(t,n,r),a=function(){var t=Y(this,He.extend({},e),o);(i||Ve.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=He.timers,a=Ve.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&Ht.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));(t||!n)&&He.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=Ve.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=He.timers,a=r?r.length:0;for(n.finish=!0,He.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),He.each(["toggle","show","hide"],function(e,t){var n=He.fn[t];He.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(X(t,!0),e,r,i)}}),He.each({slideDown:X("show"),slideUp:X("hide"),slideToggle:X("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){He.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),He.timers=[],He.fx.tick=function(){var e,t=0,n=He.timers;for(bt=Date.now();t1)},removeAttr:function(e){return this.each(function(){He.removeAttr(this,e)})}}),He.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?He.prop(e,t,n):(1===o&&He.isXMLDoc(e)||(i=He.attrHooks[t.toLowerCase()]||(He.expr.match.bool.test(t)?wt:void 0)),void 0!==n?null===n?void He.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:(r=He.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!me.radioValue&&"radio"===t&&o(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(Le);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),wt={set:function(e,t,n){return t===!1?He.removeAttr(e,n):e.setAttribute(n,n),n}},He.each(He.expr.match.bool.source.match(/\w+/g),function(e,t){var n=Ct[t]||He.find.attr;Ct[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=Ct[a],Ct[a]=i,i=null!=n(e,t,r)?a:null,Ct[a]=o),i}});var Tt=/^(?:input|select|textarea|button)$/i,St=/^(?:a|area)$/i;He.fn.extend({prop:function(e,t){return Fe(this,He.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[He.propFix[e]||e]})}}),He.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&He.isXMLDoc(e)||(t=He.propFix[t]||t,i=He.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=He.find.attr(e,"tabindex");return t?parseInt(t,10):Tt.test(e.nodeName)||St.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),me.optSelected||(He.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),He.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){He.propFix[this.toLowerCase()]=this}),He.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(ye(e))return this.each(function(t){He(this).addClass(e.call(this,t,G(this)))});if(t=K(e),t.length)for(;n=this[u++];)if(i=G(n),r=1===n.nodeType&&" "+J(i)+" "){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");s=J(r),i!==s&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(ye(e))return this.each(function(t){He(this).removeClass(e.call(this,t,G(this)))});if(!arguments.length)return this.attr("class","");if(t=K(e),t.length)for(;n=this[u++];)if(i=G(n),r=1===n.nodeType&&" "+J(i)+" "){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");s=J(r),i!==s&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):ye(e)?this.each(function(n){He(this).toggleClass(e.call(this,n,G(this),t),t)}):this.each(function(){var t,i,o,a;if(r)for(i=0,o=He(this),a=K(e);t=a[i++];)o.hasClass(t)?o.removeClass(t):o.addClass(t);else(void 0===e||"boolean"===n)&&(t=G(this),t&&Ve.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||e===!1?"":Ve.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+J(G(n))+" ").indexOf(t)>-1)return!0;return!1}});var Et=/\r/g;He.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=ye(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,He(this).val()):e,null==i?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=He.map(i,function(e){return null==e?"":e+""})),t=He.valHooks[this.type]||He.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=He.valHooks[i.type]||He.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(Et,""):null==n?"":n)}}}),He.extend({valHooks:{option:{get:function(e){var t=He.find.attr(e,"value");return null!=t?t:J(He.text(e))}},select:{get:function(e){var t,n,r,i=e.options,a=e.selectedIndex,s="select-one"===e.type,u=s?null:[],c=s?a+1:i.length;for(r=0>a?c:s?a:0;c>r;r++)if(n=i[r],(n.selected||r===a)&&!n.disabled&&(!n.parentNode.disabled||!o(n.parentNode,"optgroup"))){if(t=He(n).val(),s)return t;u.push(t)}return u},set:function(e,t){for(var n,r,i=e.options,o=He.makeArray(t),a=i.length;a--;)r=i[a],(r.selected=He.inArray(He.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),He.each(["radio","checkbox"],function(){He.valHooks[this]={set:function(e,t){return Array.isArray(t)?e.checked=He.inArray(He(e).val(),t)>-1:void 0}},me.checkOn||(He.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),me.focusin="onfocusin"in e;var At=/^(?:focusinfocus|focusoutblur)$/,Dt=function(e){e.stopPropagation()};He.extend(He.event,{trigger:function(t,n,r,i){var o,a,s,u,c,l,d,f,p=[r||ae],h=he.call(t,"type")?t.type:t,g=he.call(t,"namespace")?t.namespace.split("."):[];if(a=f=s=r=r||ae,3!==r.nodeType&&8!==r.nodeType&&!At.test(h+He.event.triggered)&&(h.indexOf(".")>-1&&(g=h.split("."),h=g.shift(),g.sort()),c=h.indexOf(":")<0&&"on"+h,t=t[He.expando]?t:new He.Event(h,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=g.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:He.makeArray(n,[t]),d=He.event.special[h]||{},i||!d.trigger||d.trigger.apply(r,n)!==!1)){if(!i&&!d.noBubble&&!be(r)){for(u=d.delegateType||h,At.test(u+h)||(a=a.parentNode);a;a=a.parentNode)p.push(a),s=a;s===(r.ownerDocument||ae)&&p.push(s.defaultView||s.parentWindow||e)}for(o=0;(a=p[o++])&&!t.isPropagationStopped();)f=a,t.type=o>1?u:d.bindType||h,l=(Ve.get(a,"events")||{})[t.type]&&Ve.get(a,"handle"),l&&l.apply(a,n),l=c&&a[c],l&&l.apply&&Re(a)&&(t.result=l.apply(a,n),t.result===!1&&t.preventDefault());return t.type=h,i||t.isDefaultPrevented()||d._default&&d._default.apply(p.pop(),n)!==!1||!Re(r)||c&&ye(r[h])&&!be(r)&&(s=r[c],s&&(r[c]=null),He.event.triggered=h,t.isPropagationStopped()&&f.addEventListener(h,Dt),r[h](),t.isPropagationStopped()&&f.removeEventListener(h,Dt),He.event.triggered=void 0,s&&(r[c]=s)),t.result}},simulate:function(e,t,n){var r=He.extend(new He.Event,n,{type:e,isSimulated:!0});He.event.trigger(r,null,t)}}),He.fn.extend({trigger:function(e,t){return this.each(function(){He.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];return n?He.event.trigger(e,t,n,!0):void 0}}),me.focusin||He.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){He.event.simulate(t,e.target,He.event.fix(e))};He.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=Ve.access(r,t);i||r.addEventListener(e,n,!0),Ve.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=Ve.access(r,t)-1;i?Ve.access(r,t,i):(r.removeEventListener(e,n,!0),Ve.remove(r,t))}}});var It=e.location,kt=Date.now(),jt=/\?/;He.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(r){n=void 0}return(!n||n.getElementsByTagName("parsererror").length)&&He.error("Invalid XML: "+t),n};var Nt=/\[\]$/,Lt=/\r?\n/g,qt=/^(?:submit|button|image|reset|file)$/i,Ot=/^(?:input|select|textarea|keygen)/i;He.param=function(e,t){var n,r=[],i=function(e,t){var n=ye(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!He.isPlainObject(e))He.each(e,function(){i(this.name,this.value)});else for(n in e)Z(n,e[n],t,i);return r.join("&")},He.fn.extend({serialize:function(){return He.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=He.prop(this,"elements");return e?He.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!He(this).is(":disabled")&&Ot.test(this.nodeName)&&!qt.test(e)&&(this.checked||!Ge.test(e))}).map(function(e,t){var n=He(this).val();return null==n?null:Array.isArray(n)?He.map(n,function(e){return{name:t.name,value:e.replace(Lt,"\r\n")}}):{name:t.name,value:n.replace(Lt,"\r\n")}}).get()}});var Ft=/%20/g,Mt=/#.*$/,Bt=/([?&])_=[^&]*/,Rt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Vt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,$t=/^(?:GET|HEAD)$/,Ut=/^\/\//,zt={},Xt={},Wt="*/".concat("*"),Qt=ae.createElement("a");Qt.href=It.href,He.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:It.href,type:"GET",isLocal:Vt.test(It.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Wt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":He.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?ne(ne(e,He.ajaxSettings),t):ne(He.ajaxSettings,e)},ajaxPrefilter:ee(zt),ajaxTransport:ee(Xt),ajax:function(t,n){function r(t,n,r,s){var c,f,p,x,P,H=n;l||(l=!0,u&&e.clearTimeout(u),i=void 0,a=s||"",w.readyState=t>0?4:0,c=t>=200&&300>t||304===t,r&&(x=re(h,w,r)),x=ie(h,x,w,c),c?(h.ifModified&&(P=w.getResponseHeader("Last-Modified"),P&&(He.lastModified[o]=P),P=w.getResponseHeader("etag"),P&&(He.etag[o]=P)),204===t||"HEAD"===h.type?H="nocontent":304===t?H="notmodified":(H=x.state,f=x.data,p=x.error,c=!p)):(p=H,(t||!H)&&(H="error",0>t&&(t=0))),w.status=t,w.statusText=(n||H)+"",c?m.resolveWith(g,[f,H,w]):m.rejectWith(g,[w,H,p]),w.statusCode(b),b=void 0,d&&v.trigger(c?"ajaxSuccess":"ajaxError",[w,h,c?f:p]),y.fireWith(g,[w,H]),d&&(v.trigger("ajaxComplete",[w,h]),--He.active||He.event.trigger("ajaxStop")))}"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,c,l,d,f,p,h=He.ajaxSetup({},n),g=h.context||h,v=h.context&&(g.nodeType||g.jquery)?He(g):He.event,m=He.Deferred(),y=He.Callbacks("once memory"),b=h.statusCode||{},x={},P={},H="canceled",w={readyState:0,getResponseHeader:function(e){var t;if(l){if(!s)for(s={};t=Rt.exec(a);)s[t[1].toLowerCase()]=t[2];t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return l?a:null},setRequestHeader:function(e,t){return null==l&&(e=P[e.toLowerCase()]=P[e.toLowerCase()]||e,x[e]=t),this},overrideMimeType:function(e){return null==l&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(l)w.always(e[w.status]);else for(t in e)b[t]=[b[t],e[t]];return this},abort:function(e){var t=e||H;return i&&i.abort(t),r(0,t),this}};if(m.promise(w),h.url=((t||h.url||It.href)+"").replace(Ut,It.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(Le)||[""],null==h.crossDomain){c=ae.createElement("a");try{c.href=h.url,c.href=c.href,h.crossDomain=Qt.protocol+"//"+Qt.host!=c.protocol+"//"+c.host}catch(C){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=He.param(h.data,h.traditional)),te(zt,h,n,w),l)return w;d=He.event&&h.global,d&&0===He.active++&&He.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!$t.test(h.type),o=h.url.replace(Mt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(Ft,"+")):(p=h.url.slice(o.length),h.data&&(h.processData||"string"==typeof h.data)&&(o+=(jt.test(o)?"&":"?")+h.data,delete h.data),h.cache===!1&&(o=o.replace(Bt,"$1"),p=(jt.test(o)?"&":"?")+"_="+kt++ +p),h.url=o+p),h.ifModified&&(He.lastModified[o]&&w.setRequestHeader("If-Modified-Since",He.lastModified[o]),He.etag[o]&&w.setRequestHeader("If-None-Match",He.etag[o])),(h.data&&h.hasContent&&h.contentType!==!1||n.contentType)&&w.setRequestHeader("Content-Type",h.contentType),w.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+Wt+"; q=0.01":""):h.accepts["*"]);for(f in h.headers)w.setRequestHeader(f,h.headers[f]);if(h.beforeSend&&(h.beforeSend.call(g,w,h)===!1||l))return w.abort();if(H="abort",y.add(h.complete),w.done(h.success),w.fail(h.error),i=te(Xt,h,n,w)){if(w.readyState=1,d&&v.trigger("ajaxSend",[w,h]),l)return w;h.async&&h.timeout>0&&(u=e.setTimeout(function(){w.abort("timeout")},h.timeout));try{l=!1,i.send(x,r)}catch(C){if(l)throw C;r(-1,C)}}else r(-1,"No Transport");return w},getJSON:function(e,t,n){return He.get(e,t,n,"json")},getScript:function(e,t){return He.get(e,void 0,t,"script")}}),He.each(["get","post"],function(e,t){He[t]=function(e,n,r,i){return ye(n)&&(i=i||r,r=n,n=void 0),He.ajax(He.extend({url:e,type:t,dataType:i,data:n,success:r},He.isPlainObject(e)&&e))}}),He._evalUrl=function(e){return He.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},He.fn.extend({wrapAll:function(e){var t;return this[0]&&(ye(e)&&(e=e.call(this[0])),t=He(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return ye(e)?this.each(function(t){He(this).wrapInner(e.call(this,t))}):this.each(function(){var t=He(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=ye(e);return this.each(function(n){He(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){He(this).replaceWith(this.childNodes)}),this}}),He.expr.pseudos.hidden=function(e){return!He.expr.pseudos.visible(e)},He.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},He.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(t){}};var _t={0:200,1223:204},Yt=He.ajaxSettings.xhr();me.cors=!!Yt&&"withCredentials"in Yt,me.ajax=Yt=!!Yt,He.ajaxTransport(function(t){var n,r;return me.cors||Yt&&!t.crossDomain?{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(a in i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(_t[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(u){if(n)throw u}},abort:function(){n&&n()}}:void 0}),He.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),He.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return He.globalEval(e),e}}}),He.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),He.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=He("';return t};return''+t(H5PIntegration.core.styles)+t(H5PIntegration.contents["cid-"+e].styles)+n(H5PIntegration.core.scripts)+n(H5PIntegration.contents["cid-"+e].scripts)+""},H5P.communicator=function(){function e(){var e=this,t={};window.addEventListener("message",function(e){window.parent===e.source&&"h5p"===e.data.context&&void 0!==t[e.data.action]&&t[e.data.action](e.data)},!1),e.on=function(e,n){t[e]=n},e.send=function(e,t){void 0===t&&(t={}),t.context="h5p",t.action=e,window.parent.postMessage(t,"*")}}return window.postMessage&&window.addEventListener?new e:void 0}(),H5P.semiFullScreen=function(e,t,n,r){H5P.fullScreen(e,t,n,r,!0)},H5P.fullScreen=function(e,t,n,r,i){if(void 0===H5P.exitFullScreen){if(H5P.isFramed&&H5P.externalEmbed===!1)return window.parent.H5P.fullScreen(e,t,n,H5P.$body.get(),i),H5P.isFullscreen=!0,H5P.exitFullScreen=function(){window.parent.H5P.exitFullScreen()},void H5P.on(t,"exitFullScreen",function(){H5P.isFullscreen=!1,H5P.exitFullScreen=void 0});var o,a,s=e;if(void 0===r)$body=H5P.$body;else{$body=H5P.jQuery(r),o=$body.add(e.get());var u="#h5p-iframe-"+e.parent().data("content-id");a=H5P.jQuery(u),e=a.parent()}o=e.add(H5P.$body).add(o);var c=function(e){o.addClass(e),void 0!==a&&a.css("height","")},l=function(){H5P.trigger(t,"resize"),H5P.trigger(t,"focus"),H5P.trigger(t,"enterFullScreen")},d=function(e){H5P.isFullscreen=!1,o.removeClass(e),H5P.trigger(t,"resize"),H5P.trigger(t,"focus"),H5P.exitFullScreen=void 0,void 0!==n&&n(),H5P.trigger(t,"exitFullScreen")};if(H5P.isFullscreen=!0,void 0===H5P.fullScreenBrowserPrefix||i===!0){if(H5P.isFramed)return;c("h5p-semi-fullscreen");var f,p=H5P.jQuery('
    ').appendTo(s.find(".h5p-content-controls")),h=H5P.exitFullScreen=function(){g?v.content=g:b.removeChild(v),p.remove(),$body.unbind("keyup",f),d("h5p-semi-fullscreen")};f=function(e){27===e.keyCode&&h()},p.click(h),$body.keyup(f);for(var g,v,m=document.getElementsByTagName("meta"),y=0;y-1?new c(e.params,t):new c(e.params,t,i),void 0===f.$&&(f.$=H5P.jQuery(f)),void 0===f.contentId&&(f.contentId=t),void 0===f.subContentId&&e.subContentId&&(f.subContentId=e.subContentId),void 0===f.parent&&i&&i.parent&&(f.parent=i.parent),void 0===f.libraryInfo&&(f.libraryInfo={versionedName:e.library,versionedNameNoSpaces:s+"-"+a[0]+"."+a[1],machineName:s,majorVersion:a[0],minorVersion:a[1]}),void 0!==n&&(n.toggleClass("h5p-standalone",d),f.attach(n),H5P.trigger(f,"domChanged",{$target:n,library:s,key:"newLibrary"},{bubbles:!0,external:!0}),void 0!==r&&r||H5P.trigger(f,"resize")),f},H5P.error=function(e){void 0!==window.console&&void 0!==console.error&&console.error(e.stack?e.stack:e)},H5P.t=function(e,t,n){if(void 0===n&&(n="H5P"),void 0===H5PIntegration.l10n[n])return'[Missing translation namespace "'+n+'"]';if(void 0===H5PIntegration.l10n[n][e])return'[Missing translation "'+e+'" in "'+n+'"]';var r=H5PIntegration.l10n[n][e];if(void 0!==t)for(var i in t)r=r.replace(i,t[i]);return r},H5P.Dialog=function(e,t,n,r){var i=this,o=H5P.jQuery('

    '+t+'

    '+n+'
    ').insertAfter(r).click(function(){i.close()}).children(".h5p-inner").click(function(){return!1}).find(".h5p-close").click(function(){i.close()}).end().find("a").click(function(e){e.stopPropagation()}).end().end();i.open=function(){setTimeout(function(){o.addClass("h5p-open"),H5P.jQuery(i).trigger("dialog-opened",[o])},1)},i.close=function(){o.removeClass("h5p-open"),setTimeout(function(){o.remove()},200)}},H5P.getCopyrights=function(e,t,n){var r;if(void 0!==e.getCopyrights)try{r=e.getCopyrights()}catch(i){}return void 0===r&&(r=new H5P.ContentCopyrights,H5P.findCopyrights(r,t,n)),void 0!==r&&(r=r.toString()),r},H5P.findCopyrights=function(e,t,n){for(var r in t)if(t.hasOwnProperty(r))if("overrideSettings"!==r){var i=t[r];if(i instanceof Array)H5P.findCopyrights(e,i,n);else if(i instanceof Object)if(void 0===i.copyright||void 0===i.copyright.license||void 0===i.path||void 0===i.mime)H5P.findCopyrights(e,i,n);else{var o=new H5P.MediaCopyright(i.copyright);void 0!==i.width&&void 0!==i.height&&o.setThumbnail(new H5P.Thumbnail(H5P.getPath(i.path,n),i.width,i.height)),e.addMedia(o)}}else console.warn("The semantics field 'overrideSettings' is DEPRECATED and should not be used."),console.warn(t)},H5P.openEmbedDialog=function(e,t,n,r){var i=t+n,o=new H5P.Dialog("embed",H5P.t("embed"),''+H5P.t("size")+': × px
    '+H5P.t("showAdvanced")+'

    '+H5P.t("advancedHelp")+'

    ",e);H5P.jQuery(o).on("dialog-opened",function(e,t){var n=t.find(".h5p-inner"),o=n.find(".h5p-scroll-content"),a=o.outerHeight()-o.innerHeight(),s=function(){var e=n.height();o[0].scrollHeight+a>e?n.css("height",""):(n.css("height","auto"),e=n.height()),n.css("marginTop","-"+e/2+"px")},u=t.find(".h5p-embed-size:eq(0)"),c=t.find(".h5p-embed-size:eq(1)"),l=function(e,t){var n=parseFloat(e.val());return isNaN(n)?t:Math.ceil(n)},d=function(){t.find(".h5p-embed-code-container:first").val(i.replace(":w",l(u,r.width)).replace(":h",l(c,r.height)))};u.change(d),c.change(d),d(),t.find(".h5p-embed-code-container").each(function(e,t){H5P.jQuery(this).css("height",this.scrollHeight+"px").focus(function(){H5P.jQuery(this).select()})}),t.find(".h5p-embed-code-container").eq(0).select(),s();var f=function(){var e=H5P.jQuery(this),n=e.next();n.is(":visible")?(e.removeClass("h5p-open").text(H5P.t("showAdvanced")),n.hide()):(e.addClass("h5p-open").text(H5P.t("hideAdvanced")),n.show()),t.find(".h5p-embed-code-container").each(function(e,t){H5P.jQuery(this).css("height",this.scrollHeight+"px")}),s()};t.find(".h5p-expander").click(f).keypress(function(e){32===e.keyCode&&f.apply(this)})}),o.open()},H5P.ContentCopyrights=function(){var e,t=[],n=[];this.setLabel=function(t){e=t},this.addMedia=function(e){void 0!==e&&t.push(e)},this.addContent=function(e){void 0!==e&&n.push(e)},this.toString=function(){for(var r="",i=0;i"+e+""+r),r='
    '+r+"
    "),r}},H5P.MediaCopyright=function(e,t,n,r){var i,o=new H5P.DefinitionList,a=function(e){return void 0===t||void 0===t[e]?H5P.t(e):t[e]},s=function(e,t){var n=H5P.copyrightLicenses[e],r="";"PD"===e&&t||(r+=n.hasOwnProperty("label")?n.label:n);var i;n.versions&&(!n.versions["default"]||t&&n.versions[t]||(t=n.versions["default"]),t&&n.versions[t]&&(i=n.versions[t])),i&&(r&&(r+=" "),r+=i.hasOwnProperty("label")?i.label:i);var o;n.hasOwnProperty("link")?o=n.link.replace(":version",n.linkVersions?n.linkVersions[t]:t):i&&n.hasOwnProperty("link")&&(o=i.link),o&&(r=''+r+"");var a="";return"PD"!==e&&"C"!==e&&(a+=e),t&&"CC0 1.0"!==t&&(a&&"GNU GPL"!==e&&(a+=" "),a+=t),a&&(r+=" ("+a+")"),"C"===e&&(r+=" ©"),r};if(void 0!==e){for(var u in r)r.hasOwnProperty(u)&&(e[u]=r[u]);void 0===n&&(n=["title","author","year","source","license"]);for(var c=0;c'+e+"
    "),e)}},H5P.Thumbnail=function(e,t,n){var r,i=100;void 0!==t&&(r=Math.round(i*(t/n))),this.toString=function(){return''+H5P.t("}},H5P.Field=function(e,t){this.getLabel=function(){return e},this.getValue=function(){return t}},H5P.DefinitionList=function(){var e=[];this.add=function(t){e.push(t)},this.size=function(){return e.length},this.get=function(t){return e[t]},this.toString=function(){for(var t="",n=0;n"+r.getLabel()+"
    "+r.getValue()+"
    "}return""===t?t:'
    '+t+"
    "}},H5P.Coords=function(e,t,n,r){return this instanceof H5P.Coords?(this.x=0,this.y=0,this.w=1,this.h=1,"object"==typeof e?(this.x=e.x,this.y=e.y,this.w=e.w,this.h=e.h):(void 0!==e&&(this.x=e),void 0!==t&&(this.y=t),void 0!==n&&(this.w=n),void 0!==r&&(this.h=r)),this):new H5P.Coords(e,t,n,r)},H5P.libraryFromString=function(e){var t=/(.+)\s(\d+)\.(\d+)$/g,n=t.exec(e);return null!==n?{machineName:n[1],majorVersion:n[2],minorVersion:n[3]}:!1},H5P.getLibraryPath=function(e){return(void 0!==H5PIntegration.libraryUrl?H5PIntegration.libraryUrl+"/":H5PIntegration.url+"/libraries/")+e},H5P.cloneObject=function(e,t){var n=e instanceof Array?[]:{};for(var r in e)e.hasOwnProperty(r)&&(void 0!==t&&t&&"object"==typeof e[r]?n[r]=H5P.cloneObject(e[r],t):n[r]=e[r]);return n},H5P.trim=function(e){return e.replace(/^\s+|\s+$/g,"")},H5P.jsLoaded=function(e){return H5PIntegration.loadedJs=H5PIntegration.loadedJs||[],-1!==H5P.jQuery.inArray(e,H5PIntegration.loadedJs)},H5P.cssLoaded=function(e){return H5PIntegration.loadedCss=H5PIntegration.loadedCss||[],-1!==H5P.jQuery.inArray(e,H5PIntegration.loadedCss)},H5P.shuffleArray=function(e){if(e instanceof Array){var t,n,r,i=e.length;if(0===i)return!1;for(;--i;)t=Math.floor(Math.random()*(i+1)),n=e[i],r=e[t],e[i]=r,e[t]=n;return e}},H5P.setFinished=function(e,t,n,r){var i="number"==typeof t||t instanceof Number;if(i&&H5PIntegration.postUserStatistics===!0){var o=function(e){return Math.round(e.getTime()/1e3)};H5P.jQuery.post(H5PIntegration.ajax.setFinished,{contentId:e,score:t,maxScore:n,opened:o(H5P.opened[e]),finished:o(new Date),time:r})}},Array.prototype.indexOf||(Array.prototype.indexOf=function(e){for(var t=0;t").text(e.replace(/(<([^>]+)>)/gi,"")).text();return n.length>t&&(n=n.substr(0,t-3)+"..."),n},function(e){function t(t,n,r,i,o,a,s,u){if(void 0===H5PIntegration.user)return void i("Not signed in.");var c={url:H5PIntegration.ajax.contentUserData.replace(":contentId",t).replace(":dataType",n).replace(":subContentId",r?r:0),dataType:"json",async:void 0===u?!0:u};void 0!==o?(c.type="POST",c.data={data:null===o?0:o,preload:a?1:0,invalidate:s?1:0}):c.type="GET",void 0!==i&&(c.error=function(e,t){i(t)},c.success=function(e){return e.success?e.data===!1||void 0===e.data?void i():void i(void 0,e.data):void i(e.message)}),e.ajax(c)}H5P.getUserData=function(e,n,r,i){i||(i=0),H5PIntegration.contents=H5PIntegration.contents||{};var o=H5PIntegration.contents["cid-"+e]||{},a=o.contentUserData;if(a&&a[i]&&void 0!==a[i][n]){if("RESET"===a[i][n])return void r(void 0,null);try{r(void 0,JSON.parse(a[i][n]))}catch(s){r(s)}}else t(e,n,i,function(e,t){if(e||void 0===t)return void r(e,t);void 0===o.contentUserData&&(o.contentUserData=a={}),void 0===a[i]&&(a[i]={}),a[i][n]=t;try{r(void 0,JSON.parse(t))}catch(s){r(s)}})},H5P.setUserData=function(e,n,r,i){var o=H5P.jQuery.extend(!0,{},{subContentId:0,preloaded:!0,deleteOnChange:!1,async:!0},i);try{r=JSON.stringify(r)}catch(a){return void(o.errorCallback&&o.errorCallback(a))}var s=H5PIntegration.contents["cid-"+e];void 0===s&&(s=H5PIntegration.contents["cid-"+e]={}),s.contentUserData||(s.contentUserData={});var u=s.contentUserData;void 0===u[o.subContentId]&&(u[o.subContentId]={}),r!==u[o.subContentId][n]&&(u[o.subContentId][n]=r,t(e,n,o.subContentId,function(e,t){o.errorCallback&&e&&o.errorCallback(e)},r,o.preloaded,o.deleteOnChange,o.async))},H5P.deleteUserData=function(e,n,r){r||(r=0);var i=H5PIntegration.contents["cid-"+e].contentUserData;i&&i[r]&&i[r][n]&&delete i[r][n],t(e,n,r,void 0,null)},e(document).ready(function(){var e={"default":"4.0","4.0":H5P.t("licenseCC40"),"3.0":H5P.t("licenseCC30"),2.5:H5P.t("licenseCC25"),"2.0":H5P.t("licenseCC20"),"1.0":H5P.t("licenseCC10")};if(H5P.copyrightLicenses={U:H5P.t("licenseU"),"CC BY":{label:H5P.t("licenseCCBY"),link:"http://creativecommons.org/licenses/by/:version/legalcode",versions:e},"CC BY-SA":{label:H5P.t("licenseCCBYSA"),link:"http://creativecommons.org/licenses/by-sa/:version/legalcode",versions:e},"CC BY-ND":{label:H5P.t("licenseCCBYND"),link:"http://creativecommons.org/licenses/by-nd/:version/legalcode",versions:e},"CC BY-NC":{label:H5P.t("licenseCCBYNC"),link:"http://creativecommons.org/licenses/by-nc/:version/legalcode",versions:e},"CC BY-NC-SA":{label:H5P.t("licenseCCBYNCSA"),link:"http://creativecommons.org/licenses/by-nc-sa/:version/legalcode",versions:e},"CC BY-NC-ND":{label:H5P.t("licenseCCBYNCND"),link:"http://creativecommons.org/licenses/by-nc-nd/:version/legalcode",versions:e},"GNU GPL":{label:H5P.t("licenseGPL"),link:"http://www.gnu.org/licenses/gpl-:version-standalone.html",linkVersions:{v3:"3.0",v2:"2.0",v1:"1.0"},versions:{"default":"v3",v3:H5P.t("licenseV3"),v2:H5P.t("licenseV2"),v1:H5P.t("licenseV1")}},PD:{label:H5P.t("licensePD"),versions:{"CC0 1.0":{label:H5P.t("licenseCC010"),link:"https://creativecommons.org/publicdomain/zero/1.0/"},"CC PDM":{label:H5P.t("licensePDM"),link:"https://creativecommons.org/publicdomain/mark/1.0/"}}},"ODC PDDL":'Public Domain Dedication and Licence',"CC PDM":H5P.t("licensePDM"),C:H5P.t("licenseC")},H5P.isFramed&&H5P.externalEmbed===!1&&H5P.externalDispatcher.on("*",function(e){window.parent.H5P.externalDispatcher.trigger.call(this,e)}),H5P.preventInit||H5P.init(document.body),H5PIntegration.saveFreq!==!1){var t=0,n=function(){var e=(new Date).getTime();if(e-t>250){t=e;for(var n=0;n tbody { border: none; + width: 100%; } .h5p-admin-table tr:nth-child(odd), @@ -203,7 +204,7 @@ button.h5p-admin.disabled:hover { line-height: 130%; border: none; background: none; - font-family: 'H5P'; /* TODO: Find content */ + font-family: 'H5P'; font-size: 1.4em; } .h5p-content-pager > button:focus { @@ -231,7 +232,8 @@ button.h5p-admin.disabled:hover { .h5p-admin-header { margin-top: 1.5em; } -#h5p-library-upload-form.h5p-admin-upload-libraries-form { +#h5p-library-upload-form.h5p-admin-upload-libraries-form, +#h5p-content-type-cache-update-form.h5p-admin-upload-libraries-form { position: relative; margin: 0; @@ -257,6 +259,8 @@ button.h5p-admin.disabled:hover { } .h5p-data-view input[type="text"] { margin-bottom: 0.5em; + margin-right: 0.5em; + float: left; } .h5p-data-view input[type="text"]::-ms-clear { display: none; @@ -283,3 +287,55 @@ button.h5p-admin.disabled:hover { .h5p-data-view th[role="button"].h5p-sort:hover:after { color: #999; } +.h5p-data-view .h5p-facet { + cursor: pointer; + color: #0073aa; + outline: none; +} +.h5p-data-view .h5p-facet:hover, +.h5p-data-view .h5p-facet:active { + color: #00a0d2; +} +.h5p-data-view .h5p-facet:focus { + color: #124964; + box-shadow: 0 0 0 1px #5b9dd9,0 0 2px 1px rgba(30,140,190,.8); +} +.h5p-data-view .h5p-facet-wrapper { + line-height: 23px; +} +.h5p-data-view .h5p-facet-tag { + margin: 2px 0 0 0.5em; + font-size: 12px; + background: #e8e8e8; + border: 1px solid #cbcbcc; + border-radius: 5px; + color: #5d5d5d; + padding: 0 24px 0 10px; + display: inline-block; + position: relative; +} +.h5p-data-view .h5p-facet-tag > span { + position: absolute; + right: 0; + top: auto; + bottom: auto; + font-size: 18px; + color: #a2a2a2; + outline: none; + width: 21px; + text-indent: 4px; + letter-spacing: 10px; + overflow: hidden; + cursor: pointer; +} +.h5p-data-view .h5p-facet-tag > span:before { + content: "×"; + font-weight: bold; +} +.h5p-data-view .h5p-facet-tag > span:hover, +.h5p-data-view .h5p-facet-tag > span:focus { + color: #a20000; +} +.h5p-data-view .h5p-facet-tag > span:active { + color: #d20000; +} diff --git a/dist/styles/h5p-confirmation-dialog.css b/dist/styles/h5p-confirmation-dialog.css new file mode 100644 index 00000000..5a8f597c --- /dev/null +++ b/dist/styles/h5p-confirmation-dialog.css @@ -0,0 +1,118 @@ +.h5p-confirmation-dialog-background { + position: absolute; + height: 100%; + width: 100%; + left: 0; + top: 0; + + background: rgba(44, 44, 44, 0.9); + opacity: 1; + visibility: visible; + -webkit-transition: opacity 0.1s, linear 0s, visibility 0s linear 0s; + transition: opacity 0.1s linear 0s, visibility 0s linear 0s; + + z-index: 201; +} + +.h5p-confirmation-dialog-background.hidden { + display: none; +} + +.h5p-confirmation-dialog-background.hiding { + opacity: 0; + visibility: hidden; + -webkit-transition: opacity 0.1s, linear 0s, visibility 0s linear 0.1s; + transition: opacity 0.1s linear 0s, visibility 0s linear 0.1s; +} + +.h5p-confirmation-dialog-popup:focus { + outline: none; +} + +.h5p-confirmation-dialog-popup { + position: absolute; + display: flex; + flex-direction: column; + justify-content: center; + + box-sizing: border-box; + max-width: 35em; + min-width: 25em; + + top: 2em; + left: 50%; + -webkit-transform: translate(-50%, 0%); + -ms-transform: translate(-50%, 0%); + transform: translate(-50%, 0%); + + color: #555; + box-shadow: 0 0 6px 6px rgba(10,10,10,0.3); + + -webkit-transition: transform 0.1s ease-in; + transition: transform 0.1s ease-in; +} + +.h5p-confirmation-dialog-popup.hidden { + -webkit-transform: translate(-50%, 50%); + -ms-transform: translate(-50%, 50%); + transform: translate(-50%, 50%); +} + +.h5p-confirmation-dialog-header { + padding: 1.5em; + background: #fff; + color: #356593; +} + +.h5p-confirmation-dialog-header-text { + font-size: 1.25em; +} + +.h5p-confirmation-dialog-body { + background: #fafbfc; + border-top: solid 1px #dde0e9; + padding: 1.25em 1.5em; +} + +.h5p-confirmation-dialog-text { + margin-bottom: 1.5em; +} + +.h5p-confirmation-dialog-buttons { + float: right; +} + +button.h5p-confirmation-dialog-exit:visited, +button.h5p-confirmation-dialog-exit:link, +button.h5p-confirmation-dialog-exit { + position: absolute; + background: none; + border: none; + font-size: 2.5em; + top: -0.9em; + right: -1.15em; + color: #fff; + cursor: pointer; + text-decoration: none; +} + +button.h5p-confirmation-dialog-exit:focus, +button.h5p-confirmation-dialog-exit:hover { + color: #E4ECF5; +} + +.h5p-confirmation-dialog-exit:before { + font-family: "H5P"; + content: "\e890"; +} + +.h5p-core-button.h5p-confirmation-dialog-confirm-button { + padding-left: 0.75em; + margin-bottom: 0; +} + +.h5p-core-button.h5p-confirmation-dialog-confirm-button:before { + content: "\e601"; + margin-top: -6px; + display: inline-block; +} diff --git a/dist/styles/h5p-core-button.css b/dist/styles/h5p-core-button.css new file mode 100644 index 00000000..e6511dc3 --- /dev/null +++ b/dist/styles/h5p-core-button.css @@ -0,0 +1,60 @@ +button.h5p-core-button:visited, +button.h5p-core-button:link, +button.h5p-core-button { + font-family: "Open Sans", sans-serif; + font-weight: 600; + font-size: 1em; + line-height: 1.2; + padding: 0.5em 1.25em; + border-radius: 2em; + + background: #2579c6; + color: #fff; + + cursor: pointer; + border: none; + box-shadow: none; + outline: none; + + display: inline-block; + text-align: center; + text-shadow: none; + vertical-align: baseline; + text-decoration: none; + + -webkit-transition: initial; + transition: initial; +} +button.h5p-core-button:focus { + background: #1f67a8; +} +button.h5p-core-button:hover { + background: rgba(31, 103, 168, 0.83); +} +button.h5p-core-button:active { + background: #104888; +} +button.h5p-core-button:before { + font-family: 'H5P'; + padding-right: 0.15em; + font-size: 1.5em; + vertical-align: middle; + line-height: 0.7; +} +button.h5p-core-cancel-button:visited, +button.h5p-core-cancel-button:link, +button.h5p-core-cancel-button { + border: none; + background: none; + color: #a00; + margin-right: 1em; + font-size: 1em; + text-decoration: none; + cursor: pointer; +} +button.h5p-core-cancel-button:hover, +button.h5p-core-cancel-button:focus { + background: none; + border: none; + color: #e40000; +} diff --git a/dist/styles/h5p.css b/dist/styles/h5p.css old mode 100644 new mode 100755 index 45869521..7696348c --- a/dist/styles/h5p.css +++ b/dist/styles/h5p.css @@ -3,11 +3,11 @@ /* Custom H5P font to use for icons. */ @font-face { font-family: 'h5p'; - src:url('../fonts/h5p.eot?ny'); - src:url('../fonts/h5p.eot?#iefix-ny') format('embedded-opentype'), - url('data:application/font-woff;base64,d09GRgABAAAAAA/4AAsAAAAAD6wAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAGAAAABgDxIGg2NtYXAAAAFoAAAAbAAAAGzRac9fZ2FzcAAAAdQAAAAIAAAACAAAABBnbHlmAAAB3AAAC8AAAAvAZjnEZGhlYWQAAA2cAAAANgAAADYHfShNaGhlYQAADdQAAAAkAAAAJAgIBPtobXR4AAAN+AAAAEQAAABERsMR2GxvY2EAAA48AAAAJAAAACQR3hQibWF4cAAADmAAAAAgAAAAIAAeAQ5uYW1lAAAOgAAAAVYAAAFWxhg3/XBvc3QAAA/YAAAAIAAAACAAAwAAAAMExQGQAAUAAAKZAswAAACPApkCzAAAAesAMwEJAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAAAAAAAAAQAAA6JQDwP/AAEADwABAAAAAAQAAAAAAAAAAAAAAIAAAAAAAAwAAAAMAAAAcAAEAAwAAABwAAwABAAAAHAAEAFAAAAAQABAAAwAAAAEAIOYB6IrojOiU//3//wAAAAAAIOYA6IjojOiO//3//wAB/+MaBBd+F30XfAADAAEAAAAAAAAAAAAAAAAAAAAAAAEAAf//AA8AAQAAAAAAAAAAAAIAADc5AQAAAAABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAADAGDABYCfQNqAAQACQAOABMAGAAdACIAJwAsADEANgA7AAABMxUjNTsBFSM1BzMVIzU7ARUjNQczFSM1OwEVIzUHMxUjNTsBFSM1BzMVIzU7ARUjNQczFSM1OwEVIzUBg0dHs0dHs0dHs0dHs0dHs0dHs0dHs0dHs0dHs0dHs0dHs0dHA2pHR0dHnEdHR0ecSEhISJxISEhInUdHR0ecR0dHRwABAP0A9wMDAokABQAAAScHFwEnAcZ1VMkBPVQBoXVVygE9VQABAZcAyQOTAsAAIwAAASIOAhUUHgIXNSMiJj8BNjIfARYGKwEVPgM1NC4CIwKUNF1FJx42SixXCQQFhgUPBoUFBAlXLEo2HyhFXTUCwChFXTQuU0ItCc4KBqUHB6UGCs4JLUJTLjRdRSgAAAADAZgAwgOUAr4AFAAZACQAAAEiDgIVFB4CMzI+AjU0LgIjBzMVIzUTIzUzNSM1MxUzFQKWNF1FKChFXTQ1XEUoKEVcNShUVH+uMjKGKAK+KEVcNTVcRSgoRVw1NVxFKDFCQv6FM58z0jMAAAACAYcAtwOdAs0AHgArAAAlJz4BNTQuAiMiDgIVFB4CMzI2NxcWMj8BNjQnJSImNTQ2MzIWFRQGIwOdchQXJD9VLzBVPiUlPlUwJUUccwQLBCIEBP7SRWJiRUViYkXtch1EJjBUPyQkP1QwMFQ/JRcVcwQEIgQMBFJhRkViYkVGYQAAAAAKAR0AvQQMAsMADAAWACMALQA6AEQAUQBbAGAAZQAAATYmLwEiBhUXHgE/AQcXFjI/ATY0LwEFFjY/ATYmIwcOAR8BJwcGFB8BFjI/AQcGFh8BMjYvAS4BDwE3JyYiDwEGFB8BJSYGFQcUFjM3PgEvARc3NjQvASYiDwEDESERIQEhESERAfADAgRwBQUMAQUDaEtBAwkEFwMDQQHZAwUBCwEGBHAEAgNoREEDAxcDCgNBSwMCBHAEBgELAQUDaEtBAwkEFwMDQf4nAwYMBQVwBAIDaERBAwMYAwkDQYgC7/0RAsL9awKVAlsDBQEMBgRwBAIDaERBAwMXAwoDQUsDAgRwBAYMAQUDaEtBAwkEFwMDQfsDBQEMBgRwBAIDaERBAwMYAwkDQUsDAgRwBAYMAQUDaEtBAwkEFwMDQQFj/foCBv4nAaz+VAAAAAMA4QEABEYCgAAoADgAXAAAAS4BKwEVIwc+ATc2FjMyFhceARUUBgcOAQcOAQczNTMyNjc+ATU2JicHDgErATUzMhYXHgEVFAYHBSIGByc3IxUjNSMRMzUzFTMuAScuAScuASc3HgEzMjY1NCYjBCcQMCCVqQ4JFgkJEQgdLxIREgkJCRsQBw0HjkYkNRIREQEQEGEHGBEjJxEXBQYGBgf+2hAZB2cuZHp4eHqVDRcJCg8GBgkEZwcZEBUfHxUCYQ8QTT0EBwICARESESwaEyQRERwJAwIHkBAQEC0dHCwPeQYFVgcGBw8JCg8GKREND9Cjo/6AkJAHCQcHEAkJFg0PDRAfFhYfAAQBIgCdBAcC6QA2AGoA5AELAAABFgYHDgEHDgEjIiYnIiYnLgEnJiIjDgEHBiYnLgEnJjY3PgE3PgEXMhYXHgEXFjI3PgE3NhYXBTYWFx4BBzYWFxYGBzoBFx4BFxYGBw4BBw4BBw4BJy4BJy4BJy4BJzQ2Nz4BNzYWFx4BFx8BFjY3Jy4BJy4BNz4BNzYWFx4BFx4BFx4BNz4BNzYmJy4BJy4BNz4BFx4BFR4BFx4BMz4BNzwBJy4BJy4BNTQ2NzYWFx4BFx4BFx4BFx4BNz4BJxcUMDEWFAcOAQciBhUOAQciBgcOAScuAScOAQcGJicuASc+ATcXAx4BFx4BFzIwFw4BByoBIy4BJyYGDwEUFhceARcOAQcuASc3MDYXBAcBAgEQJhcKEgkJDAYBAwEyZjMBBAESJRMTJhIKDgUDCAghQB8KFQsDCAMfPx8BBAMWMBcCAwH+CA4aCwoBCA8VCAgECwQJAwsQAwQEBwQJAwQJAwsgChcoFA4YDAYHAQMFBw0HDSYLAQMBlhwNJAgDESMRAgIBAQUDBAcCCxcLCxcLBhAICw8FAQIBIEEfAgQBAg4HAQIgQyADAwINFgICJUolAwIEBAMIAwMGAhs1GgkQBwEEARISBycBAQUbFQICByMZAgEBDjQaAwcEBQsGFSoQBw8IBgsHAaYYLhgZMRkCAg4YDAECAiFFIgIDA1AHBQIEAgYLBgwRAVkRCQGtAgICERQFAQIBAQIBLlsuAQUJBQQGCwYRCggQAgoXDAMEAQMBDBcMAQEGDgYBAgHPCAUMChgQAwoMDRkMAQMOCwoTBwUIBQUIBQoCCxYyGREgEQcPCgYLBQcPBw0FEAEEA9QdDAQQAxEjEQIHBAMFAQIDAwsXCwsWDAcEAQMMCwIDASE/IAMHBQcFBAIBASBDIAIBARMNAwICJUomAgUEAwgBAgEEAgcCGjUbCA8JAQICAyESAQEGDQYXHQcCAhgdAgMBGRUJAgQBBQkCCgkPBw8HBgwIAQIICBAHCA8JAQUIBQsWCgEBAboHDQYDBQEGDQcPHhPVDAIAAAACAZcAwgOSAr4AFAA5AAABIg4CFRQeAjMyPgI1NC4CIxMWFA8BBiIvAQcGIi8BJjQ/AScmND8BNjIfATc2Mh8BFhQPARcClDRdRScnRV00NV1FJydFXTWIBQUiBQ8FTUwGDgUiBgZMTAYGIgUOBkxNBg4FIgUFTU0CvihFXDU1XEUoKEVcNTVcRSj+tQUPBSIFBU1NBQUiBg4FTU0FDwUiBQVNTQUFIgUPBU1NAAAAAAoBKAC8BAUCuwAMABYAIwAtADoARABRAFsAYABlAAABBhYzFxY2LwE0Jg8BNycmIg8BBhQfASUmBhUHBhY/ATI2LwEXNzY0LwEmIg8BEzYmIycmBh8BFBY/AQcXFjI/ATY0LwEFFjY1NzYmDwEiBh8BJwcGFB8BFjI/ARMVITUhBSE1IRUBRAMCBW8FBgEMBQRoS0EDCQMXBARBAhcDBQwBBgVvBQIEaERBAwMXAwkEQUsEAgVvBQYBDAUDaEpABAkDFwMDQf3oBAUMAQYFbwUCA2hDQQQEFwMJA0FPAW3+kwFA/u0BEwI3BAUMAQYFbwUCA2hDQQMDFwMJBEFMAwIFbwUGAQwFBGhLQQMJAxcEBEH+xgMGDAEGBW8FAgNoREAEBBcDCQNBSwMCBW8FBgEMBgNoS0EDCQMXBARAAUD4+MuengAAAAACAXMBAgO2An4AHAA5AAABHgEdARQGLwEuAT0BNDY/ATYWHQEUBg8BBhQfASU+AS8BLgE9ATQ2HwEeAR0BFAYPAQYmPQE0Nj8BAlgDBQUD3QQEBATdAwUFA5kEBJkBEgMBBJkDBQUD3QQEBATdAwUFA5kBUQIJBDsEAwOUAgkEMgQKApYCAwQ7BAkCawIHAmhoAgYDagMJBDsEAgKVAwkEMgQJA5QCAgU6BAkDaAAAAAQBeQDLA7ACpAAMABYAPABJAAABIgYfARYyPwE2JiMhFzU0JisBIgYdARciBg8BDgEHMAYjIiYxLgEvAS4BKwEiBh0BFBYzITI2PQE0JisBBSImNTQ2MzIWFRQGIwH2CgUGmQYRBpgHBgn+w9kNCkcJDsQGDwRMBA0FBwgHBwUNBEwEDwaCBwkJBwIYBgkJBoP+ogwQEAwMEBAMAgsLB7wICLwHCwqLCg4OCouJBwVdBQ0EBAQEDQVdBQcJB44GCQkGjgcJcxELDBERDAsRAAABAdcBAwNSAn0AJAAAATc2NC8BJiIPAScmIg8BBhQfAQcGFB8BFjI/ARcWMj8BNjQvAQLnawcHMAcUB2xrBxQHMAcHa2sHBzAHFAdrbAcUBzAHB2sBwGsHFQcvBwdrawcHLwcVB2trBxUHLwcHa2sHBy8HFQdrAAABAAAAAQAAVAt2QV8PPPUACwQAAAAAANIMcfMAAAAA0gxx8wAAAAAERgNqAAAACAACAAAAAAAAAAEAAAPA/8AAAAUpAAAAAARGAAEAAAAAAAAAAAAAAAAAAAARBAAAAAAAAAAAAAAAAgAAAAQAAYMEAAD9BSkBlwUpAZgFKQGHBSkBHQUpAOEFKQEiBSkBlwUpASgFKQFzBSkBeQUpAdcAAAAAAAoAFAAeAHAAggC4AO4BMAHWAloD6ARABOQFPAWkBeAAAQAAABEBDAAMAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAAMAAAABAAAAAAACAAcAPAABAAAAAAADAAMAKgABAAAAAAAEAAMAUQABAAAAAAAFAAsACQABAAAAAAAGAAMAMwABAAAAAAAKABoAWgADAAEECQABAAYAAwADAAEECQACAA4AQwADAAEECQADAAYALQADAAEECQAEAAYAVAADAAEECQAFABYAFAADAAEECQAGAAYANgADAAEECQAKADQAdGg1cABoADUAcFZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMGg1cABoADUAcGg1cABoADUAcFJlZ3VsYXIAUgBlAGcAdQBsAGEAcmg1cABoADUAcEZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=') format('woff'), - url('../fonts/h5p.ttf?ny') format('truetype'), - url('../fonts/h5p.svg?ny#h5p') format('svg'); + src: url('../fonts/h5p-core-18.eot?cb8kvi'); + src: url('../fonts/h5p-core-18.eot?cb8kvi#iefix') format('embedded-opentype'), + url('../fonts/h5p-core-18.ttf?cb8kvi') format('truetype'), + url('../fonts/h5p-core-18.woff?cb8kvi') format('woff'), + url('../fonts/h5p-core-18.svg?cb8kvi#h5p') format('svg'); font-weight: normal; font-style: normal; } @@ -30,6 +30,14 @@ html.h5p-iframe, html.h5p-iframe > body { box-sizing: border-box; -moz-box-sizing: border-box; } +.h5p-noselect +{ + -khtml-user-select: none; + -ms-user-select: none; + -moz-user-select: none; + -webkit-user-select: none; + user-select: none; +} html.h5p-iframe .h5p-content { font-size: 16px; line-height: 1.5em; @@ -100,13 +108,20 @@ body.h5p-semi-fullscreen { width: 1.125em; height: 0.925em; text-indent: -0.0875em; - outline: none; } .h5p-disable-fullscreen { line-height: 0.925em; width: 1.1em; height: 0.9em; } + +.h5p-enable-fullscreen:focus, +.h5p-disable-fullscreen:focus { + outline-style: solid; + outline-width: 1px; + outline-offset: 0.25em; +} + .h5p-enable-fullscreen:hover, .h5p-disable-fullscreen:hover { background: rgba(0,0,0,0.5); } @@ -147,7 +162,11 @@ div.h5p-fullscreen { z-index: 20; } .h5p-iframe-wrapper iframe.h5p-iframe { - width: 100%; + /* Hack for IOS landscape / portrait */ + width: 10px; + min-width: 100%; + *width: 100%; + /* End of hack */ height: 100%; z-index: 10; overflow: hidden; @@ -176,24 +195,37 @@ div.h5p-fullscreen { .h5p-actions > .h5p-button { float: left; cursor: pointer; - margin: 0 1.5em 0 0; + margin: 0 0.5em 0 0; background: none; - padding: 0; + padding: 0 0.75em 0 0.25em; vertical-align: top; color: #999; text-decoration: none; outline: none; + line-height: 23px; } .h5p-actions > .h5p-button:hover { color: #666; } +.h5p-actions > .h5p-button:active, +.h5p-actions > .h5p-button:focus, +.h5p-actions .h5p-link:active, +.h5p-actions .h5p-link:focus { + color: #666; +} +.h5p-actions > .h5p-button:focus, +.h5p-actions .h5p-link:focus { + outline-style: solid; + outline-width: thin; + outline-offset: -2px; + outline-color: #9ecaed; +} .h5p-actions > .h5p-button:before { font-family: 'H5P'; - font-size: 1em; + font-size: 20px; + line-height: 20px; + vertical-align: top; padding-right: 0; - font-size: 1.7em; - line-height: 1.125em; - vertical-align: middle; } .h5p-actions > .h5p-button.h5p-export:before { content: "\e893"; @@ -208,7 +240,7 @@ div.h5p-fullscreen { float: right; margin-right: 0; font-size: 2.0em; - line-height: 1; + line-height: 23px; overflow: hidden; color: #999; text-decoration: none; @@ -217,9 +249,11 @@ div.h5p-fullscreen { .h5p-actions .h5p-link:before { font-family: 'H5P'; content: "\e88e"; + vertical-align: bottom; } .h5p-actions > li { margin: 0; + list-style: none; } .h5p-popup-dialog { position: absolute; diff --git a/src/js/h5pintegration.es6 b/src/js/h5pintegration.es6 index 1bebdba3..faa6c0d1 100644 --- a/src/js/h5pintegration.es6 +++ b/src/js/h5pintegration.es6 @@ -160,7 +160,8 @@ library: `${library.machineName} ${library.majorVersion}.${library.minorVersion}`, jsonContent: JSON.stringify(content), styles: styles, - scripts: scripts + scripts: scripts, + displayOptions: {} }; H5P.init(); diff --git a/src/js/h5pintegration.js b/src/js/h5pintegration.js index 14be2a48..dac9ad75 100644 --- a/src/js/h5pintegration.js +++ b/src/js/h5pintegration.js @@ -185,7 +185,8 @@ var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = library: library.machineName + " " + library.majorVersion + "." + library.minorVersion, jsonContent: JSON.stringify(content), styles: styles, - scripts: scripts + scripts: scripts, + displayOptions: {} }; H5P.init();