vendor: 88 bytes, lines 1-4
1/******/ (() => { // webpackBootstrap 2/******/ var __webpack_modules__ = ({ 3 4/***/ "./s
4cripts/libraries/customFileUpload.js": 5/*!***********************************************!*\ 6 !*** ./scripts/libraries/customFileUpload.js ***! 7 \***********************************************/ 8/***/ (() => { 9 10/** 11* SimpleFileInput 0.1 - A jQuery plugin to customise your file inputs 12* http://github.com/s43/Simple-file-input/ 13* Requirements : jQuery 1.7+ 14* 15* :: Copyright (c) 2014 SAID ASSEMLAL 16* 17* Dual licensed under the MIT and GPL licenses. 18*/ 19 20(function ($) { 21 $.fn.simpleFileInput = function (options) { 22 $('html').addClass('sfi-js'); 23 return this.each(function () { 24 var defaults = { 25 placeholder: 'Pick your file', 26 wrapperClass: 'sfi-container', 27 validClass: 'sfi-valid', 28 errorClass: 'sfi-error', 29 disabledClass: 'sfi-disabled', 30 buttonText: 'Pick your file', 31 allowedExts: false, 32 // This has to be an array 33 width: 300, 34 onInit: function onInit() {}, 35 onFileSelect: function onFileSelect() {}, 36 onError: function onError() {} 37 }; 38 39 /* 40 Init 41 */ 42 43 var _options = $.extend(defaults, options), 44 _input = $(this), 45 _sfiWrapper = $('<div class="sfi-wrapper ' + _options.wrapperClass + (_input.is(':disabled') ? ' sfi-disabled' : '') + '"></div>'), 46 _sfiFileName = $('<span class="sfi-filename empty">' + _options.placeholder + '</span>'), 47 _sfiTrigger = $('<a href="#" class="sfi-trigger">' + _options.buttonText + '</a>'); 48 _options.onInit(); 49 50 /* 51 Check if the input has been already stylised, if so then move forwards. 52 */ 53 54 if ($(this).next('.sfi-wrapper').length) { 55 return; 56 } 57 58 /* 59 Generate the DOM Elements 60 */ 61 62 _sfiWrapper.insertAfter(_input); 63 _sfiWrapper.attr("tabindex", _input.attr("tabindex") || "0"); 64 if (_options.width != false) _sfiWrapper.css('width', _options.width + 'px'); 65 _sfiFileName.appendTo(_sfiWrapper); 66 _sfiTrigger.appendTo(_sfiWrapper); 67 _input.hide(); // Hide the old input, it still can be used in the background 68 69 /* 70 If the input is disabled, don't apply the events, and just move forward. 71 */ 72 73 if (_input.is(':disabled')) { 74 _sfiWrapper.addClass('.sfi-disabled'); 75 return; 76 } 77 78 /* 79 Events &/ Triggers 80 */ 81 82 _sfiTrigger.unbind('click').bind('click', function (e) { 83 _triggerInput(e); 84 }); 85 _sfiFileName.unbind('click').bind('click', function (e) { 86 _triggerInput(e); 87 }); 88 _input.bind('change', function (e) { 89 var _val = $(this).val(); 90 if (_checkAllowedExtensions(_val) == true) { 91 _sfiFileName.text(_getFileName(_val)); 92 _options.onFileSelect(); 93 _sfiWrapper.removeClass(_options.errorClass); 94 _sfiWrapper.addClass(_options.validClass); 95 } else { 96 _options.onError(); 97 _input.val(''); 98 _sfiWrapper.removeClass(_options.validClass); 99 _sfiWrapper.addClass(_options.errorClass); 100 } 101 }); 102 103 /* 104 _getFileName() : Get the selected file's name 105 */ 106 107 function _getFileName(_fakePath) { 108 var _index = _fakePath.indexOf('\\') >= 0 ? _fakePath.lastIndexOf('\\') : _fakePath.lastIndexOf('/'); 109 var _filename = _fakePath.substring(_index); 110 if (_filename.indexOf('\\') === 0 || _filename.indexOf('/') === 0) { 111 _filename = _filename.substring(1); 112 } 113 return _filename; 114 } 115 116 /* 117 _triggerInput() : Trigger the click event on the hidden input 118 */ 119 120 function _triggerInput(_e) { 121 _e.preventDefault(); 122 _input.trigger('click'); 123 } 124 125 /* 126 _checkAllowedExtensions() : Check for the allowed extensions if there is, and return a valid or non-valid response. 127 */ 128 function _checkAllowedExtensions(_filename) { 129 var _filename = _filename === undefined ? '' : _filename; 130 var _allowed = _options.allowedExts, 131 _ext = _filename.split('.').pop(); 132 if (_ext == '' || _allowed == false) return true; 133 if ($.inArray(_ext, _allowed) !== -1) return true;else return false;
134 } 135 }); 136 }; 137})($); 138 139/***/ }), 140
vendor: 20,420 bytes, lines 141-579
141/***/ "./node_modules/jquery-validation-unobtrusive/dist/jquery.validate.unobtrusive.js": 142/*!****************************************************************************************!*\ 143 !*** ./node_modules/jquery-validation-unobtrusive/dist/jquery.validate.unobtrusive.js ***! 144 \****************************************************************************************/ 145/***/ ((module, exports, __webpack_require__) => { 146 147var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Unobtrusive validation support library for jQuery and jQuery Validate 148// Copyright (c) .NET Foundation. All rights reserved. 149// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 150// @version v3.2.12 151 152/*jslint white: true, browser: true, onevar: true, undef: true, nomen: true, eqeqeq: true, plusplus: true, bitwise: true, regexp: true, newcap: true, immed: true, strict: false */ 153/*global document: false, jQuery: false */ 154 155(function (factory) { 156 if (true) { 157 // AMD. Register as an anonymous module. 158 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! jquery-validation */ "./node_modules/jquery-validation/dist/jquery.validate.js")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 159 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 160 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), 161 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 162 } else {} 163}(function ($) { 164 var $jQval = $.validator, 165 adapters, 166 data_validation = "unobtrusiveValidation"; 167 168 function setValidationValues(options, ruleName, value) { 169 options.rules[ruleName] = value; 170 if (options.message) { 171 options.messages[ruleName] = options.message; 172 } 173 } 174 175 function splitAndTrim(value) { 176 return value.replace(/^\s+|\s+$/g, "").split(/\s*,\s*/g); 177 } 178 179 function escapeAttributeValue(value) { 180 // As mentioned on http://api.jquery.com/category/selectors/ 181 return value.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g, "\\$1"); 182 } 183 184 function getModelPrefix(fieldName) { 185 return fieldName.substr(0, fieldName.lastIndexOf(".") + 1); 186 } 187 188 function appendModelPrefix(value, prefix) { 189 if (value.indexOf("*.") === 0) { 190 value = value.replace("*.", prefix); 191 } 192 return value; 193 } 194 195 function onError(error, inputElement) { // 'this' is the form element 196 var container = $(this).find("[data-valmsg-for='" + escapeAttributeValue(inputElement[0].name) + "']"), 197 replaceAttrValue = container.attr("data-valmsg-replace"), 198 replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) !== false : null; 199 200 container.removeClass("field-validation-valid").addClass("field-validation-error"); 201 error.data("unobtrusiveContainer", container); 202 203 if (replace) { 204 container.empty(); 205 error.removeClass("input-validation-error").appendTo(container); 206 } 207 else { 208 error.hide(); 209 } 210 } 211 212 function onErrors(event, validator) { // 'this' is the form element 213 var container = $(this).find("[data-valmsg-summary=true]"), 214 list = container.find("ul"); 215 216 if (list && list.length && validator.errorList.length) { 217 list.empty(); 218 container.addClass("validation-summary-errors").removeClass("validation-summary-valid"); 219 220 $.each(validator.errorList, function () { 221 $("<li />").html(this.message).appendTo(list); 222 }); 223 } 224 } 225 226 function onSuccess(error) { // 'this' is the form element 227 var container = error.data("unobtrusiveContainer"); 228 229 if (container) { 230 var replaceAttrValue = container.attr("data-valmsg-replace"), 231 replace = replaceAttrValue ? $.parseJSON(replaceAttrValue) : null; 232 233 container.addClass("field-validation-valid").removeClass("field-validation-error"); 234 error.removeData("unobtrusiveContainer"); 235 236 if (replace) { 237 container.empty(); 238 } 239 } 240 } 241 242 function onReset(event) { // 'this' is the form element 243 var $form = $(this), 244 key = '__jquery_unobtrusive_validation_form_reset'; 245 if ($form.data(key)) { 246 return; 247 } 248 // Set a flag that indicates we're currently resetting the form. 249 $form.data(key, true); 250 try { 251 $form.data("validator").resetForm(); 252 } finally { 253 $form.removeData(key); 254 } 255 256 $form.find(".validation-summary-errors") 257 .addClass("validation-summary-valid") 258 .removeClass("validation-summary-errors"); 259 $form.find(".field-validation-error") 260 .addClass("field-validation-valid") 261 .removeClass("field-validation-error") 262 .removeData("unobtrusiveContainer") 263 .find(">*") // If we were using valmsg-replace, get the underlying error 264 .removeData("unobtrusiveContainer"); 265 } 266 267 function validationInfo(form) { 268 var $form = $(form), 269 result = $form.data(data_validation), 270 onResetProxy = $.proxy(onReset, form), 271 defaultOptions = $jQval.unobtrusive.options || {}, 272 execInContext = function (name, args) { 273 var func = defaultOptions[name]; 274 func && $.isFunction(func) && func.apply(form, args); 275 }; 276 277 if (!result) { 278 result = { 279 options: { // options structure passed to jQuery Validate's validate() method 280 errorClass: defaultOptions.errorClass || "input-validation-error", 281 errorElement: defaultOptions.errorElement || "span", 282 errorPlacement: function () { 283 onError.apply(form, arguments); 284 execInContext("errorPlacement", arguments); 285 }, 286 invalidHandler: function () { 287 onErrors.apply(form, arguments); 288 execInContext("invalidHandler", arguments); 289 }, 290 messages: {}, 291 rules: {}, 292 success: function () { 293 onSuccess.apply(form, arguments); 294 execInContext("success", arguments); 295 } 296 }, 297 attachValidation: function () { 298 $form 299 .off("reset." + data_validation, onResetProxy) 300 .on("reset." + data_validation, onResetProxy) 301 .validate(this.options); 302 }, 303 validate: function () { // a validation function that is called by unobtrusive Ajax 304 $form.validate(); 305 return $form.valid(); 306 } 307 }; 308 $form.data(data_validation, result); 309 } 310 311 return result; 312 } 313 314 $jQval.unobtrusive = { 315 adapters: [], 316 317 parseElement: function (element, skipAttach) { 318 /// <summary> 319 /// Parses a single HTML element for unobtrusive validation attributes. 320 /// </summary> 321 /// <param name="element" domElement="true">The HTML element to be parsed.</param> 322 /// <param name="skipAttach" type="Boolean">[Optional] true to skip attaching the 323 /// validation to the form. If parsing just this single element, you should specify true. 324 /// If parsing several elements, you should specify false, and manually attach the validation 325 /// to the form when you are finished. The default is false.</param> 326 var $element = $(element), 327 form = $element.parents("form")[0], 328 valInfo, rules, messages; 329 330 if (!form) { // Cannot do client-side validation without a form 331 return; 332 } 333 334 valInfo = validationInfo(form); 335 valInfo.options.rules[element.name] = rules = {}; 336 valInfo.options.messages[element.name] = messages = {}; 337 338 $.each(this.adapters, function () { 339 var prefix = "data-val-" + this.name, 340 message = $element.attr(prefix), 341 paramValues = {}; 342 343 if (message !== undefined) { // Compare against undefined, because an empty message is legal (and falsy) 344 prefix += "-"; 345 346 $.each(this.params, function () { 347 paramValues[this] = $element.attr(prefix + this); 348 }); 349 350 this.adapt({ 351 element: element, 352 form: form, 353 message: message, 354 params: paramValues, 355 rules: rules, 356 messages: messages 357 }); 358 } 359 }); 360 361 $.extend(rules, { "__dummy__": true }); 362 363 if (!skipAttach) { 364 valInfo.attachValidation(); 365 } 366 }, 367 368 parse: function (selector) { 369 /// <summary> 370 /// Parses all the HTML elements in the specified selector. It looks for input elements decorated 371 /// with the [data-val=true] attribute value and enables validation according to the data-val-* 372 /// attribute values. 373 /// </summary> 374 /// <param name="selector" type="String">Any valid jQuery selector.</param> 375 376 // $forms includes all forms in selector's DOM hierarchy (parent, children and self) that have at least one 377 // element with data-val=true 378 var $selector = $(selector), 379 $forms = $selector.parents() 380 .addBack() 381 .filter("form") 382 .add($selector.find("form")) 383 .has("[data-val=true]"); 384 385 $selector.find("[data-val=true]").each(function () { 386 $jQval.unobtrusive.parseElement(this, true); 387 }); 388 389 $forms.each(function () { 390 var info = validationInfo(this); 391 if (info) { 392 info.attachValidation(); 393 } 394 }); 395 } 396 }; 397 398 adapters = $jQval.unobtrusive.adapters; 399 400 adapters.add = function (adapterName, params, fn) { 401 /// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation.</summary> 402 /// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used 403 /// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param> 404 /// <param name="params" type="Array" optional="true">[Optional] An array of parameter names (strings) that will 405 /// be extracted from the data-val-nnnn-mmmm HTML attributes (where nnnn is the adapter name, and 406 /// mmmm is the parameter name).</param> 407 /// <param name="fn" type="Function">The function to call, which adapts the values from the HTML 408 /// attributes into jQuery Validate rules and/or messages.</param> 409 /// <returns type="jQuery.validator.unobtrusive.adapters" /> 410 if (!fn) { // Called with no params, just a function 411 fn = params; 412 params = []; 413 } 414 this.push({ name: adapterName, params: params, adapt: fn }); 415 return this; 416 }; 417 418 adapters.addBool = function (adapterName, ruleName) { 419 /// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where 420 /// the jQuery Validate validation rule has no parameter values.</summary> 421 /// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used 422 /// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param> 423 /// <param name="ruleName" type="String" optional="true">[Optional] The name of the jQuery Validate rule. If not provided, the value 424 /// of adapterName will be used instead.</param> 425 /// <returns type="jQuery.validator.unobtrusive.adapters" /> 426 return this.add(adapterName, function (options) { 427 setValidationValues(options, ruleName || adapterName, true); 428 }); 429 }; 430 431 adapters.addMinMax = function (adapterName, minRuleName, maxRuleName, minMaxRuleName, minAttribute, maxAttribute) { 432 /// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where 433 /// the jQuery Validate validation has three potential rules (one for min-only, one for max-only, and 434 /// one for min-and-max). The HTML parameters are expected to be named -min and -max.</summary> 435 /// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used 436 /// in the data-val-nnnn HTML attribute (where nnnn is the adapter name).</param> 437 /// <param name="minRuleName" type="String">The name of the jQuery Validate rule to be used when you only 438 /// have a minimum value.</param> 439 /// <param name="maxRuleName" type="String">The name of the jQuery Validate rule to be used when you only 440 /// have a maximum value.</param> 441 /// <param name="minMaxRuleName" type="String">The name of the jQuery Validate rule to be used when you 442 /// have both a minimum and maximum value.</param> 443 /// <param name="minAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that 444 /// contains the minimum value. The default is "min".</param> 445 /// <param name="maxAttribute" type="String" optional="true">[Optional] The name of the HTML attribute that 446 /// contains the maximum value. The default is "max".</param> 447 /// <returns type="jQuery.validator.unobtrusive.adapters" /> 448 return this.add(adapterName, [minAttribute || "min", maxAttribute || "max"], function (options) { 449 var min = options.params.min, 450 max = options.params.max; 451 452 if (min && max) { 453 setValidationValues(options, minMaxRuleName, [min, max]); 454 } 455 else if (min) { 456 setValidationValues(options, minRuleName, min); 457 } 458 else if (max) { 459 setValidationValues(options, maxRuleName, max); 460 } 461 }); 462 }; 463 464 adapters.addSingleVal = function (adapterName, attribute, ruleName) { 465 /// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation, where 466 /// the jQuery Validate validation rule has a single value.</summary> 467 /// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used 468 /// in the data-val-nnnn HTML attribute(where nnnn is the adapter name).</param> 469 /// <param name="attribute" type="String">[Optional] The name of the HTML attribute that contains the value. 470 /// The default is "val".</param> 471 /// <param name="ruleName" type="String" optional="true">[Optional] The name of the jQuery Validate rule. If not provided, the value 472 /// of adapterName will be used instead.</param> 473 /// <returns type="jQuery.validator.unobtrusive.adapters" /> 474 return this.add(adapterName, [attribute || "val"], function (options) { 475 setValidationValues(options, ruleName || adapterName, options.params[attribute]); 476 }); 477 }; 478 479 $jQval.addMethod("__dummy__", function (value, element, params) { 480 return true; 481 }); 482 483 $jQval.addMethod("regex", function (value, element, params) { 484 var match; 485 if (this.optional(element)) { 486 return true; 487 } 488 489 match = new RegExp(params).exec(value); 490 return (match && (match.index === 0) && (match[0].length === value.length)); 491 }); 492 493 $jQval.addMethod("nonalphamin", function (value, element, nonalphamin) { 494 var match; 495 if (nonalphamin) { 496 match = value.match(/\W/g); 497 match = match && match.length >= nonalphamin; 498 } 499 return match; 500 }); 501 502 if ($jQval.methods.extension) { 503 adapters.addSingleVal("accept", "mimtype"); 504 adapters.addSingleVal("extension", "extension"); 505 } else { 506 // for backward compatibility, when the 'extension' validation method does not exist, such as with versions 507 // of JQuery Validation plugin prior to 1.10, we should use the 'accept' method for 508 // validating the extension, and ignore mime-type validations as they are not supported. 509 adapters.addSingleVal("extension", "extension", "accept"); 510 } 511 512 adapters.addSingleVal("regex", "pattern"); 513 adapters.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url"); 514 adapters.addMinMax("length", "minlength", "maxlength", "rangelength").addMinMax("range", "min", "max", "range"); 515 adapters.addMinMax("minlength", "minlength").addMinMax("maxlength", "minlength", "maxlength"); 516 adapters.add("equalto", ["other"], function (options) { 517 var prefix = getModelPrefix(options.element.name), 518 other = options.params.other, 519 fullOtherName = appendModelPrefix(other, prefix), 520 element = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(fullOtherName) + "']")[0]; 521 522 setValidationValues(options, "equalTo", element); 523 }); 524 adapters.add("required", function (options) { 525 // jQuery Validate equates "required" with "mandatory" for checkbox elements 526 if (options.element.tagName.toUpperCase() !== "INPUT" || options.element.type.toUpperCase() !== "CHECKBOX") { 527 setValidationValues(options, "required", true); 528 } 529 }); 530 adapters.add("remote", ["url", "type", "additionalfields"], function (options) { 531 var value = { 532 url: options.params.url, 533 type: options.params.type || "GET", 534 data: {} 535 }, 536 prefix = getModelPrefix(options.element.name); 537 538 $.each(splitAndTrim(options.params.additionalfields || options.element.name), function (i, fieldName) { 539 var paramName = appendModelPrefix(fieldName, prefix); 540 value.data[paramName] = function () { 541 var field = $(options.form).find(":input").filter("[name='" + escapeAttributeValue(paramName) + "']"); 542 // For checkboxes and radio buttons, only pick up values from checked fields. 543 if (field.is(":checkbox")) { 544 return field.filter(":checked").val() || field.filter(":hidden").val() || ''; 545 } 546 else if (field.is(":radio")) { 547 return field.filter(":checked").val() || ''; 548 } 549 return field.val(); 550 }; 551 }); 552 553 setValidationValues(options, "remote", value); 554 }); 555 adapters.add("password", ["min", "nonalphamin", "regex"], function (options) { 556 if (options.params.min) { 557 setValidationValues(options, "minlength", options.params.min); 558 } 559 if (options.params.nonalphamin) { 560 setValidationValues(options, "nonalphamin", options.params.nonalphamin); 561 } 562 if (options.params.regex) { 563 setValidationValues(options, "regex", options.params.regex); 564 } 565 }); 566 adapters.add("fileextensions", ["extensions"], function (options) { 567 setValidationValues(options, "extension", options.params.extensions); 568 }); 569 570 $(function () { 571 $jQval.unobtrusive.parse(document); 572 }); 573 574 return $jQval.unobtrusive; 575})); 576 577 578/***/ }), 579
vendor: 51,621 bytes, lines 580-2244
580/***/ "./node_modules/jquery-validation/dist/jquery.validate.js": 581/*!****************************************************************!*\ 582 !*** ./node_modules/jquery-validation/dist/jquery.validate.js ***! 583 \****************************************************************/ 584/***/ ((module, exports, __webpack_require__) => { 585 586var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 587 * jQuery Validation Plugin v1.19.3 588 * 589 * https://jqueryvalidation.org/ 590 * 591 * Copyright (c) 2021 Jörn Zaefferer 592 * Released under the MIT license 593 */ 594(function( factory ) { 595 if ( true ) { 596 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(/*! jquery */ "jquery")], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), 597 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? 598 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), 599 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 600 } else {} 601}(function( $ ) { 602 603$.extend( $.fn, { 604 605 // https://jqueryvalidation.org/validate/ 606 validate: function( options ) { 607 608 // If nothing is selected, return nothing; can't chain anyway 609 if ( !this.length ) { 610 if ( options && options.debug && window.console ) { 611 console.warn( "Nothing selected, can't validate, returning nothing." ); 612 } 613 return; 614 } 615 616 // Check if a validator for this form was already created 617 var validator = $.data( this[ 0 ], "validator" ); 618 if ( validator ) { 619 return validator; 620 } 621 622 // Add novalidate tag if HTML5. 623 this.attr( "novalidate", "novalidate" ); 624 625 validator = new $.validator( options, this[ 0 ] ); 626 $.data( this[ 0 ], "validator", validator ); 627 628 if ( validator.settings.onsubmit ) { 629 630 this.on( "click.validate", ":submit", function( event ) { 631 632 // Track the used submit button to properly handle scripted 633 // submits later. 634 validator.submitButton = event.currentTarget; 635 636 // Allow suppressing validation by adding a cancel class to the submit button 637 if ( $( this ).hasClass( "cancel" ) ) { 638 validator.cancelSubmit = true; 639 } 640 641 // Allow suppressing validation by adding the html5 formnovalidate attribute to the submit button 642 if ( $( this ).attr( "formnovalidate" ) !== undefined ) { 643 validator.cancelSubmit = true; 644 } 645 } ); 646 647 // Validate the form on submit 648 this.on( "submit.validate", function( event ) { 649 if ( validator.settings.debug ) { 650 651 // Prevent form submit to be able to see console output 652 event.preventDefault(); 653 } 654 655 function handle() { 656 var hidden, result; 657 658 // Insert a hidden input as a replacement for the missing submit button 659 // The hidden input is inserted in two cases: 660 // - A user defined a `submitHandler` 661 // - There was a pending request due to `remote` method and `stopRequest()` 662 // was called to submit the form in case it's valid 663 if ( validator.submitButton && ( validator.settings.submitHandler || validator.formSubmitted ) ) { 664 hidden = $( "<input type='hidden'/>" ) 665 .attr( "name", validator.submitButton.name ) 666 .val( $( validator.submitButton ).val() ) 667 .appendTo( validator.currentForm ); 668 } 669 670 if ( validator.settings.submitHandler && !validator.settings.debug ) { 671 result = validator.settings.submitHandler.call( validator, validator.currentForm, event ); 672 if ( hidden ) { 673 674 // And clean up afterwards; thanks to no-block-scope, hidden can be referenced 675 hidden.remove(); 676 } 677 if ( result !== undefined ) { 678 return result; 679 } 680 return false; 681 } 682 return true; 683 } 684 685 // Prevent submit for invalid forms or custom submit handlers 686 if ( validator.cancelSubmit ) { 687 validator.cancelSubmit = false; 688 return handle(); 689 } 690 if ( validator.form() ) { 691 if ( validator.pendingRequest ) { 692 validator.formSubmitted = true; 693 return false; 694 } 695 return handle(); 696 } else { 697 validator.focusInvalid(); 698 return false; 699 } 700 } ); 701 } 702 703 return validator; 704 }, 705 706 // https://jqueryvalidation.org/valid/ 707 valid: function() { 708 var valid, validator, errorList; 709 710 if ( $( this[ 0 ] ).is( "form" ) ) { 711 valid = this.validate().form(); 712 } else { 713 errorList = []; 714 valid = true; 715 validator = $( this[ 0 ].form ).validate(); 716 this.each( function() { 717 valid = validator.element( this ) && valid; 718 if ( !valid ) { 719 errorList = errorList.concat( validator.errorList ); 720 } 721 } ); 722 validator.errorList = errorList; 723 } 724 return valid; 725 }, 726 727 // https://jqueryvalidation.org/rules/ 728 rules: function( command, argument ) { 729 var element = this[ 0 ], 730 isContentEditable = typeof this.attr( "contenteditable" ) !== "undefined" && this.attr( "contenteditable" ) !== "false", 731 settings, staticRules, existingRules, data, param, filtered; 732 733 // If nothing is selected, return empty object; can't chain anyway 734 if ( element == null ) { 735 return; 736 } 737 738 if ( !element.form && isContentEditable ) { 739 element.form = this.closest( "form" )[ 0 ]; 740 element.name = this.attr( "name" ); 741 } 742 743 if ( element.form == null ) { 744 return; 745 } 746 747 if ( command ) { 748 settings = $.data( element.form, "validator" ).settings; 749 staticRules = settings.rules; 750 existingRules = $.validator.staticRules( element ); 751 switch ( command ) { 752 case "add": 753 $.extend( existingRules, $.validator.normalizeRule( argument ) ); 754 755 // Remove messages from rules, but allow them to be set separately 756 delete existingRules.messages; 757 staticRules[ element.name ] = existingRules; 758 if ( argument.messages ) { 759 settings.messages[ element.name ] = $.extend( settings.messages[ element.name ], argument.messages ); 760 } 761 break; 762 case "remove": 763 if ( !argument ) { 764 delete staticRules[ element.name ]; 765 return existingRules; 766 } 767 filtered = {}; 768 $.each( argument.split( /\s/ ), function( index, method ) { 769 filtered[ method ] = existingRules[ method ]; 770 delete existingRules[ method ]; 771 } ); 772 return filtered; 773 } 774 } 775 776 data = $.validator.normalizeRules( 777 $.extend( 778 {}, 779 $.validator.classRules( element ), 780 $.validator.attributeRules( element ), 781 $.validator.dataRules( element ), 782 $.validator.staticRules( element ) 783 ), element ); 784 785 // Make sure required is at front 786 if ( data.required ) { 787 param = data.required; 788 delete data.required; 789 data = $.extend( { required: param }, data ); 790 } 791 792 // Make sure remote is at back 793 if ( data.remote ) { 794 param = data.remote; 795 delete data.remote; 796 data = $.extend( data, { remote: param } ); 797 } 798 799 return data; 800 } 801} ); 802 803// JQuery trim is deprecated, provide a trim method based on String.prototype.trim 804var trim = function( str ) { 805 806 // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/trim#Polyfill 807 return str.replace( /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "" ); 808}; 809 810// Custom selectors 811$.extend( $.expr.pseudos || $.expr[ ":" ], { // '|| $.expr[ ":" ]' here enables backwards compatibility to jQuery 1.7. Can be removed when dropping jQ 1.7.x support 812 813 // https://jqueryvalidation.org/blank-selector/ 814 blank: function( a ) { 815 return !trim( "" + $( a ).val() ); 816 }, 817 818 // https://jqueryvalidation.org/filled-selector/ 819 filled: function( a ) { 820 var val = $( a ).val(); 821 return val !== null && !!trim( "" + val ); 822 }, 823 824 // https://jqueryvalidation.org/unchecked-selector/ 825 unchecked: function( a ) { 826 return !$( a ).prop( "checked" ); 827 } 828} ); 829 830// Constructor for validator 831$.validator = function( options, form ) { 832 this.settings = $.extend( true, {}, $.validator.defaults, options ); 833 this.currentForm = form; 834 this.init(); 835}; 836 837// https://jqueryvalidation.org/jQuery.validator.format/ 838$.validator.format = function( source, params ) { 839 if ( arguments.length === 1 ) { 840 return function() { 841 var args = $.makeArray( arguments ); 842 args.unshift( source ); 843 return $.validator.format.apply( this, args ); 844 }; 845 } 846 if ( params === undefined ) { 847 return source; 848 } 849 if ( arguments.length > 2 && params.constructor !== Array ) { 850 params = $.makeArray( arguments ).slice( 1 ); 851 } 852 if ( params.constructor !== Array ) { 853 params = [ params ]; 854 } 855 $.each( params, function( i, n ) { 856 source = source.replace( new RegExp( "\\{" + i + "\\}", "g" ), function() { 857 return n; 858 } ); 859 } ); 860 return source; 861}; 862 863$.extend( $.validator, { 864 865 defaults: { 866 messages: {}, 867 groups: {}, 868 rules: {}, 869 errorClass: "error", 870 pendingClass: "pending", 871 validClass: "valid", 872 errorElement: "label", 873 focusCleanup: false, 874 focusInvalid: true, 875 errorContainer: $( [] ), 876 errorLabelContainer: $( [] ), 877 onsubmit: true, 878 ignore: ":hidden", 879 ignoreTitle: false, 880 onfocusin: function( element ) { 881 this.lastActive = element; 882 883 // Hide error label and remove error class on focus if enabled 884 if ( this.settings.focusCleanup ) { 885 if ( this.settings.unhighlight ) { 886 this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass ); 887 } 888 this.hideThese( this.errorsFor( element ) ); 889 } 890 }, 891 onfocusout: function( element ) { 892 if ( !this.checkable( element ) && ( element.name in this.submitted || !this.optional( element ) ) ) { 893 this.element( element ); 894 } 895 }, 896 onkeyup: function( element, event ) { 897 898 // Avoid revalidate the field when pressing one of the following keys 899 // Shift => 16 900 // Ctrl => 17 901 // Alt => 18 902 // Caps lock => 20 903 // End => 35 904 // Home => 36 905 // Left arrow => 37 906 // Up arrow => 38 907 // Right arrow => 39 908 // Down arrow => 40 909 // Insert => 45 910 // Num lock => 144 911 // AltGr key => 225 912 var excludedKeys = [ 913 16, 17, 18, 20, 35, 36, 37, 914 38, 39, 40, 45, 144, 225 915 ]; 916 917 if ( event.which === 9 && this.elementValue( element ) === "" || $.inArray( event.keyCode, excludedKeys ) !== -1 ) { 918 return; 919 } else if ( element.name in this.submitted || element.name in this.invalid ) { 920 this.element( element ); 921 } 922 }, 923 onclick: function( element ) { 924 925 // Click on selects, radiobuttons and checkboxes 926 if ( element.name in this.submitted ) { 927 this.element( element ); 928 929 // Or option elements, check parent select in that case 930 } else if ( element.parentNode.name in this.submitted ) { 931 this.element( element.parentNode ); 932 } 933 }, 934 highlight: function( element, errorClass, validClass ) { 935 if ( element.type === "radio" ) { 936 this.findByName( element.name ).addClass( errorClass ).removeClass( validClass ); 937 } else { 938 $( element ).addClass( errorClass ).removeClass( validClass ); 939 } 940 }, 941 unhighlight: function( element, errorClass, validClass ) { 942 if ( element.type === "radio" ) { 943 this.findByName( element.name ).removeClass( errorClass ).addClass( validClass ); 944 } else { 945 $( element ).removeClass( errorClass ).addClass( validClass ); 946 } 947 } 948 }, 949 950 // https://jqueryvalidation.org/jQuery.validator.setDefaults/ 951 setDefaults: function( settings ) { 952 $.extend( $.validator.defaults, settings ); 953 }, 954 955 messages: { 956 required: "This field is required.", 957 remote: "Please fix this field.", 958 email: "Please enter a valid email address.", 959 url: "Please enter a valid URL.", 960 date: "Please enter a valid date.", 961 dateISO: "Please enter a valid date (ISO).", 962 number: "Please enter a valid number.", 963 digits: "Please enter only digits.", 964 equalTo: "Please enter the same value again.", 965 maxlength: $.validator.format( "Please enter no more than {0} characters." ), 966 minlength: $.validator.format( "Please enter at least {0} characters." ), 967 rangelength: $.validator.format( "Please enter a value between {0} and {1} characters long." ), 968 range: $.validator.format( "Please enter a value between {0} and {1}." ), 969 max: $.validator.format( "Please enter a value less than or equal to {0}." ), 970 min: $.validator.format( "Please enter a value greater than or equal to {0}." ), 971 step: $.validator.format( "Please enter a multiple of {0}." ) 972 }, 973 974 autoCreateRanges: false, 975 976 prototype: { 977 978 init: function() { 979 this.labelContainer = $( this.settings.errorLabelContainer ); 980 this.errorContext = this.labelContainer.length && this.labelContainer || $( this.currentForm ); 981 this.containers = $( this.settings.errorContainer ).add( this.settings.errorLabelContainer ); 982 this.submitted = {}; 983 this.valueCache = {}; 984 this.pendingRequest = 0; 985 this.pending = {}; 986 this.invalid = {}; 987 this.reset(); 988 989 var currentForm = this.currentForm, 990 groups = ( this.groups = {} ), 991 rules; 992 $.each( this.settings.groups, function( key, value ) { 993 if ( typeof value === "string" ) { 994 value = value.split( /\s/ ); 995 } 996 $.each( value, function( index, name ) { 997 groups[ name ] = key; 998 } ); 999 } ); 1000 rules = this.settings.rules; 1001 $.each( rules, function( key, value ) { 1002 rules[ key ] = $.validator.normalizeRule( value ); 1003 } ); 1004 1005 function delegate( event ) { 1006 var isContentEditable = typeof $( this ).attr( "contenteditable" ) !== "undefined" && $( this ).attr( "contenteditable" ) !== "false"; 1007 1008 // Set form expando on contenteditable 1009 if ( !this.form && isContentEditable ) { 1010 this.form = $( this ).closest( "form" )[ 0 ]; 1011 this.name = $( this ).attr( "name" ); 1012 } 1013 1014 // Ignore the element if it belongs to another form. This will happen mainly 1015 // when setting the `form` attribute of an input to the id of another form. 1016 if ( currentForm !== this.form ) { 1017 return; 1018 } 1019 1020 var validator = $.data( this.form, "validator" ), 1021 eventType = "on" + event.type.replace( /^validate/, "" ), 1022 settings = validator.settings; 1023 if ( settings[ eventType ] && !$( this ).is( settings.ignore ) ) { 1024 settings[ eventType ].call( validator, this, event ); 1025 } 1026 } 1027 1028 $( this.currentForm ) 1029 .on( "focusin.validate focusout.validate keyup.validate", 1030 ":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], " + 1031 "[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], " + 1032 "[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], " + 1033 "[type='radio'], [type='checkbox'], [contenteditable], [type='button']", delegate ) 1034 1035 // Support: Chrome, oldIE 1036 // "select" is provided as event.target when clicking a option 1037 .on( "click.validate", "select, option, [type='radio'], [type='checkbox']", delegate ); 1038 1039 if ( this.settings.invalidHandler ) { 1040 $( this.currentForm ).on( "invalid-form.validate", this.settings.invalidHandler ); 1041 } 1042 }, 1043 1044 // https://jqueryvalidation.org/Validator.form/ 1045 form: function() { 1046 this.checkForm(); 1047 $.extend( this.submitted, this.errorMap ); 1048 this.invalid = $.extend( {}, this.errorMap ); 1049 if ( !this.valid() ) { 1050 $( this.currentForm ).triggerHandler( "invalid-form", [ this ] ); 1051 } 1052 this.showErrors(); 1053 return this.valid(); 1054 }, 1055 1056 checkForm: function() { 1057 this.prepareForm(); 1058 for ( var i = 0, elements = ( this.currentElements = this.elements() ); elements[ i ]; i++ ) { 1059 this.check( elements[ i ] ); 1060 } 1061 return this.valid(); 1062 }, 1063 1064 // https://jqueryvalidation.org/Validator.element/ 1065 element: function( element ) { 1066 var cleanElement = this.clean( element ), 1067 checkElement = this.validationTargetFor( cleanElement ), 1068 v = this, 1069 result = true, 1070 rs, group; 1071 1072 if ( checkElement === undefined ) { 1073 delete this.invalid[ cleanElement.name ]; 1074 } else { 1075 this.prepareElement( checkElement ); 1076 this.currentElements = $( checkElement ); 1077 1078 // If this element is grouped, then validate all group elements already 1079 // containing a value 1080 group = this.groups[ checkElement.name ]; 1081 if ( group ) { 1082 $.each( this.groups, function( name, testgroup ) { 1083 if ( testgroup === group && name !== checkElement.name ) { 1084 cleanElement = v.validationTargetFor( v.clean( v.findByName( name ) ) ); 1085 if ( cleanElement && cleanElement.name in v.invalid ) { 1086 v.currentElements.push( cleanElement ); 1087 result = v.check( cleanElement ) && result; 1088 } 1089 } 1090 } ); 1091 } 1092 1093 rs = this.check( checkElement ) !== false; 1094 result = result && rs; 1095 if ( rs ) { 1096 this.invalid[ checkElement.name ] = false; 1097 } else { 1098 this.invalid[ checkElement.name ] = true; 1099 } 1100 1101 if ( !this.numberOfInvalids() ) { 1102 1103 // Hide error containers on last error 1104 this.toHide = this.toHide.add( this.containers ); 1105 } 1106 this.showErrors(); 1107 1108 // Add aria-invalid status for screen readers 1109 $( element ).attr( "aria-invalid", !rs ); 1110 } 1111 1112 return result; 1113 }, 1114 1115 // https://jqueryvalidation.org/Validator.showErrors/ 1116 showErrors: function( errors ) { 1117 if ( errors ) { 1118 var validator = this; 1119 1120 // Add items to error list and map 1121 $.extend( this.errorMap, errors ); 1122 this.errorList = $.map( this.errorMap, function( message, name ) { 1123 return { 1124 message: message, 1125 element: validator.findByName( name )[ 0 ] 1126 }; 1127 } ); 1128 1129 // Remove items from success list 1130 this.successList = $.grep( this.successList, function( element ) { 1131 return !( element.name in errors ); 1132 } ); 1133 } 1134 if ( this.settings.showErrors ) { 1135 this.settings.showErrors.call( this, this.errorMap, this.errorList ); 1136 } else { 1137 this.defaultShowErrors(); 1138 } 1139 }, 1140 1141 // https://jqueryvalidation.org/Validator.resetForm/ 1142 resetForm: function() { 1143 if ( $.fn.resetForm ) { 1144 $( this.currentForm ).resetForm(); 1145 } 1146 this.invalid = {}; 1147 this.submitted = {}; 1148 this.prepareForm(); 1149 this.hideErrors(); 1150 var elements = this.elements() 1151 .removeData( "previousValue" ) 1152 .removeAttr( "aria-invalid" ); 1153 1154 this.resetElements( elements ); 1155 }, 1156 1157 resetElements: function( elements ) { 1158 var i; 1159 1160 if ( this.settings.unhighlight ) { 1161 for ( i = 0; elements[ i ]; i++ ) { 1162 this.settings.unhighlight.call( this, elements[ i ], 1163 this.settings.errorClass, "" ); 1164 this.findByName( elements[ i ].name ).removeClass( this.settings.validClass ); 1165 } 1166 } else { 1167 elements 1168 .removeClass( this.settings.errorClass ) 1169 .removeClass( this.settings.validClass ); 1170 } 1171 }, 1172 1173 numberOfInvalids: function() { 1174 return this.objectLength( this.invalid ); 1175 }, 1176 1177 objectLength: function( obj ) { 1178 /* jshint unused: false */ 1179 var count = 0, 1180 i; 1181 for ( i in obj ) { 1182 1183 // This check allows counting elements with empty error 1184 // message as invalid elements 1185 if ( obj[ i ] !== undefined && obj[ i ] !== null && obj[ i ] !== false ) { 1186 count++; 1187 } 1188 } 1189 return count; 1190 }, 1191 1192 hideErrors: function() { 1193 this.hideThese( this.toHide ); 1194 }, 1195 1196 hideThese: function( errors ) { 1197 errors.not( this.containers ).text( "" ); 1198 this.addWrapper( errors ).hide(); 1199 }, 1200 1201 valid: function() { 1202 return this.size() === 0; 1203 }, 1204 1205 size: function() { 1206 return this.errorList.length; 1207 }, 1208 1209 focusInvalid: function() { 1210 if ( this.settings.focusInvalid ) { 1211 try { 1212 $( this.findLastActive() || this.errorList.length && this.errorList[ 0 ].element || [] ) 1213 .filter( ":visible" ) 1214 .trigger( "focus" ) 1215 1216 // Manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find 1217 .trigger( "focusin" ); 1218 } catch ( e ) { 1219 1220 // Ignore IE throwing errors when focusing hidden elements 1221 } 1222 } 1223 }, 1224 1225 findLastActive: function() { 1226 var lastActive = this.lastActive; 1227 return lastActive && $.grep( this.errorList, function( n ) { 1228 return n.element.name === lastActive.name; 1229 } ).length === 1 && lastActive; 1230 }, 1231 1232 elements: function() { 1233 var validator = this, 1234 rulesCache = {}; 1235 1236 // Select all valid inputs inside the form (no submit or reset buttons) 1237 return $( this.currentForm ) 1238 .find( "input, select, textarea, [contenteditable]" ) 1239 .not( ":submit, :reset, :image, :disabled" ) 1240 .not( this.settings.ignore ) 1241 .filter( function() { 1242 var name = this.name || $( this ).attr( "name" ); // For contenteditable 1243 var isContentEditable = typeof $( this ).attr( "contenteditable" ) !== "undefined" && $( this ).attr( "contenteditable" ) !== "false"; 1244 1245 if ( !name && validator.settings.debug && window.console ) { 1246 console.error( "%o has no name assigned", this ); 1247 } 1248 1249 // Set form expando on contenteditable 1250 if ( isContentEditable ) { 1251 this.form = $( this ).closest( "form" )[ 0 ]; 1252 this.name = name; 1253 } 1254 1255 // Ignore elements that belong to other/nested forms 1256 if ( this.form !== validator.currentForm ) { 1257 return false; 1258 } 1259 1260 // Select only the first element for each name, and only those with rules specified 1261 if ( name in rulesCache || !validator.objectLength( $( this ).rules() ) ) { 1262 return false; 1263 } 1264 1265 rulesCache[ name ] = true; 1266 return true; 1267 } ); 1268 }, 1269 1270 clean: function( selector ) { 1271 return $( selector )[ 0 ]; 1272 }, 1273 1274 errors: function() { 1275 var errorClass = this.settings.errorClass.split( " " ).join( "." ); 1276 return $( this.settings.errorElement + "." + errorClass, this.errorContext ); 1277 }, 1278 1279 resetInternals: function() { 1280 this.successList = []; 1281 this.errorList = []; 1282 this.errorMap = {}; 1283 this.toShow = $( [] ); 1284 this.toHide = $( [] ); 1285 }, 1286 1287 reset: function() { 1288 this.resetInternals(); 1289 this.currentElements = $( [] ); 1290 }, 1291 1292 prepareForm: function() { 1293 this.reset(); 1294 this.toHide = this.errors().add( this.containers ); 1295 }, 1296 1297 prepareElement: function( element ) { 1298 this.reset(); 1299 this.toHide = this.errorsFor( element ); 1300 }, 1301 1302 elementValue: function( element ) { 1303 var $element = $( element ), 1304 type = element.type, 1305 isContentEditable = typeof $element.attr( "contenteditable" ) !== "undefined" && $element.attr( "contenteditable" ) !== "false", 1306 val, idx; 1307 1308 if ( type === "radio" || type === "checkbox" ) { 1309 return this.findByName( element.name ).filter( ":checked" ).val(); 1310 } else if ( type === "number" && typeof element.validity !== "undefined" ) { 1311 return element.validity.badInput ? "NaN" : $element.val(); 1312 } 1313 1314 if ( isContentEditable ) { 1315 val = $element.text(); 1316 } else { 1317 val = $element.val(); 1318 } 1319 1320 if ( type === "file" ) { 1321 1322 // Modern browser (chrome & safari) 1323 if ( val.substr( 0, 12 ) === "C:\\fakepath\\" ) { 1324 return val.substr( 12 ); 1325 } 1326 1327 // Legacy browsers 1328 // Unix-based path 1329 idx = val.lastIndexOf( "/" ); 1330 if ( idx >= 0 ) { 1331 return val.substr( idx + 1 ); 1332 } 1333 1334 // Windows-based path 1335 idx = val.lastIndexOf( "\\" ); 1336 if ( idx >= 0 ) { 1337 return val.substr( idx + 1 ); 1338 } 1339 1340 // Just the file name 1341 return val; 1342 } 1343 1344 if ( typeof val === "string" ) { 1345 return val.replace( /\r/g, "" ); 1346 } 1347 return val; 1348 }, 1349 1350 check: function( element ) { 1351 element = this.validationTargetFor( this.clean( element ) ); 1352 1353 var rules = $( element ).rules(), 1354 rulesCount = $.map( rules, function( n, i ) { 1355 return i; 1356 } ).length, 1357 dependencyMismatch = false, 1358 val = this.elementValue( element ), 1359 result, method, rule, normalizer; 1360 1361 // Prioritize the local normalizer defined for this element over the global one 1362 // if the former exists, otherwise user the global one in case it exists. 1363 if ( typeof rules.normalizer === "function" ) { 1364 normalizer = rules.normalizer; 1365 } else if ( typeof this.settings.normalizer === "function" ) { 1366 normalizer = this.settings.normalizer; 1367 } 1368 1369 // If normalizer is defined, then call it to retreive the changed value instead 1370 // of using the real one. 1371 // Note that `this` in the normalizer is `element`. 1372 if ( normalizer ) { 1373 val = normalizer.call( element, val ); 1374 1375 // Delete the normalizer from rules to avoid treating it as a pre-defined method. 1376 delete rules.normalizer; 1377 } 1378 1379 for ( method in rules ) { 1380 rule = { method: method, parameters: rules[ method ] }; 1381 try { 1382 result = $.validator.methods[ method ].call( this, val, element, rule.parameters ); 1383 1384 // If a method indicates that the field is optional and therefore valid, 1385 // don't mark it as valid when there are no other rules 1386 if ( result === "dependency-mismatch" && rulesCount === 1 ) { 1387 dependencyMismatch = true; 1388 continue; 1389 } 1390 dependencyMismatch = false; 1391 1392 if ( result === "pending" ) { 1393 this.toHide = this.toHide.not( this.errorsFor( element ) ); 1394 return; 1395 } 1396 1397 if ( !result ) { 1398 this.formatAndAdd( element, rule ); 1399 return false; 1400 } 1401 } catch ( e ) { 1402 if ( this.settings.debug && window.console ) { 1403 console.log( "Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e ); 1404 } 1405 if ( e instanceof TypeError ) { 1406 e.message += ". Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method."; 1407 } 1408 1409 throw e; 1410 } 1411 } 1412 if ( dependencyMismatch ) { 1413 return; 1414 } 1415 if ( this.objectLength( rules ) ) { 1416 this.successList.push( element ); 1417 } 1418 return true; 1419 }, 1420 1421 // Return the custom message for the given element and validation method 1422 // specified in the element's HTML5 data attribute 1423 // return the generic message if present and no method specific message is present 1424 customDataMessage: function( element, method ) { 1425 return $( element ).data( "msg" + method.charAt( 0 ).toUpperCase() + 1426 method.substring( 1 ).toLowerCase() ) || $( element ).data( "msg" ); 1427 }, 1428 1429 // Return the custom message for the given element name and validation method 1430 customMessage: function( name, method ) { 1431 var m = this.settings.messages[ name ]; 1432 return m && ( m.constructor === String ? m : m[ method ] ); 1433 }, 1434 1435 // Return the first defined argument, allowing empty strings 1436 findDefined: function() { 1437 for ( var i = 0; i < arguments.length; i++ ) { 1438 if ( arguments[ i ] !== undefined ) { 1439 return arguments[ i ]; 1440 } 1441 } 1442 return undefined; 1443 }, 1444 1445 // The second parameter 'rule' used to be a string, and extended to an object literal 1446 // of the following form: 1447 // rule = { 1448 // method: "method name", 1449 // parameters: "the given method parameters" 1450 // } 1451 // 1452 // The old behavior still supported, kept to maintain backward compatibility with 1453 // old code, and will be removed in the next major release. 1454 defaultMessage: function( element, rule ) { 1455 if ( typeof rule === "string" ) { 1456 rule = { method: rule }; 1457 } 1458 1459 var message = this.findDefined( 1460 this.customMessage( element.name, rule.method ), 1461 this.customDataMessage( element, rule.method ), 1462 1463 // 'title' is never undefined, so handle empty string as undefined 1464 !this.settings.ignoreTitle && element.title || undefined, 1465 $.validator.messages[ rule.method ], 1466 "<strong>Warning: No message defined for " + element.name + "</strong>" 1467 ), 1468 theregex = /\$?\{(\d+)\}/g; 1469 if ( typeof message === "function" ) { 1470 message = message.call( this, rule.parameters, element ); 1471 } else if ( theregex.test( message ) ) { 1472 message = $.validator.format( message.replace( theregex, "{$1}" ), rule.parameters ); 1473 } 1474 1475 return message; 1476 }, 1477 1478 formatAndAdd: function( element, rule ) { 1479 var message = this.defaultMessage( element, rule ); 1480 1481 this.errorList.push( { 1482 message: message, 1483 element: element, 1484 method: rule.method 1485 } ); 1486 1487 this.errorMap[ element.name ] = message; 1488 this.submitted[ element.name ] = message; 1489 }, 1490 1491 addWrapper: function( toToggle ) { 1492 if ( this.settings.wrapper ) { 1493 toToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) ); 1494 } 1495 return toToggle; 1496 }, 1497 1498 defaultShowErrors: function() { 1499 var i, elements, error; 1500 for ( i = 0; this.errorList[ i ]; i++ ) { 1501 error = this.errorList[ i ]; 1502 if ( this.settings.highlight ) { 1503 this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.validClass ); 1504 } 1505 this.showLabel( error.element, error.message ); 1506 } 1507 if ( this.errorList.length ) { 1508 this.toShow = this.toShow.add( this.containers ); 1509 } 1510 if ( this.settings.success ) { 1511 for ( i = 0; this.successList[ i ]; i++ ) { 1512 this.showLabel( this.successList[ i ] ); 1513 } 1514 } 1515 if ( this.settings.unhighlight ) { 1516 for ( i = 0, elements = this.validElements(); elements[ i ]; i++ ) { 1517 this.settings.unhighlight.call( this, elements[ i ], this.settings.errorClass, this.settings.validClass ); 1518 } 1519 } 1520 this.toHide = this.toHide.not( this.toShow ); 1521 this.hideErrors(); 1522 this.addWrapper( this.toShow ).show(); 1523 }, 1524 1525 validElements: function() { 1526 return this.currentElements.not( this.invalidElements() ); 1527 }, 1528 1529 invalidElements: function() { 1530 return $( this.errorList ).map( function() { 1531 return this.element; 1532 } ); 1533 }, 1534 1535 showLabel: function( element, message ) { 1536 var place, group, errorID, v, 1537 error = this.errorsFor( element ), 1538 elementID = this.idOrName( element ), 1539 describedBy = $( element ).attr( "aria-describedby" ); 1540 1541 if ( error.length ) { 1542 1543 // Refresh error/success class 1544 error.removeClass( this.settings.validClass ).addClass( this.settings.errorClass ); 1545 1546 // Replace message on existing label 1547 error.html( message ); 1548 } else { 1549 1550 // Create error element 1551 error = $( "<" + this.settings.errorElement + ">" ) 1552 .attr( "id", elementID + "-error" ) 1553 .addClass( this.settings.errorClass ) 1554 .html( message || "" ); 1555 1556 // Maintain reference to the element to be placed into the DOM 1557 place = error; 1558 if ( this.settings.wrapper ) { 1559 1560 // Make sure the element is visible, even in IE 1561 // actually showing the wrapped element is handled elsewhere 1562 place = error.hide().show().wrap( "<" + this.settings.wrapper + "/>" ).parent(); 1563 } 1564 if ( this.labelContainer.length ) { 1565 this.labelContainer.append( place ); 1566 } else if ( this.settings.errorPlacement ) { 1567 this.settings.errorPlacement.call( this, place, $( element ) ); 1568 } else { 1569 place.insertAfter( element ); 1570 } 1571 1572 // Link error back to the element 1573 if ( error.is( "label" ) ) { 1574 1575 // If the error is a label, then associate using 'for' 1576 error.attr( "for", elementID ); 1577 1578 // If the element is not a child of an associated label, then it's necessary 1579 // to explicitly apply aria-describedby 1580 } else if ( error.parents( "label[for='" + this.escapeCssMeta( elementID ) + "']" ).length === 0 ) { 1581 errorID = error.attr( "id" ); 1582 1583 // Respect existing non-error aria-describedby 1584 if ( !describedBy ) { 1585 describedBy = errorID; 1586 } else if ( !describedBy.match( new RegExp( "\\b" + this.escapeCssMeta( errorID ) + "\\b" ) ) ) { 1587 1588 // Add to end of list if not already present 1589 describedBy += " " + errorID; 1590 } 1591 $( element ).attr( "aria-describedby", describedBy ); 1592 1593 // If this element is grouped, then assign to all elements in the same group 1594 group = this.groups[ element.name ]; 1595 if ( group ) { 1596 v = this; 1597 $.each( v.groups, function( name, testgroup ) { 1598 if ( testgroup === group ) { 1599 $( "[name='" + v.escapeCssMeta( name ) + "']", v.currentForm ) 1600 .attr( "aria-describedby", error.attr( "id" ) ); 1601 } 1602 } ); 1603 } 1604 } 1605 } 1606 if ( !message && this.settings.success ) { 1607 error.text( "" ); 1608 if ( typeof this.settings.success === "string" ) { 1609 error.addClass( this.settings.success ); 1610 } else { 1611 this.settings.success( error, element ); 1612 } 1613 } 1614 this.toShow = this.toShow.add( error ); 1615 }, 1616 1617 errorsFor: function( element ) { 1618 var name = this.escapeCssMeta( this.idOrName( element ) ), 1619 describer = $( element ).attr( "aria-describedby" ), 1620 selector = "label[for='" + name + "'], label[for='" + name + "'] *"; 1621 1622 // 'aria-describedby' should directly reference the error element 1623 if ( describer ) { 1624 selector = selector + ", #" + this.escapeCssMeta( describer ) 1625 .replace( /\s+/g, ", #" ); 1626 } 1627 1628 return this 1629 .errors() 1630 .filter( selector ); 1631 }, 1632 1633 // See https://api.jquery.com/category/selectors/, for CSS 1634 // meta-characters that should be escaped in order to be used with JQuery 1635 // as a literal part of a name/id or any selector. 1636 escapeCssMeta: function( string ) { 1637 return string.replace( /([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g, "\\$1" ); 1638 }, 1639 1640 idOrName: function( element ) { 1641 return this.groups[ element.name ] || ( this.checkable( element ) ? element.name : element.id || element.name ); 1642 }, 1643 1644 validationTargetFor: function( element ) { 1645 1646 // If radio/checkbox, validate first element in group instead 1647 if ( this.checkable( element ) ) { 1648 element = this.findByName( element.name ); 1649 } 1650 1651 // Always apply ignore filter 1652 return $( element ).not( this.settings.ignore )[ 0 ]; 1653 }, 1654 1655 checkable: function( element ) { 1656 return ( /radio|checkbox/i ).test( element.type ); 1657 }, 1658 1659 findByName: function( name ) { 1660 return $( this.currentForm ).find( "[name='" + this.escapeCssMeta( name ) + "']" ); 1661 }, 1662 1663 getLength: function( value, element ) { 1664 switch ( element.nodeName.toLowerCase() ) { 1665 case "select": 1666 return $( "option:selected", element ).length; 1667 case "input": 1668 if ( this.checkable( element ) ) { 1669 return this.findByName( element.name ).filter( ":checked" ).length; 1670 } 1671 } 1672 return value.length; 1673 }, 1674 1675 depend: function( param, element ) { 1676 return this.dependTypes[ typeof param ] ? this.dependTypes[ typeof param ]( param, element ) : true; 1677 }, 1678 1679 dependTypes: { 1680 "boolean": function( param ) { 1681 return param; 1682 }, 1683 "string": function( param, element ) { 1684 return !!$( param, element.form ).length; 1685 }, 1686 "function": function( param, element ) { 1687 return param( element ); 1688 } 1689 }, 1690 1691 optional: function( element ) { 1692 var val = this.elementValue( element ); 1693 return !$.validator.methods.required.call( this, val, element ) && "dependency-mismatch"; 1694 }, 1695 1696 startRequest: function( element ) { 1697 if ( !this.pending[ element.name ] ) { 1698 this.pendingRequest++; 1699 $( element ).addClass( this.settings.pendingClass ); 1700 this.pending[ element.name ] = true; 1701 } 1702 }, 1703 1704 stopRequest: function( element, valid ) { 1705 this.pendingRequest--; 1706 1707 // Sometimes synchronization fails, make sure pendingRequest is never < 0 1708 if ( this.pendingRequest < 0 ) { 1709 this.pendingRequest = 0; 1710 } 1711 delete this.pending[ element.name ]; 1712 $( element ).removeClass( this.settings.pendingClass ); 1713 if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() ) { 1714 $( this.currentForm ).submit(); 1715 1716 // Remove the hidden input that was used as a replacement for the 1717 // missing submit button. The hidden input is added by `handle()` 1718 // to ensure that the value of the used submit button is passed on 1719 // for scripted submits triggered by this method 1720 if ( this.submitButton ) { 1721 $( "input:hidden[name='" + this.submitButton.name + "']", this.currentForm ).remove(); 1722 } 1723 1724 this.formSubmitted = false; 1725 } else if ( !valid && this.pendingRequest === 0 && this.formSubmitted ) { 1726 $( this.currentForm ).triggerHandler( "invalid-form", [ this ] ); 1727 this.formSubmitted = false; 1728 } 1729 }, 1730 1731 previousValue: function( element, method ) { 1732 method = typeof method === "string" && method || "remote"; 1733 1734 return $.data( element, "previousValue" ) || $.data( element, "previousValue", { 1735 old: null, 1736 valid: true, 1737 message: this.defaultMessage( element, { method: method } ) 1738 } ); 1739 }, 1740 1741 // Cleans up all forms and elements, removes validator-specific events 1742 destroy: function() { 1743 this.resetForm(); 1744 1745 $( this.currentForm ) 1746 .off( ".validate" ) 1747 .removeData( "validator" ) 1748 .find( ".validate-equalTo-blur" ) 1749 .off( ".validate-equalTo" ) 1750 .removeClass( "validate-equalTo-blur" ) 1751 .find( ".validate-lessThan-blur" ) 1752 .off( ".validate-lessThan" ) 1753 .removeClass( "validate-lessThan-blur" ) 1754 .find( ".validate-lessThanEqual-blur" ) 1755 .off( ".validate-lessThanEqual" ) 1756 .removeClass( "validate-lessThanEqual-blur" ) 1757 .find( ".validate-greaterThanEqual-blur" ) 1758 .off( ".validate-greaterThanEqual" ) 1759 .removeClass( "validate-greaterThanEqual-blur" ) 1760 .find( ".validate-greaterThan-blur" ) 1761 .off( ".validate-greaterThan" ) 1762 .removeClass( "validate-greaterThan-blur" ); 1763 } 1764 1765 }, 1766 1767 classRuleSettings: { 1768 required: { required: true }, 1769 email: { email: true }, 1770 url: { url: true }, 1771 date: { date: true }, 1772 dateISO: { dateISO: true }, 1773 number: { number: true }, 1774 digits: { digits: true }, 1775 creditcard: { creditcard: true } 1776 }, 1777 1778 addClassRules: function( className, rules ) { 1779 if ( className.constructor === String ) { 1780 this.classRuleSettings[ className ] = rules; 1781 } else { 1782 $.extend( this.classRuleSettings, className ); 1783 } 1784 }, 1785 1786 classRules: function( element ) { 1787 var rules = {}, 1788 classes = $( element ).attr( "class" ); 1789 1790 if ( classes ) { 1791 $.each( classes.split( " " ), function() { 1792 if ( this in $.validator.classRuleSettings ) { 1793 $.extend( rules, $.validator.classRuleSettings[ this ] ); 1794 } 1795 } ); 1796 } 1797 return rules; 1798 }, 1799 1800 normalizeAttributeRule: function( rules, type, method, value ) { 1801 1802 // Convert the value to a number for number inputs, and for text for backwards compability 1803 // allows type="date" and others to be compared as strings 1804 if ( /min|max|step/.test( method ) && ( type === null || /number|range|text/.test( type ) ) ) { 1805 value = Number( value ); 1806 1807 // Support Opera Mini, which returns NaN for undefined minlength 1808 if ( isNaN( value ) ) { 1809 value = undefined; 1810 } 1811 } 1812 1813 if ( value || value === 0 ) { 1814 rules[ method ] = value; 1815 } else if ( type === method && type !== "range" ) { 1816 1817 // Exception: the jquery validate 'range' method 1818 // does not test for the html5 'range' type 1819 rules[ method ] = true; 1820 } 1821 }, 1822 1823 attributeRules: function( element ) { 1824 var rules = {}, 1825 $element = $( element ), 1826 type = element.getAttribute( "type" ), 1827 method, value; 1828 1829 for ( method in $.validator.methods ) { 1830 1831 // Support for <input required> in both html5 and older browsers 1832 if ( method === "required" ) { 1833 value = element.getAttribute( method ); 1834 1835 // Some browsers return an empty string for the required attribute 1836 // and non-HTML5 browsers might have required="" markup 1837 if ( value === "" ) { 1838 value = true; 1839 } 1840 1841 // Force non-HTML5 browsers to return bool 1842 value = !!value; 1843 } else { 1844 value = $element.attr( method ); 1845 } 1846 1847 this.normalizeAttributeRule( rules, type, method, value ); 1848 } 1849 1850 // 'maxlength' may be returned as -1, 2147483647 ( IE ) and 524288 ( safari ) for text inputs 1851 if ( rules.maxlength && /-1|2147483647|524288/.test( rules.maxlength ) ) { 1852 delete rules.maxlength; 1853 } 1854 1855 return rules; 1856 }, 1857 1858 dataRules: function( element ) { 1859 var rules = {}, 1860 $element = $( element ), 1861 type = element.getAttribute( "type" ), 1862 method, value; 1863 1864 for ( method in $.validator.methods ) { 1865 value = $element.data( "rule" + method.charAt( 0 ).toUpperCase() + method.substring( 1 ).toLowerCase() ); 1866 1867 // Cast empty attributes like `data-rule-required` to `true` 1868 if ( value === "" ) { 1869 value = true; 1870 } 1871 1872 this.normalizeAttributeRule( rules, type, method, value ); 1873 } 1874 return rules; 1875 }, 1876 1877 staticRules: function( element ) { 1878 var rules = {}, 1879 validator = $.data( element.form, "validator" ); 1880 1881 if ( validator.settings.rules ) { 1882 rules = $.validator.normalizeRule( validator.settings.rules[ element.name ] ) || {}; 1883 } 1884 return rules; 1885 }, 1886 1887 normalizeRules: function( rules, element ) { 1888 1889 // Handle dependency check 1890 $.each( rules, function( prop, val ) { 1891 1892 // Ignore rule when param is explicitly false, eg. required:false 1893 if ( val === false ) { 1894 delete rules[ prop ]; 1895 return; 1896 } 1897 if ( val.param || val.depends ) { 1898 var keepRule = true; 1899 switch ( typeof val.depends ) { 1900 case "string": 1901 keepRule = !!$( val.depends, element.form ).length; 1902 break; 1903 case "function": 1904 keepRule = val.depends.call( element, element ); 1905 break; 1906 } 1907 if ( keepRule ) { 1908 rules[ prop ] = val.param !== undefined ? val.param : true; 1909 } else { 1910 $.data( element.form, "validator" ).resetElements( $( element ) ); 1911 delete rules[ prop ]; 1912 } 1913 } 1914 } ); 1915 1916 // Evaluate parameters 1917 $.each( rules, function( rule, parameter ) { 1918 rules[ rule ] = typeof parameter === "function" && rule !== "normalizer" ? parameter( element ) : parameter; 1919 } ); 1920 1921 // Clean number parameters 1922 $.each( [ "minlength", "maxlength" ], function() { 1923 if ( rules[ this ] ) { 1924 rules[ this ] = Number( rules[ this ] ); 1925 } 1926 } ); 1927 $.each( [ "rangelength", "range" ], function() { 1928 var parts; 1929 if ( rules[ this ] ) { 1930 if ( Array.isArray( rules[ this ] ) ) { 1931 rules[ this ] = [ Number( rules[ this ][ 0 ] ), Number( rules[ this ][ 1 ] ) ]; 1932 } else if ( typeof rules[ this ] === "string" ) { 1933 parts = rules[ this ].replace( /[\[\]]/g, "" ).split( /[\s,]+/ ); 1934 rules[ this ] = [ Number( parts[ 0 ] ), Number( parts[ 1 ] ) ]; 1935 } 1936 } 1937 } ); 1938 1939 if ( $.validator.autoCreateRanges ) { 1940 1941 // Auto-create ranges 1942 if ( rules.min != null && rules.max != null ) { 1943 rules.range = [ rules.min, rules.max ]; 1944 delete rules.min; 1945 delete rules.max; 1946 } 1947 if ( rules.minlength != null && rules.maxlength != null ) { 1948 rules.rangelength = [ rules.minlength, rules.maxlength ]; 1949 delete rules.minlength; 1950 delete rules.maxlength; 1951 } 1952 } 1953 1954 return rules; 1955 }, 1956 1957 // Converts a simple string to a {string: true} rule, e.g., "required" to {required:true} 1958 normalizeRule: function( data ) { 1959 if ( typeof data === "string" ) { 1960 var transformed = {}; 1961 $.each( data.split( /\s/ ), function() { 1962 transformed[ this ] = true; 1963 } ); 1964 data = transformed; 1965 } 1966 return data; 1967 }, 1968 1969 // https://jqueryvalidation.org/jQuery.validator.addMethod/ 1970 addMethod: function( name, method, message ) { 1971 $.validator.methods[ name ] = method; 1972 $.validator.messages[ name ] = message !== undefined ? message : $.validator.messages[ name ]; 1973 if ( method.length < 3 ) { 1974 $.validator.addClassRules( name, $.validator.normalizeRule( name ) ); 1975 } 1976 }, 1977 1978 // https://jqueryvalidation.org/jQuery.validator.methods/ 1979 methods: { 1980 1981 // https://jqueryvalidation.org/required-method/ 1982 required: function( value, element, param ) { 1983 1984 // Check if dependency is met 1985 if ( !this.depend( param, element ) ) { 1986 return "dependency-mismatch"; 1987 } 1988 if ( element.nodeName.toLowerCase() === "select" ) { 1989 1990 // Could be an array for select-multiple or a string, both are fine this way 1991 var val = $( element ).val(); 1992 return val && val.length > 0; 1993 } 1994 if ( this.checkable( element ) ) { 1995 return this.getLength( value, element ) > 0; 1996 } 1997 return value !== undefined && value !== null && value.length > 0; 1998 }, 1999 2000 // https://jqueryvalidation.org/email-method/ 2001 email: function( value, element ) { 2002 2003 // From https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address 2004 // Retrieved 2014-01-14 2005 // If you have a problem with this implementation, report a bug against the above spec 2006 // Or use custom methods to implement your own email validation 2007 return this.optional( element ) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test( value ); 2008 }, 2009 2010 // https://jqueryvalidation.org/url-method/ 2011 url: function( value, element ) { 2012 2013 // Copyright (c) 2010-2013 Diego Perini, MIT licensed 2014 // https://gist.github.com/dperini/729294 2015 // see also https://mathiasbynens.be/demo/url-regex 2016 // modified to allow protocol-relative URLs 2017 return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value ); 2018 }, 2019 2020 // https://jqueryvalidation.org/date-method/ 2021 date: ( function() { 2022 var called = false; 2023 2024 return function( value, element ) { 2025 if ( !called ) { 2026 called = true; 2027 if ( this.settings.debug && window.console ) { 2028 console.warn( 2029 "The `date` method is deprecated and will be removed in version '2.0.0'.\n" + 2030 "Please don't use it, since it relies on the Date constructor, which\n" + 2031 "behaves very differently across browsers and locales. Use `dateISO`\n" + 2032 "instead or one of the locale specific methods in `localizations/`\n" + 2033 "and `additional-methods.js`." 2034 ); 2035 } 2036 } 2037 2038 return this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() ); 2039 }; 2040 }() ), 2041 2042 // https://jqueryvalidation.org/dateISO-method/ 2043 dateISO: function( value, element ) { 2044 return this.optional( element ) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test( value ); 2045 }, 2046 2047 // https://jqueryvalidation.org/number-method/ 2048 number: function( value, element ) { 2049 return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test( value ); 2050 }, 2051 2052 // https://jqueryvalidation.org/digits-method/ 2053 digits: function( value, element ) { 2054 return this.optional( element ) || /^\d+$/.test( value ); 2055 }, 2056 2057 // https://jqueryvalidation.org/minlength-method/ 2058 minlength: function( value, element, param ) { 2059 var length = Array.isArray( value ) ? value.length : this.getLength( value, element ); 2060 return this.optional( element ) || length >= param; 2061 }, 2062 2063 // https://jqueryvalidation.org/maxlength-method/ 2064 maxlength: function( value, element, param ) { 2065 var length = Array.isArray( value ) ? value.length : this.getLength( value, element ); 2066 return this.optional( element ) || length <= param; 2067 }, 2068 2069 // https://jqueryvalidation.org/rangelength-method/ 2070 rangelength: function( value, element, param ) { 2071 var length = Array.isArray( value ) ? value.length : this.getLength( value, element ); 2072 return this.optional( element ) || ( length >= param[ 0 ] && length <= param[ 1 ] ); 2073 }, 2074 2075 // https://jqueryvalidation.org/min-method/ 2076 min: function( value, element, param ) { 2077 return this.optional( element ) || value >= param; 2078 }, 2079 2080 // https://jqueryvalidation.org/max-method/ 2081 max: function( value, element, param ) { 2082 return this.optional( element ) || value <= param; 2083 }, 2084 2085 // https://jqueryvalidation.org/range-method/ 2086 range: function( value, element, param ) { 2087 return this.optional( element ) || ( value >= param[ 0 ] && value <= param[ 1 ] ); 2088 }, 2089 2090 // https://jqueryvalidation.org/step-method/ 2091 step: function( value, element, param ) { 2092 var type = $( element ).attr( "type" ), 2093 errorMessage = "Step attribute on input type " + type + " is not supported.", 2094 supportedTypes = [ "text", "number", "range" ], 2095 re = new RegExp( "\\b" + type + "\\b" ), 2096 notSupported = type && !re.test( supportedTypes.join() ), 2097 decimalPlaces = function( num ) { 2098 var match = ( "" + num ).match( /(?:\.(\d+))?$/ ); 2099 if ( !match ) { 2100 return 0; 2101 } 2102 2103 // Number of digits right of decimal point. 2104 return match[ 1 ] ? match[ 1 ].length : 0; 2105 }, 2106 toInt = function( num ) { 2107 return Math.round( num * Math.pow( 10, decimals ) ); 2108 }, 2109 valid = true, 2110 decimals; 2111 2112 // Works only for text, number and range input types 2113 // TODO find a way to support input types date, datetime, datetime-local, month, time and week 2114 if ( notSupported ) { 2115 throw new Error( errorMessage ); 2116 } 2117 2118 decimals = decimalPlaces( param ); 2119 2120 // Value can't have too many decimals 2121 if ( decimalPlaces( value ) > decimals || toInt( value ) % toInt( param ) !== 0 ) { 2122 valid = false; 2123 } 2124 2125 return this.optional( element ) || valid; 2126 }, 2127 2128 // https://jqueryvalidation.org/equalTo-method/ 2129 equalTo: function( value, element, param ) { 2130 2131 // Bind to the blur event of the target in order to revalidate whenever the target field is updated 2132 var target = $( param ); 2133 if ( this.settings.onfocusout && target.not( ".validate-equalTo-blur" ).length ) { 2134 target.addClass( "validate-equalTo-blur" ).on( "blur.validate-equalTo", function() { 2135 $( element ).valid(); 2136 } ); 2137 } 2138 return value === target.val(); 2139 }, 2140 2141 // https://jqueryvalidation.org/remote-method/ 2142 remote: function( value, element, param, method ) { 2143 if ( this.optional( element ) ) { 2144 return "dependency-mismatch"; 2145 } 2146 2147 method = typeof method === "string" && method || "remote"; 2148 2149 var previous = this.previousValue( element, method ), 2150 validator, data, optionDataString; 2151 2152 if ( !this.settings.messages[ element.name ] ) { 2153 this.settings.messages[ element.name ] = {}; 2154 } 2155 previous.originalMessage = previous.originalMessage || this.settings.messages[ element.name ][ method ]; 2156 this.settings.messages[ element.name ][ method ] = previous.message; 2157 2158 param = typeof param === "string" && { url: param } || param; 2159 optionDataString = $.param( $.extend( { data: value }, param.data ) ); 2160 if ( previous.old === optionDataString ) { 2161 return previous.valid; 2162 } 2163 2164 previous.old = optionDataString; 2165 validator = this; 2166 this.startRequest( element ); 2167 data = {}; 2168 data[ element.name ] = value; 2169 $.ajax( $.extend( true, { 2170 mode: "abort", 2171 port: "validate" + element.name, 2172 dataType: "json", 2173 data: data, 2174 context: validator.currentForm, 2175 success: function( response ) { 2176 var valid = response === true || response === "true", 2177 errors, message, submitted; 2178 2179 validator.settings.messages[ element.name ][ method ] = previous.originalMessage; 2180 if ( valid ) { 2181 submitted = validator.formSubmitted; 2182 validator.resetInternals(); 2183 validator.toHide = validator.errorsFor( element ); 2184 validator.formSubmitted = submitted; 2185 validator.successList.push( element ); 2186 validator.invalid[ element.name ] = false; 2187 validator.showErrors(); 2188 } else { 2189 errors = {}; 2190 message = response || validator.defaultMessage( element, { method: method, parameters: value } ); 2191 errors[ element.name ] = previous.message = message; 2192 validator.invalid[ element.name ] = true; 2193 validator.showErrors( errors ); 2194 } 2195 previous.valid = valid; 2196 validator.stopRequest( element, valid ); 2197 } 2198 }, param ) ); 2199 return "pending"; 2200 } 2201 } 2202 2203} ); 2204 2205// Ajax mode: abort 2206// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]}); 2207// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort() 2208 2209var pendingRequests = {}, 2210 ajax; 2211 2212// Use a prefilter if available (1.5+) 2213if ( $.ajaxPrefilter ) { 2214 $.ajaxPrefilter( function( settings, _, xhr ) { 2215 var port = settings.port; 2216 if ( settings.mode === "abort" ) { 2217 if ( pendingRequests[ port ] ) { 2218 pendingRequests[ port ].abort(); 2219 } 2220 pendingRequests[ port ] = xhr; 2221 } 2222 } ); 2223} else { 2224 2225 // Proxy ajax 2226 ajax = $.ajax; 2227 $.ajax = function( settings ) { 2228 var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode, 2229 port = ( "port" in settings ? settings : $.ajaxSettings ).port; 2230 if ( mode === "abort" ) { 2231 if ( pendingRequests[ port ] ) { 2232 pendingRequests[ port ].abort(); 2233 } 2234 pendingRequests[ port ] = ajax.apply( this, arguments ); 2235 return pendingRequests[ port ]; 2236 } 2237 return ajax.apply( this, arguments ); 2238 }; 2239} 2240return $; 2241})); 2242 2243/***/ }), 2244
vendor: 289,018 bytes, lines 2245-13135
2245/***/ "./node_modules/jquery/dist/jquery.js": 2246/*!********************************************!*\ 2247 !*** ./node_modules/jquery/dist/jquery.js ***! 2248 \********************************************/ 2249/***/ (function(module, exports) { 2250 2251var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 2252 * jQuery JavaScript Library v3.6.0 2253 * https://jquery.com/ 2254 * 2255 * Includes Sizzle.js 2256 * https://sizzlejs.com/ 2257 * 2258 * Copyright OpenJS Foundation and other contributors 2259 * Released under the MIT license 2260 * https://jquery.org/license 2261 * 2262 * Date: 2021-03-02T17:08Z 2263 */ 2264( function( global, factory ) { 2265 2266 "use strict"; 2267 2268 if ( true && typeof module.exports === "object" ) { 2269 2270 // For CommonJS and CommonJS-like environments where a proper `window` 2271 // is present, execute the factory and get jQuery. 2272 // For environments that do not have a `window` with a `document` 2273 // (such as Node.js), expose a factory as module.exports. 2274 // This accentuates the need for the creation of a real `window`. 2275 // e.g. var jQuery = require("jquery")(window); 2276 // See ticket #14549 for more info. 2277 module.exports = global.document ? 2278 factory( global, true ) : 2279 function( w ) { 2280 if ( !w.document ) { 2281 throw new Error( "jQuery requires a window with a document" ); 2282 } 2283 return factory( w ); 2284 }; 2285 } else { 2286 factory( global ); 2287 } 2288 2289// Pass this if window is not defined yet 2290} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { 2291 2292// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 2293// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode 2294// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common 2295// enough that all such attempts are guarded in a try block. 2296"use strict"; 2297 2298var arr = []; 2299 2300var getProto = Object.getPrototypeOf; 2301 2302var slice = arr.slice; 2303 2304var flat = arr.flat ? function( array ) { 2305 return arr.flat.call( array ); 2306} : function( array ) { 2307 return arr.concat.apply( [], array ); 2308}; 2309 2310 2311var push = arr.push; 2312 2313var indexOf = arr.indexOf; 2314 2315var class2type = {}; 2316 2317var toString = class2type.toString; 2318 2319var hasOwn = class2type.hasOwnProperty; 2320 2321var fnToString = hasOwn.toString; 2322 2323var ObjectFunctionString = fnToString.call( Object ); 2324 2325var support = {}; 2326 2327var isFunction = function isFunction( obj ) { 2328 2329 // Support: Chrome <=57, Firefox <=52 2330 // In some browsers, typeof returns "function" for HTML <object> elements 2331 // (i.e., `typeof document.createElement( "object" ) === "function"`). 2332 // We don't want to classify *any* DOM node as a function. 2333 // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5 2334 // Plus for old WebKit, typeof returns "function" for HTML collections 2335 // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756) 2336 return typeof obj === "function" && typeof obj.nodeType !== "number" && 2337 typeof obj.item !== "function"; 2338 }; 2339 2340 2341var isWindow = function isWindow( obj ) { 2342 return obj != null && obj === obj.window; 2343 }; 2344 2345 2346var document = window.document; 2347 2348 2349 2350 var preservedScriptAttributes = { 2351 type: true, 2352 src: true, 2353 nonce: true, 2354 noModule: true 2355 }; 2356 2357 function DOMEval( code, node, doc ) { 2358 doc = doc || document; 2359 2360 var i, val, 2361 script = doc.createElement( "script" ); 2362 2363 script.text = code; 2364 if ( node ) { 2365 for ( i in preservedScriptAttributes ) { 2366 2367 // Support: Firefox 64+, Edge 18+ 2368 // Some browsers don't support the "nonce" property on scripts. 2369 // On the other hand, just using `getAttribute` is not enough as 2370 // the `nonce` attribute is reset to an empty string whenever it 2371 // becomes browsing-context connected. 2372 // See https://github.com/whatwg/html/issues/2369 2373 // See https://html.spec.whatwg.org/#nonce-attributes 2374 // The `node.getAttribute` check was added for the sake of 2375 // `jQuery.globalEval` so that it can fake a nonce-containing node 2376 // via an object. 2377 val = node[ i ] || node.getAttribute && node.getAttribute( i ); 2378 if ( val ) { 2379 script.setAttribute( i, val ); 2380 } 2381 } 2382 } 2383 doc.head.appendChild( script ).parentNode.removeChild( script ); 2384 } 2385 2386 2387function toType( obj ) { 2388 if ( obj == null ) { 2389 return obj + ""; 2390 } 2391 2392 // Support: Android <=2.3 only (functionish RegExp) 2393 return typeof obj === "object" || typeof obj === "function" ? 2394 class2type[ toString.call( obj ) ] || "object" : 2395 typeof obj; 2396} 2397/* global Symbol */ 2398// Defining this global in .eslintrc.json would create a danger of using the global 2399// unguarded in another place, it seems safer to define global only for this module 2400 2401 2402 2403var 2404 version = "3.6.0", 2405 2406 // Define a local copy of jQuery 2407 jQuery = function( selector, context ) { 2408 2409 // The jQuery object is actually just the init constructor 'enhanced' 2410 // Need init if jQuery is called (just allow error to be thrown if not included) 2411 return new jQuery.fn.init( selector, context ); 2412 }; 2413 2414jQuery.fn = jQuery.prototype = { 2415 2416 // The current version of jQuery being used 2417 jquery: version, 2418 2419 constructor: jQuery, 2420 2421 // The default length of a jQuery object is 0 2422 length: 0, 2423 2424 toArray: function() { 2425 return slice.call( this ); 2426 }, 2427 2428 // Get the Nth element in the matched element set OR 2429 // Get the whole matched element set as a clean array 2430 get: function( num ) { 2431 2432 // Return all the elements in a clean array 2433 if ( num == null ) { 2434 return slice.call( this ); 2435 } 2436 2437 // Return just the one element from the set 2438 return num < 0 ? this[ num + this.length ] : this[ num ]; 2439 }, 2440 2441 // Take an array of elements and push it onto the stack 2442 // (returning the new matched element set) 2443 pushStack: function( elems ) { 2444 2445 // Build a new jQuery matched element set 2446 var ret = jQuery.merge( this.constructor(), elems ); 2447 2448 // Add the old object onto the stack (as a reference) 2449 ret.prevObject = this; 2450 2451 // Return the newly-formed element set 2452 return ret; 2453 }, 2454 2455 // Execute a callback for every element in the matched set. 2456 each: function( callback ) { 2457 return jQuery.each( this, callback ); 2458 }, 2459 2460 map: function( callback ) { 2461 return this.pushStack( jQuery.map( this, function( elem, i ) { 2462 return callback.call( elem, i, elem ); 2463 } ) ); 2464 }, 2465 2466 slice: function() { 2467 return this.pushStack( slice.apply( this, arguments ) ); 2468 }, 2469 2470 first: function() { 2471 return this.eq( 0 ); 2472 }, 2473 2474 last: function() { 2475 return this.eq( -1 ); 2476 }, 2477 2478 even: function() { 2479 return this.pushStack( jQuery.grep( this, function( _elem, i ) { 2480 return ( i + 1 ) % 2; 2481 } ) ); 2482 }, 2483 2484 odd: function() { 2485 return this.pushStack( jQuery.grep( this, function( _elem, i ) { 2486 return i % 2; 2487 } ) ); 2488 }, 2489 2490 eq: function( i ) { 2491 var len = this.length, 2492 j = +i + ( i < 0 ? len : 0 ); 2493 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); 2494 }, 2495 2496 end: function() { 2497 return this.prevObject || this.constructor(); 2498 }, 2499 2500 // For internal use only. 2501 // Behaves like an Array's method, not like a jQuery method. 2502 push: push, 2503 sort: arr.sort, 2504 splice: arr.splice 2505}; 2506 2507jQuery.extend = jQuery.fn.extend = function() { 2508 var options, name, src, copy, copyIsArray, clone, 2509 target = arguments[ 0 ] || {}, 2510 i = 1, 2511 length = arguments.length, 2512 deep = false; 2513 2514 // Handle a deep copy situation 2515 if ( typeof target === "boolean" ) { 2516 deep = target; 2517 2518 // Skip the boolean and the target 2519 target = arguments[ i ] || {}; 2520 i++; 2521 } 2522 2523 // Handle case when target is a string or something (possible in deep copy) 2524 if ( typeof target !== "object" && !isFunction( target ) ) { 2525 target = {}; 2526 } 2527 2528 // Extend jQuery itself if only one argument is passed 2529 if ( i === length ) { 2530 target = this; 2531 i--; 2532 } 2533 2534 for ( ; i < length; i++ ) { 2535 2536 // Only deal with non-null/undefined values 2537 if ( ( options = arguments[ i ] ) != null ) { 2538 2539 // Extend the base object 2540 for ( name in options ) { 2541 copy = options[ name ]; 2542 2543 // Prevent Object.prototype pollution 2544 // Prevent never-ending loop 2545 if ( name === "__proto__" || target === copy ) { 2546 continue; 2547 } 2548 2549 // Recurse if we're merging plain objects or arrays 2550 if ( deep && copy && ( jQuery.isPlainObject( copy ) || 2551 ( copyIsArray = Array.isArray( copy ) ) ) ) { 2552 src = target[ name ]; 2553 2554 // Ensure proper type for the source value 2555 if ( copyIsArray && !Array.isArray( src ) ) { 2556 clone = []; 2557 } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { 2558 clone = {}; 2559 } else { 2560 clone = src; 2561 } 2562 copyIsArray = false; 2563 2564 // Never move original objects, clone them 2565 target[ name ] = jQuery.extend( deep, clone, copy ); 2566 2567 // Don't bring in undefined values 2568 } else if ( copy !== undefined ) { 2569 target[ name ] = copy; 2570 } 2571 } 2572 } 2573 } 2574 2575 // Return the modified object 2576 return target; 2577}; 2578 2579jQuery.extend( { 2580 2581 // Unique for each copy of jQuery on the page 2582 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), 2583 2584 // Assume jQuery is ready without the ready module 2585 isReady: true, 2586 2587 error: function( msg ) { 2588 throw new Error( msg ); 2589 }, 2590 2591 noop: function() {}, 2592 2593 isPlainObject: function( obj ) { 2594 var proto, Ctor; 2595 2596 // Detect obvious negatives 2597 // Use toString instead of jQuery.type to catch host objects 2598 if ( !obj || toString.call( obj ) !== "[object Object]" ) { 2599 return false; 2600 } 2601 2602 proto = getProto( obj ); 2603 2604 // Objects with no prototype (e.g., `Object.create( null )`) are plain 2605 if ( !proto ) { 2606 return true; 2607 } 2608 2609 // Objects with prototype are plain iff they were constructed by a global Object function 2610 Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; 2611 return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; 2612 }, 2613 2614 isEmptyObject: function( obj ) { 2615 var name; 2616 2617 for ( name in obj ) { 2618 return false; 2619 } 2620 return true; 2621 }, 2622 2623 // Evaluates a script in a provided context; falls back to the global one 2624 // if not specified. 2625 globalEval: function( code, options, doc ) { 2626 DOMEval( code, { nonce: options && options.nonce }, doc ); 2627 }, 2628 2629 each: function( obj, callback ) { 2630 var length, i = 0; 2631 2632 if ( isArrayLike( obj ) ) { 2633 length = obj.length; 2634 for ( ; i < length; i++ ) { 2635 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 2636 break; 2637 } 2638 } 2639 } else { 2640 for ( i in obj ) { 2641 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 2642 break; 2643 } 2644 } 2645 } 2646 2647 return obj; 2648 }, 2649 2650 // results is for internal usage only 2651 makeArray: function( arr, results ) { 2652 var ret = results || []; 2653 2654 if ( arr != null ) { 2655 if ( isArrayLike( Object( arr ) ) ) { 2656 jQuery.merge( ret, 2657 typeof arr === "string" ? 2658 [ arr ] : arr 2659 ); 2660 } else { 2661 push.call( ret, arr ); 2662 } 2663 } 2664 2665 return ret; 2666 }, 2667 2668 inArray: function( elem, arr, i ) { 2669 return arr == null ? -1 : indexOf.call( arr, elem, i ); 2670 }, 2671 2672 // Support: Android <=4.0 only, PhantomJS 1 only 2673 // push.apply(_, arraylike) throws on ancient WebKit 2674 merge: function( first, second ) { 2675 var len = +second.length, 2676 j = 0, 2677 i = first.length; 2678 2679 for ( ; j < len; j++ ) { 2680 first[ i++ ] = second[ j ]; 2681 } 2682 2683 first.length = i; 2684 2685 return first; 2686 }, 2687 2688 grep: function( elems, callback, invert ) { 2689 var callbackInverse, 2690 matches = [], 2691 i = 0, 2692 length = elems.length, 2693 callbackExpect = !invert; 2694 2695 // Go through the array, only saving the items 2696 // that pass the validator function 2697 for ( ; i < length; i++ ) { 2698 callbackInverse = !callback( elems[ i ], i ); 2699 if ( callbackInverse !== callbackExpect ) { 2700 matches.push( elems[ i ] ); 2701 } 2702 } 2703 2704 return matches; 2705 }, 2706 2707 // arg is for internal usage only 2708 map: function( elems, callback, arg ) { 2709 var length, value, 2710 i = 0, 2711 ret = []; 2712 2713 // Go through the array, translating each of the items to their new values 2714 if ( isArrayLike( elems ) ) { 2715 length = elems.length; 2716 for ( ; i < length; i++ ) { 2717 value = callback( elems[ i ], i, arg ); 2718 2719 if ( value != null ) { 2720 ret.push( value ); 2721 } 2722 } 2723 2724 // Go through every key on the object, 2725 } else { 2726 for ( i in elems ) { 2727 value = callback( elems[ i ], i, arg ); 2728 2729 if ( value != null ) { 2730 ret.push( value ); 2731 } 2732 } 2733 } 2734 2735 // Flatten any nested arrays 2736 return flat( ret ); 2737 }, 2738 2739 // A global GUID counter for objects 2740 guid: 1, 2741 2742 // jQuery.support is not used in Core but other projects attach their 2743 // properties to it so it needs to exist. 2744 support: support 2745} ); 2746 2747if ( typeof Symbol === "function" ) { 2748 jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; 2749} 2750 2751// Populate the class2type map 2752jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), 2753 function( _i, name ) { 2754 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 2755 } ); 2756 2757function isArrayLike( obj ) { 2758 2759 // Support: real iOS 8.2 only (not reproducible in simulator) 2760 // `in` check used to prevent JIT error (gh-2145) 2761 // hasOwn isn't used here due to false negatives 2762 // regarding Nodelist length in IE 2763 var length = !!obj && "length" in obj && obj.length, 2764 type = toType( obj ); 2765 2766 if ( isFunction( obj ) || isWindow( obj ) ) { 2767 return false; 2768 } 2769 2770 return type === "array" || length === 0 || 2771 typeof length === "number" && length > 0 && ( length - 1 ) in obj; 2772} 2773var Sizzle = 2774/*! 2775 * Sizzle CSS Selector Engine v2.3.6 2776 * https://sizzlejs.com/ 2777 * 2778 * Copyright JS Foundation and other contributors 2779 * Released under the MIT license 2780 * https://js.foundation/ 2781 * 2782 * Date: 2021-02-16 2783 */ 2784( function( window ) { 2785var i, 2786 support, 2787 Expr, 2788 getText, 2789 isXML, 2790 tokenize, 2791 compile, 2792 select, 2793 outermostContext, 2794 sortInput, 2795 hasDuplicate, 2796 2797 // Local document vars 2798 setDocument, 2799 document, 2800 docElem, 2801 documentIsHTML, 2802 rbuggyQSA, 2803 rbuggyMatches, 2804 matches, 2805 contains, 2806 2807 // Instance-specific data 2808 expando = "sizzle" + 1 * new Date(), 2809 preferredDoc = window.document, 2810 dirruns = 0, 2811 done = 0, 2812 classCache = createCache(), 2813 tokenCache = createCache(), 2814 compilerCache = createCache(), 2815 nonnativeSelectorCache = createCache(), 2816 sortOrder = function( a, b ) { 2817 if ( a === b ) { 2818 hasDuplicate = true; 2819 } 2820 return 0; 2821 }, 2822 2823 // Instance methods 2824 hasOwn = ( {} ).hasOwnProperty, 2825 arr = [], 2826 pop = arr.pop, 2827 pushNative = arr.push, 2828 push = arr.push, 2829 slice = arr.slice, 2830 2831 // Use a stripped-down indexOf as it's faster than native 2832 // https://jsperf.com/thor-indexof-vs-for/5 2833 indexOf = function( list, elem ) { 2834 var i = 0, 2835 len = list.length; 2836 for ( ; i < len; i++ ) { 2837 if ( list[ i ] === elem ) { 2838 return i; 2839 } 2840 } 2841 return -1; 2842 }, 2843 2844 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" + 2845 "ismap|loop|multiple|open|readonly|required|scoped", 2846 2847 // Regular expressions 2848 2849 // http://www.w3.org/TR/css3-selectors/#whitespace 2850 whitespace = "[\\x20\\t\\r\\n\\f]", 2851 2852 // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram 2853 identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + 2854 "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", 2855 2856 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors 2857 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + 2858 2859 // Operator (capture 2) 2860 "*([*^$|!~]?=)" + whitespace + 2861 2862 // "Attribute values must be CSS identifiers [capture 5] 2863 // or strings [capture 3 or capture 4]" 2864 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + 2865 whitespace + "*\\]", 2866 2867 pseudos = ":(" + identifier + ")(?:\\((" + 2868 2869 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: 2870 // 1. quoted (capture 3; capture 4 or capture 5) 2871 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + 2872 2873 // 2. simple (capture 6) 2874 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + 2875 2876 // 3. anything else (capture 2) 2877 ".*" + 2878 ")\\)|)", 2879 2880 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 2881 rwhitespace = new RegExp( whitespace + "+", "g" ), 2882 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + 2883 whitespace + "+$", "g" ), 2884 2885 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), 2886 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + 2887 "*" ), 2888 rdescend = new RegExp( whitespace + "|>" ), 2889 2890 rpseudo = new RegExp( pseudos ), 2891 ridentifier = new RegExp( "^" + identifier + "$" ), 2892 2893 matchExpr = { 2894 "ID": new RegExp( "^#(" + identifier + ")" ), 2895 "CLASS": new RegExp( "^\\.(" + identifier + ")" ), 2896 "TAG": new RegExp( "^(" + identifier + "|[*])" ), 2897 "ATTR": new RegExp( "^" + attributes ), 2898 "PSEUDO": new RegExp( "^" + pseudos ), 2899 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + 2900 whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + 2901 whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), 2902 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), 2903 2904 // For use in libraries implementing .is() 2905 // We use this for POS matching in `select` 2906 "needsContext": new RegExp( "^" + whitespace + 2907 "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + 2908 "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) 2909 }, 2910 2911 rhtml = /HTML$/i, 2912 rinputs = /^(?:input|select|textarea|button)$/i, 2913 rheader = /^h\d$/i, 2914 2915 rnative = /^[^{]+\{\s*\[native \w/, 2916 2917 // Easily-parseable/retrievable ID or TAG or CLASS selectors 2918 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 2919 2920 rsibling = /[+~]/, 2921 2922 // CSS escapes 2923 // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters 2924 runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ), 2925 funescape = function( escape, nonHex ) { 2926 var high = "0x" + escape.slice( 1 ) - 0x10000; 2927 2928 return nonHex ? 2929 2930 // Strip the backslash prefix from a non-hex escape sequence 2931 nonHex : 2932 2933 // Replace a hexadecimal escape sequence with the encoded Unicode code point 2934 // Support: IE <=11+ 2935 // For values outside the Basic Multilingual Plane (BMP), manually construct a 2936 // surrogate pair 2937 high < 0 ? 2938 String.fromCharCode( high + 0x10000 ) : 2939 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 2940 }, 2941 2942 // CSS string/identifier serialization 2943 // https://drafts.csswg.org/cssom/#common-serializing-idioms 2944 rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, 2945 fcssescape = function( ch, asCodePoint ) { 2946 if ( asCodePoint ) { 2947 2948 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER 2949 if ( ch === "\0" ) { 2950 return "\uFFFD"; 2951 } 2952 2953 // Control characters and (dependent upon position) numbers get escaped as code points 2954 return ch.slice( 0, -1 ) + "\\" + 2955 ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; 2956 } 2957 2958 // Other potentially-special ASCII characters get backslash-escaped 2959 return "\\" + ch; 2960 }, 2961 2962 // Used for iframes 2963 // See setDocument() 2964 // Removing the function wrapper causes a "Permission Denied" 2965 // error in IE 2966 unloadHandler = function() { 2967 setDocument(); 2968 }, 2969 2970 inDisabledFieldset = addCombinator( 2971 function( elem ) { 2972 return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; 2973 }, 2974 { dir: "parentNode", next: "legend" } 2975 ); 2976 2977// Optimize for push.apply( _, NodeList ) 2978try { 2979 push.apply( 2980 ( arr = slice.call( preferredDoc.childNodes ) ), 2981 preferredDoc.childNodes 2982 ); 2983 2984 // Support: Android<4.0 2985 // Detect silently failing push.apply 2986 // eslint-disable-next-line no-unused-expressions 2987 arr[ preferredDoc.childNodes.length ].nodeType; 2988} catch ( e ) { 2989 push = { apply: arr.length ? 2990 2991 // Leverage slice if possible 2992 function( target, els ) { 2993 pushNative.apply( target, slice.call( els ) ); 2994 } : 2995 2996 // Support: IE<9 2997 // Otherwise append directly 2998 function( target, els ) { 2999 var j = target.length, 3000 i = 0; 3001 3002 // Can't trust NodeList.length 3003 while ( ( target[ j++ ] = els[ i++ ] ) ) {} 3004 target.length = j - 1; 3005 } 3006 }; 3007} 3008 3009function Sizzle( selector, context, results, seed ) { 3010 var m, i, elem, nid, match, groups, newSelector, 3011 newContext = context && context.ownerDocument, 3012 3013 // nodeType defaults to 9, since context defaults to document 3014 nodeType = context ? context.nodeType : 9; 3015 3016 results = results || []; 3017 3018 // Return early from calls with invalid selector or context 3019 if ( typeof selector !== "string" || !selector || 3020 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { 3021 3022 return results; 3023 } 3024 3025 // Try to shortcut find operations (as opposed to filters) in HTML documents 3026 if ( !seed ) { 3027 setDocument( context ); 3028 context = context || document; 3029 3030 if ( documentIsHTML ) { 3031 3032 // If the selector is sufficiently simple, try using a "get*By*" DOM method 3033 // (excepting DocumentFragment context, where the methods don't exist) 3034 if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { 3035 3036 // ID selector 3037 if ( ( m = match[ 1 ] ) ) { 3038 3039 // Document context 3040 if ( nodeType === 9 ) { 3041 if ( ( elem = context.getElementById( m ) ) ) { 3042 3043 // Support: IE, Opera, Webkit 3044 // TODO: identify versions 3045 // getElementById can match elements by name instead of ID 3046 if ( elem.id === m ) { 3047 results.push( elem ); 3048 return results; 3049 } 3050 } else { 3051 return results; 3052 } 3053 3054 // Element context 3055 } else { 3056 3057 // Support: IE, Opera, Webkit 3058 // TODO: identify versions 3059 // getElementById can match elements by name instead of ID 3060 if ( newContext && ( elem = newContext.getElementById( m ) ) && 3061 contains( context, elem ) && 3062 elem.id === m ) { 3063 3064 results.push( elem ); 3065 return results; 3066 } 3067 } 3068 3069 // Type selector 3070 } else if ( match[ 2 ] ) { 3071 push.apply( results, context.getElementsByTagName( selector ) ); 3072 return results; 3073 3074 // Class selector 3075 } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && 3076 context.getElementsByClassName ) { 3077 3078 push.apply( results, context.getElementsByClassName( m ) ); 3079 return results; 3080 } 3081 } 3082 3083 // Take advantage of querySelectorAll 3084 if ( support.qsa && 3085 !nonnativeSelectorCache[ selector + " " ] && 3086 ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) && 3087 3088 // Support: IE 8 only 3089 // Exclude object elements 3090 ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) { 3091 3092 newSelector = selector; 3093 newContext = context; 3094 3095 // qSA considers elements outside a scoping root when evaluating child or 3096 // descendant combinators, which is not what we want. 3097 // In such cases, we work around the behavior by prefixing every selector in the 3098 // list with an ID selector referencing the scope context. 3099 // The technique has to be used as well when a leading combinator is used 3100 // as such selectors are not recognized by querySelectorAll. 3101 // Thanks to Andrew Dupont for this technique. 3102 if ( nodeType === 1 && 3103 ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { 3104 3105 // Expand context for sibling selectors 3106 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || 3107 context; 3108 3109 // We can use :scope instead of the ID hack if the browser 3110 // supports it & if we're not changing the context. 3111 if ( newContext !== context || !support.scope ) { 3112 3113 // Capture the context ID, setting it first if necessary 3114 if ( ( nid = context.getAttribute( "id" ) ) ) { 3115 nid = nid.replace( rcssescape, fcssescape ); 3116 } else { 3117 context.setAttribute( "id", ( nid = expando ) ); 3118 } 3119 } 3120 3121 // Prefix every selector in the list 3122 groups = tokenize( selector ); 3123 i = groups.length; 3124 while ( i-- ) { 3125 groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + 3126 toSelector( groups[ i ] ); 3127 } 3128 newSelector = groups.join( "," ); 3129 } 3130 3131 try { 3132 push.apply( results, 3133 newContext.querySelectorAll( newSelector ) 3134 ); 3135 return results; 3136 } catch ( qsaError ) { 3137 nonnativeSelectorCache( selector, true ); 3138 } finally { 3139 if ( nid === expando ) { 3140 context.removeAttribute( "id" ); 3141 } 3142 } 3143 } 3144 } 3145 } 3146 3147 // All others 3148 return select( selector.replace( rtrim, "$1" ), context, results, seed ); 3149} 3150 3151/** 3152 * Create key-value caches of limited size 3153 * @returns {function(string, object)} Returns the Object data after storing it on itself with 3154 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 3155 * deleting the oldest entry 3156 */ 3157function createCache() { 3158 var keys = []; 3159 3160 function cache( key, value ) { 3161 3162 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) 3163 if ( keys.push( key + " " ) > Expr.cacheLength ) { 3164 3165 // Only keep the most recent entries 3166 delete cache[ keys.shift() ]; 3167 } 3168 return ( cache[ key + " " ] = value ); 3169 } 3170 return cache; 3171} 3172 3173/** 3174 * Mark a function for special use by Sizzle 3175 * @param {Function} fn The function to mark 3176 */ 3177function markFunction( fn ) { 3178 fn[ expando ] = true; 3179 return fn; 3180} 3181 3182/** 3183 * Support testing using an element 3184 * @param {Function} fn Passed the created element and returns a boolean result 3185 */ 3186function assert( fn ) { 3187 var el = document.createElement( "fieldset" ); 3188 3189 try { 3190 return !!fn( el ); 3191 } catch ( e ) { 3192 return false; 3193 } finally { 3194 3195 // Remove from its parent by default 3196 if ( el.parentNode ) { 3197 el.parentNode.removeChild( el ); 3198 } 3199 3200 // release memory in IE 3201 el = null; 3202 } 3203} 3204 3205/** 3206 * Adds the same handler for all of the specified attrs 3207 * @param {String} attrs Pipe-separated list of attributes 3208 * @param {Function} handler The method that will be applied 3209 */ 3210function addHandle( attrs, handler ) { 3211 var arr = attrs.split( "|" ), 3212 i = arr.length; 3213 3214 while ( i-- ) { 3215 Expr.attrHandle[ arr[ i ] ] = handler; 3216 } 3217} 3218 3219/** 3220 * Checks document order of two siblings 3221 * @param {Element} a 3222 * @param {Element} b 3223 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b 3224 */ 3225function siblingCheck( a, b ) { 3226 var cur = b && a, 3227 diff = cur && a.nodeType === 1 && b.nodeType === 1 && 3228 a.sourceIndex - b.sourceIndex; 3229 3230 // Use IE sourceIndex if available on both nodes 3231 if ( diff ) { 3232 return diff; 3233 } 3234 3235 // Check if b follows a 3236 if ( cur ) { 3237 while ( ( cur = cur.nextSibling ) ) { 3238 if ( cur === b ) { 3239 return -1; 3240 } 3241 } 3242 } 3243 3244 return a ? 1 : -1; 3245} 3246 3247/** 3248 * Returns a function to use in pseudos for input types 3249 * @param {String} type 3250 */ 3251function createInputPseudo( type ) { 3252 return function( elem ) { 3253 var name = elem.nodeName.toLowerCase(); 3254 return name === "input" && elem.type === type; 3255 }; 3256} 3257 3258/** 3259 * Returns a function to use in pseudos for buttons 3260 * @param {String} type 3261 */ 3262function createButtonPseudo( type ) { 3263 return function( elem ) { 3264 var name = elem.nodeName.toLowerCase(); 3265 return ( name === "input" || name === "button" ) && elem.type === type; 3266 }; 3267} 3268 3269/** 3270 * Returns a function to use in pseudos for :enabled/:disabled 3271 * @param {Boolean} disabled true for :disabled; false for :enabled 3272 */ 3273function createDisabledPseudo( disabled ) { 3274 3275 // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable 3276 return function( elem ) { 3277 3278 // Only certain elements can match :enabled or :disabled 3279 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled 3280 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled 3281 if ( "form" in elem ) { 3282 3283 // Check for inherited disabledness on relevant non-disabled elements: 3284 // * listed form-associated elements in a disabled fieldset 3285 // https://html.spec.whatwg.org/multipage/forms.html#category-listed 3286 // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled 3287 // * option elements in a disabled optgroup 3288 // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled 3289 // All such elements have a "form" property. 3290 if ( elem.parentNode && elem.disabled === false ) { 3291 3292 // Option elements defer to a parent optgroup if present 3293 if ( "label" in elem ) { 3294 if ( "label" in elem.parentNode ) { 3295 return elem.parentNode.disabled === disabled; 3296 } else { 3297 return elem.disabled === disabled; 3298 } 3299 } 3300 3301 // Support: IE 6 - 11 3302 // Use the isDisabled shortcut property to check for disabled fieldset ancestors 3303 return elem.isDisabled === disabled || 3304 3305 // Where there is no isDisabled, check manually 3306 /* jshint -W018 */ 3307 elem.isDisabled !== !disabled && 3308 inDisabledFieldset( elem ) === disabled; 3309 } 3310 3311 return elem.disabled === disabled; 3312 3313 // Try to winnow out elements that can't be disabled before trusting the disabled property. 3314 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't 3315 // even exist on them, let alone have a boolean value. 3316 } else if ( "label" in elem ) { 3317 return elem.disabled === disabled; 3318 } 3319 3320 // Remaining elements are neither :enabled nor :disabled 3321 return false; 3322 }; 3323} 3324 3325/** 3326 * Returns a function to use in pseudos for positionals 3327 * @param {Function} fn 3328 */ 3329function createPositionalPseudo( fn ) { 3330 return markFunction( function( argument ) { 3331 argument = +argument; 3332 return markFunction( function( seed, matches ) { 3333 var j, 3334 matchIndexes = fn( [], seed.length, argument ), 3335 i = matchIndexes.length; 3336 3337 // Match elements found at the specified indexes 3338 while ( i-- ) { 3339 if ( seed[ ( j = matchIndexes[ i ] ) ] ) { 3340 seed[ j ] = !( matches[ j ] = seed[ j ] ); 3341 } 3342 } 3343 } ); 3344 } ); 3345} 3346 3347/** 3348 * Checks a node for validity as a Sizzle context 3349 * @param {Element|Object=} context 3350 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value 3351 */ 3352function testContext( context ) { 3353 return context && typeof context.getElementsByTagName !== "undefined" && context; 3354} 3355 3356// Expose support vars for convenience 3357support = Sizzle.support = {}; 3358 3359/** 3360 * Detects XML nodes 3361 * @param {Element|Object} elem An element or a document 3362 * @returns {Boolean} True iff elem is a non-HTML XML node 3363 */ 3364isXML = Sizzle.isXML = function( elem ) { 3365 var namespace = elem && elem.namespaceURI, 3366 docElem = elem && ( elem.ownerDocument || elem ).documentElement; 3367 3368 // Support: IE <=8 3369 // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes 3370 // https://bugs.jquery.com/ticket/4833 3371 return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); 3372}; 3373 3374/** 3375 * Sets document-related variables once based on the current document 3376 * @param {Element|Object} [doc] An element or document object to use to set the document 3377 * @returns {Object} Returns the current document 3378 */ 3379setDocument = Sizzle.setDocument = function( node ) { 3380 var hasCompare, subWindow, 3381 doc = node ? node.ownerDocument || node : preferredDoc; 3382 3383 // Return early if doc is invalid or already selected 3384 // Support: IE 11+, Edge 17 - 18+ 3385 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 3386 // two documents; shallow comparisons work. 3387 // eslint-disable-next-line eqeqeq 3388 if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { 3389 return document; 3390 } 3391 3392 // Update global variables 3393 document = doc; 3394 docElem = document.documentElement; 3395 documentIsHTML = !isXML( document ); 3396 3397 // Support: IE 9 - 11+, Edge 12 - 18+ 3398 // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) 3399 // Support: IE 11+, Edge 17 - 18+ 3400 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 3401 // two documents; shallow comparisons work. 3402 // eslint-disable-next-line eqeqeq 3403 if ( preferredDoc != document && 3404 ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { 3405 3406 // Support: IE 11, Edge 3407 if ( subWindow.addEventListener ) { 3408 subWindow.addEventListener( "unload", unloadHandler, false ); 3409 3410 // Support: IE 9 - 10 only 3411 } else if ( subWindow.attachEvent ) { 3412 subWindow.attachEvent( "onunload", unloadHandler ); 3413 } 3414 } 3415 3416 // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only, 3417 // Safari 4 - 5 only, Opera <=11.6 - 12.x only 3418 // IE/Edge & older browsers don't support the :scope pseudo-class. 3419 // Support: Safari 6.0 only 3420 // Safari 6.0 supports :scope but it's an alias of :root there. 3421 support.scope = assert( function( el ) { 3422 docElem.appendChild( el ).appendChild( document.createElement( "div" ) ); 3423 return typeof el.querySelectorAll !== "undefined" && 3424 !el.querySelectorAll( ":scope fieldset div" ).length; 3425 } ); 3426 3427 /* Attributes 3428 ---------------------------------------------------------------------- */ 3429 3430 // Support: IE<8 3431 // Verify that getAttribute really returns attributes and not properties 3432 // (excepting IE8 booleans) 3433 support.attributes = assert( function( el ) { 3434 el.className = "i"; 3435 return !el.getAttribute( "className" ); 3436 } ); 3437 3438 /* getElement(s)By* 3439 ---------------------------------------------------------------------- */ 3440 3441 // Check if getElementsByTagName("*") returns only elements 3442 support.getElementsByTagName = assert( function( el ) { 3443 el.appendChild( document.createComment( "" ) ); 3444 return !el.getElementsByTagName( "*" ).length; 3445 } ); 3446 3447 // Support: IE<9 3448 support.getElementsByClassName = rnative.test( document.getElementsByClassName ); 3449 3450 // Support: IE<10 3451 // Check if getElementById returns elements by name 3452 // The broken getElementById methods don't pick up programmatically-set names, 3453 // so use a roundabout getElementsByName test 3454 support.getById = assert( function( el ) { 3455 docElem.appendChild( el ).id = expando; 3456 return !document.getElementsByName || !document.getElementsByName( expando ).length; 3457 } ); 3458 3459 // ID filter and find 3460 if ( support.getById ) { 3461 Expr.filter[ "ID" ] = function( id ) { 3462 var attrId = id.replace( runescape, funescape ); 3463 return function( elem ) { 3464 return elem.getAttribute( "id" ) === attrId; 3465 }; 3466 }; 3467 Expr.find[ "ID" ] = function( id, context ) { 3468 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 3469 var elem = context.getElementById( id ); 3470 return elem ? [ elem ] : []; 3471 } 3472 }; 3473 } else { 3474 Expr.filter[ "ID" ] = function( id ) { 3475 var attrId = id.replace( runescape, funescape ); 3476 return function( elem ) { 3477 var node = typeof elem.getAttributeNode !== "undefined" && 3478 elem.getAttributeNode( "id" ); 3479 return node && node.value === attrId; 3480 }; 3481 }; 3482 3483 // Support: IE 6 - 7 only 3484 // getElementById is not reliable as a find shortcut 3485 Expr.find[ "ID" ] = function( id, context ) { 3486 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 3487 var node, i, elems, 3488 elem = context.getElementById( id ); 3489 3490 if ( elem ) { 3491 3492 // Verify the id attribute 3493 node = elem.getAttributeNode( "id" ); 3494 if ( node && node.value === id ) { 3495 return [ elem ]; 3496 } 3497 3498 // Fall back on getElementsByName 3499 elems = context.getElementsByName( id ); 3500 i = 0; 3501 while ( ( elem = elems[ i++ ] ) ) { 3502 node = elem.getAttributeNode( "id" ); 3503 if ( node && node.value === id ) { 3504 return [ elem ]; 3505 } 3506 } 3507 } 3508 3509 return []; 3510 } 3511 }; 3512 } 3513 3514 // Tag 3515 Expr.find[ "TAG" ] = support.getElementsByTagName ? 3516 function( tag, context ) { 3517 if ( typeof context.getElementsByTagName !== "undefined" ) { 3518 return context.getElementsByTagName( tag ); 3519 3520 // DocumentFragment nodes don't have gEBTN 3521 } else if ( support.qsa ) { 3522 return context.querySelectorAll( tag ); 3523 } 3524 } : 3525 3526 function( tag, context ) { 3527 var elem, 3528 tmp = [], 3529 i = 0, 3530 3531 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too 3532 results = context.getElementsByTagName( tag ); 3533 3534 // Filter out possible comments 3535 if ( tag === "*" ) { 3536 while ( ( elem = results[ i++ ] ) ) { 3537 if ( elem.nodeType === 1 ) { 3538 tmp.push( elem ); 3539 } 3540 } 3541 3542 return tmp; 3543 } 3544 return results; 3545 }; 3546 3547 // Class 3548 Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { 3549 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { 3550 return context.getElementsByClassName( className ); 3551 } 3552 }; 3553 3554 /* QSA/matchesSelector 3555 ---------------------------------------------------------------------- */ 3556 3557 // QSA and matchesSelector support 3558 3559 // matchesSelector(:active) reports false when true (IE9/Opera 11.5) 3560 rbuggyMatches = []; 3561 3562 // qSa(:focus) reports false when true (Chrome 21) 3563 // We allow this because of a bug in IE8/9 that throws an error 3564 // whenever `document.activeElement` is accessed on an iframe 3565 // So, we allow :focus to pass through QSA all the time to avoid the IE error 3566 // See https://bugs.jquery.com/ticket/13378 3567 rbuggyQSA = []; 3568 3569 if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { 3570 3571 // Build QSA regex 3572 // Regex strategy adopted from Diego Perini 3573 assert( function( el ) { 3574 3575 var input; 3576 3577 // Select is set to empty string on purpose 3578 // This is to test IE's treatment of not explicitly 3579 // setting a boolean content attribute, 3580 // since its presence should be enough 3581 // https://bugs.jquery.com/ticket/12359 3582 docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" + 3583 "<select id='" + expando + "-\r\\' msallowcapture=''>" + 3584 "<option selected=''></option></select>"; 3585 3586 // Support: IE8, Opera 11-12.16 3587 // Nothing should be selected when empty strings follow ^= or $= or *= 3588 // The test attribute must be unknown in Opera but "safe" for WinRT 3589 // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section 3590 if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) { 3591 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); 3592 } 3593 3594 // Support: IE8 3595 // Boolean attributes and "value" are not treated correctly 3596 if ( !el.querySelectorAll( "[selected]" ).length ) { 3597 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); 3598 } 3599 3600 // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ 3601 if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { 3602 rbuggyQSA.push( "~=" ); 3603 } 3604 3605 // Support: IE 11+, Edge 15 - 18+ 3606 // IE 11/Edge don't find elements on a `[name='']` query in some cases. 3607 // Adding a temporary attribute to the document before the selection works 3608 // around the issue. 3609 // Interestingly, IE 10 & older don't seem to have the issue. 3610 input = document.createElement( "input" ); 3611 input.setAttribute( "name", "" ); 3612 el.appendChild( input ); 3613 if ( !el.querySelectorAll( "[name='']" ).length ) { 3614 rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + 3615 whitespace + "*(?:''|\"\")" ); 3616 } 3617 3618 // Webkit/Opera - :checked should return selected option elements 3619 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 3620 // IE8 throws error here and will not see later tests 3621 if ( !el.querySelectorAll( ":checked" ).length ) { 3622 rbuggyQSA.push( ":checked" ); 3623 } 3624 3625 // Support: Safari 8+, iOS 8+ 3626 // https://bugs.webkit.org/show_bug.cgi?id=136851 3627 // In-page `selector#id sibling-combinator selector` fails 3628 if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { 3629 rbuggyQSA.push( ".#.+[+~]" ); 3630 } 3631 3632 // Support: Firefox <=3.6 - 5 only 3633 // Old Firefox doesn't throw on a badly-escaped identifier. 3634 el.querySelectorAll( "\\\f" ); 3635 rbuggyQSA.push( "[\\r\\n\\f]" ); 3636 } ); 3637 3638 assert( function( el ) { 3639 el.innerHTML = "<a href='' disabled='disabled'></a>" + 3640 "<select disabled='disabled'><option/></select>"; 3641 3642 // Support: Windows 8 Native Apps 3643 // The type and name attributes are restricted during .innerHTML assignment 3644 var input = document.createElement( "input" ); 3645 input.setAttribute( "type", "hidden" ); 3646 el.appendChild( input ).setAttribute( "name", "D" ); 3647 3648 // Support: IE8 3649 // Enforce case-sensitivity of name attribute 3650 if ( el.querySelectorAll( "[name=d]" ).length ) { 3651 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); 3652 } 3653 3654 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) 3655 // IE8 throws error here and will not see later tests 3656 if ( el.querySelectorAll( ":enabled" ).length !== 2 ) { 3657 rbuggyQSA.push( ":enabled", ":disabled" ); 3658 } 3659 3660 // Support: IE9-11+ 3661 // IE's :disabled selector does not pick up the children of disabled fieldsets 3662 docElem.appendChild( el ).disabled = true; 3663 if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { 3664 rbuggyQSA.push( ":enabled", ":disabled" ); 3665 } 3666 3667 // Support: Opera 10 - 11 only 3668 // Opera 10-11 does not throw on post-comma invalid pseudos 3669 el.querySelectorAll( "*,:x" ); 3670 rbuggyQSA.push( ",.*:" ); 3671 } ); 3672 } 3673 3674 if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches || 3675 docElem.webkitMatchesSelector || 3676 docElem.mozMatchesSelector || 3677 docElem.oMatchesSelector || 3678 docElem.msMatchesSelector ) ) ) ) { 3679 3680 assert( function( el ) { 3681 3682 // Check to see if it's possible to do matchesSelector 3683 // on a disconnected node (IE 9) 3684 support.disconnectedMatch = matches.call( el, "*" ); 3685 3686 // This should fail with an exception 3687 // Gecko does not error, returns false instead 3688 matches.call( el, "[s!='']:x" ); 3689 rbuggyMatches.push( "!=", pseudos ); 3690 } ); 3691 } 3692 3693 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); 3694 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) ); 3695 3696 /* Contains 3697 ---------------------------------------------------------------------- */ 3698 hasCompare = rnative.test( docElem.compareDocumentPosition ); 3699 3700 // Element contains another 3701 // Purposefully self-exclusive 3702 // As in, an element does not contain itself 3703 contains = hasCompare || rnative.test( docElem.contains ) ? 3704 function( a, b ) { 3705 var adown = a.nodeType === 9 ? a.documentElement : a, 3706 bup = b && b.parentNode; 3707 return a === bup || !!( bup && bup.nodeType === 1 && ( 3708 adown.contains ? 3709 adown.contains( bup ) : 3710 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 3711 ) ); 3712 } : 3713 function( a, b ) { 3714 if ( b ) { 3715 while ( ( b = b.parentNode ) ) { 3716 if ( b === a ) { 3717 return true; 3718 } 3719 } 3720 } 3721 return false; 3722 }; 3723 3724 /* Sorting 3725 ---------------------------------------------------------------------- */ 3726 3727 // Document order sorting 3728 sortOrder = hasCompare ? 3729 function( a, b ) { 3730 3731 // Flag for duplicate removal 3732 if ( a === b ) { 3733 hasDuplicate = true; 3734 return 0; 3735 } 3736 3737 // Sort on method existence if only one input has compareDocumentPosition 3738 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 3739 if ( compare ) { 3740 return compare; 3741 } 3742 3743 // Calculate position if both inputs belong to the same document 3744 // Support: IE 11+, Edge 17 - 18+ 3745 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 3746 // two documents; shallow comparisons work. 3747 // eslint-disable-next-line eqeqeq 3748 compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? 3749 a.compareDocumentPosition( b ) : 3750 3751 // Otherwise we know they are disconnected 3752 1; 3753 3754 // Disconnected nodes 3755 if ( compare & 1 || 3756 ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { 3757 3758 // Choose the first element that is related to our preferred document 3759 // Support: IE 11+, Edge 17 - 18+ 3760 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 3761 // two documents; shallow comparisons work. 3762 // eslint-disable-next-line eqeqeq 3763 if ( a == document || a.ownerDocument == preferredDoc && 3764 contains( preferredDoc, a ) ) { 3765 return -1; 3766 } 3767 3768 // Support: IE 11+, Edge 17 - 18+ 3769 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 3770 // two documents; shallow comparisons work. 3771 // eslint-disable-next-line eqeqeq 3772 if ( b == document || b.ownerDocument == preferredDoc && 3773 contains( preferredDoc, b ) ) { 3774 return 1; 3775 } 3776 3777 // Maintain original order 3778 return sortInput ? 3779 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 3780 0; 3781 } 3782 3783 return compare & 4 ? -1 : 1; 3784 } : 3785 function( a, b ) { 3786 3787 // Exit early if the nodes are identical 3788 if ( a === b ) { 3789 hasDuplicate = true; 3790 return 0; 3791 } 3792 3793 var cur, 3794 i = 0, 3795 aup = a.parentNode, 3796 bup = b.parentNode, 3797 ap = [ a ], 3798 bp = [ b ]; 3799 3800 // Parentless nodes are either documents or disconnected 3801 if ( !aup || !bup ) { 3802 3803 // Support: IE 11+, Edge 17 - 18+ 3804 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 3805 // two documents; shallow comparisons work. 3806 /* eslint-disable eqeqeq */ 3807 return a == document ? -1 : 3808 b == document ? 1 : 3809 /* eslint-enable eqeqeq */ 3810 aup ? -1 : 3811 bup ? 1 : 3812 sortInput ? 3813 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 3814 0; 3815 3816 // If the nodes are siblings, we can do a quick check 3817 } else if ( aup === bup ) { 3818 return siblingCheck( a, b ); 3819 } 3820 3821 // Otherwise we need full lists of their ancestors for comparison 3822 cur = a; 3823 while ( ( cur = cur.parentNode ) ) { 3824 ap.unshift( cur ); 3825 } 3826 cur = b; 3827 while ( ( cur = cur.parentNode ) ) { 3828 bp.unshift( cur ); 3829 } 3830 3831 // Walk down the tree looking for a discrepancy 3832 while ( ap[ i ] === bp[ i ] ) { 3833 i++; 3834 } 3835 3836 return i ? 3837 3838 // Do a sibling check if the nodes have a common ancestor 3839 siblingCheck( ap[ i ], bp[ i ] ) : 3840 3841 // Otherwise nodes in our document sort first 3842 // Support: IE 11+, Edge 17 - 18+ 3843 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 3844 // two documents; shallow comparisons work. 3845 /* eslint-disable eqeqeq */ 3846 ap[ i ] == preferredDoc ? -1 : 3847 bp[ i ] == preferredDoc ? 1 : 3848 /* eslint-enable eqeqeq */ 3849 0; 3850 }; 3851 3852 return document; 3853}; 3854 3855Sizzle.matches = function( expr, elements ) { 3856 return Sizzle( expr, null, null, elements ); 3857}; 3858 3859Sizzle.matchesSelector = function( elem, expr ) { 3860 setDocument( elem ); 3861 3862 if ( support.matchesSelector && documentIsHTML && 3863 !nonnativeSelectorCache[ expr + " " ] && 3864 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && 3865 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { 3866 3867 try { 3868 var ret = matches.call( elem, expr ); 3869 3870 // IE 9's matchesSelector returns false on disconnected nodes 3871 if ( ret || support.disconnectedMatch || 3872 3873 // As well, disconnected nodes are said to be in a document 3874 // fragment in IE 9 3875 elem.document && elem.document.nodeType !== 11 ) { 3876 return ret; 3877 } 3878 } catch ( e ) { 3879 nonnativeSelectorCache( expr, true ); 3880 } 3881 } 3882 3883 return Sizzle( expr, document, null, [ elem ] ).length > 0; 3884}; 3885 3886Sizzle.contains = function( context, elem ) { 3887 3888 // Set document vars if needed 3889 // Support: IE 11+, Edge 17 - 18+ 3890 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 3891 // two documents; shallow comparisons work. 3892 // eslint-disable-next-line eqeqeq 3893 if ( ( context.ownerDocument || context ) != document ) { 3894 setDocument( context ); 3895 } 3896 return contains( context, elem ); 3897}; 3898 3899Sizzle.attr = function( elem, name ) { 3900 3901 // Set document vars if needed 3902 // Support: IE 11+, Edge 17 - 18+ 3903 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 3904 // two documents; shallow comparisons work. 3905 // eslint-disable-next-line eqeqeq 3906 if ( ( elem.ownerDocument || elem ) != document ) { 3907 setDocument( elem ); 3908 } 3909 3910 var fn = Expr.attrHandle[ name.toLowerCase() ], 3911 3912 // Don't get fooled by Object.prototype properties (jQuery #13807) 3913 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? 3914 fn( elem, name, !documentIsHTML ) : 3915 undefined; 3916 3917 return val !== undefined ? 3918 val : 3919 support.attributes || !documentIsHTML ? 3920 elem.getAttribute( name ) : 3921 ( val = elem.getAttributeNode( name ) ) && val.specified ? 3922 val.value : 3923 null; 3924}; 3925 3926Sizzle.escape = function( sel ) { 3927 return ( sel + "" ).replace( rcssescape, fcssescape ); 3928}; 3929 3930Sizzle.error = function( msg ) { 3931 throw new Error( "Syntax error, unrecognized expression: " + msg ); 3932}; 3933 3934/** 3935 * Document sorting and removing duplicates 3936 * @param {ArrayLike} results 3937 */ 3938Sizzle.uniqueSort = function( results ) { 3939 var elem, 3940 duplicates = [], 3941 j = 0, 3942 i = 0; 3943 3944 // Unless we *know* we can detect duplicates, assume their presence 3945 hasDuplicate = !support.detectDuplicates; 3946 sortInput = !support.sortStable && results.slice( 0 ); 3947 results.sort( sortOrder ); 3948 3949 if ( hasDuplicate ) { 3950 while ( ( elem = results[ i++ ] ) ) { 3951 if ( elem === results[ i ] ) { 3952 j = duplicates.push( i ); 3953 } 3954 } 3955 while ( j-- ) { 3956 results.splice( duplicates[ j ], 1 ); 3957 } 3958 } 3959 3960 // Clear input after sorting to release objects 3961 // See https://github.com/jquery/sizzle/pull/225 3962 sortInput = null; 3963 3964 return results; 3965}; 3966 3967/** 3968 * Utility function for retrieving the text value of an array of DOM nodes 3969 * @param {Array|Element} elem 3970 */ 3971getText = Sizzle.getText = function( elem ) { 3972 var node, 3973 ret = "", 3974 i = 0, 3975 nodeType = elem.nodeType; 3976 3977 if ( !nodeType ) { 3978 3979 // If no nodeType, this is expected to be an array 3980 while ( ( node = elem[ i++ ] ) ) { 3981 3982 // Do not traverse comment nodes 3983 ret += getText( node ); 3984 } 3985 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { 3986 3987 // Use textContent for elements 3988 // innerText usage removed for consistency of new lines (jQuery #11153) 3989 if ( typeof elem.textContent === "string" ) { 3990 return elem.textContent; 3991 } else { 3992 3993 // Traverse its children 3994 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 3995 ret += getText( elem ); 3996 } 3997 } 3998 } else if ( nodeType === 3 || nodeType === 4 ) { 3999 return elem.nodeValue; 4000 } 4001 4002 // Do not include comment or processing instruction nodes 4003 4004 return ret; 4005}; 4006 4007Expr = Sizzle.selectors = { 4008 4009 // Can be adjusted by the user 4010 cacheLength: 50, 4011 4012 createPseudo: markFunction, 4013 4014 match: matchExpr, 4015 4016 attrHandle: {}, 4017 4018 find: {}, 4019 4020 relative: { 4021 ">": { dir: "parentNode", first: true }, 4022 " ": { dir: "parentNode" }, 4023 "+": { dir: "previousSibling", first: true }, 4024 "~": { dir: "previousSibling" } 4025 }, 4026 4027 preFilter: { 4028 "ATTR": function( match ) { 4029 match[ 1 ] = match[ 1 ].replace( runescape, funescape ); 4030 4031 // Move the given value to match[3] whether quoted or unquoted 4032 match[ 3 ] = ( match[ 3 ] || match[ 4 ] || 4033 match[ 5 ] || "" ).replace( runescape, funescape ); 4034 4035 if ( match[ 2 ] === "~=" ) { 4036 match[ 3 ] = " " + match[ 3 ] + " "; 4037 } 4038 4039 return match.slice( 0, 4 ); 4040 }, 4041 4042 "CHILD": function( match ) { 4043 4044 /* matches from matchExpr["CHILD"] 4045 1 type (only|nth|...) 4046 2 what (child|of-type) 4047 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 4048 4 xn-component of xn+y argument ([+-]?\d*n|) 4049 5 sign of xn-component 4050 6 x of xn-component 4051 7 sign of y-component 4052 8 y of y-component 4053 */ 4054 match[ 1 ] = match[ 1 ].toLowerCase(); 4055 4056 if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { 4057 4058 // nth-* requires argument 4059 if ( !match[ 3 ] ) { 4060 Sizzle.error( match[ 0 ] ); 4061 } 4062 4063 // numeric x and y parameters for Expr.filter.CHILD 4064 // remember that false/true cast respectively to 0/1 4065 match[ 4 ] = +( match[ 4 ] ? 4066 match[ 5 ] + ( match[ 6 ] || 1 ) : 4067 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) ); 4068 match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); 4069 4070 // other types prohibit arguments 4071 } else if ( match[ 3 ] ) { 4072 Sizzle.error( match[ 0 ] ); 4073 } 4074 4075 return match; 4076 }, 4077 4078 "PSEUDO": function( match ) { 4079 var excess, 4080 unquoted = !match[ 6 ] && match[ 2 ]; 4081 4082 if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) { 4083 return null; 4084 } 4085 4086 // Accept quoted arguments as-is 4087 if ( match[ 3 ] ) { 4088 match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; 4089 4090 // Strip excess characters from unquoted arguments 4091 } else if ( unquoted && rpseudo.test( unquoted ) && 4092 4093 // Get excess from tokenize (recursively) 4094 ( excess = tokenize( unquoted, true ) ) && 4095 4096 // advance to the next closing parenthesis 4097 ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { 4098 4099 // excess is a negative index 4100 match[ 0 ] = match[ 0 ].slice( 0, excess ); 4101 match[ 2 ] = unquoted.slice( 0, excess ); 4102 } 4103 4104 // Return only captures needed by the pseudo filter method (type and argument) 4105 return match.slice( 0, 3 ); 4106 } 4107 }, 4108 4109 filter: { 4110 4111 "TAG": function( nodeNameSelector ) { 4112 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); 4113 return nodeNameSelector === "*" ? 4114 function() { 4115 return true; 4116 } : 4117 function( elem ) { 4118 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; 4119 }; 4120 }, 4121 4122 "CLASS": function( className ) { 4123 var pattern = classCache[ className + " " ]; 4124 4125 return pattern || 4126 ( pattern = new RegExp( "(^|" + whitespace + 4127 ")" + className + "(" + whitespace + "|$)" ) ) && classCache( 4128 className, function( elem ) { 4129 return pattern.test( 4130 typeof elem.className === "string" && elem.className || 4131 typeof elem.getAttribute !== "undefined" && 4132 elem.getAttribute( "class" ) || 4133 "" 4134 ); 4135 } ); 4136 }, 4137 4138 "ATTR": function( name, operator, check ) { 4139 return function( elem ) { 4140 var result = Sizzle.attr( elem, name ); 4141 4142 if ( result == null ) { 4143 return operator === "!="; 4144 } 4145 if ( !operator ) { 4146 return true; 4147 } 4148 4149 result += ""; 4150 4151 /* eslint-disable max-len */ 4152 4153 return operator === "=" ? result === check : 4154 operator === "!=" ? result !== check : 4155 operator === "^=" ? check && result.indexOf( check ) === 0 : 4156 operator === "*=" ? check && result.indexOf( check ) > -1 : 4157 operator === "$=" ? check && result.slice( -check.length ) === check : 4158 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : 4159 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : 4160 false; 4161 /* eslint-enable max-len */ 4162 4163 }; 4164 }, 4165 4166 "CHILD": function( type, what, _argument, first, last ) { 4167 var simple = type.slice( 0, 3 ) !== "nth", 4168 forward = type.slice( -4 ) !== "last", 4169 ofType = what === "of-type"; 4170 4171 return first === 1 && last === 0 ? 4172 4173 // Shortcut for :nth-*(n) 4174 function( elem ) { 4175 return !!elem.parentNode; 4176 } : 4177 4178 function( elem, _context, xml ) { 4179 var cache, uniqueCache, outerCache, node, nodeIndex, start, 4180 dir = simple !== forward ? "nextSibling" : "previousSibling", 4181 parent = elem.parentNode, 4182 name = ofType && elem.nodeName.toLowerCase(), 4183 useCache = !xml && !ofType, 4184 diff = false; 4185 4186 if ( parent ) { 4187 4188 // :(first|last|only)-(child|of-type) 4189 if ( simple ) { 4190 while ( dir ) { 4191 node = elem; 4192 while ( ( node = node[ dir ] ) ) { 4193 if ( ofType ? 4194 node.nodeName.toLowerCase() === name : 4195 node.nodeType === 1 ) { 4196 4197 return false; 4198 } 4199 } 4200 4201 // Reverse direction for :only-* (if we haven't yet done so) 4202 start = dir = type === "only" && !start && "nextSibling"; 4203 } 4204 return true; 4205 } 4206 4207 start = [ forward ? parent.firstChild : parent.lastChild ]; 4208 4209 // non-xml :nth-child(...) stores cache data on `parent` 4210 if ( forward && useCache ) { 4211 4212 // Seek `elem` from a previously-cached index 4213 4214 // ...in a gzip-friendly way 4215 node = parent; 4216 outerCache = node[ expando ] || ( node[ expando ] = {} ); 4217 4218 // Support: IE <9 only 4219 // Defend against cloned attroperties (jQuery gh-1709) 4220 uniqueCache = outerCache[ node.uniqueID ] || 4221 ( outerCache[ node.uniqueID ] = {} ); 4222 4223 cache = uniqueCache[ type ] || []; 4224 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 4225 diff = nodeIndex && cache[ 2 ]; 4226 node = nodeIndex && parent.childNodes[ nodeIndex ]; 4227 4228 while ( ( node = ++nodeIndex && node && node[ dir ] || 4229 4230 // Fallback to seeking `elem` from the start 4231 ( diff = nodeIndex = 0 ) || start.pop() ) ) { 4232 4233 // When found, cache indexes on `parent` and break 4234 if ( node.nodeType === 1 && ++diff && node === elem ) { 4235 uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; 4236 break; 4237 } 4238 } 4239 4240 } else { 4241 4242 // Use previously-cached element index if available 4243 if ( useCache ) { 4244 4245 // ...in a gzip-friendly way 4246 node = elem; 4247 outerCache = node[ expando ] || ( node[ expando ] = {} ); 4248 4249 // Support: IE <9 only 4250 // Defend against cloned attroperties (jQuery gh-1709) 4251 uniqueCache = outerCache[ node.uniqueID ] || 4252 ( outerCache[ node.uniqueID ] = {} ); 4253 4254 cache = uniqueCache[ type ] || []; 4255 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 4256 diff = nodeIndex; 4257 } 4258 4259 // xml :nth-child(...) 4260 // or :nth-last-child(...) or :nth(-last)?-of-type(...) 4261 if ( diff === false ) { 4262 4263 // Use the same loop as above to seek `elem` from the start 4264 while ( ( node = ++nodeIndex && node && node[ dir ] || 4265 ( diff = nodeIndex = 0 ) || start.pop() ) ) { 4266 4267 if ( ( ofType ? 4268 node.nodeName.toLowerCase() === name : 4269 node.nodeType === 1 ) && 4270 ++diff ) { 4271 4272 // Cache the index of each encountered element 4273 if ( useCache ) { 4274 outerCache = node[ expando ] || 4275 ( node[ expando ] = {} ); 4276 4277 // Support: IE <9 only 4278 // Defend against cloned attroperties (jQuery gh-1709) 4279 uniqueCache = outerCache[ node.uniqueID ] || 4280 ( outerCache[ node.uniqueID ] = {} ); 4281 4282 uniqueCache[ type ] = [ dirruns, diff ]; 4283 } 4284 4285 if ( node === elem ) { 4286 break; 4287 } 4288 } 4289 } 4290 } 4291 } 4292 4293 // Incorporate the offset, then check against cycle size 4294 diff -= last; 4295 return diff === first || ( diff % first === 0 && diff / first >= 0 ); 4296 } 4297 }; 4298 }, 4299 4300 "PSEUDO": function( pseudo, argument ) { 4301 4302 // pseudo-class names are case-insensitive 4303 // http://www.w3.org/TR/selectors/#pseudo-classes 4304 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 4305 // Remember that setFilters inherits from pseudos 4306 var args, 4307 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || 4308 Sizzle.error( "unsupported pseudo: " + pseudo ); 4309 4310 // The user may use createPseudo to indicate that 4311 // arguments are needed to create the filter function 4312 // just as Sizzle does 4313 if ( fn[ expando ] ) { 4314 return fn( argument ); 4315 } 4316 4317 // But maintain support for old signatures 4318 if ( fn.length > 1 ) { 4319 args = [ pseudo, pseudo, "", argument ]; 4320 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? 4321 markFunction( function( seed, matches ) { 4322 var idx, 4323 matched = fn( seed, argument ), 4324 i = matched.length; 4325 while ( i-- ) { 4326 idx = indexOf( seed, matched[ i ] ); 4327 seed[ idx ] = !( matches[ idx ] = matched[ i ] ); 4328 } 4329 } ) : 4330 function( elem ) { 4331 return fn( elem, 0, args ); 4332 }; 4333 } 4334 4335 return fn; 4336 } 4337 }, 4338 4339 pseudos: { 4340 4341 // Potentially complex pseudos 4342 "not": markFunction( function( selector ) { 4343 4344 // Trim the selector passed to compile 4345 // to avoid treating leading and trailing 4346 // spaces as combinators 4347 var input = [], 4348 results = [], 4349 matcher = compile( selector.replace( rtrim, "$1" ) ); 4350 4351 return matcher[ expando ] ? 4352 markFunction( function( seed, matches, _context, xml ) { 4353 var elem, 4354 unmatched = matcher( seed, null, xml, [] ), 4355 i = seed.length; 4356 4357 // Match elements unmatched by `matcher` 4358 while ( i-- ) { 4359 if ( ( elem = unmatched[ i ] ) ) { 4360 seed[ i ] = !( matches[ i ] = elem ); 4361 } 4362 } 4363 } ) : 4364 function( elem, _context, xml ) { 4365 input[ 0 ] = elem; 4366 matcher( input, null, xml, results ); 4367 4368 // Don't keep the element (issue #299) 4369 input[ 0 ] = null; 4370 return !results.pop(); 4371 }; 4372 } ), 4373 4374 "has": markFunction( function( selector ) { 4375 return function( elem ) { 4376 return Sizzle( selector, elem ).length > 0; 4377 }; 4378 } ), 4379 4380 "contains": markFunction( function( text ) { 4381 text = text.replace( runescape, funescape ); 4382 return function( elem ) { 4383 return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; 4384 }; 4385 } ), 4386 4387 // "Whether an element is represented by a :lang() selector 4388 // is based solely on the element's language value 4389 // being equal to the identifier C, 4390 // or beginning with the identifier C immediately followed by "-". 4391 // The matching of C against the element's language value is performed case-insensitively. 4392 // The identifier C does not have to be a valid language name." 4393 // http://www.w3.org/TR/selectors/#lang-pseudo 4394 "lang": markFunction( function( lang ) { 4395 4396 // lang value must be a valid identifier 4397 if ( !ridentifier.test( lang || "" ) ) { 4398 Sizzle.error( "unsupported lang: " + lang ); 4399 } 4400 lang = lang.replace( runescape, funescape ).toLowerCase(); 4401 return function( elem ) { 4402 var elemLang; 4403 do { 4404 if ( ( elemLang = documentIsHTML ? 4405 elem.lang : 4406 elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { 4407 4408 elemLang = elemLang.toLowerCase(); 4409 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 4410 } 4411 } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); 4412 return false; 4413 }; 4414 } ), 4415 4416 // Miscellaneous 4417 "target": function( elem ) { 4418 var hash = window.location && window.location.hash; 4419 return hash && hash.slice( 1 ) === elem.id; 4420 }, 4421 4422 "root": function( elem ) { 4423 return elem === docElem; 4424 }, 4425 4426 "focus": function( elem ) { 4427 return elem === document.activeElement && 4428 ( !document.hasFocus || document.hasFocus() ) && 4429 !!( elem.type || elem.href || ~elem.tabIndex ); 4430 }, 4431 4432 // Boolean properties 4433 "enabled": createDisabledPseudo( false ), 4434 "disabled": createDisabledPseudo( true ), 4435 4436 "checked": function( elem ) { 4437 4438 // In CSS3, :checked should return both checked and selected elements 4439 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 4440 var nodeName = elem.nodeName.toLowerCase(); 4441 return ( nodeName === "input" && !!elem.checked ) || 4442 ( nodeName === "option" && !!elem.selected ); 4443 }, 4444 4445 "selected": function( elem ) { 4446 4447 // Accessing this property makes selected-by-default 4448 // options in Safari work properly 4449 if ( elem.parentNode ) { 4450 // eslint-disable-next-line no-unused-expressions 4451 elem.parentNode.selectedIndex; 4452 } 4453 4454 return elem.selected === true; 4455 }, 4456 4457 // Contents 4458 "empty": function( elem ) { 4459 4460 // http://www.w3.org/TR/selectors/#empty-pseudo 4461 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), 4462 // but not by others (comment: 8; processing instruction: 7; etc.) 4463 // nodeType < 6 works because attributes (2) do not appear as children 4464 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 4465 if ( elem.nodeType < 6 ) { 4466 return false; 4467 } 4468 } 4469 return true; 4470 }, 4471 4472 "parent": function( elem ) { 4473 return !Expr.pseudos[ "empty" ]( elem ); 4474 }, 4475 4476 // Element/input types 4477 "header": function( elem ) { 4478 return rheader.test( elem.nodeName ); 4479 }, 4480 4481 "input": function( elem ) { 4482 return rinputs.test( elem.nodeName ); 4483 }, 4484 4485 "button": function( elem ) { 4486 var name = elem.nodeName.toLowerCase(); 4487 return name === "input" && elem.type === "button" || name === "button"; 4488 }, 4489 4490 "text": function( elem ) { 4491 var attr; 4492 return elem.nodeName.toLowerCase() === "input" && 4493 elem.type === "text" && 4494 4495 // Support: IE<8 4496 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" 4497 ( ( attr = elem.getAttribute( "type" ) ) == null || 4498 attr.toLowerCase() === "text" ); 4499 }, 4500 4501 // Position-in-collection 4502 "first": createPositionalPseudo( function() { 4503 return [ 0 ]; 4504 } ), 4505 4506 "last": createPositionalPseudo( function( _matchIndexes, length ) { 4507 return [ length - 1 ]; 4508 } ), 4509 4510 "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) { 4511 return [ argument < 0 ? argument + length : argument ]; 4512 } ), 4513 4514 "even": createPositionalPseudo( function( matchIndexes, length ) { 4515 var i = 0; 4516 for ( ; i < length; i += 2 ) { 4517 matchIndexes.push( i ); 4518 } 4519 return matchIndexes; 4520 } ), 4521 4522 "odd": createPositionalPseudo( function( matchIndexes, length ) { 4523 var i = 1; 4524 for ( ; i < length; i += 2 ) { 4525 matchIndexes.push( i ); 4526 } 4527 return matchIndexes; 4528 } ), 4529 4530 "lt": createPositionalPseudo( function( matchIndexes, length, argument ) { 4531 var i = argument < 0 ? 4532 argument + length : 4533 argument > length ? 4534 length : 4535 argument; 4536 for ( ; --i >= 0; ) { 4537 matchIndexes.push( i ); 4538 } 4539 return matchIndexes; 4540 } ), 4541 4542 "gt": createPositionalPseudo( function( matchIndexes, length, argument ) { 4543 var i = argument < 0 ? argument + length : argument; 4544 for ( ; ++i < length; ) { 4545 matchIndexes.push( i ); 4546 } 4547 return matchIndexes; 4548 } ) 4549 } 4550}; 4551 4552Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ]; 4553 4554// Add button/input type pseudos 4555for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { 4556 Expr.pseudos[ i ] = createInputPseudo( i ); 4557} 4558for ( i in { submit: true, reset: true } ) { 4559 Expr.pseudos[ i ] = createButtonPseudo( i ); 4560} 4561 4562// Easy API for creating new setFilters 4563function setFilters() {} 4564setFilters.prototype = Expr.filters = Expr.pseudos; 4565Expr.setFilters = new setFilters(); 4566 4567tokenize = Sizzle.tokenize = function( selector, parseOnly ) { 4568 var matched, match, tokens, type, 4569 soFar, groups, preFilters, 4570 cached = tokenCache[ selector + " " ]; 4571 4572 if ( cached ) { 4573 return parseOnly ? 0 : cached.slice( 0 ); 4574 } 4575 4576 soFar = selector; 4577 groups = []; 4578 preFilters = Expr.preFilter; 4579 4580 while ( soFar ) { 4581 4582 // Comma and first run 4583 if ( !matched || ( match = rcomma.exec( soFar ) ) ) { 4584 if ( match ) { 4585 4586 // Don't consume trailing commas as valid 4587 soFar = soFar.slice( match[ 0 ].length ) || soFar; 4588 } 4589 groups.push( ( tokens = [] ) ); 4590 } 4591 4592 matched = false; 4593 4594 // Combinators 4595 if ( ( match = rcombinators.exec( soFar ) ) ) { 4596 matched = match.shift(); 4597 tokens.push( { 4598 value: matched, 4599 4600 // Cast descendant combinators to space 4601 type: match[ 0 ].replace( rtrim, " " ) 4602 } ); 4603 soFar = soFar.slice( matched.length ); 4604 } 4605 4606 // Filters 4607 for ( type in Expr.filter ) { 4608 if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || 4609 ( match = preFilters[ type ]( match ) ) ) ) { 4610 matched = match.shift(); 4611 tokens.push( { 4612 value: matched, 4613 type: type, 4614 matches: match 4615 } ); 4616 soFar = soFar.slice( matched.length ); 4617 } 4618 } 4619 4620 if ( !matched ) { 4621 break; 4622 } 4623 } 4624 4625 // Return the length of the invalid excess 4626 // if we're just parsing 4627 // Otherwise, throw an error or return tokens 4628 return parseOnly ? 4629 soFar.length : 4630 soFar ? 4631 Sizzle.error( selector ) : 4632 4633 // Cache the tokens 4634 tokenCache( selector, groups ).slice( 0 ); 4635}; 4636 4637function toSelector( tokens ) { 4638 var i = 0, 4639 len = tokens.length, 4640 selector = ""; 4641 for ( ; i < len; i++ ) { 4642 selector += tokens[ i ].value; 4643 } 4644 return selector; 4645} 4646 4647function addCombinator( matcher, combinator, base ) { 4648 var dir = combinator.dir, 4649 skip = combinator.next, 4650 key = skip || dir, 4651 checkNonElements = base && key === "parentNode", 4652 doneName = done++; 4653 4654 return combinator.first ? 4655 4656 // Check against closest ancestor/preceding element 4657 function( elem, context, xml ) { 4658 while ( ( elem = elem[ dir ] ) ) { 4659 if ( elem.nodeType === 1 || checkNonElements ) { 4660 return matcher( elem, context, xml ); 4661 } 4662 } 4663 return false; 4664 } : 4665 4666 // Check against all ancestor/preceding elements 4667 function( elem, context, xml ) { 4668 var oldCache, uniqueCache, outerCache, 4669 newCache = [ dirruns, doneName ]; 4670 4671 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching 4672 if ( xml ) { 4673 while ( ( elem = elem[ dir ] ) ) { 4674 if ( elem.nodeType === 1 || checkNonElements ) { 4675 if ( matcher( elem, context, xml ) ) { 4676 return true; 4677 } 4678 } 4679 } 4680 } else { 4681 while ( ( elem = elem[ dir ] ) ) { 4682 if ( elem.nodeType === 1 || checkNonElements ) { 4683 outerCache = elem[ expando ] || ( elem[ expando ] = {} ); 4684 4685 // Support: IE <9 only 4686 // Defend against cloned attroperties (jQuery gh-1709) 4687 uniqueCache = outerCache[ elem.uniqueID ] || 4688 ( outerCache[ elem.uniqueID ] = {} ); 4689 4690 if ( skip && skip === elem.nodeName.toLowerCase() ) { 4691 elem = elem[ dir ] || elem; 4692 } else if ( ( oldCache = uniqueCache[ key ] ) && 4693 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { 4694 4695 // Assign to newCache so results back-propagate to previous elements 4696 return ( newCache[ 2 ] = oldCache[ 2 ] ); 4697 } else { 4698 4699 // Reuse newcache so results back-propagate to previous elements 4700 uniqueCache[ key ] = newCache; 4701 4702 // A match means we're done; a fail means we have to keep checking 4703 if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { 4704 return true; 4705 } 4706 } 4707 } 4708 } 4709 } 4710 return false; 4711 }; 4712} 4713 4714function elementMatcher( matchers ) { 4715 return matchers.length > 1 ? 4716 function( elem, context, xml ) { 4717 var i = matchers.length; 4718 while ( i-- ) { 4719 if ( !matchers[ i ]( elem, context, xml ) ) { 4720 return false; 4721 } 4722 } 4723 return true; 4724 } : 4725 matchers[ 0 ]; 4726} 4727 4728function multipleContexts( selector, contexts, results ) { 4729 var i = 0, 4730 len = contexts.length; 4731 for ( ; i < len; i++ ) { 4732 Sizzle( selector, contexts[ i ], results ); 4733 } 4734 return results; 4735} 4736 4737function condense( unmatched, map, filter, context, xml ) { 4738 var elem, 4739 newUnmatched = [], 4740 i = 0, 4741 len = unmatched.length, 4742 mapped = map != null; 4743 4744 for ( ; i < len; i++ ) { 4745 if ( ( elem = unmatched[ i ] ) ) { 4746 if ( !filter || filter( elem, context, xml ) ) { 4747 newUnmatched.push( elem ); 4748 if ( mapped ) { 4749 map.push( i ); 4750 } 4751 } 4752 } 4753 } 4754 4755 return newUnmatched; 4756} 4757 4758function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { 4759 if ( postFilter && !postFilter[ expando ] ) { 4760 postFilter = setMatcher( postFilter ); 4761 } 4762 if ( postFinder && !postFinder[ expando ] ) { 4763 postFinder = setMatcher( postFinder, postSelector ); 4764 } 4765 return markFunction( function( seed, results, context, xml ) { 4766 var temp, i, elem, 4767 preMap = [], 4768 postMap = [], 4769 preexisting = results.length, 4770 4771 // Get initial elements from seed or context 4772 elems = seed || multipleContexts( 4773 selector || "*", 4774 context.nodeType ? [ context ] : context, 4775 [] 4776 ), 4777 4778 // Prefilter to get matcher input, preserving a map for seed-results synchronization 4779 matcherIn = preFilter && ( seed || !selector ) ? 4780 condense( elems, preMap, preFilter, context, xml ) : 4781 elems, 4782 4783 matcherOut = matcher ? 4784 4785 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, 4786 postFinder || ( seed ? preFilter : preexisting || postFilter ) ? 4787 4788 // ...intermediate processing is necessary 4789 [] : 4790 4791 // ...otherwise use results directly 4792 results : 4793 matcherIn; 4794 4795 // Find primary matches 4796 if ( matcher ) { 4797 matcher( matcherIn, matcherOut, context, xml ); 4798 } 4799 4800 // Apply postFilter 4801 if ( postFilter ) { 4802 temp = condense( matcherOut, postMap ); 4803 postFilter( temp, [], context, xml ); 4804 4805 // Un-match failing elements by moving them back to matcherIn 4806 i = temp.length; 4807 while ( i-- ) { 4808 if ( ( elem = temp[ i ] ) ) { 4809 matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); 4810 } 4811 } 4812 } 4813 4814 if ( seed ) { 4815 if ( postFinder || preFilter ) { 4816 if ( postFinder ) { 4817 4818 // Get the final matcherOut by condensing this intermediate into postFinder contexts 4819 temp = []; 4820 i = matcherOut.length; 4821 while ( i-- ) { 4822 if ( ( elem = matcherOut[ i ] ) ) { 4823 4824 // Restore matcherIn since elem is not yet a final match 4825 temp.push( ( matcherIn[ i ] = elem ) ); 4826 } 4827 } 4828 postFinder( null, ( matcherOut = [] ), temp, xml ); 4829 } 4830 4831 // Move matched elements from seed to results to keep them synchronized 4832 i = matcherOut.length; 4833 while ( i-- ) { 4834 if ( ( elem = matcherOut[ i ] ) && 4835 ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) { 4836 4837 seed[ temp ] = !( results[ temp ] = elem ); 4838 } 4839 } 4840 } 4841 4842 // Add elements to results, through postFinder if defined 4843 } else { 4844 matcherOut = condense( 4845 matcherOut === results ? 4846 matcherOut.splice( preexisting, matcherOut.length ) : 4847 matcherOut 4848 ); 4849 if ( postFinder ) { 4850 postFinder( null, results, matcherOut, xml ); 4851 } else { 4852 push.apply( results, matcherOut ); 4853 } 4854 } 4855 } ); 4856} 4857 4858function matcherFromTokens( tokens ) { 4859 var checkContext, matcher, j, 4860 len = tokens.length, 4861 leadingRelative = Expr.relative[ tokens[ 0 ].type ], 4862 implicitRelative = leadingRelative || Expr.relative[ " " ], 4863 i = leadingRelative ? 1 : 0, 4864 4865 // The foundational matcher ensures that elements are reachable from top-level context(s) 4866 matchContext = addCombinator( function( elem ) { 4867 return elem === checkContext; 4868 }, implicitRelative, true ), 4869 matchAnyContext = addCombinator( function( elem ) { 4870 return indexOf( checkContext, elem ) > -1; 4871 }, implicitRelative, true ), 4872 matchers = [ function( elem, context, xml ) { 4873 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( 4874 ( checkContext = context ).nodeType ? 4875 matchContext( elem, context, xml ) : 4876 matchAnyContext( elem, context, xml ) ); 4877 4878 // Avoid hanging onto element (issue #299) 4879 checkContext = null; 4880 return ret; 4881 } ]; 4882 4883 for ( ; i < len; i++ ) { 4884 if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { 4885 matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; 4886 } else { 4887 matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); 4888 4889 // Return special upon seeing a positional matcher 4890 if ( matcher[ expando ] ) { 4891 4892 // Find the next relative operator (if any) for proper handling 4893 j = ++i; 4894 for ( ; j < len; j++ ) { 4895 if ( Expr.relative[ tokens[ j ].type ] ) { 4896 break; 4897 } 4898 } 4899 return setMatcher( 4900 i > 1 && elementMatcher( matchers ), 4901 i > 1 && toSelector( 4902 4903 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 4904 tokens 4905 .slice( 0, i - 1 ) 4906 .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) 4907 ).replace( rtrim, "$1" ), 4908 matcher, 4909 i < j && matcherFromTokens( tokens.slice( i, j ) ), 4910 j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), 4911 j < len && toSelector( tokens ) 4912 ); 4913 } 4914 matchers.push( matcher ); 4915 } 4916 } 4917 4918 return elementMatcher( matchers ); 4919} 4920 4921function matcherFromGroupMatchers( elementMatchers, setMatchers ) { 4922 var bySet = setMatchers.length > 0, 4923 byElement = elementMatchers.length > 0, 4924 superMatcher = function( seed, context, xml, results, outermost ) { 4925 var elem, j, matcher, 4926 matchedCount = 0, 4927 i = "0", 4928 unmatched = seed && [], 4929 setMatched = [], 4930 contextBackup = outermostContext, 4931 4932 // We must always have either seed elements or outermost context 4933 elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ), 4934 4935 // Use integer dirruns iff this is the outermost matcher 4936 dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), 4937 len = elems.length; 4938 4939 if ( outermost ) { 4940 4941 // Support: IE 11+, Edge 17 - 18+ 4942 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 4943 // two documents; shallow comparisons work. 4944 // eslint-disable-next-line eqeqeq 4945 outermostContext = context == document || context || outermost; 4946 } 4947 4948 // Add elements passing elementMatchers directly to results 4949 // Support: IE<9, Safari 4950 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id 4951 for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { 4952 if ( byElement && elem ) { 4953 j = 0; 4954 4955 // Support: IE 11+, Edge 17 - 18+ 4956 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 4957 // two documents; shallow comparisons work. 4958 // eslint-disable-next-line eqeqeq 4959 if ( !context && elem.ownerDocument != document ) { 4960 setDocument( elem ); 4961 xml = !documentIsHTML; 4962 } 4963 while ( ( matcher = elementMatchers[ j++ ] ) ) { 4964 if ( matcher( elem, context || document, xml ) ) { 4965 results.push( elem ); 4966 break; 4967 } 4968 } 4969 if ( outermost ) { 4970 dirruns = dirrunsUnique; 4971 } 4972 } 4973 4974 // Track unmatched elements for set filters 4975 if ( bySet ) { 4976 4977 // They will have gone through all possible matchers 4978 if ( ( elem = !matcher && elem ) ) { 4979 matchedCount--; 4980 } 4981 4982 // Lengthen the array for every element, matched or not 4983 if ( seed ) { 4984 unmatched.push( elem ); 4985 } 4986 } 4987 } 4988 4989 // `i` is now the count of elements visited above, and adding it to `matchedCount` 4990 // makes the latter nonnegative. 4991 matchedCount += i; 4992 4993 // Apply set filters to unmatched elements 4994 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` 4995 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have 4996 // no element matchers and no seed. 4997 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that 4998 // case, which will result in a "00" `matchedCount` that differs from `i` but is also 4999 // numerically zero. 5000 if ( bySet && i !== matchedCount ) { 5001 j = 0; 5002 while ( ( matcher = setMatchers[ j++ ] ) ) { 5003 matcher( unmatched, setMatched, context, xml ); 5004 } 5005 5006 if ( seed ) { 5007 5008 // Reintegrate element matches to eliminate the need for sorting 5009 if ( matchedCount > 0 ) { 5010 while ( i-- ) { 5011 if ( !( unmatched[ i ] || setMatched[ i ] ) ) { 5012 setMatched[ i ] = pop.call( results ); 5013 } 5014 } 5015 } 5016 5017 // Discard index placeholder values to get only actual matches 5018 setMatched = condense( setMatched ); 5019 } 5020 5021 // Add matches to results 5022 push.apply( results, setMatched ); 5023 5024 // Seedless set matches succeeding multiple successful matchers stipulate sorting 5025 if ( outermost && !seed && setMatched.length > 0 && 5026 ( matchedCount + setMatchers.length ) > 1 ) { 5027 5028 Sizzle.uniqueSort( results ); 5029 } 5030 } 5031 5032 // Override manipulation of globals by nested matchers 5033 if ( outermost ) { 5034 dirruns = dirrunsUnique; 5035 outermostContext = contextBackup; 5036 } 5037 5038 return unmatched; 5039 }; 5040 5041 return bySet ? 5042 markFunction( superMatcher ) : 5043 superMatcher; 5044} 5045 5046compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { 5047 var i, 5048 setMatchers = [], 5049 elementMatchers = [], 5050 cached = compilerCache[ selector + " " ]; 5051 5052 if ( !cached ) { 5053 5054 // Generate a function of recursive functions that can be used to check each element 5055 if ( !match ) { 5056 match = tokenize( selector ); 5057 } 5058 i = match.length; 5059 while ( i-- ) { 5060 cached = matcherFromTokens( match[ i ] ); 5061 if ( cached[ expando ] ) { 5062 setMatchers.push( cached ); 5063 } else { 5064 elementMatchers.push( cached ); 5065 } 5066 } 5067 5068 // Cache the compiled function 5069 cached = compilerCache( 5070 selector, 5071 matcherFromGroupMatchers( elementMatchers, setMatchers ) 5072 ); 5073 5074 // Save selector and tokenization 5075 cached.selector = selector; 5076 } 5077 return cached; 5078}; 5079 5080/** 5081 * A low-level selection function that works with Sizzle's compiled 5082 * selector functions 5083 * @param {String|Function} selector A selector or a pre-compiled 5084 * selector function built with Sizzle.compile 5085 * @param {Element} context 5086 * @param {Array} [results] 5087 * @param {Array} [seed] A set of elements to match against 5088 */ 5089select = Sizzle.select = function( selector, context, results, seed ) { 5090 var i, tokens, token, type, find, 5091 compiled = typeof selector === "function" && selector, 5092 match = !seed && tokenize( ( selector = compiled.selector || selector ) ); 5093 5094 results = results || []; 5095 5096 // Try to minimize operations if there is only one selector in the list and no seed 5097 // (the latter of which guarantees us context) 5098 if ( match.length === 1 ) { 5099 5100 // Reduce context if the leading compound selector is an ID 5101 tokens = match[ 0 ] = match[ 0 ].slice( 0 ); 5102 if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && 5103 context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { 5104 5105 context = ( Expr.find[ "ID" ]( token.matches[ 0 ] 5106 .replace( runescape, funescape ), context ) || [] )[ 0 ]; 5107 if ( !context ) { 5108 return results; 5109 5110 // Precompiled matchers will still verify ancestry, so step up a level 5111 } else if ( compiled ) { 5112 context = context.parentNode; 5113 } 5114 5115 selector = selector.slice( tokens.shift().value.length ); 5116 } 5117 5118 // Fetch a seed set for right-to-left matching 5119 i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length; 5120 while ( i-- ) { 5121 token = tokens[ i ]; 5122 5123 // Abort if we hit a combinator 5124 if ( Expr.relative[ ( type = token.type ) ] ) { 5125 break; 5126 } 5127 if ( ( find = Expr.find[ type ] ) ) { 5128 5129 // Search, expanding context for leading sibling combinators 5130 if ( ( seed = find( 5131 token.matches[ 0 ].replace( runescape, funescape ), 5132 rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) || 5133 context 5134 ) ) ) { 5135 5136 // If seed is empty or no tokens remain, we can return early 5137 tokens.splice( i, 1 ); 5138 selector = seed.length && toSelector( tokens ); 5139 if ( !selector ) { 5140 push.apply( results, seed ); 5141 return results; 5142 } 5143 5144 break; 5145 } 5146 } 5147 } 5148 } 5149 5150 // Compile and execute a filtering function if one is not provided 5151 // Provide `match` to avoid retokenization if we modified the selector above 5152 ( compiled || compile( selector, match ) )( 5153 seed, 5154 context, 5155 !documentIsHTML, 5156 results, 5157 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context 5158 ); 5159 return results; 5160}; 5161 5162// One-time assignments 5163 5164// Sort stability 5165support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; 5166 5167// Support: Chrome 14-35+ 5168// Always assume duplicates if they aren't passed to the comparison function 5169support.detectDuplicates = !!hasDuplicate; 5170 5171// Initialize against the default document 5172setDocument(); 5173 5174// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) 5175// Detached nodes confoundingly follow *each other* 5176support.sortDetached = assert( function( el ) { 5177 5178 // Should return 1, but returns 4 (following) 5179 return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; 5180} ); 5181 5182// Support: IE<8 5183// Prevent attribute/property "interpolation" 5184// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx 5185if ( !assert( function( el ) { 5186 el.innerHTML = "<a href='#'></a>"; 5187 return el.firstChild.getAttribute( "href" ) === "#"; 5188} ) ) { 5189 addHandle( "type|href|height|width", function( elem, name, isXML ) { 5190 if ( !isXML ) { 5191 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); 5192 } 5193 } ); 5194} 5195 5196// Support: IE<9 5197// Use defaultValue in place of getAttribute("value") 5198if ( !support.attributes || !assert( function( el ) { 5199 el.innerHTML = "<input/>"; 5200 el.firstChild.setAttribute( "value", "" ); 5201 return el.firstChild.getAttribute( "value" ) === ""; 5202} ) ) { 5203 addHandle( "value", function( elem, _name, isXML ) { 5204 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { 5205 return elem.defaultValue; 5206 } 5207 } ); 5208} 5209 5210// Support: IE<9 5211// Use getAttributeNode to fetch booleans when getAttribute lies 5212if ( !assert( function( el ) { 5213 return el.getAttribute( "disabled" ) == null; 5214} ) ) { 5215 addHandle( booleans, function( elem, name, isXML ) { 5216 var val; 5217 if ( !isXML ) { 5218 return elem[ name ] === true ? name.toLowerCase() : 5219 ( val = elem.getAttributeNode( name ) ) && val.specified ? 5220 val.value : 5221 null; 5222 } 5223 } ); 5224} 5225 5226return Sizzle; 5227 5228} )( window ); 5229 5230 5231 5232jQuery.find = Sizzle; 5233jQuery.expr = Sizzle.selectors; 5234 5235// Deprecated 5236jQuery.expr[ ":" ] = jQuery.expr.pseudos; 5237jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; 5238jQuery.text = Sizzle.getText; 5239jQuery.isXMLDoc = Sizzle.isXML; 5240jQuery.contains = Sizzle.contains; 5241jQuery.escapeSelector = Sizzle.escape; 5242 5243 5244 5245 5246var dir = function( elem, dir, until ) { 5247 var matched = [], 5248 truncate = until !== undefined; 5249 5250 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { 5251 if ( elem.nodeType === 1 ) { 5252 if ( truncate && jQuery( elem ).is( until ) ) { 5253 break; 5254 } 5255 matched.push( elem ); 5256 } 5257 } 5258 return matched; 5259}; 5260 5261 5262var siblings = function( n, elem ) { 5263 var matched = []; 5264 5265 for ( ; n; n = n.nextSibling ) { 5266 if ( n.nodeType === 1 && n !== elem ) { 5267 matched.push( n ); 5268 } 5269 } 5270 5271 return matched; 5272}; 5273 5274 5275var rneedsContext = jQuery.expr.match.needsContext; 5276 5277 5278 5279function nodeName( elem, name ) { 5280 5281 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 5282 5283} 5284var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); 5285 5286 5287 5288// Implement the identical functionality for filter and not 5289function winnow( elements, qualifier, not ) { 5290 if ( isFunction( qualifier ) ) { 5291 return jQuery.grep( elements, function( elem, i ) { 5292 return !!qualifier.call( elem, i, elem ) !== not; 5293 } ); 5294 } 5295 5296 // Single element 5297 if ( qualifier.nodeType ) { 5298 return jQuery.grep( elements, function( elem ) { 5299 return ( elem === qualifier ) !== not; 5300 } ); 5301 } 5302 5303 // Arraylike of elements (jQuery, arguments, Array) 5304 if ( typeof qualifier !== "string" ) { 5305 return jQuery.grep( elements, function( elem ) { 5306 return ( indexOf.call( qualifier, elem ) > -1 ) !== not; 5307 } ); 5308 } 5309 5310 // Filtered directly for both simple and complex selectors 5311 return jQuery.filter( qualifier, elements, not ); 5312} 5313 5314jQuery.filter = function( expr, elems, not ) { 5315 var elem = elems[ 0 ]; 5316 5317 if ( not ) { 5318 expr = ":not(" + expr + ")"; 5319 } 5320 5321 if ( elems.length === 1 && elem.nodeType === 1 ) { 5322 return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; 5323 } 5324 5325 return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { 5326 return elem.nodeType === 1; 5327 } ) ); 5328}; 5329 5330jQuery.fn.extend( { 5331 find: function( selector ) { 5332 var i, ret, 5333 len = this.length, 5334 self = this; 5335 5336 if ( typeof selector !== "string" ) { 5337 return this.pushStack( jQuery( selector ).filter( function() { 5338 for ( i = 0; i < len; i++ ) { 5339 if ( jQuery.contains( self[ i ], this ) ) { 5340 return true; 5341 } 5342 } 5343 } ) ); 5344 } 5345 5346 ret = this.pushStack( [] ); 5347 5348 for ( i = 0; i < len; i++ ) { 5349 jQuery.find( selector, self[ i ], ret ); 5350 } 5351 5352 return len > 1 ? jQuery.uniqueSort( ret ) : ret; 5353 }, 5354 filter: function( selector ) { 5355 return this.pushStack( winnow( this, selector || [], false ) ); 5356 }, 5357 not: function( selector ) { 5358 return this.pushStack( winnow( this, selector || [], true ) ); 5359 }, 5360 is: function( selector ) { 5361 return !!winnow( 5362 this, 5363 5364 // If this is a positional/relative selector, check membership in the returned set 5365 // so $("p:first").is("p:last") won't return true for a doc with two "p". 5366 typeof selector === "string" && rneedsContext.test( selector ) ? 5367 jQuery( selector ) : 5368 selector || [], 5369 false 5370 ).length; 5371 } 5372} ); 5373 5374 5375// Initialize a jQuery object 5376 5377 5378// A central reference to the root jQuery(document) 5379var rootjQuery, 5380 5381 // A simple way to check for HTML strings 5382 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) 5383 // Strict HTML recognition (#11290: must start with <) 5384 // Shortcut simple #id case for speed 5385 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, 5386 5387 init = jQuery.fn.init = function( selector, context, root ) { 5388 var match, elem; 5389 5390 // HANDLE: $(""), $(null), $(undefined), $(false) 5391 if ( !selector ) { 5392 return this; 5393 } 5394 5395 // Method init() accepts an alternate rootjQuery 5396 // so migrate can support jQuery.sub (gh-2101) 5397 root = root || rootjQuery; 5398 5399 // Handle HTML strings 5400 if ( typeof selector === "string" ) { 5401 if ( selector[ 0 ] === "<" && 5402 selector[ selector.length - 1 ] === ">" && 5403 selector.length >= 3 ) { 5404 5405 // Assume that strings that start and end with <> are HTML and skip the regex check 5406 match = [ null, selector, null ]; 5407 5408 } else { 5409 match = rquickExpr.exec( selector ); 5410 } 5411 5412 // Match html or make sure no context is specified for #id 5413 if ( match && ( match[ 1 ] || !context ) ) { 5414 5415 // HANDLE: $(html) -> $(array) 5416 if ( match[ 1 ] ) { 5417 context = context instanceof jQuery ? context[ 0 ] : context; 5418 5419 // Option to run scripts is true for back-compat 5420 // Intentionally let the error be thrown if parseHTML is not present 5421 jQuery.merge( this, jQuery.parseHTML( 5422 match[ 1 ], 5423 context && context.nodeType ? context.ownerDocument || context : document, 5424 true 5425 ) ); 5426 5427 // HANDLE: $(html, props) 5428 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { 5429 for ( match in context ) { 5430 5431 // Properties of context are called as methods if possible 5432 if ( isFunction( this[ match ] ) ) { 5433 this[ match ]( context[ match ] ); 5434 5435 // ...and otherwise set as attributes 5436 } else { 5437 this.attr( match, context[ match ] ); 5438 } 5439 } 5440 } 5441 5442 return this; 5443 5444 // HANDLE: $(#id) 5445 } else { 5446 elem = document.getElementById( match[ 2 ] ); 5447 5448 if ( elem ) { 5449 5450 // Inject the element directly into the jQuery object 5451 this[ 0 ] = elem; 5452 this.length = 1; 5453 } 5454 return this; 5455 } 5456 5457 // HANDLE: $(expr, $(...)) 5458 } else if ( !context || context.jquery ) { 5459 return ( context || root ).find( selector ); 5460 5461 // HANDLE: $(expr, context) 5462 // (which is just equivalent to: $(context).find(expr) 5463 } else { 5464 return this.constructor( context ).find( selector ); 5465 } 5466 5467 // HANDLE: $(DOMElement) 5468 } else if ( selector.nodeType ) { 5469 this[ 0 ] = selector; 5470 this.length = 1; 5471 return this; 5472 5473 // HANDLE: $(function) 5474 // Shortcut for document ready 5475 } else if ( isFunction( selector ) ) { 5476 return root.ready !== undefined ? 5477 root.ready( selector ) : 5478 5479 // Execute immediately if ready is not present 5480 selector( jQuery ); 5481 } 5482 5483 return jQuery.makeArray( selector, this ); 5484 }; 5485 5486// Give the init function the jQuery prototype for later instantiation 5487init.prototype = jQuery.fn; 5488 5489// Initialize central reference 5490rootjQuery = jQuery( document ); 5491 5492 5493var rparentsprev = /^(?:parents|prev(?:Until|All))/, 5494 5495 // Methods guaranteed to produce a unique set when starting from a unique set 5496 guaranteedUnique = { 5497 children: true, 5498 contents: true, 5499 next: true, 5500 prev: true 5501 }; 5502 5503jQuery.fn.extend( { 5504 has: function( target ) { 5505 var targets = jQuery( target, this ), 5506 l = targets.length; 5507 5508 return this.filter( function() { 5509 var i = 0; 5510 for ( ; i < l; i++ ) { 5511 if ( jQuery.contains( this, targets[ i ] ) ) { 5512 return true; 5513 } 5514 } 5515 } ); 5516 }, 5517 5518 closest: function( selectors, context ) { 5519 var cur, 5520 i = 0, 5521 l = this.length, 5522 matched = [], 5523 targets = typeof selectors !== "string" && jQuery( selectors ); 5524 5525 // Positional selectors never match, since there's no _selection_ context 5526 if ( !rneedsContext.test( selectors ) ) { 5527 for ( ; i < l; i++ ) { 5528 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { 5529 5530 // Always skip document fragments 5531 if ( cur.nodeType < 11 && ( targets ? 5532 targets.index( cur ) > -1 : 5533 5534 // Don't pass non-elements to Sizzle 5535 cur.nodeType === 1 && 5536 jQuery.find.matchesSelector( cur, selectors ) ) ) { 5537 5538 matched.push( cur ); 5539 break; 5540 } 5541 } 5542 } 5543 } 5544 5545 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); 5546 }, 5547 5548 // Determine the position of an element within the set 5549 index: function( elem ) { 5550 5551 // No argument, return index in parent 5552 if ( !elem ) { 5553 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; 5554 } 5555 5556 // Index in selector 5557 if ( typeof elem === "string" ) { 5558 return indexOf.call( jQuery( elem ), this[ 0 ] ); 5559 } 5560 5561 // Locate the position of the desired element 5562 return indexOf.call( this, 5563 5564 // If it receives a jQuery object, the first element is used 5565 elem.jquery ? elem[ 0 ] : elem 5566 ); 5567 }, 5568 5569 add: function( selector, context ) { 5570 return this.pushStack( 5571 jQuery.uniqueSort( 5572 jQuery.merge( this.get(), jQuery( selector, context ) ) 5573 ) 5574 ); 5575 }, 5576 5577 addBack: function( selector ) { 5578 return this.add( selector == null ? 5579 this.prevObject : this.prevObject.filter( selector ) 5580 ); 5581 } 5582} ); 5583 5584function sibling( cur, dir ) { 5585 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} 5586 return cur; 5587} 5588 5589jQuery.each( { 5590 parent: function( elem ) { 5591 var parent = elem.parentNode; 5592 return parent && parent.nodeType !== 11 ? parent : null; 5593 }, 5594 parents: function( elem ) { 5595 return dir( elem, "parentNode" ); 5596 }, 5597 parentsUntil: function( elem, _i, until ) { 5598 return dir( elem, "parentNode", until ); 5599 }, 5600 next: function( elem ) { 5601 return sibling( elem, "nextSibling" ); 5602 }, 5603 prev: function( elem ) { 5604 return sibling( elem, "previousSibling" ); 5605 }, 5606 nextAll: function( elem ) { 5607 return dir( elem, "nextSibling" ); 5608 }, 5609 prevAll: function( elem ) { 5610 return dir( elem, "previousSibling" ); 5611 }, 5612 nextUntil: function( elem, _i, until ) { 5613 return dir( elem, "nextSibling", until ); 5614 }, 5615 prevUntil: function( elem, _i, until ) { 5616 return dir( elem, "previousSibling", until ); 5617 }, 5618 siblings: function( elem ) { 5619 return siblings( ( elem.parentNode || {} ).firstChild, elem ); 5620 }, 5621 children: function( elem ) { 5622 return siblings( elem.firstChild ); 5623 }, 5624 contents: function( elem ) { 5625 if ( elem.contentDocument != null && 5626 5627 // Support: IE 11+ 5628 // <object> elements with no `data` attribute has an object 5629 // `contentDocument` with a `null` prototype. 5630 getProto( elem.contentDocument ) ) { 5631 5632 return elem.contentDocument; 5633 } 5634 5635 // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only 5636 // Treat the template element as a regular one in browsers that 5637 // don't support it. 5638 if ( nodeName( elem, "template" ) ) { 5639 elem = elem.content || elem; 5640 } 5641 5642 return jQuery.merge( [], elem.childNodes ); 5643 } 5644}, function( name, fn ) { 5645 jQuery.fn[ name ] = function( until, selector ) { 5646 var matched = jQuery.map( this, fn, until ); 5647 5648 if ( name.slice( -5 ) !== "Until" ) { 5649 selector = until; 5650 } 5651 5652 if ( selector && typeof selector === "string" ) { 5653 matched = jQuery.filter( selector, matched ); 5654 } 5655 5656 if ( this.length > 1 ) { 5657 5658 // Remove duplicates 5659 if ( !guaranteedUnique[ name ] ) { 5660 jQuery.uniqueSort( matched ); 5661 } 5662 5663 // Reverse order for parents* and prev-derivatives 5664 if ( rparentsprev.test( name ) ) { 5665 matched.reverse(); 5666 } 5667 } 5668 5669 return this.pushStack( matched ); 5670 }; 5671} ); 5672var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); 5673 5674 5675 5676// Convert String-formatted options into Object-formatted ones 5677function createOptions( options ) { 5678 var object = {}; 5679 jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { 5680 object[ flag ] = true; 5681 } ); 5682 return object; 5683} 5684 5685/* 5686 * Create a callback list using the following parameters: 5687 * 5688 * options: an optional list of space-separated options that will change how 5689 * the callback list behaves or a more traditional option object 5690 * 5691 * By default a callback list will act like an event callback list and can be 5692 * "fired" multiple times. 5693 * 5694 * Possible options: 5695 * 5696 * once: will ensure the callback list can only be fired once (like a Deferred) 5697 * 5698 * memory: will keep track of previous values and will call any callback added 5699 * after the list has been fired right away with the latest "memorized" 5700 * values (like a Deferred) 5701 * 5702 * unique: will ensure a callback can only be added once (no duplicate in the list) 5703 * 5704 * stopOnFalse: interrupt callings when a callback returns false 5705 * 5706 */ 5707jQuery.Callbacks = function( options ) { 5708 5709 // Convert options from String-formatted to Object-formatted if needed 5710 // (we check in cache first) 5711 options = typeof options === "string" ? 5712 createOptions( options ) : 5713 jQuery.extend( {}, options ); 5714 5715 var // Flag to know if list is currently firing 5716 firing, 5717 5718 // Last fire value for non-forgettable lists 5719 memory, 5720 5721 // Flag to know if list was already fired 5722 fired, 5723 5724 // Flag to prevent firing 5725 locked, 5726 5727 // Actual callback list 5728 list = [], 5729 5730 // Queue of execution data for repeatable lists 5731 queue = [], 5732 5733 // Index of currently firing callback (modified by add/remove as needed) 5734 firingIndex = -1, 5735 5736 // Fire callbacks 5737 fire = function() { 5738 5739 // Enforce single-firing 5740 locked = locked || options.once; 5741 5742 // Execute callbacks for all pending executions, 5743 // respecting firingIndex overrides and runtime changes 5744 fired = firing = true; 5745 for ( ; queue.length; firingIndex = -1 ) { 5746 memory = queue.shift(); 5747 while ( ++firingIndex < list.length ) { 5748 5749 // Run callback and check for early termination 5750 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && 5751 options.stopOnFalse ) { 5752 5753 // Jump to end and forget the data so .add doesn't re-fire 5754 firingIndex = list.length; 5755 memory = false; 5756 } 5757 } 5758 } 5759 5760 // Forget the data if we're done with it 5761 if ( !options.memory ) { 5762 memory = false; 5763 } 5764 5765 firing = false; 5766 5767 // Clean up if we're done firing for good 5768 if ( locked ) { 5769 5770 // Keep an empty list if we have data for future add calls 5771 if ( memory ) { 5772 list = []; 5773 5774 // Otherwise, this object is spent 5775 } else { 5776 list = ""; 5777 } 5778 } 5779 }, 5780 5781 // Actual Callbacks object 5782 self = { 5783 5784 // Add a callback or a collection of callbacks to the list 5785 add: function() { 5786 if ( list ) { 5787 5788 // If we have memory from a past run, we should fire after adding 5789 if ( memory && !firing ) { 5790 firingIndex = list.length - 1; 5791 queue.push( memory ); 5792 } 5793 5794 ( function add( args ) { 5795 jQuery.each( args, function( _, arg ) { 5796 if ( isFunction( arg ) ) { 5797 if ( !options.unique || !self.has( arg ) ) { 5798 list.push( arg ); 5799 } 5800 } else if ( arg && arg.length && toType( arg ) !== "string" ) { 5801 5802 // Inspect recursively 5803 add( arg ); 5804 } 5805 } ); 5806 } )( arguments ); 5807 5808 if ( memory && !firing ) { 5809 fire(); 5810 } 5811 } 5812 return this; 5813 }, 5814 5815 // Remove a callback from the list 5816 remove: function() { 5817 jQuery.each( arguments, function( _, arg ) { 5818 var index; 5819 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { 5820 list.splice( index, 1 ); 5821 5822 // Handle firing indexes 5823 if ( index <= firingIndex ) { 5824 firingIndex--; 5825 } 5826 } 5827 } ); 5828 return this; 5829 }, 5830 5831 // Check if a given callback is in the list. 5832 // If no argument is given, return whether or not list has callbacks attached. 5833 has: function( fn ) { 5834 return fn ? 5835 jQuery.inArray( fn, list ) > -1 : 5836 list.length > 0; 5837 }, 5838 5839 // Remove all callbacks from the list 5840 empty: function() { 5841 if ( list ) { 5842 list = []; 5843 } 5844 return this; 5845 }, 5846 5847 // Disable .fire and .add 5848 // Abort any current/pending executions 5849 // Clear all callbacks and values 5850 disable: function() { 5851 locked = queue = []; 5852 list = memory = ""; 5853 return this; 5854 }, 5855 disabled: function() { 5856 return !list; 5857 }, 5858 5859 // Disable .fire 5860 // Also disable .add unless we have memory (since it would have no effect) 5861 // Abort any pending executions 5862 lock: function() { 5863 locked = queue = []; 5864 if ( !memory && !firing ) { 5865 list = memory = ""; 5866 } 5867 return this; 5868 }, 5869 locked: function() { 5870 return !!locked; 5871 }, 5872 5873 // Call all callbacks with the given context and arguments 5874 fireWith: function( context, args ) { 5875 if ( !locked ) { 5876 args = args || []; 5877 args = [ context, args.slice ? args.slice() : args ]; 5878 queue.push( args ); 5879 if ( !firing ) { 5880 fire(); 5881 } 5882 } 5883 return this; 5884 }, 5885 5886 // Call all the callbacks with the given arguments 5887 fire: function() { 5888 self.fireWith( this, arguments ); 5889 return this; 5890 }, 5891 5892 // To know if the callbacks have already been called at least once 5893 fired: function() { 5894 return !!fired; 5895 } 5896 }; 5897 5898 return self; 5899}; 5900 5901 5902function Identity( v ) { 5903 return v; 5904} 5905function Thrower( ex ) { 5906 throw ex; 5907} 5908 5909function adoptValue( value, resolve, reject, noValue ) { 5910 var method; 5911 5912 try { 5913 5914 // Check for promise aspect first to privilege synchronous behavior 5915 if ( value && isFunction( ( method = value.promise ) ) ) { 5916 method.call( value ).done( resolve ).fail( reject ); 5917 5918 // Other thenables 5919 } else if ( value && isFunction( ( method = value.then ) ) ) { 5920 method.call( value, resolve, reject ); 5921 5922 // Other non-thenables 5923 } else { 5924 5925 // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: 5926 // * false: [ value ].slice( 0 ) => resolve( value ) 5927 // * true: [ value ].slice( 1 ) => resolve() 5928 resolve.apply( undefined, [ value ].slice( noValue ) ); 5929 } 5930 5931 // For Promises/A+, convert exceptions into rejections 5932 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in 5933 // Deferred#then to conditionally suppress rejection. 5934 } catch ( value ) { 5935 5936 // Support: Android 4.0 only 5937 // Strict mode functions invoked without .call/.apply get global-object context 5938 reject.apply( undefined, [ value ] ); 5939 } 5940} 5941 5942jQuery.extend( { 5943 5944 Deferred: function( func ) { 5945 var tuples = [ 5946 5947 // action, add listener, callbacks, 5948 // ... .then handlers, argument index, [final state] 5949 [ "notify", "progress", jQuery.Callbacks( "memory" ), 5950 jQuery.Callbacks( "memory" ), 2 ], 5951 [ "resolve", "done", jQuery.Callbacks( "once memory" ), 5952 jQuery.Callbacks( "once memory" ), 0, "resolved" ], 5953 [ "reject", "fail", jQuery.Callbacks( "once memory" ), 5954 jQuery.Callbacks( "once memory" ), 1, "rejected" ] 5955 ], 5956 state = "pending", 5957 promise = { 5958 state: function() { 5959 return state; 5960 }, 5961 always: function() { 5962 deferred.done( arguments ).fail( arguments ); 5963 return this; 5964 }, 5965 "catch": function( fn ) { 5966 return promise.then( null, fn ); 5967 }, 5968 5969 // Keep pipe for back-compat 5970 pipe: function( /* fnDone, fnFail, fnProgress */ ) { 5971 var fns = arguments; 5972 5973 return jQuery.Deferred( function( newDefer ) { 5974 jQuery.each( tuples, function( _i, tuple ) { 5975 5976 // Map tuples (progress, done, fail) to arguments (done, fail, progress) 5977 var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; 5978 5979 // deferred.progress(function() { bind to newDefer or newDefer.notify }) 5980 // deferred.done(function() { bind to newDefer or newDefer.resolve }) 5981 // deferred.fail(function() { bind to newDefer or newDefer.reject }) 5982 deferred[ tuple[ 1 ] ]( function() { 5983 var returned = fn && fn.apply( this, arguments ); 5984 if ( returned && isFunction( returned.promise ) ) { 5985 returned.promise() 5986 .progress( newDefer.notify ) 5987 .done( newDefer.resolve ) 5988 .fail( newDefer.reject ); 5989 } else { 5990 newDefer[ tuple[ 0 ] + "With" ]( 5991 this, 5992 fn ? [ returned ] : arguments 5993 ); 5994 } 5995 } ); 5996 } ); 5997 fns = null; 5998 } ).promise(); 5999 }, 6000 then: function( onFulfilled, onRejected, onProgress ) { 6001 var maxDepth = 0; 6002 function resolve( depth, deferred, handler, special ) { 6003 return function() { 6004 var that = this, 6005 args = arguments, 6006 mightThrow = function() { 6007 var returned, then; 6008 6009 // Support: Promises/A+ section 2.3.3.3.3 6010 // https://promisesaplus.com/#point-59 6011 // Ignore double-resolution attempts 6012 if ( depth < maxDepth ) { 6013 return; 6014 } 6015 6016 returned = handler.apply( that, args ); 6017 6018 // Support: Promises/A+ section 2.3.1 6019 // https://promisesaplus.com/#point-48 6020 if ( returned === deferred.promise() ) { 6021 throw new TypeError( "Thenable self-resolution" ); 6022 } 6023 6024 // Support: Promises/A+ sections 2.3.3.1, 3.5 6025 // https://promisesaplus.com/#point-54 6026 // https://promisesaplus.com/#point-75 6027 // Retrieve `then` only once 6028 then = returned && 6029 6030 // Support: Promises/A+ section 2.3.4 6031 // https://promisesaplus.com/#point-64 6032 // Only check objects and functions for thenability 6033 ( typeof returned === "object" || 6034 typeof returned === "function" ) && 6035 returned.then; 6036 6037 // Handle a returned thenable 6038 if ( isFunction( then ) ) { 6039 6040 // Special processors (notify) just wait for resolution 6041 if ( special ) { 6042 then.call( 6043 returned, 6044 resolve( maxDepth, deferred, Identity, special ), 6045 resolve( maxDepth, deferred, Thrower, special ) 6046 ); 6047 6048 // Normal processors (resolve) also hook into progress 6049 } else { 6050 6051 // ...and disregard older resolution values 6052 maxDepth++; 6053 6054 then.call( 6055 returned, 6056 resolve( maxDepth, deferred, Identity, special ), 6057 resolve( maxDepth, deferred, Thrower, special ), 6058 resolve( maxDepth, deferred, Identity, 6059 deferred.notifyWith ) 6060 ); 6061 } 6062 6063 // Handle all other returned values 6064 } else { 6065 6066 // Only substitute handlers pass on context 6067 // and multiple values (non-spec behavior) 6068 if ( handler !== Identity ) { 6069 that = undefined; 6070 args = [ returned ]; 6071 } 6072 6073 // Process the value(s) 6074 // Default process is resolve 6075 ( special || deferred.resolveWith )( that, args ); 6076 } 6077 }, 6078 6079 // Only normal processors (resolve) catch and reject exceptions 6080 process = special ? 6081 mightThrow : 6082 function() { 6083 try { 6084 mightThrow(); 6085 } catch ( e ) { 6086 6087 if ( jQuery.Deferred.exceptionHook ) { 6088 jQuery.Deferred.exceptionHook( e, 6089 process.stackTrace ); 6090 } 6091 6092 // Support: Promises/A+ section 2.3.3.3.4.1 6093 // https://promisesaplus.com/#point-61 6094 // Ignore post-resolution exceptions 6095 if ( depth + 1 >= maxDepth ) { 6096 6097 // Only substitute handlers pass on context 6098 // and multiple values (non-spec behavior) 6099 if ( handler !== Thrower ) { 6100 that = undefined; 6101 args = [ e ]; 6102 } 6103 6104 deferred.rejectWith( that, args ); 6105 } 6106 } 6107 }; 6108 6109 // Support: Promises/A+ section 2.3.3.3.1 6110 // https://promisesaplus.com/#point-57 6111 // Re-resolve promises immediately to dodge false rejection from 6112 // subsequent errors 6113 if ( depth ) { 6114 process(); 6115 } else { 6116 6117 // Call an optional hook to record the stack, in case of exception 6118 // since it's otherwise lost when execution goes async 6119 if ( jQuery.Deferred.getStackHook ) { 6120 process.stackTrace = jQuery.Deferred.getStackHook(); 6121 } 6122 window.setTimeout( process ); 6123 } 6124 }; 6125 } 6126 6127 return jQuery.Deferred( function( newDefer ) { 6128 6129 // progress_handlers.add( ... ) 6130 tuples[ 0 ][ 3 ].add( 6131 resolve( 6132 0, 6133 newDefer, 6134 isFunction( onProgress ) ? 6135 onProgress : 6136 Identity, 6137 newDefer.notifyWith 6138 ) 6139 ); 6140 6141 // fulfilled_handlers.add( ... ) 6142 tuples[ 1 ][ 3 ].add( 6143 resolve( 6144 0, 6145 newDefer, 6146 isFunction( onFulfilled ) ? 6147 onFulfilled : 6148 Identity 6149 ) 6150 ); 6151 6152 // rejected_handlers.add( ... ) 6153 tuples[ 2 ][ 3 ].add( 6154 resolve( 6155 0, 6156 newDefer, 6157 isFunction( onRejected ) ? 6158 onRejected : 6159 Thrower 6160 ) 6161 ); 6162 } ).promise(); 6163 }, 6164 6165 // Get a promise for this deferred 6166 // If obj is provided, the promise aspect is added to the object 6167 promise: function( obj ) { 6168 return obj != null ? jQuery.extend( obj, promise ) : promise; 6169 } 6170 }, 6171 deferred = {}; 6172 6173 // Add list-specific methods 6174 jQuery.each( tuples, function( i, tuple ) { 6175 var list = tuple[ 2 ], 6176 stateString = tuple[ 5 ]; 6177 6178 // promise.progress = list.add 6179 // promise.done = list.add 6180 // promise.fail = list.add 6181 promise[ tuple[ 1 ] ] = list.add; 6182 6183 // Handle state 6184 if ( stateString ) { 6185 list.add( 6186 function() { 6187 6188 // state = "resolved" (i.e., fulfilled) 6189 // state = "rejected" 6190 state = stateString; 6191 }, 6192 6193 // rejected_callbacks.disable 6194 // fulfilled_callbacks.disable 6195 tuples[ 3 - i ][ 2 ].disable, 6196 6197 // rejected_handlers.disable 6198 // fulfilled_handlers.disable 6199 tuples[ 3 - i ][ 3 ].disable, 6200 6201 // progress_callbacks.lock 6202 tuples[ 0 ][ 2 ].lock, 6203 6204 // progress_handlers.lock 6205 tuples[ 0 ][ 3 ].lock 6206 ); 6207 } 6208 6209 // progress_handlers.fire 6210 // fulfilled_handlers.fire 6211 // rejected_handlers.fire 6212 list.add( tuple[ 3 ].fire ); 6213 6214 // deferred.notify = function() { deferred.notifyWith(...) } 6215 // deferred.resolve = function() { deferred.resolveWith(...) } 6216 // deferred.reject = function() { deferred.rejectWith(...) } 6217 deferred[ tuple[ 0 ] ] = function() { 6218 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); 6219 return this; 6220 }; 6221 6222 // deferred.notifyWith = list.fireWith 6223 // deferred.resolveWith = list.fireWith 6224 // deferred.rejectWith = list.fireWith 6225 deferred[ tuple[ 0 ] + "With" ] = list.fireWith; 6226 } ); 6227 6228 // Make the deferred a promise 6229 promise.promise( deferred ); 6230 6231 // Call given func if any 6232 if ( func ) { 6233 func.call( deferred, deferred ); 6234 } 6235 6236 // All done! 6237 return deferred; 6238 }, 6239 6240 // Deferred helper 6241 when: function( singleValue ) { 6242 var 6243 6244 // count of uncompleted subordinates 6245 remaining = arguments.length, 6246 6247 // count of unprocessed arguments 6248 i = remaining, 6249 6250 // subordinate fulfillment data 6251 resolveContexts = Array( i ), 6252 resolveValues = slice.call( arguments ), 6253 6254 // the primary Deferred 6255 primary = jQuery.Deferred(), 6256 6257 // subordinate callback factory 6258 updateFunc = function( i ) { 6259 return function( value ) { 6260 resolveContexts[ i ] = this; 6261 resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; 6262 if ( !( --remaining ) ) { 6263 primary.resolveWith( resolveContexts, resolveValues ); 6264 } 6265 }; 6266 }; 6267 6268 // Single- and empty arguments are adopted like Promise.resolve 6269 if ( remaining <= 1 ) { 6270 adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject, 6271 !remaining ); 6272 6273 // Use .then() to unwrap secondary thenables (cf. gh-3000) 6274 if ( primary.state() === "pending" || 6275 isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { 6276 6277 return primary.then(); 6278 } 6279 } 6280 6281 // Multiple arguments are aggregated like Promise.all array elements 6282 while ( i-- ) { 6283 adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject ); 6284 } 6285 6286 return primary.promise(); 6287 } 6288} ); 6289 6290 6291// These usually indicate a programmer mistake during development, 6292// warn about them ASAP rather than swallowing them by default. 6293var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; 6294 6295jQuery.Deferred.exceptionHook = function( error, stack ) { 6296 6297 // Support: IE 8 - 9 only 6298 // Console exists when dev tools are open, which can happen at any time 6299 if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { 6300 window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); 6301 } 6302}; 6303 6304 6305 6306 6307jQuery.readyException = function( error ) { 6308 window.setTimeout( function() { 6309 throw error; 6310 } ); 6311}; 6312 6313 6314 6315 6316// The deferred used on DOM ready 6317var readyList = jQuery.Deferred(); 6318 6319jQuery.fn.ready = function( fn ) { 6320 6321 readyList 6322 .then( fn ) 6323 6324 // Wrap jQuery.readyException in a function so that the lookup 6325 // happens at the time of error handling instead of callback 6326 // registration. 6327 .catch( function( error ) { 6328 jQuery.readyException( error ); 6329 } ); 6330 6331 return this; 6332}; 6333 6334jQuery.extend( { 6335 6336 // Is the DOM ready to be used? Set to true once it occurs. 6337 isReady: false, 6338 6339 // A counter to track how many items to wait for before 6340 // the ready event fires. See #6781 6341 readyWait: 1, 6342 6343 // Handle when the DOM is ready 6344 ready: function( wait ) { 6345 6346 // Abort if there are pending holds or we're already ready 6347 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { 6348 return; 6349 } 6350 6351 // Remember that the DOM is ready 6352 jQuery.isReady = true; 6353 6354 // If a normal DOM Ready event fired, decrement, and wait if need be 6355 if ( wait !== true && --jQuery.readyWait > 0 ) { 6356 return; 6357 } 6358 6359 // If there are functions bound, to execute 6360 readyList.resolveWith( document, [ jQuery ] ); 6361 } 6362} ); 6363 6364jQuery.ready.then = readyList.then; 6365 6366// The ready event handler and self cleanup method 6367function completed() { 6368 document.removeEventListener( "DOMContentLoaded", completed ); 6369 window.removeEventListener( "load", completed ); 6370 jQuery.ready(); 6371} 6372 6373// Catch cases where $(document).ready() is called 6374// after the browser event has already occurred. 6375// Support: IE <=9 - 10 only 6376// Older IE sometimes signals "interactive" too soon 6377if ( document.readyState === "complete" || 6378 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { 6379 6380 // Handle it asynchronously to allow scripts the opportunity to delay ready 6381 window.setTimeout( jQuery.ready ); 6382 6383} else { 6384 6385 // Use the handy event callback 6386 document.addEventListener( "DOMContentLoaded", completed ); 6387 6388 // A fallback to window.onload, that will always work 6389 window.addEventListener( "load", completed ); 6390} 6391 6392 6393 6394 6395// Multifunctional method to get and set values of a collection 6396// The value/s can optionally be executed if it's a function 6397var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 6398 var i = 0, 6399 len = elems.length, 6400 bulk = key == null; 6401 6402 // Sets many values 6403 if ( toType( key ) === "object" ) { 6404 chainable = true; 6405 for ( i in key ) { 6406 access( elems, fn, i, key[ i ], true, emptyGet, raw ); 6407 } 6408 6409 // Sets one value 6410 } else if ( value !== undefined ) { 6411 chainable = true; 6412 6413 if ( !isFunction( value ) ) { 6414 raw = true; 6415 } 6416 6417 if ( bulk ) { 6418 6419 // Bulk operations run against the entire set 6420 if ( raw ) { 6421 fn.call( elems, value ); 6422 fn = null; 6423 6424 // ...except when executing function values 6425 } else { 6426 bulk = fn; 6427 fn = function( elem, _key, value ) { 6428 return bulk.call( jQuery( elem ), value ); 6429 }; 6430 } 6431 } 6432 6433 if ( fn ) { 6434 for ( ; i < len; i++ ) { 6435 fn( 6436 elems[ i ], key, raw ? 6437 value : 6438 value.call( elems[ i ], i, fn( elems[ i ], key ) ) 6439 ); 6440 } 6441 } 6442 } 6443 6444 if ( chainable ) { 6445 return elems; 6446 } 6447 6448 // Gets 6449 if ( bulk ) { 6450 return fn.call( elems ); 6451 } 6452 6453 return len ? fn( elems[ 0 ], key ) : emptyGet; 6454}; 6455 6456 6457// Matches dashed string for camelizing 6458var rmsPrefix = /^-ms-/, 6459 rdashAlpha = /-([a-z])/g; 6460 6461// Used by camelCase as callback to replace() 6462function fcamelCase( _all, letter ) { 6463 return letter.toUpperCase(); 6464} 6465 6466// Convert dashed to camelCase; used by the css and data modules 6467// Support: IE <=9 - 11, Edge 12 - 15 6468// Microsoft forgot to hump their vendor prefix (#9572) 6469function camelCase( string ) { 6470 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 6471} 6472var acceptData = function( owner ) { 6473 6474 // Accepts only: 6475 // - Node 6476 // - Node.ELEMENT_NODE 6477 // - Node.DOCUMENT_NODE 6478 // - Object 6479 // - Any 6480 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); 6481}; 6482 6483 6484 6485 6486function Data() { 6487 this.expando = jQuery.expando + Data.uid++; 6488} 6489 6490Data.uid = 1; 6491 6492Data.prototype = { 6493 6494 cache: function( owner ) { 6495 6496 // Check if the owner object already has a cache 6497 var value = owner[ this.expando ]; 6498 6499 // If not, create one 6500 if ( !value ) { 6501 value = {}; 6502 6503 // We can accept data for non-element nodes in modern browsers, 6504 // but we should not, see #8335. 6505 // Always return an empty object. 6506 if ( acceptData( owner ) ) { 6507 6508 // If it is a node unlikely to be stringify-ed or looped over 6509 // use plain assignment 6510 if ( owner.nodeType ) { 6511 owner[ this.expando ] = value; 6512 6513 // Otherwise secure it in a non-enumerable property 6514 // configurable must be true to allow the property to be 6515 // deleted when data is removed 6516 } else { 6517 Object.defineProperty( owner, this.expando, { 6518 value: value, 6519 configurable: true 6520 } ); 6521 } 6522 } 6523 } 6524 6525 return value; 6526 }, 6527 set: function( owner, data, value ) { 6528 var prop, 6529 cache = this.cache( owner ); 6530 6531 // Handle: [ owner, key, value ] args 6532 // Always use camelCase key (gh-2257) 6533 if ( typeof data === "string" ) { 6534 cache[ camelCase( data ) ] = value; 6535 6536 // Handle: [ owner, { properties } ] args 6537 } else { 6538 6539 // Copy the properties one-by-one to the cache object 6540 for ( prop in data ) { 6541 cache[ camelCase( prop ) ] = data[ prop ]; 6542 } 6543 } 6544 return cache; 6545 }, 6546 get: function( owner, key ) { 6547 return key === undefined ? 6548 this.cache( owner ) : 6549 6550 // Always use camelCase key (gh-2257) 6551 owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; 6552 }, 6553 access: function( owner, key, value ) { 6554 6555 // In cases where either: 6556 // 6557 // 1. No key was specified 6558 // 2. A string key was specified, but no value provided 6559 // 6560 // Take the "read" path and allow the get method to determine 6561 // which value to return, respectively either: 6562 // 6563 // 1. The entire cache object 6564 // 2. The data stored at the key 6565 // 6566 if ( key === undefined || 6567 ( ( key && typeof key === "string" ) && value === undefined ) ) { 6568 6569 return this.get( owner, key ); 6570 } 6571 6572 // When the key is not a string, or both a key and value 6573 // are specified, set or extend (existing objects) with either: 6574 // 6575 // 1. An object of properties 6576 // 2. A key and value 6577 // 6578 this.set( owner, key, value ); 6579 6580 // Since the "set" path can have two possible entry points 6581 // return the expected data based on which path was taken[*] 6582 return value !== undefined ? value : key; 6583 }, 6584 remove: function( owner, key ) { 6585 var i, 6586 cache = owner[ this.expando ]; 6587 6588 if ( cache === undefined ) { 6589 return; 6590 } 6591 6592 if ( key !== undefined ) { 6593 6594 // Support array or space separated string of keys 6595 if ( Array.isArray( key ) ) { 6596 6597 // If key is an array of keys... 6598 // We always set camelCase keys, so remove that. 6599 key = key.map( camelCase ); 6600 } else { 6601 key = camelCase( key ); 6602 6603 // If a key with the spaces exists, use it. 6604 // Otherwise, create an array by matching non-whitespace 6605 key = key in cache ? 6606 [ key ] : 6607 ( key.match( rnothtmlwhite ) || [] ); 6608 } 6609 6610 i = key.length; 6611 6612 while ( i-- ) { 6613 delete cache[ key[ i ] ]; 6614 } 6615 } 6616 6617 // Remove the expando if there's no more data 6618 if ( key === undefined || jQuery.isEmptyObject( cache ) ) { 6619 6620 // Support: Chrome <=35 - 45 6621 // Webkit & Blink performance suffers when deleting properties 6622 // from DOM nodes, so set to undefined instead 6623 // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) 6624 if ( owner.nodeType ) { 6625 owner[ this.expando ] = undefined; 6626 } else { 6627 delete owner[ this.expando ]; 6628 } 6629 } 6630 }, 6631 hasData: function( owner ) { 6632 var cache = owner[ this.expando ]; 6633 return cache !== undefined && !jQuery.isEmptyObject( cache ); 6634 } 6635}; 6636var dataPriv = new Data(); 6637 6638var dataUser = new Data(); 6639 6640 6641 6642// Implementation Summary 6643// 6644// 1. Enforce API surface and semantic compatibility with 1.9.x branch 6645// 2. Improve the module's maintainability by reducing the storage 6646// paths to a single mechanism. 6647// 3. Use the same single mechanism to support "private" and "user" data. 6648// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) 6649// 5. Avoid exposing implementation details on user objects (eg. expando properties) 6650// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 6651 6652var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 6653 rmultiDash = /[A-Z]/g; 6654 6655function getData( data ) { 6656 if ( data === "true" ) { 6657 return true; 6658 } 6659 6660 if ( data === "false" ) { 6661 return false; 6662 } 6663 6664 if ( data === "null" ) { 6665 return null; 6666 } 6667 6668 // Only convert to a number if it doesn't change the string 6669 if ( data === +data + "" ) { 6670 return +data; 6671 } 6672 6673 if ( rbrace.test( data ) ) { 6674 return JSON.parse( data ); 6675 } 6676 6677 return data; 6678} 6679 6680function dataAttr( elem, key, data ) { 6681 var name; 6682 6683 // If nothing was found internally, try to fetch any 6684 // data from the HTML5 data-* attribute 6685 if ( data === undefined && elem.nodeType === 1 ) { 6686 name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); 6687 data = elem.getAttribute( name ); 6688 6689 if ( typeof data === "string" ) { 6690 try { 6691 data = getData( data ); 6692 } catch ( e ) {} 6693 6694 // Make sure we set the data so it isn't changed later 6695 dataUser.set( elem, key, data ); 6696 } else { 6697 data = undefined; 6698 } 6699 } 6700 return data; 6701} 6702 6703jQuery.extend( { 6704 hasData: function( elem ) { 6705 return dataUser.hasData( elem ) || dataPriv.hasData( elem ); 6706 }, 6707 6708 data: function( elem, name, data ) { 6709 return dataUser.access( elem, name, data ); 6710 }, 6711 6712 removeData: function( elem, name ) { 6713 dataUser.remove( elem, name ); 6714 }, 6715 6716 // TODO: Now that all calls to _data and _removeData have been replaced 6717 // with direct calls to dataPriv methods, these can be deprecated. 6718 _data: function( elem, name, data ) { 6719 return dataPriv.access( elem, name, data ); 6720 }, 6721 6722 _removeData: function( elem, name ) { 6723 dataPriv.remove( elem, name ); 6724 } 6725} ); 6726 6727jQuery.fn.extend( { 6728 data: function( key, value ) { 6729 var i, name, data, 6730 elem = this[ 0 ], 6731 attrs = elem && elem.attributes; 6732 6733 // Gets all values 6734 if ( key === undefined ) { 6735 if ( this.length ) { 6736 data = dataUser.get( elem ); 6737 6738 if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { 6739 i = attrs.length; 6740 while ( i-- ) { 6741 6742 // Support: IE 11 only 6743 // The attrs elements can be null (#14894) 6744 if ( attrs[ i ] ) { 6745 name = attrs[ i ].name; 6746 if ( name.indexOf( "data-" ) === 0 ) { 6747 name = camelCase( name.slice( 5 ) ); 6748 dataAttr( elem, name, data[ name ] ); 6749 } 6750 } 6751 } 6752 dataPriv.set( elem, "hasDataAttrs", true ); 6753 } 6754 } 6755 6756 return data; 6757 } 6758 6759 // Sets multiple values 6760 if ( typeof key === "object" ) { 6761 return this.each( function() { 6762 dataUser.set( this, key ); 6763 } ); 6764 } 6765 6766 return access( this, function( value ) { 6767 var data; 6768 6769 // The calling jQuery object (element matches) is not empty 6770 // (and therefore has an element appears at this[ 0 ]) and the 6771 // `value` parameter was not undefined. An empty jQuery object 6772 // will result in `undefined` for elem = this[ 0 ] which will 6773 // throw an exception if an attempt to read a data cache is made. 6774 if ( elem && value === undefined ) { 6775 6776 // Attempt to get data from the cache 6777 // The key will always be camelCased in Data 6778 data = dataUser.get( elem, key ); 6779 if ( data !== undefined ) { 6780 return data; 6781 } 6782 6783 // Attempt to "discover" the data in 6784 // HTML5 custom data-* attrs 6785 data = dataAttr( elem, key ); 6786 if ( data !== undefined ) { 6787 return data; 6788 } 6789 6790 // We tried really hard, but the data doesn't exist. 6791 return; 6792 } 6793 6794 // Set the data... 6795 this.each( function() { 6796 6797 // We always store the camelCased key 6798 dataUser.set( this, key, value ); 6799 } ); 6800 }, null, value, arguments.length > 1, null, true ); 6801 }, 6802 6803 removeData: function( key ) { 6804 return this.each( function() { 6805 dataUser.remove( this, key ); 6806 } ); 6807 } 6808} ); 6809 6810 6811jQuery.extend( { 6812 queue: function( elem, type, data ) { 6813 var queue; 6814 6815 if ( elem ) { 6816 type = ( type || "fx" ) + "queue"; 6817 queue = dataPriv.get( elem, type ); 6818 6819 // Speed up dequeue by getting out quickly if this is just a lookup 6820 if ( data ) { 6821 if ( !queue || Array.isArray( data ) ) { 6822 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); 6823 } else { 6824 queue.push( data ); 6825 } 6826 } 6827 return queue || []; 6828 } 6829 }, 6830 6831 dequeue: function( elem, type ) { 6832 type = type || "fx"; 6833 6834 var queue = jQuery.queue( elem, type ), 6835 startLength = queue.length, 6836 fn = queue.shift(), 6837 hooks = jQuery._queueHooks( elem, type ), 6838 next = function() { 6839 jQuery.dequeue( elem, type ); 6840 }; 6841 6842 // If the fx queue is dequeued, always remove the progress sentinel 6843 if ( fn === "inprogress" ) { 6844 fn = queue.shift(); 6845 startLength--; 6846 } 6847 6848 if ( fn ) { 6849 6850 // Add a progress sentinel to prevent the fx queue from being 6851 // automatically dequeued 6852 if ( type === "fx" ) { 6853 queue.unshift( "inprogress" ); 6854 } 6855 6856 // Clear up the last queue stop function 6857 delete hooks.stop; 6858 fn.call( elem, next, hooks ); 6859 } 6860 6861 if ( !startLength && hooks ) { 6862 hooks.empty.fire(); 6863 } 6864 }, 6865 6866 // Not public - generate a queueHooks object, or return the current one 6867 _queueHooks: function( elem, type ) { 6868 var key = type + "queueHooks"; 6869 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { 6870 empty: jQuery.Callbacks( "once memory" ).add( function() { 6871 dataPriv.remove( elem, [ type + "queue", key ] ); 6872 } ) 6873 } ); 6874 } 6875} ); 6876 6877jQuery.fn.extend( { 6878 queue: function( type, data ) { 6879 var setter = 2; 6880 6881 if ( typeof type !== "string" ) { 6882 data = type; 6883 type = "fx"; 6884 setter--; 6885 } 6886 6887 if ( arguments.length < setter ) { 6888 return jQuery.queue( this[ 0 ], type ); 6889 } 6890 6891 return data === undefined ? 6892 this : 6893 this.each( function() { 6894 var queue = jQuery.queue( this, type, data ); 6895 6896 // Ensure a hooks for this queue 6897 jQuery._queueHooks( this, type ); 6898 6899 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { 6900 jQuery.dequeue( this, type ); 6901 } 6902 } ); 6903 }, 6904 dequeue: function( type ) { 6905 return this.each( function() { 6906 jQuery.dequeue( this, type ); 6907 } ); 6908 }, 6909 clearQueue: function( type ) { 6910 return this.queue( type || "fx", [] ); 6911 }, 6912 6913 // Get a promise resolved when queues of a certain type 6914 // are emptied (fx is the type by default) 6915 promise: function( type, obj ) { 6916 var tmp, 6917 count = 1, 6918 defer = jQuery.Deferred(), 6919 elements = this, 6920 i = this.length, 6921 resolve = function() { 6922 if ( !( --count ) ) { 6923 defer.resolveWith( elements, [ elements ] ); 6924 } 6925 }; 6926 6927 if ( typeof type !== "string" ) { 6928 obj = type; 6929 type = undefined; 6930 } 6931 type = type || "fx"; 6932 6933 while ( i-- ) { 6934 tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); 6935 if ( tmp && tmp.empty ) { 6936 count++; 6937 tmp.empty.add( resolve ); 6938 } 6939 } 6940 resolve(); 6941 return defer.promise( obj ); 6942 } 6943} ); 6944var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; 6945 6946var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); 6947 6948 6949var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; 6950 6951var documentElement = document.documentElement; 6952 6953 6954 6955 var isAttached = function( elem ) { 6956 return jQuery.contains( elem.ownerDocument, elem ); 6957 }, 6958 composed = { composed: true }; 6959 6960 // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only 6961 // Check attachment across shadow DOM boundaries when possible (gh-3504) 6962 // Support: iOS 10.0-10.2 only 6963 // Early iOS 10 versions support `attachShadow` but not `getRootNode`, 6964 // leading to errors. We need to check for `getRootNode`. 6965 if ( documentElement.getRootNode ) { 6966 isAttached = function( elem ) { 6967 return jQuery.contains( elem.ownerDocument, elem ) || 6968 elem.getRootNode( composed ) === elem.ownerDocument; 6969 }; 6970 } 6971var isHiddenWithinTree = function( elem, el ) { 6972 6973 // isHiddenWithinTree might be called from jQuery#filter function; 6974 // in that case, element will be second argument 6975 elem = el || elem; 6976 6977 // Inline style trumps all 6978 return elem.style.display === "none" || 6979 elem.style.display === "" && 6980 6981 // Otherwise, check computed style 6982 // Support: Firefox <=43 - 45 6983 // Disconnected elements can have computed display: none, so first confirm that elem is 6984 // in the document. 6985 isAttached( elem ) && 6986 6987 jQuery.css( elem, "display" ) === "none"; 6988 }; 6989 6990 6991 6992function adjustCSS( elem, prop, valueParts, tween ) { 6993 var adjusted, scale, 6994 maxIterations = 20, 6995 currentValue = tween ? 6996 function() { 6997 return tween.cur(); 6998 } : 6999 function() { 7000 return jQuery.css( elem, prop, "" ); 7001 }, 7002 initial = currentValue(), 7003 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), 7004 7005 // Starting value computation is required for potential unit mismatches 7006 initialInUnit = elem.nodeType && 7007 ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && 7008 rcssNum.exec( jQuery.css( elem, prop ) ); 7009 7010 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { 7011 7012 // Support: Firefox <=54 7013 // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) 7014 initial = initial / 2; 7015 7016 // Trust units reported by jQuery.css 7017 unit = unit || initialInUnit[ 3 ]; 7018 7019 // Iteratively approximate from a nonzero starting point 7020 initialInUnit = +initial || 1; 7021 7022 while ( maxIterations-- ) { 7023 7024 // Evaluate and update our best guess (doubling guesses that zero out). 7025 // Finish if the scale equals or crosses 1 (making the old*new product non-positive). 7026 jQuery.style( elem, prop, initialInUnit + unit ); 7027 if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { 7028 maxIterations = 0; 7029 } 7030 initialInUnit = initialInUnit / scale; 7031 7032 } 7033 7034 initialInUnit = initialInUnit * 2; 7035 jQuery.style( elem, prop, initialInUnit + unit ); 7036 7037 // Make sure we update the tween properties later on 7038 valueParts = valueParts || []; 7039 } 7040 7041 if ( valueParts ) { 7042 initialInUnit = +initialInUnit || +initial || 0; 7043 7044 // Apply relative offset (+=/-=) if specified 7045 adjusted = valueParts[ 1 ] ? 7046 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : 7047 +valueParts[ 2 ]; 7048 if ( tween ) { 7049 tween.unit = unit; 7050 tween.start = initialInUnit; 7051 tween.end = adjusted; 7052 } 7053 } 7054 return adjusted; 7055} 7056 7057 7058var defaultDisplayMap = {}; 7059 7060function getDefaultDisplay( elem ) { 7061 var temp, 7062 doc = elem.ownerDocument, 7063 nodeName = elem.nodeName, 7064 display = defaultDisplayMap[ nodeName ]; 7065 7066 if ( display ) { 7067 return display; 7068 } 7069 7070 temp = doc.body.appendChild( doc.createElement( nodeName ) ); 7071 display = jQuery.css( temp, "display" ); 7072 7073 temp.parentNode.removeChild( temp ); 7074 7075 if ( display === "none" ) { 7076 display = "block"; 7077 } 7078 defaultDisplayMap[ nodeName ] = display; 7079 7080 return display; 7081} 7082 7083function showHide( elements, show ) { 7084 var display, elem, 7085 values = [], 7086 index = 0, 7087 length = elements.length; 7088 7089 // Determine new display value for elements that need to change 7090 for ( ; index < length; index++ ) { 7091 elem = elements[ index ]; 7092 if ( !elem.style ) { 7093 continue; 7094 } 7095 7096 display = elem.style.display; 7097 if ( show ) { 7098 7099 // Since we force visibility upon cascade-hidden elements, an immediate (and slow) 7100 // check is required in this first loop unless we have a nonempty display value (either 7101 // inline or about-to-be-restored) 7102 if ( display === "none" ) { 7103 values[ index ] = dataPriv.get( elem, "display" ) || null; 7104 if ( !values[ index ] ) { 7105 elem.style.display = ""; 7106 } 7107 } 7108 if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { 7109 values[ index ] = getDefaultDisplay( elem ); 7110 } 7111 } else { 7112 if ( display !== "none" ) { 7113 values[ index ] = "none"; 7114 7115 // Remember what we're overwriting 7116 dataPriv.set( elem, "display", display ); 7117 } 7118 } 7119 } 7120 7121 // Set the display of the elements in a second loop to avoid constant reflow 7122 for ( index = 0; index < length; index++ ) { 7123 if ( values[ index ] != null ) { 7124 elements[ index ].style.display = values[ index ]; 7125 } 7126 } 7127 7128 return elements; 7129} 7130 7131jQuery.fn.extend( { 7132 show: function() { 7133 return showHide( this, true ); 7134 }, 7135 hide: function() { 7136 return showHide( this ); 7137 }, 7138 toggle: function( state ) { 7139 if ( typeof state === "boolean" ) { 7140 return state ? this.show() : this.hide(); 7141 } 7142 7143 return this.each( function() { 7144 if ( isHiddenWithinTree( this ) ) { 7145 jQuery( this ).show(); 7146 } else { 7147 jQuery( this ).hide(); 7148 } 7149 } ); 7150 } 7151} ); 7152var rcheckableType = ( /^(?:checkbox|radio)$/i ); 7153 7154var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); 7155 7156var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); 7157 7158 7159 7160( function() { 7161 var fragment = document.createDocumentFragment(), 7162 div = fragment.appendChild( document.createElement( "div" ) ), 7163 input = document.createElement( "input" ); 7164 7165 // Support: Android 4.0 - 4.3 only 7166 // Check state lost if the name is set (#11217) 7167 // Support: Windows Web Apps (WWA) 7168 // `name` and `type` must use .setAttribute for WWA (#14901) 7169 input.setAttribute( "type", "radio" ); 7170 input.setAttribute( "checked", "checked" ); 7171 input.setAttribute( "name", "t" ); 7172 7173 div.appendChild( input ); 7174 7175 // Support: Android <=4.1 only 7176 // Older WebKit doesn't clone checked state correctly in fragments 7177 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; 7178 7179 // Support: IE <=11 only 7180 // Make sure textarea (and checkbox) defaultValue is properly cloned 7181 div.innerHTML = "<textarea>x</textarea>"; 7182 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 7183 7184 // Support: IE <=9 only 7185 // IE <=9 replaces <option> tags with their contents when inserted outside of 7186 // the select element. 7187 div.innerHTML = "<option></option>"; 7188 support.option = !!div.lastChild; 7189} )(); 7190 7191 7192// We have to close these tags to support XHTML (#13200) 7193var wrapMap = { 7194 7195 // XHTML parsers do not magically insert elements in the 7196 // same way that tag soup parsers do. So we cannot shorten 7197 // this by omitting <tbody> or other required elements. 7198 thead: [ 1, "<table>", "</table>" ], 7199 col: [ 2, "<table><colgroup>", "</colgroup></table>" ], 7200 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 7201 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 7202 7203 _default: [ 0, "", "" ] 7204}; 7205 7206wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 7207wrapMap.th = wrapMap.td; 7208 7209// Support: IE <=9 only 7210if ( !support.option ) { 7211 wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ]; 7212} 7213 7214 7215function getAll( context, tag ) { 7216 7217 // Support: IE <=9 - 11 only 7218 // Use typeof to avoid zero-argument method invocation on host objects (#15151) 7219 var ret; 7220 7221 if ( typeof context.getElementsByTagName !== "undefined" ) { 7222 ret = context.getElementsByTagName( tag || "*" ); 7223 7224 } else if ( typeof context.querySelectorAll !== "undefined" ) { 7225 ret = context.querySelectorAll( tag || "*" ); 7226 7227 } else { 7228 ret = []; 7229 } 7230 7231 if ( tag === undefined || tag && nodeName( context, tag ) ) { 7232 return jQuery.merge( [ context ], ret ); 7233 } 7234 7235 return ret; 7236} 7237 7238 7239// Mark scripts as having already been evaluated 7240function setGlobalEval( elems, refElements ) { 7241 var i = 0, 7242 l = elems.length; 7243 7244 for ( ; i < l; i++ ) { 7245 dataPriv.set( 7246 elems[ i ], 7247 "globalEval", 7248 !refElements || dataPriv.get( refElements[ i ], "globalEval" ) 7249 ); 7250 } 7251} 7252 7253 7254var rhtml = /<|&#?\w+;/; 7255 7256function buildFragment( elems, context, scripts, selection, ignored ) { 7257 var elem, tmp, tag, wrap, attached, j, 7258 fragment = context.createDocumentFragment(), 7259 nodes = [], 7260 i = 0, 7261 l = elems.length; 7262 7263 for ( ; i < l; i++ ) { 7264 elem = elems[ i ]; 7265 7266 if ( elem || elem === 0 ) { 7267 7268 // Add nodes directly 7269 if ( toType( elem ) === "object" ) { 7270 7271 // Support: Android <=4.0 only, PhantomJS 1 only 7272 // push.apply(_, arraylike) throws on ancient WebKit 7273 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 7274 7275 // Convert non-html into a text node 7276 } else if ( !rhtml.test( elem ) ) { 7277 nodes.push( context.createTextNode( elem ) ); 7278 7279 // Convert html into DOM nodes 7280 } else { 7281 tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); 7282 7283 // Deserialize a standard representation 7284 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); 7285 wrap = wrapMap[ tag ] || wrapMap._default; 7286 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; 7287 7288 // Descend through wrappers to the right content 7289 j = wrap[ 0 ]; 7290 while ( j-- ) { 7291 tmp = tmp.lastChild; 7292 } 7293 7294 // Support: Android <=4.0 only, PhantomJS 1 only 7295 // push.apply(_, arraylike) throws on ancient WebKit 7296 jQuery.merge( nodes, tmp.childNodes ); 7297 7298 // Remember the top-level container 7299 tmp = fragment.firstChild; 7300 7301 // Ensure the created nodes are orphaned (#12392) 7302 tmp.textContent = ""; 7303 } 7304 } 7305 } 7306 7307 // Remove wrapper from fragment 7308 fragment.textContent = ""; 7309 7310 i = 0; 7311 while ( ( elem = nodes[ i++ ] ) ) { 7312 7313 // Skip elements already in the context collection (trac-4087) 7314 if ( selection && jQuery.inArray( elem, selection ) > -1 ) { 7315 if ( ignored ) { 7316 ignored.push( elem ); 7317 } 7318 continue; 7319 } 7320 7321 attached = isAttached( elem ); 7322 7323 // Append to fragment 7324 tmp = getAll( fragment.appendChild( elem ), "script" ); 7325 7326 // Preserve script evaluation history 7327 if ( attached ) { 7328 setGlobalEval( tmp ); 7329 } 7330 7331 // Capture executables 7332 if ( scripts ) { 7333 j = 0; 7334 while ( ( elem = tmp[ j++ ] ) ) { 7335 if ( rscriptType.test( elem.type || "" ) ) { 7336 scripts.push( elem ); 7337 } 7338 } 7339 } 7340 } 7341 7342 return fragment; 7343} 7344 7345 7346var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 7347 7348function returnTrue() { 7349 return true; 7350} 7351 7352function returnFalse() { 7353 return false; 7354} 7355 7356// Support: IE <=9 - 11+ 7357// focus() and blur() are asynchronous, except when they are no-op. 7358// So expect focus to be synchronous when the element is already active, 7359// and blur to be synchronous when the element is not already active. 7360// (focus and blur are always synchronous in other supported browsers, 7361// this just defines when we can count on it). 7362function expectSync( elem, type ) { 7363 return ( elem === safeActiveElement() ) === ( type === "focus" ); 7364} 7365 7366// Support: IE <=9 only 7367// Accessing document.activeElement can throw unexpectedly 7368// https://bugs.jquery.com/ticket/13393 7369function safeActiveElement() { 7370 try { 7371 return document.activeElement; 7372 } catch ( err ) { } 7373} 7374 7375function on( elem, types, selector, data, fn, one ) { 7376 var origFn, type; 7377 7378 // Types can be a map of types/handlers 7379 if ( typeof types === "object" ) { 7380 7381 // ( types-Object, selector, data ) 7382 if ( typeof selector !== "string" ) { 7383 7384 // ( types-Object, data ) 7385 data = data || selector; 7386 selector = undefined; 7387 } 7388 for ( type in types ) { 7389 on( elem, type, selector, data, types[ type ], one ); 7390 } 7391 return elem; 7392 } 7393 7394 if ( data == null && fn == null ) { 7395 7396 // ( types, fn ) 7397 fn = selector; 7398 data = selector = undefined; 7399 } else if ( fn == null ) { 7400 if ( typeof selector === "string" ) { 7401 7402 // ( types, selector, fn ) 7403 fn = data; 7404 data = undefined; 7405 } else { 7406 7407 // ( types, data, fn ) 7408 fn = data; 7409 data = selector; 7410 selector = undefined; 7411 } 7412 } 7413 if ( fn === false ) { 7414 fn = returnFalse; 7415 } else if ( !fn ) { 7416 return elem; 7417 } 7418 7419 if ( one === 1 ) { 7420 origFn = fn; 7421 fn = function( event ) { 7422 7423 // Can use an empty set, since event contains the info 7424 jQuery().off( event ); 7425 return origFn.apply( this, arguments ); 7426 }; 7427 7428 // Use same guid so caller can remove using origFn 7429 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); 7430 } 7431 return elem.each( function() { 7432 jQuery.event.add( this, types, fn, data, selector ); 7433 } ); 7434} 7435 7436/* 7437 * Helper functions for managing events -- not part of the public interface. 7438 * Props to Dean Edwards' addEvent library for many of the ideas. 7439 */ 7440jQuery.event = { 7441 7442 global: {}, 7443 7444 add: function( elem, types, handler, data, selector ) { 7445 7446 var handleObjIn, eventHandle, tmp, 7447 events, t, handleObj, 7448 special, handlers, type, namespaces, origType, 7449 elemData = dataPriv.get( elem ); 7450 7451 // Only attach events to objects that accept data 7452 if ( !acceptData( elem ) ) { 7453 return; 7454 } 7455 7456 // Caller can pass in an object of custom data in lieu of the handler 7457 if ( handler.handler ) { 7458 handleObjIn = handler; 7459 handler = handleObjIn.handler; 7460 selector = handleObjIn.selector; 7461 } 7462 7463 // Ensure that invalid selectors throw exceptions at attach time 7464 // Evaluate against documentElement in case elem is a non-element node (e.g., document) 7465 if ( selector ) { 7466 jQuery.find.matchesSelector( documentElement, selector ); 7467 } 7468 7469 // Make sure that the handler has a unique ID, used to find/remove it later 7470 if ( !handler.guid ) { 7471 handler.guid = jQuery.guid++; 7472 } 7473 7474 // Init the element's event structure and main handler, if this is the first 7475 if ( !( events = elemData.events ) ) { 7476 events = elemData.events = Object.create( null ); 7477 } 7478 if ( !( eventHandle = elemData.handle ) ) { 7479 eventHandle = elemData.handle = function( e ) { 7480 7481 // Discard the second event of a jQuery.event.trigger() and 7482 // when an event is called after a page has unloaded 7483 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? 7484 jQuery.event.dispatch.apply( elem, arguments ) : undefined; 7485 }; 7486 } 7487 7488 // Handle multiple events separated by a space 7489 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 7490 t = types.length; 7491 while ( t-- ) { 7492 tmp = rtypenamespace.exec( types[ t ] ) || []; 7493 type = origType = tmp[ 1 ]; 7494 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 7495 7496 // There *must* be a type, no attaching namespace-only handlers 7497 if ( !type ) { 7498 continue; 7499 } 7500 7501 // If event changes its type, use the special event handlers for the changed type 7502 special = jQuery.event.special[ type ] || {}; 7503 7504 // If selector defined, determine special event api type, otherwise given type 7505 type = ( selector ? special.delegateType : special.bindType ) || type; 7506 7507 // Update special based on newly reset type 7508 special = jQuery.event.special[ type ] || {}; 7509 7510 // handleObj is passed to all event handlers 7511 handleObj = jQuery.extend( { 7512 type: type, 7513 origType: origType, 7514 data: data, 7515 handler: handler, 7516 guid: handler.guid, 7517 selector: selector, 7518 needsContext: selector && jQuery.expr.match.needsContext.test( selector ), 7519 namespace: namespaces.join( "." ) 7520 }, handleObjIn ); 7521 7522 // Init the event handler queue if we're the first 7523 if ( !( handlers = events[ type ] ) ) { 7524 handlers = events[ type ] = []; 7525 handlers.delegateCount = 0; 7526 7527 // Only use addEventListener if the special events handler returns false 7528 if ( !special.setup || 7529 special.setup.call( elem, data, namespaces, eventHandle ) === false ) { 7530 7531 if ( elem.addEventListener ) { 7532 elem.addEventListener( type, eventHandle ); 7533 } 7534 } 7535 } 7536 7537 if ( special.add ) { 7538 special.add.call( elem, handleObj ); 7539 7540 if ( !handleObj.handler.guid ) { 7541 handleObj.handler.guid = handler.guid; 7542 } 7543 } 7544 7545 // Add to the element's handler list, delegates in front 7546 if ( selector ) { 7547 handlers.splice( handlers.delegateCount++, 0, handleObj ); 7548 } else { 7549 handlers.push( handleObj ); 7550 } 7551 7552 // Keep track of which events have ever been used, for event optimization 7553 jQuery.event.global[ type ] = true; 7554 } 7555 7556 }, 7557 7558 // Detach an event or set of events from an element 7559 remove: function( elem, types, handler, selector, mappedTypes ) { 7560 7561 var j, origCount, tmp, 7562 events, t, handleObj, 7563 special, handlers, type, namespaces, origType, 7564 elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); 7565 7566 if ( !elemData || !( events = elemData.events ) ) { 7567 return; 7568 } 7569 7570 // Once for each type.namespace in types; type may be omitted 7571 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 7572 t = types.length; 7573 while ( t-- ) { 7574 tmp = rtypenamespace.exec( types[ t ] ) || []; 7575 type = origType = tmp[ 1 ]; 7576 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 7577 7578 // Unbind all events (on this namespace, if provided) for the element 7579 if ( !type ) { 7580 for ( type in events ) { 7581 jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); 7582 } 7583 continue; 7584 } 7585 7586 special = jQuery.event.special[ type ] || {}; 7587 type = ( selector ? special.delegateType : special.bindType ) || type; 7588 handlers = events[ type ] || []; 7589 tmp = tmp[ 2 ] && 7590 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); 7591 7592 // Remove matching events 7593 origCount = j = handlers.length; 7594 while ( j-- ) { 7595 handleObj = handlers[ j ]; 7596 7597 if ( ( mappedTypes || origType === handleObj.origType ) && 7598 ( !handler || handler.guid === handleObj.guid ) && 7599 ( !tmp || tmp.test( handleObj.namespace ) ) && 7600 ( !selector || selector === handleObj.selector || 7601 selector === "**" && handleObj.selector ) ) { 7602 handlers.splice( j, 1 ); 7603 7604 if ( handleObj.selector ) { 7605 handlers.delegateCount--; 7606 } 7607 if ( special.remove ) { 7608 special.remove.call( elem, handleObj ); 7609 } 7610 } 7611 } 7612 7613 // Remove generic event handler if we removed something and no more handlers exist 7614 // (avoids potential for endless recursion during removal of special event handlers) 7615 if ( origCount && !handlers.length ) { 7616 if ( !special.teardown || 7617 special.teardown.call( elem, namespaces, elemData.handle ) === false ) { 7618 7619 jQuery.removeEvent( elem, type, elemData.handle ); 7620 } 7621 7622 delete events[ type ]; 7623 } 7624 } 7625 7626 // Remove data and the expando if it's no longer used 7627 if ( jQuery.isEmptyObject( events ) ) { 7628 dataPriv.remove( elem, "handle events" ); 7629 } 7630 }, 7631 7632 dispatch: function( nativeEvent ) { 7633 7634 var i, j, ret, matched, handleObj, handlerQueue, 7635 args = new Array( arguments.length ), 7636 7637 // Make a writable jQuery.Event from the native event object 7638 event = jQuery.event.fix( nativeEvent ), 7639 7640 handlers = ( 7641 dataPriv.get( this, "events" ) || Object.create( null ) 7642 )[ event.type ] || [], 7643 special = jQuery.event.special[ event.type ] || {}; 7644 7645 // Use the fix-ed jQuery.Event rather than the (read-only) native event 7646 args[ 0 ] = event; 7647 7648 for ( i = 1; i < arguments.length; i++ ) { 7649 args[ i ] = arguments[ i ]; 7650 } 7651 7652 event.delegateTarget = this; 7653 7654 // Call the preDispatch hook for the mapped type, and let it bail if desired 7655 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { 7656 return; 7657 } 7658 7659 // Determine handlers 7660 handlerQueue = jQuery.event.handlers.call( this, event, handlers ); 7661 7662 // Run delegates first; they may want to stop propagation beneath us 7663 i = 0; 7664 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { 7665 event.currentTarget = matched.elem; 7666 7667 j = 0; 7668 while ( ( handleObj = matched.handlers[ j++ ] ) && 7669 !event.isImmediatePropagationStopped() ) { 7670 7671 // If the event is namespaced, then each handler is only invoked if it is 7672 // specially universal or its namespaces are a superset of the event's. 7673 if ( !event.rnamespace || handleObj.namespace === false || 7674 event.rnamespace.test( handleObj.namespace ) ) { 7675 7676 event.handleObj = handleObj; 7677 event.data = handleObj.data; 7678 7679 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || 7680 handleObj.handler ).apply( matched.elem, args ); 7681 7682 if ( ret !== undefined ) { 7683 if ( ( event.result = ret ) === false ) { 7684 event.preventDefault(); 7685 event.stopPropagation(); 7686 } 7687 } 7688 } 7689 } 7690 } 7691 7692 // Call the postDispatch hook for the mapped type 7693 if ( special.postDispatch ) { 7694 special.postDispatch.call( this, event ); 7695 } 7696 7697 return event.result; 7698 }, 7699 7700 handlers: function( event, handlers ) { 7701 var i, handleObj, sel, matchedHandlers, matchedSelectors, 7702 handlerQueue = [], 7703 delegateCount = handlers.delegateCount, 7704 cur = event.target; 7705 7706 // Find delegate handlers 7707 if ( delegateCount && 7708 7709 // Support: IE <=9 7710 // Black-hole SVG <use> instance trees (trac-13180) 7711 cur.nodeType && 7712 7713 // Support: Firefox <=42 7714 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) 7715 // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click 7716 // Support: IE 11 only 7717 // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) 7718 !( event.type === "click" && event.button >= 1 ) ) { 7719 7720 for ( ; cur !== this; cur = cur.parentNode || this ) { 7721 7722 // Don't check non-elements (#13208) 7723 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) 7724 if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { 7725 matchedHandlers = []; 7726 matchedSelectors = {}; 7727 for ( i = 0; i < delegateCount; i++ ) { 7728 handleObj = handlers[ i ]; 7729 7730 // Don't conflict with Object.prototype properties (#13203) 7731 sel = handleObj.selector + " "; 7732 7733 if ( matchedSelectors[ sel ] === undefined ) { 7734 matchedSelectors[ sel ] = handleObj.needsContext ? 7735 jQuery( sel, this ).index( cur ) > -1 : 7736 jQuery.find( sel, this, null, [ cur ] ).length; 7737 } 7738 if ( matchedSelectors[ sel ] ) { 7739 matchedHandlers.push( handleObj ); 7740 } 7741 } 7742 if ( matchedHandlers.length ) { 7743 handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); 7744 } 7745 } 7746 } 7747 } 7748 7749 // Add the remaining (directly-bound) handlers 7750 cur = this; 7751 if ( delegateCount < handlers.length ) { 7752 handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); 7753 } 7754 7755 return handlerQueue; 7756 }, 7757 7758 addProp: function( name, hook ) { 7759 Object.defineProperty( jQuery.Event.prototype, name, { 7760 enumerable: true, 7761 configurable: true, 7762 7763 get: isFunction( hook ) ? 7764 function() { 7765 if ( this.originalEvent ) { 7766 return hook( this.originalEvent ); 7767 } 7768 } : 7769 function() { 7770 if ( this.originalEvent ) { 7771 return this.originalEvent[ name ]; 7772 } 7773 }, 7774 7775 set: function( value ) { 7776 Object.defineProperty( this, name, { 7777 enumerable: true, 7778 configurable: true, 7779 writable: true, 7780 value: value 7781 } ); 7782 } 7783 } ); 7784 }, 7785 7786 fix: function( originalEvent ) { 7787 return originalEvent[ jQuery.expando ] ? 7788 originalEvent : 7789 new jQuery.Event( originalEvent ); 7790 }, 7791 7792 special: { 7793 load: { 7794 7795 // Prevent triggered image.load events from bubbling to window.load 7796 noBubble: true 7797 }, 7798 click: { 7799 7800 // Utilize native event to ensure correct state for checkable inputs 7801 setup: function( data ) { 7802 7803 // For mutual compressibility with _default, replace `this` access with a local var. 7804 // `|| data` is dead code meant only to preserve the variable through minification. 7805 var el = this || data; 7806 7807 // Claim the first handler 7808 if ( rcheckableType.test( el.type ) && 7809 el.click && nodeName( el, "input" ) ) { 7810 7811 // dataPriv.set( el, "click", ... ) 7812 leverageNative( el, "click", returnTrue ); 7813 } 7814 7815 // Return false to allow normal processing in the caller 7816 return false; 7817 }, 7818 trigger: function( data ) { 7819 7820 // For mutual compressibility with _default, replace `this` access with a local var. 7821 // `|| data` is dead code meant only to preserve the variable through minification. 7822 var el = this || data; 7823 7824 // Force setup before triggering a click 7825 if ( rcheckableType.test( el.type ) && 7826 el.click && nodeName( el, "input" ) ) { 7827 7828 leverageNative( el, "click" ); 7829 } 7830 7831 // Return non-false to allow normal event-path propagation 7832 return true; 7833 }, 7834 7835 // For cross-browser consistency, suppress native .click() on links 7836 // Also prevent it if we're currently inside a leveraged native-event stack 7837 _default: function( event ) { 7838 var target = event.target; 7839 return rcheckableType.test( target.type ) && 7840 target.click && nodeName( target, "input" ) && 7841 dataPriv.get( target, "click" ) || 7842 nodeName( target, "a" ); 7843 } 7844 }, 7845 7846 beforeunload: { 7847 postDispatch: function( event ) { 7848 7849 // Support: Firefox 20+ 7850 // Firefox doesn't alert if the returnValue field is not set. 7851 if ( event.result !== undefined && event.originalEvent ) { 7852 event.originalEvent.returnValue = event.result; 7853 } 7854 } 7855 } 7856 } 7857}; 7858 7859// Ensure the presence of an event listener that handles manually-triggered 7860// synthetic events by interrupting progress until reinvoked in response to 7861// *native* events that it fires directly, ensuring that state changes have 7862// already occurred before other listeners are invoked. 7863function leverageNative( el, type, expectSync ) { 7864 7865 // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add 7866 if ( !expectSync ) { 7867 if ( dataPriv.get( el, type ) === undefined ) { 7868 jQuery.event.add( el, type, returnTrue ); 7869 } 7870 return; 7871 } 7872 7873 // Register the controller as a special universal handler for all event namespaces 7874 dataPriv.set( el, type, false ); 7875 jQuery.event.add( el, type, { 7876 namespace: false, 7877 handler: function( event ) { 7878 var notAsync, result, 7879 saved = dataPriv.get( this, type ); 7880 7881 if ( ( event.isTrigger & 1 ) && this[ type ] ) { 7882 7883 // Interrupt processing of the outer synthetic .trigger()ed event 7884 // Saved data should be false in such cases, but might be a leftover capture object 7885 // from an async native handler (gh-4350) 7886 if ( !saved.length ) { 7887 7888 // Store arguments for use when handling the inner native event 7889 // There will always be at least one argument (an event object), so this array 7890 // will not be confused with a leftover capture object. 7891 saved = slice.call( arguments ); 7892 dataPriv.set( this, type, saved ); 7893 7894 // Trigger the native event and capture its result 7895 // Support: IE <=9 - 11+ 7896 // focus() and blur() are asynchronous 7897 notAsync = expectSync( this, type ); 7898 this[ type ](); 7899 result = dataPriv.get( this, type ); 7900 if ( saved !== result || notAsync ) { 7901 dataPriv.set( this, type, false ); 7902 } else { 7903 result = {}; 7904 } 7905 if ( saved !== result ) { 7906 7907 // Cancel the outer synthetic event 7908 event.stopImmediatePropagation(); 7909 event.preventDefault(); 7910 7911 // Support: Chrome 86+ 7912 // In Chrome, if an element having a focusout handler is blurred by 7913 // clicking outside of it, it invokes the handler synchronously. If 7914 // that handler calls `.remove()` on the element, the data is cleared, 7915 // leaving `result` undefined. We need to guard against this. 7916 return result && result.value; 7917 } 7918 7919 // If this is an inner synthetic event for an event with a bubbling surrogate 7920 // (focus or blur), assume that the surrogate already propagated from triggering the 7921 // native event and prevent that from happening again here. 7922 // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the 7923 // bubbling surrogate propagates *after* the non-bubbling base), but that seems 7924 // less bad than duplication. 7925 } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { 7926 event.stopPropagation(); 7927 } 7928 7929 // If this is a native event triggered above, everything is now in order 7930 // Fire an inner synthetic event with the original arguments 7931 } else if ( saved.length ) { 7932 7933 // ...and capture the result 7934 dataPriv.set( this, type, { 7935 value: jQuery.event.trigger( 7936 7937 // Support: IE <=9 - 11+ 7938 // Extend with the prototype to reset the above stopImmediatePropagation() 7939 jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), 7940 saved.slice( 1 ), 7941 this 7942 ) 7943 } ); 7944 7945 // Abort handling of the native event 7946 event.stopImmediatePropagation(); 7947 } 7948 } 7949 } ); 7950} 7951 7952jQuery.removeEvent = function( elem, type, handle ) { 7953 7954 // This "if" is needed for plain objects 7955 if ( elem.removeEventListener ) { 7956 elem.removeEventListener( type, handle ); 7957 } 7958}; 7959 7960jQuery.Event = function( src, props ) { 7961 7962 // Allow instantiation without the 'new' keyword 7963 if ( !( this instanceof jQuery.Event ) ) { 7964 return new jQuery.Event( src, props ); 7965 } 7966 7967 // Event object 7968 if ( src && src.type ) { 7969 this.originalEvent = src; 7970 this.type = src.type; 7971 7972 // Events bubbling up the document may have been marked as prevented 7973 // by a handler lower down the tree; reflect the correct value. 7974 this.isDefaultPrevented = src.defaultPrevented || 7975 src.defaultPrevented === undefined && 7976 7977 // Support: Android <=2.3 only 7978 src.returnValue === false ? 7979 returnTrue : 7980 returnFalse; 7981 7982 // Create target properties 7983 // Support: Safari <=6 - 7 only 7984 // Target should not be a text node (#504, #13143) 7985 this.target = ( src.target && src.target.nodeType === 3 ) ? 7986 src.target.parentNode : 7987 src.target; 7988 7989 this.currentTarget = src.currentTarget; 7990 this.relatedTarget = src.relatedTarget; 7991 7992 // Event type 7993 } else { 7994 this.type = src; 7995 } 7996 7997 // Put explicitly provided properties onto the event object 7998 if ( props ) { 7999 jQuery.extend( this, props ); 8000 } 8001 8002 // Create a timestamp if incoming event doesn't have one 8003 this.timeStamp = src && src.timeStamp || Date.now(); 8004 8005 // Mark it as fixed 8006 this[ jQuery.expando ] = true; 8007}; 8008 8009// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 8010// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 8011jQuery.Event.prototype = { 8012 constructor: jQuery.Event, 8013 isDefaultPrevented: returnFalse, 8014 isPropagationStopped: returnFalse, 8015 isImmediatePropagationStopped: returnFalse, 8016 isSimulated: false, 8017 8018 preventDefault: function() { 8019 var e = this.originalEvent; 8020 8021 this.isDefaultPrevented = returnTrue; 8022 8023 if ( e && !this.isSimulated ) { 8024 e.preventDefault(); 8025 } 8026 }, 8027 stopPropagation: function() { 8028 var e = this.originalEvent; 8029 8030 this.isPropagationStopped = returnTrue; 8031 8032 if ( e && !this.isSimulated ) { 8033 e.stopPropagation(); 8034 } 8035 }, 8036 stopImmediatePropagation: function() { 8037 var e = this.originalEvent; 8038 8039 this.isImmediatePropagationStopped = returnTrue; 8040 8041 if ( e && !this.isSimulated ) { 8042 e.stopImmediatePropagation(); 8043 } 8044 8045 this.stopPropagation(); 8046 } 8047}; 8048 8049// Includes all common event props including KeyEvent and MouseEvent specific props 8050jQuery.each( { 8051 altKey: true, 8052 bubbles: true, 8053 cancelable: true, 8054 changedTouches: true, 8055 ctrlKey: true, 8056 detail: true, 8057 eventPhase: true, 8058 metaKey: true, 8059 pageX: true, 8060 pageY: true, 8061 shiftKey: true, 8062 view: true, 8063 "char": true, 8064 code: true, 8065 charCode: true, 8066 key: true, 8067 keyCode: true, 8068 button: true, 8069 buttons: true, 8070 clientX: true, 8071 clientY: true, 8072 offsetX: true, 8073 offsetY: true, 8074 pointerId: true, 8075 pointerType: true, 8076 screenX: true, 8077 screenY: true, 8078 targetTouches: true, 8079 toElement: true, 8080 touches: true, 8081 which: true 8082}, jQuery.event.addProp ); 8083 8084jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { 8085 jQuery.event.special[ type ] = { 8086 8087 // Utilize native event if possible so blur/focus sequence is correct 8088 setup: function() { 8089 8090 // Claim the first handler 8091 // dataPriv.set( this, "focus", ... ) 8092 // dataPriv.set( this, "blur", ... ) 8093 leverageNative( this, type, expectSync ); 8094 8095 // Return false to allow normal processing in the caller 8096 return false; 8097 }, 8098 trigger: function() { 8099 8100 // Force setup before trigger 8101 leverageNative( this, type ); 8102 8103 // Return non-false to allow normal event-path propagation 8104 return true; 8105 }, 8106 8107 // Suppress native focus or blur as it's already being fired 8108 // in leverageNative. 8109 _default: function() { 8110 return true; 8111 }, 8112 8113 delegateType: delegateType 8114 }; 8115} ); 8116 8117// Create mouseenter/leave events using mouseover/out and event-time checks 8118// so that event delegation works in jQuery. 8119// Do the same for pointerenter/pointerleave and pointerover/pointerout 8120// 8121// Support: Safari 7 only 8122// Safari sends mouseenter too often; see: 8123// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 8124// for the description of the bug (it existed in older Chrome versions as well). 8125jQuery.each( { 8126 mouseenter: "mouseover", 8127 mouseleave: "mouseout", 8128 pointerenter: "pointerover", 8129 pointerleave: "pointerout" 8130}, function( orig, fix ) { 8131 jQuery.event.special[ orig ] = { 8132 delegateType: fix, 8133 bindType: fix, 8134 8135 handle: function( event ) { 8136 var ret, 8137 target = this, 8138 related = event.relatedTarget, 8139 handleObj = event.handleObj; 8140 8141 // For mouseenter/leave call the handler if related is outside the target. 8142 // NB: No relatedTarget if the mouse left/entered the browser window 8143 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { 8144 event.type = handleObj.origType; 8145 ret = handleObj.handler.apply( this, arguments ); 8146 event.type = fix; 8147 } 8148 return ret; 8149 } 8150 }; 8151} ); 8152 8153jQuery.fn.extend( { 8154 8155 on: function( types, selector, data, fn ) { 8156 return on( this, types, selector, data, fn ); 8157 }, 8158 one: function( types, selector, data, fn ) { 8159 return on( this, types, selector, data, fn, 1 ); 8160 }, 8161 off: function( types, selector, fn ) { 8162 var handleObj, type; 8163 if ( types && types.preventDefault && types.handleObj ) { 8164 8165 // ( event ) dispatched jQuery.Event 8166 handleObj = types.handleObj; 8167 jQuery( types.delegateTarget ).off( 8168 handleObj.namespace ? 8169 handleObj.origType + "." + handleObj.namespace : 8170 handleObj.origType, 8171 handleObj.selector, 8172 handleObj.handler 8173 ); 8174 return this; 8175 } 8176 if ( typeof types === "object" ) { 8177 8178 // ( types-object [, selector] ) 8179 for ( type in types ) { 8180 this.off( type, selector, types[ type ] ); 8181 } 8182 return this; 8183 } 8184 if ( selector === false || typeof selector === "function" ) { 8185 8186 // ( types [, fn] ) 8187 fn = selector; 8188 selector = undefined; 8189 } 8190 if ( fn === false ) { 8191 fn = returnFalse; 8192 } 8193 return this.each( function() { 8194 jQuery.event.remove( this, types, fn, selector ); 8195 } ); 8196 } 8197} ); 8198 8199 8200var 8201 8202 // Support: IE <=10 - 11, Edge 12 - 13 only 8203 // In IE/Edge using regex groups here causes severe slowdowns. 8204 // See https://connect.microsoft.com/IE/feedback/details/1736512/ 8205 rnoInnerhtml = /<script|<style|<link/i, 8206 8207 // checked="checked" or checked 8208 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 8209 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g; 8210 8211// Prefer a tbody over its parent table for containing new rows 8212function manipulationTarget( elem, content ) { 8213 if ( nodeName( elem, "table" ) && 8214 nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { 8215 8216 return jQuery( elem ).children( "tbody" )[ 0 ] || elem; 8217 } 8218 8219 return elem; 8220} 8221 8222// Replace/restore the type attribute of script elements for safe DOM manipulation 8223function disableScript( elem ) { 8224 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; 8225 return elem; 8226} 8227function restoreScript( elem ) { 8228 if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { 8229 elem.type = elem.type.slice( 5 ); 8230 } else { 8231 elem.removeAttribute( "type" ); 8232 } 8233 8234 return elem; 8235} 8236 8237function cloneCopyEvent( src, dest ) { 8238 var i, l, type, pdataOld, udataOld, udataCur, events; 8239 8240 if ( dest.nodeType !== 1 ) { 8241 return; 8242 } 8243 8244 // 1. Copy private data: events, handlers, etc. 8245 if ( dataPriv.hasData( src ) ) { 8246 pdataOld = dataPriv.get( src ); 8247 events = pdataOld.events; 8248 8249 if ( events ) { 8250 dataPriv.remove( dest, "handle events" ); 8251 8252 for ( type in events ) { 8253 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 8254 jQuery.event.add( dest, type, events[ type ][ i ] ); 8255 } 8256 } 8257 } 8258 } 8259 8260 // 2. Copy user data 8261 if ( dataUser.hasData( src ) ) { 8262 udataOld = dataUser.access( src ); 8263 udataCur = jQuery.extend( {}, udataOld ); 8264 8265 dataUser.set( dest, udataCur ); 8266 } 8267} 8268 8269// Fix IE bugs, see support tests 8270function fixInput( src, dest ) { 8271 var nodeName = dest.nodeName.toLowerCase(); 8272 8273 // Fails to persist the checked state of a cloned checkbox or radio button. 8274 if ( nodeName === "input" && rcheckableType.test( src.type ) ) { 8275 dest.checked = src.checked; 8276 8277 // Fails to return the selected option to the default selected state when cloning options 8278 } else if ( nodeName === "input" || nodeName === "textarea" ) { 8279 dest.defaultValue = src.defaultValue; 8280 } 8281} 8282 8283function domManip( collection, args, callback, ignored ) { 8284 8285 // Flatten any nested arrays 8286 args = flat( args ); 8287 8288 var fragment, first, scripts, hasScripts, node, doc, 8289 i = 0, 8290 l = collection.length, 8291 iNoClone = l - 1, 8292 value = args[ 0 ], 8293 valueIsFunction = isFunction( value ); 8294 8295 // We can't cloneNode fragments that contain checked, in WebKit 8296 if ( valueIsFunction || 8297 ( l > 1 && typeof value === "string" && 8298 !support.checkClone && rchecked.test( value ) ) ) { 8299 return collection.each( function( index ) { 8300 var self = collection.eq( index ); 8301 if ( valueIsFunction ) { 8302 args[ 0 ] = value.call( this, index, self.html() ); 8303 } 8304 domManip( self, args, callback, ignored ); 8305 } ); 8306 } 8307 8308 if ( l ) { 8309 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); 8310 first = fragment.firstChild; 8311 8312 if ( fragment.childNodes.length === 1 ) { 8313 fragment = first; 8314 } 8315 8316 // Require either new content or an interest in ignored elements to invoke the callback 8317 if ( first || ignored ) { 8318 scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); 8319 hasScripts = scripts.length; 8320 8321 // Use the original fragment for the last item 8322 // instead of the first because it can end up 8323 // being emptied incorrectly in certain situations (#8070). 8324 for ( ; i < l; i++ ) { 8325 node = fragment; 8326 8327 if ( i !== iNoClone ) { 8328 node = jQuery.clone( node, true, true ); 8329 8330 // Keep references to cloned scripts for later restoration 8331 if ( hasScripts ) { 8332 8333 // Support: Android <=4.0 only, PhantomJS 1 only 8334 // push.apply(_, arraylike) throws on ancient WebKit 8335 jQuery.merge( scripts, getAll( node, "script" ) ); 8336 } 8337 } 8338 8339 callback.call( collection[ i ], node, i ); 8340 } 8341 8342 if ( hasScripts ) { 8343 doc = scripts[ scripts.length - 1 ].ownerDocument; 8344 8345 // Reenable scripts 8346 jQuery.map( scripts, restoreScript ); 8347 8348 // Evaluate executable scripts on first document insertion 8349 for ( i = 0; i < hasScripts; i++ ) { 8350 node = scripts[ i ]; 8351 if ( rscriptType.test( node.type || "" ) && 8352 !dataPriv.access( node, "globalEval" ) && 8353 jQuery.contains( doc, node ) ) { 8354 8355 if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { 8356 8357 // Optional AJAX dependency, but won't run scripts if not present 8358 if ( jQuery._evalUrl && !node.noModule ) { 8359 jQuery._evalUrl( node.src, { 8360 nonce: node.nonce || node.getAttribute( "nonce" ) 8361 }, doc ); 8362 } 8363 } else { 8364 DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); 8365 } 8366 } 8367 } 8368 } 8369 } 8370 } 8371 8372 return collection; 8373} 8374 8375function remove( elem, selector, keepData ) { 8376 var node, 8377 nodes = selector ? jQuery.filter( selector, elem ) : elem, 8378 i = 0; 8379 8380 for ( ; ( node = nodes[ i ] ) != null; i++ ) { 8381 if ( !keepData && node.nodeType === 1 ) { 8382 jQuery.cleanData( getAll( node ) ); 8383 } 8384 8385 if ( node.parentNode ) { 8386 if ( keepData && isAttached( node ) ) { 8387 setGlobalEval( getAll( node, "script" ) ); 8388 } 8389 node.parentNode.removeChild( node ); 8390 } 8391 } 8392 8393 return elem; 8394} 8395 8396jQuery.extend( { 8397 htmlPrefilter: function( html ) { 8398 return html; 8399 }, 8400 8401 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 8402 var i, l, srcElements, destElements, 8403 clone = elem.cloneNode( true ), 8404 inPage = isAttached( elem ); 8405 8406 // Fix IE cloning issues 8407 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && 8408 !jQuery.isXMLDoc( elem ) ) { 8409 8410 // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 8411 destElements = getAll( clone ); 8412 srcElements = getAll( elem ); 8413 8414 for ( i = 0, l = srcElements.length; i < l; i++ ) { 8415 fixInput( srcElements[ i ], destElements[ i ] ); 8416 } 8417 } 8418 8419 // Copy the events from the original to the clone 8420 if ( dataAndEvents ) { 8421 if ( deepDataAndEvents ) { 8422 srcElements = srcElements || getAll( elem ); 8423 destElements = destElements || getAll( clone ); 8424 8425 for ( i = 0, l = srcElements.length; i < l; i++ ) { 8426 cloneCopyEvent( srcElements[ i ], destElements[ i ] ); 8427 } 8428 } else { 8429 cloneCopyEvent( elem, clone ); 8430 } 8431 } 8432 8433 // Preserve script evaluation history 8434 destElements = getAll( clone, "script" ); 8435 if ( destElements.length > 0 ) { 8436 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); 8437 } 8438 8439 // Return the cloned set 8440 return clone; 8441 }, 8442 8443 cleanData: function( elems ) { 8444 var data, elem, type, 8445 special = jQuery.event.special, 8446 i = 0; 8447 8448 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { 8449 if ( acceptData( elem ) ) { 8450 if ( ( data = elem[ dataPriv.expando ] ) ) { 8451 if ( data.events ) { 8452 for ( type in data.events ) { 8453 if ( special[ type ] ) { 8454 jQuery.event.remove( elem, type ); 8455 8456 // This is a shortcut to avoid jQuery.event.remove's overhead 8457 } else { 8458 jQuery.removeEvent( elem, type, data.handle ); 8459 } 8460 } 8461 } 8462 8463 // Support: Chrome <=35 - 45+ 8464 // Assign undefined instead of using delete, see Data#remove 8465 elem[ dataPriv.expando ] = undefined; 8466 } 8467 if ( elem[ dataUser.expando ] ) { 8468 8469 // Support: Chrome <=35 - 45+ 8470 // Assign undefined instead of using delete, see Data#remove 8471 elem[ dataUser.expando ] = undefined; 8472 } 8473 } 8474 } 8475 } 8476} ); 8477 8478jQuery.fn.extend( { 8479 detach: function( selector ) { 8480 return remove( this, selector, true ); 8481 }, 8482 8483 remove: function( selector ) { 8484 return remove( this, selector ); 8485 }, 8486 8487 text: function( value ) { 8488 return access( this, function( value ) { 8489 return value === undefined ? 8490 jQuery.text( this ) : 8491 this.empty().each( function() { 8492 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 8493 this.textContent = value; 8494 } 8495 } ); 8496 }, null, value, arguments.length ); 8497 }, 8498 8499 append: function() { 8500 return domManip( this, arguments, function( elem ) { 8501 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 8502 var target = manipulationTarget( this, elem ); 8503 target.appendChild( elem ); 8504 } 8505 } ); 8506 }, 8507 8508 prepend: function() { 8509 return domManip( this, arguments, function( elem ) { 8510 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 8511 var target = manipulationTarget( this, elem ); 8512 target.insertBefore( elem, target.firstChild ); 8513 } 8514 } ); 8515 }, 8516 8517 before: function() { 8518 return domManip( this, arguments, function( elem ) { 8519 if ( this.parentNode ) { 8520 this.parentNode.insertBefore( elem, this ); 8521 } 8522 } ); 8523 }, 8524 8525 after: function() { 8526 return domManip( this, arguments, function( elem ) { 8527 if ( this.parentNode ) { 8528 this.parentNode.insertBefore( elem, this.nextSibling ); 8529 } 8530 } ); 8531 }, 8532 8533 empty: function() { 8534 var elem, 8535 i = 0; 8536 8537 for ( ; ( elem = this[ i ] ) != null; i++ ) { 8538 if ( elem.nodeType === 1 ) { 8539 8540 // Prevent memory leaks 8541 jQuery.cleanData( getAll( elem, false ) ); 8542 8543 // Remove any remaining nodes 8544 elem.textContent = ""; 8545 } 8546 } 8547 8548 return this; 8549 }, 8550 8551 clone: function( dataAndEvents, deepDataAndEvents ) { 8552 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 8553 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 8554 8555 return this.map( function() { 8556 return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); 8557 } ); 8558 }, 8559 8560 html: function( value ) { 8561 return access( this, function( value ) { 8562 var elem = this[ 0 ] || {}, 8563 i = 0, 8564 l = this.length; 8565 8566 if ( value === undefined && elem.nodeType === 1 ) { 8567 return elem.innerHTML; 8568 } 8569 8570 // See if we can take a shortcut and just use innerHTML 8571 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 8572 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { 8573 8574 value = jQuery.htmlPrefilter( value ); 8575 8576 try { 8577 for ( ; i < l; i++ ) { 8578 elem = this[ i ] || {}; 8579 8580 // Remove element nodes and prevent memory leaks 8581 if ( elem.nodeType === 1 ) { 8582 jQuery.cleanData( getAll( elem, false ) ); 8583 elem.innerHTML = value; 8584 } 8585 } 8586 8587 elem = 0; 8588 8589 // If using innerHTML throws an exception, use the fallback method 8590 } catch ( e ) {} 8591 } 8592 8593 if ( elem ) { 8594 this.empty().append( value ); 8595 } 8596 }, null, value, arguments.length ); 8597 }, 8598 8599 replaceWith: function() { 8600 var ignored = []; 8601 8602 // Make the changes, replacing each non-ignored context element with the new content 8603 return domManip( this, arguments, function( elem ) { 8604 var parent = this.parentNode; 8605 8606 if ( jQuery.inArray( this, ignored ) < 0 ) { 8607 jQuery.cleanData( getAll( this ) ); 8608 if ( parent ) { 8609 parent.replaceChild( elem, this ); 8610 } 8611 } 8612 8613 // Force callback invocation 8614 }, ignored ); 8615 } 8616} ); 8617 8618jQuery.each( { 8619 appendTo: "append", 8620 prependTo: "prepend", 8621 insertBefore: "before", 8622 insertAfter: "after", 8623 replaceAll: "replaceWith" 8624}, function( name, original ) { 8625 jQuery.fn[ name ] = function( selector ) { 8626 var elems, 8627 ret = [], 8628 insert = jQuery( selector ), 8629 last = insert.length - 1, 8630 i = 0; 8631 8632 for ( ; i <= last; i++ ) { 8633 elems = i === last ? this : this.clone( true ); 8634 jQuery( insert[ i ] )[ original ]( elems ); 8635 8636 // Support: Android <=4.0 only, PhantomJS 1 only 8637 // .get() because push.apply(_, arraylike) throws on ancient WebKit 8638 push.apply( ret, elems.get() ); 8639 } 8640 8641 return this.pushStack( ret ); 8642 }; 8643} ); 8644var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 8645 8646var getStyles = function( elem ) { 8647 8648 // Support: IE <=11 only, Firefox <=30 (#15098, #14150) 8649 // IE throws on elements created in popups 8650 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 8651 var view = elem.ownerDocument.defaultView; 8652 8653 if ( !view || !view.opener ) { 8654 view = window; 8655 } 8656 8657 return view.getComputedStyle( elem ); 8658 }; 8659 8660var swap = function( elem, options, callback ) { 8661 var ret, name, 8662 old = {}; 8663 8664 // Remember the old values, and insert the new ones 8665 for ( name in options ) { 8666 old[ name ] = elem.style[ name ]; 8667 elem.style[ name ] = options[ name ]; 8668 } 8669 8670 ret = callback.call( elem ); 8671 8672 // Revert the old values 8673 for ( name in options ) { 8674 elem.style[ name ] = old[ name ]; 8675 } 8676 8677 return ret; 8678}; 8679 8680 8681var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); 8682 8683 8684 8685( function() { 8686 8687 // Executing both pixelPosition & boxSizingReliable tests require only one layout 8688 // so they're executed at the same time to save the second computation. 8689 function computeStyleTests() { 8690 8691 // This is a singleton, we need to execute it only once 8692 if ( !div ) { 8693 return; 8694 } 8695 8696 container.style.cssText = "position:absolute;left:-11111px;width:60px;" + 8697 "margin-top:1px;padding:0;border:0"; 8698 div.style.cssText = 8699 "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + 8700 "margin:auto;border:1px;padding:1px;" + 8701 "width:60%;top:1%"; 8702 documentElement.appendChild( container ).appendChild( div ); 8703 8704 var divStyle = window.getComputedStyle( div ); 8705 pixelPositionVal = divStyle.top !== "1%"; 8706 8707 // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 8708 reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; 8709 8710 // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 8711 // Some styles come back with percentage values, even though they shouldn't 8712 div.style.right = "60%"; 8713 pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; 8714 8715 // Support: IE 9 - 11 only 8716 // Detect misreporting of content dimensions for box-sizing:border-box elements 8717 boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; 8718 8719 // Support: IE 9 only 8720 // Detect overflow:scroll screwiness (gh-3699) 8721 // Support: Chrome <=64 8722 // Don't get tricked when zoom affects offsetWidth (gh-4029) 8723 div.style.position = "absolute"; 8724 scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; 8725 8726 documentElement.removeChild( container ); 8727 8728 // Nullify the div so it wouldn't be stored in the memory and 8729 // it will also be a sign that checks already performed 8730 div = null; 8731 } 8732 8733 function roundPixelMeasures( measure ) { 8734 return Math.round( parseFloat( measure ) ); 8735 } 8736 8737 var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, 8738 reliableTrDimensionsVal, reliableMarginLeftVal, 8739 container = document.createElement( "div" ), 8740 div = document.createElement( "div" ); 8741 8742 // Finish early in limited (non-browser) environments 8743 if ( !div.style ) { 8744 return; 8745 } 8746 8747 // Support: IE <=9 - 11 only 8748 // Style of cloned element affects source element cloned (#8908) 8749 div.style.backgroundClip = "content-box"; 8750 div.cloneNode( true ).style.backgroundClip = ""; 8751 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 8752 8753 jQuery.extend( support, { 8754 boxSizingReliable: function() { 8755 computeStyleTests(); 8756 return boxSizingReliableVal; 8757 }, 8758 pixelBoxStyles: function() { 8759 computeStyleTests(); 8760 return pixelBoxStylesVal; 8761 }, 8762 pixelPosition: function() { 8763 computeStyleTests(); 8764 return pixelPositionVal; 8765 }, 8766 reliableMarginLeft: function() { 8767 computeStyleTests(); 8768 return reliableMarginLeftVal; 8769 }, 8770 scrollboxSize: function() { 8771 computeStyleTests(); 8772 return scrollboxSizeVal; 8773 }, 8774 8775 // Support: IE 9 - 11+, Edge 15 - 18+ 8776 // IE/Edge misreport `getComputedStyle` of table rows with width/height 8777 // set in CSS while `offset*` properties report correct values. 8778 // Behavior in IE 9 is more subtle than in newer versions & it passes 8779 // some versions of this test; make sure not to make it pass there! 8780 // 8781 // Support: Firefox 70+ 8782 // Only Firefox includes border widths 8783 // in computed dimensions. (gh-4529) 8784 reliableTrDimensions: function() { 8785 var table, tr, trChild, trStyle; 8786 if ( reliableTrDimensionsVal == null ) { 8787 table = document.createElement( "table" ); 8788 tr = document.createElement( "tr" ); 8789 trChild = document.createElement( "div" ); 8790 8791 table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"; 8792 tr.style.cssText = "border:1px solid"; 8793 8794 // Support: Chrome 86+ 8795 // Height set through cssText does not get applied. 8796 // Computed height then comes back as 0. 8797 tr.style.height = "1px"; 8798 trChild.style.height = "9px"; 8799 8800 // Support: Android 8 Chrome 86+ 8801 // In our bodyBackground.html iframe, 8802 // display for all div elements is set to "inline", 8803 // which causes a problem only in Android 8 Chrome 86. 8804 // Ensuring the div is display: block 8805 // gets around this issue. 8806 trChild.style.display = "block"; 8807 8808 documentElement 8809 .appendChild( table ) 8810 .appendChild( tr ) 8811 .appendChild( trChild ); 8812 8813 trStyle = window.getComputedStyle( tr ); 8814 reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) + 8815 parseInt( trStyle.borderTopWidth, 10 ) + 8816 parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight; 8817 8818 documentElement.removeChild( table ); 8819 } 8820 return reliableTrDimensionsVal; 8821 } 8822 } ); 8823} )(); 8824 8825 8826function curCSS( elem, name, computed ) { 8827 var width, minWidth, maxWidth, ret, 8828 8829 // Support: Firefox 51+ 8830 // Retrieving style before computed somehow 8831 // fixes an issue with getting wrong values 8832 // on detached elements 8833 style = elem.style; 8834 8835 computed = computed || getStyles( elem ); 8836 8837 // getPropertyValue is needed for: 8838 // .css('filter') (IE 9 only, #12537) 8839 // .css('--customProperty) (#3144) 8840 if ( computed ) { 8841 ret = computed.getPropertyValue( name ) || computed[ name ]; 8842 8843 if ( ret === "" && !isAttached( elem ) ) { 8844 ret = jQuery.style( elem, name ); 8845 } 8846 8847 // A tribute to the "awesome hack by Dean Edwards" 8848 // Android Browser returns percentage for some values, 8849 // but width seems to be reliably pixels. 8850 // This is against the CSSOM draft spec: 8851 // https://drafts.csswg.org/cssom/#resolved-values 8852 if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { 8853 8854 // Remember the original values 8855 width = style.width; 8856 minWidth = style.minWidth; 8857 maxWidth = style.maxWidth; 8858 8859 // Put in the new values to get a computed value out 8860 style.minWidth = style.maxWidth = style.width = ret; 8861 ret = computed.width; 8862 8863 // Revert the changed values 8864 style.width = width; 8865 style.minWidth = minWidth; 8866 style.maxWidth = maxWidth; 8867 } 8868 } 8869 8870 return ret !== undefined ? 8871 8872 // Support: IE <=9 - 11 only 8873 // IE returns zIndex value as an integer. 8874 ret + "" : 8875 ret; 8876} 8877 8878 8879function addGetHookIf( conditionFn, hookFn ) { 8880 8881 // Define the hook, we'll check on the first run if it's really needed. 8882 return { 8883 get: function() { 8884 if ( conditionFn() ) { 8885 8886 // Hook not needed (or it's not possible to use it due 8887 // to missing dependency), remove it. 8888 delete this.get; 8889 return; 8890 } 8891 8892 // Hook needed; redefine it so that the support test is not executed again. 8893 return ( this.get = hookFn ).apply( this, arguments ); 8894 } 8895 }; 8896} 8897 8898 8899var cssPrefixes = [ "Webkit", "Moz", "ms" ], 8900 emptyStyle = document.createElement( "div" ).style, 8901 vendorProps = {}; 8902 8903// Return a vendor-prefixed property or undefined 8904function vendorPropName( name ) { 8905 8906 // Check for vendor prefixed names 8907 var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), 8908 i = cssPrefixes.length; 8909 8910 while ( i-- ) { 8911 name = cssPrefixes[ i ] + capName; 8912 if ( name in emptyStyle ) { 8913 return name; 8914 } 8915 } 8916} 8917 8918// Return a potentially-mapped jQuery.cssProps or vendor prefixed property 8919function finalPropName( name ) { 8920 var final = jQuery.cssProps[ name ] || vendorProps[ name ]; 8921 8922 if ( final ) { 8923 return final; 8924 } 8925 if ( name in emptyStyle ) { 8926 return name; 8927 } 8928 return vendorProps[ name ] = vendorPropName( name ) || name; 8929} 8930 8931 8932var 8933 8934 // Swappable if display is none or starts with table 8935 // except "table", "table-cell", or "table-caption" 8936 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display 8937 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 8938 rcustomProp = /^--/, 8939 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 8940 cssNormalTransform = { 8941 letterSpacing: "0", 8942 fontWeight: "400" 8943 }; 8944 8945function setPositiveNumber( _elem, value, subtract ) { 8946 8947 // Any relative (+/-) values have already been 8948 // normalized at this point 8949 var matches = rcssNum.exec( value ); 8950 return matches ? 8951 8952 // Guard against undefined "subtract", e.g., when used as in cssHooks 8953 Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : 8954 value; 8955} 8956 8957function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { 8958 var i = dimension === "width" ? 1 : 0, 8959 extra = 0, 8960 delta = 0; 8961 8962 // Adjustment may not be necessary 8963 if ( box === ( isBorderBox ? "border" : "content" ) ) { 8964 return 0; 8965 } 8966 8967 for ( ; i < 4; i += 2 ) { 8968 8969 // Both box models exclude margin 8970 if ( box === "margin" ) { 8971 delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); 8972 } 8973 8974 // If we get here with a content-box, we're seeking "padding" or "border" or "margin" 8975 if ( !isBorderBox ) { 8976 8977 // Add padding 8978 delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 8979 8980 // For "border" or "margin", add border 8981 if ( box !== "padding" ) { 8982 delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 8983 8984 // But still keep track of it otherwise 8985 } else { 8986 extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 8987 } 8988 8989 // If we get here with a border-box (content + padding + border), we're seeking "content" or 8990 // "padding" or "margin" 8991 } else { 8992 8993 // For "content", subtract padding 8994 if ( box === "content" ) { 8995 delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 8996 } 8997 8998 // For "content" or "padding", subtract border 8999 if ( box !== "margin" ) { 9000 delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 9001 } 9002 } 9003 } 9004 9005 // Account for positive content-box scroll gutter when requested by providing computedVal 9006 if ( !isBorderBox && computedVal >= 0 ) { 9007 9008 // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border 9009 // Assuming integer scroll gutter, subtract the rest and round down 9010 delta += Math.max( 0, Math.ceil( 9011 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 9012 computedVal - 9013 delta - 9014 extra - 9015 0.5 9016 9017 // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter 9018 // Use an explicit zero to avoid NaN (gh-3964) 9019 ) ) || 0; 9020 } 9021 9022 return delta; 9023} 9024 9025function getWidthOrHeight( elem, dimension, extra ) { 9026 9027 // Start with computed style 9028 var styles = getStyles( elem ), 9029 9030 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). 9031 // Fake content-box until we know it's needed to know the true value. 9032 boxSizingNeeded = !support.boxSizingReliable() || extra, 9033 isBorderBox = boxSizingNeeded && 9034 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 9035 valueIsBorderBox = isBorderBox, 9036 9037 val = curCSS( elem, dimension, styles ), 9038 offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); 9039 9040 // Support: Firefox <=54 9041 // Return a confounding non-pixel value or feign ignorance, as appropriate. 9042 if ( rnumnonpx.test( val ) ) { 9043 if ( !extra ) { 9044 return val; 9045 } 9046 val = "auto"; 9047 } 9048 9049 9050 // Support: IE 9 - 11 only 9051 // Use offsetWidth/offsetHeight for when box sizing is unreliable. 9052 // In those cases, the computed value can be trusted to be border-box. 9053 if ( ( !support.boxSizingReliable() && isBorderBox || 9054 9055 // Support: IE 10 - 11+, Edge 15 - 18+ 9056 // IE/Edge misreport `getComputedStyle` of table rows with width/height 9057 // set in CSS while `offset*` properties report correct values. 9058 // Interestingly, in some cases IE 9 doesn't suffer from this issue. 9059 !support.reliableTrDimensions() && nodeName( elem, "tr" ) || 9060 9061 // Fall back to offsetWidth/offsetHeight when value is "auto" 9062 // This happens for inline elements with no explicit setting (gh-3571) 9063 val === "auto" || 9064 9065 // Support: Android <=4.1 - 4.3 only 9066 // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) 9067 !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && 9068 9069 // Make sure the element is visible & connected 9070 elem.getClientRects().length ) { 9071 9072 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; 9073 9074 // Where available, offsetWidth/offsetHeight approximate border box dimensions. 9075 // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the 9076 // retrieved value as a content box dimension. 9077 valueIsBorderBox = offsetProp in elem; 9078 if ( valueIsBorderBox ) { 9079 val = elem[ offsetProp ]; 9080 } 9081 } 9082 9083 // Normalize "" and auto 9084 val = parseFloat( val ) || 0; 9085 9086 // Adjust for the element's box model 9087 return ( val + 9088 boxModelAdjustment( 9089 elem, 9090 dimension, 9091 extra || ( isBorderBox ? "border" : "content" ), 9092 valueIsBorderBox, 9093 styles, 9094 9095 // Provide the current computed size to request scroll gutter calculation (gh-3589) 9096 val 9097 ) 9098 ) + "px"; 9099} 9100 9101jQuery.extend( { 9102 9103 // Add in style property hooks for overriding the default 9104 // behavior of getting and setting a style property 9105 cssHooks: { 9106 opacity: { 9107 get: function( elem, computed ) { 9108 if ( computed ) { 9109 9110 // We should always get a number back from opacity 9111 var ret = curCSS( elem, "opacity" ); 9112 return ret === "" ? "1" : ret; 9113 } 9114 } 9115 } 9116 }, 9117 9118 // Don't automatically add "px" to these possibly-unitless properties 9119 cssNumber: { 9120 "animationIterationCount": true, 9121 "columnCount": true, 9122 "fillOpacity": true, 9123 "flexGrow": true, 9124 "flexShrink": true, 9125 "fontWeight": true, 9126 "gridArea": true, 9127 "gridColumn": true, 9128 "gridColumnEnd": true, 9129 "gridColumnStart": true, 9130 "gridRow": true, 9131 "gridRowEnd": true, 9132 "gridRowStart": true, 9133 "lineHeight": true, 9134 "opacity": true, 9135 "order": true, 9136 "orphans": true, 9137 "widows": true, 9138 "zIndex": true, 9139 "zoom": true 9140 }, 9141 9142 // Add in properties whose names you wish to fix before 9143 // setting or getting the value 9144 cssProps: {}, 9145 9146 // Get and set the style property on a DOM Node 9147 style: function( elem, name, value, extra ) { 9148 9149 // Don't set styles on text and comment nodes 9150 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 9151 return; 9152 } 9153 9154 // Make sure that we're working with the right name 9155 var ret, type, hooks, 9156 origName = camelCase( name ), 9157 isCustomProp = rcustomProp.test( name ), 9158 style = elem.style; 9159 9160 // Make sure that we're working with the right name. We don't 9161 // want to query the value if it is a CSS custom property 9162 // since they are user-defined. 9163 if ( !isCustomProp ) { 9164 name = finalPropName( origName ); 9165 } 9166 9167 // Gets hook for the prefixed version, then unprefixed version 9168 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 9169 9170 // Check if we're setting a value 9171 if ( value !== undefined ) { 9172 type = typeof value; 9173 9174 // Convert "+=" or "-=" to relative numbers (#7345) 9175 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { 9176 value = adjustCSS( elem, name, ret ); 9177 9178 // Fixes bug #9237 9179 type = "number"; 9180 } 9181 9182 // Make sure that null and NaN values aren't set (#7116) 9183 if ( value == null || value !== value ) { 9184 return; 9185 } 9186 9187 // If a number was passed in, add the unit (except for certain CSS properties) 9188 // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append 9189 // "px" to a few hardcoded values. 9190 if ( type === "number" && !isCustomProp ) { 9191 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); 9192 } 9193 9194 // background-* props affect original clone's values 9195 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { 9196 style[ name ] = "inherit"; 9197 } 9198 9199 // If a hook was provided, use that value, otherwise just set the specified value 9200 if ( !hooks || !( "set" in hooks ) || 9201 ( value = hooks.set( elem, value, extra ) ) !== undefined ) { 9202 9203 if ( isCustomProp ) { 9204 style.setProperty( name, value ); 9205 } else { 9206 style[ name ] = value; 9207 } 9208 } 9209 9210 } else { 9211 9212 // If a hook was provided get the non-computed value from there 9213 if ( hooks && "get" in hooks && 9214 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { 9215 9216 return ret; 9217 } 9218 9219 // Otherwise just get the value from the style object 9220 return style[ name ]; 9221 } 9222 }, 9223 9224 css: function( elem, name, extra, styles ) { 9225 var val, num, hooks, 9226 origName = camelCase( name ), 9227 isCustomProp = rcustomProp.test( name ); 9228 9229 // Make sure that we're working with the right name. We don't 9230 // want to modify the value if it is a CSS custom property 9231 // since they are user-defined. 9232 if ( !isCustomProp ) { 9233 name = finalPropName( origName ); 9234 } 9235 9236 // Try prefixed name followed by the unprefixed name 9237 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 9238 9239 // If a hook was provided get the computed value from there 9240 if ( hooks && "get" in hooks ) { 9241 val = hooks.get( elem, true, extra ); 9242 } 9243 9244 // Otherwise, if a way to get the computed value exists, use that 9245 if ( val === undefined ) { 9246 val = curCSS( elem, name, styles ); 9247 } 9248 9249 // Convert "normal" to computed value 9250 if ( val === "normal" && name in cssNormalTransform ) { 9251 val = cssNormalTransform[ name ]; 9252 } 9253 9254 // Make numeric if forced or a qualifier was provided and val looks numeric 9255 if ( extra === "" || extra ) { 9256 num = parseFloat( val ); 9257 return extra === true || isFinite( num ) ? num || 0 : val; 9258 } 9259 9260 return val; 9261 } 9262} ); 9263 9264jQuery.each( [ "height", "width" ], function( _i, dimension ) { 9265 jQuery.cssHooks[ dimension ] = { 9266 get: function( elem, computed, extra ) { 9267 if ( computed ) { 9268 9269 // Certain elements can have dimension info if we invisibly show them 9270 // but it must have a current display style that would benefit 9271 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && 9272 9273 // Support: Safari 8+ 9274 // Table columns in Safari have non-zero offsetWidth & zero 9275 // getBoundingClientRect().width unless display is changed. 9276 // Support: IE <=11 only 9277 // Running getBoundingClientRect on a disconnected node 9278 // in IE throws an error. 9279 ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? 9280 swap( elem, cssShow, function() { 9281 return getWidthOrHeight( elem, dimension, extra ); 9282 } ) : 9283 getWidthOrHeight( elem, dimension, extra ); 9284 } 9285 }, 9286 9287 set: function( elem, value, extra ) { 9288 var matches, 9289 styles = getStyles( elem ), 9290 9291 // Only read styles.position if the test has a chance to fail 9292 // to avoid forcing a reflow. 9293 scrollboxSizeBuggy = !support.scrollboxSize() && 9294 styles.position === "absolute", 9295 9296 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) 9297 boxSizingNeeded = scrollboxSizeBuggy || extra, 9298 isBorderBox = boxSizingNeeded && 9299 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 9300 subtract = extra ? 9301 boxModelAdjustment( 9302 elem, 9303 dimension, 9304 extra, 9305 isBorderBox, 9306 styles 9307 ) : 9308 0; 9309 9310 // Account for unreliable border-box dimensions by comparing offset* to computed and 9311 // faking a content-box to get border and padding (gh-3699) 9312 if ( isBorderBox && scrollboxSizeBuggy ) { 9313 subtract -= Math.ceil( 9314 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 9315 parseFloat( styles[ dimension ] ) - 9316 boxModelAdjustment( elem, dimension, "border", false, styles ) - 9317 0.5 9318 ); 9319 } 9320 9321 // Convert to pixels if value adjustment is needed 9322 if ( subtract && ( matches = rcssNum.exec( value ) ) && 9323 ( matches[ 3 ] || "px" ) !== "px" ) { 9324 9325 elem.style[ dimension ] = value; 9326 value = jQuery.css( elem, dimension ); 9327 } 9328 9329 return setPositiveNumber( elem, value, subtract ); 9330 } 9331 }; 9332} ); 9333 9334jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, 9335 function( elem, computed ) { 9336 if ( computed ) { 9337 return ( parseFloat( curCSS( elem, "marginLeft" ) ) || 9338 elem.getBoundingClientRect().left - 9339 swap( elem, { marginLeft: 0 }, function() { 9340 return elem.getBoundingClientRect().left; 9341 } ) 9342 ) + "px"; 9343 } 9344 } 9345); 9346 9347// These hooks are used by animate to expand properties 9348jQuery.each( { 9349 margin: "", 9350 padding: "", 9351 border: "Width" 9352}, function( prefix, suffix ) { 9353 jQuery.cssHooks[ prefix + suffix ] = { 9354 expand: function( value ) { 9355 var i = 0, 9356 expanded = {}, 9357 9358 // Assumes a single number if not a string 9359 parts = typeof value === "string" ? value.split( " " ) : [ value ]; 9360 9361 for ( ; i < 4; i++ ) { 9362 expanded[ prefix + cssExpand[ i ] + suffix ] = 9363 parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 9364 } 9365 9366 return expanded; 9367 } 9368 }; 9369 9370 if ( prefix !== "margin" ) { 9371 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; 9372 } 9373} ); 9374 9375jQuery.fn.extend( { 9376 css: function( name, value ) { 9377 return access( this, function( elem, name, value ) { 9378 var styles, len, 9379 map = {}, 9380 i = 0; 9381 9382 if ( Array.isArray( name ) ) { 9383 styles = getStyles( elem ); 9384 len = name.length; 9385 9386 for ( ; i < len; i++ ) { 9387 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); 9388 } 9389 9390 return map; 9391 } 9392 9393 return value !== undefined ? 9394 jQuery.style( elem, name, value ) : 9395 jQuery.css( elem, name ); 9396 }, name, value, arguments.length > 1 ); 9397 } 9398} ); 9399 9400 9401function Tween( elem, options, prop, end, easing ) { 9402 return new Tween.prototype.init( elem, options, prop, end, easing ); 9403} 9404jQuery.Tween = Tween; 9405 9406Tween.prototype = { 9407 constructor: Tween, 9408 init: function( elem, options, prop, end, easing, unit ) { 9409 this.elem = elem; 9410 this.prop = prop; 9411 this.easing = easing || jQuery.easing._default; 9412 this.options = options; 9413 this.start = this.now = this.cur(); 9414 this.end = end; 9415 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 9416 }, 9417 cur: function() { 9418 var hooks = Tween.propHooks[ this.prop ]; 9419 9420 return hooks && hooks.get ? 9421 hooks.get( this ) : 9422 Tween.propHooks._default.get( this ); 9423 }, 9424 run: function( percent ) { 9425 var eased, 9426 hooks = Tween.propHooks[ this.prop ]; 9427 9428 if ( this.options.duration ) { 9429 this.pos = eased = jQuery.easing[ this.easing ]( 9430 percent, this.options.duration * percent, 0, 1, this.options.duration 9431 ); 9432 } else { 9433 this.pos = eased = percent; 9434 } 9435 this.now = ( this.end - this.start ) * eased + this.start; 9436 9437 if ( this.options.step ) { 9438 this.options.step.call( this.elem, this.now, this ); 9439 } 9440 9441 if ( hooks && hooks.set ) { 9442 hooks.set( this ); 9443 } else { 9444 Tween.propHooks._default.set( this ); 9445 } 9446 return this; 9447 } 9448}; 9449 9450Tween.prototype.init.prototype = Tween.prototype; 9451 9452Tween.propHooks = { 9453 _default: { 9454 get: function( tween ) { 9455 var result; 9456 9457 // Use a property on the element directly when it is not a DOM element, 9458 // or when there is no matching style property that exists. 9459 if ( tween.elem.nodeType !== 1 || 9460 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { 9461 return tween.elem[ tween.prop ]; 9462 } 9463 9464 // Passing an empty string as a 3rd parameter to .css will automatically 9465 // attempt a parseFloat and fallback to a string if the parse fails. 9466 // Simple values such as "10px" are parsed to Float; 9467 // complex values such as "rotate(1rad)" are returned as-is. 9468 result = jQuery.css( tween.elem, tween.prop, "" ); 9469 9470 // Empty strings, null, undefined and "auto" are converted to 0. 9471 return !result || result === "auto" ? 0 : result; 9472 }, 9473 set: function( tween ) { 9474 9475 // Use step hook for back compat. 9476 // Use cssHook if its there. 9477 // Use .style if available and use plain properties where available. 9478 if ( jQuery.fx.step[ tween.prop ] ) { 9479 jQuery.fx.step[ tween.prop ]( tween ); 9480 } else if ( tween.elem.nodeType === 1 && ( 9481 jQuery.cssHooks[ tween.prop ] || 9482 tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { 9483 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); 9484 } else { 9485 tween.elem[ tween.prop ] = tween.now; 9486 } 9487 } 9488 } 9489}; 9490 9491// Support: IE <=9 only 9492// Panic based approach to setting things on disconnected nodes 9493Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 9494 set: function( tween ) { 9495 if ( tween.elem.nodeType && tween.elem.parentNode ) { 9496 tween.elem[ tween.prop ] = tween.now; 9497 } 9498 } 9499}; 9500 9501jQuery.easing = { 9502 linear: function( p ) { 9503 return p; 9504 }, 9505 swing: function( p ) { 9506 return 0.5 - Math.cos( p * Math.PI ) / 2; 9507 }, 9508 _default: "swing" 9509}; 9510 9511jQuery.fx = Tween.prototype.init; 9512 9513// Back compat <1.8 extension point 9514jQuery.fx.step = {}; 9515 9516 9517 9518 9519var 9520 fxNow, inProgress, 9521 rfxtypes = /^(?:toggle|show|hide)$/, 9522 rrun = /queueHooks$/; 9523 9524function schedule() { 9525 if ( inProgress ) { 9526 if ( document.hidden === false && window.requestAnimationFrame ) { 9527 window.requestAnimationFrame( schedule ); 9528 } else { 9529 window.setTimeout( schedule, jQuery.fx.interval ); 9530 } 9531 9532 jQuery.fx.tick(); 9533 } 9534} 9535 9536// Animations created synchronously will run synchronously 9537function createFxNow() { 9538 window.setTimeout( function() { 9539 fxNow = undefined; 9540 } ); 9541 return ( fxNow = Date.now() ); 9542} 9543 9544// Generate parameters to create a standard animation 9545function genFx( type, includeWidth ) { 9546 var which, 9547 i = 0, 9548 attrs = { height: type }; 9549 9550 // If we include width, step value is 1 to do all cssExpand values, 9551 // otherwise step value is 2 to skip over Left and Right 9552 includeWidth = includeWidth ? 1 : 0; 9553 for ( ; i < 4; i += 2 - includeWidth ) { 9554 which = cssExpand[ i ]; 9555 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; 9556 } 9557 9558 if ( includeWidth ) { 9559 attrs.opacity = attrs.width = type; 9560 } 9561 9562 return attrs; 9563} 9564 9565function createTween( value, prop, animation ) { 9566 var tween, 9567 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), 9568 index = 0, 9569 length = collection.length; 9570 for ( ; index < length; index++ ) { 9571 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { 9572 9573 // We're done with this property 9574 return tween; 9575 } 9576 } 9577} 9578 9579function defaultPrefilter( elem, props, opts ) { 9580 var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, 9581 isBox = "width" in props || "height" in props, 9582 anim = this, 9583 orig = {}, 9584 style = elem.style, 9585 hidden = elem.nodeType && isHiddenWithinTree( elem ), 9586 dataShow = dataPriv.get( elem, "fxshow" ); 9587 9588 // Queue-skipping animations hijack the fx hooks 9589 if ( !opts.queue ) { 9590 hooks = jQuery._queueHooks( elem, "fx" ); 9591 if ( hooks.unqueued == null ) { 9592 hooks.unqueued = 0; 9593 oldfire = hooks.empty.fire; 9594 hooks.empty.fire = function() { 9595 if ( !hooks.unqueued ) { 9596 oldfire(); 9597 } 9598 }; 9599 } 9600 hooks.unqueued++; 9601 9602 anim.always( function() { 9603 9604 // Ensure the complete handler is called before this completes 9605 anim.always( function() { 9606 hooks.unqueued--; 9607 if ( !jQuery.queue( elem, "fx" ).length ) { 9608 hooks.empty.fire(); 9609 } 9610 } ); 9611 } ); 9612 } 9613 9614 // Detect show/hide animations 9615 for ( prop in props ) { 9616 value = props[ prop ]; 9617 if ( rfxtypes.test( value ) ) { 9618 delete props[ prop ]; 9619 toggle = toggle || value === "toggle"; 9620 if ( value === ( hidden ? "hide" : "show" ) ) { 9621 9622 // Pretend to be hidden if this is a "show" and 9623 // there is still data from a stopped show/hide 9624 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { 9625 hidden = true; 9626 9627 // Ignore all other no-op show/hide data 9628 } else { 9629 continue; 9630 } 9631 } 9632 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); 9633 } 9634 } 9635 9636 // Bail out if this is a no-op like .hide().hide() 9637 propTween = !jQuery.isEmptyObject( props ); 9638 if ( !propTween && jQuery.isEmptyObject( orig ) ) { 9639 return; 9640 } 9641 9642 // Restrict "overflow" and "display" styles during box animations 9643 if ( isBox && elem.nodeType === 1 ) { 9644 9645 // Support: IE <=9 - 11, Edge 12 - 15 9646 // Record all 3 overflow attributes because IE does not infer the shorthand 9647 // from identically-valued overflowX and overflowY and Edge just mirrors 9648 // the overflowX value there. 9649 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; 9650 9651 // Identify a display type, preferring old show/hide data over the CSS cascade 9652 restoreDisplay = dataShow && dataShow.display; 9653 if ( restoreDisplay == null ) { 9654 restoreDisplay = dataPriv.get( elem, "display" ); 9655 } 9656 display = jQuery.css( elem, "display" ); 9657 if ( display === "none" ) { 9658 if ( restoreDisplay ) { 9659 display = restoreDisplay; 9660 } else { 9661 9662 // Get nonempty value(s) by temporarily forcing visibility 9663 showHide( [ elem ], true ); 9664 restoreDisplay = elem.style.display || restoreDisplay; 9665 display = jQuery.css( elem, "display" ); 9666 showHide( [ elem ] ); 9667 } 9668 } 9669 9670 // Animate inline elements as inline-block 9671 if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { 9672 if ( jQuery.css( elem, "float" ) === "none" ) { 9673 9674 // Restore the original display value at the end of pure show/hide animations 9675 if ( !propTween ) { 9676 anim.done( function() { 9677 style.display = restoreDisplay; 9678 } ); 9679 if ( restoreDisplay == null ) { 9680 display = style.display; 9681 restoreDisplay = display === "none" ? "" : display; 9682 } 9683 } 9684 style.display = "inline-block"; 9685 } 9686 } 9687 } 9688 9689 if ( opts.overflow ) { 9690 style.overflow = "hidden"; 9691 anim.always( function() { 9692 style.overflow = opts.overflow[ 0 ]; 9693 style.overflowX = opts.overflow[ 1 ]; 9694 style.overflowY = opts.overflow[ 2 ]; 9695 } ); 9696 } 9697 9698 // Implement show/hide animations 9699 propTween = false; 9700 for ( prop in orig ) { 9701 9702 // General show/hide setup for this element animation 9703 if ( !propTween ) { 9704 if ( dataShow ) { 9705 if ( "hidden" in dataShow ) { 9706 hidden = dataShow.hidden; 9707 } 9708 } else { 9709 dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); 9710 } 9711 9712 // Store hidden/visible for toggle so `.stop().toggle()` "reverses" 9713 if ( toggle ) { 9714 dataShow.hidden = !hidden; 9715 } 9716 9717 // Show elements before animating them 9718 if ( hidden ) { 9719 showHide( [ elem ], true ); 9720 } 9721 9722 /* eslint-disable no-loop-func */ 9723 9724 anim.done( function() { 9725 9726 /* eslint-enable no-loop-func */ 9727 9728 // The final step of a "hide" animation is actually hiding the element 9729 if ( !hidden ) { 9730 showHide( [ elem ] ); 9731 } 9732 dataPriv.remove( elem, "fxshow" ); 9733 for ( prop in orig ) { 9734 jQuery.style( elem, prop, orig[ prop ] ); 9735 } 9736 } ); 9737 } 9738 9739 // Per-property setup 9740 propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); 9741 if ( !( prop in dataShow ) ) { 9742 dataShow[ prop ] = propTween.start; 9743 if ( hidden ) { 9744 propTween.end = propTween.start; 9745 propTween.start = 0; 9746 } 9747 } 9748 } 9749} 9750 9751function propFilter( props, specialEasing ) { 9752 var index, name, easing, value, hooks; 9753 9754 // camelCase, specialEasing and expand cssHook pass 9755 for ( index in props ) { 9756 name = camelCase( index ); 9757 easing = specialEasing[ name ]; 9758 value = props[ index ]; 9759 if ( Array.isArray( value ) ) { 9760 easing = value[ 1 ]; 9761 value = props[ index ] = value[ 0 ]; 9762 } 9763 9764 if ( index !== name ) { 9765 props[ name ] = value; 9766 delete props[ index ]; 9767 } 9768 9769 hooks = jQuery.cssHooks[ name ]; 9770 if ( hooks && "expand" in hooks ) { 9771 value = hooks.expand( value ); 9772 delete props[ name ]; 9773 9774 // Not quite $.extend, this won't overwrite existing keys. 9775 // Reusing 'index' because we have the correct "name" 9776 for ( index in value ) { 9777 if ( !( index in props ) ) { 9778 props[ index ] = value[ index ]; 9779 specialEasing[ index ] = easing; 9780 } 9781 } 9782 } else { 9783 specialEasing[ name ] = easing; 9784 } 9785 } 9786} 9787 9788function Animation( elem, properties, options ) { 9789 var result, 9790 stopped, 9791 index = 0, 9792 length = Animation.prefilters.length, 9793 deferred = jQuery.Deferred().always( function() { 9794 9795 // Don't match elem in the :animated selector 9796 delete tick.elem; 9797 } ), 9798 tick = function() { 9799 if ( stopped ) { 9800 return false; 9801 } 9802 var currentTime = fxNow || createFxNow(), 9803 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), 9804 9805 // Support: Android 2.3 only 9806 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) 9807 temp = remaining / animation.duration || 0, 9808 percent = 1 - temp, 9809 index = 0, 9810 length = animation.tweens.length; 9811 9812 for ( ; index < length; index++ ) { 9813 animation.tweens[ index ].run( percent ); 9814 } 9815 9816 deferred.notifyWith( elem, [ animation, percent, remaining ] ); 9817 9818 // If there's more to do, yield 9819 if ( percent < 1 && length ) { 9820 return remaining; 9821 } 9822 9823 // If this was an empty animation, synthesize a final progress notification 9824 if ( !length ) { 9825 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 9826 } 9827 9828 // Resolve the animation and report its conclusion 9829 deferred.resolveWith( elem, [ animation ] ); 9830 return false; 9831 }, 9832 animation = deferred.promise( { 9833 elem: elem, 9834 props: jQuery.extend( {}, properties ), 9835 opts: jQuery.extend( true, { 9836 specialEasing: {}, 9837 easing: jQuery.easing._default 9838 }, options ), 9839 originalProperties: properties, 9840 originalOptions: options, 9841 startTime: fxNow || createFxNow(), 9842 duration: options.duration, 9843 tweens: [], 9844 createTween: function( prop, end ) { 9845 var tween = jQuery.Tween( elem, animation.opts, prop, end, 9846 animation.opts.specialEasing[ prop ] || animation.opts.easing ); 9847 animation.tweens.push( tween ); 9848 return tween; 9849 }, 9850 stop: function( gotoEnd ) { 9851 var index = 0, 9852 9853 // If we are going to the end, we want to run all the tweens 9854 // otherwise we skip this part 9855 length = gotoEnd ? animation.tweens.length : 0; 9856 if ( stopped ) { 9857 return this; 9858 } 9859 stopped = true; 9860 for ( ; index < length; index++ ) { 9861 animation.tweens[ index ].run( 1 ); 9862 } 9863 9864 // Resolve when we played the last frame; otherwise, reject 9865 if ( gotoEnd ) { 9866 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 9867 deferred.resolveWith( elem, [ animation, gotoEnd ] ); 9868 } else { 9869 deferred.rejectWith( elem, [ animation, gotoEnd ] ); 9870 } 9871 return this; 9872 } 9873 } ), 9874 props = animation.props; 9875 9876 propFilter( props, animation.opts.specialEasing ); 9877 9878 for ( ; index < length; index++ ) { 9879 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); 9880 if ( result ) { 9881 if ( isFunction( result.stop ) ) { 9882 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = 9883 result.stop.bind( result ); 9884 } 9885 return result; 9886 } 9887 } 9888 9889 jQuery.map( props, createTween, animation ); 9890 9891 if ( isFunction( animation.opts.start ) ) { 9892 animation.opts.start.call( elem, animation ); 9893 } 9894 9895 // Attach callbacks from options 9896 animation 9897 .progress( animation.opts.progress ) 9898 .done( animation.opts.done, animation.opts.complete ) 9899 .fail( animation.opts.fail ) 9900 .always( animation.opts.always ); 9901 9902 jQuery.fx.timer( 9903 jQuery.extend( tick, { 9904 elem: elem, 9905 anim: animation, 9906 queue: animation.opts.queue 9907 } ) 9908 ); 9909 9910 return animation; 9911} 9912 9913jQuery.Animation = jQuery.extend( Animation, { 9914 9915 tweeners: { 9916 "*": [ function( prop, value ) { 9917 var tween = this.createTween( prop, value ); 9918 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); 9919 return tween; 9920 } ] 9921 }, 9922 9923 tweener: function( props, callback ) { 9924 if ( isFunction( props ) ) { 9925 callback = props; 9926 props = [ "*" ]; 9927 } else { 9928 props = props.match( rnothtmlwhite ); 9929 } 9930 9931 var prop, 9932 index = 0, 9933 length = props.length; 9934 9935 for ( ; index < length; index++ ) { 9936 prop = props[ index ]; 9937 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; 9938 Animation.tweeners[ prop ].unshift( callback ); 9939 } 9940 }, 9941 9942 prefilters: [ defaultPrefilter ], 9943 9944 prefilter: function( callback, prepend ) { 9945 if ( prepend ) { 9946 Animation.prefilters.unshift( callback ); 9947 } else { 9948 Animation.prefilters.push( callback ); 9949 } 9950 } 9951} ); 9952 9953jQuery.speed = function( speed, easing, fn ) { 9954 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { 9955 complete: fn || !fn && easing || 9956 isFunction( speed ) && speed, 9957 duration: speed, 9958 easing: fn && easing || easing && !isFunction( easing ) && easing 9959 }; 9960 9961 // Go to the end state if fx are off 9962 if ( jQuery.fx.off ) { 9963 opt.duration = 0; 9964 9965 } else { 9966 if ( typeof opt.duration !== "number" ) { 9967 if ( opt.duration in jQuery.fx.speeds ) { 9968 opt.duration = jQuery.fx.speeds[ opt.duration ]; 9969 9970 } else { 9971 opt.duration = jQuery.fx.speeds._default; 9972 } 9973 } 9974 } 9975 9976 // Normalize opt.queue - true/undefined/null -> "fx" 9977 if ( opt.queue == null || opt.queue === true ) { 9978 opt.queue = "fx"; 9979 } 9980 9981 // Queueing 9982 opt.old = opt.complete; 9983 9984 opt.complete = function() { 9985 if ( isFunction( opt.old ) ) { 9986 opt.old.call( this ); 9987 } 9988 9989 if ( opt.queue ) { 9990 jQuery.dequeue( this, opt.queue ); 9991 } 9992 }; 9993 9994 return opt; 9995}; 9996 9997jQuery.fn.extend( { 9998 fadeTo: function( speed, to, easing, callback ) { 9999 10000 // Show any hidden elements after setting opacity to 0 10001 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() 10002 10003 // Animate to the value specified 10004 .end().animate( { opacity: to }, speed, easing, callback ); 10005 }, 10006 animate: function( prop, speed, easing, callback ) { 10007 var empty = jQuery.isEmptyObject( prop ), 10008 optall = jQuery.speed( speed, easing, callback ), 10009 doAnimation = function() { 10010 10011 // Operate on a copy of prop so per-property easing won't be lost 10012 var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 10013 10014 // Empty animations, or finishing resolves immediately 10015 if ( empty || dataPriv.get( this, "finish" ) ) { 10016 anim.stop( true ); 10017 } 10018 }; 10019 10020 doAnimation.finish = doAnimation; 10021 10022 return empty || optall.queue === false ? 10023 this.each( doAnimation ) : 10024 this.queue( optall.queue, doAnimation ); 10025 }, 10026 stop: function( type, clearQueue, gotoEnd ) { 10027 var stopQueue = function( hooks ) { 10028 var stop = hooks.stop; 10029 delete hooks.stop; 10030 stop( gotoEnd ); 10031 }; 10032 10033 if ( typeof type !== "string" ) { 10034 gotoEnd = clearQueue; 10035 clearQueue = type; 10036 type = undefined; 10037 } 10038 if ( clearQueue ) { 10039 this.queue( type || "fx", [] ); 10040 } 10041 10042 return this.each( function() { 10043 var dequeue = true, 10044 index = type != null && type + "queueHooks", 10045 timers = jQuery.timers, 10046 data = dataPriv.get( this ); 10047 10048 if ( index ) { 10049 if ( data[ index ] && data[ index ].stop ) { 10050 stopQueue( data[ index ] ); 10051 } 10052 } else { 10053 for ( index in data ) { 10054 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { 10055 stopQueue( data[ index ] ); 10056 } 10057 } 10058 } 10059 10060 for ( index = timers.length; index--; ) { 10061 if ( timers[ index ].elem === this && 10062 ( type == null || timers[ index ].queue === type ) ) { 10063 10064 timers[ index ].anim.stop( gotoEnd ); 10065 dequeue = false; 10066 timers.splice( index, 1 ); 10067 } 10068 } 10069 10070 // Start the next in the queue if the last step wasn't forced. 10071 // Timers currently will call their complete callbacks, which 10072 // will dequeue but only if they were gotoEnd. 10073 if ( dequeue || !gotoEnd ) { 10074 jQuery.dequeue( this, type ); 10075 } 10076 } ); 10077 }, 10078 finish: function( type ) { 10079 if ( type !== false ) { 10080 type = type || "fx"; 10081 } 10082 return this.each( function() { 10083 var index, 10084 data = dataPriv.get( this ), 10085 queue = data[ type + "queue" ], 10086 hooks = data[ type + "queueHooks" ], 10087 timers = jQuery.timers, 10088 length = queue ? queue.length : 0; 10089 10090 // Enable finishing flag on private data 10091 data.finish = true; 10092 10093 // Empty the queue first 10094 jQuery.queue( this, type, [] ); 10095 10096 if ( hooks && hooks.stop ) { 10097 hooks.stop.call( this, true ); 10098 } 10099 10100 // Look for any active animations, and finish them 10101 for ( index = timers.length; index--; ) { 10102 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 10103 timers[ index ].anim.stop( true ); 10104 timers.splice( index, 1 ); 10105 } 10106 } 10107 10108 // Look for any animations in the old queue and finish them 10109 for ( index = 0; index < length; index++ ) { 10110 if ( queue[ index ] && queue[ index ].finish ) { 10111 queue[ index ].finish.call( this ); 10112 } 10113 } 10114 10115 // Turn off finishing flag 10116 delete data.finish; 10117 } ); 10118 } 10119} ); 10120 10121jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { 10122 var cssFn = jQuery.fn[ name ]; 10123 jQuery.fn[ name ] = function( speed, easing, callback ) { 10124 return speed == null || typeof speed === "boolean" ? 10125 cssFn.apply( this, arguments ) : 10126 this.animate( genFx( name, true ), speed, easing, callback ); 10127 }; 10128} ); 10129 10130// Generate shortcuts for custom animations 10131jQuery.each( { 10132 slideDown: genFx( "show" ), 10133 slideUp: genFx( "hide" ), 10134 slideToggle: genFx( "toggle" ), 10135 fadeIn: { opacity: "show" }, 10136 fadeOut: { opacity: "hide" }, 10137 fadeToggle: { opacity: "toggle" } 10138}, function( name, props ) { 10139 jQuery.fn[ name ] = function( speed, easing, callback ) { 10140 return this.animate( props, speed, easing, callback ); 10141 }; 10142} ); 10143 10144jQuery.timers = []; 10145jQuery.fx.tick = function() { 10146 var timer, 10147 i = 0, 10148 timers = jQuery.timers; 10149 10150 fxNow = Date.now(); 10151 10152 for ( ; i < timers.length; i++ ) { 10153 timer = timers[ i ]; 10154 10155 // Run the timer and safely remove it when done (allowing for external removal) 10156 if ( !timer() && timers[ i ] === timer ) { 10157 timers.splice( i--, 1 ); 10158 } 10159 } 10160 10161 if ( !timers.length ) { 10162 jQuery.fx.stop(); 10163 } 10164 fxNow = undefined; 10165}; 10166 10167jQuery.fx.timer = function( timer ) { 10168 jQuery.timers.push( timer ); 10169 jQuery.fx.start(); 10170}; 10171 10172jQuery.fx.interval = 13; 10173jQuery.fx.start = function() { 10174 if ( inProgress ) { 10175 return; 10176 } 10177 10178 inProgress = true; 10179 schedule(); 10180}; 10181 10182jQuery.fx.stop = function() { 10183 inProgress = null; 10184}; 10185 10186jQuery.fx.speeds = { 10187 slow: 600, 10188 fast: 200, 10189 10190 // Default speed 10191 _default: 400 10192}; 10193 10194 10195// Based off of the plugin by Clint Helfers, with permission. 10196// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ 10197jQuery.fn.delay = function( time, type ) { 10198 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 10199 type = type || "fx"; 10200 10201 return this.queue( type, function( next, hooks ) { 10202 var timeout = window.setTimeout( next, time ); 10203 hooks.stop = function() { 10204 window.clearTimeout( timeout ); 10205 }; 10206 } ); 10207}; 10208 10209 10210( function() { 10211 var input = document.createElement( "input" ), 10212 select = document.createElement( "select" ), 10213 opt = select.appendChild( document.createElement( "option" ) ); 10214 10215 input.type = "checkbox"; 10216 10217 // Support: Android <=4.3 only 10218 // Default value for a checkbox should be "on" 10219 support.checkOn = input.value !== ""; 10220 10221 // Support: IE <=11 only 10222 // Must access selectedIndex to make default options select 10223 support.optSelected = opt.selected; 10224 10225 // Support: IE <=11 only 10226 // An input loses its value after becoming a radio 10227 input = document.createElement( "input" ); 10228 input.value = "t"; 10229 input.type = "radio"; 10230 support.radioValue = input.value === "t"; 10231} )(); 10232 10233 10234var boolHook, 10235 attrHandle = jQuery.expr.attrHandle; 10236 10237jQuery.fn.extend( { 10238 attr: function( name, value ) { 10239 return access( this, jQuery.attr, name, value, arguments.length > 1 ); 10240 }, 10241 10242 removeAttr: function( name ) { 10243 return this.each( function() { 10244 jQuery.removeAttr( this, name ); 10245 } ); 10246 } 10247} ); 10248 10249jQuery.extend( { 10250 attr: function( elem, name, value ) { 10251 var ret, hooks, 10252 nType = elem.nodeType; 10253 10254 // Don't get/set attributes on text, comment and attribute nodes 10255 if ( nType === 3 || nType === 8 || nType === 2 ) { 10256 return; 10257 } 10258 10259 // Fallback to prop when attributes are not supported 10260 if ( typeof elem.getAttribute === "undefined" ) { 10261 return jQuery.prop( elem, name, value ); 10262 } 10263 10264 // Attribute hooks are determined by the lowercase version 10265 // Grab necessary hook if one is defined 10266 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 10267 hooks = jQuery.attrHooks[ name.toLowerCase() ] || 10268 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); 10269 } 10270 10271 if ( value !== undefined ) { 10272 if ( value === null ) { 10273 jQuery.removeAttr( elem, name ); 10274 return; 10275 } 10276 10277 if ( hooks && "set" in hooks && 10278 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 10279 return ret; 10280 } 10281 10282 elem.setAttribute( name, value + "" ); 10283 return value; 10284 } 10285 10286 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 10287 return ret; 10288 } 10289 10290 ret = jQuery.find.attr( elem, name ); 10291 10292 // Non-existent attributes return null, we normalize to undefined 10293 return ret == null ? undefined : ret; 10294 }, 10295 10296 attrHooks: { 10297 type: { 10298 set: function( elem, value ) { 10299 if ( !support.radioValue && value === "radio" && 10300 nodeName( elem, "input" ) ) { 10301 var val = elem.value; 10302 elem.setAttribute( "type", value ); 10303 if ( val ) { 10304 elem.value = val; 10305 } 10306 return value; 10307 } 10308 } 10309 } 10310 }, 10311 10312 removeAttr: function( elem, value ) { 10313 var name, 10314 i = 0, 10315 10316 // Attribute names can contain non-HTML whitespace characters 10317 // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 10318 attrNames = value && value.match( rnothtmlwhite ); 10319 10320 if ( attrNames && elem.nodeType === 1 ) { 10321 while ( ( name = attrNames[ i++ ] ) ) { 10322 elem.removeAttribute( name ); 10323 } 10324 } 10325 } 10326} ); 10327 10328// Hooks for boolean attributes 10329boolHook = { 10330 set: function( elem, value, name ) { 10331 if ( value === false ) { 10332 10333 // Remove boolean attributes when set to false 10334 jQuery.removeAttr( elem, name ); 10335 } else { 10336 elem.setAttribute( name, name ); 10337 } 10338 return name; 10339 } 10340}; 10341 10342jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { 10343 var getter = attrHandle[ name ] || jQuery.find.attr; 10344 10345 attrHandle[ name ] = function( elem, name, isXML ) { 10346 var ret, handle, 10347 lowercaseName = name.toLowerCase(); 10348 10349 if ( !isXML ) { 10350 10351 // Avoid an infinite loop by temporarily removing this function from the getter 10352 handle = attrHandle[ lowercaseName ]; 10353 attrHandle[ lowercaseName ] = ret; 10354 ret = getter( elem, name, isXML ) != null ? 10355 lowercaseName : 10356 null; 10357 attrHandle[ lowercaseName ] = handle; 10358 } 10359 return ret; 10360 }; 10361} ); 10362 10363 10364 10365 10366var rfocusable = /^(?:input|select|textarea|button)$/i, 10367 rclickable = /^(?:a|area)$/i; 10368 10369jQuery.fn.extend( { 10370 prop: function( name, value ) { 10371 return access( this, jQuery.prop, name, value, arguments.length > 1 ); 10372 }, 10373 10374 removeProp: function( name ) { 10375 return this.each( function() { 10376 delete this[ jQuery.propFix[ name ] || name ]; 10377 } ); 10378 } 10379} ); 10380 10381jQuery.extend( { 10382 prop: function( elem, name, value ) { 10383 var ret, hooks, 10384 nType = elem.nodeType; 10385 10386 // Don't get/set properties on text, comment and attribute nodes 10387 if ( nType === 3 || nType === 8 || nType === 2 ) { 10388 return; 10389 } 10390 10391 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 10392 10393 // Fix name and attach hooks 10394 name = jQuery.propFix[ name ] || name; 10395 hooks = jQuery.propHooks[ name ]; 10396 } 10397 10398 if ( value !== undefined ) { 10399 if ( hooks && "set" in hooks && 10400 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 10401 return ret; 10402 } 10403 10404 return ( elem[ name ] = value ); 10405 } 10406 10407 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 10408 return ret; 10409 } 10410 10411 return elem[ name ]; 10412 }, 10413 10414 propHooks: { 10415 tabIndex: { 10416 get: function( elem ) { 10417 10418 // Support: IE <=9 - 11 only 10419 // elem.tabIndex doesn't always return the 10420 // correct value when it hasn't been explicitly set 10421 // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ 10422 // Use proper attribute retrieval(#12072) 10423 var tabindex = jQuery.find.attr( elem, "tabindex" ); 10424 10425 if ( tabindex ) { 10426 return parseInt( tabindex, 10 ); 10427 } 10428 10429 if ( 10430 rfocusable.test( elem.nodeName ) || 10431 rclickable.test( elem.nodeName ) && 10432 elem.href 10433 ) { 10434 return 0; 10435 } 10436 10437 return -1; 10438 } 10439 } 10440 }, 10441 10442 propFix: { 10443 "for": "htmlFor", 10444 "class": "className" 10445 } 10446} ); 10447 10448// Support: IE <=11 only 10449// Accessing the selectedIndex property 10450// forces the browser to respect setting selected 10451// on the option 10452// The getter ensures a default option is selected 10453// when in an optgroup 10454// eslint rule "no-unused-expressions" is disabled for this code 10455// since it considers such accessions noop 10456if ( !support.optSelected ) { 10457 jQuery.propHooks.selected = { 10458 get: function( elem ) { 10459 10460 /* eslint no-unused-expressions: "off" */ 10461 10462 var parent = elem.parentNode; 10463 if ( parent && parent.parentNode ) { 10464 parent.parentNode.selectedIndex; 10465 } 10466 return null; 10467 }, 10468 set: function( elem ) { 10469 10470 /* eslint no-unused-expressions: "off" */ 10471 10472 var parent = elem.parentNode; 10473 if ( parent ) { 10474 parent.selectedIndex; 10475 10476 if ( parent.parentNode ) { 10477 parent.parentNode.selectedIndex; 10478 } 10479 } 10480 } 10481 }; 10482} 10483 10484jQuery.each( [ 10485 "tabIndex", 10486 "readOnly", 10487 "maxLength", 10488 "cellSpacing", 10489 "cellPadding", 10490 "rowSpan", 10491 "colSpan", 10492 "useMap", 10493 "frameBorder", 10494 "contentEditable" 10495], function() { 10496 jQuery.propFix[ this.toLowerCase() ] = this; 10497} ); 10498 10499 10500 10501 10502 // Strip and collapse whitespace according to HTML spec 10503 // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace 10504 function stripAndCollapse( value ) { 10505 var tokens = value.match( rnothtmlwhite ) || []; 10506 return tokens.join( " " ); 10507 } 10508 10509 10510function getClass( elem ) { 10511 return elem.getAttribute && elem.getAttribute( "class" ) || ""; 10512} 10513 10514function classesToArray( value ) { 10515 if ( Array.isArray( value ) ) { 10516 return value; 10517 } 10518 if ( typeof value === "string" ) { 10519 return value.match( rnothtmlwhite ) || []; 10520 } 10521 return []; 10522} 10523 10524jQuery.fn.extend( { 10525 addClass: function( value ) { 10526 var classes, elem, cur, curValue, clazz, j, finalValue, 10527 i = 0; 10528 10529 if ( isFunction( value ) ) { 10530 return this.each( function( j ) { 10531 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); 10532 } ); 10533 } 10534 10535 classes = classesToArray( value ); 10536 10537 if ( classes.length ) { 10538 while ( ( elem = this[ i++ ] ) ) { 10539 curValue = getClass( elem ); 10540 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 10541 10542 if ( cur ) { 10543 j = 0; 10544 while ( ( clazz = classes[ j++ ] ) ) { 10545 if ( cur.indexOf( " " + clazz + " " ) < 0 ) { 10546 cur += clazz + " "; 10547 } 10548 } 10549 10550 // Only assign if different to avoid unneeded rendering. 10551 finalValue = stripAndCollapse( cur ); 10552 if ( curValue !== finalValue ) { 10553 elem.setAttribute( "class", finalValue ); 10554 } 10555 } 10556 } 10557 } 10558 10559 return this; 10560 }, 10561 10562 removeClass: function( value ) { 10563 var classes, elem, cur, curValue, clazz, j, finalValue, 10564 i = 0; 10565 10566 if ( isFunction( value ) ) { 10567 return this.each( function( j ) { 10568 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); 10569 } ); 10570 } 10571 10572 if ( !arguments.length ) { 10573 return this.attr( "class", "" ); 10574 } 10575 10576 classes = classesToArray( value ); 10577 10578 if ( classes.length ) { 10579 while ( ( elem = this[ i++ ] ) ) { 10580 curValue = getClass( elem ); 10581 10582 // This expression is here for better compressibility (see addClass) 10583 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 10584 10585 if ( cur ) { 10586 j = 0; 10587 while ( ( clazz = classes[ j++ ] ) ) { 10588 10589 // Remove *all* instances 10590 while ( cur.indexOf( " " + clazz + " " ) > -1 ) { 10591 cur = cur.replace( " " + clazz + " ", " " ); 10592 } 10593 } 10594 10595 // Only assign if different to avoid unneeded rendering. 10596 finalValue = stripAndCollapse( cur ); 10597 if ( curValue !== finalValue ) { 10598 elem.setAttribute( "class", finalValue ); 10599 } 10600 } 10601 } 10602 } 10603 10604 return this; 10605 }, 10606 10607 toggleClass: function( value, stateVal ) { 10608 var type = typeof value, 10609 isValidValue = type === "string" || Array.isArray( value ); 10610 10611 if ( typeof stateVal === "boolean" && isValidValue ) { 10612 return stateVal ? this.addClass( value ) : this.removeClass( value ); 10613 } 10614 10615 if ( isFunction( value ) ) { 10616 return this.each( function( i ) { 10617 jQuery( this ).toggleClass( 10618 value.call( this, i, getClass( this ), stateVal ), 10619 stateVal 10620 ); 10621 } ); 10622 } 10623 10624 return this.each( function() { 10625 var className, i, self, classNames; 10626 10627 if ( isValidValue ) { 10628 10629 // Toggle individual class names 10630 i = 0; 10631 self = jQuery( this ); 10632 classNames = classesToArray( value ); 10633 10634 while ( ( className = classNames[ i++ ] ) ) { 10635 10636 // Check each className given, space separated list 10637 if ( self.hasClass( className ) ) { 10638 self.removeClass( className ); 10639 } else { 10640 self.addClass( className ); 10641 } 10642 } 10643 10644 // Toggle whole class name 10645 } else if ( value === undefined || type === "boolean" ) { 10646 className = getClass( this ); 10647 if ( className ) { 10648 10649 // Store className if set 10650 dataPriv.set( this, "__className__", className ); 10651 } 10652 10653 // If the element has a class name or if we're passed `false`, 10654 // then remove the whole classname (if there was one, the above saved it). 10655 // Otherwise bring back whatever was previously saved (if anything), 10656 // falling back to the empty string if nothing was stored. 10657 if ( this.setAttribute ) { 10658 this.setAttribute( "class", 10659 className || value === false ? 10660 "" : 10661 dataPriv.get( this, "__className__" ) || "" 10662 ); 10663 } 10664 } 10665 } ); 10666 }, 10667 10668 hasClass: function( selector ) { 10669 var className, elem, 10670 i = 0; 10671 10672 className = " " + selector + " "; 10673 while ( ( elem = this[ i++ ] ) ) { 10674 if ( elem.nodeType === 1 && 10675 ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { 10676 return true; 10677 } 10678 } 10679 10680 return false; 10681 } 10682} ); 10683 10684 10685 10686 10687var rreturn = /\r/g; 10688 10689jQuery.fn.extend( { 10690 val: function( value ) { 10691 var hooks, ret, valueIsFunction, 10692 elem = this[ 0 ]; 10693 10694 if ( !arguments.length ) { 10695 if ( elem ) { 10696 hooks = jQuery.valHooks[ elem.type ] || 10697 jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 10698 10699 if ( hooks && 10700 "get" in hooks && 10701 ( ret = hooks.get( elem, "value" ) ) !== undefined 10702 ) { 10703 return ret; 10704 } 10705 10706 ret = elem.value; 10707 10708 // Handle most common string cases 10709 if ( typeof ret === "string" ) { 10710 return ret.replace( rreturn, "" ); 10711 } 10712 10713 // Handle cases where value is null/undef or number 10714 return ret == null ? "" : ret; 10715 } 10716 10717 return; 10718 } 10719 10720 valueIsFunction = isFunction( value ); 10721 10722 return this.each( function( i ) { 10723 var val; 10724 10725 if ( this.nodeType !== 1 ) { 10726 return; 10727 } 10728 10729 if ( valueIsFunction ) { 10730 val = value.call( this, i, jQuery( this ).val() ); 10731 } else { 10732 val = value; 10733 } 10734 10735 // Treat null/undefined as ""; convert numbers to string 10736 if ( val == null ) { 10737 val = ""; 10738 10739 } else if ( typeof val === "number" ) { 10740 val += ""; 10741 10742 } else if ( Array.isArray( val ) ) { 10743 val = jQuery.map( val, function( value ) { 10744 return value == null ? "" : value + ""; 10745 } ); 10746 } 10747 10748 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 10749 10750 // If set returns undefined, fall back to normal setting 10751 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { 10752 this.value = val; 10753 } 10754 } ); 10755 } 10756} ); 10757 10758jQuery.extend( { 10759 valHooks: { 10760 option: { 10761 get: function( elem ) { 10762 10763 var val = jQuery.find.attr( elem, "value" ); 10764 return val != null ? 10765 val : 10766 10767 // Support: IE <=10 - 11 only 10768 // option.text throws exceptions (#14686, #14858) 10769 // Strip and collapse whitespace 10770 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace 10771 stripAndCollapse( jQuery.text( elem ) ); 10772 } 10773 }, 10774 select: { 10775 get: function( elem ) { 10776 var value, option, i, 10777 options = elem.options, 10778 index = elem.selectedIndex, 10779 one = elem.type === "select-one", 10780 values = one ? null : [], 10781 max = one ? index + 1 : options.length; 10782 10783 if ( index < 0 ) { 10784 i = max; 10785 10786 } else { 10787 i = one ? index : 0; 10788 } 10789 10790 // Loop through all the selected options 10791 for ( ; i < max; i++ ) { 10792 option = options[ i ]; 10793 10794 // Support: IE <=9 only 10795 // IE8-9 doesn't update selected after form reset (#2551) 10796 if ( ( option.selected || i === index ) && 10797 10798 // Don't return options that are disabled or in a disabled optgroup 10799 !option.disabled && 10800 ( !option.parentNode.disabled || 10801 !nodeName( option.parentNode, "optgroup" ) ) ) { 10802 10803 // Get the specific value for the option 10804 value = jQuery( option ).val(); 10805 10806 // We don't need an array for one selects 10807 if ( one ) { 10808 return value; 10809 } 10810 10811 // Multi-Selects return an array 10812 values.push( value ); 10813 } 10814 } 10815 10816 return values; 10817 }, 10818 10819 set: function( elem, value ) { 10820 var optionSet, option, 10821 options = elem.options, 10822 values = jQuery.makeArray( value ), 10823 i = options.length; 10824 10825 while ( i-- ) { 10826 option = options[ i ]; 10827 10828 /* eslint-disable no-cond-assign */ 10829 10830 if ( option.selected = 10831 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 10832 ) { 10833 optionSet = true; 10834 } 10835 10836 /* eslint-enable no-cond-assign */ 10837 } 10838 10839 // Force browsers to behave consistently when non-matching value is set 10840 if ( !optionSet ) { 10841 elem.selectedIndex = -1; 10842 } 10843 return values; 10844 } 10845 } 10846 } 10847} ); 10848 10849// Radios and checkboxes getter/setter 10850jQuery.each( [ "radio", "checkbox" ], function() { 10851 jQuery.valHooks[ this ] = { 10852 set: function( elem, value ) { 10853 if ( Array.isArray( value ) ) { 10854 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); 10855 } 10856 } 10857 }; 10858 if ( !support.checkOn ) { 10859 jQuery.valHooks[ this ].get = function( elem ) { 10860 return elem.getAttribute( "value" ) === null ? "on" : elem.value; 10861 }; 10862 } 10863} ); 10864 10865 10866 10867 10868// Return jQuery for attributes-only inclusion 10869 10870 10871support.focusin = "onfocusin" in window; 10872 10873 10874var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, 10875 stopPropagationCallback = function( e ) { 10876 e.stopPropagation(); 10877 }; 10878 10879jQuery.extend( jQuery.event, { 10880 10881 trigger: function( event, data, elem, onlyHandlers ) { 10882 10883 var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, 10884 eventPath = [ elem || document ], 10885 type = hasOwn.call( event, "type" ) ? event.type : event, 10886 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; 10887 10888 cur = lastElement = tmp = elem = elem || document; 10889 10890 // Don't do events on text and comment nodes 10891 if ( elem.nodeType === 3 || elem.nodeType === 8 ) { 10892 return; 10893 } 10894 10895 // focus/blur morphs to focusin/out; ensure we're not firing them right now 10896 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { 10897 return; 10898 } 10899 10900 if ( type.indexOf( "." ) > -1 ) { 10901 10902 // Namespaced trigger; create a regexp to match event type in handle() 10903 namespaces = type.split( "." ); 10904 type = namespaces.shift(); 10905 namespaces.sort(); 10906 } 10907 ontype = type.indexOf( ":" ) < 0 && "on" + type; 10908 10909 // Caller can pass in a jQuery.Event object, Object, or just an event type string 10910 event = event[ jQuery.expando ] ? 10911 event : 10912 new jQuery.Event( type, typeof event === "object" && event ); 10913 10914 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) 10915 event.isTrigger = onlyHandlers ? 2 : 3; 10916 event.namespace = namespaces.join( "." ); 10917 event.rnamespace = event.namespace ? 10918 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : 10919 null; 10920 10921 // Clean up the event in case it is being reused 10922 event.result = undefined; 10923 if ( !event.target ) { 10924 event.target = elem; 10925 } 10926 10927 // Clone any incoming data and prepend the event, creating the handler arg list 10928 data = data == null ? 10929 [ event ] : 10930 jQuery.makeArray( data, [ event ] ); 10931 10932 // Allow special events to draw outside the lines 10933 special = jQuery.event.special[ type ] || {}; 10934 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { 10935 return; 10936 } 10937 10938 // Determine event propagation path in advance, per W3C events spec (#9951) 10939 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) 10940 if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { 10941 10942 bubbleType = special.delegateType || type; 10943 if ( !rfocusMorph.test( bubbleType + type ) ) { 10944 cur = cur.parentNode; 10945 } 10946 for ( ; cur; cur = cur.parentNode ) { 10947 eventPath.push( cur ); 10948 tmp = cur; 10949 } 10950 10951 // Only add window if we got to document (e.g., not plain obj or detached DOM) 10952 if ( tmp === ( elem.ownerDocument || document ) ) { 10953 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 10954 } 10955 } 10956 10957 // Fire handlers on the event path 10958 i = 0; 10959 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { 10960 lastElement = cur; 10961 event.type = i > 1 ? 10962 bubbleType : 10963 special.bindType || type; 10964 10965 // jQuery handler 10966 handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] && 10967 dataPriv.get( cur, "handle" ); 10968 if ( handle ) { 10969 handle.apply( cur, data ); 10970 } 10971 10972 // Native handler 10973 handle = ontype && cur[ ontype ]; 10974 if ( handle && handle.apply && acceptData( cur ) ) { 10975 event.result = handle.apply( cur, data ); 10976 if ( event.result === false ) { 10977 event.preventDefault(); 10978 } 10979 } 10980 } 10981 event.type = type; 10982 10983 // If nobody prevented the default action, do it now 10984 if ( !onlyHandlers && !event.isDefaultPrevented() ) { 10985 10986 if ( ( !special._default || 10987 special._default.apply( eventPath.pop(), data ) === false ) && 10988 acceptData( elem ) ) { 10989 10990 // Call a native DOM method on the target with the same name as the event. 10991 // Don't do default actions on window, that's where global variables be (#6170) 10992 if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { 10993 10994 // Don't re-trigger an onFOO event when we call its FOO() method 10995 tmp = elem[ ontype ]; 10996 10997 if ( tmp ) { 10998 elem[ ontype ] = null; 10999 } 11000 11001 // Prevent re-triggering of the same event, since we already bubbled it above 11002 jQuery.event.triggered = type; 11003 11004 if ( event.isPropagationStopped() ) { 11005 lastElement.addEventListener( type, stopPropagationCallback ); 11006 } 11007 11008 elem[ type ](); 11009 11010 if ( event.isPropagationStopped() ) { 11011 lastElement.removeEventListener( type, stopPropagationCallback ); 11012 } 11013 11014 jQuery.event.triggered = undefined; 11015 11016 if ( tmp ) { 11017 elem[ ontype ] = tmp; 11018 } 11019 } 11020 } 11021 } 11022 11023 return event.result; 11024 }, 11025 11026 // Piggyback on a donor event to simulate a different one 11027 // Used only for `focus(in | out)` events 11028 simulate: function( type, elem, event ) { 11029 var e = jQuery.extend( 11030 new jQuery.Event(), 11031 event, 11032 { 11033 type: type, 11034 isSimulated: true 11035 } 11036 ); 11037 11038 jQuery.event.trigger( e, null, elem ); 11039 } 11040 11041} ); 11042 11043jQuery.fn.extend( { 11044 11045 trigger: function( type, data ) { 11046 return this.each( function() { 11047 jQuery.event.trigger( type, data, this ); 11048 } ); 11049 }, 11050 triggerHandler: function( type, data ) { 11051 var elem = this[ 0 ]; 11052 if ( elem ) { 11053 return jQuery.event.trigger( type, data, elem, true ); 11054 } 11055 } 11056} ); 11057 11058 11059// Support: Firefox <=44 11060// Firefox doesn't have focus(in | out) events 11061// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 11062// 11063// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 11064// focus(in | out) events fire after focus & blur events, 11065// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order 11066// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 11067if ( !support.focusin ) { 11068 jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { 11069 11070 // Attach a single capturing handler on the document while someone wants focusin/focusout 11071 var handler = function( event ) { 11072 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); 11073 }; 11074 11075 jQuery.event.special[ fix ] = { 11076 setup: function() { 11077 11078 // Handle: regular nodes (via `this.ownerDocument`), window 11079 // (via `this.document`) & document (via `this`). 11080 var doc = this.ownerDocument || this.document || this, 11081 attaches = dataPriv.access( doc, fix ); 11082 11083 if ( !attaches ) { 11084 doc.addEventListener( orig, handler, true ); 11085 } 11086 dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); 11087 }, 11088 teardown: function() { 11089 var doc = this.ownerDocument || this.document || this, 11090 attaches = dataPriv.access( doc, fix ) - 1; 11091 11092 if ( !attaches ) { 11093 doc.removeEventListener( orig, handler, true ); 11094 dataPriv.remove( doc, fix ); 11095 11096 } else { 11097 dataPriv.access( doc, fix, attaches ); 11098 } 11099 } 11100 }; 11101 } ); 11102} 11103var location = window.location; 11104 11105var nonce = { guid: Date.now() }; 11106 11107var rquery = ( /\?/ ); 11108 11109 11110 11111// Cross-browser xml parsing 11112jQuery.parseXML = function( data ) { 11113 var xml, parserErrorElem; 11114 if ( !data || typeof data !== "string" ) { 11115 return null; 11116 } 11117 11118 // Support: IE 9 - 11 only 11119 // IE throws on parseFromString with invalid input. 11120 try { 11121 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); 11122 } catch ( e ) {} 11123 11124 parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ]; 11125 if ( !xml || parserErrorElem ) { 11126 jQuery.error( "Invalid XML: " + ( 11127 parserErrorElem ? 11128 jQuery.map( parserErrorElem.childNodes, function( el ) { 11129 return el.textContent; 11130 } ).join( "\n" ) : 11131 data 11132 ) ); 11133 } 11134 return xml; 11135}; 11136 11137 11138var 11139 rbracket = /\[\]$/, 11140 rCRLF = /\r?\n/g, 11141 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 11142 rsubmittable = /^(?:input|select|textarea|keygen)/i; 11143 11144function buildParams( prefix, obj, traditional, add ) { 11145 var name; 11146 11147 if ( Array.isArray( obj ) ) { 11148 11149 // Serialize array item. 11150 jQuery.each( obj, function( i, v ) { 11151 if ( traditional || rbracket.test( prefix ) ) { 11152 11153 // Treat each array item as a scalar. 11154 add( prefix, v ); 11155 11156 } else { 11157 11158 // Item is non-scalar (array or object), encode its numeric index. 11159 buildParams( 11160 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", 11161 v, 11162 traditional, 11163 add 11164 ); 11165 } 11166 } ); 11167 11168 } else if ( !traditional && toType( obj ) === "object" ) { 11169 11170 // Serialize object item. 11171 for ( name in obj ) { 11172 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 11173 } 11174 11175 } else { 11176 11177 // Serialize scalar item. 11178 add( prefix, obj ); 11179 } 11180} 11181 11182// Serialize an array of form elements or a set of 11183// key/values into a query string 11184jQuery.param = function( a, traditional ) { 11185 var prefix, 11186 s = [], 11187 add = function( key, valueOrFunction ) { 11188 11189 // If value is a function, invoke it and use its return value 11190 var value = isFunction( valueOrFunction ) ? 11191 valueOrFunction() : 11192 valueOrFunction; 11193 11194 s[ s.length ] = encodeURIComponent( key ) + "=" + 11195 encodeURIComponent( value == null ? "" : value ); 11196 }; 11197 11198 if ( a == null ) { 11199 return ""; 11200 } 11201 11202 // If an array was passed in, assume that it is an array of form elements. 11203 if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 11204 11205 // Serialize the form elements 11206 jQuery.each( a, function() { 11207 add( this.name, this.value ); 11208 } ); 11209 11210 } else { 11211 11212 // If traditional, encode the "old" way (the way 1.3.2 or older 11213 // did it), otherwise encode params recursively. 11214 for ( prefix in a ) { 11215 buildParams( prefix, a[ prefix ], traditional, add ); 11216 } 11217 } 11218 11219 // Return the resulting serialization 11220 return s.join( "&" ); 11221}; 11222 11223jQuery.fn.extend( { 11224 serialize: function() { 11225 return jQuery.param( this.serializeArray() ); 11226 }, 11227 serializeArray: function() { 11228 return this.map( function() { 11229 11230 // Can add propHook for "elements" to filter or add form elements 11231 var elements = jQuery.prop( this, "elements" ); 11232 return elements ? jQuery.makeArray( elements ) : this; 11233 } ).filter( function() { 11234 var type = this.type; 11235 11236 // Use .is( ":disabled" ) so that fieldset[disabled] works 11237 return this.name && !jQuery( this ).is( ":disabled" ) && 11238 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 11239 ( this.checked || !rcheckableType.test( type ) ); 11240 } ).map( function( _i, elem ) { 11241 var val = jQuery( this ).val(); 11242 11243 if ( val == null ) { 11244 return null; 11245 } 11246 11247 if ( Array.isArray( val ) ) { 11248 return jQuery.map( val, function( val ) { 11249 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 11250 } ); 11251 } 11252 11253 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 11254 } ).get(); 11255 } 11256} ); 11257 11258 11259var 11260 r20 = /%20/g, 11261 rhash = /#.*$/, 11262 rantiCache = /([?&])_=[^&]*/, 11263 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, 11264 11265 // #7653, #8125, #8152: local protocol detection 11266 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 11267 rnoContent = /^(?:GET|HEAD)$/, 11268 rprotocol = /^\/\//, 11269 11270 /* Prefilters 11271 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 11272 * 2) These are called: 11273 * - BEFORE asking for a transport 11274 * - AFTER param serialization (s.data is a string if s.processData is true) 11275 * 3) key is the dataType 11276 * 4) the catchall symbol "*" can be used 11277 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 11278 */ 11279 prefilters = {}, 11280 11281 /* Transports bindings 11282 * 1) key is the dataType 11283 * 2) the catchall symbol "*" can be used 11284 * 3) selection will start with transport dataType and THEN go to "*" if needed 11285 */ 11286 transports = {}, 11287 11288 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression 11289 allTypes = "*/".concat( "*" ), 11290 11291 // Anchor tag for parsing the document origin 11292 originAnchor = document.createElement( "a" ); 11293 11294originAnchor.href = location.href; 11295 11296// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 11297function addToPrefiltersOrTransports( structure ) { 11298 11299 // dataTypeExpression is optional and defaults to "*" 11300 return function( dataTypeExpression, func ) { 11301 11302 if ( typeof dataTypeExpression !== "string" ) { 11303 func = dataTypeExpression; 11304 dataTypeExpression = "*"; 11305 } 11306 11307 var dataType, 11308 i = 0, 11309 dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; 11310 11311 if ( isFunction( func ) ) { 11312 11313 // For each dataType in the dataTypeExpression 11314 while ( ( dataType = dataTypes[ i++ ] ) ) { 11315 11316 // Prepend if requested 11317 if ( dataType[ 0 ] === "+" ) { 11318 dataType = dataType.slice( 1 ) || "*"; 11319 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); 11320 11321 // Otherwise append 11322 } else { 11323 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); 11324 } 11325 } 11326 } 11327 }; 11328} 11329 11330// Base inspection function for prefilters and transports 11331function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { 11332 11333 var inspected = {}, 11334 seekingTransport = ( structure === transports ); 11335 11336 function inspect( dataType ) { 11337 var selected; 11338 inspected[ dataType ] = true; 11339 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { 11340 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); 11341 if ( typeof dataTypeOrTransport === "string" && 11342 !seekingTransport && !inspected[ dataTypeOrTransport ] ) { 11343 11344 options.dataTypes.unshift( dataTypeOrTransport ); 11345 inspect( dataTypeOrTransport ); 11346 return false; 11347 } else if ( seekingTransport ) { 11348 return !( selected = dataTypeOrTransport ); 11349 } 11350 } ); 11351 return selected; 11352 } 11353 11354 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); 11355} 11356 11357// A special extend for ajax options 11358// that takes "flat" options (not to be deep extended) 11359// Fixes #9887 11360function ajaxExtend( target, src ) { 11361 var key, deep, 11362 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 11363 11364 for ( key in src ) { 11365 if ( src[ key ] !== undefined ) { 11366 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; 11367 } 11368 } 11369 if ( deep ) { 11370 jQuery.extend( true, target, deep ); 11371 } 11372 11373 return target; 11374} 11375 11376/* Handles responses to an ajax request: 11377 * - finds the right dataType (mediates between content-type and expected dataType) 11378 * - returns the corresponding response 11379 */ 11380function ajaxHandleResponses( s, jqXHR, responses ) { 11381 11382 var ct, type, finalDataType, firstDataType, 11383 contents = s.contents, 11384 dataTypes = s.dataTypes; 11385 11386 // Remove auto dataType and get content-type in the process 11387 while ( dataTypes[ 0 ] === "*" ) { 11388 dataTypes.shift(); 11389 if ( ct === undefined ) { 11390 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); 11391 } 11392 } 11393 11394 // Check if we're dealing with a known content-type 11395 if ( ct ) { 11396 for ( type in contents ) { 11397 if ( contents[ type ] && contents[ type ].test( ct ) ) { 11398 dataTypes.unshift( type ); 11399 break; 11400 } 11401 } 11402 } 11403 11404 // Check to see if we have a response for the expected dataType 11405 if ( dataTypes[ 0 ] in responses ) { 11406 finalDataType = dataTypes[ 0 ]; 11407 } else { 11408 11409 // Try convertible dataTypes 11410 for ( type in responses ) { 11411 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { 11412 finalDataType = type; 11413 break; 11414 } 11415 if ( !firstDataType ) { 11416 firstDataType = type; 11417 } 11418 } 11419 11420 // Or just use first one 11421 finalDataType = finalDataType || firstDataType; 11422 } 11423 11424 // If we found a dataType 11425 // We add the dataType to the list if needed 11426 // and return the corresponding response 11427 if ( finalDataType ) { 11428 if ( finalDataType !== dataTypes[ 0 ] ) { 11429 dataTypes.unshift( finalDataType ); 11430 } 11431 return responses[ finalDataType ]; 11432 } 11433} 11434 11435/* Chain conversions given the request and the original response 11436 * Also sets the responseXXX fields on the jqXHR instance 11437 */ 11438function ajaxConvert( s, response, jqXHR, isSuccess ) { 11439 var conv2, current, conv, tmp, prev, 11440 converters = {}, 11441 11442 // Work with a copy of dataTypes in case we need to modify it for conversion 11443 dataTypes = s.dataTypes.slice(); 11444 11445 // Create converters map with lowercased keys 11446 if ( dataTypes[ 1 ] ) { 11447 for ( conv in s.converters ) { 11448 converters[ conv.toLowerCase() ] = s.converters[ conv ]; 11449 } 11450 } 11451 11452 current = dataTypes.shift(); 11453 11454 // Convert to each sequential dataType 11455 while ( current ) { 11456 11457 if ( s.responseFields[ current ] ) { 11458 jqXHR[ s.responseFields[ current ] ] = response; 11459 } 11460 11461 // Apply the dataFilter if provided 11462 if ( !prev && isSuccess && s.dataFilter ) { 11463 response = s.dataFilter( response, s.dataType ); 11464 } 11465 11466 prev = current; 11467 current = dataTypes.shift(); 11468 11469 if ( current ) { 11470 11471 // There's only work to do if current dataType is non-auto 11472 if ( current === "*" ) { 11473 11474 current = prev; 11475 11476 // Convert response if prev dataType is non-auto and differs from current 11477 } else if ( prev !== "*" && prev !== current ) { 11478 11479 // Seek a direct converter 11480 conv = converters[ prev + " " + current ] || converters[ "* " + current ]; 11481 11482 // If none found, seek a pair 11483 if ( !conv ) { 11484 for ( conv2 in converters ) { 11485 11486 // If conv2 outputs current 11487 tmp = conv2.split( " " ); 11488 if ( tmp[ 1 ] === current ) { 11489 11490 // If prev can be converted to accepted input 11491 conv = converters[ prev + " " + tmp[ 0 ] ] || 11492 converters[ "* " + tmp[ 0 ] ]; 11493 if ( conv ) { 11494 11495 // Condense equivalence converters 11496 if ( conv === true ) { 11497 conv = converters[ conv2 ]; 11498 11499 // Otherwise, insert the intermediate dataType 11500 } else if ( converters[ conv2 ] !== true ) { 11501 current = tmp[ 0 ]; 11502 dataTypes.unshift( tmp[ 1 ] ); 11503 } 11504 break; 11505 } 11506 } 11507 } 11508 } 11509 11510 // Apply converter (if not an equivalence) 11511 if ( conv !== true ) { 11512 11513 // Unless errors are allowed to bubble, catch and return them 11514 if ( conv && s.throws ) { 11515 response = conv( response ); 11516 } else { 11517 try { 11518 response = conv( response ); 11519 } catch ( e ) { 11520 return { 11521 state: "parsererror", 11522 error: conv ? e : "No conversion from " + prev + " to " + current 11523 }; 11524 } 11525 } 11526 } 11527 } 11528 } 11529 } 11530 11531 return { state: "success", data: response }; 11532} 11533 11534jQuery.extend( { 11535 11536 // Counter for holding the number of active queries 11537 active: 0, 11538 11539 // Last-Modified header cache for next request 11540 lastModified: {}, 11541 etag: {}, 11542 11543 ajaxSettings: { 11544 url: location.href, 11545 type: "GET", 11546 isLocal: rlocalProtocol.test( location.protocol ), 11547 global: true, 11548 processData: true, 11549 async: true, 11550 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 11551 11552 /* 11553 timeout: 0, 11554 data: null, 11555 dataType: null, 11556 username: null, 11557 password: null, 11558 cache: null, 11559 throws: false, 11560 traditional: false, 11561 headers: {}, 11562 */ 11563 11564 accepts: { 11565 "*": allTypes, 11566 text: "text/plain", 11567 html: "text/html", 11568 xml: "application/xml, text/xml", 11569 json: "application/json, text/javascript" 11570 }, 11571 11572 contents: { 11573 xml: /\bxml\b/, 11574 html: /\bhtml/, 11575 json: /\bjson\b/ 11576 }, 11577 11578 responseFields: { 11579 xml: "responseXML", 11580 text: "responseText", 11581 json: "responseJSON" 11582 }, 11583 11584 // Data converters 11585 // Keys separate source (or catchall "*") and destination types with a single space 11586 converters: { 11587 11588 // Convert anything to text 11589 "* text": String, 11590 11591 // Text to html (true = no transformation) 11592 "text html": true, 11593 11594 // Evaluate text as a json expression 11595 "text json": JSON.parse, 11596 11597 // Parse text as xml 11598 "text xml": jQuery.parseXML 11599 }, 11600 11601 // For options that shouldn't be deep extended: 11602 // you can add your own custom options here if 11603 // and when you create one that shouldn't be 11604 // deep extended (see ajaxExtend) 11605 flatOptions: { 11606 url: true, 11607 context: true 11608 } 11609 }, 11610 11611 // Creates a full fledged settings object into target 11612 // with both ajaxSettings and settings fields. 11613 // If target is omitted, writes into ajaxSettings. 11614 ajaxSetup: function( target, settings ) { 11615 return settings ? 11616 11617 // Building a settings object 11618 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : 11619 11620 // Extending ajaxSettings 11621 ajaxExtend( jQuery.ajaxSettings, target ); 11622 }, 11623 11624 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), 11625 ajaxTransport: addToPrefiltersOrTransports( transports ), 11626 11627 // Main method 11628 ajax: function( url, options ) { 11629 11630 // If url is an object, simulate pre-1.5 signature 11631 if ( typeof url === "object" ) { 11632 options = url; 11633 url = undefined; 11634 } 11635 11636 // Force options to be an object 11637 options = options || {}; 11638 11639 var transport, 11640 11641 // URL without anti-cache param 11642 cacheURL, 11643 11644 // Response headers 11645 responseHeadersString, 11646 responseHeaders, 11647 11648 // timeout handle 11649 timeoutTimer, 11650 11651 // Url cleanup var 11652 urlAnchor, 11653 11654 // Request state (becomes false upon send and true upon completion) 11655 completed, 11656 11657 // To know if global events are to be dispatched 11658 fireGlobals, 11659 11660 // Loop variable 11661 i, 11662 11663 // uncached part of the url 11664 uncached, 11665 11666 // Create the final options object 11667 s = jQuery.ajaxSetup( {}, options ), 11668 11669 // Callbacks context 11670 callbackContext = s.context || s, 11671 11672 // Context for global events is callbackContext if it is a DOM node or jQuery collection 11673 globalEventContext = s.context && 11674 ( callbackContext.nodeType || callbackContext.jquery ) ? 11675 jQuery( callbackContext ) : 11676 jQuery.event, 11677 11678 // Deferreds 11679 deferred = jQuery.Deferred(), 11680 completeDeferred = jQuery.Callbacks( "once memory" ), 11681 11682 // Status-dependent callbacks 11683 statusCode = s.statusCode || {}, 11684 11685 // Headers (they are sent all at once) 11686 requestHeaders = {}, 11687 requestHeadersNames = {}, 11688 11689 // Default abort message 11690 strAbort = "canceled", 11691 11692 // Fake xhr 11693 jqXHR = { 11694 readyState: 0, 11695 11696 // Builds headers hashtable if needed 11697 getResponseHeader: function( key ) { 11698 var match; 11699 if ( completed ) { 11700 if ( !responseHeaders ) { 11701 responseHeaders = {}; 11702 while ( ( match = rheaders.exec( responseHeadersString ) ) ) { 11703 responseHeaders[ match[ 1 ].toLowerCase() + " " ] = 11704 ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) 11705 .concat( match[ 2 ] ); 11706 } 11707 } 11708 match = responseHeaders[ key.toLowerCase() + " " ]; 11709 } 11710 return match == null ? null : match.join( ", " ); 11711 }, 11712 11713 // Raw string 11714 getAllResponseHeaders: function() { 11715 return completed ? responseHeadersString : null; 11716 }, 11717 11718 // Caches the header 11719 setRequestHeader: function( name, value ) { 11720 if ( completed == null ) { 11721 name = requestHeadersNames[ name.toLowerCase() ] = 11722 requestHeadersNames[ name.toLowerCase() ] || name; 11723 requestHeaders[ name ] = value; 11724 } 11725 return this; 11726 }, 11727 11728 // Overrides response content-type header 11729 overrideMimeType: function( type ) { 11730 if ( completed == null ) { 11731 s.mimeType = type; 11732 } 11733 return this; 11734 }, 11735 11736 // Status-dependent callbacks 11737 statusCode: function( map ) { 11738 var code; 11739 if ( map ) { 11740 if ( completed ) { 11741 11742 // Execute the appropriate callbacks 11743 jqXHR.always( map[ jqXHR.status ] ); 11744 } else { 11745 11746 // Lazy-add the new callbacks in a way that preserves old ones 11747 for ( code in map ) { 11748 statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; 11749 } 11750 } 11751 } 11752 return this; 11753 }, 11754 11755 // Cancel the request 11756 abort: function( statusText ) { 11757 var finalText = statusText || strAbort; 11758 if ( transport ) { 11759 transport.abort( finalText ); 11760 } 11761 done( 0, finalText ); 11762 return this; 11763 } 11764 }; 11765 11766 // Attach deferreds 11767 deferred.promise( jqXHR ); 11768 11769 // Add protocol if not provided (prefilters might expect it) 11770 // Handle falsy url in the settings object (#10093: consistency with old signature) 11771 // We also use the url parameter if available 11772 s.url = ( ( url || s.url || location.href ) + "" ) 11773 .replace( rprotocol, location.protocol + "//" ); 11774 11775 // Alias method option to type as per ticket #12004 11776 s.type = options.method || options.type || s.method || s.type; 11777 11778 // Extract dataTypes list 11779 s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; 11780 11781 // A cross-domain request is in order when the origin doesn't match the current origin. 11782 if ( s.crossDomain == null ) { 11783 urlAnchor = document.createElement( "a" ); 11784 11785 // Support: IE <=8 - 11, Edge 12 - 15 11786 // IE throws exception on accessing the href property if url is malformed, 11787 // e.g. http://example.com:80x/ 11788 try { 11789 urlAnchor.href = s.url; 11790 11791 // Support: IE <=8 - 11 only 11792 // Anchor's host property isn't correctly set when s.url is relative 11793 urlAnchor.href = urlAnchor.href; 11794 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== 11795 urlAnchor.protocol + "//" + urlAnchor.host; 11796 } catch ( e ) { 11797 11798 // If there is an error parsing the URL, assume it is crossDomain, 11799 // it can be rejected by the transport if it is invalid 11800 s.crossDomain = true; 11801 } 11802 } 11803 11804 // Convert data if not already a string 11805 if ( s.data && s.processData && typeof s.data !== "string" ) { 11806 s.data = jQuery.param( s.data, s.traditional ); 11807 } 11808 11809 // Apply prefilters 11810 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 11811 11812 // If request was aborted inside a prefilter, stop there 11813 if ( completed ) { 11814 return jqXHR; 11815 } 11816 11817 // We can fire global events as of now if asked to 11818 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) 11819 fireGlobals = jQuery.event && s.global; 11820 11821 // Watch for a new set of requests 11822 if ( fireGlobals && jQuery.active++ === 0 ) { 11823 jQuery.event.trigger( "ajaxStart" ); 11824 } 11825 11826 // Uppercase the type 11827 s.type = s.type.toUpperCase(); 11828 11829 // Determine if request has content 11830 s.hasContent = !rnoContent.test( s.type ); 11831 11832 // Save the URL in case we're toying with the If-Modified-Since 11833 // and/or If-None-Match header later on 11834 // Remove hash to simplify url manipulation 11835 cacheURL = s.url.replace( rhash, "" ); 11836 11837 // More options handling for requests with no content 11838 if ( !s.hasContent ) { 11839 11840 // Remember the hash so we can put it back 11841 uncached = s.url.slice( cacheURL.length ); 11842 11843 // If data is available and should be processed, append data to url 11844 if ( s.data && ( s.processData || typeof s.data === "string" ) ) { 11845 cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; 11846 11847 // #9682: remove data so that it's not used in an eventual retry 11848 delete s.data; 11849 } 11850 11851 // Add or update anti-cache param if needed 11852 if ( s.cache === false ) { 11853 cacheURL = cacheURL.replace( rantiCache, "$1" ); 11854 uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + 11855 uncached; 11856 } 11857 11858 // Put hash and anti-cache on the URL that will be requested (gh-1732) 11859 s.url = cacheURL + uncached; 11860 11861 // Change '%20' to '+' if this is encoded form body content (gh-2658) 11862 } else if ( s.data && s.processData && 11863 ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { 11864 s.data = s.data.replace( r20, "+" ); 11865 } 11866 11867 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 11868 if ( s.ifModified ) { 11869 if ( jQuery.lastModified[ cacheURL ] ) { 11870 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); 11871 } 11872 if ( jQuery.etag[ cacheURL ] ) { 11873 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); 11874 } 11875 } 11876 11877 // Set the correct header, if data is being sent 11878 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { 11879 jqXHR.setRequestHeader( "Content-Type", s.contentType ); 11880 } 11881 11882 // Set the Accepts header for the server, depending on the dataType 11883 jqXHR.setRequestHeader( 11884 "Accept", 11885 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? 11886 s.accepts[ s.dataTypes[ 0 ] ] + 11887 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 11888 s.accepts[ "*" ] 11889 ); 11890 11891 // Check for headers option 11892 for ( i in s.headers ) { 11893 jqXHR.setRequestHeader( i, s.headers[ i ] ); 11894 } 11895 11896 // Allow custom headers/mimetypes and early abort 11897 if ( s.beforeSend && 11898 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { 11899 11900 // Abort if not done already and return 11901 return jqXHR.abort(); 11902 } 11903 11904 // Aborting is no longer a cancellation 11905 strAbort = "abort"; 11906 11907 // Install callbacks on deferreds 11908 completeDeferred.add( s.complete ); 11909 jqXHR.done( s.success ); 11910 jqXHR.fail( s.error ); 11911 11912 // Get transport 11913 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); 11914 11915 // If no transport, we auto-abort 11916 if ( !transport ) { 11917 done( -1, "No Transport" ); 11918 } else { 11919 jqXHR.readyState = 1; 11920 11921 // Send global event 11922 if ( fireGlobals ) { 11923 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); 11924 } 11925 11926 // If request was aborted inside ajaxSend, stop there 11927 if ( completed ) { 11928 return jqXHR; 11929 } 11930 11931 // Timeout 11932 if ( s.async && s.timeout > 0 ) { 11933 timeoutTimer = window.setTimeout( function() { 11934 jqXHR.abort( "timeout" ); 11935 }, s.timeout ); 11936 } 11937 11938 try { 11939 completed = false; 11940 transport.send( requestHeaders, done ); 11941 } catch ( e ) { 11942 11943 // Rethrow post-completion exceptions 11944 if ( completed ) { 11945 throw e; 11946 } 11947 11948 // Propagate others as results 11949 done( -1, e ); 11950 } 11951 } 11952 11953 // Callback for when everything is done 11954 function done( status, nativeStatusText, responses, headers ) { 11955 var isSuccess, success, error, response, modified, 11956 statusText = nativeStatusText; 11957 11958 // Ignore repeat invocations 11959 if ( completed ) { 11960 return; 11961 } 11962 11963 completed = true; 11964 11965 // Clear timeout if it exists 11966 if ( timeoutTimer ) { 11967 window.clearTimeout( timeoutTimer ); 11968 } 11969 11970 // Dereference transport for early garbage collection 11971 // (no matter how long the jqXHR object will be used) 11972 transport = undefined; 11973 11974 // Cache response headers 11975 responseHeadersString = headers || ""; 11976 11977 // Set readyState 11978 jqXHR.readyState = status > 0 ? 4 : 0; 11979 11980 // Determine if successful 11981 isSuccess = status >= 200 && status < 300 || status === 304; 11982 11983 // Get response data 11984 if ( responses ) { 11985 response = ajaxHandleResponses( s, jqXHR, responses ); 11986 } 11987 11988 // Use a noop converter for missing script but not if jsonp 11989 if ( !isSuccess && 11990 jQuery.inArray( "script", s.dataTypes ) > -1 && 11991 jQuery.inArray( "json", s.dataTypes ) < 0 ) { 11992 s.converters[ "text script" ] = function() {}; 11993 } 11994 11995 // Convert no matter what (that way responseXXX fields are always set) 11996 response = ajaxConvert( s, response, jqXHR, isSuccess ); 11997 11998 // If successful, handle type chaining 11999 if ( isSuccess ) { 12000 12001 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 12002 if ( s.ifModified ) { 12003 modified = jqXHR.getResponseHeader( "Last-Modified" ); 12004 if ( modified ) { 12005 jQuery.lastModified[ cacheURL ] = modified; 12006 } 12007 modified = jqXHR.getResponseHeader( "etag" ); 12008 if ( modified ) { 12009 jQuery.etag[ cacheURL ] = modified; 12010 } 12011 } 12012 12013 // if no content 12014 if ( status === 204 || s.type === "HEAD" ) { 12015 statusText = "nocontent"; 12016 12017 // if not modified 12018 } else if ( status === 304 ) { 12019 statusText = "notmodified"; 12020 12021 // If we have data, let's convert it 12022 } else { 12023 statusText = response.state; 12024 success = response.data; 12025 error = response.error; 12026 isSuccess = !error; 12027 } 12028 } else { 12029 12030 // Extract error from statusText and normalize for non-aborts 12031 error = statusText; 12032 if ( status || !statusText ) { 12033 statusText = "error"; 12034 if ( status < 0 ) { 12035 status = 0; 12036 } 12037 } 12038 } 12039 12040 // Set data for the fake xhr object 12041 jqXHR.status = status; 12042 jqXHR.statusText = ( nativeStatusText || statusText ) + ""; 12043 12044 // Success/Error 12045 if ( isSuccess ) { 12046 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); 12047 } else { 12048 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); 12049 } 12050 12051 // Status-dependent callbacks 12052 jqXHR.statusCode( statusCode ); 12053 statusCode = undefined; 12054 12055 if ( fireGlobals ) { 12056 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", 12057 [ jqXHR, s, isSuccess ? success : error ] ); 12058 } 12059 12060 // Complete 12061 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); 12062 12063 if ( fireGlobals ) { 12064 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 12065 12066 // Handle the global AJAX counter 12067 if ( !( --jQuery.active ) ) { 12068 jQuery.event.trigger( "ajaxStop" ); 12069 } 12070 } 12071 } 12072 12073 return jqXHR; 12074 }, 12075 12076 getJSON: function( url, data, callback ) { 12077 return jQuery.get( url, data, callback, "json" ); 12078 }, 12079 12080 getScript: function( url, callback ) { 12081 return jQuery.get( url, undefined, callback, "script" ); 12082 } 12083} ); 12084 12085jQuery.each( [ "get", "post" ], function( _i, method ) { 12086 jQuery[ method ] = function( url, data, callback, type ) { 12087 12088 // Shift arguments if data argument was omitted 12089 if ( isFunction( data ) ) { 12090 type = type || callback; 12091 callback = data; 12092 data = undefined; 12093 } 12094 12095 // The url can be an options object (which then must have .url) 12096 return jQuery.ajax( jQuery.extend( { 12097 url: url, 12098 type: method, 12099 dataType: type, 12100 data: data, 12101 success: callback 12102 }, jQuery.isPlainObject( url ) && url ) ); 12103 }; 12104} ); 12105 12106jQuery.ajaxPrefilter( function( s ) { 12107 var i; 12108 for ( i in s.headers ) { 12109 if ( i.toLowerCase() === "content-type" ) { 12110 s.contentType = s.headers[ i ] || ""; 12111 } 12112 } 12113} ); 12114 12115 12116jQuery._evalUrl = function( url, options, doc ) { 12117 return jQuery.ajax( { 12118 url: url, 12119 12120 // Make this explicit, since user can override this through ajaxSetup (#11264) 12121 type: "GET", 12122 dataType: "script", 12123 cache: true, 12124 async: false, 12125 global: false, 12126 12127 // Only evaluate the response if it is successful (gh-4126) 12128 // dataFilter is not invoked for failure responses, so using it instead 12129 // of the default converter is kludgy but it works. 12130 converters: { 12131 "text script": function() {} 12132 }, 12133 dataFilter: function( response ) { 12134 jQuery.globalEval( response, options, doc ); 12135 } 12136 } ); 12137}; 12138 12139 12140jQuery.fn.extend( { 12141 wrapAll: function( html ) { 12142 var wrap; 12143 12144 if ( this[ 0 ] ) { 12145 if ( isFunction( html ) ) { 12146 html = html.call( this[ 0 ] ); 12147 } 12148 12149 // The elements to wrap the target around 12150 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); 12151 12152 if ( this[ 0 ].parentNode ) { 12153 wrap.insertBefore( this[ 0 ] ); 12154 } 12155 12156 wrap.map( function() { 12157 var elem = this; 12158 12159 while ( elem.firstElementChild ) { 12160 elem = elem.firstElementChild; 12161 } 12162 12163 return elem; 12164 } ).append( this ); 12165 } 12166 12167 return this; 12168 }, 12169 12170 wrapInner: function( html ) { 12171 if ( isFunction( html ) ) { 12172 return this.each( function( i ) { 12173 jQuery( this ).wrapInner( html.call( this, i ) ); 12174 } ); 12175 } 12176 12177 return this.each( function() { 12178 var self = jQuery( this ), 12179 contents = self.contents(); 12180 12181 if ( contents.length ) { 12182 contents.wrapAll( html ); 12183 12184 } else { 12185 self.append( html ); 12186 } 12187 } ); 12188 }, 12189 12190 wrap: function( html ) { 12191 var htmlIsFunction = isFunction( html ); 12192 12193 return this.each( function( i ) { 12194 jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); 12195 } ); 12196 }, 12197 12198 unwrap: function( selector ) { 12199 this.parent( selector ).not( "body" ).each( function() { 12200 jQuery( this ).replaceWith( this.childNodes ); 12201 } ); 12202 return this; 12203 } 12204} ); 12205 12206 12207jQuery.expr.pseudos.hidden = function( elem ) { 12208 return !jQuery.expr.pseudos.visible( elem ); 12209}; 12210jQuery.expr.pseudos.visible = function( elem ) { 12211 return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); 12212}; 12213 12214 12215 12216 12217jQuery.ajaxSettings.xhr = function() { 12218 try { 12219 return new window.XMLHttpRequest(); 12220 } catch ( e ) {} 12221}; 12222 12223var xhrSuccessStatus = { 12224 12225 // File protocol always yields status code 0, assume 200 12226 0: 200, 12227 12228 // Support: IE <=9 only 12229 // #1450: sometimes IE returns 1223 when it should be 204 12230 1223: 204 12231 }, 12232 xhrSupported = jQuery.ajaxSettings.xhr(); 12233 12234support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 12235support.ajax = xhrSupported = !!xhrSupported; 12236 12237jQuery.ajaxTransport( function( options ) { 12238 var callback, errorCallback; 12239 12240 // Cross domain only allowed if supported through XMLHttpRequest 12241 if ( support.cors || xhrSupported && !options.crossDomain ) { 12242 return { 12243 send: function( headers, complete ) { 12244 var i, 12245 xhr = options.xhr(); 12246 12247 xhr.open( 12248 options.type, 12249 options.url, 12250 options.async, 12251 options.username, 12252 options.password 12253 ); 12254 12255 // Apply custom fields if provided 12256 if ( options.xhrFields ) { 12257 for ( i in options.xhrFields ) { 12258 xhr[ i ] = options.xhrFields[ i ]; 12259 } 12260 } 12261 12262 // Override mime type if needed 12263 if ( options.mimeType && xhr.overrideMimeType ) { 12264 xhr.overrideMimeType( options.mimeType ); 12265 } 12266 12267 // X-Requested-With header 12268 // For cross-domain requests, seeing as conditions for a preflight are 12269 // akin to a jigsaw puzzle, we simply never set it to be sure. 12270 // (it can always be set on a per-request basis or even using ajaxSetup) 12271 // For same-domain requests, won't change header if already provided. 12272 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { 12273 headers[ "X-Requested-With" ] = "XMLHttpRequest"; 12274 } 12275 12276 // Set headers 12277 for ( i in headers ) { 12278 xhr.setRequestHeader( i, headers[ i ] ); 12279 } 12280 12281 // Callback 12282 callback = function( type ) { 12283 return function() { 12284 if ( callback ) { 12285 callback = errorCallback = xhr.onload = 12286 xhr.onerror = xhr.onabort = xhr.ontimeout = 12287 xhr.onreadystatechange = null; 12288 12289 if ( type === "abort" ) { 12290 xhr.abort(); 12291 } else if ( type === "error" ) { 12292 12293 // Support: IE <=9 only 12294 // On a manual native abort, IE9 throws 12295 // errors on any property access that is not readyState 12296 if ( typeof xhr.status !== "number" ) { 12297 complete( 0, "error" ); 12298 } else { 12299 complete( 12300 12301 // File: protocol always yields status 0; see #8605, #14207 12302 xhr.status, 12303 xhr.statusText 12304 ); 12305 } 12306 } else { 12307 complete( 12308 xhrSuccessStatus[ xhr.status ] || xhr.status, 12309 xhr.statusText, 12310 12311 // Support: IE <=9 only 12312 // IE9 has no XHR2 but throws on binary (trac-11426) 12313 // For XHR2 non-text, let the caller handle it (gh-2498) 12314 ( xhr.responseType || "text" ) !== "text" || 12315 typeof xhr.responseText !== "string" ? 12316 { binary: xhr.response } : 12317 { text: xhr.responseText }, 12318 xhr.getAllResponseHeaders() 12319 ); 12320 } 12321 } 12322 }; 12323 }; 12324 12325 // Listen to events 12326 xhr.onload = callback(); 12327 errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); 12328 12329 // Support: IE 9 only 12330 // Use onreadystatechange to replace onabort 12331 // to handle uncaught aborts 12332 if ( xhr.onabort !== undefined ) { 12333 xhr.onabort = errorCallback; 12334 } else { 12335 xhr.onreadystatechange = function() { 12336 12337 // Check readyState before timeout as it changes 12338 if ( xhr.readyState === 4 ) { 12339 12340 // Allow onerror to be called first, 12341 // but that will not handle a native abort 12342 // Also, save errorCallback to a variable 12343 // as xhr.onerror cannot be accessed 12344 window.setTimeout( function() { 12345 if ( callback ) { 12346 errorCallback(); 12347 } 12348 } ); 12349 } 12350 }; 12351 } 12352 12353 // Create the abort callback 12354 callback = callback( "abort" ); 12355 12356 try { 12357 12358 // Do send the request (this may raise an exception) 12359 xhr.send( options.hasContent && options.data || null ); 12360 } catch ( e ) { 12361 12362 // #14683: Only rethrow if this hasn't been notified as an error yet 12363 if ( callback ) { 12364 throw e; 12365 } 12366 } 12367 }, 12368 12369 abort: function() { 12370 if ( callback ) { 12371 callback(); 12372 } 12373 } 12374 }; 12375 } 12376} ); 12377 12378 12379 12380 12381// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) 12382jQuery.ajaxPrefilter( function( s ) { 12383 if ( s.crossDomain ) { 12384 s.contents.script = false; 12385 } 12386} ); 12387 12388// Install script dataType 12389jQuery.ajaxSetup( { 12390 accepts: { 12391 script: "text/javascript, application/javascript, " + 12392 "application/ecmascript, application/x-ecmascript" 12393 }, 12394 contents: { 12395 script: /\b(?:java|ecma)script\b/ 12396 }, 12397 converters: { 12398 "text script": function( text ) { 12399 jQuery.globalEval( text ); 12400 return text; 12401 } 12402 } 12403} ); 12404 12405// Handle cache's special case and crossDomain 12406jQuery.ajaxPrefilter( "script", function( s ) { 12407 if ( s.cache === undefined ) { 12408 s.cache = false; 12409 } 12410 if ( s.crossDomain ) { 12411 s.type = "GET"; 12412 } 12413} ); 12414 12415// Bind script tag hack transport 12416jQuery.ajaxTransport( "script", function( s ) { 12417 12418 // This transport only deals with cross domain or forced-by-attrs requests 12419 if ( s.crossDomain || s.scriptAttrs ) { 12420 var script, callback; 12421 return { 12422 send: function( _, complete ) { 12423 script = jQuery( "<script>" ) 12424 .attr( s.scriptAttrs || {} ) 12425 .prop( { charset: s.scriptCharset, src: s.url } ) 12426 .on( "load error", callback = function( evt ) { 12427 script.remove(); 12428 callback = null; 12429 if ( evt ) { 12430 complete( evt.type === "error" ? 404 : 200, evt.type ); 12431 } 12432 } ); 12433 12434 // Use native DOM manipulation to avoid our domManip AJAX trickery 12435 document.head.appendChild( script[ 0 ] ); 12436 }, 12437 abort: function() { 12438 if ( callback ) { 12439 callback(); 12440 } 12441 } 12442 }; 12443 } 12444} ); 12445 12446 12447 12448 12449var oldCallbacks = [], 12450 rjsonp = /(=)\?(?=&|$)|\?\?/; 12451 12452// Default jsonp settings 12453jQuery.ajaxSetup( { 12454 jsonp: "callback", 12455 jsonpCallback: function() { 12456 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) ); 12457 this[ callback ] = true; 12458 return callback; 12459 } 12460} ); 12461 12462// Detect, normalize options and install callbacks for jsonp requests 12463jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 12464 12465 var callbackName, overwritten, responseContainer, 12466 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 12467 "url" : 12468 typeof s.data === "string" && 12469 ( s.contentType || "" ) 12470 .indexOf( "application/x-www-form-urlencoded" ) === 0 && 12471 rjsonp.test( s.data ) && "data" 12472 ); 12473 12474 // Handle iff the expected data type is "jsonp" or we have a parameter to set 12475 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 12476 12477 // Get callback name, remembering preexisting value associated with it 12478 callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ? 12479 s.jsonpCallback() : 12480 s.jsonpCallback; 12481 12482 // Insert callback into url or form data 12483 if ( jsonProp ) { 12484 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 12485 } else if ( s.jsonp !== false ) { 12486 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 12487 } 12488 12489 // Use data converter to retrieve json after script execution 12490 s.converters[ "script json" ] = function() { 12491 if ( !responseContainer ) { 12492 jQuery.error( callbackName + " was not called" ); 12493 } 12494 return responseContainer[ 0 ]; 12495 }; 12496 12497 // Force json dataType 12498 s.dataTypes[ 0 ] = "json"; 12499 12500 // Install callback 12501 overwritten = window[ callbackName ]; 12502 window[ callbackName ] = function() { 12503 responseContainer = arguments; 12504 }; 12505 12506 // Clean-up function (fires after converters) 12507 jqXHR.always( function() { 12508 12509 // If previous value didn't exist - remove it 12510 if ( overwritten === undefined ) { 12511 jQuery( window ).removeProp( callbackName ); 12512 12513 // Otherwise restore preexisting value 12514 } else { 12515 window[ callbackName ] = overwritten; 12516 } 12517 12518 // Save back as free 12519 if ( s[ callbackName ] ) { 12520 12521 // Make sure that re-using the options doesn't screw things around 12522 s.jsonpCallback = originalSettings.jsonpCallback; 12523 12524 // Save the callback name for future use 12525 oldCallbacks.push( callbackName ); 12526 } 12527 12528 // Call if it was a function and we have a response 12529 if ( responseContainer && isFunction( overwritten ) ) { 12530 overwritten( responseContainer[ 0 ] ); 12531 } 12532 12533 responseContainer = overwritten = undefined; 12534 } ); 12535 12536 // Delegate to script 12537 return "script"; 12538 } 12539} ); 12540 12541 12542 12543 12544// Support: Safari 8 only 12545// In Safari 8 documents created via document.implementation.createHTMLDocument 12546// collapse sibling forms: the second one becomes a child of the first one. 12547// Because of that, this security measure has to be disabled in Safari 8. 12548// https://bugs.webkit.org/show_bug.cgi?id=137337 12549support.createHTMLDocument = ( function() { 12550 var body = document.implementation.createHTMLDocument( "" ).body; 12551 body.innerHTML = "<form></form><form></form>"; 12552 return body.childNodes.length === 2; 12553} )(); 12554 12555 12556// Argument "data" should be string of html 12557// context (optional): If specified, the fragment will be created in this context, 12558// defaults to document 12559// keepScripts (optional): If true, will include scripts passed in the html string 12560jQuery.parseHTML = function( data, context, keepScripts ) { 12561 if ( typeof data !== "string" ) { 12562 return []; 12563 } 12564 if ( typeof context === "boolean" ) { 12565 keepScripts = context; 12566 context = false; 12567 } 12568 12569 var base, parsed, scripts; 12570 12571 if ( !context ) { 12572 12573 // Stop scripts or inline event handlers from being executed immediately 12574 // by using document.implementation 12575 if ( support.createHTMLDocument ) { 12576 context = document.implementation.createHTMLDocument( "" ); 12577 12578 // Set the base href for the created document 12579 // so any parsed elements with URLs 12580 // are based on the document's URL (gh-2965) 12581 base = context.createElement( "base" ); 12582 base.href = document.location.href; 12583 context.head.appendChild( base ); 12584 } else { 12585 context = document; 12586 } 12587 } 12588 12589 parsed = rsingleTag.exec( data ); 12590 scripts = !keepScripts && []; 12591 12592 // Single tag 12593 if ( parsed ) { 12594 return [ context.createElement( parsed[ 1 ] ) ]; 12595 } 12596 12597 parsed = buildFragment( [ data ], context, scripts ); 12598 12599 if ( scripts && scripts.length ) { 12600 jQuery( scripts ).remove(); 12601 } 12602 12603 return jQuery.merge( [], parsed.childNodes ); 12604}; 12605 12606 12607/** 12608 * Load a url into a page 12609 */ 12610jQuery.fn.load = function( url, params, callback ) { 12611 var selector, type, response, 12612 self = this, 12613 off = url.indexOf( " " ); 12614 12615 if ( off > -1 ) { 12616 selector = stripAndCollapse( url.slice( off ) ); 12617 url = url.slice( 0, off ); 12618 } 12619 12620 // If it's a function 12621 if ( isFunction( params ) ) { 12622 12623 // We assume that it's the callback 12624 callback = params; 12625 params = undefined; 12626 12627 // Otherwise, build a param string 12628 } else if ( params && typeof params === "object" ) { 12629 type = "POST"; 12630 } 12631 12632 // If we have elements to modify, make the request 12633 if ( self.length > 0 ) { 12634 jQuery.ajax( { 12635 url: url, 12636 12637 // If "type" variable is undefined, then "GET" method will be used. 12638 // Make value of this field explicit since 12639 // user can override it through ajaxSetup method 12640 type: type || "GET", 12641 dataType: "html", 12642 data: params 12643 } ).done( function( responseText ) { 12644 12645 // Save response for use in complete callback 12646 response = arguments; 12647 12648 self.html( selector ? 12649 12650 // If a selector was specified, locate the right elements in a dummy div 12651 // Exclude scripts to avoid IE 'Permission Denied' errors 12652 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : 12653 12654 // Otherwise use the full result 12655 responseText ); 12656 12657 // If the request succeeds, this function gets "data", "status", "jqXHR" 12658 // but they are ignored because response was set above. 12659 // If it fails, this function gets "jqXHR", "status", "error" 12660 } ).always( callback && function( jqXHR, status ) { 12661 self.each( function() { 12662 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); 12663 } ); 12664 } ); 12665 } 12666 12667 return this; 12668}; 12669 12670 12671 12672 12673jQuery.expr.pseudos.animated = function( elem ) { 12674 return jQuery.grep( jQuery.timers, function( fn ) { 12675 return elem === fn.elem; 12676 } ).length; 12677}; 12678 12679 12680 12681 12682jQuery.offset = { 12683 setOffset: function( elem, options, i ) { 12684 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, 12685 position = jQuery.css( elem, "position" ), 12686 curElem = jQuery( elem ), 12687 props = {}; 12688 12689 // Set position first, in-case top/left are set even on static elem 12690 if ( position === "static" ) { 12691 elem.style.position = "relative"; 12692 } 12693 12694 curOffset = curElem.offset(); 12695 curCSSTop = jQuery.css( elem, "top" ); 12696 curCSSLeft = jQuery.css( elem, "left" ); 12697 calculatePosition = ( position === "absolute" || position === "fixed" ) && 12698 ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; 12699 12700 // Need to be able to calculate position if either 12701 // top or left is auto and position is either absolute or fixed 12702 if ( calculatePosition ) { 12703 curPosition = curElem.position(); 12704 curTop = curPosition.top; 12705 curLeft = curPosition.left; 12706 12707 } else { 12708 curTop = parseFloat( curCSSTop ) || 0; 12709 curLeft = parseFloat( curCSSLeft ) || 0; 12710 } 12711 12712 if ( isFunction( options ) ) { 12713 12714 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) 12715 options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); 12716 } 12717 12718 if ( options.top != null ) { 12719 props.top = ( options.top - curOffset.top ) + curTop; 12720 } 12721 if ( options.left != null ) { 12722 props.left = ( options.left - curOffset.left ) + curLeft; 12723 } 12724 12725 if ( "using" in options ) { 12726 options.using.call( elem, props ); 12727 12728 } else { 12729 curElem.css( props ); 12730 } 12731 } 12732}; 12733 12734jQuery.fn.extend( { 12735 12736 // offset() relates an element's border box to the document origin 12737 offset: function( options ) { 12738 12739 // Preserve chaining for setter 12740 if ( arguments.length ) { 12741 return options === undefined ? 12742 this : 12743 this.each( function( i ) { 12744 jQuery.offset.setOffset( this, options, i ); 12745 } ); 12746 } 12747 12748 var rect, win, 12749 elem = this[ 0 ]; 12750 12751 if ( !elem ) { 12752 return; 12753 } 12754 12755 // Return zeros for disconnected and hidden (display: none) elements (gh-2310) 12756 // Support: IE <=11 only 12757 // Running getBoundingClientRect on a 12758 // disconnected node in IE throws an error 12759 if ( !elem.getClientRects().length ) { 12760 return { top: 0, left: 0 }; 12761 } 12762 12763 // Get document-relative position by adding viewport scroll to viewport-relative gBCR 12764 rect = elem.getBoundingClientRect(); 12765 win = elem.ownerDocument.defaultView; 12766 return { 12767 top: rect.top + win.pageYOffset, 12768 left: rect.left + win.pageXOffset 12769 }; 12770 }, 12771 12772 // position() relates an element's margin box to its offset parent's padding box 12773 // This corresponds to the behavior of CSS absolute positioning 12774 position: function() { 12775 if ( !this[ 0 ] ) { 12776 return; 12777 } 12778 12779 var offsetParent, offset, doc, 12780 elem = this[ 0 ], 12781 parentOffset = { top: 0, left: 0 }; 12782 12783 // position:fixed elements are offset from the viewport, which itself always has zero offset 12784 if ( jQuery.css( elem, "position" ) === "fixed" ) { 12785 12786 // Assume position:fixed implies availability of getBoundingClientRect 12787 offset = elem.getBoundingClientRect(); 12788 12789 } else { 12790 offset = this.offset(); 12791 12792 // Account for the *real* offset parent, which can be the document or its root element 12793 // when a statically positioned element is identified 12794 doc = elem.ownerDocument; 12795 offsetParent = elem.offsetParent || doc.documentElement; 12796 while ( offsetParent && 12797 ( offsetParent === doc.body || offsetParent === doc.documentElement ) && 12798 jQuery.css( offsetParent, "position" ) === "static" ) { 12799 12800 offsetParent = offsetParent.parentNode; 12801 } 12802 if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) { 12803 12804 // Incorporate borders into its offset, since they are outside its content origin 12805 parentOffset = jQuery( offsetParent ).offset(); 12806 parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true ); 12807 parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true ); 12808 } 12809 } 12810 12811 // Subtract parent offsets and element margins 12812 return { 12813 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), 12814 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) 12815 }; 12816 }, 12817 12818 // This method will return documentElement in the following cases: 12819 // 1) For the element inside the iframe without offsetParent, this method will return 12820 // documentElement of the parent window 12821 // 2) For the hidden or detached element 12822 // 3) For body or html element, i.e. in case of the html node - it will return itself 12823 // 12824 // but those exceptions were never presented as a real life use-cases 12825 // and might be considered as more preferable results. 12826 // 12827 // This logic, however, is not guaranteed and can change at any point in the future 12828 offsetParent: function() { 12829 return this.map( function() { 12830 var offsetParent = this.offsetParent; 12831 12832 while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { 12833 offsetParent = offsetParent.offsetParent; 12834 } 12835 12836 return offsetParent || documentElement; 12837 } ); 12838 } 12839} ); 12840 12841// Create scrollLeft and scrollTop methods 12842jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { 12843 var top = "pageYOffset" === prop; 12844 12845 jQuery.fn[ method ] = function( val ) { 12846 return access( this, function( elem, method, val ) { 12847 12848 // Coalesce documents and windows 12849 var win; 12850 if ( isWindow( elem ) ) { 12851 win = elem; 12852 } else if ( elem.nodeType === 9 ) { 12853 win = elem.defaultView; 12854 } 12855 12856 if ( val === undefined ) { 12857 return win ? win[ prop ] : elem[ method ]; 12858 } 12859 12860 if ( win ) { 12861 win.scrollTo( 12862 !top ? val : win.pageXOffset, 12863 top ? val : win.pageYOffset 12864 ); 12865 12866 } else { 12867 elem[ method ] = val; 12868 } 12869 }, method, val, arguments.length ); 12870 }; 12871} ); 12872 12873// Support: Safari <=7 - 9.1, Chrome <=37 - 49 12874// Add the top/left cssHooks using jQuery.fn.position 12875// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 12876// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347 12877// getComputedStyle returns percent when specified for top/left/bottom/right; 12878// rather than make the css module depend on the offset module, just check for it here 12879jQuery.each( [ "top", "left" ], function( _i, prop ) { 12880 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, 12881 function( elem, computed ) { 12882 if ( computed ) { 12883 computed = curCSS( elem, prop ); 12884 12885 // If curCSS returns percentage, fallback to offset 12886 return rnumnonpx.test( computed ) ? 12887 jQuery( elem ).position()[ prop ] + "px" : 12888 computed; 12889 } 12890 } 12891 ); 12892} ); 12893 12894 12895// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 12896jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { 12897 jQuery.each( { 12898 padding: "inner" + name, 12899 content: type, 12900 "": "outer" + name 12901 }, function( defaultExtra, funcName ) { 12902 12903 // Margin is only for outerHeight, outerWidth 12904 jQuery.fn[ funcName ] = function( margin, value ) { 12905 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 12906 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 12907 12908 return access( this, function( elem, type, value ) { 12909 var doc; 12910 12911 if ( isWindow( elem ) ) { 12912 12913 // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729) 12914 return funcName.indexOf( "outer" ) === 0 ? 12915 elem[ "inner" + name ] : 12916 elem.document.documentElement[ "client" + name ]; 12917 } 12918 12919 // Get document width or height 12920 if ( elem.nodeType === 9 ) { 12921 doc = elem.documentElement; 12922 12923 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 12924 // whichever is greatest 12925 return Math.max( 12926 elem.body[ "scroll" + name ], doc[ "scroll" + name ], 12927 elem.body[ "offset" + name ], doc[ "offset" + name ], 12928 doc[ "client" + name ] 12929 ); 12930 } 12931 12932 return value === undefined ? 12933 12934 // Get width or height on the element, requesting but not forcing parseFloat 12935 jQuery.css( elem, type, extra ) : 12936 12937 // Set width or height on the element 12938 jQuery.style( elem, type, value, extra ); 12939 }, type, chainable ? margin : undefined, chainable ); 12940 }; 12941 } ); 12942} ); 12943 12944 12945jQuery.each( [ 12946 "ajaxStart", 12947 "ajaxStop", 12948 "ajaxComplete", 12949 "ajaxError", 12950 "ajaxSuccess", 12951 "ajaxSend" 12952], function( _i, type ) { 12953 jQuery.fn[ type ] = function( fn ) { 12954 return this.on( type, fn ); 12955 }; 12956} ); 12957 12958 12959 12960 12961jQuery.fn.extend( { 12962 12963 bind: function( types, data, fn ) { 12964 return this.on( types, null, data, fn ); 12965 }, 12966 unbind: function( types, fn ) { 12967 return this.off( types, null, fn ); 12968 }, 12969 12970 delegate: function( selector, types, data, fn ) { 12971 return this.on( types, selector, data, fn ); 12972 }, 12973 undelegate: function( selector, types, fn ) { 12974 12975 // ( namespace ) or ( selector, types [, fn] ) 12976 return arguments.length === 1 ? 12977 this.off( selector, "**" ) : 12978 this.off( types, selector || "**", fn ); 12979 }, 12980 12981 hover: function( fnOver, fnOut ) { 12982 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 12983 } 12984} ); 12985 12986jQuery.each( 12987 ( "blur focus focusin focusout resize scroll click dblclick " + 12988 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 12989 "change select submit keydown keypress keyup contextmenu" ).split( " " ), 12990 function( _i, name ) { 12991 12992 // Handle event binding 12993 jQuery.fn[ name ] = function( data, fn ) { 12994 return arguments.length > 0 ? 12995 this.on( name, null, data, fn ) : 12996 this.trigger( name ); 12997 }; 12998 } 12999); 13000 13001 13002 13003 13004// Support: Android <=4.0 only 13005// Make sure we trim BOM and NBSP 13006var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; 13007 13008// Bind a function to a context, optionally partially applying any 13009// arguments. 13010// jQuery.proxy is deprecated to promote standards (specifically Function#bind) 13011// However, it is not slated for removal any time soon 13012jQuery.proxy = function( fn, context ) { 13013 var tmp, args, proxy; 13014 13015 if ( typeof context === "string" ) { 13016 tmp = fn[ context ]; 13017 context = fn; 13018 fn = tmp; 13019 } 13020 13021 // Quick check to determine if target is callable, in the spec 13022 // this throws a TypeError, but we will just return undefined. 13023 if ( !isFunction( fn ) ) { 13024 return undefined; 13025 } 13026 13027 // Simulated bind 13028 args = slice.call( arguments, 2 ); 13029 proxy = function() { 13030 return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); 13031 }; 13032 13033 // Set the guid of unique handler to the same of original handler, so it can be removed 13034 proxy.guid = fn.guid = fn.guid || jQuery.guid++; 13035 13036 return proxy; 13037}; 13038 13039jQuery.holdReady = function( hold ) { 13040 if ( hold ) { 13041 jQuery.readyWait++; 13042 } else { 13043 jQuery.ready( true ); 13044 } 13045}; 13046jQuery.isArray = Array.isArray; 13047jQuery.parseJSON = JSON.parse; 13048jQuery.nodeName = nodeName; 13049jQuery.isFunction = isFunction; 13050jQuery.isWindow = isWindow; 13051jQuery.camelCase = camelCase; 13052jQuery.type = toType; 13053 13054jQuery.now = Date.now; 13055 13056jQuery.isNumeric = function( obj ) { 13057 13058 // As of jQuery 3.0, isNumeric is limited to 13059 // strings and numbers (primitives or objects) 13060 // that can be coerced to finite numbers (gh-2662) 13061 var type = jQuery.type( obj ); 13062 return ( type === "number" || type === "string" ) && 13063 13064 // parseFloat NaNs numeric-cast false positives ("") 13065 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 13066 // subtraction forces infinities to NaN 13067 !isNaN( obj - parseFloat( obj ) ); 13068}; 13069 13070jQuery.trim = function( text ) { 13071 return text == null ? 13072 "" : 13073 ( text + "" ).replace( rtrim, "" ); 13074}; 13075 13076 13077 13078// Register as a named AMD module, since jQuery can be concatenated with other 13079// files that may use define, but not via a proper concatenation script that 13080// understands anonymous AMD modules. A named AMD is safest and most robust 13081// way to register. Lowercase jquery is used because AMD module names are 13082// derived from file names, and jQuery is normally delivered in a lowercase 13083// file name. Do this after creating the global so that if an AMD module wants 13084// to call noConflict to hide this version of jQuery, it will work. 13085 13086// Note that for maximum portability, libraries that are not jQuery should 13087// declare themselves as anonymous modules, and avoid setting a global if an 13088// AMD loader is present. jQuery is a special case. For more information, see 13089// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 13090 13091if ( true ) { 13092 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() { 13093 return jQuery; 13094 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 13095 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 13096} 13097 13098 13099 13100 13101var 13102 13103 // Map over jQuery in case of overwrite 13104 _jQuery = window.jQuery, 13105 13106 // Map over the $ in case of overwrite 13107 _$ = window.$; 13108 13109jQuery.noConflict = function( deep ) { 13110 if ( window.$ === jQuery ) { 13111 window.$ = _$; 13112 } 13113 13114 if ( deep && window.jQuery === jQuery ) { 13115 window.jQuery = _jQuery; 13116 } 13117 13118 return jQuery; 13119}; 13120 13121// Expose jQuery and $ identifiers, even in AMD 13122// (#7102#comment:10, https://github.com/jquery/jquery/pull/557) 13123// and CommonJS for browser emulators (#13566) 13124if ( typeof noGlobal === "undefined" ) { 13125 window.jQuery = window.$ = jQuery; 13126} 13127 13128 13129 13130 13131return jQuery; 13132} ); 13133 13134 13135/***/ })
vendor: 4,221 bytes, lines 13135-13236
13135, 13136 13137/***/ "jquery": 13138/*!********************!*\ 13139 !*** external "$" ***! 13140 \********************/ 13141/***/ ((module) => { 13142 13143"use strict"; 13144module.exports = $; 13145 13146/***/ }) 13147 13148/******/ }); 13149/************************************************************************/ 13150/******/ // The module cache 13151/******/ var __webpack_module_cache__ = {}; 13152/******/ 13153/******/ // The require function 13154/******/ function __webpack_require__(moduleId) { 13155/******/ // Check if module is in cache 13156/******/ var cachedModule = __webpack_module_cache__[moduleId]; 13157/******/ if (cachedModule !== undefined) { 13158/******/ return cachedModule.exports; 13159/******/ } 13160/******/ // Create a new module (and put it into the cache) 13161/******/ var module = __webpack_module_cache__[moduleId] = { 13162/******/ // no module.id needed 13163/******/ // no module.loaded needed 13164/******/ exports: {} 13165/******/ }; 13166/******/ 13167/******/ // Execute the module function 13168/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); 13169/******/ 13170/******/ // Return the exports of the module 13171/******/ return module.exports; 13172/******/ } 13173/******/ 13174/************************************************************************/ 13175/******/ /* webpack/runtime/compat get default export */ 13176/******/ (() => { 13177/******/ // getDefaultExport function for compatibility with non-harmony modules 13178/******/ __webpack_require__.n = (module) => { 13179/******/ var getter = module && module.__esModule ? 13180/******/ () => (module['default']) : 13181/******/ () => (module); 13182/******/ __webpack_require__.d(getter, { a: getter }); 13183/******/ return getter; 13184/******/ }; 13185/******/ })(); 13186/******/ 13187/******/ /* webpack/runtime/define property getters */ 13188/******/ (() => { 13189/******/ // define getter functions for harmony exports 13190/******/ __webpack_require__.d = (exports, definition) => { 13191/******/ for(var key in definition) { 13192/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 13193/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 13194/******/ } 13195/******/ } 13196/******/ }; 13197/******/ })(); 13198/******/ 13199/******/ /* webpack/runtime/hasOwnProperty shorthand */ 13200/******/ (() => { 13201/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 13202/******/ })(); 13203/******/ 13204/******/ /* webpack/runtime/make namespace object */ 13205/******/ (() => { 13206/******/ // define __esModule on exports 13207/******/ __webpack_require__.r = (exports) => { 13208/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 13209/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 13210/******/ } 13211/******/ Object.defineProperty(exports, '__esModule', { value: true }); 13212/******/ }; 13213/******/ })(); 13214/******/ 13215/************************************************************************/ 13216var __webpack_exports__ = {}; 13217// This entry need to be wrapped in an IIFE because it need to be in strict mode. 13218(() => { 13219"use strict"; 13220/*!***************************!*\ 13221 !*** ./scripts/jquery.js ***! 13222 \***************************/ 13223__webpack_require__.r(__webpack_exports__); 13224/* harmony import */ var jquery_dist_jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery/dist/jquery */ "./node_modules/jquery/dist/jquery.js"); 13225/* harmony import */ var jquery_dist_jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery_dist_jquery__WEBPACK_IMPORTED_MODULE_0__); 13226 13227window.$ = window.jQuery = (jquery_dist_jquery__WEBPACK_IMPORTED_MODULE_0___default()); 13228(jquery_dist_jquery__WEBPACK_IMPORTED_MODULE_0___default().validate) = __webpack_require__(/*! jquery-validation/dist/jquery.validate */ "./node_modules/jquery-validation/dist/jquery.validate.js"); 13229(jquery_dist_jquery__WEBPACK_IMPORTED_MODULE_0___default().validator.unobtrusive) = __webpack_require__(/*! jquery-validation-unobtrusive */ "./node_modules/jquery-validation-unobtrusive/dist/jquery.validate.unobtrusive.js"); 13230__webpack_require__(/*! ./libraries/customFileUpload */ "./scripts/libraries/customFileUpload.js"); 13231console.log('jQuery loaded'); 13232})(); 13233 13234/******/ })() 13235; 13236//# sourceMappingURL=jquery.bundle.js.map
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.