vendor: 3,595 bytes, lines 1-88
1/******/ (function(modules) { // webpackBootstrap 2/******/ // The module cache 3/******/ var installedModules = {}; 4/******/ 5/******/ // The require function 6/******/ function __webpack_require__(moduleId) { 7/******/ 8/******/ // Check if module is in cache 9/******/ if(installedModules[moduleId]) { 10/******/ return installedModules[moduleId].exports; 11/******/ } 12/******/ // Create a new module (and put it into the cache) 13/******/ var module = installedModules[moduleId] = { 14/******/ i: moduleId, 15/******/ l: false, 16/******/ exports: {} 17/******/ }; 18/******/ 19/******/ // Execute the module function 20/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21/******/ 22/******/ // Flag the module as loaded 23/******/ module.l = true; 24/******/ 25/******/ // Return the exports of the module 26/******/ return module.exports; 27/******/ } 28/******/ 29/******/ 30/******/ // expose the modules object (__webpack_modules__) 31/******/ __webpack_require__.m = modules; 32/******/ 33/******/ // expose the module cache 34/******/ __webpack_require__.c = installedModules; 35/******/ 36/******/ // define getter function for harmony exports 37/******/ __webpack_require__.d = function(exports, name, getter) { 38/******/ if(!__webpack_require__.o(exports, name)) { 39/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 40/******/ } 41/******/ }; 42/******/ 43/******/ // define __esModule on exports 44/******/ __webpack_require__.r = function(exports) { 45/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 46/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 47/******/ } 48/******/ Object.defineProperty(exports, '__esModule', { value: true }); 49/******/ }; 50/******/ 51/******/ // create a fake namespace object 52/******/ // mode & 1: value is a module id, require it 53/******/ // mode & 2: merge all properties of value into the ns 54/******/ // mode & 4: return value when already ns object 55/******/ // mode & 8|1: behave like require 56/******/ __webpack_require__.t = function(value, mode) { 57/******/ if(mode & 1) value = __webpack_require__(value); 58/******/ if(mode & 8) return value; 59/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 60/******/ var ns = Object.create(null); 61/******/ __webpack_require__.r(ns); 62/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 63/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 64/******/ return ns; 65/******/ }; 66/******/ 67/******/ // getDefaultExport function for compatibility with non-harmony modules 68/******/ __webpack_require__.n = function(module) { 69/******/ var getter = module && module.__esModule ? 70/******/ function getDefault() { return module['default']; } : 71/******/ function getModuleExports() { return module; }; 72/******/ __webpack_require__.d(getter, 'a', getter); 73/******/ return getter; 74/******/ }; 75/******/ 76/******/ // Object.prototype.hasOwnProperty.call 77/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 78/******/ 79/******/ // __webpack_public_path__ 80/******/ __webpack_require__.p = "/"; 81/******/ 82/******/ 83/******/ // Load entry module and return exports 84/******/ return __webpack_require__(__webpack_require__.s = 0); 85/******/ }) 86/************************************************************************/ 87/******/ ({ 88
89/***/ "./musee_stcloud_radix/src/js/stcloud_radix.script.js": 90/*!************************************************************!*\ 91 !*** ./musee_stcloud_radix/src/js/stcloud_radix.script.js ***! 92 \************************************************************/ 93/*! no exports provided */ 94/***/ (function(module, __webpack_exports__, __webpack_require__) { 95 96"use strict"; 97__webpack_require__.r(__webpack_exports__); 98/* harmony import */ var popper_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js"); 99/* harmony import */ var bootstrap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! bootstrap */ "./node_modules/bootstrap/dist/js/bootstrap.js"); 100/* harmony import */ var bootstrap__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(bootstrap__WEBPACK_IMPORTED_MODULE_1__); 101/* harmony import */ var _utils_handlers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/handlers */ "./musee_stcloud_radix/src/js/utils/handlers.js"); 102/* harmony import */ var _utils_functions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/functions */ "./musee_stcloud_radix/src/js/utils/functions.js"); 103/* harmony import */ var _utils_datepicker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/datepicker */ "./musee_stcloud_radix/src/js/utils/datepicker.js"); 104/* harmony import */ var _utils_slick__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/slick */ "./musee_stcloud_radix/src/js/utils/slick.js"); 105 106 107 108 109 110 111(function ($) { 112 'use strict'; 113 114 // handlers 115 Object(_utils_handlers__WEBPACK_IMPORTED_MODULE_2__["handleScrollPage"])(); 116 Object(_utils_handlers__WEBPACK_IMPORTED_MODULE_2__["handleMegaMenu"])(); 117 Object(_utils_handlers__WEBPACK_IMPORTED_MODULE_2__["handleToggleMainMenu"])(); 118 Object(_utils_handlers__WEBPACK_IMPORTED_MODULE_2__["handleSidebar"])(); 119 Object(_utils_handlers__WEBPACK_IMPORTED_MODULE_2__["handleSearchForm"])(); 120 Object(_utils_handlers__WEBPACK_IMPORTED_MODULE_2__["handleMenuOutsideClick"])(); 121 Object(_utils_handlers__WEBPACK_IMPORTED_MODULE_2__["handleHomeScroll"])(); 122 Object(_utils_handlers__WEBPACK_IMPORTED_MODULE_2__["handleMailTo"])(); 123 Object(_utils_handlers__WEBPACK_IMPORTED_MODULE_2__["handleListEmploi"])(); 124 Object(_utils_handlers__WEBPACK_IMPORTED_MODULE_2__["handleToggleForm"])(); 125 Object(_utils_handlers__WEBPACK_IMPORTED_MODULE_2__["handleScrollTop"])(); 126 Object(_utils_handlers__WEBPACK_IMPORTED_MODULE_2__["handleWrapElements"])(); 127 Object(_utils_handlers__WEBPACK_IMPORTED_MODULE_2__["handleCommentWriteAndAnswer"])(); 128 Object(_utils_handlers__WEBPACK_IMPORTED_MODULE_2__["handleDialogue"])(); 129 130 // datepicker 131 Object(_utils_datepicker__WEBPACK_IMPORTED_MODULE_4__["datepickerInit"])(); 132 133 // slick 134 Object(_utils_slick__WEBPACK_IMPORTED_MODULE_5__["initSlickSliders"])(); 135 Object(_utils_slick__WEBPACK_IMPORTED_MODULE_5__["initSlickSlidersOnDomChange"])(); 136 137 // Others 138 Object(_utils_functions__WEBPACK_IMPORTED_MODULE_3__["wrapAgendaFilters"])(); 139 Object(_utils_functions__WEBPACK_IMPORTED_MODULE_3__["setAccessibleLinks"])(); 140 Object(_utils_functions__WEBPACK_IMPORTED_MODULE_3__["setAccesibleAttributes"])(); 141 $(document).ajaxComplete(function () { 142 Object(_utils_handlers__WEBPACK_IMPORTED_MODULE_2__["handleListEmploi"])(); 143 Object(_utils_handlers__WEBPACK_IMPORTED_MODULE_2__["handleToggleForm"])(); 144 Object(_utils_handlers__WEBPACK_IMPORTED_MODULE_2__["handleCommentWriteAndAnswer"])(); 145 Object(_utils_handlers__WEBPACK_IMPORTED_MODULE_2__["handleDialogue"])(); 146 Object(_utils_handlers__WEBPACK_IMPORTED_MODULE_2__["handleWrapElements"])(true); 147 Object(_utils_datepicker__WEBPACK_IMPORTED_MODULE_4__["datepickerInit"])(); 148 Object(_utils_functions__WEBPACK_IMPORTED_MODULE_3__["wrapAgendaFilters"])(); 149 }); 150})(jQuery, Drupal); 151 152/***/ }), 153
154/***/ "./musee_stcloud_radix/src/js/utils/datepicker.js": 155/*!********************************************************!*\ 156 !*** ./musee_stcloud_radix/src/js/utils/datepicker.js ***! 157 \********************************************************/ 158/*! exports provided: datepickerInit */ 159/***/ (function(module, __webpack_exports__, __webpack_require__) { 160 161"use strict"; 162__webpack_require__.r(__webpack_exports__); 163/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "datepickerInit", function() { return datepickerInit; }); 164/** 165 * @description init datepicker on specific elements 166 */ 167function datepickerInit() { 168 (function ($) { 169 // Set defaults 170 $.datepicker.setDefaults({ 171 altField: "#datepicker", 172 closeText: 'Fermer', 173 prevText: 'Précédent', 174 nextText: 'Suivant', 175 currentText: 'text', 176 monthNames: ['Janvier', 'Février', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Août', 'Septembre', 'Octobre', 'Novembre', 'Décembre'], 177 monthNamesShort: ['Janv.', 'Févr.', 'Mars', 'Avril', 'Mai', 'Juin', 'Juil.', 'Août', 'Sept.', 'Oct.', 'Nov.', 'Déc.'], 178 dayNames: ['Lundi', 'Mardi', 'Mercredi', 'Jeudi', 'Vendredi', 'Samedi', 'Dimanche'], 179 dayNamesShort: ['Lun.', 'Mar.', 'Mer.', 'Jeu.', 'Ven.', 'Sam.', 'Dim.'], 180 dayNamesMin: ['D', 'L', 'M', 'M', 'J', 'V', 'S'], 181 weekHeader: 'Sem.', 182 dateFormat: 'dd/mm/yy', 183 firstDay: 1 184 }); 185 $("input[name=field_date_agenda_value], input[name=field_date_agenda_end_value], #edit-field-emploi-date-value-min, #edit-field-emploi-date-value-max").datepicker({ 186 changeMonth: true, 187 //this option for allowing user to select month 188 changeYear: true, 189 //this option for allowing user to select from year range 190 dateFormat: "yy-mm-dd" 191 }); 192 })(jQuery, Drupal); 193} 194 195/***/ }), 196
197/***/ "./musee_stcloud_radix/src/js/utils/functions.js": 198/*!*******************************************************!*\ 199 !*** ./musee_stcloud_radix/src/js/utils/functions.js ***! 200 \*******************************************************/ 201/*! exports provided: progressScrollPage, openSearch, closeSearch, openSidebar, closeSidebar, openMegaMenu, closeMegaMenu, openSubMenu, closeSubMenu, closeItAll, wrapAgendaFilters, setAccessibleLinks, setAccesibleAttributes */ 202/***/ (function(module, __webpack_exports__, __webpack_require__) { 203 204"use strict"; 205__webpack_require__.r(__webpack_exports__); 206/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "progressScrollPage", function() { return progressScrollPage; }); 207/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "openSearch", function() { return openSearch; }); 208/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "closeSearch", function() { return closeSearch; }); 209/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "openSidebar", function() { return openSidebar; }); 210/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "closeSidebar", function() { return closeSidebar; }); 211/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "openMegaMenu", function() { return openMegaMenu; }); 212/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "closeMegaMenu", function() { return closeMegaMenu; }); 213/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "openSubMenu", function() { return openSubMenu; }); 214/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "closeSubMenu", function() { return closeSubMenu; }); 215/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "closeItAll", function() { return closeItAll; }); 216/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "wrapAgendaFilters", function() { return wrapAgendaFilters; }); 217/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAccessibleLinks", function() { return setAccessibleLinks; }); 218/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "setAccesibleAttributes", function() { return setAccesibleAttributes; }); 219/** 220 * @description Progress Scroll page animation 221 * @returns void 222 */ 223function progressScrollPage() { 224 (function ($) { 225 var windowScroll = $(window).scrollTop(); 226 windowScroll > 70 ? $('body').addClass('scrolled') : $('body').removeClass('scrolled'); 227 $('.anchor-menu a').each(function () { 228 var target_scroll = $(this).attr('href'); 229 if (!target_scroll || target_scroll.indexOf('#') === -1) return; 230 var nbr = target_scroll.indexOf('#'); 231 var cible = target_scroll.substr(nbr); 232 var $cible = $(cible); 233 var offset = $cible.length ? $cible.offset() : null; 234 if (!offset) return; // skip if target doesn't exist 235 236 // hauteur de l'élément 237 var lastChar = cible.substr(cible.length - 1); 238 var next = parseInt(lastChar, 10) + 1; 239 var nextH2 = 'h2#anchor_title_' + next; 240 var elementH = 0; 241 if ($(nextH2).length) { 242 var offsetNextH2 = $(nextH2).offset(); 243 if (offsetNextH2) { 244 elementH = offsetNextH2.top - offset.top; 245 } 246 } else { 247 var offsetfooter = $('footer.page__footer').offset(); 248 if (offsetfooter) { 249 elementH = offsetfooter.top - offset.top; 250 } 251 } 252 253 // avoid division by zero 254 if (elementH <= 0) elementH = 1; 255 var progress_page = $(this).find('.progress_page'); 256 var distance_lecture = 25; 257 var progress_scroll = windowScroll - offset.top + distance_lecture; 258 var ratio_progress = (progress_scroll + 94) / elementH * 100; 259 if (ratio_progress > 100) { 260 ratio_progress = 100; 261 $(this).removeClass('en_lecture'); 262 } else if (ratio_progress < 0) { 263 ratio_progress = 0; 264 $(this).removeClass('en_lecture'); 265 } else { 266 $(this).addClass('en_lecture'); 267 } 268 progress_page.css('width', ratio_progress + '%'); 269 var footerTop = $('footer').offset(); 270 var footerH = $('footer').height(); 271 var WindowsSizeH = $(window).height(); 272 if (footerTop) { 273 var limiteAllProgress = windowScroll + WindowsSizeH; 274 var limiteAllProgressBottom = footerTop.top + footerH - 300; 275 if (limiteAllProgress > limiteAllProgressBottom) { 276 progress_page.css('width', '100%'); 277 } 278 } 279 }); 280 })(jQuery, Drupal); 281} 282 283/** 284 * @description open search event 285 * @returns void 286 */ 287function openSearch() { 288 (function ($) { 289 $(".wrap-search-form").slideDown(); 290 $(".wrap-search-form").find(".form-control").focus(); 291 $("#btn-search-form").addClass("active"); 292 $("#btn-search-form").attr("aria-expanded", "true"); 293 $(".shadow-sub").addClass('active'); 294 closeMegaMenu(); 295 closeSidebar(); 296 })(jQuery, Drupal); 297} 298 299/** 300 * @description close search event 301 * @returns void 302 */ 303function closeSearch() { 304 (function ($) { 305 $(".wrap-search-form").slideUp(); 306 $("#btn-search-form").removeClass("active"); 307 $("#btn-search-form").attr("aria-expanded", "false"); 308 })(jQuery, Drupal); 309} 310 311/** 312 * @description open sidebar event 313 * @returns void 314 */ 315function openSidebar() { 316 (function ($) { 317 $("#sidebar").addClass("active"); 318 $("#sidebar").attr("aria-expanded", "true"); 319 $("#wrap-sidebar").slideDown(); 320 $("#btn-search-form").removeClass("active"); 321 $("#btn-search-form").attr("aria-expanded", "false"); 322 $(".wrap-search-form").slideUp(); 323 $(".navbar-collapse").removeClass("show"); 324 $(".navbar-toggle").removeClass("collapsed"); 325 $(".navbar-toggle").attr("aria-expanded", "false"); 326 $(".shadow-sub").addClass('active'); 327 closeSearch(); 328 closeMegaMenu(); 329 })(jQuery, Drupal); 330} 331 332/** 333 * @description close sidebar event 334 * @returns void 335 */ 336function closeSidebar() { 337 (function ($) { 338 $("#sidebar").removeClass("active"); 339 $("#sidebar").attr("aria-expanded", "false"); 340 $("#wrap-sidebar").slideUp(); 341 })(jQuery, Drupal); 342} 343 344/** 345 * @description open main menu behaviors 346 * @returjs void 347 */ 348function openMegaMenu() { 349 (function ($) { 350 $("#btn-search-form").removeClass("active"); 351 $("#btn-search-form").attr("aria-expanded", "false"); 352 $(".wrap-search-form").slideUp(); 353 $("#sidebar").removeClass("active"); 354 $("#sidebar").attr("aria-expanded", "false"); 355 $("#wrap-sidebar").slideUp(); 356 $(".page__header").addClass("active"); 357 $(".navbar-static").addClass("show"); 358 $(".navbar-toggle").addClass("collapsed"); 359 $(".navbar-toggle").attr("aria-expanded", "true"); 360 $(".shadow-sub").addClass('active'); 361 closeSearch(); 362 closeSidebar(); 363 })(jQuery, Drupal); 364} 365 366/** 367 * @description close main menu behaviors 368 * @returjs void 369 */ 370function closeMegaMenu() { 371 (function ($) { 372 $(".dropdown-toggle.nav-link").next(".wrap-submenu").slideUp(); 373 $(".dropdown-toggle.nav-link").removeClass("open"); 374 $(".page__header").removeClass("active active-sub"); 375 $(".navbar-static").removeClass("show"); 376 $(".navbar-toggle").removeClass("collapsed"); 377 $(".navbar-toggle").attr("aria-expanded", "false"); 378 })(jQuery, Drupal); 379} 380 381/** 382 * @description open sub menu event 383 * @param {jQuery} item 384 * @returns void 385 */ 386function openSubMenu(item) { 387 (function ($) { 388 $(".wrap-submenu").slideUp(); 389 $(".dropdown-toggle.nav-link").removeClass("open"); 390 item.addClass("open"); 391 item.attr("aria-expanded", "true"); 392 item.next(".wrap-submenu").slideDown(); 393 $("#btn-search-form").removeClass("active"); 394 $("#btn-search-form").attr("aria-expanded", "false"); 395 $(".wrap-search-form").slideUp(); 396 $(".page__header").addClass("active-sub"); 397 $(".shadow-sub").addClass('active'); 398 closeSearch(); 399 closeSidebar(); 400 })(jQuery, Drupal); 401} 402 403/** 404 * @description close sub menu event 405 * @param {jQuery} item 406 * @returns void 407 */ 408function closeSubMenu(item) { 409 (function ($) { 410 item.removeClass("open"); 411 item.attr("aria-expanded", "false"); 412 item.next(".wrap-submenu").slideUp(); 413 })(jQuery, Drupal); 414} 415 416/** 417 * @description close megamenu, sidebar & search 418 * @returns void 419 */ 420function closeItAll() { 421 (function ($) { 422 $(".shadow-sub").removeClass('active'); 423 closeMegaMenu(); 424 closeSidebar(); 425 closeSearch(); 426 })(jQuery, Drupal); 427} 428 429/** 430 * @description wrap agenda date filters 431 * @eturns void 432 */ 433function wrapAgendaFilters() { 434 (function ($) { 435 $('.form-item-field-date-agenda-value').addClass("form-agenda-filter"); 436 $('.form-item-field-date-agenda-end-value').addClass("form-agenda-filter"); 437 $(".form-agenda-filter").wrapAll('<div role="group" aria-labelledby="group-agenda" id="wrapper-group-agenda" />'); 438 $("#wrapper-group-agenda").prepend('<p id="group-agenda" class="sr-only">Filtrer les agendas par date de début et/ou date de fin</p>'); 439 })(jQuery, Drupal); 440} 441 442/** 443 * @description add an accessible title to link (with new tab label) 444 * @returns void 445 */ 446function setAccessibleLinks() { 447 (function ($) { 448 $('a[target="_blank"]').each(function () { 449 var linkTitle = $(this).attr('title'); 450 var linkText = $(this).text(); 451 linkTitle ? $(this).attr('title', linkTitle + ' (nouvelle fenêtre)') : $(this).attr('title', linkText + ' (nouvelle fenêtre)'); 452 }); 453 })(jQuery, Drupal); 454} 455 456/** 457 * @description avoid solr search form attributes duplicates 458 */ 459function setAccesibleAttributes() { 460 (function ($) { 461 var search_form_home = $('#views-exposed-form-solr-search-content-page-2'); 462 search_form_home.find("label").attr('for', 'edit-keys-02'); 463 search_form_home.find('input[type="text"]').attr('id', 'edit-keys-02'); 464 search_form_home.find(".form-actions.js-form-wrapper.form-wrapper").attr('id', 'edit-actions-02'); 465 search_form_home.find('input[type="submit"]').attr('id', 'edit-submit-solr-search-content-02'); 466 $(".search-block-form").find("label").attr('for', 'edit-keys-01'); 467 $(".search-block-form").find('input[type="text"]').attr('id', 'edit-keys-01'); 468 $(".search-block-form").find(".form-actions.js-form-wrapper.form-wrapper").attr('id', 'edit-actions-01'); 469 $(".search-block-form").find('input[type="submit"]').attr('id', 'edit-submit-solr-search-content-01'); 470 $("#edit-submit-solr-search-content-02").attr('aria-label', 'Trouve un résultat dans le moteur de recherche principal'); 471 $("#edit-submit-solr-search-content-01").attr('aria-label', 'Trouve un résultat dans le moteur de recherche principal'); 472 $("#edit-submit-solr-search-content").attr('aria-label', 'Trouve un résultat dans le moteur de recherche principal'); 473 $('footer[role="contentinfo"]').find('#navbar-collapse').attr('id', 'navbar-collapse-02'); 474 })(jQuery, Drupal); 475} 476 477/***/ }), 478
479/***/ "./musee_stcloud_radix/src/js/utils/handlers.js": 480/*!******************************************************!*\ 481 !*** ./musee_stcloud_radix/src/js/utils/handlers.js ***! 482 \******************************************************/ 483/*! exports provided: handleScrollPage, handleMegaMenu, handleToggleMainMenu, handleSidebar, handleSearchForm, handleHomeScroll, handleMenuOutsideClick, handleMailTo, handleListEmploi, handleToggleForm, handleScrollTop, handleWrapElements, handleCommentWriteAndAnswer, handleDialogue */ 484/***/ (function(module, __webpack_exports__, __webpack_require__) { 485 486"use strict"; 487__webpack_require__.r(__webpack_exports__); 488/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "handleScrollPage", function() { return handleScrollPage; }); 489/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "handleMegaMenu", function() { return handleMegaMenu; }); 490/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "handleToggleMainMenu", function() { return handleToggleMainMenu; }); 491/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "handleSidebar", function() { return handleSidebar; }); 492/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "handleSearchForm", function() { return handleSearchForm; }); 493/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "handleHomeScroll", function() { return handleHomeScroll; }); 494/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "handleMenuOutsideClick", function() { return handleMenuOutsideClick; }); 495/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "handleMailTo", function() { return handleMailTo; }); 496/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "handleListEmploi", function() { return handleListEmploi; }); 497/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "handleToggleForm", function() { return handleToggleForm; }); 498/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "handleScrollTop", function() { return handleScrollTop; }); 499/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "handleWrapElements", function() { return handleWrapElements; }); 500/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "handleCommentWriteAndAnswer", function() { return handleCommentWriteAndAnswer; }); 501/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "handleDialogue", function() { return handleDialogue; }); 502/* harmony import */ var _functions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./functions */ "./musee_stcloud_radix/src/js/utils/functions.js"); 503 504 505/** 506 * @description scroll & resize events 507 * @returns void 508 */ 509function handleScrollPage() { 510 (function ($) { 511 if ($('.anchor-menu').length) { 512 $('.anchor-menu a').on('click', function () { 513 var cible = $(this).attr('href'); 514 var offset = $(cible).offset(); 515 var next = offset.top - 120; 516 $('html, body').animate({ 517 scrollTop: next 518 }, 900, 'swing'); 519 }); 520 Object(_functions__WEBPACK_IMPORTED_MODULE_0__["progressScrollPage"])(); 521 $(window).on('resize, scroll', function () { 522 Object(_functions__WEBPACK_IMPORTED_MODULE_0__["progressScrollPage"])(); 523 }); 524 } 525 })(jQuery, Drupal); 526} 527 528/** 529 * @description handle mobile menu 530 * @returns void 531 */ 532function handleMegaMenu() { 533 (function ($) { 534 $(".navbar-toggle").on('click', function (e) { 535 e.preventDefault(); 536 if ($(this).hasClass("collapsed")) { 537 Object(_functions__WEBPACK_IMPORTED_MODULE_0__["closeMegaMenu"])(); 538 Object(_functions__WEBPACK_IMPORTED_MODULE_0__["closeItAll"])(); 539 } else { 540 Object(_functions__WEBPACK_IMPORTED_MODULE_0__["openMegaMenu"])(); 541 } 542 }); 543 $(document).on('keyup', function (e) { 544 if (e.key === 'Escape') { 545 Object(_functions__WEBPACK_IMPORTED_MODULE_0__["closeMegaMenu"])(); 546 Object(_functions__WEBPACK_IMPORTED_MODULE_0__["closeItAll"])(); 547 } 548 }); 549 })(jQuery, Drupal); 550} 551 552/** 553 * @description handle click on toggle to open sub menu from main menu 554 * @returns void 555 */ 556function handleToggleMainMenu() { 557 (function ($) { 558 $(".dropdown-toggle.nav-link").on('click', function (e) { 559 e.preventDefault(); 560 $(this).hasClass("open") ? Object(_functions__WEBPACK_IMPORTED_MODULE_0__["closeSubMenu"])($(this)) : Object(_functions__WEBPACK_IMPORTED_MODULE_0__["openSubMenu"])($(this)); 561 }); 562 })(jQuery, Drupal); 563} 564 565/** 566 * @description handle sidebar event 567 * @returns void 568 */ 569function handleSidebar() { 570 (function ($) { 571 $("#sidebar").on('click', function (e) { 572 e.preventDefault(); 573 if ($(this).hasClass("active")) { 574 Object(_functions__WEBPACK_IMPORTED_MODULE_0__["closeSidebar"])(); 575 Object(_functions__WEBPACK_IMPORTED_MODULE_0__["closeItAll"])(); 576 } else { 577 Object(_functions__WEBPACK_IMPORTED_MODULE_0__["openSidebar"])(); 578 } 579 }); 580 })(jQuery, Drupal); 581} 582 583/** 584 * @description handle search form 585 * @returns void 586 */ 587function handleSearchForm() { 588 (function ($) { 589 $("#btn-search-form").on('click', function (e) { 590 e.preventDefault(); 591 if ($(this).hasClass("active")) { 592 Object(_functions__WEBPACK_IMPORTED_MODULE_0__["closeSearch"])(); 593 Object(_functions__WEBPACK_IMPORTED_MODULE_0__["closeItAll"])(); 594 } else { 595 Object(_functions__WEBPACK_IMPORTED_MODULE_0__["openSearch"])(); 596 } 597 }); 598 })(jQuery, Drupal); 599} 600 601/** 602 * @description handle user scroll on window 603 * @returns void 604 */ 605function handleHomeScroll() { 606 (function ($) { 607 /*========== Barre header Home ==========*/ 608 // Stockage des références des différents éléments dans des variables 609 var header_home = $('.page__header.home'); 610 var goTop = $('#go-top'); 611 612 // Calcul de la marge entre le haut du document et la div 613 //fixedLimit2 = testeur.offset().top - parseFloat(testeur.css('marginTop').replace(/auto/,0)); 614 var limiteTop1 = $(".container-fluid.header.home").height(); 615 616 // On déclenche un événement scroll pour mettre à jour le positionnement au chargement de la page 617 $(window).trigger('scroll'); 618 $(window).on('scroll', function (e) { 619 // Valeur de défilement lors du chargement de la page 620 var windowScroll = $(window).scrollTop(); 621 windowScroll > 70 ? $('body').addClass('scrolled') : $('body').removeClass('scrolled'); 622 623 // Mise à jour du positionnement en fonction du scroll 624 if (windowScroll >= limiteTop1) { 625 header_home.addClass('show'); 626 goTop.addClass('show'); 627 } else { 628 header_home.removeClass('show'); 629 goTop.removeClass('show'); 630 } 631 }); 632 })(jQuery, Drupal); 633} 634 635/** 636 * @description close mobile menu when user clicks outside 637 * @returns void 638 */ 639function handleMenuOutsideClick() { 640 (function ($) { 641 $(".page__content").append("<div class='shadow-sub'></div>"); 642 $(".shadow-sub").on('click', function () { 643 Object(_functions__WEBPACK_IMPORTED_MODULE_0__["closeItAll"])(); 644 }); 645 })(jQuery, Drupal); 646} 647/** 648 * @description mail to link click event 649 * @returns void 650 */ 651function handleMailTo() { 652 (function ($) { 653 $("#mailto").on('click', function (e) { 654 e.preventDefault(); 655 window.location.href = "mailto:?subject=" + document.title + "&body=" + encodeURI(window.location.href); 656 }); 657 })(jQuery, Drupal); 658} 659 660/** 661 * @description handle list emploi on user click 662 * @returns void 663 */ 664function handleListEmploi() { 665 (function ($) { 666 $('.list-emploi').on('click', function () { 667 $('.list-emploi.active').removeClass("active"); 668 $('.detail-emploi').fadeOut(); 669 $(this).addClass("active"); 670 $(this).next('.detail-emploi').fadeIn(); 671 }); 672 })(jQuery, Drupal); 673} 674 675/** 676 * @description handle toggler form elements on user click 677 * @returns void 678 */ 679function handleToggleForm() { 680 (function ($) { 681 // Toggler for form sections
682 $(document).off("click.handleToggleForm", ".toggler-form").on("click.handleToggleForm", ".toggler-form", function (e) { 683 e.preventDefault(); 684 $(this).parent("dt").toggleClass("active"); 685 $(this).parent("dt").next("dd").slideToggle(); 686 }); 687 688 // Toggler for .toggle-function 689 $(document).off("click.handleToggleFormToggle", ".toggle-function").on("click.handleToggleFormToggle", ".toggle-function", function (e) { 690 e.preventDefault(); 691 var expanded = $(this).attr("aria-expanded") === "true"; 692 $(this).parent().toggleClass("active", !expanded); 693 $(this).attr("aria-expanded", !expanded); 694 $(this).parent().next().slideToggle(); 695 }); 696 })(jQuery, Drupal); 697} 698 699/** 700 * @description handle scroll top on user click 701 * @returns void 702 */ 703function handleScrollTop() { 704 (function ($) { 705 $("#go-top").on('click', function () { 706 $("html, body").animate({ 707 scrollTop: 0 708 }, 750); 709 $('#main-content').focus(); 710 }); 711 })(jQuery, Drupal); 712} 713 714/** 715 * @description handle wrap services 716 * @returns void 717 */ 718function handleWrapElements() { 719 (function ($) { 720 var wrap_service_01 = false; 721 var wrap_service_02 = false; 722 var wrap_service_03 = false; 723 $('#wrap-map input[type="submit"]').on('click', function (e) { 724 e.preventDefault(); 725 wrap_service_01 = true; 726 wrap_service_02 = false; 727 wrap_service_03 = false; 728 }); 729 $('#wrap-list input[type="submit"]').on('click', function (e) { 730 e.preventDefault(); 731 wrap_service_01 = false; 732 wrap_service_02 = true; 733 wrap_service_03 = false; 734 }); 735 $('#wrap-inspiration input[type="submit"]').on('click', function (e) { 736 e.preventDefault(); 737 wrap_service_01 = false; 738 wrap_service_02 = false; 739 wrap_service_03 = true; 740 }); 741 742 /* btn - go map/list */ 743 $("#go-map").on('click', function (e) { 744 e.preventDefault(); 745 $("#wrap-map").removeClass("visible"); 746 $("#wrap-list").addClass("visible"); 747 }); 748 $("#go-list").on('click', function (e) { 749 e.preventDefault(); 750 $("#wrap-list").removeClass("visible"); 751 $("#wrap-map").addClass("visible"); 752 }); 753 $("#service-suggestion").on('click', function (e) { 754 e.preventDefault(); 755 $("#wrap-map, #wrap-list").removeClass("visible"); 756 $("#wrap-inspiration").addClass("visible"); 757 $("#service-liste").removeClass("active"); 758 $("#service-suggestion").addClass("active"); 759 }); 760 $("#service-liste").on('click', function (e) { 761 e.preventDefault(); 762 $("#wrap-list, #wrap-inspiration").removeClass("visible"); 763 $("#wrap-map").addClass("visible"); 764 $("#service-suggestion").removeClass("active"); 765 $("#service-liste").addClass("active"); 766 }); 767 if (wrap_service_01 == true) { 768 $("#wrap-list").removeClass("visible"); 769 $("#wrap-inspiration").removeClass("visible"); 770 $("#wrap-map").addClass("visible"); 771 } 772 if (wrap_service_02 == true) { 773 $("#wrap-map").removeClass("visible"); 774 $("#wrap-inspiration").removeClass("visible"); 775 $("#wrap-list").addClass("visible"); 776 } 777 if (wrap_service_03 == true) { 778 $("#wrap-map").removeClass("visible"); 779 $("#wrap-list").removeClass("visible"); 780 $("#wrap-inspiration").addClass("visible"); 781 } 782 })(jQuery, Drupal); 783} 784 785/** 786 * @description handle comment dialog box on click 787 * @returns void 788 */ 789function handleCommentWriteAndAnswer() { 790 (function ($) { 791 // Handle comment write toggle 792 $(document).off("click.handleCommentWrite", ".comment-write").on("click.handleCommentWrite", ".comment-write", function (e) { 793 e.preventDefault(); 794 var expanded = $(this).attr("aria-expanded") === "true"; 795 $(this).toggleClass("active", !expanded); 796 $(this).attr("aria-expanded", !expanded); 797 var form = $(this).parents("div.wrap-dialogue").children(".comment-form"); 798 expanded ? form.slideUp() : form.slideDown(); 799 }); 800 801 // Handle comment answer toggle 802 $(document).off("click.handleCommentAnswer", ".comment-answer").on("click.handleCommentAnswer", ".comment-answer", function (e) { 803 e.preventDefault(); 804 var expanded = $(this).attr("aria-expanded") === "true"; 805 $(this).toggleClass("active", !expanded); 806 $(this).attr("aria-expanded", !expanded); 807 var comment = $(this).parents("div.wrap-dialogue").children("article.comment"); 808 expanded ? comment.slideUp() : comment.slideDown(); 809 }); 810 })(jQuery, Drupal); 811} 812 813/** 814 * @description handle accordion dialogue on click 815 * @returns void 816 */ 817function handleDialogue() { 818 (function ($) {
819 $(document).off("click.handleDialogue", ".ckeditor-accordion-container.dialogue dl dt").on("click.handleDialogue", "ckeditor-accordion-container.dialogue dl dt", function () { 820 if (!$(this).hasClass("active")) { 821 $(this).parents("div.wrap-dialogue").children(".comment-form").slideUp(); 822 $(this).parents("div.wrap-dialogue").children("article.comment").slideUp(); 823 } 824 }); 825 })(jQuery, Drupal); 826} 827 828/***/ }), 829
830/***/ "./musee_stcloud_radix/src/js/utils/slick.js": 831/*!***************************************************!*\ 832 !*** ./musee_stcloud_radix/src/js/utils/slick.js ***! 833 \***************************************************/ 834/*! exports provided: initSlickSliders, initSlickSlidersOnDomChange */ 835/***/ (function(module, __webpack_exports__, __webpack_require__) { 836 837"use strict"; 838__webpack_require__.r(__webpack_exports__); 839/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initSlickSliders", function() { return initSlickSliders; }); 840/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "initSlickSlidersOnDomChange", function() { return initSlickSlidersOnDomChange; }); 841/** 842 * @description init slick sliders 843 * @returns void 844 */ 845function initSlickSliders() { 846 (function ($) { 847 $('.wrap-personnes>div').slick({ 848 dots: true, 849 arrows: false, 850 infinite: true, 851 slidesToShow: 1, 852 slidesToScroll: 1, 853 mobileFirst: true, 854 adaptiveHeight: true, 855 responsive: [{ 856 breakpoint: 767, 857 settings: { 858 dots: false, 859 arrows: true 860 } 861 }] 862 }); 863 $('.event-home .row').removeClass('row').slick({ 864 dots: false, 865 arrows: true, 866 infinite: true, 867 slidesToShow: 1, 868 slidesToScroll: 1, 869 mobileFirst: true, 870 adaptiveHeight: true, 871 responsive: [{ 872 breakpoint: 767, 873 settings: { 874 dots: false, 875 arrows: true, 876 slidesToShow: 3 877 } 878 }, { 879 breakpoint: 1200, 880 settings: { 881 dots: false, 882 arrows: true, 883 slidesToShow: 3 884 } 885 }] 886 }); 887 })(jQuery, Drupal); 888} 889 890/** 891 * @description init slick sliders on lod resize or orientationchange window 892 * @returns void 893 */ 894function initSlickSlidersOnDomChange() { 895 (function ($) { 896 $(window).on('load resize orientationchange', function () { 897 $('.news-une>div').each(function () { 898 /* Initializes a slick carousel only on mobile screens */ 899 // slick on mobile 900 if ($(window).width() > 768) { 901 if ($(this).hasClass('slick-initialized')) { 902 $(this).slick('unslick'); 903 } 904 } else { 905 if (!$(this).hasClass('slick-initialized')) { 906 $(this).slick({ 907 dots: true, 908 arrows: false, 909 infinite: true, 910 slidesToShow: 1, 911 slidesToScroll: 1, 912 mobileFirst: true, 913 adaptiveHeight: true 914 }); 915 } 916 } 917 }); 918 $('.slick>div').each(function () { 919 /* Initializes a slick carousel only on mobile screens */ 920 // slick on mobile 921 if ($(window).width() > 768) { 922 if ($(this).hasClass('slick-initialized')) { 923 $(this).slick('unslick'); 924 } 925 } else { 926 if (!$(this).hasClass('slick-initialized')) { 927 $(this).slick({ 928 dots: true, 929 arrows: false, 930 infinite: true, 931 slidesToShow: 1, 932 slidesToScroll: 1, 933 mobileFirst: true, 934 adaptiveHeight: true 935 }); 936 } 937 } 938 }); 939 $('section.social>div').each(function () { 940 /* Initializes a slick carousel only on mobile screens */ 941 // slick on mobile 942 if ($(window).width() > 768) { 943 if ($(this).hasClass('slick-initialized')) { 944 $(this).slick('unslick'); 945 } 946 } else { 947 if (!$(this).hasClass('slick-initialized')) { 948 $(this).slick({ 949 dots: true, 950 arrows: false, 951 infinite: true, 952 slidesToShow: 1, 953 slidesToScroll: 1, 954 mobileFirst: true, 955 adaptiveHeight: true 956 }); 957 } 958 } 959 }); 960 }); 961 })(jQuery, Drupal); 962} 963 964/***/ }), 965
vendor: 131,854 bytes, lines 966-5410
966/***/ "./node_modules/bootstrap/dist/js/bootstrap.js": 967/*!*****************************************************!*\ 968 !*** ./node_modules/bootstrap/dist/js/bootstrap.js ***! 969 \*****************************************************/ 970/*! no static exports found */ 971/***/ (function(module, exports, __webpack_require__) { 972 973/*! 974 * Bootstrap v4.3.1 (https://getbootstrap.com/) 975 * Copyright 2011-2019 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 976 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 977 */ 978(function (global, factory) { 979 true ? factory(exports, __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"), __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js")) : 980 undefined; 981}(this, function (exports, $, Popper) { 'use strict'; 982 983 $ = $ && $.hasOwnProperty('default') ? $['default'] : $; 984 Popper = Popper && Popper.hasOwnProperty('default') ? Popper['default'] : Popper; 985 986 function _defineProperties(target, props) { 987 for (var i = 0; i < props.length; i++) { 988 var descriptor = props[i]; 989 descriptor.enumerable = descriptor.enumerable || false; 990 descriptor.configurable = true; 991 if ("value" in descriptor) descriptor.writable = true; 992 Object.defineProperty(target, descriptor.key, descriptor); 993 } 994 } 995 996 function _createClass(Constructor, protoProps, staticProps) { 997 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 998 if (staticProps) _defineProperties(Constructor, staticProps); 999 return Constructor; 1000 } 1001 1002 function _defineProperty(obj, key, value) { 1003 if (key in obj) { 1004 Object.defineProperty(obj, key, { 1005 value: value, 1006 enumerable: true, 1007 configurable: true, 1008 writable: true 1009 }); 1010 } else { 1011 obj[key] = value; 1012 } 1013 1014 return obj; 1015 } 1016 1017 function _objectSpread(target) { 1018 for (var i = 1; i < arguments.length; i++) { 1019 var source = arguments[i] != null ? arguments[i] : {}; 1020 var ownKeys = Object.keys(source); 1021 1022 if (typeof Object.getOwnPropertySymbols === 'function') { 1023 ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { 1024 return Object.getOwnPropertyDescriptor(source, sym).enumerable; 1025 })); 1026 } 1027 1028 ownKeys.forEach(function (key) { 1029 _defineProperty(target, key, source[key]); 1030 }); 1031 } 1032 1033 return target; 1034 } 1035 1036 function _inheritsLoose(subClass, superClass) { 1037 subClass.prototype = Object.create(superClass.prototype); 1038 subClass.prototype.constructor = subClass; 1039 subClass.__proto__ = superClass; 1040 } 1041 1042 /** 1043 * -------------------------------------------------------------------------- 1044 * Bootstrap (v4.3.1): util.js 1045 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 1046 * -------------------------------------------------------------------------- 1047 */ 1048 /** 1049 * ------------------------------------------------------------------------ 1050 * Private TransitionEnd Helpers 1051 * ------------------------------------------------------------------------ 1052 */ 1053 1054 var TRANSITION_END = 'transitionend'; 1055 var MAX_UID = 1000000; 1056 var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp) 1057 1058 function toType(obj) { 1059 return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase(); 1060 } 1061 1062 function getSpecialTransitionEndEvent() { 1063 return { 1064 bindType: TRANSITION_END, 1065 delegateType: TRANSITION_END, 1066 handle: function handle(event) { 1067 if ($(event.target).is(this)) { 1068 return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params 1069 } 1070 1071 return undefined; // eslint-disable-line no-undefined 1072 } 1073 }; 1074 } 1075 1076 function transitionEndEmulator(duration) { 1077 var _this = this; 1078 1079 var called = false; 1080 $(this).one(Util.TRANSITION_END, function () { 1081 called = true; 1082 }); 1083 setTimeout(function () { 1084 if (!called) { 1085 Util.triggerTransitionEnd(_this); 1086 } 1087 }, duration); 1088 return this; 1089 } 1090 1091 function setTransitionEndSupport() { 1092 $.fn.emulateTransitionEnd = transitionEndEmulator; 1093 $.event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent(); 1094 } 1095 /** 1096 * -------------------------------------------------------------------------- 1097 * Public Util Api 1098 * -------------------------------------------------------------------------- 1099 */ 1100 1101 1102 var Util = { 1103 TRANSITION_END: 'bsTransitionEnd', 1104 getUID: function getUID(prefix) { 1105 do { 1106 // eslint-disable-next-line no-bitwise 1107 prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here 1108 } while (document.getElementById(prefix)); 1109 1110 return prefix; 1111 }, 1112 getSelectorFromElement: function getSelectorFromElement(element) { 1113 var selector = element.getAttribute('data-target'); 1114 1115 if (!selector || selector === '#') { 1116 var hrefAttr = element.getAttribute('href'); 1117 selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''; 1118 } 1119 1120 try { 1121 return document.querySelector(selector) ? selector : null; 1122 } catch (err) { 1123 return null; 1124 } 1125 }, 1126 getTransitionDurationFromElement: function getTransitionDurationFromElement(element) { 1127 if (!element) { 1128 return 0; 1129 } // Get transition-duration of the element 1130 1131 1132 var transitionDuration = $(element).css('transition-duration'); 1133 var transitionDelay = $(element).css('transition-delay'); 1134 var floatTransitionDuration = parseFloat(transitionDuration); 1135 var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found 1136 1137 if (!floatTransitionDuration && !floatTransitionDelay) { 1138 return 0; 1139 } // If multiple durations are defined, take the first 1140 1141 1142 transitionDuration = transitionDuration.split(',')[0]; 1143 transitionDelay = transitionDelay.split(',')[0]; 1144 return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; 1145 }, 1146 reflow: function reflow(element) { 1147 return element.offsetHeight; 1148 }, 1149 triggerTransitionEnd: function triggerTransitionEnd(element) { 1150 $(element).trigger(TRANSITION_END); 1151 }, 1152 // TODO: Remove in v5 1153 supportsTransitionEnd: function supportsTransitionEnd() { 1154 return Boolean(TRANSITION_END); 1155 }, 1156 isElement: function isElement(obj) { 1157 return (obj[0] || obj).nodeType; 1158 }, 1159 typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) { 1160 for (var property in configTypes) { 1161 if (Object.prototype.hasOwnProperty.call(configTypes, property)) { 1162 var expectedTypes = configTypes[property]; 1163 var value = config[property]; 1164 var valueType = value && Util.isElement(value) ? 'element' : toType(value); 1165 1166 if (!new RegExp(expectedTypes).test(valueType)) { 1167 throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\".")); 1168 } 1169 } 1170 } 1171 }, 1172 findShadowRoot: function findShadowRoot(element) { 1173 if (!document.documentElement.attachShadow) { 1174 return null; 1175 } // Can find the shadow root otherwise it'll return the document 1176 1177 1178 if (typeof element.getRootNode === 'function') { 1179 var root = element.getRootNode(); 1180 return root instanceof ShadowRoot ? root : null; 1181 } 1182 1183 if (element instanceof ShadowRoot) { 1184 return element; 1185 } // when we don't find a shadow root 1186 1187 1188 if (!element.parentNode) { 1189 return null; 1190 } 1191 1192 return Util.findShadowRoot(element.parentNode); 1193 } 1194 }; 1195 setTransitionEndSupport(); 1196 1197 /** 1198 * ------------------------------------------------------------------------ 1199 * Constants 1200 * ------------------------------------------------------------------------ 1201 */ 1202 1203 var NAME = 'alert'; 1204 var VERSION = '4.3.1'; 1205 var DATA_KEY = 'bs.alert'; 1206 var EVENT_KEY = "." + DATA_KEY; 1207 var DATA_API_KEY = '.data-api'; 1208 var JQUERY_NO_CONFLICT = $.fn[NAME]; 1209 var Selector = { 1210 DISMISS: '[data-dismiss="alert"]' 1211 }; 1212 var Event = { 1213 CLOSE: "close" + EVENT_KEY, 1214 CLOSED: "closed" + EVENT_KEY, 1215 CLICK_DATA_API: "click" + EVENT_KEY + DATA_API_KEY 1216 }; 1217 var ClassName = { 1218 ALERT: 'alert', 1219 FADE: 'fade', 1220 SHOW: 'show' 1221 /** 1222 * ------------------------------------------------------------------------ 1223 * Class Definition 1224 * ------------------------------------------------------------------------ 1225 */ 1226 1227 }; 1228 1229 var Alert = 1230 /*#__PURE__*/ 1231 function () { 1232 function Alert(element) { 1233 this._element = element; 1234 } // Getters 1235 1236 1237 var _proto = Alert.prototype; 1238 1239 // Public 1240 _proto.close = function close(element) { 1241 var rootElement = this._element; 1242 1243 if (element) { 1244 rootElement = this._getRootElement(element); 1245 } 1246 1247 var customEvent = this._triggerCloseEvent(rootElement); 1248 1249 if (customEvent.isDefaultPrevented()) { 1250 return; 1251 } 1252 1253 this._removeElement(rootElement); 1254 }; 1255 1256 _proto.dispose = function dispose() { 1257 $.removeData(this._element, DATA_KEY); 1258 this._element = null; 1259 } // Private 1260 ; 1261 1262 _proto._getRootElement = function _getRootElement(element) { 1263 var selector = Util.getSelectorFromElement(element); 1264 var parent = false; 1265 1266 if (selector) { 1267 parent = document.querySelector(selector); 1268 } 1269 1270 if (!parent) { 1271 parent = $(element).closest("." + ClassName.ALERT)[0]; 1272 } 1273 1274 return parent; 1275 }; 1276 1277 _proto._triggerCloseEvent = function _triggerCloseEvent(element) { 1278 var closeEvent = $.Event(Event.CLOSE); 1279 $(element).trigger(closeEvent); 1280 return closeEvent; 1281 }; 1282 1283 _proto._removeElement = function _removeElement(element) { 1284 var _this = this; 1285 1286 $(element).removeClass(ClassName.SHOW); 1287 1288 if (!$(element).hasClass(ClassName.FADE)) { 1289 this._destroyElement(element); 1290 1291 return; 1292 } 1293 1294 var transitionDuration = Util.getTransitionDurationFromElement(element); 1295 $(element).one(Util.TRANSITION_END, function (event) { 1296 return _this._destroyElement(element, event); 1297 }).emulateTransitionEnd(transitionDuration); 1298 }; 1299 1300 _proto._destroyElement = function _destroyElement(element) { 1301 $(element).detach().trigger(Event.CLOSED).remove(); 1302 } // Static 1303 ; 1304 1305 Alert._jQueryInterface = function _jQueryInterface(config) { 1306 return this.each(function () { 1307 var $element = $(this); 1308 var data = $element.data(DATA_KEY); 1309 1310 if (!data) { 1311 data = new Alert(this); 1312 $element.data(DATA_KEY, data); 1313 } 1314 1315 if (config === 'close') { 1316 data[config](this); 1317 } 1318 }); 1319 }; 1320 1321 Alert._handleDismiss = function _handleDismiss(alertInstance) { 1322 return function (event) { 1323 if (event) { 1324 event.preventDefault(); 1325 } 1326 1327 alertInstance.close(this); 1328 }; 1329 }; 1330 1331 _createClass(Alert, null, [{ 1332 key: "VERSION", 1333 get: function get() { 1334 return VERSION; 1335 } 1336 }]); 1337 1338 return Alert; 1339 }(); 1340 /** 1341 * ------------------------------------------------------------------------ 1342 * Data Api implementation 1343 * ------------------------------------------------------------------------ 1344 */ 1345 1346 1347 $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert())); 1348 /** 1349 * ------------------------------------------------------------------------ 1350 * jQuery 1351 * ------------------------------------------------------------------------ 1352 */ 1353 1354 $.fn[NAME] = Alert._jQueryInterface; 1355 $.fn[NAME].Constructor = Alert; 1356 1357 $.fn[NAME].noConflict = function () { 1358 $.fn[NAME] = JQUERY_NO_CONFLICT; 1359 return Alert._jQueryInterface; 1360 }; 1361 1362 /** 1363 * ------------------------------------------------------------------------ 1364 * Constants 1365 * ------------------------------------------------------------------------ 1366 */ 1367 1368 var NAME$1 = 'button'; 1369 var VERSION$1 = '4.3.1'; 1370 var DATA_KEY$1 = 'bs.button'; 1371 var EVENT_KEY$1 = "." + DATA_KEY$1; 1372 var DATA_API_KEY$1 = '.data-api'; 1373 var JQUERY_NO_CONFLICT$1 = $.fn[NAME$1]; 1374 var ClassName$1 = { 1375 ACTIVE: 'active', 1376 BUTTON: 'btn', 1377 FOCUS: 'focus' 1378 }; 1379 var Selector$1 = { 1380 DATA_TOGGLE_CARROT: '[data-toggle^="button"]', 1381 DATA_TOGGLE: '[data-toggle="buttons"]', 1382 INPUT: 'input:not([type="hidden"])', 1383 ACTIVE: '.active', 1384 BUTTON: '.btn' 1385 }; 1386 var Event$1 = { 1387 CLICK_DATA_API: "click" + EVENT_KEY$1 + DATA_API_KEY$1, 1388 FOCUS_BLUR_DATA_API: "focus" + EVENT_KEY$1 + DATA_API_KEY$1 + " " + ("blur" + EVENT_KEY$1 + DATA_API_KEY$1) 1389 /** 1390 * ------------------------------------------------------------------------ 1391 * Class Definition 1392 * ------------------------------------------------------------------------ 1393 */ 1394 1395 }; 1396 1397 var Button = 1398 /*#__PURE__*/ 1399 function () { 1400 function Button(element) { 1401 this._element = element; 1402 } // Getters 1403 1404 1405 var _proto = Button.prototype; 1406 1407 // Public 1408 _proto.toggle = function toggle() { 1409 var triggerChangeEvent = true; 1410 var addAriaPressed = true; 1411 var rootElement = $(this._element).closest(Selector$1.DATA_TOGGLE)[0]; 1412 1413 if (rootElement) { 1414 var input = this._element.querySelector(Selector$1.INPUT); 1415 1416 if (input) { 1417 if (input.type === 'radio') { 1418 if (input.checked && this._element.classList.contains(ClassName$1.ACTIVE)) { 1419 triggerChangeEvent = false; 1420 } else { 1421 var activeElement = rootElement.querySelector(Selector$1.ACTIVE); 1422 1423 if (activeElement) { 1424 $(activeElement).removeClass(ClassName$1.ACTIVE); 1425 } 1426 } 1427 } 1428 1429 if (triggerChangeEvent) { 1430 if (input.hasAttribute('disabled') || rootElement.hasAttribute('disabled') || input.classList.contains('disabled') || rootElement.classList.contains('disabled')) { 1431 return; 1432 } 1433 1434 input.checked = !this._element.classList.contains(ClassName$1.ACTIVE); 1435 $(input).trigger('change'); 1436 } 1437 1438 input.focus(); 1439 addAriaPressed = false; 1440 } 1441 } 1442 1443 if (addAriaPressed) { 1444 this._element.setAttribute('aria-pressed', !this._element.classList.contains(ClassName$1.ACTIVE)); 1445 } 1446 1447 if (triggerChangeEvent) { 1448 $(this._element).toggleClass(ClassName$1.ACTIVE); 1449 } 1450 }; 1451 1452 _proto.dispose = function dispose() { 1453 $.removeData(this._element, DATA_KEY$1); 1454 this._element = null; 1455 } // Static 1456 ; 1457 1458 Button._jQueryInterface = function _jQueryInterface(config) { 1459 return this.each(function () { 1460 var data = $(this).data(DATA_KEY$1); 1461 1462 if (!data) { 1463 data = new Button(this); 1464 $(this).data(DATA_KEY$1, data); 1465 } 1466 1467 if (config === 'toggle') { 1468 data[config](); 1469 } 1470 }); 1471 }; 1472 1473 _createClass(Button, null, [{ 1474 key: "VERSION", 1475 get: function get() { 1476 return VERSION$1; 1477 } 1478 }]); 1479 1480 return Button; 1481 }(); 1482 /** 1483 * ------------------------------------------------------------------------ 1484 * Data Api implementation 1485 * ------------------------------------------------------------------------ 1486 */ 1487 1488 1489 $(document).on(Event$1.CLICK_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) { 1490 event.preventDefault(); 1491 var button = event.target; 1492 1493 if (!$(button).hasClass(ClassName$1.BUTTON)) { 1494 button = $(button).closest(Selector$1.BUTTON); 1495 } 1496 1497 Button._jQueryInterface.call($(button), 'toggle'); 1498 }).on(Event$1.FOCUS_BLUR_DATA_API, Selector$1.DATA_TOGGLE_CARROT, function (event) { 1499 var button = $(event.target).closest(Selector$1.BUTTON)[0]; 1500 $(button).toggleClass(ClassName$1.FOCUS, /^focus(in)?$/.test(event.type)); 1501 }); 1502 /** 1503 * ------------------------------------------------------------------------ 1504 * jQuery 1505 * ------------------------------------------------------------------------ 1506 */ 1507 1508 $.fn[NAME$1] = Button._jQueryInterface; 1509 $.fn[NAME$1].Constructor = Button; 1510 1511 $.fn[NAME$1].noConflict = function () { 1512 $.fn[NAME$1] = JQUERY_NO_CONFLICT$1; 1513 return Button._jQueryInterface; 1514 }; 1515 1516 /** 1517 * ------------------------------------------------------------------------ 1518 * Constants 1519 * ------------------------------------------------------------------------ 1520 */ 1521 1522 var NAME$2 = 'carousel'; 1523 var VERSION$2 = '4.3.1'; 1524 var DATA_KEY$2 = 'bs.carousel'; 1525 var EVENT_KEY$2 = "." + DATA_KEY$2; 1526 var DATA_API_KEY$2 = '.data-api'; 1527 var JQUERY_NO_CONFLICT$2 = $.fn[NAME$2]; 1528 var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key 1529 1530 var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key 1531 1532 var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch 1533 1534 var SWIPE_THRESHOLD = 40; 1535 var Default = { 1536 interval: 5000, 1537 keyboard: true, 1538 slide: false, 1539 pause: 'hover', 1540 wrap: true, 1541 touch: true 1542 }; 1543 var DefaultType = { 1544 interval: '(number|boolean)', 1545 keyboard: 'boolean', 1546 slide: '(boolean|string)', 1547 pause: '(string|boolean)', 1548 wrap: 'boolean', 1549 touch: 'boolean' 1550 }; 1551 var Direction = { 1552 NEXT: 'next', 1553 PREV: 'prev', 1554 LEFT: 'left', 1555 RIGHT: 'right' 1556 }; 1557 var Event$2 = { 1558 SLIDE: "slide" + EVENT_KEY$2, 1559 SLID: "slid" + EVENT_KEY$2, 1560 KEYDOWN: "keydown" + EVENT_KEY$2, 1561 MOUSEENTER: "mouseenter" + EVENT_KEY$2, 1562 MOUSELEAVE: "mouseleave" + EVENT_KEY$2, 1563 TOUCHSTART: "touchstart" + EVENT_KEY$2, 1564 TOUCHMOVE: "touchmove" + EVENT_KEY$2, 1565 TOUCHEND: "touchend" + EVENT_KEY$2, 1566 POINTERDOWN: "pointerdown" + EVENT_KEY$2, 1567 POINTERUP: "pointerup" + EVENT_KEY$2, 1568 DRAG_START: "dragstart" + EVENT_KEY$2, 1569 LOAD_DATA_API: "load" + EVENT_KEY$2 + DATA_API_KEY$2, 1570 CLICK_DATA_API: "click" + EVENT_KEY$2 + DATA_API_KEY$2 1571 }; 1572 var ClassName$2 = { 1573 CAROUSEL: 'carousel', 1574 ACTIVE: 'active', 1575 SLIDE: 'slide', 1576 RIGHT: 'carousel-item-right', 1577 LEFT: 'carousel-item-left', 1578 NEXT: 'carousel-item-next', 1579 PREV: 'carousel-item-prev', 1580 ITEM: 'carousel-item', 1581 POINTER_EVENT: 'pointer-event' 1582 }; 1583 var Selector$2 = { 1584 ACTIVE: '.active', 1585 ACTIVE_ITEM: '.active.carousel-item', 1586 ITEM: '.carousel-item', 1587 ITEM_IMG: '.carousel-item img', 1588 NEXT_PREV: '.carousel-item-next, .carousel-item-prev', 1589 INDICATORS: '.carousel-indicators', 1590 DATA_SLIDE: '[data-slide], [data-slide-to]', 1591 DATA_RIDE: '[data-ride="carousel"]' 1592 }; 1593 var PointerType = { 1594 TOUCH: 'touch', 1595 PEN: 'pen' 1596 /** 1597 * ------------------------------------------------------------------------ 1598 * Class Definition 1599 * ------------------------------------------------------------------------ 1600 */ 1601 1602 }; 1603 1604 var Carousel = 1605 /*#__PURE__*/ 1606 function () { 1607 function Carousel(element, config) { 1608 this._items = null; 1609 this._interval = null; 1610 this._activeElement = null; 1611 this._isPaused = false; 1612 this._isSliding = false; 1613 this.touchTimeout = null; 1614 this.touchStartX = 0; 1615 this.touchDeltaX = 0; 1616 this._config = this._getConfig(config); 1617 this._element = element; 1618 this._indicatorsElement = this._element.querySelector(Selector$2.INDICATORS); 1619 this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; 1620 this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent); 1621 1622 this._addEventListeners(); 1623 } // Getters 1624 1625 1626 var _proto = Carousel.prototype; 1627 1628 // Public 1629 _proto.next = function next() { 1630 if (!this._isSliding) { 1631 this._slide(Direction.NEXT); 1632 } 1633 }; 1634 1635 _proto.nextWhenVisible = function nextWhenVisible() { 1636 // Don't call next when the page isn't visible 1637 // or the carousel or its parent isn't visible 1638 if (!document.hidden && $(this._element).is(':visible') && $(this._element).css('visibility') !== 'hidden') { 1639 this.next(); 1640 } 1641 }; 1642 1643 _proto.prev = function prev() { 1644 if (!this._isSliding) { 1645 this._slide(Direction.PREV); 1646 } 1647 }; 1648 1649 _proto.pause = function pause(event) { 1650 if (!event) { 1651 this._isPaused = true; 1652 } 1653 1654 if (this._element.querySelector(Selector$2.NEXT_PREV)) { 1655 Util.triggerTransitionEnd(this._element); 1656 this.cycle(true); 1657 } 1658 1659 clearInterval(this._interval); 1660 this._interval = null; 1661 }; 1662 1663 _proto.cycle = function cycle(event) { 1664 if (!event) { 1665 this._isPaused = false; 1666 } 1667 1668 if (this._interval) { 1669 clearInterval(this._interval); 1670 this._interval = null; 1671 } 1672 1673 if (this._config.interval && !this._isPaused) { 1674 this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval); 1675 } 1676 }; 1677 1678 _proto.to = function to(index) { 1679 var _this = this; 1680 1681 this._activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM); 1682 1683 var activeIndex = this._getItemIndex(this._activeElement); 1684 1685 if (index > this._items.length - 1 || index < 0) { 1686 return; 1687 } 1688 1689 if (this._isSliding) { 1690 $(this._element).one(Event$2.SLID, function () { 1691 return _this.to(index); 1692 }); 1693 return; 1694 } 1695 1696 if (activeIndex === index) { 1697 this.pause(); 1698 this.cycle(); 1699 return; 1700 } 1701 1702 var direction = index > activeIndex ? Direction.NEXT : Direction.PREV; 1703 1704 this._slide(direction, this._items[index]); 1705 }; 1706 1707 _proto.dispose = function dispose() { 1708 $(this._element).off(EVENT_KEY$2); 1709 $.removeData(this._element, DATA_KEY$2); 1710 this._items = null; 1711 this._config = null; 1712 this._element = null; 1713 this._interval = null; 1714 this._isPaused = null; 1715 this._isSliding = null; 1716 this._activeElement = null; 1717 this._indicatorsElement = null; 1718 } // Private 1719 ; 1720 1721 _proto._getConfig = function _getConfig(config) { 1722 config = _objectSpread({}, Default, config); 1723 Util.typeCheckConfig(NAME$2, config, DefaultType); 1724 return config; 1725 }; 1726 1727 _proto._handleSwipe = function _handleSwipe() { 1728 var absDeltax = Math.abs(this.touchDeltaX); 1729 1730 if (absDeltax <= SWIPE_THRESHOLD) { 1731 return; 1732 } 1733 1734 var direction = absDeltax / this.touchDeltaX; // swipe left 1735 1736 if (direction > 0) { 1737 this.prev(); 1738 } // swipe right 1739 1740 1741 if (direction < 0) { 1742 this.next(); 1743 } 1744 }; 1745 1746 _proto._addEventListeners = function _addEventListeners() { 1747 var _this2 = this; 1748 1749 if (this._config.keyboard) { 1750 $(this._element).on(Event$2.KEYDOWN, function (event) { 1751 return _this2._keydown(event); 1752 }); 1753 } 1754 1755 if (this._config.pause === 'hover') { 1756 $(this._element).on(Event$2.MOUSEENTER, function (event) { 1757 return _this2.pause(event); 1758 }).on(Event$2.MOUSELEAVE, function (event) { 1759 return _this2.cycle(event); 1760 }); 1761 } 1762 1763 if (this._config.touch) { 1764 this._addTouchEventListeners(); 1765 } 1766 }; 1767 1768 _proto._addTouchEventListeners = function _addTouchEventListeners() { 1769 var _this3 = this; 1770 1771 if (!this._touchSupported) { 1772 return; 1773 } 1774 1775 var start = function start(event) { 1776 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 1777 _this3.touchStartX = event.originalEvent.clientX; 1778 } else if (!_this3._pointerEvent) { 1779 _this3.touchStartX = event.originalEvent.touches[0].clientX; 1780 } 1781 }; 1782 1783 var move = function move(event) { 1784 // ensure swiping with one touch and not pinching 1785 if (event.originalEvent.touches && event.originalEvent.touches.length > 1) { 1786 _this3.touchDeltaX = 0; 1787 } else { 1788 _this3.touchDeltaX = event.originalEvent.touches[0].clientX - _this3.touchStartX; 1789 } 1790 }; 1791 1792 var end = function end(event) { 1793 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 1794 _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX; 1795 } 1796 1797 _this3._handleSwipe(); 1798 1799 if (_this3._config.pause === 'hover') { 1800 // If it's a touch-enabled device, mouseenter/leave are fired as 1801 // part of the mouse compatibility events on first tap - the carousel 1802 // would stop cycling until user tapped out of it; 1803 // here, we listen for touchend, explicitly pause the carousel 1804 // (as if it's the second time we tap on it, mouseenter compat event 1805 // is NOT fired) and after a timeout (to allow for mouse compatibility 1806 // events to fire) we explicitly restart cycling 1807 _this3.pause(); 1808 1809 if (_this3.touchTimeout) { 1810 clearTimeout(_this3.touchTimeout); 1811 } 1812 1813 _this3.touchTimeout = setTimeout(function (event) { 1814 return _this3.cycle(event); 1815 }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval); 1816 } 1817 }; 1818 1819 $(this._element.querySelectorAll(Selector$2.ITEM_IMG)).on(Event$2.DRAG_START, function (e) { 1820 return e.preventDefault(); 1821 }); 1822 1823 if (this._pointerEvent) { 1824 $(this._element).on(Event$2.POINTERDOWN, function (event) { 1825 return start(event); 1826 }); 1827 $(this._element).on(Event$2.POINTERUP, function (event) { 1828 return end(event); 1829 }); 1830 1831 this._element.classList.add(ClassName$2.POINTER_EVENT); 1832 } else { 1833 $(this._element).on(Event$2.TOUCHSTART, function (event) { 1834 return start(event); 1835 }); 1836 $(this._element).on(Event$2.TOUCHMOVE, function (event) { 1837 return move(event); 1838 }); 1839 $(this._element).on(Event$2.TOUCHEND, function (event) { 1840 return end(event); 1841 }); 1842 } 1843 }; 1844 1845 _proto._keydown = function _keydown(event) { 1846 if (/input|textarea/i.test(event.target.tagName)) { 1847 return; 1848 } 1849 1850 switch (event.which) { 1851 case ARROW_LEFT_KEYCODE: 1852 event.preventDefault(); 1853 this.prev(); 1854 break; 1855 1856 case ARROW_RIGHT_KEYCODE: 1857 event.preventDefault(); 1858 this.next(); 1859 break; 1860 1861 default: 1862 } 1863 }; 1864 1865 _proto._getItemIndex = function _getItemIndex(element) { 1866 this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(Selector$2.ITEM)) : []; 1867 return this._items.indexOf(element); 1868 }; 1869 1870 _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) { 1871 var isNextDirection = direction === Direction.NEXT; 1872 var isPrevDirection = direction === Direction.PREV; 1873 1874 var activeIndex = this._getItemIndex(activeElement); 1875 1876 var lastItemIndex = this._items.length - 1; 1877 var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex; 1878 1879 if (isGoingToWrap && !this._config.wrap) { 1880 return activeElement; 1881 } 1882 1883 var delta = direction === Direction.PREV ? -1 : 1; 1884 var itemIndex = (activeIndex + delta) % this._items.length; 1885 return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; 1886 }; 1887 1888 _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) { 1889 var targetIndex = this._getItemIndex(relatedTarget); 1890 1891 var fromIndex = this._getItemIndex(this._element.querySelector(Selector$2.ACTIVE_ITEM)); 1892 1893 var slideEvent = $.Event(Event$2.SLIDE, { 1894 relatedTarget: relatedTarget, 1895 direction: eventDirectionName, 1896 from: fromIndex, 1897 to: targetIndex 1898 }); 1899 $(this._element).trigger(slideEvent); 1900 return slideEvent; 1901 }; 1902 1903 _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) { 1904 if (this._indicatorsElement) { 1905 var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(Selector$2.ACTIVE)); 1906 $(indicators).removeClass(ClassName$2.ACTIVE); 1907 1908 var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; 1909 1910 if (nextIndicator) { 1911 $(nextIndicator).addClass(ClassName$2.ACTIVE); 1912 } 1913 } 1914 }; 1915 1916 _proto._slide = function _slide(direction, element) { 1917 var _this4 = this; 1918 1919 var activeElement = this._element.querySelector(Selector$2.ACTIVE_ITEM); 1920 1921 var activeElementIndex = this._getItemIndex(activeElement); 1922 1923 var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); 1924 1925 var nextElementIndex = this._getItemIndex(nextElement); 1926 1927 var isCycling = Boolean(this._interval); 1928 var directionalClassName; 1929 var orderClassName; 1930 var eventDirectionName; 1931 1932 if (direction === Direction.NEXT) { 1933 directionalClassName = ClassName$2.LEFT; 1934 orderClassName = ClassName$2.NEXT; 1935 eventDirectionName = Direction.LEFT; 1936 } else { 1937 directionalClassName = ClassName$2.RIGHT; 1938 orderClassName = ClassName$2.PREV; 1939 eventDirectionName = Direction.RIGHT; 1940 } 1941 1942 if (nextElement && $(nextElement).hasClass(ClassName$2.ACTIVE)) { 1943 this._isSliding = false; 1944 return; 1945 } 1946 1947 var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName); 1948 1949 if (slideEvent.isDefaultPrevented()) { 1950 return; 1951 } 1952 1953 if (!activeElement || !nextElement) { 1954 // Some weirdness is happening, so we bail 1955 return; 1956 } 1957 1958 this._isSliding = true; 1959 1960 if (isCycling) { 1961 this.pause(); 1962 } 1963 1964 this._setActiveIndicatorElement(nextElement); 1965 1966 var slidEvent = $.Event(Event$2.SLID, { 1967 relatedTarget: nextElement, 1968 direction: eventDirectionName, 1969 from: activeElementIndex, 1970 to: nextElementIndex 1971 }); 1972 1973 if ($(this._element).hasClass(ClassName$2.SLIDE)) { 1974 $(nextElement).addClass(orderClassName); 1975 Util.reflow(nextElement); 1976 $(activeElement).addClass(directionalClassName); 1977 $(nextElement).addClass(directionalClassName); 1978 var nextElementInterval = parseInt(nextElement.getAttribute('data-interval'), 10); 1979 1980 if (nextElementInterval) { 1981 this._config.defaultInterval = this._config.defaultInterval || this._config.interval; 1982 this._config.interval = nextElementInterval; 1983 } else { 1984 this._config.interval = this._config.defaultInterval || this._config.interval; 1985 } 1986 1987 var transitionDuration = Util.getTransitionDurationFromElement(activeElement); 1988 $(activeElement).one(Util.TRANSITION_END, function () { 1989 $(nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(ClassName$2.ACTIVE); 1990 $(activeElement).removeClass(ClassName$2.ACTIVE + " " + orderClassName + " " + directionalClassName); 1991 _this4._isSliding = false; 1992 setTimeout(function () { 1993 return $(_this4._element).trigger(slidEvent); 1994 }, 0); 1995 }).emulateTransitionEnd(transitionDuration); 1996 } else { 1997 $(activeElement).removeClass(ClassName$2.ACTIVE); 1998 $(nextElement).addClass(ClassName$2.ACTIVE); 1999 this._isSliding = false; 2000 $(this._element).trigger(slidEvent); 2001 } 2002 2003 if (isCycling) { 2004 this.cycle(); 2005 } 2006 } // Static 2007 ; 2008 2009 Carousel._jQueryInterface = function _jQueryInterface(config) { 2010 return this.each(function () { 2011 var data = $(this).data(DATA_KEY$2); 2012 2013 var _config = _objectSpread({}, Default, $(this).data()); 2014 2015 if (typeof config === 'object') { 2016 _config = _objectSpread({}, _config, config); 2017 } 2018 2019 var action = typeof config === 'string' ? config : _config.slide; 2020 2021 if (!data) { 2022 data = new Carousel(this, _config); 2023 $(this).data(DATA_KEY$2, data); 2024 } 2025 2026 if (typeof config === 'number') { 2027 data.to(config); 2028 } else if (typeof action === 'string') { 2029 if (typeof data[action] === 'undefined') { 2030 throw new TypeError("No method named \"" + action + "\""); 2031 } 2032 2033 data[action](); 2034 } else if (_config.interval && _config.ride) { 2035 data.pause(); 2036 data.cycle(); 2037 } 2038 }); 2039 }; 2040 2041 Carousel._dataApiClickHandler = function _dataApiClickHandler(event) { 2042 var selector = Util.getSelectorFromElement(this); 2043 2044 if (!selector) { 2045 return; 2046 } 2047 2048 var target = $(selector)[0]; 2049 2050 if (!target || !$(target).hasClass(ClassName$2.CAROUSEL)) { 2051 return; 2052 } 2053 2054 var config = _objectSpread({}, $(target).data(), $(this).data()); 2055 2056 var slideIndex = this.getAttribute('data-slide-to'); 2057 2058 if (slideIndex) { 2059 config.interval = false; 2060 } 2061 2062 Carousel._jQueryInterface.call($(target), config); 2063 2064 if (slideIndex) { 2065 $(target).data(DATA_KEY$2).to(slideIndex); 2066 } 2067 2068 event.preventDefault(); 2069 }; 2070 2071 _createClass(Carousel, null, [{ 2072 key: "VERSION", 2073 get: function get() { 2074 return VERSION$2; 2075 } 2076 }, { 2077 key: "Default", 2078 get: function get() { 2079 return Default; 2080 } 2081 }]); 2082 2083 return Carousel; 2084 }(); 2085 /** 2086 * ------------------------------------------------------------------------ 2087 * Data Api implementation 2088 * ------------------------------------------------------------------------ 2089 */ 2090 2091 2092 $(document).on(Event$2.CLICK_DATA_API, Selector$2.DATA_SLIDE, Carousel._dataApiClickHandler); 2093 $(window).on(Event$2.LOAD_DATA_API, function () { 2094 var carousels = [].slice.call(document.querySelectorAll(Selector$2.DATA_RIDE)); 2095 2096 for (var i = 0, len = carousels.length; i < len; i++) { 2097 var $carousel = $(carousels[i]); 2098 2099 Carousel._jQueryInterface.call($carousel, $carousel.data()); 2100 } 2101 }); 2102 /** 2103 * ------------------------------------------------------------------------ 2104 * jQuery 2105 * ------------------------------------------------------------------------ 2106 */ 2107 2108 $.fn[NAME$2] = Carousel._jQueryInterface; 2109 $.fn[NAME$2].Constructor = Carousel; 2110 2111 $.fn[NAME$2].noConflict = function () { 2112 $.fn[NAME$2] = JQUERY_NO_CONFLICT$2; 2113 return Carousel._jQueryInterface; 2114 }; 2115 2116 /** 2117 * ------------------------------------------------------------------------ 2118 * Constants 2119 * ------------------------------------------------------------------------ 2120 */ 2121 2122 var NAME$3 = 'collapse'; 2123 var VERSION$3 = '4.3.1'; 2124 var DATA_KEY$3 = 'bs.collapse'; 2125 var EVENT_KEY$3 = "." + DATA_KEY$3; 2126 var DATA_API_KEY$3 = '.data-api'; 2127 var JQUERY_NO_CONFLICT$3 = $.fn[NAME$3]; 2128 var Default$1 = { 2129 toggle: true, 2130 parent: '' 2131 }; 2132 var DefaultType$1 = { 2133 toggle: 'boolean', 2134 parent: '(string|element)' 2135 }; 2136 var Event$3 = { 2137 SHOW: "show" + EVENT_KEY$3, 2138 SHOWN: "shown" + EVENT_KEY$3, 2139 HIDE: "hide" + EVENT_KEY$3, 2140 HIDDEN: "hidden" + EVENT_KEY$3, 2141 CLICK_DATA_API: "click" + EVENT_KEY$3 + DATA_API_KEY$3 2142 }; 2143 var ClassName$3 = { 2144 SHOW: 'show', 2145 COLLAPSE: 'collapse', 2146 COLLAPSING: 'collapsing', 2147 COLLAPSED: 'collapsed' 2148 }; 2149 var Dimension = { 2150 WIDTH: 'width', 2151 HEIGHT: 'height' 2152 }; 2153 var Selector$3 = { 2154 ACTIVES: '.show, .collapsing', 2155 DATA_TOGGLE: '[data-toggle="collapse"]' 2156 /** 2157 * ------------------------------------------------------------------------ 2158 * Class Definition 2159 * ------------------------------------------------------------------------ 2160 */ 2161 2162 }; 2163 2164 var Collapse = 2165 /*#__PURE__*/ 2166 function () { 2167 function Collapse(element, config) { 2168 this._isTransitioning = false; 2169 this._element = element; 2170 this._config = this._getConfig(config); 2171 this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]"))); 2172 var toggleList = [].slice.call(document.querySelectorAll(Selector$3.DATA_TOGGLE)); 2173 2174 for (var i = 0, len = toggleList.length; i < len; i++) { 2175 var elem = toggleList[i]; 2176 var selector = Util.getSelectorFromElement(elem); 2177 var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) { 2178 return foundElem === element; 2179 }); 2180 2181 if (selector !== null && filterElement.length > 0) { 2182 this._selector = selector; 2183 2184 this._triggerArray.push(elem); 2185 } 2186 } 2187 2188 this._parent = this._config.parent ? this._getParent() : null; 2189 2190 if (!this._config.parent) { 2191 this._addAriaAndCollapsedClass(this._element, this._triggerArray); 2192 } 2193 2194 if (this._config.toggle) { 2195 this.toggle(); 2196 } 2197 } // Getters 2198 2199 2200 var _proto = Collapse.prototype; 2201 2202 // Public 2203 _proto.toggle = function toggle() { 2204 if ($(this._element).hasClass(ClassName$3.SHOW)) { 2205 this.hide(); 2206 } else { 2207 this.show(); 2208 } 2209 }; 2210 2211 _proto.show = function show() { 2212 var _this = this; 2213 2214 if (this._isTransitioning || $(this._element).hasClass(ClassName$3.SHOW)) { 2215 return; 2216 } 2217 2218 var actives; 2219 var activesData; 2220 2221 if (this._parent) { 2222 actives = [].slice.call(this._parent.querySelectorAll(Selector$3.ACTIVES)).filter(function (elem) { 2223 if (typeof _this._config.parent === 'string') { 2224 return elem.getAttribute('data-parent') === _this._config.parent; 2225 } 2226 2227 return elem.classList.contains(ClassName$3.COLLAPSE); 2228 }); 2229 2230 if (actives.length === 0) { 2231 actives = null; 2232 } 2233 } 2234 2235 if (actives) { 2236 activesData = $(actives).not(this._selector).data(DATA_KEY$3); 2237 2238 if (activesData && activesData._isTransitioning) { 2239 return; 2240 } 2241 } 2242 2243 var startEvent = $.Event(Event$3.SHOW); 2244 $(this._element).trigger(startEvent); 2245 2246 if (startEvent.isDefaultPrevented()) { 2247 return; 2248 } 2249 2250 if (actives) { 2251 Collapse._jQueryInterface.call($(actives).not(this._selector), 'hide'); 2252 2253 if (!activesData) { 2254 $(actives).data(DATA_KEY$3, null); 2255 } 2256 } 2257 2258 var dimension = this._getDimension(); 2259 2260 $(this._element).removeClass(ClassName$3.COLLAPSE).addClass(ClassName$3.COLLAPSING); 2261 this._element.style[dimension] = 0; 2262 2263 if (this._triggerArray.length) { 2264 $(this._triggerArray).removeClass(ClassName$3.COLLAPSED).attr('aria-expanded', true); 2265 } 2266 2267 this.setTransitioning(true); 2268 2269 var complete = function complete() { 2270 $(_this._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).addClass(ClassName$3.SHOW); 2271 _this._element.style[dimension] = ''; 2272 2273 _this.setTransitioning(false); 2274 2275 $(_this._element).trigger(Event$3.SHOWN); 2276 }; 2277 2278 var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); 2279 var scrollSize = "scroll" + capitalizedDimension; 2280 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 2281 $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 2282 this._element.style[dimension] = this._element[scrollSize] + "px"; 2283 }; 2284 2285 _proto.hide = function hide() { 2286 var _this2 = this; 2287 2288 if (this._isTransitioning || !$(this._element).hasClass(ClassName$3.SHOW)) { 2289 return; 2290 } 2291 2292 var startEvent = $.Event(Event$3.HIDE); 2293 $(this._element).trigger(startEvent); 2294 2295 if (startEvent.isDefaultPrevented()) { 2296 return; 2297 } 2298 2299 var dimension = this._getDimension(); 2300 2301 this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px"; 2302 Util.reflow(this._element); 2303 $(this._element).addClass(ClassName$3.COLLAPSING).removeClass(ClassName$3.COLLAPSE).removeClass(ClassName$3.SHOW); 2304 var triggerArrayLength = this._triggerArray.length; 2305 2306 if (triggerArrayLength > 0) { 2307 for (var i = 0; i < triggerArrayLength; i++) { 2308 var trigger = this._triggerArray[i]; 2309 var selector = Util.getSelectorFromElement(trigger); 2310 2311 if (selector !== null) { 2312 var $elem = $([].slice.call(document.querySelectorAll(selector))); 2313 2314 if (!$elem.hasClass(ClassName$3.SHOW)) { 2315 $(trigger).addClass(ClassName$3.COLLAPSED).attr('aria-expanded', false); 2316 } 2317 } 2318 } 2319 } 2320 2321 this.setTransitioning(true); 2322 2323 var complete = function complete() { 2324 _this2.setTransitioning(false); 2325 2326 $(_this2._element).removeClass(ClassName$3.COLLAPSING).addClass(ClassName$3.COLLAPSE).trigger(Event$3.HIDDEN); 2327 }; 2328 2329 this._element.style[dimension] = ''; 2330 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 2331 $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 2332 }; 2333 2334 _proto.setTransitioning = function setTransitioning(isTransitioning) { 2335 this._isTransitioning = isTransitioning; 2336 }; 2337 2338 _proto.dispose = function dispose() { 2339 $.removeData(this._element, DATA_KEY$3); 2340 this._config = null; 2341 this._parent = null; 2342 this._element = null; 2343 this._triggerArray = null; 2344 this._isTransitioning = null; 2345 } // Private 2346 ; 2347 2348 _proto._getConfig = function _getConfig(config) { 2349 config = _objectSpread({}, Default$1, config); 2350 config.toggle = Boolean(config.toggle); // Coerce string values 2351 2352 Util.typeCheckConfig(NAME$3, config, DefaultType$1); 2353 return config; 2354 }; 2355 2356 _proto._getDimension = function _getDimension() { 2357 var hasWidth = $(this._element).hasClass(Dimension.WIDTH); 2358 return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT; 2359 }; 2360 2361 _proto._getParent = function _getParent() { 2362 var _this3 = this; 2363 2364 var parent; 2365 2366 if (Util.isElement(this._config.parent)) { 2367 parent = this._config.parent; // It's a jQuery object 2368 2369 if (typeof this._config.parent.jquery !== 'undefined') { 2370 parent = this._config.parent[0]; 2371 } 2372 } else { 2373 parent = document.querySelector(this._config.parent); 2374 } 2375 2376 var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]"; 2377 var children = [].slice.call(parent.querySelectorAll(selector)); 2378 $(children).each(function (i, element) { 2379 _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); 2380 }); 2381 return parent; 2382 }; 2383 2384 _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) { 2385 var isOpen = $(element).hasClass(ClassName$3.SHOW); 2386 2387 if (triggerArray.length) { 2388 $(triggerArray).toggleClass(ClassName$3.COLLAPSED, !isOpen).attr('aria-expanded', isOpen); 2389 } 2390 } // Static 2391 ; 2392 2393 Collapse._getTargetFromElement = function _getTargetFromElement(element) { 2394 var selector = Util.getSelectorFromElement(element); 2395 return selector ? document.querySelector(selector) : null; 2396 }; 2397 2398 Collapse._jQueryInterface = function _jQueryInterface(config) { 2399 return this.each(function () { 2400 var $this = $(this); 2401 var data = $this.data(DATA_KEY$3); 2402 2403 var _config = _objectSpread({}, Default$1, $this.data(), typeof config === 'object' && config ? config : {}); 2404 2405 if (!data && _config.toggle && /show|hide/.test(config)) { 2406 _config.toggle = false; 2407 } 2408 2409 if (!data) { 2410 data = new Collapse(this, _config); 2411 $this.data(DATA_KEY$3, data); 2412 } 2413 2414 if (typeof config === 'string') { 2415 if (typeof data[config] === 'undefined') { 2416 throw new TypeError("No method named \"" + config + "\""); 2417 } 2418 2419 data[config](); 2420 } 2421 }); 2422 }; 2423 2424 _createClass(Collapse, null, [{ 2425 key: "VERSION", 2426 get: function get() { 2427 return VERSION$3; 2428 } 2429 }, { 2430 key: "Default", 2431 get: function get() { 2432 return Default$1; 2433 } 2434 }]); 2435 2436 return Collapse; 2437 }(); 2438 /** 2439 * ------------------------------------------------------------------------ 2440 * Data Api implementation 2441 * ------------------------------------------------------------------------ 2442 */ 2443 2444 2445 $(document).on(Event$3.CLICK_DATA_API, Selector$3.DATA_TOGGLE, function (event) { 2446 // preventDefault only for <a> elements (which change the URL) not inside the collapsible element 2447 if (event.currentTarget.tagName === 'A') { 2448 event.preventDefault(); 2449 } 2450 2451 var $trigger = $(this); 2452 var selector = Util.getSelectorFromElement(this); 2453 var selectors = [].slice.call(document.querySelectorAll(selector)); 2454 $(selectors).each(function () { 2455 var $target = $(this); 2456 var data = $target.data(DATA_KEY$3); 2457 var config = data ? 'toggle' : $trigger.data(); 2458 2459 Collapse._jQueryInterface.call($target, config); 2460 }); 2461 }); 2462 /** 2463 * ------------------------------------------------------------------------ 2464 * jQuery 2465 * ------------------------------------------------------------------------ 2466 */ 2467 2468 $.fn[NAME$3] = Collapse._jQueryInterface; 2469 $.fn[NAME$3].Constructor = Collapse; 2470 2471 $.fn[NAME$3].noConflict = function () { 2472 $.fn[NAME$3] = JQUERY_NO_CONFLICT$3; 2473 return Collapse._jQueryInterface; 2474 }; 2475 2476 /** 2477 * ------------------------------------------------------------------------ 2478 * Constants 2479 * ------------------------------------------------------------------------ 2480 */ 2481 2482 var NAME$4 = 'dropdown'; 2483 var VERSION$4 = '4.3.1'; 2484 var DATA_KEY$4 = 'bs.dropdown'; 2485 var EVENT_KEY$4 = "." + DATA_KEY$4; 2486 var DATA_API_KEY$4 = '.data-api'; 2487 var JQUERY_NO_CONFLICT$4 = $.fn[NAME$4]; 2488 var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key 2489 2490 var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key 2491 2492 var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key 2493 2494 var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key 2495 2496 var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key 2497 2498 var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse) 2499 2500 var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE); 2501 var Event$4 = { 2502 HIDE: "hide" + EVENT_KEY$4, 2503 HIDDEN: "hidden" + EVENT_KEY$4, 2504 SHOW: "show" + EVENT_KEY$4, 2505 SHOWN: "shown" + EVENT_KEY$4, 2506 CLICK: "click" + EVENT_KEY$4, 2507 CLICK_DATA_API: "click" + EVENT_KEY$4 + DATA_API_KEY$4, 2508 KEYDOWN_DATA_API: "keydown" + EVENT_KEY$4 + DATA_API_KEY$4, 2509 KEYUP_DATA_API: "keyup" + EVENT_KEY$4 + DATA_API_KEY$4 2510 }; 2511 var ClassName$4 = { 2512 DISABLED: 'disabled', 2513 SHOW: 'show', 2514 DROPUP: 'dropup', 2515 DROPRIGHT: 'dropright', 2516 DROPLEFT: 'dropleft', 2517 MENURIGHT: 'dropdown-menu-right', 2518 MENULEFT: 'dropdown-menu-left', 2519 POSITION_STATIC: 'position-static' 2520 }; 2521 var Selector$4 = { 2522 DATA_TOGGLE: '[data-toggle="dropdown"]', 2523 FORM_CHILD: '.dropdown form', 2524 MENU: '.dropdown-menu', 2525 NAVBAR_NAV: '.navbar-nav', 2526 VISIBLE_ITEMS: '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)' 2527 }; 2528 var AttachmentMap = { 2529 TOP: 'top-start', 2530 TOPEND: 'top-end', 2531 BOTTOM: 'bottom-start', 2532 BOTTOMEND: 'bottom-end', 2533 RIGHT: 'right-start', 2534 RIGHTEND: 'right-end', 2535 LEFT: 'left-start', 2536 LEFTEND: 'left-end' 2537 }; 2538 var Default$2 = { 2539 offset: 0, 2540 flip: true, 2541 boundary: 'scrollParent', 2542 reference: 'toggle', 2543 display: 'dynamic' 2544 }; 2545 var DefaultType$2 = { 2546 offset: '(number|string|function)', 2547 flip: 'boolean', 2548 boundary: '(string|element)', 2549 reference: '(string|element)', 2550 display: 'string' 2551 /** 2552 * ------------------------------------------------------------------------ 2553 * Class Definition 2554 * ------------------------------------------------------------------------ 2555 */ 2556 2557 }; 2558 2559 var Dropdown = 2560 /*#__PURE__*/ 2561 function () { 2562 function Dropdown(element, config) { 2563 this._element = element; 2564 this._popper = null; 2565 this._config = this._getConfig(config); 2566 this._menu = this._getMenuElement(); 2567 this._inNavbar = this._detectNavbar(); 2568 2569 this._addEventListeners(); 2570 } // Getters 2571 2572 2573 var _proto = Dropdown.prototype; 2574 2575 // Public 2576 _proto.toggle = function toggle() { 2577 if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED)) { 2578 return; 2579 } 2580 2581 var parent = Dropdown._getParentFromElement(this._element); 2582 2583 var isActive = $(this._menu).hasClass(ClassName$4.SHOW); 2584 2585 Dropdown._clearMenus(); 2586 2587 if (isActive) { 2588 return; 2589 } 2590 2591 var relatedTarget = { 2592 relatedTarget: this._element 2593 }; 2594 var showEvent = $.Event(Event$4.SHOW, relatedTarget); 2595 $(parent).trigger(showEvent); 2596 2597 if (showEvent.isDefaultPrevented()) { 2598 return; 2599 } // Disable totally Popper.js for Dropdown in Navbar 2600 2601 2602 if (!this._inNavbar) { 2603 /** 2604 * Check for Popper dependency 2605 * Popper - https://popper.js.org 2606 */ 2607 if (typeof Popper === 'undefined') { 2608 throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org/)'); 2609 } 2610 2611 var referenceElement = this._element; 2612 2613 if (this._config.reference === 'parent') { 2614 referenceElement = parent; 2615 } else if (Util.isElement(this._config.reference)) { 2616 referenceElement = this._config.reference; // Check if it's jQuery element 2617 2618 if (typeof this._config.reference.jquery !== 'undefined') { 2619 referenceElement = this._config.reference[0]; 2620 } 2621 } // If boundary is not `scrollParent`, then set position to `static` 2622 // to allow the menu to "escape" the scroll parent's boundaries 2623 // https://github.com/twbs/bootstrap/issues/24251 2624 2625 2626 if (this._config.boundary !== 'scrollParent') { 2627 $(parent).addClass(ClassName$4.POSITION_STATIC); 2628 } 2629 2630 this._popper = new Popper(referenceElement, this._menu, this._getPopperConfig()); 2631 } // If this is a touch-enabled device we add extra 2632 // empty mouseover listeners to the body's immediate children; 2633 // only needed because of broken event delegation on iOS 2634 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 2635 2636 2637 if ('ontouchstart' in document.documentElement && $(parent).closest(Selector$4.NAVBAR_NAV).length === 0) { 2638 $(document.body).children().on('mouseover', null, $.noop); 2639 } 2640 2641 this._element.focus(); 2642 2643 this._element.setAttribute('aria-expanded', true); 2644 2645 $(this._menu).toggleClass(ClassName$4.SHOW); 2646 $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget)); 2647 }; 2648 2649 _proto.show = function show() { 2650 if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || $(this._menu).hasClass(ClassName$4.SHOW)) { 2651 return; 2652 } 2653 2654 var relatedTarget = { 2655 relatedTarget: this._element 2656 }; 2657 var showEvent = $.Event(Event$4.SHOW, relatedTarget); 2658 2659 var parent = Dropdown._getParentFromElement(this._element); 2660 2661 $(parent).trigger(showEvent); 2662 2663 if (showEvent.isDefaultPrevented()) { 2664 return; 2665 } 2666 2667 $(this._menu).toggleClass(ClassName$4.SHOW); 2668 $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.SHOWN, relatedTarget)); 2669 }; 2670 2671 _proto.hide = function hide() { 2672 if (this._element.disabled || $(this._element).hasClass(ClassName$4.DISABLED) || !$(this._menu).hasClass(ClassName$4.SHOW)) { 2673 return; 2674 } 2675 2676 var relatedTarget = { 2677 relatedTarget: this._element 2678 }; 2679 var hideEvent = $.Event(Event$4.HIDE, relatedTarget); 2680 2681 var parent = Dropdown._getParentFromElement(this._element); 2682 2683 $(parent).trigger(hideEvent); 2684 2685 if (hideEvent.isDefaultPrevented()) { 2686 return; 2687 } 2688 2689 $(this._menu).toggleClass(ClassName$4.SHOW); 2690 $(parent).toggleClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget)); 2691 }; 2692 2693 _proto.dispose = function dispose() { 2694 $.removeData(this._element, DATA_KEY$4); 2695 $(this._element).off(EVENT_KEY$4); 2696 this._element = null; 2697 this._menu = null; 2698 2699 if (this._popper !== null) { 2700 this._popper.destroy(); 2701 2702 this._popper = null; 2703 } 2704 }; 2705 2706 _proto.update = function update() { 2707 this._inNavbar = this._detectNavbar(); 2708 2709 if (this._popper !== null) { 2710 this._popper.scheduleUpdate(); 2711 } 2712 } // Private 2713 ; 2714 2715 _proto._addEventListeners = function _addEventListeners() { 2716 var _this = this; 2717 2718 $(this._element).on(Event$4.CLICK, function (event) { 2719 event.preventDefault(); 2720 event.stopPropagation(); 2721 2722 _this.toggle(); 2723 }); 2724 }; 2725 2726 _proto._getConfig = function _getConfig(config) { 2727 config = _objectSpread({}, this.constructor.Default, $(this._element).data(), config); 2728 Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType); 2729 return config; 2730 }; 2731 2732 _proto._getMenuElement = function _getMenuElement() { 2733 if (!this._menu) { 2734 var parent = Dropdown._getParentFromElement(this._element); 2735 2736 if (parent) { 2737 this._menu = parent.querySelector(Selector$4.MENU); 2738 } 2739 } 2740 2741 return this._menu; 2742 }; 2743 2744 _proto._getPlacement = function _getPlacement() { 2745 var $parentDropdown = $(this._element.parentNode); 2746 var placement = AttachmentMap.BOTTOM; // Handle dropup 2747 2748 if ($parentDropdown.hasClass(ClassName$4.DROPUP)) { 2749 placement = AttachmentMap.TOP; 2750 2751 if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) { 2752 placement = AttachmentMap.TOPEND; 2753 } 2754 } else if ($parentDropdown.hasClass(ClassName$4.DROPRIGHT)) { 2755 placement = AttachmentMap.RIGHT; 2756 } else if ($parentDropdown.hasClass(ClassName$4.DROPLEFT)) { 2757 placement = AttachmentMap.LEFT; 2758 } else if ($(this._menu).hasClass(ClassName$4.MENURIGHT)) { 2759 placement = AttachmentMap.BOTTOMEND; 2760 } 2761 2762 return placement; 2763 }; 2764 2765 _proto._detectNavbar = function _detectNavbar() { 2766 return $(this._element).closest('.navbar').length > 0; 2767 }; 2768 2769 _proto._getOffset = function _getOffset() { 2770 var _this2 = this; 2771 2772 var offset = {}; 2773 2774 if (typeof this._config.offset === 'function') { 2775 offset.fn = function (data) { 2776 data.offsets = _objectSpread({}, data.offsets, _this2._config.offset(data.offsets, _this2._element) || {}); 2777 return data; 2778 }; 2779 } else { 2780 offset.offset = this._config.offset; 2781 } 2782 2783 return offset; 2784 }; 2785 2786 _proto._getPopperConfig = function _getPopperConfig() { 2787 var popperConfig = { 2788 placement: this._getPlacement(), 2789 modifiers: { 2790 offset: this._getOffset(), 2791 flip: { 2792 enabled: this._config.flip 2793 }, 2794 preventOverflow: { 2795 boundariesElement: this._config.boundary 2796 } 2797 } // Disable Popper.js if we have a static display 2798 2799 }; 2800 2801 if (this._config.display === 'static') { 2802 popperConfig.modifiers.applyStyle = { 2803 enabled: false 2804 }; 2805 } 2806 2807 return popperConfig; 2808 } // Static 2809 ; 2810 2811 Dropdown._jQueryInterface = function _jQueryInterface(config) { 2812 return this.each(function () { 2813 var data = $(this).data(DATA_KEY$4); 2814 2815 var _config = typeof config === 'object' ? config : null; 2816 2817 if (!data) { 2818 data = new Dropdown(this, _config); 2819 $(this).data(DATA_KEY$4, data); 2820 } 2821 2822 if (typeof config === 'string') { 2823 if (typeof data[config] === 'undefined') { 2824 throw new TypeError("No method named \"" + config + "\""); 2825 } 2826 2827 data[config](); 2828 } 2829 }); 2830 }; 2831 2832 Dropdown._clearMenus = function _clearMenus(event) { 2833 if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) { 2834 return; 2835 } 2836 2837 var toggles = [].slice.call(document.querySelectorAll(Selector$4.DATA_TOGGLE)); 2838 2839 for (var i = 0, len = toggles.length; i < len; i++) { 2840 var parent = Dropdown._getParentFromElement(toggles[i]); 2841 2842 var context = $(toggles[i]).data(DATA_KEY$4); 2843 var relatedTarget = { 2844 relatedTarget: toggles[i] 2845 }; 2846 2847 if (event && event.type === 'click') { 2848 relatedTarget.clickEvent = event; 2849 } 2850 2851 if (!context) { 2852 continue; 2853 } 2854 2855 var dropdownMenu = context._menu; 2856 2857 if (!$(parent).hasClass(ClassName$4.SHOW)) { 2858 continue; 2859 } 2860 2861 if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $.contains(parent, event.target)) { 2862 continue; 2863 } 2864 2865 var hideEvent = $.Event(Event$4.HIDE, relatedTarget); 2866 $(parent).trigger(hideEvent); 2867 2868 if (hideEvent.isDefaultPrevented()) { 2869 continue; 2870 } // If this is a touch-enabled device we remove the extra 2871 // empty mouseover listeners we added for iOS support 2872 2873 2874 if ('ontouchstart' in document.documentElement) { 2875 $(document.body).children().off('mouseover', null, $.noop); 2876 } 2877 2878 toggles[i].setAttribute('aria-expanded', 'false'); 2879 $(dropdownMenu).removeClass(ClassName$4.SHOW); 2880 $(parent).removeClass(ClassName$4.SHOW).trigger($.Event(Event$4.HIDDEN, relatedTarget)); 2881 } 2882 }; 2883 2884 Dropdown._getParentFromElement = function _getParentFromElement(element) { 2885 var parent; 2886 var selector = Util.getSelectorFromElement(element); 2887 2888 if (selector) { 2889 parent = document.querySelector(selector); 2890 } 2891 2892 return parent || element.parentNode; 2893 } // eslint-disable-next-line complexity 2894 ; 2895 2896 Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) { 2897 // If not input/textarea: 2898 // - And not a key in REGEXP_KEYDOWN => not a dropdown command 2899 // If input/textarea: 2900 // - If space key => not a dropdown command 2901 // - If key is other than escape 2902 // - If key is not up or down => not a dropdown command 2903 // - If trigger inside the menu => not a dropdown command 2904 if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $(event.target).closest(Selector$4.MENU).length) : !REGEXP_KEYDOWN.test(event.which)) { 2905 return; 2906 } 2907 2908 event.preventDefault(); 2909 event.stopPropagation(); 2910 2911 if (this.disabled || $(this).hasClass(ClassName$4.DISABLED)) { 2912 return; 2913 } 2914 2915 var parent = Dropdown._getParentFromElement(this); 2916 2917 var isActive = $(parent).hasClass(ClassName$4.SHOW); 2918 2919 if (!isActive || isActive && (event.which === ESCAPE_KEYCODE || event.which === SPACE_KEYCODE)) { 2920 if (event.which === ESCAPE_KEYCODE) { 2921 var toggle = parent.querySelector(Selector$4.DATA_TOGGLE); 2922 $(toggle).trigger('focus'); 2923 } 2924 2925 $(this).trigger('click'); 2926 return; 2927 } 2928 2929 var items = [].slice.call(parent.querySelectorAll(Selector$4.VISIBLE_ITEMS)); 2930 2931 if (items.length === 0) { 2932 return; 2933 } 2934 2935 var index = items.indexOf(event.target); 2936 2937 if (event.which === ARROW_UP_KEYCODE && index > 0) { 2938 // Up 2939 index--; 2940 } 2941 2942 if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { 2943 // Down 2944 index++; 2945 } 2946 2947 if (index < 0) { 2948 index = 0; 2949 } 2950 2951 items[index].focus(); 2952 }; 2953 2954 _createClass(Dropdown, null, [{ 2955 key: "VERSION", 2956 get: function get() { 2957 return VERSION$4; 2958 } 2959 }, { 2960 key: "Default", 2961 get: function get() { 2962 return Default$2; 2963 } 2964 }, { 2965 key: "DefaultType", 2966 get: function get() { 2967 return DefaultType$2; 2968 } 2969 }]); 2970 2971 return Dropdown; 2972 }(); 2973 /** 2974 * ------------------------------------------------------------------------ 2975 * Data Api implementation 2976 * ------------------------------------------------------------------------ 2977 */ 2978 2979 2980 $(document).on(Event$4.KEYDOWN_DATA_API, Selector$4.DATA_TOGGLE, Dropdown._dataApiKeydownHandler).on(Event$4.KEYDOWN_DATA_API, Selector$4.MENU, Dropdown._dataApiKeydownHandler).on(Event$4.CLICK_DATA_API + " " + Event$4.KEYUP_DATA_API, Dropdown._clearMenus).on(Event$4.CLICK_DATA_API, Selector$4.DATA_TOGGLE, function (event) { 2981 event.preventDefault(); 2982 event.stopPropagation(); 2983 2984 Dropdown._jQueryInterface.call($(this), 'toggle'); 2985 }).on(Event$4.CLICK_DATA_API, Selector$4.FORM_CHILD, function (e) { 2986 e.stopPropagation(); 2987 }); 2988 /** 2989 * ------------------------------------------------------------------------ 2990 * jQuery 2991 * ------------------------------------------------------------------------ 2992 */ 2993 2994 $.fn[NAME$4] = Dropdown._jQueryInterface; 2995 $.fn[NAME$4].Constructor = Dropdown; 2996 2997 $.fn[NAME$4].noConflict = function () { 2998 $.fn[NAME$4] = JQUERY_NO_CONFLICT$4; 2999 return Dropdown._jQueryInterface; 3000 }; 3001 3002 /** 3003 * ------------------------------------------------------------------------ 3004 * Constants 3005 * ------------------------------------------------------------------------ 3006 */ 3007 3008 var NAME$5 = 'modal'; 3009 var VERSION$5 = '4.3.1'; 3010 var DATA_KEY$5 = 'bs.modal'; 3011 var EVENT_KEY$5 = "." + DATA_KEY$5; 3012 var DATA_API_KEY$5 = '.data-api'; 3013 var JQUERY_NO_CONFLICT$5 = $.fn[NAME$5]; 3014 var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key 3015 3016 var Default$3 = { 3017 backdrop: true, 3018 keyboard: true, 3019 focus: true, 3020 show: true 3021 }; 3022 var DefaultType$3 = { 3023 backdrop: '(boolean|string)', 3024 keyboard: 'boolean', 3025 focus: 'boolean', 3026 show: 'boolean' 3027 }; 3028 var Event$5 = { 3029 HIDE: "hide" + EVENT_KEY$5, 3030 HIDDEN: "hidden" + EVENT_KEY$5, 3031 SHOW: "show" + EVENT_KEY$5, 3032 SHOWN: "shown" + EVENT_KEY$5, 3033 FOCUSIN: "focusin" + EVENT_KEY$5, 3034 RESIZE: "resize" + EVENT_KEY$5, 3035 CLICK_DISMISS: "click.dismiss" + EVENT_KEY$5, 3036 KEYDOWN_DISMISS: "keydown.dismiss" + EVENT_KEY$5, 3037 MOUSEUP_DISMISS: "mouseup.dismiss" + EVENT_KEY$5, 3038 MOUSEDOWN_DISMISS: "mousedown.dismiss" + EVENT_KEY$5, 3039 CLICK_DATA_API: "click" + EVENT_KEY$5 + DATA_API_KEY$5 3040 }; 3041 var ClassName$5 = { 3042 SCROLLABLE: 'modal-dialog-scrollable', 3043 SCROLLBAR_MEASURER: 'modal-scrollbar-measure', 3044 BACKDROP: 'modal-backdrop', 3045 OPEN: 'modal-open', 3046 FADE: 'fade', 3047 SHOW: 'show' 3048 }; 3049 var Selector$5 = { 3050 DIALOG: '.modal-dialog', 3051 MODAL_BODY: '.modal-body', 3052 DATA_TOGGLE: '[data-toggle="modal"]', 3053 DATA_DISMISS: '[data-dismiss="modal"]', 3054 FIXED_CONTENT: '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top', 3055 STICKY_CONTENT: '.sticky-top' 3056 /** 3057 * ------------------------------------------------------------------------ 3058 * Class Definition 3059 * ------------------------------------------------------------------------ 3060 */ 3061 3062 }; 3063 3064 var Modal = 3065 /*#__PURE__*/ 3066 function () { 3067 function Modal(element, config) { 3068 this._config = this._getConfig(config); 3069 this._element = element; 3070 this._dialog = element.querySelector(Selector$5.DIALOG); 3071 this._backdrop = null; 3072 this._isShown = false; 3073 this._isBodyOverflowing = false; 3074 this._ignoreBackdropClick = false; 3075 this._isTransitioning = false; 3076 this._scrollbarWidth = 0; 3077 } // Getters 3078 3079 3080 var _proto = Modal.prototype; 3081 3082 // Public 3083 _proto.toggle = function toggle(relatedTarget) { 3084 return this._isShown ? this.hide() : this.show(relatedTarget); 3085 }; 3086 3087 _proto.show = function show(relatedTarget) { 3088 var _this = this; 3089 3090 if (this._isShown || this._isTransitioning) { 3091 return; 3092 } 3093 3094 if ($(this._element).hasClass(ClassName$5.FADE)) { 3095 this._isTransitioning = true; 3096 } 3097 3098 var showEvent = $.Event(Event$5.SHOW, { 3099 relatedTarget: relatedTarget 3100 }); 3101 $(this._element).trigger(showEvent); 3102 3103 if (this._isShown || showEvent.isDefaultPrevented()) { 3104 return; 3105 } 3106 3107 this._isShown = true; 3108 3109 this._checkScrollbar(); 3110 3111 this._setScrollbar(); 3112 3113 this._adjustDialog(); 3114 3115 this._setEscapeEvent(); 3116 3117 this._setResizeEvent(); 3118 3119 $(this._element).on(Event$5.CLICK_DISMISS, Selector$5.DATA_DISMISS, function (event) { 3120 return _this.hide(event); 3121 }); 3122 $(this._dialog).on(Event$5.MOUSEDOWN_DISMISS, function () { 3123 $(_this._element).one(Event$5.MOUSEUP_DISMISS, function (event) { 3124 if ($(event.target).is(_this._element)) { 3125 _this._ignoreBackdropClick = true; 3126 } 3127 }); 3128 }); 3129 3130 this._showBackdrop(function () { 3131 return _this._showElement(relatedTarget); 3132 }); 3133 }; 3134 3135 _proto.hide = function hide(event) { 3136 var _this2 = this; 3137 3138 if (event) { 3139 event.preventDefault(); 3140 } 3141 3142 if (!this._isShown || this._isTransitioning) { 3143 return; 3144 } 3145 3146 var hideEvent = $.Event(Event$5.HIDE); 3147 $(this._element).trigger(hideEvent); 3148 3149 if (!this._isShown || hideEvent.isDefaultPrevented()) { 3150 return; 3151 } 3152 3153 this._isShown = false; 3154 var transition = $(this._element).hasClass(ClassName$5.FADE); 3155 3156 if (transition) { 3157 this._isTransitioning = true; 3158 } 3159 3160 this._setEscapeEvent(); 3161 3162 this._setResizeEvent(); 3163 3164 $(document).off(Event$5.FOCUSIN); 3165 $(this._element).removeClass(ClassName$5.SHOW); 3166 $(this._element).off(Event$5.CLICK_DISMISS); 3167 $(this._dialog).off(Event$5.MOUSEDOWN_DISMISS); 3168 3169 if (transition) { 3170 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 3171 $(this._element).one(Util.TRANSITION_END, function (event) { 3172 return _this2._hideModal(event); 3173 }).emulateTransitionEnd(transitionDuration); 3174 } else { 3175 this._hideModal(); 3176 } 3177 }; 3178 3179 _proto.dispose = function dispose() { 3180 [window, this._element, this._dialog].forEach(function (htmlElement) { 3181 return $(htmlElement).off(EVENT_KEY$5); 3182 }); 3183 /** 3184 * `document` has 2 events `Event.FOCUSIN` and `Event.CLICK_DATA_API` 3185 * Do not move `document` in `htmlElements` array 3186 * It will remove `Event.CLICK_DATA_API` event that should remain 3187 */ 3188 3189 $(document).off(Event$5.FOCUSIN); 3190 $.removeData(this._element, DATA_KEY$5); 3191 this._config = null; 3192 this._element = null; 3193 this._dialog = null; 3194 this._backdrop = null; 3195 this._isShown = null; 3196 this._isBodyOverflowing = null; 3197 this._ignoreBackdropClick = null; 3198 this._isTransitioning = null; 3199 this._scrollbarWidth = null; 3200 }; 3201 3202 _proto.handleUpdate = function handleUpdate() { 3203 this._adjustDialog(); 3204 } // Private 3205 ; 3206 3207 _proto._getConfig = function _getConfig(config) { 3208 config = _objectSpread({}, Default$3, config); 3209 Util.typeCheckConfig(NAME$5, config, DefaultType$3); 3210 return config; 3211 }; 3212 3213 _proto._showElement = function _showElement(relatedTarget) { 3214 var _this3 = this; 3215 3216 var transition = $(this._element).hasClass(ClassName$5.FADE); 3217 3218 if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { 3219 // Don't move modal's DOM position 3220 document.body.appendChild(this._element); 3221 } 3222 3223 this._element.style.display = 'block'; 3224 3225 this._element.removeAttribute('aria-hidden'); 3226 3227 this._element.setAttribute('aria-modal', true); 3228 3229 if ($(this._dialog).hasClass(ClassName$5.SCROLLABLE)) { 3230 this._dialog.querySelector(Selector$5.MODAL_BODY).scrollTop = 0; 3231 } else { 3232 this._element.scrollTop = 0; 3233 } 3234 3235 if (transition) { 3236 Util.reflow(this._element); 3237 } 3238 3239 $(this._element).addClass(ClassName$5.SHOW); 3240 3241 if (this._config.focus) { 3242 this._enforceFocus(); 3243 } 3244 3245 var shownEvent = $.Event(Event$5.SHOWN, { 3246 relatedTarget: relatedTarget 3247 }); 3248 3249 var transitionComplete = function transitionComplete() { 3250 if (_this3._config.focus) { 3251 _this3._element.focus(); 3252 } 3253 3254 _this3._isTransitioning = false; 3255 $(_this3._element).trigger(shownEvent); 3256 }; 3257 3258 if (transition) { 3259 var transitionDuration = Util.getTransitionDurationFromElement(this._dialog); 3260 $(this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration); 3261 } else { 3262 transitionComplete(); 3263 } 3264 }; 3265 3266 _proto._enforceFocus = function _enforceFocus() { 3267 var _this4 = this; 3268 3269 $(document).off(Event$5.FOCUSIN) // Guard against infinite focus loop 3270 .on(Event$5.FOCUSIN, function (event) { 3271 if (document !== event.target && _this4._element !== event.target && $(_this4._element).has(event.target).length === 0) { 3272 _this4._element.focus(); 3273 } 3274 }); 3275 }; 3276 3277 _proto._setEscapeEvent = function _setEscapeEvent() { 3278 var _this5 = this; 3279 3280 if (this._isShown && this._config.keyboard) { 3281 $(this._element).on(Event$5.KEYDOWN_DISMISS, function (event) { 3282 if (event.which === ESCAPE_KEYCODE$1) { 3283 event.preventDefault(); 3284 3285 _this5.hide(); 3286 } 3287 }); 3288 } else if (!this._isShown) { 3289 $(this._element).off(Event$5.KEYDOWN_DISMISS); 3290 } 3291 }; 3292 3293 _proto._setResizeEvent = function _setResizeEvent() { 3294 var _this6 = this; 3295 3296 if (this._isShown) { 3297 $(window).on(Event$5.RESIZE, function (event) { 3298 return _this6.handleUpdate(event); 3299 }); 3300 } else { 3301 $(window).off(Event$5.RESIZE); 3302 } 3303 }; 3304 3305 _proto._hideModal = function _hideModal() { 3306 var _this7 = this; 3307 3308 this._element.style.display = 'none'; 3309 3310 this._element.setAttribute('aria-hidden', true); 3311 3312 this._element.removeAttribute('aria-modal'); 3313 3314 this._isTransitioning = false; 3315 3316 this._showBackdrop(function () { 3317 $(document.body).removeClass(ClassName$5.OPEN); 3318 3319 _this7._resetAdjustments(); 3320 3321 _this7._resetScrollbar(); 3322 3323 $(_this7._element).trigger(Event$5.HIDDEN); 3324 }); 3325 }; 3326 3327 _proto._removeBackdrop = function _removeBackdrop() { 3328 if (this._backdrop) { 3329 $(this._backdrop).remove(); 3330 this._backdrop = null; 3331 } 3332 }; 3333 3334 _proto._showBackdrop = function _showBackdrop(callback) { 3335 var _this8 = this; 3336 3337 var animate = $(this._element).hasClass(ClassName$5.FADE) ? ClassName$5.FADE : ''; 3338 3339 if (this._isShown && this._config.backdrop) { 3340 this._backdrop = document.createElement('div'); 3341 this._backdrop.className = ClassName$5.BACKDROP; 3342 3343 if (animate) { 3344 this._backdrop.classList.add(animate); 3345 } 3346 3347 $(this._backdrop).appendTo(document.body); 3348 $(this._element).on(Event$5.CLICK_DISMISS, function (event) { 3349 if (_this8._ignoreBackdropClick) { 3350 _this8._ignoreBackdropClick = false; 3351 return; 3352 } 3353 3354 if (event.target !== event.currentTarget) { 3355 return; 3356 } 3357 3358 if (_this8._config.backdrop === 'static') { 3359 _this8._element.focus(); 3360 } else { 3361 _this8.hide(); 3362 } 3363 }); 3364 3365 if (animate) { 3366 Util.reflow(this._backdrop); 3367 } 3368 3369 $(this._backdrop).addClass(ClassName$5.SHOW); 3370 3371 if (!callback) { 3372 return; 3373 } 3374 3375 if (!animate) { 3376 callback(); 3377 return; 3378 } 3379 3380 var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 3381 $(this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration); 3382 } else if (!this._isShown && this._backdrop) { 3383 $(this._backdrop).removeClass(ClassName$5.SHOW); 3384 3385 var callbackRemove = function callbackRemove() { 3386 _this8._removeBackdrop(); 3387 3388 if (callback) { 3389 callback(); 3390 } 3391 }; 3392 3393 if ($(this._element).hasClass(ClassName$5.FADE)) { 3394 var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 3395 3396 $(this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration); 3397 } else { 3398 callbackRemove(); 3399 } 3400 } else if (callback) { 3401 callback(); 3402 } 3403 } // ---------------------------------------------------------------------- 3404 // the following methods are used to handle overflowing modals 3405 // todo (fat): these should probably be refactored out of modal.js 3406 // ---------------------------------------------------------------------- 3407 ; 3408 3409 _proto._adjustDialog = function _adjustDialog() { 3410 var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 3411 3412 if (!this._isBodyOverflowing && isModalOverflowing) { 3413 this._element.style.paddingLeft = this._scrollbarWidth + "px"; 3414 } 3415 3416 if (this._isBodyOverflowing && !isModalOverflowing) { 3417 this._element.style.paddingRight = this._scrollbarWidth + "px"; 3418 } 3419 }; 3420 3421 _proto._resetAdjustments = function _resetAdjustments() { 3422 this._element.style.paddingLeft = ''; 3423 this._element.style.paddingRight = ''; 3424 }; 3425 3426 _proto._checkScrollbar = function _checkScrollbar() { 3427 var rect = document.body.getBoundingClientRect(); 3428 this._isBodyOverflowing = rect.left + rect.right < window.innerWidth; 3429 this._scrollbarWidth = this._getScrollbarWidth(); 3430 }; 3431 3432 _proto._setScrollbar = function _setScrollbar() { 3433 var _this9 = this; 3434 3435 if (this._isBodyOverflowing) { 3436 // Note: DOMNode.style.paddingRight returns the actual value or '' if not set 3437 // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set 3438 var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT)); 3439 var stickyContent = [].slice.call(document.querySelectorAll(Selector$5.STICKY_CONTENT)); // Adjust fixed content padding 3440 3441 $(fixedContent).each(function (index, element) { 3442 var actualPadding = element.style.paddingRight; 3443 var calculatedPadding = $(element).css('padding-right'); 3444 $(element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this9._scrollbarWidth + "px"); 3445 }); // Adjust sticky content margin 3446 3447 $(stickyContent).each(function (index, element) { 3448 var actualMargin = element.style.marginRight; 3449 var calculatedMargin = $(element).css('margin-right'); 3450 $(element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this9._scrollbarWidth + "px"); 3451 }); // Adjust body padding 3452 3453 var actualPadding = document.body.style.paddingRight; 3454 var calculatedPadding = $(document.body).css('padding-right'); 3455 $(document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px"); 3456 } 3457 3458 $(document.body).addClass(ClassName$5.OPEN); 3459 }; 3460 3461 _proto._resetScrollbar = function _resetScrollbar() { 3462 // Restore fixed content padding 3463 var fixedContent = [].slice.call(document.querySelectorAll(Selector$5.FIXED_CONTENT)); 3464 $(fixedContent).each(function (index, element) { 3465 var padding = $(element).data('padding-right'); 3466 $(element).removeData('padding-right'); 3467 element.style.paddingRight = padding ? padding : ''; 3468 }); // Restore sticky content 3469 3470 var elements = [].slice.call(document.querySelectorAll("" + Selector$5.STICKY_CONTENT)); 3471 $(elements).each(function (index, element) { 3472 var margin = $(element).data('margin-right'); 3473 3474 if (typeof margin !== 'undefined') { 3475 $(element).css('margin-right', margin).removeData('margin-right'); 3476 } 3477 }); // Restore body padding 3478 3479 var padding = $(document.body).data('padding-right'); 3480 $(document.body).removeData('padding-right'); 3481 document.body.style.paddingRight = padding ? padding : ''; 3482 }; 3483 3484 _proto._getScrollbarWidth = function _getScrollbarWidth() { 3485 // thx d.walsh 3486 var scrollDiv = document.createElement('div'); 3487 scrollDiv.className = ClassName$5.SCROLLBAR_MEASURER; 3488 document.body.appendChild(scrollDiv); 3489 var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; 3490 document.body.removeChild(scrollDiv); 3491 return scrollbarWidth; 3492 } // Static 3493 ; 3494 3495 Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) { 3496 return this.each(function () { 3497 var data = $(this).data(DATA_KEY$5); 3498 3499 var _config = _objectSpread({}, Default$3, $(this).data(), typeof config === 'object' && config ? config : {}); 3500 3501 if (!data) { 3502 data = new Modal(this, _config); 3503 $(this).data(DATA_KEY$5, data); 3504 } 3505 3506 if (typeof config === 'string') { 3507 if (typeof data[config] === 'undefined') { 3508 throw new TypeError("No method named \"" + config + "\""); 3509 } 3510 3511 data[config](relatedTarget); 3512 } else if (_config.show) { 3513 data.show(relatedTarget); 3514 } 3515 }); 3516 }; 3517 3518 _createClass(Modal, null, [{ 3519 key: "VERSION", 3520 get: function get() { 3521 return VERSION$5; 3522 } 3523 }, { 3524 key: "Default", 3525 get: function get() { 3526 return Default$3; 3527 } 3528 }]); 3529 3530 return Modal; 3531 }(); 3532 /** 3533 * ------------------------------------------------------------------------ 3534 * Data Api implementation 3535 * ------------------------------------------------------------------------ 3536 */ 3537 3538 3539 $(document).on(Event$5.CLICK_DATA_API, Selector$5.DATA_TOGGLE, function (event) { 3540 var _this10 = this; 3541 3542 var target; 3543 var selector = Util.getSelectorFromElement(this); 3544 3545 if (selector) { 3546 target = document.querySelector(selector); 3547 } 3548 3549 var config = $(target).data(DATA_KEY$5) ? 'toggle' : _objectSpread({}, $(target).data(), $(this).data()); 3550 3551 if (this.tagName === 'A' || this.tagName === 'AREA') { 3552 event.preventDefault(); 3553 } 3554 3555 var $target = $(target).one(Event$5.SHOW, function (showEvent) { 3556 if (showEvent.isDefaultPrevented()) { 3557 // Only register focus restorer if modal will actually get shown 3558 return; 3559 } 3560 3561 $target.one(Event$5.HIDDEN, function () { 3562 if ($(_this10).is(':visible')) { 3563 _this10.focus(); 3564 } 3565 }); 3566 }); 3567 3568 Modal._jQueryInterface.call($(target), config, this); 3569 }); 3570 /** 3571 * ------------------------------------------------------------------------ 3572 * jQuery 3573 * ------------------------------------------------------------------------ 3574 */ 3575 3576 $.fn[NAME$5] = Modal._jQueryInterface; 3577 $.fn[NAME$5].Constructor = Modal; 3578 3579 $.fn[NAME$5].noConflict = function () { 3580 $.fn[NAME$5] = JQUERY_NO_CONFLICT$5; 3581 return Modal._jQueryInterface; 3582 }; 3583 3584 /** 3585 * -------------------------------------------------------------------------- 3586 * Bootstrap (v4.3.1): tools/sanitizer.js 3587 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 3588 * -------------------------------------------------------------------------- 3589 */ 3590 var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']; 3591 var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; 3592 var DefaultWhitelist = { 3593 // Global attributes allowed on any supplied element below. 3594 '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], 3595 a: ['target', 'href', 'title', 'rel'], 3596 area: [], 3597 b: [], 3598 br: [], 3599 col: [], 3600 code: [], 3601 div: [], 3602 em: [], 3603 hr: [], 3604 h1: [], 3605 h2: [], 3606 h3: [], 3607 h4: [], 3608 h5: [], 3609 h6: [], 3610 i: [], 3611 img: ['src', 'alt', 'title', 'width', 'height'], 3612 li: [], 3613 ol: [], 3614 p: [], 3615 pre: [], 3616 s: [], 3617 small: [], 3618 span: [], 3619 sub: [], 3620 sup: [], 3621 strong: [], 3622 u: [], 3623 ul: [] 3624 /** 3625 * A pattern that recognizes a commonly useful subset of URLs that are safe. 3626 * 3627 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 3628 */ 3629 3630 }; 3631 var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi; 3632 /** 3633 * A pattern that matches safe data URLs. Only matches image, video and audio types. 3634 * 3635 * Shoutout to Angular 7 https://github.com/angular/angular/blob/7.2.4/packages/core/src/sanitization/url_sanitizer.ts 3636 */ 3637 3638 var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i; 3639 3640 function allowedAttribute(attr, allowedAttributeList) { 3641 var attrName = attr.nodeName.toLowerCase(); 3642 3643 if (allowedAttributeList.indexOf(attrName) !== -1) { 3644 if (uriAttrs.indexOf(attrName) !== -1) { 3645 return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN)); 3646 } 3647 3648 return true; 3649 } 3650 3651 var regExp = allowedAttributeList.filter(function (attrRegex) { 3652 return attrRegex instanceof RegExp; 3653 }); // Check if a regular expression validates the attribute. 3654 3655 for (var i = 0, l = regExp.length; i < l; i++) { 3656 if (attrName.match(regExp[i])) { 3657 return true; 3658 } 3659 } 3660 3661 return false; 3662 } 3663 3664 function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) { 3665 if (unsafeHtml.length === 0) { 3666 return unsafeHtml; 3667 } 3668 3669 if (sanitizeFn && typeof sanitizeFn === 'function') { 3670 return sanitizeFn(unsafeHtml); 3671 } 3672 3673 var domParser = new window.DOMParser(); 3674 var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); 3675 var whitelistKeys = Object.keys(whiteList); 3676 var elements = [].slice.call(createdDocument.body.querySelectorAll('*')); 3677 3678 var _loop = function _loop(i, len) { 3679 var el = elements[i]; 3680 var elName = el.nodeName.toLowerCase(); 3681 3682 if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) { 3683 el.parentNode.removeChild(el); 3684 return "continue"; 3685 } 3686 3687 var attributeList = [].slice.call(el.attributes); 3688 var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []); 3689 attributeList.forEach(function (attr) { 3690 if (!allowedAttribute(attr, whitelistedAttributes)) { 3691 el.removeAttribute(attr.nodeName); 3692 } 3693 }); 3694 }; 3695 3696 for (var i = 0, len = elements.length; i < len; i++) { 3697 var _ret = _loop(i, len); 3698 3699 if (_ret === "continue") continue; 3700 } 3701 3702 return createdDocument.body.innerHTML; 3703 } 3704 3705 /** 3706 * ------------------------------------------------------------------------ 3707 * Constants 3708 * ------------------------------------------------------------------------ 3709 */ 3710 3711 var NAME$6 = 'tooltip'; 3712 var VERSION$6 = '4.3.1'; 3713 var DATA_KEY$6 = 'bs.tooltip'; 3714 var EVENT_KEY$6 = "." + DATA_KEY$6; 3715 var JQUERY_NO_CONFLICT$6 = $.fn[NAME$6]; 3716 var CLASS_PREFIX = 'bs-tooltip'; 3717 var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g'); 3718 var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']; 3719 var DefaultType$4 = { 3720 animation: 'boolean', 3721 template: 'string', 3722 title: '(string|element|function)', 3723 trigger: 'string', 3724 delay: '(number|object)', 3725 html: 'boolean', 3726 selector: '(string|boolean)', 3727 placement: '(string|function)', 3728 offset: '(number|string|function)', 3729 container: '(string|element|boolean)', 3730 fallbackPlacement: '(string|array)', 3731 boundary: '(string|element)', 3732 sanitize: 'boolean', 3733 sanitizeFn: '(null|function)', 3734 whiteList: 'object' 3735 }; 3736 var AttachmentMap$1 = { 3737 AUTO: 'auto', 3738 TOP: 'top', 3739 RIGHT: 'right', 3740 BOTTOM: 'bottom', 3741 LEFT: 'left' 3742 }; 3743 var Default$4 = { 3744 animation: true, 3745 template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>', 3746 trigger: 'hover focus', 3747 title: '', 3748 delay: 0, 3749 html: false, 3750 selector: false, 3751 placement: 'top', 3752 offset: 0, 3753 container: false, 3754 fallbackPlacement: 'flip', 3755 boundary: 'scrollParent', 3756 sanitize: true, 3757 sanitizeFn: null, 3758 whiteList: DefaultWhitelist 3759 }; 3760 var HoverState = { 3761 SHOW: 'show', 3762 OUT: 'out' 3763 }; 3764 var Event$6 = { 3765 HIDE: "hide" + EVENT_KEY$6, 3766 HIDDEN: "hidden" + EVENT_KEY$6, 3767 SHOW: "show" + EVENT_KEY$6, 3768 SHOWN: "shown" + EVENT_KEY$6, 3769 INSERTED: "inserted" + EVENT_KEY$6, 3770 CLICK: "click" + EVENT_KEY$6, 3771 FOCUSIN: "focusin" + EVENT_KEY$6, 3772 FOCUSOUT: "focusout" + EVENT_KEY$6, 3773 MOUSEENTER: "mouseenter" + EVENT_KEY$6, 3774 MOUSELEAVE: "mouseleave" + EVENT_KEY$6 3775 }; 3776 var ClassName$6 = { 3777 FADE: 'fade', 3778 SHOW: 'show' 3779 }; 3780 var Selector$6 = { 3781 TOOLTIP: '.tooltip', 3782 TOOLTIP_INNER: '.tooltip-inner', 3783 ARROW: '.arrow' 3784 }; 3785 var Trigger = { 3786 HOVER: 'hover', 3787 FOCUS: 'focus', 3788 CLICK: 'click', 3789 MANUAL: 'manual' 3790 /** 3791 * ------------------------------------------------------------------------ 3792 * Class Definition 3793 * ------------------------------------------------------------------------ 3794 */ 3795 3796 }; 3797 3798 var Tooltip = 3799 /*#__PURE__*/ 3800 function () { 3801 function Tooltip(element, config) { 3802 /** 3803 * Check for Popper dependency 3804 * Popper - https://popper.js.org 3805 */ 3806 if (typeof Popper === 'undefined') { 3807 throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org/)'); 3808 } // private 3809 3810 3811 this._isEnabled = true; 3812 this._timeout = 0; 3813 this._hoverState = ''; 3814 this._activeTrigger = {}; 3815 this._popper = null; // Protected 3816 3817 this.element = element; 3818 this.config = this._getConfig(config); 3819 this.tip = null; 3820 3821 this._setListeners(); 3822 } // Getters 3823 3824 3825 var _proto = Tooltip.prototype; 3826 3827 // Public 3828 _proto.enable = function enable() { 3829 this._isEnabled = true; 3830 }; 3831 3832 _proto.disable = function disable() { 3833 this._isEnabled = false; 3834 }; 3835 3836 _proto.toggleEnabled = function toggleEnabled() { 3837 this._isEnabled = !this._isEnabled; 3838 }; 3839 3840 _proto.toggle = function toggle(event) { 3841 if (!this._isEnabled) { 3842 return; 3843 } 3844 3845 if (event) { 3846 var dataKey = this.constructor.DATA_KEY; 3847 var context = $(event.currentTarget).data(dataKey); 3848 3849 if (!context) { 3850 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 3851 $(event.currentTarget).data(dataKey, context); 3852 } 3853 3854 context._activeTrigger.click = !context._activeTrigger.click; 3855 3856 if (context._isWithActiveTrigger()) { 3857 context._enter(null, context); 3858 } else { 3859 context._leave(null, context); 3860 } 3861 } else { 3862 if ($(this.getTipElement()).hasClass(ClassName$6.SHOW)) { 3863 this._leave(null, this); 3864 3865 return; 3866 } 3867 3868 this._enter(null, this); 3869 } 3870 }; 3871 3872 _proto.dispose = function dispose() { 3873 clearTimeout(this._timeout); 3874 $.removeData(this.element, this.constructor.DATA_KEY); 3875 $(this.element).off(this.constructor.EVENT_KEY); 3876 $(this.element).closest('.modal').off('hide.bs.modal'); 3877 3878 if (this.tip) { 3879 $(this.tip).remove(); 3880 } 3881 3882 this._isEnabled = null; 3883 this._timeout = null; 3884 this._hoverState = null; 3885 this._activeTrigger = null; 3886 3887 if (this._popper !== null) { 3888 this._popper.destroy(); 3889 } 3890 3891 this._popper = null; 3892 this.element = null; 3893 this.config = null; 3894 this.tip = null; 3895 }; 3896 3897 _proto.show = function show() { 3898 var _this = this; 3899 3900 if ($(this.element).css('display') === 'none') { 3901 throw new Error('Please use show on visible elements'); 3902 } 3903 3904 var showEvent = $.Event(this.constructor.Event.SHOW); 3905 3906 if (this.isWithContent() && this._isEnabled) { 3907 $(this.element).trigger(showEvent); 3908 var shadowRoot = Util.findShadowRoot(this.element); 3909 var isInTheDom = $.contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element); 3910 3911 if (showEvent.isDefaultPrevented() || !isInTheDom) { 3912 return; 3913 } 3914 3915 var tip = this.getTipElement(); 3916 var tipId = Util.getUID(this.constructor.NAME); 3917 tip.setAttribute('id', tipId); 3918 this.element.setAttribute('aria-describedby', tipId); 3919 this.setContent(); 3920 3921 if (this.config.animation) { 3922 $(tip).addClass(ClassName$6.FADE); 3923 } 3924 3925 var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; 3926 3927 var attachment = this._getAttachment(placement); 3928 3929 this.addAttachmentClass(attachment); 3930 3931 var container = this._getContainer(); 3932 3933 $(tip).data(this.constructor.DATA_KEY, this); 3934 3935 if (!$.contains(this.element.ownerDocument.documentElement, this.tip)) { 3936 $(tip).appendTo(container); 3937 } 3938 3939 $(this.element).trigger(this.constructor.Event.INSERTED); 3940 this._popper = new Popper(this.element, tip, { 3941 placement: attachment, 3942 modifiers: { 3943 offset: this._getOffset(), 3944 flip: { 3945 behavior: this.config.fallbackPlacement 3946 }, 3947 arrow: { 3948 element: Selector$6.ARROW 3949 }, 3950 preventOverflow: { 3951 boundariesElement: this.config.boundary 3952 } 3953 }, 3954 onCreate: function onCreate(data) { 3955 if (data.originalPlacement !== data.placement) { 3956 _this._handlePopperPlacementChange(data); 3957 } 3958 }, 3959 onUpdate: function onUpdate(data) { 3960 return _this._handlePopperPlacementChange(data); 3961 } 3962 }); 3963 $(tip).addClass(ClassName$6.SHOW); // If this is a touch-enabled device we add extra 3964 // empty mouseover listeners to the body's immediate children; 3965 // only needed because of broken event delegation on iOS 3966 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 3967 3968 if ('ontouchstart' in document.documentElement) { 3969 $(document.body).children().on('mouseover', null, $.noop); 3970 } 3971 3972 var complete = function complete() { 3973 if (_this.config.animation) { 3974 _this._fixTransition(); 3975 } 3976 3977 var prevHoverState = _this._hoverState; 3978 _this._hoverState = null; 3979 $(_this.element).trigger(_this.constructor.Event.SHOWN); 3980 3981 if (prevHoverState === HoverState.OUT) { 3982 _this._leave(null, _this); 3983 } 3984 }; 3985 3986 if ($(this.tip).hasClass(ClassName$6.FADE)) { 3987 var transitionDuration = Util.getTransitionDurationFromElement(this.tip); 3988 $(this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 3989 } else { 3990 complete(); 3991 } 3992 } 3993 }; 3994 3995 _proto.hide = function hide(callback) { 3996 var _this2 = this; 3997 3998 var tip = this.getTipElement(); 3999 var hideEvent = $.Event(this.constructor.Event.HIDE); 4000 4001 var complete = function complete() { 4002 if (_this2._hoverState !== HoverState.SHOW && tip.parentNode) { 4003 tip.parentNode.removeChild(tip); 4004 } 4005 4006 _this2._cleanTipClass(); 4007 4008 _this2.element.removeAttribute('aria-describedby'); 4009 4010 $(_this2.element).trigger(_this2.constructor.Event.HIDDEN); 4011 4012 if (_this2._popper !== null) { 4013 _this2._popper.destroy(); 4014 } 4015 4016 if (callback) { 4017 callback(); 4018 } 4019 }; 4020 4021 $(this.element).trigger(hideEvent); 4022 4023 if (hideEvent.isDefaultPrevented()) { 4024 return; 4025 } 4026 4027 $(tip).removeClass(ClassName$6.SHOW); // If this is a touch-enabled device we remove the extra 4028 // empty mouseover listeners we added for iOS support 4029 4030 if ('ontouchstart' in document.documentElement) { 4031 $(document.body).children().off('mouseover', null, $.noop); 4032 } 4033 4034 this._activeTrigger[Trigger.CLICK] = false; 4035 this._activeTrigger[Trigger.FOCUS] = false; 4036 this._activeTrigger[Trigger.HOVER] = false; 4037 4038 if ($(this.tip).hasClass(ClassName$6.FADE)) { 4039 var transitionDuration = Util.getTransitionDurationFromElement(tip); 4040 $(tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 4041 } else { 4042 complete(); 4043 } 4044 4045 this._hoverState = ''; 4046 }; 4047 4048 _proto.update = function update() { 4049 if (this._popper !== null) { 4050 this._popper.scheduleUpdate(); 4051 } 4052 } // Protected 4053 ; 4054 4055 _proto.isWithContent = function isWithContent() { 4056 return Boolean(this.getTitle()); 4057 }; 4058 4059 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 4060 $(this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment); 4061 }; 4062 4063 _proto.getTipElement = function getTipElement() { 4064 this.tip = this.tip || $(this.config.template)[0]; 4065 return this.tip; 4066 }; 4067 4068 _proto.setContent = function setContent() { 4069 var tip = this.getTipElement(); 4070 this.setElementContent($(tip.querySelectorAll(Selector$6.TOOLTIP_INNER)), this.getTitle()); 4071 $(tip).removeClass(ClassName$6.FADE + " " + ClassName$6.SHOW); 4072 }; 4073 4074 _proto.setElementContent = function setElementContent($element, content) { 4075 if (typeof content === 'object' && (content.nodeType || content.jquery)) { 4076 // Content is a DOM node or a jQuery 4077 if (this.config.html) { 4078 if (!$(content).parent().is($element)) { 4079 $element.empty().append(content); 4080 } 4081 } else { 4082 $element.text($(content).text()); 4083 } 4084 4085 return; 4086 } 4087 4088 if (this.config.html) { 4089 if (this.config.sanitize) { 4090 content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn); 4091 } 4092 4093 $element.html(content); 4094 } else { 4095 $element.text(content); 4096 } 4097 }; 4098 4099 _proto.getTitle = function getTitle() { 4100 var title = this.element.getAttribute('data-original-title'); 4101 4102 if (!title) { 4103 title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title; 4104 } 4105 4106 return title; 4107 } // Private 4108 ; 4109 4110 _proto._getOffset = function _getOffset() { 4111 var _this3 = this; 4112 4113 var offset = {}; 4114 4115 if (typeof this.config.offset === 'function') { 4116 offset.fn = function (data) { 4117 data.offsets = _objectSpread({}, data.offsets, _this3.config.offset(data.offsets, _this3.element) || {}); 4118 return data; 4119 }; 4120 } else { 4121 offset.offset = this.config.offset; 4122 } 4123 4124 return offset; 4125 }; 4126 4127 _proto._getContainer = function _getContainer() { 4128 if (this.config.container === false) { 4129 return document.body; 4130 } 4131 4132 if (Util.isElement(this.config.container)) { 4133 return $(this.config.container); 4134 } 4135 4136 return $(document).find(this.config.container); 4137 }; 4138 4139 _proto._getAttachment = function _getAttachment(placement) { 4140 return AttachmentMap$1[placement.toUpperCase()]; 4141 }; 4142 4143 _proto._setListeners = function _setListeners() { 4144 var _this4 = this; 4145 4146 var triggers = this.config.trigger.split(' '); 4147 triggers.forEach(function (trigger) { 4148 if (trigger === 'click') { 4149 $(_this4.element).on(_this4.constructor.Event.CLICK, _this4.config.selector, function (event) { 4150 return _this4.toggle(event); 4151 }); 4152 } else if (trigger !== Trigger.MANUAL) { 4153 var eventIn = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSEENTER : _this4.constructor.Event.FOCUSIN; 4154 var eventOut = trigger === Trigger.HOVER ? _this4.constructor.Event.MOUSELEAVE : _this4.constructor.Event.FOCUSOUT; 4155 $(_this4.element).on(eventIn, _this4.config.selector, function (event) { 4156 return _this4._enter(event); 4157 }).on(eventOut, _this4.config.selector, function (event) { 4158 return _this4._leave(event); 4159 }); 4160 } 4161 }); 4162 $(this.element).closest('.modal').on('hide.bs.modal', function () { 4163 if (_this4.element) { 4164 _this4.hide(); 4165 } 4166 }); 4167 4168 if (this.config.selector) { 4169 this.config = _objectSpread({}, this.config, { 4170 trigger: 'manual', 4171 selector: '' 4172 }); 4173 } else { 4174 this._fixTitle(); 4175 } 4176 }; 4177 4178 _proto._fixTitle = function _fixTitle() { 4179 var titleType = typeof this.element.getAttribute('data-original-title'); 4180 4181 if (this.element.getAttribute('title') || titleType !== 'string') { 4182 this.element.setAttribute('data-original-title', this.element.getAttribute('title') || ''); 4183 this.element.setAttribute('title', ''); 4184 } 4185 }; 4186 4187 _proto._enter = function _enter(event, context) { 4188 var dataKey = this.constructor.DATA_KEY; 4189 context = context || $(event.currentTarget).data(dataKey); 4190 4191 if (!context) { 4192 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 4193 $(event.currentTarget).data(dataKey, context); 4194 } 4195 4196 if (event) { 4197 context._activeTrigger[event.type === 'focusin' ? Trigger.FOCUS : Trigger.HOVER] = true; 4198 } 4199 4200 if ($(context.getTipElement()).hasClass(ClassName$6.SHOW) || context._hoverState === HoverState.SHOW) { 4201 context._hoverState = HoverState.SHOW; 4202 return; 4203 } 4204 4205 clearTimeout(context._timeout); 4206 context._hoverState = HoverState.SHOW; 4207 4208 if (!context.config.delay || !context.config.delay.show) { 4209 context.show(); 4210 return; 4211 } 4212 4213 context._timeout = setTimeout(function () { 4214 if (context._hoverState === HoverState.SHOW) { 4215 context.show(); 4216 } 4217 }, context.config.delay.show); 4218 }; 4219 4220 _proto._leave = function _leave(event, context) { 4221 var dataKey = this.constructor.DATA_KEY; 4222 context = context || $(event.currentTarget).data(dataKey); 4223 4224 if (!context) { 4225 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 4226 $(event.currentTarget).data(dataKey, context); 4227 } 4228 4229 if (event) { 4230 context._activeTrigger[event.type === 'focusout' ? Trigger.FOCUS : Trigger.HOVER] = false; 4231 } 4232 4233 if (context._isWithActiveTrigger()) { 4234 return; 4235 } 4236 4237 clearTimeout(context._timeout); 4238 context._hoverState = HoverState.OUT; 4239 4240 if (!context.config.delay || !context.config.delay.hide) { 4241 context.hide(); 4242 return; 4243 } 4244 4245 context._timeout = setTimeout(function () { 4246 if (context._hoverState === HoverState.OUT) { 4247 context.hide(); 4248 } 4249 }, context.config.delay.hide); 4250 }; 4251 4252 _proto._isWithActiveTrigger = function _isWithActiveTrigger() { 4253 for (var trigger in this._activeTrigger) { 4254 if (this._activeTrigger[trigger]) { 4255 return true; 4256 } 4257 } 4258 4259 return false; 4260 }; 4261 4262 _proto._getConfig = function _getConfig(config) { 4263 var dataAttributes = $(this.element).data(); 4264 Object.keys(dataAttributes).forEach(function (dataAttr) { 4265 if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) { 4266 delete dataAttributes[dataAttr]; 4267 } 4268 }); 4269 config = _objectSpread({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {}); 4270 4271 if (typeof config.delay === 'number') { 4272 config.delay = { 4273 show: config.delay, 4274 hide: config.delay 4275 }; 4276 } 4277 4278 if (typeof config.title === 'number') { 4279 config.title = config.title.toString(); 4280 } 4281 4282 if (typeof config.content === 'number') { 4283 config.content = config.content.toString(); 4284 } 4285 4286 Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType); 4287 4288 if (config.sanitize) { 4289 config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn); 4290 } 4291 4292 return config; 4293 }; 4294 4295 _proto._getDelegateConfig = function _getDelegateConfig() { 4296 var config = {}; 4297 4298 if (this.config) { 4299 for (var key in this.config) { 4300 if (this.constructor.Default[key] !== this.config[key]) { 4301 config[key] = this.config[key]; 4302 } 4303 } 4304 } 4305 4306 return config; 4307 }; 4308 4309 _proto._cleanTipClass = function _cleanTipClass() { 4310 var $tip = $(this.getTipElement()); 4311 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX); 4312 4313 if (tabClass !== null && tabClass.length) { 4314 $tip.removeClass(tabClass.join('')); 4315 } 4316 }; 4317 4318 _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) { 4319 var popperInstance = popperData.instance; 4320 this.tip = popperInstance.popper; 4321 4322 this._cleanTipClass(); 4323 4324 this.addAttachmentClass(this._getAttachment(popperData.placement)); 4325 }; 4326 4327 _proto._fixTransition = function _fixTransition() { 4328 var tip = this.getTipElement(); 4329 var initConfigAnimation = this.config.animation; 4330 4331 if (tip.getAttribute('x-placement') !== null) { 4332 return; 4333 } 4334 4335 $(tip).removeClass(ClassName$6.FADE); 4336 this.config.animation = false; 4337 this.hide(); 4338 this.show(); 4339 this.config.animation = initConfigAnimation; 4340 } // Static 4341 ; 4342 4343 Tooltip._jQueryInterface = function _jQueryInterface(config) { 4344 return this.each(function () { 4345 var data = $(this).data(DATA_KEY$6); 4346 4347 var _config = typeof config === 'object' && config; 4348 4349 if (!data && /dispose|hide/.test(config)) { 4350 return; 4351 } 4352 4353 if (!data) { 4354 data = new Tooltip(this, _config); 4355 $(this).data(DATA_KEY$6, data); 4356 } 4357 4358 if (typeof config === 'string') { 4359 if (typeof data[config] === 'undefined') { 4360 throw new TypeError("No method named \"" + config + "\""); 4361 } 4362 4363 data[config](); 4364 } 4365 }); 4366 }; 4367 4368 _createClass(Tooltip, null, [{ 4369 key: "VERSION", 4370 get: function get() { 4371 return VERSION$6; 4372 } 4373 }, { 4374 key: "Default", 4375 get: function get() { 4376 return Default$4; 4377 } 4378 }, { 4379 key: "NAME", 4380 get: function get() { 4381 return NAME$6; 4382 } 4383 }, { 4384 key: "DATA_KEY", 4385 get: function get() { 4386 return DATA_KEY$6; 4387 } 4388 }, { 4389 key: "Event", 4390 get: function get() { 4391 return Event$6; 4392 } 4393 }, { 4394 key: "EVENT_KEY", 4395 get: function get() { 4396 return EVENT_KEY$6; 4397 } 4398 }, { 4399 key: "DefaultType", 4400 get: function get() { 4401 return DefaultType$4; 4402 } 4403 }]); 4404 4405 return Tooltip; 4406 }(); 4407 /** 4408 * ------------------------------------------------------------------------ 4409 * jQuery 4410 * ------------------------------------------------------------------------ 4411 */ 4412 4413 4414 $.fn[NAME$6] = Tooltip._jQueryInterface; 4415 $.fn[NAME$6].Constructor = Tooltip; 4416 4417 $.fn[NAME$6].noConflict = function () { 4418 $.fn[NAME$6] = JQUERY_NO_CONFLICT$6; 4419 return Tooltip._jQueryInterface; 4420 }; 4421 4422 /** 4423 * ------------------------------------------------------------------------ 4424 * Constants 4425 * ------------------------------------------------------------------------ 4426 */ 4427 4428 var NAME$7 = 'popover'; 4429 var VERSION$7 = '4.3.1'; 4430 var DATA_KEY$7 = 'bs.popover'; 4431 var EVENT_KEY$7 = "." + DATA_KEY$7; 4432 var JQUERY_NO_CONFLICT$7 = $.fn[NAME$7]; 4433 var CLASS_PREFIX$1 = 'bs-popover'; 4434 var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g'); 4435 4436 var Default$5 = _objectSpread({}, Tooltip.Default, { 4437 placement: 'right', 4438 trigger: 'click', 4439 content: '', 4440 template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>' 4441 }); 4442 4443 var DefaultType$5 = _objectSpread({}, Tooltip.DefaultType, { 4444 content: '(string|element|function)' 4445 }); 4446 4447 var ClassName$7 = { 4448 FADE: 'fade', 4449 SHOW: 'show' 4450 }; 4451 var Selector$7 = { 4452 TITLE: '.popover-header', 4453 CONTENT: '.popover-body' 4454 }; 4455 var Event$7 = { 4456 HIDE: "hide" + EVENT_KEY$7, 4457 HIDDEN: "hidden" + EVENT_KEY$7, 4458 SHOW: "show" + EVENT_KEY$7, 4459 SHOWN: "shown" + EVENT_KEY$7, 4460 INSERTED: "inserted" + EVENT_KEY$7, 4461 CLICK: "click" + EVENT_KEY$7, 4462 FOCUSIN: "focusin" + EVENT_KEY$7, 4463 FOCUSOUT: "focusout" + EVENT_KEY$7, 4464 MOUSEENTER: "mouseenter" + EVENT_KEY$7, 4465 MOUSELEAVE: "mouseleave" + EVENT_KEY$7 4466 /** 4467 * ------------------------------------------------------------------------ 4468 * Class Definition 4469 * ------------------------------------------------------------------------ 4470 */ 4471 4472 }; 4473 4474 var Popover = 4475 /*#__PURE__*/ 4476 function (_Tooltip) { 4477 _inheritsLoose(Popover, _Tooltip); 4478 4479 function Popover() { 4480 return _Tooltip.apply(this, arguments) || this; 4481 } 4482 4483 var _proto = Popover.prototype; 4484 4485 // Overrides 4486 _proto.isWithContent = function isWithContent() { 4487 return this.getTitle() || this._getContent(); 4488 }; 4489 4490 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 4491 $(this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment); 4492 }; 4493 4494 _proto.getTipElement = function getTipElement() { 4495 this.tip = this.tip || $(this.config.template)[0]; 4496 return this.tip; 4497 }; 4498 4499 _proto.setContent = function setContent() { 4500 var $tip = $(this.getTipElement()); // We use append for html objects to maintain js events 4501 4502 this.setElementContent($tip.find(Selector$7.TITLE), this.getTitle()); 4503 4504 var content = this._getContent(); 4505 4506 if (typeof content === 'function') { 4507 content = content.call(this.element); 4508 } 4509 4510 this.setElementContent($tip.find(Selector$7.CONTENT), content); 4511 $tip.removeClass(ClassName$7.FADE + " " + ClassName$7.SHOW); 4512 } // Private 4513 ; 4514 4515 _proto._getContent = function _getContent() { 4516 return this.element.getAttribute('data-content') || this.config.content; 4517 }; 4518 4519 _proto._cleanTipClass = function _cleanTipClass() { 4520 var $tip = $(this.getTipElement()); 4521 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1); 4522 4523 if (tabClass !== null && tabClass.length > 0) { 4524 $tip.removeClass(tabClass.join('')); 4525 } 4526 } // Static 4527 ; 4528 4529 Popover._jQueryInterface = function _jQueryInterface(config) { 4530 return this.each(function () { 4531 var data = $(this).data(DATA_KEY$7); 4532 4533 var _config = typeof config === 'object' ? config : null; 4534 4535 if (!data && /dispose|hide/.test(config)) { 4536 return; 4537 } 4538 4539 if (!data) { 4540 data = new Popover(this, _config); 4541 $(this).data(DATA_KEY$7, data); 4542 } 4543 4544 if (typeof config === 'string') { 4545 if (typeof data[config] === 'undefined') { 4546 throw new TypeError("No method named \"" + config + "\""); 4547 } 4548 4549 data[config](); 4550 } 4551 }); 4552 }; 4553 4554 _createClass(Popover, null, [{ 4555 key: "VERSION", 4556 // Getters 4557 get: function get() { 4558 return VERSION$7; 4559 } 4560 }, { 4561 key: "Default", 4562 get: function get() { 4563 return Default$5; 4564 } 4565 }, { 4566 key: "NAME", 4567 get: function get() { 4568 return NAME$7; 4569 } 4570 }, { 4571 key: "DATA_KEY", 4572 get: function get() { 4573 return DATA_KEY$7; 4574 } 4575 }, { 4576 key: "Event", 4577 get: function get() { 4578 return Event$7; 4579 } 4580 }, { 4581 key: "EVENT_KEY", 4582 get: function get() { 4583 return EVENT_KEY$7; 4584 } 4585 }, { 4586 key: "DefaultType", 4587 get: function get() { 4588 return DefaultType$5; 4589 } 4590 }]); 4591 4592 return Popover; 4593 }(Tooltip); 4594 /** 4595 * ------------------------------------------------------------------------ 4596 * jQuery 4597 * ------------------------------------------------------------------------ 4598 */ 4599 4600 4601 $.fn[NAME$7] = Popover._jQueryInterface; 4602 $.fn[NAME$7].Constructor = Popover; 4603 4604 $.fn[NAME$7].noConflict = function () { 4605 $.fn[NAME$7] = JQUERY_NO_CONFLICT$7; 4606 return Popover._jQueryInterface; 4607 }; 4608 4609 /** 4610 * ------------------------------------------------------------------------ 4611 * Constants 4612 * ------------------------------------------------------------------------ 4613 */ 4614 4615 var NAME$8 = 'scrollspy'; 4616 var VERSION$8 = '4.3.1'; 4617 var DATA_KEY$8 = 'bs.scrollspy'; 4618 var EVENT_KEY$8 = "." + DATA_KEY$8; 4619 var DATA_API_KEY$6 = '.data-api'; 4620 var JQUERY_NO_CONFLICT$8 = $.fn[NAME$8]; 4621 var Default$6 = { 4622 offset: 10, 4623 method: 'auto', 4624 target: '' 4625 }; 4626 var DefaultType$6 = { 4627 offset: 'number', 4628 method: 'string', 4629 target: '(string|element)' 4630 }; 4631 var Event$8 = { 4632 ACTIVATE: "activate" + EVENT_KEY$8, 4633 SCROLL: "scroll" + EVENT_KEY$8, 4634 LOAD_DATA_API: "load" + EVENT_KEY$8 + DATA_API_KEY$6 4635 }; 4636 var ClassName$8 = { 4637 DROPDOWN_ITEM: 'dropdown-item', 4638 DROPDOWN_MENU: 'dropdown-menu', 4639 ACTIVE: 'active' 4640 }; 4641 var Selector$8 = { 4642 DATA_SPY: '[data-spy="scroll"]', 4643 ACTIVE: '.active', 4644 NAV_LIST_GROUP: '.nav, .list-group', 4645 NAV_LINKS: '.nav-link', 4646 NAV_ITEMS: '.nav-item', 4647 LIST_ITEMS: '.list-group-item', 4648 DROPDOWN: '.dropdown', 4649 DROPDOWN_ITEMS: '.dropdown-item', 4650 DROPDOWN_TOGGLE: '.dropdown-toggle' 4651 }; 4652 var OffsetMethod = { 4653 OFFSET: 'offset', 4654 POSITION: 'position' 4655 /** 4656 * ------------------------------------------------------------------------ 4657 * Class Definition 4658 * ------------------------------------------------------------------------ 4659 */ 4660 4661 }; 4662 4663 var ScrollSpy = 4664 /*#__PURE__*/ 4665 function () { 4666 function ScrollSpy(element, config) { 4667 var _this = this; 4668 4669 this._element = element; 4670 this._scrollElement = element.tagName === 'BODY' ? window : element; 4671 this._config = this._getConfig(config); 4672 this._selector = this._config.target + " " + Selector$8.NAV_LINKS + "," + (this._config.target + " " + Selector$8.LIST_ITEMS + ",") + (this._config.target + " " + Selector$8.DROPDOWN_ITEMS); 4673 this._offsets = []; 4674 this._targets = []; 4675 this._activeTarget = null; 4676 this._scrollHeight = 0; 4677 $(this._scrollElement).on(Event$8.SCROLL, function (event) { 4678 return _this._process(event); 4679 }); 4680 this.refresh(); 4681 4682 this._process(); 4683 } // Getters 4684 4685 4686 var _proto = ScrollSpy.prototype; 4687 4688 // Public 4689 _proto.refresh = function refresh() { 4690 var _this2 = this; 4691 4692 var autoMethod = this._scrollElement === this._scrollElement.window ? OffsetMethod.OFFSET : OffsetMethod.POSITION; 4693 var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; 4694 var offsetBase = offsetMethod === OffsetMethod.POSITION ? this._getScrollTop() : 0; 4695 this._offsets = []; 4696 this._targets = []; 4697 this._scrollHeight = this._getScrollHeight(); 4698 var targets = [].slice.call(document.querySelectorAll(this._selector)); 4699 targets.map(function (element) { 4700 var target; 4701 var targetSelector = Util.getSelectorFromElement(element); 4702 4703 if (targetSelector) { 4704 target = document.querySelector(targetSelector); 4705 } 4706 4707 if (target) { 4708 var targetBCR = target.getBoundingClientRect(); 4709 4710 if (targetBCR.width || targetBCR.height) { 4711 // TODO (fat): remove sketch reliance on jQuery position/offset 4712 return [$(target)[offsetMethod]().top + offsetBase, targetSelector]; 4713 } 4714 } 4715 4716 return null; 4717 }).filter(function (item) { 4718 return item; 4719 }).sort(function (a, b) { 4720 return a[0] - b[0]; 4721 }).forEach(function (item) { 4722 _this2._offsets.push(item[0]); 4723 4724 _this2._targets.push(item[1]); 4725 }); 4726 }; 4727 4728 _proto.dispose = function dispose() { 4729 $.removeData(this._element, DATA_KEY$8); 4730 $(this._scrollElement).off(EVENT_KEY$8); 4731 this._element = null; 4732 this._scrollElement = null; 4733 this._config = null; 4734 this._selector = null; 4735 this._offsets = null; 4736 this._targets = null; 4737 this._activeTarget = null; 4738 this._scrollHeight = null; 4739 } // Private 4740 ; 4741 4742 _proto._getConfig = function _getConfig(config) { 4743 config = _objectSpread({}, Default$6, typeof config === 'object' && config ? config : {}); 4744 4745 if (typeof config.target !== 'string') { 4746 var id = $(config.target).attr('id'); 4747 4748 if (!id) { 4749 id = Util.getUID(NAME$8); 4750 $(config.target).attr('id', id); 4751 } 4752 4753 config.target = "#" + id; 4754 } 4755 4756 Util.typeCheckConfig(NAME$8, config, DefaultType$6); 4757 return config; 4758 }; 4759 4760 _proto._getScrollTop = function _getScrollTop() { 4761 return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop; 4762 }; 4763 4764 _proto._getScrollHeight = function _getScrollHeight() { 4765 return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); 4766 }; 4767 4768 _proto._getOffsetHeight = function _getOffsetHeight() { 4769 return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; 4770 }; 4771 4772 _proto._process = function _process() { 4773 var scrollTop = this._getScrollTop() + this._config.offset; 4774 4775 var scrollHeight = this._getScrollHeight(); 4776 4777 var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight(); 4778 4779 if (this._scrollHeight !== scrollHeight) { 4780 this.refresh(); 4781 } 4782 4783 if (scrollTop >= maxScroll) { 4784 var target = this._targets[this._targets.length - 1]; 4785 4786 if (this._activeTarget !== target) { 4787 this._activate(target); 4788 } 4789 4790 return; 4791 } 4792 4793 if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) { 4794 this._activeTarget = null; 4795 4796 this._clear(); 4797 4798 return; 4799 } 4800 4801 var offsetLength = this._offsets.length; 4802 4803 for (var i = offsetLength; i--;) { 4804 var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]); 4805 4806 if (isActiveTarget) { 4807 this._activate(this._targets[i]); 4808 } 4809 } 4810 }; 4811 4812 _proto._activate = function _activate(target) { 4813 this._activeTarget = target; 4814 4815 this._clear(); 4816 4817 var queries = this._selector.split(',').map(function (selector) { 4818 return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]"; 4819 }); 4820 4821 var $link = $([].slice.call(document.querySelectorAll(queries.join(',')))); 4822 4823 if ($link.hasClass(ClassName$8.DROPDOWN_ITEM)) { 4824 $link.closest(Selector$8.DROPDOWN).find(Selector$8.DROPDOWN_TOGGLE).addClass(ClassName$8.ACTIVE); 4825 $link.addClass(ClassName$8.ACTIVE); 4826 } else { 4827 // Set triggered link as active 4828 $link.addClass(ClassName$8.ACTIVE); // Set triggered links parents as active 4829 // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor 4830 4831 $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_LINKS + ", " + Selector$8.LIST_ITEMS).addClass(ClassName$8.ACTIVE); // Handle special case when .nav-link is inside .nav-item 4832 4833 $link.parents(Selector$8.NAV_LIST_GROUP).prev(Selector$8.NAV_ITEMS).children(Selector$8.NAV_LINKS).addClass(ClassName$8.ACTIVE); 4834 } 4835 4836 $(this._scrollElement).trigger(Event$8.ACTIVATE, { 4837 relatedTarget: target 4838 }); 4839 }; 4840 4841 _proto._clear = function _clear() { 4842 [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) { 4843 return node.classList.contains(ClassName$8.ACTIVE); 4844 }).forEach(function (node) { 4845 return node.classList.remove(ClassName$8.ACTIVE); 4846 }); 4847 } // Static 4848 ; 4849 4850 ScrollSpy._jQueryInterface = function _jQueryInterface(config) { 4851 return this.each(function () { 4852 var data = $(this).data(DATA_KEY$8); 4853 4854 var _config = typeof config === 'object' && config; 4855 4856 if (!data) { 4857 data = new ScrollSpy(this, _config); 4858 $(this).data(DATA_KEY$8, data); 4859 } 4860 4861 if (typeof config === 'string') { 4862 if (typeof data[config] === 'undefined') { 4863 throw new TypeError("No method named \"" + config + "\""); 4864 } 4865 4866 data[config](); 4867 } 4868 }); 4869 }; 4870 4871 _createClass(ScrollSpy, null, [{ 4872 key: "VERSION", 4873 get: function get() { 4874 return VERSION$8; 4875 } 4876 }, { 4877 key: "Default", 4878 get: function get() { 4879 return Default$6; 4880 } 4881 }]); 4882 4883 return ScrollSpy; 4884 }(); 4885 /** 4886 * ------------------------------------------------------------------------ 4887 * Data Api implementation 4888 * ------------------------------------------------------------------------ 4889 */ 4890 4891 4892 $(window).on(Event$8.LOAD_DATA_API, function () { 4893 var scrollSpys = [].slice.call(document.querySelectorAll(Selector$8.DATA_SPY)); 4894 var scrollSpysLength = scrollSpys.length; 4895 4896 for (var i = scrollSpysLength; i--;) { 4897 var $spy = $(scrollSpys[i]); 4898 4899 ScrollSpy._jQueryInterface.call($spy, $spy.data()); 4900 } 4901 }); 4902 /** 4903 * ------------------------------------------------------------------------ 4904 * jQuery 4905 * ------------------------------------------------------------------------ 4906 */ 4907 4908 $.fn[NAME$8] = ScrollSpy._jQueryInterface; 4909 $.fn[NAME$8].Constructor = ScrollSpy; 4910 4911 $.fn[NAME$8].noConflict = function () { 4912 $.fn[NAME$8] = JQUERY_NO_CONFLICT$8; 4913 return ScrollSpy._jQueryInterface; 4914 }; 4915 4916 /** 4917 * ------------------------------------------------------------------------ 4918 * Constants 4919 * ------------------------------------------------------------------------ 4920 */ 4921 4922 var NAME$9 = 'tab'; 4923 var VERSION$9 = '4.3.1'; 4924 var DATA_KEY$9 = 'bs.tab'; 4925 var EVENT_KEY$9 = "." + DATA_KEY$9; 4926 var DATA_API_KEY$7 = '.data-api'; 4927 var JQUERY_NO_CONFLICT$9 = $.fn[NAME$9]; 4928 var Event$9 = { 4929 HIDE: "hide" + EVENT_KEY$9, 4930 HIDDEN: "hidden" + EVENT_KEY$9, 4931 SHOW: "show" + EVENT_KEY$9, 4932 SHOWN: "shown" + EVENT_KEY$9, 4933 CLICK_DATA_API: "click" + EVENT_KEY$9 + DATA_API_KEY$7 4934 }; 4935 var ClassName$9 = { 4936 DROPDOWN_MENU: 'dropdown-menu', 4937 ACTIVE: 'active', 4938 DISABLED: 'disabled', 4939 FADE: 'fade', 4940 SHOW: 'show' 4941 }; 4942 var Selector$9 = { 4943 DROPDOWN: '.dropdown', 4944 NAV_LIST_GROUP: '.nav, .list-group', 4945 ACTIVE: '.active', 4946 ACTIVE_UL: '> li > .active', 4947 DATA_TOGGLE: '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]', 4948 DROPDOWN_TOGGLE: '.dropdown-toggle', 4949 DROPDOWN_ACTIVE_CHILD: '> .dropdown-menu .active' 4950 /** 4951 * ------------------------------------------------------------------------ 4952 * Class Definition 4953 * ------------------------------------------------------------------------ 4954 */ 4955 4956 }; 4957 4958 var Tab = 4959 /*#__PURE__*/ 4960 function () { 4961 function Tab(element) { 4962 this._element = element; 4963 } // Getters 4964 4965 4966 var _proto = Tab.prototype; 4967 4968 // Public 4969 _proto.show = function show() { 4970 var _this = this; 4971 4972 if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $(this._element).hasClass(ClassName$9.ACTIVE) || $(this._element).hasClass(ClassName$9.DISABLED)) { 4973 return; 4974 } 4975 4976 var target; 4977 var previous; 4978 var listElement = $(this._element).closest(Selector$9.NAV_LIST_GROUP)[0]; 4979 var selector = Util.getSelectorFromElement(this._element); 4980 4981 if (listElement) { 4982 var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector$9.ACTIVE_UL : Selector$9.ACTIVE; 4983 previous = $.makeArray($(listElement).find(itemSelector)); 4984 previous = previous[previous.length - 1]; 4985 } 4986 4987 var hideEvent = $.Event(Event$9.HIDE, { 4988 relatedTarget: this._element 4989 }); 4990 var showEvent = $.Event(Event$9.SHOW, { 4991 relatedTarget: previous 4992 }); 4993 4994 if (previous) { 4995 $(previous).trigger(hideEvent); 4996 } 4997 4998 $(this._element).trigger(showEvent); 4999 5000 if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) { 5001 return; 5002 } 5003 5004 if (selector) { 5005 target = document.querySelector(selector); 5006 } 5007 5008 this._activate(this._element, listElement); 5009 5010 var complete = function complete() { 5011 var hiddenEvent = $.Event(Event$9.HIDDEN, { 5012 relatedTarget: _this._element 5013 }); 5014 var shownEvent = $.Event(Event$9.SHOWN, { 5015 relatedTarget: previous 5016 }); 5017 $(previous).trigger(hiddenEvent); 5018 $(_this._element).trigger(shownEvent); 5019 }; 5020 5021 if (target) { 5022 this._activate(target, target.parentNode, complete); 5023 } else { 5024 complete(); 5025 } 5026 }; 5027 5028 _proto.dispose = function dispose() { 5029 $.removeData(this._element, DATA_KEY$9); 5030 this._element = null; 5031 } // Private 5032 ; 5033 5034 _proto._activate = function _activate(element, container, callback) { 5035 var _this2 = this; 5036 5037 var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $(container).find(Selector$9.ACTIVE_UL) : $(container).children(Selector$9.ACTIVE); 5038 var active = activeElements[0]; 5039 var isTransitioning = callback && active && $(active).hasClass(ClassName$9.FADE); 5040 5041 var complete = function complete() { 5042 return _this2._transitionComplete(element, active, callback); 5043 }; 5044 5045 if (active && isTransitioning) { 5046 var transitionDuration = Util.getTransitionDurationFromElement(active); 5047 $(active).removeClass(ClassName$9.SHOW).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 5048 } else { 5049 complete(); 5050 } 5051 }; 5052 5053 _proto._transitionComplete = function _transitionComplete(element, active, callback) { 5054 if (active) { 5055 $(active).removeClass(ClassName$9.ACTIVE); 5056 var dropdownChild = $(active.parentNode).find(Selector$9.DROPDOWN_ACTIVE_CHILD)[0]; 5057 5058 if (dropdownChild) { 5059 $(dropdownChild).removeClass(ClassName$9.ACTIVE); 5060 } 5061 5062 if (active.getAttribute('role') === 'tab') { 5063 active.setAttribute('aria-selected', false); 5064 } 5065 } 5066 5067 $(element).addClass(ClassName$9.ACTIVE); 5068 5069 if (element.getAttribute('role') === 'tab') { 5070 element.setAttribute('aria-selected', true); 5071 } 5072 5073 Util.reflow(element); 5074 5075 if (element.classList.contains(ClassName$9.FADE)) { 5076 element.classList.add(ClassName$9.SHOW); 5077 } 5078 5079 if (element.parentNode && $(element.parentNode).hasClass(ClassName$9.DROPDOWN_MENU)) { 5080 var dropdownElement = $(element).closest(Selector$9.DROPDOWN)[0]; 5081 5082 if (dropdownElement) { 5083 var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(Selector$9.DROPDOWN_TOGGLE)); 5084 $(dropdownToggleList).addClass(ClassName$9.ACTIVE); 5085 } 5086 5087 element.setAttribute('aria-expanded', true); 5088 } 5089 5090 if (callback) { 5091 callback(); 5092 } 5093 } // Static 5094 ; 5095 5096 Tab._jQueryInterface = function _jQueryInterface(config) { 5097 return this.each(function () { 5098 var $this = $(this); 5099 var data = $this.data(DATA_KEY$9); 5100 5101 if (!data) { 5102 data = new Tab(this); 5103 $this.data(DATA_KEY$9, data); 5104 } 5105 5106 if (typeof config === 'string') { 5107 if (typeof data[config] === 'undefined') { 5108 throw new TypeError("No method named \"" + config + "\""); 5109 } 5110 5111 data[config](); 5112 } 5113 }); 5114 }; 5115 5116 _createClass(Tab, null, [{ 5117 key: "VERSION", 5118 get: function get() { 5119 return VERSION$9; 5120 } 5121 }]); 5122 5123 return Tab; 5124 }(); 5125 /** 5126 * ------------------------------------------------------------------------ 5127 * Data Api implementation 5128 * ------------------------------------------------------------------------ 5129 */ 5130 5131 5132 $(document).on(Event$9.CLICK_DATA_API, Selector$9.DATA_TOGGLE, function (event) { 5133 event.preventDefault(); 5134 5135 Tab._jQueryInterface.call($(this), 'show'); 5136 }); 5137 /** 5138 * ------------------------------------------------------------------------ 5139 * jQuery 5140 * ------------------------------------------------------------------------ 5141 */ 5142 5143 $.fn[NAME$9] = Tab._jQueryInterface; 5144 $.fn[NAME$9].Constructor = Tab; 5145 5146 $.fn[NAME$9].noConflict = function () { 5147 $.fn[NAME$9] = JQUERY_NO_CONFLICT$9; 5148 return Tab._jQueryInterface; 5149 }; 5150 5151 /** 5152 * ------------------------------------------------------------------------ 5153 * Constants 5154 * ------------------------------------------------------------------------ 5155 */ 5156 5157 var NAME$a = 'toast'; 5158 var VERSION$a = '4.3.1'; 5159 var DATA_KEY$a = 'bs.toast'; 5160 var EVENT_KEY$a = "." + DATA_KEY$a; 5161 var JQUERY_NO_CONFLICT$a = $.fn[NAME$a]; 5162 var Event$a = { 5163 CLICK_DISMISS: "click.dismiss" + EVENT_KEY$a, 5164 HIDE: "hide" + EVENT_KEY$a, 5165 HIDDEN: "hidden" + EVENT_KEY$a, 5166 SHOW: "show" + EVENT_KEY$a, 5167 SHOWN: "shown" + EVENT_KEY$a 5168 }; 5169 var ClassName$a = { 5170 FADE: 'fade', 5171 HIDE: 'hide', 5172 SHOW: 'show', 5173 SHOWING: 'showing' 5174 }; 5175 var DefaultType$7 = { 5176 animation: 'boolean', 5177 autohide: 'boolean', 5178 delay: 'number' 5179 }; 5180 var Default$7 = { 5181 animation: true, 5182 autohide: true, 5183 delay: 500 5184 }; 5185 var Selector$a = { 5186 DATA_DISMISS: '[data-dismiss="toast"]' 5187 /** 5188 * ------------------------------------------------------------------------ 5189 * Class Definition 5190 * ------------------------------------------------------------------------ 5191 */ 5192 5193 }; 5194 5195 var Toast = 5196 /*#__PURE__*/ 5197 function () { 5198 function Toast(element, config) { 5199 this._element = element; 5200 this._config = this._getConfig(config); 5201 this._timeout = null; 5202 5203 this._setListeners(); 5204 } // Getters 5205 5206 5207 var _proto = Toast.prototype; 5208 5209 // Public 5210 _proto.show = function show() { 5211 var _this = this; 5212 5213 $(this._element).trigger(Event$a.SHOW); 5214 5215 if (this._config.animation) { 5216 this._element.classList.add(ClassName$a.FADE); 5217 } 5218 5219 var complete = function complete() { 5220 _this._element.classList.remove(ClassName$a.SHOWING); 5221 5222 _this._element.classList.add(ClassName$a.SHOW); 5223 5224 $(_this._element).trigger(Event$a.SHOWN); 5225 5226 if (_this._config.autohide) { 5227 _this.hide(); 5228 } 5229 }; 5230 5231 this._element.classList.remove(ClassName$a.HIDE); 5232 5233 this._element.classList.add(ClassName$a.SHOWING); 5234 5235 if (this._config.animation) { 5236 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 5237 $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 5238 } else { 5239 complete(); 5240 } 5241 }; 5242 5243 _proto.hide = function hide(withoutTimeout) { 5244 var _this2 = this; 5245 5246 if (!this._element.classList.contains(ClassName$a.SHOW)) { 5247 return; 5248 } 5249 5250 $(this._element).trigger(Event$a.HIDE); 5251 5252 if (withoutTimeout) { 5253 this._close(); 5254 } else { 5255 this._timeout = setTimeout(function () { 5256 _this2._close(); 5257 }, this._config.delay); 5258 } 5259 }; 5260 5261 _proto.dispose = function dispose() { 5262 clearTimeout(this._timeout); 5263 this._timeout = null; 5264 5265 if (this._element.classList.contains(ClassName$a.SHOW)) { 5266 this._element.classList.remove(ClassName$a.SHOW); 5267 } 5268 5269 $(this._element).off(Event$a.CLICK_DISMISS); 5270 $.removeData(this._element, DATA_KEY$a); 5271 this._element = null; 5272 this._config = null; 5273 } // Private 5274 ; 5275 5276 _proto._getConfig = function _getConfig(config) { 5277 config = _objectSpread({}, Default$7, $(this._element).data(), typeof config === 'object' && config ? config : {}); 5278 Util.typeCheckConfig(NAME$a, config, this.constructor.DefaultType); 5279 return config; 5280 }; 5281 5282 _proto._setListeners = function _setListeners() { 5283 var _this3 = this; 5284 5285 $(this._element).on(Event$a.CLICK_DISMISS, Selector$a.DATA_DISMISS, function () { 5286 return _this3.hide(true); 5287 }); 5288 }; 5289 5290 _proto._close = function _close() { 5291 var _this4 = this; 5292 5293 var complete = function complete() { 5294 _this4._element.classList.add(ClassName$a.HIDE); 5295 5296 $(_this4._element).trigger(Event$a.HIDDEN); 5297 }; 5298 5299 this._element.classList.remove(ClassName$a.SHOW); 5300 5301 if (this._config.animation) { 5302 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 5303 $(this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 5304 } else { 5305 complete(); 5306 } 5307 } // Static 5308 ; 5309 5310 Toast._jQueryInterface = function _jQueryInterface(config) { 5311 return this.each(function () { 5312 var $element = $(this); 5313 var data = $element.data(DATA_KEY$a); 5314 5315 var _config = typeof config === 'object' && config; 5316 5317 if (!data) { 5318 data = new Toast(this, _config); 5319 $element.data(DATA_KEY$a, data); 5320 } 5321 5322 if (typeof config === 'string') { 5323 if (typeof data[config] === 'undefined') { 5324 throw new TypeError("No method named \"" + config + "\""); 5325 } 5326 5327 data[config](this); 5328 } 5329 }); 5330 }; 5331 5332 _createClass(Toast, null, [{ 5333 key: "VERSION", 5334 get: function get() { 5335 return VERSION$a; 5336 } 5337 }, { 5338 key: "DefaultType", 5339 get: function get() { 5340 return DefaultType$7; 5341 } 5342 }, { 5343 key: "Default", 5344 get: function get() { 5345 return Default$7; 5346 } 5347 }]); 5348 5349 return Toast; 5350 }(); 5351 /** 5352 * ------------------------------------------------------------------------ 5353 * jQuery 5354 * ------------------------------------------------------------------------ 5355 */ 5356 5357 5358 $.fn[NAME$a] = Toast._jQueryInterface; 5359 $.fn[NAME$a].Constructor = Toast; 5360 5361 $.fn[NAME$a].noConflict = function () { 5362 $.fn[NAME$a] = JQUERY_NO_CONFLICT$a; 5363 return Toast._jQueryInterface; 5364 }; 5365 5366 /** 5367 * -------------------------------------------------------------------------- 5368 * Bootstrap (v4.3.1): index.js 5369 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5370 * -------------------------------------------------------------------------- 5371 */ 5372 5373 (function () { 5374 if (typeof $ === 'undefined') { 5375 throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.'); 5376 } 5377 5378 var version = $.fn.jquery.split(' ')[0].split('.'); 5379 var minMajor = 1; 5380 var ltMajor = 2; 5381 var minMinor = 9; 5382 var minPatch = 1; 5383 var maxMajor = 4; 5384 5385 if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) { 5386 throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0'); 5387 } 5388 })(); 5389 5390 exports.Util = Util; 5391 exports.Alert = Alert; 5392 exports.Button = Button; 5393 exports.Carousel = Carousel; 5394 exports.Collapse = Collapse; 5395 exports.Dropdown = Dropdown; 5396 exports.Modal = Modal; 5397 exports.Popover = Popover; 5398 exports.Scrollspy = ScrollSpy; 5399 exports.Tab = Tab; 5400 exports.Toast = Toast; 5401 exports.Tooltip = Tooltip; 5402 5403 Object.defineProperty(exports, '__esModule', { value: true }); 5404 5405})); 5406//# sourceMappingURL=bootstrap.js.map 5407 5408 5409/***/ }), 5410
vendor: 285,809 bytes, lines 5411-16138
5411/***/ "./node_modules/jquery/dist/jquery.js": 5412/*!********************************************!*\ 5413 !*** ./node_modules/jquery/dist/jquery.js ***! 5414 \********************************************/ 5415/*! no static exports found */ 5416/***/ (function(module, exports, __webpack_require__) { 5417 5418var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 5419 * jQuery JavaScript Library v3.7.1 5420 * https://jquery.com/ 5421 * 5422 * Copyright OpenJS Foundation and other contributors 5423 * Released under the MIT license 5424 * https://jquery.org/license 5425 * 5426 * Date: 2023-08-28T13:37Z 5427 */ 5428( function( global, factory ) { 5429 5430 "use strict"; 5431 5432 if ( true && typeof module.exports === "object" ) { 5433 5434 // For CommonJS and CommonJS-like environments where a proper `window` 5435 // is present, execute the factory and get jQuery. 5436 // For environments that do not have a `window` with a `document` 5437 // (such as Node.js), expose a factory as module.exports. 5438 // This accentuates the need for the creation of a real `window`. 5439 // e.g. var jQuery = require("jquery")(window); 5440 // See ticket trac-14549 for more info. 5441 module.exports = global.document ? 5442 factory( global, true ) : 5443 function( w ) { 5444 if ( !w.document ) { 5445 throw new Error( "jQuery requires a window with a document" ); 5446 } 5447 return factory( w ); 5448 }; 5449 } else { 5450 factory( global ); 5451 } 5452 5453// Pass this if window is not defined yet 5454} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { 5455 5456// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 5457// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode 5458// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common 5459// enough that all such attempts are guarded in a try block. 5460"use strict"; 5461 5462var arr = []; 5463 5464var getProto = Object.getPrototypeOf; 5465 5466var slice = arr.slice; 5467 5468var flat = arr.flat ? function( array ) { 5469 return arr.flat.call( array ); 5470} : function( array ) { 5471 return arr.concat.apply( [], array ); 5472}; 5473 5474 5475var push = arr.push; 5476 5477var indexOf = arr.indexOf; 5478 5479var class2type = {}; 5480 5481var toString = class2type.toString; 5482 5483var hasOwn = class2type.hasOwnProperty; 5484 5485var fnToString = hasOwn.toString; 5486 5487var ObjectFunctionString = fnToString.call( Object ); 5488 5489var support = {}; 5490 5491var isFunction = function isFunction( obj ) { 5492 5493 // Support: Chrome <=57, Firefox <=52 5494 // In some browsers, typeof returns "function" for HTML <object> elements 5495 // (i.e., `typeof document.createElement( "object" ) === "function"`). 5496 // We don't want to classify *any* DOM node as a function. 5497 // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5 5498 // Plus for old WebKit, typeof returns "function" for HTML collections 5499 // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756) 5500 return typeof obj === "function" && typeof obj.nodeType !== "number" && 5501 typeof obj.item !== "function"; 5502 }; 5503 5504 5505var isWindow = function isWindow( obj ) { 5506 return obj != null && obj === obj.window; 5507 }; 5508 5509 5510var document = window.document; 5511 5512 5513 5514 var preservedScriptAttributes = { 5515 type: true, 5516 src: true, 5517 nonce: true, 5518 noModule: true 5519 }; 5520 5521 function DOMEval( code, node, doc ) { 5522 doc = doc || document; 5523 5524 var i, val, 5525 script = doc.createElement( "script" ); 5526 5527 script.text = code; 5528 if ( node ) { 5529 for ( i in preservedScriptAttributes ) { 5530 5531 // Support: Firefox 64+, Edge 18+ 5532 // Some browsers don't support the "nonce" property on scripts. 5533 // On the other hand, just using `getAttribute` is not enough as 5534 // the `nonce` attribute is reset to an empty string whenever it 5535 // becomes browsing-context connected. 5536 // See https://github.com/whatwg/html/issues/2369 5537 // See https://html.spec.whatwg.org/#nonce-attributes 5538 // The `node.getAttribute` check was added for the sake of 5539 // `jQuery.globalEval` so that it can fake a nonce-containing node 5540 // via an object. 5541 val = node[ i ] || node.getAttribute && node.getAttribute( i ); 5542 if ( val ) { 5543 script.setAttribute( i, val ); 5544 } 5545 } 5546 } 5547 doc.head.appendChild( script ).parentNode.removeChild( script ); 5548 } 5549 5550 5551function toType( obj ) { 5552 if ( obj == null ) { 5553 return obj + ""; 5554 } 5555 5556 // Support: Android <=2.3 only (functionish RegExp) 5557 return typeof obj === "object" || typeof obj === "function" ? 5558 class2type[ toString.call( obj ) ] || "object" : 5559 typeof obj; 5560} 5561/* global Symbol */ 5562// Defining this global in .eslintrc.json would create a danger of using the global 5563// unguarded in another place, it seems safer to define global only for this module 5564 5565 5566 5567var version = "3.7.1", 5568 5569 rhtmlSuffix = /HTML$/i, 5570 5571 // Define a local copy of jQuery 5572 jQuery = function( selector, context ) { 5573 5574 // The jQuery object is actually just the init constructor 'enhanced' 5575 // Need init if jQuery is called (just allow error to be thrown if not included) 5576 return new jQuery.fn.init( selector, context ); 5577 }; 5578 5579jQuery.fn = jQuery.prototype = { 5580 5581 // The current version of jQuery being used 5582 jquery: version, 5583 5584 constructor: jQuery, 5585 5586 // The default length of a jQuery object is 0 5587 length: 0, 5588 5589 toArray: function() { 5590 return slice.call( this ); 5591 }, 5592 5593 // Get the Nth element in the matched element set OR 5594 // Get the whole matched element set as a clean array 5595 get: function( num ) { 5596 5597 // Return all the elements in a clean array 5598 if ( num == null ) { 5599 return slice.call( this ); 5600 } 5601 5602 // Return just the one element from the set 5603 return num < 0 ? this[ num + this.length ] : this[ num ]; 5604 }, 5605 5606 // Take an array of elements and push it onto the stack 5607 // (returning the new matched element set) 5608 pushStack: function( elems ) { 5609 5610 // Build a new jQuery matched element set 5611 var ret = jQuery.merge( this.constructor(), elems ); 5612 5613 // Add the old object onto the stack (as a reference) 5614 ret.prevObject = this; 5615 5616 // Return the newly-formed element set 5617 return ret; 5618 }, 5619 5620 // Execute a callback for every element in the matched set. 5621 each: function( callback ) { 5622 return jQuery.each( this, callback ); 5623 }, 5624 5625 map: function( callback ) { 5626 return this.pushStack( jQuery.map( this, function( elem, i ) { 5627 return callback.call( elem, i, elem ); 5628 } ) ); 5629 }, 5630 5631 slice: function() { 5632 return this.pushStack( slice.apply( this, arguments ) ); 5633 }, 5634 5635 first: function() { 5636 return this.eq( 0 ); 5637 }, 5638 5639 last: function() { 5640 return this.eq( -1 ); 5641 }, 5642 5643 even: function() { 5644 return this.pushStack( jQuery.grep( this, function( _elem, i ) { 5645 return ( i + 1 ) % 2; 5646 } ) ); 5647 }, 5648 5649 odd: function() { 5650 return this.pushStack( jQuery.grep( this, function( _elem, i ) { 5651 return i % 2; 5652 } ) ); 5653 }, 5654 5655 eq: function( i ) { 5656 var len = this.length, 5657 j = +i + ( i < 0 ? len : 0 ); 5658 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); 5659 }, 5660 5661 end: function() { 5662 return this.prevObject || this.constructor(); 5663 }, 5664 5665 // For internal use only. 5666 // Behaves like an Array's method, not like a jQuery method. 5667 push: push, 5668 sort: arr.sort, 5669 splice: arr.splice 5670}; 5671 5672jQuery.extend = jQuery.fn.extend = function() { 5673 var options, name, src, copy, copyIsArray, clone, 5674 target = arguments[ 0 ] || {}, 5675 i = 1, 5676 length = arguments.length, 5677 deep = false; 5678 5679 // Handle a deep copy situation 5680 if ( typeof target === "boolean" ) { 5681 deep = target; 5682 5683 // Skip the boolean and the target 5684 target = arguments[ i ] || {}; 5685 i++; 5686 } 5687 5688 // Handle case when target is a string or something (possible in deep copy) 5689 if ( typeof target !== "object" && !isFunction( target ) ) { 5690 target = {}; 5691 } 5692 5693 // Extend jQuery itself if only one argument is passed 5694 if ( i === length ) { 5695 target = this; 5696 i--; 5697 } 5698 5699 for ( ; i < length; i++ ) { 5700 5701 // Only deal with non-null/undefined values 5702 if ( ( options = arguments[ i ] ) != null ) { 5703 5704 // Extend the base object 5705 for ( name in options ) { 5706 copy = options[ name ]; 5707 5708 // Prevent Object.prototype pollution 5709 // Prevent never-ending loop 5710 if ( name === "__proto__" || target === copy ) { 5711 continue; 5712 } 5713 5714 // Recurse if we're merging plain objects or arrays 5715 if ( deep && copy && ( jQuery.isPlainObject( copy ) || 5716 ( copyIsArray = Array.isArray( copy ) ) ) ) { 5717 src = target[ name ]; 5718 5719 // Ensure proper type for the source value 5720 if ( copyIsArray && !Array.isArray( src ) ) { 5721 clone = []; 5722 } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { 5723 clone = {}; 5724 } else { 5725 clone = src; 5726 } 5727 copyIsArray = false; 5728 5729 // Never move original objects, clone them 5730 target[ name ] = jQuery.extend( deep, clone, copy ); 5731 5732 // Don't bring in undefined values 5733 } else if ( copy !== undefined ) { 5734 target[ name ] = copy; 5735 } 5736 } 5737 } 5738 } 5739 5740 // Return the modified object 5741 return target; 5742}; 5743 5744jQuery.extend( { 5745 5746 // Unique for each copy of jQuery on the page 5747 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), 5748 5749 // Assume jQuery is ready without the ready module 5750 isReady: true, 5751 5752 error: function( msg ) { 5753 throw new Error( msg ); 5754 }, 5755 5756 noop: function() {}, 5757 5758 isPlainObject: function( obj ) { 5759 var proto, Ctor; 5760 5761 // Detect obvious negatives 5762 // Use toString instead of jQuery.type to catch host objects 5763 if ( !obj || toString.call( obj ) !== "[object Object]" ) { 5764 return false; 5765 } 5766 5767 proto = getProto( obj ); 5768 5769 // Objects with no prototype (e.g., `Object.create( null )`) are plain 5770 if ( !proto ) { 5771 return true; 5772 } 5773 5774 // Objects with prototype are plain iff they were constructed by a global Object function 5775 Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; 5776 return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; 5777 }, 5778 5779 isEmptyObject: function( obj ) { 5780 var name; 5781 5782 for ( name in obj ) { 5783 return false; 5784 } 5785 return true; 5786 }, 5787 5788 // Evaluates a script in a provided context; falls back to the global one 5789 // if not specified. 5790 globalEval: function( code, options, doc ) { 5791 DOMEval( code, { nonce: options && options.nonce }, doc ); 5792 }, 5793 5794 each: function( obj, callback ) { 5795 var length, i = 0; 5796 5797 if ( isArrayLike( obj ) ) { 5798 length = obj.length; 5799 for ( ; i < length; i++ ) { 5800 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 5801 break; 5802 } 5803 } 5804 } else { 5805 for ( i in obj ) { 5806 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 5807 break; 5808 } 5809 } 5810 } 5811 5812 return obj; 5813 }, 5814 5815 5816 // Retrieve the text value of an array of DOM nodes 5817 text: function( elem ) { 5818 var node, 5819 ret = "", 5820 i = 0, 5821 nodeType = elem.nodeType; 5822 5823 if ( !nodeType ) { 5824 5825 // If no nodeType, this is expected to be an array 5826 while ( ( node = elem[ i++ ] ) ) { 5827 5828 // Do not traverse comment nodes 5829 ret += jQuery.text( node ); 5830 } 5831 } 5832 if ( nodeType === 1 || nodeType === 11 ) { 5833 return elem.textContent; 5834 } 5835 if ( nodeType === 9 ) { 5836 return elem.documentElement.textContent; 5837 } 5838 if ( nodeType === 3 || nodeType === 4 ) { 5839 return elem.nodeValue; 5840 } 5841 5842 // Do not include comment or processing instruction nodes 5843 5844 return ret; 5845 }, 5846 5847 // results is for internal usage only 5848 makeArray: function( arr, results ) { 5849 var ret = results || []; 5850 5851 if ( arr != null ) { 5852 if ( isArrayLike( Object( arr ) ) ) { 5853 jQuery.merge( ret, 5854 typeof arr === "string" ? 5855 [ arr ] : arr 5856 ); 5857 } else { 5858 push.call( ret, arr ); 5859 } 5860 } 5861 5862 return ret; 5863 }, 5864 5865 inArray: function( elem, arr, i ) { 5866 return arr == null ? -1 : indexOf.call( arr, elem, i ); 5867 }, 5868 5869 isXMLDoc: function( elem ) { 5870 var namespace = elem && elem.namespaceURI, 5871 docElem = elem && ( elem.ownerDocument || elem ).documentElement; 5872 5873 // Assume HTML when documentElement doesn't yet exist, such as inside 5874 // document fragments. 5875 return !rhtmlSuffix.test( namespace || docElem && docElem.nodeName || "HTML" ); 5876 }, 5877 5878 // Support: Android <=4.0 only, PhantomJS 1 only 5879 // push.apply(_, arraylike) throws on ancient WebKit 5880 merge: function( first, second ) { 5881 var len = +second.length, 5882 j = 0, 5883 i = first.length; 5884 5885 for ( ; j < len; j++ ) { 5886 first[ i++ ] = second[ j ]; 5887 } 5888 5889 first.length = i; 5890 5891 return first; 5892 }, 5893 5894 grep: function( elems, callback, invert ) { 5895 var callbackInverse, 5896 matches = [], 5897 i = 0, 5898 length = elems.length, 5899 callbackExpect = !invert; 5900 5901 // Go through the array, only saving the items 5902 // that pass the validator function 5903 for ( ; i < length; i++ ) { 5904 callbackInverse = !callback( elems[ i ], i ); 5905 if ( callbackInverse !== callbackExpect ) { 5906 matches.push( elems[ i ] ); 5907 } 5908 } 5909 5910 return matches; 5911 }, 5912 5913 // arg is for internal usage only 5914 map: function( elems, callback, arg ) { 5915 var length, value, 5916 i = 0, 5917 ret = []; 5918 5919 // Go through the array, translating each of the items to their new values 5920 if ( isArrayLike( elems ) ) { 5921 length = elems.length; 5922 for ( ; i < length; i++ ) { 5923 value = callback( elems[ i ], i, arg ); 5924 5925 if ( value != null ) { 5926 ret.push( value ); 5927 } 5928 } 5929 5930 // Go through every key on the object, 5931 } else { 5932 for ( i in elems ) { 5933 value = callback( elems[ i ], i, arg ); 5934 5935 if ( value != null ) { 5936 ret.push( value ); 5937 } 5938 } 5939 } 5940 5941 // Flatten any nested arrays 5942 return flat( ret ); 5943 }, 5944 5945 // A global GUID counter for objects 5946 guid: 1, 5947 5948 // jQuery.support is not used in Core but other projects attach their 5949 // properties to it so it needs to exist. 5950 support: support 5951} ); 5952 5953if ( typeof Symbol === "function" ) { 5954 jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; 5955} 5956 5957// Populate the class2type map 5958jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), 5959 function( _i, name ) { 5960 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 5961 } ); 5962 5963function isArrayLike( obj ) { 5964 5965 // Support: real iOS 8.2 only (not reproducible in simulator) 5966 // `in` check used to prevent JIT error (gh-2145) 5967 // hasOwn isn't used here due to false negatives 5968 // regarding Nodelist length in IE 5969 var length = !!obj && "length" in obj && obj.length, 5970 type = toType( obj ); 5971 5972 if ( isFunction( obj ) || isWindow( obj ) ) { 5973 return false; 5974 } 5975 5976 return type === "array" || length === 0 || 5977 typeof length === "number" && length > 0 && ( length - 1 ) in obj; 5978} 5979 5980 5981function nodeName( elem, name ) { 5982 5983 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 5984 5985} 5986var pop = arr.pop; 5987 5988 5989var sort = arr.sort; 5990 5991 5992var splice = arr.splice; 5993 5994 5995var whitespace = "[\\x20\\t\\r\\n\\f]"; 5996 5997 5998var rtrimCSS = new RegExp( 5999 "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", 6000 "g" 6001); 6002 6003 6004 6005 6006// Note: an element does not contain itself 6007jQuery.contains = function( a, b ) { 6008 var bup = b && b.parentNode; 6009 6010 return a === bup || !!( bup && bup.nodeType === 1 && ( 6011 6012 // Support: IE 9 - 11+ 6013 // IE doesn't have `contains` on SVG. 6014 a.contains ? 6015 a.contains( bup ) : 6016 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 6017 ) ); 6018}; 6019 6020 6021 6022 6023// CSS string/identifier serialization 6024// https://drafts.csswg.org/cssom/#common-serializing-idioms 6025var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g; 6026 6027function fcssescape( ch, asCodePoint ) { 6028 if ( asCodePoint ) { 6029 6030 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER 6031 if ( ch === "\0" ) { 6032 return "\uFFFD"; 6033 } 6034 6035 // Control characters and (dependent upon position) numbers get escaped as code points 6036 return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; 6037 } 6038 6039 // Other potentially-special ASCII characters get backslash-escaped 6040 return "\\" + ch; 6041} 6042 6043jQuery.escapeSelector = function( sel ) { 6044 return ( sel + "" ).replace( rcssescape, fcssescape ); 6045}; 6046 6047 6048 6049 6050var preferredDoc = document, 6051 pushNative = push; 6052 6053( function() { 6054 6055var i, 6056 Expr, 6057 outermostContext, 6058 sortInput, 6059 hasDuplicate, 6060 push = pushNative, 6061 6062 // Local document vars 6063 document, 6064 documentElement, 6065 documentIsHTML, 6066 rbuggyQSA, 6067 matches, 6068 6069 // Instance-specific data 6070 expando = jQuery.expando, 6071 dirruns = 0, 6072 done = 0, 6073 classCache = createCache(), 6074 tokenCache = createCache(), 6075 compilerCache = createCache(), 6076 nonnativeSelectorCache = createCache(), 6077 sortOrder = function( a, b ) { 6078 if ( a === b ) { 6079 hasDuplicate = true; 6080 } 6081 return 0; 6082 }, 6083 6084 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|" + 6085 "loop|multiple|open|readonly|required|scoped", 6086 6087 // Regular expressions 6088 6089 // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram 6090 identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + 6091 "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", 6092 6093 // Attribute selectors: https://www.w3.org/TR/selectors/#attribute-selectors 6094 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + 6095 6096 // Operator (capture 2) 6097 "*([*^$|!~]?=)" + whitespace + 6098 6099 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" 6100 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + 6101 whitespace + "*\\]", 6102 6103 pseudos = ":(" + identifier + ")(?:\\((" + 6104 6105 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: 6106 // 1. quoted (capture 3; capture 4 or capture 5) 6107 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + 6108 6109 // 2. simple (capture 6) 6110 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + 6111 6112 // 3. anything else (capture 2) 6113 ".*" + 6114 ")\\)|)", 6115 6116 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 6117 rwhitespace = new RegExp( whitespace + "+", "g" ), 6118 6119 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), 6120 rleadingCombinator = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + 6121 whitespace + "*" ), 6122 rdescend = new RegExp( whitespace + "|>" ), 6123 6124 rpseudo = new RegExp( pseudos ), 6125 ridentifier = new RegExp( "^" + identifier + "$" ), 6126 6127 matchExpr = { 6128 ID: new RegExp( "^#(" + identifier + ")" ), 6129 CLASS: new RegExp( "^\\.(" + identifier + ")" ), 6130 TAG: new RegExp( "^(" + identifier + "|[*])" ), 6131 ATTR: new RegExp( "^" + attributes ), 6132 PSEUDO: new RegExp( "^" + pseudos ), 6133 CHILD: new RegExp( 6134 "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + 6135 whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + 6136 whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), 6137 bool: new RegExp( "^(?:" + booleans + ")$", "i" ), 6138 6139 // For use in libraries implementing .is() 6140 // We use this for POS matching in `select` 6141 needsContext: new RegExp( "^" + whitespace + 6142 "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + 6143 "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) 6144 }, 6145 6146 rinputs = /^(?:input|select|textarea|button)$/i, 6147 rheader = /^h\d$/i, 6148 6149 // Easily-parseable/retrievable ID or TAG or CLASS selectors 6150 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 6151 6152 rsibling = /[+~]/, 6153 6154 // CSS escapes 6155 // https://www.w3.org/TR/CSS21/syndata.html#escaped-characters 6156 runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + 6157 "?|\\\\([^\\r\\n\\f])", "g" ), 6158 funescape = function( escape, nonHex ) { 6159 var high = "0x" + escape.slice( 1 ) - 0x10000; 6160 6161 if ( nonHex ) { 6162 6163 // Strip the backslash prefix from a non-hex escape sequence 6164 return nonHex; 6165 } 6166 6167 // Replace a hexadecimal escape sequence with the encoded Unicode code point 6168 // Support: IE <=11+ 6169 // For values outside the Basic Multilingual Plane (BMP), manually construct a 6170 // surrogate pair 6171 return high < 0 ? 6172 String.fromCharCode( high + 0x10000 ) : 6173 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 6174 }, 6175 6176 // Used for iframes; see `setDocument`. 6177 // Support: IE 9 - 11+, Edge 12 - 18+ 6178 // Removing the function wrapper causes a "Permission Denied" 6179 // error in IE/Edge. 6180 unloadHandler = function() { 6181 setDocument(); 6182 }, 6183 6184 inDisabledFieldset = addCombinator( 6185 function( elem ) { 6186 return elem.disabled === true && nodeName( elem, "fieldset" ); 6187 }, 6188 { dir: "parentNode", next: "legend" } 6189 ); 6190 6191// Support: IE <=9 only 6192// Accessing document.activeElement can throw unexpectedly 6193// https://bugs.jquery.com/ticket/13393 6194function safeActiveElement() { 6195 try { 6196 return document.activeElement; 6197 } catch ( err ) { } 6198} 6199 6200// Optimize for push.apply( _, NodeList ) 6201try { 6202 push.apply( 6203 ( arr = slice.call( preferredDoc.childNodes ) ), 6204 preferredDoc.childNodes 6205 ); 6206 6207 // Support: Android <=4.0 6208 // Detect silently failing push.apply 6209 // eslint-disable-next-line no-unused-expressions 6210 arr[ preferredDoc.childNodes.length ].nodeType; 6211} catch ( e ) { 6212 push = { 6213 apply: function( target, els ) { 6214 pushNative.apply( target, slice.call( els ) ); 6215 }, 6216 call: function( target ) { 6217 pushNative.apply( target, slice.call( arguments, 1 ) ); 6218 } 6219 }; 6220} 6221 6222function find( selector, context, results, seed ) { 6223 var m, i, elem, nid, match, groups, newSelector, 6224 newContext = context && context.ownerDocument, 6225 6226 // nodeType defaults to 9, since context defaults to document 6227 nodeType = context ? context.nodeType : 9; 6228 6229 results = results || []; 6230 6231 // Return early from calls with invalid selector or context 6232 if ( typeof selector !== "string" || !selector || 6233 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { 6234 6235 return results; 6236 } 6237 6238 // Try to shortcut find operations (as opposed to filters) in HTML documents 6239 if ( !seed ) { 6240 setDocument( context ); 6241 context = context || document; 6242 6243 if ( documentIsHTML ) { 6244 6245 // If the selector is sufficiently simple, try using a "get*By*" DOM method 6246 // (excepting DocumentFragment context, where the methods don't exist) 6247 if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { 6248 6249 // ID selector 6250 if ( ( m = match[ 1 ] ) ) { 6251 6252 // Document context 6253 if ( nodeType === 9 ) { 6254 if ( ( elem = context.getElementById( m ) ) ) { 6255 6256 // Support: IE 9 only 6257 // getElementById can match elements by name instead of ID 6258 if ( elem.id === m ) { 6259 push.call( results, elem ); 6260 return results; 6261 } 6262 } else { 6263 return results; 6264 } 6265 6266 // Element context 6267 } else { 6268 6269 // Support: IE 9 only 6270 // getElementById can match elements by name instead of ID 6271 if ( newContext && ( elem = newContext.getElementById( m ) ) && 6272 find.contains( context, elem ) && 6273 elem.id === m ) { 6274 6275 push.call( results, elem ); 6276 return results; 6277 } 6278 } 6279 6280 // Type selector 6281 } else if ( match[ 2 ] ) { 6282 push.apply( results, context.getElementsByTagName( selector ) ); 6283 return results; 6284 6285 // Class selector 6286 } else if ( ( m = match[ 3 ] ) && context.getElementsByClassName ) { 6287 push.apply( results, context.getElementsByClassName( m ) ); 6288 return results; 6289 } 6290 } 6291 6292 // Take advantage of querySelectorAll 6293 if ( !nonnativeSelectorCache[ selector + " " ] && 6294 ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) ) { 6295 6296 newSelector = selector; 6297 newContext = context; 6298 6299 // qSA considers elements outside a scoping root when evaluating child or 6300 // descendant combinators, which is not what we want. 6301 // In such cases, we work around the behavior by prefixing every selector in the 6302 // list with an ID selector referencing the scope context. 6303 // The technique has to be used as well when a leading combinator is used 6304 // as such selectors are not recognized by querySelectorAll. 6305 // Thanks to Andrew Dupont for this technique. 6306 if ( nodeType === 1 && 6307 ( rdescend.test( selector ) || rleadingCombinator.test( selector ) ) ) { 6308 6309 // Expand context for sibling selectors 6310 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || 6311 context; 6312 6313 // We can use :scope instead of the ID hack if the browser 6314 // supports it & if we're not changing the context. 6315 // Support: IE 11+, Edge 17 - 18+ 6316 // IE/Edge sometimes throw a "Permission denied" error when 6317 // strict-comparing two documents; shallow comparisons work. 6318 // eslint-disable-next-line eqeqeq 6319 if ( newContext != context || !support.scope ) { 6320 6321 // Capture the context ID, setting it first if necessary 6322 if ( ( nid = context.getAttribute( "id" ) ) ) { 6323 nid = jQuery.escapeSelector( nid ); 6324 } else { 6325 context.setAttribute( "id", ( nid = expando ) ); 6326 } 6327 } 6328 6329 // Prefix every selector in the list 6330 groups = tokenize( selector ); 6331 i = groups.length; 6332 while ( i-- ) { 6333 groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + 6334 toSelector( groups[ i ] ); 6335 } 6336 newSelector = groups.join( "," ); 6337 } 6338 6339 try { 6340 push.apply( results, 6341 newContext.querySelectorAll( newSelector ) 6342 ); 6343 return results; 6344 } catch ( qsaError ) { 6345 nonnativeSelectorCache( selector, true ); 6346 } finally { 6347 if ( nid === expando ) { 6348 context.removeAttribute( "id" ); 6349 } 6350 } 6351 } 6352 } 6353 } 6354 6355 // All others 6356 return select( selector.replace( rtrimCSS, "$1" ), context, results, seed ); 6357} 6358 6359/** 6360 * Create key-value caches of limited size 6361 * @returns {function(string, object)} Returns the Object data after storing it on itself with 6362 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 6363 * deleting the oldest entry 6364 */ 6365function createCache() { 6366 var keys = []; 6367 6368 function cache( key, value ) { 6369 6370 // Use (key + " ") to avoid collision with native prototype properties 6371 // (see https://github.com/jquery/sizzle/issues/157) 6372 if ( keys.push( key + " " ) > Expr.cacheLength ) { 6373 6374 // Only keep the most recent entries 6375 delete cache[ keys.shift() ]; 6376 } 6377 return ( cache[ key + " " ] = value ); 6378 } 6379 return cache; 6380} 6381 6382/** 6383 * Mark a function for special use by jQuery selector module 6384 * @param {Function} fn The function to mark 6385 */ 6386function markFunction( fn ) { 6387 fn[ expando ] = true; 6388 return fn; 6389} 6390 6391/** 6392 * Support testing using an element 6393 * @param {Function} fn Passed the created element and returns a boolean result 6394 */ 6395function assert( fn ) { 6396 var el = document.createElement( "fieldset" ); 6397 6398 try { 6399 return !!fn( el ); 6400 } catch ( e ) { 6401 return false; 6402 } finally { 6403 6404 // Remove from its parent by default 6405 if ( el.parentNode ) { 6406 el.parentNode.removeChild( el ); 6407 } 6408 6409 // release memory in IE 6410 el = null; 6411 } 6412} 6413 6414/** 6415 * Returns a function to use in pseudos for input types 6416 * @param {String} type 6417 */ 6418function createInputPseudo( type ) { 6419 return function( elem ) { 6420 return nodeName( elem, "input" ) && elem.type === type; 6421 }; 6422} 6423 6424/** 6425 * Returns a function to use in pseudos for buttons 6426 * @param {String} type 6427 */ 6428function createButtonPseudo( type ) { 6429 return function( elem ) { 6430 return ( nodeName( elem, "input" ) || nodeName( elem, "button" ) ) && 6431 elem.type === type; 6432 }; 6433} 6434 6435/** 6436 * Returns a function to use in pseudos for :enabled/:disabled 6437 * @param {Boolean} disabled true for :disabled; false for :enabled 6438 */ 6439function createDisabledPseudo( disabled ) { 6440 6441 // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable 6442 return function( elem ) { 6443 6444 // Only certain elements can match :enabled or :disabled 6445 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled 6446 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled 6447 if ( "form" in elem ) { 6448 6449 // Check for inherited disabledness on relevant non-disabled elements: 6450 // * listed form-associated elements in a disabled fieldset 6451 // https://html.spec.whatwg.org/multipage/forms.html#category-listed 6452 // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled 6453 // * option elements in a disabled optgroup 6454 // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled 6455 // All such elements have a "form" property. 6456 if ( elem.parentNode && elem.disabled === false ) { 6457 6458 // Option elements defer to a parent optgroup if present 6459 if ( "label" in elem ) { 6460 if ( "label" in elem.parentNode ) { 6461 return elem.parentNode.disabled === disabled; 6462 } else { 6463 return elem.disabled === disabled; 6464 } 6465 } 6466 6467 // Support: IE 6 - 11+ 6468 // Use the isDisabled shortcut property to check for disabled fieldset ancestors 6469 return elem.isDisabled === disabled || 6470 6471 // Where there is no isDisabled, check manually 6472 elem.isDisabled !== !disabled && 6473 inDisabledFieldset( elem ) === disabled; 6474 } 6475 6476 return elem.disabled === disabled; 6477 6478 // Try to winnow out elements that can't be disabled before trusting the disabled property. 6479 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't 6480 // even exist on them, let alone have a boolean value. 6481 } else if ( "label" in elem ) { 6482 return elem.disabled === disabled; 6483 } 6484 6485 // Remaining elements are neither :enabled nor :disabled 6486 return false; 6487 }; 6488} 6489 6490/** 6491 * Returns a function to use in pseudos for positionals 6492 * @param {Function} fn 6493 */ 6494function createPositionalPseudo( fn ) { 6495 return markFunction( function( argument ) { 6496 argument = +argument; 6497 return markFunction( function( seed, matches ) { 6498 var j, 6499 matchIndexes = fn( [], seed.length, argument ), 6500 i = matchIndexes.length; 6501 6502 // Match elements found at the specified indexes 6503 while ( i-- ) { 6504 if ( seed[ ( j = matchIndexes[ i ] ) ] ) { 6505 seed[ j ] = !( matches[ j ] = seed[ j ] ); 6506 } 6507 } 6508 } ); 6509 } ); 6510} 6511 6512/** 6513 * Checks a node for validity as a jQuery selector context 6514 * @param {Element|Object=} context 6515 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value 6516 */ 6517function testContext( context ) { 6518 return context && typeof context.getElementsByTagName !== "undefined" && context; 6519} 6520 6521/** 6522 * Sets document-related variables once based on the current document 6523 * @param {Element|Object} [node] An element or document object to use to set the document 6524 * @returns {Object} Returns the current document 6525 */ 6526function setDocument( node ) { 6527 var subWindow, 6528 doc = node ? node.ownerDocument || node : preferredDoc; 6529 6530 // Return early if doc is invalid or already selected 6531 // Support: IE 11+, Edge 17 - 18+ 6532 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6533 // two documents; shallow comparisons work. 6534 // eslint-disable-next-line eqeqeq 6535 if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { 6536 return document; 6537 } 6538 6539 // Update global variables 6540 document = doc; 6541 documentElement = document.documentElement; 6542 documentIsHTML = !jQuery.isXMLDoc( document ); 6543 6544 // Support: iOS 7 only, IE 9 - 11+ 6545 // Older browsers didn't support unprefixed `matches`. 6546 matches = documentElement.matches || 6547 documentElement.webkitMatchesSelector || 6548 documentElement.msMatchesSelector; 6549 6550 // Support: IE 9 - 11+, Edge 12 - 18+ 6551 // Accessing iframe documents after unload throws "permission denied" errors 6552 // (see trac-13936). 6553 // Limit the fix to IE & Edge Legacy; despite Edge 15+ implementing `matches`, 6554 // all IE 9+ and Edge Legacy versions implement `msMatchesSelector` as well. 6555 if ( documentElement.msMatchesSelector && 6556 6557 // Support: IE 11+, Edge 17 - 18+ 6558 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6559 // two documents; shallow comparisons work. 6560 // eslint-disable-next-line eqeqeq 6561 preferredDoc != document && 6562 ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { 6563 6564 // Support: IE 9 - 11+, Edge 12 - 18+ 6565 subWindow.addEventListener( "unload", unloadHandler ); 6566 } 6567 6568 // Support: IE <10 6569 // Check if getElementById returns elements by name 6570 // The broken getElementById methods don't pick up programmatically-set names, 6571 // so use a roundabout getElementsByName test 6572 support.getById = assert( function( el ) { 6573 documentElement.appendChild( el ).id = jQuery.expando; 6574 return !document.getElementsByName || 6575 !document.getElementsByName( jQuery.expando ).length; 6576 } ); 6577 6578 // Support: IE 9 only 6579 // Check to see if it's possible to do matchesSelector 6580 // on a disconnected node. 6581 support.disconnectedMatch = assert( function( el ) { 6582 return matches.call( el, "*" ); 6583 } ); 6584 6585 // Support: IE 9 - 11+, Edge 12 - 18+ 6586 // IE/Edge don't support the :scope pseudo-class. 6587 support.scope = assert( function() { 6588 return document.querySelectorAll( ":scope" ); 6589 } ); 6590 6591 // Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only 6592 // Make sure the `:has()` argument is parsed unforgivingly. 6593 // We include `*` in the test to detect buggy implementations that are 6594 // _selectively_ forgiving (specifically when the list includes at least 6595 // one valid selector). 6596 // Note that we treat complete lack of support for `:has()` as if it were 6597 // spec-compliant support, which is fine because use of `:has()` in such 6598 // environments will fail in the qSA path and fall back to jQuery traversal 6599 // anyway. 6600 support.cssHas = assert( function() { 6601 try { 6602 document.querySelector( ":has(*,:jqfake)" ); 6603 return false; 6604 } catch ( e ) { 6605 return true; 6606 } 6607 } ); 6608 6609 // ID filter and find 6610 if ( support.getById ) { 6611 Expr.filter.ID = function( id ) { 6612 var attrId = id.replace( runescape, funescape ); 6613 return function( elem ) { 6614 return elem.getAttribute( "id" ) === attrId; 6615 }; 6616 }; 6617 Expr.find.ID = function( id, context ) { 6618 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 6619 var elem = context.getElementById( id ); 6620 return elem ? [ elem ] : []; 6621 } 6622 }; 6623 } else { 6624 Expr.filter.ID = function( id ) { 6625 var attrId = id.replace( runescape, funescape ); 6626 return function( elem ) { 6627 var node = typeof elem.getAttributeNode !== "undefined" && 6628 elem.getAttributeNode( "id" ); 6629 return node && node.value === attrId; 6630 }; 6631 }; 6632 6633 // Support: IE 6 - 7 only 6634 // getElementById is not reliable as a find shortcut 6635 Expr.find.ID = function( id, context ) { 6636 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 6637 var node, i, elems, 6638 elem = context.getElementById( id ); 6639 6640 if ( elem ) { 6641 6642 // Verify the id attribute 6643 node = elem.getAttributeNode( "id" ); 6644 if ( node && node.value === id ) { 6645 return [ elem ]; 6646 } 6647 6648 // Fall back on getElementsByName 6649 elems = context.getElementsByName( id ); 6650 i = 0; 6651 while ( ( elem = elems[ i++ ] ) ) { 6652 node = elem.getAttributeNode( "id" ); 6653 if ( node && node.value === id ) { 6654 return [ elem ]; 6655 } 6656 } 6657 } 6658 6659 return []; 6660 } 6661 }; 6662 } 6663 6664 // Tag 6665 Expr.find.TAG = function( tag, context ) { 6666 if ( typeof context.getElementsByTagName !== "undefined" ) { 6667 return context.getElementsByTagName( tag ); 6668 6669 // DocumentFragment nodes don't have gEBTN 6670 } else { 6671 return context.querySelectorAll( tag ); 6672 } 6673 }; 6674 6675 // Class 6676 Expr.find.CLASS = function( className, context ) { 6677 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { 6678 return context.getElementsByClassName( className ); 6679 } 6680 }; 6681 6682 /* QSA/matchesSelector 6683 ---------------------------------------------------------------------- */ 6684 6685 // QSA and matchesSelector support 6686 6687 rbuggyQSA = []; 6688 6689 // Build QSA regex 6690 // Regex strategy adopted from Diego Perini 6691 assert( function( el ) { 6692 6693 var input; 6694 6695 documentElement.appendChild( el ).innerHTML = 6696 "<a id='" + expando + "' href='' disabled='disabled'></a>" + 6697 "<select id='" + expando + "-\r\\' disabled='disabled'>" + 6698 "<option selected=''></option></select>"; 6699 6700 // Support: iOS <=7 - 8 only 6701 // Boolean attributes and "value" are not treated correctly in some XML documents 6702 if ( !el.querySelectorAll( "[selected]" ).length ) { 6703 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); 6704 } 6705 6706 // Support: iOS <=7 - 8 only 6707 if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { 6708 rbuggyQSA.push( "~=" ); 6709 } 6710 6711 // Support: iOS 8 only 6712 // https://bugs.webkit.org/show_bug.cgi?id=136851 6713 // In-page `selector#id sibling-combinator selector` fails 6714 if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { 6715 rbuggyQSA.push( ".#.+[+~]" ); 6716 } 6717 6718 // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+ 6719 // In some of the document kinds, these selectors wouldn't work natively. 6720 // This is probably OK but for backwards compatibility we want to maintain 6721 // handling them through jQuery traversal in jQuery 3.x. 6722 if ( !el.querySelectorAll( ":checked" ).length ) { 6723 rbuggyQSA.push( ":checked" ); 6724 } 6725 6726 // Support: Windows 8 Native Apps 6727 // The type and name attributes are restricted during .innerHTML assignment 6728 input = document.createElement( "input" ); 6729 input.setAttribute( "type", "hidden" ); 6730 el.appendChild( input ).setAttribute( "name", "D" ); 6731 6732 // Support: IE 9 - 11+ 6733 // IE's :disabled selector does not pick up the children of disabled fieldsets 6734 // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+ 6735 // In some of the document kinds, these selectors wouldn't work natively. 6736 // This is probably OK but for backwards compatibility we want to maintain 6737 // handling them through jQuery traversal in jQuery 3.x. 6738 documentElement.appendChild( el ).disabled = true; 6739 if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { 6740 rbuggyQSA.push( ":enabled", ":disabled" ); 6741 } 6742 6743 // Support: IE 11+, Edge 15 - 18+ 6744 // IE 11/Edge don't find elements on a `[name='']` query in some cases. 6745 // Adding a temporary attribute to the document before the selection works 6746 // around the issue. 6747 // Interestingly, IE 10 & older don't seem to have the issue. 6748 input = document.createElement( "input" ); 6749 input.setAttribute( "name", "" ); 6750 el.appendChild( input ); 6751 if ( !el.querySelectorAll( "[name='']" ).length ) { 6752 rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + 6753 whitespace + "*(?:''|\"\")" ); 6754 } 6755 } ); 6756 6757 if ( !support.cssHas ) { 6758 6759 // Support: Chrome 105 - 110+, Safari 15.4 - 16.3+ 6760 // Our regular `try-catch` mechanism fails to detect natively-unsupported 6761 // pseudo-classes inside `:has()` (such as `:has(:contains("Foo"))`) 6762 // in browsers that parse the `:has()` argument as a forgiving selector list. 6763 // https://drafts.csswg.org/selectors/#relational now requires the argument 6764 // to be parsed unforgivingly, but browsers have not yet fully adjusted. 6765 rbuggyQSA.push( ":has" ); 6766 } 6767 6768 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); 6769 6770 /* Sorting 6771 ---------------------------------------------------------------------- */ 6772 6773 // Document order sorting 6774 sortOrder = function( a, b ) { 6775 6776 // Flag for duplicate removal 6777 if ( a === b ) { 6778 hasDuplicate = true; 6779 return 0; 6780 } 6781 6782 // Sort on method existence if only one input has compareDocumentPosition 6783 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 6784 if ( compare ) { 6785 return compare; 6786 } 6787 6788 // Calculate position if both inputs belong to the same document 6789 // Support: IE 11+, Edge 17 - 18+ 6790 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6791 // two documents; shallow comparisons work. 6792 // eslint-disable-next-line eqeqeq 6793 compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? 6794 a.compareDocumentPosition( b ) : 6795 6796 // Otherwise we know they are disconnected 6797 1; 6798 6799 // Disconnected nodes 6800 if ( compare & 1 || 6801 ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { 6802 6803 // Choose the first element that is related to our preferred document 6804 // Support: IE 11+, Edge 17 - 18+ 6805 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6806 // two documents; shallow comparisons work. 6807 // eslint-disable-next-line eqeqeq 6808 if ( a === document || a.ownerDocument == preferredDoc && 6809 find.contains( preferredDoc, a ) ) { 6810 return -1; 6811 } 6812 6813 // Support: IE 11+, Edge 17 - 18+ 6814 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6815 // two documents; shallow comparisons work. 6816 // eslint-disable-next-line eqeqeq 6817 if ( b === document || b.ownerDocument == preferredDoc && 6818 find.contains( preferredDoc, b ) ) { 6819 return 1; 6820 } 6821 6822 // Maintain original order 6823 return sortInput ? 6824 ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 6825 0; 6826 } 6827 6828 return compare & 4 ? -1 : 1; 6829 }; 6830 6831 return document; 6832} 6833 6834find.matches = function( expr, elements ) { 6835 return find( expr, null, null, elements ); 6836}; 6837 6838find.matchesSelector = function( elem, expr ) { 6839 setDocument( elem ); 6840 6841 if ( documentIsHTML && 6842 !nonnativeSelectorCache[ expr + " " ] && 6843 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { 6844 6845 try { 6846 var ret = matches.call( elem, expr ); 6847 6848 // IE 9's matchesSelector returns false on disconnected nodes 6849 if ( ret || support.disconnectedMatch || 6850 6851 // As well, disconnected nodes are said to be in a document 6852 // fragment in IE 9 6853 elem.document && elem.document.nodeType !== 11 ) { 6854 return ret; 6855 } 6856 } catch ( e ) { 6857 nonnativeSelectorCache( expr, true ); 6858 } 6859 } 6860 6861 return find( expr, document, null, [ elem ] ).length > 0; 6862}; 6863 6864find.contains = function( context, elem ) { 6865 6866 // Set document vars if needed 6867 // Support: IE 11+, Edge 17 - 18+ 6868 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6869 // two documents; shallow comparisons work. 6870 // eslint-disable-next-line eqeqeq 6871 if ( ( context.ownerDocument || context ) != document ) { 6872 setDocument( context ); 6873 } 6874 return jQuery.contains( context, elem ); 6875}; 6876 6877 6878find.attr = function( elem, name ) { 6879 6880 // Set document vars if needed 6881 // Support: IE 11+, Edge 17 - 18+ 6882 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 6883 // two documents; shallow comparisons work. 6884 // eslint-disable-next-line eqeqeq 6885 if ( ( elem.ownerDocument || elem ) != document ) { 6886 setDocument( elem ); 6887 } 6888 6889 var fn = Expr.attrHandle[ name.toLowerCase() ], 6890 6891 // Don't get fooled by Object.prototype properties (see trac-13807) 6892 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? 6893 fn( elem, name, !documentIsHTML ) : 6894 undefined; 6895 6896 if ( val !== undefined ) { 6897 return val; 6898 } 6899 6900 return elem.getAttribute( name ); 6901}; 6902 6903find.error = function( msg ) { 6904 throw new Error( "Syntax error, unrecognized expression: " + msg ); 6905}; 6906 6907/** 6908 * Document sorting and removing duplicates 6909 * @param {ArrayLike} results 6910 */ 6911jQuery.uniqueSort = function( results ) { 6912 var elem, 6913 duplicates = [], 6914 j = 0, 6915 i = 0; 6916 6917 // Unless we *know* we can detect duplicates, assume their presence 6918 // 6919 // Support: Android <=4.0+ 6920 // Testing for detecting duplicates is unpredictable so instead assume we can't 6921 // depend on duplicate detection in all browsers without a stable sort. 6922 hasDuplicate = !support.sortStable; 6923 sortInput = !support.sortStable && slice.call( results, 0 ); 6924 sort.call( results, sortOrder ); 6925 6926 if ( hasDuplicate ) { 6927 while ( ( elem = results[ i++ ] ) ) { 6928 if ( elem === results[ i ] ) { 6929 j = duplicates.push( i ); 6930 } 6931 } 6932 while ( j-- ) { 6933 splice.call( results, duplicates[ j ], 1 ); 6934 } 6935 } 6936 6937 // Clear input after sorting to release objects 6938 // See https://github.com/jquery/sizzle/pull/225 6939 sortInput = null; 6940 6941 return results; 6942}; 6943 6944jQuery.fn.uniqueSort = function() { 6945 return this.pushStack( jQuery.uniqueSort( slice.apply( this ) ) ); 6946}; 6947 6948Expr = jQuery.expr = { 6949 6950 // Can be adjusted by the user 6951 cacheLength: 50, 6952 6953 createPseudo: markFunction, 6954 6955 match: matchExpr, 6956 6957 attrHandle: {}, 6958 6959 find: {}, 6960 6961 relative: { 6962 ">": { dir: "parentNode", first: true }, 6963 " ": { dir: "parentNode" }, 6964 "+": { dir: "previousSibling", first: true }, 6965 "~": { dir: "previousSibling" } 6966 }, 6967 6968 preFilter: { 6969 ATTR: function( match ) { 6970 match[ 1 ] = match[ 1 ].replace( runescape, funescape ); 6971 6972 // Move the given value to match[3] whether quoted or unquoted 6973 match[ 3 ] = ( match[ 3 ] || match[ 4 ] || match[ 5 ] || "" ) 6974 .replace( runescape, funescape ); 6975 6976 if ( match[ 2 ] === "~=" ) { 6977 match[ 3 ] = " " + match[ 3 ] + " "; 6978 } 6979 6980 return match.slice( 0, 4 ); 6981 }, 6982 6983 CHILD: function( match ) { 6984 6985 /* matches from matchExpr["CHILD"] 6986 1 type (only|nth|...) 6987 2 what (child|of-type) 6988 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 6989 4 xn-component of xn+y argument ([+-]?\d*n|) 6990 5 sign of xn-component 6991 6 x of xn-component 6992 7 sign of y-component 6993 8 y of y-component 6994 */ 6995 match[ 1 ] = match[ 1 ].toLowerCase(); 6996 6997 if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { 6998 6999 // nth-* requires argument 7000 if ( !match[ 3 ] ) { 7001 find.error( match[ 0 ] ); 7002 } 7003 7004 // numeric x and y parameters for Expr.filter.CHILD 7005 // remember that false/true cast respectively to 0/1 7006 match[ 4 ] = +( match[ 4 ] ? 7007 match[ 5 ] + ( match[ 6 ] || 1 ) : 7008 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) 7009 ); 7010 match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); 7011 7012 // other types prohibit arguments 7013 } else if ( match[ 3 ] ) { 7014 find.error( match[ 0 ] ); 7015 } 7016 7017 return match; 7018 }, 7019 7020 PSEUDO: function( match ) { 7021 var excess, 7022 unquoted = !match[ 6 ] && match[ 2 ]; 7023 7024 if ( matchExpr.CHILD.test( match[ 0 ] ) ) { 7025 return null; 7026 } 7027 7028 // Accept quoted arguments as-is 7029 if ( match[ 3 ] ) { 7030 match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; 7031 7032 // Strip excess characters from unquoted arguments 7033 } else if ( unquoted && rpseudo.test( unquoted ) && 7034 7035 // Get excess from tokenize (recursively) 7036 ( excess = tokenize( unquoted, true ) ) && 7037 7038 // advance to the next closing parenthesis 7039 ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { 7040 7041 // excess is a negative index 7042 match[ 0 ] = match[ 0 ].slice( 0, excess ); 7043 match[ 2 ] = unquoted.slice( 0, excess ); 7044 } 7045 7046 // Return only captures needed by the pseudo filter method (type and argument) 7047 return match.slice( 0, 3 ); 7048 } 7049 }, 7050 7051 filter: { 7052 7053 TAG: function( nodeNameSelector ) { 7054 var expectedNodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); 7055 return nodeNameSelector === "*" ? 7056 function() { 7057 return true; 7058 } : 7059 function( elem ) { 7060 return nodeName( elem, expectedNodeName ); 7061 }; 7062 }, 7063 7064 CLASS: function( className ) { 7065 var pattern = classCache[ className + " " ]; 7066 7067 return pattern || 7068 ( pattern = new RegExp( "(^|" + whitespace + ")" + className + 7069 "(" + whitespace + "|$)" ) ) && 7070 classCache( className, function( elem ) { 7071 return pattern.test( 7072 typeof elem.className === "string" && elem.className || 7073 typeof elem.getAttribute !== "undefined" && 7074 elem.getAttribute( "class" ) || 7075 "" 7076 ); 7077 } ); 7078 }, 7079 7080 ATTR: function( name, operator, check ) { 7081 return function( elem ) { 7082 var result = find.attr( elem, name ); 7083 7084 if ( result == null ) { 7085 return operator === "!="; 7086 } 7087 if ( !operator ) { 7088 return true; 7089 } 7090 7091 result += ""; 7092 7093 if ( operator === "=" ) { 7094 return result === check; 7095 } 7096 if ( operator === "!=" ) { 7097 return result !== check; 7098 } 7099 if ( operator === "^=" ) { 7100 return check && result.indexOf( check ) === 0; 7101 } 7102 if ( operator === "*=" ) { 7103 return check && result.indexOf( check ) > -1; 7104 } 7105 if ( operator === "$=" ) { 7106 return check && result.slice( -check.length ) === check; 7107 } 7108 if ( operator === "~=" ) { 7109 return ( " " + result.replace( rwhitespace, " " ) + " " ) 7110 .indexOf( check ) > -1; 7111 } 7112 if ( operator === "|=" ) { 7113 return result === check || result.slice( 0, check.length + 1 ) === check + "-"; 7114 } 7115 7116 return false; 7117 }; 7118 }, 7119 7120 CHILD: function( type, what, _argument, first, last ) { 7121 var simple = type.slice( 0, 3 ) !== "nth", 7122 forward = type.slice( -4 ) !== "last", 7123 ofType = what === "of-type"; 7124 7125 return first === 1 && last === 0 ? 7126 7127 // Shortcut for :nth-*(n) 7128 function( elem ) { 7129 return !!elem.parentNode; 7130 } : 7131 7132 function( elem, _context, xml ) { 7133 var cache, outerCache, node, nodeIndex, start, 7134 dir = simple !== forward ? "nextSibling" : "previousSibling", 7135 parent = elem.parentNode, 7136 name = ofType && elem.nodeName.toLowerCase(), 7137 useCache = !xml && !ofType, 7138 diff = false; 7139 7140 if ( parent ) { 7141 7142 // :(first|last|only)-(child|of-type) 7143 if ( simple ) { 7144 while ( dir ) { 7145 node = elem; 7146 while ( ( node = node[ dir ] ) ) { 7147 if ( ofType ? 7148 nodeName( node, name ) : 7149 node.nodeType === 1 ) { 7150 7151 return false; 7152 } 7153 } 7154 7155 // Reverse direction for :only-* (if we haven't yet done so) 7156 start = dir = type === "only" && !start && "nextSibling"; 7157 } 7158 return true; 7159 } 7160 7161 start = [ forward ? parent.firstChild : parent.lastChild ]; 7162 7163 // non-xml :nth-child(...) stores cache data on `parent` 7164 if ( forward && useCache ) { 7165 7166 // Seek `elem` from a previously-cached index 7167 outerCache = parent[ expando ] || ( parent[ expando ] = {} ); 7168 cache = outerCache[ type ] || []; 7169 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 7170 diff = nodeIndex && cache[ 2 ]; 7171 node = nodeIndex && parent.childNodes[ nodeIndex ]; 7172 7173 while ( ( node = ++nodeIndex && node && node[ dir ] || 7174 7175 // Fallback to seeking `elem` from the start 7176 ( diff = nodeIndex = 0 ) || start.pop() ) ) { 7177 7178 // When found, cache indexes on `parent` and break 7179 if ( node.nodeType === 1 && ++diff && node === elem ) { 7180 outerCache[ type ] = [ dirruns, nodeIndex, diff ]; 7181 break; 7182 } 7183 } 7184 7185 } else { 7186 7187 // Use previously-cached element index if available 7188 if ( useCache ) { 7189 outerCache = elem[ expando ] || ( elem[ expando ] = {} ); 7190 cache = outerCache[ type ] || []; 7191 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 7192 diff = nodeIndex; 7193 } 7194 7195 // xml :nth-child(...) 7196 // or :nth-last-child(...) or :nth(-last)?-of-type(...) 7197 if ( diff === false ) { 7198 7199 // Use the same loop as above to seek `elem` from the start 7200 while ( ( node = ++nodeIndex && node && node[ dir ] || 7201 ( diff = nodeIndex = 0 ) || start.pop() ) ) { 7202 7203 if ( ( ofType ? 7204 nodeName( node, name ) : 7205 node.nodeType === 1 ) && 7206 ++diff ) { 7207 7208 // Cache the index of each encountered element 7209 if ( useCache ) { 7210 outerCache = node[ expando ] || 7211 ( node[ expando ] = {} ); 7212 outerCache[ type ] = [ dirruns, diff ]; 7213 } 7214 7215 if ( node === elem ) { 7216 break; 7217 } 7218 } 7219 } 7220 } 7221 } 7222 7223 // Incorporate the offset, then check against cycle size 7224 diff -= last; 7225 return diff === first || ( diff % first === 0 && diff / first >= 0 ); 7226 } 7227 }; 7228 }, 7229 7230 PSEUDO: function( pseudo, argument ) { 7231 7232 // pseudo-class names are case-insensitive 7233 // https://www.w3.org/TR/selectors/#pseudo-classes 7234 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 7235 // Remember that setFilters inherits from pseudos 7236 var args, 7237 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || 7238 find.error( "unsupported pseudo: " + pseudo ); 7239 7240 // The user may use createPseudo to indicate that 7241 // arguments are needed to create the filter function 7242 // just as jQuery does 7243 if ( fn[ expando ] ) { 7244 return fn( argument ); 7245 } 7246 7247 // But maintain support for old signatures 7248 if ( fn.length > 1 ) { 7249 args = [ pseudo, pseudo, "", argument ]; 7250 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? 7251 markFunction( function( seed, matches ) { 7252 var idx, 7253 matched = fn( seed, argument ), 7254 i = matched.length; 7255 while ( i-- ) { 7256 idx = indexOf.call( seed, matched[ i ] ); 7257 seed[ idx ] = !( matches[ idx ] = matched[ i ] ); 7258 } 7259 } ) : 7260 function( elem ) { 7261 return fn( elem, 0, args ); 7262 }; 7263 } 7264 7265 return fn; 7266 } 7267 }, 7268 7269 pseudos: { 7270 7271 // Potentially complex pseudos 7272 not: markFunction( function( selector ) { 7273 7274 // Trim the selector passed to compile 7275 // to avoid treating leading and trailing 7276 // spaces as combinators 7277 var input = [], 7278 results = [], 7279 matcher = compile( selector.replace( rtrimCSS, "$1" ) ); 7280 7281 return matcher[ expando ] ? 7282 markFunction( function( seed, matches, _context, xml ) { 7283 var elem, 7284 unmatched = matcher( seed, null, xml, [] ), 7285 i = seed.length; 7286 7287 // Match elements unmatched by `matcher` 7288 while ( i-- ) { 7289 if ( ( elem = unmatched[ i ] ) ) { 7290 seed[ i ] = !( matches[ i ] = elem ); 7291 } 7292 } 7293 } ) : 7294 function( elem, _context, xml ) { 7295 input[ 0 ] = elem; 7296 matcher( input, null, xml, results ); 7297 7298 // Don't keep the element 7299 // (see https://github.com/jquery/sizzle/issues/299) 7300 input[ 0 ] = null; 7301 return !results.pop(); 7302 }; 7303 } ), 7304 7305 has: markFunction( function( selector ) { 7306 return function( elem ) { 7307 return find( selector, elem ).length > 0; 7308 }; 7309 } ), 7310 7311 contains: markFunction( function( text ) { 7312 text = text.replace( runescape, funescape ); 7313 return function( elem ) { 7314 return ( elem.textContent || jQuery.text( elem ) ).indexOf( text ) > -1; 7315 }; 7316 } ), 7317 7318 // "Whether an element is represented by a :lang() selector 7319 // is based solely on the element's language value 7320 // being equal to the identifier C, 7321 // or beginning with the identifier C immediately followed by "-". 7322 // The matching of C against the element's language value is performed case-insensitively. 7323 // The identifier C does not have to be a valid language name." 7324 // https://www.w3.org/TR/selectors/#lang-pseudo 7325 lang: markFunction( function( lang ) { 7326 7327 // lang value must be a valid identifier 7328 if ( !ridentifier.test( lang || "" ) ) { 7329 find.error( "unsupported lang: " + lang ); 7330 } 7331 lang = lang.replace( runescape, funescape ).toLowerCase(); 7332 return function( elem ) { 7333 var elemLang; 7334 do { 7335 if ( ( elemLang = documentIsHTML ? 7336 elem.lang : 7337 elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { 7338 7339 elemLang = elemLang.toLowerCase(); 7340 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 7341 } 7342 } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); 7343 return false; 7344 }; 7345 } ), 7346 7347 // Miscellaneous 7348 target: function( elem ) { 7349 var hash = window.location && window.location.hash; 7350 return hash && hash.slice( 1 ) === elem.id; 7351 }, 7352 7353 root: function( elem ) { 7354 return elem === documentElement; 7355 }, 7356 7357 focus: function( elem ) { 7358 return elem === safeActiveElement() && 7359 document.hasFocus() && 7360 !!( elem.type || elem.href || ~elem.tabIndex ); 7361 }, 7362 7363 // Boolean properties 7364 enabled: createDisabledPseudo( false ), 7365 disabled: createDisabledPseudo( true ), 7366 7367 checked: function( elem ) { 7368 7369 // In CSS3, :checked should return both checked and selected elements 7370 // https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 7371 return ( nodeName( elem, "input" ) && !!elem.checked ) || 7372 ( nodeName( elem, "option" ) && !!elem.selected ); 7373 }, 7374 7375 selected: function( elem ) { 7376 7377 // Support: IE <=11+ 7378 // Accessing the selectedIndex property 7379 // forces the browser to treat the default option as 7380 // selected when in an optgroup. 7381 if ( elem.parentNode ) { 7382 // eslint-disable-next-line no-unused-expressions 7383 elem.parentNode.selectedIndex; 7384 } 7385 7386 return elem.selected === true; 7387 }, 7388 7389 // Contents 7390 empty: function( elem ) { 7391 7392 // https://www.w3.org/TR/selectors/#empty-pseudo 7393 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), 7394 // but not by others (comment: 8; processing instruction: 7; etc.) 7395 // nodeType < 6 works because attributes (2) do not appear as children 7396 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 7397 if ( elem.nodeType < 6 ) { 7398 return false; 7399 } 7400 } 7401 return true; 7402 }, 7403 7404 parent: function( elem ) { 7405 return !Expr.pseudos.empty( elem ); 7406 }, 7407 7408 // Element/input types 7409 header: function( elem ) { 7410 return rheader.test( elem.nodeName ); 7411 }, 7412 7413 input: function( elem ) { 7414 return rinputs.test( elem.nodeName ); 7415 }, 7416 7417 button: function( elem ) { 7418 return nodeName( elem, "input" ) && elem.type === "button" || 7419 nodeName( elem, "button" ); 7420 }, 7421 7422 text: function( elem ) { 7423 var attr; 7424 return nodeName( elem, "input" ) && elem.type === "text" && 7425 7426 // Support: IE <10 only 7427 // New HTML5 attribute values (e.g., "search") appear 7428 // with elem.type === "text" 7429 ( ( attr = elem.getAttribute( "type" ) ) == null || 7430 attr.toLowerCase() === "text" ); 7431 }, 7432 7433 // Position-in-collection 7434 first: createPositionalPseudo( function() { 7435 return [ 0 ]; 7436 } ), 7437 7438 last: createPositionalPseudo( function( _matchIndexes, length ) { 7439 return [ length - 1 ]; 7440 } ), 7441 7442 eq: createPositionalPseudo( function( _matchIndexes, length, argument ) { 7443 return [ argument < 0 ? argument + length : argument ]; 7444 } ), 7445 7446 even: createPositionalPseudo( function( matchIndexes, length ) { 7447 var i = 0; 7448 for ( ; i < length; i += 2 ) { 7449 matchIndexes.push( i ); 7450 } 7451 return matchIndexes; 7452 } ), 7453 7454 odd: createPositionalPseudo( function( matchIndexes, length ) { 7455 var i = 1; 7456 for ( ; i < length; i += 2 ) { 7457 matchIndexes.push( i ); 7458 } 7459 return matchIndexes; 7460 } ), 7461 7462 lt: createPositionalPseudo( function( matchIndexes, length, argument ) { 7463 var i; 7464 7465 if ( argument < 0 ) { 7466 i = argument + length; 7467 } else if ( argument > length ) { 7468 i = length; 7469 } else { 7470 i = argument; 7471 } 7472 7473 for ( ; --i >= 0; ) { 7474 matchIndexes.push( i ); 7475 } 7476 return matchIndexes; 7477 } ), 7478 7479 gt: createPositionalPseudo( function( matchIndexes, length, argument ) { 7480 var i = argument < 0 ? argument + length : argument; 7481 for ( ; ++i < length; ) { 7482 matchIndexes.push( i ); 7483 } 7484 return matchIndexes; 7485 } ) 7486 } 7487}; 7488 7489Expr.pseudos.nth = Expr.pseudos.eq; 7490 7491// Add button/input type pseudos 7492for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { 7493 Expr.pseudos[ i ] = createInputPseudo( i ); 7494} 7495for ( i in { submit: true, reset: true } ) { 7496 Expr.pseudos[ i ] = createButtonPseudo( i ); 7497} 7498 7499// Easy API for creating new setFilters 7500function setFilters() {} 7501setFilters.prototype = Expr.filters = Expr.pseudos; 7502Expr.setFilters = new setFilters(); 7503 7504function tokenize( selector, parseOnly ) { 7505 var matched, match, tokens, type, 7506 soFar, groups, preFilters, 7507 cached = tokenCache[ selector + " " ]; 7508 7509 if ( cached ) { 7510 return parseOnly ? 0 : cached.slice( 0 ); 7511 } 7512 7513 soFar = selector; 7514 groups = []; 7515 preFilters = Expr.preFilter; 7516 7517 while ( soFar ) { 7518 7519 // Comma and first run 7520 if ( !matched || ( match = rcomma.exec( soFar ) ) ) { 7521 if ( match ) { 7522 7523 // Don't consume trailing commas as valid 7524 soFar = soFar.slice( match[ 0 ].length ) || soFar; 7525 } 7526 groups.push( ( tokens = [] ) ); 7527 } 7528 7529 matched = false; 7530 7531 // Combinators 7532 if ( ( match = rleadingCombinator.exec( soFar ) ) ) { 7533 matched = match.shift(); 7534 tokens.push( { 7535 value: matched, 7536 7537 // Cast descendant combinators to space 7538 type: match[ 0 ].replace( rtrimCSS, " " ) 7539 } ); 7540 soFar = soFar.slice( matched.length ); 7541 } 7542 7543 // Filters 7544 for ( type in Expr.filter ) { 7545 if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || 7546 ( match = preFilters[ type ]( match ) ) ) ) { 7547 matched = match.shift(); 7548 tokens.push( { 7549 value: matched, 7550 type: type, 7551 matches: match 7552 } ); 7553 soFar = soFar.slice( matched.length ); 7554 } 7555 } 7556 7557 if ( !matched ) { 7558 break; 7559 } 7560 } 7561 7562 // Return the length of the invalid excess 7563 // if we're just parsing 7564 // Otherwise, throw an error or return tokens 7565 if ( parseOnly ) { 7566 return soFar.length; 7567 } 7568 7569 return soFar ? 7570 find.error( selector ) : 7571 7572 // Cache the tokens 7573 tokenCache( selector, groups ).slice( 0 ); 7574} 7575 7576function toSelector( tokens ) { 7577 var i = 0, 7578 len = tokens.length, 7579 selector = ""; 7580 for ( ; i < len; i++ ) { 7581 selector += tokens[ i ].value; 7582 } 7583 return selector; 7584} 7585 7586function addCombinator( matcher, combinator, base ) { 7587 var dir = combinator.dir, 7588 skip = combinator.next, 7589 key = skip || dir, 7590 checkNonElements = base && key === "parentNode", 7591 doneName = done++; 7592 7593 return combinator.first ? 7594 7595 // Check against closest ancestor/preceding element 7596 function( elem, context, xml ) { 7597 while ( ( elem = elem[ dir ] ) ) { 7598 if ( elem.nodeType === 1 || checkNonElements ) { 7599 return matcher( elem, context, xml ); 7600 } 7601 } 7602 return false; 7603 } : 7604 7605 // Check against all ancestor/preceding elements 7606 function( elem, context, xml ) { 7607 var oldCache, outerCache, 7608 newCache = [ dirruns, doneName ]; 7609 7610 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching 7611 if ( xml ) { 7612 while ( ( elem = elem[ dir ] ) ) { 7613 if ( elem.nodeType === 1 || checkNonElements ) { 7614 if ( matcher( elem, context, xml ) ) { 7615 return true; 7616 } 7617 } 7618 } 7619 } else { 7620 while ( ( elem = elem[ dir ] ) ) { 7621 if ( elem.nodeType === 1 || checkNonElements ) { 7622 outerCache = elem[ expando ] || ( elem[ expando ] = {} ); 7623 7624 if ( skip && nodeName( elem, skip ) ) { 7625 elem = elem[ dir ] || elem; 7626 } else if ( ( oldCache = outerCache[ key ] ) && 7627 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { 7628 7629 // Assign to newCache so results back-propagate to previous elements 7630 return ( newCache[ 2 ] = oldCache[ 2 ] ); 7631 } else { 7632 7633 // Reuse newcache so results back-propagate to previous elements 7634 outerCache[ key ] = newCache; 7635 7636 // A match means we're done; a fail means we have to keep checking 7637 if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { 7638 return true; 7639 } 7640 } 7641 } 7642 } 7643 } 7644 return false; 7645 }; 7646} 7647 7648function elementMatcher( matchers ) { 7649 return matchers.length > 1 ? 7650 function( elem, context, xml ) { 7651 var i = matchers.length; 7652 while ( i-- ) { 7653 if ( !matchers[ i ]( elem, context, xml ) ) { 7654 return false; 7655 } 7656 } 7657 return true; 7658 } : 7659 matchers[ 0 ]; 7660} 7661 7662function multipleContexts( selector, contexts, results ) { 7663 var i = 0, 7664 len = contexts.length; 7665 for ( ; i < len; i++ ) { 7666 find( selector, contexts[ i ], results ); 7667 } 7668 return results; 7669} 7670 7671function condense( unmatched, map, filter, context, xml ) { 7672 var elem, 7673 newUnmatched = [], 7674 i = 0, 7675 len = unmatched.length, 7676 mapped = map != null; 7677 7678 for ( ; i < len; i++ ) { 7679 if ( ( elem = unmatched[ i ] ) ) { 7680 if ( !filter || filter( elem, context, xml ) ) { 7681 newUnmatched.push( elem ); 7682 if ( mapped ) { 7683 map.push( i ); 7684 } 7685 } 7686 } 7687 } 7688 7689 return newUnmatched; 7690} 7691 7692function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { 7693 if ( postFilter && !postFilter[ expando ] ) { 7694 postFilter = setMatcher( postFilter ); 7695 } 7696 if ( postFinder && !postFinder[ expando ] ) { 7697 postFinder = setMatcher( postFinder, postSelector ); 7698 } 7699 return markFunction( function( seed, results, context, xml ) { 7700 var temp, i, elem, matcherOut, 7701 preMap = [], 7702 postMap = [], 7703 preexisting = results.length, 7704 7705 // Get initial elements from seed or context 7706 elems = seed || 7707 multipleContexts( selector || "*", 7708 context.nodeType ? [ context ] : context, [] ), 7709 7710 // Prefilter to get matcher input, preserving a map for seed-results synchronization 7711 matcherIn = preFilter && ( seed || !selector ) ? 7712 condense( elems, preMap, preFilter, context, xml ) : 7713 elems; 7714 7715 if ( matcher ) { 7716 7717 // If we have a postFinder, or filtered seed, or non-seed postFilter 7718 // or preexisting results, 7719 matcherOut = postFinder || ( seed ? preFilter : preexisting || postFilter ) ? 7720 7721 // ...intermediate processing is necessary 7722 [] : 7723 7724 // ...otherwise use results directly 7725 results; 7726 7727 // Find primary matches 7728 matcher( matcherIn, matcherOut, context, xml ); 7729 } else { 7730 matcherOut = matcherIn; 7731 } 7732 7733 // Apply postFilter 7734 if ( postFilter ) { 7735 temp = condense( matcherOut, postMap ); 7736 postFilter( temp, [], context, xml ); 7737 7738 // Un-match failing elements by moving them back to matcherIn 7739 i = temp.length; 7740 while ( i-- ) { 7741 if ( ( elem = temp[ i ] ) ) { 7742 matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); 7743 } 7744 } 7745 } 7746 7747 if ( seed ) { 7748 if ( postFinder || preFilter ) { 7749 if ( postFinder ) { 7750 7751 // Get the final matcherOut by condensing this intermediate into postFinder contexts 7752 temp = []; 7753 i = matcherOut.length; 7754 while ( i-- ) { 7755 if ( ( elem = matcherOut[ i ] ) ) { 7756 7757 // Restore matcherIn since elem is not yet a final match 7758 temp.push( ( matcherIn[ i ] = elem ) ); 7759 } 7760 } 7761 postFinder( null, ( matcherOut = [] ), temp, xml ); 7762 } 7763 7764 // Move matched elements from seed to results to keep them synchronized 7765 i = matcherOut.length; 7766 while ( i-- ) { 7767 if ( ( elem = matcherOut[ i ] ) && 7768 ( temp = postFinder ? indexOf.call( seed, elem ) : preMap[ i ] ) > -1 ) { 7769 7770 seed[ temp ] = !( results[ temp ] = elem ); 7771 } 7772 } 7773 } 7774 7775 // Add elements to results, through postFinder if defined 7776 } else { 7777 matcherOut = condense( 7778 matcherOut === results ? 7779 matcherOut.splice( preexisting, matcherOut.length ) : 7780 matcherOut 7781 ); 7782 if ( postFinder ) { 7783 postFinder( null, results, matcherOut, xml ); 7784 } else { 7785 push.apply( results, matcherOut ); 7786 } 7787 } 7788 } ); 7789} 7790 7791function matcherFromTokens( tokens ) { 7792 var checkContext, matcher, j, 7793 len = tokens.length, 7794 leadingRelative = Expr.relative[ tokens[ 0 ].type ], 7795 implicitRelative = leadingRelative || Expr.relative[ " " ], 7796 i = leadingRelative ? 1 : 0, 7797 7798 // The foundational matcher ensures that elements are reachable from top-level context(s) 7799 matchContext = addCombinator( function( elem ) { 7800 return elem === checkContext; 7801 }, implicitRelative, true ), 7802 matchAnyContext = addCombinator( function( elem ) { 7803 return indexOf.call( checkContext, elem ) > -1; 7804 }, implicitRelative, true ), 7805 matchers = [ function( elem, context, xml ) { 7806 7807 // Support: IE 11+, Edge 17 - 18+ 7808 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 7809 // two documents; shallow comparisons work. 7810 // eslint-disable-next-line eqeqeq 7811 var ret = ( !leadingRelative && ( xml || context != outermostContext ) ) || ( 7812 ( checkContext = context ).nodeType ? 7813 matchContext( elem, context, xml ) : 7814 matchAnyContext( elem, context, xml ) ); 7815 7816 // Avoid hanging onto element 7817 // (see https://github.com/jquery/sizzle/issues/299) 7818 checkContext = null; 7819 return ret; 7820 } ]; 7821 7822 for ( ; i < len; i++ ) { 7823 if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { 7824 matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; 7825 } else { 7826 matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); 7827 7828 // Return special upon seeing a positional matcher 7829 if ( matcher[ expando ] ) { 7830 7831 // Find the next relative operator (if any) for proper handling 7832 j = ++i; 7833 for ( ; j < len; j++ ) { 7834 if ( Expr.relative[ tokens[ j ].type ] ) { 7835 break; 7836 } 7837 } 7838 return setMatcher( 7839 i > 1 && elementMatcher( matchers ), 7840 i > 1 && toSelector( 7841 7842 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 7843 tokens.slice( 0, i - 1 ) 7844 .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) 7845 ).replace( rtrimCSS, "$1" ), 7846 matcher, 7847 i < j && matcherFromTokens( tokens.slice( i, j ) ), 7848 j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), 7849 j < len && toSelector( tokens ) 7850 ); 7851 } 7852 matchers.push( matcher ); 7853 } 7854 } 7855 7856 return elementMatcher( matchers ); 7857} 7858 7859function matcherFromGroupMatchers( elementMatchers, setMatchers ) { 7860 var bySet = setMatchers.length > 0, 7861 byElement = elementMatchers.length > 0, 7862 superMatcher = function( seed, context, xml, results, outermost ) { 7863 var elem, j, matcher, 7864 matchedCount = 0, 7865 i = "0", 7866 unmatched = seed && [], 7867 setMatched = [], 7868 contextBackup = outermostContext, 7869 7870 // We must always have either seed elements or outermost context 7871 elems = seed || byElement && Expr.find.TAG( "*", outermost ), 7872 7873 // Use integer dirruns iff this is the outermost matcher 7874 dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), 7875 len = elems.length; 7876 7877 if ( outermost ) { 7878 7879 // Support: IE 11+, Edge 17 - 18+ 7880 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 7881 // two documents; shallow comparisons work. 7882 // eslint-disable-next-line eqeqeq 7883 outermostContext = context == document || context || outermost; 7884 } 7885 7886 // Add elements passing elementMatchers directly to results 7887 // Support: iOS <=7 - 9 only 7888 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching 7889 // elements by id. (see trac-14142) 7890 for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { 7891 if ( byElement && elem ) { 7892 j = 0; 7893 7894 // Support: IE 11+, Edge 17 - 18+ 7895 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 7896 // two documents; shallow comparisons work. 7897 // eslint-disable-next-line eqeqeq 7898 if ( !context && elem.ownerDocument != document ) { 7899 setDocument( elem ); 7900 xml = !documentIsHTML; 7901 } 7902 while ( ( matcher = elementMatchers[ j++ ] ) ) { 7903 if ( matcher( elem, context || document, xml ) ) { 7904 push.call( results, elem ); 7905 break; 7906 } 7907 } 7908 if ( outermost ) { 7909 dirruns = dirrunsUnique; 7910 } 7911 } 7912 7913 // Track unmatched elements for set filters 7914 if ( bySet ) { 7915 7916 // They will have gone through all possible matchers 7917 if ( ( elem = !matcher && elem ) ) { 7918 matchedCount--; 7919 } 7920 7921 // Lengthen the array for every element, matched or not 7922 if ( seed ) { 7923 unmatched.push( elem ); 7924 } 7925 } 7926 } 7927 7928 // `i` is now the count of elements visited above, and adding it to `matchedCount` 7929 // makes the latter nonnegative. 7930 matchedCount += i; 7931 7932 // Apply set filters to unmatched elements 7933 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` 7934 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have 7935 // no element matchers and no seed. 7936 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that 7937 // case, which will result in a "00" `matchedCount` that differs from `i` but is also 7938 // numerically zero. 7939 if ( bySet && i !== matchedCount ) { 7940 j = 0; 7941 while ( ( matcher = setMatchers[ j++ ] ) ) { 7942 matcher( unmatched, setMatched, context, xml ); 7943 } 7944 7945 if ( seed ) { 7946 7947 // Reintegrate element matches to eliminate the need for sorting 7948 if ( matchedCount > 0 ) { 7949 while ( i-- ) { 7950 if ( !( unmatched[ i ] || setMatched[ i ] ) ) { 7951 setMatched[ i ] = pop.call( results ); 7952 } 7953 } 7954 } 7955 7956 // Discard index placeholder values to get only actual matches 7957 setMatched = condense( setMatched ); 7958 } 7959 7960 // Add matches to results 7961 push.apply( results, setMatched ); 7962 7963 // Seedless set matches succeeding multiple successful matchers stipulate sorting 7964 if ( outermost && !seed && setMatched.length > 0 && 7965 ( matchedCount + setMatchers.length ) > 1 ) { 7966 7967 jQuery.uniqueSort( results ); 7968 } 7969 } 7970 7971 // Override manipulation of globals by nested matchers 7972 if ( outermost ) { 7973 dirruns = dirrunsUnique; 7974 outermostContext = contextBackup; 7975 } 7976 7977 return unmatched; 7978 }; 7979 7980 return bySet ? 7981 markFunction( superMatcher ) : 7982 superMatcher; 7983} 7984 7985function compile( selector, match /* Internal Use Only */ ) { 7986 var i, 7987 setMatchers = [], 7988 elementMatchers = [], 7989 cached = compilerCache[ selector + " " ]; 7990 7991 if ( !cached ) { 7992 7993 // Generate a function of recursive functions that can be used to check each element 7994 if ( !match ) { 7995 match = tokenize( selector ); 7996 } 7997 i = match.length; 7998 while ( i-- ) { 7999 cached = matcherFromTokens( match[ i ] ); 8000 if ( cached[ expando ] ) { 8001 setMatchers.push( cached ); 8002 } else { 8003 elementMatchers.push( cached ); 8004 } 8005 } 8006 8007 // Cache the compiled function 8008 cached = compilerCache( selector, 8009 matcherFromGroupMatchers( elementMatchers, setMatchers ) ); 8010 8011 // Save selector and tokenization 8012 cached.selector = selector; 8013 } 8014 return cached; 8015} 8016 8017/** 8018 * A low-level selection function that works with jQuery's compiled 8019 * selector functions 8020 * @param {String|Function} selector A selector or a pre-compiled 8021 * selector function built with jQuery selector compile 8022 * @param {Element} context 8023 * @param {Array} [results] 8024 * @param {Array} [seed] A set of elements to match against 8025 */ 8026function select( selector, context, results, seed ) { 8027 var i, tokens, token, type, find, 8028 compiled = typeof selector === "function" && selector, 8029 match = !seed && tokenize( ( selector = compiled.selector || selector ) ); 8030 8031 results = results || []; 8032 8033 // Try to minimize operations if there is only one selector in the list and no seed 8034 // (the latter of which guarantees us context) 8035 if ( match.length === 1 ) { 8036 8037 // Reduce context if the leading compound selector is an ID 8038 tokens = match[ 0 ] = match[ 0 ].slice( 0 ); 8039 if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && 8040 context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { 8041 8042 context = ( Expr.find.ID( 8043 token.matches[ 0 ].replace( runescape, funescape ), 8044 context 8045 ) || [] )[ 0 ]; 8046 if ( !context ) { 8047 return results; 8048 8049 // Precompiled matchers will still verify ancestry, so step up a level 8050 } else if ( compiled ) { 8051 context = context.parentNode; 8052 } 8053 8054 selector = selector.slice( tokens.shift().value.length ); 8055 } 8056 8057 // Fetch a seed set for right-to-left matching 8058 i = matchExpr.needsContext.test( selector ) ? 0 : tokens.length; 8059 while ( i-- ) { 8060 token = tokens[ i ]; 8061 8062 // Abort if we hit a combinator 8063 if ( Expr.relative[ ( type = token.type ) ] ) { 8064 break; 8065 } 8066 if ( ( find = Expr.find[ type ] ) ) { 8067 8068 // Search, expanding context for leading sibling combinators 8069 if ( ( seed = find( 8070 token.matches[ 0 ].replace( runescape, funescape ), 8071 rsibling.test( tokens[ 0 ].type ) && 8072 testContext( context.parentNode ) || context 8073 ) ) ) { 8074 8075 // If seed is empty or no tokens remain, we can return early 8076 tokens.splice( i, 1 ); 8077 selector = seed.length && toSelector( tokens ); 8078 if ( !selector ) { 8079 push.apply( results, seed ); 8080 return results; 8081 } 8082 8083 break; 8084 } 8085 } 8086 } 8087 } 8088 8089 // Compile and execute a filtering function if one is not provided 8090 // Provide `match` to avoid retokenization if we modified the selector above 8091 ( compiled || compile( selector, match ) )( 8092 seed, 8093 context, 8094 !documentIsHTML, 8095 results, 8096 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context 8097 ); 8098 return results; 8099} 8100 8101// One-time assignments 8102 8103// Support: Android <=4.0 - 4.1+ 8104// Sort stability 8105support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; 8106 8107// Initialize against the default document 8108setDocument(); 8109 8110// Support: Android <=4.0 - 4.1+ 8111// Detached nodes confoundingly follow *each other* 8112support.sortDetached = assert( function( el ) { 8113 8114 // Should return 1, but returns 4 (following) 8115 return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; 8116} ); 8117 8118jQuery.find = find; 8119 8120// Deprecated 8121jQuery.expr[ ":" ] = jQuery.expr.pseudos; 8122jQuery.unique = jQuery.uniqueSort; 8123 8124// These have always been private, but they used to be documented as part of 8125// Sizzle so let's maintain them for now for backwards compatibility purposes. 8126find.compile = compile; 8127find.select = select; 8128find.setDocument = setDocument; 8129find.tokenize = tokenize; 8130 8131find.escape = jQuery.escapeSelector; 8132find.getText = jQuery.text; 8133find.isXML = jQuery.isXMLDoc; 8134find.selectors = jQuery.expr; 8135find.support = jQuery.support; 8136find.uniqueSort = jQuery.uniqueSort; 8137 8138 /* eslint-enable */ 8139 8140} )(); 8141 8142 8143var dir = function( elem, dir, until ) { 8144 var matched = [], 8145 truncate = until !== undefined; 8146 8147 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { 8148 if ( elem.nodeType === 1 ) { 8149 if ( truncate && jQuery( elem ).is( until ) ) { 8150 break; 8151 } 8152 matched.push( elem ); 8153 } 8154 } 8155 return matched; 8156}; 8157 8158 8159var siblings = function( n, elem ) { 8160 var matched = []; 8161 8162 for ( ; n; n = n.nextSibling ) { 8163 if ( n.nodeType === 1 && n !== elem ) { 8164 matched.push( n ); 8165 } 8166 } 8167 8168 return matched; 8169}; 8170 8171 8172var rneedsContext = jQuery.expr.match.needsContext; 8173 8174var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); 8175 8176 8177 8178// Implement the identical functionality for filter and not 8179function winnow( elements, qualifier, not ) { 8180 if ( isFunction( qualifier ) ) { 8181 return jQuery.grep( elements, function( elem, i ) { 8182 return !!qualifier.call( elem, i, elem ) !== not; 8183 } ); 8184 } 8185 8186 // Single element 8187 if ( qualifier.nodeType ) { 8188 return jQuery.grep( elements, function( elem ) { 8189 return ( elem === qualifier ) !== not; 8190 } ); 8191 } 8192 8193 // Arraylike of elements (jQuery, arguments, Array) 8194 if ( typeof qualifier !== "string" ) { 8195 return jQuery.grep( elements, function( elem ) { 8196 return ( indexOf.call( qualifier, elem ) > -1 ) !== not; 8197 } ); 8198 } 8199 8200 // Filtered directly for both simple and complex selectors 8201 return jQuery.filter( qualifier, elements, not ); 8202} 8203 8204jQuery.filter = function( expr, elems, not ) { 8205 var elem = elems[ 0 ]; 8206 8207 if ( not ) { 8208 expr = ":not(" + expr + ")"; 8209 } 8210 8211 if ( elems.length === 1 && elem.nodeType === 1 ) { 8212 return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; 8213 } 8214 8215 return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { 8216 return elem.nodeType === 1; 8217 } ) ); 8218}; 8219 8220jQuery.fn.extend( { 8221 find: function( selector ) { 8222 var i, ret, 8223 len = this.length, 8224 self = this; 8225 8226 if ( typeof selector !== "string" ) { 8227 return this.pushStack( jQuery( selector ).filter( function() { 8228 for ( i = 0; i < len; i++ ) { 8229 if ( jQuery.contains( self[ i ], this ) ) { 8230 return true; 8231 } 8232 } 8233 } ) ); 8234 } 8235 8236 ret = this.pushStack( [] ); 8237 8238 for ( i = 0; i < len; i++ ) { 8239 jQuery.find( selector, self[ i ], ret ); 8240 } 8241 8242 return len > 1 ? jQuery.uniqueSort( ret ) : ret; 8243 }, 8244 filter: function( selector ) { 8245 return this.pushStack( winnow( this, selector || [], false ) ); 8246 }, 8247 not: function( selector ) { 8248 return this.pushStack( winnow( this, selector || [], true ) ); 8249 }, 8250 is: function( selector ) { 8251 return !!winnow( 8252 this, 8253 8254 // If this is a positional/relative selector, check membership in the returned set 8255 // so $("p:first").is("p:last") won't return true for a doc with two "p". 8256 typeof selector === "string" && rneedsContext.test( selector ) ? 8257 jQuery( selector ) : 8258 selector || [], 8259 false 8260 ).length; 8261 } 8262} ); 8263 8264 8265// Initialize a jQuery object 8266 8267 8268// A central reference to the root jQuery(document) 8269var rootjQuery, 8270 8271 // A simple way to check for HTML strings 8272 // Prioritize #id over <tag> to avoid XSS via location.hash (trac-9521) 8273 // Strict HTML recognition (trac-11290: must start with <) 8274 // Shortcut simple #id case for speed 8275 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, 8276 8277 init = jQuery.fn.init = function( selector, context, root ) { 8278 var match, elem; 8279 8280 // HANDLE: $(""), $(null), $(undefined), $(false) 8281 if ( !selector ) { 8282 return this; 8283 } 8284 8285 // Method init() accepts an alternate rootjQuery 8286 // so migrate can support jQuery.sub (gh-2101) 8287 root = root || rootjQuery; 8288 8289 // Handle HTML strings 8290 if ( typeof selector === "string" ) { 8291 if ( selector[ 0 ] === "<" && 8292 selector[ selector.length - 1 ] === ">" && 8293 selector.length >= 3 ) { 8294 8295 // Assume that strings that start and end with <> are HTML and skip the regex check 8296 match = [ null, selector, null ]; 8297 8298 } else { 8299 match = rquickExpr.exec( selector ); 8300 } 8301 8302 // Match html or make sure no context is specified for #id 8303 if ( match && ( match[ 1 ] || !context ) ) { 8304 8305 // HANDLE: $(html) -> $(array) 8306 if ( match[ 1 ] ) { 8307 context = context instanceof jQuery ? context[ 0 ] : context; 8308 8309 // Option to run scripts is true for back-compat 8310 // Intentionally let the error be thrown if parseHTML is not present 8311 jQuery.merge( this, jQuery.parseHTML( 8312 match[ 1 ], 8313 context && context.nodeType ? context.ownerDocument || context : document, 8314 true 8315 ) ); 8316 8317 // HANDLE: $(html, props) 8318 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { 8319 for ( match in context ) { 8320 8321 // Properties of context are called as methods if possible 8322 if ( isFunction( this[ match ] ) ) { 8323 this[ match ]( context[ match ] ); 8324 8325 // ...and otherwise set as attributes 8326 } else { 8327 this.attr( match, context[ match ] ); 8328 } 8329 } 8330 } 8331 8332 return this; 8333 8334 // HANDLE: $(#id) 8335 } else { 8336 elem = document.getElementById( match[ 2 ] ); 8337 8338 if ( elem ) { 8339 8340 // Inject the element directly into the jQuery object 8341 this[ 0 ] = elem; 8342 this.length = 1; 8343 } 8344 return this; 8345 } 8346 8347 // HANDLE: $(expr, $(...)) 8348 } else if ( !context || context.jquery ) { 8349 return ( context || root ).find( selector ); 8350 8351 // HANDLE: $(expr, context) 8352 // (which is just equivalent to: $(context).find(expr) 8353 } else { 8354 return this.constructor( context ).find( selector ); 8355 } 8356 8357 // HANDLE: $(DOMElement) 8358 } else if ( selector.nodeType ) { 8359 this[ 0 ] = selector; 8360 this.length = 1; 8361 return this; 8362 8363 // HANDLE: $(function) 8364 // Shortcut for document ready 8365 } else if ( isFunction( selector ) ) { 8366 return root.ready !== undefined ? 8367 root.ready( selector ) : 8368 8369 // Execute immediately if ready is not present 8370 selector( jQuery ); 8371 } 8372 8373 return jQuery.makeArray( selector, this ); 8374 }; 8375 8376// Give the init function the jQuery prototype for later instantiation 8377init.prototype = jQuery.fn; 8378 8379// Initialize central reference 8380rootjQuery = jQuery( document ); 8381 8382 8383var rparentsprev = /^(?:parents|prev(?:Until|All))/, 8384 8385 // Methods guaranteed to produce a unique set when starting from a unique set 8386 guaranteedUnique = { 8387 children: true, 8388 contents: true, 8389 next: true, 8390 prev: true 8391 }; 8392 8393jQuery.fn.extend( { 8394 has: function( target ) { 8395 var targets = jQuery( target, this ), 8396 l = targets.length; 8397 8398 return this.filter( function() { 8399 var i = 0; 8400 for ( ; i < l; i++ ) { 8401 if ( jQuery.contains( this, targets[ i ] ) ) { 8402 return true; 8403 } 8404 } 8405 } ); 8406 }, 8407 8408 closest: function( selectors, context ) { 8409 var cur, 8410 i = 0, 8411 l = this.length, 8412 matched = [], 8413 targets = typeof selectors !== "string" && jQuery( selectors ); 8414 8415 // Positional selectors never match, since there's no _selection_ context 8416 if ( !rneedsContext.test( selectors ) ) { 8417 for ( ; i < l; i++ ) { 8418 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { 8419 8420 // Always skip document fragments 8421 if ( cur.nodeType < 11 && ( targets ? 8422 targets.index( cur ) > -1 : 8423 8424 // Don't pass non-elements to jQuery#find 8425 cur.nodeType === 1 && 8426 jQuery.find.matchesSelector( cur, selectors ) ) ) { 8427 8428 matched.push( cur ); 8429 break; 8430 } 8431 } 8432 } 8433 } 8434 8435 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); 8436 }, 8437 8438 // Determine the position of an element within the set 8439 index: function( elem ) { 8440 8441 // No argument, return index in parent 8442 if ( !elem ) { 8443 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; 8444 } 8445 8446 // Index in selector 8447 if ( typeof elem === "string" ) { 8448 return indexOf.call( jQuery( elem ), this[ 0 ] ); 8449 } 8450 8451 // Locate the position of the desired element 8452 return indexOf.call( this, 8453 8454 // If it receives a jQuery object, the first element is used 8455 elem.jquery ? elem[ 0 ] : elem 8456 ); 8457 }, 8458 8459 add: function( selector, context ) { 8460 return this.pushStack( 8461 jQuery.uniqueSort( 8462 jQuery.merge( this.get(), jQuery( selector, context ) ) 8463 ) 8464 ); 8465 }, 8466 8467 addBack: function( selector ) { 8468 return this.add( selector == null ? 8469 this.prevObject : this.prevObject.filter( selector ) 8470 ); 8471 } 8472} ); 8473 8474function sibling( cur, dir ) { 8475 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} 8476 return cur; 8477} 8478 8479jQuery.each( { 8480 parent: function( elem ) { 8481 var parent = elem.parentNode; 8482 return parent && parent.nodeType !== 11 ? parent : null; 8483 }, 8484 parents: function( elem ) { 8485 return dir( elem, "parentNode" ); 8486 }, 8487 parentsUntil: function( elem, _i, until ) { 8488 return dir( elem, "parentNode", until ); 8489 }, 8490 next: function( elem ) { 8491 return sibling( elem, "nextSibling" ); 8492 }, 8493 prev: function( elem ) { 8494 return sibling( elem, "previousSibling" ); 8495 }, 8496 nextAll: function( elem ) { 8497 return dir( elem, "nextSibling" ); 8498 }, 8499 prevAll: function( elem ) { 8500 return dir( elem, "previousSibling" ); 8501 }, 8502 nextUntil: function( elem, _i, until ) { 8503 return dir( elem, "nextSibling", until ); 8504 }, 8505 prevUntil: function( elem, _i, until ) { 8506 return dir( elem, "previousSibling", until ); 8507 }, 8508 siblings: function( elem ) { 8509 return siblings( ( elem.parentNode || {} ).firstChild, elem ); 8510 }, 8511 children: function( elem ) { 8512 return siblings( elem.firstChild ); 8513 }, 8514 contents: function( elem ) { 8515 if ( elem.contentDocument != null && 8516 8517 // Support: IE 11+ 8518 // <object> elements with no `data` attribute has an object 8519 // `contentDocument` with a `null` prototype. 8520 getProto( elem.contentDocument ) ) { 8521 8522 return elem.contentDocument; 8523 } 8524 8525 // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only 8526 // Treat the template element as a regular one in browsers that 8527 // don't support it. 8528 if ( nodeName( elem, "template" ) ) { 8529 elem = elem.content || elem; 8530 } 8531 8532 return jQuery.merge( [], elem.childNodes ); 8533 } 8534}, function( name, fn ) { 8535 jQuery.fn[ name ] = function( until, selector ) { 8536 var matched = jQuery.map( this, fn, until ); 8537 8538 if ( name.slice( -5 ) !== "Until" ) { 8539 selector = until; 8540 } 8541 8542 if ( selector && typeof selector === "string" ) { 8543 matched = jQuery.filter( selector, matched ); 8544 } 8545 8546 if ( this.length > 1 ) { 8547 8548 // Remove duplicates 8549 if ( !guaranteedUnique[ name ] ) { 8550 jQuery.uniqueSort( matched ); 8551 } 8552 8553 // Reverse order for parents* and prev-derivatives 8554 if ( rparentsprev.test( name ) ) { 8555 matched.reverse(); 8556 } 8557 } 8558 8559 return this.pushStack( matched ); 8560 }; 8561} ); 8562var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); 8563 8564 8565 8566// Convert String-formatted options into Object-formatted ones 8567function createOptions( options ) { 8568 var object = {}; 8569 jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { 8570 object[ flag ] = true; 8571 } ); 8572 return object; 8573} 8574 8575/* 8576 * Create a callback list using the following parameters: 8577 * 8578 * options: an optional list of space-separated options that will change how 8579 * the callback list behaves or a more traditional option object 8580 * 8581 * By default a callback list will act like an event callback list and can be 8582 * "fired" multiple times. 8583 * 8584 * Possible options: 8585 * 8586 * once: will ensure the callback list can only be fired once (like a Deferred) 8587 * 8588 * memory: will keep track of previous values and will call any callback added 8589 * after the list has been fired right away with the latest "memorized" 8590 * values (like a Deferred) 8591 * 8592 * unique: will ensure a callback can only be added once (no duplicate in the list) 8593 * 8594 * stopOnFalse: interrupt callings when a callback returns false 8595 * 8596 */ 8597jQuery.Callbacks = function( options ) { 8598 8599 // Convert options from String-formatted to Object-formatted if needed 8600 // (we check in cache first) 8601 options = typeof options === "string" ? 8602 createOptions( options ) : 8603 jQuery.extend( {}, options ); 8604 8605 var // Flag to know if list is currently firing 8606 firing, 8607 8608 // Last fire value for non-forgettable lists 8609 memory, 8610 8611 // Flag to know if list was already fired 8612 fired, 8613 8614 // Flag to prevent firing 8615 locked, 8616 8617 // Actual callback list 8618 list = [], 8619 8620 // Queue of execution data for repeatable lists 8621 queue = [], 8622 8623 // Index of currently firing callback (modified by add/remove as needed) 8624 firingIndex = -1, 8625 8626 // Fire callbacks 8627 fire = function() { 8628 8629 // Enforce single-firing 8630 locked = locked || options.once; 8631 8632 // Execute callbacks for all pending executions, 8633 // respecting firingIndex overrides and runtime changes 8634 fired = firing = true; 8635 for ( ; queue.length; firingIndex = -1 ) { 8636 memory = queue.shift(); 8637 while ( ++firingIndex < list.length ) { 8638 8639 // Run callback and check for early termination 8640 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && 8641 options.stopOnFalse ) { 8642 8643 // Jump to end and forget the data so .add doesn't re-fire 8644 firingIndex = list.length; 8645 memory = false; 8646 } 8647 } 8648 } 8649 8650 // Forget the data if we're done with it 8651 if ( !options.memory ) { 8652 memory = false; 8653 } 8654 8655 firing = false; 8656 8657 // Clean up if we're done firing for good 8658 if ( locked ) { 8659 8660 // Keep an empty list if we have data for future add calls 8661 if ( memory ) { 8662 list = []; 8663 8664 // Otherwise, this object is spent 8665 } else { 8666 list = ""; 8667 } 8668 } 8669 }, 8670 8671 // Actual Callbacks object 8672 self = { 8673 8674 // Add a callback or a collection of callbacks to the list 8675 add: function() { 8676 if ( list ) { 8677 8678 // If we have memory from a past run, we should fire after adding 8679 if ( memory && !firing ) { 8680 firingIndex = list.length - 1; 8681 queue.push( memory ); 8682 } 8683 8684 ( function add( args ) { 8685 jQuery.each( args, function( _, arg ) { 8686 if ( isFunction( arg ) ) { 8687 if ( !options.unique || !self.has( arg ) ) { 8688 list.push( arg ); 8689 } 8690 } else if ( arg && arg.length && toType( arg ) !== "string" ) { 8691 8692 // Inspect recursively 8693 add( arg ); 8694 } 8695 } ); 8696 } )( arguments ); 8697 8698 if ( memory && !firing ) { 8699 fire(); 8700 } 8701 } 8702 return this; 8703 }, 8704 8705 // Remove a callback from the list 8706 remove: function() { 8707 jQuery.each( arguments, function( _, arg ) { 8708 var index; 8709 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { 8710 list.splice( index, 1 ); 8711 8712 // Handle firing indexes 8713 if ( index <= firingIndex ) { 8714 firingIndex--; 8715 } 8716 } 8717 } ); 8718 return this; 8719 }, 8720 8721 // Check if a given callback is in the list. 8722 // If no argument is given, return whether or not list has callbacks attached. 8723 has: function( fn ) { 8724 return fn ? 8725 jQuery.inArray( fn, list ) > -1 : 8726 list.length > 0; 8727 }, 8728 8729 // Remove all callbacks from the list 8730 empty: function() { 8731 if ( list ) { 8732 list = []; 8733 } 8734 return this; 8735 }, 8736 8737 // Disable .fire and .add 8738 // Abort any current/pending executions 8739 // Clear all callbacks and values 8740 disable: function() { 8741 locked = queue = []; 8742 list = memory = ""; 8743 return this; 8744 }, 8745 disabled: function() { 8746 return !list; 8747 }, 8748 8749 // Disable .fire 8750 // Also disable .add unless we have memory (since it would have no effect) 8751 // Abort any pending executions 8752 lock: function() { 8753 locked = queue = []; 8754 if ( !memory && !firing ) { 8755 list = memory = ""; 8756 } 8757 return this; 8758 }, 8759 locked: function() { 8760 return !!locked; 8761 }, 8762 8763 // Call all callbacks with the given context and arguments 8764 fireWith: function( context, args ) { 8765 if ( !locked ) { 8766 args = args || []; 8767 args = [ context, args.slice ? args.slice() : args ]; 8768 queue.push( args ); 8769 if ( !firing ) { 8770 fire(); 8771 } 8772 } 8773 return this; 8774 }, 8775 8776 // Call all the callbacks with the given arguments 8777 fire: function() { 8778 self.fireWith( this, arguments ); 8779 return this; 8780 }, 8781 8782 // To know if the callbacks have already been called at least once 8783 fired: function() { 8784 return !!fired; 8785 } 8786 }; 8787 8788 return self; 8789}; 8790 8791 8792function Identity( v ) { 8793 return v; 8794} 8795function Thrower( ex ) { 8796 throw ex; 8797} 8798 8799function adoptValue( value, resolve, reject, noValue ) { 8800 var method; 8801 8802 try { 8803 8804 // Check for promise aspect first to privilege synchronous behavior 8805 if ( value && isFunction( ( method = value.promise ) ) ) { 8806 method.call( value ).done( resolve ).fail( reject ); 8807 8808 // Other thenables 8809 } else if ( value && isFunction( ( method = value.then ) ) ) { 8810 method.call( value, resolve, reject ); 8811 8812 // Other non-thenables 8813 } else { 8814 8815 // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: 8816 // * false: [ value ].slice( 0 ) => resolve( value ) 8817 // * true: [ value ].slice( 1 ) => resolve() 8818 resolve.apply( undefined, [ value ].slice( noValue ) ); 8819 } 8820 8821 // For Promises/A+, convert exceptions into rejections 8822 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in 8823 // Deferred#then to conditionally suppress rejection. 8824 } catch ( value ) { 8825 8826 // Support: Android 4.0 only 8827 // Strict mode functions invoked without .call/.apply get global-object context 8828 reject.apply( undefined, [ value ] ); 8829 } 8830} 8831 8832jQuery.extend( { 8833 8834 Deferred: function( func ) { 8835 var tuples = [ 8836 8837 // action, add listener, callbacks, 8838 // ... .then handlers, argument index, [final state] 8839 [ "notify", "progress", jQuery.Callbacks( "memory" ), 8840 jQuery.Callbacks( "memory" ), 2 ], 8841 [ "resolve", "done", jQuery.Callbacks( "once memory" ), 8842 jQuery.Callbacks( "once memory" ), 0, "resolved" ], 8843 [ "reject", "fail", jQuery.Callbacks( "once memory" ), 8844 jQuery.Callbacks( "once memory" ), 1, "rejected" ] 8845 ], 8846 state = "pending", 8847 promise = { 8848 state: function() { 8849 return state; 8850 }, 8851 always: function() { 8852 deferred.done( arguments ).fail( arguments ); 8853 return this; 8854 }, 8855 "catch": function( fn ) { 8856 return promise.then( null, fn ); 8857 }, 8858 8859 // Keep pipe for back-compat 8860 pipe: function( /* fnDone, fnFail, fnProgress */ ) { 8861 var fns = arguments; 8862 8863 return jQuery.Deferred( function( newDefer ) { 8864 jQuery.each( tuples, function( _i, tuple ) { 8865 8866 // Map tuples (progress, done, fail) to arguments (done, fail, progress) 8867 var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; 8868 8869 // deferred.progress(function() { bind to newDefer or newDefer.notify }) 8870 // deferred.done(function() { bind to newDefer or newDefer.resolve }) 8871 // deferred.fail(function() { bind to newDefer or newDefer.reject }) 8872 deferred[ tuple[ 1 ] ]( function() { 8873 var returned = fn && fn.apply( this, arguments ); 8874 if ( returned && isFunction( returned.promise ) ) { 8875 returned.promise() 8876 .progress( newDefer.notify ) 8877 .done( newDefer.resolve ) 8878 .fail( newDefer.reject ); 8879 } else { 8880 newDefer[ tuple[ 0 ] + "With" ]( 8881 this, 8882 fn ? [ returned ] : arguments 8883 ); 8884 } 8885 } ); 8886 } ); 8887 fns = null; 8888 } ).promise(); 8889 }, 8890 then: function( onFulfilled, onRejected, onProgress ) { 8891 var maxDepth = 0; 8892 function resolve( depth, deferred, handler, special ) { 8893 return function() { 8894 var that = this, 8895 args = arguments, 8896 mightThrow = function() { 8897 var returned, then; 8898 8899 // Support: Promises/A+ section 2.3.3.3.3 8900 // https://promisesaplus.com/#point-59 8901 // Ignore double-resolution attempts 8902 if ( depth < maxDepth ) { 8903 return; 8904 } 8905 8906 returned = handler.apply( that, args ); 8907 8908 // Support: Promises/A+ section 2.3.1 8909 // https://promisesaplus.com/#point-48 8910 if ( returned === deferred.promise() ) { 8911 throw new TypeError( "Thenable self-resolution" ); 8912 } 8913 8914 // Support: Promises/A+ sections 2.3.3.1, 3.5 8915 // https://promisesaplus.com/#point-54 8916 // https://promisesaplus.com/#point-75 8917 // Retrieve `then` only once 8918 then = returned && 8919 8920 // Support: Promises/A+ section 2.3.4 8921 // https://promisesaplus.com/#point-64 8922 // Only check objects and functions for thenability 8923 ( typeof returned === "object" || 8924 typeof returned === "function" ) && 8925 returned.then; 8926 8927 // Handle a returned thenable 8928 if ( isFunction( then ) ) { 8929 8930 // Special processors (notify) just wait for resolution 8931 if ( special ) { 8932 then.call( 8933 returned, 8934 resolve( maxDepth, deferred, Identity, special ), 8935 resolve( maxDepth, deferred, Thrower, special ) 8936 ); 8937 8938 // Normal processors (resolve) also hook into progress 8939 } else { 8940 8941 // ...and disregard older resolution values 8942 maxDepth++; 8943 8944 then.call( 8945 returned, 8946 resolve( maxDepth, deferred, Identity, special ), 8947 resolve( maxDepth, deferred, Thrower, special ), 8948 resolve( maxDepth, deferred, Identity, 8949 deferred.notifyWith ) 8950 ); 8951 } 8952 8953 // Handle all other returned values 8954 } else { 8955 8956 // Only substitute handlers pass on context 8957 // and multiple values (non-spec behavior) 8958 if ( handler !== Identity ) { 8959 that = undefined; 8960 args = [ returned ]; 8961 } 8962 8963 // Process the value(s) 8964 // Default process is resolve 8965 ( special || deferred.resolveWith )( that, args ); 8966 } 8967 }, 8968 8969 // Only normal processors (resolve) catch and reject exceptions 8970 process = special ? 8971 mightThrow : 8972 function() { 8973 try { 8974 mightThrow(); 8975 } catch ( e ) { 8976 8977 if ( jQuery.Deferred.exceptionHook ) { 8978 jQuery.Deferred.exceptionHook( e, 8979 process.error ); 8980 } 8981 8982 // Support: Promises/A+ section 2.3.3.3.4.1 8983 // https://promisesaplus.com/#point-61 8984 // Ignore post-resolution exceptions 8985 if ( depth + 1 >= maxDepth ) { 8986 8987 // Only substitute handlers pass on context 8988 // and multiple values (non-spec behavior) 8989 if ( handler !== Thrower ) { 8990 that = undefined; 8991 args = [ e ]; 8992 } 8993 8994 deferred.rejectWith( that, args ); 8995 } 8996 } 8997 }; 8998 8999 // Support: Promises/A+ section 2.3.3.3.1 9000 // https://promisesaplus.com/#point-57 9001 // Re-resolve promises immediately to dodge false rejection from 9002 // subsequent errors 9003 if ( depth ) { 9004 process(); 9005 } else { 9006 9007 // Call an optional hook to record the error, in case of exception 9008 // since it's otherwise lost when execution goes async 9009 if ( jQuery.Deferred.getErrorHook ) { 9010 process.error = jQuery.Deferred.getErrorHook(); 9011 9012 // The deprecated alias of the above. While the name suggests 9013 // returning the stack, not an error instance, jQuery just passes 9014 // it directly to `console.warn` so both will work; an instance 9015 // just better cooperates with source maps. 9016 } else if ( jQuery.Deferred.getStackHook ) { 9017 process.error = jQuery.Deferred.getStackHook(); 9018 } 9019 window.setTimeout( process ); 9020 } 9021 }; 9022 } 9023 9024 return jQuery.Deferred( function( newDefer ) { 9025 9026 // progress_handlers.add( ... ) 9027 tuples[ 0 ][ 3 ].add( 9028 resolve( 9029 0, 9030 newDefer, 9031 isFunction( onProgress ) ? 9032 onProgress : 9033 Identity, 9034 newDefer.notifyWith 9035 ) 9036 ); 9037 9038 // fulfilled_handlers.add( ... ) 9039 tuples[ 1 ][ 3 ].add( 9040 resolve( 9041 0, 9042 newDefer, 9043 isFunction( onFulfilled ) ? 9044 onFulfilled : 9045 Identity 9046 ) 9047 ); 9048 9049 // rejected_handlers.add( ... ) 9050 tuples[ 2 ][ 3 ].add( 9051 resolve( 9052 0, 9053 newDefer, 9054 isFunction( onRejected ) ? 9055 onRejected : 9056 Thrower 9057 ) 9058 ); 9059 } ).promise(); 9060 }, 9061 9062 // Get a promise for this deferred 9063 // If obj is provided, the promise aspect is added to the object 9064 promise: function( obj ) { 9065 return obj != null ? jQuery.extend( obj, promise ) : promise; 9066 } 9067 }, 9068 deferred = {}; 9069 9070 // Add list-specific methods 9071 jQuery.each( tuples, function( i, tuple ) { 9072 var list = tuple[ 2 ], 9073 stateString = tuple[ 5 ]; 9074 9075 // promise.progress = list.add 9076 // promise.done = list.add 9077 // promise.fail = list.add 9078 promise[ tuple[ 1 ] ] = list.add; 9079 9080 // Handle state 9081 if ( stateString ) { 9082 list.add( 9083 function() { 9084 9085 // state = "resolved" (i.e., fulfilled) 9086 // state = "rejected" 9087 state = stateString; 9088 }, 9089 9090 // rejected_callbacks.disable 9091 // fulfilled_callbacks.disable 9092 tuples[ 3 - i ][ 2 ].disable, 9093 9094 // rejected_handlers.disable 9095 // fulfilled_handlers.disable 9096 tuples[ 3 - i ][ 3 ].disable, 9097 9098 // progress_callbacks.lock 9099 tuples[ 0 ][ 2 ].lock, 9100 9101 // progress_handlers.lock 9102 tuples[ 0 ][ 3 ].lock 9103 ); 9104 } 9105 9106 // progress_handlers.fire 9107 // fulfilled_handlers.fire 9108 // rejected_handlers.fire 9109 list.add( tuple[ 3 ].fire ); 9110 9111 // deferred.notify = function() { deferred.notifyWith(...) } 9112 // deferred.resolve = function() { deferred.resolveWith(...) } 9113 // deferred.reject = function() { deferred.rejectWith(...) } 9114 deferred[ tuple[ 0 ] ] = function() { 9115 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); 9116 return this; 9117 }; 9118 9119 // deferred.notifyWith = list.fireWith 9120 // deferred.resolveWith = list.fireWith 9121 // deferred.rejectWith = list.fireWith 9122 deferred[ tuple[ 0 ] + "With" ] = list.fireWith; 9123 } ); 9124 9125 // Make the deferred a promise 9126 promise.promise( deferred ); 9127 9128 // Call given func if any 9129 if ( func ) { 9130 func.call( deferred, deferred ); 9131 } 9132 9133 // All done! 9134 return deferred; 9135 }, 9136 9137 // Deferred helper 9138 when: function( singleValue ) { 9139 var 9140 9141 // count of uncompleted subordinates 9142 remaining = arguments.length, 9143 9144 // count of unprocessed arguments 9145 i = remaining, 9146 9147 // subordinate fulfillment data 9148 resolveContexts = Array( i ), 9149 resolveValues = slice.call( arguments ), 9150 9151 // the primary Deferred 9152 primary = jQuery.Deferred(), 9153 9154 // subordinate callback factory 9155 updateFunc = function( i ) { 9156 return function( value ) { 9157 resolveContexts[ i ] = this; 9158 resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; 9159 if ( !( --remaining ) ) { 9160 primary.resolveWith( resolveContexts, resolveValues ); 9161 } 9162 }; 9163 }; 9164 9165 // Single- and empty arguments are adopted like Promise.resolve 9166 if ( remaining <= 1 ) { 9167 adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject, 9168 !remaining ); 9169 9170 // Use .then() to unwrap secondary thenables (cf. gh-3000) 9171 if ( primary.state() === "pending" || 9172 isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { 9173 9174 return primary.then(); 9175 } 9176 } 9177 9178 // Multiple arguments are aggregated like Promise.all array elements 9179 while ( i-- ) { 9180 adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject ); 9181 } 9182 9183 return primary.promise(); 9184 } 9185} ); 9186 9187 9188// These usually indicate a programmer mistake during development, 9189// warn about them ASAP rather than swallowing them by default. 9190var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; 9191 9192// If `jQuery.Deferred.getErrorHook` is defined, `asyncError` is an error 9193// captured before the async barrier to get the original error cause 9194// which may otherwise be hidden. 9195jQuery.Deferred.exceptionHook = function( error, asyncError ) { 9196 9197 // Support: IE 8 - 9 only 9198 // Console exists when dev tools are open, which can happen at any time 9199 if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { 9200 window.console.warn( "jQuery.Deferred exception: " + error.message, 9201 error.stack, asyncError ); 9202 } 9203}; 9204 9205 9206 9207 9208jQuery.readyException = function( error ) { 9209 window.setTimeout( function() { 9210 throw error; 9211 } ); 9212}; 9213 9214 9215 9216 9217// The deferred used on DOM ready 9218var readyList = jQuery.Deferred(); 9219 9220jQuery.fn.ready = function( fn ) { 9221 9222 readyList 9223 .then( fn ) 9224 9225 // Wrap jQuery.readyException in a function so that the lookup 9226 // happens at the time of error handling instead of callback 9227 // registration. 9228 .catch( function( error ) { 9229 jQuery.readyException( error ); 9230 } ); 9231 9232 return this; 9233}; 9234 9235jQuery.extend( { 9236 9237 // Is the DOM ready to be used? Set to true once it occurs. 9238 isReady: false, 9239 9240 // A counter to track how many items to wait for before 9241 // the ready event fires. See trac-6781 9242 readyWait: 1, 9243 9244 // Handle when the DOM is ready 9245 ready: function( wait ) { 9246 9247 // Abort if there are pending holds or we're already ready 9248 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { 9249 return; 9250 } 9251 9252 // Remember that the DOM is ready 9253 jQuery.isReady = true; 9254 9255 // If a normal DOM Ready event fired, decrement, and wait if need be 9256 if ( wait !== true && --jQuery.readyWait > 0 ) { 9257 return; 9258 } 9259 9260 // If there are functions bound, to execute 9261 readyList.resolveWith( document, [ jQuery ] ); 9262 } 9263} ); 9264 9265jQuery.ready.then = readyList.then; 9266 9267// The ready event handler and self cleanup method 9268function completed() { 9269 document.removeEventListener( "DOMContentLoaded", completed ); 9270 window.removeEventListener( "load", completed ); 9271 jQuery.ready(); 9272} 9273 9274// Catch cases where $(document).ready() is called 9275// after the browser event has already occurred. 9276// Support: IE <=9 - 10 only 9277// Older IE sometimes signals "interactive" too soon 9278if ( document.readyState === "complete" || 9279 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { 9280 9281 // Handle it asynchronously to allow scripts the opportunity to delay ready 9282 window.setTimeout( jQuery.ready ); 9283 9284} else { 9285 9286 // Use the handy event callback 9287 document.addEventListener( "DOMContentLoaded", completed ); 9288 9289 // A fallback to window.onload, that will always work 9290 window.addEventListener( "load", completed ); 9291} 9292 9293 9294 9295 9296// Multifunctional method to get and set values of a collection 9297// The value/s can optionally be executed if it's a function 9298var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 9299 var i = 0, 9300 len = elems.length, 9301 bulk = key == null; 9302 9303 // Sets many values 9304 if ( toType( key ) === "object" ) { 9305 chainable = true; 9306 for ( i in key ) { 9307 access( elems, fn, i, key[ i ], true, emptyGet, raw ); 9308 } 9309 9310 // Sets one value 9311 } else if ( value !== undefined ) { 9312 chainable = true; 9313 9314 if ( !isFunction( value ) ) { 9315 raw = true; 9316 } 9317 9318 if ( bulk ) { 9319 9320 // Bulk operations run against the entire set 9321 if ( raw ) { 9322 fn.call( elems, value ); 9323 fn = null; 9324 9325 // ...except when executing function values 9326 } else { 9327 bulk = fn; 9328 fn = function( elem, _key, value ) { 9329 return bulk.call( jQuery( elem ), value ); 9330 }; 9331 } 9332 } 9333 9334 if ( fn ) { 9335 for ( ; i < len; i++ ) { 9336 fn( 9337 elems[ i ], key, raw ? 9338 value : 9339 value.call( elems[ i ], i, fn( elems[ i ], key ) ) 9340 ); 9341 } 9342 } 9343 } 9344 9345 if ( chainable ) { 9346 return elems; 9347 } 9348 9349 // Gets 9350 if ( bulk ) { 9351 return fn.call( elems ); 9352 } 9353 9354 return len ? fn( elems[ 0 ], key ) : emptyGet; 9355}; 9356 9357 9358// Matches dashed string for camelizing 9359var rmsPrefix = /^-ms-/, 9360 rdashAlpha = /-([a-z])/g; 9361 9362// Used by camelCase as callback to replace() 9363function fcamelCase( _all, letter ) { 9364 return letter.toUpperCase(); 9365} 9366 9367// Convert dashed to camelCase; used by the css and data modules 9368// Support: IE <=9 - 11, Edge 12 - 15 9369// Microsoft forgot to hump their vendor prefix (trac-9572) 9370function camelCase( string ) { 9371 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 9372} 9373var acceptData = function( owner ) { 9374 9375 // Accepts only: 9376 // - Node 9377 // - Node.ELEMENT_NODE 9378 // - Node.DOCUMENT_NODE 9379 // - Object 9380 // - Any 9381 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); 9382}; 9383 9384 9385 9386 9387function Data() { 9388 this.expando = jQuery.expando + Data.uid++; 9389} 9390 9391Data.uid = 1; 9392 9393Data.prototype = { 9394 9395 cache: function( owner ) { 9396 9397 // Check if the owner object already has a cache 9398 var value = owner[ this.expando ]; 9399 9400 // If not, create one 9401 if ( !value ) { 9402 value = {}; 9403 9404 // We can accept data for non-element nodes in modern browsers, 9405 // but we should not, see trac-8335. 9406 // Always return an empty object. 9407 if ( acceptData( owner ) ) { 9408 9409 // If it is a node unlikely to be stringify-ed or looped over 9410 // use plain assignment 9411 if ( owner.nodeType ) { 9412 owner[ this.expando ] = value; 9413 9414 // Otherwise secure it in a non-enumerable property 9415 // configurable must be true to allow the property to be 9416 // deleted when data is removed 9417 } else { 9418 Object.defineProperty( owner, this.expando, { 9419 value: value, 9420 configurable: true 9421 } ); 9422 } 9423 } 9424 } 9425 9426 return value; 9427 }, 9428 set: function( owner, data, value ) { 9429 var prop, 9430 cache = this.cache( owner ); 9431 9432 // Handle: [ owner, key, value ] args 9433 // Always use camelCase key (gh-2257) 9434 if ( typeof data === "string" ) { 9435 cache[ camelCase( data ) ] = value; 9436 9437 // Handle: [ owner, { properties } ] args 9438 } else { 9439 9440 // Copy the properties one-by-one to the cache object 9441 for ( prop in data ) { 9442 cache[ camelCase( prop ) ] = data[ prop ]; 9443 } 9444 } 9445 return cache; 9446 }, 9447 get: function( owner, key ) { 9448 return key === undefined ? 9449 this.cache( owner ) : 9450 9451 // Always use camelCase key (gh-2257) 9452 owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; 9453 }, 9454 access: function( owner, key, value ) { 9455 9456 // In cases where either: 9457 // 9458 // 1. No key was specified 9459 // 2. A string key was specified, but no value provided 9460 // 9461 // Take the "read" path and allow the get method to determine 9462 // which value to return, respectively either: 9463 // 9464 // 1. The entire cache object 9465 // 2. The data stored at the key 9466 // 9467 if ( key === undefined || 9468 ( ( key && typeof key === "string" ) && value === undefined ) ) { 9469 9470 return this.get( owner, key ); 9471 } 9472 9473 // When the key is not a string, or both a key and value 9474 // are specified, set or extend (existing objects) with either: 9475 // 9476 // 1. An object of properties 9477 // 2. A key and value 9478 // 9479 this.set( owner, key, value ); 9480 9481 // Since the "set" path can have two possible entry points 9482 // return the expected data based on which path was taken[*] 9483 return value !== undefined ? value : key; 9484 }, 9485 remove: function( owner, key ) { 9486 var i, 9487 cache = owner[ this.expando ]; 9488 9489 if ( cache === undefined ) { 9490 return; 9491 } 9492 9493 if ( key !== undefined ) { 9494 9495 // Support array or space separated string of keys 9496 if ( Array.isArray( key ) ) { 9497 9498 // If key is an array of keys... 9499 // We always set camelCase keys, so remove that. 9500 key = key.map( camelCase ); 9501 } else { 9502 key = camelCase( key ); 9503 9504 // If a key with the spaces exists, use it. 9505 // Otherwise, create an array by matching non-whitespace 9506 key = key in cache ? 9507 [ key ] : 9508 ( key.match( rnothtmlwhite ) || [] ); 9509 } 9510 9511 i = key.length; 9512 9513 while ( i-- ) { 9514 delete cache[ key[ i ] ]; 9515 } 9516 } 9517 9518 // Remove the expando if there's no more data 9519 if ( key === undefined || jQuery.isEmptyObject( cache ) ) { 9520 9521 // Support: Chrome <=35 - 45 9522 // Webkit & Blink performance suffers when deleting properties 9523 // from DOM nodes, so set to undefined instead 9524 // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) 9525 if ( owner.nodeType ) { 9526 owner[ this.expando ] = undefined; 9527 } else { 9528 delete owner[ this.expando ]; 9529 } 9530 } 9531 }, 9532 hasData: function( owner ) { 9533 var cache = owner[ this.expando ]; 9534 return cache !== undefined && !jQuery.isEmptyObject( cache ); 9535 } 9536}; 9537var dataPriv = new Data(); 9538 9539var dataUser = new Data(); 9540 9541 9542 9543// Implementation Summary 9544// 9545// 1. Enforce API surface and semantic compatibility with 1.9.x branch 9546// 2. Improve the module's maintainability by reducing the storage 9547// paths to a single mechanism. 9548// 3. Use the same single mechanism to support "private" and "user" data. 9549// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) 9550// 5. Avoid exposing implementation details on user objects (eg. expando properties) 9551// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 9552 9553var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 9554 rmultiDash = /[A-Z]/g; 9555 9556function getData( data ) { 9557 if ( data === "true" ) { 9558 return true; 9559 } 9560 9561 if ( data === "false" ) { 9562 return false; 9563 } 9564 9565 if ( data === "null" ) { 9566 return null; 9567 } 9568 9569 // Only convert to a number if it doesn't change the string 9570 if ( data === +data + "" ) { 9571 return +data; 9572 } 9573 9574 if ( rbrace.test( data ) ) { 9575 return JSON.parse( data ); 9576 } 9577 9578 return data; 9579} 9580 9581function dataAttr( elem, key, data ) { 9582 var name; 9583 9584 // If nothing was found internally, try to fetch any 9585 // data from the HTML5 data-* attribute 9586 if ( data === undefined && elem.nodeType === 1 ) { 9587 name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); 9588 data = elem.getAttribute( name ); 9589 9590 if ( typeof data === "string" ) { 9591 try { 9592 data = getData( data ); 9593 } catch ( e ) {} 9594 9595 // Make sure we set the data so it isn't changed later 9596 dataUser.set( elem, key, data ); 9597 } else { 9598 data = undefined; 9599 } 9600 } 9601 return data; 9602} 9603 9604jQuery.extend( { 9605 hasData: function( elem ) { 9606 return dataUser.hasData( elem ) || dataPriv.hasData( elem ); 9607 }, 9608 9609 data: function( elem, name, data ) { 9610 return dataUser.access( elem, name, data ); 9611 }, 9612 9613 removeData: function( elem, name ) { 9614 dataUser.remove( elem, name ); 9615 }, 9616 9617 // TODO: Now that all calls to _data and _removeData have been replaced 9618 // with direct calls to dataPriv methods, these can be deprecated. 9619 _data: function( elem, name, data ) { 9620 return dataPriv.access( elem, name, data ); 9621 }, 9622 9623 _removeData: function( elem, name ) { 9624 dataPriv.remove( elem, name ); 9625 } 9626} ); 9627 9628jQuery.fn.extend( { 9629 data: function( key, value ) { 9630 var i, name, data, 9631 elem = this[ 0 ], 9632 attrs = elem && elem.attributes; 9633 9634 // Gets all values 9635 if ( key === undefined ) { 9636 if ( this.length ) { 9637 data = dataUser.get( elem ); 9638 9639 if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { 9640 i = attrs.length; 9641 while ( i-- ) { 9642 9643 // Support: IE 11 only 9644 // The attrs elements can be null (trac-14894) 9645 if ( attrs[ i ] ) { 9646 name = attrs[ i ].name; 9647 if ( name.indexOf( "data-" ) === 0 ) { 9648 name = camelCase( name.slice( 5 ) ); 9649 dataAttr( elem, name, data[ name ] ); 9650 } 9651 } 9652 } 9653 dataPriv.set( elem, "hasDataAttrs", true ); 9654 } 9655 } 9656 9657 return data; 9658 } 9659 9660 // Sets multiple values 9661 if ( typeof key === "object" ) { 9662 return this.each( function() { 9663 dataUser.set( this, key ); 9664 } ); 9665 } 9666 9667 return access( this, function( value ) { 9668 var data; 9669 9670 // The calling jQuery object (element matches) is not empty 9671 // (and therefore has an element appears at this[ 0 ]) and the 9672 // `value` parameter was not undefined. An empty jQuery object 9673 // will result in `undefined` for elem = this[ 0 ] which will 9674 // throw an exception if an attempt to read a data cache is made. 9675 if ( elem && value === undefined ) { 9676 9677 // Attempt to get data from the cache 9678 // The key will always be camelCased in Data 9679 data = dataUser.get( elem, key ); 9680 if ( data !== undefined ) { 9681 return data; 9682 } 9683 9684 // Attempt to "discover" the data in 9685 // HTML5 custom data-* attrs 9686 data = dataAttr( elem, key ); 9687 if ( data !== undefined ) { 9688 return data; 9689 } 9690 9691 // We tried really hard, but the data doesn't exist. 9692 return; 9693 } 9694 9695 // Set the data... 9696 this.each( function() { 9697 9698 // We always store the camelCased key 9699 dataUser.set( this, key, value ); 9700 } ); 9701 }, null, value, arguments.length > 1, null, true ); 9702 }, 9703 9704 removeData: function( key ) { 9705 return this.each( function() { 9706 dataUser.remove( this, key ); 9707 } ); 9708 } 9709} ); 9710 9711 9712jQuery.extend( { 9713 queue: function( elem, type, data ) { 9714 var queue; 9715 9716 if ( elem ) { 9717 type = ( type || "fx" ) + "queue"; 9718 queue = dataPriv.get( elem, type ); 9719 9720 // Speed up dequeue by getting out quickly if this is just a lookup 9721 if ( data ) { 9722 if ( !queue || Array.isArray( data ) ) { 9723 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); 9724 } else { 9725 queue.push( data ); 9726 } 9727 } 9728 return queue || []; 9729 } 9730 }, 9731 9732 dequeue: function( elem, type ) { 9733 type = type || "fx"; 9734 9735 var queue = jQuery.queue( elem, type ), 9736 startLength = queue.length, 9737 fn = queue.shift(), 9738 hooks = jQuery._queueHooks( elem, type ), 9739 next = function() { 9740 jQuery.dequeue( elem, type ); 9741 }; 9742 9743 // If the fx queue is dequeued, always remove the progress sentinel 9744 if ( fn === "inprogress" ) { 9745 fn = queue.shift(); 9746 startLength--; 9747 } 9748 9749 if ( fn ) { 9750 9751 // Add a progress sentinel to prevent the fx queue from being 9752 // automatically dequeued 9753 if ( type === "fx" ) { 9754 queue.unshift( "inprogress" ); 9755 } 9756 9757 // Clear up the last queue stop function 9758 delete hooks.stop; 9759 fn.call( elem, next, hooks ); 9760 } 9761 9762 if ( !startLength && hooks ) { 9763 hooks.empty.fire(); 9764 } 9765 }, 9766 9767 // Not public - generate a queueHooks object, or return the current one 9768 _queueHooks: function( elem, type ) { 9769 var key = type + "queueHooks"; 9770 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { 9771 empty: jQuery.Callbacks( "once memory" ).add( function() { 9772 dataPriv.remove( elem, [ type + "queue", key ] ); 9773 } ) 9774 } ); 9775 } 9776} ); 9777 9778jQuery.fn.extend( { 9779 queue: function( type, data ) { 9780 var setter = 2; 9781 9782 if ( typeof type !== "string" ) { 9783 data = type; 9784 type = "fx"; 9785 setter--; 9786 } 9787 9788 if ( arguments.length < setter ) { 9789 return jQuery.queue( this[ 0 ], type ); 9790 } 9791 9792 return data === undefined ? 9793 this : 9794 this.each( function() { 9795 var queue = jQuery.queue( this, type, data ); 9796 9797 // Ensure a hooks for this queue 9798 jQuery._queueHooks( this, type ); 9799 9800 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { 9801 jQuery.dequeue( this, type ); 9802 } 9803 } ); 9804 }, 9805 dequeue: function( type ) { 9806 return this.each( function() { 9807 jQuery.dequeue( this, type ); 9808 } ); 9809 }, 9810 clearQueue: function( type ) { 9811 return this.queue( type || "fx", [] ); 9812 }, 9813 9814 // Get a promise resolved when queues of a certain type 9815 // are emptied (fx is the type by default) 9816 promise: function( type, obj ) { 9817 var tmp, 9818 count = 1, 9819 defer = jQuery.Deferred(), 9820 elements = this, 9821 i = this.length, 9822 resolve = function() { 9823 if ( !( --count ) ) { 9824 defer.resolveWith( elements, [ elements ] ); 9825 } 9826 }; 9827 9828 if ( typeof type !== "string" ) { 9829 obj = type; 9830 type = undefined; 9831 } 9832 type = type || "fx"; 9833 9834 while ( i-- ) { 9835 tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); 9836 if ( tmp && tmp.empty ) { 9837 count++; 9838 tmp.empty.add( resolve ); 9839 } 9840 } 9841 resolve(); 9842 return defer.promise( obj ); 9843 } 9844} ); 9845var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; 9846 9847var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); 9848 9849 9850var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; 9851 9852var documentElement = document.documentElement; 9853 9854 9855 9856 var isAttached = function( elem ) { 9857 return jQuery.contains( elem.ownerDocument, elem ); 9858 }, 9859 composed = { composed: true }; 9860 9861 // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only 9862 // Check attachment across shadow DOM boundaries when possible (gh-3504) 9863 // Support: iOS 10.0-10.2 only 9864 // Early iOS 10 versions support `attachShadow` but not `getRootNode`, 9865 // leading to errors. We need to check for `getRootNode`. 9866 if ( documentElement.getRootNode ) { 9867 isAttached = function( elem ) { 9868 return jQuery.contains( elem.ownerDocument, elem ) || 9869 elem.getRootNode( composed ) === elem.ownerDocument; 9870 }; 9871 } 9872var isHiddenWithinTree = function( elem, el ) { 9873 9874 // isHiddenWithinTree might be called from jQuery#filter function; 9875 // in that case, element will be second argument 9876 elem = el || elem; 9877 9878 // Inline style trumps all 9879 return elem.style.display === "none" || 9880 elem.style.display === "" && 9881 9882 // Otherwise, check computed style 9883 // Support: Firefox <=43 - 45 9884 // Disconnected elements can have computed display: none, so first confirm that elem is 9885 // in the document. 9886 isAttached( elem ) && 9887 9888 jQuery.css( elem, "display" ) === "none"; 9889 }; 9890 9891 9892 9893function adjustCSS( elem, prop, valueParts, tween ) { 9894 var adjusted, scale, 9895 maxIterations = 20, 9896 currentValue = tween ? 9897 function() { 9898 return tween.cur(); 9899 } : 9900 function() { 9901 return jQuery.css( elem, prop, "" ); 9902 }, 9903 initial = currentValue(), 9904 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), 9905 9906 // Starting value computation is required for potential unit mismatches 9907 initialInUnit = elem.nodeType && 9908 ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && 9909 rcssNum.exec( jQuery.css( elem, prop ) ); 9910 9911 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { 9912 9913 // Support: Firefox <=54 9914 // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) 9915 initial = initial / 2; 9916 9917 // Trust units reported by jQuery.css 9918 unit = unit || initialInUnit[ 3 ]; 9919 9920 // Iteratively approximate from a nonzero starting point 9921 initialInUnit = +initial || 1; 9922 9923 while ( maxIterations-- ) { 9924 9925 // Evaluate and update our best guess (doubling guesses that zero out). 9926 // Finish if the scale equals or crosses 1 (making the old*new product non-positive). 9927 jQuery.style( elem, prop, initialInUnit + unit ); 9928 if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { 9929 maxIterations = 0; 9930 } 9931 initialInUnit = initialInUnit / scale; 9932 9933 } 9934 9935 initialInUnit = initialInUnit * 2; 9936 jQuery.style( elem, prop, initialInUnit + unit ); 9937 9938 // Make sure we update the tween properties later on 9939 valueParts = valueParts || []; 9940 } 9941 9942 if ( valueParts ) { 9943 initialInUnit = +initialInUnit || +initial || 0; 9944 9945 // Apply relative offset (+=/-=) if specified 9946 adjusted = valueParts[ 1 ] ? 9947 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : 9948 +valueParts[ 2 ]; 9949 if ( tween ) { 9950 tween.unit = unit; 9951 tween.start = initialInUnit; 9952 tween.end = adjusted; 9953 } 9954 } 9955 return adjusted; 9956} 9957 9958 9959var defaultDisplayMap = {}; 9960 9961function getDefaultDisplay( elem ) { 9962 var temp, 9963 doc = elem.ownerDocument, 9964 nodeName = elem.nodeName, 9965 display = defaultDisplayMap[ nodeName ]; 9966 9967 if ( display ) { 9968 return display; 9969 } 9970 9971 temp = doc.body.appendChild( doc.createElement( nodeName ) ); 9972 display = jQuery.css( temp, "display" ); 9973 9974 temp.parentNode.removeChild( temp ); 9975 9976 if ( display === "none" ) { 9977 display = "block"; 9978 } 9979 defaultDisplayMap[ nodeName ] = display; 9980 9981 return display; 9982} 9983 9984function showHide( elements, show ) { 9985 var display, elem, 9986 values = [], 9987 index = 0, 9988 length = elements.length; 9989 9990 // Determine new display value for elements that need to change 9991 for ( ; index < length; index++ ) { 9992 elem = elements[ index ]; 9993 if ( !elem.style ) { 9994 continue; 9995 } 9996 9997 display = elem.style.display; 9998 if ( show ) { 9999 10000 // Since we force visibility upon cascade-hidden elements, an immediate (and slow) 10001 // check is required in this first loop unless we have a nonempty display value (either 10002 // inline or about-to-be-restored) 10003 if ( display === "none" ) { 10004 values[ index ] = dataPriv.get( elem, "display" ) || null; 10005 if ( !values[ index ] ) { 10006 elem.style.display = ""; 10007 } 10008 } 10009 if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { 10010 values[ index ] = getDefaultDisplay( elem ); 10011 } 10012 } else { 10013 if ( display !== "none" ) { 10014 values[ index ] = "none"; 10015 10016 // Remember what we're overwriting 10017 dataPriv.set( elem, "display", display ); 10018 } 10019 } 10020 } 10021 10022 // Set the display of the elements in a second loop to avoid constant reflow 10023 for ( index = 0; index < length; index++ ) { 10024 if ( values[ index ] != null ) { 10025 elements[ index ].style.display = values[ index ]; 10026 } 10027 } 10028 10029 return elements; 10030} 10031 10032jQuery.fn.extend( { 10033 show: function() { 10034 return showHide( this, true ); 10035 }, 10036 hide: function() { 10037 return showHide( this ); 10038 }, 10039 toggle: function( state ) { 10040 if ( typeof state === "boolean" ) { 10041 return state ? this.show() : this.hide(); 10042 } 10043 10044 return this.each( function() { 10045 if ( isHiddenWithinTree( this ) ) { 10046 jQuery( this ).show(); 10047 } else { 10048 jQuery( this ).hide(); 10049 } 10050 } ); 10051 } 10052} ); 10053var rcheckableType = ( /^(?:checkbox|radio)$/i ); 10054 10055var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); 10056 10057var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); 10058 10059 10060 10061( function() { 10062 var fragment = document.createDocumentFragment(), 10063 div = fragment.appendChild( document.createElement( "div" ) ), 10064 input = document.createElement( "input" ); 10065 10066 // Support: Android 4.0 - 4.3 only 10067 // Check state lost if the name is set (trac-11217) 10068 // Support: Windows Web Apps (WWA) 10069 // `name` and `type` must use .setAttribute for WWA (trac-14901) 10070 input.setAttribute( "type", "radio" ); 10071 input.setAttribute( "checked", "checked" ); 10072 input.setAttribute( "name", "t" ); 10073 10074 div.appendChild( input ); 10075 10076 // Support: Android <=4.1 only 10077 // Older WebKit doesn't clone checked state correctly in fragments 10078 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; 10079 10080 // Support: IE <=11 only 10081 // Make sure textarea (and checkbox) defaultValue is properly cloned 10082 div.innerHTML = "<textarea>x</textarea>"; 10083 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 10084 10085 // Support: IE <=9 only 10086 // IE <=9 replaces <option> tags with their contents when inserted outside of 10087 // the select element. 10088 div.innerHTML = "<option></option>"; 10089 support.option = !!div.lastChild; 10090} )(); 10091 10092 10093// We have to close these tags to support XHTML (trac-13200) 10094var wrapMap = { 10095 10096 // XHTML parsers do not magically insert elements in the 10097 // same way that tag soup parsers do. So we cannot shorten 10098 // this by omitting <tbody> or other required elements. 10099 thead: [ 1, "<table>", "</table>" ], 10100 col: [ 2, "<table><colgroup>", "</colgroup></table>" ], 10101 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 10102 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 10103 10104 _default: [ 0, "", "" ] 10105}; 10106 10107wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 10108wrapMap.th = wrapMap.td; 10109 10110// Support: IE <=9 only 10111if ( !support.option ) { 10112 wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ]; 10113} 10114 10115 10116function getAll( context, tag ) { 10117 10118 // Support: IE <=9 - 11 only 10119 // Use typeof to avoid zero-argument method invocation on host objects (trac-15151) 10120 var ret; 10121 10122 if ( typeof context.getElementsByTagName !== "undefined" ) { 10123 ret = context.getElementsByTagName( tag || "*" ); 10124 10125 } else if ( typeof context.querySelectorAll !== "undefined" ) { 10126 ret = context.querySelectorAll( tag || "*" ); 10127 10128 } else { 10129 ret = []; 10130 } 10131 10132 if ( tag === undefined || tag && nodeName( context, tag ) ) { 10133 return jQuery.merge( [ context ], ret ); 10134 } 10135 10136 return ret; 10137} 10138 10139 10140// Mark scripts as having already been evaluated 10141function setGlobalEval( elems, refElements ) { 10142 var i = 0, 10143 l = elems.length; 10144 10145 for ( ; i < l; i++ ) { 10146 dataPriv.set( 10147 elems[ i ], 10148 "globalEval", 10149 !refElements || dataPriv.get( refElements[ i ], "globalEval" ) 10150 ); 10151 } 10152} 10153 10154 10155var rhtml = /<|&#?\w+;/; 10156 10157function buildFragment( elems, context, scripts, selection, ignored ) { 10158 var elem, tmp, tag, wrap, attached, j, 10159 fragment = context.createDocumentFragment(), 10160 nodes = [], 10161 i = 0, 10162 l = elems.length; 10163 10164 for ( ; i < l; i++ ) { 10165 elem = elems[ i ]; 10166 10167 if ( elem || elem === 0 ) { 10168 10169 // Add nodes directly 10170 if ( toType( elem ) === "object" ) { 10171 10172 // Support: Android <=4.0 only, PhantomJS 1 only 10173 // push.apply(_, arraylike) throws on ancient WebKit 10174 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 10175 10176 // Convert non-html into a text node 10177 } else if ( !rhtml.test( elem ) ) { 10178 nodes.push( context.createTextNode( elem ) ); 10179 10180 // Convert html into DOM nodes 10181 } else { 10182 tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); 10183 10184 // Deserialize a standard representation 10185 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); 10186 wrap = wrapMap[ tag ] || wrapMap._default; 10187 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; 10188 10189 // Descend through wrappers to the right content 10190 j = wrap[ 0 ]; 10191 while ( j-- ) { 10192 tmp = tmp.lastChild; 10193 } 10194 10195 // Support: Android <=4.0 only, PhantomJS 1 only 10196 // push.apply(_, arraylike) throws on ancient WebKit 10197 jQuery.merge( nodes, tmp.childNodes ); 10198 10199 // Remember the top-level container 10200 tmp = fragment.firstChild; 10201 10202 // Ensure the created nodes are orphaned (trac-12392) 10203 tmp.textContent = ""; 10204 } 10205 } 10206 } 10207 10208 // Remove wrapper from fragment 10209 fragment.textContent = ""; 10210 10211 i = 0; 10212 while ( ( elem = nodes[ i++ ] ) ) { 10213 10214 // Skip elements already in the context collection (trac-4087) 10215 if ( selection && jQuery.inArray( elem, selection ) > -1 ) { 10216 if ( ignored ) { 10217 ignored.push( elem ); 10218 } 10219 continue; 10220 } 10221 10222 attached = isAttached( elem ); 10223 10224 // Append to fragment 10225 tmp = getAll( fragment.appendChild( elem ), "script" ); 10226 10227 // Preserve script evaluation history 10228 if ( attached ) { 10229 setGlobalEval( tmp ); 10230 } 10231 10232 // Capture executables 10233 if ( scripts ) { 10234 j = 0; 10235 while ( ( elem = tmp[ j++ ] ) ) { 10236 if ( rscriptType.test( elem.type || "" ) ) { 10237 scripts.push( elem ); 10238 } 10239 } 10240 } 10241 } 10242 10243 return fragment; 10244} 10245 10246 10247var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 10248 10249function returnTrue() { 10250 return true; 10251} 10252 10253function returnFalse() { 10254 return false; 10255} 10256 10257function on( elem, types, selector, data, fn, one ) { 10258 var origFn, type; 10259 10260 // Types can be a map of types/handlers 10261 if ( typeof types === "object" ) { 10262 10263 // ( types-Object, selector, data ) 10264 if ( typeof selector !== "string" ) { 10265 10266 // ( types-Object, data ) 10267 data = data || selector; 10268 selector = undefined; 10269 } 10270 for ( type in types ) { 10271 on( elem, type, selector, data, types[ type ], one ); 10272 } 10273 return elem; 10274 } 10275 10276 if ( data == null && fn == null ) { 10277 10278 // ( types, fn ) 10279 fn = selector; 10280 data = selector = undefined; 10281 } else if ( fn == null ) { 10282 if ( typeof selector === "string" ) { 10283 10284 // ( types, selector, fn ) 10285 fn = data; 10286 data = undefined; 10287 } else { 10288 10289 // ( types, data, fn ) 10290 fn = data; 10291 data = selector; 10292 selector = undefined; 10293 } 10294 } 10295 if ( fn === false ) { 10296 fn = returnFalse; 10297 } else if ( !fn ) { 10298 return elem; 10299 } 10300 10301 if ( one === 1 ) { 10302 origFn = fn; 10303 fn = function( event ) { 10304 10305 // Can use an empty set, since event contains the info 10306 jQuery().off( event ); 10307 return origFn.apply( this, arguments ); 10308 }; 10309 10310 // Use same guid so caller can remove using origFn 10311 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); 10312 } 10313 return elem.each( function() { 10314 jQuery.event.add( this, types, fn, data, selector ); 10315 } ); 10316} 10317 10318/* 10319 * Helper functions for managing events -- not part of the public interface. 10320 * Props to Dean Edwards' addEvent library for many of the ideas. 10321 */ 10322jQuery.event = { 10323 10324 global: {}, 10325 10326 add: function( elem, types, handler, data, selector ) { 10327 10328 var handleObjIn, eventHandle, tmp, 10329 events, t, handleObj, 10330 special, handlers, type, namespaces, origType, 10331 elemData = dataPriv.get( elem ); 10332 10333 // Only attach events to objects that accept data 10334 if ( !acceptData( elem ) ) { 10335 return; 10336 } 10337 10338 // Caller can pass in an object of custom data in lieu of the handler 10339 if ( handler.handler ) { 10340 handleObjIn = handler; 10341 handler = handleObjIn.handler; 10342 selector = handleObjIn.selector; 10343 } 10344 10345 // Ensure that invalid selectors throw exceptions at attach time 10346 // Evaluate against documentElement in case elem is a non-element node (e.g., document) 10347 if ( selector ) { 10348 jQuery.find.matchesSelector( documentElement, selector ); 10349 } 10350 10351 // Make sure that the handler has a unique ID, used to find/remove it later 10352 if ( !handler.guid ) { 10353 handler.guid = jQuery.guid++; 10354 } 10355 10356 // Init the element's event structure and main handler, if this is the first 10357 if ( !( events = elemData.events ) ) { 10358 events = elemData.events = Object.create( null ); 10359 } 10360 if ( !( eventHandle = elemData.handle ) ) { 10361 eventHandle = elemData.handle = function( e ) { 10362 10363 // Discard the second event of a jQuery.event.trigger() and 10364 // when an event is called after a page has unloaded 10365 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? 10366 jQuery.event.dispatch.apply( elem, arguments ) : undefined; 10367 }; 10368 } 10369 10370 // Handle multiple events separated by a space 10371 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 10372 t = types.length; 10373 while ( t-- ) { 10374 tmp = rtypenamespace.exec( types[ t ] ) || []; 10375 type = origType = tmp[ 1 ]; 10376 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 10377 10378 // There *must* be a type, no attaching namespace-only handlers 10379 if ( !type ) { 10380 continue; 10381 } 10382 10383 // If event changes its type, use the special event handlers for the changed type 10384 special = jQuery.event.special[ type ] || {}; 10385 10386 // If selector defined, determine special event api type, otherwise given type 10387 type = ( selector ? special.delegateType : special.bindType ) || type; 10388 10389 // Update special based on newly reset type 10390 special = jQuery.event.special[ type ] || {}; 10391 10392 // handleObj is passed to all event handlers 10393 handleObj = jQuery.extend( { 10394 type: type, 10395 origType: origType, 10396 data: data, 10397 handler: handler, 10398 guid: handler.guid, 10399 selector: selector, 10400 needsContext: selector && jQuery.expr.match.needsContext.test( selector ), 10401 namespace: namespaces.join( "." ) 10402 }, handleObjIn ); 10403 10404 // Init the event handler queue if we're the first 10405 if ( !( handlers = events[ type ] ) ) { 10406 handlers = events[ type ] = []; 10407 handlers.delegateCount = 0; 10408 10409 // Only use addEventListener if the special events handler returns false 10410 if ( !special.setup || 10411 special.setup.call( elem, data, namespaces, eventHandle ) === false ) { 10412 10413 if ( elem.addEventListener ) { 10414 elem.addEventListener( type, eventHandle ); 10415 } 10416 } 10417 } 10418 10419 if ( special.add ) { 10420 special.add.call( elem, handleObj ); 10421 10422 if ( !handleObj.handler.guid ) { 10423 handleObj.handler.guid = handler.guid; 10424 } 10425 } 10426 10427 // Add to the element's handler list, delegates in front 10428 if ( selector ) { 10429 handlers.splice( handlers.delegateCount++, 0, handleObj ); 10430 } else { 10431 handlers.push( handleObj ); 10432 } 10433 10434 // Keep track of which events have ever been used, for event optimization 10435 jQuery.event.global[ type ] = true; 10436 } 10437 10438 }, 10439 10440 // Detach an event or set of events from an element 10441 remove: function( elem, types, handler, selector, mappedTypes ) { 10442 10443 var j, origCount, tmp, 10444 events, t, handleObj, 10445 special, handlers, type, namespaces, origType, 10446 elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); 10447 10448 if ( !elemData || !( events = elemData.events ) ) { 10449 return; 10450 } 10451 10452 // Once for each type.namespace in types; type may be omitted 10453 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 10454 t = types.length; 10455 while ( t-- ) { 10456 tmp = rtypenamespace.exec( types[ t ] ) || []; 10457 type = origType = tmp[ 1 ]; 10458 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 10459 10460 // Unbind all events (on this namespace, if provided) for the element 10461 if ( !type ) { 10462 for ( type in events ) { 10463 jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); 10464 } 10465 continue; 10466 } 10467 10468 special = jQuery.event.special[ type ] || {}; 10469 type = ( selector ? special.delegateType : special.bindType ) || type; 10470 handlers = events[ type ] || []; 10471 tmp = tmp[ 2 ] && 10472 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); 10473 10474 // Remove matching events 10475 origCount = j = handlers.length; 10476 while ( j-- ) { 10477 handleObj = handlers[ j ]; 10478 10479 if ( ( mappedTypes || origType === handleObj.origType ) && 10480 ( !handler || handler.guid === handleObj.guid ) && 10481 ( !tmp || tmp.test( handleObj.namespace ) ) && 10482 ( !selector || selector === handleObj.selector || 10483 selector === "**" && handleObj.selector ) ) { 10484 handlers.splice( j, 1 ); 10485 10486 if ( handleObj.selector ) { 10487 handlers.delegateCount--; 10488 } 10489 if ( special.remove ) { 10490 special.remove.call( elem, handleObj ); 10491 } 10492 } 10493 } 10494 10495 // Remove generic event handler if we removed something and no more handlers exist 10496 // (avoids potential for endless recursion during removal of special event handlers) 10497 if ( origCount && !handlers.length ) { 10498 if ( !special.teardown || 10499 special.teardown.call( elem, namespaces, elemData.handle ) === false ) { 10500 10501 jQuery.removeEvent( elem, type, elemData.handle ); 10502 } 10503 10504 delete events[ type ]; 10505 } 10506 } 10507 10508 // Remove data and the expando if it's no longer used 10509 if ( jQuery.isEmptyObject( events ) ) { 10510 dataPriv.remove( elem, "handle events" ); 10511 } 10512 }, 10513 10514 dispatch: function( nativeEvent ) { 10515 10516 var i, j, ret, matched, handleObj, handlerQueue, 10517 args = new Array( arguments.length ), 10518 10519 // Make a writable jQuery.Event from the native event object 10520 event = jQuery.event.fix( nativeEvent ), 10521 10522 handlers = ( 10523 dataPriv.get( this, "events" ) || Object.create( null ) 10524 )[ event.type ] || [], 10525 special = jQuery.event.special[ event.type ] || {}; 10526 10527 // Use the fix-ed jQuery.Event rather than the (read-only) native event 10528 args[ 0 ] = event; 10529 10530 for ( i = 1; i < arguments.length; i++ ) { 10531 args[ i ] = arguments[ i ]; 10532 } 10533 10534 event.delegateTarget = this; 10535 10536 // Call the preDispatch hook for the mapped type, and let it bail if desired 10537 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { 10538 return; 10539 } 10540 10541 // Determine handlers 10542 handlerQueue = jQuery.event.handlers.call( this, event, handlers ); 10543 10544 // Run delegates first; they may want to stop propagation beneath us 10545 i = 0; 10546 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { 10547 event.currentTarget = matched.elem; 10548 10549 j = 0; 10550 while ( ( handleObj = matched.handlers[ j++ ] ) && 10551 !event.isImmediatePropagationStopped() ) { 10552 10553 // If the event is namespaced, then each handler is only invoked if it is 10554 // specially universal or its namespaces are a superset of the event's. 10555 if ( !event.rnamespace || handleObj.namespace === false || 10556 event.rnamespace.test( handleObj.namespace ) ) { 10557 10558 event.handleObj = handleObj; 10559 event.data = handleObj.data; 10560 10561 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || 10562 handleObj.handler ).apply( matched.elem, args ); 10563 10564 if ( ret !== undefined ) { 10565 if ( ( event.result = ret ) === false ) { 10566 event.preventDefault(); 10567 event.stopPropagation(); 10568 } 10569 } 10570 } 10571 } 10572 } 10573 10574 // Call the postDispatch hook for the mapped type 10575 if ( special.postDispatch ) { 10576 special.postDispatch.call( this, event ); 10577 } 10578 10579 return event.result; 10580 }, 10581 10582 handlers: function( event, handlers ) { 10583 var i, handleObj, sel, matchedHandlers, matchedSelectors, 10584 handlerQueue = [], 10585 delegateCount = handlers.delegateCount, 10586 cur = event.target; 10587 10588 // Find delegate handlers 10589 if ( delegateCount && 10590 10591 // Support: IE <=9 10592 // Black-hole SVG <use> instance trees (trac-13180) 10593 cur.nodeType && 10594 10595 // Support: Firefox <=42 10596 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) 10597 // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click 10598 // Support: IE 11 only 10599 // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) 10600 !( event.type === "click" && event.button >= 1 ) ) { 10601 10602 for ( ; cur !== this; cur = cur.parentNode || this ) { 10603 10604 // Don't check non-elements (trac-13208) 10605 // Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764) 10606 if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { 10607 matchedHandlers = []; 10608 matchedSelectors = {}; 10609 for ( i = 0; i < delegateCount; i++ ) { 10610 handleObj = handlers[ i ]; 10611 10612 // Don't conflict with Object.prototype properties (trac-13203) 10613 sel = handleObj.selector + " "; 10614 10615 if ( matchedSelectors[ sel ] === undefined ) { 10616 matchedSelectors[ sel ] = handleObj.needsContext ? 10617 jQuery( sel, this ).index( cur ) > -1 : 10618 jQuery.find( sel, this, null, [ cur ] ).length; 10619 } 10620 if ( matchedSelectors[ sel ] ) { 10621 matchedHandlers.push( handleObj ); 10622 } 10623 } 10624 if ( matchedHandlers.length ) { 10625 handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); 10626 } 10627 } 10628 } 10629 } 10630 10631 // Add the remaining (directly-bound) handlers 10632 cur = this; 10633 if ( delegateCount < handlers.length ) { 10634 handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); 10635 } 10636 10637 return handlerQueue; 10638 }, 10639 10640 addProp: function( name, hook ) { 10641 Object.defineProperty( jQuery.Event.prototype, name, { 10642 enumerable: true, 10643 configurable: true, 10644 10645 get: isFunction( hook ) ? 10646 function() { 10647 if ( this.originalEvent ) { 10648 return hook( this.originalEvent ); 10649 } 10650 } : 10651 function() { 10652 if ( this.originalEvent ) { 10653 return this.originalEvent[ name ]; 10654 } 10655 }, 10656 10657 set: function( value ) { 10658 Object.defineProperty( this, name, { 10659 enumerable: true, 10660 configurable: true, 10661 writable: true, 10662 value: value 10663 } ); 10664 } 10665 } ); 10666 }, 10667 10668 fix: function( originalEvent ) { 10669 return originalEvent[ jQuery.expando ] ? 10670 originalEvent : 10671 new jQuery.Event( originalEvent ); 10672 }, 10673 10674 special: { 10675 load: { 10676 10677 // Prevent triggered image.load events from bubbling to window.load 10678 noBubble: true 10679 }, 10680 click: { 10681 10682 // Utilize native event to ensure correct state for checkable inputs 10683 setup: function( data ) { 10684 10685 // For mutual compressibility with _default, replace `this` access with a local var. 10686 // `|| data` is dead code meant only to preserve the variable through minification. 10687 var el = this || data; 10688 10689 // Claim the first handler 10690 if ( rcheckableType.test( el.type ) && 10691 el.click && nodeName( el, "input" ) ) { 10692 10693 // dataPriv.set( el, "click", ... ) 10694 leverageNative( el, "click", true ); 10695 } 10696 10697 // Return false to allow normal processing in the caller 10698 return false; 10699 }, 10700 trigger: function( data ) { 10701 10702 // For mutual compressibility with _default, replace `this` access with a local var. 10703 // `|| data` is dead code meant only to preserve the variable through minification. 10704 var el = this || data; 10705 10706 // Force setup before triggering a click 10707 if ( rcheckableType.test( el.type ) && 10708 el.click && nodeName( el, "input" ) ) { 10709 10710 leverageNative( el, "click" ); 10711 } 10712 10713 // Return non-false to allow normal event-path propagation 10714 return true; 10715 }, 10716 10717 // For cross-browser consistency, suppress native .click() on links 10718 // Also prevent it if we're currently inside a leveraged native-event stack 10719 _default: function( event ) { 10720 var target = event.target; 10721 return rcheckableType.test( target.type ) && 10722 target.click && nodeName( target, "input" ) && 10723 dataPriv.get( target, "click" ) || 10724 nodeName( target, "a" ); 10725 } 10726 }, 10727 10728 beforeunload: { 10729 postDispatch: function( event ) { 10730 10731 // Support: Firefox 20+ 10732 // Firefox doesn't alert if the returnValue field is not set. 10733 if ( event.result !== undefined && event.originalEvent ) { 10734 event.originalEvent.returnValue = event.result; 10735 } 10736 } 10737 } 10738 } 10739}; 10740 10741// Ensure the presence of an event listener that handles manually-triggered 10742// synthetic events by interrupting progress until reinvoked in response to 10743// *native* events that it fires directly, ensuring that state changes have 10744// already occurred before other listeners are invoked. 10745function leverageNative( el, type, isSetup ) { 10746 10747 // Missing `isSetup` indicates a trigger call, which must force setup through jQuery.event.add 10748 if ( !isSetup ) { 10749 if ( dataPriv.get( el, type ) === undefined ) { 10750 jQuery.event.add( el, type, returnTrue ); 10751 } 10752 return; 10753 } 10754 10755 // Register the controller as a special universal handler for all event namespaces 10756 dataPriv.set( el, type, false ); 10757 jQuery.event.add( el, type, { 10758 namespace: false, 10759 handler: function( event ) { 10760 var result, 10761 saved = dataPriv.get( this, type ); 10762 10763 if ( ( event.isTrigger & 1 ) && this[ type ] ) { 10764 10765 // Interrupt processing of the outer synthetic .trigger()ed event 10766 if ( !saved ) { 10767 10768 // Store arguments for use when handling the inner native event 10769 // There will always be at least one argument (an event object), so this array 10770 // will not be confused with a leftover capture object. 10771 saved = slice.call( arguments ); 10772 dataPriv.set( this, type, saved ); 10773 10774 // Trigger the native event and capture its result 10775 this[ type ](); 10776 result = dataPriv.get( this, type ); 10777 dataPriv.set( this, type, false ); 10778 10779 if ( saved !== result ) { 10780 10781 // Cancel the outer synthetic event 10782 event.stopImmediatePropagation(); 10783 event.preventDefault(); 10784 10785 return result; 10786 } 10787 10788 // If this is an inner synthetic event for an event with a bubbling surrogate 10789 // (focus or blur), assume that the surrogate already propagated from triggering 10790 // the native event and prevent that from happening again here. 10791 // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the 10792 // bubbling surrogate propagates *after* the non-bubbling base), but that seems 10793 // less bad than duplication. 10794 } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { 10795 event.stopPropagation(); 10796 } 10797 10798 // If this is a native event triggered above, everything is now in order 10799 // Fire an inner synthetic event with the original arguments 10800 } else if ( saved ) { 10801 10802 // ...and capture the result 10803 dataPriv.set( this, type, jQuery.event.trigger( 10804 saved[ 0 ], 10805 saved.slice( 1 ), 10806 this 10807 ) ); 10808 10809 // Abort handling of the native event by all jQuery handlers while allowing 10810 // native handlers on the same element to run. On target, this is achieved 10811 // by stopping immediate propagation just on the jQuery event. However, 10812 // the native event is re-wrapped by a jQuery one on each level of the 10813 // propagation so the only way to stop it for jQuery is to stop it for 10814 // everyone via native `stopPropagation()`. This is not a problem for 10815 // focus/blur which don't bubble, but it does also stop click on checkboxes 10816 // and radios. We accept this limitation. 10817 event.stopPropagation(); 10818 event.isImmediatePropagationStopped = returnTrue; 10819 } 10820 } 10821 } ); 10822} 10823 10824jQuery.removeEvent = function( elem, type, handle ) { 10825 10826 // This "if" is needed for plain objects 10827 if ( elem.removeEventListener ) { 10828 elem.removeEventListener( type, handle ); 10829 } 10830}; 10831 10832jQuery.Event = function( src, props ) { 10833 10834 // Allow instantiation without the 'new' keyword 10835 if ( !( this instanceof jQuery.Event ) ) { 10836 return new jQuery.Event( src, props ); 10837 } 10838 10839 // Event object 10840 if ( src && src.type ) { 10841 this.originalEvent = src; 10842 this.type = src.type; 10843 10844 // Events bubbling up the document may have been marked as prevented 10845 // by a handler lower down the tree; reflect the correct value. 10846 this.isDefaultPrevented = src.defaultPrevented || 10847 src.defaultPrevented === undefined && 10848 10849 // Support: Android <=2.3 only 10850 src.returnValue === false ? 10851 returnTrue : 10852 returnFalse; 10853 10854 // Create target properties 10855 // Support: Safari <=6 - 7 only 10856 // Target should not be a text node (trac-504, trac-13143) 10857 this.target = ( src.target && src.target.nodeType === 3 ) ? 10858 src.target.parentNode : 10859 src.target; 10860 10861 this.currentTarget = src.currentTarget; 10862 this.relatedTarget = src.relatedTarget; 10863 10864 // Event type 10865 } else { 10866 this.type = src; 10867 } 10868 10869 // Put explicitly provided properties onto the event object 10870 if ( props ) { 10871 jQuery.extend( this, props ); 10872 } 10873 10874 // Create a timestamp if incoming event doesn't have one 10875 this.timeStamp = src && src.timeStamp || Date.now(); 10876 10877 // Mark it as fixed 10878 this[ jQuery.expando ] = true; 10879}; 10880 10881// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 10882// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 10883jQuery.Event.prototype = { 10884 constructor: jQuery.Event, 10885 isDefaultPrevented: returnFalse, 10886 isPropagationStopped: returnFalse, 10887 isImmediatePropagationStopped: returnFalse, 10888 isSimulated: false, 10889 10890 preventDefault: function() { 10891 var e = this.originalEvent; 10892 10893 this.isDefaultPrevented = returnTrue; 10894 10895 if ( e && !this.isSimulated ) { 10896 e.preventDefault(); 10897 } 10898 }, 10899 stopPropagation: function() { 10900 var e = this.originalEvent; 10901 10902 this.isPropagationStopped = returnTrue; 10903 10904 if ( e && !this.isSimulated ) { 10905 e.stopPropagation(); 10906 } 10907 }, 10908 stopImmediatePropagation: function() { 10909 var e = this.originalEvent; 10910 10911 this.isImmediatePropagationStopped = returnTrue; 10912 10913 if ( e && !this.isSimulated ) { 10914 e.stopImmediatePropagation(); 10915 } 10916 10917 this.stopPropagation(); 10918 } 10919}; 10920 10921// Includes all common event props including KeyEvent and MouseEvent specific props 10922jQuery.each( { 10923 altKey: true, 10924 bubbles: true, 10925 cancelable: true, 10926 changedTouches: true, 10927 ctrlKey: true, 10928 detail: true, 10929 eventPhase: true, 10930 metaKey: true, 10931 pageX: true, 10932 pageY: true, 10933 shiftKey: true, 10934 view: true, 10935 "char": true, 10936 code: true, 10937 charCode: true, 10938 key: true, 10939 keyCode: true, 10940 button: true, 10941 buttons: true, 10942 clientX: true, 10943 clientY: true, 10944 offsetX: true, 10945 offsetY: true, 10946 pointerId: true, 10947 pointerType: true, 10948 screenX: true, 10949 screenY: true, 10950 targetTouches: true, 10951 toElement: true, 10952 touches: true, 10953 which: true 10954}, jQuery.event.addProp ); 10955 10956jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { 10957 10958 function focusMappedHandler( nativeEvent ) { 10959 if ( document.documentMode ) { 10960 10961 // Support: IE 11+ 10962 // Attach a single focusin/focusout handler on the document while someone wants 10963 // focus/blur. This is because the former are synchronous in IE while the latter 10964 // are async. In other browsers, all those handlers are invoked synchronously. 10965 10966 // `handle` from private data would already wrap the event, but we need 10967 // to change the `type` here. 10968 var handle = dataPriv.get( this, "handle" ), 10969 event = jQuery.event.fix( nativeEvent ); 10970 event.type = nativeEvent.type === "focusin" ? "focus" : "blur"; 10971 event.isSimulated = true; 10972 10973 // First, handle focusin/focusout 10974 handle( nativeEvent ); 10975 10976 // ...then, handle focus/blur 10977 // 10978 // focus/blur don't bubble while focusin/focusout do; simulate the former by only 10979 // invoking the handler at the lower level. 10980 if ( event.target === event.currentTarget ) { 10981 10982 // The setup part calls `leverageNative`, which, in turn, calls 10983 // `jQuery.event.add`, so event handle will already have been set 10984 // by this point. 10985 handle( event ); 10986 } 10987 } else { 10988 10989 // For non-IE browsers, attach a single capturing handler on the document 10990 // while someone wants focusin/focusout. 10991 jQuery.event.simulate( delegateType, nativeEvent.target, 10992 jQuery.event.fix( nativeEvent ) ); 10993 } 10994 } 10995 10996 jQuery.event.special[ type ] = { 10997 10998 // Utilize native event if possible so blur/focus sequence is correct 10999 setup: function() { 11000 11001 var attaches; 11002 11003 // Claim the first handler 11004 // dataPriv.set( this, "focus", ... ) 11005 // dataPriv.set( this, "blur", ... ) 11006 leverageNative( this, type, true ); 11007 11008 if ( document.documentMode ) { 11009 11010 // Support: IE 9 - 11+ 11011 // We use the same native handler for focusin & focus (and focusout & blur) 11012 // so we need to coordinate setup & teardown parts between those events. 11013 // Use `delegateType` as the key as `type` is already used by `leverageNative`. 11014 attaches = dataPriv.get( this, delegateType ); 11015 if ( !attaches ) { 11016 this.addEventListener( delegateType, focusMappedHandler ); 11017 } 11018 dataPriv.set( this, delegateType, ( attaches || 0 ) + 1 ); 11019 } else { 11020 11021 // Return false to allow normal processing in the caller 11022 return false; 11023 } 11024 }, 11025 trigger: function() { 11026 11027 // Force setup before trigger 11028 leverageNative( this, type ); 11029 11030 // Return non-false to allow normal event-path propagation 11031 return true; 11032 }, 11033 11034 teardown: function() { 11035 var attaches; 11036 11037 if ( document.documentMode ) { 11038 attaches = dataPriv.get( this, delegateType ) - 1; 11039 if ( !attaches ) { 11040 this.removeEventListener( delegateType, focusMappedHandler ); 11041 dataPriv.remove( this, delegateType ); 11042 } else { 11043 dataPriv.set( this, delegateType, attaches ); 11044 } 11045 } else { 11046 11047 // Return false to indicate standard teardown should be applied 11048 return false; 11049 } 11050 }, 11051 11052 // Suppress native focus or blur if we're currently inside 11053 // a leveraged native-event stack 11054 _default: function( event ) { 11055 return dataPriv.get( event.target, type ); 11056 }, 11057 11058 delegateType: delegateType 11059 }; 11060 11061 // Support: Firefox <=44 11062 // Firefox doesn't have focus(in | out) events 11063 // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 11064 // 11065 // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 11066 // focus(in | out) events fire after focus & blur events, 11067 // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order 11068 // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 11069 // 11070 // Support: IE 9 - 11+ 11071 // To preserve relative focusin/focus & focusout/blur event order guaranteed on the 3.x branch, 11072 // attach a single handler for both events in IE. 11073 jQuery.event.special[ delegateType ] = { 11074 setup: function() { 11075 11076 // Handle: regular nodes (via `this.ownerDocument`), window 11077 // (via `this.document`) & document (via `this`). 11078 var doc = this.ownerDocument || this.document || this, 11079 dataHolder = document.documentMode ? this : doc, 11080 attaches = dataPriv.get( dataHolder, delegateType ); 11081 11082 // Support: IE 9 - 11+ 11083 // We use the same native handler for focusin & focus (and focusout & blur) 11084 // so we need to coordinate setup & teardown parts between those events. 11085 // Use `delegateType` as the key as `type` is already used by `leverageNative`. 11086 if ( !attaches ) { 11087 if ( document.documentMode ) { 11088 this.addEventListener( delegateType, focusMappedHandler ); 11089 } else { 11090 doc.addEventListener( type, focusMappedHandler, true ); 11091 } 11092 } 11093 dataPriv.set( dataHolder, delegateType, ( attaches || 0 ) + 1 ); 11094 }, 11095 teardown: function() { 11096 var doc = this.ownerDocument || this.document || this, 11097 dataHolder = document.documentMode ? this : doc, 11098 attaches = dataPriv.get( dataHolder, delegateType ) - 1; 11099 11100 if ( !attaches ) { 11101 if ( document.documentMode ) { 11102 this.removeEventListener( delegateType, focusMappedHandler ); 11103 } else { 11104 doc.removeEventListener( type, focusMappedHandler, true ); 11105 } 11106 dataPriv.remove( dataHolder, delegateType ); 11107 } else { 11108 dataPriv.set( dataHolder, delegateType, attaches ); 11109 } 11110 } 11111 }; 11112} ); 11113 11114// Create mouseenter/leave events using mouseover/out and event-time checks 11115// so that event delegation works in jQuery. 11116// Do the same for pointerenter/pointerleave and pointerover/pointerout 11117// 11118// Support: Safari 7 only 11119// Safari sends mouseenter too often; see: 11120// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 11121// for the description of the bug (it existed in older Chrome versions as well). 11122jQuery.each( { 11123 mouseenter: "mouseover", 11124 mouseleave: "mouseout", 11125 pointerenter: "pointerover", 11126 pointerleave: "pointerout" 11127}, function( orig, fix ) { 11128 jQuery.event.special[ orig ] = { 11129 delegateType: fix, 11130 bindType: fix, 11131 11132 handle: function( event ) { 11133 var ret, 11134 target = this, 11135 related = event.relatedTarget, 11136 handleObj = event.handleObj; 11137 11138 // For mouseenter/leave call the handler if related is outside the target. 11139 // NB: No relatedTarget if the mouse left/entered the browser window 11140 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { 11141 event.type = handleObj.origType; 11142 ret = handleObj.handler.apply( this, arguments ); 11143 event.type = fix; 11144 } 11145 return ret; 11146 } 11147 }; 11148} ); 11149 11150jQuery.fn.extend( { 11151 11152 on: function( types, selector, data, fn ) { 11153 return on( this, types, selector, data, fn ); 11154 }, 11155 one: function( types, selector, data, fn ) { 11156 return on( this, types, selector, data, fn, 1 ); 11157 }, 11158 off: function( types, selector, fn ) { 11159 var handleObj, type; 11160 if ( types && types.preventDefault && types.handleObj ) { 11161 11162 // ( event ) dispatched jQuery.Event 11163 handleObj = types.handleObj; 11164 jQuery( types.delegateTarget ).off( 11165 handleObj.namespace ? 11166 handleObj.origType + "." + handleObj.namespace : 11167 handleObj.origType, 11168 handleObj.selector, 11169 handleObj.handler 11170 ); 11171 return this; 11172 } 11173 if ( typeof types === "object" ) { 11174 11175 // ( types-object [, selector] ) 11176 for ( type in types ) { 11177 this.off( type, selector, types[ type ] ); 11178 } 11179 return this; 11180 } 11181 if ( selector === false || typeof selector === "function" ) { 11182 11183 // ( types [, fn] ) 11184 fn = selector; 11185 selector = undefined; 11186 } 11187 if ( fn === false ) { 11188 fn = returnFalse; 11189 } 11190 return this.each( function() { 11191 jQuery.event.remove( this, types, fn, selector ); 11192 } ); 11193 } 11194} ); 11195 11196 11197var 11198 11199 // Support: IE <=10 - 11, Edge 12 - 13 only 11200 // In IE/Edge using regex groups here causes severe slowdowns. 11201 // See https://connect.microsoft.com/IE/feedback/details/1736512/ 11202 rnoInnerhtml = /<script|<style|<link/i, 11203 11204 // checked="checked" or checked 11205 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 11206 11207 rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g; 11208 11209// Prefer a tbody over its parent table for containing new rows 11210function manipulationTarget( elem, content ) { 11211 if ( nodeName( elem, "table" ) && 11212 nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { 11213 11214 return jQuery( elem ).children( "tbody" )[ 0 ] || elem; 11215 } 11216 11217 return elem; 11218} 11219 11220// Replace/restore the type attribute of script elements for safe DOM manipulation 11221function disableScript( elem ) { 11222 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; 11223 return elem; 11224} 11225function restoreScript( elem ) { 11226 if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { 11227 elem.type = elem.type.slice( 5 ); 11228 } else { 11229 elem.removeAttribute( "type" ); 11230 } 11231 11232 return elem; 11233} 11234 11235function cloneCopyEvent( src, dest ) { 11236 var i, l, type, pdataOld, udataOld, udataCur, events; 11237 11238 if ( dest.nodeType !== 1 ) { 11239 return; 11240 } 11241 11242 // 1. Copy private data: events, handlers, etc. 11243 if ( dataPriv.hasData( src ) ) { 11244 pdataOld = dataPriv.get( src ); 11245 events = pdataOld.events; 11246 11247 if ( events ) { 11248 dataPriv.remove( dest, "handle events" ); 11249 11250 for ( type in events ) { 11251 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 11252 jQuery.event.add( dest, type, events[ type ][ i ] ); 11253 } 11254 } 11255 } 11256 } 11257 11258 // 2. Copy user data 11259 if ( dataUser.hasData( src ) ) { 11260 udataOld = dataUser.access( src ); 11261 udataCur = jQuery.extend( {}, udataOld ); 11262 11263 dataUser.set( dest, udataCur ); 11264 } 11265} 11266 11267// Fix IE bugs, see support tests 11268function fixInput( src, dest ) { 11269 var nodeName = dest.nodeName.toLowerCase(); 11270 11271 // Fails to persist the checked state of a cloned checkbox or radio button. 11272 if ( nodeName === "input" && rcheckableType.test( src.type ) ) { 11273 dest.checked = src.checked; 11274 11275 // Fails to return the selected option to the default selected state when cloning options 11276 } else if ( nodeName === "input" || nodeName === "textarea" ) { 11277 dest.defaultValue = src.defaultValue; 11278 } 11279} 11280 11281function domManip( collection, args, callback, ignored ) { 11282 11283 // Flatten any nested arrays 11284 args = flat( args ); 11285 11286 var fragment, first, scripts, hasScripts, node, doc, 11287 i = 0, 11288 l = collection.length, 11289 iNoClone = l - 1, 11290 value = args[ 0 ], 11291 valueIsFunction = isFunction( value ); 11292 11293 // We can't cloneNode fragments that contain checked, in WebKit 11294 if ( valueIsFunction || 11295 ( l > 1 && typeof value === "string" && 11296 !support.checkClone && rchecked.test( value ) ) ) { 11297 return collection.each( function( index ) { 11298 var self = collection.eq( index ); 11299 if ( valueIsFunction ) { 11300 args[ 0 ] = value.call( this, index, self.html() ); 11301 } 11302 domManip( self, args, callback, ignored ); 11303 } ); 11304 } 11305 11306 if ( l ) { 11307 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); 11308 first = fragment.firstChild; 11309 11310 if ( fragment.childNodes.length === 1 ) { 11311 fragment = first; 11312 } 11313 11314 // Require either new content or an interest in ignored elements to invoke the callback 11315 if ( first || ignored ) { 11316 scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); 11317 hasScripts = scripts.length; 11318 11319 // Use the original fragment for the last item 11320 // instead of the first because it can end up 11321 // being emptied incorrectly in certain situations (trac-8070). 11322 for ( ; i < l; i++ ) { 11323 node = fragment; 11324 11325 if ( i !== iNoClone ) { 11326 node = jQuery.clone( node, true, true ); 11327 11328 // Keep references to cloned scripts for later restoration 11329 if ( hasScripts ) { 11330 11331 // Support: Android <=4.0 only, PhantomJS 1 only 11332 // push.apply(_, arraylike) throws on ancient WebKit 11333 jQuery.merge( scripts, getAll( node, "script" ) ); 11334 } 11335 } 11336 11337 callback.call( collection[ i ], node, i ); 11338 } 11339 11340 if ( hasScripts ) { 11341 doc = scripts[ scripts.length - 1 ].ownerDocument; 11342 11343 // Re-enable scripts 11344 jQuery.map( scripts, restoreScript ); 11345 11346 // Evaluate executable scripts on first document insertion 11347 for ( i = 0; i < hasScripts; i++ ) { 11348 node = scripts[ i ]; 11349 if ( rscriptType.test( node.type || "" ) && 11350 !dataPriv.access( node, "globalEval" ) && 11351 jQuery.contains( doc, node ) ) { 11352 11353 if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { 11354 11355 // Optional AJAX dependency, but won't run scripts if not present 11356 if ( jQuery._evalUrl && !node.noModule ) { 11357 jQuery._evalUrl( node.src, { 11358 nonce: node.nonce || node.getAttribute( "nonce" ) 11359 }, doc ); 11360 } 11361 } else { 11362 11363 // Unwrap a CDATA section containing script contents. This shouldn't be 11364 // needed as in XML documents they're already not visible when 11365 // inspecting element contents and in HTML documents they have no 11366 // meaning but we're preserving that logic for backwards compatibility. 11367 // This will be removed completely in 4.0. See gh-4904. 11368 DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); 11369 } 11370 } 11371 } 11372 } 11373 } 11374 } 11375 11376 return collection; 11377} 11378 11379function remove( elem, selector, keepData ) { 11380 var node, 11381 nodes = selector ? jQuery.filter( selector, elem ) : elem, 11382 i = 0; 11383 11384 for ( ; ( node = nodes[ i ] ) != null; i++ ) { 11385 if ( !keepData && node.nodeType === 1 ) { 11386 jQuery.cleanData( getAll( node ) ); 11387 } 11388 11389 if ( node.parentNode ) { 11390 if ( keepData && isAttached( node ) ) { 11391 setGlobalEval( getAll( node, "script" ) ); 11392 } 11393 node.parentNode.removeChild( node ); 11394 } 11395 } 11396 11397 return elem; 11398} 11399 11400jQuery.extend( { 11401 htmlPrefilter: function( html ) { 11402 return html; 11403 }, 11404 11405 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 11406 var i, l, srcElements, destElements, 11407 clone = elem.cloneNode( true ), 11408 inPage = isAttached( elem ); 11409 11410 // Fix IE cloning issues 11411 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && 11412 !jQuery.isXMLDoc( elem ) ) { 11413 11414 // We eschew jQuery#find here for performance reasons: 11415 // https://jsperf.com/getall-vs-sizzle/2 11416 destElements = getAll( clone ); 11417 srcElements = getAll( elem ); 11418 11419 for ( i = 0, l = srcElements.length; i < l; i++ ) { 11420 fixInput( srcElements[ i ], destElements[ i ] ); 11421 } 11422 } 11423 11424 // Copy the events from the original to the clone 11425 if ( dataAndEvents ) { 11426 if ( deepDataAndEvents ) { 11427 srcElements = srcElements || getAll( elem ); 11428 destElements = destElements || getAll( clone ); 11429 11430 for ( i = 0, l = srcElements.length; i < l; i++ ) { 11431 cloneCopyEvent( srcElements[ i ], destElements[ i ] ); 11432 } 11433 } else { 11434 cloneCopyEvent( elem, clone ); 11435 } 11436 } 11437 11438 // Preserve script evaluation history 11439 destElements = getAll( clone, "script" ); 11440 if ( destElements.length > 0 ) { 11441 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); 11442 } 11443 11444 // Return the cloned set 11445 return clone; 11446 }, 11447 11448 cleanData: function( elems ) { 11449 var data, elem, type, 11450 special = jQuery.event.special, 11451 i = 0; 11452 11453 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { 11454 if ( acceptData( elem ) ) { 11455 if ( ( data = elem[ dataPriv.expando ] ) ) { 11456 if ( data.events ) { 11457 for ( type in data.events ) { 11458 if ( special[ type ] ) { 11459 jQuery.event.remove( elem, type ); 11460 11461 // This is a shortcut to avoid jQuery.event.remove's overhead 11462 } else { 11463 jQuery.removeEvent( elem, type, data.handle ); 11464 } 11465 } 11466 } 11467 11468 // Support: Chrome <=35 - 45+ 11469 // Assign undefined instead of using delete, see Data#remove 11470 elem[ dataPriv.expando ] = undefined; 11471 } 11472 if ( elem[ dataUser.expando ] ) { 11473 11474 // Support: Chrome <=35 - 45+ 11475 // Assign undefined instead of using delete, see Data#remove 11476 elem[ dataUser.expando ] = undefined; 11477 } 11478 } 11479 } 11480 } 11481} ); 11482 11483jQuery.fn.extend( { 11484 detach: function( selector ) { 11485 return remove( this, selector, true ); 11486 }, 11487 11488 remove: function( selector ) { 11489 return remove( this, selector ); 11490 }, 11491 11492 text: function( value ) { 11493 return access( this, function( value ) { 11494 return value === undefined ? 11495 jQuery.text( this ) : 11496 this.empty().each( function() { 11497 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 11498 this.textContent = value; 11499 } 11500 } ); 11501 }, null, value, arguments.length ); 11502 }, 11503 11504 append: function() { 11505 return domManip( this, arguments, function( elem ) { 11506 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 11507 var target = manipulationTarget( this, elem ); 11508 target.appendChild( elem ); 11509 } 11510 } ); 11511 }, 11512 11513 prepend: function() { 11514 return domManip( this, arguments, function( elem ) { 11515 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 11516 var target = manipulationTarget( this, elem ); 11517 target.insertBefore( elem, target.firstChild ); 11518 } 11519 } ); 11520 }, 11521 11522 before: function() { 11523 return domManip( this, arguments, function( elem ) { 11524 if ( this.parentNode ) { 11525 this.parentNode.insertBefore( elem, this ); 11526 } 11527 } ); 11528 }, 11529 11530 after: function() { 11531 return domManip( this, arguments, function( elem ) { 11532 if ( this.parentNode ) { 11533 this.parentNode.insertBefore( elem, this.nextSibling ); 11534 } 11535 } ); 11536 }, 11537 11538 empty: function() { 11539 var elem, 11540 i = 0; 11541 11542 for ( ; ( elem = this[ i ] ) != null; i++ ) { 11543 if ( elem.nodeType === 1 ) { 11544 11545 // Prevent memory leaks 11546 jQuery.cleanData( getAll( elem, false ) ); 11547 11548 // Remove any remaining nodes 11549 elem.textContent = ""; 11550 } 11551 } 11552 11553 return this; 11554 }, 11555 11556 clone: function( dataAndEvents, deepDataAndEvents ) { 11557 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 11558 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 11559 11560 return this.map( function() { 11561 return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); 11562 } ); 11563 }, 11564 11565 html: function( value ) { 11566 return access( this, function( value ) { 11567 var elem = this[ 0 ] || {}, 11568 i = 0, 11569 l = this.length; 11570 11571 if ( value === undefined && elem.nodeType === 1 ) { 11572 return elem.innerHTML; 11573 } 11574 11575 // See if we can take a shortcut and just use innerHTML 11576 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 11577 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { 11578 11579 value = jQuery.htmlPrefilter( value ); 11580 11581 try { 11582 for ( ; i < l; i++ ) { 11583 elem = this[ i ] || {}; 11584 11585 // Remove element nodes and prevent memory leaks 11586 if ( elem.nodeType === 1 ) { 11587 jQuery.cleanData( getAll( elem, false ) ); 11588 elem.innerHTML = value; 11589 } 11590 } 11591 11592 elem = 0; 11593 11594 // If using innerHTML throws an exception, use the fallback method 11595 } catch ( e ) {} 11596 } 11597 11598 if ( elem ) { 11599 this.empty().append( value ); 11600 } 11601 }, null, value, arguments.length ); 11602 }, 11603 11604 replaceWith: function() { 11605 var ignored = []; 11606 11607 // Make the changes, replacing each non-ignored context element with the new content 11608 return domManip( this, arguments, function( elem ) { 11609 var parent = this.parentNode; 11610 11611 if ( jQuery.inArray( this, ignored ) < 0 ) { 11612 jQuery.cleanData( getAll( this ) ); 11613 if ( parent ) { 11614 parent.replaceChild( elem, this ); 11615 } 11616 } 11617 11618 // Force callback invocation 11619 }, ignored ); 11620 } 11621} ); 11622 11623jQuery.each( { 11624 appendTo: "append", 11625 prependTo: "prepend", 11626 insertBefore: "before", 11627 insertAfter: "after", 11628 replaceAll: "replaceWith" 11629}, function( name, original ) { 11630 jQuery.fn[ name ] = function( selector ) { 11631 var elems, 11632 ret = [], 11633 insert = jQuery( selector ), 11634 last = insert.length - 1, 11635 i = 0; 11636 11637 for ( ; i <= last; i++ ) { 11638 elems = i === last ? this : this.clone( true ); 11639 jQuery( insert[ i ] )[ original ]( elems ); 11640 11641 // Support: Android <=4.0 only, PhantomJS 1 only 11642 // .get() because push.apply(_, arraylike) throws on ancient WebKit 11643 push.apply( ret, elems.get() ); 11644 } 11645 11646 return this.pushStack( ret ); 11647 }; 11648} ); 11649var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 11650 11651var rcustomProp = /^--/; 11652 11653 11654var getStyles = function( elem ) { 11655 11656 // Support: IE <=11 only, Firefox <=30 (trac-15098, trac-14150) 11657 // IE throws on elements created in popups 11658 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 11659 var view = elem.ownerDocument.defaultView; 11660 11661 if ( !view || !view.opener ) { 11662 view = window; 11663 } 11664 11665 return view.getComputedStyle( elem ); 11666 }; 11667 11668var swap = function( elem, options, callback ) { 11669 var ret, name, 11670 old = {}; 11671 11672 // Remember the old values, and insert the new ones 11673 for ( name in options ) { 11674 old[ name ] = elem.style[ name ]; 11675 elem.style[ name ] = options[ name ]; 11676 } 11677 11678 ret = callback.call( elem ); 11679 11680 // Revert the old values 11681 for ( name in options ) { 11682 elem.style[ name ] = old[ name ]; 11683 } 11684 11685 return ret; 11686}; 11687 11688 11689var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); 11690 11691 11692 11693( function() { 11694 11695 // Executing both pixelPosition & boxSizingReliable tests require only one layout 11696 // so they're executed at the same time to save the second computation. 11697 function computeStyleTests() { 11698 11699 // This is a singleton, we need to execute it only once 11700 if ( !div ) { 11701 return; 11702 } 11703 11704 container.style.cssText = "position:absolute;left:-11111px;width:60px;" + 11705 "margin-top:1px;padding:0;border:0"; 11706 div.style.cssText = 11707 "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + 11708 "margin:auto;border:1px;padding:1px;" + 11709 "width:60%;top:1%"; 11710 documentElement.appendChild( container ).appendChild( div ); 11711 11712 var divStyle = window.getComputedStyle( div ); 11713 pixelPositionVal = divStyle.top !== "1%"; 11714 11715 // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 11716 reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; 11717 11718 // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 11719 // Some styles come back with percentage values, even though they shouldn't 11720 div.style.right = "60%"; 11721 pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; 11722 11723 // Support: IE 9 - 11 only 11724 // Detect misreporting of content dimensions for box-sizing:border-box elements 11725 boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; 11726 11727 // Support: IE 9 only 11728 // Detect overflow:scroll screwiness (gh-3699) 11729 // Support: Chrome <=64 11730 // Don't get tricked when zoom affects offsetWidth (gh-4029) 11731 div.style.position = "absolute"; 11732 scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; 11733 11734 documentElement.removeChild( container ); 11735 11736 // Nullify the div so it wouldn't be stored in the memory and 11737 // it will also be a sign that checks already performed 11738 div = null; 11739 } 11740 11741 function roundPixelMeasures( measure ) { 11742 return Math.round( parseFloat( measure ) ); 11743 } 11744 11745 var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, 11746 reliableTrDimensionsVal, reliableMarginLeftVal, 11747 container = document.createElement( "div" ), 11748 div = document.createElement( "div" ); 11749 11750 // Finish early in limited (non-browser) environments 11751 if ( !div.style ) { 11752 return; 11753 } 11754 11755 // Support: IE <=9 - 11 only 11756 // Style of cloned element affects source element cloned (trac-8908) 11757 div.style.backgroundClip = "content-box"; 11758 div.cloneNode( true ).style.backgroundClip = ""; 11759 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 11760 11761 jQuery.extend( support, { 11762 boxSizingReliable: function() { 11763 computeStyleTests(); 11764 return boxSizingReliableVal; 11765 }, 11766 pixelBoxStyles: function() { 11767 computeStyleTests(); 11768 return pixelBoxStylesVal; 11769 }, 11770 pixelPosition: function() { 11771 computeStyleTests(); 11772 return pixelPositionVal; 11773 }, 11774 reliableMarginLeft: function() { 11775 computeStyleTests(); 11776 return reliableMarginLeftVal; 11777 }, 11778 scrollboxSize: function() { 11779 computeStyleTests(); 11780 return scrollboxSizeVal; 11781 }, 11782 11783 // Support: IE 9 - 11+, Edge 15 - 18+ 11784 // IE/Edge misreport `getComputedStyle` of table rows with width/height 11785 // set in CSS while `offset*` properties report correct values. 11786 // Behavior in IE 9 is more subtle than in newer versions & it passes 11787 // some versions of this test; make sure not to make it pass there! 11788 // 11789 // Support: Firefox 70+ 11790 // Only Firefox includes border widths 11791 // in computed dimensions. (gh-4529) 11792 reliableTrDimensions: function() { 11793 var table, tr, trChild, trStyle; 11794 if ( reliableTrDimensionsVal == null ) { 11795 table = document.createElement( "table" ); 11796 tr = document.createElement( "tr" ); 11797 trChild = document.createElement( "div" ); 11798 11799 table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"; 11800 tr.style.cssText = "box-sizing:content-box;border:1px solid"; 11801 11802 // Support: Chrome 86+ 11803 // Height set through cssText does not get applied. 11804 // Computed height then comes back as 0. 11805 tr.style.height = "1px"; 11806 trChild.style.height = "9px"; 11807 11808 // Support: Android 8 Chrome 86+ 11809 // In our bodyBackground.html iframe, 11810 // display for all div elements is set to "inline", 11811 // which causes a problem only in Android 8 Chrome 86. 11812 // Ensuring the div is `display: block` 11813 // gets around this issue. 11814 trChild.style.display = "block"; 11815 11816 documentElement 11817 .appendChild( table ) 11818 .appendChild( tr ) 11819 .appendChild( trChild ); 11820 11821 trStyle = window.getComputedStyle( tr ); 11822 reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) + 11823 parseInt( trStyle.borderTopWidth, 10 ) + 11824 parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight; 11825 11826 documentElement.removeChild( table ); 11827 } 11828 return reliableTrDimensionsVal; 11829 } 11830 } ); 11831} )(); 11832 11833 11834function curCSS( elem, name, computed ) { 11835 var width, minWidth, maxWidth, ret, 11836 isCustomProp = rcustomProp.test( name ), 11837 11838 // Support: Firefox 51+ 11839 // Retrieving style before computed somehow 11840 // fixes an issue with getting wrong values 11841 // on detached elements 11842 style = elem.style; 11843 11844 computed = computed || getStyles( elem ); 11845 11846 // getPropertyValue is needed for: 11847 // .css('filter') (IE 9 only, trac-12537) 11848 // .css('--customProperty) (gh-3144) 11849 if ( computed ) { 11850 11851 // Support: IE <=9 - 11+ 11852 // IE only supports `"float"` in `getPropertyValue`; in computed styles 11853 // it's only available as `"cssFloat"`. We no longer modify properties 11854 // sent to `.css()` apart from camelCasing, so we need to check both. 11855 // Normally, this would create difference in behavior: if 11856 // `getPropertyValue` returns an empty string, the value returned 11857 // by `.css()` would be `undefined`. This is usually the case for 11858 // disconnected elements. However, in IE even disconnected elements 11859 // with no styles return `"none"` for `getPropertyValue( "float" )` 11860 ret = computed.getPropertyValue( name ) || computed[ name ]; 11861 11862 if ( isCustomProp && ret ) { 11863 11864 // Support: Firefox 105+, Chrome <=105+ 11865 // Spec requires trimming whitespace for custom properties (gh-4926). 11866 // Firefox only trims leading whitespace. Chrome just collapses 11867 // both leading & trailing whitespace to a single space. 11868 // 11869 // Fall back to `undefined` if empty string returned. 11870 // This collapses a missing definition with property defined 11871 // and set to an empty string but there's no standard API 11872 // allowing us to differentiate them without a performance penalty 11873 // and returning `undefined` aligns with older jQuery. 11874 // 11875 // rtrimCSS treats U+000D CARRIAGE RETURN and U+000C FORM FEED 11876 // as whitespace while CSS does not, but this is not a problem 11877 // because CSS preprocessing replaces them with U+000A LINE FEED 11878 // (which *is* CSS whitespace) 11879 // https://www.w3.org/TR/css-syntax-3/#input-preprocessing 11880 ret = ret.replace( rtrimCSS, "$1" ) || undefined; 11881 } 11882 11883 if ( ret === "" && !isAttached( elem ) ) { 11884 ret = jQuery.style( elem, name ); 11885 } 11886 11887 // A tribute to the "awesome hack by Dean Edwards" 11888 // Android Browser returns percentage for some values, 11889 // but width seems to be reliably pixels. 11890 // This is against the CSSOM draft spec: 11891 // https://drafts.csswg.org/cssom/#resolved-values 11892 if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { 11893 11894 // Remember the original values 11895 width = style.width; 11896 minWidth = style.minWidth; 11897 maxWidth = style.maxWidth; 11898 11899 // Put in the new values to get a computed value out 11900 style.minWidth = style.maxWidth = style.width = ret; 11901 ret = computed.width; 11902 11903 // Revert the changed values 11904 style.width = width; 11905 style.minWidth = minWidth; 11906 style.maxWidth = maxWidth; 11907 } 11908 } 11909 11910 return ret !== undefined ? 11911 11912 // Support: IE <=9 - 11 only 11913 // IE returns zIndex value as an integer. 11914 ret + "" : 11915 ret; 11916} 11917 11918 11919function addGetHookIf( conditionFn, hookFn ) { 11920 11921 // Define the hook, we'll check on the first run if it's really needed. 11922 return { 11923 get: function() { 11924 if ( conditionFn() ) { 11925 11926 // Hook not needed (or it's not possible to use it due 11927 // to missing dependency), remove it. 11928 delete this.get; 11929 return; 11930 } 11931 11932 // Hook needed; redefine it so that the support test is not executed again. 11933 return ( this.get = hookFn ).apply( this, arguments ); 11934 } 11935 }; 11936} 11937 11938 11939var cssPrefixes = [ "Webkit", "Moz", "ms" ], 11940 emptyStyle = document.createElement( "div" ).style, 11941 vendorProps = {}; 11942 11943// Return a vendor-prefixed property or undefined 11944function vendorPropName( name ) { 11945 11946 // Check for vendor prefixed names 11947 var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), 11948 i = cssPrefixes.length; 11949 11950 while ( i-- ) { 11951 name = cssPrefixes[ i ] + capName; 11952 if ( name in emptyStyle ) { 11953 return name; 11954 } 11955 } 11956} 11957 11958// Return a potentially-mapped jQuery.cssProps or vendor prefixed property 11959function finalPropName( name ) { 11960 var final = jQuery.cssProps[ name ] || vendorProps[ name ]; 11961 11962 if ( final ) { 11963 return final; 11964 } 11965 if ( name in emptyStyle ) { 11966 return name; 11967 } 11968 return vendorProps[ name ] = vendorPropName( name ) || name; 11969} 11970 11971 11972var 11973 11974 // Swappable if display is none or starts with table 11975 // except "table", "table-cell", or "table-caption" 11976 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display 11977 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 11978 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 11979 cssNormalTransform = { 11980 letterSpacing: "0", 11981 fontWeight: "400" 11982 }; 11983 11984function setPositiveNumber( _elem, value, subtract ) { 11985 11986 // Any relative (+/-) values have already been 11987 // normalized at this point 11988 var matches = rcssNum.exec( value ); 11989 return matches ? 11990 11991 // Guard against undefined "subtract", e.g., when used as in cssHooks 11992 Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : 11993 value; 11994} 11995 11996function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { 11997 var i = dimension === "width" ? 1 : 0, 11998 extra = 0, 11999 delta = 0, 12000 marginDelta = 0; 12001 12002 // Adjustment may not be necessary 12003 if ( box === ( isBorderBox ? "border" : "content" ) ) { 12004 return 0; 12005 } 12006 12007 for ( ; i < 4; i += 2 ) { 12008 12009 // Both box models exclude margin 12010 // Count margin delta separately to only add it after scroll gutter adjustment. 12011 // This is needed to make negative margins work with `outerHeight( true )` (gh-3982). 12012 if ( box === "margin" ) { 12013 marginDelta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); 12014 } 12015 12016 // If we get here with a content-box, we're seeking "padding" or "border" or "margin" 12017 if ( !isBorderBox ) { 12018 12019 // Add padding 12020 delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 12021 12022 // For "border" or "margin", add border 12023 if ( box !== "padding" ) { 12024 delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 12025 12026 // But still keep track of it otherwise 12027 } else { 12028 extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 12029 } 12030 12031 // If we get here with a border-box (content + padding + border), we're seeking "content" or 12032 // "padding" or "margin" 12033 } else { 12034 12035 // For "content", subtract padding 12036 if ( box === "content" ) { 12037 delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 12038 } 12039 12040 // For "content" or "padding", subtract border 12041 if ( box !== "margin" ) { 12042 delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 12043 } 12044 } 12045 } 12046 12047 // Account for positive content-box scroll gutter when requested by providing computedVal 12048 if ( !isBorderBox && computedVal >= 0 ) { 12049 12050 // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border 12051 // Assuming integer scroll gutter, subtract the rest and round down 12052 delta += Math.max( 0, Math.ceil( 12053 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 12054 computedVal - 12055 delta - 12056 extra - 12057 0.5 12058 12059 // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter 12060 // Use an explicit zero to avoid NaN (gh-3964) 12061 ) ) || 0; 12062 } 12063 12064 return delta + marginDelta; 12065} 12066 12067function getWidthOrHeight( elem, dimension, extra ) { 12068 12069 // Start with computed style 12070 var styles = getStyles( elem ), 12071 12072 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). 12073 // Fake content-box until we know it's needed to know the true value. 12074 boxSizingNeeded = !support.boxSizingReliable() || extra, 12075 isBorderBox = boxSizingNeeded && 12076 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 12077 valueIsBorderBox = isBorderBox, 12078 12079 val = curCSS( elem, dimension, styles ), 12080 offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); 12081 12082 // Support: Firefox <=54 12083 // Return a confounding non-pixel value or feign ignorance, as appropriate. 12084 if ( rnumnonpx.test( val ) ) { 12085 if ( !extra ) { 12086 return val; 12087 } 12088 val = "auto"; 12089 } 12090 12091 12092 // Support: IE 9 - 11 only 12093 // Use offsetWidth/offsetHeight for when box sizing is unreliable. 12094 // In those cases, the computed value can be trusted to be border-box. 12095 if ( ( !support.boxSizingReliable() && isBorderBox || 12096 12097 // Support: IE 10 - 11+, Edge 15 - 18+ 12098 // IE/Edge misreport `getComputedStyle` of table rows with width/height 12099 // set in CSS while `offset*` properties report correct values. 12100 // Interestingly, in some cases IE 9 doesn't suffer from this issue. 12101 !support.reliableTrDimensions() && nodeName( elem, "tr" ) || 12102 12103 // Fall back to offsetWidth/offsetHeight when value is "auto" 12104 // This happens for inline elements with no explicit setting (gh-3571) 12105 val === "auto" || 12106 12107 // Support: Android <=4.1 - 4.3 only 12108 // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) 12109 !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && 12110 12111 // Make sure the element is visible & connected 12112 elem.getClientRects().length ) { 12113 12114 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; 12115 12116 // Where available, offsetWidth/offsetHeight approximate border box dimensions. 12117 // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the 12118 // retrieved value as a content box dimension. 12119 valueIsBorderBox = offsetProp in elem; 12120 if ( valueIsBorderBox ) { 12121 val = elem[ offsetProp ]; 12122 } 12123 } 12124 12125 // Normalize "" and auto 12126 val = parseFloat( val ) || 0; 12127 12128 // Adjust for the element's box model 12129 return ( val + 12130 boxModelAdjustment( 12131 elem, 12132 dimension, 12133 extra || ( isBorderBox ? "border" : "content" ), 12134 valueIsBorderBox, 12135 styles, 12136 12137 // Provide the current computed size to request scroll gutter calculation (gh-3589) 12138 val 12139 ) 12140 ) + "px"; 12141} 12142 12143jQuery.extend( { 12144 12145 // Add in style property hooks for overriding the default 12146 // behavior of getting and setting a style property 12147 cssHooks: { 12148 opacity: { 12149 get: function( elem, computed ) { 12150 if ( computed ) { 12151 12152 // We should always get a number back from opacity 12153 var ret = curCSS( elem, "opacity" ); 12154 return ret === "" ? "1" : ret; 12155 } 12156 } 12157 } 12158 }, 12159 12160 // Don't automatically add "px" to these possibly-unitless properties 12161 cssNumber: { 12162 animationIterationCount: true, 12163 aspectRatio: true, 12164 borderImageSlice: true, 12165 columnCount: true, 12166 flexGrow: true, 12167 flexShrink: true, 12168 fontWeight: true, 12169 gridArea: true, 12170 gridColumn: true, 12171 gridColumnEnd: true, 12172 gridColumnStart: true, 12173 gridRow: true, 12174 gridRowEnd: true, 12175 gridRowStart: true, 12176 lineHeight: true, 12177 opacity: true, 12178 order: true, 12179 orphans: true, 12180 scale: true, 12181 widows: true, 12182 zIndex: true, 12183 zoom: true, 12184 12185 // SVG-related 12186 fillOpacity: true, 12187 floodOpacity: true, 12188 stopOpacity: true, 12189 strokeMiterlimit: true, 12190 strokeOpacity: true 12191 }, 12192 12193 // Add in properties whose names you wish to fix before 12194 // setting or getting the value 12195 cssProps: {}, 12196 12197 // Get and set the style property on a DOM Node 12198 style: function( elem, name, value, extra ) { 12199 12200 // Don't set styles on text and comment nodes 12201 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 12202 return; 12203 } 12204 12205 // Make sure that we're working with the right name 12206 var ret, type, hooks, 12207 origName = camelCase( name ), 12208 isCustomProp = rcustomProp.test( name ), 12209 style = elem.style; 12210 12211 // Make sure that we're working with the right name. We don't 12212 // want to query the value if it is a CSS custom property 12213 // since they are user-defined. 12214 if ( !isCustomProp ) { 12215 name = finalPropName( origName ); 12216 } 12217 12218 // Gets hook for the prefixed version, then unprefixed version 12219 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 12220 12221 // Check if we're setting a value 12222 if ( value !== undefined ) { 12223 type = typeof value; 12224 12225 // Convert "+=" or "-=" to relative numbers (trac-7345) 12226 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { 12227 value = adjustCSS( elem, name, ret ); 12228 12229 // Fixes bug trac-9237 12230 type = "number"; 12231 } 12232 12233 // Make sure that null and NaN values aren't set (trac-7116) 12234 if ( value == null || value !== value ) { 12235 return; 12236 } 12237 12238 // If a number was passed in, add the unit (except for certain CSS properties) 12239 // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append 12240 // "px" to a few hardcoded values. 12241 if ( type === "number" && !isCustomProp ) { 12242 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); 12243 } 12244 12245 // background-* props affect original clone's values 12246 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { 12247 style[ name ] = "inherit"; 12248 } 12249 12250 // If a hook was provided, use that value, otherwise just set the specified value 12251 if ( !hooks || !( "set" in hooks ) || 12252 ( value = hooks.set( elem, value, extra ) ) !== undefined ) { 12253 12254 if ( isCustomProp ) { 12255 style.setProperty( name, value ); 12256 } else { 12257 style[ name ] = value; 12258 } 12259 } 12260 12261 } else { 12262 12263 // If a hook was provided get the non-computed value from there 12264 if ( hooks && "get" in hooks && 12265 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { 12266 12267 return ret; 12268 } 12269 12270 // Otherwise just get the value from the style object 12271 return style[ name ]; 12272 } 12273 }, 12274 12275 css: function( elem, name, extra, styles ) { 12276 var val, num, hooks, 12277 origName = camelCase( name ), 12278 isCustomProp = rcustomProp.test( name ); 12279 12280 // Make sure that we're working with the right name. We don't 12281 // want to modify the value if it is a CSS custom property 12282 // since they are user-defined. 12283 if ( !isCustomProp ) { 12284 name = finalPropName( origName ); 12285 } 12286 12287 // Try prefixed name followed by the unprefixed name 12288 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 12289 12290 // If a hook was provided get the computed value from there 12291 if ( hooks && "get" in hooks ) { 12292 val = hooks.get( elem, true, extra ); 12293 } 12294 12295 // Otherwise, if a way to get the computed value exists, use that 12296 if ( val === undefined ) { 12297 val = curCSS( elem, name, styles ); 12298 } 12299 12300 // Convert "normal" to computed value 12301 if ( val === "normal" && name in cssNormalTransform ) { 12302 val = cssNormalTransform[ name ]; 12303 } 12304 12305 // Make numeric if forced or a qualifier was provided and val looks numeric 12306 if ( extra === "" || extra ) { 12307 num = parseFloat( val ); 12308 return extra === true || isFinite( num ) ? num || 0 : val; 12309 } 12310 12311 return val; 12312 } 12313} ); 12314 12315jQuery.each( [ "height", "width" ], function( _i, dimension ) { 12316 jQuery.cssHooks[ dimension ] = { 12317 get: function( elem, computed, extra ) { 12318 if ( computed ) { 12319 12320 // Certain elements can have dimension info if we invisibly show them 12321 // but it must have a current display style that would benefit 12322 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && 12323 12324 // Support: Safari 8+ 12325 // Table columns in Safari have non-zero offsetWidth & zero 12326 // getBoundingClientRect().width unless display is changed. 12327 // Support: IE <=11 only 12328 // Running getBoundingClientRect on a disconnected node 12329 // in IE throws an error. 12330 ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? 12331 swap( elem, cssShow, function() { 12332 return getWidthOrHeight( elem, dimension, extra ); 12333 } ) : 12334 getWidthOrHeight( elem, dimension, extra ); 12335 } 12336 }, 12337 12338 set: function( elem, value, extra ) { 12339 var matches, 12340 styles = getStyles( elem ), 12341 12342 // Only read styles.position if the test has a chance to fail 12343 // to avoid forcing a reflow. 12344 scrollboxSizeBuggy = !support.scrollboxSize() && 12345 styles.position === "absolute", 12346 12347 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) 12348 boxSizingNeeded = scrollboxSizeBuggy || extra, 12349 isBorderBox = boxSizingNeeded && 12350 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 12351 subtract = extra ? 12352 boxModelAdjustment( 12353 elem, 12354 dimension, 12355 extra, 12356 isBorderBox, 12357 styles 12358 ) : 12359 0; 12360 12361 // Account for unreliable border-box dimensions by comparing offset* to computed and 12362 // faking a content-box to get border and padding (gh-3699) 12363 if ( isBorderBox && scrollboxSizeBuggy ) { 12364 subtract -= Math.ceil( 12365 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 12366 parseFloat( styles[ dimension ] ) - 12367 boxModelAdjustment( elem, dimension, "border", false, styles ) - 12368 0.5 12369 ); 12370 } 12371 12372 // Convert to pixels if value adjustment is needed 12373 if ( subtract && ( matches = rcssNum.exec( value ) ) && 12374 ( matches[ 3 ] || "px" ) !== "px" ) { 12375 12376 elem.style[ dimension ] = value; 12377 value = jQuery.css( elem, dimension ); 12378 } 12379 12380 return setPositiveNumber( elem, value, subtract ); 12381 } 12382 }; 12383} ); 12384 12385jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, 12386 function( elem, computed ) { 12387 if ( computed ) { 12388 return ( parseFloat( curCSS( elem, "marginLeft" ) ) || 12389 elem.getBoundingClientRect().left - 12390 swap( elem, { marginLeft: 0 }, function() { 12391 return elem.getBoundingClientRect().left; 12392 } ) 12393 ) + "px"; 12394 } 12395 } 12396); 12397 12398// These hooks are used by animate to expand properties 12399jQuery.each( { 12400 margin: "", 12401 padding: "", 12402 border: "Width" 12403}, function( prefix, suffix ) { 12404 jQuery.cssHooks[ prefix + suffix ] = { 12405 expand: function( value ) { 12406 var i = 0, 12407 expanded = {}, 12408 12409 // Assumes a single number if not a string 12410 parts = typeof value === "string" ? value.split( " " ) : [ value ]; 12411 12412 for ( ; i < 4; i++ ) { 12413 expanded[ prefix + cssExpand[ i ] + suffix ] = 12414 parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 12415 } 12416 12417 return expanded; 12418 } 12419 }; 12420 12421 if ( prefix !== "margin" ) { 12422 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; 12423 } 12424} ); 12425 12426jQuery.fn.extend( { 12427 css: function( name, value ) { 12428 return access( this, function( elem, name, value ) { 12429 var styles, len, 12430 map = {}, 12431 i = 0; 12432 12433 if ( Array.isArray( name ) ) { 12434 styles = getStyles( elem ); 12435 len = name.length; 12436 12437 for ( ; i < len; i++ ) { 12438 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); 12439 } 12440 12441 return map; 12442 } 12443 12444 return value !== undefined ? 12445 jQuery.style( elem, name, value ) : 12446 jQuery.css( elem, name ); 12447 }, name, value, arguments.length > 1 ); 12448 } 12449} ); 12450 12451 12452function Tween( elem, options, prop, end, easing ) { 12453 return new Tween.prototype.init( elem, options, prop, end, easing ); 12454} 12455jQuery.Tween = Tween; 12456 12457Tween.prototype = { 12458 constructor: Tween, 12459 init: function( elem, options, prop, end, easing, unit ) { 12460 this.elem = elem; 12461 this.prop = prop; 12462 this.easing = easing || jQuery.easing._default; 12463 this.options = options; 12464 this.start = this.now = this.cur(); 12465 this.end = end; 12466 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 12467 }, 12468 cur: function() { 12469 var hooks = Tween.propHooks[ this.prop ]; 12470 12471 return hooks && hooks.get ? 12472 hooks.get( this ) : 12473 Tween.propHooks._default.get( this ); 12474 }, 12475 run: function( percent ) { 12476 var eased, 12477 hooks = Tween.propHooks[ this.prop ]; 12478 12479 if ( this.options.duration ) { 12480 this.pos = eased = jQuery.easing[ this.easing ]( 12481 percent, this.options.duration * percent, 0, 1, this.options.duration 12482 ); 12483 } else { 12484 this.pos = eased = percent; 12485 } 12486 this.now = ( this.end - this.start ) * eased + this.start; 12487 12488 if ( this.options.step ) { 12489 this.options.step.call( this.elem, this.now, this ); 12490 } 12491 12492 if ( hooks && hooks.set ) { 12493 hooks.set( this ); 12494 } else { 12495 Tween.propHooks._default.set( this ); 12496 } 12497 return this; 12498 } 12499}; 12500 12501Tween.prototype.init.prototype = Tween.prototype; 12502 12503Tween.propHooks = { 12504 _default: { 12505 get: function( tween ) { 12506 var result; 12507 12508 // Use a property on the element directly when it is not a DOM element, 12509 // or when there is no matching style property that exists. 12510 if ( tween.elem.nodeType !== 1 || 12511 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { 12512 return tween.elem[ tween.prop ]; 12513 } 12514 12515 // Passing an empty string as a 3rd parameter to .css will automatically 12516 // attempt a parseFloat and fallback to a string if the parse fails. 12517 // Simple values such as "10px" are parsed to Float; 12518 // complex values such as "rotate(1rad)" are returned as-is. 12519 result = jQuery.css( tween.elem, tween.prop, "" ); 12520 12521 // Empty strings, null, undefined and "auto" are converted to 0. 12522 return !result || result === "auto" ? 0 : result; 12523 }, 12524 set: function( tween ) { 12525 12526 // Use step hook for back compat. 12527 // Use cssHook if its there. 12528 // Use .style if available and use plain properties where available. 12529 if ( jQuery.fx.step[ tween.prop ] ) { 12530 jQuery.fx.step[ tween.prop ]( tween ); 12531 } else if ( tween.elem.nodeType === 1 && ( 12532 jQuery.cssHooks[ tween.prop ] || 12533 tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { 12534 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); 12535 } else { 12536 tween.elem[ tween.prop ] = tween.now; 12537 } 12538 } 12539 } 12540}; 12541 12542// Support: IE <=9 only 12543// Panic based approach to setting things on disconnected nodes 12544Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 12545 set: function( tween ) { 12546 if ( tween.elem.nodeType && tween.elem.parentNode ) { 12547 tween.elem[ tween.prop ] = tween.now; 12548 } 12549 } 12550}; 12551 12552jQuery.easing = { 12553 linear: function( p ) { 12554 return p; 12555 }, 12556 swing: function( p ) { 12557 return 0.5 - Math.cos( p * Math.PI ) / 2; 12558 }, 12559 _default: "swing" 12560}; 12561 12562jQuery.fx = Tween.prototype.init; 12563 12564// Back compat <1.8 extension point 12565jQuery.fx.step = {}; 12566 12567 12568 12569 12570var 12571 fxNow, inProgress, 12572 rfxtypes = /^(?:toggle|show|hide)$/, 12573 rrun = /queueHooks$/; 12574 12575function schedule() { 12576 if ( inProgress ) { 12577 if ( document.hidden === false && window.requestAnimationFrame ) { 12578 window.requestAnimationFrame( schedule ); 12579 } else { 12580 window.setTimeout( schedule, jQuery.fx.interval ); 12581 } 12582 12583 jQuery.fx.tick(); 12584 } 12585} 12586 12587// Animations created synchronously will run synchronously 12588function createFxNow() { 12589 window.setTimeout( function() { 12590 fxNow = undefined; 12591 } ); 12592 return ( fxNow = Date.now() ); 12593} 12594 12595// Generate parameters to create a standard animation 12596function genFx( type, includeWidth ) { 12597 var which, 12598 i = 0, 12599 attrs = { height: type }; 12600 12601 // If we include width, step value is 1 to do all cssExpand values, 12602 // otherwise step value is 2 to skip over Left and Right 12603 includeWidth = includeWidth ? 1 : 0; 12604 for ( ; i < 4; i += 2 - includeWidth ) { 12605 which = cssExpand[ i ]; 12606 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; 12607 } 12608 12609 if ( includeWidth ) { 12610 attrs.opacity = attrs.width = type; 12611 } 12612 12613 return attrs; 12614} 12615 12616function createTween( value, prop, animation ) { 12617 var tween, 12618 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), 12619 index = 0, 12620 length = collection.length; 12621 for ( ; index < length; index++ ) { 12622 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { 12623 12624 // We're done with this property 12625 return tween; 12626 } 12627 } 12628} 12629 12630function defaultPrefilter( elem, props, opts ) { 12631 var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, 12632 isBox = "width" in props || "height" in props, 12633 anim = this, 12634 orig = {}, 12635 style = elem.style, 12636 hidden = elem.nodeType && isHiddenWithinTree( elem ), 12637 dataShow = dataPriv.get( elem, "fxshow" ); 12638 12639 // Queue-skipping animations hijack the fx hooks 12640 if ( !opts.queue ) { 12641 hooks = jQuery._queueHooks( elem, "fx" ); 12642 if ( hooks.unqueued == null ) { 12643 hooks.unqueued = 0; 12644 oldfire = hooks.empty.fire; 12645 hooks.empty.fire = function() { 12646 if ( !hooks.unqueued ) { 12647 oldfire(); 12648 } 12649 }; 12650 } 12651 hooks.unqueued++; 12652 12653 anim.always( function() { 12654 12655 // Ensure the complete handler is called before this completes 12656 anim.always( function() { 12657 hooks.unqueued--; 12658 if ( !jQuery.queue( elem, "fx" ).length ) { 12659 hooks.empty.fire(); 12660 } 12661 } ); 12662 } ); 12663 } 12664 12665 // Detect show/hide animations 12666 for ( prop in props ) { 12667 value = props[ prop ]; 12668 if ( rfxtypes.test( value ) ) { 12669 delete props[ prop ]; 12670 toggle = toggle || value === "toggle"; 12671 if ( value === ( hidden ? "hide" : "show" ) ) { 12672 12673 // Pretend to be hidden if this is a "show" and 12674 // there is still data from a stopped show/hide 12675 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { 12676 hidden = true; 12677 12678 // Ignore all other no-op show/hide data 12679 } else { 12680 continue; 12681 } 12682 } 12683 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); 12684 } 12685 } 12686 12687 // Bail out if this is a no-op like .hide().hide() 12688 propTween = !jQuery.isEmptyObject( props ); 12689 if ( !propTween && jQuery.isEmptyObject( orig ) ) { 12690 return; 12691 } 12692 12693 // Restrict "overflow" and "display" styles during box animations 12694 if ( isBox && elem.nodeType === 1 ) { 12695 12696 // Support: IE <=9 - 11, Edge 12 - 15 12697 // Record all 3 overflow attributes because IE does not infer the shorthand 12698 // from identically-valued overflowX and overflowY and Edge just mirrors 12699 // the overflowX value there. 12700 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; 12701 12702 // Identify a display type, preferring old show/hide data over the CSS cascade 12703 restoreDisplay = dataShow && dataShow.display; 12704 if ( restoreDisplay == null ) { 12705 restoreDisplay = dataPriv.get( elem, "display" ); 12706 } 12707 display = jQuery.css( elem, "display" ); 12708 if ( display === "none" ) { 12709 if ( restoreDisplay ) { 12710 display = restoreDisplay; 12711 } else { 12712 12713 // Get nonempty value(s) by temporarily forcing visibility 12714 showHide( [ elem ], true ); 12715 restoreDisplay = elem.style.display || restoreDisplay; 12716 display = jQuery.css( elem, "display" ); 12717 showHide( [ elem ] ); 12718 } 12719 } 12720 12721 // Animate inline elements as inline-block 12722 if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { 12723 if ( jQuery.css( elem, "float" ) === "none" ) { 12724 12725 // Restore the original display value at the end of pure show/hide animations 12726 if ( !propTween ) { 12727 anim.done( function() { 12728 style.display = restoreDisplay; 12729 } ); 12730 if ( restoreDisplay == null ) { 12731 display = style.display; 12732 restoreDisplay = display === "none" ? "" : display; 12733 } 12734 } 12735 style.display = "inline-block"; 12736 } 12737 } 12738 } 12739 12740 if ( opts.overflow ) { 12741 style.overflow = "hidden"; 12742 anim.always( function() { 12743 style.overflow = opts.overflow[ 0 ]; 12744 style.overflowX = opts.overflow[ 1 ]; 12745 style.overflowY = opts.overflow[ 2 ]; 12746 } ); 12747 } 12748 12749 // Implement show/hide animations 12750 propTween = false; 12751 for ( prop in orig ) { 12752 12753 // General show/hide setup for this element animation 12754 if ( !propTween ) { 12755 if ( dataShow ) { 12756 if ( "hidden" in dataShow ) { 12757 hidden = dataShow.hidden; 12758 } 12759 } else { 12760 dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); 12761 } 12762 12763 // Store hidden/visible for toggle so `.stop().toggle()` "reverses" 12764 if ( toggle ) { 12765 dataShow.hidden = !hidden; 12766 } 12767 12768 // Show elements before animating them 12769 if ( hidden ) { 12770 showHide( [ elem ], true ); 12771 } 12772 12773 /* eslint-disable no-loop-func */ 12774 12775 anim.done( function() { 12776 12777 /* eslint-enable no-loop-func */ 12778 12779 // The final step of a "hide" animation is actually hiding the element 12780 if ( !hidden ) { 12781 showHide( [ elem ] ); 12782 } 12783 dataPriv.remove( elem, "fxshow" ); 12784 for ( prop in orig ) { 12785 jQuery.style( elem, prop, orig[ prop ] ); 12786 } 12787 } ); 12788 } 12789 12790 // Per-property setup 12791 propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); 12792 if ( !( prop in dataShow ) ) { 12793 dataShow[ prop ] = propTween.start; 12794 if ( hidden ) { 12795 propTween.end = propTween.start; 12796 propTween.start = 0; 12797 } 12798 } 12799 } 12800} 12801 12802function propFilter( props, specialEasing ) { 12803 var index, name, easing, value, hooks; 12804 12805 // camelCase, specialEasing and expand cssHook pass 12806 for ( index in props ) { 12807 name = camelCase( index ); 12808 easing = specialEasing[ name ]; 12809 value = props[ index ]; 12810 if ( Array.isArray( value ) ) { 12811 easing = value[ 1 ]; 12812 value = props[ index ] = value[ 0 ]; 12813 } 12814 12815 if ( index !== name ) { 12816 props[ name ] = value; 12817 delete props[ index ]; 12818 } 12819 12820 hooks = jQuery.cssHooks[ name ]; 12821 if ( hooks && "expand" in hooks ) { 12822 value = hooks.expand( value ); 12823 delete props[ name ]; 12824 12825 // Not quite $.extend, this won't overwrite existing keys. 12826 // Reusing 'index' because we have the correct "name" 12827 for ( index in value ) { 12828 if ( !( index in props ) ) { 12829 props[ index ] = value[ index ]; 12830 specialEasing[ index ] = easing; 12831 } 12832 } 12833 } else { 12834 specialEasing[ name ] = easing; 12835 } 12836 } 12837} 12838 12839function Animation( elem, properties, options ) { 12840 var result, 12841 stopped, 12842 index = 0, 12843 length = Animation.prefilters.length, 12844 deferred = jQuery.Deferred().always( function() { 12845 12846 // Don't match elem in the :animated selector 12847 delete tick.elem; 12848 } ), 12849 tick = function() { 12850 if ( stopped ) { 12851 return false; 12852 } 12853 var currentTime = fxNow || createFxNow(), 12854 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), 12855 12856 // Support: Android 2.3 only 12857 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (trac-12497) 12858 temp = remaining / animation.duration || 0, 12859 percent = 1 - temp, 12860 index = 0, 12861 length = animation.tweens.length; 12862 12863 for ( ; index < length; index++ ) { 12864 animation.tweens[ index ].run( percent ); 12865 } 12866 12867 deferred.notifyWith( elem, [ animation, percent, remaining ] ); 12868 12869 // If there's more to do, yield 12870 if ( percent < 1 && length ) { 12871 return remaining; 12872 } 12873 12874 // If this was an empty animation, synthesize a final progress notification 12875 if ( !length ) { 12876 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 12877 } 12878 12879 // Resolve the animation and report its conclusion 12880 deferred.resolveWith( elem, [ animation ] ); 12881 return false; 12882 }, 12883 animation = deferred.promise( { 12884 elem: elem, 12885 props: jQuery.extend( {}, properties ), 12886 opts: jQuery.extend( true, { 12887 specialEasing: {}, 12888 easing: jQuery.easing._default 12889 }, options ), 12890 originalProperties: properties, 12891 originalOptions: options, 12892 startTime: fxNow || createFxNow(), 12893 duration: options.duration, 12894 tweens: [], 12895 createTween: function( prop, end ) { 12896 var tween = jQuery.Tween( elem, animation.opts, prop, end, 12897 animation.opts.specialEasing[ prop ] || animation.opts.easing ); 12898 animation.tweens.push( tween ); 12899 return tween; 12900 }, 12901 stop: function( gotoEnd ) { 12902 var index = 0, 12903 12904 // If we are going to the end, we want to run all the tweens 12905 // otherwise we skip this part 12906 length = gotoEnd ? animation.tweens.length : 0; 12907 if ( stopped ) { 12908 return this; 12909 } 12910 stopped = true; 12911 for ( ; index < length; index++ ) { 12912 animation.tweens[ index ].run( 1 ); 12913 } 12914 12915 // Resolve when we played the last frame; otherwise, reject 12916 if ( gotoEnd ) { 12917 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 12918 deferred.resolveWith( elem, [ animation, gotoEnd ] ); 12919 } else { 12920 deferred.rejectWith( elem, [ animation, gotoEnd ] ); 12921 } 12922 return this; 12923 } 12924 } ), 12925 props = animation.props; 12926 12927 propFilter( props, animation.opts.specialEasing ); 12928 12929 for ( ; index < length; index++ ) { 12930 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); 12931 if ( result ) { 12932 if ( isFunction( result.stop ) ) { 12933 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = 12934 result.stop.bind( result ); 12935 } 12936 return result; 12937 } 12938 } 12939 12940 jQuery.map( props, createTween, animation ); 12941 12942 if ( isFunction( animation.opts.start ) ) { 12943 animation.opts.start.call( elem, animation ); 12944 } 12945 12946 // Attach callbacks from options 12947 animation 12948 .progress( animation.opts.progress ) 12949 .done( animation.opts.done, animation.opts.complete ) 12950 .fail( animation.opts.fail ) 12951 .always( animation.opts.always ); 12952 12953 jQuery.fx.timer( 12954 jQuery.extend( tick, { 12955 elem: elem, 12956 anim: animation, 12957 queue: animation.opts.queue 12958 } ) 12959 ); 12960 12961 return animation; 12962} 12963 12964jQuery.Animation = jQuery.extend( Animation, { 12965 12966 tweeners: { 12967 "*": [ function( prop, value ) { 12968 var tween = this.createTween( prop, value ); 12969 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); 12970 return tween; 12971 } ] 12972 }, 12973 12974 tweener: function( props, callback ) { 12975 if ( isFunction( props ) ) { 12976 callback = props; 12977 props = [ "*" ]; 12978 } else { 12979 props = props.match( rnothtmlwhite ); 12980 } 12981 12982 var prop, 12983 index = 0, 12984 length = props.length; 12985 12986 for ( ; index < length; index++ ) { 12987 prop = props[ index ]; 12988 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; 12989 Animation.tweeners[ prop ].unshift( callback ); 12990 } 12991 }, 12992 12993 prefilters: [ defaultPrefilter ], 12994 12995 prefilter: function( callback, prepend ) { 12996 if ( prepend ) { 12997 Animation.prefilters.unshift( callback ); 12998 } else { 12999 Animation.prefilters.push( callback ); 13000 } 13001 } 13002} ); 13003 13004jQuery.speed = function( speed, easing, fn ) { 13005 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { 13006 complete: fn || !fn && easing || 13007 isFunction( speed ) && speed, 13008 duration: speed, 13009 easing: fn && easing || easing && !isFunction( easing ) && easing 13010 }; 13011 13012 // Go to the end state if fx are off 13013 if ( jQuery.fx.off ) { 13014 opt.duration = 0; 13015 13016 } else { 13017 if ( typeof opt.duration !== "number" ) { 13018 if ( opt.duration in jQuery.fx.speeds ) { 13019 opt.duration = jQuery.fx.speeds[ opt.duration ]; 13020 13021 } else { 13022 opt.duration = jQuery.fx.speeds._default; 13023 } 13024 } 13025 } 13026 13027 // Normalize opt.queue - true/undefined/null -> "fx" 13028 if ( opt.queue == null || opt.queue === true ) { 13029 opt.queue = "fx"; 13030 } 13031 13032 // Queueing 13033 opt.old = opt.complete; 13034 13035 opt.complete = function() { 13036 if ( isFunction( opt.old ) ) { 13037 opt.old.call( this ); 13038 } 13039 13040 if ( opt.queue ) { 13041 jQuery.dequeue( this, opt.queue ); 13042 } 13043 }; 13044 13045 return opt; 13046}; 13047 13048jQuery.fn.extend( { 13049 fadeTo: function( speed, to, easing, callback ) { 13050 13051 // Show any hidden elements after setting opacity to 0 13052 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() 13053 13054 // Animate to the value specified 13055 .end().animate( { opacity: to }, speed, easing, callback ); 13056 }, 13057 animate: function( prop, speed, easing, callback ) { 13058 var empty = jQuery.isEmptyObject( prop ), 13059 optall = jQuery.speed( speed, easing, callback ), 13060 doAnimation = function() { 13061 13062 // Operate on a copy of prop so per-property easing won't be lost 13063 var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 13064 13065 // Empty animations, or finishing resolves immediately 13066 if ( empty || dataPriv.get( this, "finish" ) ) { 13067 anim.stop( true ); 13068 } 13069 }; 13070 13071 doAnimation.finish = doAnimation; 13072 13073 return empty || optall.queue === false ? 13074 this.each( doAnimation ) : 13075 this.queue( optall.queue, doAnimation ); 13076 }, 13077 stop: function( type, clearQueue, gotoEnd ) { 13078 var stopQueue = function( hooks ) { 13079 var stop = hooks.stop; 13080 delete hooks.stop; 13081 stop( gotoEnd ); 13082 }; 13083 13084 if ( typeof type !== "string" ) { 13085 gotoEnd = clearQueue; 13086 clearQueue = type; 13087 type = undefined; 13088 } 13089 if ( clearQueue ) { 13090 this.queue( type || "fx", [] ); 13091 } 13092 13093 return this.each( function() { 13094 var dequeue = true, 13095 index = type != null && type + "queueHooks", 13096 timers = jQuery.timers, 13097 data = dataPriv.get( this ); 13098 13099 if ( index ) { 13100 if ( data[ index ] && data[ index ].stop ) { 13101 stopQueue( data[ index ] ); 13102 } 13103 } else { 13104 for ( index in data ) { 13105 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { 13106 stopQueue( data[ index ] ); 13107 } 13108 } 13109 } 13110 13111 for ( index = timers.length; index--; ) { 13112 if ( timers[ index ].elem === this && 13113 ( type == null || timers[ index ].queue === type ) ) { 13114 13115 timers[ index ].anim.stop( gotoEnd ); 13116 dequeue = false; 13117 timers.splice( index, 1 ); 13118 } 13119 } 13120 13121 // Start the next in the queue if the last step wasn't forced. 13122 // Timers currently will call their complete callbacks, which 13123 // will dequeue but only if they were gotoEnd. 13124 if ( dequeue || !gotoEnd ) { 13125 jQuery.dequeue( this, type ); 13126 } 13127 } ); 13128 }, 13129 finish: function( type ) { 13130 if ( type !== false ) { 13131 type = type || "fx"; 13132 } 13133 return this.each( function() { 13134 var index, 13135 data = dataPriv.get( this ), 13136 queue = data[ type + "queue" ], 13137 hooks = data[ type + "queueHooks" ], 13138 timers = jQuery.timers, 13139 length = queue ? queue.length : 0; 13140 13141 // Enable finishing flag on private data 13142 data.finish = true; 13143 13144 // Empty the queue first 13145 jQuery.queue( this, type, [] ); 13146 13147 if ( hooks && hooks.stop ) { 13148 hooks.stop.call( this, true ); 13149 } 13150 13151 // Look for any active animations, and finish them 13152 for ( index = timers.length; index--; ) { 13153 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 13154 timers[ index ].anim.stop( true ); 13155 timers.splice( index, 1 ); 13156 } 13157 } 13158 13159 // Look for any animations in the old queue and finish them 13160 for ( index = 0; index < length; index++ ) { 13161 if ( queue[ index ] && queue[ index ].finish ) { 13162 queue[ index ].finish.call( this ); 13163 } 13164 } 13165 13166 // Turn off finishing flag 13167 delete data.finish; 13168 } ); 13169 } 13170} ); 13171 13172jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { 13173 var cssFn = jQuery.fn[ name ]; 13174 jQuery.fn[ name ] = function( speed, easing, callback ) { 13175 return speed == null || typeof speed === "boolean" ? 13176 cssFn.apply( this, arguments ) : 13177 this.animate( genFx( name, true ), speed, easing, callback ); 13178 }; 13179} ); 13180 13181// Generate shortcuts for custom animations 13182jQuery.each( { 13183 slideDown: genFx( "show" ), 13184 slideUp: genFx( "hide" ), 13185 slideToggle: genFx( "toggle" ), 13186 fadeIn: { opacity: "show" }, 13187 fadeOut: { opacity: "hide" }, 13188 fadeToggle: { opacity: "toggle" } 13189}, function( name, props ) { 13190 jQuery.fn[ name ] = function( speed, easing, callback ) { 13191 return this.animate( props, speed, easing, callback ); 13192 }; 13193} ); 13194 13195jQuery.timers = []; 13196jQuery.fx.tick = function() { 13197 var timer, 13198 i = 0, 13199 timers = jQuery.timers; 13200 13201 fxNow = Date.now(); 13202 13203 for ( ; i < timers.length; i++ ) { 13204 timer = timers[ i ]; 13205 13206 // Run the timer and safely remove it when done (allowing for external removal) 13207 if ( !timer() && timers[ i ] === timer ) { 13208 timers.splice( i--, 1 ); 13209 } 13210 } 13211 13212 if ( !timers.length ) { 13213 jQuery.fx.stop(); 13214 } 13215 fxNow = undefined; 13216}; 13217 13218jQuery.fx.timer = function( timer ) { 13219 jQuery.timers.push( timer ); 13220 jQuery.fx.start(); 13221}; 13222 13223jQuery.fx.interval = 13; 13224jQuery.fx.start = function() { 13225 if ( inProgress ) { 13226 return; 13227 } 13228 13229 inProgress = true; 13230 schedule(); 13231}; 13232 13233jQuery.fx.stop = function() { 13234 inProgress = null; 13235}; 13236 13237jQuery.fx.speeds = { 13238 slow: 600, 13239 fast: 200, 13240 13241 // Default speed 13242 _default: 400 13243}; 13244 13245 13246// Based off of the plugin by Clint Helfers, with permission. 13247jQuery.fn.delay = function( time, type ) { 13248 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 13249 type = type || "fx"; 13250 13251 return this.queue( type, function( next, hooks ) { 13252 var timeout = window.setTimeout( next, time ); 13253 hooks.stop = function() { 13254 window.clearTimeout( timeout ); 13255 }; 13256 } ); 13257}; 13258 13259 13260( function() { 13261 var input = document.createElement( "input" ), 13262 select = document.createElement( "select" ), 13263 opt = select.appendChild( document.createElement( "option" ) ); 13264 13265 input.type = "checkbox"; 13266 13267 // Support: Android <=4.3 only 13268 // Default value for a checkbox should be "on" 13269 support.checkOn = input.value !== ""; 13270 13271 // Support: IE <=11 only 13272 // Must access selectedIndex to make default options select 13273 support.optSelected = opt.selected; 13274 13275 // Support: IE <=11 only 13276 // An input loses its value after becoming a radio 13277 input = document.createElement( "input" ); 13278 input.value = "t"; 13279 input.type = "radio"; 13280 support.radioValue = input.value === "t"; 13281} )(); 13282 13283 13284var boolHook, 13285 attrHandle = jQuery.expr.attrHandle; 13286 13287jQuery.fn.extend( { 13288 attr: function( name, value ) { 13289 return access( this, jQuery.attr, name, value, arguments.length > 1 ); 13290 }, 13291 13292 removeAttr: function( name ) { 13293 return this.each( function() { 13294 jQuery.removeAttr( this, name ); 13295 } ); 13296 } 13297} ); 13298 13299jQuery.extend( { 13300 attr: function( elem, name, value ) { 13301 var ret, hooks, 13302 nType = elem.nodeType; 13303 13304 // Don't get/set attributes on text, comment and attribute nodes 13305 if ( nType === 3 || nType === 8 || nType === 2 ) { 13306 return; 13307 } 13308 13309 // Fallback to prop when attributes are not supported 13310 if ( typeof elem.getAttribute === "undefined" ) { 13311 return jQuery.prop( elem, name, value ); 13312 } 13313 13314 // Attribute hooks are determined by the lowercase version 13315 // Grab necessary hook if one is defined 13316 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 13317 hooks = jQuery.attrHooks[ name.toLowerCase() ] || 13318 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); 13319 } 13320 13321 if ( value !== undefined ) { 13322 if ( value === null ) { 13323 jQuery.removeAttr( elem, name ); 13324 return; 13325 } 13326 13327 if ( hooks && "set" in hooks && 13328 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 13329 return ret; 13330 } 13331 13332 elem.setAttribute( name, value + "" ); 13333 return value; 13334 } 13335 13336 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 13337 return ret; 13338 } 13339 13340 ret = jQuery.find.attr( elem, name ); 13341 13342 // Non-existent attributes return null, we normalize to undefined 13343 return ret == null ? undefined : ret; 13344 }, 13345 13346 attrHooks: { 13347 type: { 13348 set: function( elem, value ) { 13349 if ( !support.radioValue && value === "radio" && 13350 nodeName( elem, "input" ) ) { 13351 var val = elem.value; 13352 elem.setAttribute( "type", value ); 13353 if ( val ) { 13354 elem.value = val; 13355 } 13356 return value; 13357 } 13358 } 13359 } 13360 }, 13361 13362 removeAttr: function( elem, value ) { 13363 var name, 13364 i = 0, 13365 13366 // Attribute names can contain non-HTML whitespace characters 13367 // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 13368 attrNames = value && value.match( rnothtmlwhite ); 13369 13370 if ( attrNames && elem.nodeType === 1 ) { 13371 while ( ( name = attrNames[ i++ ] ) ) { 13372 elem.removeAttribute( name ); 13373 } 13374 } 13375 } 13376} ); 13377 13378// Hooks for boolean attributes 13379boolHook = { 13380 set: function( elem, value, name ) { 13381 if ( value === false ) { 13382 13383 // Remove boolean attributes when set to false 13384 jQuery.removeAttr( elem, name ); 13385 } else { 13386 elem.setAttribute( name, name ); 13387 } 13388 return name; 13389 } 13390}; 13391 13392jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { 13393 var getter = attrHandle[ name ] || jQuery.find.attr; 13394 13395 attrHandle[ name ] = function( elem, name, isXML ) { 13396 var ret, handle, 13397 lowercaseName = name.toLowerCase(); 13398 13399 if ( !isXML ) { 13400 13401 // Avoid an infinite loop by temporarily removing this function from the getter 13402 handle = attrHandle[ lowercaseName ]; 13403 attrHandle[ lowercaseName ] = ret; 13404 ret = getter( elem, name, isXML ) != null ? 13405 lowercaseName : 13406 null; 13407 attrHandle[ lowercaseName ] = handle; 13408 } 13409 return ret; 13410 }; 13411} ); 13412 13413 13414 13415 13416var rfocusable = /^(?:input|select|textarea|button)$/i, 13417 rclickable = /^(?:a|area)$/i; 13418 13419jQuery.fn.extend( { 13420 prop: function( name, value ) { 13421 return access( this, jQuery.prop, name, value, arguments.length > 1 ); 13422 }, 13423 13424 removeProp: function( name ) { 13425 return this.each( function() { 13426 delete this[ jQuery.propFix[ name ] || name ]; 13427 } ); 13428 } 13429} ); 13430 13431jQuery.extend( { 13432 prop: function( elem, name, value ) { 13433 var ret, hooks, 13434 nType = elem.nodeType; 13435 13436 // Don't get/set properties on text, comment and attribute nodes 13437 if ( nType === 3 || nType === 8 || nType === 2 ) { 13438 return; 13439 } 13440 13441 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 13442 13443 // Fix name and attach hooks 13444 name = jQuery.propFix[ name ] || name; 13445 hooks = jQuery.propHooks[ name ]; 13446 } 13447 13448 if ( value !== undefined ) { 13449 if ( hooks && "set" in hooks && 13450 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 13451 return ret; 13452 } 13453 13454 return ( elem[ name ] = value ); 13455 } 13456 13457 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 13458 return ret; 13459 } 13460 13461 return elem[ name ]; 13462 }, 13463 13464 propHooks: { 13465 tabIndex: { 13466 get: function( elem ) { 13467 13468 // Support: IE <=9 - 11 only 13469 // elem.tabIndex doesn't always return the 13470 // correct value when it hasn't been explicitly set 13471 // Use proper attribute retrieval (trac-12072) 13472 var tabindex = jQuery.find.attr( elem, "tabindex" ); 13473 13474 if ( tabindex ) { 13475 return parseInt( tabindex, 10 ); 13476 } 13477 13478 if ( 13479 rfocusable.test( elem.nodeName ) || 13480 rclickable.test( elem.nodeName ) && 13481 elem.href 13482 ) { 13483 return 0; 13484 } 13485 13486 return -1; 13487 } 13488 } 13489 }, 13490 13491 propFix: { 13492 "for": "htmlFor", 13493 "class": "className" 13494 } 13495} ); 13496 13497// Support: IE <=11 only 13498// Accessing the selectedIndex property 13499// forces the browser to respect setting selected 13500// on the option 13501// The getter ensures a default option is selected 13502// when in an optgroup 13503// eslint rule "no-unused-expressions" is disabled for this code 13504// since it considers such accessions noop 13505if ( !support.optSelected ) { 13506 jQuery.propHooks.selected = { 13507 get: function( elem ) { 13508 13509 /* eslint no-unused-expressions: "off" */ 13510 13511 var parent = elem.parentNode; 13512 if ( parent && parent.parentNode ) { 13513 parent.parentNode.selectedIndex; 13514 } 13515 return null; 13516 }, 13517 set: function( elem ) { 13518 13519 /* eslint no-unused-expressions: "off" */ 13520 13521 var parent = elem.parentNode; 13522 if ( parent ) { 13523 parent.selectedIndex; 13524 13525 if ( parent.parentNode ) { 13526 parent.parentNode.selectedIndex; 13527 } 13528 } 13529 } 13530 }; 13531} 13532 13533jQuery.each( [ 13534 "tabIndex", 13535 "readOnly", 13536 "maxLength", 13537 "cellSpacing", 13538 "cellPadding", 13539 "rowSpan", 13540 "colSpan", 13541 "useMap", 13542 "frameBorder", 13543 "contentEditable" 13544], function() { 13545 jQuery.propFix[ this.toLowerCase() ] = this; 13546} ); 13547 13548 13549 13550 13551 // Strip and collapse whitespace according to HTML spec 13552 // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace 13553 function stripAndCollapse( value ) { 13554 var tokens = value.match( rnothtmlwhite ) || []; 13555 return tokens.join( " " ); 13556 } 13557 13558 13559function getClass( elem ) { 13560 return elem.getAttribute && elem.getAttribute( "class" ) || ""; 13561} 13562 13563function classesToArray( value ) { 13564 if ( Array.isArray( value ) ) { 13565 return value; 13566 } 13567 if ( typeof value === "string" ) { 13568 return value.match( rnothtmlwhite ) || []; 13569 } 13570 return []; 13571} 13572 13573jQuery.fn.extend( { 13574 addClass: function( value ) { 13575 var classNames, cur, curValue, className, i, finalValue; 13576 13577 if ( isFunction( value ) ) { 13578 return this.each( function( j ) { 13579 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); 13580 } ); 13581 } 13582 13583 classNames = classesToArray( value ); 13584 13585 if ( classNames.length ) { 13586 return this.each( function() { 13587 curValue = getClass( this ); 13588 cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 13589 13590 if ( cur ) { 13591 for ( i = 0; i < classNames.length; i++ ) { 13592 className = classNames[ i ]; 13593 if ( cur.indexOf( " " + className + " " ) < 0 ) { 13594 cur += className + " "; 13595 } 13596 } 13597 13598 // Only assign if different to avoid unneeded rendering. 13599 finalValue = stripAndCollapse( cur ); 13600 if ( curValue !== finalValue ) { 13601 this.setAttribute( "class", finalValue ); 13602 } 13603 } 13604 } ); 13605 } 13606 13607 return this; 13608 }, 13609 13610 removeClass: function( value ) { 13611 var classNames, cur, curValue, className, i, finalValue; 13612 13613 if ( isFunction( value ) ) { 13614 return this.each( function( j ) { 13615 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); 13616 } ); 13617 } 13618 13619 if ( !arguments.length ) { 13620 return this.attr( "class", "" ); 13621 } 13622 13623 classNames = classesToArray( value ); 13624 13625 if ( classNames.length ) { 13626 return this.each( function() { 13627 curValue = getClass( this ); 13628 13629 // This expression is here for better compressibility (see addClass) 13630 cur = this.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 13631 13632 if ( cur ) { 13633 for ( i = 0; i < classNames.length; i++ ) { 13634 className = classNames[ i ]; 13635 13636 // Remove *all* instances 13637 while ( cur.indexOf( " " + className + " " ) > -1 ) { 13638 cur = cur.replace( " " + className + " ", " " ); 13639 } 13640 } 13641 13642 // Only assign if different to avoid unneeded rendering. 13643 finalValue = stripAndCollapse( cur ); 13644 if ( curValue !== finalValue ) { 13645 this.setAttribute( "class", finalValue ); 13646 } 13647 } 13648 } ); 13649 } 13650 13651 return this; 13652 }, 13653 13654 toggleClass: function( value, stateVal ) { 13655 var classNames, className, i, self, 13656 type = typeof value, 13657 isValidValue = type === "string" || Array.isArray( value ); 13658 13659 if ( isFunction( value ) ) { 13660 return this.each( function( i ) { 13661 jQuery( this ).toggleClass( 13662 value.call( this, i, getClass( this ), stateVal ), 13663 stateVal 13664 ); 13665 } ); 13666 } 13667 13668 if ( typeof stateVal === "boolean" && isValidValue ) { 13669 return stateVal ? this.addClass( value ) : this.removeClass( value ); 13670 } 13671 13672 classNames = classesToArray( value ); 13673 13674 return this.each( function() { 13675 if ( isValidValue ) { 13676 13677 // Toggle individual class names 13678 self = jQuery( this ); 13679 13680 for ( i = 0; i < classNames.length; i++ ) { 13681 className = classNames[ i ]; 13682 13683 // Check each className given, space separated list 13684 if ( self.hasClass( className ) ) { 13685 self.removeClass( className ); 13686 } else { 13687 self.addClass( className ); 13688 } 13689 } 13690 13691 // Toggle whole class name 13692 } else if ( value === undefined || type === "boolean" ) { 13693 className = getClass( this ); 13694 if ( className ) { 13695 13696 // Store className if set 13697 dataPriv.set( this, "__className__", className ); 13698 } 13699 13700 // If the element has a class name or if we're passed `false`, 13701 // then remove the whole classname (if there was one, the above saved it). 13702 // Otherwise bring back whatever was previously saved (if anything), 13703 // falling back to the empty string if nothing was stored. 13704 if ( this.setAttribute ) { 13705 this.setAttribute( "class", 13706 className || value === false ? 13707 "" : 13708 dataPriv.get( this, "__className__" ) || "" 13709 ); 13710 } 13711 } 13712 } ); 13713 }, 13714 13715 hasClass: function( selector ) { 13716 var className, elem, 13717 i = 0; 13718 13719 className = " " + selector + " "; 13720 while ( ( elem = this[ i++ ] ) ) { 13721 if ( elem.nodeType === 1 && 13722 ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { 13723 return true; 13724 } 13725 } 13726 13727 return false; 13728 } 13729} ); 13730 13731 13732 13733 13734var rreturn = /\r/g; 13735 13736jQuery.fn.extend( { 13737 val: function( value ) { 13738 var hooks, ret, valueIsFunction, 13739 elem = this[ 0 ]; 13740 13741 if ( !arguments.length ) { 13742 if ( elem ) { 13743 hooks = jQuery.valHooks[ elem.type ] || 13744 jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 13745 13746 if ( hooks && 13747 "get" in hooks && 13748 ( ret = hooks.get( elem, "value" ) ) !== undefined 13749 ) { 13750 return ret; 13751 } 13752 13753 ret = elem.value; 13754 13755 // Handle most common string cases 13756 if ( typeof ret === "string" ) { 13757 return ret.replace( rreturn, "" ); 13758 } 13759 13760 // Handle cases where value is null/undef or number 13761 return ret == null ? "" : ret; 13762 } 13763 13764 return; 13765 } 13766 13767 valueIsFunction = isFunction( value ); 13768 13769 return this.each( function( i ) { 13770 var val; 13771 13772 if ( this.nodeType !== 1 ) { 13773 return; 13774 } 13775 13776 if ( valueIsFunction ) { 13777 val = value.call( this, i, jQuery( this ).val() ); 13778 } else { 13779 val = value; 13780 } 13781 13782 // Treat null/undefined as ""; convert numbers to string 13783 if ( val == null ) { 13784 val = ""; 13785 13786 } else if ( typeof val === "number" ) { 13787 val += ""; 13788 13789 } else if ( Array.isArray( val ) ) { 13790 val = jQuery.map( val, function( value ) { 13791 return value == null ? "" : value + ""; 13792 } ); 13793 } 13794 13795 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 13796 13797 // If set returns undefined, fall back to normal setting 13798 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { 13799 this.value = val; 13800 } 13801 } ); 13802 } 13803} ); 13804 13805jQuery.extend( { 13806 valHooks: { 13807 option: { 13808 get: function( elem ) { 13809 13810 var val = jQuery.find.attr( elem, "value" ); 13811 return val != null ? 13812 val : 13813 13814 // Support: IE <=10 - 11 only 13815 // option.text throws exceptions (trac-14686, trac-14858) 13816 // Strip and collapse whitespace 13817 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace 13818 stripAndCollapse( jQuery.text( elem ) ); 13819 } 13820 }, 13821 select: { 13822 get: function( elem ) { 13823 var value, option, i, 13824 options = elem.options, 13825 index = elem.selectedIndex, 13826 one = elem.type === "select-one", 13827 values = one ? null : [], 13828 max = one ? index + 1 : options.length; 13829 13830 if ( index < 0 ) { 13831 i = max; 13832 13833 } else { 13834 i = one ? index : 0; 13835 } 13836 13837 // Loop through all the selected options 13838 for ( ; i < max; i++ ) { 13839 option = options[ i ]; 13840 13841 // Support: IE <=9 only 13842 // IE8-9 doesn't update selected after form reset (trac-2551) 13843 if ( ( option.selected || i === index ) && 13844 13845 // Don't return options that are disabled or in a disabled optgroup 13846 !option.disabled && 13847 ( !option.parentNode.disabled || 13848 !nodeName( option.parentNode, "optgroup" ) ) ) { 13849 13850 // Get the specific value for the option 13851 value = jQuery( option ).val(); 13852 13853 // We don't need an array for one selects 13854 if ( one ) { 13855 return value; 13856 } 13857 13858 // Multi-Selects return an array 13859 values.push( value ); 13860 } 13861 } 13862 13863 return values; 13864 }, 13865 13866 set: function( elem, value ) { 13867 var optionSet, option, 13868 options = elem.options, 13869 values = jQuery.makeArray( value ), 13870 i = options.length; 13871 13872 while ( i-- ) { 13873 option = options[ i ]; 13874 13875 /* eslint-disable no-cond-assign */ 13876 13877 if ( option.selected = 13878 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 13879 ) { 13880 optionSet = true; 13881 } 13882 13883 /* eslint-enable no-cond-assign */ 13884 } 13885 13886 // Force browsers to behave consistently when non-matching value is set 13887 if ( !optionSet ) { 13888 elem.selectedIndex = -1; 13889 } 13890 return values; 13891 } 13892 } 13893 } 13894} ); 13895 13896// Radios and checkboxes getter/setter 13897jQuery.each( [ "radio", "checkbox" ], function() { 13898 jQuery.valHooks[ this ] = { 13899 set: function( elem, value ) { 13900 if ( Array.isArray( value ) ) { 13901 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); 13902 } 13903 } 13904 }; 13905 if ( !support.checkOn ) { 13906 jQuery.valHooks[ this ].get = function( elem ) { 13907 return elem.getAttribute( "value" ) === null ? "on" : elem.value; 13908 }; 13909 } 13910} ); 13911 13912 13913 13914 13915// Return jQuery for attributes-only inclusion 13916var location = window.location; 13917 13918var nonce = { guid: Date.now() }; 13919 13920var rquery = ( /\?/ ); 13921 13922 13923 13924// Cross-browser xml parsing 13925jQuery.parseXML = function( data ) { 13926 var xml, parserErrorElem; 13927 if ( !data || typeof data !== "string" ) { 13928 return null; 13929 } 13930 13931 // Support: IE 9 - 11 only 13932 // IE throws on parseFromString with invalid input. 13933 try { 13934 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); 13935 } catch ( e ) {} 13936 13937 parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ]; 13938 if ( !xml || parserErrorElem ) { 13939 jQuery.error( "Invalid XML: " + ( 13940 parserErrorElem ? 13941 jQuery.map( parserErrorElem.childNodes, function( el ) { 13942 return el.textContent; 13943 } ).join( "\n" ) : 13944 data 13945 ) ); 13946 } 13947 return xml; 13948}; 13949 13950 13951var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, 13952 stopPropagationCallback = function( e ) { 13953 e.stopPropagation(); 13954 }; 13955 13956jQuery.extend( jQuery.event, { 13957 13958 trigger: function( event, data, elem, onlyHandlers ) { 13959 13960 var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, 13961 eventPath = [ elem || document ], 13962 type = hasOwn.call( event, "type" ) ? event.type : event, 13963 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; 13964 13965 cur = lastElement = tmp = elem = elem || document; 13966 13967 // Don't do events on text and comment nodes 13968 if ( elem.nodeType === 3 || elem.nodeType === 8 ) { 13969 return; 13970 } 13971 13972 // focus/blur morphs to focusin/out; ensure we're not firing them right now 13973 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { 13974 return; 13975 } 13976 13977 if ( type.indexOf( "." ) > -1 ) { 13978 13979 // Namespaced trigger; create a regexp to match event type in handle() 13980 namespaces = type.split( "." ); 13981 type = namespaces.shift(); 13982 namespaces.sort(); 13983 } 13984 ontype = type.indexOf( ":" ) < 0 && "on" + type; 13985 13986 // Caller can pass in a jQuery.Event object, Object, or just an event type string 13987 event = event[ jQuery.expando ] ? 13988 event : 13989 new jQuery.Event( type, typeof event === "object" && event ); 13990 13991 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) 13992 event.isTrigger = onlyHandlers ? 2 : 3; 13993 event.namespace = namespaces.join( "." ); 13994 event.rnamespace = event.namespace ? 13995 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : 13996 null; 13997 13998 // Clean up the event in case it is being reused 13999 event.result = undefined; 14000 if ( !event.target ) { 14001 event.target = elem; 14002 } 14003 14004 // Clone any incoming data and prepend the event, creating the handler arg list 14005 data = data == null ? 14006 [ event ] : 14007 jQuery.makeArray( data, [ event ] ); 14008 14009 // Allow special events to draw outside the lines 14010 special = jQuery.event.special[ type ] || {}; 14011 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { 14012 return; 14013 } 14014 14015 // Determine event propagation path in advance, per W3C events spec (trac-9951) 14016 // Bubble up to document, then to window; watch for a global ownerDocument var (trac-9724) 14017 if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { 14018 14019 bubbleType = special.delegateType || type; 14020 if ( !rfocusMorph.test( bubbleType + type ) ) { 14021 cur = cur.parentNode; 14022 } 14023 for ( ; cur; cur = cur.parentNode ) { 14024 eventPath.push( cur ); 14025 tmp = cur; 14026 } 14027 14028 // Only add window if we got to document (e.g., not plain obj or detached DOM) 14029 if ( tmp === ( elem.ownerDocument || document ) ) { 14030 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 14031 } 14032 } 14033 14034 // Fire handlers on the event path 14035 i = 0; 14036 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { 14037 lastElement = cur; 14038 event.type = i > 1 ? 14039 bubbleType : 14040 special.bindType || type; 14041 14042 // jQuery handler 14043 handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] && 14044 dataPriv.get( cur, "handle" ); 14045 if ( handle ) { 14046 handle.apply( cur, data ); 14047 } 14048 14049 // Native handler 14050 handle = ontype && cur[ ontype ]; 14051 if ( handle && handle.apply && acceptData( cur ) ) { 14052 event.result = handle.apply( cur, data ); 14053 if ( event.result === false ) { 14054 event.preventDefault(); 14055 } 14056 } 14057 } 14058 event.type = type; 14059 14060 // If nobody prevented the default action, do it now 14061 if ( !onlyHandlers && !event.isDefaultPrevented() ) { 14062 14063 if ( ( !special._default || 14064 special._default.apply( eventPath.pop(), data ) === false ) && 14065 acceptData( elem ) ) { 14066 14067 // Call a native DOM method on the target with the same name as the event. 14068 // Don't do default actions on window, that's where global variables be (trac-6170) 14069 if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { 14070 14071 // Don't re-trigger an onFOO event when we call its FOO() method 14072 tmp = elem[ ontype ]; 14073 14074 if ( tmp ) { 14075 elem[ ontype ] = null; 14076 } 14077 14078 // Prevent re-triggering of the same event, since we already bubbled it above 14079 jQuery.event.triggered = type; 14080 14081 if ( event.isPropagationStopped() ) { 14082 lastElement.addEventListener( type, stopPropagationCallback ); 14083 } 14084 14085 elem[ type ](); 14086 14087 if ( event.isPropagationStopped() ) { 14088 lastElement.removeEventListener( type, stopPropagationCallback ); 14089 } 14090 14091 jQuery.event.triggered = undefined; 14092 14093 if ( tmp ) { 14094 elem[ ontype ] = tmp; 14095 } 14096 } 14097 } 14098 } 14099 14100 return event.result; 14101 }, 14102 14103 // Piggyback on a donor event to simulate a different one 14104 // Used only for `focus(in | out)` events 14105 simulate: function( type, elem, event ) { 14106 var e = jQuery.extend( 14107 new jQuery.Event(), 14108 event, 14109 { 14110 type: type, 14111 isSimulated: true 14112 } 14113 ); 14114 14115 jQuery.event.trigger( e, null, elem ); 14116 } 14117 14118} ); 14119 14120jQuery.fn.extend( { 14121 14122 trigger: function( type, data ) { 14123 return this.each( function() { 14124 jQuery.event.trigger( type, data, this ); 14125 } ); 14126 }, 14127 triggerHandler: function( type, data ) { 14128 var elem = this[ 0 ]; 14129 if ( elem ) { 14130 return jQuery.event.trigger( type, data, elem, true ); 14131 } 14132 } 14133} ); 14134 14135 14136var 14137 rbracket = /\[\]$/, 14138 rCRLF = /\r?\n/g, 14139 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 14140 rsubmittable = /^(?:input|select|textarea|keygen)/i; 14141 14142function buildParams( prefix, obj, traditional, add ) { 14143 var name; 14144 14145 if ( Array.isArray( obj ) ) { 14146 14147 // Serialize array item. 14148 jQuery.each( obj, function( i, v ) { 14149 if ( traditional || rbracket.test( prefix ) ) { 14150 14151 // Treat each array item as a scalar. 14152 add( prefix, v ); 14153 14154 } else { 14155 14156 // Item is non-scalar (array or object), encode its numeric index. 14157 buildParams( 14158 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", 14159 v, 14160 traditional, 14161 add 14162 ); 14163 } 14164 } ); 14165 14166 } else if ( !traditional && toType( obj ) === "object" ) { 14167 14168 // Serialize object item. 14169 for ( name in obj ) { 14170 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 14171 } 14172 14173 } else { 14174 14175 // Serialize scalar item. 14176 add( prefix, obj ); 14177 } 14178} 14179 14180// Serialize an array of form elements or a set of 14181// key/values into a query string 14182jQuery.param = function( a, traditional ) { 14183 var prefix, 14184 s = [], 14185 add = function( key, valueOrFunction ) { 14186 14187 // If value is a function, invoke it and use its return value 14188 var value = isFunction( valueOrFunction ) ? 14189 valueOrFunction() : 14190 valueOrFunction; 14191 14192 s[ s.length ] = encodeURIComponent( key ) + "=" + 14193 encodeURIComponent( value == null ? "" : value ); 14194 }; 14195 14196 if ( a == null ) { 14197 return ""; 14198 } 14199 14200 // If an array was passed in, assume that it is an array of form elements. 14201 if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 14202 14203 // Serialize the form elements 14204 jQuery.each( a, function() { 14205 add( this.name, this.value ); 14206 } ); 14207 14208 } else { 14209 14210 // If traditional, encode the "old" way (the way 1.3.2 or older 14211 // did it), otherwise encode params recursively. 14212 for ( prefix in a ) { 14213 buildParams( prefix, a[ prefix ], traditional, add ); 14214 } 14215 } 14216 14217 // Return the resulting serialization 14218 return s.join( "&" ); 14219}; 14220 14221jQuery.fn.extend( { 14222 serialize: function() { 14223 return jQuery.param( this.serializeArray() ); 14224 }, 14225 serializeArray: function() { 14226 return this.map( function() { 14227 14228 // Can add propHook for "elements" to filter or add form elements 14229 var elements = jQuery.prop( this, "elements" ); 14230 return elements ? jQuery.makeArray( elements ) : this; 14231 } ).filter( function() { 14232 var type = this.type; 14233 14234 // Use .is( ":disabled" ) so that fieldset[disabled] works 14235 return this.name && !jQuery( this ).is( ":disabled" ) && 14236 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 14237 ( this.checked || !rcheckableType.test( type ) ); 14238 } ).map( function( _i, elem ) { 14239 var val = jQuery( this ).val(); 14240 14241 if ( val == null ) { 14242 return null; 14243 } 14244 14245 if ( Array.isArray( val ) ) { 14246 return jQuery.map( val, function( val ) { 14247 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 14248 } ); 14249 } 14250 14251 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 14252 } ).get(); 14253 } 14254} ); 14255 14256 14257var 14258 r20 = /%20/g, 14259 rhash = /#.*$/, 14260 rantiCache = /([?&])_=[^&]*/, 14261 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, 14262 14263 // trac-7653, trac-8125, trac-8152: local protocol detection 14264 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 14265 rnoContent = /^(?:GET|HEAD)$/, 14266 rprotocol = /^\/\//, 14267 14268 /* Prefilters 14269 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 14270 * 2) These are called: 14271 * - BEFORE asking for a transport 14272 * - AFTER param serialization (s.data is a string if s.processData is true) 14273 * 3) key is the dataType 14274 * 4) the catchall symbol "*" can be used 14275 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 14276 */ 14277 prefilters = {}, 14278 14279 /* Transports bindings 14280 * 1) key is the dataType 14281 * 2) the catchall symbol "*" can be used 14282 * 3) selection will start with transport dataType and THEN go to "*" if needed 14283 */ 14284 transports = {}, 14285 14286 // Avoid comment-prolog char sequence (trac-10098); must appease lint and evade compression 14287 allTypes = "*/".concat( "*" ), 14288 14289 // Anchor tag for parsing the document origin 14290 originAnchor = document.createElement( "a" ); 14291 14292originAnchor.href = location.href; 14293 14294// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 14295function addToPrefiltersOrTransports( structure ) { 14296 14297 // dataTypeExpression is optional and defaults to "*" 14298 return function( dataTypeExpression, func ) { 14299 14300 if ( typeof dataTypeExpression !== "string" ) { 14301 func = dataTypeExpression; 14302 dataTypeExpression = "*"; 14303 } 14304 14305 var dataType, 14306 i = 0, 14307 dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; 14308 14309 if ( isFunction( func ) ) { 14310 14311 // For each dataType in the dataTypeExpression 14312 while ( ( dataType = dataTypes[ i++ ] ) ) { 14313 14314 // Prepend if requested 14315 if ( dataType[ 0 ] === "+" ) { 14316 dataType = dataType.slice( 1 ) || "*"; 14317 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); 14318 14319 // Otherwise append 14320 } else { 14321 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); 14322 } 14323 } 14324 } 14325 }; 14326} 14327 14328// Base inspection function for prefilters and transports 14329function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { 14330 14331 var inspected = {}, 14332 seekingTransport = ( structure === transports ); 14333 14334 function inspect( dataType ) { 14335 var selected; 14336 inspected[ dataType ] = true; 14337 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { 14338 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); 14339 if ( typeof dataTypeOrTransport === "string" && 14340 !seekingTransport && !inspected[ dataTypeOrTransport ] ) { 14341 14342 options.dataTypes.unshift( dataTypeOrTransport ); 14343 inspect( dataTypeOrTransport ); 14344 return false; 14345 } else if ( seekingTransport ) { 14346 return !( selected = dataTypeOrTransport ); 14347 } 14348 } ); 14349 return selected; 14350 } 14351 14352 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); 14353} 14354 14355// A special extend for ajax options 14356// that takes "flat" options (not to be deep extended) 14357// Fixes trac-9887 14358function ajaxExtend( target, src ) { 14359 var key, deep, 14360 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 14361 14362 for ( key in src ) { 14363 if ( src[ key ] !== undefined ) { 14364 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; 14365 } 14366 } 14367 if ( deep ) { 14368 jQuery.extend( true, target, deep ); 14369 } 14370 14371 return target; 14372} 14373 14374/* Handles responses to an ajax request: 14375 * - finds the right dataType (mediates between content-type and expected dataType) 14376 * - returns the corresponding response 14377 */ 14378function ajaxHandleResponses( s, jqXHR, responses ) { 14379 14380 var ct, type, finalDataType, firstDataType, 14381 contents = s.contents, 14382 dataTypes = s.dataTypes; 14383 14384 // Remove auto dataType and get content-type in the process 14385 while ( dataTypes[ 0 ] === "*" ) { 14386 dataTypes.shift(); 14387 if ( ct === undefined ) { 14388 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); 14389 } 14390 } 14391 14392 // Check if we're dealing with a known content-type 14393 if ( ct ) { 14394 for ( type in contents ) { 14395 if ( contents[ type ] && contents[ type ].test( ct ) ) { 14396 dataTypes.unshift( type ); 14397 break; 14398 } 14399 } 14400 } 14401 14402 // Check to see if we have a response for the expected dataType 14403 if ( dataTypes[ 0 ] in responses ) { 14404 finalDataType = dataTypes[ 0 ]; 14405 } else { 14406 14407 // Try convertible dataTypes 14408 for ( type in responses ) { 14409 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { 14410 finalDataType = type; 14411 break; 14412 } 14413 if ( !firstDataType ) { 14414 firstDataType = type; 14415 } 14416 } 14417 14418 // Or just use first one 14419 finalDataType = finalDataType || firstDataType; 14420 } 14421 14422 // If we found a dataType 14423 // We add the dataType to the list if needed 14424 // and return the corresponding response 14425 if ( finalDataType ) { 14426 if ( finalDataType !== dataTypes[ 0 ] ) { 14427 dataTypes.unshift( finalDataType ); 14428 } 14429 return responses[ finalDataType ]; 14430 } 14431} 14432 14433/* Chain conversions given the request and the original response 14434 * Also sets the responseXXX fields on the jqXHR instance 14435 */ 14436function ajaxConvert( s, response, jqXHR, isSuccess ) { 14437 var conv2, current, conv, tmp, prev, 14438 converters = {}, 14439 14440 // Work with a copy of dataTypes in case we need to modify it for conversion 14441 dataTypes = s.dataTypes.slice(); 14442 14443 // Create converters map with lowercased keys 14444 if ( dataTypes[ 1 ] ) { 14445 for ( conv in s.converters ) { 14446 converters[ conv.toLowerCase() ] = s.converters[ conv ]; 14447 } 14448 } 14449 14450 current = dataTypes.shift(); 14451 14452 // Convert to each sequential dataType 14453 while ( current ) { 14454 14455 if ( s.responseFields[ current ] ) { 14456 jqXHR[ s.responseFields[ current ] ] = response; 14457 } 14458 14459 // Apply the dataFilter if provided 14460 if ( !prev && isSuccess && s.dataFilter ) { 14461 response = s.dataFilter( response, s.dataType ); 14462 } 14463 14464 prev = current; 14465 current = dataTypes.shift(); 14466 14467 if ( current ) { 14468 14469 // There's only work to do if current dataType is non-auto 14470 if ( current === "*" ) { 14471 14472 current = prev; 14473 14474 // Convert response if prev dataType is non-auto and differs from current 14475 } else if ( prev !== "*" && prev !== current ) { 14476 14477 // Seek a direct converter 14478 conv = converters[ prev + " " + current ] || converters[ "* " + current ]; 14479 14480 // If none found, seek a pair 14481 if ( !conv ) { 14482 for ( conv2 in converters ) { 14483 14484 // If conv2 outputs current 14485 tmp = conv2.split( " " ); 14486 if ( tmp[ 1 ] === current ) { 14487 14488 // If prev can be converted to accepted input 14489 conv = converters[ prev + " " + tmp[ 0 ] ] || 14490 converters[ "* " + tmp[ 0 ] ]; 14491 if ( conv ) { 14492 14493 // Condense equivalence converters 14494 if ( conv === true ) { 14495 conv = converters[ conv2 ]; 14496 14497 // Otherwise, insert the intermediate dataType 14498 } else if ( converters[ conv2 ] !== true ) { 14499 current = tmp[ 0 ]; 14500 dataTypes.unshift( tmp[ 1 ] ); 14501 } 14502 break; 14503 } 14504 } 14505 } 14506 } 14507 14508 // Apply converter (if not an equivalence) 14509 if ( conv !== true ) { 14510 14511 // Unless errors are allowed to bubble, catch and return them 14512 if ( conv && s.throws ) { 14513 response = conv( response ); 14514 } else { 14515 try { 14516 response = conv( response ); 14517 } catch ( e ) { 14518 return { 14519 state: "parsererror", 14520 error: conv ? e : "No conversion from " + prev + " to " + current 14521 }; 14522 } 14523 } 14524 } 14525 } 14526 } 14527 } 14528 14529 return { state: "success", data: response }; 14530} 14531 14532jQuery.extend( { 14533 14534 // Counter for holding the number of active queries 14535 active: 0, 14536 14537 // Last-Modified header cache for next request 14538 lastModified: {}, 14539 etag: {}, 14540 14541 ajaxSettings: { 14542 url: location.href, 14543 type: "GET", 14544 isLocal: rlocalProtocol.test( location.protocol ), 14545 global: true, 14546 processData: true, 14547 async: true, 14548 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 14549 14550 /* 14551 timeout: 0, 14552 data: null, 14553 dataType: null, 14554 username: null, 14555 password: null, 14556 cache: null, 14557 throws: false, 14558 traditional: false, 14559 headers: {}, 14560 */ 14561 14562 accepts: { 14563 "*": allTypes, 14564 text: "text/plain", 14565 html: "text/html", 14566 xml: "application/xml, text/xml", 14567 json: "application/json, text/javascript" 14568 }, 14569 14570 contents: { 14571 xml: /\bxml\b/, 14572 html: /\bhtml/, 14573 json: /\bjson\b/ 14574 }, 14575 14576 responseFields: { 14577 xml: "responseXML", 14578 text: "responseText", 14579 json: "responseJSON" 14580 }, 14581 14582 // Data converters 14583 // Keys separate source (or catchall "*") and destination types with a single space 14584 converters: { 14585 14586 // Convert anything to text 14587 "* text": String, 14588 14589 // Text to html (true = no transformation) 14590 "text html": true, 14591 14592 // Evaluate text as a json expression 14593 "text json": JSON.parse, 14594 14595 // Parse text as xml 14596 "text xml": jQuery.parseXML 14597 }, 14598 14599 // For options that shouldn't be deep extended: 14600 // you can add your own custom options here if 14601 // and when you create one that shouldn't be 14602 // deep extended (see ajaxExtend) 14603 flatOptions: { 14604 url: true, 14605 context: true 14606 } 14607 }, 14608 14609 // Creates a full fledged settings object into target 14610 // with both ajaxSettings and settings fields. 14611 // If target is omitted, writes into ajaxSettings. 14612 ajaxSetup: function( target, settings ) { 14613 return settings ? 14614 14615 // Building a settings object 14616 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : 14617 14618 // Extending ajaxSettings 14619 ajaxExtend( jQuery.ajaxSettings, target ); 14620 }, 14621 14622 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), 14623 ajaxTransport: addToPrefiltersOrTransports( transports ), 14624 14625 // Main method 14626 ajax: function( url, options ) { 14627 14628 // If url is an object, simulate pre-1.5 signature 14629 if ( typeof url === "object" ) { 14630 options = url; 14631 url = undefined; 14632 } 14633 14634 // Force options to be an object 14635 options = options || {}; 14636 14637 var transport, 14638 14639 // URL without anti-cache param 14640 cacheURL, 14641 14642 // Response headers 14643 responseHeadersString, 14644 responseHeaders, 14645 14646 // timeout handle 14647 timeoutTimer, 14648 14649 // Url cleanup var 14650 urlAnchor, 14651 14652 // Request state (becomes false upon send and true upon completion) 14653 completed, 14654 14655 // To know if global events are to be dispatched 14656 fireGlobals, 14657 14658 // Loop variable 14659 i, 14660 14661 // uncached part of the url 14662 uncached, 14663 14664 // Create the final options object 14665 s = jQuery.ajaxSetup( {}, options ), 14666 14667 // Callbacks context 14668 callbackContext = s.context || s, 14669 14670 // Context for global events is callbackContext if it is a DOM node or jQuery collection 14671 globalEventContext = s.context && 14672 ( callbackContext.nodeType || callbackContext.jquery ) ? 14673 jQuery( callbackContext ) : 14674 jQuery.event, 14675 14676 // Deferreds 14677 deferred = jQuery.Deferred(), 14678 completeDeferred = jQuery.Callbacks( "once memory" ), 14679 14680 // Status-dependent callbacks 14681 statusCode = s.statusCode || {}, 14682 14683 // Headers (they are sent all at once) 14684 requestHeaders = {}, 14685 requestHeadersNames = {}, 14686 14687 // Default abort message 14688 strAbort = "canceled", 14689 14690 // Fake xhr 14691 jqXHR = { 14692 readyState: 0, 14693 14694 // Builds headers hashtable if needed 14695 getResponseHeader: function( key ) { 14696 var match; 14697 if ( completed ) { 14698 if ( !responseHeaders ) { 14699 responseHeaders = {}; 14700 while ( ( match = rheaders.exec( responseHeadersString ) ) ) { 14701 responseHeaders[ match[ 1 ].toLowerCase() + " " ] = 14702 ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) 14703 .concat( match[ 2 ] ); 14704 } 14705 } 14706 match = responseHeaders[ key.toLowerCase() + " " ]; 14707 } 14708 return match == null ? null : match.join( ", " ); 14709 }, 14710 14711 // Raw string 14712 getAllResponseHeaders: function() { 14713 return completed ? responseHeadersString : null; 14714 }, 14715 14716 // Caches the header 14717 setRequestHeader: function( name, value ) { 14718 if ( completed == null ) { 14719 name = requestHeadersNames[ name.toLowerCase() ] = 14720 requestHeadersNames[ name.toLowerCase() ] || name; 14721 requestHeaders[ name ] = value; 14722 } 14723 return this; 14724 }, 14725 14726 // Overrides response content-type header 14727 overrideMimeType: function( type ) { 14728 if ( completed == null ) { 14729 s.mimeType = type; 14730 } 14731 return this; 14732 }, 14733 14734 // Status-dependent callbacks 14735 statusCode: function( map ) { 14736 var code; 14737 if ( map ) { 14738 if ( completed ) { 14739 14740 // Execute the appropriate callbacks 14741 jqXHR.always( map[ jqXHR.status ] ); 14742 } else { 14743 14744 // Lazy-add the new callbacks in a way that preserves old ones 14745 for ( code in map ) { 14746 statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; 14747 } 14748 } 14749 } 14750 return this; 14751 }, 14752 14753 // Cancel the request 14754 abort: function( statusText ) { 14755 var finalText = statusText || strAbort; 14756 if ( transport ) { 14757 transport.abort( finalText ); 14758 } 14759 done( 0, finalText ); 14760 return this; 14761 } 14762 }; 14763 14764 // Attach deferreds 14765 deferred.promise( jqXHR ); 14766 14767 // Add protocol if not provided (prefilters might expect it) 14768 // Handle falsy url in the settings object (trac-10093: consistency with old signature) 14769 // We also use the url parameter if available 14770 s.url = ( ( url || s.url || location.href ) + "" ) 14771 .replace( rprotocol, location.protocol + "//" ); 14772 14773 // Alias method option to type as per ticket trac-12004 14774 s.type = options.method || options.type || s.method || s.type; 14775 14776 // Extract dataTypes list 14777 s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; 14778 14779 // A cross-domain request is in order when the origin doesn't match the current origin. 14780 if ( s.crossDomain == null ) { 14781 urlAnchor = document.createElement( "a" ); 14782 14783 // Support: IE <=8 - 11, Edge 12 - 15 14784 // IE throws exception on accessing the href property if url is malformed, 14785 // e.g. http://example.com:80x/ 14786 try { 14787 urlAnchor.href = s.url; 14788 14789 // Support: IE <=8 - 11 only 14790 // Anchor's host property isn't correctly set when s.url is relative 14791 urlAnchor.href = urlAnchor.href; 14792 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== 14793 urlAnchor.protocol + "//" + urlAnchor.host; 14794 } catch ( e ) { 14795 14796 // If there is an error parsing the URL, assume it is crossDomain, 14797 // it can be rejected by the transport if it is invalid 14798 s.crossDomain = true; 14799 } 14800 } 14801 14802 // Convert data if not already a string 14803 if ( s.data && s.processData && typeof s.data !== "string" ) { 14804 s.data = jQuery.param( s.data, s.traditional ); 14805 } 14806 14807 // Apply prefilters 14808 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 14809 14810 // If request was aborted inside a prefilter, stop there 14811 if ( completed ) { 14812 return jqXHR; 14813 } 14814 14815 // We can fire global events as of now if asked to 14816 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (trac-15118) 14817 fireGlobals = jQuery.event && s.global; 14818 14819 // Watch for a new set of requests 14820 if ( fireGlobals && jQuery.active++ === 0 ) { 14821 jQuery.event.trigger( "ajaxStart" ); 14822 } 14823 14824 // Uppercase the type 14825 s.type = s.type.toUpperCase(); 14826 14827 // Determine if request has content 14828 s.hasContent = !rnoContent.test( s.type ); 14829 14830 // Save the URL in case we're toying with the If-Modified-Since 14831 // and/or If-None-Match header later on 14832 // Remove hash to simplify url manipulation 14833 cacheURL = s.url.replace( rhash, "" ); 14834 14835 // More options handling for requests with no content 14836 if ( !s.hasContent ) { 14837 14838 // Remember the hash so we can put it back 14839 uncached = s.url.slice( cacheURL.length ); 14840 14841 // If data is available and should be processed, append data to url 14842 if ( s.data && ( s.processData || typeof s.data === "string" ) ) { 14843 cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; 14844 14845 // trac-9682: remove data so that it's not used in an eventual retry 14846 delete s.data; 14847 } 14848 14849 // Add or update anti-cache param if needed 14850 if ( s.cache === false ) { 14851 cacheURL = cacheURL.replace( rantiCache, "$1" ); 14852 uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + 14853 uncached; 14854 } 14855 14856 // Put hash and anti-cache on the URL that will be requested (gh-1732) 14857 s.url = cacheURL + uncached; 14858 14859 // Change '%20' to '+' if this is encoded form body content (gh-2658) 14860 } else if ( s.data && s.processData && 14861 ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { 14862 s.data = s.data.replace( r20, "+" ); 14863 } 14864 14865 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 14866 if ( s.ifModified ) { 14867 if ( jQuery.lastModified[ cacheURL ] ) { 14868 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); 14869 } 14870 if ( jQuery.etag[ cacheURL ] ) { 14871 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); 14872 } 14873 } 14874 14875 // Set the correct header, if data is being sent 14876 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { 14877 jqXHR.setRequestHeader( "Content-Type", s.contentType ); 14878 } 14879 14880 // Set the Accepts header for the server, depending on the dataType 14881 jqXHR.setRequestHeader( 14882 "Accept", 14883 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? 14884 s.accepts[ s.dataTypes[ 0 ] ] + 14885 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 14886 s.accepts[ "*" ] 14887 ); 14888 14889 // Check for headers option 14890 for ( i in s.headers ) { 14891 jqXHR.setRequestHeader( i, s.headers[ i ] ); 14892 } 14893 14894 // Allow custom headers/mimetypes and early abort 14895 if ( s.beforeSend && 14896 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { 14897 14898 // Abort if not done already and return 14899 return jqXHR.abort(); 14900 } 14901 14902 // Aborting is no longer a cancellation 14903 strAbort = "abort"; 14904 14905 // Install callbacks on deferreds 14906 completeDeferred.add( s.complete ); 14907 jqXHR.done( s.success ); 14908 jqXHR.fail( s.error ); 14909 14910 // Get transport 14911 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); 14912 14913 // If no transport, we auto-abort 14914 if ( !transport ) { 14915 done( -1, "No Transport" ); 14916 } else { 14917 jqXHR.readyState = 1; 14918 14919 // Send global event 14920 if ( fireGlobals ) { 14921 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); 14922 } 14923 14924 // If request was aborted inside ajaxSend, stop there 14925 if ( completed ) { 14926 return jqXHR; 14927 } 14928 14929 // Timeout 14930 if ( s.async && s.timeout > 0 ) { 14931 timeoutTimer = window.setTimeout( function() { 14932 jqXHR.abort( "timeout" ); 14933 }, s.timeout ); 14934 } 14935 14936 try { 14937 completed = false; 14938 transport.send( requestHeaders, done ); 14939 } catch ( e ) { 14940 14941 // Rethrow post-completion exceptions 14942 if ( completed ) { 14943 throw e; 14944 } 14945 14946 // Propagate others as results 14947 done( -1, e ); 14948 } 14949 } 14950 14951 // Callback for when everything is done 14952 function done( status, nativeStatusText, responses, headers ) { 14953 var isSuccess, success, error, response, modified, 14954 statusText = nativeStatusText; 14955 14956 // Ignore repeat invocations 14957 if ( completed ) { 14958 return; 14959 } 14960 14961 completed = true; 14962 14963 // Clear timeout if it exists 14964 if ( timeoutTimer ) { 14965 window.clearTimeout( timeoutTimer ); 14966 } 14967 14968 // Dereference transport for early garbage collection 14969 // (no matter how long the jqXHR object will be used) 14970 transport = undefined; 14971 14972 // Cache response headers 14973 responseHeadersString = headers || ""; 14974 14975 // Set readyState 14976 jqXHR.readyState = status > 0 ? 4 : 0; 14977 14978 // Determine if successful 14979 isSuccess = status >= 200 && status < 300 || status === 304; 14980 14981 // Get response data 14982 if ( responses ) { 14983 response = ajaxHandleResponses( s, jqXHR, responses ); 14984 } 14985 14986 // Use a noop converter for missing script but not if jsonp 14987 if ( !isSuccess && 14988 jQuery.inArray( "script", s.dataTypes ) > -1 && 14989 jQuery.inArray( "json", s.dataTypes ) < 0 ) { 14990 s.converters[ "text script" ] = function() {}; 14991 } 14992 14993 // Convert no matter what (that way responseXXX fields are always set) 14994 response = ajaxConvert( s, response, jqXHR, isSuccess ); 14995 14996 // If successful, handle type chaining 14997 if ( isSuccess ) { 14998 14999 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 15000 if ( s.ifModified ) { 15001 modified = jqXHR.getResponseHeader( "Last-Modified" ); 15002 if ( modified ) { 15003 jQuery.lastModified[ cacheURL ] = modified; 15004 } 15005 modified = jqXHR.getResponseHeader( "etag" ); 15006 if ( modified ) { 15007 jQuery.etag[ cacheURL ] = modified; 15008 } 15009 } 15010 15011 // if no content 15012 if ( status === 204 || s.type === "HEAD" ) { 15013 statusText = "nocontent"; 15014 15015 // if not modified 15016 } else if ( status === 304 ) { 15017 statusText = "notmodified"; 15018 15019 // If we have data, let's convert it 15020 } else { 15021 statusText = response.state; 15022 success = response.data; 15023 error = response.error; 15024 isSuccess = !error; 15025 } 15026 } else { 15027 15028 // Extract error from statusText and normalize for non-aborts 15029 error = statusText; 15030 if ( status || !statusText ) { 15031 statusText = "error"; 15032 if ( status < 0 ) { 15033 status = 0; 15034 } 15035 } 15036 } 15037 15038 // Set data for the fake xhr object 15039 jqXHR.status = status; 15040 jqXHR.statusText = ( nativeStatusText || statusText ) + ""; 15041 15042 // Success/Error 15043 if ( isSuccess ) { 15044 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); 15045 } else { 15046 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); 15047 } 15048 15049 // Status-dependent callbacks 15050 jqXHR.statusCode( statusCode ); 15051 statusCode = undefined; 15052 15053 if ( fireGlobals ) { 15054 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", 15055 [ jqXHR, s, isSuccess ? success : error ] ); 15056 } 15057 15058 // Complete 15059 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); 15060 15061 if ( fireGlobals ) { 15062 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 15063 15064 // Handle the global AJAX counter 15065 if ( !( --jQuery.active ) ) { 15066 jQuery.event.trigger( "ajaxStop" ); 15067 } 15068 } 15069 } 15070 15071 return jqXHR; 15072 }, 15073 15074 getJSON: function( url, data, callback ) { 15075 return jQuery.get( url, data, callback, "json" ); 15076 }, 15077 15078 getScript: function( url, callback ) { 15079 return jQuery.get( url, undefined, callback, "script" ); 15080 } 15081} ); 15082 15083jQuery.each( [ "get", "post" ], function( _i, method ) { 15084 jQuery[ method ] = function( url, data, callback, type ) { 15085 15086 // Shift arguments if data argument was omitted 15087 if ( isFunction( data ) ) { 15088 type = type || callback; 15089 callback = data; 15090 data = undefined; 15091 } 15092 15093 // The url can be an options object (which then must have .url) 15094 return jQuery.ajax( jQuery.extend( { 15095 url: url, 15096 type: method, 15097 dataType: type, 15098 data: data, 15099 success: callback 15100 }, jQuery.isPlainObject( url ) && url ) ); 15101 }; 15102} ); 15103 15104jQuery.ajaxPrefilter( function( s ) { 15105 var i; 15106 for ( i in s.headers ) { 15107 if ( i.toLowerCase() === "content-type" ) { 15108 s.contentType = s.headers[ i ] || ""; 15109 } 15110 } 15111} ); 15112 15113 15114jQuery._evalUrl = function( url, options, doc ) { 15115 return jQuery.ajax( { 15116 url: url, 15117 15118 // Make this explicit, since user can override this through ajaxSetup (trac-11264) 15119 type: "GET", 15120 dataType: "script", 15121 cache: true, 15122 async: false, 15123 global: false, 15124 15125 // Only evaluate the response if it is successful (gh-4126) 15126 // dataFilter is not invoked for failure responses, so using it instead 15127 // of the default converter is kludgy but it works. 15128 converters: { 15129 "text script": function() {} 15130 }, 15131 dataFilter: function( response ) { 15132 jQuery.globalEval( response, options, doc ); 15133 } 15134 } ); 15135}; 15136 15137 15138jQuery.fn.extend( { 15139 wrapAll: function( html ) { 15140 var wrap; 15141 15142 if ( this[ 0 ] ) { 15143 if ( isFunction( html ) ) { 15144 html = html.call( this[ 0 ] ); 15145 } 15146 15147 // The elements to wrap the target around 15148 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); 15149 15150 if ( this[ 0 ].parentNode ) { 15151 wrap.insertBefore( this[ 0 ] ); 15152 } 15153 15154 wrap.map( function() { 15155 var elem = this; 15156 15157 while ( elem.firstElementChild ) { 15158 elem = elem.firstElementChild; 15159 } 15160 15161 return elem; 15162 } ).append( this ); 15163 } 15164 15165 return this; 15166 }, 15167 15168 wrapInner: function( html ) { 15169 if ( isFunction( html ) ) { 15170 return this.each( function( i ) { 15171 jQuery( this ).wrapInner( html.call( this, i ) ); 15172 } ); 15173 } 15174 15175 return this.each( function() { 15176 var self = jQuery( this ), 15177 contents = self.contents(); 15178 15179 if ( contents.length ) { 15180 contents.wrapAll( html ); 15181 15182 } else { 15183 self.append( html ); 15184 } 15185 } ); 15186 }, 15187 15188 wrap: function( html ) { 15189 var htmlIsFunction = isFunction( html ); 15190 15191 return this.each( function( i ) { 15192 jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); 15193 } ); 15194 }, 15195 15196 unwrap: function( selector ) { 15197 this.parent( selector ).not( "body" ).each( function() { 15198 jQuery( this ).replaceWith( this.childNodes ); 15199 } ); 15200 return this; 15201 } 15202} ); 15203 15204 15205jQuery.expr.pseudos.hidden = function( elem ) { 15206 return !jQuery.expr.pseudos.visible( elem ); 15207}; 15208jQuery.expr.pseudos.visible = function( elem ) { 15209 return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); 15210}; 15211 15212 15213 15214 15215jQuery.ajaxSettings.xhr = function() { 15216 try { 15217 return new window.XMLHttpRequest(); 15218 } catch ( e ) {} 15219}; 15220 15221var xhrSuccessStatus = { 15222 15223 // File protocol always yields status code 0, assume 200 15224 0: 200, 15225 15226 // Support: IE <=9 only 15227 // trac-1450: sometimes IE returns 1223 when it should be 204 15228 1223: 204 15229 }, 15230 xhrSupported = jQuery.ajaxSettings.xhr(); 15231 15232support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 15233support.ajax = xhrSupported = !!xhrSupported; 15234 15235jQuery.ajaxTransport( function( options ) { 15236 var callback, errorCallback; 15237 15238 // Cross domain only allowed if supported through XMLHttpRequest 15239 if ( support.cors || xhrSupported && !options.crossDomain ) { 15240 return { 15241 send: function( headers, complete ) { 15242 var i, 15243 xhr = options.xhr(); 15244 15245 xhr.open( 15246 options.type, 15247 options.url, 15248 options.async, 15249 options.username, 15250 options.password 15251 ); 15252 15253 // Apply custom fields if provided 15254 if ( options.xhrFields ) { 15255 for ( i in options.xhrFields ) { 15256 xhr[ i ] = options.xhrFields[ i ]; 15257 } 15258 } 15259 15260 // Override mime type if needed 15261 if ( options.mimeType && xhr.overrideMimeType ) { 15262 xhr.overrideMimeType( options.mimeType ); 15263 } 15264 15265 // X-Requested-With header 15266 // For cross-domain requests, seeing as conditions for a preflight are 15267 // akin to a jigsaw puzzle, we simply never set it to be sure. 15268 // (it can always be set on a per-request basis or even using ajaxSetup) 15269 // For same-domain requests, won't change header if already provided. 15270 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { 15271 headers[ "X-Requested-With" ] = "XMLHttpRequest"; 15272 } 15273 15274 // Set headers 15275 for ( i in headers ) { 15276 xhr.setRequestHeader( i, headers[ i ] ); 15277 } 15278 15279 // Callback 15280 callback = function( type ) { 15281 return function() { 15282 if ( callback ) { 15283 callback = errorCallback = xhr.onload = 15284 xhr.onerror = xhr.onabort = xhr.ontimeout = 15285 xhr.onreadystatechange = null; 15286 15287 if ( type === "abort" ) { 15288 xhr.abort(); 15289 } else if ( type === "error" ) { 15290 15291 // Support: IE <=9 only 15292 // On a manual native abort, IE9 throws 15293 // errors on any property access that is not readyState 15294 if ( typeof xhr.status !== "number" ) { 15295 complete( 0, "error" ); 15296 } else { 15297 complete( 15298 15299 // File: protocol always yields status 0; see trac-8605, trac-14207 15300 xhr.status, 15301 xhr.statusText 15302 ); 15303 } 15304 } else { 15305 complete( 15306 xhrSuccessStatus[ xhr.status ] || xhr.status, 15307 xhr.statusText, 15308 15309 // Support: IE <=9 only 15310 // IE9 has no XHR2 but throws on binary (trac-11426) 15311 // For XHR2 non-text, let the caller handle it (gh-2498) 15312 ( xhr.responseType || "text" ) !== "text" || 15313 typeof xhr.responseText !== "string" ? 15314 { binary: xhr.response } : 15315 { text: xhr.responseText }, 15316 xhr.getAllResponseHeaders() 15317 ); 15318 } 15319 } 15320 }; 15321 }; 15322 15323 // Listen to events 15324 xhr.onload = callback(); 15325 errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); 15326 15327 // Support: IE 9 only 15328 // Use onreadystatechange to replace onabort 15329 // to handle uncaught aborts 15330 if ( xhr.onabort !== undefined ) { 15331 xhr.onabort = errorCallback; 15332 } else { 15333 xhr.onreadystatechange = function() { 15334 15335 // Check readyState before timeout as it changes 15336 if ( xhr.readyState === 4 ) { 15337 15338 // Allow onerror to be called first, 15339 // but that will not handle a native abort 15340 // Also, save errorCallback to a variable 15341 // as xhr.onerror cannot be accessed 15342 window.setTimeout( function() { 15343 if ( callback ) { 15344 errorCallback(); 15345 } 15346 } ); 15347 } 15348 }; 15349 } 15350 15351 // Create the abort callback 15352 callback = callback( "abort" ); 15353 15354 try { 15355 15356 // Do send the request (this may raise an exception) 15357 xhr.send( options.hasContent && options.data || null ); 15358 } catch ( e ) { 15359 15360 // trac-14683: Only rethrow if this hasn't been notified as an error yet 15361 if ( callback ) { 15362 throw e; 15363 } 15364 } 15365 }, 15366 15367 abort: function() { 15368 if ( callback ) { 15369 callback(); 15370 } 15371 } 15372 }; 15373 } 15374} ); 15375 15376 15377 15378 15379// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) 15380jQuery.ajaxPrefilter( function( s ) { 15381 if ( s.crossDomain ) { 15382 s.contents.script = false; 15383 } 15384} ); 15385 15386// Install script dataType 15387jQuery.ajaxSetup( { 15388 accepts: { 15389 script: "text/javascript, application/javascript, " + 15390 "application/ecmascript, application/x-ecmascript" 15391 }, 15392 contents: { 15393 script: /\b(?:java|ecma)script\b/ 15394 }, 15395 converters: { 15396 "text script": function( text ) { 15397 jQuery.globalEval( text ); 15398 return text; 15399 } 15400 } 15401} ); 15402 15403// Handle cache's special case and crossDomain 15404jQuery.ajaxPrefilter( "script", function( s ) { 15405 if ( s.cache === undefined ) { 15406 s.cache = false; 15407 } 15408 if ( s.crossDomain ) { 15409 s.type = "GET"; 15410 } 15411} ); 15412 15413// Bind script tag hack transport 15414jQuery.ajaxTransport( "script", function( s ) { 15415 15416 // This transport only deals with cross domain or forced-by-attrs requests 15417 if ( s.crossDomain || s.scriptAttrs ) { 15418 var script, callback; 15419 return { 15420 send: function( _, complete ) { 15421 script = jQuery( "<script>" ) 15422 .attr( s.scriptAttrs || {} ) 15423 .prop( { charset: s.scriptCharset, src: s.url } ) 15424 .on( "load error", callback = function( evt ) { 15425 script.remove(); 15426 callback = null; 15427 if ( evt ) { 15428 complete( evt.type === "error" ? 404 : 200, evt.type ); 15429 } 15430 } ); 15431 15432 // Use native DOM manipulation to avoid our domManip AJAX trickery 15433 document.head.appendChild( script[ 0 ] ); 15434 }, 15435 abort: function() { 15436 if ( callback ) { 15437 callback(); 15438 } 15439 } 15440 }; 15441 } 15442} ); 15443 15444 15445 15446 15447var oldCallbacks = [], 15448 rjsonp = /(=)\?(?=&|$)|\?\?/; 15449 15450// Default jsonp settings 15451jQuery.ajaxSetup( { 15452 jsonp: "callback", 15453 jsonpCallback: function() { 15454 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) ); 15455 this[ callback ] = true; 15456 return callback; 15457 } 15458} ); 15459 15460// Detect, normalize options and install callbacks for jsonp requests 15461jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 15462 15463 var callbackName, overwritten, responseContainer, 15464 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 15465 "url" : 15466 typeof s.data === "string" && 15467 ( s.contentType || "" ) 15468 .indexOf( "application/x-www-form-urlencoded" ) === 0 && 15469 rjsonp.test( s.data ) && "data" 15470 ); 15471 15472 // Handle iff the expected data type is "jsonp" or we have a parameter to set 15473 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 15474 15475 // Get callback name, remembering preexisting value associated with it 15476 callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ? 15477 s.jsonpCallback() : 15478 s.jsonpCallback; 15479 15480 // Insert callback into url or form data 15481 if ( jsonProp ) { 15482 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 15483 } else if ( s.jsonp !== false ) { 15484 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 15485 } 15486 15487 // Use data converter to retrieve json after script execution 15488 s.converters[ "script json" ] = function() { 15489 if ( !responseContainer ) { 15490 jQuery.error( callbackName + " was not called" ); 15491 } 15492 return responseContainer[ 0 ]; 15493 }; 15494 15495 // Force json dataType 15496 s.dataTypes[ 0 ] = "json"; 15497 15498 // Install callback 15499 overwritten = window[ callbackName ]; 15500 window[ callbackName ] = function() { 15501 responseContainer = arguments; 15502 }; 15503 15504 // Clean-up function (fires after converters) 15505 jqXHR.always( function() { 15506 15507 // If previous value didn't exist - remove it 15508 if ( overwritten === undefined ) { 15509 jQuery( window ).removeProp( callbackName ); 15510 15511 // Otherwise restore preexisting value 15512 } else { 15513 window[ callbackName ] = overwritten; 15514 } 15515 15516 // Save back as free 15517 if ( s[ callbackName ] ) { 15518 15519 // Make sure that re-using the options doesn't screw things around 15520 s.jsonpCallback = originalSettings.jsonpCallback; 15521 15522 // Save the callback name for future use 15523 oldCallbacks.push( callbackName ); 15524 } 15525 15526 // Call if it was a function and we have a response 15527 if ( responseContainer && isFunction( overwritten ) ) { 15528 overwritten( responseContainer[ 0 ] ); 15529 } 15530 15531 responseContainer = overwritten = undefined; 15532 } ); 15533 15534 // Delegate to script 15535 return "script"; 15536 } 15537} ); 15538 15539 15540 15541 15542// Support: Safari 8 only 15543// In Safari 8 documents created via document.implementation.createHTMLDocument 15544// collapse sibling forms: the second one becomes a child of the first one. 15545// Because of that, this security measure has to be disabled in Safari 8. 15546// https://bugs.webkit.org/show_bug.cgi?id=137337 15547support.createHTMLDocument = ( function() { 15548 var body = document.implementation.createHTMLDocument( "" ).body; 15549 body.innerHTML = "<form></form><form></form>"; 15550 return body.childNodes.length === 2; 15551} )(); 15552 15553 15554// Argument "data" should be string of html 15555// context (optional): If specified, the fragment will be created in this context, 15556// defaults to document 15557// keepScripts (optional): If true, will include scripts passed in the html string 15558jQuery.parseHTML = function( data, context, keepScripts ) { 15559 if ( typeof data !== "string" ) { 15560 return []; 15561 } 15562 if ( typeof context === "boolean" ) { 15563 keepScripts = context; 15564 context = false; 15565 } 15566 15567 var base, parsed, scripts; 15568 15569 if ( !context ) { 15570 15571 // Stop scripts or inline event handlers from being executed immediately 15572 // by using document.implementation 15573 if ( support.createHTMLDocument ) { 15574 context = document.implementation.createHTMLDocument( "" ); 15575 15576 // Set the base href for the created document 15577 // so any parsed elements with URLs 15578 // are based on the document's URL (gh-2965) 15579 base = context.createElement( "base" ); 15580 base.href = document.location.href; 15581 context.head.appendChild( base ); 15582 } else { 15583 context = document; 15584 } 15585 } 15586 15587 parsed = rsingleTag.exec( data ); 15588 scripts = !keepScripts && []; 15589 15590 // Single tag 15591 if ( parsed ) { 15592 return [ context.createElement( parsed[ 1 ] ) ]; 15593 } 15594 15595 parsed = buildFragment( [ data ], context, scripts ); 15596 15597 if ( scripts && scripts.length ) { 15598 jQuery( scripts ).remove(); 15599 } 15600 15601 return jQuery.merge( [], parsed.childNodes ); 15602}; 15603 15604 15605/** 15606 * Load a url into a page 15607 */ 15608jQuery.fn.load = function( url, params, callback ) { 15609 var selector, type, response, 15610 self = this, 15611 off = url.indexOf( " " ); 15612 15613 if ( off > -1 ) { 15614 selector = stripAndCollapse( url.slice( off ) ); 15615 url = url.slice( 0, off ); 15616 } 15617 15618 // If it's a function 15619 if ( isFunction( params ) ) { 15620 15621 // We assume that it's the callback 15622 callback = params; 15623 params = undefined; 15624 15625 // Otherwise, build a param string 15626 } else if ( params && typeof params === "object" ) { 15627 type = "POST"; 15628 } 15629 15630 // If we have elements to modify, make the request 15631 if ( self.length > 0 ) { 15632 jQuery.ajax( { 15633 url: url, 15634 15635 // If "type" variable is undefined, then "GET" method will be used. 15636 // Make value of this field explicit since 15637 // user can override it through ajaxSetup method 15638 type: type || "GET", 15639 dataType: "html", 15640 data: params 15641 } ).done( function( responseText ) { 15642 15643 // Save response for use in complete callback 15644 response = arguments; 15645 15646 self.html( selector ? 15647 15648 // If a selector was specified, locate the right elements in a dummy div 15649 // Exclude scripts to avoid IE 'Permission Denied' errors 15650 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : 15651 15652 // Otherwise use the full result 15653 responseText ); 15654 15655 // If the request succeeds, this function gets "data", "status", "jqXHR" 15656 // but they are ignored because response was set above. 15657 // If it fails, this function gets "jqXHR", "status", "error" 15658 } ).always( callback && function( jqXHR, status ) { 15659 self.each( function() { 15660 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); 15661 } ); 15662 } ); 15663 } 15664 15665 return this; 15666}; 15667 15668 15669 15670 15671jQuery.expr.pseudos.animated = function( elem ) { 15672 return jQuery.grep( jQuery.timers, function( fn ) { 15673 return elem === fn.elem; 15674 } ).length; 15675}; 15676 15677 15678 15679 15680jQuery.offset = { 15681 setOffset: function( elem, options, i ) { 15682 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, 15683 position = jQuery.css( elem, "position" ), 15684 curElem = jQuery( elem ), 15685 props = {}; 15686 15687 // Set position first, in-case top/left are set even on static elem 15688 if ( position === "static" ) { 15689 elem.style.position = "relative"; 15690 } 15691 15692 curOffset = curElem.offset(); 15693 curCSSTop = jQuery.css( elem, "top" ); 15694 curCSSLeft = jQuery.css( elem, "left" ); 15695 calculatePosition = ( position === "absolute" || position === "fixed" ) && 15696 ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; 15697 15698 // Need to be able to calculate position if either 15699 // top or left is auto and position is either absolute or fixed 15700 if ( calculatePosition ) { 15701 curPosition = curElem.position(); 15702 curTop = curPosition.top; 15703 curLeft = curPosition.left; 15704 15705 } else { 15706 curTop = parseFloat( curCSSTop ) || 0; 15707 curLeft = parseFloat( curCSSLeft ) || 0; 15708 } 15709 15710 if ( isFunction( options ) ) { 15711 15712 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) 15713 options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); 15714 } 15715 15716 if ( options.top != null ) { 15717 props.top = ( options.top - curOffset.top ) + curTop; 15718 } 15719 if ( options.left != null ) { 15720 props.left = ( options.left - curOffset.left ) + curLeft; 15721 } 15722 15723 if ( "using" in options ) { 15724 options.using.call( elem, props ); 15725 15726 } else { 15727 curElem.css( props ); 15728 } 15729 } 15730}; 15731 15732jQuery.fn.extend( { 15733 15734 // offset() relates an element's border box to the document origin 15735 offset: function( options ) { 15736 15737 // Preserve chaining for setter 15738 if ( arguments.length ) { 15739 return options === undefined ? 15740 this : 15741 this.each( function( i ) { 15742 jQuery.offset.setOffset( this, options, i ); 15743 } ); 15744 } 15745 15746 var rect, win, 15747 elem = this[ 0 ]; 15748 15749 if ( !elem ) { 15750 return; 15751 } 15752 15753 // Return zeros for disconnected and hidden (display: none) elements (gh-2310) 15754 // Support: IE <=11 only 15755 // Running getBoundingClientRect on a 15756 // disconnected node in IE throws an error 15757 if ( !elem.getClientRects().length ) { 15758 return { top: 0, left: 0 }; 15759 } 15760 15761 // Get document-relative position by adding viewport scroll to viewport-relative gBCR 15762 rect = elem.getBoundingClientRect(); 15763 win = elem.ownerDocument.defaultView; 15764 return { 15765 top: rect.top + win.pageYOffset, 15766 left: rect.left + win.pageXOffset 15767 }; 15768 }, 15769 15770 // position() relates an element's margin box to its offset parent's padding box 15771 // This corresponds to the behavior of CSS absolute positioning 15772 position: function() { 15773 if ( !this[ 0 ] ) { 15774 return; 15775 } 15776 15777 var offsetParent, offset, doc, 15778 elem = this[ 0 ], 15779 parentOffset = { top: 0, left: 0 }; 15780 15781 // position:fixed elements are offset from the viewport, which itself always has zero offset 15782 if ( jQuery.css( elem, "position" ) === "fixed" ) { 15783 15784 // Assume position:fixed implies availability of getBoundingClientRect 15785 offset = elem.getBoundingClientRect(); 15786 15787 } else { 15788 offset = this.offset(); 15789 15790 // Account for the *real* offset parent, which can be the document or its root element 15791 // when a statically positioned element is identified 15792 doc = elem.ownerDocument; 15793 offsetParent = elem.offsetParent || doc.documentElement; 15794 while ( offsetParent && 15795 ( offsetParent === doc.body || offsetParent === doc.documentElement ) && 15796 jQuery.css( offsetParent, "position" ) === "static" ) { 15797 15798 offsetParent = offsetParent.parentNode; 15799 } 15800 if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) { 15801 15802 // Incorporate borders into its offset, since they are outside its content origin 15803 parentOffset = jQuery( offsetParent ).offset(); 15804 parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true ); 15805 parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true ); 15806 } 15807 } 15808 15809 // Subtract parent offsets and element margins 15810 return { 15811 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), 15812 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) 15813 }; 15814 }, 15815 15816 // This method will return documentElement in the following cases: 15817 // 1) For the element inside the iframe without offsetParent, this method will return 15818 // documentElement of the parent window 15819 // 2) For the hidden or detached element 15820 // 3) For body or html element, i.e. in case of the html node - it will return itself 15821 // 15822 // but those exceptions were never presented as a real life use-cases 15823 // and might be considered as more preferable results. 15824 // 15825 // This logic, however, is not guaranteed and can change at any point in the future 15826 offsetParent: function() { 15827 return this.map( function() { 15828 var offsetParent = this.offsetParent; 15829 15830 while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { 15831 offsetParent = offsetParent.offsetParent; 15832 } 15833 15834 return offsetParent || documentElement; 15835 } ); 15836 } 15837} ); 15838 15839// Create scrollLeft and scrollTop methods 15840jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { 15841 var top = "pageYOffset" === prop; 15842 15843 jQuery.fn[ method ] = function( val ) { 15844 return access( this, function( elem, method, val ) { 15845 15846 // Coalesce documents and windows 15847 var win; 15848 if ( isWindow( elem ) ) { 15849 win = elem; 15850 } else if ( elem.nodeType === 9 ) { 15851 win = elem.defaultView; 15852 } 15853 15854 if ( val === undefined ) { 15855 return win ? win[ prop ] : elem[ method ]; 15856 } 15857 15858 if ( win ) { 15859 win.scrollTo( 15860 !top ? val : win.pageXOffset, 15861 top ? val : win.pageYOffset 15862 ); 15863 15864 } else { 15865 elem[ method ] = val; 15866 } 15867 }, method, val, arguments.length ); 15868 }; 15869} ); 15870 15871// Support: Safari <=7 - 9.1, Chrome <=37 - 49 15872// Add the top/left cssHooks using jQuery.fn.position 15873// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 15874// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347 15875// getComputedStyle returns percent when specified for top/left/bottom/right; 15876// rather than make the css module depend on the offset module, just check for it here 15877jQuery.each( [ "top", "left" ], function( _i, prop ) { 15878 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, 15879 function( elem, computed ) { 15880 if ( computed ) { 15881 computed = curCSS( elem, prop ); 15882 15883 // If curCSS returns percentage, fallback to offset 15884 return rnumnonpx.test( computed ) ? 15885 jQuery( elem ).position()[ prop ] + "px" : 15886 computed; 15887 } 15888 } 15889 ); 15890} ); 15891 15892 15893// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 15894jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { 15895 jQuery.each( { 15896 padding: "inner" + name, 15897 content: type, 15898 "": "outer" + name 15899 }, function( defaultExtra, funcName ) { 15900 15901 // Margin is only for outerHeight, outerWidth 15902 jQuery.fn[ funcName ] = function( margin, value ) { 15903 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 15904 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 15905 15906 return access( this, function( elem, type, value ) { 15907 var doc; 15908 15909 if ( isWindow( elem ) ) { 15910 15911 // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729) 15912 return funcName.indexOf( "outer" ) === 0 ? 15913 elem[ "inner" + name ] : 15914 elem.document.documentElement[ "client" + name ]; 15915 } 15916 15917 // Get document width or height 15918 if ( elem.nodeType === 9 ) { 15919 doc = elem.documentElement; 15920 15921 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 15922 // whichever is greatest 15923 return Math.max( 15924 elem.body[ "scroll" + name ], doc[ "scroll" + name ], 15925 elem.body[ "offset" + name ], doc[ "offset" + name ], 15926 doc[ "client" + name ] 15927 ); 15928 } 15929 15930 return value === undefined ? 15931 15932 // Get width or height on the element, requesting but not forcing parseFloat 15933 jQuery.css( elem, type, extra ) : 15934 15935 // Set width or height on the element 15936 jQuery.style( elem, type, value, extra ); 15937 }, type, chainable ? margin : undefined, chainable ); 15938 }; 15939 } ); 15940} ); 15941 15942 15943jQuery.each( [ 15944 "ajaxStart", 15945 "ajaxStop", 15946 "ajaxComplete", 15947 "ajaxError", 15948 "ajaxSuccess", 15949 "ajaxSend" 15950], function( _i, type ) { 15951 jQuery.fn[ type ] = function( fn ) { 15952 return this.on( type, fn ); 15953 }; 15954} ); 15955 15956 15957 15958 15959jQuery.fn.extend( { 15960 15961 bind: function( types, data, fn ) { 15962 return this.on( types, null, data, fn ); 15963 }, 15964 unbind: function( types, fn ) { 15965 return this.off( types, null, fn ); 15966 }, 15967 15968 delegate: function( selector, types, data, fn ) { 15969 return this.on( types, selector, data, fn ); 15970 }, 15971 undelegate: function( selector, types, fn ) { 15972 15973 // ( namespace ) or ( selector, types [, fn] ) 15974 return arguments.length === 1 ? 15975 this.off( selector, "**" ) : 15976 this.off( types, selector || "**", fn ); 15977 }, 15978 15979 hover: function( fnOver, fnOut ) { 15980 return this 15981 .on( "mouseenter", fnOver ) 15982 .on( "mouseleave", fnOut || fnOver ); 15983 } 15984} ); 15985 15986jQuery.each( 15987 ( "blur focus focusin focusout resize scroll click dblclick " + 15988 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 15989 "change select submit keydown keypress keyup contextmenu" ).split( " " ), 15990 function( _i, name ) { 15991 15992 // Handle event binding 15993 jQuery.fn[ name ] = function( data, fn ) { 15994 return arguments.length > 0 ? 15995 this.on( name, null, data, fn ) : 15996 this.trigger( name ); 15997 }; 15998 } 15999); 16000 16001 16002 16003 16004// Support: Android <=4.0 only 16005// Make sure we trim BOM and NBSP 16006// Require that the "whitespace run" starts from a non-whitespace 16007// to avoid O(N^2) behavior when the engine would try matching "\s+$" at each space position. 16008var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g; 16009 16010// Bind a function to a context, optionally partially applying any 16011// arguments. 16012// jQuery.proxy is deprecated to promote standards (specifically Function#bind) 16013// However, it is not slated for removal any time soon 16014jQuery.proxy = function( fn, context ) { 16015 var tmp, args, proxy; 16016 16017 if ( typeof context === "string" ) { 16018 tmp = fn[ context ]; 16019 context = fn; 16020 fn = tmp; 16021 } 16022 16023 // Quick check to determine if target is callable, in the spec 16024 // this throws a TypeError, but we will just return undefined. 16025 if ( !isFunction( fn ) ) { 16026 return undefined; 16027 } 16028 16029 // Simulated bind 16030 args = slice.call( arguments, 2 ); 16031 proxy = function() { 16032 return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); 16033 }; 16034 16035 // Set the guid of unique handler to the same of original handler, so it can be removed 16036 proxy.guid = fn.guid = fn.guid || jQuery.guid++; 16037 16038 return proxy; 16039}; 16040 16041jQuery.holdReady = function( hold ) { 16042 if ( hold ) { 16043 jQuery.readyWait++; 16044 } else { 16045 jQuery.ready( true ); 16046 } 16047}; 16048jQuery.isArray = Array.isArray; 16049jQuery.parseJSON = JSON.parse; 16050jQuery.nodeName = nodeName; 16051jQuery.isFunction = isFunction; 16052jQuery.isWindow = isWindow; 16053jQuery.camelCase = camelCase; 16054jQuery.type = toType; 16055 16056jQuery.now = Date.now; 16057 16058jQuery.isNumeric = function( obj ) { 16059 16060 // As of jQuery 3.0, isNumeric is limited to 16061 // strings and numbers (primitives or objects) 16062 // that can be coerced to finite numbers (gh-2662) 16063 var type = jQuery.type( obj ); 16064 return ( type === "number" || type === "string" ) && 16065 16066 // parseFloat NaNs numeric-cast false positives ("") 16067 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 16068 // subtraction forces infinities to NaN 16069 !isNaN( obj - parseFloat( obj ) ); 16070}; 16071 16072jQuery.trim = function( text ) { 16073 return text == null ? 16074 "" : 16075 ( text + "" ).replace( rtrim, "$1" ); 16076}; 16077 16078 16079 16080// Register as a named AMD module, since jQuery can be concatenated with other 16081// files that may use define, but not via a proper concatenation script that 16082// understands anonymous AMD modules. A named AMD is safest and most robust 16083// way to register. Lowercase jquery is used because AMD module names are 16084// derived from file names, and jQuery is normally delivered in a lowercase 16085// file name. Do this after creating the global so that if an AMD module wants 16086// to call noConflict to hide this version of jQuery, it will work. 16087 16088// Note that for maximum portability, libraries that are not jQuery should 16089// declare themselves as anonymous modules, and avoid setting a global if an 16090// AMD loader is present. jQuery is a special case. For more information, see 16091// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 16092 16093if ( true ) { 16094 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() { 16095 return jQuery; 16096 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 16097 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 16098} 16099 16100 16101 16102 16103var 16104 16105 // Map over jQuery in case of overwrite 16106 _jQuery = window.jQuery, 16107 16108 // Map over the $ in case of overwrite 16109 _$ = window.$; 16110 16111jQuery.noConflict = function( deep ) { 16112 if ( window.$ === jQuery ) { 16113 window.$ = _$; 16114 } 16115 16116 if ( deep && window.jQuery === jQuery ) { 16117 window.jQuery = _jQuery; 16118 } 16119 16120 return jQuery; 16121}; 16122 16123// Expose jQuery and $ identifiers, even in AMD 16124// (trac-7102#comment:10, https://github.com/jquery/jquery/pull/557) 16125// and CommonJS for browser emulators (trac-13566) 16126if ( typeof noGlobal === "undefined" ) { 16127 window.jQuery = window.$ = jQuery; 16128} 16129 16130 16131 16132 16133return jQuery; 16134} ); 16135 16136 16137/***/ }), 16138
vendor: 89,123 bytes, lines 16139-18768
16139/***/ "./node_modules/popper.js/dist/esm/popper.js": 16140/*!***************************************************!*\ 16141 !*** ./node_modules/popper.js/dist/esm/popper.js ***! 16142 \***************************************************/ 16143/*! exports provided: default */ 16144/***/ (function(module, __webpack_exports__, __webpack_require__) { 16145 16146"use strict"; 16147__webpack_require__.r(__webpack_exports__); 16148/* WEBPACK VAR INJECTION */(function(global) {/**! 16149 * @fileOverview Kickass library to create and place poppers near their reference elements. 16150 * @version 1.16.1 16151 * @license 16152 * Copyright (c) 2016 Federico Zivolo and contributors 16153 * 16154 * Permission is hereby granted, free of charge, to any person obtaining a copy 16155 * of this software and associated documentation files (the "Software"), to deal 16156 * in the Software without restriction, including without limitation the rights 16157 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 16158 * copies of the Software, and to permit persons to whom the Software is 16159 * furnished to do so, subject to the following conditions: 16160 * 16161 * The above copyright notice and this permission notice shall be included in all 16162 * copies or substantial portions of the Software. 16163 * 16164 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16165 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16166 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16167 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16168 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 16169 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 16170 * SOFTWARE. 16171 */ 16172var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined'; 16173 16174var timeoutDuration = function () { 16175 var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; 16176 for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { 16177 if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { 16178 return 1; 16179 } 16180 } 16181 return 0; 16182}(); 16183 16184function microtaskDebounce(fn) { 16185 var called = false; 16186 return function () { 16187 if (called) { 16188 return; 16189 } 16190 called = true; 16191 window.Promise.resolve().then(function () { 16192 called = false; 16193 fn(); 16194 }); 16195 }; 16196} 16197 16198function taskDebounce(fn) { 16199 var scheduled = false; 16200 return function () { 16201 if (!scheduled) { 16202 scheduled = true; 16203 setTimeout(function () { 16204 scheduled = false; 16205 fn(); 16206 }, timeoutDuration); 16207 } 16208 }; 16209} 16210 16211var supportsMicroTasks = isBrowser && window.Promise; 16212 16213/** 16214* Create a debounced version of a method, that's asynchronously deferred 16215* but called in the minimum time possible. 16216* 16217* @method 16218* @memberof Popper.Utils 16219* @argument {Function} fn 16220* @returns {Function} 16221*/ 16222var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce; 16223 16224/** 16225 * Check if the given variable is a function 16226 * @method 16227 * @memberof Popper.Utils 16228 * @argument {Any} functionToCheck - variable to check 16229 * @returns {Boolean} answer to: is a function? 16230 */ 16231function isFunction(functionToCheck) { 16232 var getType = {}; 16233 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; 16234} 16235 16236/** 16237 * Get CSS computed property of the given element 16238 * @method 16239 * @memberof Popper.Utils 16240 * @argument {Eement} element 16241 * @argument {String} property 16242 */ 16243function getStyleComputedProperty(element, property) { 16244 if (element.nodeType !== 1) { 16245 return []; 16246 } 16247 // NOTE: 1 DOM access here 16248 var window = element.ownerDocument.defaultView; 16249 var css = window.getComputedStyle(element, null); 16250 return property ? css[property] : css; 16251} 16252 16253/** 16254 * Returns the parentNode or the host of the element 16255 * @method 16256 * @memberof Popper.Utils 16257 * @argument {Element} element 16258 * @returns {Element} parent 16259 */ 16260function getParentNode(element) { 16261 if (element.nodeName === 'HTML') { 16262 return element; 16263 } 16264 return element.parentNode || element.host; 16265} 16266 16267/** 16268 * Returns the scrolling parent of the given element 16269 * @method 16270 * @memberof Popper.Utils 16271 * @argument {Element} element 16272 * @returns {Element} scroll parent 16273 */ 16274function getScrollParent(element) { 16275 // Return body, `getScroll` will take care to get the correct `scrollTop` from it 16276 if (!element) { 16277 return document.body; 16278 } 16279 16280 switch (element.nodeName) { 16281 case 'HTML': 16282 case 'BODY': 16283 return element.ownerDocument.body; 16284 case '#document': 16285 return element.body; 16286 } 16287 16288 // Firefox want us to check `-x` and `-y` variations as well 16289 16290 var _getStyleComputedProp = getStyleComputedProperty(element), 16291 overflow = _getStyleComputedProp.overflow, 16292 overflowX = _getStyleComputedProp.overflowX, 16293 overflowY = _getStyleComputedProp.overflowY; 16294 16295 if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { 16296 return element; 16297 } 16298 16299 return getScrollParent(getParentNode(element)); 16300} 16301 16302/** 16303 * Returns the reference node of the reference object, or the reference object itself. 16304 * @method 16305 * @memberof Popper.Utils 16306 * @param {Element|Object} reference - the reference element (the popper will be relative to this) 16307 * @returns {Element} parent 16308 */ 16309function getReferenceNode(reference) { 16310 return reference && reference.referenceNode ? reference.referenceNode : reference; 16311} 16312 16313var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode); 16314var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent); 16315 16316/** 16317 * Determines if the browser is Internet Explorer 16318 * @method 16319 * @memberof Popper.Utils 16320 * @param {Number} version to check 16321 * @returns {Boolean} isIE 16322 */ 16323function isIE(version) { 16324 if (version === 11) { 16325 return isIE11; 16326 } 16327 if (version === 10) { 16328 return isIE10; 16329 } 16330 return isIE11 || isIE10; 16331} 16332 16333/** 16334 * Returns the offset parent of the given element 16335 * @method 16336 * @memberof Popper.Utils 16337 * @argument {Element} element 16338 * @returns {Element} offset parent 16339 */ 16340function getOffsetParent(element) { 16341 if (!element) { 16342 return document.documentElement; 16343 } 16344 16345 var noOffsetParent = isIE(10) ? document.body : null; 16346 16347 // NOTE: 1 DOM access here 16348 var offsetParent = element.offsetParent || null; 16349 // Skip hidden elements which don't have an offsetParent 16350 while (offsetParent === noOffsetParent && element.nextElementSibling) { 16351 offsetParent = (element = element.nextElementSibling).offsetParent; 16352 } 16353 16354 var nodeName = offsetParent && offsetParent.nodeName; 16355 16356 if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { 16357 return element ? element.ownerDocument.documentElement : document.documentElement; 16358 } 16359 16360 // .offsetParent will return the closest TH, TD or TABLE in case 16361 // no offsetParent is present, I hate this job... 16362 if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') { 16363 return getOffsetParent(offsetParent); 16364 } 16365 16366 return offsetParent; 16367} 16368 16369function isOffsetContainer(element) { 16370 var nodeName = element.nodeName; 16371 16372 if (nodeName === 'BODY') { 16373 return false; 16374 } 16375 return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element; 16376} 16377 16378/** 16379 * Finds the root node (document, shadowDOM root) of the given element 16380 * @method 16381 * @memberof Popper.Utils 16382 * @argument {Element} node 16383 * @returns {Element} root node 16384 */ 16385function getRoot(node) { 16386 if (node.parentNode !== null) { 16387 return getRoot(node.parentNode); 16388 } 16389 16390 return node; 16391} 16392 16393/** 16394 * Finds the offset parent common to the two provided nodes 16395 * @method 16396 * @memberof Popper.Utils 16397 * @argument {Element} element1 16398 * @argument {Element} element2 16399 * @returns {Element} common offset parent 16400 */ 16401function findCommonOffsetParent(element1, element2) { 16402 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 16403 if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { 16404 return document.documentElement; 16405 } 16406 16407 // Here we make sure to give as "start" the element that comes first in the DOM 16408 var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; 16409 var start = order ? element1 : element2; 16410 var end = order ? element2 : element1; 16411 16412 // Get common ancestor container 16413 var range = document.createRange(); 16414 range.setStart(start, 0); 16415 range.setEnd(end, 0); 16416 var commonAncestorContainer = range.commonAncestorContainer; 16417 16418 // Both nodes are inside #document 16419 16420 if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { 16421 if (isOffsetContainer(commonAncestorContainer)) { 16422 return commonAncestorContainer; 16423 } 16424 16425 return getOffsetParent(commonAncestorContainer); 16426 } 16427 16428 // one of the nodes is inside shadowDOM, find which one 16429 var element1root = getRoot(element1); 16430 if (element1root.host) { 16431 return findCommonOffsetParent(element1root.host, element2); 16432 } else { 16433 return findCommonOffsetParent(element1, getRoot(element2).host); 16434 } 16435} 16436 16437/** 16438 * Gets the scroll value of the given element in the given side (top and left) 16439 * @method 16440 * @memberof Popper.Utils 16441 * @argument {Element} element 16442 * @argument {String} side `top` or `left` 16443 * @returns {number} amount of scrolled pixels 16444 */ 16445function getScroll(element) { 16446 var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; 16447 16448 var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; 16449 var nodeName = element.nodeName; 16450 16451 if (nodeName === 'BODY' || nodeName === 'HTML') { 16452 var html = element.ownerDocument.documentElement; 16453 var scrollingElement = element.ownerDocument.scrollingElement || html; 16454 return scrollingElement[upperSide]; 16455 } 16456 16457 return element[upperSide]; 16458} 16459 16460/* 16461 * Sum or subtract the element scroll values (left and top) from a given rect object 16462 * @method 16463 * @memberof Popper.Utils 16464 * @param {Object} rect - Rect object you want to change 16465 * @param {HTMLElement} element - The element from the function reads the scroll values 16466 * @param {Boolean} subtract - set to true if you want to subtract the scroll values 16467 * @return {Object} rect - The modifier rect object 16468 */ 16469function includeScroll(rect, element) { 16470 var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 16471 16472 var scrollTop = getScroll(element, 'top'); 16473 var scrollLeft = getScroll(element, 'left'); 16474 var modifier = subtract ? -1 : 1; 16475 rect.top += scrollTop * modifier; 16476 rect.bottom += scrollTop * modifier; 16477 rect.left += scrollLeft * modifier; 16478 rect.right += scrollLeft * modifier; 16479 return rect; 16480} 16481 16482/* 16483 * Helper to detect borders of a given element 16484 * @method 16485 * @memberof Popper.Utils 16486 * @param {CSSStyleDeclaration} styles 16487 * Result of `getStyleComputedProperty` on the given element 16488 * @param {String} axis - `x` or `y` 16489 * @return {number} borders - The borders size of the given axis 16490 */ 16491 16492function getBordersSize(styles, axis) { 16493 var sideA = axis === 'x' ? 'Left' : 'Top'; 16494 var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; 16495 16496 return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']); 16497} 16498 16499function getSize(axis, body, html, computedStyle) { 16500 return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0); 16501} 16502 16503function getWindowSizes(document) { 16504 var body = document.body; 16505 var html = document.documentElement; 16506 var computedStyle = isIE(10) && getComputedStyle(html); 16507 16508 return { 16509 height: getSize('Height', body, html, computedStyle), 16510 width: getSize('Width', body, html, computedStyle) 16511 }; 16512} 16513 16514var classCallCheck = function (instance, Constructor) { 16515 if (!(instance instanceof Constructor)) { 16516 throw new TypeError("Cannot call a class as a function"); 16517 } 16518}; 16519 16520var createClass = function () { 16521 function defineProperties(target, props) { 16522 for (var i = 0; i < props.length; i++) { 16523 var descriptor = props[i]; 16524 descriptor.enumerable = descriptor.enumerable || false; 16525 descriptor.configurable = true; 16526 if ("value" in descriptor) descriptor.writable = true; 16527 Object.defineProperty(target, descriptor.key, descriptor); 16528 } 16529 } 16530 16531 return function (Constructor, protoProps, staticProps) { 16532 if (protoProps) defineProperties(Constructor.prototype, protoProps); 16533 if (staticProps) defineProperties(Constructor, staticProps); 16534 return Constructor; 16535 }; 16536}(); 16537 16538 16539 16540 16541 16542var defineProperty = function (obj, key, value) { 16543 if (key in obj) { 16544 Object.defineProperty(obj, key, { 16545 value: value, 16546 enumerable: true, 16547 configurable: true, 16548 writable: true 16549 }); 16550 } else { 16551 obj[key] = value; 16552 } 16553 16554 return obj; 16555}; 16556 16557var _extends = Object.assign || function (target) { 16558 for (var i = 1; i < arguments.length; i++) { 16559 var source = arguments[i]; 16560 16561 for (var key in source) { 16562 if (Object.prototype.hasOwnProperty.call(source, key)) { 16563 target[key] = source[key]; 16564 } 16565 } 16566 } 16567 16568 return target; 16569}; 16570 16571/** 16572 * Given element offsets, generate an output similar to getBoundingClientRect 16573 * @method 16574 * @memberof Popper.Utils 16575 * @argument {Object} offsets 16576 * @returns {Object} ClientRect like output 16577 */ 16578function getClientRect(offsets) { 16579 return _extends({}, offsets, { 16580 right: offsets.left + offsets.width, 16581 bottom: offsets.top + offsets.height 16582 }); 16583} 16584 16585/** 16586 * Get bounding client rect of given element 16587 * @method 16588 * @memberof Popper.Utils 16589 * @param {HTMLElement} element 16590 * @return {Object} client rect 16591 */ 16592function getBoundingClientRect(element) { 16593 var rect = {}; 16594 16595 // IE10 10 FIX: Please, don't ask, the element isn't 16596 // considered in DOM in some circumstances... 16597 // This isn't reproducible in IE10 compatibility mode of IE11 16598 try { 16599 if (isIE(10)) { 16600 rect = element.getBoundingClientRect(); 16601 var scrollTop = getScroll(element, 'top'); 16602 var scrollLeft = getScroll(element, 'left'); 16603 rect.top += scrollTop; 16604 rect.left += scrollLeft; 16605 rect.bottom += scrollTop; 16606 rect.right += scrollLeft; 16607 } else { 16608 rect = element.getBoundingClientRect(); 16609 } 16610 } catch (e) {} 16611 16612 var result = { 16613 left: rect.left, 16614 top: rect.top, 16615 width: rect.right - rect.left, 16616 height: rect.bottom - rect.top 16617 }; 16618 16619 // subtract scrollbar size from sizes 16620 var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {}; 16621 var width = sizes.width || element.clientWidth || result.width; 16622 var height = sizes.height || element.clientHeight || result.height; 16623 16624 var horizScrollbar = element.offsetWidth - width; 16625 var vertScrollbar = element.offsetHeight - height; 16626 16627 // if an hypothetical scrollbar is detected, we must be sure it's not a `border` 16628 // we make this check conditional for performance reasons 16629 if (horizScrollbar || vertScrollbar) { 16630 var styles = getStyleComputedProperty(element); 16631 horizScrollbar -= getBordersSize(styles, 'x'); 16632 vertScrollbar -= getBordersSize(styles, 'y'); 16633 16634 result.width -= horizScrollbar; 16635 result.height -= vertScrollbar; 16636 } 16637 16638 return getClientRect(result); 16639} 16640 16641function getOffsetRectRelativeToArbitraryNode(children, parent) { 16642 var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 16643 16644 var isIE10 = isIE(10); 16645 var isHTML = parent.nodeName === 'HTML'; 16646 var childrenRect = getBoundingClientRect(children); 16647 var parentRect = getBoundingClientRect(parent); 16648 var scrollParent = getScrollParent(children); 16649 16650 var styles = getStyleComputedProperty(parent); 16651 var borderTopWidth = parseFloat(styles.borderTopWidth); 16652 var borderLeftWidth = parseFloat(styles.borderLeftWidth); 16653 16654 // In cases where the parent is fixed, we must ignore negative scroll in offset calc 16655 if (fixedPosition && isHTML) { 16656 parentRect.top = Math.max(parentRect.top, 0); 16657 parentRect.left = Math.max(parentRect.left, 0); 16658 } 16659 var offsets = getClientRect({ 16660 top: childrenRect.top - parentRect.top - borderTopWidth, 16661 left: childrenRect.left - parentRect.left - borderLeftWidth, 16662 width: childrenRect.width, 16663 height: childrenRect.height 16664 }); 16665 offsets.marginTop = 0; 16666 offsets.marginLeft = 0; 16667 16668 // Subtract margins of documentElement in case it's being used as parent 16669 // we do this only on HTML because it's the only element that behaves 16670 // differently when margins are applied to it. The margins are included in 16671 // the box of the documentElement, in the other cases not. 16672 if (!isIE10 && isHTML) { 16673 var marginTop = parseFloat(styles.marginTop); 16674 var marginLeft = parseFloat(styles.marginLeft); 16675 16676 offsets.top -= borderTopWidth - marginTop; 16677 offsets.bottom -= borderTopWidth - marginTop; 16678 offsets.left -= borderLeftWidth - marginLeft; 16679 offsets.right -= borderLeftWidth - marginLeft; 16680 16681 // Attach marginTop and marginLeft because in some circumstances we may need them 16682 offsets.marginTop = marginTop; 16683 offsets.marginLeft = marginLeft; 16684 } 16685 16686 if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { 16687 offsets = includeScroll(offsets, parent); 16688 } 16689 16690 return offsets; 16691} 16692 16693function getViewportOffsetRectRelativeToArtbitraryNode(element) { 16694 var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 16695 16696 var html = element.ownerDocument.documentElement; 16697 var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); 16698 var width = Math.max(html.clientWidth, window.innerWidth || 0); 16699 var height = Math.max(html.clientHeight, window.innerHeight || 0); 16700 16701 var scrollTop = !excludeScroll ? getScroll(html) : 0; 16702 var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; 16703 16704 var offset = { 16705 top: scrollTop - relativeOffset.top + relativeOffset.marginTop, 16706 left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, 16707 width: width, 16708 height: height 16709 }; 16710 16711 return getClientRect(offset); 16712} 16713 16714/** 16715 * Check if the given element is fixed or is inside a fixed parent 16716 * @method 16717 * @memberof Popper.Utils 16718 * @argument {Element} element 16719 * @argument {Element} customContainer 16720 * @returns {Boolean} answer to "isFixed?" 16721 */ 16722function isFixed(element) { 16723 var nodeName = element.nodeName; 16724 if (nodeName === 'BODY' || nodeName === 'HTML') { 16725 return false; 16726 } 16727 if (getStyleComputedProperty(element, 'position') === 'fixed') { 16728 return true; 16729 } 16730 var parentNode = getParentNode(element); 16731 if (!parentNode) { 16732 return false; 16733 } 16734 return isFixed(parentNode); 16735} 16736 16737/** 16738 * Finds the first parent of an element that has a transformed property defined 16739 * @method 16740 * @memberof Popper.Utils 16741 * @argument {Element} element 16742 * @returns {Element} first transformed parent or documentElement 16743 */ 16744 16745function getFixedPositionOffsetParent(element) { 16746 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 16747 if (!element || !element.parentElement || isIE()) { 16748 return document.documentElement; 16749 } 16750 var el = element.parentElement; 16751 while (el && getStyleComputedProperty(el, 'transform') === 'none') { 16752 el = el.parentElement; 16753 } 16754 return el || document.documentElement; 16755} 16756 16757/** 16758 * Computed the boundaries limits and return them 16759 * @method 16760 * @memberof Popper.Utils 16761 * @param {HTMLElement} popper 16762 * @param {HTMLElement} reference 16763 * @param {number} padding 16764 * @param {HTMLElement} boundariesElement - Element used to define the boundaries 16765 * @param {Boolean} fixedPosition - Is in fixed position mode 16766 * @returns {Object} Coordinates of the boundaries 16767 */ 16768function getBoundaries(popper, reference, padding, boundariesElement) { 16769 var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; 16770 16771 // NOTE: 1 DOM access here 16772 16773 var boundaries = { top: 0, left: 0 }; 16774 var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 16775 16776 // Handle viewport case 16777 if (boundariesElement === 'viewport') { 16778 boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); 16779 } else { 16780 // Handle other cases based on DOM element used as boundaries 16781 var boundariesNode = void 0; 16782 if (boundariesElement === 'scrollParent') { 16783 boundariesNode = getScrollParent(getParentNode(reference)); 16784 if (boundariesNode.nodeName === 'BODY') { 16785 boundariesNode = popper.ownerDocument.documentElement; 16786 } 16787 } else if (boundariesElement === 'window') { 16788 boundariesNode = popper.ownerDocument.documentElement; 16789 } else { 16790 boundariesNode = boundariesElement; 16791 } 16792 16793 var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); 16794 16795 // In case of HTML, we need a different computation 16796 if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { 16797 var _getWindowSizes = getWindowSizes(popper.ownerDocument), 16798 height = _getWindowSizes.height, 16799 width = _getWindowSizes.width; 16800 16801 boundaries.top += offsets.top - offsets.marginTop; 16802 boundaries.bottom = height + offsets.top; 16803 boundaries.left += offsets.left - offsets.marginLeft; 16804 boundaries.right = width + offsets.left; 16805 } else { 16806 // for all the other DOM elements, this one is good 16807 boundaries = offsets; 16808 } 16809 } 16810 16811 // Add paddings 16812 padding = padding || 0; 16813 var isPaddingNumber = typeof padding === 'number'; 16814 boundaries.left += isPaddingNumber ? padding : padding.left || 0; 16815 boundaries.top += isPaddingNumber ? padding : padding.top || 0; 16816 boundaries.right -= isPaddingNumber ? padding : padding.right || 0; 16817 boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; 16818 16819 return boundaries; 16820} 16821 16822function getArea(_ref) { 16823 var width = _ref.width, 16824 height = _ref.height; 16825 16826 return width * height; 16827} 16828 16829/** 16830 * Utility used to transform the `auto` placement to the placement with more 16831 * available space. 16832 * @method 16833 * @memberof Popper.Utils 16834 * @argument {Object} data - The data object generated by update method 16835 * @argument {Object} options - Modifiers configuration and options 16836 * @returns {Object} The data object, properly modified 16837 */ 16838function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { 16839 var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; 16840 16841 if (placement.indexOf('auto') === -1) { 16842 return placement; 16843 } 16844 16845 var boundaries = getBoundaries(popper, reference, padding, boundariesElement); 16846 16847 var rects = { 16848 top: { 16849 width: boundaries.width, 16850 height: refRect.top - boundaries.top 16851 }, 16852 right: { 16853 width: boundaries.right - refRect.right, 16854 height: boundaries.height 16855 }, 16856 bottom: { 16857 width: boundaries.width, 16858 height: boundaries.bottom - refRect.bottom 16859 }, 16860 left: { 16861 width: refRect.left - boundaries.left, 16862 height: boundaries.height 16863 } 16864 }; 16865 16866 var sortedAreas = Object.keys(rects).map(function (key) { 16867 return _extends({ 16868 key: key 16869 }, rects[key], { 16870 area: getArea(rects[key]) 16871 }); 16872 }).sort(function (a, b) { 16873 return b.area - a.area; 16874 }); 16875 16876 var filteredAreas = sortedAreas.filter(function (_ref2) { 16877 var width = _ref2.width, 16878 height = _ref2.height; 16879 return width >= popper.clientWidth && height >= popper.clientHeight; 16880 }); 16881 16882 var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; 16883 16884 var variation = placement.split('-')[1]; 16885 16886 return computedPlacement + (variation ? '-' + variation : ''); 16887} 16888 16889/** 16890 * Get offsets to the reference element 16891 * @method 16892 * @memberof Popper.Utils 16893 * @param {Object} state 16894 * @param {Element} popper - the popper element 16895 * @param {Element} reference - the reference element (the popper will be relative to this) 16896 * @param {Element} fixedPosition - is in fixed position mode 16897 * @returns {Object} An object containing the offsets which will be applied to the popper 16898 */ 16899function getReferenceOffsets(state, popper, reference) { 16900 var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; 16901 16902 var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 16903 return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); 16904} 16905 16906/** 16907 * Get the outer sizes of the given element (offset size + margins) 16908 * @method 16909 * @memberof Popper.Utils 16910 * @argument {Element} element 16911 * @returns {Object} object containing width and height properties 16912 */ 16913function getOuterSizes(element) { 16914 var window = element.ownerDocument.defaultView; 16915 var styles = window.getComputedStyle(element); 16916 var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0); 16917 var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0); 16918 var result = { 16919 width: element.offsetWidth + y, 16920 height: element.offsetHeight + x 16921 }; 16922 return result; 16923} 16924 16925/** 16926 * Get the opposite placement of the given one 16927 * @method 16928 * @memberof Popper.Utils 16929 * @argument {String} placement 16930 * @returns {String} flipped placement 16931 */ 16932function getOppositePlacement(placement) { 16933 var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; 16934 return placement.replace(/left|right|bottom|top/g, function (matched) { 16935 return hash[matched]; 16936 }); 16937} 16938 16939/** 16940 * Get offsets to the popper 16941 * @method 16942 * @memberof Popper.Utils 16943 * @param {Object} position - CSS position the Popper will get applied 16944 * @param {HTMLElement} popper - the popper element 16945 * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this) 16946 * @param {String} placement - one of the valid placement options 16947 * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper 16948 */ 16949function getPopperOffsets(popper, referenceOffsets, placement) { 16950 placement = placement.split('-')[0]; 16951 16952 // Get popper node sizes 16953 var popperRect = getOuterSizes(popper); 16954 16955 // Add position, width and height to our offsets object 16956 var popperOffsets = { 16957 width: popperRect.width, 16958 height: popperRect.height 16959 }; 16960 16961 // depending by the popper placement we have to compute its offsets slightly differently 16962 var isHoriz = ['right', 'left'].indexOf(placement) !== -1; 16963 var mainSide = isHoriz ? 'top' : 'left'; 16964 var secondarySide = isHoriz ? 'left' : 'top'; 16965 var measurement = isHoriz ? 'height' : 'width'; 16966 var secondaryMeasurement = !isHoriz ? 'height' : 'width'; 16967 16968 popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; 16969 if (placement === secondarySide) { 16970 popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement]; 16971 } else { 16972 popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)]; 16973 } 16974 16975 return popperOffsets; 16976} 16977 16978/** 16979 * Mimics the `find` method of Array 16980 * @method 16981 * @memberof Popper.Utils 16982 * @argument {Array} arr 16983 * @argument prop 16984 * @argument value 16985 * @returns index or -1 16986 */ 16987function find(arr, check) { 16988 // use native find if supported 16989 if (Array.prototype.find) { 16990 return arr.find(check); 16991 } 16992 16993 // use `filter` to obtain the same behavior of `find` 16994 return arr.filter(check)[0]; 16995} 16996 16997/** 16998 * Return the index of the matching object 16999 * @method 17000 * @memberof Popper.Utils 17001 * @argument {Array} arr 17002 * @argument prop 17003 * @argument value 17004 * @returns index or -1 17005 */ 17006function findIndex(arr, prop, value) { 17007 // use native findIndex if supported 17008 if (Array.prototype.findIndex) { 17009 return arr.findIndex(function (cur) { 17010 return cur[prop] === value; 17011 }); 17012 } 17013 17014 // use `find` + `indexOf` if `findIndex` isn't supported 17015 var match = find(arr, function (obj) { 17016 return obj[prop] === value; 17017 }); 17018 return arr.indexOf(match); 17019} 17020 17021/** 17022 * Loop trough the list of modifiers and run them in order, 17023 * each of them will then edit the data object. 17024 * @method 17025 * @memberof Popper.Utils 17026 * @param {dataObject} data 17027 * @param {Array} modifiers 17028 * @param {String} ends - Optional modifier name used as stopper 17029 * @returns {dataObject} 17030 */ 17031function runModifiers(modifiers, data, ends) { 17032 var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); 17033 17034 modifiersToRun.forEach(function (modifier) { 17035 if (modifier['function']) { 17036 // eslint-disable-line dot-notation 17037 console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); 17038 } 17039 var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation 17040 if (modifier.enabled && isFunction(fn)) { 17041 // Add properties to offsets to make them a complete clientRect object 17042 // we do this before each modifier to make sure the previous one doesn't 17043 // mess with these values 17044 data.offsets.popper = getClientRect(data.offsets.popper); 17045 data.offsets.reference = getClientRect(data.offsets.reference); 17046 17047 data = fn(data, modifier); 17048 } 17049 }); 17050 17051 return data; 17052} 17053 17054/** 17055 * Updates the position of the popper, computing the new offsets and applying 17056 * the new style.<br /> 17057 * Prefer `scheduleUpdate` over `update` because of performance reasons. 17058 * @method 17059 * @memberof Popper 17060 */ 17061function update() { 17062 // if popper is destroyed, don't perform any further update 17063 if (this.state.isDestroyed) { 17064 return; 17065 } 17066 17067 var data = { 17068 instance: this, 17069 styles: {}, 17070 arrowStyles: {}, 17071 attributes: {}, 17072 flipped: false, 17073 offsets: {} 17074 }; 17075 17076 // compute reference element offsets 17077 data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); 17078 17079 // compute auto placement, store placement inside the data object, 17080 // modifiers will be able to edit `placement` if needed 17081 // and refer to originalPlacement to know the original value 17082 data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); 17083 17084 // store the computed placement inside `originalPlacement` 17085 data.originalPlacement = data.placement; 17086 17087 data.positionFixed = this.options.positionFixed; 17088 17089 // compute the popper offsets 17090 data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement); 17091 17092 data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; 17093 17094 // run the modifiers 17095 data = runModifiers(this.modifiers, data); 17096 17097 // the first `update` will call `onCreate` callback 17098 // the other ones will call `onUpdate` callback 17099 if (!this.state.isCreated) { 17100 this.state.isCreated = true; 17101 this.options.onCreate(data); 17102 } else { 17103 this.options.onUpdate(data); 17104 } 17105} 17106 17107/** 17108 * Helper used to know if the given modifier is enabled. 17109 * @method 17110 * @memberof Popper.Utils 17111 * @returns {Boolean} 17112 */ 17113function isModifierEnabled(modifiers, modifierName) { 17114 return modifiers.some(function (_ref) { 17115 var name = _ref.name, 17116 enabled = _ref.enabled; 17117 return enabled && name === modifierName; 17118 }); 17119} 17120 17121/** 17122 * Get the prefixed supported property name 17123 * @method 17124 * @memberof Popper.Utils 17125 * @argument {String} property (camelCase) 17126 * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) 17127 */ 17128function getSupportedPropertyName(property) { 17129 var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; 17130 var upperProp = property.charAt(0).toUpperCase() + property.slice(1); 17131 17132 for (var i = 0; i < prefixes.length; i++) { 17133 var prefix = prefixes[i]; 17134 var toCheck = prefix ? '' + prefix + upperProp : property; 17135 if (typeof document.body.style[toCheck] !== 'undefined') { 17136 return toCheck; 17137 } 17138 } 17139 return null; 17140} 17141 17142/** 17143 * Destroys the popper. 17144 * @method 17145 * @memberof Popper 17146 */ 17147function destroy() { 17148 this.state.isDestroyed = true; 17149 17150 // touch DOM only if `applyStyle` modifier is enabled 17151 if (isModifierEnabled(this.modifiers, 'applyStyle')) { 17152 this.popper.removeAttribute('x-placement'); 17153 this.popper.style.position = ''; 17154 this.popper.style.top = ''; 17155 this.popper.style.left = ''; 17156 this.popper.style.right = ''; 17157 this.popper.style.bottom = ''; 17158 this.popper.style.willChange = ''; 17159 this.popper.style[getSupportedPropertyName('transform')] = ''; 17160 } 17161 17162 this.disableEventListeners(); 17163 17164 // remove the popper if user explicitly asked for the deletion on destroy 17165 // do not use `remove` because IE11 doesn't support it 17166 if (this.options.removeOnDestroy) { 17167 this.popper.parentNode.removeChild(this.popper); 17168 } 17169 return this; 17170} 17171 17172/** 17173 * Get the window associated with the element 17174 * @argument {Element} element 17175 * @returns {Window} 17176 */ 17177function getWindow(element) { 17178 var ownerDocument = element.ownerDocument; 17179 return ownerDocument ? ownerDocument.defaultView : window; 17180} 17181 17182function attachToScrollParents(scrollParent, event, callback, scrollParents) { 17183 var isBody = scrollParent.nodeName === 'BODY'; 17184 var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent; 17185 target.addEventListener(event, callback, { passive: true }); 17186 17187 if (!isBody) { 17188 attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents); 17189 } 17190 scrollParents.push(target); 17191} 17192 17193/** 17194 * Setup needed event listeners used to update the popper position 17195 * @method 17196 * @memberof Popper.Utils 17197 * @private 17198 */ 17199function setupEventListeners(reference, options, state, updateBound) { 17200 // Resize event listener on window 17201 state.updateBound = updateBound; 17202 getWindow(reference).addEventListener('resize', state.updateBound, { passive: true }); 17203 17204 // Scroll event listener on scroll parents 17205 var scrollElement = getScrollParent(reference); 17206 attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); 17207 state.scrollElement = scrollElement; 17208 state.eventsEnabled = true; 17209 17210 return state; 17211} 17212 17213/** 17214 * It will add resize/scroll events and start recalculating 17215 * position of the popper element when they are triggered. 17216 * @method 17217 * @memberof Popper 17218 */ 17219function enableEventListeners() { 17220 if (!this.state.eventsEnabled) { 17221 this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate); 17222 } 17223} 17224 17225/** 17226 * Remove event listeners used to update the popper position 17227 * @method 17228 * @memberof Popper.Utils 17229 * @private 17230 */ 17231function removeEventListeners(reference, state) { 17232 // Remove resize event listener on window 17233 getWindow(reference).removeEventListener('resize', state.updateBound); 17234 17235 // Remove scroll event listener on scroll parents 17236 state.scrollParents.forEach(function (target) { 17237 target.removeEventListener('scroll', state.updateBound); 17238 }); 17239 17240 // Reset state 17241 state.updateBound = null; 17242 state.scrollParents = []; 17243 state.scrollElement = null; 17244 state.eventsEnabled = false; 17245 return state; 17246} 17247 17248/** 17249 * It will remove resize/scroll events and won't recalculate popper position 17250 * when they are triggered. It also won't trigger `onUpdate` callback anymore, 17251 * unless you call `update` method manually. 17252 * @method 17253 * @memberof Popper 17254 */ 17255function disableEventListeners() { 17256 if (this.state.eventsEnabled) { 17257 cancelAnimationFrame(this.scheduleUpdate); 17258 this.state = removeEventListeners(this.reference, this.state); 17259 } 17260} 17261 17262/** 17263 * Tells if a given input is a number 17264 * @method 17265 * @memberof Popper.Utils 17266 * @param {*} input to check 17267 * @return {Boolean} 17268 */ 17269function isNumeric(n) { 17270 return n !== '' && !isNaN(parseFloat(n)) && isFinite(n); 17271} 17272 17273/** 17274 * Set the style to the given popper 17275 * @method 17276 * @memberof Popper.Utils 17277 * @argument {Element} element - Element to apply the style to 17278 * @argument {Object} styles 17279 * Object with a list of properties and values which will be applied to the element 17280 */ 17281function setStyles(element, styles) { 17282 Object.keys(styles).forEach(function (prop) { 17283 var unit = ''; 17284 // add unit if the value is numeric and is one of the following 17285 if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { 17286 unit = 'px'; 17287 } 17288 element.style[prop] = styles[prop] + unit; 17289 }); 17290} 17291 17292/** 17293 * Set the attributes to the given popper 17294 * @method 17295 * @memberof Popper.Utils 17296 * @argument {Element} element - Element to apply the attributes to 17297 * @argument {Object} styles 17298 * Object with a list of properties and values which will be applied to the element 17299 */ 17300function setAttributes(element, attributes) { 17301 Object.keys(attributes).forEach(function (prop) { 17302 var value = attributes[prop]; 17303 if (value !== false) { 17304 element.setAttribute(prop, attributes[prop]); 17305 } else { 17306 element.removeAttribute(prop); 17307 } 17308 }); 17309} 17310 17311/** 17312 * @function 17313 * @memberof Modifiers 17314 * @argument {Object} data - The data object generated by `update` method 17315 * @argument {Object} data.styles - List of style properties - values to apply to popper element 17316 * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element 17317 * @argument {Object} options - Modifiers configuration and options 17318 * @returns {Object} The same data object 17319 */ 17320function applyStyle(data) { 17321 // any property present in `data.styles` will be applied to the popper, 17322 // in this way we can make the 3rd party modifiers add custom styles to it 17323 // Be aware, modifiers could override the properties defined in the previous 17324 // lines of this modifier! 17325 setStyles(data.instance.popper, data.styles); 17326 17327 // any property present in `data.attributes` will be applied to the popper, 17328 // they will be set as HTML attributes of the element 17329 setAttributes(data.instance.popper, data.attributes); 17330 17331 // if arrowElement is defined and arrowStyles has some properties 17332 if (data.arrowElement && Object.keys(data.arrowStyles).length) { 17333 setStyles(data.arrowElement, data.arrowStyles); 17334 } 17335 17336 return data; 17337} 17338 17339/** 17340 * Set the x-placement attribute before everything else because it could be used 17341 * to add margins to the popper margins needs to be calculated to get the 17342 * correct popper offsets. 17343 * @method 17344 * @memberof Popper.modifiers 17345 * @param {HTMLElement} reference - The reference element used to position the popper 17346 * @param {HTMLElement} popper - The HTML element used as popper 17347 * @param {Object} options - Popper.js options 17348 */ 17349function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { 17350 // compute reference element offsets 17351 var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); 17352 17353 // compute auto placement, store placement inside the data object, 17354 // modifiers will be able to edit `placement` if needed 17355 // and refer to originalPlacement to know the original value 17356 var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); 17357 17358 popper.setAttribute('x-placement', placement); 17359 17360 // Apply `position` to popper before anything else because 17361 // without the position applied we can't guarantee correct computations 17362 setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); 17363 17364 return options; 17365} 17366 17367/** 17368 * @function 17369 * @memberof Popper.Utils 17370 * @argument {Object} data - The data object generated by `update` method 17371 * @argument {Boolean} shouldRound - If the offsets should be rounded at all 17372 * @returns {Object} The popper's position offsets rounded 17373 * 17374 * The tale of pixel-perfect positioning. It's still not 100% perfect, but as 17375 * good as it can be within reason. 17376 * Discussion here: https://github.com/FezVrasta/popper.js/pull/715 17377 * 17378 * Low DPI screens cause a popper to be blurry if not using full pixels (Safari 17379 * as well on High DPI screens). 17380 * 17381 * Firefox prefers no rounding for positioning and does not have blurriness on 17382 * high DPI screens. 17383 * 17384 * Only horizontal placement and left/right values need to be considered. 17385 */ 17386function getRoundedOffsets(data, shouldRound) { 17387 var _data$offsets = data.offsets, 17388 popper = _data$offsets.popper, 17389 reference = _data$offsets.reference; 17390 var round = Math.round, 17391 floor = Math.floor; 17392 17393 var noRound = function noRound(v) { 17394 return v; 17395 }; 17396 17397 var referenceWidth = round(reference.width); 17398 var popperWidth = round(popper.width); 17399 17400 var isVertical = ['left', 'right'].indexOf(data.placement) !== -1; 17401 var isVariation = data.placement.indexOf('-') !== -1; 17402 var sameWidthParity = referenceWidth % 2 === popperWidth % 2; 17403 var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1; 17404 17405 var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor; 17406 var verticalToInteger = !shouldRound ? noRound : round; 17407 17408 return { 17409 left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left), 17410 top: verticalToInteger(popper.top), 17411 bottom: verticalToInteger(popper.bottom), 17412 right: horizontalToInteger(popper.right) 17413 }; 17414} 17415 17416var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent); 17417 17418/** 17419 * @function 17420 * @memberof Modifiers 17421 * @argument {Object} data - The data object generated by `update` method 17422 * @argument {Object} options - Modifiers configuration and options 17423 * @returns {Object} The data object, properly modified 17424 */ 17425function computeStyle(data, options) { 17426 var x = options.x, 17427 y = options.y; 17428 var popper = data.offsets.popper; 17429 17430 // Remove this legacy support in Popper.js v2 17431 17432 var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { 17433 return modifier.name === 'applyStyle'; 17434 }).gpuAcceleration; 17435 if (legacyGpuAccelerationOption !== undefined) { 17436 console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); 17437 } 17438 var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; 17439 17440 var offsetParent = getOffsetParent(data.instance.popper); 17441 var offsetParentRect = getBoundingClientRect(offsetParent); 17442 17443 // Styles 17444 var styles = { 17445 position: popper.position 17446 }; 17447 17448 var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox); 17449 17450 var sideA = x === 'bottom' ? 'top' : 'bottom'; 17451 var sideB = y === 'right' ? 'left' : 'right'; 17452 17453 // if gpuAcceleration is set to `true` and transform is supported, 17454 // we use `translate3d` to apply the position to the popper we 17455 // automatically use the supported prefixed version if needed 17456 var prefixedProperty = getSupportedPropertyName('transform'); 17457 17458 // now, let's make a step back and look at this code closely (wtf?) 17459 // If the content of the popper grows once it's been positioned, it 17460 // may happen that the popper gets misplaced because of the new content 17461 // overflowing its reference element 17462 // To avoid this problem, we provide two options (x and y), which allow 17463 // the consumer to define the offset origin. 17464 // If we position a popper on top of a reference element, we can set 17465 // `x` to `top` to make the popper grow towards its top instead of 17466 // its bottom. 17467 var left = void 0, 17468 top = void 0; 17469 if (sideA === 'bottom') { 17470 // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar) 17471 // and not the bottom of the html element 17472 if (offsetParent.nodeName === 'HTML') { 17473 top = -offsetParent.clientHeight + offsets.bottom; 17474 } else { 17475 top = -offsetParentRect.height + offsets.bottom; 17476 } 17477 } else { 17478 top = offsets.top; 17479 } 17480 if (sideB === 'right') { 17481 if (offsetParent.nodeName === 'HTML') { 17482 left = -offsetParent.clientWidth + offsets.right; 17483 } else { 17484 left = -offsetParentRect.width + offsets.right; 17485 } 17486 } else { 17487 left = offsets.left; 17488 } 17489 if (gpuAcceleration && prefixedProperty) { 17490 styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; 17491 styles[sideA] = 0; 17492 styles[sideB] = 0; 17493 styles.willChange = 'transform'; 17494 } else { 17495 // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties 17496 var invertTop = sideA === 'bottom' ? -1 : 1; 17497 var invertLeft = sideB === 'right' ? -1 : 1; 17498 styles[sideA] = top * invertTop; 17499 styles[sideB] = left * invertLeft; 17500 styles.willChange = sideA + ', ' + sideB; 17501 } 17502 17503 // Attributes 17504 var attributes = { 17505 'x-placement': data.placement 17506 }; 17507 17508 // Update `data` attributes, styles and arrowStyles 17509 data.attributes = _extends({}, attributes, data.attributes); 17510 data.styles = _extends({}, styles, data.styles); 17511 data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles); 17512 17513 return data; 17514} 17515 17516/** 17517 * Helper used to know if the given modifier depends from another one.<br /> 17518 * It checks if the needed modifier is listed and enabled. 17519 * @method 17520 * @memberof Popper.Utils 17521 * @param {Array} modifiers - list of modifiers 17522 * @param {String} requestingName - name of requesting modifier 17523 * @param {String} requestedName - name of requested modifier 17524 * @returns {Boolean} 17525 */ 17526function isModifierRequired(modifiers, requestingName, requestedName) { 17527 var requesting = find(modifiers, function (_ref) { 17528 var name = _ref.name; 17529 return name === requestingName; 17530 }); 17531 17532 var isRequired = !!requesting && modifiers.some(function (modifier) { 17533 return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; 17534 }); 17535 17536 if (!isRequired) { 17537 var _requesting = '`' + requestingName + '`'; 17538 var requested = '`' + requestedName + '`'; 17539 console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); 17540 } 17541 return isRequired; 17542} 17543 17544/** 17545 * @function 17546 * @memberof Modifiers 17547 * @argument {Object} data - The data object generated by update method 17548 * @argument {Object} options - Modifiers configuration and options 17549 * @returns {Object} The data object, properly modified 17550 */ 17551function arrow(data, options) { 17552 var _data$offsets$arrow; 17553 17554 // arrow depends on keepTogether in order to work 17555 if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { 17556 return data; 17557 } 17558 17559 var arrowElement = options.element; 17560 17561 // if arrowElement is a string, suppose it's a CSS selector 17562 if (typeof arrowElement === 'string') { 17563 arrowElement = data.instance.popper.querySelector(arrowElement); 17564 17565 // if arrowElement is not found, don't run the modifier 17566 if (!arrowElement) { 17567 return data; 17568 } 17569 } else { 17570 // if the arrowElement isn't a query selector we must check that the 17571 // provided DOM node is child of its popper node 17572 if (!data.instance.popper.contains(arrowElement)) { 17573 console.warn('WARNING: `arrow.element` must be child of its popper element!'); 17574 return data; 17575 } 17576 } 17577 17578 var placement = data.placement.split('-')[0]; 17579 var _data$offsets = data.offsets, 17580 popper = _data$offsets.popper, 17581 reference = _data$offsets.reference; 17582 17583 var isVertical = ['left', 'right'].indexOf(placement) !== -1; 17584 17585 var len = isVertical ? 'height' : 'width'; 17586 var sideCapitalized = isVertical ? 'Top' : 'Left'; 17587 var side = sideCapitalized.toLowerCase(); 17588 var altSide = isVertical ? 'left' : 'top'; 17589 var opSide = isVertical ? 'bottom' : 'right'; 17590 var arrowElementSize = getOuterSizes(arrowElement)[len]; 17591 17592 // 17593 // extends keepTogether behavior making sure the popper and its 17594 // reference have enough pixels in conjunction 17595 // 17596 17597 // top/left side 17598 if (reference[opSide] - arrowElementSize < popper[side]) { 17599 data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize); 17600 } 17601 // bottom/right side 17602 if (reference[side] + arrowElementSize > popper[opSide]) { 17603 data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; 17604 } 17605 data.offsets.popper = getClientRect(data.offsets.popper); 17606 17607 // compute center of the popper 17608 var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; 17609 17610 // Compute the sideValue using the updated popper offsets 17611 // take popper margin in account because we don't have this info available 17612 var css = getStyleComputedProperty(data.instance.popper); 17613 var popperMarginSide = parseFloat(css['margin' + sideCapitalized]); 17614 var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']); 17615 var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; 17616 17617 // prevent arrowElement from being placed not contiguously to its popper 17618 sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); 17619 17620 data.arrowElement = arrowElement; 17621 data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); 17622 17623 return data; 17624} 17625 17626/** 17627 * Get the opposite placement variation of the given one 17628 * @method 17629 * @memberof Popper.Utils 17630 * @argument {String} placement variation 17631 * @returns {String} flipped placement variation 17632 */ 17633function getOppositeVariation(variation) { 17634 if (variation === 'end') { 17635 return 'start'; 17636 } else if (variation === 'start') { 17637 return 'end'; 17638 } 17639 return variation; 17640} 17641 17642/** 17643 * List of accepted placements to use as values of the `placement` option.<br /> 17644 * Valid placements are: 17645 * - `auto` 17646 * - `top` 17647 * - `right` 17648 * - `bottom` 17649 * - `left` 17650 * 17651 * Each placement can have a variation from this list: 17652 * - `-start` 17653 * - `-end` 17654 * 17655 * Variations are interpreted easily if you think of them as the left to right 17656 * written languages. Horizontally (`top` and `bottom`), `start` is left and `end` 17657 * is right.<br /> 17658 * Vertically (`left` and `right`), `start` is top and `end` is bottom. 17659 * 17660 * Some valid examples are: 17661 * - `top-end` (on top of reference, right aligned) 17662 * - `right-start` (on right of reference, top aligned) 17663 * - `bottom` (on bottom, centered) 17664 * - `auto-end` (on the side with more space available, alignment depends by placement) 17665 * 17666 * @static 17667 * @type {Array} 17668 * @enum {String} 17669 * @readonly 17670 * @method placements 17671 * @memberof Popper 17672 */ 17673var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']; 17674 17675// Get rid of `auto` `auto-start` and `auto-end` 17676var validPlacements = placements.slice(3); 17677 17678/** 17679 * Given an initial placement, returns all the subsequent placements 17680 * clockwise (or counter-clockwise). 17681 * 17682 * @method 17683 * @memberof Popper.Utils 17684 * @argument {String} placement - A valid placement (it accepts variations) 17685 * @argument {Boolean} counter - Set to true to walk the placements counterclockwise 17686 * @returns {Array} placements including their variations 17687 */ 17688function clockwise(placement) { 17689 var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 17690 17691 var index = validPlacements.indexOf(placement); 17692 var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); 17693 return counter ? arr.reverse() : arr; 17694} 17695 17696var BEHAVIORS = { 17697 FLIP: 'flip', 17698 CLOCKWISE: 'clockwise', 17699 COUNTERCLOCKWISE: 'counterclockwise' 17700}; 17701 17702/** 17703 * @function 17704 * @memberof Modifiers 17705 * @argument {Object} data - The data object generated by update method 17706 * @argument {Object} options - Modifiers configuration and options 17707 * @returns {Object} The data object, properly modified 17708 */ 17709function flip(data, options) { 17710 // if `inner` modifier is enabled, we can't use the `flip` modifier 17711 if (isModifierEnabled(data.instance.modifiers, 'inner')) { 17712 return data; 17713 } 17714 17715 if (data.flipped && data.placement === data.originalPlacement) { 17716 // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides 17717 return data; 17718 } 17719 17720 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed); 17721 17722 var placement = data.placement.split('-')[0]; 17723 var placementOpposite = getOppositePlacement(placement); 17724 var variation = data.placement.split('-')[1] || ''; 17725 17726 var flipOrder = []; 17727 17728 switch (options.behavior) { 17729 case BEHAVIORS.FLIP: 17730 flipOrder = [placement, placementOpposite]; 17731 break; 17732 case BEHAVIORS.CLOCKWISE: 17733 flipOrder = clockwise(placement); 17734 break; 17735 case BEHAVIORS.COUNTERCLOCKWISE: 17736 flipOrder = clockwise(placement, true); 17737 break; 17738 default: 17739 flipOrder = options.behavior; 17740 } 17741 17742 flipOrder.forEach(function (step, index) { 17743 if (placement !== step || flipOrder.length === index + 1) { 17744 return data; 17745 } 17746 17747 placement = data.placement.split('-')[0]; 17748 placementOpposite = getOppositePlacement(placement); 17749 17750 var popperOffsets = data.offsets.popper; 17751 var refOffsets = data.offsets.reference; 17752 17753 // using floor because the reference offsets may contain decimals we are not going to consider here 17754 var floor = Math.floor; 17755 var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom); 17756 17757 var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); 17758 var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); 17759 var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); 17760 var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); 17761 17762 var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; 17763 17764 // flip the variation if required 17765 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 17766 17767 // flips variation if reference element overflows boundaries 17768 var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); 17769 17770 // flips variation if popper content overflows boundaries 17771 var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop); 17772 17773 var flippedVariation = flippedVariationByRef || flippedVariationByContent; 17774 17775 if (overlapsRef || overflowsBoundaries || flippedVariation) { 17776 // this boolean to detect any flip loop 17777 data.flipped = true; 17778 17779 if (overlapsRef || overflowsBoundaries) { 17780 placement = flipOrder[index + 1]; 17781 } 17782 17783 if (flippedVariation) { 17784 variation = getOppositeVariation(variation); 17785 } 17786 17787 data.placement = placement + (variation ? '-' + variation : ''); 17788 17789 // this object contains `position`, we want to preserve it along with 17790 // any additional property we may add in the future 17791 data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)); 17792 17793 data = runModifiers(data.instance.modifiers, data, 'flip'); 17794 } 17795 }); 17796 return data; 17797} 17798 17799/** 17800 * @function 17801 * @memberof Modifiers 17802 * @argument {Object} data - The data object generated by update method 17803 * @argument {Object} options - Modifiers configuration and options 17804 * @returns {Object} The data object, properly modified 17805 */ 17806function keepTogether(data) { 17807 var _data$offsets = data.offsets, 17808 popper = _data$offsets.popper, 17809 reference = _data$offsets.reference; 17810 17811 var placement = data.placement.split('-')[0]; 17812 var floor = Math.floor; 17813 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 17814 var side = isVertical ? 'right' : 'bottom'; 17815 var opSide = isVertical ? 'left' : 'top'; 17816 var measurement = isVertical ? 'width' : 'height'; 17817 17818 if (popper[side] < floor(reference[opSide])) { 17819 data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; 17820 } 17821 if (popper[opSide] > floor(reference[side])) { 17822 data.offsets.popper[opSide] = floor(reference[side]); 17823 } 17824 17825 return data; 17826} 17827 17828/** 17829 * Converts a string containing value + unit into a px value number 17830 * @function 17831 * @memberof {modifiers~offset} 17832 * @private 17833 * @argument {String} str - Value + unit string 17834 * @argument {String} measurement - `height` or `width` 17835 * @argument {Object} popperOffsets 17836 * @argument {Object} referenceOffsets 17837 * @returns {Number|String} 17838 * Value in pixels, or original string if no values were extracted 17839 */ 17840function toValue(str, measurement, popperOffsets, referenceOffsets) { 17841 // separate value from unit 17842 var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); 17843 var value = +split[1]; 17844 var unit = split[2]; 17845 17846 // If it's not a number it's an operator, I guess 17847 if (!value) { 17848 return str; 17849 } 17850 17851 if (unit.indexOf('%') === 0) { 17852 var element = void 0; 17853 switch (unit) { 17854 case '%p': 17855 element = popperOffsets; 17856 break; 17857 case '%': 17858 case '%r': 17859 default: 17860 element = referenceOffsets; 17861 } 17862 17863 var rect = getClientRect(element); 17864 return rect[measurement] / 100 * value; 17865 } else if (unit === 'vh' || unit === 'vw') { 17866 // if is a vh or vw, we calculate the size based on the viewport 17867 var size = void 0; 17868 if (unit === 'vh') { 17869 size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); 17870 } else { 17871 size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); 17872 } 17873 return size / 100 * value; 17874 } else { 17875 // if is an explicit pixel unit, we get rid of the unit and keep the value 17876 // if is an implicit unit, it's px, and we return just the value 17877 return value; 17878 } 17879} 17880 17881/** 17882 * Parse an `offset` string to extrapolate `x` and `y` numeric offsets. 17883 * @function 17884 * @memberof {modifiers~offset} 17885 * @private 17886 * @argument {String} offset 17887 * @argument {Object} popperOffsets 17888 * @argument {Object} referenceOffsets 17889 * @argument {String} basePlacement 17890 * @returns {Array} a two cells array with x and y offsets in numbers 17891 */ 17892function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { 17893 var offsets = [0, 0]; 17894 17895 // Use height if placement is left or right and index is 0 otherwise use width 17896 // in this way the first offset will use an axis and the second one 17897 // will use the other one 17898 var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; 17899 17900 // Split the offset string to obtain a list of values and operands 17901 // The regex addresses values with the plus or minus sign in front (+10, -20, etc) 17902 var fragments = offset.split(/(\+|\-)/).map(function (frag) { 17903 return frag.trim(); 17904 }); 17905 17906 // Detect if the offset string contains a pair of values or a single one 17907 // they could be separated by comma or space 17908 var divider = fragments.indexOf(find(fragments, function (frag) { 17909 return frag.search(/,|\s/) !== -1; 17910 })); 17911 17912 if (fragments[divider] && fragments[divider].indexOf(',') === -1) { 17913 console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); 17914 } 17915 17916 // If divider is found, we divide the list of values and operands to divide 17917 // them by ofset X and Y. 17918 var splitRegex = /\s*,\s*|\s+/; 17919 var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; 17920 17921 // Convert the values with units to absolute pixels to allow our computations 17922 ops = ops.map(function (op, index) { 17923 // Most of the units rely on the orientation of the popper 17924 var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; 17925 var mergeWithPrevious = false; 17926 return op 17927 // This aggregates any `+` or `-` sign that aren't considered operators 17928 // e.g.: 10 + +5 => [10, +, +5] 17929 .reduce(function (a, b) { 17930 if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { 17931 a[a.length - 1] = b; 17932 mergeWithPrevious = true; 17933 return a; 17934 } else if (mergeWithPrevious) { 17935 a[a.length - 1] += b; 17936 mergeWithPrevious = false; 17937 return a; 17938 } else { 17939 return a.concat(b); 17940 } 17941 }, []) 17942 // Here we convert the string values into number values (in px) 17943 .map(function (str) { 17944 return toValue(str, measurement, popperOffsets, referenceOffsets); 17945 }); 17946 }); 17947 17948 // Loop trough the offsets arrays and execute the operations 17949 ops.forEach(function (op, index) { 17950 op.forEach(function (frag, index2) { 17951 if (isNumeric(frag)) { 17952 offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); 17953 } 17954 }); 17955 }); 17956 return offsets; 17957} 17958 17959/** 17960 * @function 17961 * @memberof Modifiers 17962 * @argument {Object} data - The data object generated by update method 17963 * @argument {Object} options - Modifiers configuration and options 17964 * @argument {Number|String} options.offset=0 17965 * The offset value as described in the modifier description 17966 * @returns {Object} The data object, properly modified 17967 */ 17968function offset(data, _ref) { 17969 var offset = _ref.offset; 17970 var placement = data.placement, 17971 _data$offsets = data.offsets, 17972 popper = _data$offsets.popper, 17973 reference = _data$offsets.reference; 17974 17975 var basePlacement = placement.split('-')[0]; 17976 17977 var offsets = void 0; 17978 if (isNumeric(+offset)) { 17979 offsets = [+offset, 0]; 17980 } else { 17981 offsets = parseOffset(offset, popper, reference, basePlacement); 17982 } 17983 17984 if (basePlacement === 'left') { 17985 popper.top += offsets[0]; 17986 popper.left -= offsets[1]; 17987 } else if (basePlacement === 'right') { 17988 popper.top += offsets[0]; 17989 popper.left += offsets[1]; 17990 } else if (basePlacement === 'top') { 17991 popper.left += offsets[0]; 17992 popper.top -= offsets[1]; 17993 } else if (basePlacement === 'bottom') { 17994 popper.left += offsets[0]; 17995 popper.top += offsets[1]; 17996 } 17997 17998 data.popper = popper; 17999 return data; 18000} 18001 18002/** 18003 * @function 18004 * @memberof Modifiers 18005 * @argument {Object} data - The data object generated by `update` method 18006 * @argument {Object} options - Modifiers configuration and options 18007 * @returns {Object} The data object, properly modified 18008 */ 18009function preventOverflow(data, options) { 18010 var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); 18011 18012 // If offsetParent is the reference element, we really want to 18013 // go one step up and use the next offsetParent as reference to 18014 // avoid to make this modifier completely useless and look like broken 18015 if (data.instance.reference === boundariesElement) { 18016 boundariesElement = getOffsetParent(boundariesElement); 18017 } 18018 18019 // NOTE: DOM access here 18020 // resets the popper's position so that the document size can be calculated excluding 18021 // the size of the popper element itself 18022 var transformProp = getSupportedPropertyName('transform'); 18023 var popperStyles = data.instance.popper.style; // assignment to help minification 18024 var top = popperStyles.top, 18025 left = popperStyles.left, 18026 transform = popperStyles[transformProp]; 18027 18028 popperStyles.top = ''; 18029 popperStyles.left = ''; 18030 popperStyles[transformProp] = ''; 18031 18032 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); 18033 18034 // NOTE: DOM access here 18035 // restores the original style properties after the offsets have been computed 18036 popperStyles.top = top; 18037 popperStyles.left = left; 18038 popperStyles[transformProp] = transform; 18039 18040 options.boundaries = boundaries; 18041 18042 var order = options.priority; 18043 var popper = data.offsets.popper; 18044 18045 var check = { 18046 primary: function primary(placement) { 18047 var value = popper[placement]; 18048 if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { 18049 value = Math.max(popper[placement], boundaries[placement]); 18050 } 18051 return defineProperty({}, placement, value); 18052 }, 18053 secondary: function secondary(placement) { 18054 var mainSide = placement === 'right' ? 'left' : 'top'; 18055 var value = popper[mainSide]; 18056 if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { 18057 value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); 18058 } 18059 return defineProperty({}, mainSide, value); 18060 } 18061 }; 18062 18063 order.forEach(function (placement) { 18064 var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; 18065 popper = _extends({}, popper, check[side](placement)); 18066 }); 18067 18068 data.offsets.popper = popper; 18069 18070 return data; 18071} 18072 18073/** 18074 * @function 18075 * @memberof Modifiers 18076 * @argument {Object} data - The data object generated by `update` method 18077 * @argument {Object} options - Modifiers configuration and options 18078 * @returns {Object} The data object, properly modified 18079 */ 18080function shift(data) { 18081 var placement = data.placement; 18082 var basePlacement = placement.split('-')[0]; 18083 var shiftvariation = placement.split('-')[1]; 18084 18085 // if shift shiftvariation is specified, run the modifier 18086 if (shiftvariation) { 18087 var _data$offsets = data.offsets, 18088 reference = _data$offsets.reference, 18089 popper = _data$offsets.popper; 18090 18091 var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; 18092 var side = isVertical ? 'left' : 'top'; 18093 var measurement = isVertical ? 'width' : 'height'; 18094 18095 var shiftOffsets = { 18096 start: defineProperty({}, side, reference[side]), 18097 end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) 18098 }; 18099 18100 data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]); 18101 } 18102 18103 return data; 18104} 18105 18106/** 18107 * @function 18108 * @memberof Modifiers 18109 * @argument {Object} data - The data object generated by update method 18110 * @argument {Object} options - Modifiers configuration and options 18111 * @returns {Object} The data object, properly modified 18112 */ 18113function hide(data) { 18114 if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) { 18115 return data; 18116 } 18117 18118 var refRect = data.offsets.reference; 18119 var bound = find(data.instance.modifiers, function (modifier) { 18120 return modifier.name === 'preventOverflow'; 18121 }).boundaries; 18122 18123 if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { 18124 // Avoid unnecessary DOM access if visibility hasn't changed 18125 if (data.hide === true) { 18126 return data; 18127 } 18128 18129 data.hide = true; 18130 data.attributes['x-out-of-boundaries'] = ''; 18131 } else { 18132 // Avoid unnecessary DOM access if visibility hasn't changed 18133 if (data.hide === false) { 18134 return data; 18135 } 18136 18137 data.hide = false; 18138 data.attributes['x-out-of-boundaries'] = false; 18139 } 18140 18141 return data; 18142} 18143 18144/** 18145 * @function 18146 * @memberof Modifiers 18147 * @argument {Object} data - The data object generated by `update` method 18148 * @argument {Object} options - Modifiers configuration and options 18149 * @returns {Object} The data object, properly modified 18150 */ 18151function inner(data) { 18152 var placement = data.placement; 18153 var basePlacement = placement.split('-')[0]; 18154 var _data$offsets = data.offsets, 18155 popper = _data$offsets.popper, 18156 reference = _data$offsets.reference; 18157 18158 var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; 18159 18160 var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; 18161 18162 popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); 18163 18164 data.placement = getOppositePlacement(placement); 18165 data.offsets.popper = getClientRect(popper); 18166 18167 return data; 18168} 18169 18170/** 18171 * Modifier function, each modifier can have a function of this type assigned 18172 * to its `fn` property.<br /> 18173 * These functions will be called on each update, this means that you must 18174 * make sure they are performant enough to avoid performance bottlenecks. 18175 * 18176 * @function ModifierFn 18177 * @argument {dataObject} data - The data object generated by `update` method 18178 * @argument {Object} options - Modifiers configuration and options 18179 * @returns {dataObject} The data object, properly modified 18180 */ 18181 18182/** 18183 * Modifiers are plugins used to alter the behavior of your poppers.<br /> 18184 * Popper.js uses a set of 9 modifiers to provide all the basic functionalities 18185 * needed by the library. 18186 * 18187 * Usually you don't want to override the `order`, `fn` and `onLoad` props. 18188 * All the other properties are configurations that could be tweaked. 18189 * @namespace modifiers 18190 */ 18191var modifiers = { 18192 /** 18193 * Modifier used to shift the popper on the start or end of its reference 18194 * element.<br /> 18195 * It will read the variation of the `placement` property.<br /> 18196 * It can be one either `-end` or `-start`. 18197 * @memberof modifiers 18198 * @inner 18199 */ 18200 shift: { 18201 /** @prop {number} order=100 - Index used to define the order of execution */ 18202 order: 100, 18203 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 18204 enabled: true, 18205 /** @prop {ModifierFn} */ 18206 fn: shift 18207 }, 18208 18209 /** 18210 * The `offset` modifier can shift your popper on both its axis. 18211 * 18212 * It accepts the following units: 18213 * - `px` or unit-less, interpreted as pixels 18214 * - `%` or `%r`, percentage relative to the length of the reference element 18215 * - `%p`, percentage relative to the length of the popper element 18216 * - `vw`, CSS viewport width unit 18217 * - `vh`, CSS viewport height unit 18218 * 18219 * For length is intended the main axis relative to the placement of the popper.<br /> 18220 * This means that if the placement is `top` or `bottom`, the length will be the 18221 * `width`. In case of `left` or `right`, it will be the `height`. 18222 * 18223 * You can provide a single value (as `Number` or `String`), or a pair of values 18224 * as `String` divided by a comma or one (or more) white spaces.<br /> 18225 * The latter is a deprecated method because it leads to confusion and will be 18226 * removed in v2.<br /> 18227 * Additionally, it accepts additions and subtractions between different units. 18228 * Note that multiplications and divisions aren't supported. 18229 * 18230 * Valid examples are: 18231 * ``` 18232 * 10 18233 * '10%' 18234 * '10, 10' 18235 * '10%, 10' 18236 * '10 + 10%' 18237 * '10 - 5vh + 3%' 18238 * '-10px + 5vh, 5px - 6%' 18239 * ``` 18240 * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap 18241 * > with their reference element, unfortunately, you will have to disable the `flip` modifier. 18242 * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373). 18243 * 18244 * @memberof modifiers 18245 * @inner 18246 */ 18247 offset: { 18248 /** @prop {number} order=200 - Index used to define the order of execution */ 18249 order: 200, 18250 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 18251 enabled: true, 18252 /** @prop {ModifierFn} */ 18253 fn: offset, 18254 /** @prop {Number|String} offset=0 18255 * The offset value as described in the modifier description 18256 */ 18257 offset: 0 18258 }, 18259 18260 /** 18261 * Modifier used to prevent the popper from being positioned outside the boundary. 18262 * 18263 * A scenario exists where the reference itself is not within the boundaries.<br /> 18264 * We can say it has "escaped the boundaries" â or just "escaped".<br /> 18265 * In this case we need to decide whether the popper should either: 18266 * 18267 * - detach from the reference and remain "trapped" in the boundaries, or 18268 * - if it should ignore the boundary and "escape with its reference" 18269 * 18270 * When `escapeWithReference` is set to`true` and reference is completely 18271 * outside its boundaries, the popper will overflow (or completely leave) 18272 * the boundaries in order to remain attached to the edge of the reference. 18273 * 18274 * @memberof modifiers 18275 * @inner 18276 */ 18277 preventOverflow: { 18278 /** @prop {number} order=300 - Index used to define the order of execution */ 18279 order: 300, 18280 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 18281 enabled: true, 18282 /** @prop {ModifierFn} */ 18283 fn: preventOverflow, 18284 /** 18285 * @prop {Array} [priority=['left','right','top','bottom']] 18286 * Popper will try to prevent overflow following these priorities by default, 18287 * then, it could overflow on the left and on top of the `boundariesElement` 18288 */ 18289 priority: ['left', 'right', 'top', 'bottom'], 18290 /** 18291 * @prop {number} padding=5 18292 * Amount of pixel used to define a minimum distance between the boundaries 18293 * and the popper. This makes sure the popper always has a little padding 18294 * between the edges of its container 18295 */ 18296 padding: 5, 18297 /** 18298 * @prop {String|HTMLElement} boundariesElement='scrollParent' 18299 * Boundaries used by the modifier. Can be `scrollParent`, `window`, 18300 * `viewport` or any DOM element. 18301 */ 18302 boundariesElement: 'scrollParent' 18303 }, 18304 18305 /** 18306 * Modifier used to make sure the reference and its popper stay near each other 18307 * without leaving any gap between the two. Especially useful when the arrow is 18308 * enabled and you want to ensure that it points to its reference element. 18309 * It cares only about the first axis. You can still have poppers with margin 18310 * between the popper and its reference element. 18311 * @memberof modifiers 18312 * @inner 18313 */ 18314 keepTogether: { 18315 /** @prop {number} order=400 - Index used to define the order of execution */ 18316 order: 400, 18317 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 18318 enabled: true, 18319 /** @prop {ModifierFn} */ 18320 fn: keepTogether 18321 }, 18322 18323 /** 18324 * This modifier is used to move the `arrowElement` of the popper to make 18325 * sure it is positioned between the reference element and its popper element. 18326 * It will read the outer size of the `arrowElement` node to detect how many 18327 * pixels of conjunction are needed. 18328 * 18329 * It has no effect if no `arrowElement` is provided. 18330 * @memberof modifiers 18331 * @inner 18332 */ 18333 arrow: { 18334 /** @prop {number} order=500 - Index used to define the order of execution */ 18335 order: 500, 18336 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 18337 enabled: true, 18338 /** @prop {ModifierFn} */ 18339 fn: arrow, 18340 /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ 18341 element: '[x-arrow]' 18342 }, 18343 18344 /** 18345 * Modifier used to flip the popper's placement when it starts to overlap its 18346 * reference element. 18347 * 18348 * Requires the `preventOverflow` modifier before it in order to work. 18349 * 18350 * **NOTE:** this modifier will interrupt the current update cycle and will 18351 * restart it if it detects the need to flip the placement. 18352 * @memberof modifiers 18353 * @inner 18354 */ 18355 flip: { 18356 /** @prop {number} order=600 - Index used to define the order of execution */ 18357 order: 600, 18358 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 18359 enabled: true, 18360 /** @prop {ModifierFn} */ 18361 fn: flip, 18362 /** 18363 * @prop {String|Array} behavior='flip' 18364 * The behavior used to change the popper's placement. It can be one of 18365 * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid 18366 * placements (with optional variations) 18367 */ 18368 behavior: 'flip', 18369 /** 18370 * @prop {number} padding=5 18371 * The popper will flip if it hits the edges of the `boundariesElement` 18372 */ 18373 padding: 5, 18374 /** 18375 * @prop {String|HTMLElement} boundariesElement='viewport' 18376 * The element which will define the boundaries of the popper position. 18377 * The popper will never be placed outside of the defined boundaries 18378 * (except if `keepTogether` is enabled) 18379 */ 18380 boundariesElement: 'viewport', 18381 /** 18382 * @prop {Boolean} flipVariations=false 18383 * The popper will switch placement variation between `-start` and `-end` when 18384 * the reference element overlaps its boundaries. 18385 * 18386 * The original placement should have a set variation. 18387 */ 18388 flipVariations: false, 18389 /** 18390 * @prop {Boolean} flipVariationsByContent=false 18391 * The popper will switch placement variation between `-start` and `-end` when 18392 * the popper element overlaps its reference boundaries. 18393 * 18394 * The original placement should have a set variation. 18395 */ 18396 flipVariationsByContent: false 18397 }, 18398 18399 /** 18400 * Modifier used to make the popper flow toward the inner of the reference element. 18401 * By default, when this modifier is disabled, the popper will be placed outside 18402 * the reference element. 18403 * @memberof modifiers 18404 * @inner 18405 */ 18406 inner: { 18407 /** @prop {number} order=700 - Index used to define the order of execution */ 18408 order: 700, 18409 /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ 18410 enabled: false, 18411 /** @prop {ModifierFn} */ 18412 fn: inner 18413 }, 18414 18415 /** 18416 * Modifier used to hide the popper when its reference element is outside of the 18417 * popper boundaries. It will set a `x-out-of-boundaries` attribute which can 18418 * be used to hide with a CSS selector the popper when its reference is 18419 * out of boundaries. 18420 * 18421 * Requires the `preventOverflow` modifier before it in order to work. 18422 * @memberof modifiers 18423 * @inner 18424 */ 18425 hide: { 18426 /** @prop {number} order=800 - Index used to define the order of execution */ 18427 order: 800, 18428 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 18429 enabled: true, 18430 /** @prop {ModifierFn} */ 18431 fn: hide 18432 }, 18433 18434 /** 18435 * Computes the style that will be applied to the popper element to gets 18436 * properly positioned. 18437 * 18438 * Note that this modifier will not touch the DOM, it just prepares the styles 18439 * so that `applyStyle` modifier can apply it. This separation is useful 18440 * in case you need to replace `applyStyle` with a custom implementation. 18441 * 18442 * This modifier has `850` as `order` value to maintain backward compatibility 18443 * with previous versions of Popper.js. Expect the modifiers ordering method 18444 * to change in future major versions of the library. 18445 * 18446 * @memberof modifiers 18447 * @inner 18448 */ 18449 computeStyle: { 18450 /** @prop {number} order=850 - Index used to define the order of execution */ 18451 order: 850, 18452 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 18453 enabled: true, 18454 /** @prop {ModifierFn} */ 18455 fn: computeStyle, 18456 /** 18457 * @prop {Boolean} gpuAcceleration=true 18458 * If true, it uses the CSS 3D transformation to position the popper. 18459 * Otherwise, it will use the `top` and `left` properties 18460 */ 18461 gpuAcceleration: true, 18462 /** 18463 * @prop {string} [x='bottom'] 18464 * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. 18465 * Change this if your popper should grow in a direction different from `bottom` 18466 */ 18467 x: 'bottom', 18468 /** 18469 * @prop {string} [x='left'] 18470 * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. 18471 * Change this if your popper should grow in a direction different from `right` 18472 */ 18473 y: 'right' 18474 }, 18475 18476 /** 18477 * Applies the computed styles to the popper element. 18478 * 18479 * All the DOM manipulations are limited to this modifier. This is useful in case 18480 * you want to integrate Popper.js inside a framework or view library and you 18481 * want to delegate all the DOM manipulations to it. 18482 * 18483 * Note that if you disable this modifier, you must make sure the popper element 18484 * has its position set to `absolute` before Popper.js can do its work! 18485 * 18486 * Just disable this modifier and define your own to achieve the desired effect. 18487 * 18488 * @memberof modifiers 18489 * @inner 18490 */ 18491 applyStyle: { 18492 /** @prop {number} order=900 - Index used to define the order of execution */ 18493 order: 900, 18494 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 18495 enabled: true, 18496 /** @prop {ModifierFn} */ 18497 fn: applyStyle, 18498 /** @prop {Function} */ 18499 onLoad: applyStyleOnLoad, 18500 /** 18501 * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier 18502 * @prop {Boolean} gpuAcceleration=true 18503 * If true, it uses the CSS 3D transformation to position the popper. 18504 * Otherwise, it will use the `top` and `left` properties 18505 */ 18506 gpuAcceleration: undefined 18507 } 18508}; 18509 18510/** 18511 * The `dataObject` is an object containing all the information used by Popper.js. 18512 * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks. 18513 * @name dataObject 18514 * @property {Object} data.instance The Popper.js instance 18515 * @property {String} data.placement Placement applied to popper 18516 * @property {String} data.originalPlacement Placement originally defined on init 18517 * @property {Boolean} data.flipped True if popper has been flipped by flip modifier 18518 * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper 18519 * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier 18520 * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`) 18521 * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`) 18522 * @property {Object} data.boundaries Offsets of the popper boundaries 18523 * @property {Object} data.offsets The measurements of popper, reference and arrow elements 18524 * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values 18525 * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values 18526 * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 18527 */ 18528 18529/** 18530 * Default options provided to Popper.js constructor.<br /> 18531 * These can be overridden using the `options` argument of Popper.js.<br /> 18532 * To override an option, simply pass an object with the same 18533 * structure of the `options` object, as the 3rd argument. For example: 18534 * ``` 18535 * new Popper(ref, pop, { 18536 * modifiers: { 18537 * preventOverflow: { enabled: false } 18538 * } 18539 * }) 18540 * ``` 18541 * @type {Object} 18542 * @static 18543 * @memberof Popper 18544 */ 18545var Defaults = { 18546 /** 18547 * Popper's placement. 18548 * @prop {Popper.placements} placement='bottom' 18549 */ 18550 placement: 'bottom', 18551 18552 /** 18553 * Set this to true if you want popper to position it self in 'fixed' mode 18554 * @prop {Boolean} positionFixed=false 18555 */ 18556 positionFixed: false, 18557 18558 /** 18559 * Whether events (resize, scroll) are initially enabled. 18560 * @prop {Boolean} eventsEnabled=true 18561 */ 18562 eventsEnabled: true, 18563 18564 /** 18565 * Set to true if you want to automatically remove the popper when 18566 * you call the `destroy` method. 18567 * @prop {Boolean} removeOnDestroy=false 18568 */ 18569 removeOnDestroy: false, 18570 18571 /** 18572 * Callback called when the popper is created.<br /> 18573 * By default, it is set to no-op.<br /> 18574 * Access Popper.js instance with `data.instance`. 18575 * @prop {onCreate} 18576 */ 18577 onCreate: function onCreate() {}, 18578 18579 /** 18580 * Callback called when the popper is updated. This callback is not called 18581 * on the initialization/creation of the popper, but only on subsequent 18582 * updates.<br /> 18583 * By default, it is set to no-op.<br /> 18584 * Access Popper.js instance with `data.instance`. 18585 * @prop {onUpdate} 18586 */ 18587 onUpdate: function onUpdate() {}, 18588 18589 /** 18590 * List of modifiers used to modify the offsets before they are applied to the popper. 18591 * They provide most of the functionalities of Popper.js. 18592 * @prop {modifiers} 18593 */ 18594 modifiers: modifiers 18595}; 18596 18597/** 18598 * @callback onCreate 18599 * @param {dataObject} data 18600 */ 18601 18602/** 18603 * @callback onUpdate 18604 * @param {dataObject} data 18605 */ 18606 18607// Utils 18608// Methods 18609var Popper = function () { 18610 /** 18611 * Creates a new Popper.js instance. 18612 * @class Popper 18613 * @param {Element|referenceObject} reference - The reference element used to position the popper 18614 * @param {Element} popper - The HTML / XML element used as the popper 18615 * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) 18616 * @return {Object} instance - The generated Popper.js instance 18617 */ 18618 function Popper(reference, popper) { 18619 var _this = this; 18620 18621 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 18622 classCallCheck(this, Popper); 18623 18624 this.scheduleUpdate = function () { 18625 return requestAnimationFrame(_this.update); 18626 }; 18627 18628 // make update() debounced, so that it only runs at most once-per-tick 18629 this.update = debounce(this.update.bind(this)); 18630 18631 // with {} we create a new object with the options inside it 18632 this.options = _extends({}, Popper.Defaults, options); 18633 18634 // init state 18635 this.state = { 18636 isDestroyed: false, 18637 isCreated: false, 18638 scrollParents: [] 18639 }; 18640 18641 // get reference and popper elements (allow jQuery wrappers) 18642 this.reference = reference && reference.jquery ? reference[0] : reference; 18643 this.popper = popper && popper.jquery ? popper[0] : popper; 18644 18645 // Deep merge modifiers options 18646 this.options.modifiers = {}; 18647 Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { 18648 _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); 18649 }); 18650 18651 // Refactoring modifiers' list (Object => Array) 18652 this.modifiers = Object.keys(this.options.modifiers).map(function (name) { 18653 return _extends({ 18654 name: name 18655 }, _this.options.modifiers[name]); 18656 }) 18657 // sort the modifiers by order 18658 .sort(function (a, b) { 18659 return a.order - b.order; 18660 }); 18661 18662 // modifiers have the ability to execute arbitrary code when Popper.js get inited 18663 // such code is executed in the same order of its modifier 18664 // they could add new properties to their options configuration 18665 // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! 18666 this.modifiers.forEach(function (modifierOptions) { 18667 if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { 18668 modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); 18669 } 18670 }); 18671 18672 // fire the first update to position the popper in the right place 18673 this.update(); 18674 18675 var eventsEnabled = this.options.eventsEnabled; 18676 if (eventsEnabled) { 18677 // setup event listeners, they will take care of update the position in specific situations 18678 this.enableEventListeners(); 18679 } 18680 18681 this.state.eventsEnabled = eventsEnabled; 18682 } 18683 18684 // We can't use class properties because they don't get listed in the 18685 // class prototype and break stuff like Sinon stubs 18686 18687 18688 createClass(Popper, [{ 18689 key: 'update', 18690 value: function update$$1() { 18691 return update.call(this); 18692 } 18693 }, { 18694 key: 'destroy', 18695 value: function destroy$$1() { 18696 return destroy.call(this); 18697 } 18698 }, { 18699 key: 'enableEventListeners', 18700 value: function enableEventListeners$$1() { 18701 return enableEventListeners.call(this); 18702 } 18703 }, { 18704 key: 'disableEventListeners', 18705 value: function disableEventListeners$$1() { 18706 return disableEventListeners.call(this); 18707 } 18708 18709 /** 18710 * Schedules an update. It will run on the next UI update available. 18711 * @method scheduleUpdate 18712 * @memberof Popper 18713 */ 18714 18715 18716 /** 18717 * Collection of utilities useful when writing custom modifiers. 18718 * Starting from version 1.7, this method is available only if you 18719 * include `popper-utils.js` before `popper.js`. 18720 * 18721 * **DEPRECATION**: This way to access PopperUtils is deprecated 18722 * and will be removed in v2! Use the PopperUtils module directly instead. 18723 * Due to the high instability of the methods contained in Utils, we can't 18724 * guarantee them to follow semver. Use them at your own risk! 18725 * @static 18726 * @private 18727 * @type {Object} 18728 * @deprecated since version 1.8 18729 * @member Utils 18730 * @memberof Popper 18731 */ 18732 18733 }]); 18734 return Popper; 18735}(); 18736 18737/** 18738 * The `referenceObject` is an object that provides an interface compatible with Popper.js 18739 * and lets you use it as replacement of a real DOM node.<br /> 18740 * You can use this method to position a popper relatively to a set of coordinates 18741 * in case you don't have a DOM node to use as reference. 18742 * 18743 * ``` 18744 * new Popper(referenceObject, popperNode); 18745 * ``` 18746 * 18747 * NB: This feature isn't supported in Internet Explorer 10. 18748 * @name referenceObject 18749 * @property {Function} data.getBoundingClientRect 18750 * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method. 18751 * @property {number} data.clientWidth 18752 * An ES6 getter that will return the width of the virtual reference element. 18753 * @property {number} data.clientHeight 18754 * An ES6 getter that will return the height of the virtual reference element. 18755 */ 18756 18757 18758Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils; 18759Popper.placements = placements; 18760Popper.Defaults = Defaults; 18761 18762/* harmony default export */ __webpack_exports__["default"] = (Popper); 18763//# sourceMappingURL=popper.js.map 18764 18765/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) 18766 18767/***/ }), 18768
vendor: 721 bytes, lines 18769-18798
18769/***/ "./node_modules/webpack/buildin/global.js": 18770/*!***********************************!*\ 18771 !*** (webpack)/buildin/global.js ***! 18772 \***********************************/ 18773/*! no static exports found */ 18774/***/ (function(module, exports) { 18775 18776var g; 18777 18778// This works in non-strict mode 18779g = (function() { 18780 return this; 18781})(); 18782 18783try { 18784 // This works if eval is allowed (see CSP) 18785 g = g || new Function("return this")(); 18786} catch (e) { 18787 // This works if the window reference is available 18788 if (typeof window === "object") g = window; 18789} 18790 18791// g can still be undefined, but nothing to do about it... 18792// We return undefined, instead of nothing here, so it's 18793// easier to handle this case. if(!global) { ...} 18794 18795module.exports = g; 18796 18797 18798/***/ })
18798, 18799 18800/***/ 0: 18801/*!******************************************************************!*\ 18802 !*** multi ./musee_stcloud_radix/src/js/stcloud_radix.script.js ***! 18803 \******************************************************************/ 18804/*! no static exports found */ 18805/***/ (function(module, exports, __webpack_require__) { 18806 18807module.exports = __webpack_require__(/*! /home/wwwroot/stcloud/web/themes/musee_stcloud_radix/src/js/stcloud_radix.script.js */"./musee_stcloud_radix/src/js/stcloud_radix.script.js"); 18808 18809 18810/***/ }) 18811 18812/******/ });
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.