PageSourceSearch

https://www.nhia.org.au/resources/js/jqueryMigrate.3.4.1.js

js nhia.org.au collected 2026-09-29 07:21:56 UTC 33,029 bytes, 1,022 lines download raw bytes

vendor: 5,152 bytes, lines 1-181
1
2
3 
4/*!
5 * jQuery Migrate - v3.4.1 - 2023-02-23T15:31Z
6 * Copyright OpenJS Foundation and other contributors
7 */
8( function( factory ) {
9	"use strict";
10
11	if ( typeof define === "function" && define.amd ) {
12
13		// AMD. Register as an anonymous module.
14		define( [ "jquery" ], function( jQuery ) {
15			return factory( jQuery, window );
16		} );
17	} else if ( typeof module === "object" && module.exports ) {
18
19		// Node/CommonJS
20		// eslint-disable-next-line no-undef
21		module.exports = factory( require( "jquery" ), window );
22	} else {
23
24		// Browser globals
25		factory( jQuery, window );
26	}
27} )( function( jQuery, window ) {
28"use strict";
29
30jQuery.migrateVersion = "3.4.1";
31jQuery.migrateMute = true;
32
33// Returns 0 if v1 == v2, -1 if v1 < v2, 1 if v1 > v2
34function compareVersions( v1, v2 ) {
35	var i,
36		rVersionParts = /^(\d+)\.(\d+)\.(\d+)/,
37		v1p = rVersionParts.exec( v1 ) || [ ],
38		v2p = rVersionParts.exec( v2 ) || [ ];
39
40	for ( i = 1; i <= 3; i++ ) {
41		if ( +v1p[ i ] > +v2p[ i ] ) {
42			return 1;
43		}
44		if ( +v1p[ i ] < +v2p[ i ] ) {
45			return -1;
46		}
47	}
48	return 0;
49}
50
51function jQueryVersionSince( version ) {
52	return compareVersions( jQuery.fn.jquery, version ) >= 0;
53}
54
55// A map from disabled patch codes to `true`. This should really
56// be a `Set` but those are unsupported in IE.
57var disabledPatches = Object.create( null );
58
59// Don't apply patches for specified codes. Helpful for code bases
60// where some Migrate warnings have been addressed and it's desirable
61// to avoid needless patches or false positives.
62jQuery.migrateDisablePatches = function() {
63	var i;
64	for ( i = 0; i < arguments.length; i++ ) {
65		disabledPatches[ arguments[ i ] ] = true;
66	}
67};
68
69// Allow enabling patches disabled via `jQuery.migrateDisablePatches`.
70// Helpful if you want to disable a patch only for some code that won't
71// be updated soon to be able to focus on other warnings - and enable it
72// immediately after such a call:
73// ```js
74// jQuery.migrateDisablePatches( "workaroundA" );
75// elem.pluginViolatingWarningA( "pluginMethod" );
76// jQuery.migrateEnablePatches( "workaroundA" );
77// ```
78jQuery.migrateEnablePatches = function() {
79	var i;
80	for ( i = 0; i < arguments.length; i++ ) {
81		delete disabledPatches[ arguments[ i ] ];
82	}
83};
84
85jQuery.migrateIsPatchEnabled = function( patchCode ) {
86	return !disabledPatches[ patchCode ];
87};
88
89( function() {
90
91	// Support: IE9 only
92	// IE9 only creates console object when dev tools are first opened
93	// IE9 console is a host object, callable but doesn't have .apply()
94	if ( !window.console || !window.console.log ) {
95		return;
96	}
97
98	// Need jQuery 3.x-4.x and no older Migrate loaded
99	if ( !jQuery || !jQueryVersionSince( "3.0.0" ) ||
100			jQueryVersionSince( "5.0.0" ) ) {
101		window.console.log( "JQMIGRATE: jQuery 3.x-4.x REQUIRED" );
102	}
103	if ( jQuery.migrateWarnings ) {
104		window.console.log( "JQMIGRATE: Migrate plugin loaded multiple times" );
105	}
106
107	// Show a message on the console so devs know we're active
108	window.console.log( "JQMIGRATE: Migrate is installed" +
109		( jQuery.migrateMute ? "" : " with logging active" ) +
110		", version " + jQuery.migrateVersion );
111
112} )();
113
114var warnedAbout = {};
115
116// By default each warning is only reported once.
117jQuery.migrateDeduplicateWarnings = true;
118
119// List of warnings already given; public read only
120jQuery.migrateWarnings = [];
121
122// Set to false to disable traces that appear with warnings
123if ( jQuery.migrateTrace === undefined ) {
124	jQuery.migrateTrace = true;
125}
126
127// Forget any warnings we've already given; public
128jQuery.migrateReset = function() {
129	warnedAbout = {};
130	jQuery.migrateWarnings.length = 0;
131};
132
133function migrateWarn( code, msg ) {
134	var console = window.console;
135	if ( jQuery.migrateIsPatchEnabled( code ) &&
136		( !jQuery.migrateDeduplicateWarnings || !warnedAbout[ msg ] ) ) {
137		warnedAbout[ msg ] = true;
138		jQuery.migrateWarnings.push( msg + " [" + code + "]" );
139		if ( console && console.warn && !jQuery.migrateMute ) {
140			console.warn( "JQMIGRATE: " + msg );
141			if ( jQuery.migrateTrace && console.trace ) {
142				console.trace();
143			}
144		}
145	}
146}
147
148function migrateWarnProp( obj, prop, value, code, msg ) {
149	Object.defineProperty( obj, prop, {
150		configurable: true,
151		enumerable: true,
152		get: function() {
153			migrateWarn( code, msg );
154			return value;
155		},
156		set: function( newValue ) {
157			migrateWarn( code, msg );
158			value = newValue;
159		}
160	} );
161}
162
163function migrateWarnFuncInternal( obj, prop, newFunc, code, msg ) {
164	var finalFunc,
165		origFunc = obj[ prop ];
166
167	obj[ prop ] = function() {
168
169		// If `msg` not provided, do not warn; more sophisticated warnings
170		// logic is most likely embedded in `newFunc`, in that case here
171		// we just care about the logic choosing the proper implementation
172		// based on whether the patch is disabled or not.
173		if ( msg ) {
174			migrateWarn( code, msg );
175		}
176
177		// Since patches can be disabled & enabled dynamically, we
178		// need to decide which implementation to run on each invocation.
179		finalFunc = jQuery.migrateIsPatchEnabled( code ) ?
180			newFunc :
181
182			// The function may not have existed originally so we need a fallback.
183			( origFunc || jQuery.noop );
184
185		return finalFunc.apply( this, arguments );
186	};
187}
188
189function migratePatchAndWarnFunc( obj, prop, newFunc, code, msg ) {
190	if ( !msg ) {
191		throw new Error( "No warning message provided" );
192	}
193	return migrateWarnFuncInternal( obj, prop, newFunc, code, msg );
194}
195
196function migratePatchFunc( obj, prop, newFunc, code ) {
197	return migrateWarnFuncInternal( obj, prop, newFunc, code );
198}
199
200if ( window.document.compatMode === "BackCompat" ) {
201
202	// jQuery has never supported or tested Quirks Mode
203	migrateWarn( "quirks", "jQuery is not compatible with Quirks Mode" );
204}
205
206var findProp,
207	class2type = {},
208	oldInit = jQuery.fn.init,
209	oldFind = jQuery.find,
210
211	rattrHashTest = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,
212	rattrHashGlob = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,
213
214	// Require that the "whitespace run" starts from a non-whitespace
215	// to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position.
216	rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
217
218migratePatchFunc( jQuery.fn, "init", function( arg1 ) {
219	var args = Array.prototype.slice.call( arguments );
220
221	if ( jQuery.migrateIsPatchEnabled( "selector-empty-id" ) &&
222		typeof arg1 === "string" && arg1 === "#" ) {
223
224		// JQuery( "#" ) is a bogus ID selector, but it returned an empty set
225		// before jQuery 3.0
226		migrateWarn( "selector-empty-id", "jQuery( '#' ) is not a valid selector" );
227		args[ 0 ] = [];
228	}
229
230	return oldInit.apply( this, args );
231}, "selector-empty-id" );
232
233// This is already done in Core but the above patch will lose this assignment
234// so we need to redo it. It doesn't matter whether the patch is enabled or not
235// as the method is always going to be a Migrate-created wrapper.
236jQuery.fn.init.prototype = jQuery.fn;
237
238migratePatchFunc( jQuery, "find", function( selector ) {
239	var args = Array.prototype.slice.call( arguments );
240
241	// Support: PhantomJS 1.x
242	// String#match fails to match when used with a //g RegExp, only on some strings
243	if ( typeof selector === "string" && rattrHashTest.test( selector ) ) {
244
245		// The nonstandard and undocumented unquoted-hash was removed in jQuery 1.12.0
246		// First see if qS thinks it's a valid selector, if so avoid a false positive
247		try {
248			window.document.querySelector( selector );
249		} catch ( err1 ) {
250
251			// Didn't *look* valid to qSA, warn and try quoting what we think is the value
252			selector = selector.replace( rattrHashGlob, function( _, attr, op, value ) {
253				return "[" + attr + op + "\"" + value + "\"]";
254			} );
255
256			// If the regexp *may* have created an invalid selector, don't update it
257			// Note that there may be false alarms if selector uses jQuery extensions
258			try {
259				window.document.querySelector( selector );
260				migrateWarn( "selector-hash",
261					"Attribute selector with '#' must be quoted: " + args[ 0 ] );
262				args[ 0 ] = selector;
263			} catch ( err2 ) {
264				migrateWarn( "selector-hash",
265					"Attribute selector with '#' was not fixed: " + args[ 0 ] );
266			}
267		}
268	}
269
270	return oldFind.apply( this, args );
271}, "selector-hash" );
272
273// Copy properties attached to original jQuery.find method (e.g. .attr, .isXML)
274for ( findProp in oldFind ) {
275	if ( Object.prototype.hasOwnProperty.call( oldFind, findProp ) ) {
276		jQuery.find[ findProp ] = oldFind[ findProp ];
277	}
278}
279
280// The number of elements contained in the matched element set
281migratePatchAndWarnFunc( jQuery.fn, "size", function() {
282	return this.length;
283}, "size",
284"jQuery.fn.size() is deprecated and removed; use the .length property" );
285
286migratePatchAndWarnFunc( jQuery, "parseJSON", function() {
287	return JSON.parse.apply( null, arguments );
288}, "parseJSON",
289"jQuery.parseJSON is deprecated; use JSON.parse" );
290
291migratePatchAndWarnFunc( jQuery, "holdReady", jQuery.holdReady,
292	"holdReady", "jQuery.holdReady is deprecated" );
293
294migratePatchAndWarnFunc( jQuery, "unique", jQuery.uniqueSort,
295	"unique", "jQuery.unique is deprecated; use jQuery.uniqueSort" );
296
297// Now jQuery.expr.pseudos is the standard incantation
298migrateWarnProp( jQuery.expr, "filters", jQuery.expr.pseudos, "expr-pre-pseudos",
299	"jQuery.expr.filters is deprecated; use jQuery.expr.pseudos" );
300migrateWarnProp( jQuery.expr, ":", jQuery.expr.pseudos, "expr-pre-pseudos",
301	"jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos" );
302
303// Prior to jQuery 3.1.1 there were internal refs so we don't warn there
304if ( jQueryVersionSince( "3.1.1" ) ) {
305	migratePatchAndWarnFunc( jQuery, "trim", function( text ) {
306		return text == null ?
307			"" :
308			( text + "" ).replace( rtrim, "$1" );
309	}, "trim",
310	"jQuery.trim is deprecated; use String.prototype.trim" );
311}
312
313// Prior to jQuery 3.2 there were internal refs so we don't warn there
314if ( jQueryVersionSince( "3.2.0" ) ) {
315	migratePatchAndWarnFunc( jQuery, "nodeName", function( elem, name ) {
316		return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
317	}, "nodeName",
318	"jQuery.nodeName is deprecated" );
319
320	migratePatchAndWarnFunc( jQuery, "isArray", Array.isArray, "isArray",
321		"jQuery.isArray is deprecated; use Array.isArray"
322	);
323}
324
325if ( jQueryVersionSince( "3.3.0" ) ) {
326
327	migratePatchAndWarnFunc( jQuery, "isNumeric", function( obj ) {
328
329			// As of jQuery 3.0, isNumeric is limited to
330			// strings and numbers (primitives or objects)
331			// that can be coerced to finite numbers (gh-2662)
332			var type = typeof obj;
333			return ( type === "number" || type === "string" ) &&
334
335				// parseFloat NaNs numeric-cast false positives ("")
336				// ...but misinterprets leading-number strings, e.g. hex literals ("0x...")
337				// subtraction forces infinities to NaN
338				!isNaN( obj - parseFloat( obj ) );
339		}, "isNumeric",
340		"jQuery.isNumeric() is deprecated"
341	);
342
343	// Populate the class2type map
344	jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".
345		split( " " ),
346	function( _, name ) {
347		class2type[ "[object " + name + "]" ] = name.toLowerCase();
348	} );
349
350	migratePatchAndWarnFunc( jQuery, "type", function( obj ) {
351		if ( obj == null ) {
352			return obj + "";
353		}
354
355		// Support: Android <=2.3 only (functionish RegExp)
356		return typeof obj === "object" || typeof obj === "function" ?
357			class2type[ Object.prototype.toString.call( obj ) ] || "object" :
358			typeof obj;
359	}, "type",
360	"jQuery.type is deprecated" );
361
362	migratePatchAndWarnFunc( jQuery, "isFunction",
363		function( obj ) {
364			return typeof obj === "function";
365		}, "isFunction",
366		"jQuery.isFunction() is deprecated" );
367
368	migratePatchAndWarnFunc( jQuery, "isWindow",
369		function( obj ) {
370			return obj != null && obj === obj.window;
371		}, "isWindow",
372		"jQuery.isWindow() is deprecated"
373	);
374}
375
376// Support jQuery slim which excludes the ajax module
377if ( jQuery.ajax ) {
378
379var oldAjax = jQuery.ajax,
380	rjsonp = /(=)\?(?=&|$)|\?\?/;
381
382migratePatchFunc( jQuery, "ajax", function() {
383	var jQXHR = oldAjax.apply( this, arguments );
384
385	// Be sure we got a jQXHR (e.g., not sync)
386	if ( jQXHR.promise ) {
387		migratePatchAndWarnFunc( jQXHR, "success", jQXHR.done, "jqXHR-methods",
388			"jQXHR.success is deprecated and removed" );
389		migratePatchAndWarnFunc( jQXHR, "error", jQXHR.fail, "jqXHR-methods",
390			"jQXHR.error is deprecated and removed" );
391		migratePatchAndWarnFunc( jQXHR, "complete", jQXHR.always, "jqXHR-methods",
392			"jQXHR.complete is deprecated and removed" );
393	}
394
395	return jQXHR;
396}, "jqXHR-methods" );
397
398// Only trigger the logic in jQuery <4 as the JSON-to-JSONP auto-promotion
399// behavior is gone in jQuery 4.0 and as it has security implications, we don't
400// want to restore the legacy behavior.
401if ( !jQueryVersionSince( "4.0.0" ) ) {
402
403	// Register this prefilter before the jQuery one. Otherwise, a promoted
404	// request is transformed into one with the script dataType and we can't
405	// catch it anymore.
406	jQuery.ajaxPrefilter( "+json", function( s ) {
407
408		// Warn if JSON-to-JSONP auto-promotion happens.
409		if ( s.jsonp !== false && ( rjsonp.test( s.url ) ||
410				typeof s.data === "string" &&
411				( s.contentType || "" )
412					.indexOf( "application/x-www-form-urlencoded" ) === 0 &&
413				rjsonp.test( s.data )
414		) ) {
415			migrateWarn( "jsonp-promotion", "JSON-to-JSONP auto-promotion is deprecated" );
416		}
417	} );
418}
419
420}
421
422var oldRemoveAttr = jQuery.fn.removeAttr,
423	oldToggleClass = jQuery.fn.toggleClass,
424	rmatchNonSpace = /\S+/g;
425
426migratePatchFunc( jQuery.fn, "removeAttr", function( name ) {
427	var self = this,
428		patchNeeded = false;
429
430	jQuery.each( name.match( rmatchNonSpace ), function( _i, attr ) {
431		if ( jQuery.expr.match.bool.test( attr ) ) {
432
433			// Only warn if at least a single node had the property set to
434			// something else than `false`. Otherwise, this Migrate patch
435			// doesn't influence the behavior and there's no need to set or warn.
436			self.each( function() {
437				if ( jQuery( this ).prop( attr ) !== false ) {
438					patchNeeded = true;
439					return false;
440				}
441			} );
442		}
443
444		if ( patchNeeded ) {
445			migrateWarn( "removeAttr-bool",
446				"jQuery.fn.removeAttr no longer sets boolean properties: " + attr );
447			self.prop( attr, false );
448		}
449	} );
450
451	return oldRemoveAttr.apply( this, arguments );
452}, "removeAttr-bool" );
453
454migratePatchFunc( jQuery.fn, "toggleClass", function( state ) {
455
456	// Only deprecating no-args or single boolean arg
457	if ( state !== undefined && typeof state !== "boolean" ) {
458
459		return oldToggleClass.apply( this, arguments );
460	}
461
462	migrateWarn( "toggleClass-bool", "jQuery.fn.toggleClass( boolean ) is deprecated" );
463
464	// Toggle entire class name of each element
465	return this.each( function() {
466		var className = this.getAttribute && this.getAttribute( "class" ) || "";
467
468		if ( className ) {
469			jQuery.data( this, "__className__", className );
470		}
471
472		// If the element has a class name or if we're passed `false`,
473		// then remove the whole classname (if there was one, the above saved it).
474		// Otherwise bring back whatever was previously saved (if anything),
475		// falling back to the empty string if nothing was stored.
476		if ( this.setAttribute ) {
477			this.setAttribute( "class",
478				className || state === false ?
479				"" :
480				jQuery.data( this, "__className__" ) || ""
481			);
482		}
483	} );
484}, "toggleClass-bool" );
485
486function camelCase( string ) {
487	return string.replace( /-([a-z])/g, function( _, letter ) {
488		return letter.toUpperCase();
489	} );
490}
491
492var origFnCss, internalCssNumber,
493	internalSwapCall = false,
494	ralphaStart = /^[a-z]/,
495
496	// The regex visualized:
497	//
498	//                         /----------\
499	//                        |            |    /-------\
500	//                        |  / Top  \  |   |         |
501	//         /--- Border ---+-| Right  |-+---+- Width -+---\
502	//        |                 | Bottom |                    |
503	//        |                  \ Left /                     |
504	//        |                                               |
505	//        |                              /----------\     |
506	//        |          /-------------\    |            |    |- END
507	//        |         |               |   |  / Top  \  |    |
508	//        |         |  / Margin  \  |   | | Right  | |    |
509	//        |---------+-|           |-+---+-| Bottom |-+----|
510	//        |            \ Padding /         \ Left /       |
511	// BEGIN -|                                               |
512	//        |                /---------\                    |
513	//        |               |           |                   |
514	//        |               |  / Min \  |    / Width  \     |
515	//         \--------------+-|       |-+---|          |---/
516	//                           \ Max /       \ Height /
517	rautoPx = /^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/;
518
519// If this version of jQuery has .swap(), don't false-alarm on internal uses
520if ( jQuery.swap ) {
521	jQuery.each( [ "height", "width", "reliableMarginRight" ], function( _, name ) {
522		var oldHook = jQuery.cssHooks[ name ] && jQuery.cssHooks[ name ].get;
523
524		if ( oldHook ) {
525			jQuery.cssHooks[ name ].get = function() {
526				var ret;
527
528				internalSwapCall = true;
529				ret = oldHook.apply( this, arguments );
530				internalSwapCall = false;
531				return ret;
532			};
533		}
534	} );
535}
536
537migratePatchFunc( jQuery, "swap", function( elem, options, callback, args ) {
538	var ret, name,
539		old = {};
540
541	if ( !internalSwapCall ) {
542		migrateWarn( "swap", "jQuery.swap() is undocumented and deprecated" );
543	}
544
545	// Remember the old values, and insert the new ones
546	for ( name in options ) {
547		old[ name ] = elem.style[ name ];
548		elem.style[ name ] = options[ name ];
549	}
550
551	ret = callback.apply( elem, args || [] );
552
553	// Revert the old values
554	for ( name in options ) {
555		elem.style[ name ] = old[ name ];
556	}
557
558	return ret;
559}, "swap" );
560
561if ( jQueryVersionSince( "3.4.0" ) && typeof Proxy !== "undefined" ) {
562	jQuery.cssProps = new Proxy( jQuery.cssProps || {}, {
563		set: function() {
564			migrateWarn( "cssProps", "jQuery.cssProps is deprecated" );
565			return Reflect.set.apply( this, arguments );
566		}
567	} );
568}
569
570// In jQuery >=4 where jQuery.cssNumber is missing fill it with the latest 3.x version:
571// https://github.com/jquery/jquery/blob/3.6.0/src/css.js#L212-L233
572// This way, number values for the CSS properties below won't start triggering
573// Migrate warnings when jQuery gets updated to >=4.0.0 (gh-438).
574if ( jQueryVersionSince( "4.0.0" ) ) {
575
576	// We need to keep this as a local variable as we need it internally
577	// in a `jQuery.fn.css` patch and this usage shouldn't warn.
578	internalCssNumber = {
579		animationIterationCount: true,
580		columnCount: true,
581		fillOpacity: true,
582		flexGrow: true,
583		flexShrink: true,
584		fontWeight: true,
585		gridArea: true,
586		gridColumn: true,
587		gridColumnEnd: true,
588		gridColumnStart: true,
589		gridRow: true,
590		gridRowEnd: true,
591		gridRowStart: true,
592		lineHeight: true,
593		opacity: true,
594		order: true,
595		orphans: true,
596		widows: true,
597		zIndex: true,
598		zoom: true
599	};
600
601	if ( typeof Proxy !== "undefined" ) {
602		jQuery.cssNumber = new Proxy( internalCssNumber, {
603			get: function() {
604				migrateWarn( "css-number", "jQuery.cssNumber is deprecated" );
605				return Reflect.get.apply( this, arguments );
606			},
607			set: function() {
608				migrateWarn( "css-number", "jQuery.cssNumber is deprecated" );
609				return Reflect.set.apply( this, arguments );
610			}
611		} );
612	} else {
613
614		// Support: IE 9-11+
615		// IE doesn't support proxies, but we still want to restore the legacy
616		// jQuery.cssNumber there.
617		jQuery.cssNumber = internalCssNumber;
618	}
619} else {
620
621	// Make `internalCssNumber` defined for jQuery <4 as well as it's needed
622	// in the `jQuery.fn.css` patch below.
623	internalCssNumber = jQuery.cssNumber;
624}
625
626function isAutoPx( prop ) {
627
628	// The first test is used to ensure that:
629	// 1. The prop starts with a lowercase letter (as we uppercase it for the second regex).
630	// 2. The prop is not empty.
631	return ralphaStart.test( prop ) &&
632		rautoPx.test( prop[ 0 ].toUpperCase() + prop.slice( 1 ) );
633}
634
635origFnCss = jQuery.fn.css;
636
637migratePatchFunc( jQuery.fn, "css", function( name, value ) {
638	var camelName,
639		origThis = this;
640
641	if ( name && typeof name === "object" && !Array.isArray( name ) ) {
642		jQuery.each( name, function( n, v ) {
643			jQuery.fn.css.call( origThis, n, v );
644		} );
645		return this;
646	}
647
648	if ( typeof value === "number" ) {
649		camelName = camelCase( name );
650
651		// Use `internalCssNumber` to avoid triggering our warnings in this
652		// internal check.
653		if ( !isAutoPx( camelName ) && !internalCssNumber[ camelName ] ) {
654			migrateWarn( "css-number",
655				"Number-typed values are deprecated for jQuery.fn.css( \"" +
656				name + "\", value )" );
657		}
658	}
659
660	return origFnCss.apply( this, arguments );
661}, "css-number" );
662
663var origData = jQuery.data;
664
665migratePatchFunc( jQuery, "data", function( elem, name, value ) {
666	var curData, sameKeys, key;
667
668	// Name can be an object, and each entry in the object is meant to be set as data
669	if ( name && typeof name === "object" && arguments.length === 2 ) {
670
671		curData = jQuery.hasData( elem ) && origData.call( this, elem );
672		sameKeys = {};
673		for ( key in name ) {
674			if ( key !== camelCase( key ) ) {
675				migrateWarn( "data-camelCase",
676					"jQuery.data() always sets/gets camelCased names: " + key );
677				curData[ key ] = name[ key ];
678			} else {
679				sameKeys[ key ] = name[ key ];
680			}
681		}
682
683		origData.call( this, elem, sameKeys );
684
685		return name;
686	}
687
688	// If the name is transformed, look for the un-transformed name in the data object
689	if ( name && typeof name === "string" && name !== camelCase( name ) ) {
690
691		curData = jQuery.hasData( elem ) && origData.call( this, elem );
692		if ( curData && name in curData ) {
693			migrateWarn( "data-camelCase",
694				"jQuery.data() always sets/gets camelCased names: " + name );
695			if ( arguments.length > 2 ) {
696				curData[ name ] = value;
697			}
698			return curData[ name ];
699		}
700	}
701
702	return origData.apply( this, arguments );
703}, "data-camelCase" );
704
705// Support jQuery slim which excludes the effects module
706if ( jQuery.fx ) {
707
708var intervalValue, intervalMsg,
709	oldTweenRun = jQuery.Tween.prototype.run,
710	linearEasing = function( pct ) {
711		return pct;
712	};
713
714migratePatchFunc( jQuery.Tween.prototype, "run", function( ) {
715	if ( jQuery.easing[ this.easing ].length > 1 ) {
716		migrateWarn(
717			"easing-one-arg",
718			"'jQuery.easing." + this.easing.toString() + "' should use only one argument"
719		);
720
721		jQuery.easing[ this.easing ] = linearEasing;
722	}
723
724	oldTweenRun.apply( this, arguments );
725}, "easing-one-arg" );
726
727intervalValue = jQuery.fx.interval;
728intervalMsg = "jQuery.fx.interval is deprecated";
729
730// Support: IE9, Android <=4.4
731// Avoid false positives on browsers that lack rAF
732// Don't warn if document is hidden, jQuery uses setTimeout (#292)
733if ( window.requestAnimationFrame ) {
734	Object.defineProperty( jQuery.fx, "interval", {
735		configurable: true,
736		enumerable: true,
737		get: function() {
738			if ( !window.document.hidden ) {
739				migrateWarn( "fx-interval", intervalMsg );
740			}
741
742			// Only fallback to the default if patch is enabled
743			if ( !jQuery.migrateIsPatchEnabled( "fx-interval" ) ) {
744				return intervalValue;
745			}
746			return intervalValue === undefined ? 13 : intervalValue;
747		},
748		set: function( newValue ) {
749			migrateWarn( "fx-interval", intervalMsg );
750			intervalValue = newValue;
751		}
752	} );
753}
754
755}
756
757var oldLoad = jQuery.fn.load,
758	oldEventAdd = jQuery.event.add,
759	originalFix = jQuery.event.fix;
760
761jQuery.event.props = [];
762jQuery.event.fixHooks = {};
763
764migrateWarnProp( jQuery.event.props, "concat", jQuery.event.props.concat,
765	"event-old-patch",
766	"jQuery.event.props.concat() is deprecated and removed" );
767
768migratePatchFunc( jQuery.event, "fix", function( originalEvent ) {
769	var event,
770		type = originalEvent.type,
771		fixHook = this.fixHooks[ type ],
772		props = jQuery.event.props;
773
774	if ( props.length ) {
775		migrateWarn( "event-old-patch",
776			"jQuery.event.props are deprecated and removed: " + props.join() );
777		while ( props.length ) {
778			jQuery.event.addProp( props.pop() );
779		}
780	}
781
782	if ( fixHook && !fixHook._migrated_ ) {
783		fixHook._migrated_ = true;
784		migrateWarn( "event-old-patch",
785			"jQuery.event.fixHooks are deprecated and removed: " + type );
786		if ( ( props = fixHook.props ) && props.length ) {
787			while ( props.length ) {
788				jQuery.event.addProp( props.pop() );
789			}
790		}
791	}
792
793	event = originalFix.call( this, originalEvent );
794
795	return fixHook && fixHook.filter ?
796		fixHook.filter( event, originalEvent ) :
797		event;
798}, "event-old-patch" );
799
800migratePatchFunc( jQuery.event, "add", function( elem, types ) {
801
802	// This misses the multiple-types case but that seems awfully rare
803	if ( elem === window && types === "load" && window.document.readyState === "complete" ) {
804		migrateWarn( "load-after-event",
805			"jQuery(window).on('load'...) called after load event occurred" );
806	}
807	return oldEventAdd.apply( this, arguments );
808}, "load-after-event" );
809
810jQuery.each( [ "load", "unload", "error" ], function( _, name ) {
811
812	migratePatchFunc( jQuery.fn, name, function() {
813		var args = Array.prototype.slice.call( arguments, 0 );
814
815		// If this is an ajax load() the first arg should be the string URL;
816		// technically this could also be the "Anything" arg of the event .load()
817		// which just goes to show why this dumb signature has been deprecated!
818		// jQuery custom builds that exclude the Ajax module justifiably die here.
819		if ( name === "load" && typeof args[ 0 ] === "string" ) {
820			return oldLoad.apply( this, args );
821		}
822
823		migrateWarn( "shorthand-removed-v3",
824			"jQuery.fn." + name + "() is deprecated" );
825
826		args.splice( 0, 0, name );
827		if ( arguments.length ) {
828			return this.on.apply( this, args );
829		}
830
831		// Use .triggerHandler here because:
832		// - load and unload events don't need to bubble, only applied to window or image
833		// - error event should not bubble to window, although it does pre-1.7
834		// See http://bugs.jquery.com/ticket/11820
835		this.triggerHandler.apply( this, args );
836		return this;
837	}, "shorthand-removed-v3" );
838
839} );
840
841jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " +
842	"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
843	"change select submit keydown keypress keyup contextmenu" ).split( " " ),
844	function( _i, name ) {
845
846	// Handle event binding
847	migratePatchAndWarnFunc( jQuery.fn, name, function( data, fn ) {
848		return arguments.length > 0 ?
849			this.on( name, null, data, fn ) :
850			this.trigger( name );
851		},
852		"shorthand-deprecated-v3",
853		"jQuery.fn." + name + "() event shorthand is deprecated" );
854} );
855
856// Trigger "ready" event only once, on document ready
857jQuery( function() {
858	jQuery( window.document ).triggerHandler( "ready" );
859} );
860
861jQuery.event.special.ready = {
862	setup: function() {
863		if ( this === window.document ) {
864			migrateWarn( "ready-event", "'ready' event is deprecated" );
865		}
866	}
867};
868
869migratePatchAndWarnFunc( jQuery.fn, "bind", function( types, data, fn ) {
870	return this.on( types, null, data, fn );
871}, "pre-on-methods", "jQuery.fn.bind() is deprecated" );
872migratePatchAndWarnFunc( jQuery.fn, "unbind", function( types, fn ) {
873	return this.off( types, null, fn );
874}, "pre-on-methods", "jQuery.fn.unbind() is deprecated" );
875migratePatchAndWarnFunc( jQuery.fn, "delegate", function( selector, types, data, fn ) {
876	return this.on( types, selector, data, fn );
877}, "pre-on-methods", "jQuery.fn.delegate() is deprecated" );
878migratePatchAndWarnFunc( jQuery.fn, "undelegate", function( selector, types, fn ) {
879	return arguments.length === 1 ?
880		this.off( selector, "**" ) :
881		this.off( types, selector || "**", fn );
882}, "pre-on-methods", "jQuery.fn.undelegate() is deprecated" );
883migratePatchAndWarnFunc( jQuery.fn, "hover", function( fnOver, fnOut ) {
884	return this.on( "mouseenter", fnOver ).on( "mouseleave", fnOut || fnOver );
885}, "pre-on-methods", "jQuery.fn.hover() is deprecated" );
886
887var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,
888	makeMarkup = function( html ) {
889		var doc = window.document.implementation.createHTMLDocument( "" );
890		doc.body.innerHTML = html;
891		return doc.body && doc.body.innerHTML;
892	},
893	warnIfChanged = function( html ) {
894		var changed = html.replace( rxhtmlTag, "<$1></$2>" );
895		if ( changed !== html && makeMarkup( html ) !== makeMarkup( changed ) ) {
896			migrateWarn( "self-closed-tags",
897				"HTML tags must be properly nested and closed: " + html );
898		}
899	};
900
901/**
902 * Deprecated, please use `jQuery.migrateDisablePatches( "self-closed-tags" )` instead.
903 * @deprecated
904 */
905jQuery.UNSAFE_restoreLegacyHtmlPrefilter = function() {
906	jQuery.migrateEnablePatches( "self-closed-tags" );
907};
908
909migratePatchFunc( jQuery, "htmlPrefilter", function( html ) {
910	warnIfChanged( html );
911	return html.replace( rxhtmlTag, "<$1></$2>" );
912}, "self-closed-tags" );
913
914// This patch needs to be disabled by default as it re-introduces
915// security issues (CVE-2020-11022, CVE-2020-11023).
916jQuery.migrateDisablePatches( "self-closed-tags" );
917
918var origOffset = jQuery.fn.offset;
919
920migratePatchFunc( jQuery.fn, "offset", function() {
921	var elem = this[ 0 ];
922
923	if ( elem && ( !elem.nodeType || !elem.getBoundingClientRect ) ) {
924		migrateWarn( "offset-valid-elem", "jQuery.fn.offset() requires a valid DOM element" );
925		return arguments.length ? this : undefined;
926	}
927
928	return origOffset.apply( this, arguments );
929}, "offset-valid-elem" );
930
931// Support jQuery slim which excludes the ajax module
932// The jQuery.param patch is about respecting `jQuery.ajaxSettings.traditional`
933// so it doesn't make sense for the slim build.
934if ( jQuery.ajax ) {
935
936var origParam = jQuery.param;
937
938migratePatchFunc( jQuery, "param", function( data, traditional ) {
939	var ajaxTraditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
940
941	if ( traditional === undefined && ajaxTraditional ) {
942
943		migrateWarn( "param-ajax-traditional",
944			"jQuery.param() no longer uses jQuery.ajaxSettings.traditional" );
945		traditional = ajaxTraditional;
946	}
947
948	return origParam.call( this, data, traditional );
949}, "param-ajax-traditional" );
950
951}
952
953migratePatchAndWarnFunc( jQuery.fn, "andSelf", jQuery.fn.addBack, "andSelf",
954	"jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()" );
955
956// Support jQuery slim which excludes the deferred module in jQuery 4.0+
957if ( jQuery.Deferred ) {
958
959var oldDeferred = jQuery.Deferred,
960	tuples = [
961
962		// Action, add listener, callbacks, .then handlers, final state
963		[ "resolve", "done", jQuery.Callbacks( "once memory" ),
964			jQuery.Callbacks( "once memory" ), "resolved" ],
965		[ "reject", "fail", jQuery.Callbacks( "once memory" ),
966			jQuery.Callbacks( "once memory" ), "rejected" ],
967		[ "notify", "progress", jQuery.Callbacks( "memory" ),
968			jQuery.Callbacks( "memory" ) ]
969	];
970
971migratePatchFunc( jQuery, "Deferred", function( func ) {
972	var deferred = oldDeferred(),
973		promise = deferred.promise();
974
975	function newDeferredPipe( /* fnDone, fnFail, fnProgress */ ) {
976		var fns = arguments;
977
978		return jQuery.Deferred( function( newDefer ) {
979			jQuery.each( tuples, function( i, tuple ) {
980				var fn = typeof fns[ i ] === "function" && fns[ i ];
981
982				// Deferred.done(function() { bind to newDefer or newDefer.resolve })
983				// deferred.fail(function() { bind to newDefer or newDefer.reject })
984				// deferred.progress(function() { bind to newDefer or newDefer.notify })
985				deferred[ tuple[ 1 ] ]( function() {
986					var returned = fn && fn.apply( this, arguments );
987					if ( returned && typeof returned.promise === "function" ) {
988						returned.promise()
989							.done( newDefer.resolve )
990							.fail( newDefer.reject )
991							.progress( newDefer.notify );
992					} else {
993						newDefer[ tuple[ 0 ] + "With" ](
994							this === promise ? newDefer.promise() : this,
995							fn ? [ returned ] : arguments
996						);
997					}
998				} );
999			} );
1000			fns = null;
1001		} ).promise();
1002	}
1003
1004	migratePatchAndWarnFunc( deferred, "pipe", newDeferredPipe, "deferred-pipe",
1005		"deferred.pipe() is deprecated" );
1006	migratePatchAndWarnFunc( promise, "pipe", newDeferredPipe, "deferred-pipe",
1007		"deferred.pipe() is deprecated" );
1008
1009	if ( func ) {
1010		func.call( deferred, deferred );
1011	}
1012
1013	return deferred;
1014}, "deferred-pipe" );
1015
1016// Preserve handler of uncaught exceptions in promise chains
1017jQuery.Deferred.exceptionHook = oldDeferred.exceptionHook;
1018
1019}
1020
1021return jQuery;
1022} );

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.