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/******/ exports: {}, 15/******/ id: moduleId, 16/******/ loaded: false 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.loaded = 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/******/ // __webpack_public_path__ 37/******/ __webpack_require__.p = ""; 38 39/******/ // Load entry module and return exports 40/******/ return __webpack_require__(0); 41/******/ }) 42/************************************************************************/ 43/******/ ([ 44/* 0 */ 45/***/ (function(module, exports, __webpack_require__) { 46 47 /* WEBPACK VAR INJECTION */(function($, jQuery) {"use strict"; 48 49 __webpack_require__(2); 50 51 var _news_ajax = __webpack_require__(332); 52 53 var _news_ajax2 = _interopRequireDefault(_news_ajax); 54 55 var _browser = __webpack_require__(333); 56 57 var _browser2 = _interopRequireDefault(_browser); 58 59 __webpack_require__(334); 60 61 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 62 63 __webpack_require__(335); 64 __webpack_require__(336); 65 66 var sp_border = 850; 67 var window_flag = null; 68 if ($(window).width() > sp_border) { 69 window_flag = "over"; 70 } else { 71 window_flag = "under"; 72 } 73 74 $(function () { 75 _browser2.default.init(); 76 if (_browser2.default.isDevice() == "sp") { 77 $("html").addClass("sp"); 78 } else if (_browser2.default.isDevice() == "tablet") { 79 $("html").addClass("tablet"); 80 } 81 setTimeout(function () { 82 $("body").removeClass("hidden"); 83 }, 300); 84 menu(); 85 pc_event(); 86 image_guard(); 87 if ($("body#top")[0]) { 88 top(); 89 } else if ($("body#company.showroom")[0]) { 90 slick_type1(); 91 slick_type3(); 92 setTimeout(function () {
93 if ($("div.showroom_introduction__anchor_links").length) { 94 showroom_index(); 95 } 96 }, 100); 97 } else if ($("body#company.social-contribution")[0]) { 98 social_contribution(); 99 } else if ($("body#news")[0]) { 100 (0, _news_ajax2.default)(); 101 } else if ($("body#news_single")[0]) { 102 news_single(); 103 } else if ($("body#products.stone.production")[0]) { 104 slick_type2(); 105 } else if ($("body#products.safety")[0]) { 106 slick_type2(); 107 } else if ($("body#products.kitchen.material")[0]) { 108 slick_type1(); 109 } else if ($("body#products.catalog")[0]) { 110 slick_type1(); 111 catalog(); 112 } else if ($("body#recruit.faq")[0]) { 113 faq(); 114 } else if ($("body#contact.form")[0] || $("body#photocontest-form")[0]) { 115 contact(); 116 } else if ($("body#products.feature.business-area")[0]) { 117 business_area(); 118 slick_type3(); 119 } else if ($("body#products.feature.products-handled")[0]) { 120 slick_type3(); 121 } else if ($("body#products.atelier")[0]) { 122 slick_type3(); 123 if (!$("body#products.atelier.atelier_single")[0]) { 124 atelier(); 125 } else { 126 atelier_single(); 127 } 128 } 129 if ($("body.single")[0]) { 130 iframe_resize(); 131 $(window).on("resize", function () { 132 iframe_resize(); 133 }); 134 } 135 }); 136 137 function iframe_resize() { 138 var text_block = $("div.flexible_content.text"); 139 var block_length = text_block.length; 140 if (block_length >= 1) { 141 for (var i = 0; i < block_length; i++) { 142 var w = text_block.eq(i).width(); 143 var target = text_block.eq(i).find("iframe"); 144 if (target.length) { 145 for (var j = 0; j < target.length; j++) { 146 var iframe = target.eq(j); 147 var w_origin = iframe.attr("width"); 148 var h_origin = iframe.attr("height"); 149 var val = w / w_origin; 150 iframe.width(w); 151 iframe.height(h_origin * val); 152 } 153 } 154 } 155 } 156 } 157 158 function image_guard() { 159 $("img.guard").on("contextmenu", function (e) { 160 return false; 161 }); 162 $("img.guard").on("mousedown mouseup", function (e) { 163 return false; 164 }); 165 $("img.guard").css({ 166 "pointer-events": "none", 167 "-webkit-touch-callout": "none", 168 "-webkit-user-select": "none", 169 "-moz-touch-callout": "none", 170 "-moz-user-select": "none", 171 "touch-callout": "none", 172 "user-select": "none" 173 }); 174 } 175
176 function top() { 177 var is_autoplay = true; 178 var is_swipe = false; 179 if ($("html").hasClass("sp") || $("html").hasClass("tablet")) { 180 is_autoplay = true; 181 is_swipe = true; 182 } 183 var slide_images = $("div#top_slide_images ul"); 184 slide_images.slick({ 185 infinite: true, 186 autoplay: is_autoplay, 187 autoplaySpeed: 4400, 188 fade: true, 189 speed: 1200, 190 touchThreshold: 5, 191 pauseOnHover: false, 192 slidesToShow: 1, 193 slidesToScroll: 1, 194 swipe: is_swipe, 195 arrows: false, 196 dots: true 197 }); 198 } 199 200 function contact() { 201 //ãã©ãã³ã³ãã¹ããã©ã¼ã ã®æ®å½±å¹´ã«ä»å¹´åº¦ã追å 202 var shooting_year = $('select[name="shooting-year"]'); 203 if (shooting_year.length) { 204 var d = new Date(); 205 var current_year = Number(d.getFullYear()); 206 for (var i = 2025; i < current_year + 1; i++) { 207 if (i >= 2026) { 208 shooting_year.append('<option value="' + i + '">' + i + '</option>'); 209 } 210 } 211 } 212 213 // æ·»ä»ãã¡ã¤ã«ã®ãã¡ã¤ã«å表示å¦çï¼ãã©ãã³ã³ãã¹ã&ãè¦ç©ãï¼ 214 $("input#attach-file, input#estimates-inquiries-attach-file").on("change", function () { 215 var files = $(this).prop("files"); 216 var $fileNameSpan = $(this).closest("dd").find("span.file_name"); 217 218 // ãã¡ã¤ã«ã鏿ããã¦ãããï¼1ã¤ä»¥ä¸ãããï¼ãã§ã㯠219 if (files && files.length > 0) { 220 var value = files[0].name; 221 $fileNameSpan.text(value); 222 } else { 223 $fileNameSpan.text(""); 224 } 225 }); 226 227 // å ¥å確èªï¼ç·¨éãã¿ã³ãã¯ãªãã¯ããæã®ã¹ã¯ãã¼ã«ã¤ãã³ã 228 wpcf7c_scroll = function wpcf7c_scroll(unit_tag) { 229 jQuery(jQuery.find("input[name=_wpcf7_unit_tag]")).each(function () { 230 if (jQuery(this).val() == unit_tag) { 231 232 var $form = $(this).closest('form'); 233 234 if ($form.find('.wpcf7c-btn-back').is(':visible')) { 235 // ä¿®æ£ãã¿ã³ããç»é¢ã«è¦ãã¦ããã ï¼ ç¢ºèªç»é¢ 236 // .error_note ãé表示ã«ãã 237 $form.closest("div#contents").find("section.contact_head_block span.error_note").removeClass("active"); 238 $form.closest("div.form_block").find("div.form_block_headline span.error_note").removeClass("active"); 239 // 確èªç»é¢ã®æã«è¡¨ç¤ºããè¦ç´ ã«classãã¤ãã 240 $form.closest("div#contents").find("section.contact_head_block span.confirm_note").addClass("active"); 241 $form.closest("div.form_block").find("div.form_block_headline span.confirm_note").addClass("active"); 242 $("div.inquiry_type__button").addClass("disactive"); 243 } else { 244 // ä¿®æ£ãã¿ã³ããé ãã¦ããã ï¼ å ¥åç»é¢ 245 // 確èªç»é¢ã®æã«è¡¨ç¤ºãã¦ããè¦ç´ ããclassãå¤ã 246 $form.closest("div#contents").find("section.contact_head_block span.confirm_note").removeClass("active"); 247 $form.closest("div.form_block").find("div.form_block_headline span.confirm_note").removeClass("active"); 248 $("div.inquiry_type__button").removeClass("disactive"); 249 } 250 251 var top = null; 252 var scroll_top_margin = 0; 253 if ($("body#contact.form")[0]) { 254 scroll_top_margin = 79; 255 if ($(window).width() <= sp_border) { 256 scroll_top_margin = 110; 257 } 258 top = $(".contact__inquiry_type").offset().top - scroll_top_margin; 259 } else { 260 scroll_top_margin = 70; 261 if ($(window).width() <= sp_border) { 262 scroll_top_margin = 60; 263 } 264 top = $("section.contact_head_block").offset().top - scroll_top_margin; 265 } 266 TweenMax.to("html, body", 1.0, { scrollTop: top, ease: Cubic.easeInOut }); 267 } 268 }); 269 }; 270 271 // å ¥åã¨ã©ã¼ï¼ä¸åï¼ããã£ã¦éä¿¡ããããã¯ãããæ 272 document.addEventListener('wpcf7invalid', function (event) { 273 274 // 1. CF7ã®ã¡ã¤ã³ã¨ã©ã¼ã¡ãã»ã¼ã¸ï¼[response]ã®å 容ï¼ãåå¾ 275 var errorMessage = event.detail.apiResponse.message; 276 277 // 2. åå¾ããã¡ãã»ã¼ã¸ãæ¿å ¥ï¼textï¼ãã¦ãããactiveã¯ã©ã¹ãä»ä¸ 278 $("div#contents").find("section.contact_head_block span.error_note").text(errorMessage).addClass("active"); 279 $("div.form_block.active").find("div.form_block_headline span.error_note").text(errorMessage).addClass("active"); 280 281 var top = null; 282 var scroll_top_margin = 0; 283 if ($("body#contact.form")[0]) { 284 scroll_top_margin = 105; 285 if ($(window).width() <= sp_border) { 286 scroll_top_margin = 127; 287 } 288 top = $("div#form").offset().top - scroll_top_margin; 289 } else { 290 scroll_top_margin = 70; 291 if ($(window).width() <= sp_border) { 292 scroll_top_margin = 60; 293 } 294 top = $("section.contact_head_block").offset().top - scroll_top_margin; 295 } 296 TweenMax.to("html, body", 1.0, { scrollTop: top, ease: Cubic.easeInOut }); 297 }, false); 298 299 // ã¡ã¼ã«ã®éä¿¡ããæåããã¦å®äºç»é¢ã«ãªã£ãæ 300 document.addEventListener('wpcf7mailsent', function (event) { 301 // 確èªç»é¢ã®æã«è¡¨ç¤ºãã¦ããè¦ç´ ããclassãå¤ã 302 $("div#contents").find("section.contact_head_block span.confirm_note").removeClass("active"); 303 $("div.form_block").find("div.form_block_headline span.confirm_note").removeClass("active"); 304 $("div.inquiry_type__button").removeClass("disactive"); 305 }, false); 306 307 // .wpcf7-not-valid ãä»ãã¦ããé ç®ã«å ¥åããæã¯ .wpcf7-not-valid ãå¤ã 308 $(document).on('input change', '.wpcf7-not-valid', function () { 309 var $this = $(this); 310 311 // å¤ã空ã§ã¯ãªãï¼å ¥åãããï¼ãã¾ãã¯ãã§ãã¯ããã¯ã¹çã«ãã§ãã¯ãå ¥ã£ãå ´å 312 if ($this.val() !== "" || $this.is(':checked')) { 313 314 // 1. èªèº«ã® input/textarea ããã¨ã©ã¼ã¯ã©ã¹ãå¤ã 315 $this.removeClass('wpcf7-not-valid'); 316
317 // ï¼ãã¾ãï¼ã¢ã¯ã»ã·ããªãã£ç¨ã®å±æ§ãæ£å¸¸ç¶æ ã«æ»ã 318 $this.attr('aria-invalid', 'false'); 319 320 // 2. ç´ä¸ã«åºã¦ãã赤åã®ã¨ã©ã¼ããã¹ãï¼.wpcf7-not-valid-tipï¼ãä¸ç·ã«æ¶ã 321 // â»CF7ã®æ¨æºæ§é ã§ãã .wpcf7-form-control-wrap ã®ä¸ããæ¢ãã¦æ¶å»ãã¾ã 322 $this.closest('.wpcf7-form-control-wrap').find('.wpcf7-not-valid-tip').fadeOut('fast', function () { 323 $(this).remove(); 324 }); 325 } 326 }); 327 328 // åæãã§ãã¯ããã¯ã¹ï¼è¦ªè¦ç´ ã«ã¨ã©ã¼ãã¤ãã¿ã¤ãï¼ã®ãªã¢ã«ã¿ã¤ã ã¨ã©ã¼è§£é¤ 329 $(document).on('change', '.wpcf7-acceptance input[type="checkbox"]', function () { 330 var $this = $(this); 331 332 // ãã§ãã¯ãå ¥ã£ãæã ãå¦çãå®è¡ 333 if ($this.is(':checked')) { 334 335 // 1. 親è¦ç´ ï¼.wpcf7-acceptanceï¼ããã¨ã©ã¼ã¯ã©ã¹ãå¤ã 336 $this.closest('.wpcf7-acceptance').removeClass('wpcf7-not-valid'); 337 338 // ï¼ãã¾ãï¼inputèªèº«ã®ã¢ã¯ã»ã·ããªãã£å±æ§ãæ»ã 339 $this.attr('aria-invalid', 'false'); 340 341 // 2. ç´ä¸ã«åºã¦ããã¨ã©ã¼ã¡ãã»ã¼ã¸ï¼åæç¢ºèªãå¿ è¦ã§ãï¼ãæ¶ã 342 $this.closest('.wpcf7-form-control-wrap').find('.wpcf7-not-valid-tip').fadeOut('fast', function () { 343 $(this).remove(); 344 }); 345 } 346 }); 347 348 //spanã§è¿½å ããplaceholderã®å¦ç 349 350 // 1. é常ã®placeholderã¨åãåãï¼æåãå ¥åããããæ¶ããï¼ã«ããå¦ç 351 $("textarea").on("input", function () { 352 var $this = $(this); 353 // å ã»ã©ã®HTMLæ§é ï¼pã¿ã°ãddã¿ã°ï¼ã©ã¡ãã§ãæ¢ããããã«æå® 354 var $placeholder = $this.closest("p, dd").find("span.placeholder"); 355 356 if ($this.val() !== "") { 357 // 1æåã§ãå ¥åããã¦ããã°æ¶ã 358 $placeholder.addClass("none"); 359 } else { 360 // 空ã£ã½ããã¤ç¢ºèªç»é¢ï¼wpcf7c-confï¼ã§ã¯ãªãæã ãå表示ãã 361 if (!$this.hasClass("wpcf7c-conf")) { 362 $placeholder.removeClass("none"); 363 } 364 } 365 }); 366 367 // 2. ãã¼ã¸èªã¿è¾¼ã¿æã確èªç»é¢ã¸ã®åãæ¿ãæã®åæãã§ã㯠368 $("textarea").each(function () { 369 var $this = $(this); 370 var $placeholder = $this.closest("p, dd").find("span.placeholder"); 371 372 // æåããæåãå ¥ã£ã¦ãããã¾ãã¯ç¢ºèªç»é¢ï¼wpcf7c-confï¼ã®æã¯æåããæ¶ã 373 if ($this.val() !== "" || $this.hasClass("wpcf7c-conf")) { 374 $placeholder.addClass("none"); 375 } 376 }); 377 378 // ãåãåãããã©ã¼ã ã®ãåãåããå 容ã®åãæ¿ã 379 var $buttons = $('.inquiry_type_button'); 380 var $blocks = $('.form_block'); 381 var paramKey = 'type'; 382 383 // ãã©ã¼ã ã¨ãã¿ã³ã®ç¶æ ãåãæ¿ãã颿° 384 function switchForm(targetType) { 385 var action = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'push'; 386 387 var foundMatch = false; 388 389 $buttons.each(function () { 390 var $btn = $(this); 391 if ($btn.data('inquiry_type') === targetType) { 392 $btn.addClass('current'); 393 foundMatch = true; 394 } else { 395 $btn.removeClass('current'); 396 } 397 }); 398 399 if (!foundMatch) return; 400 401 $blocks.each(function () { 402 var $block = $(this); 403 var $inputs = $block.find('input, textarea, select'); 404 405 if ($block.hasClass(targetType)) { 406 $block.addClass('active'); 407 $inputs.prop('disabled', false); 408 $inputs.each(function () { 409 if ($(this).attr('aria-required') === 'true') { 410 $(this).prop('required', true); 411 } 412 }); 413 } else { 414 $block.removeClass('active'); 415 $inputs.prop('disabled', true); 416 $inputs.prop('required', false); 417 } 418 }); 419 420 if (action !== 'none') { 421 var url = new URL(window.location); 422 if (url.searchParams.get(paramKey) !== targetType) { 423 url.searchParams.set(paramKey, targetType); 424 if (action === 'push') { 425 window.history.pushState({ type: targetType }, '', url); 426 } else if (action === 'replace') { 427 window.history.replaceState({ type: targetType }, '', url); 428 } 429 } 430 } 431 } 432 433 // ãåãåããå 容ã鏿ããæã®ã¯ãªãã¯ã¤ãã³ã 434 $buttons.on('click', function (e) { 435 e.preventDefault(); 436 var targetType = $(this).data('inquiry_type'); 437 switchForm(targetType, 'push'); 438 }); 439 440 // ãã©ã¦ã¶ããã¯ï¼popstateï¼ã®å¦ç 441 $(window).on('popstate', function () {
442 var urlParams = new URLSearchParams(window.location.search); 443 var type = urlParams.get(paramKey); 444 if (type) { 445 switchForm(type, 'none'); 446 } else { 447 var defaultType = $buttons.filter('.current').data('inquiry_type') || $buttons.first().data('inquiry_type'); 448 switchForm(defaultType, 'none'); 449 } 450 }); 451 452 // ååãã¼ãæã®å¦ç 453 var urlParams = new URLSearchParams(window.location.search); 454 455 // 1. ãã©ã¼ã ã®è¡¨ç¤ºåãæ¿ãï¼æ¢åã®å¦çï¼ 456 var initialType = urlParams.get(paramKey); 457 if (initialType) { 458 switchForm(initialType, 'replace'); 459 } else { 460 var currentType = $buttons.filter('.current').data('inquiry_type'); 461 if (currentType) { 462 switchForm(currentType, 'none'); 463 } 464 } 465 466 // 2. ã·ã§ã¼ã«ã¼ã å ´æã®èªå鏿ï¼è¿½å ã®å¦çï¼ 467 var placeQuery = urlParams.get('place'); // å ±éã® urlParams ããåå¾ 468 if (placeQuery) { 469 var placeMap = { 470 'sekigahara': 'é¢ã¶åæ¬ç¤¾ KISEKIã¹ãã¼ã³ã®ã£ã©ãªã¼ï¼ã·ã§ã¼ã«ã¼ã ', 471 'tokyo': 'æ±äº¬æ±é¨æ¯åº ã·ã§ã¼ã«ã¼ã ', 472 'osaka': 'å¤§éªæ¯åº ã·ã§ã¼ã«ã¼ã ' 473 }; 474 475 var targetValue = placeMap[placeQuery]; 476 if (targetValue) { 477 $('#showroom-reservation-select-showroom').val(targetValue).trigger('change'); 478 } 479 } 480 481 // ã客æ§ç¨®å¥ã®ãã§ãã¯ããã¯ã¹ã®é¸ææ°ã1ã¤ã ãã«å¶é 482 // ã-jobtypeãã¾ãã¯ã-jobtype[]ãã§çµãããã§ãã¯ããã¯ã¹ãã¹ã¦ã対象ã«ãã 483 var jobTypeSelector = 'input[type="checkbox"][name$="-jobtype"], input[type="checkbox"][name$="-jobtype[]"]'; 484 485 $(document).on('change', jobTypeSelector, function () { 486 var $this = $(this); 487 var currentName = $this.attr('name'); // ã¯ãªãã¯ãããè¦ç´ ã®nameåãåå¾ 488 489 if ($this.prop('checked')) { 490 // åãnameãæã¤ä»ã®ãã§ãã¯ããã¯ã¹ã®ãã§ãã¯ãå¤ãï¼1ã¤ã ã鏿å¶éï¼ 491 $("input[name=\"" + currentName + "\"]").not($this).prop('checked', false); 492 } 493 }); 494 } 495 496 function slick_type2() { 497 var is_swipe = false; 498 if ($("html").hasClass("sp") || $("html").hasClass("tablet")) { 499 is_swipe = true; 500 } 501 var slide_images = $(".slide_images"); 502 var slide_images_length = slide_images.length; 503 if (slide_images_length) { 504 for (var i = 0; i < slide_images_length; i++) { 505 var slick_object = slide_images.eq(i); 506 slick_object.slick({ 507 infinite: true, 508 autoplay: false, 509 autoplaySpeed: 4400, 510 fade: false, 511 speed: 500, 512 touchThreshold: 5, 513 pauseOnHover: false, 514 slidesToShow: 1, 515 slidesToScroll: 1, 516 swipe: is_swipe, 517 arrows: true, 518 prevArrow: '<div class="button_wrap"><div class="button_wrap_inner"><button type="button" class="slick-prev">Previous</button></div></div>', 519 nextArrow: '<div class="button_wrap"><div class="button_wrap_inner"><button type="button" class="slick-next">Next</button></div></div>' 520 }); 521 } 522 } 523 } 524 525 function slick_type3() { 526 var is_swipe = false; 527 if ($("html").hasClass("sp") || $("html").hasClass("tablet")) { 528 is_swipe = true; 529 } 530 var slide_images = $(".slide_images"); 531 var slide_images_length = slide_images.length; 532 if (slide_images_length) { 533 for (var i = 0; i < slide_images_length; i++) { 534 var slick_object = slide_images.eq(i); 535 slick_object.slick({ 536 infinite: true, 537 autoplay: false, 538 autoplaySpeed: 4400, 539 fade: false, 540 speed: 0, 541 touchThreshold: 5, 542 pauseOnHover: false, 543 slidesToShow: 1, 544 slidesToScroll: 1, 545 swipe: is_swipe, 546 arrows: true, 547 prevArrow: '<div class="button_wrap"><div class="button_wrap_inner"><button type="button" class="slick-prev">Previous</button></div></div>', 548 nextArrow: '<div class="button_wrap"><div class="button_wrap_inner"><button type="button" class="slick-next">Next</button></div></div>' 549 }); 550 } 551 } 552 } 553 554 function business_area() { 555 if ($("div.large_slide_images").length) { 556 var Flickity = __webpack_require__(337); 557 var FlickityNav = __webpack_require__(355); 558 var length = $("div.large_slide_images").length; 559 560 var is_swipe = false;
561 if ($("html").hasClass("sp") || $("html").hasClass("tablet")) { 562 is_swipe = true; 563 } 564 565 var options = { 566 wrapAround: true, 567 contain: true, 568 draggable: is_swipe, 569 autoPlay: false, 570 prevNextButtons: true, 571 pageDots: false, 572 fade: true 573 }; 574 575 var slide_arrays = new Array(length); 576 var thumbnail_arrays = new Array(length); 577 578 for (var i = 0; i < length; i++) { 579 580 var nav_thumb = $("div.large_slide_thumbnails").eq(i).find("ul li"); 581 var nav_length = nav_thumb.length; 582 var nav_h = null; 583 if ($(window).width() > sp_border) { 584 nav_h = Math.round($(window).width() * 0.058); 585 if ($(window).width() > 1662) { 586 nav_h = 96; 587 } 588 } else { 589 nav_h = Math.round($(window).width() * 0.125); 590 } 591 for (var j = 0; j < nav_length; j++) { 592 nav_thumb.eq(j).css({ "height": nav_h + "px" }); 593 } 594 595 var val = null; 596 var is_wrap_around = null; 597 if ($(window).width() > sp_border) { 598 val = 9; 599 } else { 600 val = 5; 601 } 602 if (nav_length > val) { 603 is_wrap_around = true; 604 } else { 605 is_wrap_around = false; 606 } 607 var nav_options = { 608 wrapAround: is_wrap_around, 609 contain: true, 610 freeScroll: false, 611 draggable: false, 612 autoPlay: false, 613 prevNextButtons: false, 614 pageDots: false, 615 cellAlign: "left", 616 asNavFor: "div.large_slide_images_" + i + " ul" 617 }; 618 619 slide_arrays[i] = new Flickity(document.querySelector("div.large_slide_images_" + i + " ul"), options); 620 slide_arrays[i].stopPlayer(); 621 622 thumbnail_arrays[i] = new FlickityNav(document.querySelector("div.large_slide_thumbnails_" + i + " ul"), nav_options); 623 thumbnail_arrays[i].stopPlayer(); 624 } 625 626 var temp_w = $(window).width(); 627 $(window).on("resize", function () { 628 if ($(window).width() != temp_w) { 629 if ($("div.large_slide_images").length) { 630 for (var i = 0; i < length; i++) { 631 thumbnail_arrays[i].resize(); 632 if ($(window).width() > sp_border) { 633 nav_h = Math.round($(window).width() * 0.058); 634 if ($(window).width() > 1662) { 635 nav_h = 96; 636 } 637 } else { 638 nav_h = Math.round($(window).width() * 0.125); 639 } 640 $("div.large_slide_thumbnails").eq(i).find("ul div.flickity-viewport").css({ "height": nav_h + "px" }); 641 for (var j = 0; j < nav_length; j++) { 642 nav_thumb.eq(j).css({ "height": nav_h + "px" }); 643 } 644 temp_w = $(window).width(); 645 } 646 } 647 } 648 }); 649 } 650 } 651 652 function atelier() { 653 var total_posts = $("section.atelier_works_block div.works_posts article.post").length; 654 var current_posts = null; 655 var more_button = $("section.atelier_works_block div.bottom"); 656 var per_page = null; 657 if ($(window).width() > sp_border) { 658 per_page = 12; 659 } else { 660 per_page = 8; 661 } 662 if (total_posts > per_page) { 663 more_button.removeClass("none"); 664 for (var i = 0; i < total_posts; i++) { 665 if (i > per_page - 1) { 666 $("section.atelier_works_block div.works_posts article.post").eq(i).addClass("none"); 667 } 668 } 669 current_posts = $("section.atelier_works_block div.works_posts article.post").not(".none").length; 670 } 671 672 if (window.history && window.history.state) { 673 var html = history.state.page; 674 if (history.state.page != null) { 675 $("section.atelier_works_block div.works_posts").html(html); 676 more_button.removeClass("none"); 677 current_posts = $("section.atelier_works_block div.works_posts article.post").not(".none").length; 678 if (current_posts >= total_posts) { 679 more_button.addClass("none"); 680 } 681 history.pushState({ page: null }, null, location.href); 682 } 683 } 684 685 $("a.more_btn").on("click", function () { 686 setTimeout(function () { 687 for (var i = 0; i < total_posts; i++) { 688 if (i <= current_posts + per_page - 1) { 689 $("section.atelier_works_block div.works_posts article.post").eq(i).removeClass("none"); 690 } 691 } 692 current_posts = $("section.atelier_works_block div.works_posts article.post").not(".none").length; 693 if (current_posts >= total_posts) { 694 more_button.addClass("none"); 695 } 696 }, 300); 697 return false;
698 }); 699 700 $(document).on("click", "section.atelier_works_block div.works_posts article.post a", function () { 701 history.pushState({ page: $("section.atelier_works_block div.works_posts").html() }, null, location.href); 702 return true; 703 }); 704 705 if ($("div.large_slide_images").length) { 706 var Flickity = __webpack_require__(337); 707 var FlickityNav = __webpack_require__(355); 708 var length = $("div.large_slide_images").length; 709 710 var is_swipe = false; 711 if ($("html").hasClass("sp") || $("html").hasClass("tablet")) { 712 is_swipe = true; 713 } 714 715 var options = { 716 wrapAround: true, 717 contain: true, 718 draggable: is_swipe, 719 autoPlay: false, 720 prevNextButtons: true, 721 pageDots: false, 722 fade: true 723 }; 724 725 var slide_arrays = new Array(length); 726 var thumbnail_arrays = new Array(length); 727 728 for (var i = 0; i < length; i++) { 729 730 var nav_thumb = $("div.large_slide_thumbnails").eq(i).find("ul li"); 731 var nav_length = nav_thumb.length; 732 var nav_h = null; 733 if ($(window).width() > sp_border) { 734 nav_h = Math.round($(window).width() * 0.058); 735 if ($(window).width() > 1662) { 736 nav_h = 96; 737 } 738 } else { 739 nav_h = Math.round($(window).width() * 0.125); 740 } 741 for (var j = 0; j < nav_length; j++) { 742 nav_thumb.eq(j).css({ "height": nav_h + "px" }); 743 } 744 745 var val = null; 746 var is_wrap_around = null; 747 if ($(window).width() > sp_border) { 748 val = 9; 749 } else { 750 val = 5; 751 } 752 if (nav_length > val) { 753 is_wrap_around = true; 754 } else { 755 is_wrap_around = false; 756 } 757 var nav_options = { 758 wrapAround: is_wrap_around, 759 contain: true, 760 freeScroll: false, 761 draggable: false, 762 autoPlay: false, 763 prevNextButtons: false, 764 pageDots: false, 765 cellAlign: "left", 766 asNavFor: "div.large_slide_images_" + i + " ul" 767 }; 768 769 slide_arrays[i] = new Flickity(document.querySelector("div.large_slide_images_" + i + " ul"), options); 770 slide_arrays[i].stopPlayer(); 771 772 thumbnail_arrays[i] = new FlickityNav(document.querySelector("div.large_slide_thumbnails_" + i + " ul"), nav_options); 773 thumbnail_arrays[i].stopPlayer(); 774 } 775 776 var temp_w = $(window).width(); 777 $(window).on("resize", function () { 778 if ($(window).width() != temp_w) { 779 if ($("div.large_slide_images").length) { 780 for (var i = 0; i < length; i++) { 781 thumbnail_arrays[i].resize(); 782 if ($(window).width() > sp_border) { 783 nav_h = Math.round($(window).width() * 0.058); 784 if ($(window).width() > 1662) { 785 nav_h = 96; 786 } 787 } else { 788 nav_h = Math.round($(window).width() * 0.125); 789 } 790 $("div.large_slide_thumbnails").eq(i).find("ul div.flickity-viewport").css({ "height": nav_h + "px" }); 791 for (var j = 0; j < nav_length; j++) { 792 nav_thumb.eq(j).css({ "height": nav_h + "px" }); 793 } 794 temp_w = $(window).width(); 795 } 796 } 797 } 798 799 if ($(window).width() <= sp_border && window_flag != "under") { 800 window_flag = "under"; 801 per_page = 8; 802 $("section.atelier_works_block div.works_posts article.post").removeClass("none"); 803 more_button.addClass("none"); 804 if (total_posts > per_page) { 805 more_button.removeClass("none"); 806 for (var i = 0; i < total_posts; i++) { 807 if (i > per_page - 1) { 808 $("section.atelier_works_block div.works_posts article.post").eq(i).addClass("none"); 809 } 810 } 811 current_posts = $("section.atelier_works_block div.works_posts article.post").not(".none").length; 812 } 813 } else if ($(window).width() > sp_border && window_flag != "over") { 814 window_flag = "over"; 815 per_page = 12; 816 $("section.atelier_works_block div.works_posts article.post").removeClass("none"); 817 more_button.addClass("none"); 818 if (total_posts > per_page) { 819 more_button.removeClass("none"); 820 for (var i = 0; i < total_posts; i++) { 821 if (i > per_page - 1) { 822 $("section.atelier_works_block div.works_posts article.post").eq(i).addClass("none"); 823 } 824 } 825 current_posts = $("section.atelier_works_block div.works_posts article.post").not(".none").length; 826 } 827 } 828 }); 829 } 830 } 831 832 function atelier_single() { 833 if ($("div.large_slide_images").length) { 834 var Flickity = __webpack_require__(337); 835 var FlickityNav = __webpack_require__(355); 836 var length = $("div.large_slide_images").length; 837 838 var is_swipe = false;
839 if ($("html").hasClass("sp") || $("html").hasClass("tablet")) { 840 is_swipe = true; 841 } 842 843 var options = { 844 wrapAround: true, 845 contain: true, 846 draggable: is_swipe, 847 autoPlay: false, 848 prevNextButtons: true, 849 pageDots: false, 850 fade: true 851 }; 852 853 var slide_arrays = new Array(length); 854 var thumbnail_arrays = new Array(length); 855 856 for (var i = 0; i < length; i++) { 857 858 var nav_thumb = $("div.large_slide_thumbnails").eq(i).find("ul li"); 859 var nav_length = nav_thumb.length; 860 var nav_h = null; 861 if ($(window).width() > sp_border) { 862 nav_h = Math.round($(window).width() * 0.058); 863 if ($(window).width() > 1662) { 864 nav_h = 96; 865 } 866 } else { 867 nav_h = Math.round($(window).width() * 0.125); 868 } 869 for (var j = 0; j < nav_length; j++) { 870 nav_thumb.eq(j).css({ "height": nav_h + "px" }); 871 } 872 873 var val = null; 874 var is_wrap_around = null; 875 if ($(window).width() > sp_border) { 876 val = 9; 877 } else { 878 val = 5; 879 } 880 if (nav_length > val) { 881 is_wrap_around = true; 882 } else { 883 is_wrap_around = false; 884 } 885 var nav_options = { 886 wrapAround: is_wrap_around, 887 contain: true, 888 freeScroll: false, 889 draggable: false, 890 autoPlay: false, 891 prevNextButtons: false, 892 pageDots: false, 893 cellAlign: "left", 894 asNavFor: "div.large_slide_images_" + i + " ul" 895 }; 896 897 slide_arrays[i] = new Flickity(document.querySelector("div.large_slide_images_" + i + " ul"), options); 898 slide_arrays[i].stopPlayer(); 899 900 thumbnail_arrays[i] = new FlickityNav(document.querySelector("div.large_slide_thumbnails_" + i + " ul"), nav_options); 901 thumbnail_arrays[i].stopPlayer(); 902 903 var min_height = 0; 904 $("div.large_slide_images_" + i + " ul li div.content_caption.on_caption").each(function (index) { 905 var caption_height = $(this).outerHeight(true); 906 if (caption_height > min_height) { 907 min_height = caption_height; 908 } 909 }); 910 911 $("div.large_slide_images_" + i + " ul li div.content_caption").not(".on_caption").css({ "height": min_height + "px" }); 912 } 913 914 var temp_w = $(window).width(); 915 $(window).on("resize", function () { 916 if ($(window).width() != temp_w) { 917 if ($("div.large_slide_images").length) { 918 for (var i = 0; i < length; i++) { 919 thumbnail_arrays[i].resize(); 920 if ($(window).width() > sp_border) { 921 nav_h = Math.round($(window).width() * 0.058); 922 if ($(window).width() > 1662) { 923 nav_h = 96; 924 } 925 } else { 926 nav_h = Math.round($(window).width() * 0.125); 927 } 928 $("div.large_slide_thumbnails").eq(i).find("ul div.flickity-viewport").css({ "height": nav_h + "px" }); 929 for (var j = 0; j < nav_length; j++) { 930 nav_thumb.eq(j).css({ "height": nav_h + "px" }); 931 } 932 temp_w = $(window).width(); 933 934 var min_height = 0; 935 $("div.large_slide_images_" + i + " ul li div.content_caption.on_caption").each(function (index) { 936 var caption_height = $(this).outerHeight(true); 937 if (caption_height > min_height) { 938 min_height = caption_height; 939 } 940 }); 941 $("div.large_slide_images_" + i + " ul li div.content_caption").not(".on_caption").css({ "height": min_height + "px" }); 942 } 943 } 944 } 945 }); 946 } 947 948 if ($("ul.two_column_images").length) { 949 950 var is_swipe = false; 951 if ($("html").hasClass("sp") || $("html").hasClass("tablet")) { 952 is_swipe = true; 953 } 954 var slide_images = $("ul.two_column_images"); 955 var slide_images_length = slide_images.length; 956 957 for (var i = 0; i < slide_images_length; i++) { 958 var slick_object = slide_images.eq(i); 959 slick_object.slick({ 960 infinite: true, 961 autoplay: false, 962 autoplaySpeed: 4400, 963 fade: false, 964 speed: 0, 965 touchThreshold: 5, 966 pauseOnHover: false, 967 slidesToShow: 1, 968 slidesToScroll: 1, 969 swipe: is_swipe, 970 arrows: true, 971 prevArrow: '<div class="button_wrap"><div class="button_wrap_inner"><button type="button" class="slick-prev">Previous</button></div></div>', 972 nextArrow: '<div class="button_wrap"><div class="button_wrap_inner"><button type="button" class="slick-next">Next</button></div></div>' 973 }); 974 } 975 } 976 977 $("a.back_btn").on("click", function () { 978 if (document.referrer && new RegExp(location.host).test(document.referrer) && new RegExp("/products/atelier/").test(document.referrer)) { 979 var path = parse_url(document.referrer).pathname;
980 var dir = path.split("/").filter(Boolean); 981 var dir1 = dir[0]; 982 var dir2 = dir[1]; 983 var dir3 = dir[2]; 984 985 if (dir1 == "products" && dir2 == "atelier") { 986 if (!dir3) { 987 if (window.history.length >= 2) { 988 history.back(); 989 return false; 990 } else { 991 return true; 992 } 993 } else { 994 return true; 995 } 996 } else { 997 return true; 998 } 999 } else { 1000 return true; 1001 } 1002 }); 1003 } 1004 1005 function parse_url(url) { 1006 var a = document.createElement("a"); 1007 a.href = url; 1008 return a; 1009 } 1010 1011 function social_contribution() { 1012 $("div.q.faq_btn").on("click", function () { 1013 var target = $(this).closest("li"); 1014 if (!target.hasClass("open")) { 1015 target.addClass("open"); 1016 } else { 1017 target.removeClass("open"); 1018 } 1019 return false; 1020 }); 1021 } 1022 1023 function catalog() { 1024 catalog_resize(); 1025 $(window).on("resize", function () { 1026 catalog_resize(); 1027 }); 1028 } 1029 1030 function catalog_resize() { 1031 var pdf = $("li.pdf"); 1032 if ($(window).width() > sp_border) { 1033 1034 if ($(window).width() > 1000) { 1035 for (var i = 0; i < pdf.length; i = i + 3) { 1036 var max_h = pdf.eq(i).find("div.title").outerHeight(true) + pdf.eq(i).find("div.note").outerHeight(true); 1037 if (i + 1 <= pdf.length - 1) { 1038 var temp_max_h = pdf.eq(i + 1).find("div.title").outerHeight(true) + pdf.eq(i + 1).find("div.note").outerHeight(true); 1039 if (temp_max_h > max_h) { 1040 max_h = temp_max_h; 1041 } 1042 } 1043 if (i + 2 <= pdf.length - 1) { 1044 var temp_max_h = pdf.eq(i + 2).find("div.title").outerHeight(true) + pdf.eq(i + 2).find("div.note").outerHeight(true); 1045 if (temp_max_h > max_h) { 1046 max_h = temp_max_h; 1047 } 1048 } 1049 pdf.eq(i).find("div.head").css({ "height": max_h + "px" }); 1050 if (i + 1 <= pdf.length - 1) { 1051 pdf.eq(i + 1).find("div.head").css({ "height": max_h + "px" }); 1052 } 1053 if (i + 2 <= pdf.length - 1) { 1054 pdf.eq(i + 2).find("div.head").css({ "height": max_h + "px" }); 1055 } 1056 } 1057 } else { 1058 for (var i = 0; i < pdf.length; i = i + 2) { 1059 var max_h = pdf.eq(i).find("div.title").outerHeight(true) + pdf.eq(i).find("div.note").outerHeight(true); 1060 if (i + 1 <= pdf.length - 1) { 1061 var temp_max_h = pdf.eq(i + 1).find("div.title").outerHeight(true) + pdf.eq(i + 1).find("div.note").outerHeight(true); 1062 if (temp_max_h > max_h) { 1063 max_h = temp_max_h; 1064 } 1065 } 1066 pdf.eq(i).find("div.head").css({ "height": max_h + "px" }); 1067 if (i + 1 <= pdf.length - 1) { 1068 pdf.eq(i + 1).find("div.head").css({ "height": max_h + "px" }); 1069 } 1070 } 1071 } 1072 } else { 1073 pdf.each(function (index) { 1074 $(this).find("div.head").css({ "height": "" }); 1075 }); 1076 } 1077 } 1078 1079 function faq() { 1080 $("a.faq_btn").on("click", function () { 1081 var target = $(this).closest(".faq_list"); 1082 if (!target.hasClass("open")) { 1083 target.addClass("open"); 1084 } else { 1085 target.removeClass("open"); 1086 } 1087 return false; 1088 }); 1089 } 1090 1091 function showroom_index() { 1092 var qs = __webpack_require__(356); 1093 var is_scroll = null; 1094 var hh = null; 1095 if ($(window).width() > sp_border) { 1096 hh = 80; 1097 } else { 1098 hh = 120; 1099 } 1100 1101 if (location.search) { 1102 var obj = qs.parse(location.search.split("?")[1]); 1103 var position = obj["p"]; 1104 var target = "#" + position; 1105 var top = $(target).offset().top; 1106 $("html,body").scrollTop(top - hh); 1107 is_scroll = position; 1108 } 1109 1110 $(window).on("popstate", function (e) { 1111 var position = null; 1112 if (location.search) { 1113 var obj = qs.parse(location.search.split("?")[1]); 1114 position = obj["p"]; 1115 } else { 1116 position = "sekigahara"; 1117 } 1118 var target = "#" + position; 1119 var top = $(target).offset().top; 1120 $("html,body").scrollTop(top - hh); 1121 is_scroll = position; 1122 }); 1123 1124 $(window).on("scroll", function () { 1125 if ($(window).width() > sp_border) { 1126 hh = 80; 1127 } else { 1128 hh = 120; 1129 } 1130 var margin = 30; 1131 var sekigahara_top = $("#sekigahara").offset().top - margin; 1132 var tokyo_top = $("#tokyo").offset().top - margin; 1133 var osaka_top = $("#osaka").offset().top - margin; 1134 if ($(window).scrollTop() >= sekigahara_top - hh && $(window).scrollTop() < tokyo_top - hh) {
1135 var href = $(location).attr("origin") + "/company/showroom/?p=sekigahara"; 1136 if (is_scroll != "sekigahara") history.pushState(null, null, href); 1137 is_scroll = "sekigahara"; 1138 } else if ($(window).scrollTop() >= tokyo_top - hh && $(window).scrollTop() < osaka_top - hh) { 1139 var href = $(location).attr("origin") + "/company/showroom/?p=tokyo"; 1140 if (is_scroll != "tokyo") history.pushState(null, null, href); 1141 is_scroll = "tokyo"; 1142 } else if ($(window).scrollTop() >= osaka_top - hh) { 1143 var href = $(location).attr("origin") + "/company/showroom/?p=osaka"; 1144 if (is_scroll != "osaka") history.pushState(null, null, href); 1145 is_scroll = "osaka"; 1146 } 1147 }); 1148 1149 $("a.showroom_anchor_button").on("click", function () { 1150 if ($(window).width() > sp_border) { 1151 hh = 80; 1152 } else { 1153 hh = 120; 1154 } 1155 var showroom_name = $(this).data("showroom_name"); 1156 var target = "#" + showroom_name; 1157 var top = $(target).offset().top - hh; 1158 $("html, body").animate({ scrollTop: top }, 1000, "easeInOutQuint"); 1159 return false; 1160 }); 1161 } 1162 1163 function slick_type1() { 1164 var is_swipe = false; 1165 if ($("html").hasClass("sp") || $("html").hasClass("tablet")) { 1166 is_swipe = true; 1167 } 1168 var slide_elements = $("div.slide_elements"); 1169 var slide_elements_length = slide_elements.length; 1170 if (slide_elements_length) { 1171 for (var i = 0; i < slide_elements_length; i++) { 1172 var slick_object = slide_elements.eq(i).children("ul.slide_elements_inner"); 1173 slick_object.slick({ 1174 infinite: true, 1175 autoplay: false, 1176 autoplaySpeed: 4400, 1177 fade: false, 1178 speed: 500, 1179 touchThreshold: 5, 1180 pauseOnHover: false, 1181 slidesToShow: 2, 1182 slidesToScroll: 1, 1183 swipe: is_swipe, 1184 arrows: true, 1185 centerMode: true, 1186 centerPadding: "19%", 1187 responsive: [{ 1188 breakpoint: 5000, 1189 settings: { 1190 slidesToShow: 3 1191 } 1192 }, { 1193 breakpoint: 1500, 1194 settings: { 1195 slidesToShow: 2 1196 } 1197 }, { 1198 breakpoint: 851, 1199 settings: { 1200 slidesToShow: 1 1201 } 1202 }] 1203 }); 1204 //大éªã·ã§ã¼ã«ã¼ã ã®å é ã夿´ 1205 if (slide_elements.eq(i).hasClass("osaka")) { 1206 if ($(window).width() > sp_border) { 1207 slick_object.slick('slickGoTo', 1); 1208 } 1209 } 1210 } 1211 } 1212 } 1213 1214 function news_single() { 1215 // var key = "/news/"; 1216 // $("div#back_btn a").on("click", function() { 1217 // if (document.referrer && new RegExp(location.host).test(document.referrer) && new RegExp(key).test(document.referrer)) { 1218 // location.href = document.referrer; 1219 // return false; 1220 // } 1221 // else return true; 1222 // }); 1223 } 1224 1225 function menu() { 1226 var is_menu = false; 1227 var is_pd_menu = false; 1228 var header = $("#header"); 1229 var pd_sub_menu = $("div#pd_sub_menu"); 1230 var scroll_top = 0; 1231 1232 $("div#menu_btn a").on("click", function () { 1233 if (!is_menu) { 1234 scroll_top = $(window).scrollTop(); 1235 header.addClass("active"); 1236 $("html, body").addClass("fixed"); 1237 is_menu = true; 1238 pd_sub_menu.removeClass("active"); 1239 is_pd_menu = false; 1240 } else { 1241 header.removeClass("active"); 1242 $("html, body").removeClass("fixed"); 1243 $(window).scrollTop(scroll_top); 1244 is_menu = false; 1245 } 1246 return false; 1247 }); 1248 1249 $("a.pd_btn_a").on("click", function () { 1250 if (!is_pd_menu) { 1251 pd_sub_menu.addClass("active"); 1252 is_pd_menu = true; 1253 } else { 1254 pd_sub_menu.removeClass("active"); 1255 is_pd_menu = false; 1256 } 1257 return false; 1258 }); 1259 1260 $(window).on("resize", function () { 1261 if ($(window).width() > sp_border && is_menu) { 1262 header.removeClass("active"); 1263 is_menu = false; 1264 } 1265 if ($(window).width() > sp_border && is_pd_menu) { 1266 pd_sub_menu.removeClass("active"); 1267 is_pd_menu = false; 1268 } 1269 }); 1270 1271 $(document).on("click", function (e) { 1272 if (!$(e.target).closest("a").length) { 1273 var target = $("div#pd_sub_menu.active"); 1274 if (target.length && $("div#pd_sub_menu").hasClass("active")) { 1275 pd_sub_menu.removeClass("active"); 1276 is_pd_menu = false;
1277 } 1278 target = $("#header.active"); 1279 if (target.length && $("#header").hasClass("active")) { 1280 header.removeClass("active"); 1281 is_menu = false; 1282 } 1283 } 1284 }); 1285 } 1286 1287 function pc_event() { 1288 if (!$("html").hasClass("sp") && !$("html").hasClass("tablet")) { 1289 $(document).on({ 1290 "mouseenter": function mouseenter() { 1291 var target = $(this).closest(".hover_target"); 1292 if (!target[0]) return false; 1293 target.addClass("hover"); 1294 }, 1295 "mouseleave": function mouseleave() { 1296 var target = $(this).closest(".hover_target"); 1297 if (!target[0]) return false; 1298 target.removeClass("hover"); 1299 } 1300 }, ".hover_target a"); 1301 } 1302 } 1303 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(1))) 1304 1305/***/ }), 1306/* 1 */ 1307/***/ (function(module, exports, __webpack_require__) { 1308 1309 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 1310 * jQuery JavaScript Library v1.12.4 1311 * http://jquery.com/ 1312 * 1313 * Includes Sizzle.js 1314 * http://sizzlejs.com/ 1315 * 1316 * Copyright jQuery Foundation and other contributors 1317 * Released under the MIT license 1318 * http://jquery.org/license 1319 * 1320 * Date: 2016-05-20T17:17Z 1321 */ 1322 1323 (function( global, factory ) { 1324 1325 if ( typeof module === "object" && typeof module.exports === "object" ) { 1326 // For CommonJS and CommonJS-like environments where a proper `window` 1327 // is present, execute the factory and get jQuery. 1328 // For environments that do not have a `window` with a `document` 1329 // (such as Node.js), expose a factory as module.exports. 1330 // This accentuates the need for the creation of a real `window`. 1331 // e.g. var jQuery = require("jquery")(window); 1332 // See ticket #14549 for more info. 1333 module.exports = global.document ? 1334 factory( global, true ) : 1335 function( w ) { 1336 if ( !w.document ) { 1337 throw new Error( "jQuery requires a window with a document" ); 1338 } 1339 return factory( w ); 1340 }; 1341 } else { 1342 factory( global ); 1343 } 1344 1345 // Pass this if window is not defined yet 1346 }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { 1347 1348 // Support: Firefox 18+ 1349 // Can't be in strict mode, several libs including ASP.NET trace 1350 // the stack via arguments.caller.callee and Firefox dies if
vendor: 4,218 bytes, lines 1351-1530
1351 // you try to trace through "use strict" call chains. (#13335) 1352 //"use strict"; 1353 var deletedIds = []; 1354 1355 var document = window.document; 1356 1357 var slice = deletedIds.slice; 1358 1359 var concat = deletedIds.concat; 1360 1361 var push = deletedIds.push; 1362 1363 var indexOf = deletedIds.indexOf; 1364 1365 var class2type = {}; 1366 1367 var toString = class2type.toString; 1368 1369 var hasOwn = class2type.hasOwnProperty; 1370 1371 var support = {}; 1372 1373 1374 1375 var 1376 version = "1.12.4", 1377 1378 // Define a local copy of jQuery 1379 jQuery = function( selector, context ) { 1380 1381 // The jQuery object is actually just the init constructor 'enhanced' 1382 // Need init if jQuery is called (just allow error to be thrown if not included) 1383 return new jQuery.fn.init( selector, context ); 1384 }, 1385 1386 // Support: Android<4.1, IE<9 1387 // Make sure we trim BOM and NBSP 1388 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, 1389 1390 // Matches dashed string for camelizing 1391 rmsPrefix = /^-ms-/, 1392 rdashAlpha = /-([\da-z])/gi, 1393 1394 // Used by jQuery.camelCase as callback to replace() 1395 fcamelCase = function( all, letter ) { 1396 return letter.toUpperCase(); 1397 }; 1398 1399 jQuery.fn = jQuery.prototype = { 1400 1401 // The current version of jQuery being used 1402 jquery: version, 1403 1404 constructor: jQuery, 1405 1406 // Start with an empty selector 1407 selector: "", 1408 1409 // The default length of a jQuery object is 0 1410 length: 0, 1411 1412 toArray: function() { 1413 return slice.call( this ); 1414 }, 1415 1416 // Get the Nth element in the matched element set OR 1417 // Get the whole matched element set as a clean array 1418 get: function( num ) { 1419 return num != null ? 1420 1421 // Return just the one element from the set 1422 ( num < 0 ? this[ num + this.length ] : this[ num ] ) : 1423 1424 // Return all the elements in a clean array 1425 slice.call( this ); 1426 }, 1427 1428 // Take an array of elements and push it onto the stack 1429 // (returning the new matched element set) 1430 pushStack: function( elems ) { 1431 1432 // Build a new jQuery matched element set 1433 var ret = jQuery.merge( this.constructor(), elems ); 1434 1435 // Add the old object onto the stack (as a reference) 1436 ret.prevObject = this; 1437 ret.context = this.context; 1438 1439 // Return the newly-formed element set 1440 return ret; 1441 }, 1442 1443 // Execute a callback for every element in the matched set. 1444 each: function( callback ) { 1445 return jQuery.each( this, callback ); 1446 }, 1447 1448 map: function( callback ) { 1449 return this.pushStack( jQuery.map( this, function( elem, i ) { 1450 return callback.call( elem, i, elem ); 1451 } ) ); 1452 }, 1453 1454 slice: function() { 1455 return this.pushStack( slice.apply( this, arguments ) ); 1456 }, 1457 1458 first: function() { 1459 return this.eq( 0 ); 1460 }, 1461 1462 last: function() { 1463 return this.eq( -1 ); 1464 }, 1465 1466 eq: function( i ) { 1467 var len = this.length, 1468 j = +i + ( i < 0 ? len : 0 ); 1469 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); 1470 }, 1471 1472 end: function() { 1473 return this.prevObject || this.constructor(); 1474 }, 1475 1476 // For internal use only. 1477 // Behaves like an Array's method, not like a jQuery method. 1478 push: push, 1479 sort: deletedIds.sort, 1480 splice: deletedIds.splice 1481 }; 1482 1483 jQuery.extend = jQuery.fn.extend = function() { 1484 var src, copyIsArray, copy, name, options, clone, 1485 target = arguments[ 0 ] || {}, 1486 i = 1, 1487 length = arguments.length, 1488 deep = false; 1489 1490 // Handle a deep copy situation 1491 if ( typeof target === "boolean" ) { 1492 deep = target; 1493 1494 // skip the boolean and the target 1495 target = arguments[ i ] || {}; 1496 i++; 1497 } 1498 1499 // Handle case when target is a string or something (possible in deep copy) 1500 if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { 1501 target = {}; 1502 } 1503 1504 // extend jQuery itself if only one argument is passed 1505 if ( i === length ) { 1506 target = this; 1507 i--; 1508 } 1509 1510 for ( ; i < length; i++ ) { 1511 1512 // Only deal with non-null/undefined values 1513 if ( ( options = arguments[ i ] ) != null ) { 1514 1515 // Extend the base object 1516 for ( name in options ) { 1517 src = target[ name ]; 1518 copy = options[ name ]; 1519 1520 // Prevent never-ending loop 1521 if ( target === copy ) { 1522 continue; 1523 } 1524 1525 // Recurse if we're merging plain objects or arrays 1526 if ( deep && copy && ( jQuery.isPlainObject( copy ) || 1527 ( copyIsArray = jQuery.isArray( copy ) ) ) ) { 1528 1529 if ( copyIsArray ) { 1530 copyIsArray = false;
vendor: 8,449 bytes, lines 1531-1872
1531 clone = src && jQuery.isArray( src ) ? src : []; 1532 1533 } else { 1534 clone = src && jQuery.isPlainObject( src ) ? src : {}; 1535 } 1536 1537 // Never move original objects, clone them 1538 target[ name ] = jQuery.extend( deep, clone, copy ); 1539 1540 // Don't bring in undefined values 1541 } else if ( copy !== undefined ) { 1542 target[ name ] = copy; 1543 } 1544 } 1545 } 1546 } 1547 1548 // Return the modified object 1549 return target; 1550 }; 1551 1552 jQuery.extend( { 1553 1554 // Unique for each copy of jQuery on the page 1555 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), 1556 1557 // Assume jQuery is ready without the ready module 1558 isReady: true, 1559 1560 error: function( msg ) { 1561 throw new Error( msg ); 1562 }, 1563 1564 noop: function() {}, 1565 1566 // See test/unit/core.js for details concerning isFunction. 1567 // Since version 1.3, DOM methods and functions like alert 1568 // aren't supported. They return false on IE (#2968). 1569 isFunction: function( obj ) { 1570 return jQuery.type( obj ) === "function"; 1571 }, 1572 1573 isArray: Array.isArray || function( obj ) { 1574 return jQuery.type( obj ) === "array"; 1575 }, 1576 1577 isWindow: function( obj ) { 1578 /* jshint eqeqeq: false */ 1579 return obj != null && obj == obj.window; 1580 }, 1581 1582 isNumeric: function( obj ) { 1583 1584 // parseFloat NaNs numeric-cast false positives (null|true|false|"") 1585 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 1586 // subtraction forces infinities to NaN 1587 // adding 1 corrects loss of precision from parseFloat (#15100) 1588 var realStringObj = obj && obj.toString(); 1589 return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0; 1590 }, 1591 1592 isEmptyObject: function( obj ) { 1593 var name; 1594 for ( name in obj ) { 1595 return false; 1596 } 1597 return true; 1598 }, 1599 1600 isPlainObject: function( obj ) { 1601 var key; 1602 1603 // Must be an Object. 1604 // Because of IE, we also have to check the presence of the constructor property. 1605 // Make sure that DOM nodes and window objects don't pass through, as well 1606 if ( !obj || jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { 1607 return false; 1608 } 1609 1610 try { 1611 1612 // Not own constructor property must be Object 1613 if ( obj.constructor && 1614 !hasOwn.call( obj, "constructor" ) && 1615 !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) { 1616 return false; 1617 } 1618 } catch ( e ) { 1619 1620 // IE8,9 Will throw exceptions on certain host objects #9897 1621 return false; 1622 } 1623 1624 // Support: IE<9 1625 // Handle iteration over inherited properties before own properties. 1626 if ( !support.ownFirst ) { 1627 for ( key in obj ) { 1628 return hasOwn.call( obj, key ); 1629 } 1630 } 1631 1632 // Own properties are enumerated firstly, so to speed up, 1633 // if last one is own, then all properties are own. 1634 for ( key in obj ) {} 1635 1636 return key === undefined || hasOwn.call( obj, key ); 1637 }, 1638 1639 type: function( obj ) { 1640 if ( obj == null ) { 1641 return obj + ""; 1642 } 1643 return typeof obj === "object" || typeof obj === "function" ? 1644 class2type[ toString.call( obj ) ] || "object" : 1645 typeof obj; 1646 }, 1647 1648 // Workarounds based on findings by Jim Driscoll 1649 // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context 1650 globalEval: function( data ) { 1651 if ( data && jQuery.trim( data ) ) { 1652 1653 // We use execScript on Internet Explorer 1654 // We use an anonymous function so that context is window 1655 // rather than jQuery in Firefox 1656 ( window.execScript || function( data ) { 1657 window[ "eval" ].call( window, data ); // jscs:ignore requireDotNotation 1658 } )( data ); 1659 } 1660 }, 1661 1662 // Convert dashed to camelCase; used by the css and data modules 1663 // Microsoft forgot to hump their vendor prefix (#9572) 1664 camelCase: function( string ) { 1665 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 1666 }, 1667 1668 nodeName: function( elem, name ) { 1669 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 1670 }, 1671 1672 each: function( obj, callback ) { 1673 var length, i = 0; 1674 1675 if ( isArrayLike( obj ) ) { 1676 length = obj.length; 1677 for ( ; i < length; i++ ) { 1678 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 1679 break; 1680 } 1681 } 1682 } else { 1683 for ( i in obj ) { 1684 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 1685 break; 1686 } 1687 } 1688 } 1689 1690 return obj; 1691 }, 1692 1693 // Support: Android<4.1, IE<9 1694 trim: function( text ) { 1695 return text == null ? 1696 "" : 1697 ( text + "" ).replace( rtrim, "" ); 1698 }, 1699 1700 // results is for internal usage only 1701 makeArray: function( arr, results ) { 1702 var ret = results || []; 1703 1704 if ( arr != null ) { 1705 if ( isArrayLike( Object( arr ) ) ) { 1706 jQuery.merge( ret, 1707 typeof arr === "string" ? 1708 [ arr ] : arr 1709 ); 1710 } else { 1711 push.call( ret, arr ); 1712 } 1713 } 1714 1715 return ret; 1716 }, 1717 1718 inArray: function( elem, arr, i ) { 1719 var len; 1720 1721 if ( arr ) { 1722 if ( indexOf ) { 1723 return indexOf.call( arr, elem, i ); 1724 } 1725 1726 len = arr.length; 1727 i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; 1728 1729 for ( ; i < len; i++ ) { 1730 1731 // Skip accessing in sparse arrays 1732 if ( i in arr && arr[ i ] === elem ) { 1733 return i; 1734 } 1735 } 1736 } 1737 1738 return -1; 1739 }, 1740 1741 merge: function( first, second ) { 1742 var len = +second.length, 1743 j = 0, 1744 i = first.length; 1745 1746 while ( j < len ) { 1747 first[ i++ ] = second[ j++ ]; 1748 } 1749 1750 // Support: IE<9 1751 // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) 1752 if ( len !== len ) { 1753 while ( second[ j ] !== undefined ) { 1754 first[ i++ ] = second[ j++ ]; 1755 } 1756 } 1757 1758 first.length = i; 1759 1760 return first; 1761 }, 1762 1763 grep: function( elems, callback, invert ) { 1764 var callbackInverse, 1765 matches = [], 1766 i = 0, 1767 length = elems.length, 1768 callbackExpect = !invert; 1769 1770 // Go through the array, only saving the items 1771 // that pass the validator function 1772 for ( ; i < length; i++ ) { 1773 callbackInverse = !callback( elems[ i ], i ); 1774 if ( callbackInverse !== callbackExpect ) { 1775 matches.push( elems[ i ] ); 1776 } 1777 } 1778 1779 return matches; 1780 }, 1781 1782 // arg is for internal usage only 1783 map: function( elems, callback, arg ) { 1784 var length, value, 1785 i = 0, 1786 ret = []; 1787 1788 // Go through the array, translating each of the items to their new values 1789 if ( isArrayLike( elems ) ) { 1790 length = elems.length; 1791 for ( ; i < length; i++ ) { 1792 value = callback( elems[ i ], i, arg ); 1793 1794 if ( value != null ) { 1795 ret.push( value ); 1796 } 1797 } 1798 1799 // Go through every key on the object, 1800 } else { 1801 for ( i in elems ) { 1802 value = callback( elems[ i ], i, arg ); 1803 1804 if ( value != null ) { 1805 ret.push( value ); 1806 } 1807 } 1808 } 1809 1810 // Flatten any nested arrays 1811 return concat.apply( [], ret ); 1812 }, 1813 1814 // A global GUID counter for objects 1815 guid: 1, 1816 1817 // Bind a function to a context, optionally partially applying any 1818 // arguments. 1819 proxy: function( fn, context ) { 1820 var args, proxy, tmp; 1821 1822 if ( typeof context === "string" ) { 1823 tmp = fn[ context ]; 1824 context = fn; 1825 fn = tmp; 1826 } 1827 1828 // Quick check to determine if target is callable, in the spec 1829 // this throws a TypeError, but we will just return undefined. 1830 if ( !jQuery.isFunction( fn ) ) { 1831 return undefined; 1832 } 1833 1834 // Simulated bind 1835 args = slice.call( arguments, 2 ); 1836 proxy = function() { 1837 return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); 1838 }; 1839 1840 // Set the guid of unique handler to the same of original handler, so it can be removed 1841 proxy.guid = fn.guid = fn.guid || jQuery.guid++; 1842 1843 return proxy; 1844 }, 1845 1846 now: function() { 1847 return +( new Date() ); 1848 }, 1849 1850 // jQuery.support is not used in Core but other projects attach their 1851 // properties to it so it needs to exist. 1852 support: support 1853 } ); 1854 1855 // JSHint would error on this code due to the Symbol not being defined in ES5. 1856 // Defining this global in .jshintrc would create a danger of using the global 1857 // unguarded in another place, it seems safer to just disable JSHint for these 1858 // three lines. 1859 /* jshint ignore: start */ 1860 if ( typeof Symbol === "function" ) { 1861 jQuery.fn[ Symbol.iterator ] = deletedIds[ Symbol.iterator ]; 1862 } 1863 /* jshint ignore: end */ 1864 1865 // Populate the class2type map 1866 jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), 1867 function( i, name ) { 1868 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 1869 } ); 1870 1871 function isArrayLike( obj ) { 1872
vendor: 19,481 bytes, lines 1873-2534
1873 // Support: iOS 8.2 (not reproducible in simulator) 1874 // `in` check used to prevent JIT error (gh-2145) 1875 // hasOwn isn't used here due to false negatives 1876 // regarding Nodelist length in IE 1877 var length = !!obj && "length" in obj && obj.length, 1878 type = jQuery.type( obj ); 1879 1880 if ( type === "function" || jQuery.isWindow( obj ) ) { 1881 return false; 1882 } 1883 1884 return type === "array" || length === 0 || 1885 typeof length === "number" && length > 0 && ( length - 1 ) in obj; 1886 } 1887 var Sizzle = 1888 /*! 1889 * Sizzle CSS Selector Engine v2.2.1 1890 * http://sizzlejs.com/ 1891 * 1892 * Copyright jQuery Foundation and other contributors 1893 * Released under the MIT license 1894 * http://jquery.org/license 1895 * 1896 * Date: 2015-10-17 1897 */ 1898 (function( window ) { 1899 1900 var i, 1901 support, 1902 Expr, 1903 getText, 1904 isXML, 1905 tokenize, 1906 compile, 1907 select, 1908 outermostContext, 1909 sortInput, 1910 hasDuplicate, 1911 1912 // Local document vars 1913 setDocument, 1914 document, 1915 docElem, 1916 documentIsHTML, 1917 rbuggyQSA, 1918 rbuggyMatches, 1919 matches, 1920 contains, 1921 1922 // Instance-specific data 1923 expando = "sizzle" + 1 * new Date(), 1924 preferredDoc = window.document, 1925 dirruns = 0, 1926 done = 0, 1927 classCache = createCache(), 1928 tokenCache = createCache(), 1929 compilerCache = createCache(), 1930 sortOrder = function( a, b ) { 1931 if ( a === b ) { 1932 hasDuplicate = true; 1933 } 1934 return 0; 1935 }, 1936 1937 // General-purpose constants 1938 MAX_NEGATIVE = 1 << 31, 1939 1940 // Instance methods 1941 hasOwn = ({}).hasOwnProperty, 1942 arr = [], 1943 pop = arr.pop, 1944 push_native = arr.push, 1945 push = arr.push, 1946 slice = arr.slice, 1947 // Use a stripped-down indexOf as it's faster than native 1948 // http://jsperf.com/thor-indexof-vs-for/5 1949 indexOf = function( list, elem ) { 1950 var i = 0, 1951 len = list.length; 1952 for ( ; i < len; i++ ) { 1953 if ( list[i] === elem ) { 1954 return i; 1955 } 1956 } 1957 return -1; 1958 }, 1959 1960 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", 1961 1962 // Regular expressions 1963 1964 // http://www.w3.org/TR/css3-selectors/#whitespace 1965 whitespace = "[\\x20\\t\\r\\n\\f]", 1966 1967 // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier 1968 identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", 1969 1970 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors 1971 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + 1972 // Operator (capture 2) 1973 "*([*^$|!~]?=)" + whitespace + 1974 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" 1975 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + 1976 "*\\]", 1977 1978 pseudos = ":(" + identifier + ")(?:\\((" + 1979 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: 1980 // 1. quoted (capture 3; capture 4 or capture 5) 1981 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + 1982 // 2. simple (capture 6) 1983 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + 1984 // 3. anything else (capture 2) 1985 ".*" + 1986 ")\\)|)", 1987 1988 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 1989 rwhitespace = new RegExp( whitespace + "+", "g" ), 1990 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), 1991 1992 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), 1993 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), 1994 1995 rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), 1996 1997 rpseudo = new RegExp( pseudos ), 1998 ridentifier = new RegExp( "^" + identifier + "$" ), 1999 2000 matchExpr = { 2001 "ID": new RegExp( "^#(" + identifier + ")" ), 2002 "CLASS": new RegExp( "^\\.(" + identifier + ")" ), 2003 "TAG": new RegExp( "^(" + identifier + "|[*])" ), 2004 "ATTR": new RegExp( "^" + attributes ), 2005 "PSEUDO": new RegExp( "^" + pseudos ), 2006 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + 2007 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + 2008 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), 2009 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), 2010 // For use in libraries implementing .is() 2011 // We use this for POS matching in `select` 2012 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + 2013 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) 2014 }, 2015 2016 rinputs = /^(?:input|select|textarea|button)$/i, 2017 rheader = /^h\d$/i, 2018 2019 rnative = /^[^{]+\{\s*\[native \w/, 2020 2021 // Easily-parseable/retrievable ID or TAG or CLASS selectors 2022 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 2023 2024 rsibling = /[+~]/, 2025 rescape = /'|\\/g, 2026 2027 // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters 2028 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), 2029 funescape = function( _, escaped, escapedWhitespace ) { 2030 var high = "0x" + escaped - 0x10000; 2031 // NaN means non-codepoint 2032 // Support: Firefox<24 2033 // Workaround erroneous numeric interpretation of +"0x" 2034 return high !== high || escapedWhitespace ? 2035 escaped : 2036 high < 0 ? 2037 // BMP codepoint 2038 String.fromCharCode( high + 0x10000 ) : 2039 // Supplemental Plane codepoint (surrogate pair) 2040 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 2041 }, 2042 2043 // Used for iframes 2044 // See setDocument() 2045 // Removing the function wrapper causes a "Permission Denied" 2046 // error in IE 2047 unloadHandler = function() { 2048 setDocument(); 2049 }; 2050 2051 // Optimize for push.apply( _, NodeList ) 2052 try { 2053 push.apply( 2054 (arr = slice.call( preferredDoc.childNodes )), 2055 preferredDoc.childNodes 2056 ); 2057 // Support: Android<4.0 2058 // Detect silently failing push.apply 2059 arr[ preferredDoc.childNodes.length ].nodeType; 2060 } catch ( e ) { 2061 push = { apply: arr.length ? 2062 2063 // Leverage slice if possible 2064 function( target, els ) { 2065 push_native.apply( target, slice.call(els) ); 2066 } : 2067 2068 // Support: IE<9 2069 // Otherwise append directly 2070 function( target, els ) { 2071 var j = target.length, 2072 i = 0; 2073 // Can't trust NodeList.length 2074 while ( (target[j++] = els[i++]) ) {} 2075 target.length = j - 1; 2076 } 2077 }; 2078 } 2079 2080 function Sizzle( selector, context, results, seed ) { 2081 var m, i, elem, nid, nidselect, match, groups, newSelector, 2082 newContext = context && context.ownerDocument, 2083 2084 // nodeType defaults to 9, since context defaults to document 2085 nodeType = context ? context.nodeType : 9; 2086 2087 results = results || []; 2088 2089 // Return early from calls with invalid selector or context 2090 if ( typeof selector !== "string" || !selector || 2091 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { 2092 2093 return results; 2094 } 2095 2096 // Try to shortcut find operations (as opposed to filters) in HTML documents 2097 if ( !seed ) { 2098 2099 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { 2100 setDocument( context ); 2101 } 2102 context = context || document; 2103 2104 if ( documentIsHTML ) { 2105 2106 // If the selector is sufficiently simple, try using a "get*By*" DOM method 2107 // (excepting DocumentFragment context, where the methods don't exist) 2108 if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { 2109 2110 // ID selector 2111 if ( (m = match[1]) ) { 2112 2113 // Document context 2114 if ( nodeType === 9 ) { 2115 if ( (elem = context.getElementById( m )) ) { 2116 2117 // Support: IE, Opera, Webkit 2118 // TODO: identify versions 2119 // getElementById can match elements by name instead of ID 2120 if ( elem.id === m ) { 2121 results.push( elem ); 2122 return results; 2123 } 2124 } else { 2125 return results; 2126 } 2127 2128 // Element context 2129 } else { 2130 2131 // Support: IE, Opera, Webkit 2132 // TODO: identify versions 2133 // getElementById can match elements by name instead of ID 2134 if ( newContext && (elem = newContext.getElementById( m )) && 2135 contains( context, elem ) && 2136 elem.id === m ) { 2137 2138 results.push( elem ); 2139 return results; 2140 } 2141 } 2142 2143 // Type selector 2144 } else if ( match[2] ) { 2145 push.apply( results, context.getElementsByTagName( selector ) ); 2146 return results; 2147 2148 // Class selector 2149 } else if ( (m = match[3]) && support.getElementsByClassName && 2150 context.getElementsByClassName ) { 2151 2152 push.apply( results, context.getElementsByClassName( m ) ); 2153 return results; 2154 } 2155 } 2156 2157 // Take advantage of querySelectorAll 2158 if ( support.qsa && 2159 !compilerCache[ selector + " " ] && 2160 (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { 2161 2162 if ( nodeType !== 1 ) { 2163 newContext = context; 2164 newSelector = selector; 2165 2166 // qSA looks outside Element context, which is not what we want 2167 // Thanks to Andrew Dupont for this workaround technique 2168 // Support: IE <=8 2169 // Exclude object elements 2170 } else if ( context.nodeName.toLowerCase() !== "object" ) { 2171 2172 // Capture the context ID, setting it first if necessary 2173 if ( (nid = context.getAttribute( "id" )) ) { 2174 nid = nid.replace( rescape, "\\$&" ); 2175 } else { 2176 context.setAttribute( "id", (nid = expando) ); 2177 } 2178 2179 // Prefix every selector in the list 2180 groups = tokenize( selector ); 2181 i = groups.length; 2182 nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']"; 2183 while ( i-- ) { 2184 groups[i] = nidselect + " " + toSelector( groups[i] ); 2185 } 2186 newSelector = groups.join( "," ); 2187 2188 // Expand context for sibling selectors 2189 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || 2190 context; 2191 } 2192 2193 if ( newSelector ) { 2194 try { 2195 push.apply( results, 2196 newContext.querySelectorAll( newSelector ) 2197 ); 2198 return results; 2199 } catch ( qsaError ) { 2200 } finally { 2201 if ( nid === expando ) { 2202 context.removeAttribute( "id" ); 2203 } 2204 } 2205 } 2206 } 2207 } 2208 } 2209 2210 // All others 2211 return select( selector.replace( rtrim, "$1" ), context, results, seed ); 2212 } 2213 2214 /** 2215 * Create key-value caches of limited size 2216 * @returns {function(string, object)} Returns the Object data after storing it on itself with 2217 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 2218 * deleting the oldest entry 2219 */ 2220 function createCache() { 2221 var keys = []; 2222 2223 function cache( key, value ) { 2224 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) 2225 if ( keys.push( key + " " ) > Expr.cacheLength ) { 2226 // Only keep the most recent entries 2227 delete cache[ keys.shift() ]; 2228 } 2229 return (cache[ key + " " ] = value); 2230 } 2231 return cache; 2232 } 2233 2234 /** 2235 * Mark a function for special use by Sizzle 2236 * @param {Function} fn The function to mark 2237 */ 2238 function markFunction( fn ) { 2239 fn[ expando ] = true; 2240 return fn; 2241 } 2242 2243 /** 2244 * Support testing using an element 2245 * @param {Function} fn Passed the created div and expects a boolean result 2246 */ 2247 function assert( fn ) { 2248 var div = document.createElement("div"); 2249 2250 try { 2251 return !!fn( div ); 2252 } catch (e) { 2253 return false; 2254 } finally { 2255 // Remove from its parent by default 2256 if ( div.parentNode ) { 2257 div.parentNode.removeChild( div ); 2258 } 2259 // release memory in IE 2260 div = null; 2261 } 2262 } 2263 2264 /** 2265 * Adds the same handler for all of the specified attrs 2266 * @param {String} attrs Pipe-separated list of attributes 2267 * @param {Function} handler The method that will be applied 2268 */ 2269 function addHandle( attrs, handler ) { 2270 var arr = attrs.split("|"), 2271 i = arr.length; 2272 2273 while ( i-- ) { 2274 Expr.attrHandle[ arr[i] ] = handler; 2275 } 2276 } 2277 2278 /** 2279 * Checks document order of two siblings 2280 * @param {Element} a 2281 * @param {Element} b 2282 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b 2283 */ 2284 function siblingCheck( a, b ) { 2285 var cur = b && a, 2286 diff = cur && a.nodeType === 1 && b.nodeType === 1 && 2287 ( ~b.sourceIndex || MAX_NEGATIVE ) - 2288 ( ~a.sourceIndex || MAX_NEGATIVE ); 2289 2290 // Use IE sourceIndex if available on both nodes 2291 if ( diff ) { 2292 return diff; 2293 } 2294 2295 // Check if b follows a 2296 if ( cur ) { 2297 while ( (cur = cur.nextSibling) ) { 2298 if ( cur === b ) { 2299 return -1; 2300 } 2301 } 2302 } 2303 2304 return a ? 1 : -1; 2305 } 2306 2307 /** 2308 * Returns a function to use in pseudos for input types 2309 * @param {String} type 2310 */ 2311 function createInputPseudo( type ) { 2312 return function( elem ) { 2313 var name = elem.nodeName.toLowerCase(); 2314 return name === "input" && elem.type === type; 2315 }; 2316 } 2317 2318 /** 2319 * Returns a function to use in pseudos for buttons 2320 * @param {String} type 2321 */ 2322 function createButtonPseudo( type ) { 2323 return function( elem ) { 2324 var name = elem.nodeName.toLowerCase(); 2325 return (name === "input" || name === "button") && elem.type === type; 2326 }; 2327 } 2328 2329 /** 2330 * Returns a function to use in pseudos for positionals 2331 * @param {Function} fn 2332 */ 2333 function createPositionalPseudo( fn ) { 2334 return markFunction(function( argument ) { 2335 argument = +argument; 2336 return markFunction(function( seed, matches ) { 2337 var j, 2338 matchIndexes = fn( [], seed.length, argument ), 2339 i = matchIndexes.length; 2340 2341 // Match elements found at the specified indexes 2342 while ( i-- ) { 2343 if ( seed[ (j = matchIndexes[i]) ] ) { 2344 seed[j] = !(matches[j] = seed[j]); 2345 } 2346 } 2347 }); 2348 }); 2349 } 2350 2351 /** 2352 * Checks a node for validity as a Sizzle context 2353 * @param {Element|Object=} context 2354 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value 2355 */ 2356 function testContext( context ) { 2357 return context && typeof context.getElementsByTagName !== "undefined" && context; 2358 } 2359 2360 // Expose support vars for convenience 2361 support = Sizzle.support = {}; 2362 2363 /** 2364 * Detects XML nodes 2365 * @param {Element|Object} elem An element or a document 2366 * @returns {Boolean} True iff elem is a non-HTML XML node 2367 */ 2368 isXML = Sizzle.isXML = function( elem ) { 2369 // documentElement is verified for cases where it doesn't yet exist 2370 // (such as loading iframes in IE - #4833) 2371 var documentElement = elem && (elem.ownerDocument || elem).documentElement; 2372 return documentElement ? documentElement.nodeName !== "HTML" : false; 2373 }; 2374 2375 /** 2376 * Sets document-related variables once based on the current document 2377 * @param {Element|Object} [doc] An element or document object to use to set the document 2378 * @returns {Object} Returns the current document 2379 */ 2380 setDocument = Sizzle.setDocument = function( node ) { 2381 var hasCompare, parent, 2382 doc = node ? node.ownerDocument || node : preferredDoc; 2383 2384 // Return early if doc is invalid or already selected 2385 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { 2386 return document; 2387 } 2388 2389 // Update global variables 2390 document = doc; 2391 docElem = document.documentElement; 2392 documentIsHTML = !isXML( document ); 2393 2394 // Support: IE 9-11, Edge 2395 // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) 2396 if ( (parent = document.defaultView) && parent.top !== parent ) { 2397 // Support: IE 11 2398 if ( parent.addEventListener ) { 2399 parent.addEventListener( "unload", unloadHandler, false ); 2400 2401 // Support: IE 9 - 10 only 2402 } else if ( parent.attachEvent ) { 2403 parent.attachEvent( "onunload", unloadHandler ); 2404 } 2405 } 2406 2407 /* Attributes 2408 ---------------------------------------------------------------------- */ 2409 2410 // Support: IE<8 2411 // Verify that getAttribute really returns attributes and not properties 2412 // (excepting IE8 booleans) 2413 support.attributes = assert(function( div ) { 2414 div.className = "i"; 2415 return !div.getAttribute("className"); 2416 }); 2417 2418 /* getElement(s)By* 2419 ---------------------------------------------------------------------- */ 2420 2421 // Check if getElementsByTagName("*") returns only elements 2422 support.getElementsByTagName = assert(function( div ) { 2423 div.appendChild( document.createComment("") ); 2424 return !div.getElementsByTagName("*").length; 2425 }); 2426 2427 // Support: IE<9 2428 support.getElementsByClassName = rnative.test( document.getElementsByClassName ); 2429 2430 // Support: IE<10 2431 // Check if getElementById returns elements by name 2432 // The broken getElementById methods don't pick up programatically-set names, 2433 // so use a roundabout getElementsByName test 2434 support.getById = assert(function( div ) { 2435 docElem.appendChild( div ).id = expando; 2436 return !document.getElementsByName || !document.getElementsByName( expando ).length; 2437 }); 2438 2439 // ID find and filter 2440 if ( support.getById ) { 2441 Expr.find["ID"] = function( id, context ) { 2442 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 2443 var m = context.getElementById( id ); 2444 return m ? [ m ] : []; 2445 } 2446 }; 2447 Expr.filter["ID"] = function( id ) { 2448 var attrId = id.replace( runescape, funescape ); 2449 return function( elem ) { 2450 return elem.getAttribute("id") === attrId; 2451 }; 2452 }; 2453 } else { 2454 // Support: IE6/7 2455 // getElementById is not reliable as a find shortcut 2456 delete Expr.find["ID"]; 2457 2458 Expr.filter["ID"] = function( id ) { 2459 var attrId = id.replace( runescape, funescape ); 2460 return function( elem ) { 2461 var node = typeof elem.getAttributeNode !== "undefined" && 2462 elem.getAttributeNode("id"); 2463 return node && node.value === attrId; 2464 }; 2465 }; 2466 } 2467 2468 // Tag 2469 Expr.find["TAG"] = support.getElementsByTagName ? 2470 function( tag, context ) { 2471 if ( typeof context.getElementsByTagName !== "undefined" ) { 2472 return context.getElementsByTagName( tag ); 2473 2474 // DocumentFragment nodes don't have gEBTN 2475 } else if ( support.qsa ) { 2476 return context.querySelectorAll( tag ); 2477 } 2478 } : 2479 2480 function( tag, context ) { 2481 var elem, 2482 tmp = [], 2483 i = 0, 2484 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too 2485 results = context.getElementsByTagName( tag ); 2486 2487 // Filter out possible comments 2488 if ( tag === "*" ) { 2489 while ( (elem = results[i++]) ) { 2490 if ( elem.nodeType === 1 ) { 2491 tmp.push( elem ); 2492 } 2493 } 2494 2495 return tmp; 2496 } 2497 return results; 2498 }; 2499 2500 // Class 2501 Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { 2502 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { 2503 return context.getElementsByClassName( className ); 2504 } 2505 }; 2506 2507 /* QSA/matchesSelector 2508 ---------------------------------------------------------------------- */ 2509 2510 // QSA and matchesSelector support 2511 2512 // matchesSelector(:active) reports false when true (IE9/Opera 11.5) 2513 rbuggyMatches = []; 2514 2515 // qSa(:focus) reports false when true (Chrome 21) 2516 // We allow this because of a bug in IE8/9 that throws an error 2517 // whenever `document.activeElement` is accessed on an iframe 2518 // So, we allow :focus to pass through QSA all the time to avoid the IE error 2519 // See http://bugs.jquery.com/ticket/13378 2520 rbuggyQSA = []; 2521 2522 if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { 2523 // Build QSA regex 2524 // Regex strategy adopted from Diego Perini 2525 assert(function( div ) { 2526 // Select is set to empty string on purpose 2527 // This is to test IE's treatment of not explicitly 2528 // setting a boolean content attribute, 2529 // since its presence should be enough 2530 // http://bugs.jquery.com/ticket/12359 2531 docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" + 2532 "<select id='" + expando + "-\r\\' msallowcapture=''>" + 2533 "<option selected=''></option></select>"; 2534
vendor: 4,310 bytes, lines 2535-2662
2535 // Support: IE8, Opera 11-12.16 2536 // Nothing should be selected when empty strings follow ^= or $= or *= 2537 // The test attribute must be unknown in Opera but "safe" for WinRT 2538 // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section 2539 if ( div.querySelectorAll("[msallowcapture^='']").length ) { 2540 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); 2541 } 2542 2543 // Support: IE8 2544 // Boolean attributes and "value" are not treated correctly 2545 if ( !div.querySelectorAll("[selected]").length ) { 2546 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); 2547 } 2548 2549 // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ 2550 if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { 2551 rbuggyQSA.push("~="); 2552 } 2553 2554 // Webkit/Opera - :checked should return selected option elements 2555 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 2556 // IE8 throws error here and will not see later tests 2557 if ( !div.querySelectorAll(":checked").length ) { 2558 rbuggyQSA.push(":checked"); 2559 } 2560 2561 // Support: Safari 8+, iOS 8+ 2562 // https://bugs.webkit.org/show_bug.cgi?id=136851 2563 // In-page `selector#id sibing-combinator selector` fails 2564 if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) { 2565 rbuggyQSA.push(".#.+[+~]"); 2566 } 2567 }); 2568 2569 assert(function( div ) { 2570 // Support: Windows 8 Native Apps 2571 // The type and name attributes are restricted during .innerHTML assignment 2572 var input = document.createElement("input"); 2573 input.setAttribute( "type", "hidden" ); 2574 div.appendChild( input ).setAttribute( "name", "D" ); 2575 2576 // Support: IE8 2577 // Enforce case-sensitivity of name attribute 2578 if ( div.querySelectorAll("[name=d]").length ) { 2579 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); 2580 } 2581 2582 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) 2583 // IE8 throws error here and will not see later tests 2584 if ( !div.querySelectorAll(":enabled").length ) { 2585 rbuggyQSA.push( ":enabled", ":disabled" ); 2586 } 2587 2588 // Opera 10-11 does not throw on post-comma invalid pseudos 2589 div.querySelectorAll("*,:x"); 2590 rbuggyQSA.push(",.*:"); 2591 }); 2592 } 2593 2594 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || 2595 docElem.webkitMatchesSelector || 2596 docElem.mozMatchesSelector || 2597 docElem.oMatchesSelector || 2598 docElem.msMatchesSelector) )) ) { 2599 2600 assert(function( div ) { 2601 // Check to see if it's possible to do matchesSelector 2602 // on a disconnected node (IE 9) 2603 support.disconnectedMatch = matches.call( div, "div" ); 2604 2605 // This should fail with an exception 2606 // Gecko does not error, returns false instead 2607 matches.call( div, "[s!='']:x" ); 2608 rbuggyMatches.push( "!=", pseudos ); 2609 }); 2610 } 2611 2612 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); 2613 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); 2614 2615 /* Contains 2616 ---------------------------------------------------------------------- */ 2617 hasCompare = rnative.test( docElem.compareDocumentPosition ); 2618 2619 // Element contains another 2620 // Purposefully self-exclusive 2621 // As in, an element does not contain itself 2622 contains = hasCompare || rnative.test( docElem.contains ) ? 2623 function( a, b ) { 2624 var adown = a.nodeType === 9 ? a.documentElement : a, 2625 bup = b && b.parentNode; 2626 return a === bup || !!( bup && bup.nodeType === 1 && ( 2627 adown.contains ? 2628 adown.contains( bup ) : 2629 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 2630 )); 2631 } : 2632 function( a, b ) { 2633 if ( b ) { 2634 while ( (b = b.parentNode) ) { 2635 if ( b === a ) { 2636 return true; 2637 } 2638 } 2639 } 2640 return false; 2641 }; 2642 2643 /* Sorting 2644 ---------------------------------------------------------------------- */ 2645 2646 // Document order sorting 2647 sortOrder = hasCompare ? 2648 function( a, b ) { 2649 2650 // Flag for duplicate removal 2651 if ( a === b ) { 2652 hasDuplicate = true; 2653 return 0; 2654 } 2655 2656 // Sort on method existence if only one input has compareDocumentPosition 2657 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 2658 if ( compare ) { 2659 return compare; 2660 } 2661 2662 // Calculate position if both inputs belong to the same document
vendor: 17,277 bytes, lines 2663-3257
2663 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? 2664 a.compareDocumentPosition( b ) : 2665 2666 // Otherwise we know they are disconnected 2667 1; 2668 2669 // Disconnected nodes 2670 if ( compare & 1 || 2671 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { 2672 2673 // Choose the first element that is related to our preferred document 2674 if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { 2675 return -1; 2676 } 2677 if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { 2678 return 1; 2679 } 2680 2681 // Maintain original order 2682 return sortInput ? 2683 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 2684 0; 2685 } 2686 2687 return compare & 4 ? -1 : 1; 2688 } : 2689 function( a, b ) { 2690 // Exit early if the nodes are identical 2691 if ( a === b ) { 2692 hasDuplicate = true; 2693 return 0; 2694 } 2695 2696 var cur, 2697 i = 0, 2698 aup = a.parentNode, 2699 bup = b.parentNode, 2700 ap = [ a ], 2701 bp = [ b ]; 2702 2703 // Parentless nodes are either documents or disconnected 2704 if ( !aup || !bup ) { 2705 return a === document ? -1 : 2706 b === document ? 1 : 2707 aup ? -1 : 2708 bup ? 1 : 2709 sortInput ? 2710 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 2711 0; 2712 2713 // If the nodes are siblings, we can do a quick check 2714 } else if ( aup === bup ) { 2715 return siblingCheck( a, b ); 2716 } 2717 2718 // Otherwise we need full lists of their ancestors for comparison 2719 cur = a; 2720 while ( (cur = cur.parentNode) ) { 2721 ap.unshift( cur ); 2722 } 2723 cur = b; 2724 while ( (cur = cur.parentNode) ) { 2725 bp.unshift( cur ); 2726 } 2727 2728 // Walk down the tree looking for a discrepancy 2729 while ( ap[i] === bp[i] ) { 2730 i++; 2731 } 2732 2733 return i ? 2734 // Do a sibling check if the nodes have a common ancestor 2735 siblingCheck( ap[i], bp[i] ) : 2736 2737 // Otherwise nodes in our document sort first 2738 ap[i] === preferredDoc ? -1 : 2739 bp[i] === preferredDoc ? 1 : 2740 0; 2741 }; 2742 2743 return document; 2744 }; 2745 2746 Sizzle.matches = function( expr, elements ) { 2747 return Sizzle( expr, null, null, elements ); 2748 }; 2749 2750 Sizzle.matchesSelector = function( elem, expr ) { 2751 // Set document vars if needed 2752 if ( ( elem.ownerDocument || elem ) !== document ) { 2753 setDocument( elem ); 2754 } 2755 2756 // Make sure that attribute selectors are quoted 2757 expr = expr.replace( rattributeQuotes, "='$1']" ); 2758 2759 if ( support.matchesSelector && documentIsHTML && 2760 !compilerCache[ expr + " " ] && 2761 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && 2762 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { 2763 2764 try { 2765 var ret = matches.call( elem, expr ); 2766 2767 // IE 9's matchesSelector returns false on disconnected nodes 2768 if ( ret || support.disconnectedMatch || 2769 // As well, disconnected nodes are said to be in a document 2770 // fragment in IE 9 2771 elem.document && elem.document.nodeType !== 11 ) { 2772 return ret; 2773 } 2774 } catch (e) {} 2775 } 2776 2777 return Sizzle( expr, document, null, [ elem ] ).length > 0; 2778 }; 2779 2780 Sizzle.contains = function( context, elem ) { 2781 // Set document vars if needed 2782 if ( ( context.ownerDocument || context ) !== document ) { 2783 setDocument( context ); 2784 } 2785 return contains( context, elem ); 2786 }; 2787 2788 Sizzle.attr = function( elem, name ) { 2789 // Set document vars if needed 2790 if ( ( elem.ownerDocument || elem ) !== document ) { 2791 setDocument( elem ); 2792 } 2793 2794 var fn = Expr.attrHandle[ name.toLowerCase() ], 2795 // Don't get fooled by Object.prototype properties (jQuery #13807) 2796 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? 2797 fn( elem, name, !documentIsHTML ) : 2798 undefined; 2799 2800 return val !== undefined ? 2801 val : 2802 support.attributes || !documentIsHTML ? 2803 elem.getAttribute( name ) : 2804 (val = elem.getAttributeNode(name)) && val.specified ? 2805 val.value : 2806 null; 2807 }; 2808 2809 Sizzle.error = function( msg ) { 2810 throw new Error( "Syntax error, unrecognized expression: " + msg ); 2811 }; 2812 2813 /** 2814 * Document sorting and removing duplicates 2815 * @param {ArrayLike} results 2816 */ 2817 Sizzle.uniqueSort = function( results ) { 2818 var elem, 2819 duplicates = [], 2820 j = 0, 2821 i = 0; 2822 2823 // Unless we *know* we can detect duplicates, assume their presence 2824 hasDuplicate = !support.detectDuplicates; 2825 sortInput = !support.sortStable && results.slice( 0 ); 2826 results.sort( sortOrder ); 2827 2828 if ( hasDuplicate ) { 2829 while ( (elem = results[i++]) ) { 2830 if ( elem === results[ i ] ) { 2831 j = duplicates.push( i ); 2832 } 2833 } 2834 while ( j-- ) { 2835 results.splice( duplicates[ j ], 1 ); 2836 } 2837 } 2838 2839 // Clear input after sorting to release objects 2840 // See https://github.com/jquery/sizzle/pull/225 2841 sortInput = null; 2842 2843 return results; 2844 }; 2845 2846 /** 2847 * Utility function for retrieving the text value of an array of DOM nodes 2848 * @param {Array|Element} elem 2849 */ 2850 getText = Sizzle.getText = function( elem ) { 2851 var node, 2852 ret = "", 2853 i = 0, 2854 nodeType = elem.nodeType; 2855 2856 if ( !nodeType ) { 2857 // If no nodeType, this is expected to be an array 2858 while ( (node = elem[i++]) ) { 2859 // Do not traverse comment nodes 2860 ret += getText( node ); 2861 } 2862 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { 2863 // Use textContent for elements 2864 // innerText usage removed for consistency of new lines (jQuery #11153) 2865 if ( typeof elem.textContent === "string" ) { 2866 return elem.textContent; 2867 } else { 2868 // Traverse its children 2869 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 2870 ret += getText( elem ); 2871 } 2872 } 2873 } else if ( nodeType === 3 || nodeType === 4 ) { 2874 return elem.nodeValue; 2875 } 2876 // Do not include comment or processing instruction nodes 2877 2878 return ret; 2879 }; 2880 2881 Expr = Sizzle.selectors = { 2882 2883 // Can be adjusted by the user 2884 cacheLength: 50, 2885 2886 createPseudo: markFunction, 2887 2888 match: matchExpr, 2889 2890 attrHandle: {}, 2891 2892 find: {}, 2893 2894 relative: { 2895 ">": { dir: "parentNode", first: true }, 2896 " ": { dir: "parentNode" }, 2897 "+": { dir: "previousSibling", first: true }, 2898 "~": { dir: "previousSibling" } 2899 }, 2900 2901 preFilter: { 2902 "ATTR": function( match ) { 2903 match[1] = match[1].replace( runescape, funescape ); 2904 2905 // Move the given value to match[3] whether quoted or unquoted 2906 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); 2907 2908 if ( match[2] === "~=" ) { 2909 match[3] = " " + match[3] + " "; 2910 } 2911 2912 return match.slice( 0, 4 ); 2913 }, 2914 2915 "CHILD": function( match ) { 2916 /* matches from matchExpr["CHILD"] 2917 1 type (only|nth|...) 2918 2 what (child|of-type) 2919 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 2920 4 xn-component of xn+y argument ([+-]?\d*n|) 2921 5 sign of xn-component 2922 6 x of xn-component 2923 7 sign of y-component 2924 8 y of y-component 2925 */ 2926 match[1] = match[1].toLowerCase(); 2927 2928 if ( match[1].slice( 0, 3 ) === "nth" ) { 2929 // nth-* requires argument 2930 if ( !match[3] ) { 2931 Sizzle.error( match[0] ); 2932 } 2933 2934 // numeric x and y parameters for Expr.filter.CHILD 2935 // remember that false/true cast respectively to 0/1 2936 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); 2937 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); 2938 2939 // other types prohibit arguments 2940 } else if ( match[3] ) { 2941 Sizzle.error( match[0] ); 2942 } 2943 2944 return match; 2945 }, 2946 2947 "PSEUDO": function( match ) { 2948 var excess, 2949 unquoted = !match[6] && match[2]; 2950 2951 if ( matchExpr["CHILD"].test( match[0] ) ) { 2952 return null; 2953 } 2954 2955 // Accept quoted arguments as-is 2956 if ( match[3] ) { 2957 match[2] = match[4] || match[5] || ""; 2958 2959 // Strip excess characters from unquoted arguments 2960 } else if ( unquoted && rpseudo.test( unquoted ) && 2961 // Get excess from tokenize (recursively) 2962 (excess = tokenize( unquoted, true )) && 2963 // advance to the next closing parenthesis 2964 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { 2965 2966 // excess is a negative index 2967 match[0] = match[0].slice( 0, excess ); 2968 match[2] = unquoted.slice( 0, excess ); 2969 } 2970 2971 // Return only captures needed by the pseudo filter method (type and argument) 2972 return match.slice( 0, 3 ); 2973 } 2974 }, 2975 2976 filter: { 2977 2978 "TAG": function( nodeNameSelector ) { 2979 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); 2980 return nodeNameSelector === "*" ? 2981 function() { return true; } : 2982 function( elem ) { 2983 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; 2984 }; 2985 }, 2986 2987 "CLASS": function( className ) { 2988 var pattern = classCache[ className + " " ]; 2989 2990 return pattern || 2991 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && 2992 classCache( className, function( elem ) { 2993 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); 2994 }); 2995 }, 2996 2997 "ATTR": function( name, operator, check ) { 2998 return function( elem ) { 2999 var result = Sizzle.attr( elem, name ); 3000 3001 if ( result == null ) { 3002 return operator === "!="; 3003 } 3004 if ( !operator ) { 3005 return true; 3006 } 3007 3008 result += ""; 3009 3010 return operator === "=" ? result === check : 3011 operator === "!=" ? result !== check : 3012 operator === "^=" ? check && result.indexOf( check ) === 0 : 3013 operator === "*=" ? check && result.indexOf( check ) > -1 : 3014 operator === "$=" ? check && result.slice( -check.length ) === check : 3015 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : 3016 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : 3017 false; 3018 }; 3019 }, 3020 3021 "CHILD": function( type, what, argument, first, last ) { 3022 var simple = type.slice( 0, 3 ) !== "nth", 3023 forward = type.slice( -4 ) !== "last", 3024 ofType = what === "of-type"; 3025 3026 return first === 1 && last === 0 ? 3027 3028 // Shortcut for :nth-*(n) 3029 function( elem ) { 3030 return !!elem.parentNode; 3031 } : 3032 3033 function( elem, context, xml ) { 3034 var cache, uniqueCache, outerCache, node, nodeIndex, start, 3035 dir = simple !== forward ? "nextSibling" : "previousSibling", 3036 parent = elem.parentNode, 3037 name = ofType && elem.nodeName.toLowerCase(), 3038 useCache = !xml && !ofType, 3039 diff = false; 3040 3041 if ( parent ) { 3042 3043 // :(first|last|only)-(child|of-type) 3044 if ( simple ) { 3045 while ( dir ) { 3046 node = elem; 3047 while ( (node = node[ dir ]) ) { 3048 if ( ofType ? 3049 node.nodeName.toLowerCase() === name : 3050 node.nodeType === 1 ) { 3051 3052 return false; 3053 } 3054 } 3055 // Reverse direction for :only-* (if we haven't yet done so) 3056 start = dir = type === "only" && !start && "nextSibling"; 3057 } 3058 return true; 3059 } 3060 3061 start = [ forward ? parent.firstChild : parent.lastChild ]; 3062 3063 // non-xml :nth-child(...) stores cache data on `parent` 3064 if ( forward && useCache ) { 3065 3066 // Seek `elem` from a previously-cached index 3067 3068 // ...in a gzip-friendly way 3069 node = parent; 3070 outerCache = node[ expando ] || (node[ expando ] = {}); 3071 3072 // Support: IE <9 only 3073 // Defend against cloned attroperties (jQuery gh-1709) 3074 uniqueCache = outerCache[ node.uniqueID ] || 3075 (outerCache[ node.uniqueID ] = {}); 3076 3077 cache = uniqueCache[ type ] || []; 3078 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 3079 diff = nodeIndex && cache[ 2 ]; 3080 node = nodeIndex && parent.childNodes[ nodeIndex ]; 3081 3082 while ( (node = ++nodeIndex && node && node[ dir ] || 3083 3084 // Fallback to seeking `elem` from the start 3085 (diff = nodeIndex = 0) || start.pop()) ) { 3086 3087 // When found, cache indexes on `parent` and break 3088 if ( node.nodeType === 1 && ++diff && node === elem ) { 3089 uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; 3090 break; 3091 } 3092 } 3093 3094 } else { 3095 // Use previously-cached element index if available 3096 if ( useCache ) { 3097 // ...in a gzip-friendly way 3098 node = elem; 3099 outerCache = node[ expando ] || (node[ expando ] = {}); 3100 3101 // Support: IE <9 only 3102 // Defend against cloned attroperties (jQuery gh-1709) 3103 uniqueCache = outerCache[ node.uniqueID ] || 3104 (outerCache[ node.uniqueID ] = {}); 3105 3106 cache = uniqueCache[ type ] || []; 3107 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 3108 diff = nodeIndex; 3109 } 3110 3111 // xml :nth-child(...) 3112 // or :nth-last-child(...) or :nth(-last)?-of-type(...) 3113 if ( diff === false ) { 3114 // Use the same loop as above to seek `elem` from the start 3115 while ( (node = ++nodeIndex && node && node[ dir ] || 3116 (diff = nodeIndex = 0) || start.pop()) ) { 3117 3118 if ( ( ofType ? 3119 node.nodeName.toLowerCase() === name : 3120 node.nodeType === 1 ) && 3121 ++diff ) { 3122 3123 // Cache the index of each encountered element 3124 if ( useCache ) { 3125 outerCache = node[ expando ] || (node[ expando ] = {}); 3126 3127 // Support: IE <9 only 3128 // Defend against cloned attroperties (jQuery gh-1709) 3129 uniqueCache = outerCache[ node.uniqueID ] || 3130 (outerCache[ node.uniqueID ] = {}); 3131 3132 uniqueCache[ type ] = [ dirruns, diff ]; 3133 } 3134 3135 if ( node === elem ) { 3136 break; 3137 } 3138 } 3139 } 3140 } 3141 } 3142 3143 // Incorporate the offset, then check against cycle size 3144 diff -= last; 3145 return diff === first || ( diff % first === 0 && diff / first >= 0 ); 3146 } 3147 }; 3148 }, 3149 3150 "PSEUDO": function( pseudo, argument ) { 3151 // pseudo-class names are case-insensitive 3152 // http://www.w3.org/TR/selectors/#pseudo-classes 3153 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 3154 // Remember that setFilters inherits from pseudos 3155 var args, 3156 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || 3157 Sizzle.error( "unsupported pseudo: " + pseudo ); 3158 3159 // The user may use createPseudo to indicate that 3160 // arguments are needed to create the filter function 3161 // just as Sizzle does 3162 if ( fn[ expando ] ) { 3163 return fn( argument ); 3164 } 3165 3166 // But maintain support for old signatures 3167 if ( fn.length > 1 ) { 3168 args = [ pseudo, pseudo, "", argument ]; 3169 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? 3170 markFunction(function( seed, matches ) { 3171 var idx, 3172 matched = fn( seed, argument ), 3173 i = matched.length; 3174 while ( i-- ) { 3175 idx = indexOf( seed, matched[i] ); 3176 seed[ idx ] = !( matches[ idx ] = matched[i] ); 3177 } 3178 }) : 3179 function( elem ) { 3180 return fn( elem, 0, args ); 3181 }; 3182 } 3183 3184 return fn; 3185 } 3186 }, 3187 3188 pseudos: { 3189 // Potentially complex pseudos 3190 "not": markFunction(function( selector ) { 3191 // Trim the selector passed to compile 3192 // to avoid treating leading and trailing 3193 // spaces as combinators 3194 var input = [], 3195 results = [], 3196 matcher = compile( selector.replace( rtrim, "$1" ) ); 3197 3198 return matcher[ expando ] ? 3199 markFunction(function( seed, matches, context, xml ) { 3200 var elem, 3201 unmatched = matcher( seed, null, xml, [] ), 3202 i = seed.length; 3203 3204 // Match elements unmatched by `matcher` 3205 while ( i-- ) { 3206 if ( (elem = unmatched[i]) ) { 3207 seed[i] = !(matches[i] = elem); 3208 } 3209 } 3210 }) : 3211 function( elem, context, xml ) { 3212 input[0] = elem; 3213 matcher( input, null, xml, results ); 3214 // Don't keep the element (issue #299) 3215 input[0] = null; 3216 return !results.pop(); 3217 }; 3218 }), 3219 3220 "has": markFunction(function( selector ) { 3221 return function( elem ) { 3222 return Sizzle( selector, elem ).length > 0; 3223 }; 3224 }), 3225 3226 "contains": markFunction(function( text ) { 3227 text = text.replace( runescape, funescape ); 3228 return function( elem ) { 3229 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; 3230 }; 3231 }), 3232 3233 // "Whether an element is represented by a :lang() selector 3234 // is based solely on the element's language value 3235 // being equal to the identifier C, 3236 // or beginning with the identifier C immediately followed by "-". 3237 // The matching of C against the element's language value is performed case-insensitively. 3238 // The identifier C does not have to be a valid language name." 3239 // http://www.w3.org/TR/selectors/#lang-pseudo 3240 "lang": markFunction( function( lang ) { 3241 // lang value must be a valid identifier 3242 if ( !ridentifier.test(lang || "") ) { 3243 Sizzle.error( "unsupported lang: " + lang ); 3244 } 3245 lang = lang.replace( runescape, funescape ).toLowerCase(); 3246 return function( elem ) { 3247 var elemLang; 3248 do { 3249 if ( (elemLang = documentIsHTML ? 3250 elem.lang : 3251 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { 3252 3253 elemLang = elemLang.toLowerCase(); 3254 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 3255 } 3256 } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); 3257 return false;
vendor: 4,684 bytes, lines 3258-3429
3258 }; 3259 }), 3260 3261 // Miscellaneous 3262 "target": function( elem ) { 3263 var hash = window.location && window.location.hash; 3264 return hash && hash.slice( 1 ) === elem.id; 3265 }, 3266 3267 "root": function( elem ) { 3268 return elem === docElem; 3269 }, 3270 3271 "focus": function( elem ) { 3272 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); 3273 }, 3274 3275 // Boolean properties 3276 "enabled": function( elem ) { 3277 return elem.disabled === false; 3278 }, 3279 3280 "disabled": function( elem ) { 3281 return elem.disabled === true; 3282 }, 3283 3284 "checked": function( elem ) { 3285 // In CSS3, :checked should return both checked and selected elements 3286 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 3287 var nodeName = elem.nodeName.toLowerCase(); 3288 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); 3289 }, 3290 3291 "selected": function( elem ) { 3292 // Accessing this property makes selected-by-default 3293 // options in Safari work properly 3294 if ( elem.parentNode ) { 3295 elem.parentNode.selectedIndex; 3296 } 3297 3298 return elem.selected === true; 3299 }, 3300 3301 // Contents 3302 "empty": function( elem ) { 3303 // http://www.w3.org/TR/selectors/#empty-pseudo 3304 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), 3305 // but not by others (comment: 8; processing instruction: 7; etc.) 3306 // nodeType < 6 works because attributes (2) do not appear as children 3307 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 3308 if ( elem.nodeType < 6 ) { 3309 return false; 3310 } 3311 } 3312 return true; 3313 }, 3314 3315 "parent": function( elem ) { 3316 return !Expr.pseudos["empty"]( elem ); 3317 }, 3318 3319 // Element/input types 3320 "header": function( elem ) { 3321 return rheader.test( elem.nodeName ); 3322 }, 3323 3324 "input": function( elem ) { 3325 return rinputs.test( elem.nodeName ); 3326 }, 3327 3328 "button": function( elem ) { 3329 var name = elem.nodeName.toLowerCase(); 3330 return name === "input" && elem.type === "button" || name === "button"; 3331 }, 3332 3333 "text": function( elem ) { 3334 var attr; 3335 return elem.nodeName.toLowerCase() === "input" && 3336 elem.type === "text" && 3337 3338 // Support: IE<8 3339 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" 3340 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); 3341 }, 3342 3343 // Position-in-collection 3344 "first": createPositionalPseudo(function() { 3345 return [ 0 ]; 3346 }), 3347 3348 "last": createPositionalPseudo(function( matchIndexes, length ) { 3349 return [ length - 1 ]; 3350 }), 3351 3352 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { 3353 return [ argument < 0 ? argument + length : argument ]; 3354 }), 3355 3356 "even": createPositionalPseudo(function( matchIndexes, length ) { 3357 var i = 0; 3358 for ( ; i < length; i += 2 ) { 3359 matchIndexes.push( i ); 3360 } 3361 return matchIndexes; 3362 }), 3363 3364 "odd": createPositionalPseudo(function( matchIndexes, length ) { 3365 var i = 1; 3366 for ( ; i < length; i += 2 ) { 3367 matchIndexes.push( i ); 3368 } 3369 return matchIndexes; 3370 }), 3371 3372 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { 3373 var i = argument < 0 ? argument + length : argument; 3374 for ( ; --i >= 0; ) { 3375 matchIndexes.push( i ); 3376 } 3377 return matchIndexes; 3378 }), 3379 3380 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { 3381 var i = argument < 0 ? argument + length : argument; 3382 for ( ; ++i < length; ) { 3383 matchIndexes.push( i ); 3384 } 3385 return matchIndexes; 3386 }) 3387 } 3388 }; 3389 3390 Expr.pseudos["nth"] = Expr.pseudos["eq"]; 3391 3392 // Add button/input type pseudos 3393 for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { 3394 Expr.pseudos[ i ] = createInputPseudo( i ); 3395 } 3396 for ( i in { submit: true, reset: true } ) { 3397 Expr.pseudos[ i ] = createButtonPseudo( i ); 3398 } 3399 3400 // Easy API for creating new setFilters 3401 function setFilters() {} 3402 setFilters.prototype = Expr.filters = Expr.pseudos; 3403 Expr.setFilters = new setFilters(); 3404 3405 tokenize = Sizzle.tokenize = function( selector, parseOnly ) { 3406 var matched, match, tokens, type, 3407 soFar, groups, preFilters, 3408 cached = tokenCache[ selector + " " ]; 3409 3410 if ( cached ) { 3411 return parseOnly ? 0 : cached.slice( 0 ); 3412 } 3413 3414 soFar = selector; 3415 groups = []; 3416 preFilters = Expr.preFilter; 3417 3418 while ( soFar ) { 3419 3420 // Comma and first run 3421 if ( !matched || (match = rcomma.exec( soFar )) ) { 3422 if ( match ) { 3423 // Don't consume trailing commas as valid 3424 soFar = soFar.slice( match[0].length ) || soFar; 3425 } 3426 groups.push( (tokens = []) ); 3427 } 3428 3429 matched = false;
vendor: 6,785 bytes, lines 3430-3681
3430 3431 // Combinators 3432 if ( (match = rcombinators.exec( soFar )) ) { 3433 matched = match.shift(); 3434 tokens.push({ 3435 value: matched, 3436 // Cast descendant combinators to space 3437 type: match[0].replace( rtrim, " " ) 3438 }); 3439 soFar = soFar.slice( matched.length ); 3440 } 3441 3442 // Filters 3443 for ( type in Expr.filter ) { 3444 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || 3445 (match = preFilters[ type ]( match ))) ) { 3446 matched = match.shift(); 3447 tokens.push({ 3448 value: matched, 3449 type: type, 3450 matches: match 3451 }); 3452 soFar = soFar.slice( matched.length ); 3453 } 3454 } 3455 3456 if ( !matched ) { 3457 break; 3458 } 3459 } 3460 3461 // Return the length of the invalid excess 3462 // if we're just parsing 3463 // Otherwise, throw an error or return tokens 3464 return parseOnly ? 3465 soFar.length : 3466 soFar ? 3467 Sizzle.error( selector ) : 3468 // Cache the tokens 3469 tokenCache( selector, groups ).slice( 0 ); 3470 }; 3471 3472 function toSelector( tokens ) { 3473 var i = 0, 3474 len = tokens.length, 3475 selector = ""; 3476 for ( ; i < len; i++ ) { 3477 selector += tokens[i].value; 3478 } 3479 return selector; 3480 } 3481 3482 function addCombinator( matcher, combinator, base ) { 3483 var dir = combinator.dir, 3484 checkNonElements = base && dir === "parentNode", 3485 doneName = done++; 3486 3487 return combinator.first ? 3488 // Check against closest ancestor/preceding element 3489 function( elem, context, xml ) { 3490 while ( (elem = elem[ dir ]) ) { 3491 if ( elem.nodeType === 1 || checkNonElements ) { 3492 return matcher( elem, context, xml ); 3493 } 3494 } 3495 } : 3496 3497 // Check against all ancestor/preceding elements 3498 function( elem, context, xml ) { 3499 var oldCache, uniqueCache, outerCache, 3500 newCache = [ dirruns, doneName ]; 3501 3502 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching 3503 if ( xml ) { 3504 while ( (elem = elem[ dir ]) ) { 3505 if ( elem.nodeType === 1 || checkNonElements ) { 3506 if ( matcher( elem, context, xml ) ) { 3507 return true; 3508 } 3509 } 3510 } 3511 } else { 3512 while ( (elem = elem[ dir ]) ) { 3513 if ( elem.nodeType === 1 || checkNonElements ) { 3514 outerCache = elem[ expando ] || (elem[ expando ] = {}); 3515 3516 // Support: IE <9 only 3517 // Defend against cloned attroperties (jQuery gh-1709) 3518 uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); 3519 3520 if ( (oldCache = uniqueCache[ dir ]) && 3521 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { 3522 3523 // Assign to newCache so results back-propagate to previous elements 3524 return (newCache[ 2 ] = oldCache[ 2 ]); 3525 } else { 3526 // Reuse newcache so results back-propagate to previous elements 3527 uniqueCache[ dir ] = newCache; 3528 3529 // A match means we're done; a fail means we have to keep checking 3530 if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { 3531 return true; 3532 } 3533 } 3534 } 3535 } 3536 } 3537 }; 3538 } 3539 3540 function elementMatcher( matchers ) { 3541 return matchers.length > 1 ? 3542 function( elem, context, xml ) { 3543 var i = matchers.length; 3544 while ( i-- ) { 3545 if ( !matchers[i]( elem, context, xml ) ) { 3546 return false; 3547 } 3548 } 3549 return true; 3550 } : 3551 matchers[0]; 3552 } 3553 3554 function multipleContexts( selector, contexts, results ) { 3555 var i = 0, 3556 len = contexts.length; 3557 for ( ; i < len; i++ ) { 3558 Sizzle( selector, contexts[i], results ); 3559 } 3560 return results; 3561 } 3562 3563 function condense( unmatched, map, filter, context, xml ) { 3564 var elem, 3565 newUnmatched = [], 3566 i = 0, 3567 len = unmatched.length, 3568 mapped = map != null; 3569 3570 for ( ; i < len; i++ ) { 3571 if ( (elem = unmatched[i]) ) { 3572 if ( !filter || filter( elem, context, xml ) ) { 3573 newUnmatched.push( elem ); 3574 if ( mapped ) { 3575 map.push( i ); 3576 } 3577 } 3578 } 3579 } 3580 3581 return newUnmatched; 3582 } 3583 3584 function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { 3585 if ( postFilter && !postFilter[ expando ] ) { 3586 postFilter = setMatcher( postFilter ); 3587 } 3588 if ( postFinder && !postFinder[ expando ] ) { 3589 postFinder = setMatcher( postFinder, postSelector ); 3590 } 3591 return markFunction(function( seed, results, context, xml ) { 3592 var temp, i, elem, 3593 preMap = [], 3594 postMap = [], 3595 preexisting = results.length, 3596 3597 // Get initial elements from seed or context 3598 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), 3599 3600 // Prefilter to get matcher input, preserving a map for seed-results synchronization 3601 matcherIn = preFilter && ( seed || !selector ) ? 3602 condense( elems, preMap, preFilter, context, xml ) : 3603 elems, 3604 3605 matcherOut = matcher ? 3606 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, 3607 postFinder || ( seed ? preFilter : preexisting || postFilter ) ? 3608 3609 // ...intermediate processing is necessary 3610 [] : 3611 3612 // ...otherwise use results directly 3613 results : 3614 matcherIn; 3615 3616 // Find primary matches 3617 if ( matcher ) { 3618 matcher( matcherIn, matcherOut, context, xml ); 3619 } 3620 3621 // Apply postFilter 3622 if ( postFilter ) { 3623 temp = condense( matcherOut, postMap ); 3624 postFilter( temp, [], context, xml ); 3625 3626 // Un-match failing elements by moving them back to matcherIn 3627 i = temp.length; 3628 while ( i-- ) { 3629 if ( (elem = temp[i]) ) { 3630 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); 3631 } 3632 } 3633 } 3634 3635 if ( seed ) { 3636 if ( postFinder || preFilter ) { 3637 if ( postFinder ) { 3638 // Get the final matcherOut by condensing this intermediate into postFinder contexts 3639 temp = []; 3640 i = matcherOut.length; 3641 while ( i-- ) { 3642 if ( (elem = matcherOut[i]) ) { 3643 // Restore matcherIn since elem is not yet a final match 3644 temp.push( (matcherIn[i] = elem) ); 3645 } 3646 } 3647 postFinder( null, (matcherOut = []), temp, xml ); 3648 } 3649 3650 // Move matched elements from seed to results to keep them synchronized 3651 i = matcherOut.length; 3652 while ( i-- ) { 3653 if ( (elem = matcherOut[i]) && 3654 (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { 3655 3656 seed[temp] = !(results[temp] = elem); 3657 } 3658 } 3659 } 3660 3661 // Add elements to results, through postFinder if defined 3662 } else { 3663 matcherOut = condense( 3664 matcherOut === results ? 3665 matcherOut.splice( preexisting, matcherOut.length ) : 3666 matcherOut 3667 ); 3668 if ( postFinder ) { 3669 postFinder( null, results, matcherOut, xml ); 3670 } else { 3671 push.apply( results, matcherOut ); 3672 } 3673 } 3674 }); 3675 } 3676 3677 function matcherFromTokens( tokens ) { 3678 var checkContext, matcher, j, 3679 len = tokens.length, 3680 leadingRelative = Expr.relative[ tokens[0].type ], 3681 implicitRelative = leadingRelative || Expr.relative[" "],
vendor: 8,037 bytes, lines 3682-3926
3682 i = leadingRelative ? 1 : 0, 3683 3684 // The foundational matcher ensures that elements are reachable from top-level context(s) 3685 matchContext = addCombinator( function( elem ) { 3686 return elem === checkContext; 3687 }, implicitRelative, true ), 3688 matchAnyContext = addCombinator( function( elem ) { 3689 return indexOf( checkContext, elem ) > -1; 3690 }, implicitRelative, true ), 3691 matchers = [ function( elem, context, xml ) { 3692 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( 3693 (checkContext = context).nodeType ? 3694 matchContext( elem, context, xml ) : 3695 matchAnyContext( elem, context, xml ) ); 3696 // Avoid hanging onto element (issue #299) 3697 checkContext = null; 3698 return ret; 3699 } ]; 3700 3701 for ( ; i < len; i++ ) { 3702 if ( (matcher = Expr.relative[ tokens[i].type ]) ) { 3703 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; 3704 } else { 3705 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); 3706 3707 // Return special upon seeing a positional matcher 3708 if ( matcher[ expando ] ) { 3709 // Find the next relative operator (if any) for proper handling 3710 j = ++i; 3711 for ( ; j < len; j++ ) { 3712 if ( Expr.relative[ tokens[j].type ] ) { 3713 break; 3714 } 3715 } 3716 return setMatcher( 3717 i > 1 && elementMatcher( matchers ), 3718 i > 1 && toSelector( 3719 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 3720 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) 3721 ).replace( rtrim, "$1" ), 3722 matcher, 3723 i < j && matcherFromTokens( tokens.slice( i, j ) ), 3724 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), 3725 j < len && toSelector( tokens ) 3726 ); 3727 } 3728 matchers.push( matcher ); 3729 } 3730 } 3731 3732 return elementMatcher( matchers ); 3733 } 3734 3735 function matcherFromGroupMatchers( elementMatchers, setMatchers ) { 3736 var bySet = setMatchers.length > 0, 3737 byElement = elementMatchers.length > 0, 3738 superMatcher = function( seed, context, xml, results, outermost ) { 3739 var elem, j, matcher, 3740 matchedCount = 0, 3741 i = "0", 3742 unmatched = seed && [], 3743 setMatched = [], 3744 contextBackup = outermostContext, 3745 // We must always have either seed elements or outermost context 3746 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), 3747 // Use integer dirruns iff this is the outermost matcher 3748 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), 3749 len = elems.length; 3750 3751 if ( outermost ) { 3752 outermostContext = context === document || context || outermost; 3753 } 3754 3755 // Add elements passing elementMatchers directly to results 3756 // Support: IE<9, Safari 3757 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id 3758 for ( ; i !== len && (elem = elems[i]) != null; i++ ) { 3759 if ( byElement && elem ) { 3760 j = 0; 3761 if ( !context && elem.ownerDocument !== document ) { 3762 setDocument( elem ); 3763 xml = !documentIsHTML; 3764 } 3765 while ( (matcher = elementMatchers[j++]) ) { 3766 if ( matcher( elem, context || document, xml) ) { 3767 results.push( elem ); 3768 break; 3769 } 3770 } 3771 if ( outermost ) { 3772 dirruns = dirrunsUnique; 3773 } 3774 } 3775 3776 // Track unmatched elements for set filters 3777 if ( bySet ) { 3778 // They will have gone through all possible matchers 3779 if ( (elem = !matcher && elem) ) { 3780 matchedCount--; 3781 } 3782 3783 // Lengthen the array for every element, matched or not 3784 if ( seed ) { 3785 unmatched.push( elem ); 3786 } 3787 } 3788 } 3789 3790 // `i` is now the count of elements visited above, and adding it to `matchedCount` 3791 // makes the latter nonnegative. 3792 matchedCount += i; 3793 3794 // Apply set filters to unmatched elements 3795 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` 3796 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have 3797 // no element matchers and no seed. 3798 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that 3799 // case, which will result in a "00" `matchedCount` that differs from `i` but is also 3800 // numerically zero. 3801 if ( bySet && i !== matchedCount ) { 3802 j = 0; 3803 while ( (matcher = setMatchers[j++]) ) { 3804 matcher( unmatched, setMatched, context, xml ); 3805 } 3806 3807 if ( seed ) { 3808 // Reintegrate element matches to eliminate the need for sorting 3809 if ( matchedCount > 0 ) { 3810 while ( i-- ) { 3811 if ( !(unmatched[i] || setMatched[i]) ) { 3812 setMatched[i] = pop.call( results ); 3813 } 3814 } 3815 } 3816 3817 // Discard index placeholder values to get only actual matches 3818 setMatched = condense( setMatched ); 3819 } 3820 3821 // Add matches to results 3822 push.apply( results, setMatched ); 3823 3824 // Seedless set matches succeeding multiple successful matchers stipulate sorting 3825 if ( outermost && !seed && setMatched.length > 0 && 3826 ( matchedCount + setMatchers.length ) > 1 ) { 3827 3828 Sizzle.uniqueSort( results ); 3829 } 3830 } 3831 3832 // Override manipulation of globals by nested matchers 3833 if ( outermost ) { 3834 dirruns = dirrunsUnique; 3835 outermostContext = contextBackup; 3836 } 3837 3838 return unmatched; 3839 }; 3840 3841 return bySet ? 3842 markFunction( superMatcher ) : 3843 superMatcher; 3844 } 3845 3846 compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { 3847 var i, 3848 setMatchers = [], 3849 elementMatchers = [], 3850 cached = compilerCache[ selector + " " ]; 3851 3852 if ( !cached ) { 3853 // Generate a function of recursive functions that can be used to check each element 3854 if ( !match ) { 3855 match = tokenize( selector ); 3856 } 3857 i = match.length; 3858 while ( i-- ) { 3859 cached = matcherFromTokens( match[i] ); 3860 if ( cached[ expando ] ) { 3861 setMatchers.push( cached ); 3862 } else { 3863 elementMatchers.push( cached ); 3864 } 3865 } 3866 3867 // Cache the compiled function 3868 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); 3869 3870 // Save selector and tokenization 3871 cached.selector = selector; 3872 } 3873 return cached; 3874 }; 3875 3876 /** 3877 * A low-level selection function that works with Sizzle's compiled 3878 * selector functions 3879 * @param {String|Function} selector A selector or a pre-compiled 3880 * selector function built with Sizzle.compile 3881 * @param {Element} context 3882 * @param {Array} [results] 3883 * @param {Array} [seed] A set of elements to match against 3884 */ 3885 select = Sizzle.select = function( selector, context, results, seed ) { 3886 var i, tokens, token, type, find, 3887 compiled = typeof selector === "function" && selector, 3888 match = !seed && tokenize( (selector = compiled.selector || selector) ); 3889 3890 results = results || []; 3891 3892 // Try to minimize operations if there is only one selector in the list and no seed 3893 // (the latter of which guarantees us context) 3894 if ( match.length === 1 ) { 3895 3896 // Reduce context if the leading compound selector is an ID 3897 tokens = match[0] = match[0].slice( 0 ); 3898 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && 3899 support.getById && context.nodeType === 9 && documentIsHTML && 3900 Expr.relative[ tokens[1].type ] ) { 3901 3902 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; 3903 if ( !context ) { 3904 return results; 3905 3906 // Precompiled matchers will still verify ancestry, so step up a level 3907 } else if ( compiled ) { 3908 context = context.parentNode; 3909 } 3910 3911 selector = selector.slice( tokens.shift().value.length ); 3912 } 3913 3914 // Fetch a seed set for right-to-left matching 3915 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; 3916 while ( i-- ) { 3917 token = tokens[i]; 3918 3919 // Abort if we hit a combinator 3920 if ( Expr.relative[ (type = token.type) ] ) { 3921 break; 3922 } 3923 if ( (find = Expr.find[ type ]) ) { 3924 // Search, expanding context for leading sibling combinators 3925 if ( (seed = find( 3926 token.matches[0].replace( runescape, funescape ),
vendor: 4,911 bytes, lines 3927-4123
3927 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context 3928 )) ) { 3929 3930 // If seed is empty or no tokens remain, we can return early 3931 tokens.splice( i, 1 ); 3932 selector = seed.length && toSelector( tokens ); 3933 if ( !selector ) { 3934 push.apply( results, seed ); 3935 return results; 3936 } 3937 3938 break; 3939 } 3940 } 3941 } 3942 } 3943 3944 // Compile and execute a filtering function if one is not provided 3945 // Provide `match` to avoid retokenization if we modified the selector above 3946 ( compiled || compile( selector, match ) )( 3947 seed, 3948 context, 3949 !documentIsHTML, 3950 results, 3951 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context 3952 ); 3953 return results; 3954 }; 3955 3956 // One-time assignments 3957 3958 // Sort stability 3959 support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; 3960 3961 // Support: Chrome 14-35+ 3962 // Always assume duplicates if they aren't passed to the comparison function 3963 support.detectDuplicates = !!hasDuplicate; 3964 3965 // Initialize against the default document 3966 setDocument(); 3967 3968 // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) 3969 // Detached nodes confoundingly follow *each other* 3970 support.sortDetached = assert(function( div1 ) { 3971 // Should return 1, but returns 4 (following) 3972 return div1.compareDocumentPosition( document.createElement("div") ) & 1; 3973 }); 3974 3975 // Support: IE<8 3976 // Prevent attribute/property "interpolation" 3977 // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx 3978 if ( !assert(function( div ) { 3979 div.innerHTML = "<a href='#'></a>"; 3980 return div.firstChild.getAttribute("href") === "#" ; 3981 }) ) { 3982 addHandle( "type|href|height|width", function( elem, name, isXML ) { 3983 if ( !isXML ) { 3984 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); 3985 } 3986 }); 3987 } 3988 3989 // Support: IE<9 3990 // Use defaultValue in place of getAttribute("value") 3991 if ( !support.attributes || !assert(function( div ) { 3992 div.innerHTML = "<input/>"; 3993 div.firstChild.setAttribute( "value", "" ); 3994 return div.firstChild.getAttribute( "value" ) === ""; 3995 }) ) { 3996 addHandle( "value", function( elem, name, isXML ) { 3997 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { 3998 return elem.defaultValue; 3999 } 4000 }); 4001 } 4002 4003 // Support: IE<9 4004 // Use getAttributeNode to fetch booleans when getAttribute lies 4005 if ( !assert(function( div ) { 4006 return div.getAttribute("disabled") == null; 4007 }) ) { 4008 addHandle( booleans, function( elem, name, isXML ) { 4009 var val; 4010 if ( !isXML ) { 4011 return elem[ name ] === true ? name.toLowerCase() : 4012 (val = elem.getAttributeNode( name )) && val.specified ? 4013 val.value : 4014 null; 4015 } 4016 }); 4017 } 4018 4019 return Sizzle; 4020 4021 })( window ); 4022 4023 4024 4025 jQuery.find = Sizzle; 4026 jQuery.expr = Sizzle.selectors; 4027 jQuery.expr[ ":" ] = jQuery.expr.pseudos; 4028 jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; 4029 jQuery.text = Sizzle.getText; 4030 jQuery.isXMLDoc = Sizzle.isXML; 4031 jQuery.contains = Sizzle.contains; 4032 4033 4034 4035 var dir = function( elem, dir, until ) { 4036 var matched = [], 4037 truncate = until !== undefined; 4038 4039 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { 4040 if ( elem.nodeType === 1 ) { 4041 if ( truncate && jQuery( elem ).is( until ) ) { 4042 break; 4043 } 4044 matched.push( elem ); 4045 } 4046 } 4047 return matched; 4048 }; 4049 4050 4051 var siblings = function( n, elem ) { 4052 var matched = []; 4053 4054 for ( ; n; n = n.nextSibling ) { 4055 if ( n.nodeType === 1 && n !== elem ) { 4056 matched.push( n ); 4057 } 4058 } 4059 4060 return matched; 4061 }; 4062 4063 4064 var rneedsContext = jQuery.expr.match.needsContext; 4065 4066 var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ ); 4067 4068 4069 4070 var risSimple = /^.[^:#\[\.,]*$/; 4071 4072 // Implement the identical functionality for filter and not 4073 function winnow( elements, qualifier, not ) { 4074 if ( jQuery.isFunction( qualifier ) ) { 4075 return jQuery.grep( elements, function( elem, i ) { 4076 /* jshint -W018 */ 4077 return !!qualifier.call( elem, i, elem ) !== not; 4078 } ); 4079 4080 } 4081 4082 if ( qualifier.nodeType ) { 4083 return jQuery.grep( elements, function( elem ) { 4084 return ( elem === qualifier ) !== not; 4085 } ); 4086 4087 } 4088 4089 if ( typeof qualifier === "string" ) { 4090 if ( risSimple.test( qualifier ) ) { 4091 return jQuery.filter( qualifier, elements, not ); 4092 } 4093 4094 qualifier = jQuery.filter( qualifier, elements ); 4095 } 4096 4097 return jQuery.grep( elements, function( elem ) { 4098 return ( jQuery.inArray( elem, qualifier ) > -1 ) !== not; 4099 } ); 4100 } 4101 4102 jQuery.filter = function( expr, elems, not ) { 4103 var elem = elems[ 0 ]; 4104 4105 if ( not ) { 4106 expr = ":not(" + expr + ")"; 4107 } 4108 4109 return elems.length === 1 && elem.nodeType === 1 ? 4110 jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : 4111 jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { 4112 return elem.nodeType === 1; 4113 } ) ); 4114 }; 4115 4116 jQuery.fn.extend( { 4117 find: function( selector ) { 4118 var i, 4119 ret = [], 4120 self = this, 4121 len = self.length; 4122 4123 if ( typeof selector !== "string" ) {
vendor: 5,081 bytes, lines 4124-4305
4124 return this.pushStack( jQuery( selector ).filter( function() { 4125 for ( i = 0; i < len; i++ ) { 4126 if ( jQuery.contains( self[ i ], this ) ) { 4127 return true; 4128 } 4129 } 4130 } ) ); 4131 } 4132 4133 for ( i = 0; i < len; i++ ) { 4134 jQuery.find( selector, self[ i ], ret ); 4135 } 4136 4137 // Needed because $( selector, context ) becomes $( context ).find( selector ) 4138 ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); 4139 ret.selector = this.selector ? this.selector + " " + selector : selector; 4140 return ret; 4141 }, 4142 filter: function( selector ) { 4143 return this.pushStack( winnow( this, selector || [], false ) ); 4144 }, 4145 not: function( selector ) { 4146 return this.pushStack( winnow( this, selector || [], true ) ); 4147 }, 4148 is: function( selector ) { 4149 return !!winnow( 4150 this, 4151 4152 // If this is a positional/relative selector, check membership in the returned set 4153 // so $("p:first").is("p:last") won't return true for a doc with two "p". 4154 typeof selector === "string" && rneedsContext.test( selector ) ? 4155 jQuery( selector ) : 4156 selector || [], 4157 false 4158 ).length; 4159 } 4160 } ); 4161 4162 4163 // Initialize a jQuery object 4164 4165 4166 // A central reference to the root jQuery(document) 4167 var rootjQuery, 4168 4169 // A simple way to check for HTML strings 4170 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) 4171 // Strict HTML recognition (#11290: must start with <) 4172 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, 4173 4174 init = jQuery.fn.init = function( selector, context, root ) { 4175 var match, elem; 4176 4177 // HANDLE: $(""), $(null), $(undefined), $(false) 4178 if ( !selector ) { 4179 return this; 4180 } 4181 4182 // init accepts an alternate rootjQuery 4183 // so migrate can support jQuery.sub (gh-2101) 4184 root = root || rootjQuery; 4185 4186 // Handle HTML strings 4187 if ( typeof selector === "string" ) { 4188 if ( selector.charAt( 0 ) === "<" && 4189 selector.charAt( selector.length - 1 ) === ">" && 4190 selector.length >= 3 ) { 4191 4192 // Assume that strings that start and end with <> are HTML and skip the regex check 4193 match = [ null, selector, null ]; 4194 4195 } else { 4196 match = rquickExpr.exec( selector ); 4197 } 4198 4199 // Match html or make sure no context is specified for #id 4200 if ( match && ( match[ 1 ] || !context ) ) { 4201 4202 // HANDLE: $(html) -> $(array) 4203 if ( match[ 1 ] ) { 4204 context = context instanceof jQuery ? context[ 0 ] : context; 4205 4206 // scripts is true for back-compat 4207 // Intentionally let the error be thrown if parseHTML is not present 4208 jQuery.merge( this, jQuery.parseHTML( 4209 match[ 1 ], 4210 context && context.nodeType ? context.ownerDocument || context : document, 4211 true 4212 ) ); 4213 4214 // HANDLE: $(html, props) 4215 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { 4216 for ( match in context ) { 4217 4218 // Properties of context are called as methods if possible 4219 if ( jQuery.isFunction( this[ match ] ) ) { 4220 this[ match ]( context[ match ] ); 4221 4222 // ...and otherwise set as attributes 4223 } else { 4224 this.attr( match, context[ match ] ); 4225 } 4226 } 4227 } 4228 4229 return this; 4230 4231 // HANDLE: $(#id) 4232 } else { 4233 elem = document.getElementById( match[ 2 ] ); 4234 4235 // Check parentNode to catch when Blackberry 4.6 returns 4236 // nodes that are no longer in the document #6963 4237 if ( elem && elem.parentNode ) { 4238 4239 // Handle the case where IE and Opera return items 4240 // by name instead of ID 4241 if ( elem.id !== match[ 2 ] ) { 4242 return rootjQuery.find( selector ); 4243 } 4244 4245 // Otherwise, we inject the element directly into the jQuery object 4246 this.length = 1; 4247 this[ 0 ] = elem; 4248 } 4249 4250 this.context = document; 4251 this.selector = selector; 4252 return this; 4253 } 4254 4255 // HANDLE: $(expr, $(...)) 4256 } else if ( !context || context.jquery ) { 4257 return ( context || root ).find( selector ); 4258 4259 // HANDLE: $(expr, context) 4260 // (which is just equivalent to: $(context).find(expr) 4261 } else { 4262 return this.constructor( context ).find( selector ); 4263 } 4264 4265 // HANDLE: $(DOMElement) 4266 } else if ( selector.nodeType ) { 4267 this.context = this[ 0 ] = selector; 4268 this.length = 1; 4269 return this; 4270 4271 // HANDLE: $(function) 4272 // Shortcut for document ready 4273 } else if ( jQuery.isFunction( selector ) ) { 4274 return typeof root.ready !== "undefined" ? 4275 root.ready( selector ) : 4276 4277 // Execute immediately if ready is not present 4278 selector( jQuery ); 4279 } 4280 4281 if ( selector.selector !== undefined ) { 4282 this.selector = selector.selector; 4283 this.context = selector.context; 4284 } 4285 4286 return jQuery.makeArray( selector, this ); 4287 }; 4288 4289 // Give the init function the jQuery prototype for later instantiation 4290 init.prototype = jQuery.fn; 4291 4292 // Initialize central reference 4293 rootjQuery = jQuery( document ); 4294 4295 4296 var rparentsprev = /^(?:parents|prev(?:Until|All))/, 4297 4298 // methods guaranteed to produce a unique set when starting from a unique set 4299 guaranteedUnique = { 4300 children: true, 4301 contents: true, 4302 next: true, 4303 prev: true 4304 }; 4305
vendor: 13,782 bytes, lines 4306-4835
4306 jQuery.fn.extend( { 4307 has: function( target ) { 4308 var i, 4309 targets = jQuery( target, this ), 4310 len = targets.length; 4311 4312 return this.filter( function() { 4313 for ( i = 0; i < len; i++ ) { 4314 if ( jQuery.contains( this, targets[ i ] ) ) { 4315 return true; 4316 } 4317 } 4318 } ); 4319 }, 4320 4321 closest: function( selectors, context ) { 4322 var cur, 4323 i = 0, 4324 l = this.length, 4325 matched = [], 4326 pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? 4327 jQuery( selectors, context || this.context ) : 4328 0; 4329 4330 for ( ; i < l; i++ ) { 4331 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { 4332 4333 // Always skip document fragments 4334 if ( cur.nodeType < 11 && ( pos ? 4335 pos.index( cur ) > -1 : 4336 4337 // Don't pass non-elements to Sizzle 4338 cur.nodeType === 1 && 4339 jQuery.find.matchesSelector( cur, selectors ) ) ) { 4340 4341 matched.push( cur ); 4342 break; 4343 } 4344 } 4345 } 4346 4347 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); 4348 }, 4349 4350 // Determine the position of an element within 4351 // the matched set of elements 4352 index: function( elem ) { 4353 4354 // No argument, return index in parent 4355 if ( !elem ) { 4356 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; 4357 } 4358 4359 // index in selector 4360 if ( typeof elem === "string" ) { 4361 return jQuery.inArray( this[ 0 ], jQuery( elem ) ); 4362 } 4363 4364 // Locate the position of the desired element 4365 return jQuery.inArray( 4366 4367 // If it receives a jQuery object, the first element is used 4368 elem.jquery ? elem[ 0 ] : elem, this ); 4369 }, 4370 4371 add: function( selector, context ) { 4372 return this.pushStack( 4373 jQuery.uniqueSort( 4374 jQuery.merge( this.get(), jQuery( selector, context ) ) 4375 ) 4376 ); 4377 }, 4378 4379 addBack: function( selector ) { 4380 return this.add( selector == null ? 4381 this.prevObject : this.prevObject.filter( selector ) 4382 ); 4383 } 4384 } ); 4385 4386 function sibling( cur, dir ) { 4387 do { 4388 cur = cur[ dir ]; 4389 } while ( cur && cur.nodeType !== 1 ); 4390 4391 return cur; 4392 } 4393 4394 jQuery.each( { 4395 parent: function( elem ) { 4396 var parent = elem.parentNode; 4397 return parent && parent.nodeType !== 11 ? parent : null; 4398 }, 4399 parents: function( elem ) { 4400 return dir( elem, "parentNode" ); 4401 }, 4402 parentsUntil: function( elem, i, until ) { 4403 return dir( elem, "parentNode", until ); 4404 }, 4405 next: function( elem ) { 4406 return sibling( elem, "nextSibling" ); 4407 }, 4408 prev: function( elem ) { 4409 return sibling( elem, "previousSibling" ); 4410 }, 4411 nextAll: function( elem ) { 4412 return dir( elem, "nextSibling" ); 4413 }, 4414 prevAll: function( elem ) { 4415 return dir( elem, "previousSibling" ); 4416 }, 4417 nextUntil: function( elem, i, until ) { 4418 return dir( elem, "nextSibling", until ); 4419 }, 4420 prevUntil: function( elem, i, until ) { 4421 return dir( elem, "previousSibling", until ); 4422 }, 4423 siblings: function( elem ) { 4424 return siblings( ( elem.parentNode || {} ).firstChild, elem ); 4425 }, 4426 children: function( elem ) { 4427 return siblings( elem.firstChild ); 4428 }, 4429 contents: function( elem ) { 4430 return jQuery.nodeName( elem, "iframe" ) ? 4431 elem.contentDocument || elem.contentWindow.document : 4432 jQuery.merge( [], elem.childNodes ); 4433 } 4434 }, function( name, fn ) { 4435 jQuery.fn[ name ] = function( until, selector ) { 4436 var ret = jQuery.map( this, fn, until ); 4437 4438 if ( name.slice( -5 ) !== "Until" ) { 4439 selector = until; 4440 } 4441 4442 if ( selector && typeof selector === "string" ) { 4443 ret = jQuery.filter( selector, ret ); 4444 } 4445 4446 if ( this.length > 1 ) { 4447 4448 // Remove duplicates 4449 if ( !guaranteedUnique[ name ] ) { 4450 ret = jQuery.uniqueSort( ret ); 4451 } 4452 4453 // Reverse order for parents* and prev-derivatives 4454 if ( rparentsprev.test( name ) ) { 4455 ret = ret.reverse(); 4456 } 4457 } 4458 4459 return this.pushStack( ret ); 4460 }; 4461 } ); 4462 var rnotwhite = ( /\S+/g ); 4463 4464 4465 4466 // Convert String-formatted options into Object-formatted ones 4467 function createOptions( options ) { 4468 var object = {}; 4469 jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { 4470 object[ flag ] = true; 4471 } ); 4472 return object; 4473 } 4474 4475 /* 4476 * Create a callback list using the following parameters: 4477 * 4478 * options: an optional list of space-separated options that will change how 4479 * the callback list behaves or a more traditional option object 4480 * 4481 * By default a callback list will act like an event callback list and can be 4482 * "fired" multiple times. 4483 * 4484 * Possible options: 4485 * 4486 * once: will ensure the callback list can only be fired once (like a Deferred) 4487 * 4488 * memory: will keep track of previous values and will call any callback added 4489 * after the list has been fired right away with the latest "memorized" 4490 * values (like a Deferred) 4491 * 4492 * unique: will ensure a callback can only be added once (no duplicate in the list) 4493 * 4494 * stopOnFalse: interrupt callings when a callback returns false 4495 * 4496 */ 4497 jQuery.Callbacks = function( options ) { 4498 4499 // Convert options from String-formatted to Object-formatted if needed 4500 // (we check in cache first) 4501 options = typeof options === "string" ? 4502 createOptions( options ) : 4503 jQuery.extend( {}, options ); 4504 4505 var // Flag to know if list is currently firing 4506 firing, 4507 4508 // Last fire value for non-forgettable lists 4509 memory, 4510 4511 // Flag to know if list was already fired 4512 fired, 4513 4514 // Flag to prevent firing 4515 locked, 4516 4517 // Actual callback list 4518 list = [], 4519 4520 // Queue of execution data for repeatable lists 4521 queue = [], 4522 4523 // Index of currently firing callback (modified by add/remove as needed) 4524 firingIndex = -1, 4525 4526 // Fire callbacks 4527 fire = function() { 4528 4529 // Enforce single-firing 4530 locked = options.once; 4531 4532 // Execute callbacks for all pending executions, 4533 // respecting firingIndex overrides and runtime changes 4534 fired = firing = true; 4535 for ( ; queue.length; firingIndex = -1 ) { 4536 memory = queue.shift(); 4537 while ( ++firingIndex < list.length ) { 4538 4539 // Run callback and check for early termination 4540 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && 4541 options.stopOnFalse ) { 4542 4543 // Jump to end and forget the data so .add doesn't re-fire 4544 firingIndex = list.length; 4545 memory = false; 4546 } 4547 } 4548 } 4549 4550 // Forget the data if we're done with it 4551 if ( !options.memory ) { 4552 memory = false; 4553 } 4554 4555 firing = false; 4556 4557 // Clean up if we're done firing for good 4558 if ( locked ) { 4559 4560 // Keep an empty list if we have data for future add calls 4561 if ( memory ) { 4562 list = []; 4563 4564 // Otherwise, this object is spent 4565 } else { 4566 list = ""; 4567 } 4568 } 4569 }, 4570 4571 // Actual Callbacks object 4572 self = { 4573 4574 // Add a callback or a collection of callbacks to the list 4575 add: function() { 4576 if ( list ) { 4577 4578 // If we have memory from a past run, we should fire after adding 4579 if ( memory && !firing ) { 4580 firingIndex = list.length - 1; 4581 queue.push( memory ); 4582 } 4583 4584 ( function add( args ) { 4585 jQuery.each( args, function( _, arg ) { 4586 if ( jQuery.isFunction( arg ) ) { 4587 if ( !options.unique || !self.has( arg ) ) { 4588 list.push( arg ); 4589 } 4590 } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { 4591 4592 // Inspect recursively 4593 add( arg ); 4594 } 4595 } ); 4596 } )( arguments ); 4597 4598 if ( memory && !firing ) { 4599 fire(); 4600 } 4601 } 4602 return this; 4603 }, 4604 4605 // Remove a callback from the list 4606 remove: function() { 4607 jQuery.each( arguments, function( _, arg ) { 4608 var index; 4609 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { 4610 list.splice( index, 1 ); 4611 4612 // Handle firing indexes 4613 if ( index <= firingIndex ) { 4614 firingIndex--; 4615 } 4616 } 4617 } ); 4618 return this; 4619 }, 4620 4621 // Check if a given callback is in the list. 4622 // If no argument is given, return whether or not list has callbacks attached. 4623 has: function( fn ) { 4624 return fn ? 4625 jQuery.inArray( fn, list ) > -1 : 4626 list.length > 0; 4627 }, 4628 4629 // Remove all callbacks from the list 4630 empty: function() { 4631 if ( list ) { 4632 list = []; 4633 } 4634 return this; 4635 }, 4636 4637 // Disable .fire and .add 4638 // Abort any current/pending executions 4639 // Clear all callbacks and values 4640 disable: function() { 4641 locked = queue = []; 4642 list = memory = ""; 4643 return this; 4644 }, 4645 disabled: function() { 4646 return !list; 4647 }, 4648 4649 // Disable .fire 4650 // Also disable .add unless we have memory (since it would have no effect) 4651 // Abort any pending executions 4652 lock: function() { 4653 locked = true; 4654 if ( !memory ) { 4655 self.disable(); 4656 } 4657 return this; 4658 }, 4659 locked: function() { 4660 return !!locked; 4661 }, 4662 4663 // Call all callbacks with the given context and arguments 4664 fireWith: function( context, args ) { 4665 if ( !locked ) { 4666 args = args || []; 4667 args = [ context, args.slice ? args.slice() : args ]; 4668 queue.push( args ); 4669 if ( !firing ) { 4670 fire(); 4671 } 4672 } 4673 return this; 4674 }, 4675 4676 // Call all the callbacks with the given arguments 4677 fire: function() { 4678 self.fireWith( this, arguments ); 4679 return this; 4680 }, 4681 4682 // To know if the callbacks have already been called at least once 4683 fired: function() { 4684 return !!fired; 4685 } 4686 }; 4687 4688 return self; 4689 }; 4690 4691 4692 jQuery.extend( { 4693 4694 Deferred: function( func ) { 4695 var tuples = [ 4696 4697 // action, add listener, listener list, final state 4698 [ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ], 4699 [ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ], 4700 [ "notify", "progress", jQuery.Callbacks( "memory" ) ] 4701 ], 4702 state = "pending", 4703 promise = { 4704 state: function() { 4705 return state; 4706 }, 4707 always: function() { 4708 deferred.done( arguments ).fail( arguments ); 4709 return this; 4710 }, 4711 then: function( /* fnDone, fnFail, fnProgress */ ) { 4712 var fns = arguments; 4713 return jQuery.Deferred( function( newDefer ) { 4714 jQuery.each( tuples, function( i, tuple ) { 4715 var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; 4716 4717 // deferred[ done | fail | progress ] for forwarding actions to newDefer 4718 deferred[ tuple[ 1 ] ]( function() { 4719 var returned = fn && fn.apply( this, arguments ); 4720 if ( returned && jQuery.isFunction( returned.promise ) ) { 4721 returned.promise() 4722 .progress( newDefer.notify ) 4723 .done( newDefer.resolve ) 4724 .fail( newDefer.reject ); 4725 } else { 4726 newDefer[ tuple[ 0 ] + "With" ]( 4727 this === promise ? newDefer.promise() : this, 4728 fn ? [ returned ] : arguments 4729 ); 4730 } 4731 } ); 4732 } ); 4733 fns = null; 4734 } ).promise(); 4735 }, 4736 4737 // Get a promise for this deferred 4738 // If obj is provided, the promise aspect is added to the object 4739 promise: function( obj ) { 4740 return obj != null ? jQuery.extend( obj, promise ) : promise; 4741 } 4742 }, 4743 deferred = {}; 4744 4745 // Keep pipe for back-compat 4746 promise.pipe = promise.then; 4747 4748 // Add list-specific methods 4749 jQuery.each( tuples, function( i, tuple ) { 4750 var list = tuple[ 2 ], 4751 stateString = tuple[ 3 ]; 4752 4753 // promise[ done | fail | progress ] = list.add 4754 promise[ tuple[ 1 ] ] = list.add; 4755 4756 // Handle state 4757 if ( stateString ) { 4758 list.add( function() { 4759 4760 // state = [ resolved | rejected ] 4761 state = stateString; 4762 4763 // [ reject_list | resolve_list ].disable; progress_list.lock 4764 }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); 4765 } 4766 4767 // deferred[ resolve | reject | notify ] 4768 deferred[ tuple[ 0 ] ] = function() { 4769 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments ); 4770 return this; 4771 }; 4772 deferred[ tuple[ 0 ] + "With" ] = list.fireWith; 4773 } ); 4774 4775 // Make the deferred a promise 4776 promise.promise( deferred ); 4777 4778 // Call given func if any 4779 if ( func ) { 4780 func.call( deferred, deferred ); 4781 } 4782 4783 // All done! 4784 return deferred; 4785 }, 4786 4787 // Deferred helper 4788 when: function( subordinate /* , ..., subordinateN */ ) { 4789 var i = 0, 4790 resolveValues = slice.call( arguments ), 4791 length = resolveValues.length, 4792 4793 // the count of uncompleted subordinates 4794 remaining = length !== 1 || 4795 ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, 4796 4797 // the master Deferred. 4798 // If resolveValues consist of only a single Deferred, just use that. 4799 deferred = remaining === 1 ? subordinate : jQuery.Deferred(), 4800 4801 // Update function for both resolve and progress values 4802 updateFunc = function( i, contexts, values ) { 4803 return function( value ) { 4804 contexts[ i ] = this; 4805 values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; 4806 if ( values === progressValues ) { 4807 deferred.notifyWith( contexts, values ); 4808 4809 } else if ( !( --remaining ) ) { 4810 deferred.resolveWith( contexts, values ); 4811 } 4812 }; 4813 }, 4814 4815 progressValues, progressContexts, resolveContexts; 4816 4817 // add listeners to Deferred subordinates; treat others as resolved 4818 if ( length > 1 ) { 4819 progressValues = new Array( length ); 4820 progressContexts = new Array( length ); 4821 resolveContexts = new Array( length ); 4822 for ( ; i < length; i++ ) { 4823 if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { 4824 resolveValues[ i ].promise() 4825 .progress( updateFunc( i, progressContexts, progressValues ) ) 4826 .done( updateFunc( i, resolveContexts, resolveValues ) ) 4827 .fail( deferred.reject ); 4828 } else { 4829 --remaining; 4830 } 4831 } 4832 } 4833 4834 // if we're not waiting on anything, resolve the master 4835 if ( !remaining ) {
4836 deferred.resolveWith( resolveContexts, resolveValues ); 4837 } 4838 4839 return deferred.promise(); 4840 } 4841 } ); 4842 4843 4844 // The deferred used on DOM ready 4845 var readyList; 4846 4847 jQuery.fn.ready = function( fn ) { 4848 4849 // Add the callback 4850 jQuery.ready.promise().done( fn ); 4851 4852 return this; 4853 }; 4854 4855 jQuery.extend( { 4856 4857 // Is the DOM ready to be used? Set to true once it occurs. 4858 isReady: false, 4859 4860 // A counter to track how many items to wait for before 4861 // the ready event fires. See #6781 4862 readyWait: 1, 4863 4864 // Hold (or release) the ready event 4865 holdReady: function( hold ) { 4866 if ( hold ) { 4867 jQuery.readyWait++; 4868 } else { 4869 jQuery.ready( true ); 4870 } 4871 }, 4872 4873 // Handle when the DOM is ready 4874 ready: function( wait ) { 4875 4876 // Abort if there are pending holds or we're already ready 4877 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { 4878 return; 4879 } 4880 4881 // Remember that the DOM is ready 4882 jQuery.isReady = true; 4883 4884 // If a normal DOM Ready event fired, decrement, and wait if need be 4885 if ( wait !== true && --jQuery.readyWait > 0 ) { 4886 return; 4887 } 4888 4889 // If there are functions bound, to execute 4890 readyList.resolveWith( document, [ jQuery ] ); 4891 4892 // Trigger any bound ready events 4893 if ( jQuery.fn.triggerHandler ) { 4894 jQuery( document ).triggerHandler( "ready" ); 4895 jQuery( document ).off( "ready" ); 4896 } 4897 } 4898 } ); 4899 4900 /** 4901 * Clean-up method for dom ready events 4902 */ 4903 function detach() { 4904 if ( document.addEventListener ) { 4905 document.removeEventListener( "DOMContentLoaded", completed ); 4906 window.removeEventListener( "load", completed ); 4907 4908 } else { 4909 document.detachEvent( "onreadystatechange", completed ); 4910 window.detachEvent( "onload", completed ); 4911 } 4912 } 4913 4914 /** 4915 * The ready event handler and self cleanup method 4916 */ 4917 function completed() { 4918 4919 // readyState === "complete" is good enough for us to call the dom ready in oldIE 4920 if ( document.addEventListener || 4921 window.event.type === "load" || 4922 document.readyState === "complete" ) { 4923 4924 detach(); 4925 jQuery.ready(); 4926 } 4927 } 4928 4929 jQuery.ready.promise = function( obj ) { 4930 if ( !readyList ) { 4931 4932 readyList = jQuery.Deferred(); 4933 4934 // Catch cases where $(document).ready() is called 4935 // after the browser event has already occurred. 4936 // Support: IE6-10 4937 // Older IE sometimes signals "interactive" too soon 4938 if ( document.readyState === "complete" || 4939 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { 4940 4941 // Handle it asynchronously to allow scripts the opportunity to delay ready 4942 window.setTimeout( jQuery.ready ); 4943 4944 // Standards-based browsers support DOMContentLoaded 4945 } else if ( document.addEventListener ) { 4946 4947 // Use the handy event callback 4948 document.addEventListener( "DOMContentLoaded", completed ); 4949 4950 // A fallback to window.onload, that will always work 4951 window.addEventListener( "load", completed ); 4952 4953 // If IE event model is used 4954 } else { 4955 4956 // Ensure firing before onload, maybe late but safe also for iframes 4957 document.attachEvent( "onreadystatechange", completed ); 4958 4959 // A fallback to window.onload, that will always work 4960 window.attachEvent( "onload", completed ); 4961 4962 // If IE and not a frame 4963 // continually check to see if the document is ready 4964 var top = false; 4965 4966 try { 4967 top = window.frameElement == null && document.documentElement; 4968 } catch ( e ) {} 4969 4970 if ( top && top.doScroll ) { 4971 ( function doScrollCheck() { 4972 if ( !jQuery.isReady ) { 4973 4974 try { 4975 4976 // Use the trick by Diego Perini 4977 // http://javascript.nwbox.com/IEContentLoaded/ 4978 top.doScroll( "left" ); 4979 } catch ( e ) { 4980 return window.setTimeout( doScrollCheck, 50 ); 4981 } 4982 4983 // detach all dom ready events 4984 detach(); 4985 4986 // and execute any waiting functions 4987 jQuery.ready(); 4988 } 4989 } )(); 4990 } 4991 } 4992 } 4993 return readyList.promise( obj ); 4994 }; 4995 4996 // Kick off the DOM ready check even if the user does not 4997 jQuery.ready.promise(); 4998 4999 5000 5001 5002 // Support: IE<9 5003 // Iteration over object's inherited properties before its own 5004 var i; 5005 for ( i in jQuery( support ) ) { 5006 break; 5007 } 5008 support.ownFirst = i === "0"; 5009 5010 // Note: most support tests are defined in their respective modules. 5011 // false until the test is run 5012 support.inlineBlockNeedsLayout = false;
vendor: 13,904 bytes, lines 5013-5564
5013 5014 // Execute ASAP in case we need to set body.style.zoom 5015 jQuery( function() { 5016 5017 // Minified: var a,b,c,d 5018 var val, div, body, container; 5019 5020 body = document.getElementsByTagName( "body" )[ 0 ]; 5021 if ( !body || !body.style ) { 5022 5023 // Return for frameset docs that don't have a body 5024 return; 5025 } 5026 5027 // Setup 5028 div = document.createElement( "div" ); 5029 container = document.createElement( "div" ); 5030 container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; 5031 body.appendChild( container ).appendChild( div ); 5032 5033 if ( typeof div.style.zoom !== "undefined" ) { 5034 5035 // Support: IE<8 5036 // Check if natively block-level elements act like inline-block 5037 // elements when setting their display to 'inline' and giving 5038 // them layout 5039 div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; 5040 5041 support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; 5042 if ( val ) { 5043 5044 // Prevent IE 6 from affecting layout for positioned elements #11048 5045 // Prevent IE from shrinking the body in IE 7 mode #12869 5046 // Support: IE<8 5047 body.style.zoom = 1; 5048 } 5049 } 5050 5051 body.removeChild( container ); 5052 } ); 5053 5054 5055 ( function() { 5056 var div = document.createElement( "div" ); 5057 5058 // Support: IE<9 5059 support.deleteExpando = true; 5060 try { 5061 delete div.test; 5062 } catch ( e ) { 5063 support.deleteExpando = false; 5064 } 5065 5066 // Null elements to avoid leaks in IE. 5067 div = null; 5068 } )(); 5069 var acceptData = function( elem ) { 5070 var noData = jQuery.noData[ ( elem.nodeName + " " ).toLowerCase() ], 5071 nodeType = +elem.nodeType || 1; 5072 5073 // Do not set data on non-element DOM nodes because it will not be cleared (#8335). 5074 return nodeType !== 1 && nodeType !== 9 ? 5075 false : 5076 5077 // Nodes accept data unless otherwise specified; rejection can be conditional 5078 !noData || noData !== true && elem.getAttribute( "classid" ) === noData; 5079 }; 5080 5081 5082 5083 5084 var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 5085 rmultiDash = /([A-Z])/g; 5086 5087 function dataAttr( elem, key, data ) { 5088 5089 // If nothing was found internally, try to fetch any 5090 // data from the HTML5 data-* attribute 5091 if ( data === undefined && elem.nodeType === 1 ) { 5092 5093 var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); 5094 5095 data = elem.getAttribute( name ); 5096 5097 if ( typeof data === "string" ) { 5098 try { 5099 data = data === "true" ? true : 5100 data === "false" ? false : 5101 data === "null" ? null : 5102 5103 // Only convert to a number if it doesn't change the string 5104 +data + "" === data ? +data : 5105 rbrace.test( data ) ? jQuery.parseJSON( data ) : 5106 data; 5107 } catch ( e ) {} 5108 5109 // Make sure we set the data so it isn't changed later 5110 jQuery.data( elem, key, data ); 5111 5112 } else { 5113 data = undefined; 5114 } 5115 } 5116 5117 return data; 5118 } 5119 5120 // checks a cache object for emptiness 5121 function isEmptyDataObject( obj ) { 5122 var name; 5123 for ( name in obj ) { 5124 5125 // if the public data object is empty, the private is still empty 5126 if ( name === "data" && jQuery.isEmptyObject( obj[ name ] ) ) { 5127 continue; 5128 } 5129 if ( name !== "toJSON" ) { 5130 return false; 5131 } 5132 } 5133 5134 return true; 5135 } 5136 5137 function internalData( elem, name, data, pvt /* Internal Use Only */ ) { 5138 if ( !acceptData( elem ) ) { 5139 return; 5140 } 5141 5142 var ret, thisCache, 5143 internalKey = jQuery.expando, 5144 5145 // We have to handle DOM nodes and JS objects differently because IE6-7 5146 // can't GC object references properly across the DOM-JS boundary 5147 isNode = elem.nodeType, 5148 5149 // Only DOM nodes need the global jQuery cache; JS object data is 5150 // attached directly to the object so GC can occur automatically 5151 cache = isNode ? jQuery.cache : elem, 5152 5153 // Only defining an ID for JS objects if its cache already exists allows 5154 // the code to shortcut on the same path as a DOM node with no cache 5155 id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; 5156 5157 // Avoid doing any more work than we need to when trying to get data on an 5158 // object that has no data at all 5159 if ( ( !id || !cache[ id ] || ( !pvt && !cache[ id ].data ) ) && 5160 data === undefined && typeof name === "string" ) { 5161 return; 5162 } 5163 5164 if ( !id ) { 5165 5166 // Only DOM nodes need a new unique ID for each element since their data 5167 // ends up in the global cache 5168 if ( isNode ) { 5169 id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++; 5170 } else { 5171 id = internalKey; 5172 } 5173 } 5174 5175 if ( !cache[ id ] ) { 5176 5177 // Avoid exposing jQuery metadata on plain JS objects when the object 5178 // is serialized using JSON.stringify 5179 cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; 5180 } 5181 5182 // An object can be passed to jQuery.data instead of a key/value pair; this gets 5183 // shallow copied over onto the existing cache 5184 if ( typeof name === "object" || typeof name === "function" ) { 5185 if ( pvt ) { 5186 cache[ id ] = jQuery.extend( cache[ id ], name ); 5187 } else { 5188 cache[ id ].data = jQuery.extend( cache[ id ].data, name ); 5189 } 5190 } 5191 5192 thisCache = cache[ id ]; 5193 5194 // jQuery data() is stored in a separate object inside the object's internal data 5195 // cache in order to avoid key collisions between internal data and user-defined 5196 // data. 5197 if ( !pvt ) { 5198 if ( !thisCache.data ) { 5199 thisCache.data = {}; 5200 } 5201 5202 thisCache = thisCache.data; 5203 } 5204 5205 if ( data !== undefined ) { 5206 thisCache[ jQuery.camelCase( name ) ] = data; 5207 } 5208 5209 // Check for both converted-to-camel and non-converted data property names 5210 // If a data property was specified 5211 if ( typeof name === "string" ) { 5212 5213 // First Try to find as-is property data 5214 ret = thisCache[ name ]; 5215 5216 // Test for null|undefined property data 5217 if ( ret == null ) { 5218 5219 // Try to find the camelCased property 5220 ret = thisCache[ jQuery.camelCase( name ) ]; 5221 } 5222 } else { 5223 ret = thisCache; 5224 } 5225 5226 return ret; 5227 } 5228 5229 function internalRemoveData( elem, name, pvt ) { 5230 if ( !acceptData( elem ) ) { 5231 return; 5232 } 5233 5234 var thisCache, i, 5235 isNode = elem.nodeType, 5236 5237 // See jQuery.data for more information 5238 cache = isNode ? jQuery.cache : elem, 5239 id = isNode ? elem[ jQuery.expando ] : jQuery.expando; 5240 5241 // If there is already no cache entry for this object, there is no 5242 // purpose in continuing 5243 if ( !cache[ id ] ) { 5244 return; 5245 } 5246 5247 if ( name ) { 5248 5249 thisCache = pvt ? cache[ id ] : cache[ id ].data; 5250 5251 if ( thisCache ) { 5252 5253 // Support array or space separated string names for data keys 5254 if ( !jQuery.isArray( name ) ) { 5255 5256 // try the string as a key before any manipulation 5257 if ( name in thisCache ) { 5258 name = [ name ]; 5259 } else { 5260 5261 // split the camel cased version by spaces unless a key with the spaces exists 5262 name = jQuery.camelCase( name ); 5263 if ( name in thisCache ) { 5264 name = [ name ]; 5265 } else { 5266 name = name.split( " " ); 5267 } 5268 } 5269 } else { 5270 5271 // If "name" is an array of keys... 5272 // When data is initially created, via ("key", "val") signature, 5273 // keys will be converted to camelCase. 5274 // Since there is no way to tell _how_ a key was added, remove 5275 // both plain key and camelCase key. #12786 5276 // This will only penalize the array argument path. 5277 name = name.concat( jQuery.map( name, jQuery.camelCase ) ); 5278 } 5279 5280 i = name.length; 5281 while ( i-- ) { 5282 delete thisCache[ name[ i ] ]; 5283 } 5284 5285 // If there is no data left in the cache, we want to continue 5286 // and let the cache object itself get destroyed 5287 if ( pvt ? !isEmptyDataObject( thisCache ) : !jQuery.isEmptyObject( thisCache ) ) { 5288 return; 5289 } 5290 } 5291 } 5292 5293 // See jQuery.data for more information 5294 if ( !pvt ) { 5295 delete cache[ id ].data; 5296 5297 // Don't destroy the parent cache unless the internal data object 5298 // had been the only thing left in it 5299 if ( !isEmptyDataObject( cache[ id ] ) ) { 5300 return; 5301 } 5302 } 5303 5304 // Destroy the cache 5305 if ( isNode ) { 5306 jQuery.cleanData( [ elem ], true ); 5307 5308 // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) 5309 /* jshint eqeqeq: false */ 5310 } else if ( support.deleteExpando || cache != cache.window ) { 5311 /* jshint eqeqeq: true */ 5312 delete cache[ id ]; 5313 5314 // When all else fails, undefined 5315 } else { 5316 cache[ id ] = undefined; 5317 } 5318 } 5319 5320 jQuery.extend( { 5321 cache: {}, 5322 5323 // The following elements (space-suffixed to avoid Object.prototype collisions) 5324 // throw uncatchable exceptions if you attempt to set expando properties 5325 noData: { 5326 "applet ": true, 5327 "embed ": true, 5328 5329 // ...but Flash objects (which have this classid) *can* handle expandos 5330 "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 5331 }, 5332 5333 hasData: function( elem ) { 5334 elem = elem.nodeType ? jQuery.cache[ elem[ jQuery.expando ] ] : elem[ jQuery.expando ]; 5335 return !!elem && !isEmptyDataObject( elem ); 5336 }, 5337 5338 data: function( elem, name, data ) { 5339 return internalData( elem, name, data ); 5340 }, 5341 5342 removeData: function( elem, name ) { 5343 return internalRemoveData( elem, name ); 5344 }, 5345 5346 // For internal use only. 5347 _data: function( elem, name, data ) { 5348 return internalData( elem, name, data, true ); 5349 }, 5350 5351 _removeData: function( elem, name ) { 5352 return internalRemoveData( elem, name, true ); 5353 } 5354 } ); 5355 5356 jQuery.fn.extend( { 5357 data: function( key, value ) { 5358 var i, name, data, 5359 elem = this[ 0 ], 5360 attrs = elem && elem.attributes; 5361 5362 // Special expections of .data basically thwart jQuery.access, 5363 // so implement the relevant behavior ourselves 5364 5365 // Gets all values 5366 if ( key === undefined ) { 5367 if ( this.length ) { 5368 data = jQuery.data( elem ); 5369 5370 if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { 5371 i = attrs.length; 5372 while ( i-- ) { 5373 5374 // Support: IE11+ 5375 // The attrs elements can be null (#14894) 5376 if ( attrs[ i ] ) { 5377 name = attrs[ i ].name; 5378 if ( name.indexOf( "data-" ) === 0 ) { 5379 name = jQuery.camelCase( name.slice( 5 ) ); 5380 dataAttr( elem, name, data[ name ] ); 5381 } 5382 } 5383 } 5384 jQuery._data( elem, "parsedAttrs", true ); 5385 } 5386 } 5387 5388 return data; 5389 } 5390 5391 // Sets multiple values 5392 if ( typeof key === "object" ) { 5393 return this.each( function() { 5394 jQuery.data( this, key ); 5395 } ); 5396 } 5397 5398 return arguments.length > 1 ? 5399 5400 // Sets one value 5401 this.each( function() { 5402 jQuery.data( this, key, value ); 5403 } ) : 5404 5405 // Gets one value 5406 // Try to fetch any internally stored data first 5407 elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined; 5408 }, 5409 5410 removeData: function( key ) { 5411 return this.each( function() { 5412 jQuery.removeData( this, key ); 5413 } ); 5414 } 5415 } ); 5416 5417 5418 jQuery.extend( { 5419 queue: function( elem, type, data ) { 5420 var queue; 5421 5422 if ( elem ) { 5423 type = ( type || "fx" ) + "queue"; 5424 queue = jQuery._data( elem, type ); 5425 5426 // Speed up dequeue by getting out quickly if this is just a lookup 5427 if ( data ) { 5428 if ( !queue || jQuery.isArray( data ) ) { 5429 queue = jQuery._data( elem, type, jQuery.makeArray( data ) ); 5430 } else { 5431 queue.push( data ); 5432 } 5433 } 5434 return queue || []; 5435 } 5436 }, 5437 5438 dequeue: function( elem, type ) { 5439 type = type || "fx"; 5440 5441 var queue = jQuery.queue( elem, type ), 5442 startLength = queue.length, 5443 fn = queue.shift(), 5444 hooks = jQuery._queueHooks( elem, type ), 5445 next = function() { 5446 jQuery.dequeue( elem, type ); 5447 }; 5448 5449 // If the fx queue is dequeued, always remove the progress sentinel 5450 if ( fn === "inprogress" ) { 5451 fn = queue.shift(); 5452 startLength--; 5453 } 5454 5455 if ( fn ) { 5456 5457 // Add a progress sentinel to prevent the fx queue from being 5458 // automatically dequeued 5459 if ( type === "fx" ) { 5460 queue.unshift( "inprogress" ); 5461 } 5462 5463 // clear up the last queue stop function 5464 delete hooks.stop; 5465 fn.call( elem, next, hooks ); 5466 } 5467 5468 if ( !startLength && hooks ) { 5469 hooks.empty.fire(); 5470 } 5471 }, 5472 5473 // not intended for public consumption - generates a queueHooks object, 5474 // or returns the current one 5475 _queueHooks: function( elem, type ) { 5476 var key = type + "queueHooks"; 5477 return jQuery._data( elem, key ) || jQuery._data( elem, key, { 5478 empty: jQuery.Callbacks( "once memory" ).add( function() { 5479 jQuery._removeData( elem, type + "queue" ); 5480 jQuery._removeData( elem, key ); 5481 } ) 5482 } ); 5483 } 5484 } ); 5485 5486 jQuery.fn.extend( { 5487 queue: function( type, data ) { 5488 var setter = 2; 5489 5490 if ( typeof type !== "string" ) { 5491 data = type; 5492 type = "fx"; 5493 setter--; 5494 } 5495 5496 if ( arguments.length < setter ) { 5497 return jQuery.queue( this[ 0 ], type ); 5498 } 5499 5500 return data === undefined ? 5501 this : 5502 this.each( function() { 5503 var queue = jQuery.queue( this, type, data ); 5504 5505 // ensure a hooks for this queue 5506 jQuery._queueHooks( this, type ); 5507 5508 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { 5509 jQuery.dequeue( this, type ); 5510 } 5511 } ); 5512 }, 5513 dequeue: function( type ) { 5514 return this.each( function() { 5515 jQuery.dequeue( this, type ); 5516 } ); 5517 }, 5518 clearQueue: function( type ) { 5519 return this.queue( type || "fx", [] ); 5520 }, 5521 5522 // Get a promise resolved when queues of a certain type 5523 // are emptied (fx is the type by default) 5524 promise: function( type, obj ) { 5525 var tmp, 5526 count = 1, 5527 defer = jQuery.Deferred(), 5528 elements = this, 5529 i = this.length, 5530 resolve = function() { 5531 if ( !( --count ) ) { 5532 defer.resolveWith( elements, [ elements ] ); 5533 } 5534 }; 5535 5536 if ( typeof type !== "string" ) { 5537 obj = type; 5538 type = undefined; 5539 } 5540 type = type || "fx"; 5541 5542 while ( i-- ) { 5543 tmp = jQuery._data( elements[ i ], type + "queueHooks" ); 5544 if ( tmp && tmp.empty ) { 5545 count++; 5546 tmp.empty.add( resolve ); 5547 } 5548 } 5549 resolve(); 5550 return defer.promise( obj ); 5551 } 5552 } ); 5553 5554 5555 ( function() { 5556 var shrinkWrapBlocksVal; 5557 5558 support.shrinkWrapBlocks = function() { 5559 if ( shrinkWrapBlocksVal != null ) { 5560 return shrinkWrapBlocksVal; 5561 } 5562 5563 // Will be changed later if needed. 5564 shrinkWrapBlocksVal = false;
vendor: 4,283 bytes, lines 5565-5713
5565 5566 // Minified: var b,c,d 5567 var div, body, container; 5568 5569 body = document.getElementsByTagName( "body" )[ 0 ]; 5570 if ( !body || !body.style ) { 5571 5572 // Test fired too early or in an unsupported environment, exit. 5573 return; 5574 } 5575 5576 // Setup 5577 div = document.createElement( "div" ); 5578 container = document.createElement( "div" ); 5579 container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; 5580 body.appendChild( container ).appendChild( div ); 5581 5582 // Support: IE6 5583 // Check if elements with layout shrink-wrap their children 5584 if ( typeof div.style.zoom !== "undefined" ) { 5585 5586 // Reset CSS: box-sizing; display; margin; border 5587 div.style.cssText = 5588 5589 // Support: Firefox<29, Android 2.3 5590 // Vendor-prefix box-sizing 5591 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + 5592 "box-sizing:content-box;display:block;margin:0;border:0;" + 5593 "padding:1px;width:1px;zoom:1"; 5594 div.appendChild( document.createElement( "div" ) ).style.width = "5px"; 5595 shrinkWrapBlocksVal = div.offsetWidth !== 3; 5596 } 5597 5598 body.removeChild( container ); 5599 5600 return shrinkWrapBlocksVal; 5601 }; 5602 5603 } )(); 5604 var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; 5605 5606 var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); 5607 5608 5609 var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; 5610 5611 var isHidden = function( elem, el ) { 5612 5613 // isHidden might be called from jQuery#filter function; 5614 // in that case, element will be second argument 5615 elem = el || elem; 5616 return jQuery.css( elem, "display" ) === "none" || 5617 !jQuery.contains( elem.ownerDocument, elem ); 5618 }; 5619 5620 5621 5622 function adjustCSS( elem, prop, valueParts, tween ) { 5623 var adjusted, 5624 scale = 1, 5625 maxIterations = 20, 5626 currentValue = tween ? 5627 function() { return tween.cur(); } : 5628 function() { return jQuery.css( elem, prop, "" ); }, 5629 initial = currentValue(), 5630 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), 5631 5632 // Starting value computation is required for potential unit mismatches 5633 initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && 5634 rcssNum.exec( jQuery.css( elem, prop ) ); 5635 5636 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { 5637 5638 // Trust units reported by jQuery.css 5639 unit = unit || initialInUnit[ 3 ]; 5640 5641 // Make sure we update the tween properties later on 5642 valueParts = valueParts || []; 5643 5644 // Iteratively approximate from a nonzero starting point 5645 initialInUnit = +initial || 1; 5646 5647 do { 5648 5649 // If previous iteration zeroed out, double until we get *something*. 5650 // Use string for doubling so we don't accidentally see scale as unchanged below 5651 scale = scale || ".5"; 5652 5653 // Adjust and apply 5654 initialInUnit = initialInUnit / scale; 5655 jQuery.style( elem, prop, initialInUnit + unit ); 5656 5657 // Update scale, tolerating zero or NaN from tween.cur() 5658 // Break the loop if scale is unchanged or perfect, or if we've just had enough. 5659 } while ( 5660 scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations 5661 ); 5662 } 5663 5664 if ( valueParts ) { 5665 initialInUnit = +initialInUnit || +initial || 0; 5666 5667 // Apply relative offset (+=/-=) if specified 5668 adjusted = valueParts[ 1 ] ? 5669 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : 5670 +valueParts[ 2 ]; 5671 if ( tween ) { 5672 tween.unit = unit; 5673 tween.start = initialInUnit; 5674 tween.end = adjusted; 5675 } 5676 } 5677 return adjusted; 5678 } 5679 5680 5681 // Multifunctional method to get and set values of a collection 5682 // The value/s can optionally be executed if it's a function 5683 var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 5684 var i = 0, 5685 length = elems.length, 5686 bulk = key == null; 5687 5688 // Sets many values 5689 if ( jQuery.type( key ) === "object" ) { 5690 chainable = true; 5691 for ( i in key ) { 5692 access( elems, fn, i, key[ i ], true, emptyGet, raw ); 5693 } 5694 5695 // Sets one value 5696 } else if ( value !== undefined ) { 5697 chainable = true; 5698 5699 if ( !jQuery.isFunction( value ) ) { 5700 raw = true; 5701 } 5702 5703 if ( bulk ) { 5704 5705 // Bulk operations run against the entire set 5706 if ( raw ) { 5707 fn.call( elems, value ); 5708 fn = null; 5709 5710 // ...except when executing function values 5711 } else { 5712 bulk = fn; 5713 fn = function( elem, key, value ) {
5714 return bulk.call( jQuery( elem ), value ); 5715 }; 5716 } 5717 } 5718 5719 if ( fn ) { 5720 for ( ; i < length; i++ ) { 5721 fn( 5722 elems[ i ], 5723 key, 5724 raw ? value : value.call( elems[ i ], i, fn( elems[ i ], key ) ) 5725 ); 5726 } 5727 } 5728 } 5729 5730 return chainable ? 5731 elems : 5732 5733 // Gets 5734 bulk ? 5735 fn.call( elems ) : 5736 length ? fn( elems[ 0 ], key ) : emptyGet; 5737 }; 5738 var rcheckableType = ( /^(?:checkbox|radio)$/i ); 5739 5740 var rtagName = ( /<([\w:-]+)/ ); 5741 5742 var rscriptType = ( /^$|\/(?:java|ecma)script/i ); 5743 5744 var rleadingWhitespace = ( /^\s+/ ); 5745 5746 var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|" + 5747 "details|dialog|figcaption|figure|footer|header|hgroup|main|" + 5748 "mark|meter|nav|output|picture|progress|section|summary|template|time|video"; 5749 5750 5751 5752 function createSafeFragment( document ) { 5753 var list = nodeNames.split( "|" ), 5754 safeFrag = document.createDocumentFragment(); 5755 5756 if ( safeFrag.createElement ) { 5757 while ( list.length ) { 5758 safeFrag.createElement( 5759 list.pop() 5760 ); 5761 } 5762 } 5763 return safeFrag; 5764 } 5765 5766 5767 ( function() { 5768 var div = document.createElement( "div" ), 5769 fragment = document.createDocumentFragment(), 5770 input = document.createElement( "input" ); 5771 5772 // Setup 5773 div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; 5774 5775 // IE strips leading whitespace when .innerHTML is used 5776 support.leadingWhitespace = div.firstChild.nodeType === 3; 5777 5778 // Make sure that tbody elements aren't automatically inserted 5779 // IE will insert them into empty tables 5780 support.tbody = !div.getElementsByTagName( "tbody" ).length; 5781 5782 // Make sure that link elements get serialized correctly by innerHTML 5783 // This requires a wrapper element in IE 5784 support.htmlSerialize = !!div.getElementsByTagName( "link" ).length; 5785 5786 // Makes sure cloning an html5 element does not cause problems 5787 // Where outerHTML is undefined, this still works 5788 support.html5Clone = 5789 document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>"; 5790 5791 // Check if a disconnected checkbox will retain its checked 5792 // value of true after appended to the DOM (IE6/7) 5793 input.type = "checkbox"; 5794 input.checked = true; 5795 fragment.appendChild( input ); 5796 support.appendChecked = input.checked; 5797 5798 // Make sure textarea (and checkbox) defaultValue is properly cloned 5799 // Support: IE6-IE11+ 5800 div.innerHTML = "<textarea>x</textarea>"; 5801 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 5802 5803 // #11217 - WebKit loses check when the name is after the checked attribute 5804 fragment.appendChild( div ); 5805 5806 // Support: Windows Web Apps (WWA) 5807 // `name` and `type` must use .setAttribute for WWA (#14901) 5808 input = document.createElement( "input" ); 5809 input.setAttribute( "type", "radio" ); 5810 input.setAttribute( "checked", "checked" ); 5811 input.setAttribute( "name", "t" ); 5812 5813 div.appendChild( input ); 5814 5815 // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 5816 // old WebKit doesn't clone checked state correctly in fragments 5817 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; 5818 5819 // Support: IE<9 5820 // Cloned elements keep attachEvent handlers, we use addEventListener on IE9+ 5821 support.noCloneEvent = !!div.addEventListener; 5822 5823 // Support: IE<9 5824 // Since attributes and properties are the same in IE, 5825 // cleanData must set properties to undefined rather than use removeAttribute 5826 div[ jQuery.expando ] = 1; 5827 support.attributes = !div.getAttribute( jQuery.expando ); 5828 } )(); 5829 5830 5831 // We have to close these tags to support XHTML (#13200) 5832 var wrapMap = { 5833 option: [ 1, "<select multiple='multiple'>", "</select>" ], 5834 legend: [ 1, "<fieldset>", "</fieldset>" ], 5835 area: [ 1, "<map>", "</map>" ], 5836 5837 // Support: IE8 5838 param: [ 1, "<object>", "</object>" ], 5839 thead: [ 1, "<table>", "</table>" ], 5840 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 5841 col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], 5842 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 5843 5844 // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, 5845 // unless wrapped in a div with non-breaking characters in front of it. 5846 _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] 5847 }; 5848 5849 // Support: IE8-IE9 5850 wrapMap.optgroup = wrapMap.option; 5851 5852 wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 5853 wrapMap.th = wrapMap.td; 5854 5855 5856 function getAll( context, tag ) { 5857 var elems, elem, 5858 i = 0, 5859 found = typeof context.getElementsByTagName !== "undefined" ? 5860 context.getElementsByTagName( tag || "*" ) : 5861 typeof context.querySelectorAll !== "undefined" ? 5862 context.querySelectorAll( tag || "*" ) : 5863 undefined; 5864 5865 if ( !found ) { 5866 for ( found = [], elems = context.childNodes || context; 5867 ( elem = elems[ i ] ) != null; 5868 i++ 5869 ) { 5870 if ( !tag || jQuery.nodeName( elem, tag ) ) { 5871 found.push( elem ); 5872 } else { 5873 jQuery.merge( found, getAll( elem, tag ) ); 5874 } 5875 } 5876 } 5877 5878 return tag === undefined || tag && jQuery.nodeName( context, tag ) ? 5879 jQuery.merge( [ context ], found ) : 5880 found; 5881 } 5882 5883 5884 // Mark scripts as having already been evaluated 5885 function setGlobalEval( elems, refElements ) { 5886 var elem, 5887 i = 0; 5888 for ( ; ( elem = elems[ i ] ) != null; i++ ) { 5889 jQuery._data( 5890 elem, 5891 "globalEval", 5892 !refElements || jQuery._data( refElements[ i ], "globalEval" ) 5893 ); 5894 } 5895 } 5896 5897
vendor: 46,866 bytes, lines 5898-7530
5898 var rhtml = /<|&#?\w+;/, 5899 rtbody = /<tbody/i; 5900 5901 function fixDefaultChecked( elem ) { 5902 if ( rcheckableType.test( elem.type ) ) { 5903 elem.defaultChecked = elem.checked; 5904 } 5905 } 5906 5907 function buildFragment( elems, context, scripts, selection, ignored ) { 5908 var j, elem, contains, 5909 tmp, tag, tbody, wrap, 5910 l = elems.length, 5911 5912 // Ensure a safe fragment 5913 safe = createSafeFragment( context ), 5914 5915 nodes = [], 5916 i = 0; 5917 5918 for ( ; i < l; i++ ) { 5919 elem = elems[ i ]; 5920 5921 if ( elem || elem === 0 ) { 5922 5923 // Add nodes directly 5924 if ( jQuery.type( elem ) === "object" ) { 5925 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 5926 5927 // Convert non-html into a text node 5928 } else if ( !rhtml.test( elem ) ) { 5929 nodes.push( context.createTextNode( elem ) ); 5930 5931 // Convert html into DOM nodes 5932 } else { 5933 tmp = tmp || safe.appendChild( context.createElement( "div" ) ); 5934 5935 // Deserialize a standard representation 5936 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); 5937 wrap = wrapMap[ tag ] || wrapMap._default; 5938 5939 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; 5940 5941 // Descend through wrappers to the right content 5942 j = wrap[ 0 ]; 5943 while ( j-- ) { 5944 tmp = tmp.lastChild; 5945 } 5946 5947 // Manually add leading whitespace removed by IE 5948 if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { 5949 nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[ 0 ] ) ); 5950 } 5951 5952 // Remove IE's autoinserted <tbody> from table fragments 5953 if ( !support.tbody ) { 5954 5955 // String was a <table>, *may* have spurious <tbody> 5956 elem = tag === "table" && !rtbody.test( elem ) ? 5957 tmp.firstChild : 5958 5959 // String was a bare <thead> or <tfoot> 5960 wrap[ 1 ] === "<table>" && !rtbody.test( elem ) ? 5961 tmp : 5962 0; 5963 5964 j = elem && elem.childNodes.length; 5965 while ( j-- ) { 5966 if ( jQuery.nodeName( ( tbody = elem.childNodes[ j ] ), "tbody" ) && 5967 !tbody.childNodes.length ) { 5968 5969 elem.removeChild( tbody ); 5970 } 5971 } 5972 } 5973 5974 jQuery.merge( nodes, tmp.childNodes ); 5975 5976 // Fix #12392 for WebKit and IE > 9 5977 tmp.textContent = ""; 5978 5979 // Fix #12392 for oldIE 5980 while ( tmp.firstChild ) { 5981 tmp.removeChild( tmp.firstChild ); 5982 } 5983 5984 // Remember the top-level container for proper cleanup 5985 tmp = safe.lastChild; 5986 } 5987 } 5988 } 5989 5990 // Fix #11356: Clear elements from fragment 5991 if ( tmp ) { 5992 safe.removeChild( tmp ); 5993 } 5994 5995 // Reset defaultChecked for any radios and checkboxes 5996 // about to be appended to the DOM in IE 6/7 (#8060) 5997 if ( !support.appendChecked ) { 5998 jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); 5999 } 6000 6001 i = 0; 6002 while ( ( elem = nodes[ i++ ] ) ) { 6003 6004 // Skip elements already in the context collection (trac-4087) 6005 if ( selection && jQuery.inArray( elem, selection ) > -1 ) { 6006 if ( ignored ) { 6007 ignored.push( elem ); 6008 } 6009 6010 continue; 6011 } 6012 6013 contains = jQuery.contains( elem.ownerDocument, elem ); 6014 6015 // Append to fragment 6016 tmp = getAll( safe.appendChild( elem ), "script" ); 6017 6018 // Preserve script evaluation history 6019 if ( contains ) { 6020 setGlobalEval( tmp ); 6021 } 6022 6023 // Capture executables 6024 if ( scripts ) { 6025 j = 0; 6026 while ( ( elem = tmp[ j++ ] ) ) { 6027 if ( rscriptType.test( elem.type || "" ) ) { 6028 scripts.push( elem ); 6029 } 6030 } 6031 } 6032 } 6033 6034 tmp = null; 6035 6036 return safe; 6037 } 6038 6039 6040 ( function() { 6041 var i, eventName, 6042 div = document.createElement( "div" ); 6043 6044 // Support: IE<9 (lack submit/change bubble), Firefox (lack focus(in | out) events) 6045 for ( i in { submit: true, change: true, focusin: true } ) { 6046 eventName = "on" + i; 6047 6048 if ( !( support[ i ] = eventName in window ) ) { 6049 6050 // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) 6051 div.setAttribute( eventName, "t" ); 6052 support[ i ] = div.attributes[ eventName ].expando === false; 6053 } 6054 } 6055 6056 // Null elements to avoid leaks in IE. 6057 div = null; 6058 } )(); 6059 6060 6061 var rformElems = /^(?:input|select|textarea)$/i, 6062 rkeyEvent = /^key/, 6063 rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, 6064 rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, 6065 rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 6066 6067 function returnTrue() { 6068 return true; 6069 } 6070 6071 function returnFalse() { 6072 return false; 6073 } 6074 6075 // Support: IE9 6076 // See #13393 for more info 6077 function safeActiveElement() { 6078 try { 6079 return document.activeElement; 6080 } catch ( err ) { } 6081 } 6082 6083 function on( elem, types, selector, data, fn, one ) { 6084 var origFn, type; 6085 6086 // Types can be a map of types/handlers 6087 if ( typeof types === "object" ) { 6088 6089 // ( types-Object, selector, data ) 6090 if ( typeof selector !== "string" ) { 6091 6092 // ( types-Object, data ) 6093 data = data || selector; 6094 selector = undefined; 6095 } 6096 for ( type in types ) { 6097 on( elem, type, selector, data, types[ type ], one ); 6098 } 6099 return elem; 6100 } 6101 6102 if ( data == null && fn == null ) { 6103 6104 // ( types, fn ) 6105 fn = selector; 6106 data = selector = undefined; 6107 } else if ( fn == null ) { 6108 if ( typeof selector === "string" ) { 6109 6110 // ( types, selector, fn ) 6111 fn = data; 6112 data = undefined; 6113 } else { 6114 6115 // ( types, data, fn ) 6116 fn = data; 6117 data = selector; 6118 selector = undefined; 6119 } 6120 } 6121 if ( fn === false ) { 6122 fn = returnFalse; 6123 } else if ( !fn ) { 6124 return elem; 6125 } 6126 6127 if ( one === 1 ) { 6128 origFn = fn; 6129 fn = function( event ) { 6130 6131 // Can use an empty set, since event contains the info 6132 jQuery().off( event ); 6133 return origFn.apply( this, arguments ); 6134 }; 6135 6136 // Use same guid so caller can remove using origFn 6137 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); 6138 } 6139 return elem.each( function() { 6140 jQuery.event.add( this, types, fn, data, selector ); 6141 } ); 6142 } 6143 6144 /* 6145 * Helper functions for managing events -- not part of the public interface. 6146 * Props to Dean Edwards' addEvent library for many of the ideas. 6147 */ 6148 jQuery.event = { 6149 6150 global: {}, 6151 6152 add: function( elem, types, handler, data, selector ) { 6153 var tmp, events, t, handleObjIn, 6154 special, eventHandle, handleObj, 6155 handlers, type, namespaces, origType, 6156 elemData = jQuery._data( elem ); 6157 6158 // Don't attach events to noData or text/comment nodes (but allow plain objects) 6159 if ( !elemData ) { 6160 return; 6161 } 6162 6163 // Caller can pass in an object of custom data in lieu of the handler 6164 if ( handler.handler ) { 6165 handleObjIn = handler; 6166 handler = handleObjIn.handler; 6167 selector = handleObjIn.selector; 6168 } 6169 6170 // Make sure that the handler has a unique ID, used to find/remove it later 6171 if ( !handler.guid ) { 6172 handler.guid = jQuery.guid++; 6173 } 6174 6175 // Init the element's event structure and main handler, if this is the first 6176 if ( !( events = elemData.events ) ) { 6177 events = elemData.events = {}; 6178 } 6179 if ( !( eventHandle = elemData.handle ) ) { 6180 eventHandle = elemData.handle = function( e ) { 6181 6182 // Discard the second event of a jQuery.event.trigger() and 6183 // when an event is called after a page has unloaded 6184 return typeof jQuery !== "undefined" && 6185 ( !e || jQuery.event.triggered !== e.type ) ? 6186 jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : 6187 undefined; 6188 }; 6189 6190 // Add elem as a property of the handle fn to prevent a memory leak 6191 // with IE non-native events 6192 eventHandle.elem = elem; 6193 } 6194 6195 // Handle multiple events separated by a space 6196 types = ( types || "" ).match( rnotwhite ) || [ "" ]; 6197 t = types.length; 6198 while ( t-- ) { 6199 tmp = rtypenamespace.exec( types[ t ] ) || []; 6200 type = origType = tmp[ 1 ]; 6201 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 6202 6203 // There *must* be a type, no attaching namespace-only handlers 6204 if ( !type ) { 6205 continue; 6206 } 6207 6208 // If event changes its type, use the special event handlers for the changed type 6209 special = jQuery.event.special[ type ] || {}; 6210 6211 // If selector defined, determine special event api type, otherwise given type 6212 type = ( selector ? special.delegateType : special.bindType ) || type; 6213 6214 // Update special based on newly reset type 6215 special = jQuery.event.special[ type ] || {}; 6216 6217 // handleObj is passed to all event handlers 6218 handleObj = jQuery.extend( { 6219 type: type, 6220 origType: origType, 6221 data: data, 6222 handler: handler, 6223 guid: handler.guid, 6224 selector: selector, 6225 needsContext: selector && jQuery.expr.match.needsContext.test( selector ), 6226 namespace: namespaces.join( "." ) 6227 }, handleObjIn ); 6228 6229 // Init the event handler queue if we're the first 6230 if ( !( handlers = events[ type ] ) ) { 6231 handlers = events[ type ] = []; 6232 handlers.delegateCount = 0; 6233 6234 // Only use addEventListener/attachEvent if the special events handler returns false 6235 if ( !special.setup || 6236 special.setup.call( elem, data, namespaces, eventHandle ) === false ) { 6237 6238 // Bind the global event handler to the element 6239 if ( elem.addEventListener ) { 6240 elem.addEventListener( type, eventHandle, false ); 6241 6242 } else if ( elem.attachEvent ) { 6243 elem.attachEvent( "on" + type, eventHandle ); 6244 } 6245 } 6246 } 6247 6248 if ( special.add ) { 6249 special.add.call( elem, handleObj ); 6250 6251 if ( !handleObj.handler.guid ) { 6252 handleObj.handler.guid = handler.guid; 6253 } 6254 } 6255 6256 // Add to the element's handler list, delegates in front 6257 if ( selector ) { 6258 handlers.splice( handlers.delegateCount++, 0, handleObj ); 6259 } else { 6260 handlers.push( handleObj ); 6261 } 6262 6263 // Keep track of which events have ever been used, for event optimization 6264 jQuery.event.global[ type ] = true; 6265 } 6266 6267 // Nullify elem to prevent memory leaks in IE 6268 elem = null; 6269 }, 6270 6271 // Detach an event or set of events from an element 6272 remove: function( elem, types, handler, selector, mappedTypes ) { 6273 var j, handleObj, tmp, 6274 origCount, t, events, 6275 special, handlers, type, 6276 namespaces, origType, 6277 elemData = jQuery.hasData( elem ) && jQuery._data( elem ); 6278 6279 if ( !elemData || !( events = elemData.events ) ) { 6280 return; 6281 } 6282 6283 // Once for each type.namespace in types; type may be omitted 6284 types = ( types || "" ).match( rnotwhite ) || [ "" ]; 6285 t = types.length; 6286 while ( t-- ) { 6287 tmp = rtypenamespace.exec( types[ t ] ) || []; 6288 type = origType = tmp[ 1 ]; 6289 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 6290 6291 // Unbind all events (on this namespace, if provided) for the element 6292 if ( !type ) { 6293 for ( type in events ) { 6294 jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); 6295 } 6296 continue; 6297 } 6298 6299 special = jQuery.event.special[ type ] || {}; 6300 type = ( selector ? special.delegateType : special.bindType ) || type; 6301 handlers = events[ type ] || []; 6302 tmp = tmp[ 2 ] && 6303 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); 6304 6305 // Remove matching events 6306 origCount = j = handlers.length; 6307 while ( j-- ) { 6308 handleObj = handlers[ j ]; 6309 6310 if ( ( mappedTypes || origType === handleObj.origType ) && 6311 ( !handler || handler.guid === handleObj.guid ) && 6312 ( !tmp || tmp.test( handleObj.namespace ) ) && 6313 ( !selector || selector === handleObj.selector || 6314 selector === "**" && handleObj.selector ) ) { 6315 handlers.splice( j, 1 ); 6316 6317 if ( handleObj.selector ) { 6318 handlers.delegateCount--; 6319 } 6320 if ( special.remove ) { 6321 special.remove.call( elem, handleObj ); 6322 } 6323 } 6324 } 6325 6326 // Remove generic event handler if we removed something and no more handlers exist 6327 // (avoids potential for endless recursion during removal of special event handlers) 6328 if ( origCount && !handlers.length ) { 6329 if ( !special.teardown || 6330 special.teardown.call( elem, namespaces, elemData.handle ) === false ) { 6331 6332 jQuery.removeEvent( elem, type, elemData.handle ); 6333 } 6334 6335 delete events[ type ]; 6336 } 6337 } 6338 6339 // Remove the expando if it's no longer used 6340 if ( jQuery.isEmptyObject( events ) ) { 6341 delete elemData.handle; 6342 6343 // removeData also checks for emptiness and clears the expando if empty 6344 // so use it instead of delete 6345 jQuery._removeData( elem, "events" ); 6346 } 6347 }, 6348 6349 trigger: function( event, data, elem, onlyHandlers ) { 6350 var handle, ontype, cur, 6351 bubbleType, special, tmp, i, 6352 eventPath = [ elem || document ], 6353 type = hasOwn.call( event, "type" ) ? event.type : event, 6354 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; 6355 6356 cur = tmp = elem = elem || document; 6357 6358 // Don't do events on text and comment nodes 6359 if ( elem.nodeType === 3 || elem.nodeType === 8 ) { 6360 return; 6361 } 6362 6363 // focus/blur morphs to focusin/out; ensure we're not firing them right now 6364 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { 6365 return; 6366 } 6367 6368 if ( type.indexOf( "." ) > -1 ) { 6369 6370 // Namespaced trigger; create a regexp to match event type in handle() 6371 namespaces = type.split( "." ); 6372 type = namespaces.shift(); 6373 namespaces.sort(); 6374 } 6375 ontype = type.indexOf( ":" ) < 0 && "on" + type; 6376 6377 // Caller can pass in a jQuery.Event object, Object, or just an event type string 6378 event = event[ jQuery.expando ] ? 6379 event : 6380 new jQuery.Event( type, typeof event === "object" && event ); 6381 6382 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) 6383 event.isTrigger = onlyHandlers ? 2 : 3; 6384 event.namespace = namespaces.join( "." ); 6385 event.rnamespace = event.namespace ? 6386 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : 6387 null; 6388 6389 // Clean up the event in case it is being reused 6390 event.result = undefined; 6391 if ( !event.target ) { 6392 event.target = elem; 6393 } 6394 6395 // Clone any incoming data and prepend the event, creating the handler arg list 6396 data = data == null ? 6397 [ event ] : 6398 jQuery.makeArray( data, [ event ] ); 6399 6400 // Allow special events to draw outside the lines 6401 special = jQuery.event.special[ type ] || {}; 6402 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { 6403 return; 6404 } 6405 6406 // Determine event propagation path in advance, per W3C events spec (#9951) 6407 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) 6408 if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { 6409 6410 bubbleType = special.delegateType || type; 6411 if ( !rfocusMorph.test( bubbleType + type ) ) { 6412 cur = cur.parentNode; 6413 } 6414 for ( ; cur; cur = cur.parentNode ) { 6415 eventPath.push( cur ); 6416 tmp = cur; 6417 } 6418 6419 // Only add window if we got to document (e.g., not plain obj or detached DOM) 6420 if ( tmp === ( elem.ownerDocument || document ) ) { 6421 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 6422 } 6423 } 6424 6425 // Fire handlers on the event path 6426 i = 0; 6427 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { 6428 6429 event.type = i > 1 ? 6430 bubbleType : 6431 special.bindType || type; 6432 6433 // jQuery handler 6434 handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && 6435 jQuery._data( cur, "handle" ); 6436 6437 if ( handle ) { 6438 handle.apply( cur, data ); 6439 } 6440 6441 // Native handler 6442 handle = ontype && cur[ ontype ]; 6443 if ( handle && handle.apply && acceptData( cur ) ) { 6444 event.result = handle.apply( cur, data ); 6445 if ( event.result === false ) { 6446 event.preventDefault(); 6447 } 6448 } 6449 } 6450 event.type = type; 6451 6452 // If nobody prevented the default action, do it now 6453 if ( !onlyHandlers && !event.isDefaultPrevented() ) { 6454 6455 if ( 6456 ( !special._default || 6457 special._default.apply( eventPath.pop(), data ) === false 6458 ) && acceptData( elem ) 6459 ) { 6460 6461 // Call a native DOM method on the target with the same name name as the event. 6462 // Can't use an .isFunction() check here because IE6/7 fails that test. 6463 // Don't do default actions on window, that's where global variables be (#6170) 6464 if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { 6465 6466 // Don't re-trigger an onFOO event when we call its FOO() method 6467 tmp = elem[ ontype ]; 6468 6469 if ( tmp ) { 6470 elem[ ontype ] = null; 6471 } 6472 6473 // Prevent re-triggering of the same event, since we already bubbled it above 6474 jQuery.event.triggered = type; 6475 try { 6476 elem[ type ](); 6477 } catch ( e ) { 6478 6479 // IE<9 dies on focus/blur to hidden element (#1486,#12518) 6480 // only reproducible on winXP IE8 native, not IE9 in IE8 mode 6481 } 6482 jQuery.event.triggered = undefined; 6483 6484 if ( tmp ) { 6485 elem[ ontype ] = tmp; 6486 } 6487 } 6488 } 6489 } 6490 6491 return event.result; 6492 }, 6493 6494 dispatch: function( event ) { 6495 6496 // Make a writable jQuery.Event from the native event object 6497 event = jQuery.event.fix( event ); 6498 6499 var i, j, ret, matched, handleObj, 6500 handlerQueue = [], 6501 args = slice.call( arguments ), 6502 handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], 6503 special = jQuery.event.special[ event.type ] || {}; 6504 6505 // Use the fix-ed jQuery.Event rather than the (read-only) native event 6506 args[ 0 ] = event; 6507 event.delegateTarget = this; 6508 6509 // Call the preDispatch hook for the mapped type, and let it bail if desired 6510 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { 6511 return; 6512 } 6513 6514 // Determine handlers 6515 handlerQueue = jQuery.event.handlers.call( this, event, handlers ); 6516 6517 // Run delegates first; they may want to stop propagation beneath us 6518 i = 0; 6519 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { 6520 event.currentTarget = matched.elem; 6521 6522 j = 0; 6523 while ( ( handleObj = matched.handlers[ j++ ] ) && 6524 !event.isImmediatePropagationStopped() ) { 6525 6526 // Triggered event must either 1) have no namespace, or 2) have namespace(s) 6527 // a subset or equal to those in the bound event (both can have no namespace). 6528 if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) { 6529 6530 event.handleObj = handleObj; 6531 event.data = handleObj.data; 6532 6533 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || 6534 handleObj.handler ).apply( matched.elem, args ); 6535 6536 if ( ret !== undefined ) { 6537 if ( ( event.result = ret ) === false ) { 6538 event.preventDefault(); 6539 event.stopPropagation(); 6540 } 6541 } 6542 } 6543 } 6544 } 6545 6546 // Call the postDispatch hook for the mapped type 6547 if ( special.postDispatch ) { 6548 special.postDispatch.call( this, event ); 6549 } 6550 6551 return event.result; 6552 }, 6553 6554 handlers: function( event, handlers ) { 6555 var i, matches, sel, handleObj, 6556 handlerQueue = [], 6557 delegateCount = handlers.delegateCount, 6558 cur = event.target; 6559 6560 // Support (at least): Chrome, IE9 6561 // Find delegate handlers 6562 // Black-hole SVG <use> instance trees (#13180) 6563 // 6564 // Support: Firefox<=42+ 6565 // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343) 6566 if ( delegateCount && cur.nodeType && 6567 ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) { 6568 6569 /* jshint eqeqeq: false */ 6570 for ( ; cur != this; cur = cur.parentNode || this ) { 6571 /* jshint eqeqeq: true */ 6572 6573 // Don't check non-elements (#13208) 6574 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) 6575 if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) { 6576 matches = []; 6577 for ( i = 0; i < delegateCount; i++ ) { 6578 handleObj = handlers[ i ]; 6579 6580 // Don't conflict with Object.prototype properties (#13203) 6581 sel = handleObj.selector + " "; 6582 6583 if ( matches[ sel ] === undefined ) { 6584 matches[ sel ] = handleObj.needsContext ? 6585 jQuery( sel, this ).index( cur ) > -1 : 6586 jQuery.find( sel, this, null, [ cur ] ).length; 6587 } 6588 if ( matches[ sel ] ) { 6589 matches.push( handleObj ); 6590 } 6591 } 6592 if ( matches.length ) { 6593 handlerQueue.push( { elem: cur, handlers: matches } ); 6594 } 6595 } 6596 } 6597 } 6598 6599 // Add the remaining (directly-bound) handlers 6600 if ( delegateCount < handlers.length ) { 6601 handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } ); 6602 } 6603 6604 return handlerQueue; 6605 }, 6606 6607 fix: function( event ) { 6608 if ( event[ jQuery.expando ] ) { 6609 return event; 6610 } 6611 6612 // Create a writable copy of the event object and normalize some properties 6613 var i, prop, copy, 6614 type = event.type, 6615 originalEvent = event, 6616 fixHook = this.fixHooks[ type ]; 6617 6618 if ( !fixHook ) { 6619 this.fixHooks[ type ] = fixHook = 6620 rmouseEvent.test( type ) ? this.mouseHooks : 6621 rkeyEvent.test( type ) ? this.keyHooks : 6622 {}; 6623 } 6624 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; 6625 6626 event = new jQuery.Event( originalEvent ); 6627 6628 i = copy.length; 6629 while ( i-- ) { 6630 prop = copy[ i ]; 6631 event[ prop ] = originalEvent[ prop ]; 6632 } 6633 6634 // Support: IE<9 6635 // Fix target property (#1925) 6636 if ( !event.target ) { 6637 event.target = originalEvent.srcElement || document; 6638 } 6639 6640 // Support: Safari 6-8+ 6641 // Target should not be a text node (#504, #13143) 6642 if ( event.target.nodeType === 3 ) { 6643 event.target = event.target.parentNode; 6644 } 6645 6646 // Support: IE<9 6647 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) 6648 event.metaKey = !!event.metaKey; 6649 6650 return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; 6651 }, 6652 6653 // Includes some event props shared by KeyEvent and MouseEvent 6654 props: ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " + 6655 "metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ), 6656 6657 fixHooks: {}, 6658 6659 keyHooks: { 6660 props: "char charCode key keyCode".split( " " ), 6661 filter: function( event, original ) { 6662 6663 // Add which for key events 6664 if ( event.which == null ) { 6665 event.which = original.charCode != null ? original.charCode : original.keyCode; 6666 } 6667 6668 return event; 6669 } 6670 }, 6671 6672 mouseHooks: { 6673 props: ( "button buttons clientX clientY fromElement offsetX offsetY " + 6674 "pageX pageY screenX screenY toElement" ).split( " " ), 6675 filter: function( event, original ) { 6676 var body, eventDoc, doc, 6677 button = original.button, 6678 fromElement = original.fromElement; 6679 6680 // Calculate pageX/Y if missing and clientX/Y available 6681 if ( event.pageX == null && original.clientX != null ) { 6682 eventDoc = event.target.ownerDocument || document; 6683 doc = eventDoc.documentElement; 6684 body = eventDoc.body; 6685 6686 event.pageX = original.clientX + 6687 ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - 6688 ( doc && doc.clientLeft || body && body.clientLeft || 0 ); 6689 event.pageY = original.clientY + 6690 ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - 6691 ( doc && doc.clientTop || body && body.clientTop || 0 ); 6692 } 6693 6694 // Add relatedTarget, if necessary 6695 if ( !event.relatedTarget && fromElement ) { 6696 event.relatedTarget = fromElement === event.target ? 6697 original.toElement : 6698 fromElement; 6699 } 6700 6701 // Add which for click: 1 === left; 2 === middle; 3 === right 6702 // Note: button is not normalized, so don't use it 6703 if ( !event.which && button !== undefined ) { 6704 event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); 6705 } 6706 6707 return event; 6708 } 6709 }, 6710 6711 special: { 6712 load: { 6713 6714 // Prevent triggered image.load events from bubbling to window.load 6715 noBubble: true 6716 }, 6717 focus: { 6718 6719 // Fire native event if possible so blur/focus sequence is correct 6720 trigger: function() { 6721 if ( this !== safeActiveElement() && this.focus ) { 6722 try { 6723 this.focus(); 6724 return false; 6725 } catch ( e ) { 6726 6727 // Support: IE<9 6728 // If we error on focus to hidden element (#1486, #12518), 6729 // let .trigger() run the handlers 6730 } 6731 } 6732 }, 6733 delegateType: "focusin" 6734 }, 6735 blur: { 6736 trigger: function() { 6737 if ( this === safeActiveElement() && this.blur ) { 6738 this.blur(); 6739 return false; 6740 } 6741 }, 6742 delegateType: "focusout" 6743 }, 6744 click: { 6745 6746 // For checkbox, fire native event so checked state will be right 6747 trigger: function() { 6748 if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { 6749 this.click(); 6750 return false; 6751 } 6752 }, 6753 6754 // For cross-browser consistency, don't fire native .click() on links 6755 _default: function( event ) { 6756 return jQuery.nodeName( event.target, "a" ); 6757 } 6758 }, 6759 6760 beforeunload: { 6761 postDispatch: function( event ) { 6762 6763 // Support: Firefox 20+ 6764 // Firefox doesn't alert if the returnValue field is not set. 6765 if ( event.result !== undefined && event.originalEvent ) { 6766 event.originalEvent.returnValue = event.result; 6767 } 6768 } 6769 } 6770 }, 6771 6772 // Piggyback on a donor event to simulate a different one 6773 simulate: function( type, elem, event ) { 6774 var e = jQuery.extend( 6775 new jQuery.Event(), 6776 event, 6777 { 6778 type: type, 6779 isSimulated: true 6780 6781 // Previously, `originalEvent: {}` was set here, so stopPropagation call 6782 // would not be triggered on donor event, since in our own 6783 // jQuery.event.stopPropagation function we had a check for existence of 6784 // originalEvent.stopPropagation method, so, consequently it would be a noop. 6785 // 6786 // Guard for simulated events was moved to jQuery.event.stopPropagation function 6787 // since `originalEvent` should point to the original event for the 6788 // constancy with other events and for more focused logic 6789 } 6790 ); 6791 6792 jQuery.event.trigger( e, null, elem ); 6793 6794 if ( e.isDefaultPrevented() ) { 6795 event.preventDefault(); 6796 } 6797 } 6798 }; 6799 6800 jQuery.removeEvent = document.removeEventListener ? 6801 function( elem, type, handle ) { 6802 6803 // This "if" is needed for plain objects 6804 if ( elem.removeEventListener ) { 6805 elem.removeEventListener( type, handle ); 6806 } 6807 } : 6808 function( elem, type, handle ) { 6809 var name = "on" + type; 6810 6811 if ( elem.detachEvent ) { 6812 6813 // #8545, #7054, preventing memory leaks for custom events in IE6-8 6814 // detachEvent needed property on element, by name of that event, 6815 // to properly expose it to GC 6816 if ( typeof elem[ name ] === "undefined" ) { 6817 elem[ name ] = null; 6818 } 6819 6820 elem.detachEvent( name, handle ); 6821 } 6822 }; 6823 6824 jQuery.Event = function( src, props ) { 6825 6826 // Allow instantiation without the 'new' keyword 6827 if ( !( this instanceof jQuery.Event ) ) { 6828 return new jQuery.Event( src, props ); 6829 } 6830 6831 // Event object 6832 if ( src && src.type ) { 6833 this.originalEvent = src; 6834 this.type = src.type; 6835 6836 // Events bubbling up the document may have been marked as prevented 6837 // by a handler lower down the tree; reflect the correct value. 6838 this.isDefaultPrevented = src.defaultPrevented || 6839 src.defaultPrevented === undefined && 6840 6841 // Support: IE < 9, Android < 4.0 6842 src.returnValue === false ? 6843 returnTrue : 6844 returnFalse; 6845 6846 // Event type 6847 } else { 6848 this.type = src; 6849 } 6850 6851 // Put explicitly provided properties onto the event object 6852 if ( props ) { 6853 jQuery.extend( this, props ); 6854 } 6855 6856 // Create a timestamp if incoming event doesn't have one 6857 this.timeStamp = src && src.timeStamp || jQuery.now(); 6858 6859 // Mark it as fixed 6860 this[ jQuery.expando ] = true; 6861 }; 6862 6863 // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 6864 // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 6865 jQuery.Event.prototype = { 6866 constructor: jQuery.Event, 6867 isDefaultPrevented: returnFalse, 6868 isPropagationStopped: returnFalse, 6869 isImmediatePropagationStopped: returnFalse, 6870 6871 preventDefault: function() { 6872 var e = this.originalEvent; 6873 6874 this.isDefaultPrevented = returnTrue; 6875 if ( !e ) { 6876 return; 6877 } 6878 6879 // If preventDefault exists, run it on the original event 6880 if ( e.preventDefault ) { 6881 e.preventDefault(); 6882 6883 // Support: IE 6884 // Otherwise set the returnValue property of the original event to false 6885 } else { 6886 e.returnValue = false; 6887 } 6888 }, 6889 stopPropagation: function() { 6890 var e = this.originalEvent; 6891 6892 this.isPropagationStopped = returnTrue; 6893 6894 if ( !e || this.isSimulated ) { 6895 return; 6896 } 6897 6898 // If stopPropagation exists, run it on the original event 6899 if ( e.stopPropagation ) { 6900 e.stopPropagation(); 6901 } 6902 6903 // Support: IE 6904 // Set the cancelBubble property of the original event to true 6905 e.cancelBubble = true; 6906 }, 6907 stopImmediatePropagation: function() { 6908 var e = this.originalEvent; 6909 6910 this.isImmediatePropagationStopped = returnTrue; 6911 6912 if ( e && e.stopImmediatePropagation ) { 6913 e.stopImmediatePropagation(); 6914 } 6915 6916 this.stopPropagation(); 6917 } 6918 }; 6919 6920 // Create mouseenter/leave events using mouseover/out and event-time checks 6921 // so that event delegation works in jQuery. 6922 // Do the same for pointerenter/pointerleave and pointerover/pointerout 6923 // 6924 // Support: Safari 7 only 6925 // Safari sends mouseenter too often; see: 6926 // https://code.google.com/p/chromium/issues/detail?id=470258 6927 // for the description of the bug (it existed in older Chrome versions as well). 6928 jQuery.each( { 6929 mouseenter: "mouseover", 6930 mouseleave: "mouseout", 6931 pointerenter: "pointerover", 6932 pointerleave: "pointerout" 6933 }, function( orig, fix ) { 6934 jQuery.event.special[ orig ] = { 6935 delegateType: fix, 6936 bindType: fix, 6937 6938 handle: function( event ) { 6939 var ret, 6940 target = this, 6941 related = event.relatedTarget, 6942 handleObj = event.handleObj; 6943 6944 // For mouseenter/leave call the handler if related is outside the target. 6945 // NB: No relatedTarget if the mouse left/entered the browser window 6946 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { 6947 event.type = handleObj.origType; 6948 ret = handleObj.handler.apply( this, arguments ); 6949 event.type = fix; 6950 } 6951 return ret; 6952 } 6953 }; 6954 } ); 6955 6956 // IE submit delegation 6957 if ( !support.submit ) { 6958 6959 jQuery.event.special.submit = { 6960 setup: function() { 6961 6962 // Only need this for delegated form submit events 6963 if ( jQuery.nodeName( this, "form" ) ) { 6964 return false; 6965 } 6966 6967 // Lazy-add a submit handler when a descendant form may potentially be submitted 6968 jQuery.event.add( this, "click._submit keypress._submit", function( e ) { 6969 6970 // Node name check avoids a VML-related crash in IE (#9807) 6971 var elem = e.target, 6972 form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? 6973 6974 // Support: IE <=8 6975 // We use jQuery.prop instead of elem.form 6976 // to allow fixing the IE8 delegated submit issue (gh-2332) 6977 // by 3rd party polyfills/workarounds. 6978 jQuery.prop( elem, "form" ) : 6979 undefined; 6980 6981 if ( form && !jQuery._data( form, "submit" ) ) { 6982 jQuery.event.add( form, "submit._submit", function( event ) { 6983 event._submitBubble = true; 6984 } ); 6985 jQuery._data( form, "submit", true ); 6986 } 6987 } ); 6988 6989 // return undefined since we don't need an event listener 6990 }, 6991 6992 postDispatch: function( event ) { 6993 6994 // If form was submitted by the user, bubble the event up the tree 6995 if ( event._submitBubble ) { 6996 delete event._submitBubble; 6997 if ( this.parentNode && !event.isTrigger ) { 6998 jQuery.event.simulate( "submit", this.parentNode, event ); 6999 } 7000 } 7001 }, 7002 7003 teardown: function() { 7004 7005 // Only need this for delegated form submit events 7006 if ( jQuery.nodeName( this, "form" ) ) { 7007 return false; 7008 } 7009 7010 // Remove delegated handlers; cleanData eventually reaps submit handlers attached above 7011 jQuery.event.remove( this, "._submit" ); 7012 } 7013 }; 7014 } 7015 7016 // IE change delegation and checkbox/radio fix 7017 if ( !support.change ) { 7018 7019 jQuery.event.special.change = { 7020 7021 setup: function() { 7022 7023 if ( rformElems.test( this.nodeName ) ) { 7024 7025 // IE doesn't fire change on a check/radio until blur; trigger it on click 7026 // after a propertychange. Eat the blur-change in special.change.handle. 7027 // This still fires onchange a second time for check/radio after blur. 7028 if ( this.type === "checkbox" || this.type === "radio" ) { 7029 jQuery.event.add( this, "propertychange._change", function( event ) { 7030 if ( event.originalEvent.propertyName === "checked" ) { 7031 this._justChanged = true; 7032 } 7033 } ); 7034 jQuery.event.add( this, "click._change", function( event ) { 7035 if ( this._justChanged && !event.isTrigger ) { 7036 this._justChanged = false; 7037 } 7038 7039 // Allow triggered, simulated change events (#11500) 7040 jQuery.event.simulate( "change", this, event ); 7041 } ); 7042 } 7043 return false; 7044 } 7045 7046 // Delegated event; lazy-add a change handler on descendant inputs 7047 jQuery.event.add( this, "beforeactivate._change", function( e ) { 7048 var elem = e.target; 7049 7050 if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "change" ) ) { 7051 jQuery.event.add( elem, "change._change", function( event ) { 7052 if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { 7053 jQuery.event.simulate( "change", this.parentNode, event ); 7054 } 7055 } ); 7056 jQuery._data( elem, "change", true ); 7057 } 7058 } ); 7059 }, 7060 7061 handle: function( event ) { 7062 var elem = event.target; 7063 7064 // Swallow native change events from checkbox/radio, we already triggered them above 7065 if ( this !== elem || event.isSimulated || event.isTrigger || 7066 ( elem.type !== "radio" && elem.type !== "checkbox" ) ) { 7067 7068 return event.handleObj.handler.apply( this, arguments ); 7069 } 7070 }, 7071 7072 teardown: function() { 7073 jQuery.event.remove( this, "._change" ); 7074 7075 return !rformElems.test( this.nodeName ); 7076 } 7077 }; 7078 } 7079 7080 // Support: Firefox 7081 // Firefox doesn't have focus(in | out) events 7082 // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 7083 // 7084 // Support: Chrome, Safari 7085 // focus(in | out) events fire after focus & blur events, 7086 // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order 7087 // Related ticket - https://code.google.com/p/chromium/issues/detail?id=449857 7088 if ( !support.focusin ) { 7089 jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { 7090 7091 // Attach a single capturing handler on the document while someone wants focusin/focusout 7092 var handler = function( event ) { 7093 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); 7094 }; 7095 7096 jQuery.event.special[ fix ] = { 7097 setup: function() { 7098 var doc = this.ownerDocument || this, 7099 attaches = jQuery._data( doc, fix ); 7100 7101 if ( !attaches ) { 7102 doc.addEventListener( orig, handler, true ); 7103 } 7104 jQuery._data( doc, fix, ( attaches || 0 ) + 1 ); 7105 }, 7106 teardown: function() { 7107 var doc = this.ownerDocument || this, 7108 attaches = jQuery._data( doc, fix ) - 1; 7109 7110 if ( !attaches ) { 7111 doc.removeEventListener( orig, handler, true ); 7112 jQuery._removeData( doc, fix ); 7113 } else { 7114 jQuery._data( doc, fix, attaches ); 7115 } 7116 } 7117 }; 7118 } ); 7119 } 7120 7121 jQuery.fn.extend( { 7122 7123 on: function( types, selector, data, fn ) { 7124 return on( this, types, selector, data, fn ); 7125 }, 7126 one: function( types, selector, data, fn ) { 7127 return on( this, types, selector, data, fn, 1 ); 7128 }, 7129 off: function( types, selector, fn ) { 7130 var handleObj, type; 7131 if ( types && types.preventDefault && types.handleObj ) { 7132 7133 // ( event ) dispatched jQuery.Event 7134 handleObj = types.handleObj; 7135 jQuery( types.delegateTarget ).off( 7136 handleObj.namespace ? 7137 handleObj.origType + "." + handleObj.namespace : 7138 handleObj.origType, 7139 handleObj.selector, 7140 handleObj.handler 7141 ); 7142 return this; 7143 } 7144 if ( typeof types === "object" ) { 7145 7146 // ( types-object [, selector] ) 7147 for ( type in types ) { 7148 this.off( type, selector, types[ type ] ); 7149 } 7150 return this; 7151 } 7152 if ( selector === false || typeof selector === "function" ) { 7153 7154 // ( types [, fn] ) 7155 fn = selector; 7156 selector = undefined; 7157 } 7158 if ( fn === false ) { 7159 fn = returnFalse; 7160 } 7161 return this.each( function() { 7162 jQuery.event.remove( this, types, fn, selector ); 7163 } ); 7164 }, 7165 7166 trigger: function( type, data ) { 7167 return this.each( function() { 7168 jQuery.event.trigger( type, data, this ); 7169 } ); 7170 }, 7171 triggerHandler: function( type, data ) { 7172 var elem = this[ 0 ]; 7173 if ( elem ) { 7174 return jQuery.event.trigger( type, data, elem, true ); 7175 } 7176 } 7177 } ); 7178 7179 7180 var rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, 7181 rnoshimcache = new RegExp( "<(?:" + nodeNames + ")[\\s/>]", "i" ), 7182 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, 7183 7184 // Support: IE 10-11, Edge 10240+ 7185 // In IE/Edge using regex groups here causes severe slowdowns. 7186 // See https://connect.microsoft.com/IE/feedback/details/1736512/ 7187 rnoInnerhtml = /<script|<style|<link/i, 7188 7189 // checked="checked" or checked 7190 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 7191 rscriptTypeMasked = /^true\/(.*)/, 7192 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, 7193 safeFragment = createSafeFragment( document ), 7194 fragmentDiv = safeFragment.appendChild( document.createElement( "div" ) ); 7195 7196 // Support: IE<8 7197 // Manipulating tables requires a tbody 7198 function manipulationTarget( elem, content ) { 7199 return jQuery.nodeName( elem, "table" ) && 7200 jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? 7201 7202 elem.getElementsByTagName( "tbody" )[ 0 ] || 7203 elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) : 7204 elem; 7205 } 7206 7207 // Replace/restore the type attribute of script elements for safe DOM manipulation 7208 function disableScript( elem ) { 7209 elem.type = ( jQuery.find.attr( elem, "type" ) !== null ) + "/" + elem.type; 7210 return elem; 7211 } 7212 function restoreScript( elem ) { 7213 var match = rscriptTypeMasked.exec( elem.type ); 7214 if ( match ) { 7215 elem.type = match[ 1 ]; 7216 } else { 7217 elem.removeAttribute( "type" ); 7218 } 7219 return elem; 7220 } 7221 7222 function cloneCopyEvent( src, dest ) { 7223 if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { 7224 return; 7225 } 7226 7227 var type, i, l, 7228 oldData = jQuery._data( src ), 7229 curData = jQuery._data( dest, oldData ), 7230 events = oldData.events; 7231 7232 if ( events ) { 7233 delete curData.handle; 7234 curData.events = {}; 7235 7236 for ( type in events ) { 7237 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 7238 jQuery.event.add( dest, type, events[ type ][ i ] ); 7239 } 7240 } 7241 } 7242 7243 // make the cloned public data object a copy from the original 7244 if ( curData.data ) { 7245 curData.data = jQuery.extend( {}, curData.data ); 7246 } 7247 } 7248 7249 function fixCloneNodeIssues( src, dest ) { 7250 var nodeName, e, data; 7251 7252 // We do not need to do anything for non-Elements 7253 if ( dest.nodeType !== 1 ) { 7254 return; 7255 } 7256 7257 nodeName = dest.nodeName.toLowerCase(); 7258 7259 // IE6-8 copies events bound via attachEvent when using cloneNode. 7260 if ( !support.noCloneEvent && dest[ jQuery.expando ] ) { 7261 data = jQuery._data( dest ); 7262 7263 for ( e in data.events ) { 7264 jQuery.removeEvent( dest, e, data.handle ); 7265 } 7266 7267 // Event data gets referenced instead of copied if the expando gets copied too 7268 dest.removeAttribute( jQuery.expando ); 7269 } 7270 7271 // IE blanks contents when cloning scripts, and tries to evaluate newly-set text 7272 if ( nodeName === "script" && dest.text !== src.text ) { 7273 disableScript( dest ).text = src.text; 7274 restoreScript( dest ); 7275 7276 // IE6-10 improperly clones children of object elements using classid. 7277 // IE10 throws NoModificationAllowedError if parent is null, #12132. 7278 } else if ( nodeName === "object" ) { 7279 if ( dest.parentNode ) { 7280 dest.outerHTML = src.outerHTML; 7281 } 7282 7283 // This path appears unavoidable for IE9. When cloning an object 7284 // element in IE9, the outerHTML strategy above is not sufficient. 7285 // If the src has innerHTML and the destination does not, 7286 // copy the src.innerHTML into the dest.innerHTML. #10324 7287 if ( support.html5Clone && ( src.innerHTML && !jQuery.trim( dest.innerHTML ) ) ) { 7288 dest.innerHTML = src.innerHTML; 7289 } 7290 7291 } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { 7292 7293 // IE6-8 fails to persist the checked state of a cloned checkbox 7294 // or radio button. Worse, IE6-7 fail to give the cloned element 7295 // a checked appearance if the defaultChecked value isn't also set 7296 7297 dest.defaultChecked = dest.checked = src.checked; 7298 7299 // IE6-7 get confused and end up setting the value of a cloned 7300 // checkbox/radio button to an empty string instead of "on" 7301 if ( dest.value !== src.value ) { 7302 dest.value = src.value; 7303 } 7304 7305 // IE6-8 fails to return the selected option to the default selected 7306 // state when cloning options 7307 } else if ( nodeName === "option" ) { 7308 dest.defaultSelected = dest.selected = src.defaultSelected; 7309 7310 // IE6-8 fails to set the defaultValue to the correct value when 7311 // cloning other types of input fields 7312 } else if ( nodeName === "input" || nodeName === "textarea" ) { 7313 dest.defaultValue = src.defaultValue; 7314 } 7315 } 7316 7317 function domManip( collection, args, callback, ignored ) { 7318 7319 // Flatten any nested arrays 7320 args = concat.apply( [], args ); 7321 7322 var first, node, hasScripts, 7323 scripts, doc, fragment, 7324 i = 0, 7325 l = collection.length, 7326 iNoClone = l - 1, 7327 value = args[ 0 ], 7328 isFunction = jQuery.isFunction( value ); 7329 7330 // We can't cloneNode fragments that contain checked, in WebKit 7331 if ( isFunction || 7332 ( l > 1 && typeof value === "string" && 7333 !support.checkClone && rchecked.test( value ) ) ) { 7334 return collection.each( function( index ) { 7335 var self = collection.eq( index ); 7336 if ( isFunction ) { 7337 args[ 0 ] = value.call( this, index, self.html() ); 7338 } 7339 domManip( self, args, callback, ignored ); 7340 } ); 7341 } 7342 7343 if ( l ) { 7344 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); 7345 first = fragment.firstChild; 7346 7347 if ( fragment.childNodes.length === 1 ) { 7348 fragment = first; 7349 } 7350 7351 // Require either new content or an interest in ignored elements to invoke the callback 7352 if ( first || ignored ) { 7353 scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); 7354 hasScripts = scripts.length; 7355 7356 // Use the original fragment for the last item 7357 // instead of the first because it can end up 7358 // being emptied incorrectly in certain situations (#8070). 7359 for ( ; i < l; i++ ) { 7360 node = fragment; 7361 7362 if ( i !== iNoClone ) { 7363 node = jQuery.clone( node, true, true ); 7364 7365 // Keep references to cloned scripts for later restoration 7366 if ( hasScripts ) { 7367 7368 // Support: Android<4.1, PhantomJS<2 7369 // push.apply(_, arraylike) throws on ancient WebKit 7370 jQuery.merge( scripts, getAll( node, "script" ) ); 7371 } 7372 } 7373 7374 callback.call( collection[ i ], node, i ); 7375 } 7376 7377 if ( hasScripts ) { 7378 doc = scripts[ scripts.length - 1 ].ownerDocument; 7379 7380 // Reenable scripts 7381 jQuery.map( scripts, restoreScript ); 7382 7383 // Evaluate executable scripts on first document insertion 7384 for ( i = 0; i < hasScripts; i++ ) { 7385 node = scripts[ i ]; 7386 if ( rscriptType.test( node.type || "" ) && 7387 !jQuery._data( node, "globalEval" ) && 7388 jQuery.contains( doc, node ) ) { 7389 7390 if ( node.src ) { 7391 7392 // Optional AJAX dependency, but won't run scripts if not present 7393 if ( jQuery._evalUrl ) { 7394 jQuery._evalUrl( node.src ); 7395 } 7396 } else { 7397 jQuery.globalEval( 7398 ( node.text || node.textContent || node.innerHTML || "" ) 7399 .replace( rcleanScript, "" ) 7400 ); 7401 } 7402 } 7403 } 7404 } 7405 7406 // Fix #11809: Avoid leaking memory 7407 fragment = first = null; 7408 } 7409 } 7410 7411 return collection; 7412 } 7413 7414 function remove( elem, selector, keepData ) { 7415 var node, 7416 elems = selector ? jQuery.filter( selector, elem ) : elem, 7417 i = 0; 7418 7419 for ( ; ( node = elems[ i ] ) != null; i++ ) { 7420 7421 if ( !keepData && node.nodeType === 1 ) { 7422 jQuery.cleanData( getAll( node ) ); 7423 } 7424 7425 if ( node.parentNode ) { 7426 if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { 7427 setGlobalEval( getAll( node, "script" ) ); 7428 } 7429 node.parentNode.removeChild( node ); 7430 } 7431 } 7432 7433 return elem; 7434 } 7435 7436 jQuery.extend( { 7437 htmlPrefilter: function( html ) { 7438 return html.replace( rxhtmlTag, "<$1></$2>" ); 7439 }, 7440 7441 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 7442 var destElements, node, clone, i, srcElements, 7443 inPage = jQuery.contains( elem.ownerDocument, elem ); 7444 7445 if ( support.html5Clone || jQuery.isXMLDoc( elem ) || 7446 !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { 7447 7448 clone = elem.cloneNode( true ); 7449 7450 // IE<=8 does not properly clone detached, unknown element nodes 7451 } else { 7452 fragmentDiv.innerHTML = elem.outerHTML; 7453 fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); 7454 } 7455 7456 if ( ( !support.noCloneEvent || !support.noCloneChecked ) && 7457 ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) { 7458 7459 // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 7460 destElements = getAll( clone ); 7461 srcElements = getAll( elem ); 7462 7463 // Fix all IE cloning issues 7464 for ( i = 0; ( node = srcElements[ i ] ) != null; ++i ) { 7465 7466 // Ensure that the destination node is not null; Fixes #9587 7467 if ( destElements[ i ] ) { 7468 fixCloneNodeIssues( node, destElements[ i ] ); 7469 } 7470 } 7471 } 7472 7473 // Copy the events from the original to the clone 7474 if ( dataAndEvents ) { 7475 if ( deepDataAndEvents ) { 7476 srcElements = srcElements || getAll( elem ); 7477 destElements = destElements || getAll( clone ); 7478 7479 for ( i = 0; ( node = srcElements[ i ] ) != null; i++ ) { 7480 cloneCopyEvent( node, destElements[ i ] ); 7481 } 7482 } else { 7483 cloneCopyEvent( elem, clone ); 7484 } 7485 } 7486 7487 // Preserve script evaluation history 7488 destElements = getAll( clone, "script" ); 7489 if ( destElements.length > 0 ) { 7490 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); 7491 } 7492 7493 destElements = srcElements = node = null; 7494 7495 // Return the cloned set 7496 return clone; 7497 }, 7498 7499 cleanData: function( elems, /* internal */ forceAcceptData ) { 7500 var elem, type, id, data, 7501 i = 0, 7502 internalKey = jQuery.expando, 7503 cache = jQuery.cache, 7504 attributes = support.attributes, 7505 special = jQuery.event.special; 7506 7507 for ( ; ( elem = elems[ i ] ) != null; i++ ) { 7508 if ( forceAcceptData || acceptData( elem ) ) { 7509 7510 id = elem[ internalKey ]; 7511 data = id && cache[ id ]; 7512 7513 if ( data ) { 7514 if ( data.events ) { 7515 for ( type in data.events ) { 7516 if ( special[ type ] ) { 7517 jQuery.event.remove( elem, type ); 7518 7519 // This is a shortcut to avoid jQuery.event.remove's overhead 7520 } else { 7521 jQuery.removeEvent( elem, type, data.handle ); 7522 } 7523 } 7524 } 7525 7526 // Remove cache only if it was not already removed by jQuery.event.remove 7527 if ( cache[ id ] ) { 7528 7529 delete cache[ id ]; 7530
7531 // Support: IE<9 7532 // IE does not allow us to delete expando properties from nodes 7533 // IE creates expando attributes along with the property 7534 // IE does not have a removeAttribute function on Document nodes 7535 if ( !attributes && typeof elem.removeAttribute !== "undefined" ) { 7536 elem.removeAttribute( internalKey ); 7537 7538 // Webkit & Blink performance suffers when deleting properties 7539 // from DOM nodes, so set to undefined instead 7540 // https://code.google.com/p/chromium/issues/detail?id=378607 7541 } else { 7542 elem[ internalKey ] = undefined; 7543 } 7544 7545 deletedIds.push( id ); 7546 } 7547 } 7548 } 7549 } 7550 } 7551 } ); 7552 7553 jQuery.fn.extend( { 7554 7555 // Keep domManip exposed until 3.0 (gh-2225) 7556 domManip: domManip, 7557 7558 detach: function( selector ) { 7559 return remove( this, selector, true ); 7560 }, 7561 7562 remove: function( selector ) { 7563 return remove( this, selector ); 7564 }, 7565 7566 text: function( value ) { 7567 return access( this, function( value ) { 7568 return value === undefined ? 7569 jQuery.text( this ) : 7570 this.empty().append( 7571 ( this[ 0 ] && this[ 0 ].ownerDocument || document ).createTextNode( value ) 7572 ); 7573 }, null, value, arguments.length ); 7574 }, 7575 7576 append: function() { 7577 return domManip( this, arguments, function( elem ) { 7578 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 7579 var target = manipulationTarget( this, elem ); 7580 target.appendChild( elem ); 7581 } 7582 } ); 7583 }, 7584 7585 prepend: function() { 7586 return domManip( this, arguments, function( elem ) { 7587 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 7588 var target = manipulationTarget( this, elem ); 7589 target.insertBefore( elem, target.firstChild ); 7590 } 7591 } ); 7592 }, 7593 7594 before: function() { 7595 return domManip( this, arguments, function( elem ) { 7596 if ( this.parentNode ) { 7597 this.parentNode.insertBefore( elem, this ); 7598 } 7599 } ); 7600 }, 7601 7602 after: function() { 7603 return domManip( this, arguments, function( elem ) { 7604 if ( this.parentNode ) { 7605 this.parentNode.insertBefore( elem, this.nextSibling ); 7606 } 7607 } ); 7608 }, 7609 7610 empty: function() { 7611 var elem, 7612 i = 0; 7613 7614 for ( ; ( elem = this[ i ] ) != null; i++ ) { 7615 7616 // Remove element nodes and prevent memory leaks 7617 if ( elem.nodeType === 1 ) { 7618 jQuery.cleanData( getAll( elem, false ) ); 7619 } 7620 7621 // Remove any remaining nodes 7622 while ( elem.firstChild ) { 7623 elem.removeChild( elem.firstChild ); 7624 } 7625 7626 // If this is a select, ensure that it displays empty (#12336) 7627 // Support: IE<9 7628 if ( elem.options && jQuery.nodeName( elem, "select" ) ) { 7629 elem.options.length = 0; 7630 } 7631 } 7632 7633 return this; 7634 }, 7635 7636 clone: function( dataAndEvents, deepDataAndEvents ) { 7637 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 7638 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 7639 7640 return this.map( function() { 7641 return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); 7642 } ); 7643 }, 7644 7645 html: function( value ) { 7646 return access( this, function( value ) { 7647 var elem = this[ 0 ] || {}, 7648 i = 0, 7649 l = this.length; 7650 7651 if ( value === undefined ) { 7652 return elem.nodeType === 1 ? 7653 elem.innerHTML.replace( rinlinejQuery, "" ) : 7654 undefined; 7655 } 7656 7657 // See if we can take a shortcut and just use innerHTML 7658 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 7659 ( support.htmlSerialize || !rnoshimcache.test( value ) ) && 7660 ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && 7661 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { 7662 7663 value = jQuery.htmlPrefilter( value ); 7664 7665 try { 7666 for ( ; i < l; i++ ) { 7667 7668 // Remove element nodes and prevent memory leaks 7669 elem = this[ i ] || {}; 7670 if ( elem.nodeType === 1 ) { 7671 jQuery.cleanData( getAll( elem, false ) ); 7672 elem.innerHTML = value; 7673 } 7674 } 7675 7676 elem = 0; 7677 7678 // If using innerHTML throws an exception, use the fallback method 7679 } catch ( e ) {} 7680 } 7681 7682 if ( elem ) { 7683 this.empty().append( value ); 7684 } 7685 }, null, value, arguments.length ); 7686 }, 7687 7688 replaceWith: function() { 7689 var ignored = []; 7690 7691 // Make the changes, replacing each non-ignored context element with the new content 7692 return domManip( this, arguments, function( elem ) { 7693 var parent = this.parentNode; 7694 7695 if ( jQuery.inArray( this, ignored ) < 0 ) { 7696 jQuery.cleanData( getAll( this ) ); 7697 if ( parent ) { 7698 parent.replaceChild( elem, this ); 7699 } 7700 } 7701 7702 // Force callback invocation 7703 }, ignored ); 7704 } 7705 } ); 7706 7707 jQuery.each( { 7708 appendTo: "append",
vendor: 1,227 bytes, lines 7709-7758
7709 prependTo: "prepend", 7710 insertBefore: "before", 7711 insertAfter: "after", 7712 replaceAll: "replaceWith" 7713 }, function( name, original ) { 7714 jQuery.fn[ name ] = function( selector ) { 7715 var elems, 7716 i = 0, 7717 ret = [], 7718 insert = jQuery( selector ), 7719 last = insert.length - 1; 7720 7721 for ( ; i <= last; i++ ) { 7722 elems = i === last ? this : this.clone( true ); 7723 jQuery( insert[ i ] )[ original ]( elems ); 7724 7725 // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() 7726 push.apply( ret, elems.get() ); 7727 } 7728 7729 return this.pushStack( ret ); 7730 }; 7731 } ); 7732 7733 7734 var iframe, 7735 elemdisplay = { 7736 7737 // Support: Firefox 7738 // We have to pre-define these values for FF (#10227) 7739 HTML: "block", 7740 BODY: "block" 7741 }; 7742 7743 /** 7744 * Retrieve the actual display of a element 7745 * @param {String} name nodeName of the element 7746 * @param {Object} doc Document object 7747 */ 7748 7749 // Called only from within defaultDisplay 7750 function actualDisplay( name, doc ) { 7751 var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), 7752 7753 display = jQuery.css( elem[ 0 ], "display" ); 7754 7755 // We don't have any data stored on the element, 7756 // so use "detach" method as fast way to get rid of the element 7757 elem.detach(); 7758
7759 return display; 7760 } 7761 7762 /** 7763 * Try to determine the default display value of an element 7764 * @param {String} nodeName 7765 */ 7766 function defaultDisplay( nodeName ) { 7767 var doc = document, 7768 display = elemdisplay[ nodeName ]; 7769 7770 if ( !display ) { 7771 display = actualDisplay( nodeName, doc ); 7772 7773 // If the simple way fails, read from inside an iframe 7774 if ( display === "none" || !display ) { 7775 7776 // Use the already-created iframe if possible 7777 iframe = ( iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" ) ) 7778 .appendTo( doc.documentElement ); 7779 7780 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse 7781 doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document; 7782 7783 // Support: IE 7784 doc.write(); 7785 doc.close(); 7786 7787 display = actualDisplay( nodeName, doc ); 7788 iframe.detach(); 7789 } 7790 7791 // Store the correct default display 7792 elemdisplay[ nodeName ] = display; 7793 } 7794 7795 return display; 7796 } 7797 var rmargin = ( /^margin/ ); 7798 7799 var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 7800 7801 var swap = function( elem, options, callback, args ) { 7802 var ret, name, 7803 old = {}; 7804 7805 // Remember the old values, and insert the new ones 7806 for ( name in options ) { 7807 old[ name ] = elem.style[ name ]; 7808 elem.style[ name ] = options[ name ]; 7809 } 7810 7811 ret = callback.apply( elem, args || [] ); 7812 7813 // Revert the old values 7814 for ( name in options ) { 7815 elem.style[ name ] = old[ name ]; 7816 } 7817 7818 return ret; 7819 }; 7820 7821 7822 var documentElement = document.documentElement; 7823 7824 7825 7826 ( function() { 7827 var pixelPositionVal, pixelMarginRightVal, boxSizingReliableVal, 7828 reliableHiddenOffsetsVal, reliableMarginRightVal, reliableMarginLeftVal, 7829 container = document.createElement( "div" ), 7830 div = document.createElement( "div" ); 7831 7832 // Finish early in limited (non-browser) environments 7833 if ( !div.style ) { 7834 return; 7835 } 7836 7837 div.style.cssText = "float:left;opacity:.5"; 7838 7839 // Support: IE<9 7840 // Make sure that element opacity exists (as opposed to filter) 7841 support.opacity = div.style.opacity === "0.5"; 7842 7843 // Verify style float existence 7844 // (IE uses styleFloat instead of cssFloat) 7845 support.cssFloat = !!div.style.cssFloat; 7846 7847 div.style.backgroundClip = "content-box"; 7848 div.cloneNode( true ).style.backgroundClip = ""; 7849 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 7850 7851 container = document.createElement( "div" ); 7852 container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" + 7853 "padding:0;margin-top:1px;position:absolute"; 7854 div.innerHTML = ""; 7855 container.appendChild( div ); 7856 7857 // Support: Firefox<29, Android 2.3 7858 // Vendor-prefix box-sizing 7859 support.boxSizing = div.style.boxSizing === "" || div.style.MozBoxSizing === "" || 7860 div.style.WebkitBoxSizing === ""; 7861 7862 jQuery.extend( support, { 7863 reliableHiddenOffsets: function() { 7864 if ( pixelPositionVal == null ) { 7865 computeStyleTests(); 7866 } 7867 return reliableHiddenOffsetsVal; 7868 }, 7869 7870 boxSizingReliable: function() { 7871 7872 // We're checking for pixelPositionVal here instead of boxSizingReliableVal 7873 // since that compresses better and they're computed together anyway. 7874 if ( pixelPositionVal == null ) { 7875 computeStyleTests(); 7876 } 7877 return boxSizingReliableVal; 7878 }, 7879 7880 pixelMarginRight: function() { 7881 7882 // Support: Android 4.0-4.3 7883 if ( pixelPositionVal == null ) { 7884 computeStyleTests(); 7885 } 7886 return pixelMarginRightVal; 7887 }, 7888 7889 pixelPosition: function() { 7890 if ( pixelPositionVal == null ) { 7891 computeStyleTests(); 7892 } 7893 return pixelPositionVal; 7894 }, 7895 7896 reliableMarginRight: function() { 7897 7898 // Support: Android 2.3 7899 if ( pixelPositionVal == null ) { 7900 computeStyleTests(); 7901 } 7902 return reliableMarginRightVal; 7903 }, 7904 7905 reliableMarginLeft: function() { 7906 7907 // Support: IE <=8 only, Android 4.0 - 4.3 only, Firefox <=3 - 37 7908 if ( pixelPositionVal == null ) { 7909 computeStyleTests(); 7910 } 7911 return reliableMarginLeftVal; 7912 } 7913 } ); 7914 7915 function computeStyleTests() { 7916 var contents, divStyle, 7917 documentElement = document.documentElement; 7918 7919 // Setup 7920 documentElement.appendChild( container ); 7921 7922 div.style.cssText = 7923
7924 // Support: Android 2.3 7925 // Vendor-prefix box-sizing 7926 "-webkit-box-sizing:border-box;box-sizing:border-box;" + 7927 "position:relative;display:block;" + 7928 "margin:auto;border:1px;padding:1px;" + 7929 "top:1%;width:50%"; 7930 7931 // Support: IE<9 7932 // Assume reasonable values in the absence of getComputedStyle 7933 pixelPositionVal = boxSizingReliableVal = reliableMarginLeftVal = false; 7934 pixelMarginRightVal = reliableMarginRightVal = true; 7935 7936 // Check for getComputedStyle so that this code is not run in IE<9. 7937 if ( window.getComputedStyle ) { 7938 divStyle = window.getComputedStyle( div ); 7939 pixelPositionVal = ( divStyle || {} ).top !== "1%"; 7940 reliableMarginLeftVal = ( divStyle || {} ).marginLeft === "2px"; 7941 boxSizingReliableVal = ( divStyle || { width: "4px" } ).width === "4px"; 7942 7943 // Support: Android 4.0 - 4.3 only 7944 // Some styles come back with percentage values, even though they shouldn't 7945 div.style.marginRight = "50%"; 7946 pixelMarginRightVal = ( divStyle || { marginRight: "4px" } ).marginRight === "4px"; 7947 7948 // Support: Android 2.3 only 7949 // Div with explicit width and no margin-right incorrectly 7950 // gets computed margin-right based on width of container (#3333) 7951 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right 7952 contents = div.appendChild( document.createElement( "div" ) ); 7953 7954 // Reset CSS: box-sizing; display; margin; border; padding 7955 contents.style.cssText = div.style.cssText = 7956 7957 // Support: Android 2.3 7958 // Vendor-prefix box-sizing 7959 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + 7960 "box-sizing:content-box;display:block;margin:0;border:0;padding:0"; 7961 contents.style.marginRight = contents.style.width = "0"; 7962 div.style.width = "1px"; 7963 7964 reliableMarginRightVal = 7965 !parseFloat( ( window.getComputedStyle( contents ) || {} ).marginRight ); 7966 7967 div.removeChild( contents ); 7968 } 7969 7970 // Support: IE6-8 7971 // First check that getClientRects works as expected 7972 // Check if table cells still have offsetWidth/Height when they are set 7973 // to display:none and there are still other visible table cells in a 7974 // table row; if so, offsetWidth/Height are not reliable for use when 7975 // determining if an element has been hidden directly using 7976 // display:none (it is still safe to use offsets if a parent element is 7977 // hidden; don safety goggles and see bug #4512 for more information). 7978 div.style.display = "none"; 7979 reliableHiddenOffsetsVal = div.getClientRects().length === 0; 7980 if ( reliableHiddenOffsetsVal ) { 7981 div.style.display = ""; 7982 div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; 7983 div.childNodes[ 0 ].style.borderCollapse = "separate"; 7984 contents = div.getElementsByTagName( "td" ); 7985 contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none"; 7986 reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0; 7987 if ( reliableHiddenOffsetsVal ) { 7988 contents[ 0 ].style.display = ""; 7989 contents[ 1 ].style.display = "none"; 7990 reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0; 7991 } 7992 } 7993 7994 // Teardown 7995 documentElement.removeChild( container ); 7996 } 7997 7998 } )(); 7999 8000 8001 var getStyles, curCSS, 8002 rposition = /^(top|right|bottom|left)$/; 8003 8004 if ( window.getComputedStyle ) { 8005 getStyles = function( elem ) { 8006 8007 // Support: IE<=11+, Firefox<=30+ (#15098, #14150) 8008 // IE throws on elements created in popups 8009 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 8010 var view = elem.ownerDocument.defaultView; 8011 8012 if ( !view || !view.opener ) { 8013 view = window; 8014 } 8015 8016 return view.getComputedStyle( elem ); 8017 }; 8018 8019 curCSS = function( elem, name, computed ) { 8020 var width, minWidth, maxWidth, ret, 8021 style = elem.style; 8022 8023 computed = computed || getStyles( elem ); 8024 8025 // getPropertyValue is only needed for .css('filter') in IE9, see #12537 8026 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined; 8027 8028 // Support: Opera 12.1x only 8029 // Fall back to style even without computed 8030 // computed is undefined for elems on document fragments 8031 if ( ( ret === "" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) { 8032 ret = jQuery.style( elem, name ); 8033 } 8034 8035 if ( computed ) { 8036 8037 // A tribute to the "awesome hack by Dean Edwards" 8038 // Chrome < 17 and Safari 5.0 uses "computed value" 8039 // instead of "used value" for margin-right 8040 // Safari 5.1.7 (at least) returns percentage for a larger set of values, 8041 // but width seems to be reliably pixels 8042 // this is against the CSSOM draft spec: 8043 // http://dev.w3.org/csswg/cssom/#resolved-values 8044 if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) { 8045 8046 // Remember the original values 8047 width = style.width; 8048 minWidth = style.minWidth; 8049 maxWidth = style.maxWidth; 8050 8051 // Put in the new values to get a computed value out 8052 style.minWidth = style.maxWidth = style.width = ret; 8053 ret = computed.width; 8054 8055 // Revert the changed values 8056 style.width = width; 8057 style.minWidth = minWidth; 8058 style.maxWidth = maxWidth; 8059 } 8060 } 8061
vendor: 4,282 bytes, lines 8062-8224
8062 // Support: IE 8063 // IE returns zIndex value as an integer. 8064 return ret === undefined ? 8065 ret : 8066 ret + ""; 8067 }; 8068 } else if ( documentElement.currentStyle ) { 8069 getStyles = function( elem ) { 8070 return elem.currentStyle; 8071 }; 8072 8073 curCSS = function( elem, name, computed ) { 8074 var left, rs, rsLeft, ret, 8075 style = elem.style; 8076 8077 computed = computed || getStyles( elem ); 8078 ret = computed ? computed[ name ] : undefined; 8079 8080 // Avoid setting ret to empty string here 8081 // so we don't default to auto 8082 if ( ret == null && style && style[ name ] ) { 8083 ret = style[ name ]; 8084 } 8085 8086 // From the awesome hack by Dean Edwards 8087 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 8088 8089 // If we're not dealing with a regular pixel number 8090 // but a number that has a weird ending, we need to convert it to pixels 8091 // but not position css attributes, as those are 8092 // proportional to the parent element instead 8093 // and we can't measure the parent instead because it 8094 // might trigger a "stacking dolls" problem 8095 if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { 8096 8097 // Remember the original values 8098 left = style.left; 8099 rs = elem.runtimeStyle; 8100 rsLeft = rs && rs.left; 8101 8102 // Put in the new values to get a computed value out 8103 if ( rsLeft ) { 8104 rs.left = elem.currentStyle.left; 8105 } 8106 style.left = name === "fontSize" ? "1em" : ret; 8107 ret = style.pixelLeft + "px"; 8108 8109 // Revert the changed values 8110 style.left = left; 8111 if ( rsLeft ) { 8112 rs.left = rsLeft; 8113 } 8114 } 8115 8116 // Support: IE 8117 // IE returns zIndex value as an integer. 8118 return ret === undefined ? 8119 ret : 8120 ret + "" || "auto"; 8121 }; 8122 } 8123 8124 8125 8126 8127 function addGetHookIf( conditionFn, hookFn ) { 8128 8129 // Define the hook, we'll check on the first run if it's really needed. 8130 return { 8131 get: function() { 8132 if ( conditionFn() ) { 8133 8134 // Hook not needed (or it's not possible to use it due 8135 // to missing dependency), remove it. 8136 delete this.get; 8137 return; 8138 } 8139 8140 // Hook needed; redefine it so that the support test is not executed again. 8141 return ( this.get = hookFn ).apply( this, arguments ); 8142 } 8143 }; 8144 } 8145 8146 8147 var 8148 8149 ralpha = /alpha\([^)]*\)/i, 8150 ropacity = /opacity\s*=\s*([^)]*)/i, 8151 8152 // swappable if display is none or starts with table except 8153 // "table", "table-cell", or "table-caption" 8154 // see here for display values: 8155 // https://developer.mozilla.org/en-US/docs/CSS/display 8156 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 8157 rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ), 8158 8159 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 8160 cssNormalTransform = { 8161 letterSpacing: "0", 8162 fontWeight: "400" 8163 }, 8164 8165 cssPrefixes = [ "Webkit", "O", "Moz", "ms" ], 8166 emptyStyle = document.createElement( "div" ).style; 8167 8168 8169 // return a css property mapped to a potentially vendor prefixed property 8170 function vendorPropName( name ) { 8171 8172 // shortcut for names that are not vendor prefixed 8173 if ( name in emptyStyle ) { 8174 return name; 8175 } 8176 8177 // check for vendor prefixed names 8178 var capName = name.charAt( 0 ).toUpperCase() + name.slice( 1 ), 8179 i = cssPrefixes.length; 8180 8181 while ( i-- ) { 8182 name = cssPrefixes[ i ] + capName; 8183 if ( name in emptyStyle ) { 8184 return name; 8185 } 8186 } 8187 } 8188 8189 function showHide( elements, show ) { 8190 var display, elem, hidden, 8191 values = [], 8192 index = 0, 8193 length = elements.length; 8194 8195 for ( ; index < length; index++ ) { 8196 elem = elements[ index ]; 8197 if ( !elem.style ) { 8198 continue; 8199 } 8200 8201 values[ index ] = jQuery._data( elem, "olddisplay" ); 8202 display = elem.style.display; 8203 if ( show ) { 8204 8205 // Reset the inline display of this element to learn if it is 8206 // being hidden by cascaded rules or not 8207 if ( !values[ index ] && display === "none" ) { 8208 elem.style.display = ""; 8209 } 8210 8211 // Set elements which have been overridden with display: none 8212 // in a stylesheet to whatever the default browser style is 8213 // for such an element 8214 if ( elem.style.display === "" && isHidden( elem ) ) { 8215 values[ index ] = 8216 jQuery._data( elem, "olddisplay", defaultDisplay( elem.nodeName ) ); 8217 } 8218 } else { 8219 hidden = isHidden( elem ); 8220 8221 if ( display && display !== "none" || !hidden ) { 8222 jQuery._data( 8223 elem, 8224 "olddisplay",
vendor: 6,213 bytes, lines 8225-8436
8225 hidden ? display : jQuery.css( elem, "display" ) 8226 ); 8227 } 8228 } 8229 } 8230 8231 // Set the display of most of the elements in a second loop 8232 // to avoid the constant reflow 8233 for ( index = 0; index < length; index++ ) { 8234 elem = elements[ index ]; 8235 if ( !elem.style ) { 8236 continue; 8237 } 8238 if ( !show || elem.style.display === "none" || elem.style.display === "" ) { 8239 elem.style.display = show ? values[ index ] || "" : "none"; 8240 } 8241 } 8242 8243 return elements; 8244 } 8245 8246 function setPositiveNumber( elem, value, subtract ) { 8247 var matches = rnumsplit.exec( value ); 8248 return matches ? 8249 8250 // Guard against undefined "subtract", e.g., when used as in cssHooks 8251 Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : 8252 value; 8253 } 8254 8255 function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { 8256 var i = extra === ( isBorderBox ? "border" : "content" ) ? 8257 8258 // If we already have the right measurement, avoid augmentation 8259 4 : 8260 8261 // Otherwise initialize for horizontal or vertical properties 8262 name === "width" ? 1 : 0, 8263 8264 val = 0; 8265 8266 for ( ; i < 4; i += 2 ) { 8267 8268 // both box models exclude margin, so add it if we want it 8269 if ( extra === "margin" ) { 8270 val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); 8271 } 8272 8273 if ( isBorderBox ) { 8274 8275 // border-box includes padding, so remove it if we want content 8276 if ( extra === "content" ) { 8277 val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 8278 } 8279 8280 // at this point, extra isn't border nor margin, so remove border 8281 if ( extra !== "margin" ) { 8282 val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 8283 } 8284 } else { 8285 8286 // at this point, extra isn't content, so add padding 8287 val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 8288 8289 // at this point, extra isn't content nor padding, so add border 8290 if ( extra !== "padding" ) { 8291 val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 8292 } 8293 } 8294 } 8295 8296 return val; 8297 } 8298 8299 function getWidthOrHeight( elem, name, extra ) { 8300 8301 // Start with offset property, which is equivalent to the border-box value 8302 var valueIsBorderBox = true, 8303 val = name === "width" ? elem.offsetWidth : elem.offsetHeight, 8304 styles = getStyles( elem ), 8305 isBorderBox = support.boxSizing && 8306 jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; 8307 8308 // some non-html elements return undefined for offsetWidth, so check for null/undefined 8309 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 8310 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 8311 if ( val <= 0 || val == null ) { 8312 8313 // Fall back to computed then uncomputed css if necessary 8314 val = curCSS( elem, name, styles ); 8315 if ( val < 0 || val == null ) { 8316 val = elem.style[ name ]; 8317 } 8318 8319 // Computed unit is not pixels. Stop here and return. 8320 if ( rnumnonpx.test( val ) ) { 8321 return val; 8322 } 8323 8324 // we need the check for style in case a browser which returns unreliable values 8325 // for getComputedStyle silently falls back to the reliable elem.style 8326 valueIsBorderBox = isBorderBox && 8327 ( support.boxSizingReliable() || val === elem.style[ name ] ); 8328 8329 // Normalize "", auto, and prepare for extra 8330 val = parseFloat( val ) || 0; 8331 } 8332 8333 // use the active box-sizing model to add/subtract irrelevant styles 8334 return ( val + 8335 augmentWidthOrHeight( 8336 elem, 8337 name, 8338 extra || ( isBorderBox ? "border" : "content" ), 8339 valueIsBorderBox, 8340 styles 8341 ) 8342 ) + "px"; 8343 } 8344 8345 jQuery.extend( { 8346 8347 // Add in style property hooks for overriding the default 8348 // behavior of getting and setting a style property 8349 cssHooks: { 8350 opacity: { 8351 get: function( elem, computed ) { 8352 if ( computed ) { 8353 8354 // We should always get a number back from opacity 8355 var ret = curCSS( elem, "opacity" ); 8356 return ret === "" ? "1" : ret; 8357 } 8358 } 8359 } 8360 }, 8361 8362 // Don't automatically add "px" to these possibly-unitless properties 8363 cssNumber: { 8364 "animationIterationCount": true, 8365 "columnCount": true, 8366 "fillOpacity": true, 8367 "flexGrow": true, 8368 "flexShrink": true, 8369 "fontWeight": true, 8370 "lineHeight": true, 8371 "opacity": true, 8372 "order": true, 8373 "orphans": true, 8374 "widows": true, 8375 "zIndex": true, 8376 "zoom": true 8377 }, 8378 8379 // Add in properties whose names you wish to fix before 8380 // setting or getting the value 8381 cssProps: { 8382 8383 // normalize float css property 8384 "float": support.cssFloat ? "cssFloat" : "styleFloat" 8385 }, 8386 8387 // Get and set the style property on a DOM Node 8388 style: function( elem, name, value, extra ) { 8389 8390 // Don't set styles on text and comment nodes 8391 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 8392 return; 8393 } 8394 8395 // Make sure that we're working with the right name 8396 var ret, type, hooks, 8397 origName = jQuery.camelCase( name ), 8398 style = elem.style; 8399 8400 name = jQuery.cssProps[ origName ] || 8401 ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName ); 8402 8403 // gets hook for the prefixed version 8404 // followed by the unprefixed version 8405 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 8406 8407 // Check if we're setting a value 8408 if ( value !== undefined ) { 8409 type = typeof value; 8410 8411 // Convert "+=" or "-=" to relative numbers (#7345) 8412 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { 8413 value = adjustCSS( elem, name, ret ); 8414 8415 // Fixes bug #9237 8416 type = "number"; 8417 } 8418 8419 // Make sure that null and NaN values aren't set. See: #7116 8420 if ( value == null || value !== value ) { 8421 return; 8422 } 8423 8424 // If a number was passed in, add the unit (except for certain CSS properties) 8425 if ( type === "number" ) { 8426 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); 8427 } 8428 8429 // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, 8430 // but it would mean to define eight 8431 // (for every problematic property) identical functions 8432 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { 8433 style[ name ] = "inherit"; 8434 } 8435 8436 // If a hook was provided, use that value, otherwise just set the specified value
vendor: 4,716 bytes, lines 8437-8592
8437 if ( !hooks || !( "set" in hooks ) || 8438 ( value = hooks.set( elem, value, extra ) ) !== undefined ) { 8439 8440 // Support: IE 8441 // Swallow errors from 'invalid' CSS values (#5509) 8442 try { 8443 style[ name ] = value; 8444 } catch ( e ) {} 8445 } 8446 8447 } else { 8448 8449 // If a hook was provided get the non-computed value from there 8450 if ( hooks && "get" in hooks && 8451 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { 8452 8453 return ret; 8454 } 8455 8456 // Otherwise just get the value from the style object 8457 return style[ name ]; 8458 } 8459 }, 8460 8461 css: function( elem, name, extra, styles ) { 8462 var num, val, hooks, 8463 origName = jQuery.camelCase( name ); 8464 8465 // Make sure that we're working with the right name 8466 name = jQuery.cssProps[ origName ] || 8467 ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName ); 8468 8469 // gets hook for the prefixed version 8470 // followed by the unprefixed version 8471 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 8472 8473 // If a hook was provided get the computed value from there 8474 if ( hooks && "get" in hooks ) { 8475 val = hooks.get( elem, true, extra ); 8476 } 8477 8478 // Otherwise, if a way to get the computed value exists, use that 8479 if ( val === undefined ) { 8480 val = curCSS( elem, name, styles ); 8481 } 8482 8483 //convert "normal" to computed value 8484 if ( val === "normal" && name in cssNormalTransform ) { 8485 val = cssNormalTransform[ name ]; 8486 } 8487 8488 // Return, converting to number if forced or a qualifier was provided and val looks numeric 8489 if ( extra === "" || extra ) { 8490 num = parseFloat( val ); 8491 return extra === true || isFinite( num ) ? num || 0 : val; 8492 } 8493 return val; 8494 } 8495 } ); 8496 8497 jQuery.each( [ "height", "width" ], function( i, name ) { 8498 jQuery.cssHooks[ name ] = { 8499 get: function( elem, computed, extra ) { 8500 if ( computed ) { 8501 8502 // certain elements can have dimension info if we invisibly show them 8503 // however, it must have a current display style that would benefit from this 8504 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && 8505 elem.offsetWidth === 0 ? 8506 swap( elem, cssShow, function() { 8507 return getWidthOrHeight( elem, name, extra ); 8508 } ) : 8509 getWidthOrHeight( elem, name, extra ); 8510 } 8511 }, 8512 8513 set: function( elem, value, extra ) { 8514 var styles = extra && getStyles( elem ); 8515 return setPositiveNumber( elem, value, extra ? 8516 augmentWidthOrHeight( 8517 elem, 8518 name, 8519 extra, 8520 support.boxSizing && 8521 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 8522 styles 8523 ) : 0 8524 ); 8525 } 8526 }; 8527 } ); 8528 8529 if ( !support.opacity ) { 8530 jQuery.cssHooks.opacity = { 8531 get: function( elem, computed ) { 8532 8533 // IE uses filters for opacity 8534 return ropacity.test( ( computed && elem.currentStyle ? 8535 elem.currentStyle.filter : 8536 elem.style.filter ) || "" ) ? 8537 ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : 8538 computed ? "1" : ""; 8539 }, 8540 8541 set: function( elem, value ) { 8542 var style = elem.style, 8543 currentStyle = elem.currentStyle, 8544 opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", 8545 filter = currentStyle && currentStyle.filter || style.filter || ""; 8546 8547 // IE has trouble with opacity if it does not have layout 8548 // Force it by setting the zoom level 8549 style.zoom = 1; 8550 8551 // if setting opacity to 1, and no other filters exist - 8552 // attempt to remove filter attribute #6652 8553 // if value === "", then remove inline opacity #12685 8554 if ( ( value >= 1 || value === "" ) && 8555 jQuery.trim( filter.replace( ralpha, "" ) ) === "" && 8556 style.removeAttribute ) { 8557 8558 // Setting style.filter to null, "" & " " still leave "filter:" in the cssText 8559 // if "filter:" is present at all, clearType is disabled, we want to avoid this 8560 // style.removeAttribute is IE Only, but so apparently is this code path... 8561 style.removeAttribute( "filter" ); 8562 8563 // if there is no filter style applied in a css rule 8564 // or unset inline opacity, we are done 8565 if ( value === "" || currentStyle && !currentStyle.filter ) { 8566 return; 8567 } 8568 } 8569 8570 // otherwise, set new filter values 8571 style.filter = ralpha.test( filter ) ? 8572 filter.replace( ralpha, opacity ) : 8573 filter + " " + opacity; 8574 } 8575 }; 8576 } 8577 8578 jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight, 8579 function( elem, computed ) { 8580 if ( computed ) { 8581 return swap( elem, { "display": "inline-block" }, 8582 curCSS, [ elem, "marginRight" ] ); 8583 } 8584 } 8585 ); 8586 8587 jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, 8588 function( elem, computed ) { 8589 if ( computed ) { 8590 return ( 8591 parseFloat( curCSS( elem, "marginLeft" ) ) || 8592
vendor: 4,202 bytes, lines 8593-8753
8593 // Support: IE<=11+ 8594 // Running getBoundingClientRect on a disconnected node in IE throws an error 8595 // Support: IE8 only 8596 // getClientRects() errors on disconnected elems 8597 ( jQuery.contains( elem.ownerDocument, elem ) ? 8598 elem.getBoundingClientRect().left - 8599 swap( elem, { marginLeft: 0 }, function() { 8600 return elem.getBoundingClientRect().left; 8601 } ) : 8602 0 8603 ) 8604 ) + "px"; 8605 } 8606 } 8607 ); 8608 8609 // These hooks are used by animate to expand properties 8610 jQuery.each( { 8611 margin: "", 8612 padding: "", 8613 border: "Width" 8614 }, function( prefix, suffix ) { 8615 jQuery.cssHooks[ prefix + suffix ] = { 8616 expand: function( value ) { 8617 var i = 0, 8618 expanded = {}, 8619 8620 // assumes a single number if not a string 8621 parts = typeof value === "string" ? value.split( " " ) : [ value ]; 8622 8623 for ( ; i < 4; i++ ) { 8624 expanded[ prefix + cssExpand[ i ] + suffix ] = 8625 parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 8626 } 8627 8628 return expanded; 8629 } 8630 }; 8631 8632 if ( !rmargin.test( prefix ) ) { 8633 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; 8634 } 8635 } ); 8636 8637 jQuery.fn.extend( { 8638 css: function( name, value ) { 8639 return access( this, function( elem, name, value ) { 8640 var styles, len, 8641 map = {}, 8642 i = 0; 8643 8644 if ( jQuery.isArray( name ) ) { 8645 styles = getStyles( elem ); 8646 len = name.length; 8647 8648 for ( ; i < len; i++ ) { 8649 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); 8650 } 8651 8652 return map; 8653 } 8654 8655 return value !== undefined ? 8656 jQuery.style( elem, name, value ) : 8657 jQuery.css( elem, name ); 8658 }, name, value, arguments.length > 1 ); 8659 }, 8660 show: function() { 8661 return showHide( this, true ); 8662 }, 8663 hide: function() { 8664 return showHide( this ); 8665 }, 8666 toggle: function( state ) { 8667 if ( typeof state === "boolean" ) { 8668 return state ? this.show() : this.hide(); 8669 } 8670 8671 return this.each( function() { 8672 if ( isHidden( this ) ) { 8673 jQuery( this ).show(); 8674 } else { 8675 jQuery( this ).hide(); 8676 } 8677 } ); 8678 } 8679 } ); 8680 8681 8682 function Tween( elem, options, prop, end, easing ) { 8683 return new Tween.prototype.init( elem, options, prop, end, easing ); 8684 } 8685 jQuery.Tween = Tween; 8686 8687 Tween.prototype = { 8688 constructor: Tween, 8689 init: function( elem, options, prop, end, easing, unit ) { 8690 this.elem = elem; 8691 this.prop = prop; 8692 this.easing = easing || jQuery.easing._default; 8693 this.options = options; 8694 this.start = this.now = this.cur(); 8695 this.end = end; 8696 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 8697 }, 8698 cur: function() { 8699 var hooks = Tween.propHooks[ this.prop ]; 8700 8701 return hooks && hooks.get ? 8702 hooks.get( this ) : 8703 Tween.propHooks._default.get( this ); 8704 }, 8705 run: function( percent ) { 8706 var eased, 8707 hooks = Tween.propHooks[ this.prop ]; 8708 8709 if ( this.options.duration ) { 8710 this.pos = eased = jQuery.easing[ this.easing ]( 8711 percent, this.options.duration * percent, 0, 1, this.options.duration 8712 ); 8713 } else { 8714 this.pos = eased = percent; 8715 } 8716 this.now = ( this.end - this.start ) * eased + this.start; 8717 8718 if ( this.options.step ) { 8719 this.options.step.call( this.elem, this.now, this ); 8720 } 8721 8722 if ( hooks && hooks.set ) { 8723 hooks.set( this ); 8724 } else { 8725 Tween.propHooks._default.set( this ); 8726 } 8727 return this; 8728 } 8729 }; 8730 8731 Tween.prototype.init.prototype = Tween.prototype; 8732 8733 Tween.propHooks = { 8734 _default: { 8735 get: function( tween ) { 8736 var result; 8737 8738 // Use a property on the element directly when it is not a DOM element, 8739 // or when there is no matching style property that exists. 8740 if ( tween.elem.nodeType !== 1 || 8741 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { 8742 return tween.elem[ tween.prop ]; 8743 } 8744 8745 // passing an empty string as a 3rd parameter to .css will automatically 8746 // attempt a parseFloat and fallback to a string if the parse fails 8747 // so, simple values such as "10px" are parsed to Float. 8748 // complex values such as "rotate(1rad)" are returned as is. 8749 result = jQuery.css( tween.elem, tween.prop, "" ); 8750 8751 // Empty strings, null, undefined and "auto" are converted to 0. 8752 return !result || result === "auto" ? 0 : result; 8753 },
vendor: 6,415 bytes, lines 8754-8988
8754 set: function( tween ) { 8755 8756 // use step hook for back compat - use cssHook if its there - use .style if its 8757 // available and use plain properties where available 8758 if ( jQuery.fx.step[ tween.prop ] ) { 8759 jQuery.fx.step[ tween.prop ]( tween ); 8760 } else if ( tween.elem.nodeType === 1 && 8761 ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || 8762 jQuery.cssHooks[ tween.prop ] ) ) { 8763 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); 8764 } else { 8765 tween.elem[ tween.prop ] = tween.now; 8766 } 8767 } 8768 } 8769 }; 8770 8771 // Support: IE <=9 8772 // Panic based approach to setting things on disconnected nodes 8773 8774 Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 8775 set: function( tween ) { 8776 if ( tween.elem.nodeType && tween.elem.parentNode ) { 8777 tween.elem[ tween.prop ] = tween.now; 8778 } 8779 } 8780 }; 8781 8782 jQuery.easing = { 8783 linear: function( p ) { 8784 return p; 8785 }, 8786 swing: function( p ) { 8787 return 0.5 - Math.cos( p * Math.PI ) / 2; 8788 }, 8789 _default: "swing" 8790 }; 8791 8792 jQuery.fx = Tween.prototype.init; 8793 8794 // Back Compat <1.8 extension point 8795 jQuery.fx.step = {}; 8796 8797 8798 8799 8800 var 8801 fxNow, timerId, 8802 rfxtypes = /^(?:toggle|show|hide)$/, 8803 rrun = /queueHooks$/; 8804 8805 // Animations created synchronously will run synchronously 8806 function createFxNow() { 8807 window.setTimeout( function() { 8808 fxNow = undefined; 8809 } ); 8810 return ( fxNow = jQuery.now() ); 8811 } 8812 8813 // Generate parameters to create a standard animation 8814 function genFx( type, includeWidth ) { 8815 var which, 8816 attrs = { height: type }, 8817 i = 0; 8818 8819 // if we include width, step value is 1 to do all cssExpand values, 8820 // if we don't include width, step value is 2 to skip over Left and Right 8821 includeWidth = includeWidth ? 1 : 0; 8822 for ( ; i < 4 ; i += 2 - includeWidth ) { 8823 which = cssExpand[ i ]; 8824 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; 8825 } 8826 8827 if ( includeWidth ) { 8828 attrs.opacity = attrs.width = type; 8829 } 8830 8831 return attrs; 8832 } 8833 8834 function createTween( value, prop, animation ) { 8835 var tween, 8836 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), 8837 index = 0, 8838 length = collection.length; 8839 for ( ; index < length; index++ ) { 8840 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { 8841 8842 // we're done with this property 8843 return tween; 8844 } 8845 } 8846 } 8847 8848 function defaultPrefilter( elem, props, opts ) { 8849 /* jshint validthis: true */ 8850 var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay, 8851 anim = this, 8852 orig = {}, 8853 style = elem.style, 8854 hidden = elem.nodeType && isHidden( elem ), 8855 dataShow = jQuery._data( elem, "fxshow" ); 8856 8857 // handle queue: false promises 8858 if ( !opts.queue ) { 8859 hooks = jQuery._queueHooks( elem, "fx" ); 8860 if ( hooks.unqueued == null ) { 8861 hooks.unqueued = 0; 8862 oldfire = hooks.empty.fire; 8863 hooks.empty.fire = function() { 8864 if ( !hooks.unqueued ) { 8865 oldfire(); 8866 } 8867 }; 8868 } 8869 hooks.unqueued++; 8870 8871 anim.always( function() { 8872 8873 // doing this makes sure that the complete handler will be called 8874 // before this completes 8875 anim.always( function() { 8876 hooks.unqueued--; 8877 if ( !jQuery.queue( elem, "fx" ).length ) { 8878 hooks.empty.fire(); 8879 } 8880 } ); 8881 } ); 8882 } 8883 8884 // height/width overflow pass 8885 if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { 8886 8887 // Make sure that nothing sneaks out 8888 // Record all 3 overflow attributes because IE does not 8889 // change the overflow attribute when overflowX and 8890 // overflowY are set to the same value 8891 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; 8892 8893 // Set display property to inline-block for height/width 8894 // animations on inline elements that are having width/height animated 8895 display = jQuery.css( elem, "display" ); 8896 8897 // Test default display if display is currently "none" 8898 checkDisplay = display === "none" ? 8899 jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display; 8900 8901 if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) { 8902 8903 // inline-level elements accept inline-block; 8904 // block-level elements need to be inline with layout 8905 if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) { 8906 style.display = "inline-block"; 8907 } else { 8908 style.zoom = 1; 8909 } 8910 } 8911 } 8912 8913 if ( opts.overflow ) { 8914 style.overflow = "hidden"; 8915 if ( !support.shrinkWrapBlocks() ) { 8916 anim.always( function() { 8917 style.overflow = opts.overflow[ 0 ]; 8918 style.overflowX = opts.overflow[ 1 ]; 8919 style.overflowY = opts.overflow[ 2 ]; 8920 } ); 8921 } 8922 } 8923 8924 // show/hide pass 8925 for ( prop in props ) { 8926 value = props[ prop ]; 8927 if ( rfxtypes.exec( value ) ) { 8928 delete props[ prop ]; 8929 toggle = toggle || value === "toggle"; 8930 if ( value === ( hidden ? "hide" : "show" ) ) { 8931 8932 // If there is dataShow left over from a stopped hide or show 8933 // and we are going to proceed with show, we should pretend to be hidden 8934 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { 8935 hidden = true; 8936 } else { 8937 continue; 8938 } 8939 } 8940 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); 8941 8942 // Any non-fx value stops us from restoring the original display value 8943 } else { 8944 display = undefined; 8945 } 8946 } 8947 8948 if ( !jQuery.isEmptyObject( orig ) ) { 8949 if ( dataShow ) { 8950 if ( "hidden" in dataShow ) { 8951 hidden = dataShow.hidden; 8952 } 8953 } else { 8954 dataShow = jQuery._data( elem, "fxshow", {} ); 8955 } 8956 8957 // store state if its toggle - enables .stop().toggle() to "reverse" 8958 if ( toggle ) { 8959 dataShow.hidden = !hidden; 8960 } 8961 if ( hidden ) { 8962 jQuery( elem ).show(); 8963 } else { 8964 anim.done( function() { 8965 jQuery( elem ).hide(); 8966 } ); 8967 } 8968 anim.done( function() { 8969 var prop; 8970 jQuery._removeData( elem, "fxshow" ); 8971 for ( prop in orig ) { 8972 jQuery.style( elem, prop, orig[ prop ] ); 8973 } 8974 } ); 8975 for ( prop in orig ) { 8976 tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); 8977 8978 if ( !( prop in dataShow ) ) { 8979 dataShow[ prop ] = tween.start; 8980 if ( hidden ) { 8981 tween.end = tween.start; 8982 tween.start = prop === "width" || prop === "height" ? 1 : 0; 8983 } 8984 } 8985 } 8986 8987 // If this is a noop like .hide().hide(), restore an overwritten display value 8988 } else if ( ( display === "none" ? defaultDisplay( elem.nodeName ) : dis
vendor: 8,003 bytes, lines 8988-9286
8988play ) === "inline" ) { 8989 style.display = display; 8990 } 8991 } 8992 8993 function propFilter( props, specialEasing ) { 8994 var index, name, easing, value, hooks; 8995 8996 // camelCase, specialEasing and expand cssHook pass 8997 for ( index in props ) { 8998 name = jQuery.camelCase( index ); 8999 easing = specialEasing[ name ]; 9000 value = props[ index ]; 9001 if ( jQuery.isArray( value ) ) { 9002 easing = value[ 1 ]; 9003 value = props[ index ] = value[ 0 ]; 9004 } 9005 9006 if ( index !== name ) { 9007 props[ name ] = value; 9008 delete props[ index ]; 9009 } 9010 9011 hooks = jQuery.cssHooks[ name ]; 9012 if ( hooks && "expand" in hooks ) { 9013 value = hooks.expand( value ); 9014 delete props[ name ]; 9015 9016 // not quite $.extend, this wont overwrite keys already present. 9017 // also - reusing 'index' from above because we have the correct "name" 9018 for ( index in value ) { 9019 if ( !( index in props ) ) { 9020 props[ index ] = value[ index ]; 9021 specialEasing[ index ] = easing; 9022 } 9023 } 9024 } else { 9025 specialEasing[ name ] = easing; 9026 } 9027 } 9028 } 9029 9030 function Animation( elem, properties, options ) { 9031 var result, 9032 stopped, 9033 index = 0, 9034 length = Animation.prefilters.length, 9035 deferred = jQuery.Deferred().always( function() { 9036 9037 // don't match elem in the :animated selector 9038 delete tick.elem; 9039 } ), 9040 tick = function() { 9041 if ( stopped ) { 9042 return false; 9043 } 9044 var currentTime = fxNow || createFxNow(), 9045 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), 9046 9047 // Support: Android 2.3 9048 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) 9049 temp = remaining / animation.duration || 0, 9050 percent = 1 - temp, 9051 index = 0, 9052 length = animation.tweens.length; 9053 9054 for ( ; index < length ; index++ ) { 9055 animation.tweens[ index ].run( percent ); 9056 } 9057 9058 deferred.notifyWith( elem, [ animation, percent, remaining ] ); 9059 9060 if ( percent < 1 && length ) { 9061 return remaining; 9062 } else { 9063 deferred.resolveWith( elem, [ animation ] ); 9064 return false; 9065 } 9066 }, 9067 animation = deferred.promise( { 9068 elem: elem, 9069 props: jQuery.extend( {}, properties ), 9070 opts: jQuery.extend( true, { 9071 specialEasing: {}, 9072 easing: jQuery.easing._default 9073 }, options ), 9074 originalProperties: properties, 9075 originalOptions: options, 9076 startTime: fxNow || createFxNow(), 9077 duration: options.duration, 9078 tweens: [], 9079 createTween: function( prop, end ) { 9080 var tween = jQuery.Tween( elem, animation.opts, prop, end, 9081 animation.opts.specialEasing[ prop ] || animation.opts.easing ); 9082 animation.tweens.push( tween ); 9083 return tween; 9084 }, 9085 stop: function( gotoEnd ) { 9086 var index = 0, 9087 9088 // if we are going to the end, we want to run all the tweens 9089 // otherwise we skip this part 9090 length = gotoEnd ? animation.tweens.length : 0; 9091 if ( stopped ) { 9092 return this; 9093 } 9094 stopped = true; 9095 for ( ; index < length ; index++ ) { 9096 animation.tweens[ index ].run( 1 ); 9097 } 9098 9099 // resolve when we played the last frame 9100 // otherwise, reject 9101 if ( gotoEnd ) { 9102 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 9103 deferred.resolveWith( elem, [ animation, gotoEnd ] ); 9104 } else { 9105 deferred.rejectWith( elem, [ animation, gotoEnd ] ); 9106 } 9107 return this; 9108 } 9109 } ), 9110 props = animation.props; 9111 9112 propFilter( props, animation.opts.specialEasing ); 9113 9114 for ( ; index < length ; index++ ) { 9115 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); 9116 if ( result ) { 9117 if ( jQuery.isFunction( result.stop ) ) { 9118 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = 9119 jQuery.proxy( result.stop, result ); 9120 } 9121 return result; 9122 } 9123 } 9124 9125 jQuery.map( props, createTween, animation ); 9126 9127 if ( jQuery.isFunction( animation.opts.start ) ) { 9128 animation.opts.start.call( elem, animation ); 9129 } 9130 9131 jQuery.fx.timer( 9132 jQuery.extend( tick, { 9133 elem: elem, 9134 anim: animation, 9135 queue: animation.opts.queue 9136 } ) 9137 ); 9138 9139 // attach callbacks from options 9140 return animation.progress( animation.opts.progress ) 9141 .done( animation.opts.done, animation.opts.complete ) 9142 .fail( animation.opts.fail ) 9143 .always( animation.opts.always ); 9144 } 9145 9146 jQuery.Animation = jQuery.extend( Animation, { 9147 9148 tweeners: { 9149 "*": [ function( prop, value ) { 9150 var tween = this.createTween( prop, value ); 9151 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); 9152 return tween; 9153 } ] 9154 }, 9155 9156 tweener: function( props, callback ) { 9157 if ( jQuery.isFunction( props ) ) { 9158 callback = props; 9159 props = [ "*" ]; 9160 } else { 9161 props = props.match( rnotwhite ); 9162 } 9163 9164 var prop, 9165 index = 0, 9166 length = props.length; 9167 9168 for ( ; index < length ; index++ ) { 9169 prop = props[ index ]; 9170 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; 9171 Animation.tweeners[ prop ].unshift( callback ); 9172 } 9173 }, 9174 9175 prefilters: [ defaultPrefilter ], 9176 9177 prefilter: function( callback, prepend ) { 9178 if ( prepend ) { 9179 Animation.prefilters.unshift( callback ); 9180 } else { 9181 Animation.prefilters.push( callback ); 9182 } 9183 } 9184 } ); 9185 9186 jQuery.speed = function( speed, easing, fn ) { 9187 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { 9188 complete: fn || !fn && easing || 9189 jQuery.isFunction( speed ) && speed, 9190 duration: speed, 9191 easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing 9192 }; 9193 9194 opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : 9195 opt.duration in jQuery.fx.speeds ? 9196 jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; 9197 9198 // normalize opt.queue - true/undefined/null -> "fx" 9199 if ( opt.queue == null || opt.queue === true ) { 9200 opt.queue = "fx"; 9201 } 9202 9203 // Queueing 9204 opt.old = opt.complete; 9205 9206 opt.complete = function() { 9207 if ( jQuery.isFunction( opt.old ) ) { 9208 opt.old.call( this ); 9209 } 9210 9211 if ( opt.queue ) { 9212 jQuery.dequeue( this, opt.queue ); 9213 } 9214 }; 9215 9216 return opt; 9217 }; 9218 9219 jQuery.fn.extend( { 9220 fadeTo: function( speed, to, easing, callback ) { 9221 9222 // show any hidden elements after setting opacity to 0 9223 return this.filter( isHidden ).css( "opacity", 0 ).show() 9224 9225 // animate to the value specified 9226 .end().animate( { opacity: to }, speed, easing, callback ); 9227 }, 9228 animate: function( prop, speed, easing, callback ) { 9229 var empty = jQuery.isEmptyObject( prop ), 9230 optall = jQuery.speed( speed, easing, callback ), 9231 doAnimation = function() { 9232 9233 // Operate on a copy of prop so per-property easing won't be lost 9234 var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 9235 9236 // Empty animations, or finishing resolves immediately 9237 if ( empty || jQuery._data( this, "finish" ) ) { 9238 anim.stop( true ); 9239 } 9240 }; 9241 doAnimation.finish = doAnimation; 9242 9243 return empty || optall.queue === false ? 9244 this.each( doAnimation ) : 9245 this.queue( optall.queue, doAnimation ); 9246 }, 9247 stop: function( type, clearQueue, gotoEnd ) { 9248 var stopQueue = function( hooks ) { 9249 var stop = hooks.stop; 9250 delete hooks.stop; 9251 stop( gotoEnd ); 9252 }; 9253 9254 if ( typeof type !== "string" ) { 9255 gotoEnd = clearQueue; 9256 clearQueue = type; 9257 type = undefined; 9258 } 9259 if ( clearQueue && type !== false ) { 9260 this.queue( type || "fx", [] ); 9261 } 9262 9263 return this.each( function() { 9264 var dequeue = true, 9265 index = type != null && type + "queueHooks", 9266 timers = jQuery.timers, 9267 data = jQuery._data( this ); 9268 9269 if ( index ) { 9270 if ( data[ index ] && data[ index ].stop ) { 9271 stopQueue( data[ index ] ); 9272 } 9273 } else { 9274 for ( index in data ) { 9275 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { 9276 stopQueue( data[ index ] ); 9277 } 9278 } 9279 } 9280 9281 for ( index = timers.length; index--; ) { 9282 if ( timers[ index ].elem === this && 9283 ( type == null || timers[ index ].queue === type ) ) { 9284 9285 timers[ index ].anim.stop( gotoEnd ); 9286 dequeue = false;
vendor: 7,139 bytes, lines 9287-9560
9287 timers.splice( index, 1 ); 9288 } 9289 } 9290 9291 // start the next in the queue if the last step wasn't forced 9292 // timers currently will call their complete callbacks, which will dequeue 9293 // but only if they were gotoEnd 9294 if ( dequeue || !gotoEnd ) { 9295 jQuery.dequeue( this, type ); 9296 } 9297 } ); 9298 }, 9299 finish: function( type ) { 9300 if ( type !== false ) { 9301 type = type || "fx"; 9302 } 9303 return this.each( function() { 9304 var index, 9305 data = jQuery._data( this ), 9306 queue = data[ type + "queue" ], 9307 hooks = data[ type + "queueHooks" ], 9308 timers = jQuery.timers, 9309 length = queue ? queue.length : 0; 9310 9311 // enable finishing flag on private data 9312 data.finish = true; 9313 9314 // empty the queue first 9315 jQuery.queue( this, type, [] ); 9316 9317 if ( hooks && hooks.stop ) { 9318 hooks.stop.call( this, true ); 9319 } 9320 9321 // look for any active animations, and finish them 9322 for ( index = timers.length; index--; ) { 9323 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 9324 timers[ index ].anim.stop( true ); 9325 timers.splice( index, 1 ); 9326 } 9327 } 9328 9329 // look for any animations in the old queue and finish them 9330 for ( index = 0; index < length; index++ ) { 9331 if ( queue[ index ] && queue[ index ].finish ) { 9332 queue[ index ].finish.call( this ); 9333 } 9334 } 9335 9336 // turn off finishing flag 9337 delete data.finish; 9338 } ); 9339 } 9340 } ); 9341 9342 jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) { 9343 var cssFn = jQuery.fn[ name ]; 9344 jQuery.fn[ name ] = function( speed, easing, callback ) { 9345 return speed == null || typeof speed === "boolean" ? 9346 cssFn.apply( this, arguments ) : 9347 this.animate( genFx( name, true ), speed, easing, callback ); 9348 }; 9349 } ); 9350 9351 // Generate shortcuts for custom animations 9352 jQuery.each( { 9353 slideDown: genFx( "show" ), 9354 slideUp: genFx( "hide" ), 9355 slideToggle: genFx( "toggle" ), 9356 fadeIn: { opacity: "show" }, 9357 fadeOut: { opacity: "hide" }, 9358 fadeToggle: { opacity: "toggle" } 9359 }, function( name, props ) { 9360 jQuery.fn[ name ] = function( speed, easing, callback ) { 9361 return this.animate( props, speed, easing, callback ); 9362 }; 9363 } ); 9364 9365 jQuery.timers = []; 9366 jQuery.fx.tick = function() { 9367 var timer, 9368 timers = jQuery.timers, 9369 i = 0; 9370 9371 fxNow = jQuery.now(); 9372 9373 for ( ; i < timers.length; i++ ) { 9374 timer = timers[ i ]; 9375 9376 // Checks the timer has not already been removed 9377 if ( !timer() && timers[ i ] === timer ) { 9378 timers.splice( i--, 1 ); 9379 } 9380 } 9381 9382 if ( !timers.length ) { 9383 jQuery.fx.stop(); 9384 } 9385 fxNow = undefined; 9386 }; 9387 9388 jQuery.fx.timer = function( timer ) { 9389 jQuery.timers.push( timer ); 9390 if ( timer() ) { 9391 jQuery.fx.start(); 9392 } else { 9393 jQuery.timers.pop(); 9394 } 9395 }; 9396 9397 jQuery.fx.interval = 13; 9398 9399 jQuery.fx.start = function() { 9400 if ( !timerId ) { 9401 timerId = window.setInterval( jQuery.fx.tick, jQuery.fx.interval ); 9402 } 9403 }; 9404 9405 jQuery.fx.stop = function() { 9406 window.clearInterval( timerId ); 9407 timerId = null; 9408 }; 9409 9410 jQuery.fx.speeds = { 9411 slow: 600, 9412 fast: 200, 9413 9414 // Default speed 9415 _default: 400 9416 }; 9417 9418 9419 // Based off of the plugin by Clint Helfers, with permission. 9420 // http://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ 9421 jQuery.fn.delay = function( time, type ) { 9422 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 9423 type = type || "fx"; 9424 9425 return this.queue( type, function( next, hooks ) { 9426 var timeout = window.setTimeout( next, time ); 9427 hooks.stop = function() { 9428 window.clearTimeout( timeout ); 9429 }; 9430 } ); 9431 }; 9432 9433 9434 ( function() { 9435 var a, 9436 input = document.createElement( "input" ), 9437 div = document.createElement( "div" ), 9438 select = document.createElement( "select" ), 9439 opt = select.appendChild( document.createElement( "option" ) ); 9440 9441 // Setup 9442 div = document.createElement( "div" ); 9443 div.setAttribute( "className", "t" ); 9444 div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; 9445 a = div.getElementsByTagName( "a" )[ 0 ]; 9446 9447 // Support: Windows Web Apps (WWA) 9448 // `type` must use .setAttribute for WWA (#14901) 9449 input.setAttribute( "type", "checkbox" ); 9450 div.appendChild( input ); 9451 9452 a = div.getElementsByTagName( "a" )[ 0 ]; 9453 9454 // First batch of tests. 9455 a.style.cssText = "top:1px"; 9456 9457 // Test setAttribute on camelCase class. 9458 // If it works, we need attrFixes when doing get/setAttribute (ie6/7) 9459 support.getSetAttribute = div.className !== "t"; 9460 9461 // Get the style information from getAttribute 9462 // (IE uses .cssText instead) 9463 support.style = /top/.test( a.getAttribute( "style" ) ); 9464 9465 // Make sure that URLs aren't manipulated 9466 // (IE normalizes it by default) 9467 support.hrefNormalized = a.getAttribute( "href" ) === "/a"; 9468 9469 // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) 9470 support.checkOn = !!input.value; 9471 9472 // Make sure that a selected-by-default option has a working selected property. 9473 // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) 9474 support.optSelected = opt.selected; 9475 9476 // Tests for enctype support on a form (#6743) 9477 support.enctype = !!document.createElement( "form" ).enctype; 9478 9479 // Make sure that the options inside disabled selects aren't marked as disabled 9480 // (WebKit marks them as disabled) 9481 select.disabled = true; 9482 support.optDisabled = !opt.disabled; 9483 9484 // Support: IE8 only 9485 // Check if we can trust getAttribute("value") 9486 input = document.createElement( "input" ); 9487 input.setAttribute( "value", "" ); 9488 support.input = input.getAttribute( "value" ) === ""; 9489 9490 // Check if an input maintains its value after becoming a radio 9491 input.value = "t"; 9492 input.setAttribute( "type", "radio" ); 9493 support.radioValue = input.value === "t"; 9494 } )(); 9495 9496 9497 var rreturn = /\r/g, 9498 rspaces = /[\x20\t\r\n\f]+/g; 9499 9500 jQuery.fn.extend( { 9501 val: function( value ) { 9502 var hooks, ret, isFunction, 9503 elem = this[ 0 ]; 9504 9505 if ( !arguments.length ) { 9506 if ( elem ) { 9507 hooks = jQuery.valHooks[ elem.type ] || 9508 jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 9509 9510 if ( 9511 hooks && 9512 "get" in hooks && 9513 ( ret = hooks.get( elem, "value" ) ) !== undefined 9514 ) { 9515 return ret; 9516 } 9517 9518 ret = elem.value; 9519 9520 return typeof ret === "string" ? 9521 9522 // handle most common string cases 9523 ret.replace( rreturn, "" ) : 9524 9525 // handle cases where value is null/undef or number 9526 ret == null ? "" : ret; 9527 } 9528 9529 return; 9530 } 9531 9532 isFunction = jQuery.isFunction( value ); 9533 9534 return this.each( function( i ) { 9535 var val; 9536 9537 if ( this.nodeType !== 1 ) { 9538 return; 9539 } 9540 9541 if ( isFunction ) { 9542 val = value.call( this, i, jQuery( this ).val() ); 9543 } else { 9544 val = value; 9545 } 9546 9547 // Treat null/undefined as ""; convert numbers to string 9548 if ( val == null ) { 9549 val = ""; 9550 } else if ( typeof val === "number" ) { 9551 val += ""; 9552 } else if ( jQuery.isArray( val ) ) { 9553 val = jQuery.map( val, function( value ) { 9554 return value == null ? "" : value + ""; 9555 } ); 9556 } 9557 9558 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 9559 9560 // If set returns undefined, fall back to normal setting
vendor: 5,794 bytes, lines 9561-9783
9561 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { 9562 this.value = val; 9563 } 9564 } ); 9565 } 9566 } ); 9567 9568 jQuery.extend( { 9569 valHooks: { 9570 option: { 9571 get: function( elem ) { 9572 var val = jQuery.find.attr( elem, "value" ); 9573 return val != null ? 9574 val : 9575 9576 // Support: IE10-11+ 9577 // option.text throws exceptions (#14686, #14858) 9578 // Strip and collapse whitespace 9579 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace 9580 jQuery.trim( jQuery.text( elem ) ).replace( rspaces, " " ); 9581 } 9582 }, 9583 select: { 9584 get: function( elem ) { 9585 var value, option, 9586 options = elem.options, 9587 index = elem.selectedIndex, 9588 one = elem.type === "select-one" || index < 0, 9589 values = one ? null : [], 9590 max = one ? index + 1 : options.length, 9591 i = index < 0 ? 9592 max : 9593 one ? index : 0; 9594 9595 // Loop through all the selected options 9596 for ( ; i < max; i++ ) { 9597 option = options[ i ]; 9598 9599 // oldIE doesn't update selected after form reset (#2551) 9600 if ( ( option.selected || i === index ) && 9601 9602 // Don't return options that are disabled or in a disabled optgroup 9603 ( support.optDisabled ? 9604 !option.disabled : 9605 option.getAttribute( "disabled" ) === null ) && 9606 ( !option.parentNode.disabled || 9607 !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { 9608 9609 // Get the specific value for the option 9610 value = jQuery( option ).val(); 9611 9612 // We don't need an array for one selects 9613 if ( one ) { 9614 return value; 9615 } 9616 9617 // Multi-Selects return an array 9618 values.push( value ); 9619 } 9620 } 9621 9622 return values; 9623 }, 9624 9625 set: function( elem, value ) { 9626 var optionSet, option, 9627 options = elem.options, 9628 values = jQuery.makeArray( value ), 9629 i = options.length; 9630 9631 while ( i-- ) { 9632 option = options[ i ]; 9633 9634 if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 ) { 9635 9636 // Support: IE6 9637 // When new option element is added to select box we need to 9638 // force reflow of newly added node in order to workaround delay 9639 // of initialization properties 9640 try { 9641 option.selected = optionSet = true; 9642 9643 } catch ( _ ) { 9644 9645 // Will be executed only in IE6 9646 option.scrollHeight; 9647 } 9648 9649 } else { 9650 option.selected = false; 9651 } 9652 } 9653 9654 // Force browsers to behave consistently when non-matching value is set 9655 if ( !optionSet ) { 9656 elem.selectedIndex = -1; 9657 } 9658 9659 return options; 9660 } 9661 } 9662 } 9663 } ); 9664 9665 // Radios and checkboxes getter/setter 9666 jQuery.each( [ "radio", "checkbox" ], function() { 9667 jQuery.valHooks[ this ] = { 9668 set: function( elem, value ) { 9669 if ( jQuery.isArray( value ) ) { 9670 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); 9671 } 9672 } 9673 }; 9674 if ( !support.checkOn ) { 9675 jQuery.valHooks[ this ].get = function( elem ) { 9676 return elem.getAttribute( "value" ) === null ? "on" : elem.value; 9677 }; 9678 } 9679 } ); 9680 9681 9682 9683 9684 var nodeHook, boolHook, 9685 attrHandle = jQuery.expr.attrHandle, 9686 ruseDefault = /^(?:checked|selected)$/i, 9687 getSetAttribute = support.getSetAttribute, 9688 getSetInput = support.input; 9689 9690 jQuery.fn.extend( { 9691 attr: function( name, value ) { 9692 return access( this, jQuery.attr, name, value, arguments.length > 1 ); 9693 }, 9694 9695 removeAttr: function( name ) { 9696 return this.each( function() { 9697 jQuery.removeAttr( this, name ); 9698 } ); 9699 } 9700 } ); 9701 9702 jQuery.extend( { 9703 attr: function( elem, name, value ) { 9704 var ret, hooks, 9705 nType = elem.nodeType; 9706 9707 // Don't get/set attributes on text, comment and attribute nodes 9708 if ( nType === 3 || nType === 8 || nType === 2 ) { 9709 return; 9710 } 9711 9712 // Fallback to prop when attributes are not supported 9713 if ( typeof elem.getAttribute === "undefined" ) { 9714 return jQuery.prop( elem, name, value ); 9715 } 9716 9717 // All attributes are lowercase 9718 // Grab necessary hook if one is defined 9719 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 9720 name = name.toLowerCase(); 9721 hooks = jQuery.attrHooks[ name ] || 9722 ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); 9723 } 9724 9725 if ( value !== undefined ) { 9726 if ( value === null ) { 9727 jQuery.removeAttr( elem, name ); 9728 return; 9729 } 9730 9731 if ( hooks && "set" in hooks && 9732 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 9733 return ret; 9734 } 9735 9736 elem.setAttribute( name, value + "" ); 9737 return value; 9738 } 9739 9740 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 9741 return ret; 9742 } 9743 9744 ret = jQuery.find.attr( elem, name ); 9745 9746 // Non-existent attributes return null, we normalize to undefined 9747 return ret == null ? undefined : ret; 9748 }, 9749 9750 attrHooks: { 9751 type: { 9752 set: function( elem, value ) { 9753 if ( !support.radioValue && value === "radio" && 9754 jQuery.nodeName( elem, "input" ) ) { 9755 9756 // Setting the type on a radio button after the value resets the value in IE8-9 9757 // Reset value to default in case type is set after value during creation 9758 var val = elem.value; 9759 elem.setAttribute( "type", value ); 9760 if ( val ) { 9761 elem.value = val; 9762 } 9763 return value; 9764 } 9765 } 9766 } 9767 }, 9768 9769 removeAttr: function( elem, value ) { 9770 var name, propName, 9771 i = 0, 9772 attrNames = value && value.match( rnotwhite ); 9773 9774 if ( attrNames && elem.nodeType === 1 ) { 9775 while ( ( name = attrNames[ i++ ] ) ) { 9776 propName = jQuery.propFix[ name ] || name; 9777 9778 // Boolean attributes get special treatment (#10870) 9779 if ( jQuery.expr.match.bool.test( name ) ) { 9780 9781 // Set corresponding property to false 9782 if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { 9783 elem[ propName ] = false;
vendor: 4,518 bytes, lines 9784-9948
9784 9785 // Support: IE<9 9786 // Also clear defaultChecked/defaultSelected (if appropriate) 9787 } else { 9788 elem[ jQuery.camelCase( "default-" + name ) ] = 9789 elem[ propName ] = false; 9790 } 9791 9792 // See #9699 for explanation of this approach (setting first, then removal) 9793 } else { 9794 jQuery.attr( elem, name, "" ); 9795 } 9796 9797 elem.removeAttribute( getSetAttribute ? name : propName ); 9798 } 9799 } 9800 } 9801 } ); 9802 9803 // Hooks for boolean attributes 9804 boolHook = { 9805 set: function( elem, value, name ) { 9806 if ( value === false ) { 9807 9808 // Remove boolean attributes when set to false 9809 jQuery.removeAttr( elem, name ); 9810 } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { 9811 9812 // IE<8 needs the *property* name 9813 elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); 9814 9815 } else { 9816 9817 // Support: IE<9 9818 // Use defaultChecked and defaultSelected for oldIE 9819 elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; 9820 } 9821 return name; 9822 } 9823 }; 9824 9825 jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { 9826 var getter = attrHandle[ name ] || jQuery.find.attr; 9827 9828 if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { 9829 attrHandle[ name ] = function( elem, name, isXML ) { 9830 var ret, handle; 9831 if ( !isXML ) { 9832 9833 // Avoid an infinite loop by temporarily removing this function from the getter 9834 handle = attrHandle[ name ]; 9835 attrHandle[ name ] = ret; 9836 ret = getter( elem, name, isXML ) != null ? 9837 name.toLowerCase() : 9838 null; 9839 attrHandle[ name ] = handle; 9840 } 9841 return ret; 9842 }; 9843 } else { 9844 attrHandle[ name ] = function( elem, name, isXML ) { 9845 if ( !isXML ) { 9846 return elem[ jQuery.camelCase( "default-" + name ) ] ? 9847 name.toLowerCase() : 9848 null; 9849 } 9850 }; 9851 } 9852 } ); 9853 9854 // fix oldIE attroperties 9855 if ( !getSetInput || !getSetAttribute ) { 9856 jQuery.attrHooks.value = { 9857 set: function( elem, value, name ) { 9858 if ( jQuery.nodeName( elem, "input" ) ) { 9859 9860 // Does not return so that setAttribute is also used 9861 elem.defaultValue = value; 9862 } else { 9863 9864 // Use nodeHook if defined (#1954); otherwise setAttribute is fine 9865 return nodeHook && nodeHook.set( elem, value, name ); 9866 } 9867 } 9868 }; 9869 } 9870 9871 // IE6/7 do not support getting/setting some attributes with get/setAttribute 9872 if ( !getSetAttribute ) { 9873 9874 // Use this for any attribute in IE6/7 9875 // This fixes almost every IE6/7 issue 9876 nodeHook = { 9877 set: function( elem, value, name ) { 9878 9879 // Set the existing or create a new attribute node 9880 var ret = elem.getAttributeNode( name ); 9881 if ( !ret ) { 9882 elem.setAttributeNode( 9883 ( ret = elem.ownerDocument.createAttribute( name ) ) 9884 ); 9885 } 9886 9887 ret.value = value += ""; 9888 9889 // Break association with cloned elements by also using setAttribute (#9646) 9890 if ( name === "value" || value === elem.getAttribute( name ) ) { 9891 return value; 9892 } 9893 } 9894 }; 9895 9896 // Some attributes are constructed with empty-string values when not defined 9897 attrHandle.id = attrHandle.name = attrHandle.coords = 9898 function( elem, name, isXML ) { 9899 var ret; 9900 if ( !isXML ) { 9901 return ( ret = elem.getAttributeNode( name ) ) && ret.value !== "" ? 9902 ret.value : 9903 null; 9904 } 9905 }; 9906 9907 // Fixing value retrieval on a button requires this module 9908 jQuery.valHooks.button = { 9909 get: function( elem, name ) { 9910 var ret = elem.getAttributeNode( name ); 9911 if ( ret && ret.specified ) { 9912 return ret.value; 9913 } 9914 }, 9915 set: nodeHook.set 9916 }; 9917 9918 // Set contenteditable to false on removals(#10429) 9919 // Setting to empty string throws an error as an invalid value 9920 jQuery.attrHooks.contenteditable = { 9921 set: function( elem, value, name ) { 9922 nodeHook.set( elem, value === "" ? false : value, name ); 9923 } 9924 }; 9925 9926 // Set width and height to auto instead of 0 on empty string( Bug #8150 ) 9927 // This is for removals 9928 jQuery.each( [ "width", "height" ], function( i, name ) { 9929 jQuery.attrHooks[ name ] = { 9930 set: function( elem, value ) { 9931 if ( value === "" ) { 9932 elem.setAttribute( name, "auto" ); 9933 return value; 9934 } 9935 } 9936 }; 9937 } ); 9938 } 9939 9940 if ( !support.style ) { 9941 jQuery.attrHooks.style = { 9942 get: function( elem ) { 9943 9944 // Return undefined in the case of empty string 9945 // Note: IE uppercases css property names, but if we were to .toLowerCase() 9946 // .cssText, that would destroy case sensitivity in URL's, like in "background" 9947 return elem.style.cssText || undefined; 9948 },
9949 set: function( elem, value ) { 9950 return ( elem.style.cssText = value + "" ); 9951 } 9952 }; 9953 } 9954 9955 9956 9957 9958 var rfocusable = /^(?:input|select|textarea|button|object)$/i, 9959 rclickable = /^(?:a|area)$/i; 9960 9961 jQuery.fn.extend( { 9962 prop: function( name, value ) { 9963 return access( this, jQuery.prop, name, value, arguments.length > 1 ); 9964 }, 9965 9966 removeProp: function( name ) { 9967 name = jQuery.propFix[ name ] || name; 9968 return this.each( function() { 9969 9970 // try/catch handles cases where IE balks (such as removing a property on window) 9971 try { 9972 this[ name ] = undefined; 9973 delete this[ name ]; 9974 } catch ( e ) {} 9975 } ); 9976 } 9977 } ); 9978 9979 jQuery.extend( { 9980 prop: function( elem, name, value ) { 9981 var ret, hooks, 9982 nType = elem.nodeType; 9983 9984 // Don't get/set properties on text, comment and attribute nodes 9985 if ( nType === 3 || nType === 8 || nType === 2 ) { 9986 return; 9987 } 9988 9989 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 9990 9991 // Fix name and attach hooks 9992 name = jQuery.propFix[ name ] || name; 9993 hooks = jQuery.propHooks[ name ]; 9994 } 9995 9996 if ( value !== undefined ) { 9997 if ( hooks && "set" in hooks && 9998 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 9999 return ret; 10000 } 10001 10002 return ( elem[ name ] = value ); 10003 } 10004 10005 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 10006 return ret; 10007 } 10008 10009 return elem[ name ]; 10010 }, 10011 10012 propHooks: { 10013 tabIndex: { 10014 get: function( elem ) { 10015 10016 // elem.tabIndex doesn't always return the 10017 // correct value when it hasn't been explicitly set 10018 // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ 10019 // Use proper attribute retrieval(#12072) 10020 var tabindex = jQuery.find.attr( elem, "tabindex" ); 10021 10022 return tabindex ? 10023 parseInt( tabindex, 10 ) : 10024 rfocusable.test( elem.nodeName ) || 10025 rclickable.test( elem.nodeName ) && elem.href ? 10026 0 : 10027 -1; 10028 } 10029 } 10030 }, 10031 10032 propFix: { 10033 "for": "htmlFor", 10034 "class": "className" 10035 } 10036 } ); 10037 10038 // Some attributes require a special call on IE 10039 // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx 10040 if ( !support.hrefNormalized ) { 10041 10042 // href/src property should get the full normalized URL (#10299/#12915) 10043 jQuery.each( [ "href", "src" ], function( i, name ) { 10044 jQuery.propHooks[ name ] = { 10045 get: function( elem ) { 10046 return elem.getAttribute( name, 4 ); 10047 } 10048 }; 10049 } ); 10050 } 10051 10052 // Support: Safari, IE9+ 10053 // Accessing the selectedIndex property 10054 // forces the browser to respect setting selected 10055 // on the option 10056 // The getter ensures a default option is selected 10057 // when in an optgroup 10058 if ( !support.optSelected ) { 10059 jQuery.propHooks.selected = { 10060 get: function( elem ) { 10061 var parent = elem.parentNode; 10062 10063 if ( parent ) { 10064 parent.selectedIndex; 10065 10066 // Make sure that it also works with optgroups, see #5701 10067 if ( parent.parentNode ) { 10068 parent.parentNode.selectedIndex; 10069 } 10070 } 10071 return null; 10072 }, 10073 set: function( elem ) { 10074 var parent = elem.parentNode; 10075 if ( parent ) { 10076 parent.selectedIndex; 10077 10078 if ( parent.parentNode ) { 10079 parent.parentNode.selectedIndex; 10080 } 10081 } 10082 } 10083 }; 10084 } 10085 10086 jQuery.each( [ 10087 "tabIndex", 10088 "readOnly", 10089 "maxLength", 10090 "cellSpacing", 10091 "cellPadding", 10092 "rowSpan", 10093 "colSpan", 10094 "useMap", 10095 "frameBorder", 10096 "contentEditable" 10097 ], function() { 10098 jQuery.propFix[ this.toLowerCase() ] = this; 10099 } ); 10100 10101 // IE6/7 call enctype encoding 10102 if ( !support.enctype ) { 10103 jQuery.propFix.enctype = "encoding"; 10104 } 10105 10106 10107 10108 10109 var rclass = /[\t\r\n\f]/g; 10110 10111 function getClass( elem ) { 10112 return jQuery.attr( elem, "class" ) || ""; 10113 } 10114 10115 jQuery.fn.extend( { 10116 addClass: function( value ) { 10117 var classes, elem, cur, curValue, clazz, j, finalValue, 10118 i = 0; 10119 10120 if ( jQuery.isFunction( value ) ) { 10121 return this.each( function( j ) { 10122 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); 10123 } ); 10124 } 10125 10126 if ( typeof value === "string" && value ) { 10127 classes = value.match( rnotwhite ) || []; 10128 10129 while ( ( elem = this[ i++ ] ) ) { 10130 curValue = getClass( elem ); 10131 cur = elem.nodeType === 1 && 10132 ( " " + curValue + " " ).replace( rclass, " " ); 10133 10134 if ( cur ) { 10135 j = 0; 10136 while ( ( clazz = classes[ j++ ] ) ) { 10137 if ( cur.indexOf( " " + clazz + " " ) < 0 ) { 10138 cur += clazz + " "; 10139 } 10140 } 10141 10142 // only assign if different to avoid unneeded rendering. 10143 finalValue = jQuery.trim( cur ); 10144 if ( curValue !== finalValue ) { 10145 jQuery.attr( elem, "class", finalValue ); 10146 } 10147 } 10148 } 10149 } 10150 10151 return this; 10152 }, 10153 10154 removeClass: function( value ) { 10155 var classes, elem, cur, curValue, clazz, j, finalValue, 10156 i = 0; 10157 10158 if ( jQuery.isFunction( value ) ) { 10159 return this.each( function( j ) { 10160 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); 10161 } ); 10162 } 10163 10164 if ( !arguments.length ) { 10165 return this.attr( "class", "" ); 10166 } 10167 10168 if ( typeof value === "string" && value ) { 10169 classes = value.match( rnotwhite ) || []; 10170 10171 while ( ( elem = this[ i++ ] ) ) { 10172 curValue = getClass( elem ); 10173 10174 // This expression is here for better compressibility (see addClass) 10175 cur = elem.nodeType === 1 && 10176 ( " " + curValue + " " ).replace( rclass, " " ); 10177 10178 if ( cur ) { 10179 j = 0; 10180 while ( ( clazz = classes[ j++ ] ) ) { 10181
10182 // Remove *all* instances 10183 while ( cur.indexOf( " " + clazz + " " ) > -1 ) { 10184 cur = cur.replace( " " + clazz + " ", " " ); 10185 } 10186 } 10187 10188 // Only assign if different to avoid unneeded rendering. 10189 finalValue = jQuery.trim( cur ); 10190 if ( curValue !== finalValue ) { 10191 jQuery.attr( elem, "class", finalValue ); 10192 } 10193 } 10194 } 10195 } 10196 10197 return this; 10198 }, 10199 10200 toggleClass: function( value, stateVal ) { 10201 var type = typeof value; 10202 10203 if ( typeof stateVal === "boolean" && type === "string" ) { 10204 return stateVal ? this.addClass( value ) : this.removeClass( value ); 10205 } 10206 10207 if ( jQuery.isFunction( value ) ) { 10208 return this.each( function( i ) { 10209 jQuery( this ).toggleClass( 10210 value.call( this, i, getClass( this ), stateVal ), 10211 stateVal 10212 ); 10213 } ); 10214 } 10215 10216 return this.each( function() { 10217 var className, i, self, classNames; 10218 10219 if ( type === "string" ) { 10220 10221 // Toggle individual class names 10222 i = 0; 10223 self = jQuery( this ); 10224 classNames = value.match( rnotwhite ) || []; 10225 10226 while ( ( className = classNames[ i++ ] ) ) { 10227 10228 // Check each className given, space separated list 10229 if ( self.hasClass( className ) ) { 10230 self.removeClass( className ); 10231 } else { 10232 self.addClass( className ); 10233 } 10234 } 10235 10236 // Toggle whole class name 10237 } else if ( value === undefined || type === "boolean" ) { 10238 className = getClass( this ); 10239 if ( className ) { 10240 10241 // store className if set 10242 jQuery._data( this, "__className__", className ); 10243 } 10244 10245 // If the element has a class name or if we're passed "false", 10246 // then remove the whole classname (if there was one, the above saved it). 10247 // Otherwise bring back whatever was previously saved (if anything), 10248 // falling back to the empty string if nothing was stored. 10249 jQuery.attr( this, "class", 10250 className || value === false ? 10251 "" : 10252 jQuery._data( this, "__className__" ) || "" 10253 ); 10254 } 10255 } ); 10256 }, 10257 10258 hasClass: function( selector ) { 10259 var className, elem, 10260 i = 0; 10261 10262 className = " " + selector + " "; 10263 while ( ( elem = this[ i++ ] ) ) { 10264 if ( elem.nodeType === 1 && 10265 ( " " + getClass( elem ) + " " ).replace( rclass, " " ) 10266 .indexOf( className ) > -1 10267 ) { 10268 return true; 10269 } 10270 } 10271 10272 return false; 10273 } 10274 } ); 10275 10276 10277 10278 10279 // Return jQuery for attributes-only inclusion 10280 10281 10282 jQuery.each( ( "blur focus focusin focusout load resize scroll unload click dblclick " + 10283 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 10284 "change select submit keydown keypress keyup error contextmenu" ).split( " " ), 10285 function( i, name ) { 10286 10287 // Handle event binding 10288 jQuery.fn[ name ] = function( data, fn ) { 10289 return arguments.length > 0 ? 10290 this.on( name, null, data, fn ) : 10291 this.trigger( name ); 10292 }; 10293 } ); 10294 10295 jQuery.fn.extend( { 10296 hover: function( fnOver, fnOut ) { 10297 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 10298 } 10299 } ); 10300 10301 10302 var location = window.location; 10303 10304 var nonce = jQuery.now(); 10305 10306 var rquery = ( /\?/ ); 10307 10308 10309 10310 var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g; 10311 10312 jQuery.parseJSON = function( data ) { 10313 10314 // Attempt to parse using the native JSON parser first 10315 if ( window.JSON && window.JSON.parse ) { 10316 10317 // Support: Android 2.3 10318 // Workaround failure to string-cast null input 10319 return window.JSON.parse( data + "" ); 10320 } 10321 10322 var requireNonComma, 10323 depth = null, 10324 str = jQuery.trim( data + "" ); 10325 10326 // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains 10327 // after removing valid tokens 10328 return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) { 10329 10330 // Force termination if we see a misplaced comma 10331 if ( requireNonComma && comma ) { 10332 depth = 0; 10333 } 10334 10335 // Perform no more replacements after returning to outermost depth 10336 if ( depth === 0 ) { 10337 return token; 10338 } 10339 10340 // Commas must not follow "[", "{", or "," 10341 requireNonComma = open || comma; 10342 10343 // Determine new depth 10344 // array/object open ("[" or "{"): depth += true - false (increment) 10345 // array/object close ("]" or "}"): depth += false - true (decrement) 10346 // other cases ("," or primitive): depth += true - true (numeric cast) 10347 depth += !close - !open; 10348 10349 // Remove this token 10350 return ""; 10351 } ) ) ? 10352 ( Function( "return " + str ) )() : 10353 jQuery.error( "Invalid JSON: " + data ); 10354 }; 10355 10356 10357 // Cross-browser xml parsing 10358 jQuery.parseXML = function( data ) { 10359 var xml, tmp; 10360 if ( !data || typeof data !== "string" ) { 10361 return null; 10362 } 10363 try { 10364 if ( window.DOMParser ) { // Standard 10365 tmp = new window.DOMParser(); 10366 xml = tmp.parseFromString( data, "text/xml" ); 10367 } else { // IE 10368 xml = new window.ActiveXObject( "Microsoft.XMLDOM" ); 10369 xml.async = "false"; 10370 xml.loadXML( data ); 10371 } 10372 } catch ( e ) { 10373 xml = undefined; 10374 } 10375 if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { 10376 jQuery.error( "Invalid XML: " + data ); 10377 } 10378 return xml; 10379 }; 10380 10381 10382 var 10383 rhash = /#.*$/, 10384 rts = /([?&])_=[^&]*/, 10385 10386 // IE leaves an \r character at EOL 10387 rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, 10388
vendor: 9,624 bytes, lines 10389-10747
10389 // #7653, #8125, #8152: local protocol detection 10390 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 10391 rnoContent = /^(?:GET|HEAD)$/, 10392 rprotocol = /^\/\//, 10393 rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, 10394 10395 /* Prefilters 10396 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 10397 * 2) These are called: 10398 * - BEFORE asking for a transport 10399 * - AFTER param serialization (s.data is a string if s.processData is true) 10400 * 3) key is the dataType 10401 * 4) the catchall symbol "*" can be used 10402 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 10403 */ 10404 prefilters = {}, 10405 10406 /* Transports bindings 10407 * 1) key is the dataType 10408 * 2) the catchall symbol "*" can be used 10409 * 3) selection will start with transport dataType and THEN go to "*" if needed 10410 */ 10411 transports = {}, 10412 10413 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression 10414 allTypes = "*/".concat( "*" ), 10415 10416 // Document location 10417 ajaxLocation = location.href, 10418 10419 // Segment location into parts 10420 ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; 10421 10422 // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 10423 function addToPrefiltersOrTransports( structure ) { 10424 10425 // dataTypeExpression is optional and defaults to "*" 10426 return function( dataTypeExpression, func ) { 10427 10428 if ( typeof dataTypeExpression !== "string" ) { 10429 func = dataTypeExpression; 10430 dataTypeExpression = "*"; 10431 } 10432 10433 var dataType, 10434 i = 0, 10435 dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || []; 10436 10437 if ( jQuery.isFunction( func ) ) { 10438 10439 // For each dataType in the dataTypeExpression 10440 while ( ( dataType = dataTypes[ i++ ] ) ) { 10441 10442 // Prepend if requested 10443 if ( dataType.charAt( 0 ) === "+" ) { 10444 dataType = dataType.slice( 1 ) || "*"; 10445 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); 10446 10447 // Otherwise append 10448 } else { 10449 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); 10450 } 10451 } 10452 } 10453 }; 10454 } 10455 10456 // Base inspection function for prefilters and transports 10457 function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { 10458 10459 var inspected = {}, 10460 seekingTransport = ( structure === transports ); 10461 10462 function inspect( dataType ) { 10463 var selected; 10464 inspected[ dataType ] = true; 10465 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { 10466 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); 10467 if ( typeof dataTypeOrTransport === "string" && 10468 !seekingTransport && !inspected[ dataTypeOrTransport ] ) { 10469 10470 options.dataTypes.unshift( dataTypeOrTransport ); 10471 inspect( dataTypeOrTransport ); 10472 return false; 10473 } else if ( seekingTransport ) { 10474 return !( selected = dataTypeOrTransport ); 10475 } 10476 } ); 10477 return selected; 10478 } 10479 10480 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); 10481 } 10482 10483 // A special extend for ajax options 10484 // that takes "flat" options (not to be deep extended) 10485 // Fixes #9887 10486 function ajaxExtend( target, src ) { 10487 var deep, key, 10488 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 10489 10490 for ( key in src ) { 10491 if ( src[ key ] !== undefined ) { 10492 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; 10493 } 10494 } 10495 if ( deep ) { 10496 jQuery.extend( true, target, deep ); 10497 } 10498 10499 return target; 10500 } 10501 10502 /* Handles responses to an ajax request: 10503 * - finds the right dataType (mediates between content-type and expected dataType) 10504 * - returns the corresponding response 10505 */ 10506 function ajaxHandleResponses( s, jqXHR, responses ) { 10507 var firstDataType, ct, finalDataType, type, 10508 contents = s.contents, 10509 dataTypes = s.dataTypes; 10510 10511 // Remove auto dataType and get content-type in the process 10512 while ( dataTypes[ 0 ] === "*" ) { 10513 dataTypes.shift(); 10514 if ( ct === undefined ) { 10515 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); 10516 } 10517 } 10518 10519 // Check if we're dealing with a known content-type 10520 if ( ct ) { 10521 for ( type in contents ) { 10522 if ( contents[ type ] && contents[ type ].test( ct ) ) { 10523 dataTypes.unshift( type ); 10524 break; 10525 } 10526 } 10527 } 10528 10529 // Check to see if we have a response for the expected dataType 10530 if ( dataTypes[ 0 ] in responses ) { 10531 finalDataType = dataTypes[ 0 ]; 10532 } else { 10533 10534 // Try convertible dataTypes 10535 for ( type in responses ) { 10536 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { 10537 finalDataType = type; 10538 break; 10539 } 10540 if ( !firstDataType ) { 10541 firstDataType = type; 10542 } 10543 } 10544 10545 // Or just use first one 10546 finalDataType = finalDataType || firstDataType; 10547 } 10548 10549 // If we found a dataType 10550 // We add the dataType to the list if needed 10551 // and return the corresponding response 10552 if ( finalDataType ) { 10553 if ( finalDataType !== dataTypes[ 0 ] ) { 10554 dataTypes.unshift( finalDataType ); 10555 } 10556 return responses[ finalDataType ]; 10557 } 10558 } 10559 10560 /* Chain conversions given the request and the original response 10561 * Also sets the responseXXX fields on the jqXHR instance 10562 */ 10563 function ajaxConvert( s, response, jqXHR, isSuccess ) { 10564 var conv2, current, conv, tmp, prev, 10565 converters = {}, 10566 10567 // Work with a copy of dataTypes in case we need to modify it for conversion 10568 dataTypes = s.dataTypes.slice(); 10569 10570 // Create converters map with lowercased keys 10571 if ( dataTypes[ 1 ] ) { 10572 for ( conv in s.converters ) { 10573 converters[ conv.toLowerCase() ] = s.converters[ conv ]; 10574 } 10575 } 10576 10577 current = dataTypes.shift(); 10578 10579 // Convert to each sequential dataType 10580 while ( current ) { 10581 10582 if ( s.responseFields[ current ] ) { 10583 jqXHR[ s.responseFields[ current ] ] = response; 10584 } 10585 10586 // Apply the dataFilter if provided 10587 if ( !prev && isSuccess && s.dataFilter ) { 10588 response = s.dataFilter( response, s.dataType ); 10589 } 10590 10591 prev = current; 10592 current = dataTypes.shift(); 10593 10594 if ( current ) { 10595 10596 // There's only work to do if current dataType is non-auto 10597 if ( current === "*" ) { 10598 10599 current = prev; 10600 10601 // Convert response if prev dataType is non-auto and differs from current 10602 } else if ( prev !== "*" && prev !== current ) { 10603 10604 // Seek a direct converter 10605 conv = converters[ prev + " " + current ] || converters[ "* " + current ]; 10606 10607 // If none found, seek a pair 10608 if ( !conv ) { 10609 for ( conv2 in converters ) { 10610 10611 // If conv2 outputs current 10612 tmp = conv2.split( " " ); 10613 if ( tmp[ 1 ] === current ) { 10614 10615 // If prev can be converted to accepted input 10616 conv = converters[ prev + " " + tmp[ 0 ] ] || 10617 converters[ "* " + tmp[ 0 ] ]; 10618 if ( conv ) { 10619 10620 // Condense equivalence converters 10621 if ( conv === true ) { 10622 conv = converters[ conv2 ]; 10623 10624 // Otherwise, insert the intermediate dataType 10625 } else if ( converters[ conv2 ] !== true ) { 10626 current = tmp[ 0 ]; 10627 dataTypes.unshift( tmp[ 1 ] ); 10628 } 10629 break; 10630 } 10631 } 10632 } 10633 } 10634 10635 // Apply converter (if not an equivalence) 10636 if ( conv !== true ) { 10637 10638 // Unless errors are allowed to bubble, catch and return them 10639 if ( conv && s[ "throws" ] ) { // jscs:ignore requireDotNotation 10640 response = conv( response ); 10641 } else { 10642 try { 10643 response = conv( response ); 10644 } catch ( e ) { 10645 return { 10646 state: "parsererror", 10647 error: conv ? e : "No conversion from " + prev + " to " + current 10648 }; 10649 } 10650 } 10651 } 10652 } 10653 } 10654 } 10655 10656 return { state: "success", data: response }; 10657 } 10658 10659 jQuery.extend( { 10660 10661 // Counter for holding the number of active queries 10662 active: 0, 10663 10664 // Last-Modified header cache for next request 10665 lastModified: {}, 10666 etag: {}, 10667 10668 ajaxSettings: { 10669 url: ajaxLocation, 10670 type: "GET", 10671 isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), 10672 global: true, 10673 processData: true, 10674 async: true, 10675 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 10676 /* 10677 timeout: 0, 10678 data: null, 10679 dataType: null, 10680 username: null, 10681 password: null, 10682 cache: null, 10683 throws: false, 10684 traditional: false, 10685 headers: {}, 10686 */ 10687 10688 accepts: { 10689 "*": allTypes, 10690 text: "text/plain", 10691 html: "text/html", 10692 xml: "application/xml, text/xml", 10693 json: "application/json, text/javascript" 10694 }, 10695 10696 contents: { 10697 xml: /\bxml\b/, 10698 html: /\bhtml/, 10699 json: /\bjson\b/ 10700 }, 10701 10702 responseFields: { 10703 xml: "responseXML", 10704 text: "responseText", 10705 json: "responseJSON" 10706 }, 10707 10708 // Data converters 10709 // Keys separate source (or catchall "*") and destination types with a single space 10710 converters: { 10711 10712 // Convert anything to text 10713 "* text": String, 10714 10715 // Text to html (true = no transformation) 10716 "text html": true, 10717 10718 // Evaluate text as a json expression 10719 "text json": jQuery.parseJSON, 10720 10721 // Parse text as xml 10722 "text xml": jQuery.parseXML 10723 }, 10724 10725 // For options that shouldn't be deep extended: 10726 // you can add your own custom options here if 10727 // and when you create one that shouldn't be 10728 // deep extended (see ajaxExtend) 10729 flatOptions: { 10730 url: true, 10731 context: true 10732 } 10733 }, 10734 10735 // Creates a full fledged settings object into target 10736 // with both ajaxSettings and settings fields. 10737 // If target is omitted, writes into ajaxSettings. 10738 ajaxSetup: function( target, settings ) { 10739 return settings ? 10740 10741 // Building a settings object 10742 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : 10743 10744 // Extending ajaxSettings 10745 ajaxExtend( jQuery.ajaxSettings, target ); 10746 }, 10747
vendor: 5,679 bytes, lines 10748-10954
10748 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), 10749 ajaxTransport: addToPrefiltersOrTransports( transports ), 10750 10751 // Main method 10752 ajax: function( url, options ) { 10753 10754 // If url is an object, simulate pre-1.5 signature 10755 if ( typeof url === "object" ) { 10756 options = url; 10757 url = undefined; 10758 } 10759 10760 // Force options to be an object 10761 options = options || {}; 10762 10763 var 10764 10765 // Cross-domain detection vars 10766 parts, 10767 10768 // Loop variable 10769 i, 10770 10771 // URL without anti-cache param 10772 cacheURL, 10773 10774 // Response headers as string 10775 responseHeadersString, 10776 10777 // timeout handle 10778 timeoutTimer, 10779 10780 // To know if global events are to be dispatched 10781 fireGlobals, 10782 10783 transport, 10784 10785 // Response headers 10786 responseHeaders, 10787 10788 // Create the final options object 10789 s = jQuery.ajaxSetup( {}, options ), 10790 10791 // Callbacks context 10792 callbackContext = s.context || s, 10793 10794 // Context for global events is callbackContext if it is a DOM node or jQuery collection 10795 globalEventContext = s.context && 10796 ( callbackContext.nodeType || callbackContext.jquery ) ? 10797 jQuery( callbackContext ) : 10798 jQuery.event, 10799 10800 // Deferreds 10801 deferred = jQuery.Deferred(), 10802 completeDeferred = jQuery.Callbacks( "once memory" ), 10803 10804 // Status-dependent callbacks 10805 statusCode = s.statusCode || {}, 10806 10807 // Headers (they are sent all at once) 10808 requestHeaders = {}, 10809 requestHeadersNames = {}, 10810 10811 // The jqXHR state 10812 state = 0, 10813 10814 // Default abort message 10815 strAbort = "canceled", 10816 10817 // Fake xhr 10818 jqXHR = { 10819 readyState: 0, 10820 10821 // Builds headers hashtable if needed 10822 getResponseHeader: function( key ) { 10823 var match; 10824 if ( state === 2 ) { 10825 if ( !responseHeaders ) { 10826 responseHeaders = {}; 10827 while ( ( match = rheaders.exec( responseHeadersString ) ) ) { 10828 responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ]; 10829 } 10830 } 10831 match = responseHeaders[ key.toLowerCase() ]; 10832 } 10833 return match == null ? null : match; 10834 }, 10835 10836 // Raw string 10837 getAllResponseHeaders: function() { 10838 return state === 2 ? responseHeadersString : null; 10839 }, 10840 10841 // Caches the header 10842 setRequestHeader: function( name, value ) { 10843 var lname = name.toLowerCase(); 10844 if ( !state ) { 10845 name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; 10846 requestHeaders[ name ] = value; 10847 } 10848 return this; 10849 }, 10850 10851 // Overrides response content-type header 10852 overrideMimeType: function( type ) { 10853 if ( !state ) { 10854 s.mimeType = type; 10855 } 10856 return this; 10857 }, 10858 10859 // Status-dependent callbacks 10860 statusCode: function( map ) { 10861 var code; 10862 if ( map ) { 10863 if ( state < 2 ) { 10864 for ( code in map ) { 10865 10866 // Lazy-add the new callback in a way that preserves old ones 10867 statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; 10868 } 10869 } else { 10870 10871 // Execute the appropriate callbacks 10872 jqXHR.always( map[ jqXHR.status ] ); 10873 } 10874 } 10875 return this; 10876 }, 10877 10878 // Cancel the request 10879 abort: function( statusText ) { 10880 var finalText = statusText || strAbort; 10881 if ( transport ) { 10882 transport.abort( finalText ); 10883 } 10884 done( 0, finalText ); 10885 return this; 10886 } 10887 }; 10888 10889 // Attach deferreds 10890 deferred.promise( jqXHR ).complete = completeDeferred.add; 10891 jqXHR.success = jqXHR.done; 10892 jqXHR.error = jqXHR.fail; 10893 10894 // Remove hash character (#7531: and string promotion) 10895 // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) 10896 // Handle falsy url in the settings object (#10093: consistency with old signature) 10897 // We also use the url parameter if available 10898 s.url = ( ( url || s.url || ajaxLocation ) + "" ) 10899 .replace( rhash, "" ) 10900 .replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); 10901 10902 // Alias method option to type as per ticket #12004 10903 s.type = options.method || options.type || s.method || s.type; 10904 10905 // Extract dataTypes list 10906 s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ]; 10907 10908 // A cross-domain request is in order when we have a protocol:host:port mismatch 10909 if ( s.crossDomain == null ) { 10910 parts = rurl.exec( s.url.toLowerCase() ); 10911 s.crossDomain = !!( parts && 10912 ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || 10913 ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !== 10914 ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) ) 10915 ); 10916 } 10917 10918 // Convert data if not already a string 10919 if ( s.data && s.processData && typeof s.data !== "string" ) { 10920 s.data = jQuery.param( s.data, s.traditional ); 10921 } 10922 10923 // Apply prefilters 10924 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 10925 10926 // If request was aborted inside a prefilter, stop there 10927 if ( state === 2 ) { 10928 return jqXHR; 10929 } 10930 10931 // We can fire global events as of now if asked to 10932 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) 10933 fireGlobals = jQuery.event && s.global; 10934 10935 // Watch for a new set of requests 10936 if ( fireGlobals && jQuery.active++ === 0 ) { 10937 jQuery.event.trigger( "ajaxStart" ); 10938 } 10939 10940 // Uppercase the type 10941 s.type = s.type.toUpperCase(); 10942 10943 // Determine if request has content 10944 s.hasContent = !rnoContent.test( s.type ); 10945 10946 // Save the URL in case we're toying with the If-Modified-Since 10947 // and/or If-None-Match header later on 10948 cacheURL = s.url; 10949 10950 // More options handling for requests with no content 10951 if ( !s.hasContent ) { 10952 10953 // If data is available, append data to url 10954 if ( s.data ) {
vendor: 8,514 bytes, lines 10955-11294
10955 cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); 10956 10957 // #9682: remove data so that it's not used in an eventual retry 10958 delete s.data; 10959 } 10960 10961 // Add anti-cache in url if needed 10962 if ( s.cache === false ) { 10963 s.url = rts.test( cacheURL ) ? 10964 10965 // If there is already a '_' parameter, set its value 10966 cacheURL.replace( rts, "$1_=" + nonce++ ) : 10967 10968 // Otherwise add one to the end 10969 cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++; 10970 } 10971 } 10972 10973 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 10974 if ( s.ifModified ) { 10975 if ( jQuery.lastModified[ cacheURL ] ) { 10976 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); 10977 } 10978 if ( jQuery.etag[ cacheURL ] ) { 10979 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); 10980 } 10981 } 10982 10983 // Set the correct header, if data is being sent 10984 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { 10985 jqXHR.setRequestHeader( "Content-Type", s.contentType ); 10986 } 10987 10988 // Set the Accepts header for the server, depending on the dataType 10989 jqXHR.setRequestHeader( 10990 "Accept", 10991 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? 10992 s.accepts[ s.dataTypes[ 0 ] ] + 10993 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 10994 s.accepts[ "*" ] 10995 ); 10996 10997 // Check for headers option 10998 for ( i in s.headers ) { 10999 jqXHR.setRequestHeader( i, s.headers[ i ] ); 11000 } 11001 11002 // Allow custom headers/mimetypes and early abort 11003 if ( s.beforeSend && 11004 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { 11005 11006 // Abort if not done already and return 11007 return jqXHR.abort(); 11008 } 11009 11010 // aborting is no longer a cancellation 11011 strAbort = "abort"; 11012 11013 // Install callbacks on deferreds 11014 for ( i in { success: 1, error: 1, complete: 1 } ) { 11015 jqXHR[ i ]( s[ i ] ); 11016 } 11017 11018 // Get transport 11019 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); 11020 11021 // If no transport, we auto-abort 11022 if ( !transport ) { 11023 done( -1, "No Transport" ); 11024 } else { 11025 jqXHR.readyState = 1; 11026 11027 // Send global event 11028 if ( fireGlobals ) { 11029 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); 11030 } 11031 11032 // If request was aborted inside ajaxSend, stop there 11033 if ( state === 2 ) { 11034 return jqXHR; 11035 } 11036 11037 // Timeout 11038 if ( s.async && s.timeout > 0 ) { 11039 timeoutTimer = window.setTimeout( function() { 11040 jqXHR.abort( "timeout" ); 11041 }, s.timeout ); 11042 } 11043 11044 try { 11045 state = 1; 11046 transport.send( requestHeaders, done ); 11047 } catch ( e ) { 11048 11049 // Propagate exception as error if not done 11050 if ( state < 2 ) { 11051 done( -1, e ); 11052 11053 // Simply rethrow otherwise 11054 } else { 11055 throw e; 11056 } 11057 } 11058 } 11059 11060 // Callback for when everything is done 11061 function done( status, nativeStatusText, responses, headers ) { 11062 var isSuccess, success, error, response, modified, 11063 statusText = nativeStatusText; 11064 11065 // Called once 11066 if ( state === 2 ) { 11067 return; 11068 } 11069 11070 // State is "done" now 11071 state = 2; 11072 11073 // Clear timeout if it exists 11074 if ( timeoutTimer ) { 11075 window.clearTimeout( timeoutTimer ); 11076 } 11077 11078 // Dereference transport for early garbage collection 11079 // (no matter how long the jqXHR object will be used) 11080 transport = undefined; 11081 11082 // Cache response headers 11083 responseHeadersString = headers || ""; 11084 11085 // Set readyState 11086 jqXHR.readyState = status > 0 ? 4 : 0; 11087 11088 // Determine if successful 11089 isSuccess = status >= 200 && status < 300 || status === 304; 11090 11091 // Get response data 11092 if ( responses ) { 11093 response = ajaxHandleResponses( s, jqXHR, responses ); 11094 } 11095 11096 // Convert no matter what (that way responseXXX fields are always set) 11097 response = ajaxConvert( s, response, jqXHR, isSuccess ); 11098 11099 // If successful, handle type chaining 11100 if ( isSuccess ) { 11101 11102 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 11103 if ( s.ifModified ) { 11104 modified = jqXHR.getResponseHeader( "Last-Modified" ); 11105 if ( modified ) { 11106 jQuery.lastModified[ cacheURL ] = modified; 11107 } 11108 modified = jqXHR.getResponseHeader( "etag" ); 11109 if ( modified ) { 11110 jQuery.etag[ cacheURL ] = modified; 11111 } 11112 } 11113 11114 // if no content 11115 if ( status === 204 || s.type === "HEAD" ) { 11116 statusText = "nocontent"; 11117 11118 // if not modified 11119 } else if ( status === 304 ) { 11120 statusText = "notmodified"; 11121 11122 // If we have data, let's convert it 11123 } else { 11124 statusText = response.state; 11125 success = response.data; 11126 error = response.error; 11127 isSuccess = !error; 11128 } 11129 } else { 11130 11131 // We extract error from statusText 11132 // then normalize statusText and status for non-aborts 11133 error = statusText; 11134 if ( status || !statusText ) { 11135 statusText = "error"; 11136 if ( status < 0 ) { 11137 status = 0; 11138 } 11139 } 11140 } 11141 11142 // Set data for the fake xhr object 11143 jqXHR.status = status; 11144 jqXHR.statusText = ( nativeStatusText || statusText ) + ""; 11145 11146 // Success/Error 11147 if ( isSuccess ) { 11148 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); 11149 } else { 11150 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); 11151 } 11152 11153 // Status-dependent callbacks 11154 jqXHR.statusCode( statusCode ); 11155 statusCode = undefined; 11156 11157 if ( fireGlobals ) { 11158 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", 11159 [ jqXHR, s, isSuccess ? success : error ] ); 11160 } 11161 11162 // Complete 11163 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); 11164 11165 if ( fireGlobals ) { 11166 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 11167 11168 // Handle the global AJAX counter 11169 if ( !( --jQuery.active ) ) { 11170 jQuery.event.trigger( "ajaxStop" ); 11171 } 11172 } 11173 } 11174 11175 return jqXHR; 11176 }, 11177 11178 getJSON: function( url, data, callback ) { 11179 return jQuery.get( url, data, callback, "json" ); 11180 }, 11181 11182 getScript: function( url, callback ) { 11183 return jQuery.get( url, undefined, callback, "script" ); 11184 } 11185 } ); 11186 11187 jQuery.each( [ "get", "post" ], function( i, method ) { 11188 jQuery[ method ] = function( url, data, callback, type ) { 11189 11190 // shift arguments if data argument was omitted 11191 if ( jQuery.isFunction( data ) ) { 11192 type = type || callback; 11193 callback = data; 11194 data = undefined; 11195 } 11196 11197 // The url can be an options object (which then must have .url) 11198 return jQuery.ajax( jQuery.extend( { 11199 url: url, 11200 type: method, 11201 dataType: type, 11202 data: data, 11203 success: callback 11204 }, jQuery.isPlainObject( url ) && url ) ); 11205 }; 11206 } ); 11207 11208 11209 jQuery._evalUrl = function( url ) { 11210 return jQuery.ajax( { 11211 url: url, 11212 11213 // Make this explicit, since user can override this through ajaxSetup (#11264) 11214 type: "GET", 11215 dataType: "script", 11216 cache: true, 11217 async: false, 11218 global: false, 11219 "throws": true 11220 } ); 11221 }; 11222 11223 11224 jQuery.fn.extend( { 11225 wrapAll: function( html ) { 11226 if ( jQuery.isFunction( html ) ) { 11227 return this.each( function( i ) { 11228 jQuery( this ).wrapAll( html.call( this, i ) ); 11229 } ); 11230 } 11231 11232 if ( this[ 0 ] ) { 11233 11234 // The elements to wrap the target around 11235 var wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); 11236 11237 if ( this[ 0 ].parentNode ) { 11238 wrap.insertBefore( this[ 0 ] ); 11239 } 11240 11241 wrap.map( function() { 11242 var elem = this; 11243 11244 while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { 11245 elem = elem.firstChild; 11246 } 11247 11248 return elem; 11249 } ).append( this ); 11250 } 11251 11252 return this; 11253 }, 11254 11255 wrapInner: function( html ) { 11256 if ( jQuery.isFunction( html ) ) { 11257 return this.each( function( i ) { 11258 jQuery( this ).wrapInner( html.call( this, i ) ); 11259 } ); 11260 } 11261 11262 return this.each( function() { 11263 var self = jQuery( this ), 11264 contents = self.contents(); 11265 11266 if ( contents.length ) { 11267 contents.wrapAll( html ); 11268 11269 } else { 11270 self.append( html ); 11271 } 11272 } ); 11273 }, 11274 11275 wrap: function( html ) { 11276 var isFunction = jQuery.isFunction( html ); 11277 11278 return this.each( function( i ) { 11279 jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html ); 11280 } ); 11281 }, 11282 11283 unwrap: function() { 11284 return this.parent().each( function() { 11285 if ( !jQuery.nodeName( this, "body" ) ) { 11286 jQuery( this ).replaceWith( this.childNodes ); 11287 } 11288 } ).end(); 11289 } 11290 } ); 11291 11292 11293 function getDisplay( elem ) { 11294 return elem.style && elem.style.display || jQuery.css( elem, "dis
vendor: 33,908 bytes, lines 11294-12518
11294play" ); 11295 } 11296 11297 function filterHidden( elem ) { 11298 11299 // Disconnected elements are considered hidden 11300 if ( !jQuery.contains( elem.ownerDocument || document, elem ) ) { 11301 return true; 11302 } 11303 while ( elem && elem.nodeType === 1 ) { 11304 if ( getDisplay( elem ) === "none" || elem.type === "hidden" ) { 11305 return true; 11306 } 11307 elem = elem.parentNode; 11308 } 11309 return false; 11310 } 11311 11312 jQuery.expr.filters.hidden = function( elem ) { 11313 11314 // Support: Opera <= 12.12 11315 // Opera reports offsetWidths and offsetHeights less than zero on some elements 11316 return support.reliableHiddenOffsets() ? 11317 ( elem.offsetWidth <= 0 && elem.offsetHeight <= 0 && 11318 !elem.getClientRects().length ) : 11319 filterHidden( elem ); 11320 }; 11321 11322 jQuery.expr.filters.visible = function( elem ) { 11323 return !jQuery.expr.filters.hidden( elem ); 11324 }; 11325 11326 11327 11328 11329 var r20 = /%20/g, 11330 rbracket = /\[\]$/, 11331 rCRLF = /\r?\n/g, 11332 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 11333 rsubmittable = /^(?:input|select|textarea|keygen)/i; 11334 11335 function buildParams( prefix, obj, traditional, add ) { 11336 var name; 11337 11338 if ( jQuery.isArray( obj ) ) { 11339 11340 // Serialize array item. 11341 jQuery.each( obj, function( i, v ) { 11342 if ( traditional || rbracket.test( prefix ) ) { 11343 11344 // Treat each array item as a scalar. 11345 add( prefix, v ); 11346 11347 } else { 11348 11349 // Item is non-scalar (array or object), encode its numeric index. 11350 buildParams( 11351 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", 11352 v, 11353 traditional, 11354 add 11355 ); 11356 } 11357 } ); 11358 11359 } else if ( !traditional && jQuery.type( obj ) === "object" ) { 11360 11361 // Serialize object item. 11362 for ( name in obj ) { 11363 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 11364 } 11365 11366 } else { 11367 11368 // Serialize scalar item. 11369 add( prefix, obj ); 11370 } 11371 } 11372 11373 // Serialize an array of form elements or a set of 11374 // key/values into a query string 11375 jQuery.param = function( a, traditional ) { 11376 var prefix, 11377 s = [], 11378 add = function( key, value ) { 11379 11380 // If value is a function, invoke it and return its value 11381 value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); 11382 s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); 11383 }; 11384 11385 // Set traditional to true for jQuery <= 1.3.2 behavior. 11386 if ( traditional === undefined ) { 11387 traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; 11388 } 11389 11390 // If an array was passed in, assume that it is an array of form elements. 11391 if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 11392 11393 // Serialize the form elements 11394 jQuery.each( a, function() { 11395 add( this.name, this.value ); 11396 } ); 11397 11398 } else { 11399 11400 // If traditional, encode the "old" way (the way 1.3.2 or older 11401 // did it), otherwise encode params recursively. 11402 for ( prefix in a ) { 11403 buildParams( prefix, a[ prefix ], traditional, add ); 11404 } 11405 } 11406 11407 // Return the resulting serialization 11408 return s.join( "&" ).replace( r20, "+" ); 11409 }; 11410 11411 jQuery.fn.extend( { 11412 serialize: function() { 11413 return jQuery.param( this.serializeArray() ); 11414 }, 11415 serializeArray: function() { 11416 return this.map( function() { 11417 11418 // Can add propHook for "elements" to filter or add form elements 11419 var elements = jQuery.prop( this, "elements" ); 11420 return elements ? jQuery.makeArray( elements ) : this; 11421 } ) 11422 .filter( function() { 11423 var type = this.type; 11424 11425 // Use .is(":disabled") so that fieldset[disabled] works 11426 return this.name && !jQuery( this ).is( ":disabled" ) && 11427 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 11428 ( this.checked || !rcheckableType.test( type ) ); 11429 } ) 11430 .map( function( i, elem ) { 11431 var val = jQuery( this ).val(); 11432 11433 return val == null ? 11434 null : 11435 jQuery.isArray( val ) ? 11436 jQuery.map( val, function( val ) { 11437 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 11438 } ) : 11439 { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 11440 } ).get(); 11441 } 11442 } ); 11443 11444 11445 // Create the request object 11446 // (This is still attached to ajaxSettings for backward compatibility) 11447 jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ? 11448 11449 // Support: IE6-IE8 11450 function() { 11451 11452 // XHR cannot access local files, always use ActiveX for that case 11453 if ( this.isLocal ) { 11454 return createActiveXHR(); 11455 } 11456 11457 // Support: IE 9-11 11458 // IE seems to error on cross-domain PATCH requests when ActiveX XHR 11459 // is used. In IE 9+ always use the native XHR. 11460 // Note: this condition won't catch Edge as it doesn't define 11461 // document.documentMode but it also doesn't support ActiveX so it won't 11462 // reach this code. 11463 if ( document.documentMode > 8 ) { 11464 return createStandardXHR(); 11465 } 11466 11467 // Support: IE<9 11468 // oldIE XHR does not support non-RFC2616 methods (#13240) 11469 // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx 11470 // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9 11471 // Although this check for six methods instead of eight 11472 // since IE also does not support "trace" and "connect" 11473 return /^(get|post|head|put|delete|options)$/i.test( this.type ) && 11474 createStandardXHR() || createActiveXHR(); 11475 } : 11476 11477 // For all other browsers, use the standard XMLHttpRequest object 11478 createStandardXHR; 11479 11480 var xhrId = 0, 11481 xhrCallbacks = {}, 11482 xhrSupported = jQuery.ajaxSettings.xhr(); 11483 11484 // Support: IE<10 11485 // Open requests must be manually aborted on unload (#5280) 11486 // See https://support.microsoft.com/kb/2856746 for more info 11487 if ( window.attachEvent ) { 11488 window.attachEvent( "onunload", function() { 11489 for ( var key in xhrCallbacks ) { 11490 xhrCallbacks[ key ]( undefined, true ); 11491 } 11492 } ); 11493 } 11494 11495 // Determine support properties 11496 support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 11497 xhrSupported = support.ajax = !!xhrSupported; 11498 11499 // Create transport if the browser can provide an xhr 11500 if ( xhrSupported ) { 11501 11502 jQuery.ajaxTransport( function( options ) { 11503 11504 // Cross domain only allowed if supported through XMLHttpRequest 11505 if ( !options.crossDomain || support.cors ) { 11506 11507 var callback; 11508 11509 return { 11510 send: function( headers, complete ) { 11511 var i, 11512 xhr = options.xhr(), 11513 id = ++xhrId; 11514 11515 // Open the socket 11516 xhr.open( 11517 options.type, 11518 options.url, 11519 options.async, 11520 options.username, 11521 options.password 11522 ); 11523 11524 // Apply custom fields if provided 11525 if ( options.xhrFields ) { 11526 for ( i in options.xhrFields ) { 11527 xhr[ i ] = options.xhrFields[ i ]; 11528 } 11529 } 11530 11531 // Override mime type if needed 11532 if ( options.mimeType && xhr.overrideMimeType ) { 11533 xhr.overrideMimeType( options.mimeType ); 11534 } 11535 11536 // X-Requested-With header 11537 // For cross-domain requests, seeing as conditions for a preflight are 11538 // akin to a jigsaw puzzle, we simply never set it to be sure. 11539 // (it can always be set on a per-request basis or even using ajaxSetup) 11540 // For same-domain requests, won't change header if already provided. 11541 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { 11542 headers[ "X-Requested-With" ] = "XMLHttpRequest"; 11543 } 11544 11545 // Set headers 11546 for ( i in headers ) { 11547 11548 // Support: IE<9 11549 // IE's ActiveXObject throws a 'Type Mismatch' exception when setting 11550 // request header to a null-value. 11551 // 11552 // To keep consistent with other XHR implementations, cast the value 11553 // to string and ignore `undefined`. 11554 if ( headers[ i ] !== undefined ) { 11555 xhr.setRequestHeader( i, headers[ i ] + "" ); 11556 } 11557 } 11558 11559 // Do send the request 11560 // This may raise an exception which is actually 11561 // handled in jQuery.ajax (so no try/catch here) 11562 xhr.send( ( options.hasContent && options.data ) || null ); 11563 11564 // Listener 11565 callback = function( _, isAbort ) { 11566 var status, statusText, responses; 11567 11568 // Was never called and is aborted or complete 11569 if ( callback && ( isAbort || xhr.readyState === 4 ) ) { 11570 11571 // Clean up 11572 delete xhrCallbacks[ id ]; 11573 callback = undefined; 11574 xhr.onreadystatechange = jQuery.noop; 11575 11576 // Abort manually if needed 11577 if ( isAbort ) { 11578 if ( xhr.readyState !== 4 ) { 11579 xhr.abort(); 11580 } 11581 } else { 11582 responses = {}; 11583 status = xhr.status; 11584 11585 // Support: IE<10 11586 // Accessing binary-data responseText throws an exception 11587 // (#11426) 11588 if ( typeof xhr.responseText === "string" ) { 11589 responses.text = xhr.responseText; 11590 } 11591 11592 // Firefox throws an exception when accessing 11593 // statusText for faulty cross-domain requests 11594 try { 11595 statusText = xhr.statusText; 11596 } catch ( e ) { 11597 11598 // We normalize with Webkit giving an empty statusText 11599 statusText = ""; 11600 } 11601 11602 // Filter status for non standard behaviors 11603 11604 // If the request is local and we have data: assume a success 11605 // (success with no data won't get notified, that's the best we 11606 // can do given current implementations) 11607 if ( !status && options.isLocal && !options.crossDomain ) { 11608 status = responses.text ? 200 : 404; 11609 11610 // IE - #1450: sometimes returns 1223 when it should be 204 11611 } else if ( status === 1223 ) { 11612 status = 204; 11613 } 11614 } 11615 } 11616 11617 // Call complete if needed 11618 if ( responses ) { 11619 complete( status, statusText, responses, xhr.getAllResponseHeaders() ); 11620 } 11621 }; 11622 11623 // Do send the request 11624 // `xhr.send` may raise an exception, but it will be 11625 // handled in jQuery.ajax (so no try/catch here) 11626 if ( !options.async ) { 11627 11628 // If we're in sync mode we fire the callback 11629 callback(); 11630 } else if ( xhr.readyState === 4 ) { 11631 11632 // (IE6 & IE7) if it's in cache and has been 11633 // retrieved directly we need to fire the callback 11634 window.setTimeout( callback ); 11635 } else { 11636 11637 // Register the callback, but delay it in case `xhr.send` throws 11638 // Add to the list of active xhr callbacks 11639 xhr.onreadystatechange = xhrCallbacks[ id ] = callback; 11640 } 11641 }, 11642 11643 abort: function() { 11644 if ( callback ) { 11645 callback( undefined, true ); 11646 } 11647 } 11648 }; 11649 } 11650 } ); 11651 } 11652 11653 // Functions to create xhrs 11654 function createStandardXHR() { 11655 try { 11656 return new window.XMLHttpRequest(); 11657 } catch ( e ) {} 11658 } 11659 11660 function createActiveXHR() { 11661 try { 11662 return new window.ActiveXObject( "Microsoft.XMLHTTP" ); 11663 } catch ( e ) {} 11664 } 11665 11666 11667 11668 11669 // Install script dataType 11670 jQuery.ajaxSetup( { 11671 accepts: { 11672 script: "text/javascript, application/javascript, " + 11673 "application/ecmascript, application/x-ecmascript" 11674 }, 11675 contents: { 11676 script: /\b(?:java|ecma)script\b/ 11677 }, 11678 converters: { 11679 "text script": function( text ) { 11680 jQuery.globalEval( text ); 11681 return text; 11682 } 11683 } 11684 } ); 11685 11686 // Handle cache's special case and global 11687 jQuery.ajaxPrefilter( "script", function( s ) { 11688 if ( s.cache === undefined ) { 11689 s.cache = false; 11690 } 11691 if ( s.crossDomain ) { 11692 s.type = "GET"; 11693 s.global = false; 11694 } 11695 } ); 11696 11697 // Bind script tag hack transport 11698 jQuery.ajaxTransport( "script", function( s ) { 11699 11700 // This transport only deals with cross domain requests 11701 if ( s.crossDomain ) { 11702 11703 var script, 11704 head = document.head || jQuery( "head" )[ 0 ] || document.documentElement; 11705 11706 return { 11707 11708 send: function( _, callback ) { 11709 11710 script = document.createElement( "script" ); 11711 11712 script.async = true; 11713 11714 if ( s.scriptCharset ) { 11715 script.charset = s.scriptCharset; 11716 } 11717 11718 script.src = s.url; 11719 11720 // Attach handlers for all browsers 11721 script.onload = script.onreadystatechange = function( _, isAbort ) { 11722 11723 if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { 11724 11725 // Handle memory leak in IE 11726 script.onload = script.onreadystatechange = null; 11727 11728 // Remove the script 11729 if ( script.parentNode ) { 11730 script.parentNode.removeChild( script ); 11731 } 11732 11733 // Dereference the script 11734 script = null; 11735 11736 // Callback if not abort 11737 if ( !isAbort ) { 11738 callback( 200, "success" ); 11739 } 11740 } 11741 }; 11742 11743 // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending 11744 // Use native DOM manipulation to avoid our domManip AJAX trickery 11745 head.insertBefore( script, head.firstChild ); 11746 }, 11747 11748 abort: function() { 11749 if ( script ) { 11750 script.onload( undefined, true ); 11751 } 11752 } 11753 }; 11754 } 11755 } ); 11756 11757 11758 11759 11760 var oldCallbacks = [], 11761 rjsonp = /(=)\?(?=&|$)|\?\?/; 11762 11763 // Default jsonp settings 11764 jQuery.ajaxSetup( { 11765 jsonp: "callback", 11766 jsonpCallback: function() { 11767 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); 11768 this[ callback ] = true; 11769 return callback; 11770 } 11771 } ); 11772 11773 // Detect, normalize options and install callbacks for jsonp requests 11774 jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 11775 11776 var callbackName, overwritten, responseContainer, 11777 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 11778 "url" : 11779 typeof s.data === "string" && 11780 ( s.contentType || "" ) 11781 .indexOf( "application/x-www-form-urlencoded" ) === 0 && 11782 rjsonp.test( s.data ) && "data" 11783 ); 11784 11785 // Handle iff the expected data type is "jsonp" or we have a parameter to set 11786 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 11787 11788 // Get callback name, remembering preexisting value associated with it 11789 callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? 11790 s.jsonpCallback() : 11791 s.jsonpCallback; 11792 11793 // Insert callback into url or form data 11794 if ( jsonProp ) { 11795 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 11796 } else if ( s.jsonp !== false ) { 11797 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 11798 } 11799 11800 // Use data converter to retrieve json after script execution 11801 s.converters[ "script json" ] = function() { 11802 if ( !responseContainer ) { 11803 jQuery.error( callbackName + " was not called" ); 11804 } 11805 return responseContainer[ 0 ]; 11806 }; 11807 11808 // force json dataType 11809 s.dataTypes[ 0 ] = "json"; 11810 11811 // Install callback 11812 overwritten = window[ callbackName ]; 11813 window[ callbackName ] = function() { 11814 responseContainer = arguments; 11815 }; 11816 11817 // Clean-up function (fires after converters) 11818 jqXHR.always( function() { 11819 11820 // If previous value didn't exist - remove it 11821 if ( overwritten === undefined ) { 11822 jQuery( window ).removeProp( callbackName ); 11823 11824 // Otherwise restore preexisting value 11825 } else { 11826 window[ callbackName ] = overwritten; 11827 } 11828 11829 // Save back as free 11830 if ( s[ callbackName ] ) { 11831 11832 // make sure that re-using the options doesn't screw things around 11833 s.jsonpCallback = originalSettings.jsonpCallback; 11834 11835 // save the callback name for future use 11836 oldCallbacks.push( callbackName ); 11837 } 11838 11839 // Call if it was a function and we have a response 11840 if ( responseContainer && jQuery.isFunction( overwritten ) ) { 11841 overwritten( responseContainer[ 0 ] ); 11842 } 11843 11844 responseContainer = overwritten = undefined; 11845 } ); 11846 11847 // Delegate to script 11848 return "script"; 11849 } 11850 } ); 11851 11852 11853 11854 11855 // data: string of html 11856 // context (optional): If specified, the fragment will be created in this context, 11857 // defaults to document 11858 // keepScripts (optional): If true, will include scripts passed in the html string 11859 jQuery.parseHTML = function( data, context, keepScripts ) { 11860 if ( !data || typeof data !== "string" ) { 11861 return null; 11862 } 11863 if ( typeof context === "boolean" ) { 11864 keepScripts = context; 11865 context = false; 11866 } 11867 context = context || document; 11868 11869 var parsed = rsingleTag.exec( data ), 11870 scripts = !keepScripts && []; 11871 11872 // Single tag 11873 if ( parsed ) { 11874 return [ context.createElement( parsed[ 1 ] ) ]; 11875 } 11876 11877 parsed = buildFragment( [ data ], context, scripts ); 11878 11879 if ( scripts && scripts.length ) { 11880 jQuery( scripts ).remove(); 11881 } 11882 11883 return jQuery.merge( [], parsed.childNodes ); 11884 }; 11885 11886 11887 // Keep a copy of the old load method 11888 var _load = jQuery.fn.load; 11889 11890 /** 11891 * Load a url into a page 11892 */ 11893 jQuery.fn.load = function( url, params, callback ) { 11894 if ( typeof url !== "string" && _load ) { 11895 return _load.apply( this, arguments ); 11896 } 11897 11898 var selector, type, response, 11899 self = this, 11900 off = url.indexOf( " " ); 11901 11902 if ( off > -1 ) { 11903 selector = jQuery.trim( url.slice( off, url.length ) ); 11904 url = url.slice( 0, off ); 11905 } 11906 11907 // If it's a function 11908 if ( jQuery.isFunction( params ) ) { 11909 11910 // We assume that it's the callback 11911 callback = params; 11912 params = undefined; 11913 11914 // Otherwise, build a param string 11915 } else if ( params && typeof params === "object" ) { 11916 type = "POST"; 11917 } 11918 11919 // If we have elements to modify, make the request 11920 if ( self.length > 0 ) { 11921 jQuery.ajax( { 11922 url: url, 11923 11924 // If "type" variable is undefined, then "GET" method will be used. 11925 // Make value of this field explicit since 11926 // user can override it through ajaxSetup method 11927 type: type || "GET", 11928 dataType: "html", 11929 data: params 11930 } ).done( function( responseText ) { 11931 11932 // Save response for use in complete callback 11933 response = arguments; 11934 11935 self.html( selector ? 11936 11937 // If a selector was specified, locate the right elements in a dummy div 11938 // Exclude scripts to avoid IE 'Permission Denied' errors 11939 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : 11940 11941 // Otherwise use the full result 11942 responseText ); 11943 11944 // If the request succeeds, this function gets "data", "status", "jqXHR" 11945 // but they are ignored because response was set above. 11946 // If it fails, this function gets "jqXHR", "status", "error" 11947 } ).always( callback && function( jqXHR, status ) { 11948 self.each( function() { 11949 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); 11950 } ); 11951 } ); 11952 } 11953 11954 return this; 11955 }; 11956 11957 11958 11959 11960 // Attach a bunch of functions for handling common AJAX events 11961 jQuery.each( [ 11962 "ajaxStart", 11963 "ajaxStop", 11964 "ajaxComplete", 11965 "ajaxError", 11966 "ajaxSuccess", 11967 "ajaxSend" 11968 ], function( i, type ) { 11969 jQuery.fn[ type ] = function( fn ) { 11970 return this.on( type, fn ); 11971 }; 11972 } ); 11973 11974 11975 11976 11977 jQuery.expr.filters.animated = function( elem ) { 11978 return jQuery.grep( jQuery.timers, function( fn ) { 11979 return elem === fn.elem; 11980 } ).length; 11981 }; 11982 11983 11984 11985 11986 11987 /** 11988 * Gets a window from an element 11989 */ 11990 function getWindow( elem ) { 11991 return jQuery.isWindow( elem ) ? 11992 elem : 11993 elem.nodeType === 9 ? 11994 elem.defaultView || elem.parentWindow : 11995 false; 11996 } 11997 11998 jQuery.offset = { 11999 setOffset: function( elem, options, i ) { 12000 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, 12001 position = jQuery.css( elem, "position" ), 12002 curElem = jQuery( elem ), 12003 props = {}; 12004 12005 // set position first, in-case top/left are set even on static elem 12006 if ( position === "static" ) { 12007 elem.style.position = "relative"; 12008 } 12009 12010 curOffset = curElem.offset(); 12011 curCSSTop = jQuery.css( elem, "top" ); 12012 curCSSLeft = jQuery.css( elem, "left" ); 12013 calculatePosition = ( position === "absolute" || position === "fixed" ) && 12014 jQuery.inArray( "auto", [ curCSSTop, curCSSLeft ] ) > -1; 12015 12016 // need to be able to calculate position if either top or left 12017 // is auto and position is either absolute or fixed 12018 if ( calculatePosition ) { 12019 curPosition = curElem.position(); 12020 curTop = curPosition.top; 12021 curLeft = curPosition.left; 12022 } else { 12023 curTop = parseFloat( curCSSTop ) || 0; 12024 curLeft = parseFloat( curCSSLeft ) || 0; 12025 } 12026 12027 if ( jQuery.isFunction( options ) ) { 12028 12029 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) 12030 options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); 12031 } 12032 12033 if ( options.top != null ) { 12034 props.top = ( options.top - curOffset.top ) + curTop; 12035 } 12036 if ( options.left != null ) { 12037 props.left = ( options.left - curOffset.left ) + curLeft; 12038 } 12039 12040 if ( "using" in options ) { 12041 options.using.call( elem, props ); 12042 } else { 12043 curElem.css( props ); 12044 } 12045 } 12046 }; 12047 12048 jQuery.fn.extend( { 12049 offset: function( options ) { 12050 if ( arguments.length ) { 12051 return options === undefined ? 12052 this : 12053 this.each( function( i ) { 12054 jQuery.offset.setOffset( this, options, i ); 12055 } ); 12056 } 12057 12058 var docElem, win, 12059 box = { top: 0, left: 0 }, 12060 elem = this[ 0 ], 12061 doc = elem && elem.ownerDocument; 12062 12063 if ( !doc ) { 12064 return; 12065 } 12066 12067 docElem = doc.documentElement; 12068 12069 // Make sure it's not a disconnected DOM node 12070 if ( !jQuery.contains( docElem, elem ) ) { 12071 return box; 12072 } 12073 12074 // If we don't have gBCR, just use 0,0 rather than error 12075 // BlackBerry 5, iOS 3 (original iPhone) 12076 if ( typeof elem.getBoundingClientRect !== "undefined" ) { 12077 box = elem.getBoundingClientRect(); 12078 } 12079 win = getWindow( doc ); 12080 return { 12081 top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), 12082 left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) 12083 }; 12084 }, 12085 12086 position: function() { 12087 if ( !this[ 0 ] ) { 12088 return; 12089 } 12090 12091 var offsetParent, offset, 12092 parentOffset = { top: 0, left: 0 }, 12093 elem = this[ 0 ]; 12094 12095 // Fixed elements are offset from window (parentOffset = {top:0, left: 0}, 12096 // because it is its only offset parent 12097 if ( jQuery.css( elem, "position" ) === "fixed" ) { 12098 12099 // we assume that getBoundingClientRect is available when computed position is fixed 12100 offset = elem.getBoundingClientRect(); 12101 } else { 12102 12103 // Get *real* offsetParent 12104 offsetParent = this.offsetParent(); 12105 12106 // Get correct offsets 12107 offset = this.offset(); 12108 if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { 12109 parentOffset = offsetParent.offset(); 12110 } 12111 12112 // Add offsetParent borders 12113 parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); 12114 parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); 12115 } 12116 12117 // Subtract parent offsets and element margins 12118 // note: when an element has margin: auto the offsetLeft and marginLeft 12119 // are the same in Safari causing offset.left to incorrectly be 0 12120 return { 12121 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), 12122 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) 12123 }; 12124 }, 12125 12126 offsetParent: function() { 12127 return this.map( function() { 12128 var offsetParent = this.offsetParent; 12129 12130 while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && 12131 jQuery.css( offsetParent, "position" ) === "static" ) ) { 12132 offsetParent = offsetParent.offsetParent; 12133 } 12134 return offsetParent || documentElement; 12135 } ); 12136 } 12137 } ); 12138 12139 // Create scrollLeft and scrollTop methods 12140 jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { 12141 var top = /Y/.test( prop ); 12142 12143 jQuery.fn[ method ] = function( val ) { 12144 return access( this, function( elem, method, val ) { 12145 var win = getWindow( elem ); 12146 12147 if ( val === undefined ) { 12148 return win ? ( prop in win ) ? win[ prop ] : 12149 win.document.documentElement[ method ] : 12150 elem[ method ]; 12151 } 12152 12153 if ( win ) { 12154 win.scrollTo( 12155 !top ? val : jQuery( win ).scrollLeft(), 12156 top ? val : jQuery( win ).scrollTop() 12157 ); 12158 12159 } else { 12160 elem[ method ] = val; 12161 } 12162 }, method, val, arguments.length, null ); 12163 }; 12164 } ); 12165 12166 // Support: Safari<7-8+, Chrome<37-44+ 12167 // Add the top/left cssHooks using jQuery.fn.position 12168 // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 12169 // getComputedStyle returns percent when specified for top/left/bottom/right 12170 // rather than make the css module depend on the offset module, we just check for it here 12171 jQuery.each( [ "top", "left" ], function( i, prop ) { 12172 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, 12173 function( elem, computed ) { 12174 if ( computed ) { 12175 computed = curCSS( elem, prop ); 12176 12177 // if curCSS returns percentage, fallback to offset 12178 return rnumnonpx.test( computed ) ? 12179 jQuery( elem ).position()[ prop ] + "px" : 12180 computed; 12181 } 12182 } 12183 ); 12184 } ); 12185 12186 12187 // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 12188 jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { 12189 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, 12190 function( defaultExtra, funcName ) { 12191 12192 // margin is only for outerHeight, outerWidth 12193 jQuery.fn[ funcName ] = function( margin, value ) { 12194 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 12195 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 12196 12197 return access( this, function( elem, type, value ) { 12198 var doc; 12199 12200 if ( jQuery.isWindow( elem ) ) { 12201 12202 // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there 12203 // isn't a whole lot we can do. See pull request at this URL for discussion: 12204 // https://github.com/jquery/jquery/pull/764 12205 return elem.document.documentElement[ "client" + name ]; 12206 } 12207 12208 // Get document width or height 12209 if ( elem.nodeType === 9 ) { 12210 doc = elem.documentElement; 12211 12212 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 12213 // whichever is greatest 12214 // unfortunately, this causes bug #3838 in IE6/8 only, 12215 // but there is currently no good, small way to fix it. 12216 return Math.max( 12217 elem.body[ "scroll" + name ], doc[ "scroll" + name ], 12218 elem.body[ "offset" + name ], doc[ "offset" + name ], 12219 doc[ "client" + name ] 12220 ); 12221 } 12222 12223 return value === undefined ? 12224 12225 // Get width or height on the element, requesting but not forcing parseFloat 12226 jQuery.css( elem, type, extra ) : 12227 12228 // Set width or height on the element 12229 jQuery.style( elem, type, value, extra ); 12230 }, type, chainable ? margin : undefined, chainable, null ); 12231 }; 12232 } ); 12233 } ); 12234 12235 12236 jQuery.fn.extend( { 12237 12238 bind: function( types, data, fn ) { 12239 return this.on( types, null, data, fn ); 12240 }, 12241 unbind: function( types, fn ) { 12242 return this.off( types, null, fn ); 12243 }, 12244 12245 delegate: function( selector, types, data, fn ) { 12246 return this.on( types, selector, data, fn ); 12247 }, 12248 undelegate: function( selector, types, fn ) { 12249 12250 // ( namespace ) or ( selector, types [, fn] ) 12251 return arguments.length === 1 ? 12252 this.off( selector, "**" ) : 12253 this.off( types, selector || "**", fn ); 12254 } 12255 } ); 12256 12257 // The number of elements contained in the matched element set 12258 jQuery.fn.size = function() { 12259 return this.length; 12260 }; 12261 12262 jQuery.fn.andSelf = jQuery.fn.addBack; 12263 12264 12265 12266 12267 // Register as a named AMD module, since jQuery can be concatenated with other 12268 // files that may use define, but not via a proper concatenation script that 12269 // understands anonymous AMD modules. A named AMD is safest and most robust 12270 // way to register. Lowercase jquery is used because AMD module names are 12271 // derived from file names, and jQuery is normally delivered in a lowercase 12272 // file name. Do this after creating the global so that if an AMD module wants 12273 // to call noConflict to hide this version of jQuery, it will work. 12274 12275 // Note that for maximum portability, libraries that are not jQuery should 12276 // declare themselves as anonymous modules, and avoid setting a global if an 12277 // AMD loader is present. jQuery is a special case. For more information, see 12278 // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 12279 12280 if ( true ) { 12281 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() { 12282 return jQuery; 12283 }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 12284 } 12285 12286 12287 12288 var 12289 12290 // Map over jQuery in case of overwrite 12291 _jQuery = window.jQuery, 12292 12293 // Map over the $ in case of overwrite 12294 _$ = window.$; 12295 12296 jQuery.noConflict = function( deep ) { 12297 if ( window.$ === jQuery ) { 12298 window.$ = _$; 12299 } 12300 12301 if ( deep && window.jQuery === jQuery ) { 12302 window.jQuery = _jQuery; 12303 } 12304 12305 return jQuery; 12306 }; 12307 12308 // Expose jQuery and $ identifiers, even in 12309 // AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557) 12310 // and CommonJS for browser emulators (#13566) 12311 if ( !noGlobal ) { 12312 window.jQuery = window.$ = jQuery; 12313 } 12314 12315 return jQuery; 12316 })); 12317 12318 12319/***/ }), 12320/* 2 */ 12321/***/ (function(module, exports, __webpack_require__) { 12322 12323 /* WEBPACK VAR INJECTION */(function(global) {"use strict"; 12324 12325 __webpack_require__(3); 12326 12327 __webpack_require__(328); 12328 12329 __webpack_require__(329); 12330 12331 if (global._babelPolyfill) { 12332 throw new Error("only one instance of babel-polyfill is allowed"); 12333 } 12334 global._babelPolyfill = true; 12335 12336 var DEFINE_PROPERTY = "defineProperty"; 12337 function define(O, key, value) { 12338 O[key] || Object[DEFINE_PROPERTY](O, key, { 12339 writable: true, 12340 configurable: true, 12341 value: value 12342 }); 12343 } 12344 12345 define(String.prototype, "padLeft", "".padStart); 12346 define(String.prototype, "padRight", "".padEnd); 12347 12348 "pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function (key) { 12349 [][key] && define(Array, key, Function.call.bind([][key])); 12350 }); 12351 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) 12352 12353/***/ }), 12354/* 3 */ 12355/***/ (function(module, exports, __webpack_require__) { 12356 12357 __webpack_require__(4); 12358 __webpack_require__(52); 12359 __webpack_require__(53); 12360 __webpack_require__(54); 12361 __webpack_require__(55); 12362 __webpack_require__(57); 12363 __webpack_require__(60); 12364 __webpack_require__(61); 12365 __webpack_require__(62); 12366 __webpack_require__(63); 12367 __webpack_require__(64); 12368 __webpack_require__(65); 12369 __webpack_require__(66); 12370 __webpack_require__(67); 12371 __webpack_require__(68); 12372 __webpack_require__(70); 12373 __webpack_require__(72); 12374 __webpack_require__(74); 12375 __webpack_require__(76); 12376 __webpack_require__(79); 12377 __webpack_require__(80); 12378 __webpack_require__(81); 12379 __webpack_require__(85); 12380 __webpack_require__(87); 12381 __webpack_require__(89); 12382 __webpack_require__(92); 12383 __webpack_require__(93); 12384 __webpack_require__(94); 12385 __webpack_require__(95); 12386 __webpack_require__(97); 12387 __webpack_require__(98); 12388 __webpack_require__(99); 12389 __webpack_require__(100); 12390 __webpack_require__(101); 12391 __webpack_require__(102); 12392 __webpack_require__(103); 12393 __webpack_require__(105); 12394 __webpack_require__(106); 12395 __webpack_require__(107); 12396 __webpack_require__(109); 12397 __webpack_require__(110); 12398 __webpack_require__(111); 12399 __webpack_require__(113); 12400 __webpack_require__(115); 12401 __webpack_require__(116); 12402 __webpack_require__(117); 12403 __webpack_require__(118); 12404 __webpack_require__(119); 12405 __webpack_require__(120); 12406 __webpack_require__(121); 12407 __webpack_require__(122); 12408 __webpack_require__(123); 12409 __webpack_require__(124); 12410 __webpack_require__(125); 12411 __webpack_require__(126); 12412 __webpack_require__(127); 12413 __webpack_require__(132); 12414 __webpack_require__(133); 12415 __webpack_require__(137); 12416 __webpack_require__(138); 12417 __webpack_require__(139); 12418 __webpack_require__(140); 12419 __webpack_require__(142); 12420 __webpack_require__(143); 12421 __webpack_require__(144); 12422 __webpack_require__(145); 12423 __webpack_require__(146); 12424 __webpack_require__(147); 12425 __webpack_require__(148); 12426 __webpack_require__(149); 12427 __webpack_require__(150); 12428 __webpack_require__(151); 12429 __webpack_require__(152); 12430 __webpack_require__(153); 12431 __webpack_require__(154); 12432 __webpack_require__(155); 12433 __webpack_require__(156); 12434 __webpack_require__(158); 12435 __webpack_require__(159); 12436 __webpack_require__(161); 12437 __webpack_require__(162); 12438 __webpack_require__(168); 12439 __webpack_require__(169); 12440 __webpack_require__(171); 12441 __webpack_require__(172); 12442 __webpack_require__(173); 12443 __webpack_require__(177); 12444 __webpack_require__(178); 12445 __webpack_require__(179); 12446 __webpack_require__(180); 12447 __webpack_require__(181); 12448 __webpack_require__(183); 12449 __webpack_require__(184); 12450 __webpack_require__(185); 12451 __webpack_require__(186); 12452 __webpack_require__(189); 12453 __webpack_require__(191); 12454 __webpack_require__(192); 12455 __webpack_require__(193); 12456 __webpack_require__(195); 12457 __webpack_require__(197); 12458 __webpack_require__(199); 12459 __webpack_require__(201); 12460 __webpack_require__(202); 12461 __webpack_require__(203); 12462 __webpack_require__(207); 12463 __webpack_require__(208); 12464 __webpack_require__(209); 12465 __webpack_require__(211); 12466 __webpack_require__(221); 12467 __webpack_require__(225); 12468 __webpack_require__(226); 12469 __webpack_require__(228); 12470 __webpack_require__(229); 12471 __webpack_require__(233); 12472 __webpack_require__(234); 12473 __webpack_require__(236); 12474 __webpack_require__(237); 12475 __webpack_require__(238); 12476 __webpack_require__(239); 12477 __webpack_require__(240); 12478 __webpack_require__(241); 12479 __webpack_require__(242); 12480 __webpack_require__(243); 12481 __webpack_require__(244); 12482 __webpack_require__(245); 12483 __webpack_require__(246); 12484 __webpack_require__(247); 12485 __webpack_require__(248); 12486 __webpack_require__(249); 12487 __webpack_require__(250); 12488 __webpack_require__(251); 12489 __webpack_require__(252); 12490 __webpack_require__(253); 12491 __webpack_require__(254); 12492 __webpack_require__(256); 12493 __webpack_require__(257); 12494 __webpack_require__(258); 12495 __webpack_require__(259); 12496 __webpack_require__(260); 12497 __webpack_require__(262); 12498 __webpack_require__(263); 12499 __webpack_require__(264); 12500 __webpack_require__(266); 12501 __webpack_require__(267); 12502 __webpack_require__(268); 12503 __webpack_require__(269); 12504 __webpack_require__(270); 12505 __webpack_require__(271); 12506 __webpack_require__(272); 12507 __webpack_require__(273); 12508 __webpack_require__(275); 12509 __webpack_require__(276); 12510 __webpack_require__(278); 12511 __webpack_require__(279); 12512 __webpack_require__(280); 12513 __webpack_require__(281); 12514 __webpack_require__(284); 12515 __webpack_require__(285); 12516 __webpack_require__(287); 12517 __webpack_require__(288); 12518 __webpack_require__(289);
vendor: 9,025 bytes, lines 12519-12768
12519 __webpack_require__(290); 12520 __webpack_require__(292); 12521 __webpack_require__(293); 12522 __webpack_require__(294); 12523 __webpack_require__(295); 12524 __webpack_require__(296); 12525 __webpack_require__(297); 12526 __webpack_require__(298); 12527 __webpack_require__(299); 12528 __webpack_require__(300); 12529 __webpack_require__(301); 12530 __webpack_require__(303); 12531 __webpack_require__(304); 12532 __webpack_require__(305); 12533 __webpack_require__(306); 12534 __webpack_require__(307); 12535 __webpack_require__(308); 12536 __webpack_require__(309); 12537 __webpack_require__(310); 12538 __webpack_require__(311); 12539 __webpack_require__(312); 12540 __webpack_require__(313); 12541 __webpack_require__(315); 12542 __webpack_require__(316); 12543 __webpack_require__(317); 12544 __webpack_require__(318); 12545 __webpack_require__(319); 12546 __webpack_require__(320); 12547 __webpack_require__(321); 12548 __webpack_require__(322); 12549 __webpack_require__(323); 12550 __webpack_require__(324); 12551 __webpack_require__(325); 12552 __webpack_require__(326); 12553 __webpack_require__(327); 12554 module.exports = __webpack_require__(10); 12555 12556 12557/***/ }), 12558/* 4 */ 12559/***/ (function(module, exports, __webpack_require__) { 12560 12561 'use strict'; 12562 // ECMAScript 6 symbols shim 12563 var global = __webpack_require__(5); 12564 var has = __webpack_require__(6); 12565 var DESCRIPTORS = __webpack_require__(7); 12566 var $export = __webpack_require__(9); 12567 var redefine = __webpack_require__(19); 12568 var META = __webpack_require__(23).KEY; 12569 var $fails = __webpack_require__(8); 12570 var shared = __webpack_require__(24); 12571 var setToStringTag = __webpack_require__(26); 12572 var uid = __webpack_require__(20); 12573 var wks = __webpack_require__(27); 12574 var wksExt = __webpack_require__(28); 12575 var wksDefine = __webpack_require__(29); 12576 var enumKeys = __webpack_require__(30); 12577 var isArray = __webpack_require__(45); 12578 var anObject = __webpack_require__(13); 12579 var isObject = __webpack_require__(14); 12580 var toIObject = __webpack_require__(33); 12581 var toPrimitive = __webpack_require__(17); 12582 var createDesc = __webpack_require__(18); 12583 var _create = __webpack_require__(46); 12584 var gOPNExt = __webpack_require__(49); 12585 var $GOPD = __webpack_require__(51); 12586 var $DP = __webpack_require__(12); 12587 var $keys = __webpack_require__(31); 12588 var gOPD = $GOPD.f; 12589 var dP = $DP.f; 12590 var gOPN = gOPNExt.f; 12591 var $Symbol = global.Symbol; 12592 var $JSON = global.JSON; 12593 var _stringify = $JSON && $JSON.stringify; 12594 var PROTOTYPE = 'prototype'; 12595 var HIDDEN = wks('_hidden'); 12596 var TO_PRIMITIVE = wks('toPrimitive'); 12597 var isEnum = {}.propertyIsEnumerable; 12598 var SymbolRegistry = shared('symbol-registry'); 12599 var AllSymbols = shared('symbols'); 12600 var OPSymbols = shared('op-symbols'); 12601 var ObjectProto = Object[PROTOTYPE]; 12602 var USE_NATIVE = typeof $Symbol == 'function'; 12603 var QObject = global.QObject; 12604 // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 12605 var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; 12606 12607 // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 12608 var setSymbolDesc = DESCRIPTORS && $fails(function () { 12609 return _create(dP({}, 'a', { 12610 get: function () { return dP(this, 'a', { value: 7 }).a; } 12611 })).a != 7; 12612 }) ? function (it, key, D) { 12613 var protoDesc = gOPD(ObjectProto, key); 12614 if (protoDesc) delete ObjectProto[key]; 12615 dP(it, key, D); 12616 if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc); 12617 } : dP; 12618 12619 var wrap = function (tag) { 12620 var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); 12621 sym._k = tag; 12622 return sym; 12623 }; 12624 12625 var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) { 12626 return typeof it == 'symbol'; 12627 } : function (it) { 12628 return it instanceof $Symbol; 12629 }; 12630 12631 var $defineProperty = function defineProperty(it, key, D) { 12632 if (it === ObjectProto) $defineProperty(OPSymbols, key, D); 12633 anObject(it); 12634 key = toPrimitive(key, true); 12635 anObject(D); 12636 if (has(AllSymbols, key)) { 12637 if (!D.enumerable) { 12638 if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {})); 12639 it[HIDDEN][key] = true; 12640 } else { 12641 if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; 12642 D = _create(D, { enumerable: createDesc(0, false) }); 12643 } return setSymbolDesc(it, key, D); 12644 } return dP(it, key, D); 12645 }; 12646 var $defineProperties = function defineProperties(it, P) { 12647 anObject(it); 12648 var keys = enumKeys(P = toIObject(P)); 12649 var i = 0; 12650 var l = keys.length; 12651 var key; 12652 while (l > i) $defineProperty(it, key = keys[i++], P[key]); 12653 return it; 12654 }; 12655 var $create = function create(it, P) { 12656 return P === undefined ? _create(it) : $defineProperties(_create(it), P); 12657 }; 12658 var $propertyIsEnumerable = function propertyIsEnumerable(key) { 12659 var E = isEnum.call(this, key = toPrimitive(key, true)); 12660 if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false; 12661 return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; 12662 }; 12663 var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { 12664 it = toIObject(it); 12665 key = toPrimitive(key, true); 12666 if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return; 12667 var D = gOPD(it, key); 12668 if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; 12669 return D; 12670 }; 12671 var $getOwnPropertyNames = function getOwnPropertyNames(it) { 12672 var names = gOPN(toIObject(it)); 12673 var result = []; 12674 var i = 0; 12675 var key; 12676 while (names.length > i) { 12677 if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); 12678 } return result; 12679 }; 12680 var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { 12681 var IS_OP = it === ObjectProto; 12682 var names = gOPN(IS_OP ? OPSymbols : toIObject(it)); 12683 var result = []; 12684 var i = 0; 12685 var key; 12686 while (names.length > i) { 12687 if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]); 12688 } return result; 12689 }; 12690 12691 // 19.4.1.1 Symbol([description]) 12692 if (!USE_NATIVE) { 12693 $Symbol = function Symbol() { 12694 if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); 12695 var tag = uid(arguments.length > 0 ? arguments[0] : undefined); 12696 var $set = function (value) { 12697 if (this === ObjectProto) $set.call(OPSymbols, value); 12698 if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; 12699 setSymbolDesc(this, tag, createDesc(1, value)); 12700 }; 12701 if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set }); 12702 return wrap(tag); 12703 }; 12704 redefine($Symbol[PROTOTYPE], 'toString', function toString() { 12705 return this._k; 12706 }); 12707 12708 $GOPD.f = $getOwnPropertyDescriptor; 12709 $DP.f = $defineProperty; 12710 __webpack_require__(50).f = gOPNExt.f = $getOwnPropertyNames; 12711 __webpack_require__(44).f = $propertyIsEnumerable; 12712 __webpack_require__(43).f = $getOwnPropertySymbols; 12713 12714 if (DESCRIPTORS && !__webpack_require__(25)) { 12715 redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); 12716 } 12717 12718 wksExt.f = function (name) { 12719 return wrap(wks(name)); 12720 }; 12721 } 12722 12723 $export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol }); 12724 12725 for (var es6Symbols = ( 12726 // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 12727 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' 12728 ).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]); 12729 12730 for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]); 12731 12732 $export($export.S + $export.F * !USE_NATIVE, 'Symbol', { 12733 // 19.4.2.1 Symbol.for(key) 12734 'for': function (key) { 12735 return has(SymbolRegistry, key += '') 12736 ? SymbolRegistry[key] 12737 : SymbolRegistry[key] = $Symbol(key); 12738 }, 12739 // 19.4.2.5 Symbol.keyFor(sym) 12740 keyFor: function keyFor(sym) { 12741 if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); 12742 for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key; 12743 }, 12744 useSetter: function () { setter = true; }, 12745 useSimple: function () { setter = false; } 12746 }); 12747 12748 $export($export.S + $export.F * !USE_NATIVE, 'Object', { 12749 // 19.1.2.2 Object.create(O [, Properties]) 12750 create: $create, 12751 // 19.1.2.4 Object.defineProperty(O, P, Attributes) 12752 defineProperty: $defineProperty, 12753 // 19.1.2.3 Object.defineProperties(O, Properties) 12754 defineProperties: $defineProperties, 12755 // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) 12756 getOwnPropertyDescriptor: $getOwnPropertyDescriptor, 12757 // 19.1.2.7 Object.getOwnPropertyNames(O) 12758 getOwnPropertyNames: $getOwnPropertyNames, 12759 // 19.1.2.8 Object.getOwnPropertySymbols(O) 12760 getOwnPropertySymbols: $getOwnPropertySymbols 12761 }); 12762 12763 // 24.3.2 JSON.stringify(value [, replacer [, space]]) 12764 $JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () { 12765 var S = $Symbol(); 12766 // MS Edge converts symbol values to JSON as {} 12767 // WebKit converts symbol values to JSON as null 12768 // V8 throws on boxed symbols
vendor: 5,385 bytes, lines 12769-12947
12769 return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}'; 12770 })), 'JSON', { 12771 stringify: function stringify(it) { 12772 var args = [it]; 12773 var i = 1; 12774 var replacer, $replacer; 12775 while (arguments.length > i) args.push(arguments[i++]); 12776 $replacer = replacer = args[1]; 12777 if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined 12778 if (!isArray(replacer)) replacer = function (key, value) { 12779 if (typeof $replacer == 'function') value = $replacer.call(this, key, value); 12780 if (!isSymbol(value)) return value; 12781 }; 12782 args[1] = replacer; 12783 return _stringify.apply($JSON, args); 12784 } 12785 }); 12786 12787 // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) 12788 $Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(11)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); 12789 // 19.4.3.5 Symbol.prototype[@@toStringTag] 12790 setToStringTag($Symbol, 'Symbol'); 12791 // 20.2.1.9 Math[@@toStringTag] 12792 setToStringTag(Math, 'Math', true); 12793 // 24.3.3 JSON[@@toStringTag] 12794 setToStringTag(global.JSON, 'JSON', true); 12795 12796 12797/***/ }), 12798/* 5 */ 12799/***/ (function(module, exports) { 12800 12801 // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 12802 var global = module.exports = typeof window != 'undefined' && window.Math == Math 12803 ? window : typeof self != 'undefined' && self.Math == Math ? self 12804 // eslint-disable-next-line no-new-func 12805 : Function('return this')(); 12806 if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef 12807 12808 12809/***/ }), 12810/* 6 */ 12811/***/ (function(module, exports) { 12812 12813 var hasOwnProperty = {}.hasOwnProperty; 12814 module.exports = function (it, key) { 12815 return hasOwnProperty.call(it, key); 12816 }; 12817 12818 12819/***/ }), 12820/* 7 */ 12821/***/ (function(module, exports, __webpack_require__) { 12822 12823 // Thank's IE8 for his funny defineProperty 12824 module.exports = !__webpack_require__(8)(function () { 12825 return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; 12826 }); 12827 12828 12829/***/ }), 12830/* 8 */ 12831/***/ (function(module, exports) { 12832 12833 module.exports = function (exec) { 12834 try { 12835 return !!exec(); 12836 } catch (e) { 12837 return true; 12838 } 12839 }; 12840 12841 12842/***/ }), 12843/* 9 */ 12844/***/ (function(module, exports, __webpack_require__) { 12845 12846 var global = __webpack_require__(5); 12847 var core = __webpack_require__(10); 12848 var hide = __webpack_require__(11); 12849 var redefine = __webpack_require__(19); 12850 var ctx = __webpack_require__(21); 12851 var PROTOTYPE = 'prototype'; 12852 12853 var $export = function (type, name, source) { 12854 var IS_FORCED = type & $export.F; 12855 var IS_GLOBAL = type & $export.G; 12856 var IS_STATIC = type & $export.S; 12857 var IS_PROTO = type & $export.P; 12858 var IS_BIND = type & $export.B; 12859 var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; 12860 var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); 12861 var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); 12862 var key, own, out, exp; 12863 if (IS_GLOBAL) source = name; 12864 for (key in source) { 12865 // contains in native 12866 own = !IS_FORCED && target && target[key] !== undefined; 12867 // export native or passed 12868 out = (own ? target : source)[key]; 12869 // bind timers to global for call from export context 12870 exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; 12871 // extend global 12872 if (target) redefine(target, key, out, type & $export.U); 12873 // export 12874 if (exports[key] != out) hide(exports, key, exp); 12875 if (IS_PROTO && expProto[key] != out) expProto[key] = out; 12876 } 12877 }; 12878 global.core = core; 12879 // type bitmap 12880 $export.F = 1; // forced 12881 $export.G = 2; // global 12882 $export.S = 4; // static 12883 $export.P = 8; // proto 12884 $export.B = 16; // bind 12885 $export.W = 32; // wrap 12886 $export.U = 64; // safe 12887 $export.R = 128; // real proto method for `library` 12888 module.exports = $export; 12889 12890 12891/***/ }), 12892/* 10 */ 12893/***/ (function(module, exports) { 12894 12895 var core = module.exports = { version: '2.6.0' }; 12896 if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef 12897 12898 12899/***/ }), 12900/* 11 */ 12901/***/ (function(module, exports, __webpack_require__) { 12902 12903 var dP = __webpack_require__(12); 12904 var createDesc = __webpack_require__(18); 12905 module.exports = __webpack_require__(7) ? function (object, key, value) { 12906 return dP.f(object, key, createDesc(1, value)); 12907 } : function (object, key, value) { 12908 object[key] = value; 12909 return object; 12910 }; 12911 12912 12913/***/ }), 12914/* 12 */ 12915/***/ (function(module, exports, __webpack_require__) { 12916 12917 var anObject = __webpack_require__(13); 12918 var IE8_DOM_DEFINE = __webpack_require__(15); 12919 var toPrimitive = __webpack_require__(17); 12920 var dP = Object.defineProperty; 12921 12922 exports.f = __webpack_require__(7) ? Object.defineProperty : function defineProperty(O, P, Attributes) { 12923 anObject(O); 12924 P = toPrimitive(P, true); 12925 anObject(Attributes); 12926 if (IE8_DOM_DEFINE) try { 12927 return dP(O, P, Attributes); 12928 } catch (e) { /* empty */ } 12929 if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); 12930 if ('value' in Attributes) O[P] = Attributes.value; 12931 return O; 12932 }; 12933 12934 12935/***/ }), 12936/* 13 */ 12937/***/ (function(module, exports, __webpack_require__) { 12938 12939 var isObject = __webpack_require__(14); 12940 module.exports = function (it) { 12941 if (!isObject(it)) throw TypeError(it + ' is not an object!'); 12942 return it; 12943 }; 12944 12945 12946/***/ }), 12947/* 14 */
vendor: 4,222 bytes, lines 12948-13100
12948/***/ (function(module, exports) { 12949 12950 module.exports = function (it) { 12951 return typeof it === 'object' ? it !== null : typeof it === 'function'; 12952 }; 12953 12954 12955/***/ }), 12956/* 15 */ 12957/***/ (function(module, exports, __webpack_require__) { 12958 12959 module.exports = !__webpack_require__(7) && !__webpack_require__(8)(function () { 12960 return Object.defineProperty(__webpack_require__(16)('div'), 'a', { get: function () { return 7; } }).a != 7; 12961 }); 12962 12963 12964/***/ }), 12965/* 16 */ 12966/***/ (function(module, exports, __webpack_require__) { 12967 12968 var isObject = __webpack_require__(14); 12969 var document = __webpack_require__(5).document; 12970 // typeof document.createElement is 'object' in old IE 12971 var is = isObject(document) && isObject(document.createElement); 12972 module.exports = function (it) { 12973 return is ? document.createElement(it) : {}; 12974 }; 12975 12976 12977/***/ }), 12978/* 17 */ 12979/***/ (function(module, exports, __webpack_require__) { 12980 12981 // 7.1.1 ToPrimitive(input [, PreferredType]) 12982 var isObject = __webpack_require__(14); 12983 // instead of the ES6 spec version, we didn't implement @@toPrimitive case 12984 // and the second argument - flag - preferred type is a string 12985 module.exports = function (it, S) { 12986 if (!isObject(it)) return it; 12987 var fn, val; 12988 if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; 12989 if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; 12990 if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; 12991 throw TypeError("Can't convert object to primitive value"); 12992 }; 12993 12994 12995/***/ }), 12996/* 18 */ 12997/***/ (function(module, exports) { 12998 12999 module.exports = function (bitmap, value) { 13000 return { 13001 enumerable: !(bitmap & 1), 13002 configurable: !(bitmap & 2), 13003 writable: !(bitmap & 4), 13004 value: value 13005 }; 13006 }; 13007 13008 13009/***/ }), 13010/* 19 */ 13011/***/ (function(module, exports, __webpack_require__) { 13012 13013 var global = __webpack_require__(5); 13014 var hide = __webpack_require__(11); 13015 var has = __webpack_require__(6); 13016 var SRC = __webpack_require__(20)('src'); 13017 var TO_STRING = 'toString'; 13018 var $toString = Function[TO_STRING]; 13019 var TPL = ('' + $toString).split(TO_STRING); 13020 13021 __webpack_require__(10).inspectSource = function (it) { 13022 return $toString.call(it); 13023 }; 13024 13025 (module.exports = function (O, key, val, safe) { 13026 var isFunction = typeof val == 'function'; 13027 if (isFunction) has(val, 'name') || hide(val, 'name', key); 13028 if (O[key] === val) return; 13029 if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); 13030 if (O === global) { 13031 O[key] = val; 13032 } else if (!safe) { 13033 delete O[key]; 13034 hide(O, key, val); 13035 } else if (O[key]) { 13036 O[key] = val; 13037 } else { 13038 hide(O, key, val); 13039 } 13040 // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative 13041 })(Function.prototype, TO_STRING, function toString() { 13042 return typeof this == 'function' && this[SRC] || $toString.call(this); 13043 }); 13044 13045 13046/***/ }), 13047/* 20 */ 13048/***/ (function(module, exports) { 13049 13050 var id = 0; 13051 var px = Math.random(); 13052 module.exports = function (key) { 13053 return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); 13054 }; 13055 13056 13057/***/ }), 13058/* 21 */ 13059/***/ (function(module, exports, __webpack_require__) { 13060 13061 // optional / simple context binding 13062 var aFunction = __webpack_require__(22); 13063 module.exports = function (fn, that, length) { 13064 aFunction(fn); 13065 if (that === undefined) return fn; 13066 switch (length) { 13067 case 1: return function (a) { 13068 return fn.call(that, a); 13069 }; 13070 case 2: return function (a, b) { 13071 return fn.call(that, a, b); 13072 }; 13073 case 3: return function (a, b, c) { 13074 return fn.call(that, a, b, c); 13075 }; 13076 } 13077 return function (/* ...args */) { 13078 return fn.apply(that, arguments); 13079 }; 13080 }; 13081 13082 13083/***/ }), 13084/* 22 */ 13085/***/ (function(module, exports) { 13086 13087 module.exports = function (it) { 13088 if (typeof it != 'function') throw TypeError(it + ' is not a function!'); 13089 return it; 13090 }; 13091 13092 13093/***/ }), 13094/* 23 */ 13095/***/ (function(module, exports, __webpack_require__) { 13096 13097 var META = __webpack_require__(20)('meta'); 13098 var isObject = __webpack_require__(14); 13099 var has = __webpack_require__(6); 13100 var setDesc = __webpack_require__(12).f;
vendor: 5,696 bytes, lines 13101-13311
13101 var id = 0; 13102 var isExtensible = Object.isExtensible || function () { 13103 return true; 13104 }; 13105 var FREEZE = !__webpack_require__(8)(function () { 13106 return isExtensible(Object.preventExtensions({})); 13107 }); 13108 var setMeta = function (it) { 13109 setDesc(it, META, { value: { 13110 i: 'O' + ++id, // object ID 13111 w: {} // weak collections IDs 13112 } }); 13113 }; 13114 var fastKey = function (it, create) { 13115 // return primitive with prefix 13116 if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; 13117 if (!has(it, META)) { 13118 // can't set metadata to uncaught frozen object 13119 if (!isExtensible(it)) return 'F'; 13120 // not necessary to add metadata 13121 if (!create) return 'E'; 13122 // add missing metadata 13123 setMeta(it); 13124 // return object ID 13125 } return it[META].i; 13126 }; 13127 var getWeak = function (it, create) { 13128 if (!has(it, META)) { 13129 // can't set metadata to uncaught frozen object 13130 if (!isExtensible(it)) return true; 13131 // not necessary to add metadata 13132 if (!create) return false; 13133 // add missing metadata 13134 setMeta(it); 13135 // return hash weak collections IDs 13136 } return it[META].w; 13137 }; 13138 // add metadata on freeze-family methods calling 13139 var onFreeze = function (it) { 13140 if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); 13141 return it; 13142 }; 13143 var meta = module.exports = { 13144 KEY: META, 13145 NEED: false, 13146 fastKey: fastKey, 13147 getWeak: getWeak, 13148 onFreeze: onFreeze 13149 }; 13150 13151 13152/***/ }), 13153/* 24 */ 13154/***/ (function(module, exports, __webpack_require__) { 13155 13156 var core = __webpack_require__(10); 13157 var global = __webpack_require__(5); 13158 var SHARED = '__core-js_shared__'; 13159 var store = global[SHARED] || (global[SHARED] = {}); 13160 13161 (module.exports = function (key, value) { 13162 return store[key] || (store[key] = value !== undefined ? value : {}); 13163 })('versions', []).push({ 13164 version: core.version, 13165 mode: __webpack_require__(25) ? 'pure' : 'global', 13166 copyright: '© 2018 Denis Pushkarev (zloirock.ru)' 13167 }); 13168 13169 13170/***/ }), 13171/* 25 */ 13172/***/ (function(module, exports) { 13173 13174 module.exports = false; 13175 13176 13177/***/ }), 13178/* 26 */ 13179/***/ (function(module, exports, __webpack_require__) { 13180 13181 var def = __webpack_require__(12).f; 13182 var has = __webpack_require__(6); 13183 var TAG = __webpack_require__(27)('toStringTag'); 13184 13185 module.exports = function (it, tag, stat) { 13186 if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); 13187 }; 13188 13189 13190/***/ }), 13191/* 27 */ 13192/***/ (function(module, exports, __webpack_require__) { 13193 13194 var store = __webpack_require__(24)('wks'); 13195 var uid = __webpack_require__(20); 13196 var Symbol = __webpack_require__(5).Symbol; 13197 var USE_SYMBOL = typeof Symbol == 'function'; 13198 13199 var $exports = module.exports = function (name) { 13200 return store[name] || (store[name] = 13201 USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); 13202 }; 13203 13204 $exports.store = store; 13205 13206 13207/***/ }), 13208/* 28 */ 13209/***/ (function(module, exports, __webpack_require__) { 13210 13211 exports.f = __webpack_require__(27); 13212 13213 13214/***/ }), 13215/* 29 */ 13216/***/ (function(module, exports, __webpack_require__) { 13217 13218 var global = __webpack_require__(5); 13219 var core = __webpack_require__(10); 13220 var LIBRARY = __webpack_require__(25); 13221 var wksExt = __webpack_require__(28); 13222 var defineProperty = __webpack_require__(12).f; 13223 module.exports = function (name) { 13224 var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); 13225 if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) }); 13226 }; 13227 13228 13229/***/ }), 13230/* 30 */ 13231/***/ (function(module, exports, __webpack_require__) { 13232 13233 // all enumerable object keys, includes symbols 13234 var getKeys = __webpack_require__(31); 13235 var gOPS = __webpack_require__(43); 13236 var pIE = __webpack_require__(44); 13237 module.exports = function (it) { 13238 var result = getKeys(it); 13239 var getSymbols = gOPS.f; 13240 if (getSymbols) { 13241 var symbols = getSymbols(it); 13242 var isEnum = pIE.f; 13243 var i = 0; 13244 var key; 13245 while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key); 13246 } return result; 13247 }; 13248 13249 13250/***/ }), 13251/* 31 */ 13252/***/ (function(module, exports, __webpack_require__) { 13253 13254 // 19.1.2.14 / 15.2.3.14 Object.keys(O) 13255 var $keys = __webpack_require__(32); 13256 var enumBugKeys = __webpack_require__(42); 13257 13258 module.exports = Object.keys || function keys(O) { 13259 return $keys(O, enumBugKeys); 13260 }; 13261 13262 13263/***/ }), 13264/* 32 */ 13265/***/ (function(module, exports, __webpack_require__) { 13266 13267 var has = __webpack_require__(6); 13268 var toIObject = __webpack_require__(33); 13269 var arrayIndexOf = __webpack_require__(37)(false); 13270 var IE_PROTO = __webpack_require__(41)('IE_PROTO'); 13271 13272 module.exports = function (object, names) { 13273 var O = toIObject(object); 13274 var i = 0; 13275 var result = []; 13276 var key; 13277 for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key); 13278 // Don't enum bug & hidden keys 13279 while (names.length > i) if (has(O, key = names[i++])) { 13280 ~arrayIndexOf(result, key) || result.push(key); 13281 } 13282 return result; 13283 }; 13284 13285 13286/***/ }), 13287/* 33 */ 13288/***/ (function(module, exports, __webpack_require__) { 13289 13290 // to indexed object, toObject with fallback for non-array-like ES3 strings 13291 var IObject = __webpack_require__(34); 13292 var defined = __webpack_require__(36); 13293 module.exports = function (it) { 13294 return IObject(defined(it)); 13295 }; 13296 13297 13298/***/ }), 13299/* 34 */ 13300/***/ (function(module, exports, __webpack_require__) { 13301 13302 // fallback for non-array-like ES3 and non-enumerable old V8 strings 13303 var cof = __webpack_require__(35); 13304 // eslint-disable-next-line no-prototype-builtins 13305 module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { 13306 return cof(it) == 'String' ? it.split('') : Object(it); 13307 }; 13308 13309 13310/***/ }), 13311/* 35 */
vendor: 2,411 bytes, lines 13312-13404
13312/***/ (function(module, exports) { 13313 13314 var toString = {}.toString; 13315 13316 module.exports = function (it) { 13317 return toString.call(it).slice(8, -1); 13318 }; 13319 13320 13321/***/ }), 13322/* 36 */ 13323/***/ (function(module, exports) { 13324 13325 // 7.2.1 RequireObjectCoercible(argument) 13326 module.exports = function (it) { 13327 if (it == undefined) throw TypeError("Can't call method on " + it); 13328 return it; 13329 }; 13330 13331 13332/***/ }), 13333/* 37 */ 13334/***/ (function(module, exports, __webpack_require__) { 13335 13336 // false -> Array#indexOf 13337 // true -> Array#includes 13338 var toIObject = __webpack_require__(33); 13339 var toLength = __webpack_require__(38); 13340 var toAbsoluteIndex = __webpack_require__(40); 13341 module.exports = function (IS_INCLUDES) { 13342 return function ($this, el, fromIndex) { 13343 var O = toIObject($this); 13344 var length = toLength(O.length); 13345 var index = toAbsoluteIndex(fromIndex, length); 13346 var value; 13347 // Array#includes uses SameValueZero equality algorithm 13348 // eslint-disable-next-line no-self-compare 13349 if (IS_INCLUDES && el != el) while (length > index) { 13350 value = O[index++]; 13351 // eslint-disable-next-line no-self-compare 13352 if (value != value) return true; 13353 // Array#indexOf ignores holes, Array#includes - not 13354 } else for (;length > index; index++) if (IS_INCLUDES || index in O) { 13355 if (O[index] === el) return IS_INCLUDES || index || 0; 13356 } return !IS_INCLUDES && -1; 13357 }; 13358 }; 13359 13360 13361/***/ }), 13362/* 38 */ 13363/***/ (function(module, exports, __webpack_require__) { 13364 13365 // 7.1.15 ToLength 13366 var toInteger = __webpack_require__(39); 13367 var min = Math.min; 13368 module.exports = function (it) { 13369 return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 13370 }; 13371 13372 13373/***/ }), 13374/* 39 */ 13375/***/ (function(module, exports) { 13376 13377 // 7.1.4 ToInteger 13378 var ceil = Math.ceil; 13379 var floor = Math.floor; 13380 module.exports = function (it) { 13381 return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); 13382 }; 13383 13384 13385/***/ }), 13386/* 40 */ 13387/***/ (function(module, exports, __webpack_require__) { 13388 13389 var toInteger = __webpack_require__(39); 13390 var max = Math.max; 13391 var min = Math.min; 13392 module.exports = function (index, length) { 13393 index = toInteger(index); 13394 return index < 0 ? max(index + length, 0) : min(index, length); 13395 }; 13396 13397 13398/***/ }), 13399/* 41 */ 13400/***/ (function(module, exports, __webpack_require__) { 13401 13402 var shared = __webpack_require__(24)('keys'); 13403 var uid = __webpack_require__(20); 13404 module.exports = function (key) {
vendor: 6,045 bytes, lines 13405-13623
13405 return shared[key] || (shared[key] = uid(key)); 13406 }; 13407 13408 13409/***/ }), 13410/* 42 */ 13411/***/ (function(module, exports) { 13412 13413 // IE 8- don't enum bug keys 13414 module.exports = ( 13415 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' 13416 ).split(','); 13417 13418 13419/***/ }), 13420/* 43 */ 13421/***/ (function(module, exports) { 13422 13423 exports.f = Object.getOwnPropertySymbols; 13424 13425 13426/***/ }), 13427/* 44 */ 13428/***/ (function(module, exports) { 13429 13430 exports.f = {}.propertyIsEnumerable; 13431 13432 13433/***/ }), 13434/* 45 */ 13435/***/ (function(module, exports, __webpack_require__) { 13436 13437 // 7.2.2 IsArray(argument) 13438 var cof = __webpack_require__(35); 13439 module.exports = Array.isArray || function isArray(arg) { 13440 return cof(arg) == 'Array'; 13441 }; 13442 13443 13444/***/ }), 13445/* 46 */ 13446/***/ (function(module, exports, __webpack_require__) { 13447 13448 // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) 13449 var anObject = __webpack_require__(13); 13450 var dPs = __webpack_require__(47); 13451 var enumBugKeys = __webpack_require__(42); 13452 var IE_PROTO = __webpack_require__(41)('IE_PROTO'); 13453 var Empty = function () { /* empty */ }; 13454 var PROTOTYPE = 'prototype'; 13455 13456 // Create object with fake `null` prototype: use iframe Object with cleared prototype 13457 var createDict = function () { 13458 // Thrash, waste and sodomy: IE GC bug 13459 var iframe = __webpack_require__(16)('iframe'); 13460 var i = enumBugKeys.length; 13461 var lt = '<'; 13462 var gt = '>'; 13463 var iframeDocument; 13464 iframe.style.display = 'none'; 13465 __webpack_require__(48).appendChild(iframe); 13466 iframe.src = 'javascript:'; // eslint-disable-line no-script-url 13467 // createDict = iframe.contentWindow.Object; 13468 // html.removeChild(iframe); 13469 iframeDocument = iframe.contentWindow.document; 13470 iframeDocument.open(); 13471 iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); 13472 iframeDocument.close(); 13473 createDict = iframeDocument.F; 13474 while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]]; 13475 return createDict(); 13476 }; 13477 13478 module.exports = Object.create || function create(O, Properties) { 13479 var result; 13480 if (O !== null) { 13481 Empty[PROTOTYPE] = anObject(O); 13482 result = new Empty(); 13483 Empty[PROTOTYPE] = null; 13484 // add "__proto__" for Object.getPrototypeOf polyfill 13485 result[IE_PROTO] = O; 13486 } else result = createDict(); 13487 return Properties === undefined ? result : dPs(result, Properties); 13488 }; 13489 13490 13491/***/ }), 13492/* 47 */ 13493/***/ (function(module, exports, __webpack_require__) { 13494 13495 var dP = __webpack_require__(12); 13496 var anObject = __webpack_require__(13); 13497 var getKeys = __webpack_require__(31); 13498 13499 module.exports = __webpack_require__(7) ? Object.defineProperties : function defineProperties(O, Properties) { 13500 anObject(O); 13501 var keys = getKeys(Properties); 13502 var length = keys.length; 13503 var i = 0; 13504 var P; 13505 while (length > i) dP.f(O, P = keys[i++], Properties[P]); 13506 return O; 13507 }; 13508 13509 13510/***/ }), 13511/* 48 */ 13512/***/ (function(module, exports, __webpack_require__) { 13513 13514 var document = __webpack_require__(5).document; 13515 module.exports = document && document.documentElement; 13516 13517 13518/***/ }), 13519/* 49 */ 13520/***/ (function(module, exports, __webpack_require__) { 13521 13522 // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window 13523 var toIObject = __webpack_require__(33); 13524 var gOPN = __webpack_require__(50).f; 13525 var toString = {}.toString; 13526 13527 var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames 13528 ? Object.getOwnPropertyNames(window) : []; 13529 13530 var getWindowNames = function (it) { 13531 try { 13532 return gOPN(it); 13533 } catch (e) { 13534 return windowNames.slice(); 13535 } 13536 }; 13537 13538 module.exports.f = function getOwnPropertyNames(it) { 13539 return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); 13540 }; 13541 13542 13543/***/ }), 13544/* 50 */ 13545/***/ (function(module, exports, __webpack_require__) { 13546 13547 // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) 13548 var $keys = __webpack_require__(32); 13549 var hiddenKeys = __webpack_require__(42).concat('length', 'prototype'); 13550 13551 exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { 13552 return $keys(O, hiddenKeys); 13553 }; 13554 13555 13556/***/ }), 13557/* 51 */ 13558/***/ (function(module, exports, __webpack_require__) { 13559 13560 var pIE = __webpack_require__(44); 13561 var createDesc = __webpack_require__(18); 13562 var toIObject = __webpack_require__(33); 13563 var toPrimitive = __webpack_require__(17); 13564 var has = __webpack_require__(6); 13565 var IE8_DOM_DEFINE = __webpack_require__(15); 13566 var gOPD = Object.getOwnPropertyDescriptor; 13567 13568 exports.f = __webpack_require__(7) ? gOPD : function getOwnPropertyDescriptor(O, P) { 13569 O = toIObject(O); 13570 P = toPrimitive(P, true); 13571 if (IE8_DOM_DEFINE) try { 13572 return gOPD(O, P); 13573 } catch (e) { /* empty */ } 13574 if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); 13575 }; 13576 13577 13578/***/ }), 13579/* 52 */ 13580/***/ (function(module, exports, __webpack_require__) { 13581 13582 var $export = __webpack_require__(9); 13583 // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) 13584 $export($export.S, 'Object', { create: __webpack_require__(46) }); 13585 13586 13587/***/ }), 13588/* 53 */ 13589/***/ (function(module, exports, __webpack_require__) { 13590 13591 var $export = __webpack_require__(9); 13592 // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes) 13593 $export($export.S + $export.F * !__webpack_require__(7), 'Object', { defineProperty: __webpack_require__(12).f }); 13594 13595 13596/***/ }), 13597/* 54 */ 13598/***/ (function(module, exports, __webpack_require__) { 13599 13600 var $export = __webpack_require__(9); 13601 // 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties) 13602 $export($export.S + $export.F * !__webpack_require__(7), 'Object', { defineProperties: __webpack_require__(47) }); 13603 13604 13605/***/ }), 13606/* 55 */ 13607/***/ (function(module, exports, __webpack_require__) { 13608 13609 // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) 13610 var toIObject = __webpack_require__(33); 13611 var $getOwnPropertyDescriptor = __webpack_require__(51).f; 13612 13613 __webpack_require__(56)('getOwnPropertyDescriptor', function () { 13614 return function getOwnPropertyDescriptor(it, key) { 13615 return $getOwnPropertyDescriptor(toIObject(it), key); 13616 }; 13617 }); 13618 13619 13620/***/ }), 13621/* 56 */ 13622/***/ (function(module, exports, __webpack_require__) { 13623
vendor: 4,205 bytes, lines 13624-13788
13624 // most Object methods by ES6 should accept primitives 13625 var $export = __webpack_require__(9); 13626 var core = __webpack_require__(10); 13627 var fails = __webpack_require__(8); 13628 module.exports = function (KEY, exec) { 13629 var fn = (core.Object || {})[KEY] || Object[KEY]; 13630 var exp = {}; 13631 exp[KEY] = exec(fn); 13632 $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp); 13633 }; 13634 13635 13636/***/ }), 13637/* 57 */ 13638/***/ (function(module, exports, __webpack_require__) { 13639 13640 // 19.1.2.9 Object.getPrototypeOf(O) 13641 var toObject = __webpack_require__(58); 13642 var $getPrototypeOf = __webpack_require__(59); 13643 13644 __webpack_require__(56)('getPrototypeOf', function () { 13645 return function getPrototypeOf(it) { 13646 return $getPrototypeOf(toObject(it)); 13647 }; 13648 }); 13649 13650 13651/***/ }), 13652/* 58 */ 13653/***/ (function(module, exports, __webpack_require__) { 13654 13655 // 7.1.13 ToObject(argument) 13656 var defined = __webpack_require__(36); 13657 module.exports = function (it) { 13658 return Object(defined(it)); 13659 }; 13660 13661 13662/***/ }), 13663/* 59 */ 13664/***/ (function(module, exports, __webpack_require__) { 13665 13666 // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) 13667 var has = __webpack_require__(6); 13668 var toObject = __webpack_require__(58); 13669 var IE_PROTO = __webpack_require__(41)('IE_PROTO'); 13670 var ObjectProto = Object.prototype; 13671 13672 module.exports = Object.getPrototypeOf || function (O) { 13673 O = toObject(O); 13674 if (has(O, IE_PROTO)) return O[IE_PROTO]; 13675 if (typeof O.constructor == 'function' && O instanceof O.constructor) { 13676 return O.constructor.prototype; 13677 } return O instanceof Object ? ObjectProto : null; 13678 }; 13679 13680 13681/***/ }), 13682/* 60 */ 13683/***/ (function(module, exports, __webpack_require__) { 13684 13685 // 19.1.2.14 Object.keys(O) 13686 var toObject = __webpack_require__(58); 13687 var $keys = __webpack_require__(31); 13688 13689 __webpack_require__(56)('keys', function () { 13690 return function keys(it) { 13691 return $keys(toObject(it)); 13692 }; 13693 }); 13694 13695 13696/***/ }), 13697/* 61 */ 13698/***/ (function(module, exports, __webpack_require__) { 13699 13700 // 19.1.2.7 Object.getOwnPropertyNames(O) 13701 __webpack_require__(56)('getOwnPropertyNames', function () { 13702 return __webpack_require__(49).f; 13703 }); 13704 13705 13706/***/ }), 13707/* 62 */ 13708/***/ (function(module, exports, __webpack_require__) { 13709 13710 // 19.1.2.5 Object.freeze(O) 13711 var isObject = __webpack_require__(14); 13712 var meta = __webpack_require__(23).onFreeze; 13713 13714 __webpack_require__(56)('freeze', function ($freeze) { 13715 return function freeze(it) { 13716 return $freeze && isObject(it) ? $freeze(meta(it)) : it; 13717 }; 13718 }); 13719 13720 13721/***/ }), 13722/* 63 */ 13723/***/ (function(module, exports, __webpack_require__) { 13724 13725 // 19.1.2.17 Object.seal(O) 13726 var isObject = __webpack_require__(14); 13727 var meta = __webpack_require__(23).onFreeze; 13728 13729 __webpack_require__(56)('seal', function ($seal) { 13730 return function seal(it) { 13731 return $seal && isObject(it) ? $seal(meta(it)) : it; 13732 }; 13733 }); 13734 13735 13736/***/ }), 13737/* 64 */ 13738/***/ (function(module, exports, __webpack_require__) { 13739 13740 // 19.1.2.15 Object.preventExtensions(O) 13741 var isObject = __webpack_require__(14); 13742 var meta = __webpack_require__(23).onFreeze; 13743 13744 __webpack_require__(56)('preventExtensions', function ($preventExtensions) { 13745 return function preventExtensions(it) { 13746 return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it; 13747 }; 13748 }); 13749 13750 13751/***/ }), 13752/* 65 */ 13753/***/ (function(module, exports, __webpack_require__) { 13754 13755 // 19.1.2.12 Object.isFrozen(O) 13756 var isObject = __webpack_require__(14); 13757 13758 __webpack_require__(56)('isFrozen', function ($isFrozen) { 13759 return function isFrozen(it) { 13760 return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true; 13761 }; 13762 }); 13763 13764 13765/***/ }), 13766/* 66 */ 13767/***/ (function(module, exports, __webpack_require__) { 13768 13769 // 19.1.2.13 Object.isSealed(O) 13770 var isObject = __webpack_require__(14); 13771 13772 __webpack_require__(56)('isSealed', function ($isSealed) { 13773 return function isSealed(it) { 13774 return isObject(it) ? $isSealed ? $isSealed(it) : false : true; 13775 }; 13776 }); 13777 13778 13779/***/ }), 13780/* 67 */ 13781/***/ (function(module, exports, __webpack_require__) { 13782 13783 // 19.1.2.11 Object.isExtensible(O) 13784 var isObject = __webpack_require__(14); 13785 13786 __webpack_require__(56)('isExtensible', function ($isExtensible) { 13787 return function isExtensible(it) { 13788 return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;
vendor: 4,216 bytes, lines 13789-13937
13789 }; 13790 }); 13791 13792 13793/***/ }), 13794/* 68 */ 13795/***/ (function(module, exports, __webpack_require__) { 13796 13797 // 19.1.3.1 Object.assign(target, source) 13798 var $export = __webpack_require__(9); 13799 13800 $export($export.S + $export.F, 'Object', { assign: __webpack_require__(69) }); 13801 13802 13803/***/ }), 13804/* 69 */ 13805/***/ (function(module, exports, __webpack_require__) { 13806 13807 'use strict'; 13808 // 19.1.2.1 Object.assign(target, source, ...) 13809 var getKeys = __webpack_require__(31); 13810 var gOPS = __webpack_require__(43); 13811 var pIE = __webpack_require__(44); 13812 var toObject = __webpack_require__(58); 13813 var IObject = __webpack_require__(34); 13814 var $assign = Object.assign; 13815 13816 // should work with symbols and should have deterministic property order (V8 bug) 13817 module.exports = !$assign || __webpack_require__(8)(function () { 13818 var A = {}; 13819 var B = {}; 13820 // eslint-disable-next-line no-undef 13821 var S = Symbol(); 13822 var K = 'abcdefghijklmnopqrst'; 13823 A[S] = 7; 13824 K.split('').forEach(function (k) { B[k] = k; }); 13825 return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; 13826 }) ? function assign(target, source) { // eslint-disable-line no-unused-vars 13827 var T = toObject(target); 13828 var aLen = arguments.length; 13829 var index = 1; 13830 var getSymbols = gOPS.f; 13831 var isEnum = pIE.f; 13832 while (aLen > index) { 13833 var S = IObject(arguments[index++]); 13834 var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S); 13835 var length = keys.length; 13836 var j = 0; 13837 var key; 13838 while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; 13839 } return T; 13840 } : $assign; 13841 13842 13843/***/ }), 13844/* 70 */ 13845/***/ (function(module, exports, __webpack_require__) { 13846 13847 // 19.1.3.10 Object.is(value1, value2) 13848 var $export = __webpack_require__(9); 13849 $export($export.S, 'Object', { is: __webpack_require__(71) }); 13850 13851 13852/***/ }), 13853/* 71 */ 13854/***/ (function(module, exports) { 13855 13856 // 7.2.9 SameValue(x, y) 13857 module.exports = Object.is || function is(x, y) { 13858 // eslint-disable-next-line no-self-compare 13859 return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y; 13860 }; 13861 13862 13863/***/ }), 13864/* 72 */ 13865/***/ (function(module, exports, __webpack_require__) { 13866 13867 // 19.1.3.19 Object.setPrototypeOf(O, proto) 13868 var $export = __webpack_require__(9); 13869 $export($export.S, 'Object', { setPrototypeOf: __webpack_require__(73).set }); 13870 13871 13872/***/ }), 13873/* 73 */ 13874/***/ (function(module, exports, __webpack_require__) { 13875 13876 // Works with __proto__ only. Old v8 can't work with null proto objects. 13877 /* eslint-disable no-proto */ 13878 var isObject = __webpack_require__(14); 13879 var anObject = __webpack_require__(13); 13880 var check = function (O, proto) { 13881 anObject(O); 13882 if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); 13883 }; 13884 module.exports = { 13885 set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line 13886 function (test, buggy, set) { 13887 try { 13888 set = __webpack_require__(21)(Function.call, __webpack_require__(51).f(Object.prototype, '__proto__').set, 2); 13889 set(test, []); 13890 buggy = !(test instanceof Array); 13891 } catch (e) { buggy = true; } 13892 return function setPrototypeOf(O, proto) { 13893 check(O, proto); 13894 if (buggy) O.__proto__ = proto; 13895 else set(O, proto); 13896 return O; 13897 }; 13898 }({}, false) : undefined), 13899 check: check 13900 }; 13901 13902 13903/***/ }), 13904/* 74 */ 13905/***/ (function(module, exports, __webpack_require__) { 13906 13907 'use strict'; 13908 // 19.1.3.6 Object.prototype.toString() 13909 var classof = __webpack_require__(75); 13910 var test = {}; 13911 test[__webpack_require__(27)('toStringTag')] = 'z'; 13912 if (test + '' != '[object z]') { 13913 __webpack_require__(19)(Object.prototype, 'toString', function toString() { 13914 return '[object ' + classof(this) + ']'; 13915 }, true); 13916 } 13917 13918 13919/***/ }), 13920/* 75 */ 13921/***/ (function(module, exports, __webpack_require__) { 13922 13923 // getting tag from 19.1.3.6 Object.prototype.toString() 13924 var cof = __webpack_require__(35); 13925 var TAG = __webpack_require__(27)('toStringTag'); 13926 // ES3 wrong here 13927 var ARG = cof(function () { return arguments; }()) == 'Arguments'; 13928 13929 // fallback for IE11 Script Access Denied error 13930 var tryGet = function (it, key) { 13931 try { 13932 return it[key]; 13933 } catch (e) { /* empty */ } 13934 }; 13935 13936 module.exports = function (it) { 13937 var O, T, B;
vendor: 27,589 bytes, lines 13938-14964
13938 return it === undefined ? 'Undefined' : it === null ? 'Null' 13939 // @@toStringTag case 13940 : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T 13941 // builtinTag case 13942 : ARG ? cof(O) 13943 // ES3 arguments fallback 13944 : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; 13945 }; 13946 13947 13948/***/ }), 13949/* 76 */ 13950/***/ (function(module, exports, __webpack_require__) { 13951 13952 // 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...) 13953 var $export = __webpack_require__(9); 13954 13955 $export($export.P, 'Function', { bind: __webpack_require__(77) }); 13956 13957 13958/***/ }), 13959/* 77 */ 13960/***/ (function(module, exports, __webpack_require__) { 13961 13962 'use strict'; 13963 var aFunction = __webpack_require__(22); 13964 var isObject = __webpack_require__(14); 13965 var invoke = __webpack_require__(78); 13966 var arraySlice = [].slice; 13967 var factories = {}; 13968 13969 var construct = function (F, len, args) { 13970 if (!(len in factories)) { 13971 for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']'; 13972 // eslint-disable-next-line no-new-func 13973 factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')'); 13974 } return factories[len](F, args); 13975 }; 13976 13977 module.exports = Function.bind || function bind(that /* , ...args */) { 13978 var fn = aFunction(this); 13979 var partArgs = arraySlice.call(arguments, 1); 13980 var bound = function (/* args... */) { 13981 var args = partArgs.concat(arraySlice.call(arguments)); 13982 return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that); 13983 }; 13984 if (isObject(fn.prototype)) bound.prototype = fn.prototype; 13985 return bound; 13986 }; 13987 13988 13989/***/ }), 13990/* 78 */ 13991/***/ (function(module, exports) { 13992 13993 // fast apply, http://jsperf.lnkit.com/fast-apply/5 13994 module.exports = function (fn, args, that) { 13995 var un = that === undefined; 13996 switch (args.length) { 13997 case 0: return un ? fn() 13998 : fn.call(that); 13999 case 1: return un ? fn(args[0]) 14000 : fn.call(that, args[0]); 14001 case 2: return un ? fn(args[0], args[1]) 14002 : fn.call(that, args[0], args[1]); 14003 case 3: return un ? fn(args[0], args[1], args[2]) 14004 : fn.call(that, args[0], args[1], args[2]); 14005 case 4: return un ? fn(args[0], args[1], args[2], args[3]) 14006 : fn.call(that, args[0], args[1], args[2], args[3]); 14007 } return fn.apply(that, args); 14008 }; 14009 14010 14011/***/ }), 14012/* 79 */ 14013/***/ (function(module, exports, __webpack_require__) { 14014 14015 var dP = __webpack_require__(12).f; 14016 var FProto = Function.prototype; 14017 var nameRE = /^\s*function ([^ (]*)/; 14018 var NAME = 'name'; 14019 14020 // 19.2.4.2 name 14021 NAME in FProto || __webpack_require__(7) && dP(FProto, NAME, { 14022 configurable: true, 14023 get: function () { 14024 try { 14025 return ('' + this).match(nameRE)[1]; 14026 } catch (e) { 14027 return ''; 14028 } 14029 } 14030 }); 14031 14032 14033/***/ }), 14034/* 80 */ 14035/***/ (function(module, exports, __webpack_require__) { 14036 14037 'use strict'; 14038 var isObject = __webpack_require__(14); 14039 var getPrototypeOf = __webpack_require__(59); 14040 var HAS_INSTANCE = __webpack_require__(27)('hasInstance'); 14041 var FunctionProto = Function.prototype; 14042 // 19.2.3.6 Function.prototype[@@hasInstance](V) 14043 if (!(HAS_INSTANCE in FunctionProto)) __webpack_require__(12).f(FunctionProto, HAS_INSTANCE, { value: function (O) { 14044 if (typeof this != 'function' || !isObject(O)) return false; 14045 if (!isObject(this.prototype)) return O instanceof this; 14046 // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this: 14047 while (O = getPrototypeOf(O)) if (this.prototype === O) return true; 14048 return false; 14049 } }); 14050 14051 14052/***/ }), 14053/* 81 */ 14054/***/ (function(module, exports, __webpack_require__) { 14055 14056 var $export = __webpack_require__(9); 14057 var $parseInt = __webpack_require__(82); 14058 // 18.2.5 parseInt(string, radix) 14059 $export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt }); 14060 14061 14062/***/ }), 14063/* 82 */ 14064/***/ (function(module, exports, __webpack_require__) { 14065 14066 var $parseInt = __webpack_require__(5).parseInt; 14067 var $trim = __webpack_require__(83).trim; 14068 var ws = __webpack_require__(84); 14069 var hex = /^[-+]?0[xX]/; 14070 14071 module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) { 14072 var string = $trim(String(str), 3); 14073 return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10)); 14074 } : $parseInt; 14075 14076 14077/***/ }), 14078/* 83 */ 14079/***/ (function(module, exports, __webpack_require__) { 14080 14081 var $export = __webpack_require__(9); 14082 var defined = __webpack_require__(36); 14083 var fails = __webpack_require__(8); 14084 var spaces = __webpack_require__(84); 14085 var space = '[' + spaces + ']'; 14086 var non = '\u200b\u0085'; 14087 var ltrim = RegExp('^' + space + space + '*'); 14088 var rtrim = RegExp(space + space + '*$'); 14089 14090 var exporter = function (KEY, exec, ALIAS) { 14091 var exp = {}; 14092 var FORCE = fails(function () { 14093 return !!spaces[KEY]() || non[KEY]() != non; 14094 }); 14095 var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY]; 14096 if (ALIAS) exp[ALIAS] = fn; 14097 $export($export.P + $export.F * FORCE, 'String', exp); 14098 }; 14099 14100 // 1 -> String#trimLeft 14101 // 2 -> String#trimRight 14102 // 3 -> String#trim 14103 var trim = exporter.trim = function (string, TYPE) { 14104 string = String(defined(string)); 14105 if (TYPE & 1) string = string.replace(ltrim, ''); 14106 if (TYPE & 2) string = string.replace(rtrim, ''); 14107 return string; 14108 }; 14109 14110 module.exports = exporter; 14111 14112 14113/***/ }), 14114/* 84 */ 14115/***/ (function(module, exports) { 14116 14117 module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' + 14118 '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; 14119 14120 14121/***/ }), 14122/* 85 */ 14123/***/ (function(module, exports, __webpack_require__) { 14124 14125 var $export = __webpack_require__(9); 14126 var $parseFloat = __webpack_require__(86); 14127 // 18.2.4 parseFloat(string) 14128 $export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat }); 14129 14130 14131/***/ }), 14132/* 86 */ 14133/***/ (function(module, exports, __webpack_require__) { 14134 14135 var $parseFloat = __webpack_require__(5).parseFloat; 14136 var $trim = __webpack_require__(83).trim; 14137 14138 module.exports = 1 / $parseFloat(__webpack_require__(84) + '-0') !== -Infinity ? function parseFloat(str) { 14139 var string = $trim(String(str), 3); 14140 var result = $parseFloat(string); 14141 return result === 0 && string.charAt(0) == '-' ? -0 : result; 14142 } : $parseFloat; 14143 14144 14145/***/ }), 14146/* 87 */ 14147/***/ (function(module, exports, __webpack_require__) { 14148 14149 'use strict'; 14150 var global = __webpack_require__(5); 14151 var has = __webpack_require__(6); 14152 var cof = __webpack_require__(35); 14153 var inheritIfRequired = __webpack_require__(88); 14154 var toPrimitive = __webpack_require__(17); 14155 var fails = __webpack_require__(8); 14156 var gOPN = __webpack_require__(50).f; 14157 var gOPD = __webpack_require__(51).f; 14158 var dP = __webpack_require__(12).f; 14159 var $trim = __webpack_require__(83).trim; 14160 var NUMBER = 'Number'; 14161 var $Number = global[NUMBER]; 14162 var Base = $Number; 14163 var proto = $Number.prototype; 14164 // Opera ~12 has broken Object#toString 14165 var BROKEN_COF = cof(__webpack_require__(46)(proto)) == NUMBER; 14166 var TRIM = 'trim' in String.prototype; 14167 14168 // 7.1.3 ToNumber(argument) 14169 var toNumber = function (argument) { 14170 var it = toPrimitive(argument, false); 14171 if (typeof it == 'string' && it.length > 2) { 14172 it = TRIM ? it.trim() : $trim(it, 3); 14173 var first = it.charCodeAt(0); 14174 var third, radix, maxCode; 14175 if (first === 43 || first === 45) { 14176 third = it.charCodeAt(2); 14177 if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix 14178 } else if (first === 48) { 14179 switch (it.charCodeAt(1)) { 14180 case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i 14181 case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i 14182 default: return +it; 14183 } 14184 for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) { 14185 code = digits.charCodeAt(i); 14186 // parseInt parses a string to a first unavailable symbol 14187 // but ToNumber should return NaN if a string contains unavailable symbols 14188 if (code < 48 || code > maxCode) return NaN; 14189 } return parseInt(digits, radix); 14190 } 14191 } return +it; 14192 }; 14193 14194 if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) { 14195 $Number = function Number(value) { 14196 var it = arguments.length < 1 ? 0 : value; 14197 var that = this; 14198 return that instanceof $Number 14199 // check on 1..constructor(foo) case 14200 && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER) 14201 ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it); 14202 }; 14203 for (var keys = __webpack_require__(7) ? gOPN(Base) : ( 14204 // ES3: 14205 'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' + 14206 // ES6 (in case, if modules with ES6 Number statics required before): 14207 'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' + 14208 'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger' 14209 ).split(','), j = 0, key; keys.length > j; j++) { 14210 if (has(Base, key = keys[j]) && !has($Number, key)) { 14211 dP($Number, key, gOPD(Base, key)); 14212 } 14213 } 14214 $Number.prototype = proto; 14215 proto.constructor = $Number; 14216 __webpack_require__(19)(global, NUMBER, $Number); 14217 } 14218 14219 14220/***/ }), 14221/* 88 */ 14222/***/ (function(module, exports, __webpack_require__) { 14223 14224 var isObject = __webpack_require__(14); 14225 var setPrototypeOf = __webpack_require__(73).set; 14226 module.exports = function (that, target, C) { 14227 var S = target.constructor; 14228 var P; 14229 if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) { 14230 setPrototypeOf(that, P); 14231 } return that; 14232 }; 14233 14234 14235/***/ }), 14236/* 89 */ 14237/***/ (function(module, exports, __webpack_require__) { 14238 14239 'use strict'; 14240 var $export = __webpack_require__(9); 14241 var toInteger = __webpack_require__(39); 14242 var aNumberValue = __webpack_require__(90); 14243 var repeat = __webpack_require__(91); 14244 var $toFixed = 1.0.toFixed; 14245 var floor = Math.floor; 14246 var data = [0, 0, 0, 0, 0, 0]; 14247 var ERROR = 'Number.toFixed: incorrect invocation!'; 14248 var ZERO = '0'; 14249 14250 var multiply = function (n, c) { 14251 var i = -1; 14252 var c2 = c; 14253 while (++i < 6) { 14254 c2 += n * data[i]; 14255 data[i] = c2 % 1e7; 14256 c2 = floor(c2 / 1e7); 14257 } 14258 }; 14259 var divide = function (n) { 14260 var i = 6; 14261 var c = 0; 14262 while (--i >= 0) { 14263 c += data[i]; 14264 data[i] = floor(c / n); 14265 c = (c % n) * 1e7; 14266 } 14267 }; 14268 var numToString = function () { 14269 var i = 6; 14270 var s = ''; 14271 while (--i >= 0) { 14272 if (s !== '' || i === 0 || data[i] !== 0) { 14273 var t = String(data[i]); 14274 s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t; 14275 } 14276 } return s; 14277 }; 14278 var pow = function (x, n, acc) { 14279 return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc); 14280 }; 14281 var log = function (x) { 14282 var n = 0; 14283 var x2 = x; 14284 while (x2 >= 4096) { 14285 n += 12; 14286 x2 /= 4096; 14287 } 14288 while (x2 >= 2) { 14289 n += 1; 14290 x2 /= 2; 14291 } return n; 14292 }; 14293 14294 $export($export.P + $export.F * (!!$toFixed && ( 14295 0.00008.toFixed(3) !== '0.000' || 14296 0.9.toFixed(0) !== '1' || 14297 1.255.toFixed(2) !== '1.25' || 14298 1000000000000000128.0.toFixed(0) !== '1000000000000000128' 14299 ) || !__webpack_require__(8)(function () { 14300 // V8 ~ Android 4.3- 14301 $toFixed.call({}); 14302 })), 'Number', { 14303 toFixed: function toFixed(fractionDigits) { 14304 var x = aNumberValue(this, ERROR); 14305 var f = toInteger(fractionDigits); 14306 var s = ''; 14307 var m = ZERO; 14308 var e, z, j, k; 14309 if (f < 0 || f > 20) throw RangeError(ERROR); 14310 // eslint-disable-next-line no-self-compare 14311 if (x != x) return 'NaN'; 14312 if (x <= -1e21 || x >= 1e21) return String(x); 14313 if (x < 0) { 14314 s = '-'; 14315 x = -x; 14316 } 14317 if (x > 1e-21) { 14318 e = log(x * pow(2, 69, 1)) - 69; 14319 z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1); 14320 z *= 0x10000000000000; 14321 e = 52 - e; 14322 if (e > 0) { 14323 multiply(0, z); 14324 j = f; 14325 while (j >= 7) { 14326 multiply(1e7, 0); 14327 j -= 7; 14328 } 14329 multiply(pow(10, j, 1), 0); 14330 j = e - 1; 14331 while (j >= 23) { 14332 divide(1 << 23); 14333 j -= 23; 14334 } 14335 divide(1 << j); 14336 multiply(1, 1); 14337 divide(2); 14338 m = numToString(); 14339 } else { 14340 multiply(0, z); 14341 multiply(1 << -e, 0); 14342 m = numToString() + repeat.call(ZERO, f); 14343 } 14344 } 14345 if (f > 0) { 14346 k = m.length; 14347 m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f)); 14348 } else { 14349 m = s + m; 14350 } return m; 14351 } 14352 }); 14353 14354 14355/***/ }), 14356/* 90 */ 14357/***/ (function(module, exports, __webpack_require__) { 14358 14359 var cof = __webpack_require__(35); 14360 module.exports = function (it, msg) { 14361 if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg); 14362 return +it; 14363 }; 14364 14365 14366/***/ }), 14367/* 91 */ 14368/***/ (function(module, exports, __webpack_require__) { 14369 14370 'use strict'; 14371 var toInteger = __webpack_require__(39); 14372 var defined = __webpack_require__(36); 14373 14374 module.exports = function repeat(count) { 14375 var str = String(defined(this)); 14376 var res = ''; 14377 var n = toInteger(count); 14378 if (n < 0 || n == Infinity) throw RangeError("Count can't be negative"); 14379 for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str; 14380 return res; 14381 }; 14382 14383 14384/***/ }), 14385/* 92 */ 14386/***/ (function(module, exports, __webpack_require__) { 14387 14388 'use strict'; 14389 var $export = __webpack_require__(9); 14390 var $fails = __webpack_require__(8); 14391 var aNumberValue = __webpack_require__(90); 14392 var $toPrecision = 1.0.toPrecision; 14393 14394 $export($export.P + $export.F * ($fails(function () { 14395 // IE7- 14396 return $toPrecision.call(1, undefined) !== '1'; 14397 }) || !$fails(function () { 14398 // V8 ~ Android 4.3- 14399 $toPrecision.call({}); 14400 })), 'Number', { 14401 toPrecision: function toPrecision(precision) { 14402 var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!'); 14403 return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision); 14404 } 14405 }); 14406 14407 14408/***/ }), 14409/* 93 */ 14410/***/ (function(module, exports, __webpack_require__) { 14411 14412 // 20.1.2.1 Number.EPSILON 14413 var $export = __webpack_require__(9); 14414 14415 $export($export.S, 'Number', { EPSILON: Math.pow(2, -52) }); 14416 14417 14418/***/ }), 14419/* 94 */ 14420/***/ (function(module, exports, __webpack_require__) { 14421 14422 // 20.1.2.2 Number.isFinite(number) 14423 var $export = __webpack_require__(9); 14424 var _isFinite = __webpack_require__(5).isFinite; 14425 14426 $export($export.S, 'Number', { 14427 isFinite: function isFinite(it) { 14428 return typeof it == 'number' && _isFinite(it); 14429 } 14430 }); 14431 14432 14433/***/ }), 14434/* 95 */ 14435/***/ (function(module, exports, __webpack_require__) { 14436 14437 // 20.1.2.3 Number.isInteger(number) 14438 var $export = __webpack_require__(9); 14439 14440 $export($export.S, 'Number', { isInteger: __webpack_require__(96) }); 14441 14442 14443/***/ }), 14444/* 96 */ 14445/***/ (function(module, exports, __webpack_require__) { 14446 14447 // 20.1.2.3 Number.isInteger(number) 14448 var isObject = __webpack_require__(14); 14449 var floor = Math.floor; 14450 module.exports = function isInteger(it) { 14451 return !isObject(it) && isFinite(it) && floor(it) === it; 14452 }; 14453 14454 14455/***/ }), 14456/* 97 */ 14457/***/ (function(module, exports, __webpack_require__) { 14458 14459 // 20.1.2.4 Number.isNaN(number) 14460 var $export = __webpack_require__(9); 14461 14462 $export($export.S, 'Number', { 14463 isNaN: function isNaN(number) { 14464 // eslint-disable-next-line no-self-compare 14465 return number != number; 14466 } 14467 }); 14468 14469 14470/***/ }), 14471/* 98 */ 14472/***/ (function(module, exports, __webpack_require__) { 14473 14474 // 20.1.2.5 Number.isSafeInteger(number) 14475 var $export = __webpack_require__(9); 14476 var isInteger = __webpack_require__(96); 14477 var abs = Math.abs; 14478 14479 $export($export.S, 'Number', { 14480 isSafeInteger: function isSafeInteger(number) { 14481 return isInteger(number) && abs(number) <= 0x1fffffffffffff; 14482 } 14483 }); 14484 14485 14486/***/ }), 14487/* 99 */ 14488/***/ (function(module, exports, __webpack_require__) { 14489 14490 // 20.1.2.6 Number.MAX_SAFE_INTEGER 14491 var $export = __webpack_require__(9); 14492 14493 $export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff }); 14494 14495 14496/***/ }), 14497/* 100 */ 14498/***/ (function(module, exports, __webpack_require__) { 14499 14500 // 20.1.2.10 Number.MIN_SAFE_INTEGER 14501 var $export = __webpack_require__(9); 14502 14503 $export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff }); 14504 14505 14506/***/ }), 14507/* 101 */ 14508/***/ (function(module, exports, __webpack_require__) { 14509 14510 var $export = __webpack_require__(9); 14511 var $parseFloat = __webpack_require__(86); 14512 // 20.1.2.12 Number.parseFloat(string) 14513 $export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat }); 14514 14515 14516/***/ }), 14517/* 102 */ 14518/***/ (function(module, exports, __webpack_require__) { 14519 14520 var $export = __webpack_require__(9); 14521 var $parseInt = __webpack_require__(82); 14522 // 20.1.2.13 Number.parseInt(string, radix) 14523 $export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt }); 14524 14525 14526/***/ }), 14527/* 103 */ 14528/***/ (function(module, exports, __webpack_require__) { 14529 14530 // 20.2.2.3 Math.acosh(x) 14531 var $export = __webpack_require__(9); 14532 var log1p = __webpack_require__(104); 14533 var sqrt = Math.sqrt; 14534 var $acosh = Math.acosh; 14535 14536 $export($export.S + $export.F * !($acosh 14537 // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509 14538 && Math.floor($acosh(Number.MAX_VALUE)) == 710 14539 // Tor Browser bug: Math.acosh(Infinity) -> NaN 14540 && $acosh(Infinity) == Infinity 14541 ), 'Math', { 14542 acosh: function acosh(x) { 14543 return (x = +x) < 1 ? NaN : x > 94906265.62425156 14544 ? Math.log(x) + Math.LN2 14545 : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1)); 14546 } 14547 }); 14548 14549 14550/***/ }), 14551/* 104 */ 14552/***/ (function(module, exports) { 14553 14554 // 20.2.2.20 Math.log1p(x) 14555 module.exports = Math.log1p || function log1p(x) { 14556 return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x); 14557 }; 14558 14559 14560/***/ }), 14561/* 105 */ 14562/***/ (function(module, exports, __webpack_require__) { 14563 14564 // 20.2.2.5 Math.asinh(x) 14565 var $export = __webpack_require__(9); 14566 var $asinh = Math.asinh; 14567 14568 function asinh(x) { 14569 return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1)); 14570 } 14571 14572 // Tor Browser bug: Math.asinh(0) -> -0 14573 $export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh }); 14574 14575 14576/***/ }), 14577/* 106 */ 14578/***/ (function(module, exports, __webpack_require__) { 14579 14580 // 20.2.2.7 Math.atanh(x) 14581 var $export = __webpack_require__(9); 14582 var $atanh = Math.atanh; 14583 14584 // Tor Browser bug: Math.atanh(-0) -> 0 14585 $export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', { 14586 atanh: function atanh(x) { 14587 return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2; 14588 } 14589 }); 14590 14591 14592/***/ }), 14593/* 107 */ 14594/***/ (function(module, exports, __webpack_require__) { 14595 14596 // 20.2.2.9 Math.cbrt(x) 14597 var $export = __webpack_require__(9); 14598 var sign = __webpack_require__(108); 14599 14600 $export($export.S, 'Math', { 14601 cbrt: function cbrt(x) { 14602 return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3); 14603 } 14604 }); 14605 14606 14607/***/ }), 14608/* 108 */ 14609/***/ (function(module, exports) { 14610 14611 // 20.2.2.28 Math.sign(x) 14612 module.exports = Math.sign || function sign(x) { 14613 // eslint-disable-next-line no-self-compare 14614 return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1; 14615 }; 14616 14617 14618/***/ }), 14619/* 109 */ 14620/***/ (function(module, exports, __webpack_require__) { 14621 14622 // 20.2.2.11 Math.clz32(x) 14623 var $export = __webpack_require__(9); 14624 14625 $export($export.S, 'Math', { 14626 clz32: function clz32(x) { 14627 return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32; 14628 } 14629 }); 14630 14631 14632/***/ }), 14633/* 110 */ 14634/***/ (function(module, exports, __webpack_require__) { 14635 14636 // 20.2.2.12 Math.cosh(x) 14637 var $export = __webpack_require__(9); 14638 var exp = Math.exp; 14639 14640 $export($export.S, 'Math', { 14641 cosh: function cosh(x) { 14642 return (exp(x = +x) + exp(-x)) / 2; 14643 } 14644 }); 14645 14646 14647/***/ }), 14648/* 111 */ 14649/***/ (function(module, exports, __webpack_require__) { 14650 14651 // 20.2.2.14 Math.expm1(x) 14652 var $export = __webpack_require__(9); 14653 var $expm1 = __webpack_require__(112); 14654 14655 $export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 }); 14656 14657 14658/***/ }), 14659/* 112 */ 14660/***/ (function(module, exports) { 14661 14662 // 20.2.2.14 Math.expm1(x) 14663 var $expm1 = Math.expm1; 14664 module.exports = (!$expm1 14665 // Old FF bug 14666 || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168 14667 // Tor Browser bug 14668 || $expm1(-2e-17) != -2e-17 14669 ) ? function expm1(x) { 14670 return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1; 14671 } : $expm1; 14672 14673 14674/***/ }), 14675/* 113 */ 14676/***/ (function(module, exports, __webpack_require__) { 14677 14678 // 20.2.2.16 Math.fround(x) 14679 var $export = __webpack_require__(9); 14680 14681 $export($export.S, 'Math', { fround: __webpack_require__(114) }); 14682 14683 14684/***/ }), 14685/* 114 */ 14686/***/ (function(module, exports, __webpack_require__) { 14687 14688 // 20.2.2.16 Math.fround(x) 14689 var sign = __webpack_require__(108); 14690 var pow = Math.pow; 14691 var EPSILON = pow(2, -52); 14692 var EPSILON32 = pow(2, -23); 14693 var MAX32 = pow(2, 127) * (2 - EPSILON32); 14694 var MIN32 = pow(2, -126); 14695 14696 var roundTiesToEven = function (n) { 14697 return n + 1 / EPSILON - 1 / EPSILON; 14698 }; 14699 14700 module.exports = Math.fround || function fround(x) { 14701 var $abs = Math.abs(x); 14702 var $sign = sign(x); 14703 var a, result; 14704 if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32; 14705 a = (1 + EPSILON32 / EPSILON) * $abs; 14706 result = a - (a - $abs); 14707 // eslint-disable-next-line no-self-compare 14708 if (result > MAX32 || result != result) return $sign * Infinity; 14709 return $sign * result; 14710 }; 14711 14712 14713/***/ }), 14714/* 115 */ 14715/***/ (function(module, exports, __webpack_require__) { 14716 14717 // 20.2.2.17 Math.hypot([value1[, value2[, ⦠]]]) 14718 var $export = __webpack_require__(9); 14719 var abs = Math.abs; 14720 14721 $export($export.S, 'Math', { 14722 hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars 14723 var sum = 0; 14724 var i = 0; 14725 var aLen = arguments.length; 14726 var larg = 0; 14727 var arg, div; 14728 while (i < aLen) { 14729 arg = abs(arguments[i++]); 14730 if (larg < arg) { 14731 div = larg / arg; 14732 sum = sum * div * div + 1; 14733 larg = arg; 14734 } else if (arg > 0) { 14735 div = arg / larg; 14736 sum += div * div; 14737 } else sum += arg; 14738 } 14739 return larg === Infinity ? Infinity : larg * Math.sqrt(sum); 14740 } 14741 }); 14742 14743 14744/***/ }), 14745/* 116 */ 14746/***/ (function(module, exports, __webpack_require__) { 14747 14748 // 20.2.2.18 Math.imul(x, y) 14749 var $export = __webpack_require__(9); 14750 var $imul = Math.imul; 14751 14752 // some WebKit versions fails with big numbers, some has wrong arity 14753 $export($export.S + $export.F * __webpack_require__(8)(function () { 14754 return $imul(0xffffffff, 5) != -5 || $imul.length != 2; 14755 }), 'Math', { 14756 imul: function imul(x, y) { 14757 var UINT16 = 0xffff; 14758 var xn = +x; 14759 var yn = +y; 14760 var xl = UINT16 & xn; 14761 var yl = UINT16 & yn; 14762 return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0); 14763 } 14764 }); 14765 14766 14767/***/ }), 14768/* 117 */ 14769/***/ (function(module, exports, __webpack_require__) { 14770 14771 // 20.2.2.21 Math.log10(x) 14772 var $export = __webpack_require__(9); 14773 14774 $export($export.S, 'Math', { 14775 log10: function log10(x) { 14776 return Math.log(x) * Math.LOG10E; 14777 } 14778 }); 14779 14780 14781/***/ }), 14782/* 118 */ 14783/***/ (function(module, exports, __webpack_require__) { 14784 14785 // 20.2.2.20 Math.log1p(x) 14786 var $export = __webpack_require__(9); 14787 14788 $export($export.S, 'Math', { log1p: __webpack_require__(104) }); 14789 14790 14791/***/ }), 14792/* 119 */ 14793/***/ (function(module, exports, __webpack_require__) { 14794 14795 // 20.2.2.22 Math.log2(x) 14796 var $export = __webpack_require__(9); 14797 14798 $export($export.S, 'Math', { 14799 log2: function log2(x) { 14800 return Math.log(x) / Math.LN2; 14801 } 14802 }); 14803 14804 14805/***/ }), 14806/* 120 */ 14807/***/ (function(module, exports, __webpack_require__) { 14808 14809 // 20.2.2.28 Math.sign(x) 14810 var $export = __webpack_require__(9); 14811 14812 $export($export.S, 'Math', { sign: __webpack_require__(108) }); 14813 14814 14815/***/ }), 14816/* 121 */ 14817/***/ (function(module, exports, __webpack_require__) { 14818 14819 // 20.2.2.30 Math.sinh(x) 14820 var $export = __webpack_require__(9); 14821 var expm1 = __webpack_require__(112); 14822 var exp = Math.exp; 14823 14824 // V8 near Chromium 38 has a problem with very small numbers 14825 $export($export.S + $export.F * __webpack_require__(8)(function () { 14826 return !Math.sinh(-2e-17) != -2e-17; 14827 }), 'Math', { 14828 sinh: function sinh(x) { 14829 return Math.abs(x = +x) < 1 14830 ? (expm1(x) - expm1(-x)) / 2 14831 : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2); 14832 } 14833 }); 14834 14835 14836/***/ }), 14837/* 122 */ 14838/***/ (function(module, exports, __webpack_require__) { 14839 14840 // 20.2.2.33 Math.tanh(x) 14841 var $export = __webpack_require__(9); 14842 var expm1 = __webpack_require__(112); 14843 var exp = Math.exp; 14844 14845 $export($export.S, 'Math', { 14846 tanh: function tanh(x) { 14847 var a = expm1(x = +x); 14848 var b = expm1(-x); 14849 return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x)); 14850 } 14851 }); 14852 14853 14854/***/ }), 14855/* 123 */ 14856/***/ (function(module, exports, __webpack_require__) { 14857 14858 // 20.2.2.34 Math.trunc(x) 14859 var $export = __webpack_require__(9); 14860 14861 $export($export.S, 'Math', { 14862 trunc: function trunc(it) { 14863 return (it > 0 ? Math.floor : Math.ceil)(it); 14864 } 14865 }); 14866 14867 14868/***/ }), 14869/* 124 */ 14870/***/ (function(module, exports, __webpack_require__) { 14871 14872 var $export = __webpack_require__(9); 14873 var toAbsoluteIndex = __webpack_require__(40); 14874 var fromCharCode = String.fromCharCode; 14875 var $fromCodePoint = String.fromCodePoint; 14876 14877 // length should be 1, old FF problem 14878 $export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { 14879 // 21.1.2.2 String.fromCodePoint(...codePoints) 14880 fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars 14881 var res = []; 14882 var aLen = arguments.length; 14883 var i = 0; 14884 var code; 14885 while (aLen > i) { 14886 code = +arguments[i++]; 14887 if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point'); 14888 res.push(code < 0x10000 14889 ? fromCharCode(code) 14890 : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00) 14891 ); 14892 } return res.join(''); 14893 } 14894 }); 14895 14896 14897/***/ }), 14898/* 125 */ 14899/***/ (function(module, exports, __webpack_require__) { 14900 14901 var $export = __webpack_require__(9); 14902 var toIObject = __webpack_require__(33); 14903 var toLength = __webpack_require__(38); 14904 14905 $export($export.S, 'String', { 14906 // 21.1.2.4 String.raw(callSite, ...substitutions) 14907 raw: function raw(callSite) { 14908 var tpl = toIObject(callSite.raw); 14909 var len = toLength(tpl.length); 14910 var aLen = arguments.length; 14911 var res = []; 14912 var i = 0; 14913 while (len > i) { 14914 res.push(String(tpl[i++])); 14915 if (i < aLen) res.push(String(arguments[i])); 14916 } return res.join(''); 14917 } 14918 }); 14919 14920 14921/***/ }), 14922/* 126 */ 14923/***/ (function(module, exports, __webpack_require__) { 14924 14925 'use strict'; 14926 // 21.1.3.25 String.prototype.trim() 14927 __webpack_require__(83)('trim', function ($trim) { 14928 return function trim() { 14929 return $trim(this, 3); 14930 }; 14931 }); 14932 14933 14934/***/ }), 14935/* 127 */ 14936/***/ (function(module, exports, __webpack_require__) { 14937 14938 'use strict'; 14939 var $at = __webpack_require__(128)(true); 14940 14941 // 21.1.3.27 String.prototype[@@iterator]() 14942 __webpack_require__(129)(String, 'String', function (iterated) { 14943 this._t = String(iterated); // target 14944 this._i = 0; // next index 14945 // 21.1.5.2.1 %StringIteratorPrototype%.next() 14946 }, function () { 14947 var O = this._t; 14948 var index = this._i; 14949 var point; 14950 if (index >= O.length) return { value: undefined, done: true }; 14951 point = $at(O, index); 14952 this._i += point.length; 14953 return { value: point, done: false }; 14954 }); 14955 14956 14957/***/ }), 14958/* 128 */ 14959/***/ (function(module, exports, __webpack_require__) { 14960 14961 var toInteger = __webpack_require__(39); 14962 var defined = __webpack_require__(36); 14963 // true -> String#at 14964 // false ->
vendor: 1,840 bytes, lines 14964-15013
14964 String#codePointAt 14965 module.exports = function (TO_STRING) { 14966 return function (that, pos) { 14967 var s = String(defined(that)); 14968 var i = toInteger(pos); 14969 var l = s.length; 14970 var a, b; 14971 if (i < 0 || i >= l) return TO_STRING ? '' : undefined; 14972 a = s.charCodeAt(i); 14973 return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff 14974 ? TO_STRING ? s.charAt(i) : a 14975 : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; 14976 }; 14977 }; 14978 14979 14980/***/ }), 14981/* 129 */ 14982/***/ (function(module, exports, __webpack_require__) { 14983 14984 'use strict'; 14985 var LIBRARY = __webpack_require__(25); 14986 var $export = __webpack_require__(9); 14987 var redefine = __webpack_require__(19); 14988 var hide = __webpack_require__(11); 14989 var Iterators = __webpack_require__(130); 14990 var $iterCreate = __webpack_require__(131); 14991 var setToStringTag = __webpack_require__(26); 14992 var getPrototypeOf = __webpack_require__(59); 14993 var ITERATOR = __webpack_require__(27)('iterator'); 14994 var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` 14995 var FF_ITERATOR = '@@iterator'; 14996 var KEYS = 'keys'; 14997 var VALUES = 'values'; 14998 14999 var returnThis = function () { return this; }; 15000 15001 module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { 15002 $iterCreate(Constructor, NAME, next); 15003 var getMethod = function (kind) { 15004 if (!BUGGY && kind in proto) return proto[kind]; 15005 switch (kind) { 15006 case KEYS: return function keys() { return new Constructor(this, kind); }; 15007 case VALUES: return function values() { return new Constructor(this, kind); }; 15008 } return function entries() { return new Constructor(this, kind); }; 15009 }; 15010 var TAG = NAME + ' Iterator'; 15011 var DEF_VALUES = DEFAULT == VALUES; 15012 var VALUES_BUG = false; 15013 var proto = Base.prototype;
vendor: 69,271 bytes, lines 15014-17235
15014 var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; 15015 var $default = $native || getMethod(DEFAULT); 15016 var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; 15017 var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; 15018 var methods, key, IteratorPrototype; 15019 // Fix native 15020 if ($anyNative) { 15021 IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); 15022 if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { 15023 // Set @@toStringTag to native iterators 15024 setToStringTag(IteratorPrototype, TAG, true); 15025 // fix for some old engines 15026 if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis); 15027 } 15028 } 15029 // fix Array#{values, @@iterator}.name in V8 / FF 15030 if (DEF_VALUES && $native && $native.name !== VALUES) { 15031 VALUES_BUG = true; 15032 $default = function values() { return $native.call(this); }; 15033 } 15034 // Define iterator 15035 if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { 15036 hide(proto, ITERATOR, $default); 15037 } 15038 // Plug for library 15039 Iterators[NAME] = $default; 15040 Iterators[TAG] = returnThis; 15041 if (DEFAULT) { 15042 methods = { 15043 values: DEF_VALUES ? $default : getMethod(VALUES), 15044 keys: IS_SET ? $default : getMethod(KEYS), 15045 entries: $entries 15046 }; 15047 if (FORCED) for (key in methods) { 15048 if (!(key in proto)) redefine(proto, key, methods[key]); 15049 } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); 15050 } 15051 return methods; 15052 }; 15053 15054 15055/***/ }), 15056/* 130 */ 15057/***/ (function(module, exports) { 15058 15059 module.exports = {}; 15060 15061 15062/***/ }), 15063/* 131 */ 15064/***/ (function(module, exports, __webpack_require__) { 15065 15066 'use strict'; 15067 var create = __webpack_require__(46); 15068 var descriptor = __webpack_require__(18); 15069 var setToStringTag = __webpack_require__(26); 15070 var IteratorPrototype = {}; 15071 15072 // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() 15073 __webpack_require__(11)(IteratorPrototype, __webpack_require__(27)('iterator'), function () { return this; }); 15074 15075 module.exports = function (Constructor, NAME, next) { 15076 Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); 15077 setToStringTag(Constructor, NAME + ' Iterator'); 15078 }; 15079 15080 15081/***/ }), 15082/* 132 */ 15083/***/ (function(module, exports, __webpack_require__) { 15084 15085 'use strict'; 15086 var $export = __webpack_require__(9); 15087 var $at = __webpack_require__(128)(false); 15088 $export($export.P, 'String', { 15089 // 21.1.3.3 String.prototype.codePointAt(pos) 15090 codePointAt: function codePointAt(pos) { 15091 return $at(this, pos); 15092 } 15093 }); 15094 15095 15096/***/ }), 15097/* 133 */ 15098/***/ (function(module, exports, __webpack_require__) { 15099 15100 // 21.1.3.6 String.prototype.endsWith(searchString [, endPosition]) 15101 'use strict'; 15102 var $export = __webpack_require__(9); 15103 var toLength = __webpack_require__(38); 15104 var context = __webpack_require__(134); 15105 var ENDS_WITH = 'endsWith'; 15106 var $endsWith = ''[ENDS_WITH]; 15107 15108 $export($export.P + $export.F * __webpack_require__(136)(ENDS_WITH), 'String', { 15109 endsWith: function endsWith(searchString /* , endPosition = @length */) { 15110 var that = context(this, searchString, ENDS_WITH); 15111 var endPosition = arguments.length > 1 ? arguments[1] : undefined; 15112 var len = toLength(that.length); 15113 var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len); 15114 var search = String(searchString); 15115 return $endsWith 15116 ? $endsWith.call(that, search, end) 15117 : that.slice(end - search.length, end) === search; 15118 } 15119 }); 15120 15121 15122/***/ }), 15123/* 134 */ 15124/***/ (function(module, exports, __webpack_require__) { 15125 15126 // helper for String#{startsWith, endsWith, includes} 15127 var isRegExp = __webpack_require__(135); 15128 var defined = __webpack_require__(36); 15129 15130 module.exports = function (that, searchString, NAME) { 15131 if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!"); 15132 return String(defined(that)); 15133 }; 15134 15135 15136/***/ }), 15137/* 135 */ 15138/***/ (function(module, exports, __webpack_require__) { 15139 15140 // 7.2.8 IsRegExp(argument) 15141 var isObject = __webpack_require__(14); 15142 var cof = __webpack_require__(35); 15143 var MATCH = __webpack_require__(27)('match'); 15144 module.exports = function (it) { 15145 var isRegExp; 15146 return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); 15147 }; 15148 15149 15150/***/ }), 15151/* 136 */ 15152/***/ (function(module, exports, __webpack_require__) { 15153 15154 var MATCH = __webpack_require__(27)('match'); 15155 module.exports = function (KEY) { 15156 var re = /./; 15157 try { 15158 '/./'[KEY](re); 15159 } catch (e) { 15160 try { 15161 re[MATCH] = false; 15162 return !'/./'[KEY](re); 15163 } catch (f) { /* empty */ } 15164 } return true; 15165 }; 15166 15167 15168/***/ }), 15169/* 137 */ 15170/***/ (function(module, exports, __webpack_require__) { 15171 15172 // 21.1.3.7 String.prototype.includes(searchString, position = 0) 15173 'use strict'; 15174 var $export = __webpack_require__(9); 15175 var context = __webpack_require__(134); 15176 var INCLUDES = 'includes'; 15177 15178 $export($export.P + $export.F * __webpack_require__(136)(INCLUDES), 'String', { 15179 includes: function includes(searchString /* , position = 0 */) { 15180 return !!~context(this, searchString, INCLUDES) 15181 .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); 15182 } 15183 }); 15184 15185 15186/***/ }), 15187/* 138 */ 15188/***/ (function(module, exports, __webpack_require__) { 15189 15190 var $export = __webpack_require__(9); 15191 15192 $export($export.P, 'String', { 15193 // 21.1.3.13 String.prototype.repeat(count) 15194 repeat: __webpack_require__(91) 15195 }); 15196 15197 15198/***/ }), 15199/* 139 */ 15200/***/ (function(module, exports, __webpack_require__) { 15201 15202 // 21.1.3.18 String.prototype.startsWith(searchString [, position ]) 15203 'use strict'; 15204 var $export = __webpack_require__(9); 15205 var toLength = __webpack_require__(38); 15206 var context = __webpack_require__(134); 15207 var STARTS_WITH = 'startsWith'; 15208 var $startsWith = ''[STARTS_WITH]; 15209 15210 $export($export.P + $export.F * __webpack_require__(136)(STARTS_WITH), 'String', { 15211 startsWith: function startsWith(searchString /* , position = 0 */) { 15212 var that = context(this, searchString, STARTS_WITH); 15213 var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)); 15214 var search = String(searchString); 15215 return $startsWith 15216 ? $startsWith.call(that, search, index) 15217 : that.slice(index, index + search.length) === search; 15218 } 15219 }); 15220 15221 15222/***/ }), 15223/* 140 */ 15224/***/ (function(module, exports, __webpack_require__) { 15225 15226 'use strict'; 15227 // B.2.3.2 String.prototype.anchor(name) 15228 __webpack_require__(141)('anchor', function (createHTML) { 15229 return function anchor(name) { 15230 return createHTML(this, 'a', 'name', name); 15231 }; 15232 }); 15233 15234 15235/***/ }), 15236/* 141 */ 15237/***/ (function(module, exports, __webpack_require__) { 15238 15239 var $export = __webpack_require__(9); 15240 var fails = __webpack_require__(8); 15241 var defined = __webpack_require__(36); 15242 var quot = /"/g; 15243 // B.2.3.2.1 CreateHTML(string, tag, attribute, value) 15244 var createHTML = function (string, tag, attribute, value) { 15245 var S = String(defined(string)); 15246 var p1 = '<' + tag; 15247 if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '"') + '"'; 15248 return p1 + '>' + S + '</' + tag + '>'; 15249 }; 15250 module.exports = function (NAME, exec) { 15251 var O = {}; 15252 O[NAME] = exec(createHTML); 15253 $export($export.P + $export.F * fails(function () { 15254 var test = ''[NAME]('"'); 15255 return test !== test.toLowerCase() || test.split('"').length > 3; 15256 }), 'String', O); 15257 }; 15258 15259 15260/***/ }), 15261/* 142 */ 15262/***/ (function(module, exports, __webpack_require__) { 15263 15264 'use strict'; 15265 // B.2.3.3 String.prototype.big() 15266 __webpack_require__(141)('big', function (createHTML) { 15267 return function big() { 15268 return createHTML(this, 'big', '', ''); 15269 }; 15270 }); 15271 15272 15273/***/ }), 15274/* 143 */ 15275/***/ (function(module, exports, __webpack_require__) { 15276 15277 'use strict'; 15278 // B.2.3.4 String.prototype.blink() 15279 __webpack_require__(141)('blink', function (createHTML) { 15280 return function blink() { 15281 return createHTML(this, 'blink', '', ''); 15282 }; 15283 }); 15284 15285 15286/***/ }), 15287/* 144 */ 15288/***/ (function(module, exports, __webpack_require__) { 15289 15290 'use strict'; 15291 // B.2.3.5 String.prototype.bold() 15292 __webpack_require__(141)('bold', function (createHTML) { 15293 return function bold() { 15294 return createHTML(this, 'b', '', ''); 15295 }; 15296 }); 15297 15298 15299/***/ }), 15300/* 145 */ 15301/***/ (function(module, exports, __webpack_require__) { 15302 15303 'use strict'; 15304 // B.2.3.6 String.prototype.fixed() 15305 __webpack_require__(141)('fixed', function (createHTML) { 15306 return function fixed() { 15307 return createHTML(this, 'tt', '', ''); 15308 }; 15309 }); 15310 15311 15312/***/ }), 15313/* 146 */ 15314/***/ (function(module, exports, __webpack_require__) { 15315 15316 'use strict'; 15317 // B.2.3.7 String.prototype.fontcolor(color) 15318 __webpack_require__(141)('fontcolor', function (createHTML) { 15319 return function fontcolor(color) { 15320 return createHTML(this, 'font', 'color', color); 15321 }; 15322 }); 15323 15324 15325/***/ }), 15326/* 147 */ 15327/***/ (function(module, exports, __webpack_require__) { 15328 15329 'use strict'; 15330 // B.2.3.8 String.prototype.fontsize(size) 15331 __webpack_require__(141)('fontsize', function (createHTML) { 15332 return function fontsize(size) { 15333 return createHTML(this, 'font', 'size', size); 15334 }; 15335 }); 15336 15337 15338/***/ }), 15339/* 148 */ 15340/***/ (function(module, exports, __webpack_require__) { 15341 15342 'use strict'; 15343 // B.2.3.9 String.prototype.italics() 15344 __webpack_require__(141)('italics', function (createHTML) { 15345 return function italics() { 15346 return createHTML(this, 'i', '', ''); 15347 }; 15348 }); 15349 15350 15351/***/ }), 15352/* 149 */ 15353/***/ (function(module, exports, __webpack_require__) { 15354 15355 'use strict'; 15356 // B.2.3.10 String.prototype.link(url) 15357 __webpack_require__(141)('link', function (createHTML) { 15358 return function link(url) { 15359 return createHTML(this, 'a', 'href', url); 15360 }; 15361 }); 15362 15363 15364/***/ }), 15365/* 150 */ 15366/***/ (function(module, exports, __webpack_require__) { 15367 15368 'use strict'; 15369 // B.2.3.11 String.prototype.small() 15370 __webpack_require__(141)('small', function (createHTML) { 15371 return function small() { 15372 return createHTML(this, 'small', '', ''); 15373 }; 15374 }); 15375 15376 15377/***/ }), 15378/* 151 */ 15379/***/ (function(module, exports, __webpack_require__) { 15380 15381 'use strict'; 15382 // B.2.3.12 String.prototype.strike() 15383 __webpack_require__(141)('strike', function (createHTML) { 15384 return function strike() { 15385 return createHTML(this, 'strike', '', ''); 15386 }; 15387 }); 15388 15389 15390/***/ }), 15391/* 152 */ 15392/***/ (function(module, exports, __webpack_require__) { 15393 15394 'use strict'; 15395 // B.2.3.13 String.prototype.sub() 15396 __webpack_require__(141)('sub', function (createHTML) { 15397 return function sub() { 15398 return createHTML(this, 'sub', '', ''); 15399 }; 15400 }); 15401 15402 15403/***/ }), 15404/* 153 */ 15405/***/ (function(module, exports, __webpack_require__) { 15406 15407 'use strict'; 15408 // B.2.3.14 String.prototype.sup() 15409 __webpack_require__(141)('sup', function (createHTML) { 15410 return function sup() { 15411 return createHTML(this, 'sup', '', ''); 15412 }; 15413 }); 15414 15415 15416/***/ }), 15417/* 154 */ 15418/***/ (function(module, exports, __webpack_require__) { 15419 15420 // 20.3.3.1 / 15.9.4.4 Date.now() 15421 var $export = __webpack_require__(9); 15422 15423 $export($export.S, 'Date', { now: function () { return new Date().getTime(); } }); 15424 15425 15426/***/ }), 15427/* 155 */ 15428/***/ (function(module, exports, __webpack_require__) { 15429 15430 'use strict'; 15431 var $export = __webpack_require__(9); 15432 var toObject = __webpack_require__(58); 15433 var toPrimitive = __webpack_require__(17); 15434 15435 $export($export.P + $export.F * __webpack_require__(8)(function () { 15436 return new Date(NaN).toJSON() !== null 15437 || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1; 15438 }), 'Date', { 15439 // eslint-disable-next-line no-unused-vars 15440 toJSON: function toJSON(key) { 15441 var O = toObject(this); 15442 var pv = toPrimitive(O); 15443 return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString(); 15444 } 15445 }); 15446 15447 15448/***/ }), 15449/* 156 */ 15450/***/ (function(module, exports, __webpack_require__) { 15451 15452 // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() 15453 var $export = __webpack_require__(9); 15454 var toISOString = __webpack_require__(157); 15455 15456 // PhantomJS / old WebKit has a broken implementations 15457 $export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', { 15458 toISOString: toISOString 15459 }); 15460 15461 15462/***/ }), 15463/* 157 */ 15464/***/ (function(module, exports, __webpack_require__) { 15465 15466 'use strict'; 15467 // 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString() 15468 var fails = __webpack_require__(8); 15469 var getTime = Date.prototype.getTime; 15470 var $toISOString = Date.prototype.toISOString; 15471 15472 var lz = function (num) { 15473 return num > 9 ? num : '0' + num; 15474 }; 15475 15476 // PhantomJS / old WebKit has a broken implementations 15477 module.exports = (fails(function () { 15478 return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z'; 15479 }) || !fails(function () { 15480 $toISOString.call(new Date(NaN)); 15481 })) ? function toISOString() { 15482 if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value'); 15483 var d = this; 15484 var y = d.getUTCFullYear(); 15485 var m = d.getUTCMilliseconds(); 15486 var s = y < 0 ? '-' : y > 9999 ? '+' : ''; 15487 return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) + 15488 '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) + 15489 'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) + 15490 ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z'; 15491 } : $toISOString; 15492 15493 15494/***/ }), 15495/* 158 */ 15496/***/ (function(module, exports, __webpack_require__) { 15497 15498 var DateProto = Date.prototype; 15499 var INVALID_DATE = 'Invalid Date'; 15500 var TO_STRING = 'toString'; 15501 var $toString = DateProto[TO_STRING]; 15502 var getTime = DateProto.getTime; 15503 if (new Date(NaN) + '' != INVALID_DATE) { 15504 __webpack_require__(19)(DateProto, TO_STRING, function toString() { 15505 var value = getTime.call(this); 15506 // eslint-disable-next-line no-self-compare 15507 return value === value ? $toString.call(this) : INVALID_DATE; 15508 }); 15509 } 15510 15511 15512/***/ }), 15513/* 159 */ 15514/***/ (function(module, exports, __webpack_require__) { 15515 15516 var TO_PRIMITIVE = __webpack_require__(27)('toPrimitive'); 15517 var proto = Date.prototype; 15518 15519 if (!(TO_PRIMITIVE in proto)) __webpack_require__(11)(proto, TO_PRIMITIVE, __webpack_require__(160)); 15520 15521 15522/***/ }), 15523/* 160 */ 15524/***/ (function(module, exports, __webpack_require__) { 15525 15526 'use strict'; 15527 var anObject = __webpack_require__(13); 15528 var toPrimitive = __webpack_require__(17); 15529 var NUMBER = 'number'; 15530 15531 module.exports = function (hint) { 15532 if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint'); 15533 return toPrimitive(anObject(this), hint != NUMBER); 15534 }; 15535 15536 15537/***/ }), 15538/* 161 */ 15539/***/ (function(module, exports, __webpack_require__) { 15540 15541 // 22.1.2.2 / 15.4.3.2 Array.isArray(arg) 15542 var $export = __webpack_require__(9); 15543 15544 $export($export.S, 'Array', { isArray: __webpack_require__(45) }); 15545 15546 15547/***/ }), 15548/* 162 */ 15549/***/ (function(module, exports, __webpack_require__) { 15550 15551 'use strict'; 15552 var ctx = __webpack_require__(21); 15553 var $export = __webpack_require__(9); 15554 var toObject = __webpack_require__(58); 15555 var call = __webpack_require__(163); 15556 var isArrayIter = __webpack_require__(164); 15557 var toLength = __webpack_require__(38); 15558 var createProperty = __webpack_require__(165); 15559 var getIterFn = __webpack_require__(166); 15560 15561 $export($export.S + $export.F * !__webpack_require__(167)(function (iter) { Array.from(iter); }), 'Array', { 15562 // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) 15563 from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) { 15564 var O = toObject(arrayLike); 15565 var C = typeof this == 'function' ? this : Array; 15566 var aLen = arguments.length; 15567 var mapfn = aLen > 1 ? arguments[1] : undefined; 15568 var mapping = mapfn !== undefined; 15569 var index = 0; 15570 var iterFn = getIterFn(O); 15571 var length, result, step, iterator; 15572 if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); 15573 // if object isn't iterable or it's array with default iterator - use simple case 15574 if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) { 15575 for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { 15576 createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); 15577 } 15578 } else { 15579 length = toLength(O.length); 15580 for (result = new C(length); length > index; index++) { 15581 createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); 15582 } 15583 } 15584 result.length = index; 15585 return result; 15586 } 15587 }); 15588 15589 15590/***/ }), 15591/* 163 */ 15592/***/ (function(module, exports, __webpack_require__) { 15593 15594 // call something on iterator step with safe closing on error 15595 var anObject = __webpack_require__(13); 15596 module.exports = function (iterator, fn, value, entries) { 15597 try { 15598 return entries ? fn(anObject(value)[0], value[1]) : fn(value); 15599 // 7.4.6 IteratorClose(iterator, completion) 15600 } catch (e) { 15601 var ret = iterator['return']; 15602 if (ret !== undefined) anObject(ret.call(iterator)); 15603 throw e; 15604 } 15605 }; 15606 15607 15608/***/ }), 15609/* 164 */ 15610/***/ (function(module, exports, __webpack_require__) { 15611 15612 // check on default Array iterator 15613 var Iterators = __webpack_require__(130); 15614 var ITERATOR = __webpack_require__(27)('iterator'); 15615 var ArrayProto = Array.prototype; 15616 15617 module.exports = function (it) { 15618 return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); 15619 }; 15620 15621 15622/***/ }), 15623/* 165 */ 15624/***/ (function(module, exports, __webpack_require__) { 15625 15626 'use strict'; 15627 var $defineProperty = __webpack_require__(12); 15628 var createDesc = __webpack_require__(18); 15629 15630 module.exports = function (object, index, value) { 15631 if (index in object) $defineProperty.f(object, index, createDesc(0, value)); 15632 else object[index] = value; 15633 }; 15634 15635 15636/***/ }), 15637/* 166 */ 15638/***/ (function(module, exports, __webpack_require__) { 15639 15640 var classof = __webpack_require__(75); 15641 var ITERATOR = __webpack_require__(27)('iterator'); 15642 var Iterators = __webpack_require__(130); 15643 module.exports = __webpack_require__(10).getIteratorMethod = function (it) { 15644 if (it != undefined) return it[ITERATOR] 15645 || it['@@iterator'] 15646 || Iterators[classof(it)]; 15647 }; 15648 15649 15650/***/ }), 15651/* 167 */ 15652/***/ (function(module, exports, __webpack_require__) { 15653 15654 var ITERATOR = __webpack_require__(27)('iterator'); 15655 var SAFE_CLOSING = false; 15656 15657 try { 15658 var riter = [7][ITERATOR](); 15659 riter['return'] = function () { SAFE_CLOSING = true; }; 15660 // eslint-disable-next-line no-throw-literal 15661 Array.from(riter, function () { throw 2; }); 15662 } catch (e) { /* empty */ } 15663 15664 module.exports = function (exec, skipClosing) { 15665 if (!skipClosing && !SAFE_CLOSING) return false; 15666 var safe = false; 15667 try { 15668 var arr = [7]; 15669 var iter = arr[ITERATOR](); 15670 iter.next = function () { return { done: safe = true }; }; 15671 arr[ITERATOR] = function () { return iter; }; 15672 exec(arr); 15673 } catch (e) { /* empty */ } 15674 return safe; 15675 }; 15676 15677 15678/***/ }), 15679/* 168 */ 15680/***/ (function(module, exports, __webpack_require__) { 15681 15682 'use strict'; 15683 var $export = __webpack_require__(9); 15684 var createProperty = __webpack_require__(165); 15685 15686 // WebKit Array.of isn't generic 15687 $export($export.S + $export.F * __webpack_require__(8)(function () { 15688 function F() { /* empty */ } 15689 return !(Array.of.call(F) instanceof F); 15690 }), 'Array', { 15691 // 22.1.2.3 Array.of( ...items) 15692 of: function of(/* ...args */) { 15693 var index = 0; 15694 var aLen = arguments.length; 15695 var result = new (typeof this == 'function' ? this : Array)(aLen); 15696 while (aLen > index) createProperty(result, index, arguments[index++]); 15697 result.length = aLen; 15698 return result; 15699 } 15700 }); 15701 15702 15703/***/ }), 15704/* 169 */ 15705/***/ (function(module, exports, __webpack_require__) { 15706 15707 'use strict'; 15708 // 22.1.3.13 Array.prototype.join(separator) 15709 var $export = __webpack_require__(9); 15710 var toIObject = __webpack_require__(33); 15711 var arrayJoin = [].join; 15712 15713 // fallback for not array-like strings 15714 $export($export.P + $export.F * (__webpack_require__(34) != Object || !__webpack_require__(170)(arrayJoin)), 'Array', { 15715 join: function join(separator) { 15716 return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator); 15717 } 15718 }); 15719 15720 15721/***/ }), 15722/* 170 */ 15723/***/ (function(module, exports, __webpack_require__) { 15724 15725 'use strict'; 15726 var fails = __webpack_require__(8); 15727 15728 module.exports = function (method, arg) { 15729 return !!method && fails(function () { 15730 // eslint-disable-next-line no-useless-call 15731 arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null); 15732 }); 15733 }; 15734 15735 15736/***/ }), 15737/* 171 */ 15738/***/ (function(module, exports, __webpack_require__) { 15739 15740 'use strict'; 15741 var $export = __webpack_require__(9); 15742 var html = __webpack_require__(48); 15743 var cof = __webpack_require__(35); 15744 var toAbsoluteIndex = __webpack_require__(40); 15745 var toLength = __webpack_require__(38); 15746 var arraySlice = [].slice; 15747 15748 // fallback for not array-like ES3 strings and DOM objects 15749 $export($export.P + $export.F * __webpack_require__(8)(function () { 15750 if (html) arraySlice.call(html); 15751 }), 'Array', { 15752 slice: function slice(begin, end) { 15753 var len = toLength(this.length); 15754 var klass = cof(this); 15755 end = end === undefined ? len : end; 15756 if (klass == 'Array') return arraySlice.call(this, begin, end); 15757 var start = toAbsoluteIndex(begin, len); 15758 var upTo = toAbsoluteIndex(end, len); 15759 var size = toLength(upTo - start); 15760 var cloned = new Array(size); 15761 var i = 0; 15762 for (; i < size; i++) cloned[i] = klass == 'String' 15763 ? this.charAt(start + i) 15764 : this[start + i]; 15765 return cloned; 15766 } 15767 }); 15768 15769 15770/***/ }), 15771/* 172 */ 15772/***/ (function(module, exports, __webpack_require__) { 15773 15774 'use strict'; 15775 var $export = __webpack_require__(9); 15776 var aFunction = __webpack_require__(22); 15777 var toObject = __webpack_require__(58); 15778 var fails = __webpack_require__(8); 15779 var $sort = [].sort; 15780 var test = [1, 2, 3]; 15781 15782 $export($export.P + $export.F * (fails(function () { 15783 // IE8- 15784 test.sort(undefined); 15785 }) || !fails(function () { 15786 // V8 bug 15787 test.sort(null); 15788 // Old WebKit 15789 }) || !__webpack_require__(170)($sort)), 'Array', { 15790 // 22.1.3.25 Array.prototype.sort(comparefn) 15791 sort: function sort(comparefn) { 15792 return comparefn === undefined 15793 ? $sort.call(toObject(this)) 15794 : $sort.call(toObject(this), aFunction(comparefn)); 15795 } 15796 }); 15797 15798 15799/***/ }), 15800/* 173 */ 15801/***/ (function(module, exports, __webpack_require__) { 15802 15803 'use strict'; 15804 var $export = __webpack_require__(9); 15805 var $forEach = __webpack_require__(174)(0); 15806 var STRICT = __webpack_require__(170)([].forEach, true); 15807 15808 $export($export.P + $export.F * !STRICT, 'Array', { 15809 // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg]) 15810 forEach: function forEach(callbackfn /* , thisArg */) { 15811 return $forEach(this, callbackfn, arguments[1]); 15812 } 15813 }); 15814 15815 15816/***/ }), 15817/* 174 */ 15818/***/ (function(module, exports, __webpack_require__) { 15819 15820 // 0 -> Array#forEach 15821 // 1 -> Array#map 15822 // 2 -> Array#filter 15823 // 3 -> Array#some 15824 // 4 -> Array#every 15825 // 5 -> Array#find 15826 // 6 -> Array#findIndex 15827 var ctx = __webpack_require__(21); 15828 var IObject = __webpack_require__(34); 15829 var toObject = __webpack_require__(58); 15830 var toLength = __webpack_require__(38); 15831 var asc = __webpack_require__(175); 15832 module.exports = function (TYPE, $create) { 15833 var IS_MAP = TYPE == 1; 15834 var IS_FILTER = TYPE == 2; 15835 var IS_SOME = TYPE == 3; 15836 var IS_EVERY = TYPE == 4; 15837 var IS_FIND_INDEX = TYPE == 6; 15838 var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; 15839 var create = $create || asc; 15840 return function ($this, callbackfn, that) { 15841 var O = toObject($this); 15842 var self = IObject(O); 15843 var f = ctx(callbackfn, that, 3); 15844 var length = toLength(self.length); 15845 var index = 0; 15846 var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; 15847 var val, res; 15848 for (;length > index; index++) if (NO_HOLES || index in self) { 15849 val = self[index]; 15850 res = f(val, index, O); 15851 if (TYPE) { 15852 if (IS_MAP) result[index] = res; // map 15853 else if (res) switch (TYPE) { 15854 case 3: return true; // some 15855 case 5: return val; // find 15856 case 6: return index; // findIndex 15857 case 2: result.push(val); // filter 15858 } else if (IS_EVERY) return false; // every 15859 } 15860 } 15861 return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; 15862 }; 15863 }; 15864 15865 15866/***/ }), 15867/* 175 */ 15868/***/ (function(module, exports, __webpack_require__) { 15869 15870 // 9.4.2.3 ArraySpeciesCreate(originalArray, length) 15871 var speciesConstructor = __webpack_require__(176); 15872 15873 module.exports = function (original, length) { 15874 return new (speciesConstructor(original))(length); 15875 }; 15876 15877 15878/***/ }), 15879/* 176 */ 15880/***/ (function(module, exports, __webpack_require__) { 15881 15882 var isObject = __webpack_require__(14); 15883 var isArray = __webpack_require__(45); 15884 var SPECIES = __webpack_require__(27)('species'); 15885 15886 module.exports = function (original) { 15887 var C; 15888 if (isArray(original)) { 15889 C = original.constructor; 15890 // cross-realm fallback 15891 if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; 15892 if (isObject(C)) { 15893 C = C[SPECIES]; 15894 if (C === null) C = undefined; 15895 } 15896 } return C === undefined ? Array : C; 15897 }; 15898 15899 15900/***/ }), 15901/* 177 */ 15902/***/ (function(module, exports, __webpack_require__) { 15903 15904 'use strict'; 15905 var $export = __webpack_require__(9); 15906 var $map = __webpack_require__(174)(1); 15907 15908 $export($export.P + $export.F * !__webpack_require__(170)([].map, true), 'Array', { 15909 // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg]) 15910 map: function map(callbackfn /* , thisArg */) { 15911 return $map(this, callbackfn, arguments[1]); 15912 } 15913 }); 15914 15915 15916/***/ }), 15917/* 178 */ 15918/***/ (function(module, exports, __webpack_require__) { 15919 15920 'use strict'; 15921 var $export = __webpack_require__(9); 15922 var $filter = __webpack_require__(174)(2); 15923 15924 $export($export.P + $export.F * !__webpack_require__(170)([].filter, true), 'Array', { 15925 // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg]) 15926 filter: function filter(callbackfn /* , thisArg */) { 15927 return $filter(this, callbackfn, arguments[1]); 15928 } 15929 }); 15930 15931 15932/***/ }), 15933/* 179 */ 15934/***/ (function(module, exports, __webpack_require__) { 15935 15936 'use strict'; 15937 var $export = __webpack_require__(9); 15938 var $some = __webpack_require__(174)(3); 15939 15940 $export($export.P + $export.F * !__webpack_require__(170)([].some, true), 'Array', { 15941 // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg]) 15942 some: function some(callbackfn /* , thisArg */) { 15943 return $some(this, callbackfn, arguments[1]); 15944 } 15945 }); 15946 15947 15948/***/ }), 15949/* 180 */ 15950/***/ (function(module, exports, __webpack_require__) { 15951 15952 'use strict'; 15953 var $export = __webpack_require__(9); 15954 var $every = __webpack_require__(174)(4); 15955 15956 $export($export.P + $export.F * !__webpack_require__(170)([].every, true), 'Array', { 15957 // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg]) 15958 every: function every(callbackfn /* , thisArg */) { 15959 return $every(this, callbackfn, arguments[1]); 15960 } 15961 }); 15962 15963 15964/***/ }), 15965/* 181 */ 15966/***/ (function(module, exports, __webpack_require__) { 15967 15968 'use strict'; 15969 var $export = __webpack_require__(9); 15970 var $reduce = __webpack_require__(182); 15971 15972 $export($export.P + $export.F * !__webpack_require__(170)([].reduce, true), 'Array', { 15973 // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue]) 15974 reduce: function reduce(callbackfn /* , initialValue */) { 15975 return $reduce(this, callbackfn, arguments.length, arguments[1], false); 15976 } 15977 }); 15978 15979 15980/***/ }), 15981/* 182 */ 15982/***/ (function(module, exports, __webpack_require__) { 15983 15984 var aFunction = __webpack_require__(22); 15985 var toObject = __webpack_require__(58); 15986 var IObject = __webpack_require__(34); 15987 var toLength = __webpack_require__(38); 15988 15989 module.exports = function (that, callbackfn, aLen, memo, isRight) { 15990 aFunction(callbackfn); 15991 var O = toObject(that); 15992 var self = IObject(O); 15993 var length = toLength(O.length); 15994 var index = isRight ? length - 1 : 0; 15995 var i = isRight ? -1 : 1; 15996 if (aLen < 2) for (;;) { 15997 if (index in self) { 15998 memo = self[index]; 15999 index += i; 16000 break; 16001 } 16002 index += i; 16003 if (isRight ? index < 0 : length <= index) { 16004 throw TypeError('Reduce of empty array with no initial value'); 16005 } 16006 } 16007 for (;isRight ? index >= 0 : length > index; index += i) if (index in self) { 16008 memo = callbackfn(memo, self[index], index, O); 16009 } 16010 return memo; 16011 }; 16012 16013 16014/***/ }), 16015/* 183 */ 16016/***/ (function(module, exports, __webpack_require__) { 16017 16018 'use strict'; 16019 var $export = __webpack_require__(9); 16020 var $reduce = __webpack_require__(182); 16021 16022 $export($export.P + $export.F * !__webpack_require__(170)([].reduceRight, true), 'Array', { 16023 // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue]) 16024 reduceRight: function reduceRight(callbackfn /* , initialValue */) { 16025 return $reduce(this, callbackfn, arguments.length, arguments[1], true); 16026 } 16027 }); 16028 16029 16030/***/ }), 16031/* 184 */ 16032/***/ (function(module, exports, __webpack_require__) { 16033 16034 'use strict'; 16035 var $export = __webpack_require__(9); 16036 var $indexOf = __webpack_require__(37)(false); 16037 var $native = [].indexOf; 16038 var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0; 16039 16040 $export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(170)($native)), 'Array', { 16041 // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex]) 16042 indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { 16043 return NEGATIVE_ZERO 16044 // convert -0 to +0 16045 ? $native.apply(this, arguments) || 0 16046 : $indexOf(this, searchElement, arguments[1]); 16047 } 16048 }); 16049 16050 16051/***/ }), 16052/* 185 */ 16053/***/ (function(module, exports, __webpack_require__) { 16054 16055 'use strict'; 16056 var $export = __webpack_require__(9); 16057 var toIObject = __webpack_require__(33); 16058 var toInteger = __webpack_require__(39); 16059 var toLength = __webpack_require__(38); 16060 var $native = [].lastIndexOf; 16061 var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0; 16062 16063 $export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(170)($native)), 'Array', { 16064 // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex]) 16065 lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) { 16066 // convert -0 to +0 16067 if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0; 16068 var O = toIObject(this); 16069 var length = toLength(O.length); 16070 var index = length - 1; 16071 if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1])); 16072 if (index < 0) index = length + index; 16073 for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0; 16074 return -1; 16075 } 16076 }); 16077 16078 16079/***/ }), 16080/* 186 */ 16081/***/ (function(module, exports, __webpack_require__) { 16082 16083 // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) 16084 var $export = __webpack_require__(9); 16085 16086 $export($export.P, 'Array', { copyWithin: __webpack_require__(187) }); 16087 16088 __webpack_require__(188)('copyWithin'); 16089 16090 16091/***/ }), 16092/* 187 */ 16093/***/ (function(module, exports, __webpack_require__) { 16094 16095 // 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length) 16096 'use strict'; 16097 var toObject = __webpack_require__(58); 16098 var toAbsoluteIndex = __webpack_require__(40); 16099 var toLength = __webpack_require__(38); 16100 16101 module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) { 16102 var O = toObject(this); 16103 var len = toLength(O.length); 16104 var to = toAbsoluteIndex(target, len); 16105 var from = toAbsoluteIndex(start, len); 16106 var end = arguments.length > 2 ? arguments[2] : undefined; 16107 var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to); 16108 var inc = 1; 16109 if (from < to && to < from + count) { 16110 inc = -1; 16111 from += count - 1; 16112 to += count - 1; 16113 } 16114 while (count-- > 0) { 16115 if (from in O) O[to] = O[from]; 16116 else delete O[to]; 16117 to += inc; 16118 from += inc; 16119 } return O; 16120 }; 16121 16122 16123/***/ }), 16124/* 188 */ 16125/***/ (function(module, exports, __webpack_require__) { 16126 16127 // 22.1.3.31 Array.prototype[@@unscopables] 16128 var UNSCOPABLES = __webpack_require__(27)('unscopables'); 16129 var ArrayProto = Array.prototype; 16130 if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(11)(ArrayProto, UNSCOPABLES, {}); 16131 module.exports = function (key) { 16132 ArrayProto[UNSCOPABLES][key] = true; 16133 }; 16134 16135 16136/***/ }), 16137/* 189 */ 16138/***/ (function(module, exports, __webpack_require__) { 16139 16140 // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) 16141 var $export = __webpack_require__(9); 16142 16143 $export($export.P, 'Array', { fill: __webpack_require__(190) }); 16144 16145 __webpack_require__(188)('fill'); 16146 16147 16148/***/ }), 16149/* 190 */ 16150/***/ (function(module, exports, __webpack_require__) { 16151 16152 // 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length) 16153 'use strict'; 16154 var toObject = __webpack_require__(58); 16155 var toAbsoluteIndex = __webpack_require__(40); 16156 var toLength = __webpack_require__(38); 16157 module.exports = function fill(value /* , start = 0, end = @length */) { 16158 var O = toObject(this); 16159 var length = toLength(O.length); 16160 var aLen = arguments.length; 16161 var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length); 16162 var end = aLen > 2 ? arguments[2] : undefined; 16163 var endPos = end === undefined ? length : toAbsoluteIndex(end, length); 16164 while (endPos > index) O[index++] = value; 16165 return O; 16166 }; 16167 16168 16169/***/ }), 16170/* 191 */ 16171/***/ (function(module, exports, __webpack_require__) { 16172 16173 'use strict'; 16174 // 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined) 16175 var $export = __webpack_require__(9); 16176 var $find = __webpack_require__(174)(5); 16177 var KEY = 'find'; 16178 var forced = true; 16179 // Shouldn't skip holes 16180 if (KEY in []) Array(1)[KEY](function () { forced = false; }); 16181 $export($export.P + $export.F * forced, 'Array', { 16182 find: function find(callbackfn /* , that = undefined */) { 16183 return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); 16184 } 16185 }); 16186 __webpack_require__(188)(KEY); 16187 16188 16189/***/ }), 16190/* 192 */ 16191/***/ (function(module, exports, __webpack_require__) { 16192 16193 'use strict'; 16194 // 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined) 16195 var $export = __webpack_require__(9); 16196 var $find = __webpack_require__(174)(6); 16197 var KEY = 'findIndex'; 16198 var forced = true; 16199 // Shouldn't skip holes 16200 if (KEY in []) Array(1)[KEY](function () { forced = false; }); 16201 $export($export.P + $export.F * forced, 'Array', { 16202 findIndex: function findIndex(callbackfn /* , that = undefined */) { 16203 return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); 16204 } 16205 }); 16206 __webpack_require__(188)(KEY); 16207 16208 16209/***/ }), 16210/* 193 */ 16211/***/ (function(module, exports, __webpack_require__) { 16212 16213 __webpack_require__(194)('Array'); 16214 16215 16216/***/ }), 16217/* 194 */ 16218/***/ (function(module, exports, __webpack_require__) { 16219 16220 'use strict'; 16221 var global = __webpack_require__(5); 16222 var dP = __webpack_require__(12); 16223 var DESCRIPTORS = __webpack_require__(7); 16224 var SPECIES = __webpack_require__(27)('species'); 16225 16226 module.exports = function (KEY) { 16227 var C = global[KEY]; 16228 if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { 16229 configurable: true, 16230 get: function () { return this; } 16231 }); 16232 }; 16233 16234 16235/***/ }), 16236/* 195 */ 16237/***/ (function(module, exports, __webpack_require__) { 16238 16239 'use strict'; 16240 var addToUnscopables = __webpack_require__(188); 16241 var step = __webpack_require__(196); 16242 var Iterators = __webpack_require__(130); 16243 var toIObject = __webpack_require__(33); 16244 16245 // 22.1.3.4 Array.prototype.entries() 16246 // 22.1.3.13 Array.prototype.keys() 16247 // 22.1.3.29 Array.prototype.values() 16248 // 22.1.3.30 Array.prototype[@@iterator]() 16249 module.exports = __webpack_require__(129)(Array, 'Array', function (iterated, kind) { 16250 this._t = toIObject(iterated); // target 16251 this._i = 0; // next index 16252 this._k = kind; // kind 16253 // 22.1.5.2.1 %ArrayIteratorPrototype%.next() 16254 }, function () { 16255 var O = this._t; 16256 var kind = this._k; 16257 var index = this._i++; 16258 if (!O || index >= O.length) { 16259 this._t = undefined; 16260 return step(1); 16261 } 16262 if (kind == 'keys') return step(0, index); 16263 if (kind == 'values') return step(0, O[index]); 16264 return step(0, [index, O[index]]); 16265 }, 'values'); 16266 16267 // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) 16268 Iterators.Arguments = Iterators.Array; 16269 16270 addToUnscopables('keys'); 16271 addToUnscopables('values'); 16272 addToUnscopables('entries'); 16273 16274 16275/***/ }), 16276/* 196 */ 16277/***/ (function(module, exports) { 16278 16279 module.exports = function (done, value) { 16280 return { value: value, done: !!done }; 16281 }; 16282 16283 16284/***/ }), 16285/* 197 */ 16286/***/ (function(module, exports, __webpack_require__) { 16287 16288 var global = __webpack_require__(5); 16289 var inheritIfRequired = __webpack_require__(88); 16290 var dP = __webpack_require__(12).f; 16291 var gOPN = __webpack_require__(50).f; 16292 var isRegExp = __webpack_require__(135); 16293 var $flags = __webpack_require__(198); 16294 var $RegExp = global.RegExp; 16295 var Base = $RegExp; 16296 var proto = $RegExp.prototype; 16297 var re1 = /a/g; 16298 var re2 = /a/g; 16299 // "new" creates a new object, old webkit buggy here 16300 var CORRECT_NEW = new $RegExp(re1) !== re1; 16301 16302 if (__webpack_require__(7) && (!CORRECT_NEW || __webpack_require__(8)(function () { 16303 re2[__webpack_require__(27)('match')] = false; 16304 // RegExp constructor can alter flags and IsRegExp works correct with @@match 16305 return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i'; 16306 }))) { 16307 $RegExp = function RegExp(p, f) { 16308 var tiRE = this instanceof $RegExp; 16309 var piRE = isRegExp(p); 16310 var fiU = f === undefined; 16311 return !tiRE && piRE && p.constructor === $RegExp && fiU ? p 16312 : inheritIfRequired(CORRECT_NEW 16313 ? new Base(piRE && !fiU ? p.source : p, f) 16314 : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f) 16315 , tiRE ? this : proto, $RegExp); 16316 }; 16317 var proxy = function (key) { 16318 key in $RegExp || dP($RegExp, key, { 16319 configurable: true, 16320 get: function () { return Base[key]; }, 16321 set: function (it) { Base[key] = it; } 16322 }); 16323 }; 16324 for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]); 16325 proto.constructor = $RegExp; 16326 $RegExp.prototype = proto; 16327 __webpack_require__(19)(global, 'RegExp', $RegExp); 16328 } 16329 16330 __webpack_require__(194)('RegExp'); 16331 16332 16333/***/ }), 16334/* 198 */ 16335/***/ (function(module, exports, __webpack_require__) { 16336 16337 'use strict'; 16338 // 21.2.5.3 get RegExp.prototype.flags 16339 var anObject = __webpack_require__(13); 16340 module.exports = function () { 16341 var that = anObject(this); 16342 var result = ''; 16343 if (that.global) result += 'g'; 16344 if (that.ignoreCase) result += 'i'; 16345 if (that.multiline) result += 'm'; 16346 if (that.unicode) result += 'u'; 16347 if (that.sticky) result += 'y'; 16348 return result; 16349 }; 16350 16351 16352/***/ }), 16353/* 199 */ 16354/***/ (function(module, exports, __webpack_require__) { 16355 16356 'use strict'; 16357 var regexpExec = __webpack_require__(200); 16358 __webpack_require__(9)({ 16359 target: 'RegExp', 16360 proto: true, 16361 forced: regexpExec !== /./.exec 16362 }, { 16363 exec: regexpExec 16364 }); 16365 16366 16367/***/ }), 16368/* 200 */ 16369/***/ (function(module, exports, __webpack_require__) { 16370 16371 'use strict'; 16372 16373 var regexpFlags = __webpack_require__(198); 16374 16375 var nativeExec = RegExp.prototype.exec; 16376 // This always refers to the native implementation, because the 16377 // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js, 16378 // which loads this file before patching the method. 16379 var nativeReplace = String.prototype.replace; 16380 16381 var patchedExec = nativeExec; 16382 16383 var LAST_INDEX = 'lastIndex'; 16384 16385 var UPDATES_LAST_INDEX_WRONG = (function () { 16386 var re1 = /a/, 16387 re2 = /b*/g; 16388 nativeExec.call(re1, 'a'); 16389 nativeExec.call(re2, 'a'); 16390 return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0; 16391 })(); 16392 16393 // nonparticipating capturing group, copied from es5-shim's String#split patch. 16394 var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; 16395 16396 var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED; 16397 16398 if (PATCH) { 16399 patchedExec = function exec(str) { 16400 var re = this; 16401 var lastIndex, reCopy, match, i; 16402 16403 if (NPCG_INCLUDED) { 16404 reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re)); 16405 } 16406 if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX]; 16407 16408 match = nativeExec.call(re, str); 16409 16410 if (UPDATES_LAST_INDEX_WRONG && match) { 16411 re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex; 16412 } 16413 if (NPCG_INCLUDED && match && match.length > 1) { 16414 // Fix browsers whose `exec` methods don't consistently return `undefined` 16415 // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/ 16416 // eslint-disable-next-line no-loop-func 16417 nativeReplace.call(match[0], reCopy, function () { 16418 for (i = 1; i < arguments.length - 2; i++) { 16419 if (arguments[i] === undefined) match[i] = undefined; 16420 } 16421 }); 16422 } 16423 16424 return match; 16425 }; 16426 } 16427 16428 module.exports = patchedExec; 16429 16430 16431/***/ }), 16432/* 201 */ 16433/***/ (function(module, exports, __webpack_require__) { 16434 16435 'use strict'; 16436 __webpack_require__(202); 16437 var anObject = __webpack_require__(13); 16438 var $flags = __webpack_require__(198); 16439 var DESCRIPTORS = __webpack_require__(7); 16440 var TO_STRING = 'toString'; 16441 var $toString = /./[TO_STRING]; 16442 16443 var define = function (fn) { 16444 __webpack_require__(19)(RegExp.prototype, TO_STRING, fn, true); 16445 }; 16446 16447 // 21.2.5.14 RegExp.prototype.toString() 16448 if (__webpack_require__(8)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) { 16449 define(function toString() { 16450 var R = anObject(this); 16451 return '/'.concat(R.source, '/', 16452 'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined); 16453 }); 16454 // FF44- RegExp#toString has a wrong name 16455 } else if ($toString.name != TO_STRING) { 16456 define(function toString() { 16457 return $toString.call(this); 16458 }); 16459 } 16460 16461 16462/***/ }), 16463/* 202 */ 16464/***/ (function(module, exports, __webpack_require__) { 16465 16466 // 21.2.5.3 get RegExp.prototype.flags() 16467 if (__webpack_require__(7) && /./g.flags != 'g') __webpack_require__(12).f(RegExp.prototype, 'flags', { 16468 configurable: true, 16469 get: __webpack_require__(198) 16470 }); 16471 16472 16473/***/ }), 16474/* 203 */ 16475/***/ (function(module, exports, __webpack_require__) { 16476 16477 'use strict'; 16478 16479 var anObject = __webpack_require__(13); 16480 var toLength = __webpack_require__(38); 16481 var advanceStringIndex = __webpack_require__(204); 16482 var regExpExec = __webpack_require__(205); 16483 16484 // @@match logic 16485 __webpack_require__(206)('match', 1, function (defined, MATCH, $match, maybeCallNative) { 16486 return [ 16487 // `String.prototype.match` method 16488 // https://tc39.github.io/ecma262/#sec-string.prototype.match 16489 function match(regexp) { 16490 var O = defined(this); 16491 var fn = regexp == undefined ? undefined : regexp[MATCH]; 16492 return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O)); 16493 }, 16494 // `RegExp.prototype[@@match]` method 16495 // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match 16496 function (regexp) { 16497 var res = maybeCallNative($match, regexp, this); 16498 if (res.done) return res.value; 16499 var rx = anObject(regexp); 16500 var S = String(this); 16501 if (!rx.global) return regExpExec(rx, S); 16502 var fullUnicode = rx.unicode; 16503 rx.lastIndex = 0; 16504 var A = []; 16505 var n = 0; 16506 var result; 16507 while ((result = regExpExec(rx, S)) !== null) { 16508 var matchStr = String(result[0]); 16509 A[n] = matchStr; 16510 if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); 16511 n++; 16512 } 16513 return n === 0 ? null : A; 16514 } 16515 ]; 16516 }); 16517 16518 16519/***/ }), 16520/* 204 */ 16521/***/ (function(module, exports, __webpack_require__) { 16522 16523 'use strict'; 16524 var at = __webpack_require__(128)(true); 16525 16526 // `AdvanceStringIndex` abstract operation 16527 // https://tc39.github.io/ecma262/#sec-advancestringindex 16528 module.exports = function (S, index, unicode) { 16529 return index + (unicode ? at(S, index).length : 1); 16530 }; 16531 16532 16533/***/ }), 16534/* 205 */ 16535/***/ (function(module, exports, __webpack_require__) { 16536 16537 'use strict'; 16538 16539 var classof = __webpack_require__(75); 16540 var builtinExec = RegExp.prototype.exec; 16541 16542 // `RegExpExec` abstract operation 16543 // https://tc39.github.io/ecma262/#sec-regexpexec 16544 module.exports = function (R, S) { 16545 var exec = R.exec; 16546 if (typeof exec === 'function') { 16547 var result = exec.call(R, S); 16548 if (typeof result !== 'object') { 16549 throw new TypeError('RegExp exec method returned something other than an Object or null'); 16550 } 16551 return result; 16552 } 16553 if (classof(R) !== 'RegExp') { 16554 throw new TypeError('RegExp#exec called on incompatible receiver'); 16555 } 16556 return builtinExec.call(R, S); 16557 }; 16558 16559 16560/***/ }), 16561/* 206 */ 16562/***/ (function(module, exports, __webpack_require__) { 16563 16564 'use strict'; 16565 __webpack_require__(199); 16566 var redefine = __webpack_require__(19); 16567 var hide = __webpack_require__(11); 16568 var fails = __webpack_require__(8); 16569 var defined = __webpack_require__(36); 16570 var wks = __webpack_require__(27); 16571 var regexpExec = __webpack_require__(200); 16572 16573 var SPECIES = wks('species'); 16574 16575 var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { 16576 // #replace needs built-in support for named groups. 16577 // #match works fine because it just return the exec results, even if it has 16578 // a "grops" property. 16579 var re = /./; 16580 re.exec = function () { 16581 var result = []; 16582 result.groups = { a: '7' }; 16583 return result; 16584 }; 16585 return ''.replace(re, '$<a>') !== '7'; 16586 }); 16587 16588 var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () { 16589 // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec 16590 var re = /(?:)/; 16591 var originalExec = re.exec; 16592 re.exec = function () { return originalExec.apply(this, arguments); }; 16593 var result = 'ab'.split(re); 16594 return result.length === 2 && result[0] === 'a' && result[1] === 'b'; 16595 })(); 16596 16597 module.exports = function (KEY, length, exec) { 16598 var SYMBOL = wks(KEY); 16599 16600 var DELEGATES_TO_SYMBOL = !fails(function () { 16601 // String methods call symbol-named RegEp methods 16602 var O = {}; 16603 O[SYMBOL] = function () { return 7; }; 16604 return ''[KEY](O) != 7; 16605 }); 16606 16607 var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function () { 16608 // Symbol-named RegExp methods call .exec 16609 var execCalled = false; 16610 var re = /a/; 16611 re.exec = function () { execCalled = true; return null; }; 16612 if (KEY === 'split') { 16613 // RegExp[@@split] doesn't call the regex's exec method, but first creates 16614 // a new one. We need to return the patched regex when creating the new one. 16615 re.constructor = {}; 16616 re.constructor[SPECIES] = function () { return re; }; 16617 } 16618 re[SYMBOL](''); 16619 return !execCalled; 16620 }) : undefined; 16621 16622 if ( 16623 !DELEGATES_TO_SYMBOL || 16624 !DELEGATES_TO_EXEC || 16625 (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) || 16626 (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) 16627 ) { 16628 var nativeRegExpMethod = /./[SYMBOL]; 16629 var fns = exec( 16630 defined, 16631 SYMBOL, 16632 ''[KEY], 16633 function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) { 16634 if (regexp.exec === regexpExec) { 16635 if (DELEGATES_TO_SYMBOL && !forceStringMethod) { 16636 // The native String method already delegates to @@method (this 16637 // polyfilled function), leasing to infinite recursion. 16638 // We avoid it by directly calling the native @@method method. 16639 return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) }; 16640 } 16641 return { done: true, value: nativeMethod.call(str, regexp, arg2) }; 16642 } 16643 return { done: false }; 16644 } 16645 ); 16646 var strfn = fns[0]; 16647 var rxfn = fns[1]; 16648 16649 redefine(String.prototype, KEY, strfn); 16650 hide(RegExp.prototype, SYMBOL, length == 2 16651 // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) 16652 // 21.2.5.11 RegExp.prototype[@@split](string, limit) 16653 ? function (string, arg) { return rxfn.call(string, this, arg); } 16654 // 21.2.5.6 RegExp.prototype[@@match](string) 16655 // 21.2.5.9 RegExp.prototype[@@search](string) 16656 : function (string) { return rxfn.call(string, this); } 16657 ); 16658 } 16659 }; 16660 16661 16662/***/ }), 16663/* 207 */ 16664/***/ (function(module, exports, __webpack_require__) { 16665 16666 'use strict'; 16667 16668 var anObject = __webpack_require__(13); 16669 var toObject = __webpack_require__(58); 16670 var toLength = __webpack_require__(38); 16671 var toInteger = __webpack_require__(39); 16672 var advanceStringIndex = __webpack_require__(204); 16673 var regExpExec = __webpack_require__(205); 16674 var max = Math.max; 16675 var min = Math.min; 16676 var floor = Math.floor; 16677 var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g; 16678 var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g; 16679 16680 var maybeToString = function (it) { 16681 return it === undefined ? it : String(it); 16682 }; 16683 16684 // @@replace logic 16685 __webpack_require__(206)('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) { 16686 return [ 16687 // `String.prototype.replace` method 16688 // https://tc39.github.io/ecma262/#sec-string.prototype.replace 16689 function replace(searchValue, replaceValue) { 16690 var O = defined(this); 16691 var fn = searchValue == undefined ? undefined : searchValue[REPLACE]; 16692 return fn !== undefined 16693 ? fn.call(searchValue, O, replaceValue) 16694 : $replace.call(String(O), searchValue, replaceValue); 16695 }, 16696 // `RegExp.prototype[@@replace]` method 16697 // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace 16698 function (regexp, replaceValue) { 16699 var res = maybeCallNative($replace, regexp, this, replaceValue); 16700 if (res.done) return res.value; 16701 16702 var rx = anObject(regexp); 16703 var S = String(this); 16704 var functionalReplace = typeof replaceValue === 'function'; 16705 if (!functionalReplace) replaceValue = String(replaceValue); 16706 var global = rx.global; 16707 if (global) { 16708 var fullUnicode = rx.unicode; 16709 rx.lastIndex = 0; 16710 } 16711 var results = []; 16712 while (true) { 16713 var result = regExpExec(rx, S); 16714 if (result === null) break; 16715 results.push(result); 16716 if (!global) break; 16717 var matchStr = String(result[0]); 16718 if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); 16719 } 16720 var accumulatedResult = ''; 16721 var nextSourcePosition = 0; 16722 for (var i = 0; i < results.length; i++) { 16723 result = results[i]; 16724 var matched = String(result[0]); 16725 var position = max(min(toInteger(result.index), S.length), 0); 16726 var captures = []; 16727 // NOTE: This is equivalent to 16728 // captures = result.slice(1).map(maybeToString) 16729 // but for some reason `nativeSlice.call(result, 1, result.length)` (called in 16730 // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and 16731 // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. 16732 for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j])); 16733 var namedCaptures = result.groups; 16734 if (functionalReplace) { 16735 var replacerArgs = [matched].concat(captures, position, S); 16736 if (namedCaptures !== undefined) replacerArgs.push(namedCaptures); 16737 var replacement = String(replaceValue.apply(undefined, replacerArgs)); 16738 } else { 16739 replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); 16740 } 16741 if (position >= nextSourcePosition) { 16742 accumulatedResult += S.slice(nextSourcePosition, position) + replacement; 16743 nextSourcePosition = position + matched.length; 16744 } 16745 } 16746 return accumulatedResult + S.slice(nextSourcePosition); 16747 } 16748 ]; 16749 16750 // https://tc39.github.io/ecma262/#sec-getsubstitution 16751 function getSubstitution(matched, str, position, captures, namedCaptures, replacement) { 16752 var tailPos = position + matched.length; 16753 var m = captures.length; 16754 var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; 16755 if (namedCaptures !== undefined) { 16756 namedCaptures = toObject(namedCaptures); 16757 symbols = SUBSTITUTION_SYMBOLS; 16758 } 16759 return $replace.call(replacement, symbols, function (match, ch) { 16760 var capture; 16761 switch (ch.charAt(0)) { 16762 case '$': return '$'; 16763 case '&': return matched; 16764 case '`': return str.slice(0, position); 16765 case "'": return str.slice(tailPos); 16766 case '<': 16767 capture = namedCaptures[ch.slice(1, -1)]; 16768 break; 16769 default: // \d\d? 16770 var n = +ch; 16771 if (n === 0) return ch; 16772 if (n > m) { 16773 var f = floor(n / 10); 16774 if (f === 0) return ch; 16775 if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1); 16776 return ch; 16777 } 16778 capture = captures[n - 1]; 16779 } 16780 return capture === undefined ? '' : capture; 16781 }); 16782 } 16783 }); 16784 16785 16786/***/ }), 16787/* 208 */ 16788/***/ (function(module, exports, __webpack_require__) { 16789 16790 'use strict'; 16791 16792 var anObject = __webpack_require__(13); 16793 var sameValue = __webpack_require__(71); 16794 var regExpExec = __webpack_require__(205); 16795 16796 // @@search logic 16797 __webpack_require__(206)('search', 1, function (defined, SEARCH, $search, maybeCallNative) { 16798 return [ 16799 // `String.prototype.search` method 16800 // https://tc39.github.io/ecma262/#sec-string.prototype.search 16801 function search(regexp) { 16802 var O = defined(this); 16803 var fn = regexp == undefined ? undefined : regexp[SEARCH]; 16804 return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O)); 16805 }, 16806 // `RegExp.prototype[@@search]` method 16807 // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search 16808 function (regexp) { 16809 var res = maybeCallNative($search, regexp, this); 16810 if (res.done) return res.value; 16811 var rx = anObject(regexp); 16812 var S = String(this); 16813 var previousLastIndex = rx.lastIndex; 16814 if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0; 16815 var result = regExpExec(rx, S); 16816 if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex; 16817 return result === null ? -1 : result.index; 16818 } 16819 ]; 16820 }); 16821 16822 16823/***/ }), 16824/* 209 */ 16825/***/ (function(module, exports, __webpack_require__) { 16826 16827 'use strict'; 16828 16829 var isRegExp = __webpack_require__(135); 16830 var anObject = __webpack_require__(13); 16831 var speciesConstructor = __webpack_require__(210); 16832 var advanceStringIndex = __webpack_require__(204); 16833 var toLength = __webpack_require__(38); 16834 var callRegExpExec = __webpack_require__(205); 16835 var regexpExec = __webpack_require__(200); 16836 var $min = Math.min; 16837 var $push = [].push; 16838 var $SPLIT = 'split'; 16839 var LENGTH = 'length'; 16840 var LAST_INDEX = 'lastIndex'; 16841 16842 // eslint-disable-next-line no-empty 16843 var SUPPORTS_Y = !!(function () { try { return new RegExp('x', 'y'); } catch (e) {} })(); 16844 16845 // @@split logic 16846 __webpack_require__(206)('split', 2, function (defined, SPLIT, $split, maybeCallNative) { 16847 var internalSplit = $split; 16848 if ( 16849 'abbc'[$SPLIT](/(b)*/)[1] == 'c' || 16850 'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 || 16851 'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 || 16852 '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 || 16853 '.'[$SPLIT](/()()/)[LENGTH] > 1 || 16854 ''[$SPLIT](/.?/)[LENGTH] 16855 ) { 16856 // based on es5-shim implementation, need to rework it 16857 internalSplit = function (separator, limit) { 16858 var string = String(this); 16859 if (separator === undefined && limit === 0) return []; 16860 // If `separator` is not a regex, use native split 16861 if (!isRegExp(separator)) return $split.call(string, separator, limit); 16862 var output = []; 16863 var flags = (separator.ignoreCase ? 'i' : '') + 16864 (separator.multiline ? 'm' : '') + 16865 (separator.unicode ? 'u' : '') + 16866 (separator.sticky ? 'y' : ''); 16867 var lastLastIndex = 0; 16868 var splitLimit = limit === undefined ? 4294967295 : limit >>> 0; 16869 // Make `global` and avoid `lastIndex` issues by working with a copy 16870 var separatorCopy = new RegExp(separator.source, flags + 'g'); 16871 var match, lastIndex, lastLength; 16872 while (match = regexpExec.call(separatorCopy, string)) { 16873 lastIndex = separatorCopy[LAST_INDEX]; 16874 if (lastIndex > lastLastIndex) { 16875 output.push(string.slice(lastLastIndex, match.index)); 16876 if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1)); 16877 lastLength = match[0][LENGTH]; 16878 lastLastIndex = lastIndex; 16879 if (output[LENGTH] >= splitLimit) break; 16880 } 16881 if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop 16882 } 16883 if (lastLastIndex === string[LENGTH]) { 16884 if (lastLength || !separatorCopy.test('')) output.push(''); 16885 } else output.push(string.slice(lastLastIndex)); 16886 return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output; 16887 }; 16888 // Chakra, V8 16889 } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) { 16890 internalSplit = function (separator, limit) { 16891 return separator === undefined && limit === 0 ? [] : $split.call(this, separator, limit); 16892 }; 16893 } 16894 16895 return [ 16896 // `String.prototype.split` method 16897 // https://tc39.github.io/ecma262/#sec-string.prototype.split 16898 function split(separator, limit) { 16899 var O = defined(this); 16900 var splitter = separator == undefined ? undefined : separator[SPLIT]; 16901 return splitter !== undefined 16902 ? splitter.call(separator, O, limit) 16903 : internalSplit.call(String(O), separator, limit); 16904 }, 16905 // `RegExp.prototype[@@split]` method 16906 // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split 16907 // 16908 // NOTE: This cannot be properly polyfilled in engines that don't support 16909 // the 'y' flag. 16910 function (regexp, limit) { 16911 var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== $split); 16912 if (res.done) return res.value; 16913 16914 var rx = anObject(regexp); 16915 var S = String(this); 16916 var C = speciesConstructor(rx, RegExp); 16917 16918 var unicodeMatching = rx.unicode; 16919 var flags = (rx.ignoreCase ? 'i' : '') + 16920 (rx.multiline ? 'm' : '') + 16921 (rx.unicode ? 'u' : '') + 16922 (SUPPORTS_Y ? 'y' : 'g'); 16923 16924 // ^(? + rx + ) is needed, in combination with some S slicing, to 16925 // simulate the 'y' flag. 16926 var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags); 16927 var lim = limit === undefined ? 0xffffffff : limit >>> 0; 16928 if (lim === 0) return []; 16929 if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : []; 16930 var p = 0; 16931 var q = 0; 16932 var A = []; 16933 while (q < S.length) { 16934 splitter.lastIndex = SUPPORTS_Y ? q : 0; 16935 var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q)); 16936 var e; 16937 if ( 16938 z === null || 16939 (e = $min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p 16940 ) { 16941 q = advanceStringIndex(S, q, unicodeMatching); 16942 } else { 16943 A.push(S.slice(p, q)); 16944 if (A.length === lim) return A; 16945 for (var i = 1; i <= z.length - 1; i++) { 16946 A.push(z[i]); 16947 if (A.length === lim) return A; 16948 } 16949 q = p = e; 16950 } 16951 } 16952 A.push(S.slice(p)); 16953 return A; 16954 } 16955 ]; 16956 }); 16957 16958 16959/***/ }), 16960/* 210 */ 16961/***/ (function(module, exports, __webpack_require__) { 16962 16963 // 7.3.20 SpeciesConstructor(O, defaultConstructor) 16964 var anObject = __webpack_require__(13); 16965 var aFunction = __webpack_require__(22); 16966 var SPECIES = __webpack_require__(27)('species'); 16967 module.exports = function (O, D) { 16968 var C = anObject(O).constructor; 16969 var S; 16970 return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); 16971 }; 16972 16973 16974/***/ }), 16975/* 211 */ 16976/***/ (function(module, exports, __webpack_require__) { 16977 16978 'use strict'; 16979 var LIBRARY = __webpack_require__(25); 16980 var global = __webpack_require__(5); 16981 var ctx = __webpack_require__(21); 16982 var classof = __webpack_require__(75); 16983 var $export = __webpack_require__(9); 16984 var isObject = __webpack_require__(14); 16985 var aFunction = __webpack_require__(22); 16986 var anInstance = __webpack_require__(212); 16987 var forOf = __webpack_require__(213); 16988 var speciesConstructor = __webpack_require__(210); 16989 var task = __webpack_require__(214).set; 16990 var microtask = __webpack_require__(215)(); 16991 var newPromiseCapabilityModule = __webpack_require__(216); 16992 var perform = __webpack_require__(217); 16993 var userAgent = __webpack_require__(218); 16994 var promiseResolve = __webpack_require__(219); 16995 var PROMISE = 'Promise'; 16996 var TypeError = global.TypeError; 16997 var process = global.process; 16998 var versions = process && process.versions; 16999 var v8 = versions && versions.v8 || ''; 17000 var $Promise = global[PROMISE]; 17001 var isNode = classof(process) == 'process'; 17002 var empty = function () { /* empty */ }; 17003 var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; 17004 var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; 17005 17006 var USE_NATIVE = !!function () { 17007 try { 17008 // correct subclassing with @@species support 17009 var promise = $Promise.resolve(1); 17010 var FakePromise = (promise.constructor = {})[__webpack_require__(27)('species')] = function (exec) { 17011 exec(empty, empty); 17012 }; 17013 // unhandled rejections tracking support, NodeJS Promise without it fails @@species test 17014 return (isNode || typeof PromiseRejectionEvent == 'function') 17015 && promise.then(empty) instanceof FakePromise 17016 // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables 17017 // https://bugs.chromium.org/p/chromium/issues/detail?id=830565 17018 // we can't detect it synchronously, so just check versions 17019 && v8.indexOf('6.6') !== 0 17020 && userAgent.indexOf('Chrome/66') === -1; 17021 } catch (e) { /* empty */ } 17022 }(); 17023 17024 // helpers 17025 var isThenable = function (it) { 17026 var then; 17027 return isObject(it) && typeof (then = it.then) == 'function' ? then : false; 17028 }; 17029 var notify = function (promise, isReject) { 17030 if (promise._n) return; 17031 promise._n = true; 17032 var chain = promise._c; 17033 microtask(function () { 17034 var value = promise._v; 17035 var ok = promise._s == 1; 17036 var i = 0; 17037 var run = function (reaction) { 17038 var handler = ok ? reaction.ok : reaction.fail; 17039 var resolve = reaction.resolve; 17040 var reject = reaction.reject; 17041 var domain = reaction.domain; 17042 var result, then, exited; 17043 try { 17044 if (handler) { 17045 if (!ok) { 17046 if (promise._h == 2) onHandleUnhandled(promise); 17047 promise._h = 1; 17048 } 17049 if (handler === true) result = value; 17050 else { 17051 if (domain) domain.enter(); 17052 result = handler(value); // may throw 17053 if (domain) { 17054 domain.exit(); 17055 exited = true; 17056 } 17057 } 17058 if (result === reaction.promise) { 17059 reject(TypeError('Promise-chain cycle')); 17060 } else if (then = isThenable(result)) { 17061 then.call(result, resolve, reject); 17062 } else resolve(result); 17063 } else reject(value); 17064 } catch (e) { 17065 if (domain && !exited) domain.exit(); 17066 reject(e); 17067 } 17068 }; 17069 while (chain.length > i) run(chain[i++]); // variable length - can't use forEach 17070 promise._c = []; 17071 promise._n = false; 17072 if (isReject && !promise._h) onUnhandled(promise); 17073 }); 17074 }; 17075 var onUnhandled = function (promise) { 17076 task.call(global, function () { 17077 var value = promise._v; 17078 var unhandled = isUnhandled(promise); 17079 var result, handler, console; 17080 if (unhandled) { 17081 result = perform(function () { 17082 if (isNode) { 17083 process.emit('unhandledRejection', value, promise); 17084 } else if (handler = global.onunhandledrejection) { 17085 handler({ promise: promise, reason: value }); 17086 } else if ((console = global.console) && console.error) { 17087 console.error('Unhandled promise rejection', value); 17088 } 17089 }); 17090 // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should 17091 promise._h = isNode || isUnhandled(promise) ? 2 : 1; 17092 } promise._a = undefined; 17093 if (unhandled && result.e) throw result.v; 17094 }); 17095 }; 17096 var isUnhandled = function (promise) { 17097 return promise._h !== 1 && (promise._a || promise._c).length === 0; 17098 }; 17099 var onHandleUnhandled = function (promise) { 17100 task.call(global, function () { 17101 var handler; 17102 if (isNode) { 17103 process.emit('rejectionHandled', promise); 17104 } else if (handler = global.onrejectionhandled) { 17105 handler({ promise: promise, reason: promise._v }); 17106 } 17107 }); 17108 }; 17109 var $reject = function (value) { 17110 var promise = this; 17111 if (promise._d) return; 17112 promise._d = true; 17113 promise = promise._w || promise; // unwrap 17114 promise._v = value; 17115 promise._s = 2; 17116 if (!promise._a) promise._a = promise._c.slice(); 17117 notify(promise, true); 17118 }; 17119 var $resolve = function (value) { 17120 var promise = this; 17121 var then; 17122 if (promise._d) return; 17123 promise._d = true; 17124 promise = promise._w || promise; // unwrap 17125 try { 17126 if (promise === value) throw TypeError("Promise can't be resolved itself"); 17127 if (then = isThenable(value)) { 17128 microtask(function () { 17129 var wrapper = { _w: promise, _d: false }; // wrap 17130 try { 17131 then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); 17132 } catch (e) { 17133 $reject.call(wrapper, e); 17134 } 17135 }); 17136 } else { 17137 promise._v = value; 17138 promise._s = 1; 17139 notify(promise, false); 17140 } 17141 } catch (e) { 17142 $reject.call({ _w: promise, _d: false }, e); // wrap 17143 } 17144 }; 17145 17146 // constructor polyfill 17147 if (!USE_NATIVE) { 17148 // 25.4.3.1 Promise(executor) 17149 $Promise = function Promise(executor) { 17150 anInstance(this, $Promise, PROMISE, '_h'); 17151 aFunction(executor); 17152 Internal.call(this); 17153 try { 17154 executor(ctx($resolve, this, 1), ctx($reject, this, 1)); 17155 } catch (err) { 17156 $reject.call(this, err); 17157 } 17158 }; 17159 // eslint-disable-next-line no-unused-vars 17160 Internal = function Promise(executor) { 17161 this._c = []; // <- awaiting reactions 17162 this._a = undefined; // <- checked in isUnhandled reactions 17163 this._s = 0; // <- state 17164 this._d = false; // <- done 17165 this._v = undefined; // <- value 17166 this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled 17167 this._n = false; // <- notify 17168 }; 17169 Internal.prototype = __webpack_require__(220)($Promise.prototype, { 17170 // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) 17171 then: function then(onFulfilled, onRejected) { 17172 var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); 17173 reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; 17174 reaction.fail = typeof onRejected == 'function' && onRejected; 17175 reaction.domain = isNode ? process.domain : undefined; 17176 this._c.push(reaction); 17177 if (this._a) this._a.push(reaction); 17178 if (this._s) notify(this, false); 17179 return reaction.promise; 17180 }, 17181 // 25.4.5.1 Promise.prototype.catch(onRejected) 17182 'catch': function (onRejected) { 17183 return this.then(undefined, onRejected); 17184 } 17185 }); 17186 OwnPromiseCapability = function () { 17187 var promise = new Internal(); 17188 this.promise = promise; 17189 this.resolve = ctx($resolve, promise, 1); 17190 this.reject = ctx($reject, promise, 1); 17191 }; 17192 newPromiseCapabilityModule.f = newPromiseCapability = function (C) { 17193 return C === $Promise || C === Wrapper 17194 ? new OwnPromiseCapability(C) 17195 : newGenericPromiseCapability(C); 17196 }; 17197 } 17198 17199 $export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); 17200 __webpack_require__(26)($Promise, PROMISE); 17201 __webpack_require__(194)(PROMISE); 17202 Wrapper = __webpack_require__(10)[PROMISE]; 17203 17204 // statics 17205 $export($export.S + $export.F * !USE_NATIVE, PROMISE, { 17206 // 25.4.4.5 Promise.reject(r) 17207 reject: function reject(r) { 17208 var capability = newPromiseCapability(this); 17209 var $$reject = capability.reject; 17210 $$reject(r); 17211 return capability.promise; 17212 } 17213 }); 17214 $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { 17215 // 25.4.4.6 Promise.resolve(x) 17216 resolve: function resolve(x) { 17217 return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); 17218 } 17219 }); 17220 $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(167)(function (iter) { 17221 $Promise.all(iter)['catch'](empty); 17222 })), PROMISE, { 17223 // 25.4.4.1 Promise.all(iterable) 17224 all: function all(iterable) { 17225 var C = this; 17226 var capability = newPromiseCapability(C); 17227 var resolve = capability.resolve; 17228 var reject = capability.reject; 17229 var result = perform(function () { 17230 var values = []; 17231 var index = 0; 17232 var remaining = 1; 17233 forOf(iterable, false, function (promise) { 17234 var $index = index++; 17235 var alreadyCalled = false;
vendor: 5,242 bytes, lines 17236-17403
17236 values.push(undefined); 17237 remaining++; 17238 C.resolve(promise).then(function (value) { 17239 if (alreadyCalled) return; 17240 alreadyCalled = true; 17241 values[$index] = value; 17242 --remaining || resolve(values); 17243 }, reject); 17244 }); 17245 --remaining || resolve(values); 17246 }); 17247 if (result.e) reject(result.v); 17248 return capability.promise; 17249 }, 17250 // 25.4.4.4 Promise.race(iterable) 17251 race: function race(iterable) { 17252 var C = this; 17253 var capability = newPromiseCapability(C); 17254 var reject = capability.reject; 17255 var result = perform(function () { 17256 forOf(iterable, false, function (promise) { 17257 C.resolve(promise).then(capability.resolve, reject); 17258 }); 17259 }); 17260 if (result.e) reject(result.v); 17261 return capability.promise; 17262 } 17263 }); 17264 17265 17266/***/ }), 17267/* 212 */ 17268/***/ (function(module, exports) { 17269 17270 module.exports = function (it, Constructor, name, forbiddenField) { 17271 if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) { 17272 throw TypeError(name + ': incorrect invocation!'); 17273 } return it; 17274 }; 17275 17276 17277/***/ }), 17278/* 213 */ 17279/***/ (function(module, exports, __webpack_require__) { 17280 17281 var ctx = __webpack_require__(21); 17282 var call = __webpack_require__(163); 17283 var isArrayIter = __webpack_require__(164); 17284 var anObject = __webpack_require__(13); 17285 var toLength = __webpack_require__(38); 17286 var getIterFn = __webpack_require__(166); 17287 var BREAK = {}; 17288 var RETURN = {}; 17289 var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { 17290 var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable); 17291 var f = ctx(fn, that, entries ? 2 : 1); 17292 var index = 0; 17293 var length, step, iterator, result; 17294 if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); 17295 // fast case for arrays with default iterator 17296 if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { 17297 result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); 17298 if (result === BREAK || result === RETURN) return result; 17299 } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { 17300 result = call(iterator, f, step.value, entries); 17301 if (result === BREAK || result === RETURN) return result; 17302 } 17303 }; 17304 exports.BREAK = BREAK; 17305 exports.RETURN = RETURN; 17306 17307 17308/***/ }), 17309/* 214 */ 17310/***/ (function(module, exports, __webpack_require__) { 17311 17312 var ctx = __webpack_require__(21); 17313 var invoke = __webpack_require__(78); 17314 var html = __webpack_require__(48); 17315 var cel = __webpack_require__(16); 17316 var global = __webpack_require__(5); 17317 var process = global.process; 17318 var setTask = global.setImmediate; 17319 var clearTask = global.clearImmediate; 17320 var MessageChannel = global.MessageChannel; 17321 var Dispatch = global.Dispatch; 17322 var counter = 0; 17323 var queue = {}; 17324 var ONREADYSTATECHANGE = 'onreadystatechange'; 17325 var defer, channel, port; 17326 var run = function () { 17327 var id = +this; 17328 // eslint-disable-next-line no-prototype-builtins 17329 if (queue.hasOwnProperty(id)) { 17330 var fn = queue[id]; 17331 delete queue[id]; 17332 fn(); 17333 } 17334 }; 17335 var listener = function (event) { 17336 run.call(event.data); 17337 }; 17338 // Node.js 0.9+ & IE10+ has setImmediate, otherwise: 17339 if (!setTask || !clearTask) { 17340 setTask = function setImmediate(fn) { 17341 var args = []; 17342 var i = 1; 17343 while (arguments.length > i) args.push(arguments[i++]); 17344 queue[++counter] = function () { 17345 // eslint-disable-next-line no-new-func 17346 invoke(typeof fn == 'function' ? fn : Function(fn), args); 17347 }; 17348 defer(counter); 17349 return counter; 17350 }; 17351 clearTask = function clearImmediate(id) { 17352 delete queue[id]; 17353 }; 17354 // Node.js 0.8- 17355 if (__webpack_require__(35)(process) == 'process') { 17356 defer = function (id) { 17357 process.nextTick(ctx(run, id, 1)); 17358 }; 17359 // Sphere (JS game engine) Dispatch API 17360 } else if (Dispatch && Dispatch.now) { 17361 defer = function (id) { 17362 Dispatch.now(ctx(run, id, 1)); 17363 }; 17364 // Browsers with MessageChannel, includes WebWorkers 17365 } else if (MessageChannel) { 17366 channel = new MessageChannel(); 17367 port = channel.port2; 17368 channel.port1.onmessage = listener; 17369 defer = ctx(port.postMessage, port, 1); 17370 // Browsers with postMessage, skip WebWorkers 17371 // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' 17372 } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { 17373 defer = function (id) { 17374 global.postMessage(id + '', '*'); 17375 }; 17376 global.addEventListener('message', listener, false); 17377 // IE8- 17378 } else if (ONREADYSTATECHANGE in cel('script')) { 17379 defer = function (id) { 17380 html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { 17381 html.removeChild(this); 17382 run.call(id); 17383 }; 17384 }; 17385 // Rest old browsers 17386 } else { 17387 defer = function (id) { 17388 setTimeout(ctx(run, id, 1), 0); 17389 }; 17390 } 17391 } 17392 module.exports = { 17393 set: setTask, 17394 clear: clearTask 17395 }; 17396 17397 17398/***/ }), 17399/* 215 */ 17400/***/ (function(module, exports, __webpack_require__) { 17401 17402 var global = __webpack_require__(5); 17403 var macrotask = __webpack_require__(214).set;
vendor: 4,302 bytes, lines 17404-17567
17404 var Observer = global.MutationObserver || global.WebKitMutationObserver; 17405 var process = global.process; 17406 var Promise = global.Promise; 17407 var isNode = __webpack_require__(35)(process) == 'process'; 17408 17409 module.exports = function () { 17410 var head, last, notify; 17411 17412 var flush = function () { 17413 var parent, fn; 17414 if (isNode && (parent = process.domain)) parent.exit(); 17415 while (head) { 17416 fn = head.fn; 17417 head = head.next; 17418 try { 17419 fn(); 17420 } catch (e) { 17421 if (head) notify(); 17422 else last = undefined; 17423 throw e; 17424 } 17425 } last = undefined; 17426 if (parent) parent.enter(); 17427 }; 17428 17429 // Node.js 17430 if (isNode) { 17431 notify = function () { 17432 process.nextTick(flush); 17433 }; 17434 // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339 17435 } else if (Observer && !(global.navigator && global.navigator.standalone)) { 17436 var toggle = true; 17437 var node = document.createTextNode(''); 17438 new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new 17439 notify = function () { 17440 node.data = toggle = !toggle; 17441 }; 17442 // environments with maybe non-completely correct, but existent Promise 17443 } else if (Promise && Promise.resolve) { 17444 // Promise.resolve without an argument throws an error in LG WebOS 2 17445 var promise = Promise.resolve(undefined); 17446 notify = function () { 17447 promise.then(flush); 17448 }; 17449 // for other environments - macrotask based on: 17450 // - setImmediate 17451 // - MessageChannel 17452 // - window.postMessag 17453 // - onreadystatechange 17454 // - setTimeout 17455 } else { 17456 notify = function () { 17457 // strange IE + webpack dev server bug - use .call(global) 17458 macrotask.call(global, flush); 17459 }; 17460 } 17461 17462 return function (fn) { 17463 var task = { fn: fn, next: undefined }; 17464 if (last) last.next = task; 17465 if (!head) { 17466 head = task; 17467 notify(); 17468 } last = task; 17469 }; 17470 }; 17471 17472 17473/***/ }), 17474/* 216 */ 17475/***/ (function(module, exports, __webpack_require__) { 17476 17477 'use strict'; 17478 // 25.4.1.5 NewPromiseCapability(C) 17479 var aFunction = __webpack_require__(22); 17480 17481 function PromiseCapability(C) { 17482 var resolve, reject; 17483 this.promise = new C(function ($$resolve, $$reject) { 17484 if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); 17485 resolve = $$resolve; 17486 reject = $$reject; 17487 }); 17488 this.resolve = aFunction(resolve); 17489 this.reject = aFunction(reject); 17490 } 17491 17492 module.exports.f = function (C) { 17493 return new PromiseCapability(C); 17494 }; 17495 17496 17497/***/ }), 17498/* 217 */ 17499/***/ (function(module, exports) { 17500 17501 module.exports = function (exec) { 17502 try { 17503 return { e: false, v: exec() }; 17504 } catch (e) { 17505 return { e: true, v: e }; 17506 } 17507 }; 17508 17509 17510/***/ }), 17511/* 218 */ 17512/***/ (function(module, exports, __webpack_require__) { 17513 17514 var global = __webpack_require__(5); 17515 var navigator = global.navigator; 17516 17517 module.exports = navigator && navigator.userAgent || ''; 17518 17519 17520/***/ }), 17521/* 219 */ 17522/***/ (function(module, exports, __webpack_require__) { 17523 17524 var anObject = __webpack_require__(13); 17525 var isObject = __webpack_require__(14); 17526 var newPromiseCapability = __webpack_require__(216); 17527 17528 module.exports = function (C, x) { 17529 anObject(C); 17530 if (isObject(x) && x.constructor === C) return x; 17531 var promiseCapability = newPromiseCapability.f(C); 17532 var resolve = promiseCapability.resolve; 17533 resolve(x); 17534 return promiseCapability.promise; 17535 }; 17536 17537 17538/***/ }), 17539/* 220 */ 17540/***/ (function(module, exports, __webpack_require__) { 17541 17542 var redefine = __webpack_require__(19); 17543 module.exports = function (target, src, safe) { 17544 for (var key in src) redefine(target, key, src[key], safe); 17545 return target; 17546 }; 17547 17548 17549/***/ }), 17550/* 221 */ 17551/***/ (function(module, exports, __webpack_require__) { 17552 17553 'use strict'; 17554 var strong = __webpack_require__(222); 17555 var validate = __webpack_require__(223); 17556 var MAP = 'Map'; 17557 17558 // 23.1 Map Objects 17559 module.exports = __webpack_require__(224)(MAP, function (get) { 17560 return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; 17561 }, { 17562 // 23.1.3.6 Map.prototype.get(key) 17563 get: function get(key) { 17564 var entry = strong.getEntry(validate(this, MAP), key); 17565 return entry && entry.v; 17566 }, 17567 // 23.1.3.9 Map.prototype.set(key, value)
vendor: 4,119 bytes, lines 17568-17686
17568 set: function set(key, value) { 17569 return strong.def(validate(this, MAP), key === 0 ? 0 : key, value); 17570 } 17571 }, strong, true); 17572 17573 17574/***/ }), 17575/* 222 */ 17576/***/ (function(module, exports, __webpack_require__) { 17577 17578 'use strict'; 17579 var dP = __webpack_require__(12).f; 17580 var create = __webpack_require__(46); 17581 var redefineAll = __webpack_require__(220); 17582 var ctx = __webpack_require__(21); 17583 var anInstance = __webpack_require__(212); 17584 var forOf = __webpack_require__(213); 17585 var $iterDefine = __webpack_require__(129); 17586 var step = __webpack_require__(196); 17587 var setSpecies = __webpack_require__(194); 17588 var DESCRIPTORS = __webpack_require__(7); 17589 var fastKey = __webpack_require__(23).fastKey; 17590 var validate = __webpack_require__(223); 17591 var SIZE = DESCRIPTORS ? '_s' : 'size'; 17592 17593 var getEntry = function (that, key) { 17594 // fast case 17595 var index = fastKey(key); 17596 var entry; 17597 if (index !== 'F') return that._i[index]; 17598 // frozen object case 17599 for (entry = that._f; entry; entry = entry.n) { 17600 if (entry.k == key) return entry; 17601 } 17602 }; 17603 17604 module.exports = { 17605 getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { 17606 var C = wrapper(function (that, iterable) { 17607 anInstance(that, C, NAME, '_i'); 17608 that._t = NAME; // collection type 17609 that._i = create(null); // index 17610 that._f = undefined; // first entry 17611 that._l = undefined; // last entry 17612 that[SIZE] = 0; // size 17613 if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); 17614 }); 17615 redefineAll(C.prototype, { 17616 // 23.1.3.1 Map.prototype.clear() 17617 // 23.2.3.2 Set.prototype.clear() 17618 clear: function clear() { 17619 for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) { 17620 entry.r = true; 17621 if (entry.p) entry.p = entry.p.n = undefined; 17622 delete data[entry.i]; 17623 } 17624 that._f = that._l = undefined; 17625 that[SIZE] = 0; 17626 }, 17627 // 23.1.3.3 Map.prototype.delete(key) 17628 // 23.2.3.4 Set.prototype.delete(value) 17629 'delete': function (key) { 17630 var that = validate(this, NAME); 17631 var entry = getEntry(that, key); 17632 if (entry) { 17633 var next = entry.n; 17634 var prev = entry.p; 17635 delete that._i[entry.i]; 17636 entry.r = true; 17637 if (prev) prev.n = next; 17638 if (next) next.p = prev; 17639 if (that._f == entry) that._f = next; 17640 if (that._l == entry) that._l = prev; 17641 that[SIZE]--; 17642 } return !!entry; 17643 }, 17644 // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) 17645 // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) 17646 forEach: function forEach(callbackfn /* , that = undefined */) { 17647 validate(this, NAME); 17648 var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3); 17649 var entry; 17650 while (entry = entry ? entry.n : this._f) { 17651 f(entry.v, entry.k, this); 17652 // revert to the last existing entry 17653 while (entry && entry.r) entry = entry.p; 17654 } 17655 }, 17656 // 23.1.3.7 Map.prototype.has(key) 17657 // 23.2.3.7 Set.prototype.has(value) 17658 has: function has(key) { 17659 return !!getEntry(validate(this, NAME), key); 17660 } 17661 }); 17662 if (DESCRIPTORS) dP(C.prototype, 'size', { 17663 get: function () { 17664 return validate(this, NAME)[SIZE]; 17665 } 17666 }); 17667 return C; 17668 }, 17669 def: function (that, key, value) { 17670 var entry = getEntry(that, key); 17671 var prev, index; 17672 // change existing entry 17673 if (entry) { 17674 entry.v = value; 17675 // create new entry 17676 } else { 17677 that._l = entry = { 17678 i: index = fastKey(key, true), // <- index 17679 k: key, // <- key 17680 v: value, // <- value 17681 p: prev = that._l, // <- previous entry 17682 n: undefined, // <- next entry 17683 r: false // <- removed 17684 }; 17685 if (!that._f) that._f = entry; 17686 if (prev) prev.n = entry;
vendor: 12,261 bytes, lines 17687-18052
17687 that[SIZE]++; 17688 // add to index 17689 if (index !== 'F') that._i[index] = entry; 17690 } return that; 17691 }, 17692 getEntry: getEntry, 17693 setStrong: function (C, NAME, IS_MAP) { 17694 // add .keys, .values, .entries, [@@iterator] 17695 // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 17696 $iterDefine(C, NAME, function (iterated, kind) { 17697 this._t = validate(iterated, NAME); // target 17698 this._k = kind; // kind 17699 this._l = undefined; // previous 17700 }, function () { 17701 var that = this; 17702 var kind = that._k; 17703 var entry = that._l; 17704 // revert to the last existing entry 17705 while (entry && entry.r) entry = entry.p; 17706 // get next entry 17707 if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) { 17708 // or finish the iteration 17709 that._t = undefined; 17710 return step(1); 17711 } 17712 // return step by kind 17713 if (kind == 'keys') return step(0, entry.k); 17714 if (kind == 'values') return step(0, entry.v); 17715 return step(0, [entry.k, entry.v]); 17716 }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); 17717 17718 // add [@@species], 23.1.2.2, 23.2.2.2 17719 setSpecies(NAME); 17720 } 17721 }; 17722 17723 17724/***/ }), 17725/* 223 */ 17726/***/ (function(module, exports, __webpack_require__) { 17727 17728 var isObject = __webpack_require__(14); 17729 module.exports = function (it, TYPE) { 17730 if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); 17731 return it; 17732 }; 17733 17734 17735/***/ }), 17736/* 224 */ 17737/***/ (function(module, exports, __webpack_require__) { 17738 17739 'use strict'; 17740 var global = __webpack_require__(5); 17741 var $export = __webpack_require__(9); 17742 var redefine = __webpack_require__(19); 17743 var redefineAll = __webpack_require__(220); 17744 var meta = __webpack_require__(23); 17745 var forOf = __webpack_require__(213); 17746 var anInstance = __webpack_require__(212); 17747 var isObject = __webpack_require__(14); 17748 var fails = __webpack_require__(8); 17749 var $iterDetect = __webpack_require__(167); 17750 var setToStringTag = __webpack_require__(26); 17751 var inheritIfRequired = __webpack_require__(88); 17752 17753 module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { 17754 var Base = global[NAME]; 17755 var C = Base; 17756 var ADDER = IS_MAP ? 'set' : 'add'; 17757 var proto = C && C.prototype; 17758 var O = {}; 17759 var fixMethod = function (KEY) { 17760 var fn = proto[KEY]; 17761 redefine(proto, KEY, 17762 KEY == 'delete' ? function (a) { 17763 return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); 17764 } : KEY == 'has' ? function has(a) { 17765 return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); 17766 } : KEY == 'get' ? function get(a) { 17767 return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); 17768 } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; } 17769 : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; } 17770 ); 17771 }; 17772 if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () { 17773 new C().entries().next(); 17774 }))) { 17775 // create collection constructor 17776 C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); 17777 redefineAll(C.prototype, methods); 17778 meta.NEED = true; 17779 } else { 17780 var instance = new C(); 17781 // early implementations not supports chaining 17782 var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; 17783 // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false 17784 var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); 17785 // most early implementations doesn't supports iterables, most modern - not close it correctly 17786 var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new 17787 // for early implementations -0 and +0 not the same 17788 var BUGGY_ZERO = !IS_WEAK && fails(function () { 17789 // V8 ~ Chromium 42- fails only with 5+ elements 17790 var $instance = new C(); 17791 var index = 5; 17792 while (index--) $instance[ADDER](index, index); 17793 return !$instance.has(-0); 17794 }); 17795 if (!ACCEPT_ITERABLES) { 17796 C = wrapper(function (target, iterable) { 17797 anInstance(target, C, NAME); 17798 var that = inheritIfRequired(new Base(), target, C); 17799 if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); 17800 return that; 17801 }); 17802 C.prototype = proto; 17803 proto.constructor = C; 17804 } 17805 if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { 17806 fixMethod('delete'); 17807 fixMethod('has'); 17808 IS_MAP && fixMethod('get'); 17809 } 17810 if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); 17811 // weak collections should not contains .clear method 17812 if (IS_WEAK && proto.clear) delete proto.clear; 17813 } 17814 17815 setToStringTag(C, NAME); 17816 17817 O[NAME] = C; 17818 $export($export.G + $export.W + $export.F * (C != Base), O); 17819 17820 if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); 17821 17822 return C; 17823 }; 17824 17825 17826/***/ }), 17827/* 225 */ 17828/***/ (function(module, exports, __webpack_require__) { 17829 17830 'use strict'; 17831 var strong = __webpack_require__(222); 17832 var validate = __webpack_require__(223); 17833 var SET = 'Set'; 17834 17835 // 23.2 Set Objects 17836 module.exports = __webpack_require__(224)(SET, function (get) { 17837 return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; 17838 }, { 17839 // 23.2.3.1 Set.prototype.add(value) 17840 add: function add(value) { 17841 return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value); 17842 } 17843 }, strong); 17844 17845 17846/***/ }), 17847/* 226 */ 17848/***/ (function(module, exports, __webpack_require__) { 17849 17850 'use strict'; 17851 var each = __webpack_require__(174)(0); 17852 var redefine = __webpack_require__(19); 17853 var meta = __webpack_require__(23); 17854 var assign = __webpack_require__(69); 17855 var weak = __webpack_require__(227); 17856 var isObject = __webpack_require__(14); 17857 var fails = __webpack_require__(8); 17858 var validate = __webpack_require__(223); 17859 var WEAK_MAP = 'WeakMap'; 17860 var getWeak = meta.getWeak; 17861 var isExtensible = Object.isExtensible; 17862 var uncaughtFrozenStore = weak.ufstore; 17863 var tmp = {}; 17864 var InternalMap; 17865 17866 var wrapper = function (get) { 17867 return function WeakMap() { 17868 return get(this, arguments.length > 0 ? arguments[0] : undefined); 17869 }; 17870 }; 17871 17872 var methods = { 17873 // 23.3.3.3 WeakMap.prototype.get(key) 17874 get: function get(key) { 17875 if (isObject(key)) { 17876 var data = getWeak(key); 17877 if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key); 17878 return data ? data[this._i] : undefined; 17879 } 17880 }, 17881 // 23.3.3.5 WeakMap.prototype.set(key, value) 17882 set: function set(key, value) { 17883 return weak.def(validate(this, WEAK_MAP), key, value); 17884 } 17885 }; 17886 17887 // 23.3 WeakMap Objects 17888 var $WeakMap = module.exports = __webpack_require__(224)(WEAK_MAP, wrapper, methods, weak, true, true); 17889 17890 // IE11 WeakMap frozen keys fix 17891 if (fails(function () { return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; })) { 17892 InternalMap = weak.getConstructor(wrapper, WEAK_MAP); 17893 assign(InternalMap.prototype, methods); 17894 meta.NEED = true; 17895 each(['delete', 'has', 'get', 'set'], function (key) { 17896 var proto = $WeakMap.prototype; 17897 var method = proto[key]; 17898 redefine(proto, key, function (a, b) { 17899 // store frozen objects on internal weakmap shim 17900 if (isObject(a) && !isExtensible(a)) { 17901 if (!this._f) this._f = new InternalMap(); 17902 var result = this._f[key](a, b); 17903 return key == 'set' ? this : result; 17904 // store all the rest on native weakmap 17905 } return method.call(this, a, b); 17906 }); 17907 }); 17908 } 17909 17910 17911/***/ }), 17912/* 227 */ 17913/***/ (function(module, exports, __webpack_require__) { 17914 17915 'use strict'; 17916 var redefineAll = __webpack_require__(220); 17917 var getWeak = __webpack_require__(23).getWeak; 17918 var anObject = __webpack_require__(13); 17919 var isObject = __webpack_require__(14); 17920 var anInstance = __webpack_require__(212); 17921 var forOf = __webpack_require__(213); 17922 var createArrayMethod = __webpack_require__(174); 17923 var $has = __webpack_require__(6); 17924 var validate = __webpack_require__(223); 17925 var arrayFind = createArrayMethod(5); 17926 var arrayFindIndex = createArrayMethod(6); 17927 var id = 0; 17928 17929 // fallback for uncaught frozen keys 17930 var uncaughtFrozenStore = function (that) { 17931 return that._l || (that._l = new UncaughtFrozenStore()); 17932 }; 17933 var UncaughtFrozenStore = function () { 17934 this.a = []; 17935 }; 17936 var findUncaughtFrozen = function (store, key) { 17937 return arrayFind(store.a, function (it) { 17938 return it[0] === key; 17939 }); 17940 }; 17941 UncaughtFrozenStore.prototype = { 17942 get: function (key) { 17943 var entry = findUncaughtFrozen(this, key); 17944 if (entry) return entry[1]; 17945 }, 17946 has: function (key) { 17947 return !!findUncaughtFrozen(this, key); 17948 }, 17949 set: function (key, value) { 17950 var entry = findUncaughtFrozen(this, key); 17951 if (entry) entry[1] = value; 17952 else this.a.push([key, value]); 17953 }, 17954 'delete': function (key) { 17955 var index = arrayFindIndex(this.a, function (it) { 17956 return it[0] === key; 17957 }); 17958 if (~index) this.a.splice(index, 1); 17959 return !!~index; 17960 } 17961 }; 17962 17963 module.exports = { 17964 getConstructor: function (wrapper, NAME, IS_MAP, ADDER) { 17965 var C = wrapper(function (that, iterable) { 17966 anInstance(that, C, NAME, '_i'); 17967 that._t = NAME; // collection type 17968 that._i = id++; // collection id 17969 that._l = undefined; // leak store for uncaught frozen objects 17970 if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); 17971 }); 17972 redefineAll(C.prototype, { 17973 // 23.3.3.2 WeakMap.prototype.delete(key) 17974 // 23.4.3.3 WeakSet.prototype.delete(value) 17975 'delete': function (key) { 17976 if (!isObject(key)) return false; 17977 var data = getWeak(key); 17978 if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key); 17979 return data && $has(data, this._i) && delete data[this._i]; 17980 }, 17981 // 23.3.3.4 WeakMap.prototype.has(key) 17982 // 23.4.3.4 WeakSet.prototype.has(value) 17983 has: function has(key) { 17984 if (!isObject(key)) return false; 17985 var data = getWeak(key); 17986 if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key); 17987 return data && $has(data, this._i); 17988 } 17989 }); 17990 return C; 17991 }, 17992 def: function (that, key, value) { 17993 var data = getWeak(anObject(key), true); 17994 if (data === true) uncaughtFrozenStore(that).set(key, value); 17995 else data[that._i] = value; 17996 return that; 17997 }, 17998 ufstore: uncaughtFrozenStore 17999 }; 18000 18001 18002/***/ }), 18003/* 228 */ 18004/***/ (function(module, exports, __webpack_require__) { 18005 18006 'use strict'; 18007 var weak = __webpack_require__(227); 18008 var validate = __webpack_require__(223); 18009 var WEAK_SET = 'WeakSet'; 18010 18011 // 23.4 WeakSet Objects 18012 __webpack_require__(224)(WEAK_SET, function (get) { 18013 return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); }; 18014 }, { 18015 // 23.4.3.1 WeakSet.prototype.add(value) 18016 add: function add(value) { 18017 return weak.def(validate(this, WEAK_SET), value, true); 18018 } 18019 }, weak, false, true); 18020 18021 18022/***/ }), 18023/* 229 */ 18024/***/ (function(module, exports, __webpack_require__) { 18025 18026 'use strict'; 18027 var $export = __webpack_require__(9); 18028 var $typed = __webpack_require__(230); 18029 var buffer = __webpack_require__(231); 18030 var anObject = __webpack_require__(13); 18031 var toAbsoluteIndex = __webpack_require__(40); 18032 var toLength = __webpack_require__(38); 18033 var isObject = __webpack_require__(14); 18034 var ArrayBuffer = __webpack_require__(5).ArrayBuffer; 18035 var speciesConstructor = __webpack_require__(210); 18036 var $ArrayBuffer = buffer.ArrayBuffer; 18037 var $DataView = buffer.DataView; 18038 var $isView = $typed.ABV && ArrayBuffer.isView; 18039 var $slice = $ArrayBuffer.prototype.slice; 18040 var VIEW = $typed.VIEW; 18041 var ARRAY_BUFFER = 'ArrayBuffer'; 18042 18043 $export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer }); 18044 18045 $export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, { 18046 // 24.1.3.1 ArrayBuffer.isView(arg) 18047 isView: function isView(it) { 18048 return $isView && $isView(it) || isObject(it) && VIEW in it; 18049 } 18050 }); 18051 18052 $export($export.P + $export.U + $export.F * __webpack_require__(8)(function () {
vendor: 15,351 bytes, lines 18053-18500
18053 return !new $ArrayBuffer(2).slice(1, undefined).byteLength; 18054 }), ARRAY_BUFFER, { 18055 // 24.1.4.3 ArrayBuffer.prototype.slice(start, end) 18056 slice: function slice(start, end) { 18057 if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix 18058 var len = anObject(this).byteLength; 18059 var first = toAbsoluteIndex(start, len); 18060 var fin = toAbsoluteIndex(end === undefined ? len : end, len); 18061 var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first)); 18062 var viewS = new $DataView(this); 18063 var viewT = new $DataView(result); 18064 var index = 0; 18065 while (first < fin) { 18066 viewT.setUint8(index++, viewS.getUint8(first++)); 18067 } return result; 18068 } 18069 }); 18070 18071 __webpack_require__(194)(ARRAY_BUFFER); 18072 18073 18074/***/ }), 18075/* 230 */ 18076/***/ (function(module, exports, __webpack_require__) { 18077 18078 var global = __webpack_require__(5); 18079 var hide = __webpack_require__(11); 18080 var uid = __webpack_require__(20); 18081 var TYPED = uid('typed_array'); 18082 var VIEW = uid('view'); 18083 var ABV = !!(global.ArrayBuffer && global.DataView); 18084 var CONSTR = ABV; 18085 var i = 0; 18086 var l = 9; 18087 var Typed; 18088 18089 var TypedArrayConstructors = ( 18090 'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array' 18091 ).split(','); 18092 18093 while (i < l) { 18094 if (Typed = global[TypedArrayConstructors[i++]]) { 18095 hide(Typed.prototype, TYPED, true); 18096 hide(Typed.prototype, VIEW, true); 18097 } else CONSTR = false; 18098 } 18099 18100 module.exports = { 18101 ABV: ABV, 18102 CONSTR: CONSTR, 18103 TYPED: TYPED, 18104 VIEW: VIEW 18105 }; 18106 18107 18108/***/ }), 18109/* 231 */ 18110/***/ (function(module, exports, __webpack_require__) { 18111 18112 'use strict'; 18113 var global = __webpack_require__(5); 18114 var DESCRIPTORS = __webpack_require__(7); 18115 var LIBRARY = __webpack_require__(25); 18116 var $typed = __webpack_require__(230); 18117 var hide = __webpack_require__(11); 18118 var redefineAll = __webpack_require__(220); 18119 var fails = __webpack_require__(8); 18120 var anInstance = __webpack_require__(212); 18121 var toInteger = __webpack_require__(39); 18122 var toLength = __webpack_require__(38); 18123 var toIndex = __webpack_require__(232); 18124 var gOPN = __webpack_require__(50).f; 18125 var dP = __webpack_require__(12).f; 18126 var arrayFill = __webpack_require__(190); 18127 var setToStringTag = __webpack_require__(26); 18128 var ARRAY_BUFFER = 'ArrayBuffer'; 18129 var DATA_VIEW = 'DataView'; 18130 var PROTOTYPE = 'prototype'; 18131 var WRONG_LENGTH = 'Wrong length!'; 18132 var WRONG_INDEX = 'Wrong index!'; 18133 var $ArrayBuffer = global[ARRAY_BUFFER]; 18134 var $DataView = global[DATA_VIEW]; 18135 var Math = global.Math; 18136 var RangeError = global.RangeError; 18137 // eslint-disable-next-line no-shadow-restricted-names 18138 var Infinity = global.Infinity; 18139 var BaseBuffer = $ArrayBuffer; 18140 var abs = Math.abs; 18141 var pow = Math.pow; 18142 var floor = Math.floor; 18143 var log = Math.log; 18144 var LN2 = Math.LN2; 18145 var BUFFER = 'buffer'; 18146 var BYTE_LENGTH = 'byteLength'; 18147 var BYTE_OFFSET = 'byteOffset'; 18148 var $BUFFER = DESCRIPTORS ? '_b' : BUFFER; 18149 var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH; 18150 var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET; 18151 18152 // IEEE754 conversions based on https://github.com/feross/ieee754 18153 function packIEEE754(value, mLen, nBytes) { 18154 var buffer = new Array(nBytes); 18155 var eLen = nBytes * 8 - mLen - 1; 18156 var eMax = (1 << eLen) - 1; 18157 var eBias = eMax >> 1; 18158 var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0; 18159 var i = 0; 18160 var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0; 18161 var e, m, c; 18162 value = abs(value); 18163 // eslint-disable-next-line no-self-compare 18164 if (value != value || value === Infinity) { 18165 // eslint-disable-next-line no-self-compare 18166 m = value != value ? 1 : 0; 18167 e = eMax; 18168 } else { 18169 e = floor(log(value) / LN2); 18170 if (value * (c = pow(2, -e)) < 1) { 18171 e--; 18172 c *= 2; 18173 } 18174 if (e + eBias >= 1) { 18175 value += rt / c; 18176 } else { 18177 value += rt * pow(2, 1 - eBias); 18178 } 18179 if (value * c >= 2) { 18180 e++; 18181 c /= 2; 18182 } 18183 if (e + eBias >= eMax) { 18184 m = 0; 18185 e = eMax; 18186 } else if (e + eBias >= 1) { 18187 m = (value * c - 1) * pow(2, mLen); 18188 e = e + eBias; 18189 } else { 18190 m = value * pow(2, eBias - 1) * pow(2, mLen); 18191 e = 0; 18192 } 18193 } 18194 for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8); 18195 e = e << mLen | m; 18196 eLen += mLen; 18197 for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8); 18198 buffer[--i] |= s * 128; 18199 return buffer; 18200 } 18201 function unpackIEEE754(buffer, mLen, nBytes) { 18202 var eLen = nBytes * 8 - mLen - 1; 18203 var eMax = (1 << eLen) - 1; 18204 var eBias = eMax >> 1; 18205 var nBits = eLen - 7; 18206 var i = nBytes - 1; 18207 var s = buffer[i--]; 18208 var e = s & 127; 18209 var m; 18210 s >>= 7; 18211 for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8); 18212 m = e & (1 << -nBits) - 1; 18213 e >>= -nBits; 18214 nBits += mLen; 18215 for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8); 18216 if (e === 0) { 18217 e = 1 - eBias; 18218 } else if (e === eMax) { 18219 return m ? NaN : s ? -Infinity : Infinity; 18220 } else { 18221 m = m + pow(2, mLen); 18222 e = e - eBias; 18223 } return (s ? -1 : 1) * m * pow(2, e - mLen); 18224 } 18225 18226 function unpackI32(bytes) { 18227 return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0]; 18228 } 18229 function packI8(it) { 18230 return [it & 0xff]; 18231 } 18232 function packI16(it) { 18233 return [it & 0xff, it >> 8 & 0xff]; 18234 } 18235 function packI32(it) { 18236 return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff]; 18237 } 18238 function packF64(it) { 18239 return packIEEE754(it, 52, 8); 18240 } 18241 function packF32(it) { 18242 return packIEEE754(it, 23, 4); 18243 } 18244 18245 function addGetter(C, key, internal) { 18246 dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } }); 18247 } 18248 18249 function get(view, bytes, index, isLittleEndian) { 18250 var numIndex = +index; 18251 var intIndex = toIndex(numIndex); 18252 if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); 18253 var store = view[$BUFFER]._b; 18254 var start = intIndex + view[$OFFSET]; 18255 var pack = store.slice(start, start + bytes); 18256 return isLittleEndian ? pack : pack.reverse(); 18257 } 18258 function set(view, bytes, index, conversion, value, isLittleEndian) { 18259 var numIndex = +index; 18260 var intIndex = toIndex(numIndex); 18261 if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX); 18262 var store = view[$BUFFER]._b; 18263 var start = intIndex + view[$OFFSET]; 18264 var pack = conversion(+value); 18265 for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1]; 18266 } 18267 18268 if (!$typed.ABV) { 18269 $ArrayBuffer = function ArrayBuffer(length) { 18270 anInstance(this, $ArrayBuffer, ARRAY_BUFFER); 18271 var byteLength = toIndex(length); 18272 this._b = arrayFill.call(new Array(byteLength), 0); 18273 this[$LENGTH] = byteLength; 18274 }; 18275 18276 $DataView = function DataView(buffer, byteOffset, byteLength) { 18277 anInstance(this, $DataView, DATA_VIEW); 18278 anInstance(buffer, $ArrayBuffer, DATA_VIEW); 18279 var bufferLength = buffer[$LENGTH]; 18280 var offset = toInteger(byteOffset); 18281 if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!'); 18282 byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength); 18283 if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH); 18284 this[$BUFFER] = buffer; 18285 this[$OFFSET] = offset; 18286 this[$LENGTH] = byteLength; 18287 }; 18288 18289 if (DESCRIPTORS) { 18290 addGetter($ArrayBuffer, BYTE_LENGTH, '_l'); 18291 addGetter($DataView, BUFFER, '_b'); 18292 addGetter($DataView, BYTE_LENGTH, '_l'); 18293 addGetter($DataView, BYTE_OFFSET, '_o'); 18294 } 18295 18296 redefineAll($DataView[PROTOTYPE], { 18297 getInt8: function getInt8(byteOffset) { 18298 return get(this, 1, byteOffset)[0] << 24 >> 24; 18299 }, 18300 getUint8: function getUint8(byteOffset) { 18301 return get(this, 1, byteOffset)[0]; 18302 }, 18303 getInt16: function getInt16(byteOffset /* , littleEndian */) { 18304 var bytes = get(this, 2, byteOffset, arguments[1]); 18305 return (bytes[1] << 8 | bytes[0]) << 16 >> 16; 18306 }, 18307 getUint16: function getUint16(byteOffset /* , littleEndian */) { 18308 var bytes = get(this, 2, byteOffset, arguments[1]); 18309 return bytes[1] << 8 | bytes[0]; 18310 }, 18311 getInt32: function getInt32(byteOffset /* , littleEndian */) { 18312 return unpackI32(get(this, 4, byteOffset, arguments[1])); 18313 }, 18314 getUint32: function getUint32(byteOffset /* , littleEndian */) { 18315 return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0; 18316 }, 18317 getFloat32: function getFloat32(byteOffset /* , littleEndian */) { 18318 return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4); 18319 }, 18320 getFloat64: function getFloat64(byteOffset /* , littleEndian */) { 18321 return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8); 18322 }, 18323 setInt8: function setInt8(byteOffset, value) { 18324 set(this, 1, byteOffset, packI8, value); 18325 }, 18326 setUint8: function setUint8(byteOffset, value) { 18327 set(this, 1, byteOffset, packI8, value); 18328 }, 18329 setInt16: function setInt16(byteOffset, value /* , littleEndian */) { 18330 set(this, 2, byteOffset, packI16, value, arguments[2]); 18331 }, 18332 setUint16: function setUint16(byteOffset, value /* , littleEndian */) { 18333 set(this, 2, byteOffset, packI16, value, arguments[2]); 18334 }, 18335 setInt32: function setInt32(byteOffset, value /* , littleEndian */) { 18336 set(this, 4, byteOffset, packI32, value, arguments[2]); 18337 }, 18338 setUint32: function setUint32(byteOffset, value /* , littleEndian */) { 18339 set(this, 4, byteOffset, packI32, value, arguments[2]); 18340 }, 18341 setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) { 18342 set(this, 4, byteOffset, packF32, value, arguments[2]); 18343 }, 18344 setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) { 18345 set(this, 8, byteOffset, packF64, value, arguments[2]); 18346 } 18347 }); 18348 } else { 18349 if (!fails(function () { 18350 $ArrayBuffer(1); 18351 }) || !fails(function () { 18352 new $ArrayBuffer(-1); // eslint-disable-line no-new 18353 }) || fails(function () { 18354 new $ArrayBuffer(); // eslint-disable-line no-new 18355 new $ArrayBuffer(1.5); // eslint-disable-line no-new 18356 new $ArrayBuffer(NaN); // eslint-disable-line no-new 18357 return $ArrayBuffer.name != ARRAY_BUFFER; 18358 })) { 18359 $ArrayBuffer = function ArrayBuffer(length) { 18360 anInstance(this, $ArrayBuffer); 18361 return new BaseBuffer(toIndex(length)); 18362 }; 18363 var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE]; 18364 for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) { 18365 if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]); 18366 } 18367 if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer; 18368 } 18369 // iOS Safari 7.x bug 18370 var view = new $DataView(new $ArrayBuffer(2)); 18371 var $setInt8 = $DataView[PROTOTYPE].setInt8; 18372 view.setInt8(0, 2147483648); 18373 view.setInt8(1, 2147483649); 18374 if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], { 18375 setInt8: function setInt8(byteOffset, value) { 18376 $setInt8.call(this, byteOffset, value << 24 >> 24); 18377 }, 18378 setUint8: function setUint8(byteOffset, value) { 18379 $setInt8.call(this, byteOffset, value << 24 >> 24); 18380 } 18381 }, true); 18382 } 18383 setToStringTag($ArrayBuffer, ARRAY_BUFFER); 18384 setToStringTag($DataView, DATA_VIEW); 18385 hide($DataView[PROTOTYPE], $typed.VIEW, true); 18386 exports[ARRAY_BUFFER] = $ArrayBuffer; 18387 exports[DATA_VIEW] = $DataView; 18388 18389 18390/***/ }), 18391/* 232 */ 18392/***/ (function(module, exports, __webpack_require__) { 18393 18394 // https://tc39.github.io/ecma262/#sec-toindex 18395 var toInteger = __webpack_require__(39); 18396 var toLength = __webpack_require__(38); 18397 module.exports = function (it) { 18398 if (it === undefined) return 0; 18399 var number = toInteger(it); 18400 var length = toLength(number); 18401 if (number !== length) throw RangeError('Wrong length!'); 18402 return length; 18403 }; 18404 18405 18406/***/ }), 18407/* 233 */ 18408/***/ (function(module, exports, __webpack_require__) { 18409 18410 var $export = __webpack_require__(9); 18411 $export($export.G + $export.W + $export.F * !__webpack_require__(230).ABV, { 18412 DataView: __webpack_require__(231).DataView 18413 }); 18414 18415 18416/***/ }), 18417/* 234 */ 18418/***/ (function(module, exports, __webpack_require__) { 18419 18420 __webpack_require__(235)('Int8', 1, function (init) { 18421 return function Int8Array(data, byteOffset, length) { 18422 return init(this, data, byteOffset, length); 18423 }; 18424 }); 18425 18426 18427/***/ }), 18428/* 235 */ 18429/***/ (function(module, exports, __webpack_require__) { 18430 18431 'use strict'; 18432 if (__webpack_require__(7)) { 18433 var LIBRARY = __webpack_require__(25); 18434 var global = __webpack_require__(5); 18435 var fails = __webpack_require__(8); 18436 var $export = __webpack_require__(9); 18437 var $typed = __webpack_require__(230); 18438 var $buffer = __webpack_require__(231); 18439 var ctx = __webpack_require__(21); 18440 var anInstance = __webpack_require__(212); 18441 var propertyDesc = __webpack_require__(18); 18442 var hide = __webpack_require__(11); 18443 var redefineAll = __webpack_require__(220); 18444 var toInteger = __webpack_require__(39); 18445 var toLength = __webpack_require__(38); 18446 var toIndex = __webpack_require__(232); 18447 var toAbsoluteIndex = __webpack_require__(40); 18448 var toPrimitive = __webpack_require__(17); 18449 var has = __webpack_require__(6); 18450 var classof = __webpack_require__(75); 18451 var isObject = __webpack_require__(14); 18452 var toObject = __webpack_require__(58); 18453 var isArrayIter = __webpack_require__(164); 18454 var create = __webpack_require__(46); 18455 var getPrototypeOf = __webpack_require__(59); 18456 var gOPN = __webpack_require__(50).f; 18457 var getIterFn = __webpack_require__(166); 18458 var uid = __webpack_require__(20); 18459 var wks = __webpack_require__(27); 18460 var createArrayMethod = __webpack_require__(174); 18461 var createArrayIncludes = __webpack_require__(37); 18462 var speciesConstructor = __webpack_require__(210); 18463 var ArrayIterators = __webpack_require__(195); 18464 var Iterators = __webpack_require__(130); 18465 var $iterDetect = __webpack_require__(167); 18466 var setSpecies = __webpack_require__(194); 18467 var arrayFill = __webpack_require__(190); 18468 var arrayCopyWithin = __webpack_require__(187); 18469 var $DP = __webpack_require__(12); 18470 var $GOPD = __webpack_require__(51); 18471 var dP = $DP.f; 18472 var gOPD = $GOPD.f; 18473 var RangeError = global.RangeError; 18474 var TypeError = global.TypeError; 18475 var Uint8Array = global.Uint8Array; 18476 var ARRAY_BUFFER = 'ArrayBuffer'; 18477 var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER; 18478 var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT'; 18479 var PROTOTYPE = 'prototype'; 18480 var ArrayProto = Array[PROTOTYPE]; 18481 var $ArrayBuffer = $buffer.ArrayBuffer; 18482 var $DataView = $buffer.DataView; 18483 var arrayForEach = createArrayMethod(0); 18484 var arrayFilter = createArrayMethod(2); 18485 var arraySome = createArrayMethod(3); 18486 var arrayEvery = createArrayMethod(4); 18487 var arrayFind = createArrayMethod(5); 18488 var arrayFindIndex = createArrayMethod(6); 18489 var arrayIncludes = createArrayIncludes(true); 18490 var arrayIndexOf = createArrayIncludes(false); 18491 var arrayValues = ArrayIterators.values; 18492 var arrayKeys = ArrayIterators.keys; 18493 var arrayEntries = ArrayIterators.entries; 18494 var arrayLastIndexOf = ArrayProto.lastIndexOf; 18495 var arrayReduce = ArrayProto.reduce; 18496 var arrayReduceRight = ArrayProto.reduceRight; 18497 var arrayJoin = ArrayProto.join; 18498 var arraySort = ArrayProto.sort; 18499 var arraySlice = ArrayProto.slice; 18500 var arrayToString = ArrayProto.toString;
vendor: 13,430 bytes, lines 18501-18850
18501 var arrayToLocaleString = ArrayProto.toLocaleString; 18502 var ITERATOR = wks('iterator'); 18503 var TAG = wks('toStringTag'); 18504 var TYPED_CONSTRUCTOR = uid('typed_constructor'); 18505 var DEF_CONSTRUCTOR = uid('def_constructor'); 18506 var ALL_CONSTRUCTORS = $typed.CONSTR; 18507 var TYPED_ARRAY = $typed.TYPED; 18508 var VIEW = $typed.VIEW; 18509 var WRONG_LENGTH = 'Wrong length!'; 18510 18511 var $map = createArrayMethod(1, function (O, length) { 18512 return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length); 18513 }); 18514 18515 var LITTLE_ENDIAN = fails(function () { 18516 // eslint-disable-next-line no-undef 18517 return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1; 18518 }); 18519 18520 var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () { 18521 new Uint8Array(1).set({}); 18522 }); 18523 18524 var toOffset = function (it, BYTES) { 18525 var offset = toInteger(it); 18526 if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!'); 18527 return offset; 18528 }; 18529 18530 var validate = function (it) { 18531 if (isObject(it) && TYPED_ARRAY in it) return it; 18532 throw TypeError(it + ' is not a typed array!'); 18533 }; 18534 18535 var allocate = function (C, length) { 18536 if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) { 18537 throw TypeError('It is not a typed array constructor!'); 18538 } return new C(length); 18539 }; 18540 18541 var speciesFromList = function (O, list) { 18542 return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list); 18543 }; 18544 18545 var fromList = function (C, list) { 18546 var index = 0; 18547 var length = list.length; 18548 var result = allocate(C, length); 18549 while (length > index) result[index] = list[index++]; 18550 return result; 18551 }; 18552 18553 var addGetter = function (it, key, internal) { 18554 dP(it, key, { get: function () { return this._d[internal]; } }); 18555 }; 18556 18557 var $from = function from(source /* , mapfn, thisArg */) { 18558 var O = toObject(source); 18559 var aLen = arguments.length; 18560 var mapfn = aLen > 1 ? arguments[1] : undefined; 18561 var mapping = mapfn !== undefined; 18562 var iterFn = getIterFn(O); 18563 var i, length, values, result, step, iterator; 18564 if (iterFn != undefined && !isArrayIter(iterFn)) { 18565 for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) { 18566 values.push(step.value); 18567 } O = values; 18568 } 18569 if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2); 18570 for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) { 18571 result[i] = mapping ? mapfn(O[i], i) : O[i]; 18572 } 18573 return result; 18574 }; 18575 18576 var $of = function of(/* ...items */) { 18577 var index = 0; 18578 var length = arguments.length; 18579 var result = allocate(this, length); 18580 while (length > index) result[index] = arguments[index++]; 18581 return result; 18582 }; 18583 18584 // iOS Safari 6.x fails here 18585 var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); }); 18586 18587 var $toLocaleString = function toLocaleString() { 18588 return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments); 18589 }; 18590 18591 var proto = { 18592 copyWithin: function copyWithin(target, start /* , end */) { 18593 return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined); 18594 }, 18595 every: function every(callbackfn /* , thisArg */) { 18596 return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); 18597 }, 18598 fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars 18599 return arrayFill.apply(validate(this), arguments); 18600 }, 18601 filter: function filter(callbackfn /* , thisArg */) { 18602 return speciesFromList(this, arrayFilter(validate(this), callbackfn, 18603 arguments.length > 1 ? arguments[1] : undefined)); 18604 }, 18605 find: function find(predicate /* , thisArg */) { 18606 return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); 18607 }, 18608 findIndex: function findIndex(predicate /* , thisArg */) { 18609 return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined); 18610 }, 18611 forEach: function forEach(callbackfn /* , thisArg */) { 18612 arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); 18613 }, 18614 indexOf: function indexOf(searchElement /* , fromIndex */) { 18615 return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); 18616 }, 18617 includes: function includes(searchElement /* , fromIndex */) { 18618 return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined); 18619 }, 18620 join: function join(separator) { // eslint-disable-line no-unused-vars 18621 return arrayJoin.apply(validate(this), arguments); 18622 }, 18623 lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars 18624 return arrayLastIndexOf.apply(validate(this), arguments); 18625 }, 18626 map: function map(mapfn /* , thisArg */) { 18627 return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined); 18628 }, 18629 reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars 18630 return arrayReduce.apply(validate(this), arguments); 18631 }, 18632 reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars 18633 return arrayReduceRight.apply(validate(this), arguments); 18634 }, 18635 reverse: function reverse() { 18636 var that = this; 18637 var length = validate(that).length; 18638 var middle = Math.floor(length / 2); 18639 var index = 0; 18640 var value; 18641 while (index < middle) { 18642 value = that[index]; 18643 that[index++] = that[--length]; 18644 that[length] = value; 18645 } return that; 18646 }, 18647 some: function some(callbackfn /* , thisArg */) { 18648 return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined); 18649 }, 18650 sort: function sort(comparefn) { 18651 return arraySort.call(validate(this), comparefn); 18652 }, 18653 subarray: function subarray(begin, end) { 18654 var O = validate(this); 18655 var length = O.length; 18656 var $begin = toAbsoluteIndex(begin, length); 18657 return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))( 18658 O.buffer, 18659 O.byteOffset + $begin * O.BYTES_PER_ELEMENT, 18660 toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin) 18661 ); 18662 } 18663 }; 18664 18665 var $slice = function slice(start, end) { 18666 return speciesFromList(this, arraySlice.call(validate(this), start, end)); 18667 }; 18668 18669 var $set = function set(arrayLike /* , offset */) { 18670 validate(this); 18671 var offset = toOffset(arguments[1], 1); 18672 var length = this.length; 18673 var src = toObject(arrayLike); 18674 var len = toLength(src.length); 18675 var index = 0; 18676 if (len + offset > length) throw RangeError(WRONG_LENGTH); 18677 while (index < len) this[offset + index] = src[index++]; 18678 }; 18679 18680 var $iterators = { 18681 entries: function entries() { 18682 return arrayEntries.call(validate(this)); 18683 }, 18684 keys: function keys() { 18685 return arrayKeys.call(validate(this)); 18686 }, 18687 values: function values() { 18688 return arrayValues.call(validate(this)); 18689 } 18690 }; 18691 18692 var isTAIndex = function (target, key) { 18693 return isObject(target) 18694 && target[TYPED_ARRAY] 18695 && typeof key != 'symbol' 18696 && key in target 18697 && String(+key) == String(key); 18698 }; 18699 var $getDesc = function getOwnPropertyDescriptor(target, key) { 18700 return isTAIndex(target, key = toPrimitive(key, true)) 18701 ? propertyDesc(2, target[key]) 18702 : gOPD(target, key); 18703 }; 18704 var $setDesc = function defineProperty(target, key, desc) { 18705 if (isTAIndex(target, key = toPrimitive(key, true)) 18706 && isObject(desc) 18707 && has(desc, 'value') 18708 && !has(desc, 'get') 18709 && !has(desc, 'set') 18710 // TODO: add validation descriptor w/o calling accessors 18711 && !desc.configurable 18712 && (!has(desc, 'writable') || desc.writable) 18713 && (!has(desc, 'enumerable') || desc.enumerable) 18714 ) { 18715 target[key] = desc.value; 18716 return target; 18717 } return dP(target, key, desc); 18718 }; 18719 18720 if (!ALL_CONSTRUCTORS) { 18721 $GOPD.f = $getDesc; 18722 $DP.f = $setDesc; 18723 } 18724 18725 $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', { 18726 getOwnPropertyDescriptor: $getDesc, 18727 defineProperty: $setDesc 18728 }); 18729 18730 if (fails(function () { arrayToString.call({}); })) { 18731 arrayToString = arrayToLocaleString = function toString() { 18732 return arrayJoin.call(this); 18733 }; 18734 } 18735 18736 var $TypedArrayPrototype$ = redefineAll({}, proto); 18737 redefineAll($TypedArrayPrototype$, $iterators); 18738 hide($TypedArrayPrototype$, ITERATOR, $iterators.values); 18739 redefineAll($TypedArrayPrototype$, { 18740 slice: $slice, 18741 set: $set, 18742 constructor: function () { /* noop */ }, 18743 toString: arrayToString, 18744 toLocaleString: $toLocaleString 18745 }); 18746 addGetter($TypedArrayPrototype$, 'buffer', 'b'); 18747 addGetter($TypedArrayPrototype$, 'byteOffset', 'o'); 18748 addGetter($TypedArrayPrototype$, 'byteLength', 'l'); 18749 addGetter($TypedArrayPrototype$, 'length', 'e'); 18750 dP($TypedArrayPrototype$, TAG, { 18751 get: function () { return this[TYPED_ARRAY]; } 18752 }); 18753 18754 // eslint-disable-next-line max-statements 18755 module.exports = function (KEY, BYTES, wrapper, CLAMPED) { 18756 CLAMPED = !!CLAMPED; 18757 var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array'; 18758 var GETTER = 'get' + KEY; 18759 var SETTER = 'set' + KEY; 18760 var TypedArray = global[NAME]; 18761 var Base = TypedArray || {}; 18762 var TAC = TypedArray && getPrototypeOf(TypedArray); 18763 var FORCED = !TypedArray || !$typed.ABV; 18764 var O = {}; 18765 var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE]; 18766 var getter = function (that, index) { 18767 var data = that._d; 18768 return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN); 18769 }; 18770 var setter = function (that, index, value) { 18771 var data = that._d; 18772 if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff; 18773 data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN); 18774 }; 18775 var addElement = function (that, index) { 18776 dP(that, index, { 18777 get: function () { 18778 return getter(this, index); 18779 }, 18780 set: function (value) { 18781 return setter(this, index, value); 18782 }, 18783 enumerable: true 18784 }); 18785 }; 18786 if (FORCED) { 18787 TypedArray = wrapper(function (that, data, $offset, $length) { 18788 anInstance(that, TypedArray, NAME, '_d'); 18789 var index = 0; 18790 var offset = 0; 18791 var buffer, byteLength, length, klass; 18792 if (!isObject(data)) { 18793 length = toIndex(data); 18794 byteLength = length * BYTES; 18795 buffer = new $ArrayBuffer(byteLength); 18796 } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { 18797 buffer = data; 18798 offset = toOffset($offset, BYTES); 18799 var $len = data.byteLength; 18800 if ($length === undefined) { 18801 if ($len % BYTES) throw RangeError(WRONG_LENGTH); 18802 byteLength = $len - offset; 18803 if (byteLength < 0) throw RangeError(WRONG_LENGTH); 18804 } else { 18805 byteLength = toLength($length) * BYTES; 18806 if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH); 18807 } 18808 length = byteLength / BYTES; 18809 } else if (TYPED_ARRAY in data) { 18810 return fromList(TypedArray, data); 18811 } else { 18812 return $from.call(TypedArray, data); 18813 } 18814 hide(that, '_d', { 18815 b: buffer, 18816 o: offset, 18817 l: byteLength, 18818 e: length, 18819 v: new $DataView(buffer) 18820 }); 18821 while (index < length) addElement(that, index++); 18822 }); 18823 TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$); 18824 hide(TypedArrayPrototype, 'constructor', TypedArray); 18825 } else if (!fails(function () { 18826 TypedArray(1); 18827 }) || !fails(function () { 18828 new TypedArray(-1); // eslint-disable-line no-new 18829 }) || !$iterDetect(function (iter) { 18830 new TypedArray(); // eslint-disable-line no-new 18831 new TypedArray(null); // eslint-disable-line no-new 18832 new TypedArray(1.5); // eslint-disable-line no-new 18833 new TypedArray(iter); // eslint-disable-line no-new 18834 }, true)) { 18835 TypedArray = wrapper(function (that, data, $offset, $length) { 18836 anInstance(that, TypedArray, NAME); 18837 var klass; 18838 // `ws` module bug, temporarily remove validation length for Uint8Array 18839 // https://github.com/websockets/ws/pull/645 18840 if (!isObject(data)) return new Base(toIndex(data)); 18841 if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) { 18842 return $length !== undefined 18843 ? new Base(data, toOffset($offset, BYTES), $length) 18844 : $offset !== undefined 18845 ? new Base(data, toOffset($offset, BYTES)) 18846 : new Base(data); 18847 } 18848 if (TYPED_ARRAY in data) return fromList(TypedArray, data); 18849 return $from.call(TypedArray, data); 18850 });
vendor: 14,283 bytes, lines 18851-19319
18851 arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) { 18852 if (!(key in TypedArray)) hide(TypedArray, key, Base[key]); 18853 }); 18854 TypedArray[PROTOTYPE] = TypedArrayPrototype; 18855 if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray; 18856 } 18857 var $nativeIterator = TypedArrayPrototype[ITERATOR]; 18858 var CORRECT_ITER_NAME = !!$nativeIterator 18859 && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined); 18860 var $iterator = $iterators.values; 18861 hide(TypedArray, TYPED_CONSTRUCTOR, true); 18862 hide(TypedArrayPrototype, TYPED_ARRAY, NAME); 18863 hide(TypedArrayPrototype, VIEW, true); 18864 hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray); 18865 18866 if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) { 18867 dP(TypedArrayPrototype, TAG, { 18868 get: function () { return NAME; } 18869 }); 18870 } 18871 18872 O[NAME] = TypedArray; 18873 18874 $export($export.G + $export.W + $export.F * (TypedArray != Base), O); 18875 18876 $export($export.S, NAME, { 18877 BYTES_PER_ELEMENT: BYTES 18878 }); 18879 18880 $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, { 18881 from: $from, 18882 of: $of 18883 }); 18884 18885 if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES); 18886 18887 $export($export.P, NAME, proto); 18888 18889 setSpecies(NAME); 18890 18891 $export($export.P + $export.F * FORCED_SET, NAME, { set: $set }); 18892 18893 $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators); 18894 18895 if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString; 18896 18897 $export($export.P + $export.F * fails(function () { 18898 new TypedArray(1).slice(); 18899 }), NAME, { slice: $slice }); 18900 18901 $export($export.P + $export.F * (fails(function () { 18902 return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString(); 18903 }) || !fails(function () { 18904 TypedArrayPrototype.toLocaleString.call([1, 2]); 18905 })), NAME, { toLocaleString: $toLocaleString }); 18906 18907 Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator; 18908 if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator); 18909 }; 18910 } else module.exports = function () { /* empty */ }; 18911 18912 18913/***/ }), 18914/* 236 */ 18915/***/ (function(module, exports, __webpack_require__) { 18916 18917 __webpack_require__(235)('Uint8', 1, function (init) { 18918 return function Uint8Array(data, byteOffset, length) { 18919 return init(this, data, byteOffset, length); 18920 }; 18921 }); 18922 18923 18924/***/ }), 18925/* 237 */ 18926/***/ (function(module, exports, __webpack_require__) { 18927 18928 __webpack_require__(235)('Uint8', 1, function (init) { 18929 return function Uint8ClampedArray(data, byteOffset, length) { 18930 return init(this, data, byteOffset, length); 18931 }; 18932 }, true); 18933 18934 18935/***/ }), 18936/* 238 */ 18937/***/ (function(module, exports, __webpack_require__) { 18938 18939 __webpack_require__(235)('Int16', 2, function (init) { 18940 return function Int16Array(data, byteOffset, length) { 18941 return init(this, data, byteOffset, length); 18942 }; 18943 }); 18944 18945 18946/***/ }), 18947/* 239 */ 18948/***/ (function(module, exports, __webpack_require__) { 18949 18950 __webpack_require__(235)('Uint16', 2, function (init) { 18951 return function Uint16Array(data, byteOffset, length) { 18952 return init(this, data, byteOffset, length); 18953 }; 18954 }); 18955 18956 18957/***/ }), 18958/* 240 */ 18959/***/ (function(module, exports, __webpack_require__) { 18960 18961 __webpack_require__(235)('Int32', 4, function (init) { 18962 return function Int32Array(data, byteOffset, length) { 18963 return init(this, data, byteOffset, length); 18964 }; 18965 }); 18966 18967 18968/***/ }), 18969/* 241 */ 18970/***/ (function(module, exports, __webpack_require__) { 18971 18972 __webpack_require__(235)('Uint32', 4, function (init) { 18973 return function Uint32Array(data, byteOffset, length) { 18974 return init(this, data, byteOffset, length); 18975 }; 18976 }); 18977 18978 18979/***/ }), 18980/* 242 */ 18981/***/ (function(module, exports, __webpack_require__) { 18982 18983 __webpack_require__(235)('Float32', 4, function (init) { 18984 return function Float32Array(data, byteOffset, length) { 18985 return init(this, data, byteOffset, length); 18986 }; 18987 }); 18988 18989 18990/***/ }), 18991/* 243 */ 18992/***/ (function(module, exports, __webpack_require__) { 18993 18994 __webpack_require__(235)('Float64', 8, function (init) { 18995 return function Float64Array(data, byteOffset, length) { 18996 return init(this, data, byteOffset, length); 18997 }; 18998 }); 18999 19000 19001/***/ }), 19002/* 244 */ 19003/***/ (function(module, exports, __webpack_require__) { 19004 19005 // 26.1.1 Reflect.apply(target, thisArgument, argumentsList) 19006 var $export = __webpack_require__(9); 19007 var aFunction = __webpack_require__(22); 19008 var anObject = __webpack_require__(13); 19009 var rApply = (__webpack_require__(5).Reflect || {}).apply; 19010 var fApply = Function.apply; 19011 // MS Edge argumentsList argument is optional 19012 $export($export.S + $export.F * !__webpack_require__(8)(function () { 19013 rApply(function () { /* empty */ }); 19014 }), 'Reflect', { 19015 apply: function apply(target, thisArgument, argumentsList) { 19016 var T = aFunction(target); 19017 var L = anObject(argumentsList); 19018 return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L); 19019 } 19020 }); 19021 19022 19023/***/ }), 19024/* 245 */ 19025/***/ (function(module, exports, __webpack_require__) { 19026 19027 // 26.1.2 Reflect.construct(target, argumentsList [, newTarget]) 19028 var $export = __webpack_require__(9); 19029 var create = __webpack_require__(46); 19030 var aFunction = __webpack_require__(22); 19031 var anObject = __webpack_require__(13); 19032 var isObject = __webpack_require__(14); 19033 var fails = __webpack_require__(8); 19034 var bind = __webpack_require__(77); 19035 var rConstruct = (__webpack_require__(5).Reflect || {}).construct; 19036 19037 // MS Edge supports only 2 arguments and argumentsList argument is optional 19038 // FF Nightly sets third argument as `new.target`, but does not create `this` from it 19039 var NEW_TARGET_BUG = fails(function () { 19040 function F() { /* empty */ } 19041 return !(rConstruct(function () { /* empty */ }, [], F) instanceof F); 19042 }); 19043 var ARGS_BUG = !fails(function () { 19044 rConstruct(function () { /* empty */ }); 19045 }); 19046 19047 $export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', { 19048 construct: function construct(Target, args /* , newTarget */) { 19049 aFunction(Target); 19050 anObject(args); 19051 var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]); 19052 if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget); 19053 if (Target == newTarget) { 19054 // w/o altered newTarget, optimization for 0-4 arguments 19055 switch (args.length) { 19056 case 0: return new Target(); 19057 case 1: return new Target(args[0]); 19058 case 2: return new Target(args[0], args[1]); 19059 case 3: return new Target(args[0], args[1], args[2]); 19060 case 4: return new Target(args[0], args[1], args[2], args[3]); 19061 } 19062 // w/o altered newTarget, lot of arguments case 19063 var $args = [null]; 19064 $args.push.apply($args, args); 19065 return new (bind.apply(Target, $args))(); 19066 } 19067 // with altered newTarget, not support built-in constructors 19068 var proto = newTarget.prototype; 19069 var instance = create(isObject(proto) ? proto : Object.prototype); 19070 var result = Function.apply.call(Target, instance, args); 19071 return isObject(result) ? result : instance; 19072 } 19073 }); 19074 19075 19076/***/ }), 19077/* 246 */ 19078/***/ (function(module, exports, __webpack_require__) { 19079 19080 // 26.1.3 Reflect.defineProperty(target, propertyKey, attributes) 19081 var dP = __webpack_require__(12); 19082 var $export = __webpack_require__(9); 19083 var anObject = __webpack_require__(13); 19084 var toPrimitive = __webpack_require__(17); 19085 19086 // MS Edge has broken Reflect.defineProperty - throwing instead of returning false 19087 $export($export.S + $export.F * __webpack_require__(8)(function () { 19088 // eslint-disable-next-line no-undef 19089 Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 }); 19090 }), 'Reflect', { 19091 defineProperty: function defineProperty(target, propertyKey, attributes) { 19092 anObject(target); 19093 propertyKey = toPrimitive(propertyKey, true); 19094 anObject(attributes); 19095 try { 19096 dP.f(target, propertyKey, attributes); 19097 return true; 19098 } catch (e) { 19099 return false; 19100 } 19101 } 19102 }); 19103 19104 19105/***/ }), 19106/* 247 */ 19107/***/ (function(module, exports, __webpack_require__) { 19108 19109 // 26.1.4 Reflect.deleteProperty(target, propertyKey) 19110 var $export = __webpack_require__(9); 19111 var gOPD = __webpack_require__(51).f; 19112 var anObject = __webpack_require__(13); 19113 19114 $export($export.S, 'Reflect', { 19115 deleteProperty: function deleteProperty(target, propertyKey) { 19116 var desc = gOPD(anObject(target), propertyKey); 19117 return desc && !desc.configurable ? false : delete target[propertyKey]; 19118 } 19119 }); 19120 19121 19122/***/ }), 19123/* 248 */ 19124/***/ (function(module, exports, __webpack_require__) { 19125 19126 'use strict'; 19127 // 26.1.5 Reflect.enumerate(target) 19128 var $export = __webpack_require__(9); 19129 var anObject = __webpack_require__(13); 19130 var Enumerate = function (iterated) { 19131 this._t = anObject(iterated); // target 19132 this._i = 0; // next index 19133 var keys = this._k = []; // keys 19134 var key; 19135 for (key in iterated) keys.push(key); 19136 }; 19137 __webpack_require__(131)(Enumerate, 'Object', function () { 19138 var that = this; 19139 var keys = that._k; 19140 var key; 19141 do { 19142 if (that._i >= keys.length) return { value: undefined, done: true }; 19143 } while (!((key = keys[that._i++]) in that._t)); 19144 return { value: key, done: false }; 19145 }); 19146 19147 $export($export.S, 'Reflect', { 19148 enumerate: function enumerate(target) { 19149 return new Enumerate(target); 19150 } 19151 }); 19152 19153 19154/***/ }), 19155/* 249 */ 19156/***/ (function(module, exports, __webpack_require__) { 19157 19158 // 26.1.6 Reflect.get(target, propertyKey [, receiver]) 19159 var gOPD = __webpack_require__(51); 19160 var getPrototypeOf = __webpack_require__(59); 19161 var has = __webpack_require__(6); 19162 var $export = __webpack_require__(9); 19163 var isObject = __webpack_require__(14); 19164 var anObject = __webpack_require__(13); 19165 19166 function get(target, propertyKey /* , receiver */) { 19167 var receiver = arguments.length < 3 ? target : arguments[2]; 19168 var desc, proto; 19169 if (anObject(target) === receiver) return target[propertyKey]; 19170 if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value') 19171 ? desc.value 19172 : desc.get !== undefined 19173 ? desc.get.call(receiver) 19174 : undefined; 19175 if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver); 19176 } 19177 19178 $export($export.S, 'Reflect', { get: get }); 19179 19180 19181/***/ }), 19182/* 250 */ 19183/***/ (function(module, exports, __webpack_require__) { 19184 19185 // 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey) 19186 var gOPD = __webpack_require__(51); 19187 var $export = __webpack_require__(9); 19188 var anObject = __webpack_require__(13); 19189 19190 $export($export.S, 'Reflect', { 19191 getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) { 19192 return gOPD.f(anObject(target), propertyKey); 19193 } 19194 }); 19195 19196 19197/***/ }), 19198/* 251 */ 19199/***/ (function(module, exports, __webpack_require__) { 19200 19201 // 26.1.8 Reflect.getPrototypeOf(target) 19202 var $export = __webpack_require__(9); 19203 var getProto = __webpack_require__(59); 19204 var anObject = __webpack_require__(13); 19205 19206 $export($export.S, 'Reflect', { 19207 getPrototypeOf: function getPrototypeOf(target) { 19208 return getProto(anObject(target)); 19209 } 19210 }); 19211 19212 19213/***/ }), 19214/* 252 */ 19215/***/ (function(module, exports, __webpack_require__) { 19216 19217 // 26.1.9 Reflect.has(target, propertyKey) 19218 var $export = __webpack_require__(9); 19219 19220 $export($export.S, 'Reflect', { 19221 has: function has(target, propertyKey) { 19222 return propertyKey in target; 19223 } 19224 }); 19225 19226 19227/***/ }), 19228/* 253 */ 19229/***/ (function(module, exports, __webpack_require__) { 19230 19231 // 26.1.10 Reflect.isExtensible(target) 19232 var $export = __webpack_require__(9); 19233 var anObject = __webpack_require__(13); 19234 var $isExtensible = Object.isExtensible; 19235 19236 $export($export.S, 'Reflect', { 19237 isExtensible: function isExtensible(target) { 19238 anObject(target); 19239 return $isExtensible ? $isExtensible(target) : true; 19240 } 19241 }); 19242 19243 19244/***/ }), 19245/* 254 */ 19246/***/ (function(module, exports, __webpack_require__) { 19247 19248 // 26.1.11 Reflect.ownKeys(target) 19249 var $export = __webpack_require__(9); 19250 19251 $export($export.S, 'Reflect', { ownKeys: __webpack_require__(255) }); 19252 19253 19254/***/ }), 19255/* 255 */ 19256/***/ (function(module, exports, __webpack_require__) { 19257 19258 // all object keys, includes non-enumerable and symbols 19259 var gOPN = __webpack_require__(50); 19260 var gOPS = __webpack_require__(43); 19261 var anObject = __webpack_require__(13); 19262 var Reflect = __webpack_require__(5).Reflect; 19263 module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) { 19264 var keys = gOPN.f(anObject(it)); 19265 var getSymbols = gOPS.f; 19266 return getSymbols ? keys.concat(getSymbols(it)) : keys; 19267 }; 19268 19269 19270/***/ }), 19271/* 256 */ 19272/***/ (function(module, exports, __webpack_require__) { 19273 19274 // 26.1.12 Reflect.preventExtensions(target) 19275 var $export = __webpack_require__(9); 19276 var anObject = __webpack_require__(13); 19277 var $preventExtensions = Object.preventExtensions; 19278 19279 $export($export.S, 'Reflect', { 19280 preventExtensions: function preventExtensions(target) { 19281 anObject(target); 19282 try { 19283 if ($preventExtensions) $preventExtensions(target); 19284 return true; 19285 } catch (e) { 19286 return false; 19287 } 19288 } 19289 }); 19290 19291 19292/***/ }), 19293/* 257 */ 19294/***/ (function(module, exports, __webpack_require__) { 19295 19296 // 26.1.13 Reflect.set(target, propertyKey, V [, receiver]) 19297 var dP = __webpack_require__(12); 19298 var gOPD = __webpack_require__(51); 19299 var getPrototypeOf = __webpack_require__(59); 19300 var has = __webpack_require__(6); 19301 var $export = __webpack_require__(9); 19302 var createDesc = __webpack_require__(18); 19303 var anObject = __webpack_require__(13); 19304 var isObject = __webpack_require__(14); 19305 19306 function set(target, propertyKey, V /* , receiver */) { 19307 var receiver = arguments.length < 4 ? target : arguments[3]; 19308 var ownDesc = gOPD.f(anObject(target), propertyKey); 19309 var existingDescriptor, proto; 19310 if (!ownDesc) { 19311 if (isObject(proto = getPrototypeOf(target))) { 19312 return set(proto, propertyKey, V, receiver); 19313 } 19314 ownDesc = createDesc(0); 19315 } 19316 if (has(ownDesc, 'value')) { 19317 if (ownDesc.writable === false || !isObject(receiver)) return false; 19318 if (existingDescriptor = gOPD.f(receiver, propertyKey)) { 19319 if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;
vendor: 15,643 bytes, lines 19320-19880
19320 existingDescriptor.value = V; 19321 dP.f(receiver, propertyKey, existingDescriptor); 19322 } else dP.f(receiver, propertyKey, createDesc(0, V)); 19323 return true; 19324 } 19325 return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true); 19326 } 19327 19328 $export($export.S, 'Reflect', { set: set }); 19329 19330 19331/***/ }), 19332/* 258 */ 19333/***/ (function(module, exports, __webpack_require__) { 19334 19335 // 26.1.14 Reflect.setPrototypeOf(target, proto) 19336 var $export = __webpack_require__(9); 19337 var setProto = __webpack_require__(73); 19338 19339 if (setProto) $export($export.S, 'Reflect', { 19340 setPrototypeOf: function setPrototypeOf(target, proto) { 19341 setProto.check(target, proto); 19342 try { 19343 setProto.set(target, proto); 19344 return true; 19345 } catch (e) { 19346 return false; 19347 } 19348 } 19349 }); 19350 19351 19352/***/ }), 19353/* 259 */ 19354/***/ (function(module, exports, __webpack_require__) { 19355 19356 'use strict'; 19357 // https://github.com/tc39/Array.prototype.includes 19358 var $export = __webpack_require__(9); 19359 var $includes = __webpack_require__(37)(true); 19360 19361 $export($export.P, 'Array', { 19362 includes: function includes(el /* , fromIndex = 0 */) { 19363 return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); 19364 } 19365 }); 19366 19367 __webpack_require__(188)('includes'); 19368 19369 19370/***/ }), 19371/* 260 */ 19372/***/ (function(module, exports, __webpack_require__) { 19373 19374 'use strict'; 19375 // https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap 19376 var $export = __webpack_require__(9); 19377 var flattenIntoArray = __webpack_require__(261); 19378 var toObject = __webpack_require__(58); 19379 var toLength = __webpack_require__(38); 19380 var aFunction = __webpack_require__(22); 19381 var arraySpeciesCreate = __webpack_require__(175); 19382 19383 $export($export.P, 'Array', { 19384 flatMap: function flatMap(callbackfn /* , thisArg */) { 19385 var O = toObject(this); 19386 var sourceLen, A; 19387 aFunction(callbackfn); 19388 sourceLen = toLength(O.length); 19389 A = arraySpeciesCreate(O, 0); 19390 flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]); 19391 return A; 19392 } 19393 }); 19394 19395 __webpack_require__(188)('flatMap'); 19396 19397 19398/***/ }), 19399/* 261 */ 19400/***/ (function(module, exports, __webpack_require__) { 19401 19402 'use strict'; 19403 // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray 19404 var isArray = __webpack_require__(45); 19405 var isObject = __webpack_require__(14); 19406 var toLength = __webpack_require__(38); 19407 var ctx = __webpack_require__(21); 19408 var IS_CONCAT_SPREADABLE = __webpack_require__(27)('isConcatSpreadable'); 19409 19410 function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) { 19411 var targetIndex = start; 19412 var sourceIndex = 0; 19413 var mapFn = mapper ? ctx(mapper, thisArg, 3) : false; 19414 var element, spreadable; 19415 19416 while (sourceIndex < sourceLen) { 19417 if (sourceIndex in source) { 19418 element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex]; 19419 19420 spreadable = false; 19421 if (isObject(element)) { 19422 spreadable = element[IS_CONCAT_SPREADABLE]; 19423 spreadable = spreadable !== undefined ? !!spreadable : isArray(element); 19424 } 19425 19426 if (spreadable && depth > 0) { 19427 targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1; 19428 } else { 19429 if (targetIndex >= 0x1fffffffffffff) throw TypeError(); 19430 target[targetIndex] = element; 19431 } 19432 19433 targetIndex++; 19434 } 19435 sourceIndex++; 19436 } 19437 return targetIndex; 19438 } 19439 19440 module.exports = flattenIntoArray; 19441 19442 19443/***/ }), 19444/* 262 */ 19445/***/ (function(module, exports, __webpack_require__) { 19446 19447 'use strict'; 19448 // https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten 19449 var $export = __webpack_require__(9); 19450 var flattenIntoArray = __webpack_require__(261); 19451 var toObject = __webpack_require__(58); 19452 var toLength = __webpack_require__(38); 19453 var toInteger = __webpack_require__(39); 19454 var arraySpeciesCreate = __webpack_require__(175); 19455 19456 $export($export.P, 'Array', { 19457 flatten: function flatten(/* depthArg = 1 */) { 19458 var depthArg = arguments[0]; 19459 var O = toObject(this); 19460 var sourceLen = toLength(O.length); 19461 var A = arraySpeciesCreate(O, 0); 19462 flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg)); 19463 return A; 19464 } 19465 }); 19466 19467 __webpack_require__(188)('flatten'); 19468 19469 19470/***/ }), 19471/* 263 */ 19472/***/ (function(module, exports, __webpack_require__) { 19473 19474 'use strict'; 19475 // https://github.com/mathiasbynens/String.prototype.at 19476 var $export = __webpack_require__(9); 19477 var $at = __webpack_require__(128)(true); 19478 19479 $export($export.P, 'String', { 19480 at: function at(pos) { 19481 return $at(this, pos); 19482 } 19483 }); 19484 19485 19486/***/ }), 19487/* 264 */ 19488/***/ (function(module, exports, __webpack_require__) { 19489 19490 'use strict'; 19491 // https://github.com/tc39/proposal-string-pad-start-end 19492 var $export = __webpack_require__(9); 19493 var $pad = __webpack_require__(265); 19494 var userAgent = __webpack_require__(218); 19495 19496 // https://github.com/zloirock/core-js/issues/280 19497 $export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { 19498 padStart: function padStart(maxLength /* , fillString = ' ' */) { 19499 return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); 19500 } 19501 }); 19502 19503 19504/***/ }), 19505/* 265 */ 19506/***/ (function(module, exports, __webpack_require__) { 19507 19508 // https://github.com/tc39/proposal-string-pad-start-end 19509 var toLength = __webpack_require__(38); 19510 var repeat = __webpack_require__(91); 19511 var defined = __webpack_require__(36); 19512 19513 module.exports = function (that, maxLength, fillString, left) { 19514 var S = String(defined(that)); 19515 var stringLength = S.length; 19516 var fillStr = fillString === undefined ? ' ' : String(fillString); 19517 var intMaxLength = toLength(maxLength); 19518 if (intMaxLength <= stringLength || fillStr == '') return S; 19519 var fillLen = intMaxLength - stringLength; 19520 var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); 19521 if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); 19522 return left ? stringFiller + S : S + stringFiller; 19523 }; 19524 19525 19526/***/ }), 19527/* 266 */ 19528/***/ (function(module, exports, __webpack_require__) { 19529 19530 'use strict'; 19531 // https://github.com/tc39/proposal-string-pad-start-end 19532 var $export = __webpack_require__(9); 19533 var $pad = __webpack_require__(265); 19534 var userAgent = __webpack_require__(218); 19535 19536 // https://github.com/zloirock/core-js/issues/280 19537 $export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { 19538 padEnd: function padEnd(maxLength /* , fillString = ' ' */) { 19539 return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); 19540 } 19541 }); 19542 19543 19544/***/ }), 19545/* 267 */ 19546/***/ (function(module, exports, __webpack_require__) { 19547 19548 'use strict'; 19549 // https://github.com/sebmarkbage/ecmascript-string-left-right-trim 19550 __webpack_require__(83)('trimLeft', function ($trim) { 19551 return function trimLeft() { 19552 return $trim(this, 1); 19553 }; 19554 }, 'trimStart'); 19555 19556 19557/***/ }), 19558/* 268 */ 19559/***/ (function(module, exports, __webpack_require__) { 19560 19561 'use strict'; 19562 // https://github.com/sebmarkbage/ecmascript-string-left-right-trim 19563 __webpack_require__(83)('trimRight', function ($trim) { 19564 return function trimRight() { 19565 return $trim(this, 2); 19566 }; 19567 }, 'trimEnd'); 19568 19569 19570/***/ }), 19571/* 269 */ 19572/***/ (function(module, exports, __webpack_require__) { 19573 19574 'use strict'; 19575 // https://tc39.github.io/String.prototype.matchAll/ 19576 var $export = __webpack_require__(9); 19577 var defined = __webpack_require__(36); 19578 var toLength = __webpack_require__(38); 19579 var isRegExp = __webpack_require__(135); 19580 var getFlags = __webpack_require__(198); 19581 var RegExpProto = RegExp.prototype; 19582 19583 var $RegExpStringIterator = function (regexp, string) { 19584 this._r = regexp; 19585 this._s = string; 19586 }; 19587 19588 __webpack_require__(131)($RegExpStringIterator, 'RegExp String', function next() { 19589 var match = this._r.exec(this._s); 19590 return { value: match, done: match === null }; 19591 }); 19592 19593 $export($export.P, 'String', { 19594 matchAll: function matchAll(regexp) { 19595 defined(this); 19596 if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!'); 19597 var S = String(this); 19598 var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp); 19599 var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags); 19600 rx.lastIndex = toLength(regexp.lastIndex); 19601 return new $RegExpStringIterator(rx, S); 19602 } 19603 }); 19604 19605 19606/***/ }), 19607/* 270 */ 19608/***/ (function(module, exports, __webpack_require__) { 19609 19610 __webpack_require__(29)('asyncIterator'); 19611 19612 19613/***/ }), 19614/* 271 */ 19615/***/ (function(module, exports, __webpack_require__) { 19616 19617 __webpack_require__(29)('observable'); 19618 19619 19620/***/ }), 19621/* 272 */ 19622/***/ (function(module, exports, __webpack_require__) { 19623 19624 // https://github.com/tc39/proposal-object-getownpropertydescriptors 19625 var $export = __webpack_require__(9); 19626 var ownKeys = __webpack_require__(255); 19627 var toIObject = __webpack_require__(33); 19628 var gOPD = __webpack_require__(51); 19629 var createProperty = __webpack_require__(165); 19630 19631 $export($export.S, 'Object', { 19632 getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { 19633 var O = toIObject(object); 19634 var getDesc = gOPD.f; 19635 var keys = ownKeys(O); 19636 var result = {}; 19637 var i = 0; 19638 var key, desc; 19639 while (keys.length > i) { 19640 desc = getDesc(O, key = keys[i++]); 19641 if (desc !== undefined) createProperty(result, key, desc); 19642 } 19643 return result; 19644 } 19645 }); 19646 19647 19648/***/ }), 19649/* 273 */ 19650/***/ (function(module, exports, __webpack_require__) { 19651 19652 // https://github.com/tc39/proposal-object-values-entries 19653 var $export = __webpack_require__(9); 19654 var $values = __webpack_require__(274)(false); 19655 19656 $export($export.S, 'Object', { 19657 values: function values(it) { 19658 return $values(it); 19659 } 19660 }); 19661 19662 19663/***/ }), 19664/* 274 */ 19665/***/ (function(module, exports, __webpack_require__) { 19666 19667 var getKeys = __webpack_require__(31); 19668 var toIObject = __webpack_require__(33); 19669 var isEnum = __webpack_require__(44).f; 19670 module.exports = function (isEntries) { 19671 return function (it) { 19672 var O = toIObject(it); 19673 var keys = getKeys(O); 19674 var length = keys.length; 19675 var i = 0; 19676 var result = []; 19677 var key; 19678 while (length > i) if (isEnum.call(O, key = keys[i++])) { 19679 result.push(isEntries ? [key, O[key]] : O[key]); 19680 } return result; 19681 }; 19682 }; 19683 19684 19685/***/ }), 19686/* 275 */ 19687/***/ (function(module, exports, __webpack_require__) { 19688 19689 // https://github.com/tc39/proposal-object-values-entries 19690 var $export = __webpack_require__(9); 19691 var $entries = __webpack_require__(274)(true); 19692 19693 $export($export.S, 'Object', { 19694 entries: function entries(it) { 19695 return $entries(it); 19696 } 19697 }); 19698 19699 19700/***/ }), 19701/* 276 */ 19702/***/ (function(module, exports, __webpack_require__) { 19703 19704 'use strict'; 19705 var $export = __webpack_require__(9); 19706 var toObject = __webpack_require__(58); 19707 var aFunction = __webpack_require__(22); 19708 var $defineProperty = __webpack_require__(12); 19709 19710 // B.2.2.2 Object.prototype.__defineGetter__(P, getter) 19711 __webpack_require__(7) && $export($export.P + __webpack_require__(277), 'Object', { 19712 __defineGetter__: function __defineGetter__(P, getter) { 19713 $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true }); 19714 } 19715 }); 19716 19717 19718/***/ }), 19719/* 277 */ 19720/***/ (function(module, exports, __webpack_require__) { 19721 19722 'use strict'; 19723 // Forced replacement prototype accessors methods 19724 module.exports = __webpack_require__(25) || !__webpack_require__(8)(function () { 19725 var K = Math.random(); 19726 // In FF throws only define methods 19727 // eslint-disable-next-line no-undef, no-useless-call 19728 __defineSetter__.call(null, K, function () { /* empty */ }); 19729 delete __webpack_require__(5)[K]; 19730 }); 19731 19732 19733/***/ }), 19734/* 278 */ 19735/***/ (function(module, exports, __webpack_require__) { 19736 19737 'use strict'; 19738 var $export = __webpack_require__(9); 19739 var toObject = __webpack_require__(58); 19740 var aFunction = __webpack_require__(22); 19741 var $defineProperty = __webpack_require__(12); 19742 19743 // B.2.2.3 Object.prototype.__defineSetter__(P, setter) 19744 __webpack_require__(7) && $export($export.P + __webpack_require__(277), 'Object', { 19745 __defineSetter__: function __defineSetter__(P, setter) { 19746 $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true }); 19747 } 19748 }); 19749 19750 19751/***/ }), 19752/* 279 */ 19753/***/ (function(module, exports, __webpack_require__) { 19754 19755 'use strict'; 19756 var $export = __webpack_require__(9); 19757 var toObject = __webpack_require__(58); 19758 var toPrimitive = __webpack_require__(17); 19759 var getPrototypeOf = __webpack_require__(59); 19760 var getOwnPropertyDescriptor = __webpack_require__(51).f; 19761 19762 // B.2.2.4 Object.prototype.__lookupGetter__(P) 19763 __webpack_require__(7) && $export($export.P + __webpack_require__(277), 'Object', { 19764 __lookupGetter__: function __lookupGetter__(P) { 19765 var O = toObject(this); 19766 var K = toPrimitive(P, true); 19767 var D; 19768 do { 19769 if (D = getOwnPropertyDescriptor(O, K)) return D.get; 19770 } while (O = getPrototypeOf(O)); 19771 } 19772 }); 19773 19774 19775/***/ }), 19776/* 280 */ 19777/***/ (function(module, exports, __webpack_require__) { 19778 19779 'use strict'; 19780 var $export = __webpack_require__(9); 19781 var toObject = __webpack_require__(58); 19782 var toPrimitive = __webpack_require__(17); 19783 var getPrototypeOf = __webpack_require__(59); 19784 var getOwnPropertyDescriptor = __webpack_require__(51).f; 19785 19786 // B.2.2.5 Object.prototype.__lookupSetter__(P) 19787 __webpack_require__(7) && $export($export.P + __webpack_require__(277), 'Object', { 19788 __lookupSetter__: function __lookupSetter__(P) { 19789 var O = toObject(this); 19790 var K = toPrimitive(P, true); 19791 var D; 19792 do { 19793 if (D = getOwnPropertyDescriptor(O, K)) return D.set; 19794 } while (O = getPrototypeOf(O)); 19795 } 19796 }); 19797 19798 19799/***/ }), 19800/* 281 */ 19801/***/ (function(module, exports, __webpack_require__) { 19802 19803 // https://github.com/DavidBruant/Map-Set.prototype.toJSON 19804 var $export = __webpack_require__(9); 19805 19806 $export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(282)('Map') }); 19807 19808 19809/***/ }), 19810/* 282 */ 19811/***/ (function(module, exports, __webpack_require__) { 19812 19813 // https://github.com/DavidBruant/Map-Set.prototype.toJSON 19814 var classof = __webpack_require__(75); 19815 var from = __webpack_require__(283); 19816 module.exports = function (NAME) { 19817 return function toJSON() { 19818 if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic"); 19819 return from(this); 19820 }; 19821 }; 19822 19823 19824/***/ }), 19825/* 283 */ 19826/***/ (function(module, exports, __webpack_require__) { 19827 19828 var forOf = __webpack_require__(213); 19829 19830 module.exports = function (iter, ITERATOR) { 19831 var result = []; 19832 forOf(iter, false, result.push, result, ITERATOR); 19833 return result; 19834 }; 19835 19836 19837/***/ }), 19838/* 284 */ 19839/***/ (function(module, exports, __webpack_require__) { 19840 19841 // https://github.com/DavidBruant/Map-Set.prototype.toJSON 19842 var $export = __webpack_require__(9); 19843 19844 $export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(282)('Set') }); 19845 19846 19847/***/ }), 19848/* 285 */ 19849/***/ (function(module, exports, __webpack_require__) { 19850 19851 // https://tc39.github.io/proposal-setmap-offrom/#sec-map.of 19852 __webpack_require__(286)('Map'); 19853 19854 19855/***/ }), 19856/* 286 */ 19857/***/ (function(module, exports, __webpack_require__) { 19858 19859 'use strict'; 19860 // https://tc39.github.io/proposal-setmap-offrom/ 19861 var $export = __webpack_require__(9); 19862 19863 module.exports = function (COLLECTION) { 19864 $export($export.S, COLLECTION, { of: function of() { 19865 var length = arguments.length; 19866 var A = new Array(length); 19867 while (length--) A[length] = arguments[length]; 19868 return new this(A); 19869 } }); 19870 }; 19871 19872 19873/***/ }), 19874/* 287 */ 19875/***/ (function(module, exports, __webpack_require__) { 19876 19877 // https://tc39.github.io/proposal-setmap-offrom/#sec-set.of 19878 __webpack_require__(286)('Set'); 19879 19880
vendor: 1,639 bytes, lines 19881-19946
19881/***/ }), 19882/* 288 */ 19883/***/ (function(module, exports, __webpack_require__) { 19884 19885 // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of 19886 __webpack_require__(286)('WeakMap'); 19887 19888 19889/***/ }), 19890/* 289 */ 19891/***/ (function(module, exports, __webpack_require__) { 19892 19893 // https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of 19894 __webpack_require__(286)('WeakSet'); 19895 19896 19897/***/ }), 19898/* 290 */ 19899/***/ (function(module, exports, __webpack_require__) { 19900 19901 // https://tc39.github.io/proposal-setmap-offrom/#sec-map.from 19902 __webpack_require__(291)('Map'); 19903 19904 19905/***/ }), 19906/* 291 */ 19907/***/ (function(module, exports, __webpack_require__) { 19908 19909 'use strict'; 19910 // https://tc39.github.io/proposal-setmap-offrom/ 19911 var $export = __webpack_require__(9); 19912 var aFunction = __webpack_require__(22); 19913 var ctx = __webpack_require__(21); 19914 var forOf = __webpack_require__(213); 19915 19916 module.exports = function (COLLECTION) { 19917 $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) { 19918 var mapFn = arguments[1]; 19919 var mapping, A, n, cb; 19920 aFunction(this); 19921 mapping = mapFn !== undefined; 19922 if (mapping) aFunction(mapFn); 19923 if (source == undefined) return new this(); 19924 A = []; 19925 if (mapping) { 19926 n = 0; 19927 cb = ctx(mapFn, arguments[2], 2); 19928 forOf(source, false, function (nextItem) { 19929 A.push(cb(nextItem, n++)); 19930 }); 19931 } else { 19932 forOf(source, false, A.push, A); 19933 } 19934 return new this(A); 19935 } }); 19936 }; 19937 19938 19939/***/ }), 19940/* 292 */ 19941/***/ (function(module, exports, __webpack_require__) { 19942 19943 // https://tc39.github.io/proposal-setmap-offrom/#sec-set.from 19944 __webpack_require__(291)('Set'); 19945 19946
vendor: 19,640 bytes, lines 19947-20623
19947/***/ }), 19948/* 293 */ 19949/***/ (function(module, exports, __webpack_require__) { 19950 19951 // https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from 19952 __webpack_require__(291)('WeakMap'); 19953 19954 19955/***/ }), 19956/* 294 */ 19957/***/ (function(module, exports, __webpack_require__) { 19958 19959 // https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from 19960 __webpack_require__(291)('WeakSet'); 19961 19962 19963/***/ }), 19964/* 295 */ 19965/***/ (function(module, exports, __webpack_require__) { 19966 19967 // https://github.com/tc39/proposal-global 19968 var $export = __webpack_require__(9); 19969 19970 $export($export.G, { global: __webpack_require__(5) }); 19971 19972 19973/***/ }), 19974/* 296 */ 19975/***/ (function(module, exports, __webpack_require__) { 19976 19977 // https://github.com/tc39/proposal-global 19978 var $export = __webpack_require__(9); 19979 19980 $export($export.S, 'System', { global: __webpack_require__(5) }); 19981 19982 19983/***/ }), 19984/* 297 */ 19985/***/ (function(module, exports, __webpack_require__) { 19986 19987 // https://github.com/ljharb/proposal-is-error 19988 var $export = __webpack_require__(9); 19989 var cof = __webpack_require__(35); 19990 19991 $export($export.S, 'Error', { 19992 isError: function isError(it) { 19993 return cof(it) === 'Error'; 19994 } 19995 }); 19996 19997 19998/***/ }), 19999/* 298 */ 20000/***/ (function(module, exports, __webpack_require__) { 20001 20002 // https://rwaldron.github.io/proposal-math-extensions/ 20003 var $export = __webpack_require__(9); 20004 20005 $export($export.S, 'Math', { 20006 clamp: function clamp(x, lower, upper) { 20007 return Math.min(upper, Math.max(lower, x)); 20008 } 20009 }); 20010 20011 20012/***/ }), 20013/* 299 */ 20014/***/ (function(module, exports, __webpack_require__) { 20015 20016 // https://rwaldron.github.io/proposal-math-extensions/ 20017 var $export = __webpack_require__(9); 20018 20019 $export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 }); 20020 20021 20022/***/ }), 20023/* 300 */ 20024/***/ (function(module, exports, __webpack_require__) { 20025 20026 // https://rwaldron.github.io/proposal-math-extensions/ 20027 var $export = __webpack_require__(9); 20028 var RAD_PER_DEG = 180 / Math.PI; 20029 20030 $export($export.S, 'Math', { 20031 degrees: function degrees(radians) { 20032 return radians * RAD_PER_DEG; 20033 } 20034 }); 20035 20036 20037/***/ }), 20038/* 301 */ 20039/***/ (function(module, exports, __webpack_require__) { 20040 20041 // https://rwaldron.github.io/proposal-math-extensions/ 20042 var $export = __webpack_require__(9); 20043 var scale = __webpack_require__(302); 20044 var fround = __webpack_require__(114); 20045 20046 $export($export.S, 'Math', { 20047 fscale: function fscale(x, inLow, inHigh, outLow, outHigh) { 20048 return fround(scale(x, inLow, inHigh, outLow, outHigh)); 20049 } 20050 }); 20051 20052 20053/***/ }), 20054/* 302 */ 20055/***/ (function(module, exports) { 20056 20057 // https://rwaldron.github.io/proposal-math-extensions/ 20058 module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) { 20059 if ( 20060 arguments.length === 0 20061 // eslint-disable-next-line no-self-compare 20062 || x != x 20063 // eslint-disable-next-line no-self-compare 20064 || inLow != inLow 20065 // eslint-disable-next-line no-self-compare 20066 || inHigh != inHigh 20067 // eslint-disable-next-line no-self-compare 20068 || outLow != outLow 20069 // eslint-disable-next-line no-self-compare 20070 || outHigh != outHigh 20071 ) return NaN; 20072 if (x === Infinity || x === -Infinity) return x; 20073 return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow; 20074 }; 20075 20076 20077/***/ }), 20078/* 303 */ 20079/***/ (function(module, exports, __webpack_require__) { 20080 20081 // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 20082 var $export = __webpack_require__(9); 20083 20084 $export($export.S, 'Math', { 20085 iaddh: function iaddh(x0, x1, y0, y1) { 20086 var $x0 = x0 >>> 0; 20087 var $x1 = x1 >>> 0; 20088 var $y0 = y0 >>> 0; 20089 return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0; 20090 } 20091 }); 20092 20093 20094/***/ }), 20095/* 304 */ 20096/***/ (function(module, exports, __webpack_require__) { 20097 20098 // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 20099 var $export = __webpack_require__(9); 20100 20101 $export($export.S, 'Math', { 20102 isubh: function isubh(x0, x1, y0, y1) { 20103 var $x0 = x0 >>> 0; 20104 var $x1 = x1 >>> 0; 20105 var $y0 = y0 >>> 0; 20106 return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0; 20107 } 20108 }); 20109 20110 20111/***/ }), 20112/* 305 */ 20113/***/ (function(module, exports, __webpack_require__) { 20114 20115 // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 20116 var $export = __webpack_require__(9); 20117 20118 $export($export.S, 'Math', { 20119 imulh: function imulh(u, v) { 20120 var UINT16 = 0xffff; 20121 var $u = +u; 20122 var $v = +v; 20123 var u0 = $u & UINT16; 20124 var v0 = $v & UINT16; 20125 var u1 = $u >> 16; 20126 var v1 = $v >> 16; 20127 var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); 20128 return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16); 20129 } 20130 }); 20131 20132 20133/***/ }), 20134/* 306 */ 20135/***/ (function(module, exports, __webpack_require__) { 20136 20137 // https://rwaldron.github.io/proposal-math-extensions/ 20138 var $export = __webpack_require__(9); 20139 20140 $export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI }); 20141 20142 20143/***/ }), 20144/* 307 */ 20145/***/ (function(module, exports, __webpack_require__) { 20146 20147 // https://rwaldron.github.io/proposal-math-extensions/ 20148 var $export = __webpack_require__(9); 20149 var DEG_PER_RAD = Math.PI / 180; 20150 20151 $export($export.S, 'Math', { 20152 radians: function radians(degrees) { 20153 return degrees * DEG_PER_RAD; 20154 } 20155 }); 20156 20157 20158/***/ }), 20159/* 308 */ 20160/***/ (function(module, exports, __webpack_require__) { 20161 20162 // https://rwaldron.github.io/proposal-math-extensions/ 20163 var $export = __webpack_require__(9); 20164 20165 $export($export.S, 'Math', { scale: __webpack_require__(302) }); 20166 20167 20168/***/ }), 20169/* 309 */ 20170/***/ (function(module, exports, __webpack_require__) { 20171 20172 // https://gist.github.com/BrendanEich/4294d5c212a6d2254703 20173 var $export = __webpack_require__(9); 20174 20175 $export($export.S, 'Math', { 20176 umulh: function umulh(u, v) { 20177 var UINT16 = 0xffff; 20178 var $u = +u; 20179 var $v = +v; 20180 var u0 = $u & UINT16; 20181 var v0 = $v & UINT16; 20182 var u1 = $u >>> 16; 20183 var v1 = $v >>> 16; 20184 var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16); 20185 return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16); 20186 } 20187 }); 20188 20189 20190/***/ }), 20191/* 310 */ 20192/***/ (function(module, exports, __webpack_require__) { 20193 20194 // http://jfbastien.github.io/papers/Math.signbit.html 20195 var $export = __webpack_require__(9); 20196 20197 $export($export.S, 'Math', { signbit: function signbit(x) { 20198 // eslint-disable-next-line no-self-compare 20199 return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0; 20200 } }); 20201 20202 20203/***/ }), 20204/* 311 */ 20205/***/ (function(module, exports, __webpack_require__) { 20206 20207 // https://github.com/tc39/proposal-promise-finally 20208 'use strict'; 20209 var $export = __webpack_require__(9); 20210 var core = __webpack_require__(10); 20211 var global = __webpack_require__(5); 20212 var speciesConstructor = __webpack_require__(210); 20213 var promiseResolve = __webpack_require__(219); 20214 20215 $export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { 20216 var C = speciesConstructor(this, core.Promise || global.Promise); 20217 var isFunction = typeof onFinally == 'function'; 20218 return this.then( 20219 isFunction ? function (x) { 20220 return promiseResolve(C, onFinally()).then(function () { return x; }); 20221 } : onFinally, 20222 isFunction ? function (e) { 20223 return promiseResolve(C, onFinally()).then(function () { throw e; }); 20224 } : onFinally 20225 ); 20226 } }); 20227 20228 20229/***/ }), 20230/* 312 */ 20231/***/ (function(module, exports, __webpack_require__) { 20232 20233 'use strict'; 20234 // https://github.com/tc39/proposal-promise-try 20235 var $export = __webpack_require__(9); 20236 var newPromiseCapability = __webpack_require__(216); 20237 var perform = __webpack_require__(217); 20238 20239 $export($export.S, 'Promise', { 'try': function (callbackfn) { 20240 var promiseCapability = newPromiseCapability.f(this); 20241 var result = perform(callbackfn); 20242 (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); 20243 return promiseCapability.promise; 20244 } }); 20245 20246 20247/***/ }), 20248/* 313 */ 20249/***/ (function(module, exports, __webpack_require__) { 20250 20251 var metadata = __webpack_require__(314); 20252 var anObject = __webpack_require__(13); 20253 var toMetaKey = metadata.key; 20254 var ordinaryDefineOwnMetadata = metadata.set; 20255 20256 metadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) { 20257 ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey)); 20258 } }); 20259 20260 20261/***/ }), 20262/* 314 */ 20263/***/ (function(module, exports, __webpack_require__) { 20264 20265 var Map = __webpack_require__(221); 20266 var $export = __webpack_require__(9); 20267 var shared = __webpack_require__(24)('metadata'); 20268 var store = shared.store || (shared.store = new (__webpack_require__(226))()); 20269 20270 var getOrCreateMetadataMap = function (target, targetKey, create) { 20271 var targetMetadata = store.get(target); 20272 if (!targetMetadata) { 20273 if (!create) return undefined; 20274 store.set(target, targetMetadata = new Map()); 20275 } 20276 var keyMetadata = targetMetadata.get(targetKey); 20277 if (!keyMetadata) { 20278 if (!create) return undefined; 20279 targetMetadata.set(targetKey, keyMetadata = new Map()); 20280 } return keyMetadata; 20281 }; 20282 var ordinaryHasOwnMetadata = function (MetadataKey, O, P) { 20283 var metadataMap = getOrCreateMetadataMap(O, P, false); 20284 return metadataMap === undefined ? false : metadataMap.has(MetadataKey); 20285 }; 20286 var ordinaryGetOwnMetadata = function (MetadataKey, O, P) { 20287 var metadataMap = getOrCreateMetadataMap(O, P, false); 20288 return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey); 20289 }; 20290 var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) { 20291 getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue); 20292 }; 20293 var ordinaryOwnMetadataKeys = function (target, targetKey) { 20294 var metadataMap = getOrCreateMetadataMap(target, targetKey, false); 20295 var keys = []; 20296 if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); }); 20297 return keys; 20298 }; 20299 var toMetaKey = function (it) { 20300 return it === undefined || typeof it == 'symbol' ? it : String(it); 20301 }; 20302 var exp = function (O) { 20303 $export($export.S, 'Reflect', O); 20304 }; 20305 20306 module.exports = { 20307 store: store, 20308 map: getOrCreateMetadataMap, 20309 has: ordinaryHasOwnMetadata, 20310 get: ordinaryGetOwnMetadata, 20311 set: ordinaryDefineOwnMetadata, 20312 keys: ordinaryOwnMetadataKeys, 20313 key: toMetaKey, 20314 exp: exp 20315 }; 20316 20317 20318/***/ }), 20319/* 315 */ 20320/***/ (function(module, exports, __webpack_require__) { 20321 20322 var metadata = __webpack_require__(314); 20323 var anObject = __webpack_require__(13); 20324 var toMetaKey = metadata.key; 20325 var getOrCreateMetadataMap = metadata.map; 20326 var store = metadata.store; 20327 20328 metadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) { 20329 var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]); 20330 var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false); 20331 if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false; 20332 if (metadataMap.size) return true; 20333 var targetMetadata = store.get(target); 20334 targetMetadata['delete'](targetKey); 20335 return !!targetMetadata.size || store['delete'](target); 20336 } }); 20337 20338 20339/***/ }), 20340/* 316 */ 20341/***/ (function(module, exports, __webpack_require__) { 20342 20343 var metadata = __webpack_require__(314); 20344 var anObject = __webpack_require__(13); 20345 var getPrototypeOf = __webpack_require__(59); 20346 var ordinaryHasOwnMetadata = metadata.has; 20347 var ordinaryGetOwnMetadata = metadata.get; 20348 var toMetaKey = metadata.key; 20349 20350 var ordinaryGetMetadata = function (MetadataKey, O, P) { 20351 var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); 20352 if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P); 20353 var parent = getPrototypeOf(O); 20354 return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined; 20355 }; 20356 20357 metadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) { 20358 return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); 20359 } }); 20360 20361 20362/***/ }), 20363/* 317 */ 20364/***/ (function(module, exports, __webpack_require__) { 20365 20366 var Set = __webpack_require__(225); 20367 var from = __webpack_require__(283); 20368 var metadata = __webpack_require__(314); 20369 var anObject = __webpack_require__(13); 20370 var getPrototypeOf = __webpack_require__(59); 20371 var ordinaryOwnMetadataKeys = metadata.keys; 20372 var toMetaKey = metadata.key; 20373 20374 var ordinaryMetadataKeys = function (O, P) { 20375 var oKeys = ordinaryOwnMetadataKeys(O, P); 20376 var parent = getPrototypeOf(O); 20377 if (parent === null) return oKeys; 20378 var pKeys = ordinaryMetadataKeys(parent, P); 20379 return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys; 20380 }; 20381 20382 metadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) { 20383 return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); 20384 } }); 20385 20386 20387/***/ }), 20388/* 318 */ 20389/***/ (function(module, exports, __webpack_require__) { 20390 20391 var metadata = __webpack_require__(314); 20392 var anObject = __webpack_require__(13); 20393 var ordinaryGetOwnMetadata = metadata.get; 20394 var toMetaKey = metadata.key; 20395 20396 metadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) { 20397 return ordinaryGetOwnMetadata(metadataKey, anObject(target) 20398 , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); 20399 } }); 20400 20401 20402/***/ }), 20403/* 319 */ 20404/***/ (function(module, exports, __webpack_require__) { 20405 20406 var metadata = __webpack_require__(314); 20407 var anObject = __webpack_require__(13); 20408 var ordinaryOwnMetadataKeys = metadata.keys; 20409 var toMetaKey = metadata.key; 20410 20411 metadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) { 20412 return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1])); 20413 } }); 20414 20415 20416/***/ }), 20417/* 320 */ 20418/***/ (function(module, exports, __webpack_require__) { 20419 20420 var metadata = __webpack_require__(314); 20421 var anObject = __webpack_require__(13); 20422 var getPrototypeOf = __webpack_require__(59); 20423 var ordinaryHasOwnMetadata = metadata.has; 20424 var toMetaKey = metadata.key; 20425 20426 var ordinaryHasMetadata = function (MetadataKey, O, P) { 20427 var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P); 20428 if (hasOwn) return true; 20429 var parent = getPrototypeOf(O); 20430 return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false; 20431 }; 20432 20433 metadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) { 20434 return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2])); 20435 } }); 20436 20437 20438/***/ }), 20439/* 321 */ 20440/***/ (function(module, exports, __webpack_require__) { 20441 20442 var metadata = __webpack_require__(314); 20443 var anObject = __webpack_require__(13); 20444 var ordinaryHasOwnMetadata = metadata.has; 20445 var toMetaKey = metadata.key; 20446 20447 metadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) { 20448 return ordinaryHasOwnMetadata(metadataKey, anObject(target) 20449 , arguments.length < 3 ? undefined : toMetaKey(arguments[2])); 20450 } }); 20451 20452 20453/***/ }), 20454/* 322 */ 20455/***/ (function(module, exports, __webpack_require__) { 20456 20457 var $metadata = __webpack_require__(314); 20458 var anObject = __webpack_require__(13); 20459 var aFunction = __webpack_require__(22); 20460 var toMetaKey = $metadata.key; 20461 var ordinaryDefineOwnMetadata = $metadata.set; 20462 20463 $metadata.exp({ metadata: function metadata(metadataKey, metadataValue) { 20464 return function decorator(target, targetKey) { 20465 ordinaryDefineOwnMetadata( 20466 metadataKey, metadataValue, 20467 (targetKey !== undefined ? anObject : aFunction)(target), 20468 toMetaKey(targetKey) 20469 ); 20470 }; 20471 } }); 20472 20473 20474/***/ }), 20475/* 323 */ 20476/***/ (function(module, exports, __webpack_require__) { 20477 20478 // https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask 20479 var $export = __webpack_require__(9); 20480 var microtask = __webpack_require__(215)(); 20481 var process = __webpack_require__(5).process; 20482 var isNode = __webpack_require__(35)(process) == 'process'; 20483 20484 $export($export.G, { 20485 asap: function asap(fn) { 20486 var domain = isNode && process.domain; 20487 microtask(domain ? domain.bind(fn) : fn); 20488 } 20489 }); 20490 20491 20492/***/ }), 20493/* 324 */ 20494/***/ (function(module, exports, __webpack_require__) { 20495 20496 'use strict'; 20497 // https://github.com/zenparsing/es-observable 20498 var $export = __webpack_require__(9); 20499 var global = __webpack_require__(5); 20500 var core = __webpack_require__(10); 20501 var microtask = __webpack_require__(215)(); 20502 var OBSERVABLE = __webpack_require__(27)('observable'); 20503 var aFunction = __webpack_require__(22); 20504 var anObject = __webpack_require__(13); 20505 var anInstance = __webpack_require__(212); 20506 var redefineAll = __webpack_require__(220); 20507 var hide = __webpack_require__(11); 20508 var forOf = __webpack_require__(213); 20509 var RETURN = forOf.RETURN; 20510 20511 var getMethod = function (fn) { 20512 return fn == null ? undefined : aFunction(fn); 20513 }; 20514 20515 var cleanupSubscription = function (subscription) { 20516 var cleanup = subscription._c; 20517 if (cleanup) { 20518 subscription._c = undefined; 20519 cleanup(); 20520 } 20521 }; 20522 20523 var subscriptionClosed = function (subscription) { 20524 return subscription._o === undefined; 20525 }; 20526 20527 var closeSubscription = function (subscription) { 20528 if (!subscriptionClosed(subscription)) { 20529 subscription._o = undefined; 20530 cleanupSubscription(subscription); 20531 } 20532 }; 20533 20534 var Subscription = function (observer, subscriber) { 20535 anObject(observer); 20536 this._c = undefined; 20537 this._o = observer; 20538 observer = new SubscriptionObserver(this); 20539 try { 20540 var cleanup = subscriber(observer); 20541 var subscription = cleanup; 20542 if (cleanup != null) { 20543 if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); }; 20544 else aFunction(cleanup); 20545 this._c = cleanup; 20546 } 20547 } catch (e) { 20548 observer.error(e); 20549 return; 20550 } if (subscriptionClosed(this)) cleanupSubscription(this); 20551 }; 20552 20553 Subscription.prototype = redefineAll({}, { 20554 unsubscribe: function unsubscribe() { closeSubscription(this); } 20555 }); 20556 20557 var SubscriptionObserver = function (subscription) { 20558 this._s = subscription; 20559 }; 20560 20561 SubscriptionObserver.prototype = redefineAll({}, { 20562 next: function next(value) { 20563 var subscription = this._s; 20564 if (!subscriptionClosed(subscription)) { 20565 var observer = subscription._o; 20566 try { 20567 var m = getMethod(observer.next); 20568 if (m) return m.call(observer, value); 20569 } catch (e) { 20570 try { 20571 closeSubscription(subscription); 20572 } finally { 20573 throw e; 20574 } 20575 } 20576 } 20577 }, 20578 error: function error(value) { 20579 var subscription = this._s; 20580 if (subscriptionClosed(subscription)) throw value; 20581 var observer = subscription._o; 20582 subscription._o = undefined; 20583 try { 20584 var m = getMethod(observer.error); 20585 if (!m) throw value; 20586 value = m.call(observer, value); 20587 } catch (e) { 20588 try { 20589 cleanupSubscription(subscription); 20590 } finally { 20591 throw e; 20592 } 20593 } cleanupSubscription(subscription); 20594 return value; 20595 }, 20596 complete: function complete(value) { 20597 var subscription = this._s; 20598 if (!subscriptionClosed(subscription)) { 20599 var observer = subscription._o; 20600 subscription._o = undefined; 20601 try { 20602 var m = getMethod(observer.complete); 20603 value = m ? m.call(observer, value) : undefined; 20604 } catch (e) { 20605 try { 20606 cleanupSubscription(subscription); 20607 } finally { 20608 throw e; 20609 } 20610 } cleanupSubscription(subscription); 20611 return value; 20612 } 20613 } 20614 }); 20615 20616 var $Observable = function Observable(subscriber) { 20617 anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber); 20618 }; 20619 20620 redefineAll($Observable.prototype, { 20621 subscribe: function subscribe(observer) { 20622 return new Subscription(observer, this._f); 20623 },
vendor: 5,036 bytes, lines 20624-20793
20624 forEach: function forEach(fn) { 20625 var that = this; 20626 return new (core.Promise || global.Promise)(function (resolve, reject) { 20627 aFunction(fn); 20628 var subscription = that.subscribe({ 20629 next: function (value) { 20630 try { 20631 return fn(value); 20632 } catch (e) { 20633 reject(e); 20634 subscription.unsubscribe(); 20635 } 20636 }, 20637 error: reject, 20638 complete: resolve 20639 }); 20640 }); 20641 } 20642 }); 20643 20644 redefineAll($Observable, { 20645 from: function from(x) { 20646 var C = typeof this === 'function' ? this : $Observable; 20647 var method = getMethod(anObject(x)[OBSERVABLE]); 20648 if (method) { 20649 var observable = anObject(method.call(x)); 20650 return observable.constructor === C ? observable : new C(function (observer) { 20651 return observable.subscribe(observer); 20652 }); 20653 } 20654 return new C(function (observer) { 20655 var done = false; 20656 microtask(function () { 20657 if (!done) { 20658 try { 20659 if (forOf(x, false, function (it) { 20660 observer.next(it); 20661 if (done) return RETURN; 20662 }) === RETURN) return; 20663 } catch (e) { 20664 if (done) throw e; 20665 observer.error(e); 20666 return; 20667 } observer.complete(); 20668 } 20669 }); 20670 return function () { done = true; }; 20671 }); 20672 }, 20673 of: function of() { 20674 for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++]; 20675 return new (typeof this === 'function' ? this : $Observable)(function (observer) { 20676 var done = false; 20677 microtask(function () { 20678 if (!done) { 20679 for (var j = 0; j < items.length; ++j) { 20680 observer.next(items[j]); 20681 if (done) return; 20682 } observer.complete(); 20683 } 20684 }); 20685 return function () { done = true; }; 20686 }); 20687 } 20688 }); 20689 20690 hide($Observable.prototype, OBSERVABLE, function () { return this; }); 20691 20692 $export($export.G, { Observable: $Observable }); 20693 20694 __webpack_require__(194)('Observable'); 20695 20696 20697/***/ }), 20698/* 325 */ 20699/***/ (function(module, exports, __webpack_require__) { 20700 20701 // ie9- setTimeout & setInterval additional parameters fix 20702 var global = __webpack_require__(5); 20703 var $export = __webpack_require__(9); 20704 var userAgent = __webpack_require__(218); 20705 var slice = [].slice; 20706 var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check 20707 var wrap = function (set) { 20708 return function (fn, time /* , ...args */) { 20709 var boundArgs = arguments.length > 2; 20710 var args = boundArgs ? slice.call(arguments, 2) : false; 20711 return set(boundArgs ? function () { 20712 // eslint-disable-next-line no-new-func 20713 (typeof fn == 'function' ? fn : Function(fn)).apply(this, args); 20714 } : fn, time); 20715 }; 20716 }; 20717 $export($export.G + $export.B + $export.F * MSIE, { 20718 setTimeout: wrap(global.setTimeout), 20719 setInterval: wrap(global.setInterval) 20720 }); 20721 20722 20723/***/ }), 20724/* 326 */ 20725/***/ (function(module, exports, __webpack_require__) { 20726 20727 var $export = __webpack_require__(9); 20728 var $task = __webpack_require__(214); 20729 $export($export.G + $export.B, { 20730 setImmediate: $task.set, 20731 clearImmediate: $task.clear 20732 }); 20733 20734 20735/***/ }), 20736/* 327 */ 20737/***/ (function(module, exports, __webpack_require__) { 20738 20739 var $iterators = __webpack_require__(195); 20740 var getKeys = __webpack_require__(31); 20741 var redefine = __webpack_require__(19); 20742 var global = __webpack_require__(5); 20743 var hide = __webpack_require__(11); 20744 var Iterators = __webpack_require__(130); 20745 var wks = __webpack_require__(27); 20746 var ITERATOR = wks('iterator'); 20747 var TO_STRING_TAG = wks('toStringTag'); 20748 var ArrayValues = Iterators.Array; 20749 20750 var DOMIterables = { 20751 CSSRuleList: true, // TODO: Not spec compliant, should be false. 20752 CSSStyleDeclaration: false, 20753 CSSValueList: false, 20754 ClientRectList: false, 20755 DOMRectList: false, 20756 DOMStringList: false, 20757 DOMTokenList: true, 20758 DataTransferItemList: false, 20759 FileList: false, 20760 HTMLAllCollection: false, 20761 HTMLCollection: false, 20762 HTMLFormElement: false, 20763 HTMLSelectElement: false, 20764 MediaList: true, // TODO: Not spec compliant, should be false. 20765 MimeTypeArray: false, 20766 NamedNodeMap: false, 20767 NodeList: true, 20768 PaintRequestList: false, 20769 Plugin: false, 20770 PluginArray: false, 20771 SVGLengthList: false, 20772 SVGNumberList: false, 20773 SVGPathSegList: false, 20774 SVGPointList: false, 20775 SVGStringList: false, 20776 SVGTransformList: false, 20777 SourceBufferList: false, 20778 StyleSheetList: true, // TODO: Not spec compliant, should be false. 20779 TextTrackCueList: false, 20780 TextTrackList: false, 20781 TouchList: false 20782 }; 20783 20784 for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) { 20785 var NAME = collections[i]; 20786 var explicit = DOMIterables[NAME]; 20787 var Collection = global[NAME]; 20788 var proto = Collection && Collection.prototype; 20789 var key; 20790 if (proto) { 20791 if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues); 20792 if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); 20793 Iterators[NAME] = ArrayValues;
vendor: 8,299 bytes, lines 20794-20996
20794 if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true); 20795 } 20796 } 20797 20798 20799/***/ }), 20800/* 328 */ 20801/***/ (function(module, exports) { 20802 20803 /* WEBPACK VAR INJECTION */(function(global) {/** 20804 * Copyright (c) 2014, Facebook, Inc. 20805 * All rights reserved. 20806 * 20807 * This source code is licensed under the BSD-style license found in the 20808 * https://raw.github.com/facebook/regenerator/master/LICENSE file. An 20809 * additional grant of patent rights can be found in the PATENTS file in 20810 * the same directory. 20811 */ 20812 20813 !(function(global) { 20814 "use strict"; 20815 20816 var Op = Object.prototype; 20817 var hasOwn = Op.hasOwnProperty; 20818 var undefined; // More compressible than void 0. 20819 var $Symbol = typeof Symbol === "function" ? Symbol : {}; 20820 var iteratorSymbol = $Symbol.iterator || "@@iterator"; 20821 var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; 20822 var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; 20823 20824 var inModule = typeof module === "object"; 20825 var runtime = global.regeneratorRuntime; 20826 if (runtime) { 20827 if (inModule) { 20828 // If regeneratorRuntime is defined globally and we're in a module, 20829 // make the exports object identical to regeneratorRuntime. 20830 module.exports = runtime; 20831 } 20832 // Don't bother evaluating the rest of this file if the runtime was 20833 // already defined globally. 20834 return; 20835 } 20836 20837 // Define the runtime globally (as expected by generated code) as either 20838 // module.exports (if we're in a module) or a new, empty object. 20839 runtime = global.regeneratorRuntime = inModule ? module.exports : {}; 20840 20841 function wrap(innerFn, outerFn, self, tryLocsList) { 20842 // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. 20843 var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; 20844 var generator = Object.create(protoGenerator.prototype); 20845 var context = new Context(tryLocsList || []); 20846 20847 // The ._invoke method unifies the implementations of the .next, 20848 // .throw, and .return methods. 20849 generator._invoke = makeInvokeMethod(innerFn, self, context); 20850 20851 return generator; 20852 } 20853 runtime.wrap = wrap; 20854 20855 // Try/catch helper to minimize deoptimizations. Returns a completion 20856 // record like context.tryEntries[i].completion. This interface could 20857 // have been (and was previously) designed to take a closure to be 20858 // invoked without arguments, but in all the cases we care about we 20859 // already have an existing method we want to call, so there's no need 20860 // to create a new function object. We can even get away with assuming 20861 // the method takes exactly one argument, since that happens to be true 20862 // in every case, so we don't have to touch the arguments object. The 20863 // only additional allocation required is the completion record, which 20864 // has a stable shape and so hopefully should be cheap to allocate. 20865 function tryCatch(fn, obj, arg) { 20866 try { 20867 return { type: "normal", arg: fn.call(obj, arg) }; 20868 } catch (err) { 20869 return { type: "throw", arg: err }; 20870 } 20871 } 20872 20873 var GenStateSuspendedStart = "suspendedStart"; 20874 var GenStateSuspendedYield = "suspendedYield"; 20875 var GenStateExecuting = "executing"; 20876 var GenStateCompleted = "completed"; 20877 20878 // Returning this object from the innerFn has the same effect as 20879 // breaking out of the dispatch switch statement. 20880 var ContinueSentinel = {}; 20881 20882 // Dummy constructor functions that we use as the .constructor and 20883 // .constructor.prototype properties for functions that return Generator 20884 // objects. For full spec compliance, you may wish to configure your 20885 // minifier not to mangle the names of these two functions. 20886 function Generator() {} 20887 function GeneratorFunction() {} 20888 function GeneratorFunctionPrototype() {} 20889 20890 // This is a polyfill for %IteratorPrototype% for environments that 20891 // don't natively support it. 20892 var IteratorPrototype = {}; 20893 IteratorPrototype[iteratorSymbol] = function () { 20894 return this; 20895 }; 20896 20897 var getProto = Object.getPrototypeOf; 20898 var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); 20899 if (NativeIteratorPrototype && 20900 NativeIteratorPrototype !== Op && 20901 hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { 20902 // This environment has a native %IteratorPrototype%; use it instead 20903 // of the polyfill. 20904 IteratorPrototype = NativeIteratorPrototype; 20905 } 20906 20907 var Gp = GeneratorFunctionPrototype.prototype = 20908 Generator.prototype = Object.create(IteratorPrototype); 20909 GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; 20910 GeneratorFunctionPrototype.constructor = GeneratorFunction; 20911 GeneratorFunctionPrototype[toStringTagSymbol] = 20912 GeneratorFunction.displayName = "GeneratorFunction"; 20913 20914 // Helper for defining the .next, .throw, and .return methods of the 20915 // Iterator interface in terms of a single ._invoke method. 20916 function defineIteratorMethods(prototype) { 20917 ["next", "throw", "return"].forEach(function(method) { 20918 prototype[method] = function(arg) { 20919 return this._invoke(method, arg); 20920 }; 20921 }); 20922 } 20923 20924 runtime.isGeneratorFunction = function(genFun) { 20925 var ctor = typeof genFun === "function" && genFun.constructor; 20926 return ctor 20927 ? ctor === GeneratorFunction || 20928 // For the native GeneratorFunction constructor, the best we can 20929 // do is to check its .name property. 20930 (ctor.displayName || ctor.name) === "GeneratorFunction" 20931 : false; 20932 }; 20933 20934 runtime.mark = function(genFun) { 20935 if (Object.setPrototypeOf) { 20936 Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); 20937 } else { 20938 genFun.__proto__ = GeneratorFunctionPrototype; 20939 if (!(toStringTagSymbol in genFun)) { 20940 genFun[toStringTagSymbol] = "GeneratorFunction"; 20941 } 20942 } 20943 genFun.prototype = Object.create(Gp); 20944 return genFun; 20945 }; 20946 20947 // Within the body of any async function, `await x` is transformed to 20948 // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test 20949 // `hasOwn.call(value, "__await")` to determine if the yielded value is 20950 // meant to be awaited. 20951 runtime.awrap = function(arg) { 20952 return { __await: arg }; 20953 }; 20954 20955 function AsyncIterator(generator) { 20956 function invoke(method, arg, resolve, reject) { 20957 var record = tryCatch(generator[method], generator, arg); 20958 if (record.type === "throw") { 20959 reject(record.arg); 20960 } else { 20961 var result = record.arg; 20962 var value = result.value; 20963 if (value && 20964 typeof value === "object" && 20965 hasOwn.call(value, "__await")) { 20966 return Promise.resolve(value.__await).then(function(value) { 20967 invoke("next", value, resolve, reject); 20968 }, function(err) { 20969 invoke("throw", err, resolve, reject); 20970 }); 20971 } 20972 20973 return Promise.resolve(value).then(function(unwrapped) { 20974 // When a yielded Promise is resolved, its final value becomes 20975 // the .value of the Promise<{value,done}> result for the 20976 // current iteration. If the Promise is rejected, however, the 20977 // result for this iteration will be rejected with the same 20978 // reason. Note that rejections of yielded Promises are not 20979 // thrown back into the generator function, as is the case 20980 // when an awaited Promise is rejected. This difference in 20981 // behavior between yield and await is important, because it 20982 // allows the consumer to decide what to do with the yielded 20983 // rejection (swallow it and continue, manually .throw it back 20984 // into the generator, abandon iteration, whatever). With 20985 // await, by contrast, there is no opportunity to examine the 20986 // rejection reason outside the generator function, so the 20987 // only option is to throw it from the await expression, and 20988 // let the generator function handle the exception. 20989 result.value = unwrapped; 20990 resolve(result); 20991 }, reject); 20992 } 20993 } 20994 20995 if (typeof global.process === "object" && global.process.domain) { 20996 invoke = global.process.domain.bind(invoke);
vendor: 16,642 bytes, lines 20996-21532
20996 20997 } 20998 20999 var previousPromise; 21000 21001 function enqueue(method, arg) { 21002 function callInvokeWithMethodAndArg() { 21003 return new Promise(function(resolve, reject) { 21004 invoke(method, arg, resolve, reject); 21005 }); 21006 } 21007 21008 return previousPromise = 21009 // If enqueue has been called before, then we want to wait until 21010 // all previous Promises have been resolved before calling invoke, 21011 // so that results are always delivered in the correct order. If 21012 // enqueue has not been called before, then it is important to 21013 // call invoke immediately, without waiting on a callback to fire, 21014 // so that the async generator function has the opportunity to do 21015 // any necessary setup in a predictable way. This predictability 21016 // is why the Promise constructor synchronously invokes its 21017 // executor callback, and why async functions synchronously 21018 // execute code before the first await. Since we implement simple 21019 // async functions in terms of async generators, it is especially 21020 // important to get this right, even though it requires care. 21021 previousPromise ? previousPromise.then( 21022 callInvokeWithMethodAndArg, 21023 // Avoid propagating failures to Promises returned by later 21024 // invocations of the iterator. 21025 callInvokeWithMethodAndArg 21026 ) : callInvokeWithMethodAndArg(); 21027 } 21028 21029 // Define the unified helper method that is used to implement .next, 21030 // .throw, and .return (see defineIteratorMethods). 21031 this._invoke = enqueue; 21032 } 21033 21034 defineIteratorMethods(AsyncIterator.prototype); 21035 AsyncIterator.prototype[asyncIteratorSymbol] = function () { 21036 return this; 21037 }; 21038 runtime.AsyncIterator = AsyncIterator; 21039 21040 // Note that simple async functions are implemented on top of 21041 // AsyncIterator objects; they just return a Promise for the value of 21042 // the final result produced by the iterator. 21043 runtime.async = function(innerFn, outerFn, self, tryLocsList) { 21044 var iter = new AsyncIterator( 21045 wrap(innerFn, outerFn, self, tryLocsList) 21046 ); 21047 21048 return runtime.isGeneratorFunction(outerFn) 21049 ? iter // If outerFn is a generator, return the full iterator. 21050 : iter.next().then(function(result) { 21051 return result.done ? result.value : iter.next(); 21052 }); 21053 }; 21054 21055 function makeInvokeMethod(innerFn, self, context) { 21056 var state = GenStateSuspendedStart; 21057 21058 return function invoke(method, arg) { 21059 if (state === GenStateExecuting) { 21060 throw new Error("Generator is already running"); 21061 } 21062 21063 if (state === GenStateCompleted) { 21064 if (method === "throw") { 21065 throw arg; 21066 } 21067 21068 // Be forgiving, per 25.3.3.3.3 of the spec: 21069 // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume 21070 return doneResult(); 21071 } 21072 21073 context.method = method; 21074 context.arg = arg; 21075 21076 while (true) { 21077 var delegate = context.delegate; 21078 if (delegate) { 21079 var delegateResult = maybeInvokeDelegate(delegate, context); 21080 if (delegateResult) { 21081 if (delegateResult === ContinueSentinel) continue; 21082 return delegateResult; 21083 } 21084 } 21085 21086 if (context.method === "next") { 21087 // Setting context._sent for legacy support of Babel's 21088 // function.sent implementation. 21089 context.sent = context._sent = context.arg; 21090 21091 } else if (context.method === "throw") { 21092 if (state === GenStateSuspendedStart) { 21093 state = GenStateCompleted; 21094 throw context.arg; 21095 } 21096 21097 context.dispatchException(context.arg); 21098 21099 } else if (context.method === "return") { 21100 context.abrupt("return", context.arg); 21101 } 21102 21103 state = GenStateExecuting; 21104 21105 var record = tryCatch(innerFn, self, context); 21106 if (record.type === "normal") { 21107 // If an exception is thrown from innerFn, we leave state === 21108 // GenStateExecuting and loop back for another invocation. 21109 state = context.done 21110 ? GenStateCompleted 21111 : GenStateSuspendedYield; 21112 21113 if (record.arg === ContinueSentinel) { 21114 continue; 21115 } 21116 21117 return { 21118 value: record.arg, 21119 done: context.done 21120 }; 21121 21122 } else if (record.type === "throw") { 21123 state = GenStateCompleted; 21124 // Dispatch the exception by looping back around to the 21125 // context.dispatchException(context.arg) call above. 21126 context.method = "throw"; 21127 context.arg = record.arg; 21128 } 21129 } 21130 }; 21131 } 21132 21133 // Call delegate.iterator[context.method](context.arg) and handle the 21134 // result, either by returning a { value, done } result from the 21135 // delegate iterator, or by modifying context.method and context.arg, 21136 // setting context.delegate to null, and returning the ContinueSentinel. 21137 function maybeInvokeDelegate(delegate, context) { 21138 var method = delegate.iterator[context.method]; 21139 if (method === undefined) { 21140 // A .throw or .return when the delegate iterator has no .throw 21141 // method always terminates the yield* loop. 21142 context.delegate = null; 21143 21144 if (context.method === "throw") { 21145 if (delegate.iterator.return) { 21146 // If the delegate iterator has a return method, give it a 21147 // chance to clean up. 21148 context.method = "return"; 21149 context.arg = undefined; 21150 maybeInvokeDelegate(delegate, context); 21151 21152 if (context.method === "throw") { 21153 // If maybeInvokeDelegate(context) changed context.method from 21154 // "return" to "throw", let that override the TypeError below. 21155 return ContinueSentinel; 21156 } 21157 } 21158 21159 context.method = "throw"; 21160 context.arg = new TypeError( 21161 "The iterator does not provide a 'throw' method"); 21162 } 21163 21164 return ContinueSentinel; 21165 } 21166 21167 var record = tryCatch(method, delegate.iterator, context.arg); 21168 21169 if (record.type === "throw") { 21170 context.method = "throw"; 21171 context.arg = record.arg; 21172 context.delegate = null; 21173 return ContinueSentinel; 21174 } 21175 21176 var info = record.arg; 21177 21178 if (! info) { 21179 context.method = "throw"; 21180 context.arg = new TypeError("iterator result is not an object"); 21181 context.delegate = null; 21182 return ContinueSentinel; 21183 } 21184 21185 if (info.done) { 21186 // Assign the result of the finished delegate to the temporary 21187 // variable specified by delegate.resultName (see delegateYield). 21188 context[delegate.resultName] = info.value; 21189 21190 // Resume execution at the desired location (see delegateYield). 21191 context.next = delegate.nextLoc; 21192 21193 // If context.method was "throw" but the delegate handled the 21194 // exception, let the outer generator proceed normally. If 21195 // context.method was "next", forget context.arg since it has been 21196 // "consumed" by the delegate iterator. If context.method was 21197 // "return", allow the original .return call to continue in the 21198 // outer generator. 21199 if (context.method !== "return") { 21200 context.method = "next"; 21201 context.arg = undefined; 21202 } 21203 21204 } else { 21205 // Re-yield the result returned by the delegate method. 21206 return info; 21207 } 21208 21209 // The delegate iterator is finished, so forget it and continue with 21210 // the outer generator. 21211 context.delegate = null; 21212 return ContinueSentinel; 21213 } 21214 21215 // Define Generator.prototype.{next,throw,return} in terms of the 21216 // unified ._invoke helper method. 21217 defineIteratorMethods(Gp); 21218 21219 Gp[toStringTagSymbol] = "Generator"; 21220 21221 // A Generator should always return itself as the iterator object when the 21222 // @@iterator function is called on it. Some browsers' implementations of the 21223 // iterator prototype chain incorrectly implement this, causing the Generator 21224 // object to not be returned from this call. This ensures that doesn't happen. 21225 // See https://github.com/facebook/regenerator/issues/274 for more details. 21226 Gp[iteratorSymbol] = function() { 21227 return this; 21228 }; 21229 21230 Gp.toString = function() { 21231 return "[object Generator]"; 21232 }; 21233 21234 function pushTryEntry(locs) { 21235 var entry = { tryLoc: locs[0] }; 21236 21237 if (1 in locs) { 21238 entry.catchLoc = locs[1]; 21239 } 21240 21241 if (2 in locs) { 21242 entry.finallyLoc = locs[2]; 21243 entry.afterLoc = locs[3]; 21244 } 21245 21246 this.tryEntries.push(entry); 21247 } 21248 21249 function resetTryEntry(entry) { 21250 var record = entry.completion || {}; 21251 record.type = "normal"; 21252 delete record.arg; 21253 entry.completion = record; 21254 } 21255 21256 function Context(tryLocsList) { 21257 // The root entry object (effectively a try statement without a catch 21258 // or a finally block) gives us a place to store values thrown from 21259 // locations where there is no enclosing try statement. 21260 this.tryEntries = [{ tryLoc: "root" }]; 21261 tryLocsList.forEach(pushTryEntry, this); 21262 this.reset(true); 21263 } 21264 21265 runtime.keys = function(object) { 21266 var keys = []; 21267 for (var key in object) { 21268 keys.push(key); 21269 } 21270 keys.reverse(); 21271 21272 // Rather than returning an object with a next method, we keep 21273 // things simple and return the next function itself. 21274 return function next() { 21275 while (keys.length) { 21276 var key = keys.pop(); 21277 if (key in object) { 21278 next.value = key; 21279 next.done = false; 21280 return next; 21281 } 21282 } 21283 21284 // To avoid creating an additional object, we just hang the .value 21285 // and .done properties off the next function object itself. This 21286 // also ensures that the minifier will not anonymize the function. 21287 next.done = true; 21288 return next; 21289 }; 21290 }; 21291 21292 function values(iterable) { 21293 if (iterable) { 21294 var iteratorMethod = iterable[iteratorSymbol]; 21295 if (iteratorMethod) { 21296 return iteratorMethod.call(iterable); 21297 } 21298 21299 if (typeof iterable.next === "function") { 21300 return iterable; 21301 } 21302 21303 if (!isNaN(iterable.length)) { 21304 var i = -1, next = function next() { 21305 while (++i < iterable.length) { 21306 if (hasOwn.call(iterable, i)) { 21307 next.value = iterable[i]; 21308 next.done = false; 21309 return next; 21310 } 21311 } 21312 21313 next.value = undefined; 21314 next.done = true; 21315 21316 return next; 21317 }; 21318 21319 return next.next = next; 21320 } 21321 } 21322 21323 // Return an iterator with no values. 21324 return { next: doneResult }; 21325 } 21326 runtime.values = values; 21327 21328 function doneResult() { 21329 return { value: undefined, done: true }; 21330 } 21331 21332 Context.prototype = { 21333 constructor: Context, 21334 21335 reset: function(skipTempReset) { 21336 this.prev = 0; 21337 this.next = 0; 21338 // Resetting context._sent for legacy support of Babel's 21339 // function.sent implementation. 21340 this.sent = this._sent = undefined; 21341 this.done = false; 21342 this.delegate = null; 21343 21344 this.method = "next"; 21345 this.arg = undefined; 21346 21347 this.tryEntries.forEach(resetTryEntry); 21348 21349 if (!skipTempReset) { 21350 for (var name in this) { 21351 // Not sure about the optimal order of these conditions: 21352 if (name.charAt(0) === "t" && 21353 hasOwn.call(this, name) && 21354 !isNaN(+name.slice(1))) { 21355 this[name] = undefined; 21356 } 21357 } 21358 } 21359 }, 21360 21361 stop: function() { 21362 this.done = true; 21363 21364 var rootEntry = this.tryEntries[0]; 21365 var rootRecord = rootEntry.completion; 21366 if (rootRecord.type === "throw") { 21367 throw rootRecord.arg; 21368 } 21369 21370 return this.rval; 21371 }, 21372 21373 dispatchException: function(exception) { 21374 if (this.done) { 21375 throw exception; 21376 } 21377 21378 var context = this; 21379 function handle(loc, caught) { 21380 record.type = "throw"; 21381 record.arg = exception; 21382 context.next = loc; 21383 21384 if (caught) { 21385 // If the dispatched exception was caught by a catch block, 21386 // then let that catch block handle the exception normally. 21387 context.method = "next"; 21388 context.arg = undefined; 21389 } 21390 21391 return !! caught; 21392 } 21393 21394 for (var i = this.tryEntries.length - 1; i >= 0; --i) { 21395 var entry = this.tryEntries[i]; 21396 var record = entry.completion; 21397 21398 if (entry.tryLoc === "root") { 21399 // Exception thrown outside of any try block that could handle 21400 // it, so set the completion value of the entire function to 21401 // throw the exception. 21402 return handle("end"); 21403 } 21404 21405 if (entry.tryLoc <= this.prev) { 21406 var hasCatch = hasOwn.call(entry, "catchLoc"); 21407 var hasFinally = hasOwn.call(entry, "finallyLoc"); 21408 21409 if (hasCatch && hasFinally) { 21410 if (this.prev < entry.catchLoc) { 21411 return handle(entry.catchLoc, true); 21412 } else if (this.prev < entry.finallyLoc) { 21413 return handle(entry.finallyLoc); 21414 } 21415 21416 } else if (hasCatch) { 21417 if (this.prev < entry.catchLoc) { 21418 return handle(entry.catchLoc, true); 21419 } 21420 21421 } else if (hasFinally) { 21422 if (this.prev < entry.finallyLoc) { 21423 return handle(entry.finallyLoc); 21424 } 21425 21426 } else { 21427 throw new Error("try statement without catch or finally"); 21428 } 21429 } 21430 } 21431 }, 21432 21433 abrupt: function(type, arg) { 21434 for (var i = this.tryEntries.length - 1; i >= 0; --i) { 21435 var entry = this.tryEntries[i]; 21436 if (entry.tryLoc <= this.prev && 21437 hasOwn.call(entry, "finallyLoc") && 21438 this.prev < entry.finallyLoc) { 21439 var finallyEntry = entry; 21440 break; 21441 } 21442 } 21443 21444 if (finallyEntry && 21445 (type === "break" || 21446 type === "continue") && 21447 finallyEntry.tryLoc <= arg && 21448 arg <= finallyEntry.finallyLoc) { 21449 // Ignore the finally entry if control is not jumping to a 21450 // location outside the try/catch block. 21451 finallyEntry = null; 21452 } 21453 21454 var record = finallyEntry ? finallyEntry.completion : {}; 21455 record.type = type; 21456 record.arg = arg; 21457 21458 if (finallyEntry) { 21459 this.method = "next"; 21460 this.next = finallyEntry.finallyLoc; 21461 return ContinueSentinel; 21462 } 21463 21464 return this.complete(record); 21465 }, 21466 21467 complete: function(record, afterLoc) { 21468 if (record.type === "throw") { 21469 throw record.arg; 21470 } 21471 21472 if (record.type === "break" || 21473 record.type === "continue") { 21474 this.next = record.arg; 21475 } else if (record.type === "return") { 21476 this.rval = this.arg = record.arg; 21477 this.method = "return"; 21478 this.next = "end"; 21479 } else if (record.type === "normal" && afterLoc) { 21480 this.next = afterLoc; 21481 } 21482 21483 return ContinueSentinel; 21484 }, 21485 21486 finish: function(finallyLoc) { 21487 for (var i = this.tryEntries.length - 1; i >= 0; --i) { 21488 var entry = this.tryEntries[i]; 21489 if (entry.finallyLoc === finallyLoc) { 21490 this.complete(entry.completion, entry.afterLoc); 21491 resetTryEntry(entry); 21492 return ContinueSentinel; 21493 } 21494 } 21495 }, 21496 21497 "catch": function(tryLoc) { 21498 for (var i = this.tryEntries.length - 1; i >= 0; --i) { 21499 var entry = this.tryEntries[i]; 21500 if (entry.tryLoc === tryLoc) { 21501 var record = entry.completion; 21502 if (record.type === "throw") { 21503 var thrown = record.arg; 21504 resetTryEntry(entry); 21505 } 21506 return thrown; 21507 } 21508 } 21509 21510 // The context.catch method must only be called with a location 21511 // argument that corresponds to a known catch block. 21512 throw new Error("illegal catch attempt"); 21513 }, 21514 21515 delegateYield: function(iterable, resultName, nextLoc) { 21516 this.delegate = { 21517 iterator: values(iterable), 21518 resultName: resultName, 21519 nextLoc: nextLoc 21520 }; 21521 21522 if (this.method === "next") { 21523 // Deliberately forget the last sent value so that we don't 21524 // accidentally pass it on to the delegate. 21525 this.arg = undefined; 21526 } 21527 21528 return ContinueSentinel; 21529 } 21530 }; 21531 })( 21532 //
21532Among the various tricks for obtaining a reference to the global 21533 // object, this seems to be the most reliable technique that does not 21534 // use indirect eval (which violates Content Security Policy). 21535 typeof global === "object" ? global : 21536 typeof window === "object" ? window : 21537 typeof self === "object" ? self : this 21538 ); 21539 21540 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) 21541 21542/***/ }), 21543/* 329 */ 21544/***/ (function(module, exports, __webpack_require__) { 21545 21546 __webpack_require__(330); 21547 module.exports = __webpack_require__(10).RegExp.escape; 21548 21549 21550/***/ }), 21551/* 330 */ 21552/***/ (function(module, exports, __webpack_require__) { 21553 21554 // https://github.com/benjamingr/RexExp.escape 21555 var $export = __webpack_require__(9); 21556 var $re = __webpack_require__(331)(/[\\^$*+?.()|[\]{}]/g, '\\$&'); 21557 21558 $export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } }); 21559 21560 21561/***/ }), 21562/* 331 */ 21563/***/ (function(module, exports) { 21564 21565 module.exports = function (regExp, replace) { 21566 var replacer = replace === Object(replace) ? function (part) { 21567 return replace[part]; 21568 } : replace; 21569 return function (it) { 21570 return String(it).replace(regExp, replacer); 21571 }; 21572 }; 21573 21574 21575/***/ }), 21576/* 332 */ 21577/***/ (function(module, exports, __webpack_require__) { 21578 21579 /* WEBPACK VAR INJECTION */(function($) {"use strict"; 21580 21581 Object.defineProperty(exports, "__esModule", { 21582 value: true 21583 }); 21584 var news_ajax = function news_ajax() { 21585 21586 var posts = $("div#news_posts"); 21587 var post_length = posts.find("div.news_posts_inner article.news_post").length; 21588 var total_posts = posts.data("total_posts"); 21589 var per_page = posts.data("per_page"); 21590 var current_category = posts.data("current_category"); 21591 var more = true; 21592 if (total_posts > per_page) { 21593 more_display(); 21594 } 21595 21596 function more_display() { 21597 var scroll = 0; 21598 $(window).on("scroll", function () { 21599 if (total_posts > post_length) { 21600 if ($(window).scrollTop() >= scroll) { 21601 if ($(window).scrollTop() + $(window).height() > $("body, html").outerHeight() * 0.6) { 21602 if (more) { 21603 more = false; 21604 ajax_request(); 21605 } 21606 } 21607 } 21608 scroll = $(window).scrollTop(); 21609 } 21610 }); 21611 } 21612 21613 function ajax_request() { 21614 var offset = post_length; 21615 $.ajax({ 21616 type: "POST", 21617 url: ajaxurl, 21618 data: { 21619 "action": "my_ajax_get_news_posts", 21620 "offset": offset, 21621 "per_page": per_page, 21622 "current_category": current_category 21623 } 21624 }).then(function (result) { 21625 var data = JSON.parse(result); 21626 $.when(posts.find("div.news_posts_inner").append(data["post"])).done(function () { 21627 update(); 21628 }); 21629 }, function () { 21630 console.log("Request fails"); 21631 }); 21632 } 21633 21634 function update() { 21635 post_length = posts.find("div.news_posts_inner article.news_post").length; 21636 if (total_posts > post_length) { 21637 more = true; 21638 } 21639 } 21640 }; 21641 21642 exports.default = news_ajax; 21643 /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) 21644 21645/***/ }), 21646/* 333 */ 21647/***/ (function(module, exports) { 21648 21649 "use strict"; 21650 21651 Object.defineProperty(exports, "__esModule", { 21652 value: true 21653 }); 21654 var browser = { 21655 ua: null, 21656 init: function init() { 21657 this.ua = navigator.userAgent.toLowerCase(); 21658 this.ua = { 21659 isLtIE8: typeof window.addEventListener == "undefined" && typeof document.getElementsByClassName == "undefined", 21660 isLtIE9: document.uniqueID && typeof window.matchMedia == "undefined", 21661 isIE: document.uniqueID, 21662 isFirefox: /firefox/.test(this.ua), 21663 isChrome: /chrome/.test(this.ua), 21664 isSafari: /safari/.test(this.ua) && !/chrome/.test(this.ua), 21665 isWebKit: /applewebkit/.test(this.ua), 21666 isMobile: /mobile/.test(this.ua), 21667 isIOS: /i(phone|pod|pad)/.test(this.ua), 21668 isIPhone: /iphone/.test(this.ua), 21669 isIPad: /ipad/.test(this.ua), 21670 isAndroid: /android/.test(this.ua) 21671 }; 21672 }, 21673 isDevice: function isDevice() { 21674 if (this.ua.isIPhone || this.ua.isAndroid && this.ua.isMobile) { 21675 return "sp"; 21676 } else if (this.ua.isIPad || this.ua.isAndroid) { 21677 return "tablet"; 21678 } 21679 } 21680 }; 21681 21682 exports.default = browser; 21683 21684/***/ }), 21685/* 334 */ 21686/***/ (function(module, exports, __webpack_require__) { 21687 21688 var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* 21689 _ _ _ _ 21690 ___| (_) ___| | __ (_)___ 21691 / __| | |/ __| |/ / | / __| 21692 \__ \ | | (__| < _ | \__ \ 21693 |___/_|_|\___|_|\_(_)/ |___/ 21694 |__/ 21695 21696 Version: 1.8.1 21697 Author: Ken Wheeler 21698 Website: http://kenwheeler.github.io 21699 Docs: http://kenwheeler.github.io/slick 21700 Repo: http://github.com/kenwheeler/slick 21701 Issues: http://github.com/kenwheeler/slick/issues 21702 21703 */ 21704 /* global window, document, define, jQuery, setInterval, clearInterval */ 21705 ;(function(factory) { 21706 'use strict'; 21707 if (true) { 21708 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 21709 } else if (typeof exports !== 'undefined') { 21710 module.exports = factory(require('jquery')); 21711 } else { 21712 factory(jQuery); 21713 } 21714 21715 }(function($) { 21716 'use strict'; 21717 var Slick = window.Slick || {}; 21718 21719 Slick = (function() { 21720 21721 var instanceUid = 0; 21722 21723 function Slick(element, settings) { 21724 21725 var _ = this, dataSettings; 21726 21727 _.defaults = { 21728 accessibility: true, 21729 adaptiveHeight: false, 21730 appendArrows: $(element), 21731 appendDots: $(element), 21732 arrows: true, 21733 asNavFor: null, 21734 prevArrow: '<button class="slick-prev" aria-label="Previous" type="button">Previous</button>', 21735 nextArrow: '<button class="slick-next" aria-label="Next" type="button">Next</button>', 21736 autoplay: false, 21737 autoplaySpeed: 3000, 21738 centerMode: false, 21739 centerPadding: '50px', 21740 cssEase: 'ease', 21741 customPaging: function(slider, i) { 21742 return $('<button type="button" />').text(i + 1); 21743 }, 21744 dots: false, 21745 dotsClass: 'slick-dots', 21746 draggable: true, 21747 easing: 'linear', 21748 edgeFriction: 0.35, 21749 fade: false, 21750 focusOnSelect: false, 21751 focusOnChange: false, 21752 infinite: true, 21753 initialSlide: 0, 21754 lazyLoad: 'ondemand', 21755 mobileFirst: false, 21756 pauseOnHover: true, 21757 pauseOnFocus: true, 21758 pauseOnDotsHover: false, 21759 respondTo: 'window', 21760 responsive: null, 21761 rows: 1, 21762 rtl: false, 21763 slide: '', 21764 slidesPerRow: 1, 21765 slidesToShow: 1, 21766 slidesToScroll: 1, 21767 speed: 500, 21768 swipe: true, 21769 swipeToSlide: false, 21770 touchMove: true, 21771 touchThreshold: 5, 21772 useCSS: true, 21773 useTransform: true, 21774 variableWidth: false, 21775 vertical: false, 21776 verticalSwiping: false, 21777 waitForAnimate: true, 21778 zIndex: 1000 21779 }; 21780 21781 _.initials = { 21782 animating: false, 21783 dragging: false, 21784 autoPlayTimer: null, 21785 currentDirection: 0, 21786 currentLeft: null, 21787 currentSlide: 0, 21788 direction: 1, 21789 $dots: null, 21790 listWidth: null, 21791 listHeight: null, 21792 loadIndex: 0, 21793 $nextArrow: null, 21794 $prevArrow: null, 21795 scrolling: false, 21796 slideCount: null, 21797 slideWidth: null, 21798 $slideTrack: null, 21799 $slides: null, 21800 sliding: false, 21801 slideOffset: 0, 21802 swipeLeft: null, 21803 swiping: false, 21804 $list: null, 21805 touchObject: {}, 21806 transformsEnabled: false,
vendor: 87,829 bytes, lines 21807-24713
21807 unslicked: false 21808 }; 21809 21810 $.extend(_, _.initials); 21811 21812 _.activeBreakpoint = null; 21813 _.animType = null; 21814 _.animProp = null; 21815 _.breakpoints = []; 21816 _.breakpointSettings = []; 21817 _.cssTransitions = false; 21818 _.focussed = false; 21819 _.interrupted = false; 21820 _.hidden = 'hidden'; 21821 _.paused = true; 21822 _.positionProp = null; 21823 _.respondTo = null; 21824 _.rowCount = 1; 21825 _.shouldClick = true; 21826 _.$slider = $(element); 21827 _.$slidesCache = null; 21828 _.transformType = null; 21829 _.transitionType = null; 21830 _.visibilityChange = 'visibilitychange'; 21831 _.windowWidth = 0; 21832 _.windowTimer = null; 21833 21834 dataSettings = $(element).data('slick') || {}; 21835 21836 _.options = $.extend({}, _.defaults, settings, dataSettings); 21837 21838 _.currentSlide = _.options.initialSlide; 21839 21840 _.originalSettings = _.options; 21841 21842 if (typeof document.mozHidden !== 'undefined') { 21843 _.hidden = 'mozHidden'; 21844 _.visibilityChange = 'mozvisibilitychange'; 21845 } else if (typeof document.webkitHidden !== 'undefined') { 21846 _.hidden = 'webkitHidden'; 21847 _.visibilityChange = 'webkitvisibilitychange'; 21848 } 21849 21850 _.autoPlay = $.proxy(_.autoPlay, _); 21851 _.autoPlayClear = $.proxy(_.autoPlayClear, _); 21852 _.autoPlayIterator = $.proxy(_.autoPlayIterator, _); 21853 _.changeSlide = $.proxy(_.changeSlide, _); 21854 _.clickHandler = $.proxy(_.clickHandler, _); 21855 _.selectHandler = $.proxy(_.selectHandler, _); 21856 _.setPosition = $.proxy(_.setPosition, _); 21857 _.swipeHandler = $.proxy(_.swipeHandler, _); 21858 _.dragHandler = $.proxy(_.dragHandler, _); 21859 _.keyHandler = $.proxy(_.keyHandler, _); 21860 21861 _.instanceUid = instanceUid++; 21862 21863 // A simple way to check for HTML strings 21864 // Strict HTML recognition (must start with <) 21865 // Extracted from jQuery v1.11 source 21866 _.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/; 21867 21868 21869 _.registerBreakpoints(); 21870 _.init(true); 21871 21872 } 21873 21874 return Slick; 21875 21876 }()); 21877 21878 Slick.prototype.activateADA = function() { 21879 var _ = this; 21880 21881 _.$slideTrack.find('.slick-active').attr({ 21882 'aria-hidden': 'false' 21883 }).find('a, input, button, select').attr({ 21884 'tabindex': '0' 21885 }); 21886 21887 }; 21888 21889 Slick.prototype.addSlide = Slick.prototype.slickAdd = function(markup, index, addBefore) { 21890 21891 var _ = this; 21892 21893 if (typeof(index) === 'boolean') { 21894 addBefore = index; 21895 index = null; 21896 } else if (index < 0 || (index >= _.slideCount)) { 21897 return false; 21898 } 21899 21900 _.unload(); 21901 21902 if (typeof(index) === 'number') { 21903 if (index === 0 && _.$slides.length === 0) { 21904 $(markup).appendTo(_.$slideTrack); 21905 } else if (addBefore) { 21906 $(markup).insertBefore(_.$slides.eq(index)); 21907 } else { 21908 $(markup).insertAfter(_.$slides.eq(index)); 21909 } 21910 } else { 21911 if (addBefore === true) { 21912 $(markup).prependTo(_.$slideTrack); 21913 } else { 21914 $(markup).appendTo(_.$slideTrack); 21915 } 21916 } 21917 21918 _.$slides = _.$slideTrack.children(this.options.slide); 21919 21920 _.$slideTrack.children(this.options.slide).detach(); 21921 21922 _.$slideTrack.append(_.$slides); 21923 21924 _.$slides.each(function(index, element) { 21925 $(element).attr('data-slick-index', index); 21926 }); 21927 21928 _.$slidesCache = _.$slides; 21929 21930 _.reinit(); 21931 21932 }; 21933 21934 Slick.prototype.animateHeight = function() { 21935 var _ = this; 21936 if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) { 21937 var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true); 21938 _.$list.animate({ 21939 height: targetHeight 21940 }, _.options.speed); 21941 } 21942 }; 21943 21944 Slick.prototype.animateSlide = function(targetLeft, callback) { 21945 21946 var animProps = {}, 21947 _ = this; 21948 21949 _.animateHeight(); 21950 21951 if (_.options.rtl === true && _.options.vertical === false) { 21952 targetLeft = -targetLeft; 21953 } 21954 if (_.transformsEnabled === false) { 21955 if (_.options.vertical === false) { 21956 _.$slideTrack.animate({ 21957 left: targetLeft 21958 }, _.options.speed, _.options.easing, callback); 21959 } else { 21960 _.$slideTrack.animate({ 21961 top: targetLeft 21962 }, _.options.speed, _.options.easing, callback); 21963 } 21964 21965 } else { 21966 21967 if (_.cssTransitions === false) { 21968 if (_.options.rtl === true) { 21969 _.currentLeft = -(_.currentLeft); 21970 } 21971 $({ 21972 animStart: _.currentLeft 21973 }).animate({ 21974 animStart: targetLeft 21975 }, { 21976 duration: _.options.speed, 21977 easing: _.options.easing, 21978 step: function(now) { 21979 now = Math.ceil(now); 21980 if (_.options.vertical === false) { 21981 animProps[_.animType] = 'translate(' + 21982 now + 'px, 0px)'; 21983 _.$slideTrack.css(animProps); 21984 } else { 21985 animProps[_.animType] = 'translate(0px,' + 21986 now + 'px)'; 21987 _.$slideTrack.css(animProps); 21988 } 21989 }, 21990 complete: function() { 21991 if (callback) { 21992 callback.call(); 21993 } 21994 } 21995 }); 21996 21997 } else { 21998 21999 _.applyTransition(); 22000 targetLeft = Math.ceil(targetLeft); 22001 22002 if (_.options.vertical === false) { 22003 animProps[_.animType] = 'translate3d(' + targetLeft + 'px, 0px, 0px)'; 22004 } else { 22005 animProps[_.animType] = 'translate3d(0px,' + targetLeft + 'px, 0px)'; 22006 } 22007 _.$slideTrack.css(animProps); 22008 22009 if (callback) { 22010 setTimeout(function() { 22011 22012 _.disableTransition(); 22013 22014 callback.call(); 22015 }, _.options.speed); 22016 } 22017 22018 } 22019 22020 } 22021 22022 }; 22023 22024 Slick.prototype.getNavTarget = function() { 22025 22026 var _ = this, 22027 asNavFor = _.options.asNavFor; 22028 22029 if ( asNavFor && asNavFor !== null ) { 22030 asNavFor = $(asNavFor).not(_.$slider); 22031 } 22032 22033 return asNavFor; 22034 22035 }; 22036 22037 Slick.prototype.asNavFor = function(index) { 22038 22039 var _ = this, 22040 asNavFor = _.getNavTarget(); 22041 22042 if ( asNavFor !== null && typeof asNavFor === 'object' ) { 22043 asNavFor.each(function() { 22044 var target = $(this).slick('getSlick'); 22045 if(!target.unslicked) { 22046 target.slideHandler(index, true); 22047 } 22048 }); 22049 } 22050 22051 }; 22052 22053 Slick.prototype.applyTransition = function(slide) { 22054 22055 var _ = this, 22056 transition = {}; 22057 22058 if (_.options.fade === false) { 22059 transition[_.transitionType] = _.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase; 22060 } else { 22061 transition[_.transitionType] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssEase; 22062 } 22063 22064 if (_.options.fade === false) { 22065 _.$slideTrack.css(transition); 22066 } else { 22067 _.$slides.eq(slide).css(transition); 22068 } 22069 22070 }; 22071 22072 Slick.prototype.autoPlay = function() { 22073 22074 var _ = this; 22075 22076 _.autoPlayClear(); 22077 22078 if ( _.slideCount > _.options.slidesToShow ) { 22079 _.autoPlayTimer = setInterval( _.autoPlayIterator, _.options.autoplaySpeed ); 22080 } 22081 22082 }; 22083 22084 Slick.prototype.autoPlayClear = function() { 22085 22086 var _ = this; 22087 22088 if (_.autoPlayTimer) { 22089 clearInterval(_.autoPlayTimer); 22090 } 22091 22092 }; 22093 22094 Slick.prototype.autoPlayIterator = function() { 22095 22096 var _ = this, 22097 slideTo = _.currentSlide + _.options.slidesToScroll; 22098 22099 if ( !_.paused && !_.interrupted && !_.focussed ) { 22100 22101 if ( _.options.infinite === false ) { 22102 22103 if ( _.direction === 1 && ( _.currentSlide + 1 ) === ( _.slideCount - 1 )) { 22104 _.direction = 0; 22105 } 22106 22107 else if ( _.direction === 0 ) { 22108 22109 slideTo = _.currentSlide - _.options.slidesToScroll; 22110 22111 if ( _.currentSlide - 1 === 0 ) { 22112 _.direction = 1; 22113 } 22114 22115 } 22116 22117 } 22118 22119 _.slideHandler( slideTo ); 22120 22121 } 22122 22123 }; 22124 22125 Slick.prototype.buildArrows = function() { 22126 22127 var _ = this; 22128 22129 if (_.options.arrows === true ) { 22130 22131 _.$prevArrow = $(_.options.prevArrow).addClass('slick-arrow'); 22132 _.$nextArrow = $(_.options.nextArrow).addClass('slick-arrow'); 22133 22134 if( _.slideCount > _.options.slidesToShow ) { 22135 22136 _.$prevArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex'); 22137 _.$nextArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex'); 22138 22139 if (_.htmlExpr.test(_.options.prevArrow)) { 22140 _.$prevArrow.prependTo(_.options.appendArrows); 22141 } 22142 22143 if (_.htmlExpr.test(_.options.nextArrow)) { 22144 _.$nextArrow.appendTo(_.options.appendArrows); 22145 } 22146 22147 if (_.options.infinite !== true) { 22148 _.$prevArrow 22149 .addClass('slick-disabled') 22150 .attr('aria-disabled', 'true'); 22151 } 22152 22153 } else { 22154 22155 _.$prevArrow.add( _.$nextArrow ) 22156 22157 .addClass('slick-hidden') 22158 .attr({ 22159 'aria-disabled': 'true', 22160 'tabindex': '-1' 22161 }); 22162 22163 } 22164 22165 } 22166 22167 }; 22168 22169 Slick.prototype.buildDots = function() { 22170 22171 var _ = this, 22172 i, dot; 22173 22174 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 22175 22176 _.$slider.addClass('slick-dotted'); 22177 22178 dot = $('<ul />').addClass(_.options.dotsClass); 22179 22180 for (i = 0; i <= _.getDotCount(); i += 1) { 22181 dot.append($('<li />').append(_.options.customPaging.call(this, _, i))); 22182 } 22183 22184 _.$dots = dot.appendTo(_.options.appendDots); 22185 22186 _.$dots.find('li').first().addClass('slick-active'); 22187 22188 } 22189 22190 }; 22191 22192 Slick.prototype.buildOut = function() { 22193 22194 var _ = this; 22195 22196 _.$slides = 22197 _.$slider 22198 .children( _.options.slide + ':not(.slick-cloned)') 22199 .addClass('slick-slide'); 22200 22201 _.slideCount = _.$slides.length; 22202 22203 _.$slides.each(function(index, element) { 22204 $(element) 22205 .attr('data-slick-index', index) 22206 .data('originalStyling', $(element).attr('style') || ''); 22207 }); 22208 22209 _.$slider.addClass('slick-slider'); 22210 22211 _.$slideTrack = (_.slideCount === 0) ? 22212 $('<div class="slick-track"/>').appendTo(_.$slider) : 22213 _.$slides.wrapAll('<div class="slick-track"/>').parent(); 22214 22215 _.$list = _.$slideTrack.wrap( 22216 '<div class="slick-list"/>').parent(); 22217 _.$slideTrack.css('opacity', 0); 22218 22219 if (_.options.centerMode === true || _.options.swipeToSlide === true) { 22220 _.options.slidesToScroll = 1; 22221 } 22222 22223 $('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading'); 22224 22225 _.setupInfinite(); 22226 22227 _.buildArrows(); 22228 22229 _.buildDots(); 22230 22231 _.updateDots(); 22232 22233 22234 _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0); 22235 22236 if (_.options.draggable === true) { 22237 _.$list.addClass('draggable'); 22238 } 22239 22240 }; 22241 22242 Slick.prototype.buildRows = function() { 22243 22244 var _ = this, a, b, c, newSlides, numOfSlides, originalSlides,slidesPerSection; 22245 22246 newSlides = document.createDocumentFragment(); 22247 originalSlides = _.$slider.children(); 22248 22249 if(_.options.rows > 0) { 22250 22251 slidesPerSection = _.options.slidesPerRow * _.options.rows; 22252 numOfSlides = Math.ceil( 22253 originalSlides.length / slidesPerSection 22254 ); 22255 22256 for(a = 0; a < numOfSlides; a++){ 22257 var slide = document.createElement('div'); 22258 for(b = 0; b < _.options.rows; b++) { 22259 var row = document.createElement('div'); 22260 for(c = 0; c < _.options.slidesPerRow; c++) { 22261 var target = (a * slidesPerSection + ((b * _.options.slidesPerRow) + c)); 22262 if (originalSlides.get(target)) { 22263 row.appendChild(originalSlides.get(target)); 22264 } 22265 } 22266 slide.appendChild(row); 22267 } 22268 newSlides.appendChild(slide); 22269 } 22270 22271 _.$slider.empty().append(newSlides); 22272 _.$slider.children().children().children() 22273 .css({ 22274 'width':(100 / _.options.slidesPerRow) + '%', 22275 'display': 'inline-block' 22276 }); 22277 22278 } 22279 22280 }; 22281 22282 Slick.prototype.checkResponsive = function(initial, forceUpdate) { 22283 22284 var _ = this, 22285 breakpoint, targetBreakpoint, respondToWidth, triggerBreakpoint = false; 22286 var sliderWidth = _.$slider.width(); 22287 var windowWidth = window.innerWidth || $(window).width(); 22288 22289 if (_.respondTo === 'window') { 22290 respondToWidth = windowWidth; 22291 } else if (_.respondTo === 'slider') { 22292 respondToWidth = sliderWidth; 22293 } else if (_.respondTo === 'min') { 22294 respondToWidth = Math.min(windowWidth, sliderWidth); 22295 } 22296 22297 if ( _.options.responsive && 22298 _.options.responsive.length && 22299 _.options.responsive !== null) { 22300 22301 targetBreakpoint = null; 22302 22303 for (breakpoint in _.breakpoints) { 22304 if (_.breakpoints.hasOwnProperty(breakpoint)) { 22305 if (_.originalSettings.mobileFirst === false) { 22306 if (respondToWidth < _.breakpoints[breakpoint]) { 22307 targetBreakpoint = _.breakpoints[breakpoint]; 22308 } 22309 } else { 22310 if (respondToWidth > _.breakpoints[breakpoint]) { 22311 targetBreakpoint = _.breakpoints[breakpoint]; 22312 } 22313 } 22314 } 22315 } 22316 22317 if (targetBreakpoint !== null) { 22318 if (_.activeBreakpoint !== null) { 22319 if (targetBreakpoint !== _.activeBreakpoint || forceUpdate) { 22320 _.activeBreakpoint = 22321 targetBreakpoint; 22322 if (_.breakpointSettings[targetBreakpoint] === 'unslick') { 22323 _.unslick(targetBreakpoint); 22324 } else { 22325 _.options = $.extend({}, _.originalSettings, 22326 _.breakpointSettings[ 22327 targetBreakpoint]); 22328 if (initial === true) { 22329 _.currentSlide = _.options.initialSlide; 22330 } 22331 _.refresh(initial); 22332 } 22333 triggerBreakpoint = targetBreakpoint; 22334 } 22335 } else { 22336 _.activeBreakpoint = targetBreakpoint; 22337 if (_.breakpointSettings[targetBreakpoint] === 'unslick') { 22338 _.unslick(targetBreakpoint); 22339 } else { 22340 _.options = $.extend({}, _.originalSettings, 22341 _.breakpointSettings[ 22342 targetBreakpoint]); 22343 if (initial === true) { 22344 _.currentSlide = _.options.initialSlide; 22345 } 22346 _.refresh(initial); 22347 } 22348 triggerBreakpoint = targetBreakpoint; 22349 } 22350 } else { 22351 if (_.activeBreakpoint !== null) { 22352 _.activeBreakpoint = null; 22353 _.options = _.originalSettings; 22354 if (initial === true) { 22355 _.currentSlide = _.options.initialSlide; 22356 } 22357 _.refresh(initial); 22358 triggerBreakpoint = targetBreakpoint; 22359 } 22360 } 22361 22362 // only trigger breakpoints during an actual break. not on initialize. 22363 if( !initial && triggerBreakpoint !== false ) { 22364 _.$slider.trigger('breakpoint', [_, triggerBreakpoint]); 22365 } 22366 } 22367 22368 }; 22369 22370 Slick.prototype.changeSlide = function(event, dontAnimate) { 22371 22372 var _ = this, 22373 $target = $(event.currentTarget), 22374 indexOffset, slideOffset, unevenOffset; 22375 22376 // If target is a link, prevent default action. 22377 if($target.is('a')) { 22378 event.preventDefault(); 22379 } 22380 22381 // If target is not the <li> element (ie: a child), find the <li>. 22382 if(!$target.is('li')) { 22383 $target = $target.closest('li'); 22384 } 22385 22386 unevenOffset = (_.slideCount % _.options.slidesToScroll !== 0); 22387 indexOffset = unevenOffset ? 0 : (_.slideCount - _.currentSlide) % _.options.slidesToScroll; 22388 22389 switch (event.data.message) { 22390 22391 case 'previous': 22392 slideOffset = indexOffset === 0 ? _.options.slidesToScroll : _.options.slidesToShow - indexOffset; 22393 if (_.slideCount > _.options.slidesToShow) { 22394 _.slideHandler(_.currentSlide - slideOffset, false, dontAnimate); 22395 } 22396 break; 22397 22398 case 'next': 22399 slideOffset = indexOffset === 0 ? _.options.slidesToScroll : indexOffset; 22400 if (_.slideCount > _.options.slidesToShow) { 22401 _.slideHandler(_.currentSlide + slideOffset, false, dontAnimate); 22402 } 22403 break; 22404 22405 case 'index': 22406 var index = event.data.index === 0 ? 0 : 22407 event.data.index || $target.index() * _.options.slidesToScroll; 22408 22409 _.slideHandler(_.checkNavigable(index), false, dontAnimate); 22410 $target.children().trigger('focus'); 22411 break; 22412 22413 default: 22414 return; 22415 } 22416 22417 }; 22418 22419 Slick.prototype.checkNavigable = function(index) { 22420 22421 var _ = this, 22422 navigables, prevNavigable; 22423 22424 navigables = _.getNavigableIndexes(); 22425 prevNavigable = 0; 22426 if (index > navigables[navigables.length - 1]) { 22427 index = navigables[navigables.length - 1]; 22428 } else { 22429 for (var n in navigables) { 22430 if (index < navigables[n]) { 22431 index = prevNavigable; 22432 break; 22433 } 22434 prevNavigable = navigables[n]; 22435 } 22436 } 22437 22438 return index; 22439 }; 22440 22441 Slick.prototype.cleanUpEvents = function() { 22442 22443 var _ = this; 22444 22445 if (_.options.dots && _.$dots !== null) { 22446 22447 $('li', _.$dots) 22448 .off('click.slick', _.changeSlide) 22449 .off('mouseenter.slick', $.proxy(_.interrupt, _, true)) 22450 .off('mouseleave.slick', $.proxy(_.interrupt, _, false)); 22451 22452 if (_.options.accessibility === true) { 22453 _.$dots.off('keydown.slick', _.keyHandler); 22454 } 22455 } 22456 22457 _.$slider.off('focus.slick blur.slick'); 22458 22459 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 22460 _.$prevArrow && _.$prevArrow.off('click.slick', _.changeSlide); 22461 _.$nextArrow && _.$nextArrow.off('click.slick', _.changeSlide); 22462 22463 if (_.options.accessibility === true) { 22464 _.$prevArrow && _.$prevArrow.off('keydown.slick', _.keyHandler); 22465 _.$nextArrow && _.$nextArrow.off('keydown.slick', _.keyHandler); 22466 } 22467 } 22468 22469 _.$list.off('touchstart.slick mousedown.slick', _.swipeHandler); 22470 _.$list.off('touchmove.slick mousemove.slick', _.swipeHandler); 22471 _.$list.off('touchend.slick mouseup.slick', _.swipeHandler); 22472 _.$list.off('touchcancel.slick mouseleave.slick', _.swipeHandler); 22473 22474 _.$list.off('click.slick', _.clickHandler); 22475 22476 $(document).off(_.visibilityChange, _.visibility); 22477 22478 _.cleanUpSlideEvents(); 22479 22480 if (_.options.accessibility === true) { 22481 _.$list.off('keydown.slick', _.keyHandler); 22482 } 22483 22484 if (_.options.focusOnSelect === true) { 22485 $(_.$slideTrack).children().off('click.slick', _.selectHandler); 22486 } 22487 22488 $(window).off('orientationchange.slick.slick-' + _.instanceUid, _.orientationChange); 22489 22490 $(window).off('resize.slick.slick-' + _.instanceUid, _.resize); 22491 22492 $('[draggable!=true]', _.$slideTrack).off('dragstart', _.preventDefault); 22493 22494 $(window).off('load.slick.slick-' + _.instanceUid, _.setPosition); 22495 22496 }; 22497 22498 Slick.prototype.cleanUpSlideEvents = function() { 22499 22500 var _ = this; 22501 22502 _.$list.off('mouseenter.slick', $.proxy(_.interrupt, _, true)); 22503 _.$list.off('mouseleave.slick', $.proxy(_.interrupt, _, false)); 22504 22505 }; 22506 22507 Slick.prototype.cleanUpRows = function() { 22508 22509 var _ = this, originalSlides; 22510 22511 if(_.options.rows > 0) { 22512 originalSlides = _.$slides.children().children(); 22513 originalSlides.removeAttr('style'); 22514 _.$slider.empty().append(originalSlides); 22515 } 22516 22517 }; 22518 22519 Slick.prototype.clickHandler = function(event) { 22520 22521 var _ = this; 22522 22523 if (_.shouldClick === false) { 22524 event.stopImmediatePropagation(); 22525 event.stopPropagation(); 22526 event.preventDefault(); 22527 } 22528 22529 }; 22530 22531 Slick.prototype.destroy = function(refresh) { 22532 22533 var _ = this; 22534 22535 _.autoPlayClear(); 22536 22537 _.touchObject = {}; 22538 22539 _.cleanUpEvents(); 22540 22541 $('.slick-cloned', _.$slider).detach(); 22542 22543 if (_.$dots) { 22544 _.$dots.remove(); 22545 } 22546 22547 if ( _.$prevArrow && _.$prevArrow.length ) { 22548 22549 _.$prevArrow 22550 .removeClass('slick-disabled slick-arrow slick-hidden') 22551 .removeAttr('aria-hidden aria-disabled tabindex') 22552 .css('display',''); 22553 22554 if ( _.htmlExpr.test( _.options.prevArrow )) { 22555 _.$prevArrow.remove(); 22556 } 22557 } 22558 22559 if ( _.$nextArrow && _.$nextArrow.length ) { 22560 22561 _.$nextArrow 22562 .removeClass('slick-disabled slick-arrow slick-hidden') 22563 .removeAttr('aria-hidden aria-disabled tabindex') 22564 .css('display',''); 22565 22566 if ( _.htmlExpr.test( _.options.nextArrow )) { 22567 _.$nextArrow.remove(); 22568 } 22569 } 22570 22571 22572 if (_.$slides) { 22573 22574 _.$slides 22575 .removeClass('slick-slide slick-active slick-center slick-visible slick-current') 22576 .removeAttr('aria-hidden') 22577 .removeAttr('data-slick-index') 22578 .each(function(){ 22579 $(this).attr('style', $(this).data('originalStyling')); 22580 }); 22581 22582 _.$slideTrack.children(this.options.slide).detach(); 22583 22584 _.$slideTrack.detach(); 22585 22586 _.$list.detach(); 22587 22588 _.$slider.append(_.$slides); 22589 } 22590 22591 _.cleanUpRows(); 22592 22593 _.$slider.removeClass('slick-slider'); 22594 _.$slider.removeClass('slick-initialized'); 22595 _.$slider.removeClass('slick-dotted'); 22596 22597 _.unslicked = true; 22598 22599 if(!refresh) { 22600 _.$slider.trigger('destroy', [_]); 22601 } 22602 22603 }; 22604 22605 Slick.prototype.disableTransition = function(slide) { 22606 22607 var _ = this, 22608 transition = {}; 22609 22610 transition[_.transitionType] = ''; 22611 22612 if (_.options.fade === false) { 22613 _.$slideTrack.css(transition); 22614 } else { 22615 _.$slides.eq(slide).css(transition); 22616 } 22617 22618 }; 22619 22620 Slick.prototype.fadeSlide = function(slideIndex, callback) { 22621 22622 var _ = this; 22623 22624 if (_.cssTransitions === false) { 22625 22626 _.$slides.eq(slideIndex).css({ 22627 zIndex: _.options.zIndex 22628 }); 22629 22630 _.$slides.eq(slideIndex).animate({ 22631 opacity: 1 22632 }, _.options.speed, _.options.easing, callback); 22633 22634 } else { 22635 22636 _.applyTransition(slideIndex); 22637 22638 _.$slides.eq(slideIndex).css({ 22639 opacity: 1, 22640 zIndex: _.options.zIndex 22641 }); 22642 22643 if (callback) { 22644 setTimeout(function() { 22645 22646 _.disableTransition(slideIndex); 22647 22648 callback.call(); 22649 }, _.options.speed); 22650 } 22651 22652 } 22653 22654 }; 22655 22656 Slick.prototype.fadeSlideOut = function(slideIndex) { 22657 22658 var _ = this; 22659 22660 if (_.cssTransitions === false) { 22661 22662 _.$slides.eq(slideIndex).animate({ 22663 opacity: 0, 22664 zIndex: _.options.zIndex - 2 22665 }, _.options.speed, _.options.easing); 22666 22667 } else { 22668 22669 _.applyTransition(slideIndex); 22670 22671 _.$slides.eq(slideIndex).css({ 22672 opacity: 0, 22673 zIndex: _.options.zIndex - 2 22674 }); 22675 22676 } 22677 22678 }; 22679 22680 Slick.prototype.filterSlides = Slick.prototype.slickFilter = function(filter) { 22681 22682 var _ = this; 22683 22684 if (filter !== null) { 22685 22686 _.$slidesCache = _.$slides; 22687 22688 _.unload(); 22689 22690 _.$slideTrack.children(this.options.slide).detach(); 22691 22692 _.$slidesCache.filter(filter).appendTo(_.$slideTrack); 22693 22694 _.reinit(); 22695 22696 } 22697 22698 }; 22699 22700 Slick.prototype.focusHandler = function() { 22701 22702 var _ = this; 22703 22704 _.$slider 22705 .off('focus.slick blur.slick') 22706 .on('focus.slick blur.slick', '*', function(event) { 22707 22708 event.stopImmediatePropagation(); 22709 var $sf = $(this); 22710 22711 setTimeout(function() { 22712 22713 if( _.options.pauseOnFocus ) { 22714 _.focussed = $sf.is(':focus'); 22715 _.autoPlay(); 22716 } 22717 22718 }, 0); 22719 22720 }); 22721 }; 22722 22723 Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function() { 22724 22725 var _ = this; 22726 return _.currentSlide; 22727 22728 }; 22729 22730 Slick.prototype.getDotCount = function() { 22731 22732 var _ = this; 22733 22734 var breakPoint = 0; 22735 var counter = 0; 22736 var pagerQty = 0; 22737 22738 if (_.options.infinite === true) { 22739 if (_.slideCount <= _.options.slidesToShow) { 22740 ++pagerQty; 22741 } else { 22742 while (breakPoint < _.slideCount) { 22743 ++pagerQty; 22744 breakPoint = counter + _.options.slidesToScroll; 22745 counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; 22746 } 22747 } 22748 } else if (_.options.centerMode === true) { 22749 pagerQty = _.slideCount; 22750 } else if(!_.options.asNavFor) { 22751 pagerQty = 1 + Math.ceil((_.slideCount - _.options.slidesToShow) / _.options.slidesToScroll); 22752 }else { 22753 while (breakPoint < _.slideCount) { 22754 ++pagerQty; 22755 breakPoint = counter + _.options.slidesToScroll; 22756 counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; 22757 } 22758 } 22759 22760 return pagerQty - 1; 22761 22762 }; 22763 22764 Slick.prototype.getLeft = function(slideIndex) { 22765 22766 var _ = this, 22767 targetLeft, 22768 verticalHeight, 22769 verticalOffset = 0, 22770 targetSlide, 22771 coef; 22772 22773 _.slideOffset = 0; 22774 verticalHeight = _.$slides.first().outerHeight(true); 22775 22776 if (_.options.infinite === true) { 22777 if (_.slideCount > _.options.slidesToShow) { 22778 _.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1; 22779 coef = -1 22780 22781 if (_.options.vertical === true && _.options.centerMode === true) { 22782 if (_.options.slidesToShow === 2) { 22783 coef = -1.5; 22784 } else if (_.options.slidesToShow === 1) { 22785 coef = -2 22786 } 22787 } 22788 verticalOffset = (verticalHeight * _.options.slidesToShow) * coef; 22789 } 22790 if (_.slideCount % _.options.slidesToScroll !== 0) { 22791 if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) { 22792 if (slideIndex > _.slideCount) { 22793 _.slideOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * _.slideWidth) * -1; 22794 verticalOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * verticalHeight) * -1; 22795 } else { 22796 _.slideOffset = ((_.slideCount % _.options.slidesToScroll) * _.slideWidth) * -1; 22797 verticalOffset = ((_.slideCount % _.options.slidesToScroll) * verticalHeight) * -1; 22798 } 22799 } 22800 } 22801 } else { 22802 if (slideIndex + _.options.slidesToShow > _.slideCount) { 22803 _.slideOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * _.slideWidth; 22804 verticalOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * verticalHeight; 22805 } 22806 } 22807 22808 if (_.slideCount <= _.options.slidesToShow) { 22809 _.slideOffset = 0; 22810 verticalOffset = 0; 22811 } 22812 22813 if (_.options.centerMode === true && _.slideCount <= _.options.slidesToShow) { 22814 _.slideOffset = ((_.slideWidth * Math.floor(_.options.slidesToShow)) / 2) - ((_.slideWidth * _.slideCount) / 2); 22815 } else if (_.options.centerMode === true && _.options.infinite === true) { 22816 _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth; 22817 } else if (_.options.centerMode === true) { 22818 _.slideOffset = 0; 22819 _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2); 22820 } 22821 22822 if (_.options.vertical === false) { 22823 targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset; 22824 } else { 22825 targetLeft = ((slideIndex * verticalHeight) * -1) + verticalOffset; 22826 } 22827 22828 if (_.options.variableWidth === true) { 22829 22830 if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) { 22831 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex); 22832 } else { 22833 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow); 22834 } 22835 22836 if (_.options.rtl === true) { 22837 if (targetSlide[0]) { 22838 targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1; 22839 } else { 22840 targetLeft = 0; 22841 } 22842 } else { 22843 targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0; 22844 } 22845 22846 if (_.options.centerMode === true) { 22847 if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) { 22848 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex); 22849 } else { 22850 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow + 1); 22851 } 22852 22853 if (_.options.rtl === true) { 22854 if (targetSlide[0]) { 22855 targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1; 22856 } else { 22857 targetLeft = 0; 22858 } 22859 } else { 22860 targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0; 22861 } 22862 22863 targetLeft += (_.$list.width() - targetSlide.outerWidth()) / 2; 22864 } 22865 } 22866 22867 return targetLeft; 22868 22869 }; 22870 22871 Slick.prototype.getOption = Slick.prototype.slickGetOption = function(option) { 22872 22873 var _ = this; 22874 22875 return _.options[option]; 22876 22877 }; 22878 22879 Slick.prototype.getNavigableIndexes = function() { 22880 22881 var _ = this, 22882 breakPoint = 0, 22883 counter = 0, 22884 indexes = [], 22885 max; 22886 22887 if (_.options.infinite === false) { 22888 max = _.slideCount; 22889 } else { 22890 breakPoint = _.options.slidesToScroll * -1; 22891 counter = _.options.slidesToScroll * -1; 22892 max = _.slideCount * 2; 22893 } 22894 22895 while (breakPoint < max) { 22896 indexes.push(breakPoint); 22897 breakPoint = counter + _.options.slidesToScroll; 22898 counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; 22899 } 22900 22901 return indexes; 22902 22903 }; 22904 22905 Slick.prototype.getSlick = function() { 22906 22907 return this; 22908 22909 }; 22910 22911 Slick.prototype.getSlideCount = function() { 22912 22913 var _ = this, 22914 slidesTraversed, swipedSlide, centerOffset; 22915 22916 centerOffset = _.options.centerMode === true ? _.slideWidth * Math.floor(_.options.slidesToShow / 2) : 0; 22917 22918 if (_.options.swipeToSlide === true) { 22919 _.$slideTrack.find('.slick-slide').each(function(index, slide) { 22920 if (slide.offsetLeft - centerOffset + ($(slide).outerWidth() / 2) > (_.swipeLeft * -1)) { 22921 swipedSlide = slide; 22922 return false; 22923 } 22924 }); 22925 22926 slidesTraversed = Math.abs($(swipedSlide).attr('data-slick-index') - _.currentSlide) || 1; 22927 22928 return slidesTraversed; 22929 22930 } else { 22931 return _.options.slidesToScroll; 22932 } 22933 22934 }; 22935 22936 Slick.prototype.goTo = Slick.prototype.slickGoTo = function(slide, dontAnimate) { 22937 22938 var _ = this; 22939 22940 _.changeSlide({ 22941 data: { 22942 message: 'index', 22943 index: parseInt(slide) 22944 } 22945 }, dontAnimate); 22946 22947 }; 22948 22949 Slick.prototype.init = function(creation) { 22950 22951 var _ = this; 22952 22953 if (!$(_.$slider).hasClass('slick-initialized')) { 22954 22955 $(_.$slider).addClass('slick-initialized'); 22956 22957 _.buildRows(); 22958 _.buildOut(); 22959 _.setProps(); 22960 _.startLoad(); 22961 _.loadSlider(); 22962 _.initializeEvents(); 22963 _.updateArrows(); 22964 _.updateDots(); 22965 _.checkResponsive(true); 22966 _.focusHandler(); 22967 22968 } 22969 22970 if (creation) { 22971 _.$slider.trigger('init', [_]); 22972 } 22973 22974 if (_.options.accessibility === true) { 22975 _.initADA(); 22976 } 22977 22978 if ( _.options.autoplay ) { 22979 22980 _.paused = false; 22981 _.autoPlay(); 22982 22983 } 22984 22985 }; 22986 22987 Slick.prototype.initADA = function() { 22988 var _ = this, 22989 numDotGroups = Math.ceil(_.slideCount / _.options.slidesToShow), 22990 tabControlIndexes = _.getNavigableIndexes().filter(function(val) { 22991 return (val >= 0) && (val < _.slideCount); 22992 }); 22993 22994 _.$slides.add(_.$slideTrack.find('.slick-cloned')).attr({ 22995 'aria-hidden': 'true', 22996 'tabindex': '-1' 22997 }).find('a, input, button, select').attr({ 22998 'tabindex': '-1' 22999 }); 23000 23001 if (_.$dots !== null) { 23002 _.$slides.not(_.$slideTrack.find('.slick-cloned')).each(function(i) { 23003 var slideControlIndex = tabControlIndexes.indexOf(i); 23004 23005 $(this).attr({ 23006 'role': 'tabpanel', 23007 'id': 'slick-slide' + _.instanceUid + i, 23008 'tabindex': -1 23009 }); 23010 23011 if (slideControlIndex !== -1) { 23012 var ariaButtonControl = 'slick-slide-control' + _.instanceUid + slideControlIndex 23013 if ($('#' + ariaButtonControl).length) { 23014 $(this).attr({ 23015 'aria-describedby': ariaButtonControl 23016 }); 23017 } 23018 } 23019 }); 23020 23021 _.$dots.attr('role', 'tablist').find('li').each(function(i) { 23022 var mappedSlideIndex = tabControlIndexes[i]; 23023 23024 $(this).attr({ 23025 'role': 'presentation' 23026 }); 23027 23028 $(this).find('button').first().attr({ 23029 'role': 'tab', 23030 'id': 'slick-slide-control' + _.instanceUid + i, 23031 'aria-controls': 'slick-slide' + _.instanceUid + mappedSlideIndex, 23032 'aria-label': (i + 1) + ' of ' + numDotGroups, 23033 'aria-selected': null, 23034 'tabindex': '-1' 23035 }); 23036 23037 }).eq(_.currentSlide).find('button').attr({ 23038 'aria-selected': 'true', 23039 'tabindex': '0' 23040 }).end(); 23041 } 23042 23043 for (var i=_.currentSlide, max=i+_.options.slidesToShow; i < max; i++) { 23044 if (_.options.focusOnChange) { 23045 _.$slides.eq(i).attr({'tabindex': '0'}); 23046 } else { 23047 _.$slides.eq(i).removeAttr('tabindex'); 23048 } 23049 } 23050 23051 _.activateADA(); 23052 23053 }; 23054 23055 Slick.prototype.initArrowEvents = function() { 23056 23057 var _ = this; 23058 23059 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 23060 _.$prevArrow 23061 .off('click.slick') 23062 .on('click.slick', { 23063 message: 'previous' 23064 }, _.changeSlide); 23065 _.$nextArrow 23066 .off('click.slick') 23067 .on('click.slick', { 23068 message: 'next' 23069 }, _.changeSlide); 23070 23071 if (_.options.accessibility === true) { 23072 _.$prevArrow.on('keydown.slick', _.keyHandler); 23073 _.$nextArrow.on('keydown.slick', _.keyHandler); 23074 } 23075 } 23076 23077 }; 23078 23079 Slick.prototype.initDotEvents = function() { 23080 23081 var _ = this; 23082 23083 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 23084 $('li', _.$dots).on('click.slick', { 23085 message: 'index' 23086 }, _.changeSlide); 23087 23088 if (_.options.accessibility === true) { 23089 _.$dots.on('keydown.slick', _.keyHandler); 23090 } 23091 } 23092 23093 if (_.options.dots === true && _.options.pauseOnDotsHover === true && _.slideCount > _.options.slidesToShow) { 23094 23095 $('li', _.$dots) 23096 .on('mouseenter.slick', $.proxy(_.interrupt, _, true)) 23097 .on('mouseleave.slick', $.proxy(_.interrupt, _, false)); 23098 23099 } 23100 23101 }; 23102 23103 Slick.prototype.initSlideEvents = function() { 23104 23105 var _ = this; 23106 23107 if ( _.options.pauseOnHover ) { 23108 23109 _.$list.on('mouseenter.slick', $.proxy(_.interrupt, _, true)); 23110 _.$list.on('mouseleave.slick', $.proxy(_.interrupt, _, false)); 23111 23112 } 23113 23114 }; 23115 23116 Slick.prototype.initializeEvents = function() { 23117 23118 var _ = this; 23119 23120 _.initArrowEvents(); 23121 23122 _.initDotEvents(); 23123 _.initSlideEvents(); 23124 23125 _.$list.on('touchstart.slick mousedown.slick', { 23126 action: 'start' 23127 }, _.swipeHandler); 23128 _.$list.on('touchmove.slick mousemove.slick', { 23129 action: 'move' 23130 }, _.swipeHandler); 23131 _.$list.on('touchend.slick mouseup.slick', { 23132 action: 'end' 23133 }, _.swipeHandler); 23134 _.$list.on('touchcancel.slick mouseleave.slick', { 23135 action: 'end' 23136 }, _.swipeHandler); 23137 23138 _.$list.on('click.slick', _.clickHandler); 23139 23140 $(document).on(_.visibilityChange, $.proxy(_.visibility, _)); 23141 23142 if (_.options.accessibility === true) { 23143 _.$list.on('keydown.slick', _.keyHandler); 23144 } 23145 23146 if (_.options.focusOnSelect === true) { 23147 $(_.$slideTrack).children().on('click.slick', _.selectHandler); 23148 } 23149 23150 $(window).on('orientationchange.slick.slick-' + _.instanceUid, $.proxy(_.orientationChange, _)); 23151 23152 $(window).on('resize.slick.slick-' + _.instanceUid, $.proxy(_.resize, _)); 23153 23154 $('[draggable!=true]', _.$slideTrack).on('dragstart', _.preventDefault); 23155 23156 $(window).on('load.slick.slick-' + _.instanceUid, _.setPosition); 23157 $(_.setPosition); 23158 23159 }; 23160 23161 Slick.prototype.initUI = function() { 23162 23163 var _ = this; 23164 23165 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 23166 23167 _.$prevArrow.show(); 23168 _.$nextArrow.show(); 23169 23170 } 23171 23172 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 23173 23174 _.$dots.show(); 23175 23176 } 23177 23178 }; 23179 23180 Slick.prototype.keyHandler = function(event) { 23181 23182 var _ = this; 23183 //Dont slide if the cursor is inside the form fields and arrow keys are pressed 23184 if(!event.target.tagName.match('TEXTAREA|INPUT|SELECT')) { 23185 if (event.keyCode === 37 && _.options.accessibility === true) { 23186 _.changeSlide({ 23187 data: { 23188 message: _.options.rtl === true ? 'next' : 'previous' 23189 } 23190 }); 23191 } else if (event.keyCode === 39 && _.options.accessibility === true) { 23192 _.changeSlide({ 23193 data: { 23194 message: _.options.rtl === true ? 'previous' : 'next' 23195 } 23196 }); 23197 } 23198 } 23199 23200 }; 23201 23202 Slick.prototype.lazyLoad = function() { 23203 23204 var _ = this, 23205 loadRange, cloneRange, rangeStart, rangeEnd; 23206 23207 function loadImages(imagesScope) { 23208 23209 $('img[data-lazy]', imagesScope).each(function() { 23210 23211 var image = $(this), 23212 imageSource = $(this).attr('data-lazy'), 23213 imageSrcSet = $(this).attr('data-srcset'), 23214 imageSizes = $(this).attr('data-sizes') || _.$slider.attr('data-sizes'), 23215 imageToLoad = document.createElement('img'); 23216 23217 imageToLoad.onload = function() { 23218 23219 image 23220 .animate({ opacity: 0 }, 100, function() { 23221 23222 if (imageSrcSet) { 23223 image 23224 .attr('srcset', imageSrcSet ); 23225 23226 if (imageSizes) { 23227 image 23228 .attr('sizes', imageSizes ); 23229 } 23230 } 23231 23232 image 23233 .attr('src', imageSource) 23234 .animate({ opacity: 1 }, 200, function() { 23235 image 23236 .removeAttr('data-lazy data-srcset data-sizes') 23237 .removeClass('slick-loading'); 23238 }); 23239 _.$slider.trigger('lazyLoaded', [_, image, imageSource]); 23240 }); 23241 23242 }; 23243 23244 imageToLoad.onerror = function() { 23245 23246 image 23247 .removeAttr( 'data-lazy' ) 23248 .removeClass( 'slick-loading' ) 23249 .addClass( 'slick-lazyload-error' ); 23250 23251 _.$slider.trigger('lazyLoadError', [ _, image, imageSource ]); 23252 23253 }; 23254 23255 imageToLoad.src = imageSource; 23256 23257 }); 23258 23259 } 23260 23261 if (_.options.centerMode === true) { 23262 if (_.options.infinite === true) { 23263 rangeStart = _.currentSlide + (_.options.slidesToShow / 2 + 1); 23264 rangeEnd = rangeStart + _.options.slidesToShow + 2; 23265 } else { 23266 rangeStart = Math.max(0, _.currentSlide - (_.options.slidesToShow / 2 + 1)); 23267 rangeEnd = 2 + (_.options.slidesToShow / 2 + 1) + _.currentSlide; 23268 } 23269 } else { 23270 rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide; 23271 rangeEnd = Math.ceil(rangeStart + _.options.slidesToShow); 23272 if (_.options.fade === true) { 23273 if (rangeStart > 0) rangeStart--; 23274 if (rangeEnd <= _.slideCount) rangeEnd++; 23275 } 23276 } 23277 23278 loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd); 23279 23280 if (_.options.lazyLoad === 'anticipated') { 23281 var prevSlide = rangeStart - 1, 23282 nextSlide = rangeEnd, 23283 $slides = _.$slider.find('.slick-slide'); 23284 23285 for (var i = 0; i < _.options.slidesToScroll; i++) { 23286 if (prevSlide < 0) prevSlide = _.slideCount - 1; 23287 loadRange = loadRange.add($slides.eq(prevSlide)); 23288 loadRange = loadRange.add($slides.eq(nextSlide)); 23289 prevSlide--; 23290 nextSlide++; 23291 } 23292 } 23293 23294 loadImages(loadRange); 23295 23296 if (_.slideCount <= _.options.slidesToShow) { 23297 cloneRange = _.$slider.find('.slick-slide'); 23298 loadImages(cloneRange); 23299 } else 23300 if (_.currentSlide >= _.slideCount - _.options.slidesToShow) { 23301 cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow); 23302 loadImages(cloneRange); 23303 } else if (_.currentSlide === 0) { 23304 cloneRange = _.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1); 23305 loadImages(cloneRange); 23306 } 23307 23308 }; 23309 23310 Slick.prototype.loadSlider = function() { 23311 23312 var _ = this; 23313 23314 _.setPosition(); 23315 23316 _.$slideTrack.css({ 23317 opacity: 1 23318 }); 23319 23320 _.$slider.removeClass('slick-loading'); 23321 23322 _.initUI(); 23323 23324 if (_.options.lazyLoad === 'progressive') { 23325 _.progressiveLazyLoad(); 23326 } 23327 23328 }; 23329 23330 Slick.prototype.next = Slick.prototype.slickNext = function() { 23331 23332 var _ = this; 23333 23334 _.changeSlide({ 23335 data: { 23336 message: 'next' 23337 } 23338 }); 23339 23340 }; 23341 23342 Slick.prototype.orientationChange = function() { 23343 23344 var _ = this; 23345 23346 _.checkResponsive(); 23347 _.setPosition(); 23348 23349 }; 23350 23351 Slick.prototype.pause = Slick.prototype.slickPause = function() { 23352 23353 var _ = this; 23354 23355 _.autoPlayClear(); 23356 _.paused = true; 23357 23358 }; 23359 23360 Slick.prototype.play = Slick.prototype.slickPlay = function() { 23361 23362 var _ = this; 23363 23364 _.autoPlay(); 23365 _.options.autoplay = true; 23366 _.paused = false; 23367 _.focussed = false; 23368 _.interrupted = false; 23369 23370 }; 23371 23372 Slick.prototype.postSlide = function(index) { 23373 23374 var _ = this; 23375 23376 if( !_.unslicked ) { 23377 23378 _.$slider.trigger('afterChange', [_, index]); 23379 23380 _.animating = false; 23381 23382 if (_.slideCount > _.options.slidesToShow) { 23383 _.setPosition(); 23384 } 23385 23386 _.swipeLeft = null; 23387 23388 if ( _.options.autoplay ) { 23389 _.autoPlay(); 23390 } 23391 23392 if (_.options.accessibility === true) { 23393 _.initADA(); 23394 23395 if (_.options.focusOnChange) { 23396 var $currentSlide = $(_.$slides.get(_.currentSlide)); 23397 $currentSlide.attr('tabindex', 0).focus(); 23398 } 23399 } 23400 23401 } 23402 23403 }; 23404 23405 Slick.prototype.prev = Slick.prototype.slickPrev = function() { 23406 23407 var _ = this; 23408 23409 _.changeSlide({ 23410 data: { 23411 message: 'previous' 23412 } 23413 }); 23414 23415 }; 23416 23417 Slick.prototype.preventDefault = function(event) { 23418 23419 event.preventDefault(); 23420 23421 }; 23422 23423 Slick.prototype.progressiveLazyLoad = function( tryCount ) { 23424 23425 tryCount = tryCount || 1; 23426 23427 var _ = this, 23428 $imgsToLoad = $( 'img[data-lazy]', _.$slider ), 23429 image, 23430 imageSource, 23431 imageSrcSet, 23432 imageSizes, 23433 imageToLoad; 23434 23435 if ( $imgsToLoad.length ) { 23436 23437 image = $imgsToLoad.first(); 23438 imageSource = image.attr('data-lazy'); 23439 imageSrcSet = image.attr('data-srcset'); 23440 imageSizes = image.attr('data-sizes') || _.$slider.attr('data-sizes'); 23441 imageToLoad = document.createElement('img'); 23442 23443 imageToLoad.onload = function() { 23444 23445 if (imageSrcSet) { 23446 image 23447 .attr('srcset', imageSrcSet ); 23448 23449 if (imageSizes) { 23450 image 23451 .attr('sizes', imageSizes ); 23452 } 23453 } 23454 23455 image 23456 .attr( 'src', imageSource ) 23457 .removeAttr('data-lazy data-srcset data-sizes') 23458 .removeClass('slick-loading'); 23459 23460 if ( _.options.adaptiveHeight === true ) { 23461 _.setPosition(); 23462 } 23463 23464 _.$slider.trigger('lazyLoaded', [ _, image, imageSource ]); 23465 _.progressiveLazyLoad(); 23466 23467 }; 23468 23469 imageToLoad.onerror = function() { 23470 23471 if ( tryCount < 3 ) { 23472 23473 /** 23474 * try to load the image 3 times, 23475 * leave a slight delay so we don't get 23476 * servers blocking the request. 23477 */ 23478 setTimeout( function() { 23479 _.progressiveLazyLoad( tryCount + 1 ); 23480 }, 500 ); 23481 23482 } else { 23483 23484 image 23485 .removeAttr( 'data-lazy' ) 23486 .removeClass( 'slick-loading' ) 23487 .addClass( 'slick-lazyload-error' ); 23488 23489 _.$slider.trigger('lazyLoadError', [ _, image, imageSource ]); 23490 23491 _.progressiveLazyLoad(); 23492 23493 } 23494 23495 }; 23496 23497 imageToLoad.src = imageSource; 23498 23499 } else { 23500 23501 _.$slider.trigger('allImagesLoaded', [ _ ]); 23502 23503 } 23504 23505 }; 23506 23507 Slick.prototype.refresh = function( initializing ) { 23508 23509 var _ = this, currentSlide, lastVisibleIndex; 23510 23511 lastVisibleIndex = _.slideCount - _.options.slidesToShow; 23512 23513 // in non-infinite sliders, we don't want to go past the 23514 // last visible index. 23515 if( !_.options.infinite && ( _.currentSlide > lastVisibleIndex )) { 23516 _.currentSlide = lastVisibleIndex; 23517 } 23518 23519 // if less slides than to show, go to start. 23520 if ( _.slideCount <= _.options.slidesToShow ) { 23521 _.currentSlide = 0; 23522 23523 } 23524 23525 currentSlide = _.currentSlide; 23526 23527 _.destroy(true); 23528 23529 $.extend(_, _.initials, { currentSlide: currentSlide }); 23530 23531 _.init(); 23532 23533 if( !initializing ) { 23534 23535 _.changeSlide({ 23536 data: { 23537 message: 'index', 23538 index: currentSlide 23539 } 23540 }, false); 23541 23542 } 23543 23544 }; 23545 23546 Slick.prototype.registerBreakpoints = function() { 23547 23548 var _ = this, breakpoint, currentBreakpoint, l, 23549 responsiveSettings = _.options.responsive || null; 23550 23551 if ( $.type(responsiveSettings) === 'array' && responsiveSettings.length ) { 23552 23553 _.respondTo = _.options.respondTo || 'window'; 23554 23555 for ( breakpoint in responsiveSettings ) { 23556 23557 l = _.breakpoints.length-1; 23558 23559 if (responsiveSettings.hasOwnProperty(breakpoint)) { 23560 currentBreakpoint = responsiveSettings[breakpoint].breakpoint; 23561 23562 // loop through the breakpoints and cut out any existing 23563 // ones with the same breakpoint number, we don't want dupes. 23564 while( l >= 0 ) { 23565 if( _.breakpoints[l] && _.breakpoints[l] === currentBreakpoint ) { 23566 _.breakpoints.splice(l,1); 23567 } 23568 l--; 23569 } 23570 23571 _.breakpoints.push(currentBreakpoint); 23572 _.breakpointSettings[currentBreakpoint] = responsiveSettings[breakpoint].settings; 23573 23574 } 23575 23576 } 23577 23578 _.breakpoints.sort(function(a, b) { 23579 return ( _.options.mobileFirst ) ? a-b : b-a; 23580 }); 23581 23582 } 23583 23584 }; 23585 23586 Slick.prototype.reinit = function() { 23587 23588 var _ = this; 23589 23590 _.$slides = 23591 _.$slideTrack 23592 .children(_.options.slide) 23593 .addClass('slick-slide'); 23594 23595 _.slideCount = _.$slides.length; 23596 23597 if (_.currentSlide >= _.slideCount && _.currentSlide !== 0) { 23598 _.currentSlide = _.currentSlide - _.options.slidesToScroll; 23599 } 23600 23601 if (_.slideCount <= _.options.slidesToShow) { 23602 _.currentSlide = 0; 23603 } 23604 23605 _.registerBreakpoints(); 23606 23607 _.setProps(); 23608 _.setupInfinite(); 23609 _.buildArrows(); 23610 _.updateArrows(); 23611 _.initArrowEvents(); 23612 _.buildDots(); 23613 _.updateDots(); 23614 _.initDotEvents(); 23615 _.cleanUpSlideEvents(); 23616 _.initSlideEvents(); 23617 23618 _.checkResponsive(false, true); 23619 23620 if (_.options.focusOnSelect === true) { 23621 $(_.$slideTrack).children().on('click.slick', _.selectHandler); 23622 } 23623 23624 _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0); 23625 23626 _.setPosition(); 23627 _.focusHandler(); 23628 23629 _.paused = !_.options.autoplay; 23630 _.autoPlay(); 23631 23632 _.$slider.trigger('reInit', [_]); 23633 23634 }; 23635 23636 Slick.prototype.resize = function() { 23637 23638 var _ = this; 23639 23640 if ($(window).width() !== _.windowWidth) { 23641 clearTimeout(_.windowDelay); 23642 _.windowDelay = window.setTimeout(function() { 23643 _.windowWidth = $(window).width(); 23644 _.checkResponsive(); 23645 if( !_.unslicked ) { _.setPosition(); } 23646 }, 50); 23647 } 23648 }; 23649 23650 Slick.prototype.removeSlide = Slick.prototype.slickRemove = function(index, removeBefore, removeAll) { 23651 23652 var _ = this; 23653 23654 if (typeof(index) === 'boolean') { 23655 removeBefore = index; 23656 index = removeBefore === true ? 0 : _.slideCount - 1; 23657 } else { 23658 index = removeBefore === true ? --index : index; 23659 } 23660 23661 if (_.slideCount < 1 || index < 0 || index > _.slideCount - 1) { 23662 return false; 23663 } 23664 23665 _.unload(); 23666 23667 if (removeAll === true) { 23668 _.$slideTrack.children().remove(); 23669 } else { 23670 _.$slideTrack.children(this.options.slide).eq(index).remove(); 23671 } 23672 23673 _.$slides = _.$slideTrack.children(this.options.slide); 23674 23675 _.$slideTrack.children(this.options.slide).detach(); 23676 23677 _.$slideTrack.append(_.$slides); 23678 23679 _.$slidesCache = _.$slides; 23680 23681 _.reinit(); 23682 23683 }; 23684 23685 Slick.prototype.setCSS = function(position) { 23686 23687 var _ = this, 23688 positionProps = {}, 23689 x, y; 23690 23691 if (_.options.rtl === true) { 23692 position = -position; 23693 } 23694 x = _.positionProp == 'left' ? Math.ceil(position) + 'px' : '0px'; 23695 y = _.positionProp == 'top' ? Math.ceil(position) + 'px' : '0px'; 23696 23697 positionProps[_.positionProp] = position; 23698 23699 if (_.transformsEnabled === false) { 23700 _.$slideTrack.css(positionProps); 23701 } else { 23702 positionProps = {}; 23703 if (_.cssTransitions === false) { 23704 positionProps[_.animType] = 'translate(' + x + ', ' + y + ')'; 23705 _.$slideTrack.css(positionProps); 23706 } else { 23707 positionProps[_.animType] = 'translate3d(' + x + ', ' + y + ', 0px)'; 23708 _.$slideTrack.css(positionProps); 23709 } 23710 } 23711 23712 }; 23713 23714 Slick.prototype.setDimensions = function() { 23715 23716 var _ = this; 23717 23718 if (_.options.vertical === false) { 23719 if (_.options.centerMode === true) { 23720 _.$list.css({ 23721 padding: ('0px ' + _.options.centerPadding) 23722 }); 23723 } 23724 } else { 23725 _.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow); 23726 if (_.options.centerMode === true) { 23727 _.$list.css({ 23728 padding: (_.options.centerPadding + ' 0px') 23729 }); 23730 } 23731 } 23732 23733 _.listWidth = _.$list.width(); 23734 _.listHeight = _.$list.height(); 23735 23736 23737 if (_.options.vertical === false && _.options.variableWidth === false) { 23738 _.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow); 23739 _.$slideTrack.width(Math.ceil((_.slideWidth * _.$slideTrack.children('.slick-slide').length))); 23740 23741 } else if (_.options.variableWidth === true) { 23742 _.$slideTrack.width(5000 * _.slideCount); 23743 } else { 23744 _.slideWidth = Math.ceil(_.listWidth); 23745 _.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length))); 23746 } 23747 23748 var offset = _.$slides.first().outerWidth(true) - _.$slides.first().width(); 23749 if (_.options.variableWidth === false) _.$slideTrack.children('.slick-slide').width(_.slideWidth - offset); 23750 23751 }; 23752 23753 Slick.prototype.setFade = function() { 23754 23755 var _ = this, 23756 targetLeft; 23757 23758 _.$slides.each(function(index, element) { 23759 targetLeft = (_.slideWidth * index) * -1; 23760 if (_.options.rtl === true) { 23761 $(element).css({ 23762 position: 'relative', 23763 right: targetLeft, 23764 top: 0, 23765 zIndex: _.options.zIndex - 2, 23766 opacity: 0 23767 }); 23768 } else { 23769 $(element).css({ 23770 position: 'relative', 23771 left: targetLeft, 23772 top: 0, 23773 zIndex: _.options.zIndex - 2, 23774 opacity: 0 23775 }); 23776 } 23777 }); 23778 23779 _.$slides.eq(_.currentSlide).css({ 23780 zIndex: _.options.zIndex - 1, 23781 opacity: 1 23782 }); 23783 23784 }; 23785 23786 Slick.prototype.setHeight = function() { 23787 23788 var _ = this; 23789 23790 if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) { 23791 var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true); 23792 _.$list.css('height', targetHeight); 23793 } 23794 23795 }; 23796 23797 Slick.prototype.setOption = 23798 Slick.prototype.slickSetOption = function() { 23799 23800 /** 23801 * accepts arguments in format of: 23802 * 23803 * - for changing a single option's value: 23804 * .slick("setOption", option, value, refresh ) 23805 * 23806 * - for changing a set of responsive options: 23807 * .slick("setOption", 'responsive', [{}, ...], refresh ) 23808 * 23809 * - for updating multiple values at once (not responsive) 23810 * .slick("setOption", { 'option': value, ... }, refresh ) 23811 */ 23812 23813 var _ = this, l, item, option, value, refresh = false, type; 23814 23815 if( $.type( arguments[0] ) === 'object' ) { 23816 23817 option = arguments[0]; 23818 refresh = arguments[1]; 23819 type = 'multiple'; 23820 23821 } else if ( $.type( arguments[0] ) === 'string' ) { 23822 23823 option = arguments[0]; 23824 value = arguments[1]; 23825 refresh = arguments[2]; 23826 23827 if ( arguments[0] === 'responsive' && $.type( arguments[1] ) === 'array' ) { 23828 23829 type = 'responsive'; 23830 23831 } else if ( typeof arguments[1] !== 'undefined' ) { 23832 23833 type = 'single'; 23834 23835 } 23836 23837 } 23838 23839 if ( type === 'single' ) { 23840 23841 _.options[option] = value; 23842 23843 23844 } else if ( type === 'multiple' ) { 23845 23846 $.each( option , function( opt, val ) { 23847 23848 _.options[opt] = val; 23849 23850 }); 23851 23852 23853 } else if ( type === 'responsive' ) { 23854 23855 for ( item in value ) { 23856 23857 if( $.type( _.options.responsive ) !== 'array' ) { 23858 23859 _.options.responsive = [ value[item] ]; 23860 23861 } else { 23862 23863 l = _.options.responsive.length-1; 23864 23865 // loop through the responsive object and splice out duplicates. 23866 while( l >= 0 ) { 23867 23868 if( _.options.responsive[l].breakpoint === value[item].breakpoint ) { 23869 23870 _.options.responsive.splice(l,1); 23871 23872 } 23873 23874 l--; 23875 23876 } 23877 23878 _.options.responsive.push( value[item] ); 23879 23880 } 23881 23882 } 23883 23884 } 23885 23886 if ( refresh ) { 23887 23888 _.unload(); 23889 _.reinit(); 23890 23891 } 23892 23893 }; 23894 23895 Slick.prototype.setPosition = function() { 23896 23897 var _ = this; 23898 23899 _.setDimensions(); 23900 23901 _.setHeight(); 23902 23903 if (_.options.fade === false) { 23904 _.setCSS(_.getLeft(_.currentSlide)); 23905 } else { 23906 _.setFade(); 23907 } 23908 23909 _.$slider.trigger('setPosition', [_]); 23910 23911 }; 23912 23913 Slick.prototype.setProps = function() { 23914 23915 var _ = this, 23916 bodyStyle = document.body.style; 23917 23918 _.positionProp = _.options.vertical === true ? 'top' : 'left'; 23919 23920 if (_.positionProp === 'top') { 23921 _.$slider.addClass('slick-vertical'); 23922 } else { 23923 _.$slider.removeClass('slick-vertical'); 23924 } 23925 23926 if (bodyStyle.WebkitTransition !== undefined || 23927 bodyStyle.MozTransition !== undefined || 23928 bodyStyle.msTransition !== undefined) { 23929 if (_.options.useCSS === true) { 23930 _.cssTransitions = true; 23931 } 23932 } 23933 23934 if ( _.options.fade ) { 23935 if ( typeof _.options.zIndex === 'number' ) { 23936 if( _.options.zIndex < 3 ) { 23937 _.options.zIndex = 3; 23938 } 23939 } else { 23940 _.options.zIndex = _.defaults.zIndex; 23941 } 23942 } 23943 23944 if (bodyStyle.OTransform !== undefined) { 23945 _.animType = 'OTransform'; 23946 _.transformType = '-o-transform'; 23947 _.transitionType = 'OTransition'; 23948 if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false; 23949 } 23950 if (bodyStyle.MozTransform !== undefined) { 23951 _.animType = 'MozTransform'; 23952 _.transformType = '-moz-transform'; 23953 _.transitionType = 'MozTransition'; 23954 if (bodyStyle.perspectiveProperty === undefined && bodyStyle.MozPerspective === undefined) _.animType = false; 23955 } 23956 if (bodyStyle.webkitTransform !== undefined) { 23957 _.animType = 'webkitTransform'; 23958 _.transformType = '-webkit-transform'; 23959 _.transitionType = 'webkitTransition'; 23960 if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false; 23961 } 23962 if (bodyStyle.msTransform !== undefined) { 23963 _.animType = 'msTransform'; 23964 _.transformType = '-ms-transform'; 23965 _.transitionType = 'msTransition'; 23966 if (bodyStyle.msTransform === undefined) _.animType = false; 23967 } 23968 if (bodyStyle.transform !== undefined && _.animType !== false) { 23969 _.animType = 'transform'; 23970 _.transformType = 'transform'; 23971 _.transitionType = 'transition'; 23972 } 23973 _.transformsEnabled = _.options.useTransform && (_.animType !== null && _.animType !== false); 23974 }; 23975 23976 23977 Slick.prototype.setSlideClasses = function(index) { 23978 23979 var _ = this, 23980 centerOffset, allSlides, indexOffset, remainder; 23981 23982 allSlides = _.$slider 23983 .find('.slick-slide') 23984 .removeClass('slick-active slick-center slick-current') 23985 .attr('aria-hidden', 'true'); 23986 23987 _.$slides 23988 .eq(index) 23989 .addClass('slick-current'); 23990 23991 if (_.options.centerMode === true) { 23992 23993 var evenCoef = _.options.slidesToShow % 2 === 0 ? 1 : 0; 23994 23995 centerOffset = Math.floor(_.options.slidesToShow / 2); 23996 23997 if (_.options.infinite === true) { 23998 23999 if (index >= centerOffset && index <= (_.slideCount - 1) - centerOffset) { 24000 _.$slides 24001 .slice(index - centerOffset + evenCoef, index + centerOffset + 1) 24002 .addClass('slick-active') 24003 .attr('aria-hidden', 'false'); 24004 24005 } else { 24006 24007 indexOffset = _.options.slidesToShow + index; 24008 allSlides 24009 .slice(indexOffset - centerOffset + 1 + evenCoef, indexOffset + centerOffset + 2) 24010 .addClass('slick-active') 24011 .attr('aria-hidden', 'false'); 24012 24013 } 24014 24015 if (index === 0) { 24016 24017 allSlides 24018 .eq(allSlides.length - 1 - _.options.slidesToShow) 24019 .addClass('slick-center'); 24020 24021 } else if (index === _.slideCount - 1) { 24022 24023 allSlides 24024 .eq(_.options.slidesToShow) 24025 .addClass('slick-center'); 24026 24027 } 24028 24029 } 24030 24031 _.$slides 24032 .eq(index) 24033 .addClass('slick-center'); 24034 24035 } else { 24036 24037 if (index >= 0 && index <= (_.slideCount - _.options.slidesToShow)) { 24038 24039 _.$slides 24040 .slice(index, index + _.options.slidesToShow) 24041 .addClass('slick-active') 24042 .attr('aria-hidden', 'false'); 24043 24044 } else if (allSlides.length <= _.options.slidesToShow) { 24045 24046 allSlides 24047 .addClass('slick-active') 24048 .attr('aria-hidden', 'false'); 24049 24050 } else { 24051 24052 remainder = _.slideCount % _.options.slidesToShow; 24053 indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index; 24054 24055 if (_.options.slidesToShow == _.options.slidesToScroll && (_.slideCount - index) < _.options.slidesToShow) { 24056 24057 allSlides 24058 .slice(indexOffset - (_.options.slidesToShow - remainder), indexOffset + remainder) 24059 .addClass('slick-active') 24060 .attr('aria-hidden', 'false'); 24061 24062 } else { 24063 24064 allSlides 24065 .slice(indexOffset, indexOffset + _.options.slidesToShow) 24066 .addClass('slick-active') 24067 .attr('aria-hidden', 'false'); 24068 24069 } 24070 24071 } 24072 24073 } 24074 24075 if (_.options.lazyLoad === 'ondemand' || _.options.lazyLoad === 'anticipated') { 24076 _.lazyLoad(); 24077 } 24078 }; 24079 24080 Slick.prototype.setupInfinite = function() { 24081 24082 var _ = this, 24083 i, slideIndex, infiniteCount; 24084 24085 if (_.options.fade === true) { 24086 _.options.centerMode = false; 24087 } 24088 24089 if (_.options.infinite === true && _.options.fade === false) { 24090 24091 slideIndex = null; 24092 24093 if (_.slideCount > _.options.slidesToShow) { 24094 24095 if (_.options.centerMode === true) { 24096 infiniteCount = _.options.slidesToShow + 1; 24097 } else { 24098 infiniteCount = _.options.slidesToShow; 24099 } 24100 24101 for (i = _.slideCount; i > (_.slideCount - 24102 infiniteCount); i -= 1) { 24103 slideIndex = i - 1; 24104 $(_.$slides[slideIndex]).clone(true).attr('id', '') 24105 .attr('data-slick-index', slideIndex - _.slideCount) 24106 .prependTo(_.$slideTrack).addClass('slick-cloned'); 24107 } 24108 for (i = 0; i < infiniteCount + _.slideCount; i += 1) { 24109 slideIndex = i; 24110 $(_.$slides[slideIndex]).clone(true).attr('id', '') 24111 .attr('data-slick-index', slideIndex + _.slideCount) 24112 .appendTo(_.$slideTrack).addClass('slick-cloned'); 24113 } 24114 _.$slideTrack.find('.slick-cloned').find('[id]').each(function() { 24115 $(this).attr('id', ''); 24116 }); 24117 24118 } 24119 24120 } 24121 24122 }; 24123 24124 Slick.prototype.interrupt = function( toggle ) { 24125 24126 var _ = this; 24127 24128 if( !toggle ) { 24129 _.autoPlay(); 24130 } 24131 _.interrupted = toggle; 24132 24133 }; 24134 24135 Slick.prototype.selectHandler = function(event) { 24136 24137 var _ = this; 24138 24139 var targetElement = 24140 $(event.target).is('.slick-slide') ? 24141 $(event.target) : 24142 $(event.target).parents('.slick-slide'); 24143 24144 var index = parseInt(targetElement.attr('data-slick-index')); 24145 24146 if (!index) index = 0; 24147 24148 if (_.slideCount <= _.options.slidesToShow) { 24149 24150 _.slideHandler(index, false, true); 24151 return; 24152 24153 } 24154 24155 _.slideHandler(index); 24156 24157 }; 24158 24159 Slick.prototype.slideHandler = function(index, sync, dontAnimate) { 24160 24161 var targetSlide, animSlide, oldSlide, slideLeft, targetLeft = null, 24162 _ = this, navTarget; 24163 24164 sync = sync || false; 24165 24166 if (_.animating === true && _.options.waitForAnimate === true) { 24167 return; 24168 } 24169 24170 if (_.options.fade === true && _.currentSlide === index) { 24171 return; 24172 } 24173 24174 if (sync === false) { 24175 _.asNavFor(index); 24176 } 24177 24178 targetSlide = index; 24179 targetLeft = _.getLeft(targetSlide); 24180 slideLeft = _.getLeft(_.currentSlide); 24181 24182 _.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft; 24183 24184 if (_.options.infinite === false && _.options.centerMode === false && (index < 0 || index > _.getDotCount() * _.options.slidesToScroll)) { 24185 if (_.options.fade === false) { 24186 targetSlide = _.currentSlide; 24187 if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) { 24188 _.animateSlide(slideLeft, function() { 24189 _.postSlide(targetSlide); 24190 }); 24191 } else { 24192 _.postSlide(targetSlide); 24193 } 24194 } 24195 return; 24196 } else if (_.options.infinite === false && _.options.centerMode === true && (index < 0 || index > (_.slideCount - _.options.slidesToScroll))) { 24197 if (_.options.fade === false) { 24198 targetSlide = _.currentSlide; 24199 if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) { 24200 _.animateSlide(slideLeft, function() { 24201 _.postSlide(targetSlide); 24202 }); 24203 } else { 24204 _.postSlide(targetSlide); 24205 } 24206 } 24207 return; 24208 } 24209 24210 if ( _.options.autoplay ) { 24211 clearInterval(_.autoPlayTimer); 24212 } 24213 24214 if (targetSlide < 0) { 24215 if (_.slideCount % _.options.slidesToScroll !== 0) { 24216 animSlide = _.slideCount - (_.slideCount % _.options.slidesToScroll); 24217 } else { 24218 animSlide = _.slideCount + targetSlide; 24219 } 24220 } else if (targetSlide >= _.slideCount) { 24221 if (_.slideCount % _.options.slidesToScroll !== 0) { 24222 animSlide = 0; 24223 } else { 24224 animSlide = targetSlide - _.slideCount; 24225 } 24226 } else { 24227 animSlide = targetSlide; 24228 } 24229 24230 _.animating = true; 24231 24232 _.$slider.trigger('beforeChange', [_, _.currentSlide, animSlide]); 24233 24234 oldSlide = _.currentSlide; 24235 _.currentSlide = animSlide; 24236 24237 _.setSlideClasses(_.currentSlide); 24238 24239 if ( _.options.asNavFor ) { 24240 24241 navTarget = _.getNavTarget(); 24242 navTarget = navTarget.slick('getSlick'); 24243 24244 if ( navTarget.slideCount <= navTarget.options.slidesToShow ) { 24245 navTarget.setSlideClasses(_.currentSlide); 24246 } 24247 24248 } 24249 24250 _.updateDots(); 24251 _.updateArrows(); 24252 24253 if (_.options.fade === true) { 24254 if (dontAnimate !== true) { 24255 24256 _.fadeSlideOut(oldSlide); 24257 24258 _.fadeSlide(animSlide, function() { 24259 _.postSlide(animSlide); 24260 }); 24261 24262 } else { 24263 _.postSlide(animSlide); 24264 } 24265 _.animateHeight(); 24266 return; 24267 } 24268 24269 if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) { 24270 _.animateSlide(targetLeft, function() { 24271 _.postSlide(animSlide); 24272 }); 24273 } else { 24274 _.postSlide(animSlide); 24275 } 24276 24277 }; 24278 24279 Slick.prototype.startLoad = function() { 24280 24281 var _ = this; 24282 24283 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 24284 24285 _.$prevArrow.hide(); 24286 _.$nextArrow.hide(); 24287 24288 } 24289 24290 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 24291 24292 _.$dots.hide(); 24293 24294 } 24295 24296 _.$slider.addClass('slick-loading'); 24297 24298 }; 24299 24300 Slick.prototype.swipeDirection = function() { 24301 24302 var xDist, yDist, r, swipeAngle, _ = this; 24303 24304 xDist = _.touchObject.startX - _.touchObject.curX; 24305 yDist = _.touchObject.startY - _.touchObject.curY; 24306 r = Math.atan2(yDist, xDist); 24307 24308 swipeAngle = Math.round(r * 180 / Math.PI); 24309 if (swipeAngle < 0) { 24310 swipeAngle = 360 - Math.abs(swipeAngle); 24311 } 24312 24313 if ((swipeAngle <= 45) && (swipeAngle >= 0)) { 24314 return (_.options.rtl === false ? 'left' : 'right'); 24315 } 24316 if ((swipeAngle <= 360) && (swipeAngle >= 315)) { 24317 return (_.options.rtl === false ? 'left' : 'right'); 24318 } 24319 if ((swipeAngle >= 135) && (swipeAngle <= 225)) { 24320 return (_.options.rtl === false ? 'right' : 'left'); 24321 } 24322 if (_.options.verticalSwiping === true) { 24323 if ((swipeAngle >= 35) && (swipeAngle <= 135)) { 24324 return 'down'; 24325 } else { 24326 return 'up'; 24327 } 24328 } 24329 24330 return 'vertical'; 24331 24332 }; 24333 24334 Slick.prototype.swipeEnd = function(event) { 24335 24336 var _ = this, 24337 slideCount, 24338 direction; 24339 24340 _.dragging = false; 24341 _.swiping = false; 24342 24343 if (_.scrolling) { 24344 _.scrolling = false; 24345 return false; 24346 } 24347 24348 _.interrupted = false; 24349 _.shouldClick = ( _.touchObject.swipeLength > 10 ) ? false : true; 24350 24351 if ( _.touchObject.curX === undefined ) { 24352 return false; 24353 } 24354 24355 if ( _.touchObject.edgeHit === true ) { 24356 _.$slider.trigger('edge', [_, _.swipeDirection() ]); 24357 } 24358 24359 if ( _.touchObject.swipeLength >= _.touchObject.minSwipe ) { 24360 24361 direction = _.swipeDirection(); 24362 24363 switch ( direction ) { 24364 24365 case 'left': 24366 case 'down': 24367 24368 slideCount = 24369 _.options.swipeToSlide ? 24370 _.checkNavigable( _.currentSlide + _.getSlideCount() ) : 24371 _.currentSlide + _.getSlideCount(); 24372 24373 _.currentDirection = 0; 24374 24375 break; 24376 24377 case 'right': 24378 case 'up': 24379 24380 slideCount = 24381 _.options.swipeToSlide ? 24382 _.checkNavigable( _.currentSlide - _.getSlideCount() ) : 24383 _.currentSlide - _.getSlideCount(); 24384 24385 _.currentDirection = 1; 24386 24387 break; 24388 24389 default: 24390 24391 24392 } 24393 24394 if( direction != 'vertical' ) { 24395 24396 _.slideHandler( slideCount ); 24397 _.touchObject = {}; 24398 _.$slider.trigger('swipe', [_, direction ]); 24399 24400 } 24401 24402 } else { 24403 24404 if ( _.touchObject.startX !== _.touchObject.curX ) { 24405 24406 _.slideHandler( _.currentSlide ); 24407 _.touchObject = {}; 24408 24409 } 24410 24411 } 24412 24413 }; 24414 24415 Slick.prototype.swipeHandler = function(event) { 24416 24417 var _ = this; 24418 24419 if ((_.options.swipe === false) || ('ontouchend' in document && _.options.swipe === false)) { 24420 return; 24421 } else if (_.options.draggable === false && event.type.indexOf('mouse') !== -1) { 24422 return; 24423 } 24424 24425 _.touchObject.fingerCount = event.originalEvent && event.originalEvent.touches !== undefined ? 24426 event.originalEvent.touches.length : 1; 24427 24428 _.touchObject.minSwipe = _.listWidth / _.options 24429 .touchThreshold; 24430 24431 if (_.options.verticalSwiping === true) { 24432 _.touchObject.minSwipe = _.listHeight / _.options 24433 .touchThreshold; 24434 } 24435 24436 switch (event.data.action) { 24437 24438 case 'start': 24439 _.swipeStart(event); 24440 break; 24441 24442 case 'move': 24443 _.swipeMove(event); 24444 break; 24445 24446 case 'end': 24447 _.swipeEnd(event); 24448 break; 24449 24450 } 24451 24452 }; 24453 24454 Slick.prototype.swipeMove = function(event) { 24455 24456 var _ = this, 24457 edgeWasHit = false, 24458 curLeft, swipeDirection, swipeLength, positionOffset, touches, verticalSwipeLength; 24459 24460 touches = event.originalEvent !== undefined ? event.originalEvent.touches : null; 24461 24462 if (!_.dragging || _.scrolling || touches && touches.length !== 1) { 24463 return false; 24464 } 24465 24466 curLeft = _.getLeft(_.currentSlide); 24467 24468 _.touchObject.curX = touches !== undefined ? touches[0].pageX : event.clientX; 24469 _.touchObject.curY = touches !== undefined ? touches[0].pageY : event.clientY; 24470 24471 _.touchObject.swipeLength = Math.round(Math.sqrt( 24472 Math.pow(_.touchObject.curX - _.touchObject.startX, 2))); 24473 24474 verticalSwipeLength = Math.round(Math.sqrt( 24475 Math.pow(_.touchObject.curY - _.touchObject.startY, 2))); 24476 24477 if (!_.options.verticalSwiping && !_.swiping && verticalSwipeLength > 4) { 24478 _.scrolling = true; 24479 return false; 24480 } 24481 24482 if (_.options.verticalSwiping === true) { 24483 _.touchObject.swipeLength = verticalSwipeLength; 24484 } 24485 24486 swipeDirection = _.swipeDirection(); 24487 24488 if (event.originalEvent !== undefined && _.touchObject.swipeLength > 4) { 24489 _.swiping = true; 24490 event.preventDefault(); 24491 } 24492 24493 positionOffset = (_.options.rtl === false ? 1 : -1) * (_.touchObject.curX > _.touchObject.startX ? 1 : -1); 24494 if (_.options.verticalSwiping === true) { 24495 positionOffset = _.touchObject.curY > _.touchObject.startY ? 1 : -1; 24496 } 24497 24498 24499 swipeLength = _.touchObject.swipeLength; 24500 24501 _.touchObject.edgeHit = false; 24502 24503 if (_.options.infinite === false) { 24504 if ((_.currentSlide === 0 && swipeDirection === 'right') || (_.currentSlide >= _.getDotCount() && swipeDirection === 'left')) { 24505 swipeLength = _.touchObject.swipeLength * _.options.edgeFriction; 24506 _.touchObject.edgeHit = true; 24507 } 24508 } 24509 24510 if (_.options.vertical === false) { 24511 _.swipeLeft = curLeft + swipeLength * positionOffset; 24512 } else { 24513 _.swipeLeft = curLeft + (swipeLength * (_.$list.height() / _.listWidth)) * positionOffset; 24514 } 24515 if (_.options.verticalSwiping === true) { 24516 _.swipeLeft = curLeft + swipeLength * positionOffset; 24517 } 24518 24519 if (_.options.fade === true || _.options.touchMove === false) { 24520 return false; 24521 } 24522 24523 if (_.animating === true) { 24524 _.swipeLeft = null; 24525 return false; 24526 } 24527 24528 _.setCSS(_.swipeLeft); 24529 24530 }; 24531 24532 Slick.prototype.swipeStart = function(event) { 24533 24534 var _ = this, 24535 touches; 24536 24537 _.interrupted = true; 24538 24539 if (_.touchObject.fingerCount !== 1 || _.slideCount <= _.options.slidesToShow) { 24540 _.touchObject = {}; 24541 return false; 24542 } 24543 24544 if (event.originalEvent !== undefined && event.originalEvent.touches !== undefined) { 24545 touches = event.originalEvent.touches[0]; 24546 } 24547 24548 _.touchObject.startX = _.touchObject.curX = touches !== undefined ? touches.pageX : event.clientX; 24549 _.touchObject.startY = _.touchObject.curY = touches !== undefined ? touches.pageY : event.clientY; 24550 24551 _.dragging = true; 24552 24553 }; 24554 24555 Slick.prototype.unfilterSlides = Slick.prototype.slickUnfilter = function() { 24556 24557 var _ = this; 24558 24559 if (_.$slidesCache !== null) { 24560 24561 _.unload(); 24562 24563 _.$slideTrack.children(this.options.slide).detach(); 24564 24565 _.$slidesCache.appendTo(_.$slideTrack); 24566 24567 _.reinit(); 24568 24569 } 24570 24571 }; 24572 24573 Slick.prototype.unload = function() { 24574 24575 var _ = this; 24576 24577 $('.slick-cloned', _.$slider).remove(); 24578 24579 if (_.$dots) { 24580 _.$dots.remove(); 24581 } 24582 24583 if (_.$prevArrow && _.htmlExpr.test(_.options.prevArrow)) { 24584 _.$prevArrow.remove(); 24585 } 24586 24587 if (_.$nextArrow && _.htmlExpr.test(_.options.nextArrow)) { 24588 _.$nextArrow.remove(); 24589 } 24590 24591 _.$slides 24592 .removeClass('slick-slide slick-active slick-visible slick-current') 24593 .attr('aria-hidden', 'true') 24594 .css('width', ''); 24595 24596 }; 24597 24598 Slick.prototype.unslick = function(fromBreakpoint) { 24599 24600 var _ = this; 24601 _.$slider.trigger('unslick', [_, fromBreakpoint]); 24602 _.destroy(); 24603 24604 }; 24605 24606 Slick.prototype.updateArrows = function() { 24607 24608 var _ = this, 24609 centerOffset; 24610 24611 centerOffset = Math.floor(_.options.slidesToShow / 2); 24612 24613 if ( _.options.arrows === true && 24614 _.slideCount > _.options.slidesToShow && 24615 !_.options.infinite ) { 24616 24617 _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 24618 _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 24619 24620 if (_.currentSlide === 0) { 24621 24622 _.$prevArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); 24623 _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 24624 24625 } else if (_.currentSlide >= _.slideCount - _.options.slidesToShow && _.options.centerMode === false) { 24626 24627 _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); 24628 _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 24629 24630 } else if (_.currentSlide >= _.slideCount - 1 && _.options.centerMode === true) { 24631 24632 _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); 24633 _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 24634 24635 } 24636 24637 } 24638 24639 }; 24640 24641 Slick.prototype.updateDots = function() { 24642 24643 var _ = this; 24644 24645 if (_.$dots !== null) { 24646 24647 _.$dots 24648 .find('li') 24649 .removeClass('slick-active') 24650 .end(); 24651 24652 _.$dots 24653 .find('li') 24654 .eq(Math.floor(_.currentSlide / _.options.slidesToScroll)) 24655 .addClass('slick-active'); 24656 24657 } 24658 24659 }; 24660 24661 Slick.prototype.visibility = function() { 24662 24663 var _ = this; 24664 24665 if ( _.options.autoplay ) { 24666 24667 if ( document[_.hidden] ) { 24668 24669 _.interrupted = true; 24670 24671 } else { 24672 24673 _.interrupted = false; 24674 24675 } 24676 24677 } 24678 24679 }; 24680 24681 $.fn.slick = function() { 24682 var _ = this, 24683 opt = arguments[0], 24684 args = Array.prototype.slice.call(arguments, 1), 24685 l = _.length, 24686 i, 24687 ret; 24688 for (i = 0; i < l; i++) { 24689 if (typeof opt == 'object' || typeof opt == 'undefined') 24690 _[i].slick = new Slick(_[i], opt); 24691 else 24692 ret = _[i].slick[opt].apply(_[i].slick, args); 24693 if (typeof ret != 'undefined') return ret; 24694 } 24695 return _; 24696 }; 24697 24698 })); 24699 24700 24701/***/ }), 24702/* 335 */ 24703/***/ (function(module, exports, __webpack_require__) { 24704 24705 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(global) {/*! 24706 * VERSION: 2.1.3 24707 * DATE: 2019-05-17 24708 * UPDATES AND DOCS AT: http://greensock.com 24709 * 24710 * Includes all of the following: TweenLite, TweenMax, TimelineLite, TimelineMax, EasePack, CSSPlugin, RoundPropsPlugin, BezierPlugin, AttrPlugin, DirectionalRotationPlugin 24711 * 24712 * @license Copyright (c) 2008-2019, GreenSock. All rights reserved. 24713 * This work is subject to the terms at http://greensock.com/standard-license or for
24714 * Club GreenSock members, the software agreement that was issued with your membership. 24715 * 24716 * @author: Jack Doyle, [email protected] 24717 **/ 24718 /* eslint-disable */ 24719 var _gsScope = (typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window; //helps ensure compatibility with AMD/RequireJS and CommonJS/Node 24720 (_gsScope._gsQueue || (_gsScope._gsQueue = [])).push( function() { 24721 24722 "use strict"; 24723 24724 _gsScope._gsDefine("TweenMax", ["core.Animation","core.SimpleTimeline","TweenLite"], function(Animation, SimpleTimeline, TweenLite) { 24725 24726 var _slice = function(a) { //don't use [].slice because that doesn't work in IE8 with a NodeList that's returned by querySelectorAll() 24727 var b = [], 24728 l = a.length, 24729 i; 24730 for (i = 0; i !== l; b.push(a[i++])); 24731 return b; 24732 }, 24733 _applyCycle = function(vars, targets, i) { 24734 var alt = vars.cycle, 24735 p, val; 24736 for (p in alt) { 24737 val = alt[p]; 24738 vars[p] = (typeof(val) === "function") ? val(i, targets[i], targets) : val[i % val.length]; 24739 } 24740 delete vars.cycle; 24741 }, 24742 //for distributing values across an array. Can accept a number, a function or (most commonly) a function which can contain the following properties: {base, amount, from, ease, grid, axis, length, each}. Returns a function that expects the following parameters: index, target, array. Recognizes the following 24743 _distribute = function(v) { 24744 if (typeof(v) === "function") { 24745 return v; 24746 } 24747 var vars = (typeof(v) === "object") ? v : {each:v}, //n:1 is just to indicate v was a number; we leverage that later to set v according to the length we get. If a number is passed in, we treat it like the old stagger value where 0.1, for example, would mean that things would be distributed with 0.1 between each element in the array rather than a total "amount" that's chunked out among them all. 24748 ease = vars.ease, 24749 from = vars.from || 0, 24750 base = vars.base || 0, 24751 cache = {}, 24752 isFromKeyword = isNaN(from), 24753 axis = vars.axis, 24754 ratio = {center:0.5, end:1}[from] || 0; 24755 return function(i, target, a) { 24756 var l = (a || vars).length, 24757 distances = cache[l], 24758 originX, originY, x, y, d, j, max, min, wrap; 24759 if (!distances) { 24760 wrap = (vars.grid === "auto") ? 0 : (vars.grid || [Infinity])[0]; 24761 if (!wrap) { 24762 max = -Infinity; 24763 while (max < (max = a[wrap++].getBoundingClientRect().left) && wrap < l) { } 24764 wrap--; 24765 } 24766 distances = cache[l] = []; 24767 originX = isFromKeyword ? (Math.min(wrap, l) * ratio) - 0.5 : from % wrap; 24768 originY = isFromKeyword ? l * ratio / wrap - 0.5 : (from / wrap) | 0; 24769 max = 0; 24770 min = Infinity; 24771 for (j = 0; j < l; j++) { 24772 x = (j % wrap) - originX; 24773 y = originY - ((j / wrap) | 0); 24774 distances[j] = d = !axis ? Math.sqrt(x * x + y * y) : Math.abs((axis === "y") ? y : x); 24775 if (d > max) { 24776 max = d; 24777 } 24778 if (d < min) { 24779 min = d; 24780 } 24781 } 24782 distances.max = max - min; 24783 distances.min = min; 24784 distances.v = l = vars.amount || (vars.each * (wrap > l ? l - 1 : !axis ? Math.max(wrap, l / wrap) : axis === "y" ? l / wrap : wrap)) || 0; 24785 distances.b = (l < 0) ? base - l : base; 24786 } 24787 l = (distances[i] - distances.min) / distances.max; 24788 return distances.b + (ease ? ease.getRatio(l) : l) * distances.v; 24789 }; 24790 }, 24791 TweenMax = function(target, duration, vars) { 24792 TweenLite.call(this, target, duration, vars); 24793 this._cycle = 0; 24794 this._yoyo = (this.vars.yoyo === true || !!this.vars.yoyoEase); 24795 this._repeat = this.vars.repeat || 0; 24796 this._repeatDelay = this.vars.repeatDelay || 0; 24797 if (this._repeat) { 24798 this._uncache(true); //ensures that if there is any repeat, the totalDuration will get recalculated to accurately report it. 24799 } 24800 this.render = TweenMax.prototype.render; //speed optimization (avoid prototype lookup on this "hot" method) 24801 }, 24802 _tinyNum = 0.00000001, 24803 TweenLiteInternals = TweenLite._internals, 24804 _isSelector = TweenLiteInternals.isSelector, 24805 _isArray = TweenLiteInternals.isArray, 24806 p = TweenMax.prototype = TweenLite.to({}, 0.1, {}), 24807 _blankArray = []; 24808 24809 TweenMax.version = "2.1.3"; 24810 p.constructor = TweenMax; 24811 p.kill()._gc = false;
24812 TweenMax.killTweensOf = TweenMax.killDelayedCallsTo = TweenLite.killTweensOf; 24813 TweenMax.getTweensOf = TweenLite.getTweensOf; 24814 TweenMax.lagSmoothing = TweenLite.lagSmoothing; 24815 TweenMax.ticker = TweenLite.ticker; 24816 TweenMax.render = TweenLite.render; 24817 TweenMax.distribute = _distribute; 24818 24819 p.invalidate = function() { 24820 this._yoyo = (this.vars.yoyo === true || !!this.vars.yoyoEase); 24821 this._repeat = this.vars.repeat || 0; 24822 this._repeatDelay = this.vars.repeatDelay || 0; 24823 this._yoyoEase = null; 24824 this._uncache(true); 24825 return TweenLite.prototype.invalidate.call(this); 24826 }; 24827 24828 p.updateTo = function(vars, resetDuration) { 24829 var self = this, 24830 curRatio = self.ratio, 24831 immediate = self.vars.immediateRender || vars.immediateRender, 24832 p; 24833 if (resetDuration && self._startTime < self._timeline._time) { 24834 self._startTime = self._timeline._time; 24835 self._uncache(false); 24836 if (self._gc) { 24837 self._enabled(true, false); 24838 } else { 24839 self._timeline.insert(self, self._startTime - self._delay); //ensures that any necessary re-sequencing of Animations in the timeline occurs to make sure the rendering order is correct. 24840 } 24841 } 24842 for (p in vars) { 24843 self.vars[p] = vars[p]; 24844 } 24845 if (self._initted || immediate) { 24846 if (resetDuration) { 24847 self._initted = false; 24848 if (immediate) { 24849 self.render(0, true, true); 24850 } 24851 } else { 24852 if (self._gc) { 24853 self._enabled(true, false); 24854 } 24855 if (self._notifyPluginsOfEnabled && self._firstPT) { 24856 TweenLite._onPluginEvent("_onDisable", self); //in case a plugin like MotionBlur must perform some cleanup tasks 24857 } 24858 if (self._time / self._duration > 0.998) { //if the tween has finished (or come extremely close to finishing), we just need to rewind it to 0 and then render it again at the end which forces it to re-initialize (parsing the new vars). We allow tweens that are close to finishing (but haven't quite finished) to work this way too because otherwise, the values are so small when determining where to project the starting values that binary math issues creep in and can make the tween appear to render incorrectly when run backwards. 24859 var prevTime = self._totalTime; 24860 self.render(0, true, false); 24861 self._initted = false; 24862 self.render(prevTime, true, false); 24863 } else { 24864 self._initted = false; 24865 self._init(); 24866 if (self._time > 0 || immediate) { 24867 var inv = 1 / (1 - curRatio), 24868 pt = self._firstPT, endValue; 24869 while (pt) { 24870 endValue = pt.s + pt.c; 24871 pt.c *= inv; 24872 pt.s = endValue - pt.c; 24873 pt = pt._next; 24874 } 24875 } 24876 } 24877 } 24878 } 24879 return self; 24880 }; 24881 24882 p.render = function(time, suppressEvents, force) { 24883 if (!this._initted) if (this._duration === 0 && this.vars.repeat) { //zero duration tweens that render immediately have render() called from TweenLite's constructor, before TweenMax's constructor has finished setting _repeat, _repeatDelay, and _yoyo which are critical in determining totalDuration() so we need to call invalidate() which is a low-kb way to get those set properly. 24884 this.invalidate(); 24885 } 24886 var self = this, 24887 totalDur = (!self._dirty) ? self._totalDuration : self.totalDuration(), 24888 prevTime = self._time, 24889 prevTotalTime = self._totalTime, 24890 prevCycle = self._cycle, 24891 duration = self._duration, 24892 prevRawPrevTime = self._rawPrevTime, 24893 isComplete, callback, pt, cycleDuration, r, type, pow, rawPrevTime, yoyoEase; 24894 if (time >= totalDur - _tinyNum && time >= 0) { //to work around occasional floating point math artifacts. 24895 self._totalTime = totalDur; 24896 self._cycle = self._repeat; 24897 if (self._yoyo && (self._cycle & 1) !== 0) { 24898 self._time = 0; 24899 self.ratio = self._ease._calcEnd ? self._ease.getRatio(0) : 0; 24900 } else { 24901 self._time = duration; 24902 self.ratio = self._ease._calcEnd ? self._ease.getRatio(1) : 1; 24903 } 24904 if (!self._reversed) { 24905 isComplete = true; 24906 callback = "onComplete"; 24907 force = (force || self._timeline.autoRemoveChildren); //otherwise, if the animation is unpaused/activated after it's already finished, it doesn't get removed from the parent timeline. 24908 } 24909 if (duration === 0) if (self._initted || !self.vars.lazy || force) { //zero-duration tweens are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered. 24910 if (self._startTime === self._timeline._duration) { //if a zero-duration tween is at the VERY end of a timeline and that timeline renders at its end, it will typically add a tiny bit of cushion to the render time to prevent roun
24910ding errors from getting in the way of tweens rendering their VERY end. If we then reverse() that timeline, the zero-duration tween will trigger its onReverseComplete even though technically the playhead didn't pass over it again. It's a very specific edge case we must accommodate. 24911 time = 0; 24912 } 24913 if (prevRawPrevTime < 0 || (time <= 0 && time >= -_tinyNum) || (prevRawPrevTime === _tinyNum && self.data !== "isPause")) if (prevRawPrevTime !== time) { //note: when this.data is "isPause", it's a callback added by addPause() on a timeline that we should not be triggered when LEAVING its exact start time. In other words, tl.addPause(1).play(1) shouldn't pause. 24914 force = true; 24915 if (prevRawPrevTime > _tinyNum) { 24916 callback = "onReverseComplete"; 24917 } 24918 } 24919 self._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. 24920 } 24921 24922 } else if (time < _tinyNum) { //to work around occasional floating point math artifacts, round super small values to 0. 24923 self._totalTime = self._time = self._cycle = 0; 24924 self.ratio = self._ease._calcEnd ? self._ease.getRatio(0) : 0; 24925 if (prevTotalTime !== 0 || (duration === 0 && prevRawPrevTime > 0)) { 24926 callback = "onReverseComplete"; 24927 isComplete = self._reversed; 24928 } 24929 if (time > -_tinyNum) { 24930 time = 0; 24931 } else if (time < 0) { 24932 self._active = false; 24933 if (duration === 0) if (self._initted || !self.vars.lazy || force) { //zero-duration tweens are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered. 24934 if (prevRawPrevTime >= 0) { 24935 force = true; 24936 } 24937 self._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. 24938 } 24939 } 24940 if (!self._initted) { //if we render the very beginning (time == 0) of a fromTo(), we must force the render (normal tweens wouldn't need to render at a time of 0 when the prevTime was also 0). This is also mandatory to make sure overwriting kicks in immediately. 24941 force = true; 24942 } 24943 } else { 24944 self._totalTime = self._time = time; 24945 if (self._repeat !== 0) { 24946 cycleDuration = duration + self._repeatDelay; 24947 self._cycle = (self._totalTime / cycleDuration) >> 0; //originally _totalTime % cycleDuration but floating point errors caused problems, so I normalized it. (4 % 0.8 should be 0 but some browsers report it as 0.79999999!) 24948 if (self._cycle !== 0) if (self._cycle === self._totalTime / cycleDuration && prevTotalTime <= time) { 24949 self._cycle--; //otherwise when rendered exactly at the end time, it will act as though it is repeating (at the beginning) 24950 } 24951 self._time = self._totalTime - (self._cycle * cycleDuration); 24952 if (self._yoyo) if ((self._cycle & 1) !== 0) { 24953 self._time = duration - self._time; 24954 yoyoEase = self._yoyoEase || self.vars.yoyoEase; //note: we don't set this._yoyoEase in _init() like we do other properties because it's TweenMax-specific and doing it here allows us to optimize performance (most tweens don't have a yoyoEase). Note that we also must skip the this.ratio calculation further down right after we _init() in this function, because we're doing it here. 24955 if (yoyoEase) { 24956 if (!self._yoyoEase) { 24957 if (yoyoEase === true && !self._initted) { //if it's not initted and yoyoEase is true, this._ease won't have been populated yet so we must discern it here. 24958 yoyoEase = self.vars.ease; 24959 self._yoyoEase = yoyoEase = !yoyoEase ? TweenLite.defaultEase : (yoyoEase instanceof Ease) ? yoyoEase : (typeof(yoyoEase) === "function") ? new Ease(yoyoEase, self.vars.easeParams) : Ease.map[yoyoEase] || TweenLite.defaultEase; 24960 } else { 24961 self._yoyoEase = yoyoEase = (yoyoEase === true) ? self._ease : (yoyoEase instanceof Ease) ? yoyoEase : Ease.map[yoyoEase]; 24962 } 24963 } 24964 self.ratio = yoyoEase ? 1 - yoyoEase.getRatio((duration - self._time) / duration) : 0; 24965 } 24966 } 24967 if (self._time > duration) { 24968 self._time = duration; 24969 } else if (self._time < 0) { 24970 self._time = 0; 24971 } 24972 } 24973 if (self._easeType && !yoyoEase) { 24974 r = self._time / duration; 24975 type = self._easeType; 24976 pow = self._easePower; 24977 if (type === 1 || (type === 3 && r >= 0.5)) { 24978 r = 1 - r; 24979 } 24980 if (type === 3) { 24981 r *= 2; 24982 } 24983 if (pow === 1) { 24984 r *= r; 24985 } else if (pow === 2) { 24986 r *= r * r; 24987 } else if (pow === 3) { 24988 r *= r * r * r; 24989 } else if (pow === 4) { 24990 r *= r * r * r * r; 24991 } 24992 self.ratio = (type === 1) ? 1 - r : (type === 2) ? r : (self._time / duration < 0.5) ? r / 2 : 1 - (r / 2); 24993 24994 } else if (!yoyoEase) { 24995 self.ratio = self._ease.getRatio(self._time / duration); 24996 } 24997 24998 } 24999 25000 if (prevTime === self._time && !force && prevCycle === self._cycle) { 25001 if (prevTotalTime !== self._totalTime) if (self._onUpdate) if (!suppressEvents) { //so that onUp
25001date fires even during the repeatDelay - as long as the totalTime changed, we should trigger onUpdate. 25002 self._callback("onUpdate"); 25003 } 25004 return; 25005 } else if (!self._initted) { 25006 self._init(); 25007 if (!self._initted || self._gc) { //immediateRender tweens typically won't initialize until the playhead advances (_time is greater than 0) in order to ensure that overwriting occurs properly. Also, if all of the tweening properties have been overwritten (which would cause _gc to be true, as set in _init()), we shouldn't continue otherwise an onStart callback could be called for example. 25008 return; 25009 } else if (!force && self._firstPT && ((self.vars.lazy !== false && self._duration) || (self.vars.lazy && !self._duration))) { //we stick it in the queue for rendering at the very end of the tick - this is a performance optimization because browsers invalidate styles and force a recalculation if you read, write, and then read style data (so it's better to read/read/read/write/write/write than read/write/read/write/read/write). The down side, of course, is that usually you WANT things to render immediately because you may have code running right after that which depends on the change. Like imagine running TweenLite.set(...) and then immediately after that, creating a nother tween that animates the same property to another value; the starting values of that 2nd tween wouldn't be accurate if lazy is true. 25010 self._time = prevTime; 25011 self._totalTime = prevTotalTime; 25012 self._rawPrevTime = prevRawPrevTime; 25013 self._cycle = prevCycle; 25014 TweenLiteInternals.lazyTweens.push(self); 25015 self._lazy = [time, suppressEvents]; 25016 return; 25017 } 25018 //_ease is initially set to defaultEase, so now that init() has run, _ease is set properly and we need to recalculate the ratio. Overall this is faster than using conditional logic earlier in the method to avoid having to set ratio twice because we only init() once but renderTime() gets called VERY frequently. 25019 if (self._time && !isComplete && !yoyoEase) { 25020 self.ratio = self._ease.getRatio(self._time / duration); 25021 } else if (isComplete && this._ease._calcEnd && !yoyoEase) { 25022 self.ratio = self._ease.getRatio((self._time === 0) ? 0 : 1); 25023 } 25024 } 25025 if (self._lazy !== false) { 25026 self._lazy = false; 25027 } 25028 25029 if (!self._active) if (!self._paused && self._time !== prevTime && time >= 0) { 25030 self._active = true; //so that if the user renders a tween (as opposed to the timeline rendering it), the timeline is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the tween already finished but the user manually re-renders it as halfway done. 25031 } 25032 if (prevTotalTime === 0) { 25033 if (self._initted === 2 && time > 0) { 25034 self._init(); //will just apply overwriting since _initted of (2) means it was a from() tween that had immediateRender:true 25035 } 25036 if (self._startAt) { 25037 if (time >= 0) { 25038 self._startAt.render(time, true, force); 25039 } else if (!callback) { 25040 callback = "_dummyGS"; //if no callback is defined, use a dummy value just so that the condition at the end evaluates as true because _startAt should render AFTER the normal render loop when the time is negative. We could handle this in a more intuitive way, of course, but the render loop is the MOST important thing to optimize, so this technique allows us to avoid adding extra conditional logic in a high-frequency area. 25041 } 25042 } 25043 if (self.vars.onStart) if (self._totalTime !== 0 || duration === 0) if (!suppressEvents) { 25044 self._callback("onStart"); 25045 } 25046 } 25047 25048 pt = self._firstPT; 25049 while (pt) { 25050 if (pt.f) { 25051 pt.t[pt.p](pt.c * self.ratio + pt.s); 25052 } else { 25053 pt.t[pt.p] = pt.c * self.ratio + pt.s; 25054 } 25055 pt = pt._next; 25056 } 25057 25058 if (self._onUpdate) { 25059 if (time < 0) if (self._startAt && self._startTime) { //if the tween is positioned at the VERY beginning (_startTime 0) of its parent timeline, it's illegal for the playhead to go back further, so we should not render the recorded startAt values. 25060 self._startAt.render(time, true, force); //note: for performance reasons, we tuck this conditional logic inside less traveled areas (most tweens don't have an onUpdate). We'd just have it at the end before the onComplete, but the values should be updated before any onUpdate is called, so we ALSO put it here and then if it's not called, we do so later near the onComplete. 25061 } 25062 if (!suppressEvents) if (self._totalTime !== prevTotalTime || callback) {
25063 self._callback("onUpdate"); 25064 } 25065 } 25066 if (self._cycle !== prevCycle) if (!suppressEvents) if (!self._gc) if (self.vars.onRepeat) { 25067 self._callback("onRepeat"); 25068 } 25069 if (callback) if (!self._gc || force) { //check gc because there's a chance that kill() could be called in an onUpdate 25070 if (time < 0 && self._startAt && !self._onUpdate && self._startTime) { //if the tween is positioned at the VERY beginning (_startTime 0) of its parent timeline, it's illegal for the playhead to go back further, so we should not render the recorded startAt values. 25071 self._startAt.render(time, true, force); 25072 } 25073 if (isComplete) { 25074 if (self._timeline.autoRemoveChildren) { 25075 self._enabled(false, false); 25076 } 25077 self._active = false; 25078 } 25079 if (!suppressEvents && self.vars[callback]) { 25080 self._callback(callback); 25081 } 25082 if (duration === 0 && self._rawPrevTime === _tinyNum && rawPrevTime !== _tinyNum) { //the onComplete or onReverseComplete could trigger movement of the playhead and for zero-duration tweens (which must discern direction) that land directly back on their start time, we don't want to fire again on the next render. Think of several addPause()'s in a timeline that forces the playhead to a certain spot, but what if it's already paused and another tween is tweening the "time" of the timeline? Each time it moves [forward] past that spot, it would move back, and since suppressEvents is true, it'd reset _rawPrevTime to _tinyNum so that when it begins again, the callback would fire (so ultimately it could bounce back and forth during that tween). Again, this is a very uncommon sce
25082nario, but possible nonetheless. 25083 self._rawPrevTime = 0; 25084 } 25085 } 25086 }; 25087 25088 //---- STATIC FUNCTIONS ----------------------------------------------------------------------------------------------------------- 25089 25090 TweenMax.to = function(target, duration, vars) { 25091 return new TweenMax(target, duration, vars); 25092 }; 25093 25094 TweenMax.from = function(target, duration, vars) { 25095 vars.runBackwards = true; 25096 vars.immediateRender = (vars.immediateRender != false); 25097 return new TweenMax(target, duration, vars); 25098 }; 25099 25100 TweenMax.fromTo = function(target, duration, fromVars, toVars) { 25101 toVars.startAt = fromVars; 25102 toVars.immediateRender = (toVars.immediateRender != false && fromVars.immediateRender != false); 25103 return new TweenMax(target, duration, toVars); 25104 }; 25105 25106 TweenMax.staggerTo = TweenMax.allTo = function(targets, duration, vars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { 25107 var a = [], 25108 staggerFunc = _distribute(vars.stagger || stagger), 25109 cycle = vars.cycle, 25110 fromCycle = (vars.startAt || _blankArray).cycle, 25111 l, copy, i, p; 25112 if (!_isArray(targets)) { 25113 if (typeof(targets) === "string") { 25114 targets = TweenLite.selector(targets) || targets; 25115 } 25116 if (_isSelector(targets)) { 25117 targets = _slice(targets); 25118 } 25119 } 25120 targets = targets || []; 25121 l = targets.length - 1; 25122 for (i = 0; i <= l; i++) { 25123 copy = {}; 25124 for (p in vars) { 25125 copy[p] = vars[p]; 25126 } 25127 if (cycle) { 25128 _applyCycle(copy, targets, i); 25129 if (copy.duration != null) { 25130 duration = copy.duration; 25131 delete copy.duration; 25132 } 25133 } 25134 if (fromCycle) { 25135 fromCycle = copy.startAt = {}; 25136 for (p in vars.startAt) { 25137 fromCycle[p] = vars.startAt[p]; 25138 } 25139 _applyCycle(copy.startAt, targets, i); 25140 } 25141 copy.delay = staggerFunc(i, targets[i], targets) + (copy.delay || 0); 25142 if (i === l && onCompleteAll) { 25143 copy.onComplete = function() { 25144 if (vars.onComplete) { 25145 vars.onComplete.apply(vars.onCompleteScope || this, arguments); 25146 } 25147 onCompleteAll.apply(onCompleteAllScope || vars.callbackScope || this, onCompleteAllParams || _blankArray); 25148 }; 25149 } 25150 a[i] = new TweenMax(targets[i], duration, copy); 25151 } 25152 return a; 25153 }; 25154 25155 TweenMax.staggerFrom = TweenMax.allFrom = function(targets, duration, vars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { 25156 vars.runBackwards = true; 25157 vars.immediateRender = (vars.immediateRender != false); 25158 return TweenMax.staggerTo(targets, duration, vars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope); 25159 }; 25160 25161 TweenMax.staggerFromTo = TweenMax.allFromTo = function(targets, duration, fromVars, toVars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { 25162 toVars.startAt = fromVars; 25163 toVars.immediateRender = (toVars.immediateRender != false && fromVars.immediateRender != false); 25164 return TweenMax.staggerTo(targets, duration, toVars, stagger, onCompleteAll, onCompleteAllParams, onCompleteAllScope); 25165 }; 25166 25167 TweenMax.delayedCall = function(delay, callback, params, scope, useFrames) { 25168 return new TweenMax(callback, 0, {delay:delay, onComplete:callback, onCompleteParams:params, callbackScope:scope, onReverseComplete:callback, onReverseCompleteParams:params, immediateRender:false, useFrames:useFrames, overwrite:0}); 25169 }; 25170 25171 TweenMax.set = function(target, vars) { 25172 return new TweenMax(target, 0, vars); 25173 }; 25174 25175 TweenMax.isTweening = function(target) { 25176 return (TweenLite.getTweensOf(target, true).length > 0); 25177 }; 25178 25179 var _getChildrenOf = function(timeline, includeTimelines) { 25180 var a = [], 25181 cnt = 0, 25182 tween = timeline._first; 25183 while (tween) { 25184 if (tween instanceof TweenLite) { 25185 a[cnt++] = tween; 25186 } else { 25187 if (includeTimelines) { 25188 a[cnt++] = tween; 25189 } 25190 a = a.concat(_getChildrenOf(tween, includeTimelines)); 25191 cnt = a.length; 25192 } 25193 tween = tween._next; 25194 } 25195 return a; 25196 }, 25197 getAllTweens = TweenMax.getAllTweens = function(includeTimelines) { 25198 return _getChildrenOf(Animation._rootTimeline, includeTimelines).concat( _getChildrenOf(Animation._rootFramesTimeline, includeTimelines) ); 25199 }; 25200 25201 TweenMax.killAll = function(complete, tweens, delayedCalls, timelines) { 25202 if (tweens == null) { 25203 tweens = true; 25204 } 25205 if (delayedCalls == null) { 25206 delayedCalls = true; 25207 } 25208 var a = getAllTweens((timelines != false)), 25209 l = a.length, 25210 allTrue = (tweens && delayedCalls && timelines), 25211 isDC, tween, i; 25212 for (i = 0; i < l; i++) { 25213 tween = a[i]; 25214 if (allTrue || (tween instanceof SimpleTimeline) || ((isDC = (tween.target === tween.vars.onComplete)) && delayedCalls) || (tweens && !isDC)) { 25215 if (complete) { 25216 tween.totalTime(tween._reversed ? 0 : tween.totalDuration()); 25217 } else { 25218 tween._enabled(false, false); 25219 } 25220 } 25221 } 25222 }; 25223 25224 TweenMax.killChildTweensOf = function(parent, complete) { 25225 if (parent == null) { 25226 return; 25227 } 25228 var tl = TweenLiteInternals.tweenLookup, 25229 a, curParent, p, i, l; 25230 if (typeof(parent) === "string") { 25231 parent = TweenLite.selector(parent) || parent; 25232 } 25233 if (_isSelector(parent)) { 25234 parent = _slice(parent); 25235 } 25236 if (_isArray(parent)) { 25237 i = parent.length; 25238 while (--i > -1) { 25239 TweenMax.killChildTweensOf(parent[i], complete); 25240 } 25241 return; 25242 } 25243 a = []; 25244 for (p in tl) { 25245 curParent = tl[p].target.parentNode; 25246 while (curParent) { 25247 if (curParent === parent) { 25248 a = a.concat(tl[p].tweens); 25249 } 25250 curParent = curParent.parentNode; 25251 } 25252 } 25253 l = a.length; 25254 for (i = 0; i < l; i++) { 25255 if (complete) { 25256 a[i].totalTime(a[i].totalDuration()); 25257 } 25258 a[i]._enabled(false, false); 25259 } 25260 }; 25261 25262 var _changePause = function(pause, tweens, delayedCalls, timelines) { 25263 tweens = (tweens !== false); 25264 delayedCalls = (delayedCalls !== false); 25265 timelines = (timelines !== false); 25266 var a = getAllTweens(timelines), 25267 allTrue = (tweens && delayedCalls && timelines), 25268 i = a.length, 25269 isDC, tween; 25270 while (--i > -1) { 25271 tween = a[i]; 25272 if (allTrue || (tween instanceof SimpleTimeline) || ((isDC = (tween.target === tween.vars.onComplete)) && delayedCalls) || (tweens && !isDC)) { 25273 tween.paused(pause); 25274 } 25275 } 25276 }; 25277 25278 TweenMax.pauseAll = function(tweens, delayedCalls, timelines) { 25279 _changePause(true, tweens, delayedCalls, timelines); 25280 }; 25281 25282 TweenMax.resumeAll = function(tweens, delayedCalls, timelines) { 25283 _changePause(false, tweens, delayedCalls, timelines); 25284 }; 25285 25286 TweenMax.globalTimeScale = function(value) { 25287 var tl = Animation._rootTimeline, 25288 t = TweenLite.ticker.time; 25289 if (!arguments.length) { 25290 return tl._timeScale; 25291 } 25292 value = value || _tinyNum; //can't allow zero because it'll throw the math off 25293 tl._startTime = t - ((t - tl._startTime) * tl._timeScale / value); 25294 tl = Animation._rootFramesTimeline; 25295 t = TweenLite.ticker.frame; 25296 tl._startTime = t - ((t - tl._startTime) * tl._timeScale / value); 25297 tl._timeScale = Animation._rootTimeline._timeScale = value; 25298 return value; 25299 }; 25300 25301 25302 //---- GETTERS / SETTERS ---------------------------------------------------------------------------------------------------------- 25303 25304 p.progress = function(value, suppressEvents) { 25305 return (!arguments.length) ? (this.duration() ? this._time / this._duration : this.ratio) : this.totalTime( this.duration() * ((this._yoyo && (this._cycle & 1) !== 0) ? 1 - value : value) + (this._cycle * (this._duration + this._repeatDelay)), suppressEvents); 25306 }; 25307 25308 p.totalProgress = function(value, suppressEvents) { 25309 return (!arguments.length) ? this._totalTime / this.totalDuration() : this.totalTime( this.totalDuration() * value, suppressEvents); 25310 }; 25311 25312 p.time = function(value, suppressEvents) { 25313 if (!arguments.length) { 25314 return this._time; 25315 } 25316 if (this._dirty) { 25317 this.totalDuration(); 25318 } 25319 var duration = this._duration, 25320 cycle = this._cycle, 25321 cycleDur = cycle * (duration + this._repeatDelay); 25322 if (value > duration) { 25323 value = duration; 25324 } 25325 return this.totalTime((this._yoyo && (cycle & 1)) ? duration - value + cycleDur : this._repeat ? value + cycleDur : value, suppressEvents); 25326 }; 25327 25328 p.duration = function(value) { 25329 if (!arguments.length) { 25330 return this._duration; //don't set _dirty = false because there could be repeats that haven't been factored
25330into the _totalDuration yet. Otherwise, if you create a repeated TweenMax and then immediately check its duration(), it would cache the value and the totalDuration would not be correct, thus repeats wouldn't take effect. 25331 } 25332 return Animation.prototype.duration.call(this, value); 25333 }; 25334 25335 p.totalDuration = function(value) { 25336 if (!arguments.length) { 25337 if (this._dirty) { 25338 //instead of Infinity, we use 999999999999 so that we can accommodate reverses 25339 this._totalDuration = (this._repeat === -1) ? 999999999999 : this._duration * (this._repeat + 1) + (this._repeatDelay * this._repeat); 25340 this._dirty = false; 25341 } 25342 return this._totalDuration; 25343 } 25344 return (this._repeat === -1) ? this : this.duration( (value - (this._repeat * this._repeatDelay)) / (this._repeat + 1) ); 25345 }; 25346 25347 p.repeat = function(value) { 25348 if (!arguments.length) { 25349 return this._repeat; 25350 } 25351 this._repeat = value; 25352 return this._uncache(true); 25353 }; 25354 25355 p.repeatDelay = function(value) { 25356 if (!arguments.length) { 25357 return this._repeatDelay; 25358 } 25359 this._repeatDelay = value; 25360 return this._uncache(true); 25361 }; 25362 25363 p.yoyo = function(value) { 25364 if (!arguments.length) { 25365 return this._yoyo; 25366 } 25367 this._yoyo = value; 25368 return this; 25369 }; 25370 25371 25372 return TweenMax; 25373 25374 }, true); 25375 25376 25377 25378 25379 25380 25381 25382 25383 /* 25384 * ---------------------------------------------------------------- 25385 * TimelineLite 25386 * ---------------------------------------------------------------- 25387 */ 25388 _gsScope._gsDefine("TimelineLite", ["core.Animation","core.SimpleTimeline","TweenLite"], function(Animation, SimpleTimeline, TweenLite) { 25389 25390 var TimelineLite = function(vars) { 25391 SimpleTimeline.call(this, vars); 25392 var self = this, 25393 v = self.vars, 25394 val, p; 25395 self._labels = {}; 25396 self.autoRemoveChildren = !!v.autoRemoveChildren; 25397 self.smoothChildTiming = !!v.smoothChildTiming; 25398 self._sortChildren = true; 25399 self._onUpdate = v.onUpdate; 25400 for (p in v) { 25401 val = v[p]; 25402 if (_isArray(val)) if (val.join("").indexOf("{self}") !== -1) { 25403 v[p] = self._swapSelfInParams(val); 25404 } 25405 } 25406 if (_isArray(v.tweens)) { 25407 self.add(v.tweens, 0, v.align, v.stagger); 25408 } 25409 }, 25410 _tinyNum = 0.00000001, 25411 TweenLiteInternals = TweenLite._internals, 25412 _internals = TimelineLite._internals = {}, 25413 _isSelector = TweenLiteInternals.isSelector, 25414 _isArray = TweenLiteInternals.isArray, 25415 _lazyTweens = TweenLiteInternals.lazyTweens, 25416 _lazyRender = TweenLiteInternals.lazyRender, 25417 _globals = _gsScope._gsDefine.globals, 25418 _copy = function(vars) { 25419 var copy = {}, p; 25420 for (p in vars) { 25421 copy[p] = vars[p]; 25422 } 25423 return copy; 25424 }, 25425 _applyCycle = function(vars, targets, i) { 25426 var alt = vars.cycle, 25427 p, val; 25428 for (p in alt) { 25429 val = alt[p]; 25430 vars[p] = (typeof(val) === "function") ? val(i, targets[i], targets) : val[i % val.length]; 25431 } 25432 delete vars.cycle; 25433 }, 25434 _pauseCallback = _internals.pauseCallback = function() {}, 25435 _slice = function(a) { //don't use [].slice because that doesn't work in IE8 with a NodeList that's returned by querySelectorAll() 25436 var b = [], 25437 l = a.length, 25438 i; 25439 for (i = 0; i !== l; b.push(a[i++])); 25440 return b; 25441 }, 25442 _defaultImmediateRender = function(tl, toVars, fromVars, defaultFalse) { //default to immediateRender:true unless otherwise set in toVars, fromVars or if defaultFalse is passed in as true 25443 var ir = "immediateRender"; 25444 if (!(ir in toVars)) { 25445 toVars[ir] = !((fromVars && fromVars[ir] === false) || defaultFalse); 25446 } 25447 return toVars; 25448 }, 25449 //for distributing values across an array. Can accept a number, a function or (most commonly) a function which can contain the following properties: {base, amount, from, ease, grid, axis, length, each}. Returns a function that expects the following parameters: index, target, array. Recognizes the following 25450 _distribute = function(v) { 25451 if (typeof(v) === "function") { 25452 return v; 25453 } 25454 var vars = (typeof(v) === "object") ? v : {each:v}, //n:1 is just to indicate v was a number; we leverage that later to set v according to the length we get. If a number is passed in, we treat it like the old stagger value where 0.1, for example, would mean that things would be distributed with 0.1 between each element in the array rather than a total "amount" that's chunked out among them all. 25455 ease = vars.ease, 25456 from = vars.from || 0, 25457 base = vars.base || 0, 25458 cache = {}, 25459 isFromKeyword = isNaN(from), 25460 axis = vars.axis, 25461 ratio = {center:0.5, end:1}[from] || 0; 25462 return function(i, target, a) { 25463 var l = (a || vars).length, 25464 distances = cache[l], 25465 originX, originY, x, y, d, j, max, min, wrap; 25466 if (!distances) { 25467 wrap = (vars.grid === "auto") ? 0 : (vars.grid || [Infinity])[0]; 25468 if (!wrap) { 25469 max = -Infinity; 25470 while (max < (max = a[wrap++].getBoundingClientRect().left) && wrap < l) { } 25471 wrap--; 25472 } 25473 distances = cache[l] = []; 25474 originX = isFromKeyword ? (Math.min(wrap, l) * ratio) - 0.5 : from % wrap; 25475 originY = isFromKeyword ? l * ratio / wrap - 0.5 : (from / wrap) | 0; 25476 max = 0; 25477 min = Infinity; 25478 for (j = 0; j < l; j++) { 25479 x = (j % wrap) - originX; 25480 y = originY - ((j / wrap) | 0); 25481 distances[j] = d = !axis ? Math.sqrt(x * x + y * y) : Math.abs((axis === "y") ? y : x); 25482 if (d > max) { 25483 max = d; 25484 } 25485 if (d < min) { 25486 min = d; 25487 } 25488 } 25489 distances.max = max - min; 25490 distances.min = min; 25491 distances.v = l = vars.amount || (vars.each * (wrap >
25491 l ? l - 1 : !axis ? Math.max(wrap, l / wrap) : axis === "y" ? l / wrap : wrap)) || 0; 25492 distances.b = (l < 0) ? base - l : base; 25493 } 25494 l = (distances[i] - distances.min) / distances.max; 25495 return distances.b + (ease ? ease.getRatio(l) : l) * distances.v; 25496 }; 25497 }, 25498 p = TimelineLite.prototype = new SimpleTimeline(); 25499 25500 TimelineLite.version = "2.1.3"; 25501 TimelineLite.distribute = _distribute; 25502 p.constructor = TimelineLite; 25503 p.kill()._gc = p._forcingPlayhead = p._hasPause = false; 25504 25505 /* might use later... 25506 //translates a local time inside an animation to the corresponding time on the root/global timeline, factoring in all nesting and timeScales. 25507 function localToGlobal(time, animation) { 25508 while (animation) { 25509 time = (time / animation._timeScale) + animation._startTime; 25510 animation = animation.timeline; 25511 } 25512 return time; 25513 } 25514 25515 //translates the supplied time on the root/global timeline into the corresponding local time inside a particular animation, factoring in all nesting and timeScales 25516 function globalToLocal(time, animation) { 25517 var scale = 1; 25518 time -= localToGlobal(0, animation); 25519 while (animation) { 25520 scale *= animation._timeScale; 25521 animation = animation.timeline; 25522 } 25523 return time * scale; 25524 } 25525 */ 25526 25527 p.to = function(target, duration, vars, position) { 25528 var Engine = (vars.repeat && _globals.TweenMax) || TweenLite; 25529 return duration ? this.add( new Engine(target, duration, vars), position) : this.set(target, vars, position); 25530 }; 25531 25532 p.from = function(target, duration, vars, position) { 25533 return this.add( ((vars.repeat && _globals.TweenMax) || TweenLite).from(target, duration, _defaultImmediateRender(this, vars)), position); 25534 }; 25535 25536 p.fromTo = function(target, duration, fromVars, toVars, position) { 25537 var Engine = (toVars.repeat && _globals.TweenMax) || TweenLite; 25538 toVars = _defaultImmediateRender(this, toVars, fromVars); 25539 return duration ? this.add( Engine.fromTo(target, duration, fromVars, toVars), position) : this.set(target, toVars, position); 25540 }; 25541 25542 p.staggerTo = function(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { 25543 var tl = new TimelineLite({onComplete:onCompleteAll, onCompleteParams:onCompleteAllParams, callbackScope:onCompleteAllScope, smoothChildTiming:this.smoothChildTiming}), 25544 staggerFunc = _distribute(vars.stagger || stagger), 25545 startAt = vars.startAt, 25546 cycle = vars.cycle, 25547 copy, i; 25548 if (typeof(targets) === "string") { 25549 targets = TweenLite.selector(targets) || targets; 25550 } 25551 targets = targets || []; 25552 if (_isSelector(targets)) { //if the targets object is a selector, translate it into an array. 25553 targets = _slice(targets); 25554 } 25555 for (i = 0; i < targets.length; i++) { 25556 copy = _copy(vars); 25557 if (startAt) { 25558 copy.startAt = _copy(startAt); 25559 if (startAt.cycle) { 25560 _applyCycle(copy.startAt, targets, i); 25561 } 25562 } 25563 if (cycle) { 25564 _applyCycle(copy, targets, i); 25565 if (copy.duration != null) { 25566 duration = copy.duration; 25567 delete copy.duration; 25568 } 25569 } 25570 tl.to(targets[i], duration, copy, staggerFunc(i, targets[i], targets)); 25571 } 25572 return this.add(tl, position); 25573 }; 25574 25575 p.staggerFrom = function(targets, duration, vars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { 25576 vars.runBackwards = true; 25577 return this.staggerTo(targets, duration, _defaultImmediateRender(this, vars), stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope); 25578 }; 25579 25580 p.staggerFromTo = function(targets, duration, fromVars, toVars, stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope) { 25581 toVars.startAt = fromVars; 25582 return this.staggerTo(targets, duration, _defaultImmediateRender(this, toVars, fromVars), stagger, position, onCompleteAll, onCompleteAllParams, onCompleteAllScope); 25583 }; 25584 25585 p.call = function(callback, params, scope, position) { 25586 return this.add( TweenLite.delayedCall(0, callback, params, scope), position); 25587 }; 25588 25589 p.set = function(target, vars, position) { 25590 return this.add( new TweenLite(target, 0, _defaultImmediateRender(this, vars, null, true)), position); 25591 }; 25592 25593 TimelineLite.exportRoot = function(vars, ignoreDelayedCalls) { 25594 vars = vars || {}; 25595 if (vars.smoothChildTiming == null) { 25596 vars.smoothChildTiming = true; 25597 } 25598 var tl = new TimelineLite(vars), 25599 root = tl._timeline, 25600 hasNegativeStart, time, tween, next; 25601 if (ignoreDelayedCalls == null) { 25602 ignoreDelayedCalls = true; 25603 } 25604 root._remove(tl, true); 25605 tl._startTime = 0; 25606 tl._rawPrevTime = tl._time = tl._totalTime = root._time; 25607 tween = root._first; 25608 while (tween) { 25609 next = tween._next; 25610 if (!ignoreDelayedCalls || !(tween instanceof TweenLite && tween.target === tween.vars.onComplete)) { 25611 time = tween._startTime - tween._delay; 25612 if (time < 0) { 25613 hasNegativeStart = 1; 25614 } 25615 tl.add(tween, time); 25616 } 25617 tween = next; 25618 } 25619 root.add(tl, 0); 25620 if (hasNegativeStart) { //calling totalDuration() will force the adjustment necessary to shift the children forward so none of them start before zero, and moves the timeline backwards the same amount, so the playhead is still aligned where it should be globally, but the timeline doesn't have illegal children that start before zero. 25621 tl.totalDuration(); 25622 } 25623 return tl; 25624 }; 25625 25626 p.add = function(value, position, align, stagger) { 25627 var self = this, 25628 curTime, l, i, child, tl, beforeRawTime; 25629 if (typeof(position) !== "number") { 25630 position = self._parseTimeOrLabel(position, 0, true, value); 25631 } 25632 if (!(value instanceof Animation)) { 25633 if ((value instanceof Array) || (value && value.push && _isArray(value))) {
25634 align = align || "normal"; 25635 stagger = stagger || 0; 25636 curTime = position; 25637 l = value.length; 25638 for (i = 0; i < l; i++) { 25639 if (_isArray(child = value[i])) { 25640 child = new TimelineLite({tweens:child}); 25641 } 25642 self.add(child, curTime); 25643 if (typeof(child) !== "string" && typeof(child) !== "function") { 25644 if (align === "sequence") { 25645 curTime = child._startTime + (child.totalDuration() / child._timeScale); 25646 } else if (align === "start") { 25647 child._startTime -= child.delay(); 25648 } 25649 } 25650 curTime += stagger; 25651 } 25652 return self._uncache(true); 25653 } else if (typeof(value) === "string") { 25654 return self.addLabel(value, position); 25655 } else if (typeof(value) === "function") { 25656 value = TweenLite.delayedCall(0, value); 25657 } else { 25658 throw("Cannot add " + value + " into the timeline; it is not a tween, timeline, function, or string."); 25659 } 25660 } 25661 25662 SimpleTimeline.prototype.add.call(self, value, position); 25663 25664 if (value._time || (!value._duration && value._initted)) { //in case, for example, the _startTime is moved on a tween that has already rendered. Imagine it's at its end state, then the startTime is moved WAY later (after the end of this timeline), it should render at its beginning. 25665 curTime = (self.rawTime() - value._startTime) * value._timeScale; 25666 if (!value._duration || Math.abs(Math.max(0, Math.min(value.totalDuration(), curTime))) - value._totalTime > 0.00001) { 25667 value.render(curTime, false, false); 25668 } 25669 } 25670 25671 //if the timeline has already ended but the inserted tween/timeline extends the duration, we should enable this timeline again so that it renders properly. We should also align the playhead with the parent timeline's when appropriate. 25672 if (self._gc || self._time === self._duration) if (!self._paused) if (self._duration < self.duration()) { 25673 //in case any of the ancestors had completed but should now be enabled... 25674 tl = self; 25675 beforeRawTime = (tl.rawTime() > value._startTime); //if the tween is placed on the timeline so that it starts BEFORE the current rawTime, we should align the playhead (move the timeline). This is because sometimes users will create a timeline, let it finish, and much later append a tween and expect it to run instead of jumping to its end state. While technically one could argue that it should jump to its end state, that's not what users intuitively expect. 25676 while (tl._timeline) { 25677 if (beforeRawTime && tl._timeline.smoothChildTiming) { 25678 tl.totalTime(tl._totalTime, true); //moves the timeline (shifts its startTime) if necessary, and also enables it. 25679 } else if (tl._gc) { 25680 tl._enabled(true, false); 25681 } 25682 tl = tl._timeline; 25683 } 25684 } 25685 25686 return self; 25687 }; 25688 25689 p.remove = function(value) { 25690 if (value instanceof Animation) { 25691 this._remove(value, false); 25692 var tl = value._timeline = value.vars.useFrames ? Animation._rootFramesTimeline : Animation._rootTimeline; //now that it's removed, default it to the root timeline so that if it gets played again, it doesn't jump back into this timeline. 25693 value._startTime = (value._paused ? value._pauseTime : tl._time) - ((!value._reversed ? value._totalTime : value.totalDuration() - value._totalTime) / value._timeScale); //ensure that if it gets played again, the timing is correct. 25694 return this; 25695 } else if (value instanceof Array || (value && value.push && _isArray(value))) { 25696 var i = value.length; 25697 while (--i > -1) { 25698 this.remove(value[i]); 25699 } 25700 return this; 25701 } else if (typeof(value) === "string") { 25702 return this.removeLabel(value); 25703 } 25704 return this.kill(null, value); 25705 }; 25706 25707 p._remove = function(tween, skipDisable) { 25708 SimpleTimeline.prototype._remove.call(this, tween, skipDisable); 25709 var last = this._last; 25710 if (!last) { 25711 this._time = this._totalTime = this._duration = this._totalDuration = 0; 25712 } else if (this._time > this.duration()) { 25713 this._time = this._duration; 25714 this._totalTime = this._totalDuration; 25715 } 25716 return this; 25717 }; 25718 25719 p.append = function(value, offsetOrLabel) { 25720 return this.add(value, this._parseTimeOrLabel(null, offsetOrLabel, true, value)); 25721 }; 25722 25723 p.insert = p.insertMultiple = function(value, position, align, stagger) { 25724 return this.add(value, position || 0, align, stagger); 25725 }; 25726 25727 p.appendMultiple = function(tweens, offsetOrLabel, align, stagger) { 25728 return this.add(tweens, this._parseTimeOrLabel(null, offsetOrLabel, true, tweens), align, stagger); 25729 }; 25730 25731 p.addLabel = function(label, position) { 25732 this._labels[label] = this._parseTimeOrLabel(position); 25733 return this; 25734 }; 25735 25736 p.addPause = function(position, callback, params, scope) { 25737 var t = TweenLite.delayedCall(0, _pauseCallback, params, scope || this); 25738 t.vars.onComplete = t.vars.onReverseComplete = callback;
25739 t.data = "isPause"; 25740 this._hasPause = true; 25741 return this.add(t, position); 25742 }; 25743 25744 p.removeLabel = function(label) { 25745 delete this._labels[label]; 25746 return this; 25747 }; 25748 25749 p.getLabelTime = function(label) { 25750 return (this._labels[label] != null) ? this._labels[label] : -1; 25751 }; 25752 25753 p._parseTimeOrLabel = function(timeOrLabel, offsetOrLabel, appendIfAbsent, ignore) { 25754 var clippedDuration, i; 25755 //if we're about to add a tween/timeline (or an array of them) that's already a child of this timeline, we should remove it first so that it doesn't contaminate the duration(). 25756 if (ignore instanceof Animation && ignore.timeline === this) { 25757 this.remove(ignore); 25758 } else if (ignore && ((ignore instanceof Array) || (ignore.push && _isArray(ignore)))) { 25759 i = ignore.length; 25760 while (--i > -1) { 25761 if (ignore[i] instanceof Animation && ignore[i].timeline === this) { 25762 this.remove(ignore[i]); 25763 } 25764 } 25765 } 25766 clippedDuration = (typeof(timeOrLabel) === "number" && !offsetOrLabel) ? 0 : (this.duration() > 99999999999) ? this.recent().endTime(false) : this._duration; //in case there's a child that infinitely repeats, users almost never intend for the insertion point of a new child to be based on a SUPER long value like that so we clip it and assume the most recently-added child's endTime should be used instead. 25767 if (typeof(offsetOrLabel) === "string") { 25768 return this._parseTimeOrLabel(offsetOrLabel, (appendIfAbsent && typeof(timeOrLabel) === "number" && this._labels[offsetOrLabel] == null) ? timeOrLabel - clippedDuration : 0, appendIfAbsent); 25769 } 25770 offsetOrLabel = offsetOrLabel || 0; 25771 if (typeof(timeOrLabel) === "string" && (isNaN(timeOrLabel) || this._labels[timeOrLabel] != null)) { //if the string is a number like "1", check to see if there's a label with that name, otherwise interpret it as a number (absolute value). 25772 i = timeOrLabel.indexOf("="); 25773 if (i === -1) { 25774 if (this._labels[timeOrLabel] == null) { 25775 return appendIfAbsent ? (this._labels[timeOrLabel] = clippedDuration + offsetOrLabel) : offsetOrLabel; 25776 } 25777 return this._labels[timeOrLabel] + offsetOrLabel; 25778 } 25779 offsetOrLabel = parseInt(timeOrLabel.charAt(i-1) + "1", 10) * Number(timeOrLabel.substr(i+1)); 25780 timeOrLabel = (i > 1) ? this._parseTimeOrLabel(timeOrLabel.substr(0, i-1), 0, appendIfAbsent) : clippedDuration; 25781 } else if (timeOrLabel == null) { 25782 timeOrLabel = clippedDuration; 25783 } 25784 return Number(timeOrLabel) + offsetOrLabel; 25785 }; 25786 25787 p.seek = function(position, suppressEvents) { 25788 return this.totalTime((typeof(position) === "number") ? position : this._parseTimeOrLabel(position), (suppressEvents !== false)); 25789 }; 25790 25791 p.stop = function() { 25792 return this.paused(true); 25793 }; 25794 25795 p.gotoAndPlay = function(position, suppressEvents) { 25796 return this.play(position, suppressEvents); 25797 }; 25798 25799 p.gotoAndStop = function(position, suppressEvents) { 25800 return this.pause(position, suppressEvents); 25801 }; 25802 25803 p.render = function(time, suppressEvents, force) { 25804 if (this._gc) { 25805 this._enabled(true, false); 25806 } 25807 var self = this, 25808 prevTime = self._time, 25809 totalDur = (!self._dirty) ? self._totalDuration : self.totalDuration(), 25810 prevStart = self._startTime, 25811 prevTimeScale = self._timeScale, 25812 prevPaused = self._paused, 25813 tween, isComplete, next, callback, internalForce, pauseTween, curTime, pauseTime; 25814 if (prevTime !== self._time) { //if totalDuration() finds a child with a negative startTime and smoothChildTiming is true, things get shifted around internally so we need to adjust the time accordingly. For example, if a tween starts at -30 we must shift EVERYTHING forward 30 seconds and move this timeline's startTime backward by 30 seconds so that things align with the playhead (no jump). 25815 time += self._time - prevTime; 25816 } 25817 if (self._hasPause && !self._forcingPlayhead && !suppressEvents) { 25818 if (time > prevTime) { 25819 tween = self._first; 25820 while (tween && tween._startTime <= time && !pauseTween) { 25821 if (!tween._duration) if (tween.data === "isPause" && !tween.ratio && !(tween._startTime === 0 && self._rawPrevTime === 0)) { 25822 pauseTween = tween; 25823 } 25824 tween = tween._next; 25825 } 25826 } else { 25827 tween = self._last; 25828 while (tween && tween._startTime >= time && !pauseTween) { 25829 if (!tween._duration) if (tween.data === "isPause" && tween._rawPrevTime > 0) { 25830 pauseTween = tween; 25831 } 25832 tween = tween._prev; 25833 } 25834 } 25835 if (pauseTween) { 25836 self._time = self._totalTime = time = pauseTween._startTime; 25837 pauseTime = self._startTime + (self._reversed ? self._duration - time : time) / self._timeScale; 25838 } 25839 } 25840 if (time >= totalDur - _tinyNum && time >= 0) { //to work around occasional floating point math artifacts. 25841 self._totalTime = self._time = totalDur; 25842 if (!self._reversed) if (!self._hasPausedChild()) { 25843 isComplete = true; 25844 callback = "onComplete"; 25845 internalForce = !!self._timeline.autoRemoveChildren; //otherwise, if the animation is unpaused/activated after it's already finished, it doesn't get removed from the parent timeline. 25846 if (self._duration === 0) if ((time <= 0 && time >= -_tinyNum) || self._rawPrevTime < 0 || self._rawPrevTime === _tinyNum) if (self._rawPrevTime !== time && self._first) { 25847 internalForce = true; 25848 if (self._rawPrevTime > _tinyNum) { 25849 callback = "onReverseComplete"; 25850 } 25851 } 25852 } 25853 self._rawPrevTime = (self._duration || !suppressEvents || time || self._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. 25854 time = totalDur + 0.0001; //to avoid occasional floating point rounding errors - sometimes child tweens/timelines were not being fully completed (their progress might be 0.999999999999998 instead of 1 because when _time - tween._startTime is performed, floating point errors would return a value that was SLIGHTLY off). Try (999999999999.7 - 999999999999) * 1 = 0.699951171875 instead of 0.7. 25855 25856 } else if (time < _tinyNum) { //to work around occasional floating point math artifacts, round super small values to 0. 25857 self._totalTime = self._time = 0; 25858 if (time > -_tinyNum) { 25859 time = 0; 25860 } 25861 if (prevTime !== 0 || (self._duration === 0 && self._rawPrevTime !== _tinyNum && (self._rawPrevTime > 0 || (time < 0 && self._rawPrevTime >= 0)))) { 25862 callback = "onReverseComplete"; 25863 isComplete = self._reversed; 25864 } 25865 if (time < 0) { 25866 self._active = false;
25867 if (self._timeline.autoRemoveChildren && self._reversed) { //ensures proper GC if a timeline is resumed after it's finished reversing. 25868 internalForce = isComplete = true; 25869 callback = "onReverseComplete"; 25870 } else if (self._rawPrevTime >= 0 && self._first) { //when going back beyond the start, force a render so that zero-duration tweens that sit at the very beginning render their start values properly. Otherwise, if the parent timeline's playhead lands exactly at this timeline's startTime, and then moves backwards, the zero-duration tweens at the beginning would still be at their end state. 25871 internalForce = true; 25872 } 25873 self._rawPrevTime = time; 25874 } else { 25875 self._rawPrevTime = (self._duration || !suppressEvents || time || self._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. 25876 if (time === 0 && isComplete) { //if there's a zero-duration tween at the very beginning of a timeline and the playhead lands EXACTLY at time 0, that tween will correctly render its end values, but we need to keep the timeline alive for one more render so that the beginning values render properly as the parent's playhead keeps moving beyond the begining. Imagine obj.x starts at 0 and then we do tl.set(obj, {x:100}).to(obj, 1, {x:200}) and then later we tl.reverse()...the goal is to have obj.x revert to 0. If the playhead happens to land on exactly 0, without this chunk of code, it'd complete the timeline and remove it from the rendering queue (not good). 25877 tween = self._first; 25878 while (tween && tween._startTime === 0) { 25879 if (!tween._duration) { 25880 isComplete = false; 25881 } 25882 tween = tween._next; 25883 } 25884 } 25885 time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline) 25886 if (!self._initted) { 25887 internalForce = true; 25888 } 25889 } 25890 25891 } else { 25892 self._totalTime = self._time = self._rawPrevTime = time; 25893 } 25894 if ((self._time === prevTime || !self._first) && !force && !internalForce && !pauseTween) { 25895 return; 25896 } else if (!self._initted) { 25897 self._initted = true; 25898 } 25899 25900 if (!self._active) if (!self._paused && self._time !== prevTime && time > 0) { 25901 self._active = true; //so that if the user renders the timeline (as opposed to the parent timeline rendering it), it is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the timeline already finished but the user manually re-renders it as halfway done, for example. 25902 } 25903 25904 if (prevTime === 0) if (self.vars.onStart) if (self._time !== 0 || !self._duration) if (!suppressEvents) { 25905 self._callback("onStart"); 25906 } 25907 25908 curTime = self._time; 25909 if (curTime >= prevTime) { 25910 tween = self._first; 25911 while (tween) { 25912 next = tween._next; //record it here because the value could change after rendering... 25913 if (curTime !== self._time || (self._paused && !prevPaused)) { //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete 25914 break; 25915 } else if (tween._active || (tween._startTime <= curTime && !tween._paused && !tween._gc)) { 25916 if (pauseTween === tween) { 25917 self.pause(); 25918 self._pauseTime = pauseTime; //so that when we resume(), it's starting from exactly the right spot (the pause() method uses the rawTime for the parent, but that may be a bit too far ahead) 25919 } 25920 if (!tween._reversed) { 25921 tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); 25922 } else { 25923 tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); 25924 } 25925 } 25926 tween = next; 25927 } 25928 } else { 25929 tween = self._last; 25930 while (tween) { 25931 next = tween._prev; //record it here because the value could change after rendering... 25932 if (curTime !== self._time || (self._paused && !prevPaused)) { //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete 25933 break; 25934 } else if (tween._active || (tween._startTime <= prevTime && !tween._paused && !tween._gc)) { 25935 if (pauseTween === tween) { 25936 pauseTween = tween._prev; //the linked list is organized by _startTime, thus it's possible that a tween could start BEFORE the pause and end after it, in which case it would be positioned before the pause tween in the linked list, but we should render it before we pause() the timeline and cease rendering. This is only a concern when going in reverse. 25937 while (pauseTween && pauseTween.endTime() > self._time) { 25938 pauseTween.render( (pauseTween._reversed ? pauseTween.totalDuration() - ((time - pauseTween._startTime) * pauseTween._timeScale) : (time - pauseTween._startTime) * pauseTween._timeScale), suppressEvents, force); 25939 pauseTween = pauseTween._prev; 25940 } 25941 pauseTween = null; 25942 self.pause(); 25943 self._pauseTime = pauseTime; //so that when we resume(), it's starting from exactly the right spot (the pause() method uses the rawTime for the parent, but that may be a bit too far ahead) 25944 } 25945 if (!tween._reversed) { 25946 tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); 25947 } else { 25948 tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); 25949 } 25950 } 25951 tween = next; 25952 } 25953 } 25954 25955 if (self._onUpdate) if (!suppressEvents) { 25956 if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onUpdate on a timeline that reports/checks tweened values. 25957 _lazyRender(); 25958 }
25959 self._callback("onUpdate"); 25960 } 25961 25962 if (callback) if (!self._gc) if (prevStart === self._startTime || prevTimeScale !== self._timeScale) if (self._time === 0 || totalDur >= self.totalDuration()) { //if one of the tweens that was rendered altered this timeline's startTime (like if an onComplete reversed the timeline), it probably isn't complete. If it is, don't worry, because whatever call altered the startTime would complete if it was necessary at the new time. The only exception is the timeScale property. Also check _gc because there's a chance that kill() could be called in an onUpdate 25963 if (isComplete) { 25964 if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onComplete on a timeline that reports/checks tweened values. 25965 _lazyRender(); 25966 } 25967 if (self._timeline.autoRemoveChildren) { 25968 self._enabled(false, false); 25969 } 25970 self._active = false; 25971 } 25972 if (!suppressEvents && self.vars[callback]) { 25973 self._callback(callback); 25974 } 25975 } 25976 }; 25977 25978 p._hasPausedChild = function() { 25979 var tween = this._first; 25980 while (tween) { 25981 if (tween._paused || ((tween instanceof TimelineLite) && tween._hasPausedChild())) { 25982 return true; 25983 } 25984 tween = tween._next; 25985 } 25986 return false; 25987 }; 25988 25989 p.getChildren = function(nested, tweens, timelines, ignoreBeforeTime) { 25990 ignoreBeforeTime = ignoreBeforeTime || -9999999999; 25991 var a = [], 25992 tween = this._first, 25993 cnt = 0; 25994 while (tween) { 25995 if (tween._startTime < ignoreBeforeTime) { 25996 //do nothing 25997 } else if (tween instanceof TweenLite) { 25998 if (tweens !== false) { 25999 a[cnt++] = tween; 26000 } 26001 } else { 26002 if (timelines !== false) { 26003 a[cnt++] = tween; 26004 } 26005 if (nested !== false) { 26006 a = a.concat(tween.getChildren(true, tweens, timelines)); 26007 cnt = a.length; 26008 } 26009 } 26010 tween = tween._next; 26011 } 26012 return a; 26013 }; 26014 26015 p.getTweensOf = function(target, nested) { 26016 var disabled = this._gc, 26017 a = [], 26018 cnt = 0, 26019 tweens, i; 26020 if (disabled) { 26021 this._enabled(true, true); //getTweensOf() filters out disabled tweens, and we have to mark them as _gc = true when the timeline completes in order to allow clean garbage collection, so temporarily re-enable the timeline here. 26022 } 26023 tweens = TweenLite.getTweensOf(target); 26024 i = tweens.length; 26025 while (--i > -1) { 26026 if (tweens[i].timeline === this || (nested && this._contains(tweens[i]))) { 26027 a[cnt++] = tweens[i]; 26028 } 26029 } 26030 if (disabled) { 26031 this._enabled(false, true); 26032 } 26033 return a; 26034 }; 26035 26036 p.recent = function() { 26037 return this._recent; 26038 }; 26039 26040 p._contains = function(tween) { 26041 var tl = tween.timeline; 26042 while (tl) { 26043 if (tl === this) { 26044 return true; 26045 } 26046 tl = tl.timeline; 26047 } 26048 return false; 26049 }; 26050 26051 p.shiftChildren = function(amount, adjustLabels, ignoreBeforeTime) { 26052 ignoreBeforeTime = ignoreBeforeTime || 0; 26053 var tween = this._first, 26054 labels = this._labels, 26055 p; 26056 while (tween) { 26057 if (tween._startTime >= ignoreBeforeTime) { 26058 tween._startTime += amount; 26059 } 26060 tween = tween._next; 26061 } 26062 if (adjustLabels) { 26063 for (p in labels) { 26064 if (labels[p] >= ignoreBeforeTime) { 26065 labels[p] += amount; 26066 } 26067 } 26068 } 26069 return this._uncache(true); 26070 }; 26071 26072 p._kill = function(vars, target) { 26073 if (!vars && !target) { 26074 return this._enabled(false, false); 26075 } 26076 var tweens = (!target) ? this.getChildren(true, true, false) : this.getTweensOf(target), 26077 i = tweens.length, 26078 changed = false; 26079 while (--i > -1) { 26080 if (tweens[i]._kill(vars, target)) { 26081 changed = true; 26082 } 26083 } 26084 return changed; 26085 }; 26086 26087 p.clear = function(labels) { 26088 var tweens = this.getChildren(false, true, true), 26089 i = tweens.length; 26090 this._time = this._totalTime = 0; 26091 while (--i > -1) { 26092 tweens[i]._enabled(false, false); 26093 } 26094 if (labels !== false) { 26095 this._labels = {}; 26096 } 26097 return this._uncache(true); 26098 }; 26099 26100 p.invalidate = function() { 26101 var tween = this._first; 26102 while (tween) { 26103 tween.invalidate(); 26104 tween = tween._next; 26105 } 26106 return Animation.prototype.invalidate.call(this);; 26107 }; 26108 26109 p._enabled = function(enabled, ignoreTimeline) { 26110 if (enabled === this._gc) { 26111 var tween = this._first; 26112 while (tween) { 26113 tween._enabled(enabled, true); 26114 tween = tween._next; 26115 } 26116 } 26117 return SimpleTimeline.prototype._enabled.call(this, enabled, ignoreTimeline); 26118 }; 26119 26120 p.totalTime = function(time, suppressEvents, uncapped) { 26121 this._forcingPlayhead = true; 26122 var val = Animation.prototype.totalTime.apply(this, arguments); 26123 this._forcingPlayhead = false;
26124 return val; 26125 }; 26126 26127 p.duration = function(value) { 26128 if (!arguments.length) { 26129 if (this._dirty) { 26130 this.totalDuration(); //just triggers recalculation 26131 } 26132 return this._duration; 26133 } 26134 if (this.duration() !== 0 && value !== 0) { 26135 this.timeScale(this._duration / value); 26136 } 26137 return this; 26138 }; 26139 26140 p.totalDuration = function(value) { 26141 if (!arguments.length) { 26142 if (this._dirty) { 26143 var max = 0, 26144 self = this, 26145 tween = self._last, 26146 prevStart = 999999999999, 26147 prev, end; 26148 while (tween) { 26149 prev = tween._prev; //record it here in case the tween changes position in the sequence... 26150 if (tween._dirty) { 26151 tween.totalDuration(); //could change the tween._startTime, so make sure the tween's cache is clean before analyzing it. 26152 } 26153 if (tween._startTime > prevStart && self._sortChildren && !tween._paused && !self._calculatingDuration) { //in case one of the tweens shifted out of order, it needs to be re-inserted into the correct position in the sequence 26154 self._calculatingDuration = 1; //prevent endless recursive calls - there are methods that get triggered that check duration/totalDuration when we add(), like _parseTimeOrLabel(). 26155 self.add(tween, tween._startTime - tween._delay); 26156 self._calculatingDuration = 0; 26157 } else { 26158 prevStart = tween._startTime; 26159 } 26160 if (tween._startTime < 0 && !tween._paused) { //children aren't allowed to have negative startTimes unless smoothChildTiming is true, so adjust here if one is found. 26161 max -= tween._startTime; 26162 if (self._timeline.smoothChildTiming) { 26163 self._startTime += tween._startTime / self._timeScale; 26164 self._time -= tween._startTime; 26165 self._totalTime -= tween._startTime; 26166 self._rawPrevTime -= tween._startTime; 26167 } 26168 self.shiftChildren(-tween._startTime, false, -9999999999); 26169 prevStart = 0; 26170 } 26171 end = tween._startTime + (tween._totalDuration / tween._timeScale); 26172 if (end > max) { 26173 max = end; 26174 } 26175 tween = prev; 26176 } 26177 self._duration = self._totalDuration = max; 26178 self._dirty = false; 26179 } 26180 return this._totalDuration; 26181 } 26182 return (value && this.totalDuration()) ? this.timeScale(this._totalDuration / value) : this; 26183 }; 26184 26185 p.paused = function(value) { 26186 if (value === false && this._paused) { //if there's a pause directly at the spot from where we're unpausing, skip it. 26187 var tween = this._first; 26188 while (tween) { 26189 if (tween._startTime === this._time && tween.data === "isPause") { 26190 tween._rawPrevTime = 0; //remember, _rawPrevTime is how zero-duration tweens/callbacks sense directionality and determine whether or not to fire. If _rawPrevTime is the same as _startTime on the next render, it won't fire. 26191 } 26192 tween = tween._next; 26193 } 26194 } 26195 return Animation.prototype.paused.apply(this, arguments); 26196 }; 26197 26198 p.usesFrames = function() { 26199 var tl = this._timeline; 26200 while (tl._timeline) { 26201 tl = tl._timeline; 26202 } 26203 return (tl === Animation._rootFramesTimeline); 26204 }; 26205 26206 p.rawTime = function(wrapRepeats) { 26207 return (wrapRepeats && (this._paused || (this._repeat && this.time() > 0 && this.totalProgress() < 1))) ? this._totalTime % (this._duration + this._repeatDelay) : this._paused ? this._totalTime : (this._timeline.rawTime(wrapRepeats) - this._startTime) * this._timeScale; 26208 }; 26209 26210 return TimelineLite; 26211 26212 }, true); 26213 26214 26215 26216 26217 26218 26219 26220 26221 26222 26223 26224 26225 26226 /* 26227 * ---------------------------------------------------------------- 26228 * TimelineMax 26229 * ---------------------------------------------------------------- 26230 */ 26231 _gsScope._gsDefine("TimelineMax", ["TimelineLite","TweenLite","easing.Ease"], function(TimelineLite, TweenLite, Ease) { 26232 26233 var TimelineMax = function(vars) { 26234 TimelineLite.call(this, vars); 26235 this._repeat = this.vars.repeat || 0; 26236 this._repeatDelay = this.vars.repeatDelay || 0; 26237 this._cycle = 0; 26238 this._yoyo = !!this.vars.yoyo; 26239 this._dirty = true; 26240 }, 26241 _tinyNum = 0.00000001, 26242 TweenLiteInternals = TweenLite._internals, 26243 _lazyTweens = TweenLiteInternals.lazyTweens, 26244 _lazyRender = TweenLiteInternals.lazyRender, 26245 _globals = _gsScope._gsDefine.globals,
26246 _easeNone = new Ease(null, null, 1, 0), 26247 p = TimelineMax.prototype = new TimelineLite(); 26248 26249 p.constructor = TimelineMax; 26250 p.kill()._gc = false; 26251 TimelineMax.version = "2.1.3"; 26252 26253 p.invalidate = function() { 26254 this._yoyo = !!this.vars.yoyo; 26255 this._repeat = this.vars.repeat || 0; 26256 this._repeatDelay = this.vars.repeatDelay || 0; 26257 this._uncache(true); 26258 return TimelineLite.prototype.invalidate.call(this); 26259 }; 26260 26261 p.addCallback = function(callback, position, params, scope) { 26262 return this.add( TweenLite.delayedCall(0, callback, params, scope), position); 26263 }; 26264 26265 p.removeCallback = function(callback, position) { 26266 if (callback) { 26267 if (position == null) { 26268 this._kill(null, callback); 26269 } else { 26270 var a = this.getTweensOf(callback, false), 26271 i = a.length, 26272 time = this._parseTimeOrLabel(position); 26273 while (--i > -1) { 26274 if (a[i]._startTime === time) { 26275 a[i]._enabled(false, false); 26276 } 26277 } 26278 } 26279 } 26280 return this; 26281 }; 26282 26283 p.removePause = function(position) { 26284 return this.removeCallback(TimelineLite._internals.pauseCallback, position); 26285 }; 26286 26287 p.tweenTo = function(position, vars) { 26288 vars = vars || {}; 26289 var copy = {ease:_easeNone, useFrames:this.usesFrames(), immediateRender:false, lazy:false}, 26290 Engine = (vars.repeat && _globals.TweenMax) || TweenLite, 26291 duration, p, t; 26292 for (p in vars) { 26293 copy[p] = vars[p]; 26294 } 26295 copy.time = this._parseTimeOrLabel(position); 26296 duration = (Math.abs(Number(copy.time) - this._time) / this._timeScale) || 0.001; 26297 t = new Engine(this, duration, copy); 26298 copy.onStart = function() { 26299 t.target.paused(true); 26300 if (t.vars.time !== t.target.time() && duration === t.duration() && !t.isFromTo) { //don't make the duration zero - if it's supposed to be zero, don't worry because it's already initting the tween and will complete immediately, effectively making the duration zero anyway. If we make duration zero, the tween won't run at all. 26301 t.duration( Math.abs( t.vars.time - t.target.time()) / t.target._timeScale ).render(t.time(), true, true); //render() right away to ensure that things look right, especially in the case of .tweenTo(0). 26302 } 26303 if (vars.onStart) { //in case the user had an onStart in the vars - we don't want to overwrite it. 26304 vars.onStart.apply(vars.onStartScope || vars.callbackScope || t, vars.onStartParams || []); //don't use t._callback("onStart") or it'll point to the copy.onStart and we'll get a recursion error. 26305 } 26306 }; 26307 return t; 26308 }; 26309 26310 p.tweenFromTo = function(fromPosition, toPosition, vars) { 26311 vars = vars || {}; 26312 fromPosition = this._parseTimeOrLabel(fromPosition); 26313 vars.startAt = {onComplete:this.seek, onCompleteParams:[fromPosition], callbackScope:this}; 26314 vars.immediateRender = (vars.immediateRender !== false); 26315 var t = this.tweenTo(toPosition, vars); 26316 t.isFromTo = 1; //to ensure we don't mess with the duration in the onStart (we've got the start and end values here, so lock it in) 26317 return t.duration((Math.abs( t.vars.time - fromPosition) / this._timeScale) || 0.001); 26318 }; 26319 26320 p.render = function(time, suppressEvents, force) { 26321 if (this._gc) { 26322 this._enabled(true, false); 26323 } 26324 var self = this, 26325 prevTime = self._time, 26326 totalDur = (!self._dirty) ? self._totalDuration : self.totalDuration(), 26327 dur = self._duration, 26328 prevTotalTime = self._totalTime, 26329 prevStart = self._startTime, 26330 prevTimeScale = self._timeScale, 26331 prevRawPrevTime = self._rawPrevTime, 26332 prevPaused = self._paused, 26333 prevCycle = self._cycle, 26334 tween, isComplete, next, callback, internalForce, cycleDuration, pauseTween, curTime, pauseTime; 26335 if (prevTime !== self._time) { //if totalDuration() finds a child with a negative startTime and smoothChildTiming is true, things get shifted around internally so we need to adjust the time accordingly. For example, if a tween starts at -30 we must shift EVERYTHING forward 30 seconds and move this timeline's startTime backward by 30 seconds so that things align with the playhead (no jump). 26336 time += self._time - prevTime; 26337 } 26338 if (time >= totalDur - _tinyNum && time >= 0) { //to work around occasional floating point math artifacts. 26339 if (!self._locked) { 26340 self._totalTime = totalDur; 26341 self._cycle = self._repeat; 26342 } 26343 if (!self._reversed) if (!self._hasPausedChild()) { 26344 isComplete = true; 26345 callback = "onComplete"; 26346 internalForce = !!self._timeline.autoRemoveChildren; //otherwise, if the animation is unpaused/activated after it's already finished, it doesn't get removed from the parent timeline. 26347 if (self._duration === 0) if ((time <= 0 && time >= -_tinyNum) || prevRawPrevTime < 0 || prevRawPrevTime === _tinyNum) if (prevRawPrevTime !== time && self._first) { 26348 internalForce = true; 26349 if (prevRawPrevTime > _tinyNum) { 26350 callback = "onReverseComplete"; 26351 } 26352 } 26353 } 26354 self._rawPrevTime = (self._duration || !suppressEvents || time || self._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. 26355 if (self._yoyo && (self._cycle & 1)) { 26356 self._time = time = 0; 26357 } else { 26358 self._time = dur; 26359 time = dur + 0.0001; //to avoid occasional floating point rounding errors - sometimes child tweens/timelines were not being fully completed (their progress might be 0.999999999999998 instead of 1 because when _time - tween._startTime is performed, floating point errors would return a value that was SLIGHTLY off). Try (999999999999.7 - 999999999999) * 1 = 0.699951171875 instead of 0.7. We cannot do less then 0.0001 because the same issue can occur when the duration is extremely large like 999999999999 in
26359which case adding 0.00000001, for example, causes it to act like nothing was added. 26360 } 26361 26362 } else if (time < _tinyNum) { //to work around occasional floating point math artifacts, round super small values to 0. 26363 if (!self._locked) { 26364 self._totalTime = self._cycle = 0; 26365 } 26366 self._time = 0; 26367 if (time > -_tinyNum) { 26368 time = 0; 26369 } 26370 if (prevTime !== 0 || (dur === 0 && prevRawPrevTime !== _tinyNum && (prevRawPrevTime > 0 || (time < 0 && prevRawPrevTime >= 0)) && !self._locked)) { //edge case for checking time < 0 && prevRawPrevTime >= 0: a zero-duration fromTo() tween inside a zero-duration timeline (yeah, very rare) 26371 callback = "onReverseComplete"; 26372 isComplete = self._reversed; 26373 } 26374 if (time < 0) { 26375 self._active = false; 26376 if (self._timeline.autoRemoveChildren && self._reversed) { 26377 internalForce = isComplete = true; 26378 callback = "onReverseComplete"; 26379 } else if (prevRawPrevTime >= 0 && self._first) { //when going back beyond the start, force a render so that zero-duration tweens that sit at the very beginning render their start values properly. Otherwise, if the parent timeline's playhead lands exactly at this timeline's startTime, and then moves backwards, the zero-duration tweens at the beginning would still be at their end state. 26380 internalForce = true; 26381 } 26382 self._rawPrevTime = time; 26383 } else { 26384 self._rawPrevTime = (dur || !suppressEvents || time || self._rawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration timeline or tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. 26385 if (time === 0 && isComplete) { //if there's a zero-duration tween at the very beginning of a timeline and the playhead lands EXACTLY at time 0, that tween will correctly render its end values, but we need to keep the timeline alive for one more render so that the beginning values render properly as the parent's playhead keeps moving beyond the begining. Imagine obj.x starts at 0 and then we do tl.set(obj, {x:100}).to(obj, 1, {x:200}) and then later we tl.reverse()...the goal is to have obj.x revert to 0. If the playhead happens to land on exactly 0, without this chunk of code, it'd complete the timeline and remove it from the rendering queue (not good). 26386 tween = self._first; 26387 while (tween && tween._startTime === 0) { 26388 if (!tween._duration) { 26389 isComplete = false; 26390 } 26391 tween = tween._next; 26392 } 26393 } 26394 time = 0; //to avoid occasional floating point rounding errors (could cause problems especially with zero-duration tweens at the very beginning of the timeline) 26395 if (!self._initted) { 26396 internalForce = true; 26397 } 26398 } 26399 26400 } else { 26401 if (dur === 0 && prevRawPrevTime < 0) { //without this, zero-duration repeating timelines (like with a simple callback nested at the very beginning and a repeatDelay) wouldn't render the first time through. 26402 internalForce = true; 26403 } 26404 self._time = self._rawPrevTime = time; 26405 if (!self._locked) { 26406 self._totalTime = time; 26407 if (self._repeat !== 0) { 26408 cycleDuration = dur + self._repeatDelay; 26409 self._cycle = (self._totalTime / cycleDuration) >> 0; //originally _totalTime % cycleDuration but floating point errors caused problems, so I normalized it. (4 % 0.8 should be 0 but it gets reported as 0.79999999!) 26410 if (self._cycle) if (self._cycle === self._totalTime / cycleDuration && prevTotalTime <= time) { 26411 self._cycle--; //otherwise when rendered exactly at the end time, it will act as though it is repeating (at the beginning) 26412 } 26413 self._time = self._totalTime - (self._cycle * cycleDuration); 26414 if (self._yoyo) if (self._cycle & 1) { 26415 self._time = dur - self._time; 26416 } 26417 if (self._time > dur) { 26418 self._time = dur; 26419 time = dur + 0.0001; //to avoid occasional floating point rounding error 26420 } else if (self._time < 0) { 26421 self._time = time = 0; 26422 } else { 26423 time = self._time; 26424 } 26425 } 26426 } 26427 } 26428 26429 if (self._hasPause && !self._forcingPlayhead && !suppressEvents) { 26430 time = self._time; 26431 if (time > prevTime || (self._repeat && prevCycle !== self._cycle)) { 26432 tween = self._first; 26433 while (tween && tween._startTime <= time && !pauseTween) { 26434 if (!tween._duration) if (tween.data === "isPause" && !tween.ratio && !(tween._startTime === 0 && self._rawPrevTime === 0)) { 26435 pauseTween = tween; 26436 } 26437 tween = tween._next; 26438 } 26439 } else { 26440 tween = self._last; 26441 while (tween && tween._startTime >= time && !pauseTween) { 26442 if (!tween._duration) if (tween.data === "isPause" && tween._rawPrevTime > 0) { 26443 pauseTween = tween; 26444 } 26445 tween = tween._prev; 26446 } 26447 } 26448 if (pauseTween) { 26449 pauseTime = self._startTime + (self._reversed ? self._duration - pauseTween._startTime : pauseTween._startTime) / self._timeScale; 26450 if (pauseTween._startTime < dur) { 26451 self._time = self._rawPrevTime = time = pauseTween._startTime; 26452 self._totalTime = time + (self._cycle * (self._totalDuration + self._repeatDelay)); 26453 } 26454 } 26455 } 26456 26457 if (self._cycle !== prevCycle) if (!self._locked) { 26458 /* 26459 make sure children at the end/beginning of the timeline are rendered properly. If, for example, 26460 a 3-second long timeline rendered at 2.9 seconds previously, and now renders at 3.2 seconds (which
26461 would get translated to 2.8 seconds if the timeline yoyos or 0.2 seconds if it just repeats), there 26462 could be a callback or a short tween that's at 2.95 or 3 seconds in which wouldn't render. So 26463 we need to push the timeline to the end (and/or beginning depending on its yoyo value). Also we must 26464 ensure that zero-duration tweens at the very beginning or end of the TimelineMax work. 26465 */ 26466 var backwards = (self._yoyo && (prevCycle & 1) !== 0), 26467 wrap = (backwards === (self._yoyo && (self._cycle & 1) !== 0)), 26468 recTotalTime = self._totalTime, 26469 recCycle = self._cycle, 26470 recRawPrevTime = self._rawPrevTime, 26471 recTime = self._time; 26472 26473 self._totalTime = prevCycle * dur; 26474 if (self._cycle < prevCycle) { 26475 backwards = !backwards; 26476 } else { 26477 self._totalTime += dur; 26478 } 26479 self._time = prevTime; //temporarily revert _time so that render() renders the children in the correct order. Without this, tweens won't rewind correctly. We could arhictect things in a "cleaner" way by splitting out the rendering queue into a separate method but for performance reasons, we kept it all inside this method. 26480 26481 self._rawPrevTime = (dur === 0) ? prevRawPrevTime - 0.0001 : prevRawPrevTime; 26482 self._cycle = prevCycle; 26483 self._locked = true; //prevents changes to totalTime and skips repeat/yoyo behavior when we recursively call render() 26484 prevTime = (backwards) ? 0 : dur; 26485 self.render(prevTime, suppressEvents, (dur === 0)); 26486 if (!suppressEvents) if (!self._gc) { 26487 if (self.vars.onRepeat) { 26488 self._cycle = recCycle; //in case the onRepeat alters the playhead or invalidates(), we shouldn't stay locked or use the previous cycle. 26489 self._locked = false; 26490 self._callback("onRepeat"); 26491 } 26492 } 26493 if (prevTime !== self._time) { //in case there's a callback like onComplete in a nested tween/timeline that changes the playhead position, like via seek(), we should just abort. 26494 return; 26495 } 26496 if (wrap) { 26497 self._cycle = prevCycle; //if there's an onRepeat, we reverted this above, so make sure it's set properly again. We also unlocked in that scenario, so reset that too. 26498 self._locked = true; 26499 prevTime = (backwards) ? dur + 0.0001 : -0.0001; 26500 self.render(prevTime, true, false); 26501 } 26502 self._locked = false; 26503 if (self._paused && !prevPaused) { //if the render() triggered callback that paused this timeline, we should abort (very rare, but possible) 26504 return; 26505 } 26506 self._time = recTime; 26507 self._totalTime = recTotalTime; 26508 self._cycle = recCycle; 26509 self._rawPrevTime = recRawPrevTime; 26510 } 26511 26512 if ((self._time === prevTime || !self._first) && !force && !internalForce && !pauseTween) { 26513 if (prevTotalTime !== self._totalTime) if (self._onUpdate) if (!suppressEvents) { //so that onUpdate fires even during the repeatDelay - as long as the totalTime changed, we should trigger onUpdate. 26514 self._callback("onUpdate"); 26515 } 26516 return; 26517 } else if (!self._initted) { 26518 self._initted = true; 26519 } 26520 26521 if (!self._active) if (!self._paused && self._totalTime !== prevTotalTime && time > 0) { 26522 self._active = true; //so that if the user renders the timeline (as opposed to the parent timeline rendering it), it is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the timeline already finished but the user manually re-renders it as halfway done, for example. 26523 } 26524 26525 if (prevTotalTime === 0) if (self.vars.onStart) if (self._totalTime !== 0 || !self._totalDuration) if (!suppressEvents) { 26526 self._callback("onStart"); 26527 } 26528 26529 curTime = self._time; 26530 if (curTime >= prevTime) { 26531 tween = self._first; 26532 while (tween) { 26533 next = tween._next; //record it here because the value could change after rendering... 26534 if (curTime !== self._time || (self._paused && !prevPaused)) { //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete 26535 break; 26536 } else if (tween._active || (tween._startTime <= self._time && !tween._paused && !tween._gc)) { 26537 if (pauseTween === tween) { 26538 self.pause(); 26539 self._pauseTime = pauseTime; //so that when we resume(), it's starting from exactly the right spot (the pause() method uses the rawTime for the parent, but that may be a bit too far ahead) 26540 } 26541 if (!tween._reversed) { 26542 tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); 26543 } else { 26544 tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); 26545 } 26546 } 26547 tween = next; 26548 } 26549 } else { 26550 tween = self._last; 26551 while (tween) { 26552 next = tween._prev; //record it here because the value could change after rendering... 26553 if (curTime !== self._time || (self._paused && !prevPaused)) { //in case a tween pauses or seeks the timeline when rendering, like inside of an onUpdate/onComplete 26554 break; 26555 } else if (tween._active || (tween._startTime <= prevTime && !tween._paused && !tween._gc)) { 26556 if (pauseTween === tween) { 26557 pauseTween = tween._prev; //the linked list is organized by _startTime, thus it's possible that a tween could start BEFORE the pause and end after it, in which case it would be positioned before the pause tween in the linked list, but we should render it before we pause() the timeline and cease rendering. This is only a concern when going in reverse. 26558 while (pauseTween && pauseTween.endTime() > self._time) { 26559 pauseTween.render( (pauseTween._reversed ? pauseTween.totalDuration() - ((time - pauseTween._startTime) * pauseTween._timeScale) : (time - pauseTween._startTime) * pauseTween._timeScale), suppressEvents, force); 26560 pauseTween = pauseTween._prev; 26561 } 26562 pauseTween = null; 26563 self.pause(); 26564 self._pauseTime = pauseTime; //so that when we resume(), it's starting from exactly the right spot (the pause() method uses the rawTime for the parent, but that may be a bit too far ahead) 26565 } 26566 if (!tween._reversed) { 26567 tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); 26568 } else { 26569 tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); 26570 } 26571 } 26572 tween = next; 26573 } 26574 } 26575 26576 if (self._onUpdate) if (!suppressEvents) { 26577 if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onUpdate on a timeline that reports/checks tweened values. 26578 _lazyRender(); 26579 }
26580 self._callback("onUpdate"); 26581 } 26582 if (callback) if (!self._locked) if (!self._gc) if (prevStart === self._startTime || prevTimeScale !== self._timeScale) if (self._time === 0 || totalDur >= self.totalDuration()) { //if one of the tweens that was rendered altered this timeline's startTime (like if an onComplete reversed the timeline), it probably isn't complete. If it is, don't worry, because whatever call altered the startTime would complete if it was necessary at the new time. The only exception is the timeScale property. Also check _gc because there's a chance that kill() could be called in an onUpdate 26583 if (isComplete) { 26584 if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when a timeline finishes, users expect things to have rendered fully. Imagine an onComplete on a timeline that reports/checks tweened values. 26585 _lazyRender(); 26586 } 26587 if (self._timeline.autoRemoveChildren) { 26588 self._enabled(false, false); 26589 } 26590 self._active = false; 26591 } 26592 if (!suppressEvents && self.vars[callback]) { 26593 self._callback(callback); 26594 } 26595 } 26596 }; 26597 26598 p.getActive = function(nested, tweens, timelines) { 26599 var a = [], 26600 all = this.getChildren(nested || (nested == null), tweens || (nested == null), !!timelines), 26601 cnt = 0, 26602 l = all.length, 26603 i, tween; 26604 for (i = 0; i < l; i++) { 26605 tween = all[i]; 26606 if (tween.isActive()) { 26607 a[cnt++] = tween; 26608 } 26609 } 26610 return a; 26611 }; 26612 26613 26614 p.getLabelAfter = function(time) { 26615 if (!time) if (time !== 0) { //faster than isNan() 26616 time = this._time; 26617 } 26618 var labels = this.getLabelsArray(), 26619 l = labels.length, 26620 i; 26621 for (i = 0; i < l; i++) { 26622 if (labels[i].time > time) { 26623 return labels[i].name; 26624 } 26625 } 26626 return null; 26627 }; 26628 26629 p.getLabelBefore = function(time) { 26630 if (time == null) { 26631 time = this._time; 26632 } 26633 var labels = this.getLabelsArray(), 26634 i = labels.length; 26635 while (--i > -1) { 26636 if (labels[i].time < time) { 26637 return labels[i].name; 26638 } 26639 } 26640 return null; 26641 }; 26642 26643 p.getLabelsArray = function() { 26644 var a = [], 26645 cnt = 0, 26646 p; 26647 for (p in this._labels) { 26648 a[cnt++] = {time:this._labels[p], name:p}; 26649 } 26650 a.sort(function(a,b) { 26651 return a.time - b.time; 26652 }); 26653 return a; 26654 }; 26655 26656 p.invalidate = function() { 26657 this._locked = false; //unlock and set cycle in case invalidate() is called from inside an onRepeat 26658 return TimelineLite.prototype.invalidate.call(this); 26659 }; 26660 26661 26662 //---- GETTERS / SETTERS ------------------------------------------------------------------------------------------------------- 26663 26664 p.progress = function(value, suppressEvents) { 26665 return (!arguments.length) ? (this._time / this.duration()) || 0 : this.totalTime( this.duration() * ((this._yoyo && (this._cycle & 1) !== 0) ? 1 - value : value) + (this._cycle * (this._duration + this._repeatDelay)), suppressEvents); 26666 }; 26667 26668 p.totalProgress = function(value, suppressEvents) { 26669 return (!arguments.length) ? (this._totalTime / this.totalDuration()) || 0 : this.totalTime( this.totalDuration() * value, suppressEvents); 26670 }; 26671 26672 p.totalDuration = function(value) { 26673 if (!arguments.length) { 26674 if (this._dirty) { 26675 TimelineLite.prototype.totalDuration.call(this); //just forces refresh 26676 //Instead of Infinity, we use 999999999999 so that we can accommodate reverses. 26677 this._totalDuration = (this._repeat === -1) ? 999999999999 : this._duration * (this._repeat + 1) + (this._repeatDelay * this._repeat); 26678 } 26679 return this._totalDuration; 26680 } 26681 return (this._repeat === -1 || !value) ? this : this.timeScale( this.totalDuration() / value ); 26682 }; 26683 26684 p.time = function(value, suppressEvents) { 26685 if (!arguments.length) { 26686 return this._time; 26687 } 26688 if (this._dirty) { 26689 this.totalDuration(); 26690 } 26691 var duration = this._duration, 26692 cycle = this._cycle, 26693 cycleDur = cycle * (duration + this._repeatDelay); 26694 if (value > duration) { 26695 value = duration; 26696 } 26697 return this.totalTime((this._yoyo && (cycle & 1)) ? duration - value + cycleDur : this._repeat ? value + cycleDur : value, suppressEvents); 26698 }; 26699 26700 p.repeat = function(value) { 26701 if (!arguments.length) { 26702 return this._repeat; 26703 } 26704 this._repeat = value; 26705 return this._uncache(true); 26706 }; 26707 26708 p.repeatDelay = function(value) { 26709 if (!arguments.length) { 26710 return this._repeatDelay; 26711 } 26712 this._repeatDelay = value; 26713 return this._uncache(true); 26714 }; 26715 26716 p.yoyo = function(value) { 26717 if (!arguments.length) { 26718 return this._yoyo; 26719 } 26720 this._yoyo = value; 26721 return this; 26722 }; 26723 26724 p.currentLabel = function(value) { 26725 if (!arguments.length) { 26726 return this.getLabelBefore(this._time + _tinyNum); 26727 } 26728 return this.seek(value, true); 26729 }; 26730 26731 return TimelineMax; 26732 26733 }, true); 26734 26735 26736 26737 26738 26739 26740 26741 26742 26743 26744 26745 26746 /* 26747 * ---------------------------------------------------------------- 26748 * BezierPlugin 26749 * ---------------------------------------------------------------- 26750 */ 26751 (function() { 26752 26753 var _RAD2DEG = 180 / Math.PI, 26754 _r1 = [], 26755 _r2 = [], 26756 _r3 = [], 26757 _corProps = {}, 26758 _globals = _gsScope._gsDefine.globals, 26759 Segment = function(a, b, c, d) { 26760 if (c === d) { //if c and d match, the final autoRotate value could lock at -90 degrees, so differentiate them slightly. 26761 c = d - (d - b) / 1000000; 26762 } 26763 if (a === b) { //if a and b match, the starting autoRotate value could lock at -90 degrees, so differentiate them slightly. 26764 b = a + (c - a) / 1000000; 26765 } 26766 this.a = a; 26767 this.b = b; 26768 this.c = c; 26769 this.d = d; 26770 this.da = d - a; 26771 this.ca = c - a; 26772 this.ba = b - a; 26773 }, 26774 _correlate = ",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,", 26775 cubicToQuadratic = function(a, b, c, d) { 26776 var q1 = {a:a}, 26777 q2 = {}, 26778 q3 = {}, 26779 q4 = {c:d}, 26780 mab = (a + b) / 2, 26781 mbc = (b + c) / 2, 26782 mcd = (c + d) / 2, 26783 mabc = (mab + mbc) / 2, 26784 mbcd = (mbc + mcd) / 2, 26785 m8 = (mbcd - mabc) / 8; 26786 q1.b = mab + (a - mab) / 4; 26787 q2.b = mabc + m8; 26788 q1.c = q2.a = (q1.b + q2.b) / 2; 26789 q2.c = q3.a = (mabc + mbcd) / 2; 26790 q3.b = mbcd - m8; 26791 q4.b = mcd + (d - mcd) / 4; 26792 q3.c = q4.a = (q3.b + q4.b) / 2; 26793 return [q1, q2, q3, q4]; 26794 }, 26795 _calculateControlPoints = function(a, curviness, quad, basic, correlate) { 26796 var l = a.length - 1, 26797 ii = 0, 26798 cp1 = a[0].a, 26799 i, p1, p2, p3, seg, m1, m2, mm, cp2, qb, r1, r2, tl; 26800 for (i = 0; i < l; i++) { 26801 seg = a[ii]; 26802 p1 = seg.a; 26803 p2 = seg.d; 26804 p3 = a[ii+1].d; 26805 26806 if (correlate) { 26807 r1 = _r1[i]; 26808 r2 = _r2[i]; 26809 tl = ((r2 + r1) * curviness * 0.25) / (basic ? 0.5 : _r3[i] || 0.5); 26810 m1 = p2 - (p2 - p1) * (basic ? curviness * 0.5 : (r1 !== 0 ? tl / r1 : 0)); 26811 m2 = p2 + (p3 - p2) * (basic ? curviness * 0.5 : (r2 !== 0 ? tl / r2 : 0)); 26812 mm = p2 - (m1 + (((m2 - m1) * ((r1 * 3 / (r1 + r2)) + 0.5) / 4) || 0)); 26813 } else { 26814 m1 = p2 - (p2 - p1) * curviness * 0.5; 26815 m2 = p2 + (p3 - p2) * curviness * 0.5; 26816 mm = p2 - (m1 + m2) / 2; 26817 } 26818 m1 += mm; 26819 m2 += mm; 26820 26821 seg.c = cp2 = m1; 26822 if (i !== 0) { 26823 seg.b = cp1; 26824 } else { 26825 seg.b = cp1 = seg.a + (seg.c - seg.a) * 0.6; //instead of placing b on a exactly, we move it inline with c so that if the user specifies an ease like Back.easeIn or Elastic.easeIn which goes BEYOND the beginning, it will do so smoothly. 26826 } 26827 26828 seg.da = p2 - p1; 26829 seg.ca = cp2 - p1; 26830 seg.ba = cp1 - p1; 26831 26832 if (quad) { 26833 qb = cubicToQuadratic(p1, cp1, cp2, p2); 26834 a.splice(ii, 1, qb[0], qb[1], qb[2], qb[3]); 26835 ii += 4; 26836 } else { 26837 ii++; 26838 } 26839 26840 cp1 = m2; 26841 } 26842 seg = a[ii]; 26843 seg.b = cp1; 26844 seg.c = cp1 + (seg.d - cp1) * 0.4; //instead of placing c on d exactly, we move it inline with b so that if the user specifies an ease like Back.easeOut or Elastic.easeOut which goes BEYOND the end, it will do so smoothly. 26845 seg.da = seg.d - seg.a; 26846 seg.ca = seg.c - seg.a; 26847 seg.ba = cp1 - seg.a; 26848 if (quad) { 26849 qb = cubicToQuadratic(seg.a, cp1, seg.c, seg.d); 26850 a.splice(ii, 1, qb[0], qb[1], qb[2], qb[3]); 26851 } 26852 }, 26853 _parseAnchors = function(values, p, correlate, prepend) { 26854 var a = [], 26855 l, i, p1, p2, p3, tmp; 26856 if (prepend) {
26857 values = [prepend].concat(values); 26858 i = values.length; 26859 while (--i > -1) { 26860 if (typeof( (tmp = values[i][p]) ) === "string") if (tmp.charAt(1) === "=") { 26861 values[i][p] = prepend[p] + Number(tmp.charAt(0) + tmp.substr(2)); //accommodate relative values. Do it inline instead of breaking it out into a function for speed reasons 26862 } 26863 } 26864 } 26865 l = values.length - 2; 26866 if (l < 0) { 26867 a[0] = new Segment(values[0][p], 0, 0, values[0][p]); 26868 return a; 26869 } 26870 for (i = 0; i < l; i++) { 26871 p1 = values[i][p]; 26872 p2 = values[i+1][p]; 26873 a[i] = new Segment(p1, 0, 0, p2); 26874 if (correlate) { 26875 p3 = values[i+2][p]; 26876 _r1[i] = (_r1[i] || 0) + (p2 - p1) * (p2 - p1); 26877 _r2[i] = (_r2[i] || 0) + (p3 - p2) * (p3 - p2); 26878 } 26879 } 26880 a[i] = new Segment(values[i][p], 0, 0, values[i+1][p]); 26881 return a; 26882 }, 26883 bezierThrough = function(values, curviness, quadratic, basic, correlate, prepend) { 26884 var obj = {}, 26885 props = [], 26886 first = prepend || values[0], 26887 i, p, a, j, r, l, seamless, last; 26888 correlate = (typeof(correlate) === "string") ? ","+correlate+"," : _correlate; 26889 if (curviness == null) { 26890 curviness = 1; 26891 } 26892 for (p in values[0]) { 26893 props.push(p); 26894 } 26895 //check to see if the last and first values are identical (well, within 0.05). If so, make seamless by appending the second element to the very end of the values array and the 2nd-to-last element to the very beginning (we'll remove those segments later) 26896 if (values.length > 1) { 26897 last = values[values.length - 1]; 26898 seamless = true; 26899 i = props.length; 26900 while (--i > -1) { 26901 p = props[i]; 26902 if (Math.abs(first[p] - last[p]) > 0.05) { //build in a tolerance of +/-0.05 to accommodate rounding errors. 26903 seamless = false; 26904 break; 26905 } 26906 } 26907 if (seamless) { 26908 values = values.concat(); //duplicate the array to avoid contaminating the original which the user may be reusing for other tweens 26909 if (prepend) { 26910 values.unshift(prepend); 26911 } 26912 values.push(values[1]); 26913 prepend = values[values.length - 3]; 26914 } 26915 } 26916 _r1.length = _r2.length = _r3.length = 0; 26917 i = props.length; 26918 while (--i > -1) { 26919 p = props[i]; 26920 _corProps[p] = (correlate.indexOf(","+p+",") !== -1); 26921 obj[p] = _parseAnchors(values, p, _corProps[p], prepend); 26922 } 26923 i = _r1.length; 26924 while (--i > -1) { 26925 _r1[i] = Math.sqrt(_r1[i]); 26926 _r2[i] = Math.sqrt(_r2[i]); 26927 } 26928 if (!basic) { 26929 i = props.length; 26930 while (--i > -1) { 26931 if (_corProps[p]) { 26932 a = obj[props[i]]; 26933 l = a.length - 1; 26934 for (j = 0; j < l; j++) { 26935 r = (a[j+1].da / _r2[j] + a[j].da / _r1[j]) || 0; 26936 _r3[j] = (_r3[j] || 0) + r * r; 26937 } 26938 } 26939 } 26940 i = _r3.length; 26941 while (--i > -1) { 26942 _r3[i] = Math.sqrt(_r3[i]); 26943 } 26944 } 26945 i = props.length; 26946 j = quadratic ? 4 : 1; 26947 while (--i > -1) { 26948 p = props[i]; 26949 a = obj[p]; 26950 _calculateControlPoints(a, curviness, quadratic, basic, _corProps[p]); //this method requires that _parseAnchors() and _setSegmentRatios() ran first so that _r1, _r2, and _r3 values are populated for all properties 26951 if (seamless) { 26952 a.splice(0, j); 26953 a.splice(a.length - j, j); 26954 } 26955 } 26956 return obj; 26957 }, 26958 _parseBezierData = function(values, type, prepend) { 26959 type = type || "soft"; 26960 var obj = {}, 26961 inc = (type === "cubic") ? 3 : 2, 26962 soft = (type === "soft"), 26963 props = [], 26964 a, b, c, d, cur, i, j, l, p, cnt, tmp; 26965 if (soft && prepend) { 26966 values = [prepend].concat(values); 26967 } 26968 if (values == null || values.length < inc + 1) { throw "invalid Bezier data"; } 26969 for (p in values[0]) { 26970 props.push(p); 26971 } 26972 i = props.length; 26973 while (--i > -1) { 26974 p = props[i]; 26975 obj[p] = cur = []; 26976 cnt = 0; 26977 l = values.length; 26978 for (j = 0; j < l; j++) { 26979 a = (prepend == null) ? values[j][p] : (typeof( (tmp = values[j][p]) ) === "string" && tmp.charAt(1) === "=") ? prepend[p] + Number(tmp.charAt(0) + tmp.substr(2)) : Number(tmp); 26980 if (soft) if (j > 1) if (j < l - 1) { 26981 cur[cnt++] = (a + cur[cnt-2]) / 2; 26982 } 26983 cur[cnt++] = a; 26984 } 26985 l = cnt - inc + 1; 26986 cnt = 0; 26987 for (j = 0; j < l; j += inc) { 26988 a = cur[j]; 26989 b = cur[j+1]; 26990 c = cur[j+2]; 26991 d = (inc === 2) ? 0 : cur[j+3]; 26992 cur[cnt++] = tmp = (inc === 3) ? new Segment(a, b, c, d) : new Segment(a, (2 * b + a) / 3, (2 * b + c) / 3, c); 26993 } 26994 cur.length = cnt; 26995 } 26996 return obj; 26997 }, 26998 _addCubicLengths = function(a, steps, resolution) { 26999 var inc = 1 / resolution, 27000 j = a.length, 27001 d, d1, s, da, ca, ba, p, i, inv, bez, index; 27002 while (--j > -1) { 27003 bez = a[j]; 27004 s = bez.a; 27005 da = bez.d - s; 27006 ca = bez.c - s; 27007 ba = bez.b - s; 27008 d = d1 = 0; 27009 for (i = 1; i <= resolution; i++) { 27010 p = inc * i; 27011 inv = 1 - p; 27012 d = d1 - (d1 = (p * p * da + 3 * inv * (p * ca + inv * ba)) * p); 27013 index = j * resolution + i - 1; 27014 steps[index] = (steps[index] || 0) + d * d; 27015 } 27016 } 27017 }, 27018 _parseLengthData = function(obj, resolution) { 27019 resolution = resolution >> 0 || 6; 27020 var a = [], 27021 lengths = [], 27022 d = 0, 27023 total = 0, 27024 threshold = resolution - 1, 27025 segments = [], 27026 curLS = [], //current length segments array 27027 p, i, l, index; 27028 for (p in obj) { 27029 _addCubicLengths(obj[p], a, resolution); 27030 } 27031 l = a.length; 27032 for (i = 0; i < l; i++) { 27033 d += Math.sqrt(a[i]); 27034 index = i % resolution; 27035 curLS[index] = d; 27036 if (index === threshold) { 27037 total += d; 27038 index = (i / resolution) >> 0; 27039 segments[index] = curLS; 27040 lengths[index] = total; 27041 d = 0; 27042 curLS = []; 27043 } 27044 } 27045 return {length:total, lengths:lengths, segments:segments}; 27046 }, 27047 27048 27049 27050 BezierPlugin = _gsScope._gsDefine.plugin({ 27051 propName: "bezier", 27052 priority: -1, 27053 version: "1.3.9", 27054 API: 2, 27055 global:true, 27056 27057 //gets called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run. 27058 init: function(target, vars, tween) { 27059 this._target = target; 27060 if (vars instanceof Array) { 27061 vars = {values:vars}; 27062 } 27063 this._func = {}; 27064 this._mod = {}; 27065 this._props = []; 27066 this._timeRes = (vars.timeResolution == null) ? 6 : parseInt(vars.timeResolution, 10); 27067 var values = vars.values || [], 27068 first = {}, 27069 second = values[0], 27070 autoRotate = vars.autoRotate || tween.vars.orientToBezier, 27071 p, isFunc, i, j, prepend; 27072 27073 this._autoRotate = autoRotate ? (autoRotate instanceof Array) ? autoRotate : [["x","y","rotation",((autoRotate === true) ? 0 : Number(autoRotate) || 0)]] : null; 27074 for (p in second) { 27075 this._props.push(p); 27076 } 27077 27078 i = this._props.length; 27079 while (--i > -1) { 27080 p = this._props[i]; 27081 27082 this._overwriteProps.push(p); 27083 isFunc = this._func[p] = (typeof(target[p]) === "function"); 27084 first[p] = (!isFunc) ? parseFloat(target[p]) : target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ](); 27085 if (!prepend) if (first[p] !== values[0][p]) { 27086 prepend = first; 27087 } 27088 } 27089 this._beziers = (vars.type !== "cubic" && vars.type !== "quadratic" && vars.type !== "soft") ? bezierThrough(values, isNaN(vars.curviness) ? 1 : vars.curviness, false, (vars.type === "thruBasic"), vars.correlate, prepend) : _parseBezierData(values, vars.type, first); 27090 this._segCount = this._beziers[p].length; 27091 27092 if (this._timeRes) { 27093 var ld = _parseLengthData(this._beziers, this._timeRes); 27094 this._length = ld.length; 27095 this._lengths = ld.lengths; 27096 this._segments = ld.segments; 27097 this._l1 = this._li = this._s1 = this._si = 0; 27098 this._l2 = this._lengths[0]; 27099 this._curSeg = this._segments[0]; 27100 this._s2 = this._curSeg[0]; 27101 this._prec = 1 / this._curSeg.length; 27102 } 27103 27104 if ((autoRotate = this._autoRotate)) { 27105 this._initialRotations = []; 27106 if (!(autoRotate[0] instanceof Array)) { 27107 this._autoRotate = autoRotate = [autoRotate]; 27108 } 27109 i = autoRotate.length; 27110 while (--i > -1) { 27111 for (j = 0; j < 3; j++) { 27112 p = autoRotate[i][j]; 27113 this._func[p] = (typeof(target[p]) === "function") ? target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ] : false;
27114 } 27115 p = autoRotate[i][2]; 27116 this._initialRotations[i] = (this._func[p] ? this._func[p].call(this._target) : this._target[p]) || 0; 27117 this._overwriteProps.push(p); 27118 } 27119 } 27120 this._startRatio = tween.vars.runBackwards ? 1 : 0; //we determine the starting ratio when the tween inits which is always 0 unless the tween has runBackwards:true (indicating it's a from() tween) in which case it's 1. 27121 return true; 27122 }, 27123 27124 //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.) 27125 set: function(v) { 27126 var segments = this._segCount, 27127 func = this._func, 27128 target = this._target, 27129 notStart = (v !== this._startRatio), 27130 curIndex, inv, i, p, b, t, val, l, lengths, curSeg, v1; 27131 if (!this._timeRes) { 27132 curIndex = (v < 0) ? 0 : (v >= 1) ? segments - 1 : (segments * v) >> 0; 27133 t = (v - (curIndex * (1 / segments))) * segments; 27134 } else { 27135 lengths = this._lengths; 27136 curSeg = this._curSeg; 27137 v1 = v * this._length; 27138 i = this._li; 27139 //find the appropriate segment (if the currently cached one isn't correct) 27140 if (v1 > this._l2 && i < segments - 1) { 27141 l = segments - 1; 27142 while (i < l && (this._l2 = lengths[++i]) <= v1) { } 27143 this._l1 = lengths[i-1]; 27144 this._li = i; 27145 this._curSeg = curSeg = this._segments[i]; 27146 this._s2 = curSeg[(this._s1 = this._si = 0)]; 27147 } else if (v1 < this._l1 && i > 0) { 27148 while (i > 0 && (this._l1 = lengths[--i]) >= v1) { } 27149 if (i === 0 && v1 < this._l1) { 27150 this._l1 = 0; 27151 } else { 27152 i++; 27153 } 27154 this._l2 = lengths[i]; 27155 this._li = i; 27156 this._curSeg = curSeg = this._segments[i]; 27157 this._s1 = curSeg[(this._si = curSeg.length - 1) - 1] || 0; 27158 this._s2 = curSeg[this._si]; 27159 } 27160 curIndex = i; 27161 //now find the appropriate sub-segment (we split it into the number of pieces that was defined by "precision" and measured each one) 27162 v1 -= this._l1; 27163 i = this._si; 27164 if (v1 > this._s2 && i < curSeg.length - 1) { 27165 l = curSeg.length - 1; 27166 while (i < l && (this._s2 = curSeg[++i]) <= v1) { } 27167 this._s1 = curSeg[i-1]; 27168 this._si = i; 27169 } else if (v1 < this._s1 && i > 0) { 27170 while (i > 0 && (this._s1 = curSeg[--i]) >= v1) { } 27171 if (i === 0 && v1 < this._s1) { 27172 this._s1 = 0; 27173 } else { 27174 i++; 27175 } 27176 this._s2 = curSeg[i]; 27177 this._si = i; 27178 } 27179 t = (v === 1) ? 1 : ((i + (v1 - this._s1) / (this._s2 - this._s1)) * this._prec) || 0; 27180 } 27181 inv = 1 - t; 27182 27183 i = this._props.length; 27184 while (--i > -1) { 27185 p = this._props[i]; 27186 b = this._beziers[p][curIndex]; 27187 val = (t * t * b.da + 3 * inv * (t * b.ca + inv * b.ba)) * t + b.a; 27188 if (this._mod[p]) { 27189 val = this._mod[p](val, target); 27190 } 27191 if (func[p]) { 27192 target[p](val); 27193 } else { 27194 target[p] = val; 27195 } 27196 } 27197 27198 if (this._autoRotate) { 27199 var ar = this._autoRotate, 27200 b2, x1, y1, x2, y2, add, conv; 27201 i = ar.length; 27202 while (--i > -1) { 27203 p = ar[i][2]; 27204 add = ar[i][3] || 0; 27205 conv = (ar[i][4] === true) ? 1 : _RAD2DEG; 27206 b = this._beziers[ar[i][0]]; 27207 b2 = this._beziers[ar[i][1]]; 27208 27209 if (b && b2) { //in case one of the properties got overwritten. 27210 b = b[curIndex]; 27211 b2 = b2[curIndex]; 27212 27213 x1 = b.a + (b.b - b.a) * t; 27214 x2 = b.b + (b.c - b.b) * t; 27215 x1 += (x2 - x1) * t; 27216 x2 += ((b.c + (b.d - b.c) * t) - x2) * t; 27217 27218 y1 = b2.a + (b2.b - b2.a) * t; 27219 y2 = b2.b + (b2.c - b2.b) * t; 27220 y1 += (y2 - y1) * t; 27221 y2 += ((b2.c + (b2.d - b2.c) * t) - y2) * t; 27222 27223 val = notStart ? Math.atan2(y2 - y1, x2 - x1) * conv + add : this._initialRotations[i]; 27224 27225 if (this._mod[p]) { 27226 val = this._mod[p](val, target); //for modProps 27227 } 27228 27229 if (func[p]) { 27230 target[p](val); 27231 } else { 27232 target[p] = val; 27233 } 27234 } 27235 } 27236 } 27237 } 27238 }), 27239 p = BezierPlugin.prototype; 27240 27241 27242 BezierPlugin.bezierThrough = bezierThrough; 27243 BezierPlugin.cubicToQuadratic = cubicToQuadratic; 27244 BezierPlugin._autoCSS = true; //indicates that this plugin can be inserted into the "css" object using the autoCSS feature of TweenLite 27245 BezierPlugin.quadraticToCubic = function(a, b, c) { 27246 return new Segment(a, (2 * b + a) / 3, (2 * b + c) / 3, c); 27247 }; 27248 27249 BezierPlugin._cssRegister = function() { 27250 var CSSPlugin = _globals.CSSPlugin; 27251 if (!CSSPlugin) { 27252 return; 27253 } 27254 var _internals = CSSPlugin._internals, 27255 _parseToProxy = _internals._parseToProxy, 27256 _setPluginRatio = _internals._setPluginRatio, 27257 CSSPropTween = _internals.CSSPropTween; 27258 _internals._registerComplexSpecialProp("bezier", {parser:function(t, e, prop, cssp, pt, plugin) { 27259 if (e instanceof Array) { 27260 e = {values:e}; 27261 } 27262 plugin = new BezierPlugin(); 27263 var values = e.values, 27264 l = values.length - 1, 27265 pluginValues = [], 27266 v = {}, 27267 i, p, data; 27268 if (l < 0) { 27269 return pt; 27270 } 27271 for (i = 0; i <= l; i++) { 27272 data = _parseToProxy(t, values[i], cssp, pt, plugin, (l !== i)); 27273 pluginValues[i] = data.end; 27274 } 27275 for (p in e) { 27276 v[p] = e[p]; //duplicate the vars object because we need to alter some things which w
27276ould cause problems if the user plans to reuse the same vars object for another tween. 27277 } 27278 v.values = pluginValues; 27279 pt = new CSSPropTween(t, "bezier", 0, 0, data.pt, 2); 27280 pt.data = data; 27281 pt.plugin = plugin; 27282 pt.setRatio = _setPluginRatio; 27283 if (v.autoRotate === 0) { 27284 v.autoRotate = true; 27285 } 27286 if (v.autoRotate && !(v.autoRotate instanceof Array)) { 27287 i = (v.autoRotate === true) ? 0 : Number(v.autoRotate); 27288 v.autoRotate = (data.end.left != null) ? [["left","top","rotation",i,false]] : (data.end.x != null) ? [["x","y","rotation",i,false]] : false; 27289 } 27290 if (v.autoRotate) { 27291 if (!cssp._transform) { 27292 cssp._enableTransforms(false); 27293 } 27294 data.autoRotate = cssp._target._gsTransform; 27295 data.proxy.rotation = data.autoRotate.rotation || 0; 27296 cssp._overwriteProps.push("rotation"); 27297 } 27298 plugin._onInitTween(data.proxy, v, cssp._tween); 27299 return pt; 27300 }}); 27301 }; 27302 27303 p._mod = function(lookup) { 27304 var op = this._overwriteProps, 27305 i = op.length, 27306 val; 27307 while (--i > -1) { 27308 val = lookup[op[i]]; 27309 if (val && typeof(val) === "function") { 27310 this._mod[op[i]] = val; 27311 } 27312 } 27313 }; 27314 27315 p._kill = function(lookup) { 27316 var a = this._props, 27317 p, i; 27318 for (p in this._beziers) { 27319 if (p in lookup) { 27320 delete this._beziers[p]; 27321 delete this._func[p]; 27322 i = a.length; 27323 while (--i > -1) { 27324 if (a[i] === p) { 27325 a.splice(i, 1); 27326 } 27327 } 27328 } 27329 } 27330 a = this._autoRotate; 27331 if (a) { 27332 i = a.length; 27333 while (--i > -1) { 27334 if (lookup[a[i][2]]) { 27335 a.splice(i, 1); 27336 } 27337 } 27338 } 27339 return this._super._kill.call(this, lookup); 27340 }; 27341 27342 }()); 27343 27344 27345 27346 27347 27348 27349 27350 27351 27352 27353 27354 27355 27356 27357 /* 27358 * ---------------------------------------------------------------- 27359 * CSSPlugin 27360 * ---------------------------------------------------------------- 27361 */ 27362 _gsScope._gsDefine("plugins.CSSPlugin", ["plugins.TweenPlugin","TweenLite"], function(TweenPlugin, TweenLite) { 27363 27364 /** @constructor **/ 27365 var CSSPlugin = function() { 27366 TweenPlugin.call(this, "css"); 27367 this._overwriteProps.length = 0; 27368 this.setRatio = CSSPlugin.prototype.setRatio; //speed optimization (avoid prototype lookup on this "hot" method) 27369 }, 27370 _globals = _gsScope._gsDefine.globals, 27371 _hasPriority, //turns true whenever a CSSPropTween instance is created that has a priority other than 0. This helps us discern whether or not we should spend the time organizing the linked list or not after a CSSPlugin's _onInitTween() method is called. 27372 _suffixMap, //we set this in _onInitTween() each time as a way to have a persistent variable we can use in other methods like _parse() without having to pass it around as a parameter and we keep _parse() decoupled from a particular CSSPlugin instance 27373 _cs, //computed style (we store this in a shared variable to conserve memory and make minification tighter 27374 _overwriteProps, //alias to the currently instantiating CSSPlugin's _overwriteProps array. We use this closure in order to avoid having to pass a reference around from method to method and aid in minification. 27375 _specialProps = {}, 27376 p = CSSPlugin.prototype = new TweenPlugin("css"); 27377 27378 p.constructor = CSSPlugin; 27379 CSSPlugin.version = "2.1.3"; 27380 CSSPlugin.API = 2; 27381 CSSPlugin.defaultTransformPerspective = 0; 27382 CSSPlugin.defaultSkewType = "compensated"; 27383 CSSPlugin.defaultSmoothOrigin = true; 27384 p = "px"; //we'll reuse the "p" variable to keep file size down 27385 CSSPlugin.suffixMap = {top:p, right:p, bottom:p, left:p, width:p, height:p, fontSize:p, padding:p, margin:p, perspective:p, lineHeight:""}; 27386 27387 27388 var _numExp = /(?:\-|\.|\b)(\d|\.|e\-)+/g, 27389 _relNumExp = /(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g, 27390 _valuesExp = /(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi, //finds all the values that begin with numbers or += or -= and then a number. Includes suffixes. We use this to split complex values apart like "1px 5px 20px rgb(255,102,51)" 27391 _valuesExpWithCommas = /(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b),?/gi, //finds all the values that begin with numbers or += or -= and then a number. Includes suffixes. We use this to split complex values apart like "1px 5px 20px rgb(255,102,51)" 27392 _NaNExp = /(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g, //also allows scientific notation and doesn't kill the leading -/+ in -= and += 27393 _suffixExp = /(?:\d|\-|\+|=|#|\.)*/g, 27394 _opacityExp = /opacity *= *([^)]*)/i, 27395 _opacityValExp = /opacity:([^;]*)/i, 27396 _alphaFilterExp = /alpha\(opacity *=.+?\)/i, 27397 _rgbhslExp = /^(rgb|hsl)/, 27398 _capsExp = /([A-Z])/g, 27399 _camelExp = /-([a-z])/gi, 27400 _urlExp = /(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi, //for pulling out urls from url(...) or url("...") strings (some browsers wrap urls in quotes, some don't when reporting things like backgroundImage)
27401 _camelFunc = function(s, g) { return g.toUpperCase(); }, 27402 _horizExp = /(?:Left|Right|Width)/i, 27403 _ieGetMatrixExp = /(M11|M12|M21|M22)=[\d\-\.e]+/gi, 27404 _ieSetMatrixExp = /progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i, 27405 _commasOutsideParenExp = /,(?=[^\)]*(?:\(|$))/gi, //finds any commas that are not within parenthesis 27406 _complexExp = /[\s,\(]/i, //for testing a string to find if it has a space, comma, or open parenthesis (clues that it's a complex value) 27407 _DEG2RAD = Math.PI / 180, 27408 _RAD2DEG = 180 / Math.PI, 27409 _forcePT = {}, 27410 _dummyElement = {style:{}}, 27411 _doc = _gsScope.document || {createElement: function() {return _dummyElement;}}, 27412 _createElement = function(type, ns) { 27413 var e = _doc.createElementNS ? _doc.createElementNS(ns || "http://www.w3.org/1999/xhtml", type) : _doc.createElement(type); 27414 return e.style ? e : _doc.createElement(type); //some environments won't allow access to the element's style when created with a namespace in which case we default to the standard createElement() to work around the issue. Also note that when GSAP is embedded directly inside an SVG file, createElement() won't allow access to the style object in Firefox (see https://greensock.com/forums/topic/20215-problem-using-tweenmax-in-standalone-self-containing-svg-file-err-cannot-set-property-csstext-of-undefined/). 27415 }, 27416 _tempDiv = _createElement("div"), 27417 _tempImg = _createElement("img"), 27418 _internals = CSSPlugin._internals = {_specialProps:_specialProps}, //provides a hook to a few internal methods that we need to access from inside other plugins 27419 _agent = (_gsScope.navigator || {}).userAgent || "", 27420 _autoRound, 27421 _reqSafariFix, //we won't apply the Safari transform fix until we actually come across a tween that affects a transform property (to maintain best performance). 27422 27423 _isSafari, 27424 _isFirefox, //Firefox has a bug that causes 3D transformed elements to randomly disappear unless a repaint is forced after each update on each element. 27425 _isSafariLT6, //Safari (and Android 4 which uses a flavor of Safari) has a bug that prevents changes to "top" and "left" properties from rendering properly if changed on the same frame as a transform UNLESS we set the element's WebkitBackfaceVisibility to hidden (weird, I know). Doing this for Android 3 and earlier seems to actually cause other problems, though (fun!) 27426 _ieVers, 27427 _supportsOpacity = (function() { //we set _isSafari, _ieVers, _isFirefox, and _supportsOpacity all in one function here to reduce file size slightly, especially in the minified version. 27428 var i = _agent.indexOf("Android"), 27429 a = _createElement("a"); 27430 _isSafari = (_agent.indexOf("Safari") !== -1 && _agent.indexOf("Chrome") === -1 && (i === -1 || parseFloat(_agent.substr(i+8, 2)) > 3)); 27431 _isSafariLT6 = (_isSafari && (parseFloat(_agent.substr(_agent.indexOf("Version/")+8, 2)) < 6)); 27432 _isFirefox = (_agent.indexOf("Firefox") !== -1); 27433 if ((/MSIE ([0-9]{1,}[\.0-9]{0,})/).exec(_agent) || (/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/).exec(_agent)) { 27434 _ieVers = parseFloat( RegExp.$1 ); 27435 } 27436 if (!a) { 27437 return false; 27438 } 27439 a.style.cssText = "top:1px;opacity:.55;"; 27440 return /^0.55/.test(a.style.opacity); 27441 }()), 27442 _getIEOpacity = function(v) { 27443 return (_opacityExp.test( ((typeof(v) === "string") ? v : (v.currentStyle ? v.currentStyle.filter : v.style.filter) || "") ) ? ( parseFloat( RegExp.$1 ) / 100 ) : 1); 27444 }, 27445 _log = function(s) {//for logging messages, but in a way that won't throw errors in old versions of IE. 27446 if (_gsScope.console) { 27447 console.log(s); 27448 } 27449 }, 27450 _target, //when initting a CSSPlugin, we set this variable so that we can access it from within many other functions without having to pass it around as params 27451 _index, //when initting a CSSPlugin, we set this variable so that we can access it from within many other functions without having to pass it around as params 27452 27453 _prefixCSS = "", //the non-camelCase vendor prefix like "-o-", "-moz-", "-ms-", or "-webkit-" 27454 _prefix = "", //camelCase vendor prefix like "O", "ms", "Webkit", or "Moz". 27455 27456 // @private feed in a camelCase property name like "transform" and it will check to see if it is valid as-is or if it needs a vendor prefix. It returns the corrected camelCase property name (i.e. "WebkitTransform" or "MozTransform" or "transform" or null if no such property is found, like if the browser is IE8 or before, "transform" won't be found at all) 27457 _checkPropPrefix = function(p, e) { 27458 e = e || _tempDiv; 27459 var s = e.style, 27460 a, i; 27461 if (s[p] !== undefined) { 27462 return p; 27463 } 27464 p = p.charAt(0).toUpperCase() + p.substr(1); 27465 a = ["O","Moz","ms","Ms","Webkit"]; 27466 i = 5; 27467 while (--i > -1 && s[a[i]+p] === undefined) { } 27468 if (i >= 0) { 27469 _prefix = (i === 3) ? "ms" : a[i]; 27470 _prefixCSS = "-" + _prefix.toLowerCase() + "-"; 27471 return _prefix + p; 27472 } 27473 return null; 27474 }, 27475 27476 _computedStyleScope = (typeof(window) !== "undefined" ? window : _doc.defaultView || {getComputedStyle:function() {}}), 27477 _getComputedStyle = function(e) { 27478 return _computedStyleScope.getComputedStyle(e); //to avoid errors in Microsoft Edge, we need to call getComputedStyle() from a specific scope, typically window. 27479 }, 27480 27481 /** 27482 * @private Returns the css style for a particular property of an element. For example, to get whatever the current "left" css value for an element with an ID of "myElement", you could do: 27483 * var currentLeft = CSSPlugin.getStyle( document.getElementById("myElement"), "left"); 27484 * 27485 * @param {!Object} t Target element whose style property you want to query 27486 * @param {!string} p Property name (like "left" or "top" or "marginTop", etc.) 27487 * @param {Object=} cs Computed style object. This just provides a way to speed processing if you're going to get several properties on the same element in quick succession - you can reuse the result of the getComputedStyle() call. 27488 * @param {boolean=} calc If true, the value will not be read directly from the element's "style" property (if it exists there), but instead the getComputedStyle() result will be used. This can be useful when you want to ensure that the browser itself is interpreting the value. 27489 * @param {string=} dflt Default value that should be returned in the place of null, "none", "auto" or "auto auto". 27490 * @return {?string} The current property value 27491 */ 27492 _getStyle = CSSPlugin.getStyle = function(t, p, cs, calc, dflt) { 27493 var rv; 27494 if (!_supportsOpacity) if (p === "opacity") { //several versions of IE don't use the standard "opacity" property - they use things like filter:alpha(opacity=50), so we parse that here. 27495 return _getIEOpacity(t); 27496 } 27497 if (!calc && t.style[p]) { 27498 rv = t.style[p]; 27499 } else if ((cs = cs || _getComputedStyle(t))) { 27500 rv = cs[p] || cs.getPropertyValue(p) || cs.getPropertyValue(p.replace(_capsExp, "-$1").toLowerCase()); 27501 } else if (t.currentStyle) { 27502 rv = t.currentStyle[p]; 27503 } 27504 return (dflt != null && (!rv || rv === "none" || rv === "auto" || rv === "auto auto")) ? dflt : rv; 27505 }, 27506 27507 /** 27508 * @private Pass the target element, the property name, the numeric value, and the suffix (like "%", "em", "px", etc.) and it will spit back the equivalent pixel number. 27509 * @param {!Object} t Target element 27510 * @param {!string} p Property name (like "left", "top", "marginLeft", etc.) 27511 * @param {!number} v Value 27512 * @param {string=} sfx Suffix (like "px" or "%" or "em") 27513 * @param {boolean=} recurse If true, the call is a recursive one. In some browsers (like IE7/8), occasionally the value isn't accurately reported initially, but if we run the function again it will take effect. 27514 * @return {number} value in pixels 27515 */ 27516 _convertToPixels = _internals.convertToPixels = function(t, p, v, sfx, recurse) { 27517 if (sfx === "px" || (!sfx && p !== "lineHeight")) { return v; } 27518 if (sfx === "auto" || !v) { return 0; } 27519 var horiz = _horizExp.test(p), 27520 node = t, 27521 style = _tempDiv.style, 27522 neg = (v < 0), 27523 precise = (v === 1), 27524 pix, cache, time; 27525 if (neg) { 27526 v = -v; 27527 } 27528 if (precise) { 27529 v *= 100; 27530 } 27531 if (p === "lineHeight" && !sfx) { //special case of when a simple lineHeight (without a unit) is used. Set it to the value, read back the computed value, and then revert. 27532 cache = _getComputedStyle(t).lineHeight; 27533 t.style.lineHeight = v; 27534 pix = parseFloat(_getComputedStyle(t).lineHeight); 27535 t.style.lineHeight = cache; 27536 } else if (sfx === "%" && p.indexOf("border") !== -1) { 27537 pix = (v / 100) * (horiz ? t.clientWidth : t.clientHeight); 27538 } else { 27539 style.cssText = "border:0 solid red;position:" + _getStyle(t, "position") + ";line-height:0;"; 27540 if (sfx === "%" || !node.appendChild || sfx.charAt(0) === "v" || sfx === "rem") { 27541 node = t.parentNode || _doc.body; 27542 if (_getStyle(node, "display").indexOf("flex") !== -1) { //Edge and IE11 have a bug that causes offsetWidth to report as 0 if the container has display:flex and the child is position:relative. Switching to position: absolute solves it. 27543 style.position = "absolute"; 27544 } 27545 cache = node._gsCache; 27546 time = TweenLite.ticker.frame; 27547 if (cache && horiz && cache.time === time) { //performance optimization: we record the width of elements along with the ticker frame so that we can quickly get it again on the same tick (seems relatively safe to assume it wouldn't change on the same tick) 27548 return cache.width * v / 100; 27549 } 27550 style[(horiz ? "width" : "height")] = v + sfx; 27551 } else { 27552 style[(horiz ? "borderLeftWidth" : "borderTopWidth")] = v + sfx; 27553 } 27554 node.appendChild(_tempDiv); 27555 pix = parseFloat(_tempDiv[(horiz ? "offsetWidth" : "offsetHeight")]); 27556 node.removeChild(_tempDiv); 27557 if (horiz && sfx === "%" && CSSPlugin.cacheWidths !== false) { 27558 cache = node._gsCache = node._gsCache || {}; 27559 cache.time = time; 27560 cache.width = pix / v * 100; 27561 } 27562 if (pix === 0 && !recurse) { 27563 pix = _convertToPixels(t, p, v, sfx, true); 27564 } 27565 } 27566 if (precise) { 27567 pix /= 100; 27568 } 27569 return neg ? -pix : pix; 27570 }, 27571 _calculateOffset = _internals.calculateOffset = function(t, p, cs) { //for figuring out "top" or "left" in px when it's "auto". We need to factor in margin with the offsetLeft/offsetTop 27572 if (_getStyle(t, "position", cs) !== "absolute") { return 0; } 27573 var dim = ((p === "left") ? "Left" : "Top"),
27574 v = _getStyle(t, "margin" + dim, cs); 27575 return t["offset" + dim] - (_convertToPixels(t, p, parseFloat(v), v.replace(_suffixExp, "")) || 0); 27576 }, 27577 27578 // @private returns at object containing ALL of the style properties in camelCase and their associated values. 27579 _getAllStyles = function(t, cs) { 27580 var s = {}, 27581 i, tr, p; 27582 if ((cs = cs || _getComputedStyle(t, null))) { 27583 if ((i = cs.length)) { 27584 while (--i > -1) { 27585 p = cs[i]; 27586 if (p.indexOf("-transform") === -1 || _transformPropCSS === p) { //Some webkit browsers duplicate transform values, one non-prefixed and one prefixed ("transform" and "WebkitTransform"), so we must weed out the extra one here. 27587 s[p.replace(_camelExp, _camelFunc)] = cs.getPropertyValue(p); 27588 } 27589 } 27590 } else { //some browsers behave differently - cs.length is always 0, so we must do a for...in loop. 27591 for (i in cs) { 27592 if (i.indexOf("Transform") === -1 || _transformProp === i) { //Some webkit browsers duplicate transform values, one non-prefixed and one prefixed ("transform" and "WebkitTransform"), so we must weed out the extra one here. 27593 s[i] = cs[i]; 27594 } 27595 } 27596 } 27597 } else if ((cs = t.currentStyle || t.style)) { 27598 for (i in cs) { 27599 if (typeof(i) === "string" && s[i] === undefined) { 27600 s[i.replace(_camelExp, _camelFunc)] = cs[i]; 27601 } 27602 } 27603 } 27604 if (!_supportsOpacity) { 27605 s.opacity = _getIEOpacity(t); 27606 } 27607 tr = _getTransform(t, cs, false); 27608 s.rotation = tr.rotation; 27609 s.skewX = tr.skewX; 27610 s.scaleX = tr.scaleX; 27611 s.scaleY = tr.scaleY; 27612 s.x = tr.x; 27613 s.y = tr.y; 27614 if (_supports3D) { 27615 s.z = tr.z; 27616 s.rotationX = tr.rotationX; 27617 s.rotationY = tr.rotationY; 27618 s.scaleZ = tr.scaleZ; 27619 } 27620 if (s.filters) { 27621 delete s.filters; 27622 } 27623 return s; 27624 }, 27625 27626 // @private analyzes two style objects (as returned by _getAllStyles()) and only looks for differences between them that contain tweenable values (like a number or color). It returns an object with a "difs" property which refers to an object c
27626ontaining only those isolated properties and values for tweening, and a "firstMPT" property which refers to the first MiniPropTween instance in a linked list that recorded all the starting values of the different properties so that we can revert to them at the end or beginning of the tween - we don't want the cascading to get messed up. The forceLookup parameter is an optional generic object with properties that should be forced into the results - this is necessary for className tweens that are overwriting others because imagine a scenario where a rollover/rollout adds/removes a class and the user swipes the mouse over the target SUPER fast, thus nothing actually changed yet and the subsequent comparison of the properties would indicate they match (especially when px rounding is taken into consideration), thus no tweening is necessary even though it SHOULD tween and remove those properties after the tween (otherwise the inline styles will contaminate things). See the className SpecialProp code for details. 27627 _cssDif = function(t, s1, s2, vars, forceLookup) { 27628 var difs = {}, 27629 style = t.style, 27630 val, p, mpt; 27631 for (p in s2) { 27632 if (p !== "cssText") if (p !== "length") if (isNaN(p)) if (s1[p] !== (val = s2[p]) || (forceLookup && forceLookup[p])) if (p.indexOf("Origin") === -1) if (typeof(val) === "number" || typeof(val) === "string") { 27633 difs[p] = (val === "auto" && (p === "left" || p === "top")) ? _calculateOffset(t, p) : ((val === "" || val === "auto" || val === "none") && typeof(s1[p]) === "string" && s1[p].replace(_NaNExp, "") !== "") ? 0 : val; //if the ending value is defaulting ("" or "auto"), we check the starting value and if it can be parsed into a number (a string which could have a suffix too, like 700px), then we swap in 0 for "" or "auto" so that things actually tween. 27634 if (style[p] !== undefined) { //for className tweens, we must remember which properties already existed inline - the ones that didn't should be removed when the tween isn't in progress because they were only introduced to facilitate the transition between classes. 27635 mpt = new MiniPropTween(style, p, style[p], mpt); 27636 } 27637 } 27638 } 27639 if (vars) { 27640 for (p in vars) { //copy properties (except className) 27641 if (p !== "className") { 27642 difs[p] = vars[p]; 27643 } 27644 } 27645 } 27646 return {difs:difs, firstMPT:mpt}; 27647 }, 27648 _dimensions = {width:["Left","Right"], height:["Top","Bottom"]}, 27649 _margins = ["marginLeft","marginRight","marginTop","marginBottom"], 27650 27651 /** 27652 * @private Gets the width or height of an element 27653 * @param {!Object} t Target element 27654 * @param {!string} p Property name ("width" or "height") 27655 * @param {Object=} cs Computed style object (if one exists). Just a speed optimization. 27656 * @return {number} Dimension (in pixels) 27657 */ 27658 _getDimension = function(t, p, cs) { 27659 if ((t.nodeName + "").toLowerCase() === "svg") { //Chrome no longer supports offsetWidth/offsetHeight on SVG elements. 27660 return (cs || _getComputedStyle(t))[p] || 0; 27661 } else if (t.getCTM && _isSVG(t)) { 27662 return t.getBBox()[p] || 0; 27663 } 27664 var v = parseFloat((p === "width") ? t.offsetWidth : t.offsetHeight), 27665 a = _dimensions[p], 27666 i = a.length; 27667 cs = cs || _getComputedStyle(t, null); 27668 while (--i > -1) { 27669 v -= parseFloat( _getStyle(t, "padding" + a[i], cs, true) ) || 0; 27670 v -= parseFloat( _getStyle(t, "border" + a[i] + "Width", cs, true) ) || 0; 27671 } 27672 return v; 27673 }, 27674 27675 // @private Parses position-related complex strings like "top left" or "50px 10px" or "70% 20%", etc. which are used for things like transformOrigin or backgroundPosition. Optionally decorates a supplied object (recObj) with the following properties: "ox" (offsetX), "oy" (offsetY), "oxp" (if true, "ox" is a percentage not a pixel value), and "oxy" (if true, "oy" is a percentage not a pixel value) 27676 _parsePosition = function(v, recObj) { 27677 if (v === "contain" || v === "auto" || v === "auto auto") { //note: Firefox uses "auto auto" as default whereas Chrome uses "auto". 27678 return v + " "; 27679 } 27680 if (v == null || v === "") { 27681 v = "0 0"; 27682 } 27683 var a = v.split(" "), 27684 x = (v.indexOf("left") !== -1) ? "0%" : (v.indexOf("right") !== -1) ? "100%" : a[0], 27685 y = (v.indexOf("top") !== -1) ? "0%" : (v.indexOf("bottom") !== -1) ? "100%" : a[1], 27686 i; 27687 if (a.length > 3 && !recObj) { //multiple positions 27688 a = v.split(", ").join(",").split(","); 27689 v = []; 27690 for (i = 0; i < a.length; i++) { 27691 v.push(_parsePosition(a[i])); 27692 } 27693 return v.join(","); 27694 } 27695 if (y == null) { 27696 y = (x === "center") ? "50%" : "0"; 27697 } else if (y === "center") { 27698 y = "50%"; 27699 } 27700 if (x === "center" || (isNaN(parseFloat(x)) && (x + "").indexOf("=") === -1)) { //remember, the user could flip-flop the values and say "bottom center" or "center bottom", etc. "center" is ambiguous because it c
27700ould be used to describe horizontal or vertical, hence the isNaN(). If there's an "=" sign in the value, it's relative. 27701 x = "50%"; 27702 } 27703 v = x + " " + y + ((a.length > 2) ? " " + a[2] : ""); 27704 if (recObj) { 27705 recObj.oxp = (x.indexOf("%") !== -1); 27706 recObj.oyp = (y.indexOf("%") !== -1); 27707 recObj.oxr = (x.charAt(1) === "="); 27708 recObj.oyr = (y.charAt(1) === "="); 27709 recObj.ox = parseFloat(x.replace(_NaNExp, "")); 27710 recObj.oy = parseFloat(y.replace(_NaNExp, "")); 27711 recObj.v = v; 27712 } 27713 return recObj || v; 27714 }, 27715 27716 /** 27717 * @private Takes an ending value (typically a string, but can be a number) and a starting value and returns the change between the two, looking for relative value indicators like += and -= and it also ignores suffixes (but make sure the ending value starts with a number or +=/-= and that the starting value is a NUMBER!) 27718 * @param {(number|string)} e End value which is typically a string, but could be a number 27719 * @param {(number|string)} b Beginning value which is typically a string but could be a number 27720 * @return {number} Amount of change between the beginning and ending values (relative values that have a "+=" or "-=" are recognized) 27721 */ 27722 _parseChange = function(e, b) { 27723 if (typeof(e) === "function") { 27724 e = e(_index, _target); 27725 } 27726 return (typeof(e) === "string" && e.charAt(1) === "=") ? parseInt(e.charAt(0) + "1", 10) * parseFloat(e.substr(2)) : (parseFloat(e) - parseFloat(b)) || 0; 27727 }, 27728 27729 /** 27730 * @private Takes a value and a default number, checks if the value is relative, null, or numeric and spits back a normalized number accordingly. Primarily used in the _parseTransform() function. 27731 * @param {Object} v Value to be parsed 27732 * @param {!number} d Default value (which is also used for relative calculations if "+=" or "-=" is found in the first parameter) 27733 * @return {number} Parsed value 27734 */ 27735 _parseVal = function(v, d) { 27736 if (typeof(v) === "function") { 27737 v = v(_index, _target); 27738 } 27739 var isRelative = (typeof(v) === "string" && v.charAt(1) === "="); 27740 if (typeof(v) === "string" && v.charAt(v.length - 2) === "v") { //convert vw and vh into px-equivalents. 27741 v = (isRelative ? v.substr(0, 2) : 0) + (window["inner" + ((v.substr(-2) === "vh") ? "Height" : "Width")] * (parseFloat(isRelative ? v.substr(2) : v) / 100)); 27742 } 27743 return (v == null) ? d : isRelative ? parseInt(v.charAt(0) + "1", 10) * parseFloat(v.substr(2)) + d : parseFloat(v) || 0; 27744 }, 27745 27746 /** 27747 * @private Translates strings like "40deg" or "40" or 40rad" or "+=40deg" or "270_short" or "-90_cw" or "+=45_ccw" to a numeric radian angle. Of course a starting/default value must be fed in too so that relative values can be calculated properly. 27748 * @param {Object} v Value to be parsed 27749 * @param {!number} d Default value (which is also used for relative calculations if "+=" or "-=" is found in the first parameter) 27750 * @param {string=} p property name for directionalEnd (optional - only used when the parsed value is directional ("_short", "_cw", or "_ccw" suffix). We need a way to store the uncompensated value so that at the end of the tween, we set it to exactly what was requested with no directional compensation). Property name would be "rotation", "rotationX", or "rotationY" 27751 * @param {Object=} directionalEnd An object that will store the raw end values for directional angles ("_short", "_cw", or "_ccw" suffix). We need a way to store the uncompensated value so that at the end of the tween, we set it to exactly what was requested with no directional compensation. 27752 * @return {number} parsed angle in radians 27753 */ 27754 _parseAngle = function(v, d, p, directionalEnd) { 27755 var min = 0.000001, 27756 cap, split, dif, result, isRelative; 27757 if (typeof(v) === "function") { 27758 v = v(_index, _target); 27759 } 27760 if (v == null) { 27761 result = d; 27762 } else if (typeof(v) === "number") { 27763 result = v; 27764 } else { 27765 cap = 360; 27766 split = v.split("_"); 27767 isRelative = (v.charAt(1) === "="); 27768 dif = (isRelative ? parseInt(v.charAt(0) + "1", 10) * parseFloat(split[0].substr(2)) : parseFloat(split[0])
27768) * ((v.indexOf("rad") === -1) ? 1 : _RAD2DEG) - (isRelative ? 0 : d); 27769 if (split.length) { 27770 if (directionalEnd) { 27771 directionalEnd[p] = d + dif; 27772 } 27773 if (v.indexOf("short") !== -1) { 27774 dif = dif % cap; 27775 if (dif !== dif % (cap / 2)) { 27776 dif = (dif < 0) ? dif + cap : dif - cap; 27777 } 27778 } 27779 if (v.indexOf("_cw") !== -1 && dif < 0) { 27780 dif = ((dif + cap * 9999999999) % cap) - ((dif / cap) | 0) * cap; 27781 } else if (v.indexOf("ccw") !== -1 && dif > 0) { 27782 dif = ((dif - cap * 9999999999) % cap) - ((dif / cap) | 0) * cap; 27783 } 27784 } 27785 result = d + dif; 27786 } 27787 if (result < min && result > -min) { 27788 result = 0; 27789 } 27790 return result; 27791 }, 27792 27793 _colorLookup = {aqua:[0,255,255], 27794 lime:[0,255,0], 27795 silver:[192,192,192], 27796 black:[0,0,0], 27797 maroon:[128,0,0], 27798 teal:[0,128,128], 27799 blue:[0,0,255], 27800 navy:[0,0,128], 27801 white:[255,255,255], 27802 fuchsia:[255,0,255], 27803 olive:[128,128,0], 27804 yellow:[255,255,0], 27805 orange:[255,165,0], 27806 gray:[128,128,128], 27807 purple:[128,0,128], 27808 green:[0,128,0], 27809 red:[255,0,0], 27810 pink:[255,192,203], 27811 cyan:[0,255,255], 27812 transparent:[255,255,255,0]}, 27813 27814 _hue = function(h, m1, m2) { 27815 h = (h < 0) ? h + 1 : (h > 1) ? h - 1 : h; 27816 return ((((h * 6 < 1) ? m1 + (m2 - m1) * h * 6 : (h < 0.5) ? m2 : (h * 3 < 2) ? m1 + (m2 - m1) * (2 / 3 - h) * 6 : m1) * 255) + 0.5) | 0; 27817 }, 27818 27819 /** 27820 * @private Parses a color (like #9F0, #FF9900, rgb(255,51,153) or hsl(108, 50%, 10%)) into an array with 3 elements for red, green, and blue or if toHSL parameter is true, it will populate the array with hue, saturation, and lightness values. If a relative value is found in an hsl() or hsla() string, it will preserve those relative prefixes and all the values in the array will be strings instead of numbers (in all other cases it will be populated with numbers). 27821 * @param {(string|number)} v The value the should be parsed which could be a string like #9F0 or rgb(255,102,51) or rgba(255,0,0,0.5) or it could be a number like 0xFF00CC or even a named color like red, blue, purple, etc. 27822 * @param {(boolean)} toHSL If true, an hsl() or hsla() value will be returned instead of rgb() or rgba() 27823 * @return {Array.<number>} An array containing red, green, and blue (and optionally alpha) in that order, or if the toHSL parameter was true, the array will contain hue, saturation and lightness (and optionally alpha) in that order. Always numbers unless there's a relative prefix found in an hsl() or hsla() string and toHSL is true. 27824 */ 27825 _parseColor = CSSPlugin.parseColor = function(v, toHSL) { 27826 var a, r, g, b, h, s, l, max, min, d, wasHSL; 27827 if (!v) { 27828 a = _colorLookup.black; 27829 } else if (typeof(v) === "number") { 27830 a = [v >> 16, (v >> 8) & 255, v & 255]; 27831 } else { 27832 if (v.charAt(v.length - 1) === ",") { //sometimes a trailing comma is included and we should chop it off (typically from a comma-delimited list of values like a textShadow:"2px 2px 2px blue, 5px 5px 5px rgb(255,0,0)" - in this example "blue," has a trailing comma. We could strip it out inside parseComplex() but we'd need to do it to the beginning and ending values plus it wouldn't provide protection from other potential scenarios like if the user passes in a similar value. 27833 v = v.substr(0, v.length - 1); 27834 } 27835 if (_colorLookup[v]) { 27836 a = _colorLookup[v]; 27837 } else if (v.charAt(0) === "#") { 27838 if (v.length === 4) { //for shorthand like #9F0 27839 r = v.charAt(1); 27840 g = v.charAt(2); 27841 b = v.charAt(3); 27842 v = "#" + r + r + g + g + b + b; 27843 } 27844 v = parseInt(v.substr(1), 16); 27845 a = [v >> 16, (v >> 8) & 255, v & 255]; 27846 } else if (v.substr(0, 3) === "hsl") { 27847 a = wasHSL = v.match(_numExp); 27848 if (!toHSL) { 27849 h = (Number(a[0]) % 360) / 360; 27850 s = Number(a[1]) / 100; 27851 l = Number(a[2]) / 100; 27852 g = (l <= 0.5) ? l * (s + 1) : l + s - l * s; 27853 r = l * 2 - g; 27854 if (a.length > 3) { 27855 a[3] = Number(a[3]); 27856 } 27857 a[0] = _hue(h + 1 / 3, r, g); 27858 a[1] = _hue(h, r, g); 27859 a[2] = _hue(h - 1 / 3, r, g); 27860 } else if (v.indexOf("=") !== -1) { //if relative values are found, just return the raw strings with the relative prefixes in place. 27861 return v.match(_relNumExp); 27862 } 27863 } else { 27864 a = v.match(_numExp) || _colorLookup.transparent; 27865 } 27866 a[0] = Number(a[0]); 27867 a[1] = Number(a[1]); 27868 a[2] = Number(a[2]); 27869 if (a.length > 3) { 27870 a[3] = Number(a[3]); 27871 } 27872 } 27873 if (toHSL && !wasHSL) { 27874 r = a[0] / 255; 27875 g = a[1] / 255; 27876 b = a[2] / 255; 27877 max = Math.max(r, g, b); 27878 min = Math.min(r, g, b); 27879 l = (max + min) / 2; 27880 if (max === min) { 27881 h = s = 0; 27882 } else { 27883 d = max - min; 27884 s = l > 0.5 ? d / (2 - max - min) : d / (max + min); 27885 h = (max === r) ? (g - b) / d + (g < b ? 6 : 0) : (max === g) ? (b - r) / d + 2 : (r - g) / d + 4; 27886 h *= 60; 27887 } 27888 a[0] = (h + 0.5) | 0; 27889 a[1] = (s * 100 + 0.5) | 0; 27890 a[2] = (l * 100 + 0.5) | 0; 27891 } 27892 return a; 27893 }, 27894 _formatColors = function(s, toHSL) { 27895 var colors = s.match(_colorExp) || [], 27896 charIndex = 0, 27897 parsed = "", 27898 i, color, temp; 27899 if (!colors.length) { 27900 return s; 27901 } 27902 for (i = 0; i < colors.length; i++) { 27903 color = colors[i]; 27904 temp = s.substr(charIndex, s.indexOf(color, charIndex)-charIndex); 27905 charIndex += temp.length + color.length; 27906 color = _parseColor(color, toHSL); 27907 if (color.length === 3) { 27908 color.push(1); 27909 } 27910 parsed += temp + (toHSL ? "hsla(" + color[0] + "," + color[1] + "%," + color[2] + "%," + color[3] : "rgba(" + color.
27910join(",")) + ")"; 27911 } 27912 return parsed + s.substr(charIndex); 27913 }, 27914 _colorExp = "(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3}){1,2}\\b"; //we'll dynamically build this Regular Expression to conserve file size. After building it, it will be able to find rgb(), rgba(), # (hexadecimal), and named color values like red, blue, purple, etc. 27915 27916 for (p in _colorLookup) { 27917 _colorExp += "|" + p + "\\b"; 27918 } 27919 _colorExp = new RegExp(_colorExp+")", "gi"); 27920 27921 CSSPlugin.colorStringFilter = function(a) { 27922 var combined = a[0] + " " + a[1], 27923 toHSL; 27924 if (_colorExp.test(combined)) { 27925 toHSL = (combined.indexOf("hsl(") !== -1 || combined.indexOf("hsla(") !== -1); 27926 a[0] = _formatColors(a[0], toHSL); 27927 a[1] = _formatColors(a[1], toHSL); 27928 } 27929 _colorExp.lastIndex = 0; 27930 }; 27931 27932 if (!TweenLite.defaultStringFilter) { 27933 TweenLite.defaultStringFilter = CSSPlugin.colorStringFilter; 27934 } 27935 27936 /** 27937 * @private Returns a formatter function that handles taking a string (or number in some cases) and returning a consistently formatted one in terms of delimiters, quantity of values, etc. For example, we may get boxShadow values defined as "0px red" or "0px 0px 10px rgb(255,0,0)" or "0px 0px 20px 20px #F00" and we need to ensure that what we get back is described with 4 numbers and a color. This allows us to feed it into the _parseComplex() method and split the values up appropriately. The neat thing about this _getFormatter() function is that the dflt defines a pattern as well as a default, so for example, _getFormatter("0px 0px 0px 0px #777", true) not only sets the default as 0px for all distances and #777 for the color, but also sets the pattern such that 4 numbers and a color will always get returned. 27938 * @param {!string} dflt The default value and pattern to follow. So "0px 0px 0px 0px #777" will ensure that 4 numbers and a color will always get returned. 27939 * @param {boolean=} clr If true, the values should be searched for color-related data. For example, boxShadow values typically contain a color whereas borderRadius don't. 27940 * @param {boolean=} collapsible If true, the value is a top/left/right/bottom style one that acts like margin or padding, where if only one value is received, it's used for all 4; if 2 are received, the first is duplicated for 3rd (bottom) and the 2nd is duplicated for the 4th spot (left), etc. 27941 * @return {Function} formatter function 27942 */ 27943 var _getFormatter = function(dflt, clr, collapsible, multi) { 27944 if (dflt == null) { 27945 return function(v) {return v;}; 27946 } 27947 var dColor = clr ? (dflt.match(_colorExp) || [""])[0] : "", 27948 dVals = dflt.split(dColor).join("").match(_valuesExp) || [], 27949 pfx = dflt.substr(0, dflt.indexOf(dVals[0])), 27950 sfx = (dflt.charAt(dflt.length - 1) === ")") ? ")" : "", 27951 delim = (dflt.indexOf(" ") !== -1) ? " " : ",", 27952 numVals = dVals.length, 27953 dSfx = (numVals > 0) ? dVals[0].replace(_numExp, "") : "", 27954 formatter; 27955 if (!numVals) { 27956 return function(v) {return v;}; 27957 } 27958 if (clr) { 27959 formatter = function(v) { 27960 var color, vals, i, a; 27961 if (typeof(v) === "number") { 27962 v += dSfx; 27963 } else if (multi && _commasOutsideParenExp.test(v)) { 27964 a = v.replace(_commasOutsideParenExp, "|").split("|"); 27965 for (i = 0; i < a.length; i++) { 27966 a[i] = formatter(a[i]); 27967 } 27968 return a.join(","); 27969 } 27970 color = (v.match(_colorExp) || [dColor])[0]; 27971 vals = v.split(color).join("").match(_valuesExp) || []; 27972 i = vals.length; 27973 if (numVals > i--) { 27974 while (++i < numVals) { 27975 vals[i] = collapsible ? vals[(((i - 1) / 2) | 0)] : dVals[i]; 27976 } 27977 } 27978 return pfx + vals.join(delim) + delim + color + sfx + (v.indexOf("inset") !== -1 ? " inset" : ""); 27979 }; 27980 return formatter; 27981 27982 } 27983 formatter = function(v) { 27984 var vals, a, i; 27985 if (typeof(v) === "number") { 27986 v += dSfx; 27987 } else if (multi && _commasOutsideParenExp.test(v)) { 27988 a = v.replace(_commasOutsideParenExp, "|").split("|"); 27989 for (i = 0; i < a.length; i++) { 27990 a[i] = formatter(a[i]); 27991 } 27992 return a.join(","); 27993 } 27994 vals = v.match(delim === "," ? _valuesExp : _valuesExpWithCommas) || []; 27995 i = vals.length; 27996 if (numVals > i--) { 27997 while (++i < numVals) { 27998 vals[i] = collapsible ? vals[(((i - 1) / 2) | 0)] : dVals[i]; 27999 } 28000 }
28001 return ((pfx && v !== "none") ? v.substr(0, v.indexOf(vals[0])) || pfx : pfx) + vals.join(delim) + sfx; //note: prefix might be different, like for clipPath it could start with inset( or polygon( 28002 }; 28003 return formatter; 28004 }, 28005 28006 /** 28007 * @private returns a formatter function that's used for edge-related values like marginTop, marginLeft, paddingBottom, paddingRight, etc. Just pass a comma-delimited list of property names related to the edges. 28008 * @param {!string} props a comma-delimited list of property names in order from top to left, like "marginTop,marginRight,marginBottom,marginLeft" 28009 * @return {Function} a formatter function 28010 */ 28011 _getEdgeParser = function(props) { 28012 props = props.split(","); 28013 return function(t, e, p, cssp, pt, plugin, vars) { 28014 var a = (e + "").split(" "), 28015 i; 28016 vars = {}; 28017 for (i = 0; i < 4; i++) { 28018 vars[props[i]] = a[i] = a[i] || a[(((i - 1) / 2) >> 0)]; 28019 } 28020 return cssp.parse(t, vars, pt, plugin); 28021 }; 28022 }, 28023 28024 // @private used when other plugins must tween values first, like BezierPlugin or ThrowPropsPlugin, etc. That plugin's setRatio() gets called first so that the values are updated, and then we loop through the MiniPropTweens which handle copying the values into their appropriate slots so that they can then be applied correctly in the main CSSPlugin setRatio() method. Remember, we typically create a proxy object that has a bunch of uniquely-named properties that we feed to the sub-plugin and it does its magic normally, and then we must interpret those values and apply them to the css because often numbers must get combined/concatenated, suffixes added, etc. to work with css, like boxShadow could have 4 values plus a color. 28025 _setPluginRatio = _internals._setPluginRatio = function(v) { 28026 this.plugin.setRatio(v); 28027 var d = this.data, 28028 proxy = d.proxy, 28029 mpt = d.firstMPT, 28030 min = 0.000001, 28031 val, pt, i, str, p; 28032 while (mpt) { 28033 val = proxy[mpt.v]; 28034 if (mpt.r) { 28035 val = mpt.r(val); 28036 } else if (val < min && val > -min) { 28037 val = 0; 28038 } 28039 mpt.t[mpt.p] = val; 28040 mpt = mpt._next; 28041 } 28042 if (d.autoRotate) { 28043 d.autoRotate.rotation = d.mod ? d.mod.call(this._tween, proxy.rotation, this.t, this._tween) : proxy.rotation; //special case for ModifyPlugin to hook into an auto-rotating bezier 28044 } 28045 //at the end, we must set the CSSPropTween's "e" (end) value dynamically here because that's what is used in the final setRatio() method. Same for "b" at the beginning. 28046 if (v === 1 || v === 0) { 28047 mpt = d.firstMPT; 28048 p = (v === 1) ? "e" : "b"; 28049 while (mpt) { 28050 pt = mpt.t; 28051 if (!pt.type) { 28052 pt[p] = pt.s + pt.xs0; 28053 } else if (pt.type === 1) { 28054 str = pt.xs0 + pt.s + pt.xs1; 28055 for (i = 1; i < pt.l; i++) { 28056 str += pt["xn"+i] + pt["xs"+(i+1)]; 28057 } 28058 pt[p] = str; 28059 } 28060 mpt = mpt._next; 28061 } 28062 } 28063 }, 28064 28065 /** 28066 * @private @constructor Used by a few SpecialProps to hold important values for proxies. For example, _parseToProxy() creates a MiniPropTween instance for each property that must get tweened on the proxy, and we record the original property name as well as the unique one we create for the proxy, plus whether or not the value needs to be rounded plus the original value. 28067 * @param {!Object} t target object whose property we're tweening (often a CSSPropTween) 28068 * @param {!string} p property name 28069 * @param {(number|string|object)} v value 28070 * @param {MiniPropTween=} next next MiniPropTween in the linked list 28071 * @param {boolean=} r if true, the tweened value should be rounded to the nearest integer 28072 */ 28073 MiniPropTween = function(t, p, v, next, r) { 28074 this.t = t; 28075 this.p = p; 28076 this.v = v; 28077 this.r = r; 28078 if (next) { 28079 next._prev = this; 28080 this._next = next; 28081 } 28082 }, 28083 28084 /** 28085 * @private Most other plugins (like BezierPlugin and ThrowPropsPlugin and others) can only tween numeric values, but CSSPlugin must accommodate special values that have a bunch of extra data (like a suffix or strings between numeric values, etc.). For example, boxShadow has values like "10px 10px 20px 30px rgb(255,0,0)" which would utterly confuse other plugins. This method allows us to split that data apart and grab only the numeric data and attach it to uniquely-named properties of a generic proxy object ({}) so that we can feed that to virtually any plugin to have the numbers tweened. However, we must also keep track of which properties from the proxy go with which CSSPropTween values and instances. So we create a linked list of MiniPropTweens. Each one records a target (the original CSSPropTween), property (like "s" or "xn1" or "xn2") that we're tweening and the unique property name that was used for the proxy (like "boxShadow_xn1" and "boxShadow_xn2") and whether or not they need to be roun
28085ded. That way, in the _setPluginRatio() method we can simply copy the values over from the proxy to the CSSPropTween instance(s). Then, when the main CSSPlugin setRatio() method runs and applies the CSSPropTween values accordingly, they're updated nicely. So the external plugin tweens the numbers, _setPluginRatio() copies them over, and setRatio() acts normally, applying css-specific values to the element. 28086 * This method returns an object that has the following properties: 28087 * - proxy: a generic object containing the starting values for all the properties that will be tweened by the external plugin. This is what we feed to the external _onInitTween() as the target 28088 * - end: a generic object containing the ending values for all the properties that will be tweened by the external plugin. This is what we feed to the external plugin's _onInitTween() as the destination values 28089 * - firstMPT: the first MiniPropTween in the linked list 28090 * - pt: the first CSSPropTween in the linked list that was created when parsing. If shallow is true, this linked list will NOT attach to the one passed into the _parseToProxy() as the "pt" (4th) parameter. 28091 * @param {!Object} t target object to be tweened 28092 * @param {!(Object|string)} vars the object containing the information about the tweening values (typically the end/destination values) that should be parsed 28093 * @param {!CSSPlugin} cssp The CSSPlugin instance 28094 * @param {CSSPropTween=} pt the next CSSPropTween in the linked list 28095 * @param {TweenPlugin=} plugin the external TweenPlugin instance that will be handling tweening the numeric values 28096 * @param {boolean=} shallow if true, the resulting linked list from the parse will NOT be attached to the CSSPropTween that was passed in as the "pt" (4th) parameter. 28097 * @return An object containing the following properties: proxy, end, firstMPT, and pt (see above for descriptions) 28098 */ 28099 _parseToProxy = _internals._parseToProxy = function(t, vars, cssp, pt, plugin, shallow) { 28100 var bpt = pt, 28101 start = {}, 28102 end = {}, 28103 transform = cssp._transform, 28104 oldForce = _forcePT, 28105 i, p, xp, mpt, firstPT; 28106 cssp._transform = null; 28107 _forcePT = vars; 28108 pt = firstPT = cssp.parse(t, vars, pt, plugin); 28109 _forcePT = oldForce; 28110 //break off from the linked list so the new ones are isolated. 28111 if (shallow) { 28112 cssp._transform = transform; 28113 if (bpt) { 28114 bpt._prev = null; 28115 if (bpt._prev) { 28116 bpt._prev._next = null; 28117 } 28118 } 28119 } 28120 while (pt && pt !== bpt) { 28121 if (pt.type <= 1) { 28122 p = pt.p; 28123 end[p] = pt.s + pt.c; 28124 start[p] = pt.s; 28125 if (!shallow) { 28126 mpt = new MiniPropTween(pt, "s", p, mpt, pt.r); 28127 pt.c = 0; 28128 } 28129 if (pt.type === 1) { 28130 i = pt.l; 28131 while (--i > 0) { 28132 xp = "xn" + i; 28133 p = pt.p + "_" + xp; 28134 end[p] = pt.data[xp]; 28135 start[p] = pt[xp]; 28136 if (!shallow) { 28137 mpt = new MiniPropTween(pt, xp, p, mpt, pt.rxp[xp]); 28138 } 28139 } 28140 } 28141 } 28142 pt = pt._next; 28143 } 28144 return {proxy:start, end:end, firstMPT:mpt, pt:firstPT}; 28145 }, 28146 28147 28148 28149 /** 28150 * @constructor Each property that is tweened has at least one CSSPropTween associated with it. These instances store important information like the target, property, starting value, amount of change, etc. They can also optionally have a number of "extra" strings and numeric values named xs1, xn1, xs2, xn2, xs3, xn3, etc. where "s" indicates string and "n" indicates number. These can be pieced together in a complex-value tween (type:1) that has alternating types of data like a string, number, string, number, etc. For example, boxShadow could be "5px 5px 8px rgb(102, 102, 51)". In that value, there are 6 numbers that may need to tween and then pieced back together into a string again with spaces, suffixes, etc. xs0 is special in that it stores the suffix for standard (type:0) tweens, -OR- the first string (prefix) in a complex-value (type:1) CSSPropTween -OR- it can be the non-tweening value in a type:-1 CSSPropTween. We do this to conserve memory. 28151 * CSSPropTweens have the following optional properties as well (not defined through the constructor): 28152 * - l: Length in terms of the number of extra properties that the CSSPropTween has (default: 0). For example, for a boxShadow we may need to tween 5 numbers in which case l would be 5; Keep in mind that the start/end values for the first number that's tweened are always stored in the s and c properties to conserve memory. All additional values thereafter are stored in xn1, xn2, etc. 28153 * - xfirst: The first instance of any sub-CSSPropTweens that are tweening properties of this instance. For example, we may split up a boxShadow tween so that there's a main CSSPropTween of type:1 that has various xs* and xn* values associated with the h-shadow, v-shadow, blur, color, etc. Then we spawn a CSSPropTween for each of those that has a higher priority and runs BEFORE the main CSSPropTween so that the values are all set by the time it needs to re-assemble them. The xfirst gives us an easy way to identify the first one in that chain which typically ends at the main one (because they're all prepende to the linked list) 28154 * - plugin: The TweenPlugin instance that will handle the tweening of any complex values. For example, sometimes we don't want to use normal subt
28154weens (like xfirst refers to) to tween the values - we might want ThrowPropsPlugin or BezierPlugin some other plugin to do the actual tweening, so we create a plugin instance and store a reference here. We need this reference so that if we get a request to round values or disable a tween, we can pass along that request. 28155 * - data: Arbitrary data that needs to be stored with the CSSPropTween. Typically if we're going to have a plugin handle the tweening of a complex-value tween, we create a generic object that stores the END values that we're tweening to and the CSSPropTween's xs1, xs2, etc. have the starting values. We store that object as data. That way, we can simply pass that object to the plugin and use the CSSPropTween as the target. 28156 * - setRatio: Only used for type:2 tweens that require custom functionality. In this case, we call the CSSPropTween's setRatio() method and pass the ratio each time the tween updates. This isn't quite as efficient as doing things directly in the CSSPlugin's setRatio() method, but it's very convenient and flexible. 28157 * @param {!Object} t Target object whose property will be tweened. Often a DOM element, but not always. It could be anything. 28158 * @param {string} p Property to tween (name). For example, to tween element.width, p would be "width". 28159 * @param {number} s Starting numeric value 28160 * @param {number} c Change in numeric value over the course of the entire tween. For example, if element.width starts at 5 and should end at 100, c would be 95. 28161 * @param {CSSPropTween=} next The next CSSPropTween in the linked list. If one is defined, we will define its _prev as the new instance, and the new instance's _next will be pointed at it. 28162 * @param {number=} type The type of CSSPropTween where -1 = a non-tweening value, 0 = a standard simple tween, 1 = a complex value (like one that has multiple numbers in a comma- or space-delimited string like border:"1px solid red"), and 2 = one that uses a custom setRatio function that does all of the work of applying the values on each update. 28163 * @param {string=} n Name of the property that should be used for overwriting purposes which is typically the same as p but not always. For example, we may need to create a subtween for the 2nd part of a "clip:rect(...)" tween in which case "p" might be xs1 but "n" is still "clip" 28164 * @param {boolean=} r If true, the value(s) should be rounded 28165 * @param {number=} pr Priority in the linked list order. Higher priority CSSPropTweens will be updated before lower priority ones. The default priority is 0. 28166 * @param {string=} b Beginning value. We store this to ensure that it is EXACTLY what it was when the tween began without any risk of interpretation issues. 28167 * @param {string=} e Ending value. We store this to ensure that it is EXACTLY what the user defined at the end of the tween without any risk of interpretation issues. 28168 */ 28169 CSSPropTween = _internals.CSSPropTween = function(t, p, s, c, next, type, n, r, pr, b, e) { 28170 this.t = t; //target 28171 this.p = p; //property 28172 this.s = s; //starting value 28173 this.c = c; //change value 28174 this.n = n || p; //name that this CSSPropTween should be associated to (usually the same as p, but not always - n is what overwriting looks at) 28175 if (!(t instanceof CSSPropTween)) { 28176 _overwriteProps.push(this.n); 28177 } 28178 this.r = !r ? r : (typeof(r) === "function") ? r : Math.round; //round (boolean) 28179 this.type = type || 0; //0 = normal tween, -1 = non-tweening (in which case xs0 will be applied to the target's property, like tp.t[tp.p] = tp.xs0), 1 = complex-value SpecialProp, 2 = custom setRatio() that does all the work 28180 if (pr) { 28181 this.pr = pr; 28182 _hasPriority = true; 28183 } 28184 this.b = (b === undefined) ? s : b; 28185 this.e = (e === undefined) ? s + c : e; 28186 if (next) { 28187 this._next = next; 28188 next._prev = this; 28189 } 28190 }, 28191 28192 _addNonTweeningNumericPT = function(target, prop, start, end, next, overwriteProp) { //cleans up some code redundancies and helps minification. Just a fast way to add a NUMERIC non-tweening CSSPropTween
28193 var pt = new CSSPropTween(target, prop, start, end - start, next, -1, overwriteProp); 28194 pt.b = start; 28195 pt.e = pt.xs0 = end; 28196 return pt; 28197 }, 28198 28199 /** 28200 * Takes a target, the beginning value and ending value (as strings) and parses them into a CSSPropTween (possibly with child CSSPropTweens) that accommodates multiple numbers, colors, comma-delimited values, etc. For example: 28201 * sp.parseComplex(element, "boxShadow", "5px 10px 20px rgb(255,102,51)", "0px 0px 0px red", true, "0px 0px 0px rgb(0,0,0,0)", pt); 28202 * It will walk through the beginning and ending values (which should be in the same format with the same number and type of values) and figure out which parts are numbers, what strings separate the numeric/tweenable values, and then create the CSSPropTweens accordingly. If a plugin is defined, no child CSSPropTweens will be created. Instead, the ending values will be stored in the "data" property of the returned CSSPropTween like: {s:-5, xn1:-10, xn2:-20, xn3:255, xn4:0, xn5:0} so that it can be fed to any other plugin and it'll be plain numeric tweens but the recomposition of the complex value will be handled inside CSSPlugin's setRatio(). 28203 * If a setRatio is defined, the type of the CSSPropTween will be set to 2 and recomposition of the values will be the responsibility of that method. 28204 * 28205 * @param {!Object} t Target whose property will be tweened 28206 * @param {!string} p Property that will be tweened (its name, like "left" or "backgroundColor" or "boxShadow") 28207 * @param {string} b Beginning value 28208 * @param {string} e Ending value 28209 * @param {boolean} clrs If true, the value could contain a color value like "rgb(255,0,0)" or "#F00" or "red". The default is false, so no colors will be recognized (a performance optimization) 28210 * @param {(string|number|Object)} dflt The default beginning value that should be used if no valid beginning value is defined or if the number of values inside the complex beginning and ending values don't match 28211 * @param {?CSSPropTween} pt CSSPropTween instance that is the current head of the linked list (we'll prepend to this). 28212 * @param {number=} pr Priority in the linked list order. Higher priority properties will be updated before lower priority ones. The default priority is 0. 28213 * @param {TweenPlugin=} plugin If a plugin should handle the tweening of extra properties, pass the plugin instance here. If one is defined, then NO subtweens will be created for any extra properties (the properties will be created - just not additional CSSPropTween instances to tween them) because the plugin is expected to do so. However, the end values WILL be populated in the "data" property, like {s:100, xn1:50, xn2:300} 28214 * @param {function(number)=} setRatio If values should be set in a custom function instead of being pieced together in a type:1 (complex-value) CSSPropTween, define that custom function here. 28215 * @return {CSSPropTween} The first CSSPropTween in the linked list which includes the new one(s) added by the parseComplex() call. 28216 */ 28217 _parseComplex = CSSPlugin.parseComplex = function(t, p, b, e, clrs, dflt, pt, pr, plugin, setRatio) { 28218 //DEBUG: _log("parseComplex: "+p+", b: "+b+", e: "+e); 28219 b = b || dflt || ""; 28220 if (typeof(e) === "function") { 28221 e = e(_index, _target); 28222 } 28223 pt = new CSSPropTween(t, p, 0, 0, pt, (setRatio ? 2 : 1), null, false, pr, b, e); 28224 e += ""; //ensures it's a string 28225 if (clrs && _colorExp.test(e + b)) { //if colors are found, normalize the formatting to rgba() or hsla(). 28226 e = [b, e]; 28227 CSSPlugin.colorStringFilter(e); 28228 b = e[0]; 28229 e = e[1]; 28230 } 28231 var ba = b.split(", ").join(",").split(" "), //beginning array 28232 ea = e.split(", ").join(",").split(" "), //ending array 28233 l = ba.length, 28234 autoRound = (_autoRound !== false), 28235 i, xi, ni, bv, ev, bnums, enums, bn, hasAlpha, temp, cv, str, useHSL; 28236 if (e.indexOf(",") !== -1 || b.indexOf(",") !== -1) { 28237 if ((e + b).indexOf("rgb") !== -1 || (e + b).indexOf("hsl") !== -1) { //keep rgb(), rgba(), hsl(), and hsla() values together! (remember, we're splitting on spaces) 28238 ba = ba.join(" ").replace(_commasOutsideParenExp, ", ").split(" "); 28239 ea = ea.join(" ").replace(_commasOutsideParenExp, ", ").split(" "); 28240 } else { 28241 ba = ba.join(" ").split(",").join(", ").split(" "); 28242 ea = ea.join(" ").split(",").join(", ").split(" "); 28243 } 28244 l = ba.length; 28245 } 28246 if (l !== ea.length) { 28247 //DEBUG: _log("mismatched formatting detected on " + p + " (" + b + " vs " + e + ")"); 28248 ba = (dflt || "").split(" "); 28249 l = ba.length; 28250 } 28251 pt.plugin = plugin; 28252 pt.setRatio = setRatio; 28253 _colorExp.lastIndex = 0; 28254 for (i = 0; i < l; i++) { 28255 bv = ba[i]; 28256 ev = ea[i] + ""; 28257 bn = parseFloat(bv); 28258 //if the value begins with a number (most common). It's fine if it has a suffix like px 28259 if (bn || bn === 0) { 28260 pt.appendXtra("", bn, _parseChange(ev, bn), ev.replace(_relNumExp, ""), (autoRound && ev.indexOf("px") !== -1) ? Math.round : false, true); 28261 28262 //if the value is a color 28263 } else if (clrs && _colorExp.test(bv)) { 28264 str = ev.indexOf(")") + 1; 28265 str = ")" + (str ? ev.substr(str) : ""); //if there's a comma or ) at the end, retain it. 28266 useHSL = (ev.indexOf("hsl") !== -1 && _supportsOpacity); 28267 temp = ev; //original string value so we can look for any prefix later. 28268 bv = _parseColor(bv, useHSL); 28269 ev = _parseColor(ev, useHSL); 28270 hasAlpha = (bv.length + ev.length > 6); 28271 if (hasAlpha && !_supportsOpacity && ev[3] === 0) { //older versions of IE don't support rgba(), so if the destination alpha is 0, just use "transparent" for the end color 28272 pt["xs" + pt.l] += pt.l ? " transparent" : "transparent";
28273 pt.e = pt.e.split(ea[i]).join("transparent"); 28274 } else { 28275 if (!_supportsOpacity) { //old versions of IE don't support rgba(). 28276 hasAlpha = false; 28277 } 28278 if (useHSL) { 28279 pt.appendXtra(temp.substr(0, temp.indexOf("hsl")) + (hasAlpha ? "hsla(" : "hsl("), bv[0], _parseChange(ev[0], bv[0]), ",", false, true) 28280 .appendXtra("", bv[1], _parseChange(ev[1], bv[1]), "%,", false) 28281 .appendXtra("", bv[2], _parseChange(ev[2], bv[2]), (hasAlpha ? "%," : "%" + str), false); 28282 } else { 28283 pt.appendXtra(temp.substr(0, temp.indexOf("rgb")) + (hasAlpha ? "rgba(" : "rgb("), bv[0], ev[0] - bv[0], ",", Math.round, true) 28284 .appendXtra("", bv[1], ev[1] - bv[1], ",", Math.round) 28285 .appendXtra("", bv[2], ev[2] - bv[2], (hasAlpha ? "," : str), Math.round); 28286 } 28287 28288 if (hasAlpha) { 28289 bv = (bv.length < 4) ? 1 : bv[3]; 28290 pt.appendXtra("", bv, ((ev.length < 4) ? 1 : ev[3]) - bv, str, false); 28291 } 28292 } 28293 _colorExp.lastIndex = 0; //otherwise the test() on the RegExp could move the lastIndex and taint future results. 28294 28295 } else { 28296 bnums = bv.match(_numExp); //gets each group of numbers in the beginning value string and drops them into an array 28297 28298 //if no number is found, treat it as a non-tweening value and just append the string to the current xs. 28299 if (!bnums) { 28300 pt["xs" + pt.l] += (pt.l || pt["xs" + pt.l]) ? " " + ev : ev; 28301 28302 //loop through all the numbers that are found and construct the extra values on the pt. 28303 } else { 28304 enums = ev.match(_relNumExp); //get each group of numbers in the end value string and drop them into an array. We allow relative values too, like +=50 or -=.5 28305 if (!enums || enums.length !== bnums.length) { 28306 //DEBUG: _log("mismatched formatting detected on " + p + " (" + b + " vs " + e + ")"); 28307 return pt; 28308 } 28309 ni = 0; 28310 for (xi = 0; xi < bnums.length; xi++) { 28311 cv = bnums[xi]; 28312 temp = bv.indexOf(cv, ni); 28313 pt.appendXtra(bv.substr(ni, temp - ni), Number(cv), _parseChange(enums[xi], cv), "", (autoRound && bv.substr(temp + cv.length, 2) === "px") ? Math.round : false, (xi === 0)); 28314 ni = temp + cv.length; 28315 } 28316 pt["xs" + pt.l] += bv.substr(ni); 28317 } 28318 } 28319 } 28320 //if there are relative values ("+=" or "-=" prefix), we need to adjust the ending value to eliminate the prefixes and combine the values properly. 28321 if (e.indexOf("=") !== -1) if (pt.data) { 28322 str = pt.xs0 + pt.data.s; 28323 for (i = 1; i < pt.l; i++) { 28324 str += pt["xs" + i] + pt.data["xn" + i]; 28325 } 28326 pt.e = str + pt["xs" + i]; 28327 } 28328 if (!pt.l) { 28329 pt.type = -1; 28330 pt.xs0 = pt.e; 28331 } 28332 return pt.xfirst || pt; 28333 }, 28334 i = 9; 28335 28336 28337 p = CSSPropTween.prototype; 28338 p.l = p.pr = 0; //length (number of extra properties like xn1, xn2, xn3, etc. 28339 while (--i > 0) { 28340 p["xn" + i] = 0; 28341 p["xs" + i] = ""; 28342 } 28343 p.xs0 = ""; 28344 p._next = p._prev = p.xfirst = p.data = p.plugin = p.setRatio = p.rxp = null; 28345 28346 28347 /** 28348 * Appends and extra tweening value to a CSSPropTween and automatically manages any prefix and suffix strings. The first extra value is stored in the s and c of the main CSSPropTween instance, but thereafter any extras are stored in the xn1, xn2, xn3, etc. The prefixes and suffixes are stored in the xs0, xs1, xs2, etc. properties. For example, if I walk through a clip value like "rect(10px, 5px, 0px, 20px)", the values would be stored like this: 28349 * xs0:"rect(", s:10, xs1:"px, ", xn1:5, xs2:"px, ", xn2:0, xs3:"px, ", xn3:20, xn4:"px)" 28350 * And they'd all get joined together when the CSSPlugin renders (in the setRatio() method). 28351 * @param {string=} pfx Prefix (if any) 28352 * @param {!number} s Starting value 28353 * @param {!number} c Change in numeric value over the course of the entire tween. For example, if the start is 5 and the end is 100, the change would be 95. 28354 * @param {string=} sfx Suffix (if any) 28355 * @param {boolean=} r Round (if true). 28356 * @param {boolean=} pad If true, this extra value should be separated by the previous one by a space. If there is no previous extra and pad is true, it will automatically drop the space. 28357 * @return {CSSPropTween} returns itself so that multiple methods can be chained together. 28358 */ 28359 p.appendXtra = function(pfx, s, c, sfx, r, pad) { 28360 var pt = this, 28361 l = pt.l; 28362 pt["xs" + l] += (pad && (l || pt["xs" + l])) ? " " + pfx : pfx || ""; 28363 if (!c) if (l !== 0 && !pt.plugin) { //typically we'll combine non-changing values right into the xs to optimize performance, but we don't combine them when there's a plugin that will be tweening the values because it may depend on the values being split apart, like for a bezier, if a value doesn't change between the first and second iteration but then it does on the 3rd, we'll run into trouble because there's no xn slot for that value! 28364 pt["xs" + l] += s + (sfx || ""); 28365 return pt; 28366 } 28367 pt.l++; 28368 pt.type = pt.setRatio ? 2 : 1; 28369 pt["xs" + pt.l] = sfx || ""; 28370 if (l > 0) { 28371 pt.data["xn" + l] = s + c; 28372 pt.rxp["xn" + l] = r; //round extra property (we need to tap into this in the _parseToProxy() method) 28373 pt["xn" + l] = s; 28374 if (!pt.plugin) { 28375 pt.xfirst = new CSSPropTween(pt, "xn" + l, s, c, pt.xfirst || pt, 0, pt.n, r, pt.pr); 28376 pt.xfirst.xs0 = 0; //just to ensure that the property stays numeric which helps modern browsers speed up processing. Remember, in the setRatio() method, we do pt.t[pt.p] = val + pt.xs0 so if pt.xs0 is "" (the default), it'll cast the end value as a string. When a property is a number sometimes and a string sometimes, it prevents the compiler from locking in the data type, slowing things down slightly. 28377 } 28378 return pt; 28379 } 28380 pt.data = {s:s + c}; 28381 pt.rxp = {}; 28382 pt.s = s; 28383 pt.c = c; 28384 pt.r = r; 28385 return pt; 28386 }; 28387 28388 /** 28389 * @constructor A SpecialProp is basically a css property that needs to be treated in a non-standard way, like if it may contain a complex value like boxShadow:"5px 10px 15px rgb(255, 102, 51)" or if it is associated with another plugin like ThrowPropsPlugin or BezierPlugin. Every SpecialProp is associated with a particular property name like "boxShadow" or "throwProps" or "bezier" and it will intercept those values in the vars object that's passed to the CSSPlugin and handle them accordingly. 28390 * @param {!string} p Property name (like "boxShadow" or "throwProps") 28391 * @param {Object=}
28391 options An object containing any of the following configuration options: 28392 * - defaultValue: the default value 28393 * - parser: A function that should be called when the associated property name is found in the vars. This function should return a CSSPropTween instance and it should ensure that it is properly inserted into the linked list. It will receive 4 paramters: 1) The target, 2) The value defined in the vars, 3) The CSSPlugin instance (whose _firstPT should be used for the linked list), and 4) A computed style object if one was calculated (this is a speed optimization that allows retrieval of starting values quicker) 28394 * - formatter: a function that formats any value received for this special property (for example, boxShadow could take "5px 5px red" and format it to "5px 5px 0px 0px red" so that both the beginning and ending values have a common order and quantity of values.) 28395 * - prefix: if true, we'll determine whether or not this property requires a vendor prefix (like Webkit or Moz or ms or O) 28396 * - color: set this to true if the value for this SpecialProp may contain color-related values like rgb(), rgba(), etc. 28397 * - priority: priority in the linked list order. Higher priority SpecialProps will be updated before lower priority ones. The default priority is 0. 28398 * - multi: if true, the formatter should accommodate a comma-delimited list of values, like boxShadow could have multiple boxShadows listed out. 28399 * - collapsible: if true, the formatter should treat the value like it's a top/right/bottom/left value that could be collapsed, like "5px" would apply to all, "5px, 10px" would use 5px for top/bottom and 10px for right/left, etc. 28400 * - keyword: a special keyword that can [optionally] be found inside the value (like "inset" for boxShadow). This allows us to validate beginning/ending values to make sure they match (if the keyword is found in one, it'll be added to the other for consistency by default). 28401 */ 28402 var SpecialProp = function(p, options) { 28403 options = options || {}; 28404 this.p = options.prefix ? _checkPropPrefix(p) || p : p; 28405 _specialProps[p] = _specialProps[this.p] = this; 28406 this.format = options.formatter || _getFormatter(options.defaultValue, options.color, options.collapsible, options.multi); 28407 if (options.parser) { 28408 this.parse = options.parser; 28409 } 28410 this.clrs = options.color; 28411 this.multi = options.multi; 28412 this.keyword = options.keyword; 28413 this.dflt = options.defaultValue; 28414 this.allowFunc = options.allowFunc; 28415 this.pr = options.priority || 0; 28416 }, 28417 28418 //shortcut for creating a new SpecialProp that can accept multiple properties as a comma-delimited list (helps minification). dflt can be an array for multiple values (we don't do a comma-delimited list because the default value may contain commas, like rect(0px,0px,0px,0px)). We attach this method to the SpecialProp class/object instead of using a private _createSpecialProp() method so that we can tap into it externally if necessary, like from another plugin. 28419 _registerComplexSpecialProp = _internals._registerComplexSpecialProp = function(p, options, defaults) { 28420 if (typeof(options) !== "object") { 28421 options = {parser:defaults}; //to make backwards compatible with older versions of BezierPlugin and ThrowPropsPlugin 28422 } 28423 var a = p.split(","), 28424 d = options.defaultValue, 28425 i, temp; 28426 defaults = defaults || [d]; 28427 for (i = 0; i < a.length; i++) { 28428 options.prefix = (i === 0 && options.prefix); 28429 options.defaultValue = defaults[i] || d; 28430 temp = new SpecialProp(a[i], options); 28431 } 28432 }, 28433 28434 //creates a placeholder special prop for a plugin so that the property gets caught the first time a tween of it is attempted, and at that time it makes the plugin register itself, thus taking over for all future tweens of that property. This allows us to not mandate that things load in a particular order and it also allows us to log() an error that informs the user when they attempt to tween an external plugin-related property without loading its .js file. 28435 _registerPluginProp = _internals._registerPluginProp = function(p) { 28436 if (!_specialProps[p]) { 28437 var pluginName = p.charAt(0).toUpperCase() + p.substr(1) + "Plugin"; 28438 _registerComplexSpecialProp(p, {parser:function(t, e, p, cssp, pt, plugin, vars) { 28439 var pluginClass = _globals.com.greensock.plugins[pluginName]; 28440 if (!pluginClass) { 28441 _log("Error: " + pluginName + " js file not loaded."); 28442 return pt; 28443 } 28444 pluginClass._cssRegister(); 28445 return _specialProps[p].parse(t, e, p, cssp, pt, plugin, vars); 28446 }}
28446); 28447 } 28448 }; 28449 28450 28451 p = SpecialProp.prototype; 28452 28453 /** 28454 * Alias for _parseComplex() that automatically plugs in certain values for this SpecialProp, like its property name, whether or not colors should be sensed, the default value, and priority. It also looks for any keyword that the SpecialProp defines (like "inset" for boxShadow) and ensures that the beginning and ending values have the same number of values for SpecialProps where multi is true (like boxShadow and textShadow can have a comma-delimited list) 28455 * @param {!Object} t target element 28456 * @param {(string|number|object)} b beginning value 28457 * @param {(string|number|object)} e ending (destination) value 28458 * @param {CSSPropTween=} pt next CSSPropTween in the linked list 28459 * @param {TweenPlugin=} plugin If another plugin will be tweening the complex value, that TweenPlugin instance goes here. 28460 * @param {function=} setRatio If a custom setRatio() method should be used to handle this complex value, that goes here. 28461 * @return {CSSPropTween=} First CSSPropTween in the linked list 28462 */ 28463 p.parseComplex = function(t, b, e, pt, plugin, setRatio) { 28464 var kwd = this.keyword, 28465 i, ba, ea, l, bi, ei; 28466 //if this SpecialProp's value can contain a comma-delimited list of values (like boxShadow or textShadow), we must parse them in a special way, and look for a keyword (like "inset" for boxShadow) and ensure that the beginning and ending BOTH have it if the end defines it as such. We also must ensure that there are an equal number of values specified (we can't tween 1 boxShadow to 3 for example) 28467 if (this.multi) if (_commasOutsideParenExp.test(e) || _commasOutsideParenExp.test(b)) { 28468 ba = b.replace(_commasOutsideParenExp, "|").split("|"); 28469 ea = e.replace(_commasOutsideParenExp, "|").split("|"); 28470 } else if (kwd) { 28471 ba = [b]; 28472 ea = [e]; 28473 } 28474 if (ea) { 28475 l = (ea.length > ba.length) ? ea.length : ba.length; 28476 for (i = 0; i < l; i++) { 28477 b = ba[i] = ba[i] || this.dflt; 28478 e = ea[i] = ea[i] || this.dflt; 28479 if (kwd) { 28480 bi = b.indexOf(kwd); 28481 ei = e.indexOf(kwd); 28482 if (bi !== ei) { 28483 if (ei === -1) { //if the keyword isn't in the end value, remove it from the beginning one. 28484 ba[i] = ba[i].split(kwd).join(""); 28485 } else if (bi === -1) { //if the keyword isn't in the beginning, add it. 28486 ba[i] += " " + kwd; 28487 } 28488 } 28489 } 28490 } 28491 b = ba.join(", "); 28492 e = ea.join(", "); 28493 } 28494 return _parseComplex(t, this.p, b, e, this.clrs, this.dflt, pt, this.pr, plugin, setRatio); 28495 }; 28496 28497 /** 28498 * Accepts a target and end value and spits back a CSSPropTween that has been inserted into the CSSPlugin's linked list and conforms with all the conventions we use internally, like type:-1, 0, 1, or 2, setting up any extra property tweens, priority, etc. For example, if we have a boxShadow SpecialProp and call: 28499 * this._firstPT = sp.parse(element, "5px 10px 20px rgb(2550,102,51)", "boxShadow", this); 28500 * It should figure out the starting value of the element's boxShadow, compare it to the provided end value and create all the necessary CSSPropTweens of the appropriate types to tween the boxShadow. The CSSPropTween that gets spit back should already be inserted into the linked list (the 4th parameter is the current head, so prepend to that). 28501 * @param {!Object} t Target object whose property is being tweened 28502 * @param {Object} e End value as provided in the vars object (typically a string, but not always - like a throwProps would be an object). 28503 * @param {!string} p Property name 28504 * @param {!CSSPlugin} cssp The CSSPlugin instance that should be associated with this tween. 28505 * @param {?CSSPropTween} pt The CSSPropTween that is the current head of the linked list (we'll prepend to it) 28506 * @param {TweenPlugin=} plugin If a plugin will be used to tween the parsed value, this is the plugin instance. 28507 * @param {Object=} vars Original vars object that contains the data for parsing. 28508 * @return {CSSPropTween} The first CSSPropTween in the linked list which includes the new one(s) added by the parse() call. 28509 */ 28510 p.parse = function(t, e, p, cssp, pt, plugin, vars) { 28511 return this.parseComplex(t.style, this.format(_getStyle(t, this.p, _cs, false, this.dflt)), this.format(e), pt, plugin); 28512 }; 28513 28514 /** 28515 * Registers a special property that should be intercepted from any "css" objects defined in tweens. This allows you to handle them however you want without CSSPlugin doing it for you. The 2nd parameter should be a function that accepts 3 parameters: 28516 * 1) Target object whose property should be tweened (typically a DOM element) 28517 * 2) The end/destination value (could be a string, number, object, or whatever you want) 28518 * 3) The tween instance (you probably don't need to worry about this, but it can be useful for looking up information like the duration) 28519 * 28520 * Then, your function should return a function which will be called each time the tween gets rendered, passing a numeric "ratio" parameter to your function that indicates the change factor (usually between 0 and 1). For example: 28521 * 28522 * CSSPlugin.registerSpecialProp("myCustomProp", function(target, value, tween) { 28523 * var start = target.style.width;
28524 * return function(ratio) { 28525 * target.style.width = (start + value * ratio) + "px"; 28526 * console.log("set width to " + target.style.width); 28527 * } 28528 * }, 0); 28529 * 28530 * Then, when I do this tween, it will trigger my special property: 28531 * 28532 * TweenLite.to(element, 1, {css:{myCustomProp:100}}); 28533 * 28534 * In the example, of course, we're just changing the width, but you can do anything you want. 28535 * 28536 * @param {!string} name Property name (or comma-delimited list of property names) that should be intercepted and handled by your function. For example, if I define "myCustomProp", then it would handle that portion of the following tween: TweenLite.to(element, 1, {css:{myCustomProp:100}}) 28537 * @param {!function(Object, Object, Object, string):function(number)} onInitTween The function that will be called when a tween of this special property is performed. The function will receive 4 parameters: 1) Target object that should be tweened, 2) Value that was passed to the tween, 3) The tween instance itself (rarely used), and 4) The property name that's being tweened. Your function should return a function that should be called on every update of the tween. That function will receive a single parameter that is a "change factor" value (typically between 0 and 1) indicating the amount of change as a ratio. You can use this to determine how to set the values appropriately in your function. 28538 * @param {number=} priority Priority that helps the engine determine the order in which to set the properties (default: 0). Higher priority properties will be updated before lower priority ones. 28539 */ 28540 CSSPlugin.registerSpecialProp = function(name, onInitTween, priority) { 28541 _registerComplexSpecialProp(name, {parser:function(t, e, p, cssp, pt, plugin, vars) { 28542 var rv = new CSSPropTween(t, p, 0, 0, pt, 2, p, false, priority); 28543 rv.plugin = plugin; 28544 rv.setRatio = onInitTween(t, e, cssp._tween, p); 28545 return rv; 28546 }, priority:priority}); 28547 }; 28548 28549 28550 28551 28552 28553 28554 //transform-related methods and properties 28555 CSSPlugin.useSVGTransformAttr = true; //Safari and Firefox both have some rendering bugs when applying CSS transforms to SVG elements, so default to using the "transform" attribute instead (users can override this). 28556 var _transformProps = ("scaleX,scaleY,scaleZ,x,y,z,skewX,skewY,rotation,rotationX,rotationY,perspective,xPercent,yPercent").split(","), 28557 _transformProp = _checkPropPrefix("transform"), //the Javascript (camelCase) transform property, like msTransform, WebkitTransform, MozTransform, or OTransform. 28558 _transformPropCSS = _prefixCSS + "transform", 28559 _transformOriginProp = _checkPropPrefix("transformOrigin"), 28560 _supports3D = (_checkPropPrefix("perspective") !== null), 28561 Transform = _internals.Transform = function() { 28562 this.perspective = parseFloat(CSSPlugin.defaultTransformPerspective) || 0; 28563 this.force3D = (CSSPlugin.defaultForce3D === false || !_supports3D) ? false : CSSPlugin.defaultForce3D || "auto"; 28564 }, 28565 _SVGElement = _gsScope.SVGElement, 28566 _useSVGTransformAttr, 28567 //Some browsers (like Firefox and IE) don't honor transform-origin properly in SVG elements, so we need to manually adjust the matrix accordingly. We feature detect here rather than always doing the conversion for certain browsers because they may fix the problem at some point in the future. 28568 28569 _createSVG = function(type, container, attributes) { 28570 var element = _doc.createElementNS("http://www.w3.org/2000/svg", type), 28571 reg = /([a-z])([A-Z])/g, 28572 p; 28573 for (p in attributes) { 28574 element.setAttributeNS(null, p.replace(reg, "$1-$2").toLowerCase(), attributes[p]); 28575 } 28576 container.appendChild(element); 28577 return element; 28578 }, 28579 _docElement = _doc.documentElement || {}, 28580 _forceSVGTransformAttr = (function() { 28581 //IE and Android stock don't support CSS transforms on SVG elements, so we must write them to the "transform" attribute. We populate this variable in the _parseTransform() method, and only if/when we come across an SVG element 28582 var force = _ieVers || (/Android/i.test(_agent) && !_gsScope.chrome), 28583 svg, rect, width; 28584 if (_doc.createElementNS && _docElement.appendChild && !force) { //IE8 and earlier doesn't support SVG anyway 28585 svg = _createSVG("svg", _docElement); 28586 rect = _createSVG("rect", svg, {width:100, height:50, x:100}); 28587 width = rect.getBoundingClientRect().width; 28588 rect.style[_transformOriginProp] = "50% 50%"; 28589 rect.style[_transformProp] = "scaleX(0.5)"; 28590 force = (width === rect.getBoundingClientRect().width && !(_is
28590Firefox && _supports3D)); //note: Firefox fails the test even though it does support CSS transforms in 3D. Since we can't push 3D stuff into the transform attribute, we force Firefox to pass the test here (as long as it does truly support 3D). 28591 _docElement.removeChild(svg); 28592 } 28593 return force; 28594 })(), 28595 _parseSVGOrigin = function(e, local, decoratee, absolute, smoothOrigin, skipRecord) { 28596 var tm = e._gsTransform, 28597 m = _getMatrix(e, true), 28598 v, x, y, xOrigin, yOrigin, a, b, c, d, tx, ty, determinant, xOriginOld, yOriginOld; 28599 if (tm) { 28600 xOriginOld = tm.xOrigin; //record the original values before we alter them. 28601 yOriginOld = tm.yOrigin; 28602 } 28603 if (!absolute || (v = absolute.split(" ")).length < 2) { 28604 b = e.getBBox(); 28605 if (b.x === 0 && b.y === 0 && b.width + b.height === 0) { //some browsers (like Firefox) misreport the bounds if the element has zero width and height (it just assumes it's at x:0, y:0), thus we need to manually grab the position in that case. 28606 b = {x: parseFloat(e.hasAttribute("x") ? e.getAttribute("x") : e.hasAttribute("cx") ? e.getAttribute("cx") : 0) || 0, y: parseFloat(e.hasAttribute("y") ? e.getAttribute("y") : e.hasAttribute("cy") ? e.getAttribute("cy") : 0) || 0, width:0, height:0}; 28607 } 28608 local = _parsePosition(local).split(" "); 28609 v = [(local[0].indexOf("%") !== -1 ? parseFloat(local[0]) / 100 * b.width : parseFloat(local[0])) + b.x, 28610 (local[1].indexOf("%") !== -1 ? parseFloat(local[1]) / 100 * b.height : parseFloat(local[1])) + b.y]; 28611 } 28612 decoratee.xOrigin = xOrigin = parseFloat(v[0]); 28613 decoratee.yOrigin = yOrigin = parseFloat(v[1]); 28614 if (absolute && m !== _identity2DMatrix) { //if svgOrigin is being set, we must invert the matrix and determine where the absolute point is, factoring in the current transforms. Otherwise, the svgOrigin would be based on the element's non-transformed position on the canvas. 28615 a = m[0]; 28616 b = m[1]; 28617 c = m[2]; 28618 d = m[3]; 28619 tx = m[4]; 28620 ty = m[5]; 28621 determinant = (a * d - b * c); 28622 if (determinant) { //if it's zero (like if scaleX and scaleY are zero), skip it to avoid errors with dividing by zero. 28623 x = xOrigin * (d / determinant) + yOrigin * (-c / determinant) + ((c * ty - d * tx) / determinant); 28624 y = xOrigin * (-b / determinant) + yOrigin * (a / determinant) - ((a * ty - b * tx) / determinant); 28625 xOrigin = decoratee.xOrigin = v[0] = x; 28626 yOrigin = decoratee.yOrigin = v[1] = y; 28627 } 28628 } 28629 if (tm) { //avoid jump when transformOrigin is changed - adjust the x/y values accordingly 28630 if (skipRecord) { 28631 decoratee.xOffset = tm.xOffset; 28632 decoratee.yOffset = tm.yOffset; 28633 tm = decoratee; 28634 } 28635 if (smoothOrigin || (smoothOrigin !== false && CSSPlugin.defaultSmoothOrigin !== false)) { 28636 x = xOrigin - xOriginOld; 28637 y = yOrigin - yOriginOld; 28638 //originally, we simply adjusted the x and y values, but that would cause problems if, for example, you created a rotational tween part-way through an x/y tween. Managing the offset in a separate variable gives us ultimate flexibility. 28639 //tm.x -= x - (x * m[0] + y * m[2]); 28640 //tm.y -= y - (x * m[1] + y * m[3]); 28641 tm.xOffset += (x * m[0] + y * m[2]) - x; 28642 tm.yOffset += (x * m[1] + y * m[3]) - y; 28643 } else { 28644 tm.xOffset = tm.yOffset = 0; 28645 } 28646 } 28647 if (!skipRecord) { 28648 e.setAttribute("data-svg-origin", v.join(" ")); 28649 } 28650 }, 28651 _getBBoxHack = function(swapIfPossible) { //works around issues in some browsers (like Firefox) that don't correctly report getBBox() on SVG elements inside a <defs> element and/or <mask>. We try creating an SVG, adding it to the documentElement and toss the element in there so that it's definitely part of the rendering tree, then grab the bbox and if it works, we actually swap out the original getBBox() method for our own that does these extra steps whenever getBBox is needed. This helps ensure that performance is optimal (only do all these extra steps when absolutely necessary...most elements don't need it). 28652 var svg = _createElement("svg", (this.ownerSVGElement && this.ownerSVGElement.getAttribute("xmlns")) || "http://www.w3.org/2000/svg"), 28653 oldParent = this.parentNode, 28654 oldSibling = this.nextSibling, 28655 oldCSS = this.style.cssText, 28656 bbox; 28657 _docElement.appendChild(svg); 28658 svg.appendChild(this); 28659 this.style.display = "block"; 28660 if (swapIfPossible) { 28661 try { 28662 bbox = this.getBBox(); 28663 this._originalGetBBox = this.getBBox; 28664 this.getBBox = _getBBoxHack; 28665 } catch (e) { } 28666 } else if (this._originalGetBBox) { 28667 bbox = this._originalGetBBox(); 28668 } 28669 if (oldSibling) { 28670 oldParent.insertBefore(this, oldSibling); 28671 } else { 28672 oldParent.appendChild(this); 28673 } 28674 _docElement.removeChild(svg); 28675 this.style.cssText = oldCSS; 28676 return bbox; 28677 }, 28678 _getBBox = function(e) { 28679 try { 28680 return e.getBBox(); //Firefox throws errors if you try calling getBBox() on an SVG element that's not rendered (like in a <symbol> or <defs>). https://bugzilla.mozilla.org/show_bug.cgi?id=612118 28681 } catch (error) { 28682 return _getBBoxHack.call(e, true); 28683 } 28684 }, 28685 _isSVG = function(e) { //reports if the element is an SVG on which getBBox() actually works 28686 return !!(_SVGElement && e.getCTM && (!e.parentNode || e.ownerSVGElement) && _getBBox(e)); 28687 }, 28688 _identity2DMatrix = [1,0,0,1,0,0], 28689 _getMatrix = function(e, force2D) { 28690 var tm = e._gsTransform || new Transform(), 28691 rnd = 100000, 28692 style = e.style, 28693 isDefault, s, m, n, dec, nextSibling, parent; 28694 if (_transformProp) { 28695 s = _getStyle(e, _transformPropCSS, null, true); 28696 } else if (e.currentStyle) { 28697 //for older versions of IE, we need to interpret the filter portion that is in the format: progid:DXImageTransform.Microsoft.Matrix(M11=6.123233995736766e-17, M12=-1, M21=1, M22=6.123233995736766e-17, sizingMethod='auto expand') Notice that we need to swap b and c compared to a normal matrix. 28698 s = e.currentStyle.filter.match(_ieGetMatrixExp); 28699 s = (s && s.length === 4) ? [s[0].substr(4), Number(s[2].substr(4)), Number(s[1].substr(4)), s[3].substr(4), (tm.x || 0), (tm.y || 0)].join(",") : ""; 28700 }
28701 isDefault = (!s || s === "none" || s === "matrix(1, 0, 0, 1, 0, 0)"); 28702 if (_transformProp && isDefault && !e.offsetParent && e !== _docElement) { //note: if offsetParent is null, that means the element isn't in the normal document flow, like if it has display:none or one of its ancestors has display:none). Firefox returns null for getComputedStyle() if the element is in an iframe that has display:none. https://bugzilla.mozilla.org/show_bug.cgi?id=548397 28703 //browsers don't report transforms accurately unless the element is in the DOM and has a display value that's not "none". Firefox and Microsoft browsers have a partial bug where they'll report transforms even if display:none BUT not any percentage-based values like translate(-50%, 8px) will be reported as if it's translate(0, 8px). 28704 n = style.display; 28705 style.display = "block"; 28706 parent = e.parentNode; 28707 if (!parent || !e.offsetParent) { 28708 dec = 1; //flag 28709 nextSibling = e.nextSibling; 28710 _docElement.appendChild(e); //we must add it to the DOM in order to get values properly 28711 } 28712 s = _getStyle(e, _transformPropCSS, null, true);
28713 isDefault = (!s || s === "none" || s === "matrix(1, 0, 0, 1, 0, 0)"); 28714 if (n) { 28715 style.display = n; 28716 } else { 28717 _removeProp(style, "display"); 28718 } 28719 if (dec) { 28720 if (nextSibling) { 28721 parent.insertBefore(e, nextSibling); 28722 } else if (parent) { 28723 parent.appendChild(e); 28724 } else { 28725 _docElement.removeChild(e); 28726 } 28727 } 28728 } 28729 if (tm.svg || (e.getCTM && _isSVG(e))) { 28730 if (isDefault && (style[_transformProp] + "").indexOf("matrix") !== -1) { //some browsers (like Chrome 40) don't correctly report transforms that are applied inline on an SVG element (they don't get included in the computed style), so we double-check here and accept matrix values 28731 s = style[_transformProp]; 28732 isDefault = 0; 28733 } 28734 m = e.getAttribute("transform"); 28735 if (isDefault && m) { 28736 m = e.transform.baseVal.consolidate().matrix; //ensures that even complex values like "translate(50,60) rotate(135,0,0)" are parsed because it mashes it into a matrix. 28737 s = "matrix(" + m.a + "," + m.b + "," + m.c + "," + m.d + "," + m.e + "," + m.f + ")"; 28738 isDefault = 0; 28739 } 28740 } 28741 if (isDefault) { 28742 return _identity2DMatrix; 28743 } 28744 //split the matrix values out into an array (m for matrix) 28745 m = (s || "").match(_numExp) || []; 28746 i = m.length; 28747 while (--i > -1) { 28748 n = Number(m[i]); 28749 m[i] = (dec = n - (n |= 0)) ? ((dec * rnd + (dec < 0 ? -0.5 : 0.5)) | 0) / rnd + n : n; //convert strings to Numbers and round to 5 decimal places to avoid issues with tiny numbers. Roughly 20x faster than Number.toFixed(). We also must make sure to round before dividing so that values like 0.9999999999 become 1 to avoid glitches in browser rendering and interpretation of flipped/rotated 3D matrices. And don't just multiply the number by rnd, floor it, and then divide by rnd because the bitwise operations max out at a 32-bit signed integer, thus it could get clipped at a relatively low value (like 22,000.00000 for example). 28750 } 28751 return (force2D && m.length > 6) ? [m[0], m[1], m[4], m[5], m[12], m[13]] : m; 28752 }, 28753 28754 /** 28755 * Parses the transform values for an element, returning an object with x, y, z, scaleX, scaleY, scaleZ, rotation, rotationX, rotationY, skewX, and skewY properties. Note: by default (for performance reasons), all skewing is combined into skewX and rotation but skewY still has a place in the transform object so that we can record how much of the skew is attributed to skewX vs skewY. Remember, a skewY of 10 looks the same as a rotation of 10 and skewX of -10. 28756 * @param {!Object} t target element 28757 * @param {Object=} cs computed style object (optional) 28758 * @param {boolean=} rec if true, the transform values will be recorded to the target element's _gsTransform object, like target._gsTransform = {x:0, y:0, z:0, scaleX:1...} 28759 * @param {boolean=} parse if true, we'll ignore any _gsTransform values that already exist on the element, and force a reparsing of the css (calculated style) 28760 * @return {object}
28760 object containing all of the transform properties/values like {x:0, y:0, z:0, scaleX:1...} 28761 */ 28762 _getTransform = _internals.getTransform = function(t, cs, rec, parse) { 28763 if (t._gsTransform && rec && !parse) { 28764 return t._gsTransform; //if the element already has a _gsTransform, use that. Note: some browsers don't accurately return the calculated style for the transform (particularly for SVG), so it's almost always safest to just use the values we've already applied rather than re-parsing things. 28765 } 28766 var tm = rec ? t._gsTransform || new Transform() : new Transform(), 28767 invX = (tm.scaleX < 0), //in order to interpret things properly, we need to know if the user applied a negative scaleX previously so that we can adjust the rotation and skewX accordingly. Otherwise, if we always interpret a flipped matrix as affecting scaleY and the user only wants to tween the scaleX on multiple sequential tweens, it would keep the negative scaleY without that being the user's intent. 28768 min = 0.00002, 28769 rnd = 100000, 28770 zOrigin = _supports3D ? parseFloat(_getStyle(t, _transformOriginProp, cs, false, "0 0 0").split(" ")[2]) || tm.zOrigin || 0 : 0, 28771 defaultTransformPerspective = parseFloat(CSSPlugin.defaultTransformPerspective) || 0, 28772 m, i, scaleX, scaleY, rotation, skewX; 28773 28774 tm.svg = !!(t.getCTM && _isSVG(t)); 28775 if (tm.svg) { 28776 _parseSVGOrigin(t, _getStyle(t, _transformOriginProp, cs, false, "50% 50%") + "", tm, t.getAttribute("data-svg-origin")); 28777 _useSVGTransformAttr = CSSPlugin.useSVGTransformAttr || _forceSVGTransformAttr; 28778 } 28779 m = _getMatrix(t); 28780 if (m !== _identity2DMatrix) { 28781 28782 if (m.length === 16) { 28783 //we'll only look at these position-related 6 variables first because if x/y/z all match, it's relatively safe to assume we don't need to re-parse everything which risks losing important rotational information (like rotationX:180 plus rotationY:180 would look the same as rotation:180 - there's no way to know for sure which direction was taken based solely on the matrix3d() values) 28784 var a11 = m[0], a21 = m[1], a31 = m[2], a41 = m[3], 28785 a12 = m[4], a22 = m[5], a32 = m[6], a42 = m[7], 28786 a13 = m[8], a23 = m[9], a33 = m[10], 28787 a14 = m[12], a24 = m[13], a34 = m[14], 28788 a43 = m[11], 28789 angle = Math.atan2(a32, a33), 28790 t1, t2, t3, t4, cos, sin; 28791 //we manually compensate for non-zero z component of transformOrigin to work around bugs in Safari 28792 if (tm.zOrigin) { 28793 a34 = -tm.zOrigin; 28794 a14 = a13*a34-m[12]; 28795 a24 = a23*a34-m[13]; 28796 a34 = a33*a34+tm.zOrigin-m[14]; 28797 } 28798 //note for possible future consolidation: rotationX: Math.atan2(a32, a33), rotationY: Math.atan2(-a31, Math.sqrt(a33 * a33 + a32 * a32)), rotation: Math.atan2(a21, a11), skew: Math.atan2(a12, a22). However, it doesn't seem to be quite as reliable as the full-on backwards rotation procedure. 28799 tm.rotationX = angle * _RAD2DEG; 28800 //rotationX 28801 if (angle) { 28802 cos = Math.cos(-angle); 28803 sin = Math.sin(-angle); 28804 t1 = a12*cos+a13*sin; 28805 t2 = a22*cos+a23*sin; 28806 t3 = a32*cos+a33*sin; 28807 a13 = a12*-sin+a13*cos; 28808 a23 = a22*-sin+a23*cos; 28809 a33 = a32*-sin+a33*cos; 28810 a43 = a42*-sin+a43*cos; 28811 a12 = t1; 28812 a22 = t2; 28813 a32 = t3; 28814 } 28815 //rotationY 28816 angle = Math.atan2(-a31, a33); 28817 tm.rotationY = angle * _RAD2DEG; 28818 if (angle) { 28819 cos = Math.cos(-angle); 28820 sin = Math.sin(-angle); 28821 t1 = a11*cos-a13*sin; 28822 t2 = a21*cos-a23*sin; 28823 t3 = a31*cos-a33*sin; 28824 a23 = a21*sin+a23*cos; 28825 a33 = a31*sin+a33*cos; 28826 a43 = a41*sin+a43*cos; 28827 a11 = t1; 28828 a21 = t2; 28829 a31 = t3; 28830 } 28831 //rotationZ 28832 angle = Math.atan2(a21, a11); 28833 tm.rotation = angle * _RAD2DEG; 28834 if (angle) { 28835 cos = Math.cos(angle); 28836 sin = Math.sin(angle); 28837 t1 = a11*cos+a21*sin; 28838 t2 = a12*cos+a22*sin; 28839 t3 = a13*cos+a23*sin; 28840 a21 = a21*cos-a11*sin; 28841 a22 = a22*cos-a12*sin; 28842 a23 = a23*cos-a13*sin; 28843 a11 = t1; 28844 a12 = t2; 28845 a13 = t3; 28846 } 28847 28848 if (tm.rotationX && Math.abs(tm.rotationX) + Math.abs(tm.rotation) > 359.9) { //when rotationY is set, it will often be parsed as 180 degrees different than it should be, and rotationX and rotation both being 180 (it looks the same), so we adjust for that here. 28849 tm.rotationX = tm.rotation = 0; 28850 tm.rotationY = 180 - tm.rotationY; 28851 } 28852 28853 //skewX 28854 angle = Math.atan2(a12, a22); 28855 28856 //scales 28857 tm.scaleX = ((Math.sqrt(a11 * a11 + a21 * a21 + a31 * a31) * rnd + 0.5) | 0) / rnd; 28858 tm.scaleY = ((Math.sqrt(a22 * a22 + a32 * a32) * rnd + 0.5) | 0) / rnd; 28859 tm.scaleZ = ((Math.sqrt(a13 * a13 + a23 * a23 + a33 * a33) * rnd + 0.5) | 0) / rnd; 28860 a11 /= tm.scaleX; 28861 a12 /= tm.scaleY; 28862 a21 /= tm.scaleX; 28863 a22 /= tm.scaleY; 28864 if (Math.abs(angle) > min) { 28865 tm.skewX = angle * _RAD2DEG; 28866 a12 = 0;
28866 //unskews 28867 if (tm.skewType !== "simple") { 28868 tm.scaleY *= 1 / Math.cos(angle); //by default, we compensate the scale based on the skew so that the element maintains a similar proportion when skewed, so we have to alter the scaleY here accordingly to match the default (non-adjusted) skewing that CSS does (stretching more and more as it skews). 28869 } 28870 28871 } else { 28872 tm.skewX = 0; 28873 } 28874 28875 /* //for testing purposes 28876 var transform = "matrix3d(", 28877 comma = ",", 28878 zero = "0"; 28879 a13 /= tm.scaleZ; 28880 a23 /= tm.scaleZ; 28881 a31 /= tm.scaleX; 28882 a32 /= tm.scaleY; 28883 a33 /= tm.scaleZ; 28884 transform += ((a11 < min && a11 > -min) ? zero : a11) + comma + ((a21 < min && a21 > -min) ? zero : a21) + comma + ((a31 < min && a31 > -min) ? zero : a31); 28885 transform += comma + ((a41 < min && a41 > -min) ? zero : a41) + comma + ((a12 < min && a12 > -min) ? zero : a12) + comma + ((a22 < min && a22 > -min) ? zero : a22); 28886 transform += comma + ((a32 < min && a32 > -min) ? zero : a32) + comma + ((a42 < min && a42 > -min) ? zero : a42) + comma + ((a13 < min && a13 > -min) ? zero : a13); 28887 transform += comma + ((a23 < min && a23 > -min) ? zero : a23) + comma + ((a33 < min && a33 > -min) ? zero : a33) + comma + ((a43 < min && a43 > -min) ? zero : a43) + comma; 28888 transform += a14 + comma + a24 + comma + a34 + comma + (tm.perspective ? (1 + (-a34 / tm.perspective)) : 1) + ")"; 28889 console.log(transform); 28890 document.querySelector(".test").style[_transformProp] = transform; 28891 */ 28892 28893 tm.perspective = a43 ? 1 / ((a43 < 0) ? -a43 : a43) : 0; 28894 tm.x = a14; 28895 tm.y = a24; 28896 tm.z = a34; 28897 if (tm.svg) { 28898 tm.x -= tm.xOrigin - (tm.xOrigin * a11 - tm.yOrigin * a12); 28899 tm.y -= tm.yOrigin - (tm.yOrigin * a21 - tm.xOrigin * a22); 28900 } 28901 28902 } else if ((!_supports3D || parse || !m.length || tm.x !== m[4] || tm.y !== m[5] || (!tm.rotationX && !tm.rotationY))) { //sometimes a 6-element matrix is returned even when we performed 3D transforms, like if rotationX and rotationY are 180. In cases like this, we still need to honor the 3D transforms. If we just rely on the 2D info, it could affect how the data is interpreted, like scaleY might get set to -1 or rotation could get offset by 180 degrees. For example, do a TweenLite.to(element, 1, {css:{rotationX:180, rotationY:180}}) and then later, TweenLite.to(element, 1, {css:{rotationX:0}}) and without this conditional logic in place, it'd jump to a state of being unrotated when the 2nd tween starts. Then again, we need to honor the fact that the user COULD alter the transforms outside of CSSPlugin, like by manually applying new css, so we try to sense that by looking at x and y because if those changed, we know the changes were made outside CSSPlugin and we force a reinterpretation of the matrix values. Also, in Webkit browsers, if the element's "display" is "none", its calculated style value will always return empty, so if we've already recorded the values in the _gsTransform object, we'll just rely on those. 28903 var k = (m.length >= 6), 28904 a = k ? m[0] : 1, 28905 b = m[1] || 0, 28906 c = m[2] || 0, 28907 d = k ? m[3] : 1; 28908 tm.x = m[4] || 0; 28909 tm.y = m[5] || 0; 28910 scaleX = Math.sqrt(a * a + b * b); 28911 scaleY = Math.sqrt(d * d + c * c); 28912 rotation = (a || b) ? Math.atan2(b, a) * _RAD2DEG : tm.rotation || 0; //note: if scaleX is 0, we cannot accurately measure rotation. Same for skewX with a scaleY of 0. Therefore, we default to the previously recorded value (or zero if that doesn't exist). 28913 skewX = (c || d) ? Math.atan2(c, d) * _RAD2DEG + rotation : tm.skewX || 0; 28914 tm.scaleX = scaleX; 28915 tm.scaleY = scaleY; 28916 tm.rotation = rotation; 28917 tm.skewX = skewX; 28918 if (_supports3D) { 28919 tm.rotationX = tm.rotationY = tm.z = 0; 28920 tm.perspective = defaultTransformPerspective; 28921 tm.scaleZ = 1; 28922 } 28923 if (tm.svg) { 28924 tm.x -= tm.xOrigin - (tm.xOrigin * a + tm.yOrigin * c); 28925 tm.y -= tm.yOrigin - (tm.xOrigin * b + tm.yOrigin * d); 28926 } 28927 } 28928 if (Math.abs(tm.skewX) > 90 && Math.abs(tm.skewX) < 270) { 28929 if (invX) { 28930 tm.scaleX *= -1; 28931 tm.skewX += (tm.rotation <= 0) ? 180 : -180; 28932 tm.rotation += (tm.rotation <= 0) ? 180 : -180; 28933 } else { 28934 tm.scaleY *= -1; 28935 tm.skewX += (tm.skewX <= 0) ? 180 : -180; 28936 } 28937 } 28938 tm.zOrigin = zOrigin;
28939 //some browsers have a hard time with very small values like 2.4492935982947064e-16 (notice the "e-" towards the end) and would render the object slightly off. So we round to 0 in these cases. The conditional logic here is faster than calling Math.abs(). Also, browsers tend to render a SLIGHTLY rotated object in a fuzzy way, so we need to snap to exactly 0 when appropriate. 28940 for (i in tm) { 28941 if (tm[i] < min) if (tm[i] > -min) { 28942 tm[i] = 0; 28943 } 28944 } 28945 } 28946 //DEBUG: _log("parsed rotation of " + t.getAttribute("id")+": "+(tm.rotationX)+", "+(tm.rotationY)+", "+(tm.rotation)+", scale: "+tm.scaleX+", "+tm.scaleY+", "+tm.scaleZ+", position: "+tm.x+", "+tm.y+", "+tm.z+", perspective: "+tm.perspective+ ", origin: "+ tm.xOrigin+ ","+ tm.yOrigin); 28947 if (rec) { 28948 t._gsTransform = tm; //record to the object's _gsTransform which we use so that tweens can control individual properties independently (we need all the properties to accurately recompose the matrix in the setRatio() method) 28949 if (tm.svg) { //if we're supposed to apply transforms to the SVG element's "transform" attribute, make sure there aren't any CSS transforms applied or they'll override the attribute ones. Also clear the transform attribute if we're using CSS, just to be clean. 28950 if (_useSVGTransformAttr && t.style[_transformProp]) { 28951 TweenLite.delayedCall(0.001, function(){ //if we apply this right away (before anything has rendered), we risk there being no transforms for a brief moment and it also interferes with adjusting the transformOrigin in a tween with immediateRender:true (it'd try reading the matrix and it wouldn't have the appropriate data in place because we just removed it). 28952 _removeProp(t.style, _transformProp); 28953 }); 28954 } else if (!_useSVGTransformAttr && t.getAttribute("transform")) { 28955 TweenLite.delayedCall(0.001, function(){ 28956 t.removeAttribute("transform"); 28957 }); 28958 } 28959 } 28960 } 28961 return tm; 28962 }, 28963 28964 //for setting 2D transforms in IE6, IE7, and IE8 (must use a "filter" to emulate the behavior of modern day browser transforms) 28965 _setIETransformRatio = function(v) { 28966 var t = this.data, //refers to the element's _gsTransform object 28967 ang = -t.rotation * _DEG2RAD, 28968 skew = ang + t.skewX * _DEG2RAD, 28969 rnd = 100000, 28970 a = ((Math.cos(ang) * t.scaleX * rnd) | 0) / rnd, 28971 b = ((Math.sin(ang) * t.scaleX * rnd) | 0) / rnd, 28972 c = ((Math.sin(skew) * -t.scaleY * rnd) | 0) / rnd, 28973 d = ((Math.cos(skew) * t.scaleY * rnd) | 0) / rnd, 28974 style = this.t.style, 28975 cs = this.t.currentStyle, 28976 filters, val; 28977 if (!cs) { 28978 return; 28979 } 28980 val = b; //just for swapping the variables an inverting them (reused "val" to avoid creating another variable in memory). IE's filter matrix uses a non-standard matrix configuration (angle goes the opposite way, and b and c are reversed and inverted) 28981 b = -c; 28982 c = -val; 28983 filters = cs.filter; 28984 style.filter = ""; //remove filters so that we can accurately measure offsetWidth/offsetHeight 28985 var w = this.t.offsetWidth, 28986 h = this.t.offsetHeight, 28987 clip = (cs.position !== "absolute"), 28988 m = "progid:DXImageTransform.Microsoft.Matrix(M11=" + a + ", M12=" + b + ", M21=" + c + ", M22=" + d, 28989 ox = t.x + (w * t.xPercent / 100), 28990 oy = t.y + (h * t.yPercent / 100), 28991 dx, dy; 28992 28993 //if transformOrigin is being used, adjust the offset x and y 28994 if (t.ox != null) { 28995 dx = ((t.oxp) ? w * t.ox * 0.01 : t.ox) - w / 2; 28996 dy = ((t.oyp) ? h * t.oy * 0.01 : t.oy) - h / 2; 28997 ox += dx - (dx * a + dy * b); 28998 oy += dy - (dx * c + dy * d); 28999 } 29000 29001 if (!clip) { 29002 m += ", sizingMethod='auto expand')"; 29003 } else { 29004 dx = (w / 2); 29005 dy = (h / 2); 29006 //translate to ensure that transformations occur around the correct origin (default is center). 29007 m += ", Dx=" + (dx - (dx * a + dy * b) + ox) + ", Dy=" + (dy - (dx * c + dy * d) + oy) + ")"; 29008 } 29009 if (filters.indexOf("DXImageTransform.Microsoft.Matrix(") !== -1) {
29010 style.filter = filters.replace(_ieSetMatrixExp, m); 29011 } else { 29012 style.filter = m + " " + filters; //we must always put the transform/matrix FIRST (before alpha(opacity=xx)) to avoid an IE bug that slices part of the object when rotation is applied with alpha. 29013 } 29014 29015 //at the end or beginning of the tween, if the matrix is normal (1, 0, 0, 1) and opacity is 100 (or doesn't exist), remove the filter to improve browser performance. 29016 if (v === 0 || v === 1) if (a === 1) if (b === 0) if (c === 0) if (d === 1) if (!clip || m.indexOf("Dx=0, Dy=0") !== -1) if (!_opacityExp.test(filters) || parseFloat(RegExp.$1) === 100) if (filters.indexOf("gradient(" && filters.indexOf("Alpha")) === -1) { 29017 style.removeAttribute("filter"); 29018 } 29019 29020 //we must set the margins AFTER applying the filter in order to avoid some bugs in IE8 that could (in rare scenarios) cause them to be ignored intermittently (vibration). 29021 if (!clip) { 29022 var mult = (_ieVers < 8) ? 1 : -1, //in Internet Explorer 7 and before, the box model is broken, causing the browser to treat the width/height of the actual rotated filtered image as the width/height of the box itself, but Microsoft corrected that in IE8. We must use a negative offset in IE8 on the right/bottom 29023 marg, prop, dif; 29024 dx = t.ieOffsetX || 0; 29025 dy = t.ieOffsetY || 0; 29026 t.ieOffsetX = Math.round((w - ((a < 0 ? -a : a) * w + (b < 0 ? -b : b) * h)) / 2 + ox); 29027 t.ieOffsetY = Math.round((h - ((d < 0 ? -d : d) * h + (c < 0 ? -c : c) * w)) / 2 + oy); 29028 for (i = 0; i < 4; i++) { 29029 prop = _margins[i]; 29030 marg = cs[prop]; 29031 //we need to get the current margin in case it is being tweened separately (we want to respect that tween's changes) 29032 val = (marg.indexOf("px") !== -1) ? parseFloat(marg) : _convertToPixels(this.t, prop, parseFloat(marg), marg.replace(_suffixExp, "")) || 0; 29033 if (val !== t[prop]) { 29034 dif = (i < 2) ? -t.ieOffsetX : -t.ieOffsetY; //if another tween is controlling a margin, we cannot only apply the difference in the ieOffsets, so we essentially zero-out the dx and dy here in that case. We record the margin(s) later so that we can keep comparing them, making this code very flexible. 29035 } else { 29036 dif = (i < 2) ? dx - t.ieOffsetX : dy - t.ieOffsetY; 29037 } 29038 style[prop] = (t[prop] = Math.round( val - dif * ((i === 0 || i === 2) ? 1 : mult) )) + "px"; 29039 } 29040 } 29041 }, 29042 29043 /* translates a super small decimal to a string WITHOUT scientific notation 29044 _safeDecimal = function(n) { 29045 var s = (n < 0 ? -n : n) + "", 29046 a = s.split("e-"); 29047 return (n < 0 ? "-0." : "0.") + new Array(parseInt(a[1], 10) || 0).join("0") + a[0].split(".").join(""); 29048 }, 29049 */ 29050 29051 _setTransformRatio = _internals.set3DTransformRatio = _internals.setTransformRatio = function(v) { 29052 var t = this.data, //refers to the element's _gsTransform object 29053 style = this.t.style, 29054 angle = t.rotation, 29055 rotationX = t.rotationX, 29056 rotationY = t.rotationY, 29057 sx = t.scaleX, 29058 sy = t.scaleY, 29059 sz = t.scaleZ, 29060 x = t.x, 29061 y = t.y, 29062 z = t.z, 29063 isSVG = t.svg, 29064 perspective = t.perspective, 29065 force3D = t.force3D, 29066 skewY = t.skewY, 29067 skewX = t.skewX, 29068 t1, a11, a12, a13, a21, a22, a23, a31, a32, a33, a41, a42, a43, 29069 zOrigin, min, cos, sin, t2, transform, comma, zero, skew, rnd; 29070 if (skewY) { //for performance reasons, we combine all skewing into the skewX and rotation values. Remember, a skewY of 10 degrees looks the same as a rotation of 10 degrees plus a skewX of 10 degrees. 29071 skewX += skewY; 29072 angle += skewY; 29073 } 29074 29075 //check to see if we should render as 2D (and SVGs must use 2D when _useSVGTransformAttr is true) 29076 if (((((v === 1 || v === 0) && force3D === "auto" && (this.tween._totalTime === this.tween._totalDuration || !this.tween._totalTime)) || !force3D) && !z && !perspective && !rotationY && !rotationX && sz === 1) || (_useSVGTransformAttr && isSVG) || !_supports3D) { //on the final render (which could be 0 for a from tween), if there are no 3D aspects, render in 2D to free up memory and improve performance especially on mobile devices. Check the tween's totalTime/totalDuration too in order to make sure it doesn't happen between repeats if it's a repeating tween. 29077 29078 //2D 29079 if (angle || skewX || isSVG) { 29080 angle *= _DEG2RAD; 29081 skew = skewX * _DEG2RAD; 29082 rnd = 100000; 29083 a11 = Math.cos(angle) * sx; 29084 a21 = Math.sin(angle) * sx; 29085 a12 = Math.sin(angle - skew) * -sy;
29086 a22 = Math.cos(angle - skew) * sy; 29087 if (skew && t.skewType === "simple") { //by default, we compensate skewing on the other axis to make it look more natural, but you can set the skewType to "simple" to use the uncompensated skewing that CSS does 29088 t1 = Math.tan(skew - skewY * _DEG2RAD); 29089 t1 = Math.sqrt(1 + t1 * t1); 29090 a12 *= t1; 29091 a22 *= t1; 29092 if (skewY) { 29093 t1 = Math.tan(skewY * _DEG2RAD); 29094 t1 = Math.sqrt(1 + t1 * t1); 29095 a11 *= t1; 29096 a21 *= t1; 29097 } 29098 } 29099 if (isSVG) { 29100 x += t.xOrigin - (t.xOrigin * a11 + t.yOrigin * a12) + t.xOffset; 29101 y += t.yOrigin - (t.xOrigin * a21 + t.yOrigin * a22) + t.yOffset; 29102 if (_useSVGTransformAttr && (t.xPercent || t.yPercent)) { //The SVG spec doesn't support percentage-based translation in the "transform" attribute, so we merge it into the matrix to simulate it. 29103 min = this.t.getBBox(); 29104 x += t.xPercent * 0.01 * min.width; 29105 y += t.yPercent * 0.01 * min.height; 29106 } 29107 min = 0.000001; 29108 if (x < min) if (x > -min) { 29109 x = 0; 29110 } 29111 if (y < min) if (y > -min) { 29112 y = 0; 29113 } 29114 } 29115 transform = (((a11 * rnd) | 0) / rnd) + "," + (((a21 * rnd) | 0) / rnd) + "," + (((a12 * rnd) | 0) / rnd) + "," + (((a22 * rnd) | 0) / rnd) + "," + x + "," + y + ")"; 29116 if (isSVG && _useSVGTransformAttr) {
29117 this.t.setAttribute("transform", "matrix(" + transform); 29118 } else { 29119 //some browsers have a hard time with very small values like 2.4492935982947064e-16 (notice the "e-" towards the end) and would render the object slightly off. So we round to 5 decimal places. 29120 style[_transformProp] = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix(" : "matrix(") + transform; 29121 } 29122 } else { 29123 style[_transformProp] = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix(" : "matrix(") + sx + ",0,0," + sy + "," + x + "," + y + ")"; 29124 } 29125 return; 29126 29127 } 29128 if (_isFirefox) { //Firefox has a bug (at least in v25) that causes it to render the transparent part of 32-bit PNG images as black when displayed inside an iframe and the 3D scale is very small and doesn't change sufficiently enough between renders (like if you use a Power4.easeInOut to scale from 0 to 1 where the beginning values only change a tiny amount to begin the tween before accelerating). In this case, we force the scale to be 0.00002 instead which is visually the same but works around the Firefox issue. 29129 min = 0.0001; 29130 if (sx < min && sx > -min) { 29131 sx = sz = 0.00002; 29132 } 29133 if (sy < min && sy > -min) { 29134 sy = sz = 0.00002; 29135 } 29136 if (perspective && !t.z && !t.rotationX && !t.rotationY) { //Firefox has a bug that causes elements to have an odd super-thin, broken/dotted black border on elements that have a perspective set but aren't utilizing 3D space (no rotationX, rotationY, or z). 29137 perspective = 0; 29138 } 29139 } 29140 if (angle || skewX) { 29141 angle *= _DEG2RAD; 29142 cos = a11 = Math.cos(angle); 29143 sin = a21 = Math.sin(angle); 29144 if (skewX) { 29145 angle -= skewX * _DEG2RAD; 29146 cos = Math.cos(angle); 29147 sin = Math.sin(angle); 29148 if (t.skewType === "simple") { //by default, we compensate skewing on the other axis to make it look more natural, but you can set the skewType to "simple" to use the uncompensated skewing that CSS does 29149 t1 = Math.tan((skewX - skewY) * _DEG2RAD); 29150 t1 = Math.sqrt(1 + t1 * t1); 29151 cos *= t1; 29152 sin *= t1; 29153 if (t.skewY) { 29154 t1 = Math.tan(skewY * _DEG2RAD); 29155 t1 = Math.sqrt(1 + t1 * t1); 29156 a11 *= t1; 29157 a21 *= t1; 29158 } 29159 } 29160 } 29161 a12 = -sin; 29162 a22 = cos; 29163 29164 } else if (!rotationY && !rotationX && sz === 1 && !perspective && !isSVG) { //if we're only translating and/or 2D scaling, this is faster... 29165 style[_transformProp] = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) translate3d(" : "translate3d(") + x + "px," + y + "px," + z +"px)" + ((sx !== 1 || sy !== 1) ? " scale(" + sx + "," + sy + ")" : ""); 29166 return; 29167 } else { 29168 a11 = a22 = 1; 29169 a12 = a21 = 0; 29170 } 29171 // KEY INDEX AFFECTS a[row][column] 29172 // a11 0 rotation, rotationY, scaleX 29173 // a21 1 rotation, rotationY, scaleX 29174 // a31 2 rotationY, scaleX 29175 // a41 3 rotationY, scaleX 29176 // a12 4 rotation, skewX, rotationX, scaleY 29177 // a22 5 rotation, skewX, rotationX, scaleY 29178 // a32 6 rotationX, scaleY 29179 // a42 7 rotationX, scaleY 29180 // a13 8 rotationY, rotationX, scaleZ 29181 // a23 9 rotationY, rotationX, scaleZ 29182 // a33 10 rotationY, rotationX, scaleZ 29183 // a43 11 rotationY, rotationX, perspective, scaleZ 29184 // a14 12 x, zOrigin, svgOrigin 29185 // a24 13 y, zOrigin, svgOrigin 29186 // a34 14 z, zOrigin 29187 // a44 15 29188 // rotation: Math.atan2(a21, a11) 29189 // rotationY: Math.atan2(a13, a33) (or Math.atan2(a13, a11)) 29190 // rotationX: Math.atan2(a32, a33) 29191 a33 = 1; 29192 a13 = a23 = a31 = a32 = a41 = a42 = 0; 29193 a43 = (perspective) ? -1 / perspective : 0; 29194 zOrigin = t.zOrigin; 29195 min = 0.000001; //threshold below which browsers use scientific notation which won't work. 29196 comma = ","; 29197 zero = "0"; 29198 angle = rotationY * _DEG2RAD; 29199 if (angle) { 29200 cos = Math.cos(angle); 29201 sin = Math.sin(angle);
29202 a31 = -sin; 29203 a41 = a43*-sin; 29204 a13 = a11*sin; 29205 a23 = a21*sin; 29206 a33 = cos; 29207 a43 *= cos; 29208 a11 *= cos; 29209 a21 *= cos; 29210 } 29211 angle = rotationX * _DEG2RAD; 29212 if (angle) { 29213 cos = Math.cos(angle); 29214 sin = Math.sin(angle); 29215 t1 = a12*cos+a13*sin; 29216 t2 = a22*cos+a23*sin; 29217 a32 = a33*sin; 29218 a42 = a43*sin; 29219 a13 = a12*-sin+a13*cos; 29220 a23 = a22*-sin+a23*cos; 29221 a33 = a33*cos; 29222 a43 = a43*cos; 29223 a12 = t1; 29224 a22 = t2; 29225 } 29226 if (sz !== 1) { 29227 a13*=sz; 29228 a23*=sz; 29229 a33*=sz; 29230 a43*=sz; 29231 } 29232 if (sy !== 1) { 29233 a12*=sy; 29234 a22*=sy; 29235 a32*=sy; 29236 a42*=sy; 29237 } 29238 if (sx !== 1) { 29239 a11*=sx; 29240 a21*=sx; 29241 a31*=sx; 29242 a41*=sx; 29243 } 29244 29245 if (zOrigin || isSVG) { 29246 if (zOrigin) { 29247 x += a13*-zOrigin; 29248 y += a23*-zOrigin; 29249 z += a33*-zOrigin+zOrigin; 29250 } 29251 if (isSVG) { //due to bugs in some browsers, we need to manage the transform-origin of SVG manually 29252 x += t.xOrigin - (t.xOrigin * a11 + t.yOrigin * a12) + t.xOffset; 29253 y += t.yOrigin - (t.xOrigin * a21 + t.yOrigin * a22) + t.yOffset; 29254 } 29255 if (x < min && x > -min) { 29256 x = zero; 29257 } 29258 if (y < min && y > -min) { 29259 y = zero; 29260 } 29261 if (z < min && z > -min) { 29262 z = 0; //don't use string because we calculate perspective later and need the number. 29263 } 29264 } 29265 29266 //optimized way of concatenating all the values into a string. If we do it all in one shot, it's slower because of the way browsers have to create temp strings and the way it affects memory. If we do it piece-by-piece with +=, it's a bit slower too. We found that doing it in these sized chunks works best overall: 29267 transform = ((t.xPercent || t.yPercent) ? "translate(" + t.xPercent + "%," + t.yPercent + "%) matrix3d(" : "matrix3d("); 29268 transform += ((a11 < min && a11 > -min) ? zero : a11) + comma + ((a21 < min && a21 > -min) ? zero : a21) + comma + ((a31 < min && a31 > -min) ? zero : a31); 29269 transform += comma + ((a41 < min && a41 > -min) ? zero : a41) + comma + ((a12 < min && a12 > -min) ? zero : a12) + comma + ((a22 < min && a22 > -min) ? zero : a22); 29270 if (rotationX || rotationY || sz !== 1) { //performance optimization (often there's no rotationX or rotationY, so we can skip these calculations) 29271 transform += comma + ((a32 < min && a32 > -min) ? zero : a32) + comma + ((a42 < min && a42 > -min) ? zero : a42) + comma + ((a13 < min && a13 > -min) ? zero : a13); 29272 transform += comma + ((a23 < min && a23 > -min) ? zero : a23) + comma + ((a33 < min && a33 > -min) ? zero : a33) + comma + ((a43 < min && a43 > -min) ? zero : a43) + comma; 29273 } else { 29274 transform += ",0,0,0,0,1,0,"; 29275 } 29276 transform += x + comma + y + comma + z + comma + (perspective ? (1 + (-z / perspective)) : 1) + ")"; 29277 29278 style[_transformProp] = transform; 29279 }; 29280 29281 p = Transform.prototype; 29282 p.x = p.y = p.z = p.skewX = p.skewY = p.rotation = p.rotationX = p.rotationY = p.zOrigin = p.xPercent = p.yPercent = p.xOffset = p.yOffset = 0; 29283 p.scaleX = p.scaleY = p.scaleZ = 1; 29284 29285 _registerComplexSpecialProp("transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,svgOrigin,transformPerspective,directionalRotation,parseTransform,force3D,skewType,xPercent,yPercent,smoothOrigin", {parser:function(t, e, parsingProp, cssp, pt, plugin, vars) { 29286 if (cssp._lastParsedTransform === vars) { return pt; } //only need to parse the transform once, and only if the browser supports it. 29287 cssp._lastParsedTransform = vars; 29288 var scaleFunc = (vars.scale && typeof(vars.scale) === "function") ? vars.scale : 0; //if there's a function-based "scale" value, swap in the resulting numeric value temporarily. Otherwise, if it's called for both scaleX and scaleY independently, they may not match (like if the function uses Math.random()). 29289 if (scaleFunc) { 29290 vars.scale = scaleFunc(_index, t); 29291 } 29292 var originalGSTransform = t._gsTransform, 29293 style = t.style, 29294 min = 0.000001, 29295 i = _transformProps.length, 29296 v = vars, 29297 endRotations = {}, 29298 transformOriginString = "transformOrigin", 29299 m1 = _getTransform(t, _cs, true, v.parseTransform), 29300 orig = v.transform && ((typeof(v.transform) === "function") ? v.transform(_index, _target) : v.transform), 29301 m2, copy, has3D, hasChange, dr, x, y, matrix, p; 29302 m1.skewType = v.skewType || m1.skewType || CSSPlugin.defaultSkewType; 29303 cssp._transform = m1; 29304 if ("rotationZ" in v) { 29305 v.rotation = v.rotationZ; 29306 } 29307 if (orig && typeof(orig) === "string" && _transformProp) { //for values like transform:"rotate(60deg) scale(0.5, 0.8)" 29308 copy = _tempDiv.style; //don't use the original target because it might be SVG in which case some browsers don't report computed style correctly. 29309 copy[_transformProp] = orig; 29310 copy.display = "block"; //if display is "none", the browser often refuses to report the transform properties correctly. 29311 copy.position = "absolute"; 29312 if (orig.indexOf("%") !== -1) { //%-based translations will fail unless we set the width/height to match the original target... 29313 copy.width = _getStyle(t, "width");
29314 copy.height = _getStyle(t, "height"); 29315 } 29316 _doc.body.appendChild(_tempDiv); 29317 m2 = _getTransform(_tempDiv, null, false); 29318 if (m1.skewType === "simple") { //the default _getTransform() reports the skewX/scaleY as if skewType is "compensated", thus we need to adjust that here if skewType is "simple". 29319 m2.scaleY *= Math.cos(m2.skewX * _DEG2RAD); 29320 } 29321 if (m1.svg) { //if it's an SVG element, x/y part of the matrix will be affected by whatever we use as the origin and the offsets, so compensate here... 29322 x = m1.xOrigin; 29323 y = m1.yOrigin; 29324 m2.x -= m1.xOffset; 29325 m2.y -= m1.yOffset; 29326 if (v.transformOrigin || v.svgOrigin) { //if this tween is altering the origin, we must factor that in here. The actual work of recording the transformOrigin values and setting up the PropTween is done later (still inside this function) so we cannot leave the changes intact here - we only want to update the x/y accordingly. 29327 orig = {}; 29328 _parseSVGOrigin(t, _parsePosition(v.transformOrigin), orig, v.svgOrigin, v.smoothOrigin, true); 29329 x = orig.xOrigin; 29330 y = orig.yOrigin; 29331 m2.x -= orig.xOffset - m1.xOffset; 29332 m2.y -= orig.yOffset - m1.yOffset; 29333 } 29334 if (x || y) { 29335 matrix = _getMatrix(_tempDiv, true); 29336 m2.x -= x - (x * matrix[0] + y * matrix[2]); 29337 m2.y -= y - (x * matrix[1] + y * matrix[3]); 29338 } 29339 } 29340 _doc.body.removeChild(_tempDiv); 29341 if (!m2.perspective) { 29342 m2.perspective = m1.perspective; //tweening to no perspective gives very unintuitive results - just keep the same perspective in that case. 29343 } 29344 if (v.xPercent != null) { 29345 m2.xPercent = _parseVal(v.xPercent, m1.xPercent); 29346 } 29347 if (v.yPercent != null) { 29348 m2.yPercent = _parseVal(v.yPercent, m1.yPercent); 29349 } 29350 } else if (typeof(v) === "object") { //for values like scaleX, scaleY, rotation, x, y, skewX, and skewY or transform:{...} (object) 29351 m2 = {scaleX:_parseVal((v.scaleX != null) ? v.scaleX : v.scale, m1.scaleX), 29352 scaleY:_parseVal((v.scaleY != null) ? v.scaleY : v.scale, m1.scaleY), 29353 scaleZ:_parseVal(v.scaleZ, m1.scaleZ), 29354 x:_parseVal(v.x, m1.x), 29355 y:_parseVal(v.y, m1.y), 29356 z:_parseVal(v.z, m1.z), 29357 xPercent:_parseVal(v.xPercent, m1.xPercent), 29358 yPercent:_parseVal(v.yPercent, m1.yPercent), 29359 perspective:_parseVal(v.transformPerspective, m1.perspective)}; 29360 dr = v.directionalRotation; 29361 if (dr != null) { 29362 if (typeof(dr) === "object") { 29363 for (copy in dr) { 29364 v[copy] = dr[copy]; 29365 } 29366 } else { 29367 v.rotation = dr; 29368 } 29369 } 29370 if (typeof(v.x) === "string" && v.x.indexOf("%") !== -1) { 29371 m2.x = 0; 29372 m2.xPercent = _parseVal(v.x, m1.xPercent); 29373 } 29374 if (typeof(v.y) === "string" && v.y.indexOf("%") !== -1) { 29375 m2.y = 0; 29376 m2.yPercent = _parseVal(v.y, m1.yPercent); 29377 } 29378 29379 m2.rotation = _parseAngle(("rotation" in v) ? v.rotation : ("shortRotation" in v) ? v.shortRotation + "_short" : m1.rotation, m1.rotation, "rotation", endRotations); 29380 if (_supports3D) { 29381 m2.rotationX = _parseAngle(("rotationX" in v) ? v.rotationX : ("shortRotationX" in v) ? v.shortRotationX + "_short" : m1.rotationX || 0, m1.rotationX, "rotationX", endRotations); 29382 m2.rotationY = _parseAngle(("rotationY" in v) ? v.rotationY : ("shortRotationY" in v) ? v.shortRotationY + "_short" : m1.rotationY || 0, m1.rotationY, "rotationY", endRotations); 29383 } 29384 m2.skewX = _parseAngle(v.skewX, m1.skewX); 29385 m2.skewY = _parseAngle(v.skewY, m1.skewY); 29386 } 29387 if (_supports3D && v.force3D != null) { 29388 m1.force3D = v.force3D; 29389 hasChange = true; 29390 } 29391 29392 has3D = (m1.force3D || m1.z || m1.rotationX || m1.rotationY || m2.z || m2.rotationX || m2.rotationY || m2.perspective); 29393 if (!has3D && v.scale != null) { 29394 m2.scaleZ = 1; //no need to tween scaleZ. 29395 } 29396 29397 while (--i > -1) { 29398 p = _transformProps[i]; 29399 orig = m2[p] - m1[p]; 29400 if (orig > min || orig < -min || v[p] != null || _forcePT[p] != null) { 29401 hasChange = true; 29402 pt = new CSSPropTween(m1, p, m1[p], orig, pt); 29403 if (p in endRotations) { 29404 pt.e = endRotations[p]; //directional rotations typically have compensated values during the tween, but we need to make sure they end at exactly what the user requested 29405 } 29406 pt.xs0 = 0; //ensures the value stays numeric in setRatio() 29407 pt.plugin = plugin; 29408 cssp._overwriteProps.push(pt.n); 29409 } 29410 } 29411 29412 orig = (typeof(v.transformOrigin) === "function") ? v.transformOrigin(_index, _target) : v.transformOrigin; 29413 if (m1.svg && (orig || v.svgOrigin)) { 29414 x = m1.xOffset; //when we change the origin, in order to prevent things from jumping we adjust the x/y so we must record those here so that we can create PropTweens for them and flip them at the same time as the origin 29415 y = m1.yOffset; 29416 _parseSVGOrigin(t, _parsePosition(orig), m2, v.svgOrigin, v.smoothOrigin); 29417 pt = _addNonTweeningNumericPT(m1, "xOrigin", (originalGSTransform ? m1 : m2).xOrigin, m2.xOrigin, pt, transformOriginString); //note: if there wasn't a transformOrigin defined yet, just start with the destination one; it's wasteful otherwise, and it causes problems with fromTo() tweens. For example, TweenLite.to("#wheel", 3, {rotation:180, transformOrigin:"50% 50%", delay:1}); TweenLite.fromTo("#wheel", 3, {scale:0.5, transformOrigin:"50% 50%"}, {scale:1, delay:2}); would cause a jump when the from values revert at the beginning of the 2nd tween.
29418 pt = _addNonTweeningNumericPT(m1, "yOrigin", (originalGSTransform ? m1 : m2).yOrigin, m2.yOrigin, pt, transformOriginString); 29419 if (x !== m1.xOffset || y !== m1.yOffset) { 29420 pt = _addNonTweeningNumericPT(m1, "xOffset", (originalGSTransform ? x : m1.xOffset), m1.xOffset, pt, transformOriginString); 29421 pt = _addNonTweeningNumericPT(m1, "yOffset", (originalGSTransform ? y : m1.yOffset), m1.yOffset, pt, transformOriginString); 29422 } 29423 orig = "0px 0px"; //certain browsers (like firefox) completely botch transform-origin, so we must remove it to prevent it from contaminating transforms. We manage it ourselves with xOrigin and yOrigin 29424 } 29425 if (orig || (_supports3D && has3D && m1.zOrigin)) { //if anything 3D is happening and there's a transformOrigin with a z component that's non-zero, we must ensure that the transformOrigin's z-component is set to 0 so that we can manually do those calculations to get around Safari bugs. Even if the user didn't specifically define a "transformOrigin" in this particular tween (maybe they did it via css directly). 29426 if (_transformProp) { 29427 hasChange = true; 29428 p = _transformOriginProp; 29429 if (!orig) { 29430 orig = (_getStyle(t, p, _cs, false, "50% 50%") + "").split(" "); 29431 orig = orig[0] + " " + orig[1] + " " + m1.zOrigin + "px"; 29432 } 29433 orig += ""; 29434 pt = new CSSPropTween(style, p, 0, 0, pt, -1, transformOriginString); 29435 pt.b = style[p]; 29436 pt.plugin = plugin; 29437 if (_supports3D) { 29438 copy = m1.zOrigin; 29439 orig = orig.split(" "); 29440 m1.zOrigin = ((orig.length > 2) ? parseFloat(orig[2]) : copy) || 0; //Safari doesn't handle the z part of transformOrigin correctly, so we'll manually handle it in the _set3DTransformRatio() method. 29441 pt.xs0 = pt.e = orig[0] + " " + (orig[1] || "50%") + " 0px"; //we must define a z value of 0px specifically otherwise iOS 5 Safari will stick with the old one (if one was defined)! 29442 pt = new CSSPropTween(m1, "zOrigin", 0, 0, pt, -1, pt.n); //we must create a CSSPropTween for the _gsTransform.zOrigin so that it gets reset properly at the beginning if the tween runs backward (as opposed to just setting m1.zOrigin here) 29443 pt.b = copy; 29444 pt.xs0 = pt.e = m1.zOrigin; 29445 } else { 29446 pt.xs0 = pt.e = orig; 29447 } 29448 29449 //for older versions of IE (6-8), we need to manually calculate things inside the setRatio() function. We record origin x and y (ox and oy) and whether or not the values are percentages (oxp and oyp). 29450 } else { 29451 _parsePosition(orig + "", m1); 29452 } 29453 } 29454 if (hasChange) { 29455 cssp._transformType = (!(m1.svg && _useSVGTransformAttr) && (has3D || this._transformType === 3)) ? 3 : 2; //quicker than calling cssp._enableTransforms(); 29456 } 29457 if (scaleFunc) { 29458 vars.scale = scaleFunc; 29459 } 29460 return pt; 29461 }, allowFunc:true, prefix:true}); 29462 29463 _registerComplexSpecialProp("boxShadow", {defaultValue:"0px 0px 0px 0px #999", prefix:true, color:true, multi:true, keyword:"inset"}); 29464 _registerComplexSpecialProp("clipPath", {defaultValue:"inset(0%)", prefix:true, multi:true, formatter:_getFormatter("inset(0% 0% 0% 0%)", false, true)}); 29465 29466 _registerComplexSpecialProp("borderRadius", {defaultValue:"0px", parser:function(t, e, p, cssp, pt, plugin) { 29467 e = this.format(e); 29468 var props = ["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"], 29469 style = t.style, 29470 ea1, i, es2, bs2, bs, es, bn, en, w, h, esfx, bsfx, rel, hn, vn, em; 29471 w = parseFloat(t.offsetWidth); 29472 h = parseFloat(t.offsetHeight); 29473 ea1 = e.split(" "); 29474 for (i = 0; i < props.length; i++) { //if we're dealing with percentages, we must convert things separately for the horizontal and vertical axis! 29475 if (this.p.indexOf("border")) { //older browsers used a prefix 29476 props[i] = _checkPropPrefix(props[i]); 29477 } 29478 bs = bs2 = _getStyle(t, props[i], _cs, false, "0px"); 29479 if (bs.indexOf(" ") !== -1) { 29480 bs2 = bs.split(" "); 29481 bs = bs2[0]; 29482 bs2 = bs2[1]; 29483 } 29484 es = es2 = ea1[i]; 29485 bn = parseFloat(bs); 29486 bsfx = bs.substr((bn + "").length); 29487 rel = (es.charAt(1) === "="); 29488 if (rel) { 29489 en = parseInt(es.charAt(0)+"1", 10); 29490 es = es.substr(2); 29491 en *= parseFloat(es); 29492 esfx = es.substr((en + "").length - (en < 0 ? 1 : 0)) || ""; 29493 } else { 29494 en = parseFloat(es); 29495 esfx = es.substr((en + "").length); 29496 } 29497 if (esfx === "") { 29498 esfx = _suffixMap[p] || bsfx; 29499 } 29500 if (esfx !== bsfx) { 29501 hn = _convertToPixels(t, "borderLeft", bn, bsfx); //horizontal number (we use a bogus "borderLeft" property just because the _convertToPixels() method searches for the keywords "Left", "Right", "Top", and "Bottom" to determine of it's a horizontal or vertical property, and we need "border" in the name so that it knows it should measure relative to the element itself, not its parent. 29502 vn = _convertToPixels(t, "borderTop", bn, bsfx); //vertical number 29503 if (esfx === "%") { 29504 bs = (hn / w * 100) + "%"; 29505 bs2 = (vn / h * 100) + "%"; 29506 } else if (esfx === "em") { 29507 em = _convertToPixels(t, "borderLeft", 1, "em"); 29508 bs = (hn / em) + "em"; 29509 bs2 = (vn / em) + "em"; 29510 } else { 29511 bs = hn + "px"; 29512 bs2 = vn + "px"; 29513 } 29514 if (rel) { 29515 es = (parseFloat(bs) + en) + esfx; 29516 es2 = (parseFloat(bs2) + en) + esfx; 29517 } 29518 } 29519 pt = _parseComplex(style, props[i], bs + " " + bs2, es + " " + es2, false, "0px", pt); 29520 } 29521 return pt; 29522 }, prefix:true, formatter:_getFormatter("0px 0px 0px 0px", false, true)}); 29523 _registerComplexSpecialProp("borderBottomLeftRadius,borderBottomRightRadius,borderTopLeftRadius,borderTopRightRadius", {defaultValue:"0px", parser:function(t, e, p, cssp, pt, plugin) { 29524 return _parseComplex(t.style, p, this.format(_getStyle(t, p, _cs, false, "0px 0px")), this.format(e), false, "0px", pt); 29525 }, prefix:true, formatter:_getFormatter("0px 0px", false, true)}); 29526 _registerComplexSpecialProp("backgroundPosition", {defaultValue:"0 0", parser:function(t, e, p, cssp, pt, plugin) { 29527 var bp = "background-position", 29528 cs = (_cs || _getComputedStyle(t, null)), 29529 bs = this.format( ((cs) ? _ieVers ? cs.getPropertyValue(bp + "-x") + " " + cs.getPropertyValue(bp + "-y") : cs.getPropertyValue(bp) : t.currentStyle.backgroundPositionX + " " + t.currentStyle.backgroundPositionY) || "0 0"), //Internet Explorer doesn't report background-position correctly - we must query background-position-x and background-position-y and combine them (even in IE10). Before IE9, we must do the same with the currentStyle object and use camelCase 29530 es = this.format(e), 29531 ba, ea, i, pct, overlap, src; 29532 if ((bs.indexOf("%") !== -1) !== (es.indexOf("%") !== -1) && es.split(",").length < 2) { 29533 src = _getStyle(t, "backgroundImage").replace(_urlExp, ""); 29534 if (src && src !== "none") { 29535 ba = bs.split(" "); 29536 ea = es.split(" "); 29537 _tempImg.setAttribute("src", src); //set the temp IMG's src to the background-image so that we can measure its width/height 29538 i = 2; 29539 while (--i > -1) { 29540 bs = ba[i]; 29541 pct = (bs.indexOf("%") !== -1); 29542 if (pct !== (ea[i].indexOf("%") !== -1)) { 29543 overlap = (i === 0) ? t.offsetWidth - _tempImg.width : t.offsetHeight - _tempImg.height; 29544 ba[i] = pct ? (parseFloat(bs) / 100 * overlap) + "px" : (parseFloat(bs) / overlap * 100) + "%"; 29545 } 29546 } 29547 bs = ba.join(" "); 29548 } 29549 } 29550 return this.parseComplex(t.style, bs, es, pt, plugin); 29551 }, formatter:_parsePosition}); 29552 _registerComplexSpecialProp("backgroundSize", {defaultValue:"0 0", formatter:function(v) { 29553 v += ""; //ensure it's a string 29554 return (v.substr(0,2) === "co") ? v : _parsePosition(v.indexOf(" ") === -1 ? v + " " + v : v); //if set to something like "100% 100%", Safari typically reports the computed style as just "100%" (no 2nd value), but we should ensure that there are two values, so copy the first one. Otherwise, it'd be interpreted as "100% 0" (wrong). Also remember that it could be "cover" or "contain" which we can't tween but should be able to set. 29555 }}); 29556 _registerComplexSpecialProp("perspective", {defaultValue:"0px", prefix:true}); 29557 _registerComplexSpecialProp("perspectiveOrigin", {defaultValue:"50% 50%", prefix:true}); 29558 _registerComplexSpecialProp("transformStyle", {prefix:true}); 29559 _registerComplexSpecialProp("backfaceVisibility", {prefix:true}); 29560 _registerComplexSpecialProp("userSelect", {prefix:true}); 29561 _registerComplexSpecialProp("margin", {parser:_getEdgeParser("marginTop,marginRight,marginBottom,marginLeft")}); 29562 _registerComplexSpecialProp("padding", {parser:_getEdgeParser("paddingTop,paddingRight,paddingBottom,paddingLeft")}); 29563 _registerComplexSpecialProp("clip", {defaultValue:"rect(0px,0px,0px,0px)", parser:function(t, e, p, cssp, pt, plugin){ 29564 var b, cs, delim; 29565 if (_ieVers < 9) { //IE8 and earlier don't report a "clip" value in the currentStyle - instead, the values are split apart into clipTop, clipRight, clipBottom, and clipLeft. Also, in IE7 and earlier, the values inside rect() are space-delimited, not comma-delimited. 29566 cs = t.currentStyle; 29567 delim = _ieVers < 8 ? " " : ","; 29568 b = "rect(" + cs.clipTop + delim + cs.clipRight + delim + cs.clipBottom + delim + cs.clipLeft + ")"; 29569 e = this.format(e).split(",").join(delim); 29570 } else { 29571 b = this.format(_getStyle(t, this.p, _cs, false, this.dflt)); 29572 e = this.format(e); 29573 } 29574 return this.parseComplex(t.style, b, e, pt, plugin); 29575 }}); 29576 _registerComplexSpecialProp("textShadow", {defaultValue:"0px 0px 0px #999", color:true, multi:true}); 29577 _registerComplexSpecialProp("autoRound,strictUnits", {parser:function(t, e, p, cssp, pt) {return pt;}}); //just so that we can ignore these properties (not tween them) 29578 _registerComplexSpecialProp("border", {defaultValue:"0px solid #000", parser:function(t, e, p, cssp, pt, plugin) { 29579 var bw = _getStyle(t, "borderTopWidth", _cs, false, "0px"), 29580 end = this.format(e).split(" "), 29581 esfx = end[0].replace(_suffixExp, ""); 29582 if (esfx !== "px") { //if we're animating to a non-px value, we need to convert the beginning width to that unit. 29583 bw = (parseFloat(bw) / _convertToPixels(t, "borderTopWidth", 1, esfx)) + esfx; 29584 } 29585 return this.parseComplex(t.style, this.format(bw + " " + _getStyle(t, "borderTopStyle", _cs, false, "solid") + " " + _getStyle(t, "borderTopColor", _cs, false, "#000")), end.join(" "), pt, plugin); 29586 }, color:true, formatter:function(v) { 29587 var a = v.split(" "); 29588 return a[0] + " " + (a[1] || "solid") + " " + (v.match(_colorExp) || ["#000"])[0]; 29589 }}); 29590 _registerComplexSpecialProp("borderWidth", {parser:_getEdgeParser("borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth")}); //Firefox doesn't pick up on borderWidth set in style sheets (only inline). 29591 _registerComplexSpecialProp("float,cssFloat,styleFloat", {parser:function(t, e, p, cssp, pt, plugin) { 29592 var s = t.style, 29593 prop = ("cssFloat" in s) ? "cssFloat" : "styleFloat"; 29594 return new CSSPropTween(s, prop, 0, 0, pt, -1, p, false, 0, s[prop], e); 29595 }}); 29596 29597 //opacity-related 29598 var _setIEOpacityRatio = function(v) { 29599 var t = this.t, //refers to the element's style property 29600 filters = t.filter || _getStyle(this.data, "filter") || "", 29601 val = (this.s + this.c * v) | 0, 29602 skip; 29603 if (val === 100) { //for older versions of IE that need to use a filter to apply opacity, we should remove the filter if opacity hits 1 in order to improve performance, but make sure there isn't a transform (matrix) or gradient in the filters. 29604 if (filters.indexOf("atrix(") === -1 && filters.indexOf("radient(") === -1 && filters.indexOf("oader(") === -1) { 29605 t.removeAttribute("filter"); 29606 skip = (!_getStyle(this.data, "filter")); //if a class is applied that has an alpha filter, it will take effect (we don't want that), so re-apply our alpha filter in that case. We must first remove it and then check. 29607 } else {
29608 t.filter = filters.replace(_alphaFilterExp, ""); 29609 skip = true; 29610 } 29611 } 29612 if (!skip) { 29613 if (this.xn1) { 29614 t.filter = filters = filters || ("alpha(opacity=" + val + ")"); //works around bug in IE7/8 that prevents changes to "visibility" from being applied properly if the filter is changed to a different alpha on the same frame. 29615 } 29616 if (filters.indexOf("pacity") === -1) { //only used if browser doesn't support the standard opacity style property (IE 7 and 8). We omit the "O" to avoid case-sensitivity issues 29617 if (val !== 0 || !this.xn1) { //bugs in IE7/8 won't render the filter properly if opacity is ADDED on the same frame/render as "visibility" changes (this.xn1 is 1 if this tween is an "autoAlpha" tween) 29618 t.filter = filters + " alpha(opacity=" + val + ")"; //we round the value because otherwise, bugs in IE7/8 can prevent "visibility" changes from being applied properly. 29619 } 29620 } else { 29621 t.filter = filters.replace(_opacityExp, "opacity=" + val); 29622 } 29623 } 29624 }; 29625 _registerComplexSpecialProp("opacity,alpha,autoAlpha", {defaultValue:"1", parser:function(t, e, p, cssp, pt, plugin) { 29626 var b = parseFloat(_getStyle(t, "opacity", _cs, false, "1")), 29627 style = t.style, 29628 isAutoAlpha = (p === "autoAlpha"); 29629 if (typeof(e) === "string" && e.charAt(1) === "=") { 29630 e = ((e.charAt(0) === "-") ? -1 : 1) * parseFloat(e.substr(2)) + b; 29631 } 29632 if (isAutoAlpha && b === 1 && _getStyle(t, "visibility", _cs) === "hidden" && e !== 0) { //if visibility is initially set to "hidden", we should interpret that as intent to make opacity 0 (a convenience) 29633 b = 0; 29634 } 29635 if (_supportsOpacity) { 29636 pt = new CSSPropTween(style, "opacity", b, e - b, pt); 29637 } else { 29638 pt = new CSSPropTween(style, "opacity", b * 100, (e - b) * 100, pt); 29639 pt.xn1 = isAutoAlpha ? 1 : 0; //we need to record whether or not this is an autoAlpha so that in the setRatio(), we know to duplicate the setting of the alpha in order to work around a bug in IE7 and IE8 that prevents changes to "visibility" from taking effect if the filter is changed to a different alpha(opacity) at the same time. Setting it to the SAME value first, then the new value works around the IE7/8 bug. 29640 style.zoom = 1; //helps correct an IE issue. 29641 pt.type = 2; 29642 pt.b = "alpha(opacity=" + pt.s + ")"; 29643 pt.e = "alpha(opacity=" + (pt.s + pt.c) + ")"; 29644 pt.data = t; 29645 pt.plugin = plugin; 29646 pt.setRatio = _setIEOpacityRatio; 29647 } 29648 if (isAutoAlpha) { //we have to create the "visibility" PropTween after the opacity one in the linked list so that they run in the order that works properly in IE8 and earlier 29649 pt = new CSSPropTween(style, "visibility", 0, 0, pt, -1, null, false, 0, ((b !== 0) ? "inherit" : "hidden"), ((e === 0) ? "hidden" : "inherit")); 29650 pt.xs0 = "inherit"; 29651 cssp._overwriteProps.push(pt.n); 29652 cssp._overwriteProps.push(p); 29653 } 29654 return pt; 29655 }}); 29656 29657 29658 var _removeProp = function(s, p) { 29659 if (p) { 29660 if (s.removeProperty) { 29661 if (p.substr(0,2) === "ms" || p.substr(0,6) === "webkit") { //Microsoft and some Webkit browsers don't conform to the standard of capitalizing the first prefix character, so we adjust so that when we prefix the caps with a dash, it's correct (otherwise it'd be "ms-transform" instead of "-ms-transform" for IE9, for example) 29662 p = "-" + p; 29663 } 29664 s.removeProperty(p.replace(_capsExp, "-$1").toLowerCase()); 29665 } else { //note: old versions of IE use "removeAttribute()" instead of "removeProperty()" 29666 s.removeAttribute(p); 29667 } 29668 } 29669 }, 29670 _setClassNameRatio = function(v) { 29671 this.t._gsClassPT = this; 29672 if (v === 1 || v === 0) { 29673 this.t.setAttribute("class", (v === 0) ? this.b : this.e); 29674 var mpt = this.data, //first MiniPropTween 29675 s = this.t.style; 29676 while (mpt) { 29677 if (!mpt.v) { 29678 _removeProp(s, mpt.p); 29679 } else { 29680 s[mpt.p] = mpt.v; 29681 } 29682 mpt = mpt._next; 29683 } 29684 if (v === 1 && this.t._gsClassPT === this) { 29685 this.t._gsClassPT = null; 29686 } 29687 } else if (this.t.getAttribute("class") !== this.e) { 29688 this.t.setAttribute("class", this.e); 29689 } 29690 }; 29691 _registerComplexSpecialProp("className", {parser:function(t, e, p, cssp, pt, plugin, vars) { 29692 var b = t.getAttribute("class") || "", //don't use t.className because it doesn't work consistently on SVG elements; getAttribute("class") and setAttribute("class", value") is more reliable. 29693 cssText = t.style.cssText, 29694 difData, bs, cnpt, cnptLookup, mpt; 29695 pt = cssp._classNamePT = new CSSPropTween(t, p, 0, 0, pt, 2); 29696 pt.setRatio = _setClassNameRatio; 29697 pt.pr = -11; 29698 _hasPriority = true; 29699 pt.b = b; 29700 bs = _getAllStyles(t, _cs); 29701 //if there's a className tween already operating on the target, force it to its end so that the necessary inline styles are removed and the class name is applied before we determine the end state (we don't want inline styles interfer
29701ing that were there just for class-specific values) 29702 cnpt = t._gsClassPT; 29703 if (cnpt) { 29704 cnptLookup = {}; 29705 mpt = cnpt.data; //first MiniPropTween which stores the inline styles - we need to force these so that the inline styles don't contaminate things. Otherwise, there's a small chance that a tween could start and the inline values match the destination values and they never get cleaned. 29706 while (mpt) { 29707 cnptLookup[mpt.p] = 1; 29708 mpt = mpt._next; 29709 } 29710 cnpt.setRatio(1); 29711 } 29712 t._gsClassPT = pt; 29713 pt.e = (e.charAt(1) !== "=") ? e : b.replace(new RegExp("(?:\\s|^)" + e.substr(2) + "(?![\\w-])"), "") + ((e.charAt(0) === "+") ? " " + e.substr(2) : ""); 29714 t.setAttribute("class", pt.e); 29715 difData = _cssDif(t, bs, _getAllStyles(t), vars, cnptLookup); 29716 t.setAttribute("class", b); 29717 pt.data = difData.firstMPT; 29718 if (t.style.cssText !== cssText) { //only apply if things change. Otherwise, in cases like a background-image that's pulled dynamically, it could cause a refresh. See https://greensock.com/forums/topic/20368-possible-gsap-bug-switching-classnames-in-chrome/. 29719 t.style.cssText = cssText; //we recorded cssText before we swapped classes and ran _getAllStyles() because in cases when a className tween is overwritten, we remove all the related tweening properties from that class change (otherwise class-specific stuff can't override properties we've directly set on the target's style object due to specificity). 29720 } 29721 pt = pt.xfirst = cssp.parse(t, difData.difs, pt, plugin); //we record the CSSPropTween as the xfirst so that we can handle overwriting propertly (if "className" gets overwritten, we must kill all the properties associated with the className part of the tween, so we can loop through from xfirst to the pt itself) 29722 return pt; 29723 }}); 29724 29725 29726 var _setClearPropsRatio = function(v) { 29727 if (v === 1 || v === 0) if (this.data._totalTime === this.data._totalDuration && this.data.data !== "isFromStart") { //this.data refers to the tween. Only clear at the END of the tween (remember, from() tweens make the ratio go from 1 to 0, so we can't just check that and if the tween is the zero-duration one that's created internally to render the starting values in a from() tween, ignore that because otherwise, for example, from(...{height:100, clearProps:"height", delay:1}) would wipe the height at the beginning of the tween and after 1 second, it'd kick back in). 29728 var s = this.t.style, 29729 transformParse = _specialProps.transform.parse, 29730 a, p, i, clearTransform, transform; 29731 if (this.e === "all") { 29732 s.cssText = ""; 29733 clearTransform = true; 29734 } else { 29735 a = this.e.split(" ").join("").split(","); 29736 i = a.length; 29737 while (--i > -1) { 29738 p = a[i]; 29739 if (_specialProps[p]) { 29740 if (_specialProps[p].parse === transformParse) { 29741 clearTransform = true; 29742 } else { 29743 p = (p === "transformOrigin") ? _transformOriginProp : _specialProps[p].p; //ensures that special properties use the proper browser-specific property name, like "scaleX" might be "-webkit-transform" or "boxShadow" might be "-moz-box-shadow" 29744 } 29745 } 29746 _removeProp(s, p); 29747 } 29748 } 29749 if (clearTransform) { 29750 _removeProp(s, _transformProp); 29751 transform = this.t._gsTransform; 29752 if (transform) { 29753 if (transform.svg) { 29754 this.t.removeAttribute("data-svg-origin"); 29755 this.t.removeAttribute("transform"); 29756 } 29757 delete this.t._gsTransform; 29758 } 29759 } 29760 29761 } 29762 }; 29763 _registerComplexSpecialProp("clearProps", {parser:function(t, e, p, cssp, pt) { 29764 pt = new CSSPropTween(t, p, 0, 0, pt, 2); 29765 pt.setRatio = _setClearPropsRatio; 29766 pt.e = e; 29767 pt.pr = -10; 29768 pt.data = cssp._tween; 29769 _hasPriority = true; 29770 return pt; 29771 }}); 29772 29773 p = "bezier,throwProps,physicsProps,physics2D".split(","); 29774 i = p.length; 29775 while (i--) { 29776 _registerPluginProp(p[i]); 29777 } 29778 29779 29780 29781 29782 29783 29784 29785 29786 p = CSSPlugin.prototype; 29787 p._firstPT = p._lastParsedTransform = p._transform = null; 29788 29789 //gets called when the tween renders for the first time. This kicks everything off, recording start/end values, etc. 29790 p._onInitTween = function(target, vars, tween, index) { 29791 if (!target.nodeType) { //css is only for dom elements 29792 return false;
29793 } 29794 this._target = _target = target; 29795 this._tween = tween; 29796 this._vars = vars; 29797 _index = index; 29798 _autoRound = vars.autoRound; 29799 _hasPriority = false; 29800 _suffixMap = vars.suffixMap || CSSPlugin.suffixMap; 29801 _cs = _getComputedStyle(target, ""); 29802 _overwriteProps = this._overwriteProps; 29803 var style = target.style, 29804 v, pt, pt2, first, last, next, zIndex, tpt, threeD; 29805 if (_reqSafariFix) if (style.zIndex === "") { 29806 v = _getStyle(target, "zIndex", _cs); 29807 if (v === "auto" || v === "") { 29808 //corrects a bug in [non-Android] Safari that prevents it from repainting elements in their new positions if they don't have a zIndex set. We also can't just apply this inside _parseTransform() because anything that's moved in any way (like using "left" or "top" instead of transforms like "x" and "y") can be affected, so it is best to ensure that anything that's tweening has a z-index. Setting "WebkitPerspective" to a non-zero value worked too except that on iOS Safari things would flicker randomly. Plus zIndex is less memory-intensive. 29809 this._addLazySet(style, "zIndex", 0); 29810 } 29811 } 29812 29813 if (typeof(vars) === "string") { 29814 first = style.cssText; 29815 v = _getAllStyles(target, _cs); 29816 style.cssText = first + ";" + vars; 29817 v = _cssDif(target, v, _getAllStyles(target)).difs; 29818 if (!_supportsOpacity && _opacityValExp.test(vars)) { 29819 v.opacity = parseFloat( RegExp.$1 ); 29820 } 29821 vars = v; 29822 style.cssText = first; 29823 } 29824 29825 if (vars.className) { //className tweens will combine any differences they find in the css with the vars that are passed in, so {className:"myClass", scale:0.5, left:20} would work. 29826 this._firstPT = pt = _specialProps.className.parse(target, vars.className, "className", this, null, null, vars); 29827 } else { 29828 this._firstPT = pt = this.parse(target, vars, null); 29829 } 29830 29831 if (this._transformType) { 29832 threeD = (this._transformType === 3); 29833 if (!_transformProp) { 29834 style.zoom = 1; //helps correct an IE issue. 29835 } else if (_isSafari) { 29836 _reqSafariFix = true; 29837 //if zIndex isn't set, iOS Safari doesn't repaint things correctly sometimes (seemingly at random). 29838 if (style.zIndex === "") { 29839 zIndex = _getStyle(target, "zIndex", _cs); 29840 if (zIndex === "auto" || zIndex === "") { 29841 this._addLazySet(style, "zIndex", 0); 29842 } 29843 } 29844 //Setting WebkitBackfaceVisibility corrects 3 bugs: 29845 // 1) [non-Android] Safari skips rendering changes to "top" and "left" that are made on the same frame/render as a transform update. 29846 // 2) iOS Safari sometimes neglects to repaint elements in their new positions. Setting "WebkitPerspective" to a non-zero value worked too except that on iOS Safari things would flicker randomly. 29847 // 3) Safari sometimes displayed odd artifacts when tweening the transform (or WebkitTransform) property, like ghosts of the edges of the element remained. Definitely a browser bug. 29848 //Note: we allow the user to override the auto-setting by defining WebkitBackfaceVisibility in the vars of the tween. 29849 if (_isSafariLT6) { 29850 this._addLazySet(style, "WebkitBackfaceVisibility", this._vars.WebkitBackfaceVisibility || (threeD ? "visible" : "hidden")); 29851 } 29852 } 29853 pt2 = pt; 29854 while (pt2 && pt2._next) { 29855 pt2 = pt2._next; 29856 } 29857 tpt = new CSSPropTween(target, "transform", 0, 0, null, 2); 29858 this._linkCSSP(tpt, null, pt2); 29859 tpt.setRatio = _transformProp ? _setTransformRatio : _setIETransformRatio; 29860 tpt.data = this._transform || _getTransform(target, _cs, true); 29861 tpt.tween = tween; 29862 tpt.pr = -1; //ensures that the transforms get applied after the components are updated. 29863 _overwriteProps.pop(); //we don't want to force the overwrite of all "transform" tweens of the target - we only care about individual transform properties like scaleX, rotation, etc. The CSSPropTween constructor automatically adds the property to _overwriteProps which is why we need to pop() here. 29864 } 29865 29866 if (_hasPriority) { 29867 //reorders the linked list in order of pr (priority) 29868 while (pt) { 29869 next = pt._next; 29870 pt2 = first; 29871 while (pt2 && pt2.pr > pt.pr) { 29872 pt2 = pt2._next; 29873 } 29874 if ((pt._prev = pt2 ? pt2._prev : last)) { 29875 pt._prev._next = pt; 29876 } else { 29877 first = pt; 29878 } 29879 if ((pt._next = pt2)) { 29880 pt2._prev = pt; 29881 } else { 29882 last = pt; 29883 } 29884 pt = next; 29885 } 29886 this._firstPT = first; 29887 } 29888 return true; 29889 }; 29890 29891 29892 p.parse = function(target, vars, pt, plugin) { 29893 var style = target.style, 29894 p, sp, bn, en, bs, es, bsfx, esfx, isStr, rel; 29895 for (p in vars) { 29896 es = vars[p]; //ending value string 29897 sp = _specialProps[p]; //SpecialProp lookup. 29898 if (typeof(es) === "function" && !(sp && sp.allowFunc)) { 29899 es = es(_index, _target); 29900 } 29901 if (sp) { 29902 pt = sp.parse(target, es, p, this, pt, plugin, vars); 29903 } else if (p.substr(0,2) === "--") { //for tweening CSS variables (which always start with "--"). To maximize performance and simplicity, we bypass CSSPlugin altogether and just add a normal property tween to the tween instance itself. 29904 this._tween._propLookup[p] = this._addTween.call(this._tween, target.style, "setProperty", _getComputedStyle(target).getPropertyValue(p) + "", es + "", p, false, p); 29905 continue; 29906 } else { 29907 bs = _getStyle(target, p, _cs) + ""; 29908 isStr = (typeof(es) === "string"); 29909 if (p === "color" || p === "fill" || p === "stroke" || p.indexOf("Color") !== -1 || (isStr && _rgbhslExp.test(es))) { //Opera uses background: to define color sometimes in addition to backgroundColor: 29910 if (!isStr) { 29911 es = _parseColor(es); 29912 es = ((es.length > 3) ? "rgba(" : "rgb(") + es.join(",") + ")"; 29913 } 29914 pt = _parseComplex(style, p, bs, es, true, "transparent", pt, 0, plugin); 29915 29916 } else if (isStr && _complexExp.test(es)) { 29917 pt = _parseComplex(style, p, bs, es, true, null, pt, 0, plugin); 29918 29919 } else { 29920 bn = parseFloat(bs); 29921 bsfx = (bn || bn === 0) ? bs.substr((bn + "").length) : ""; //remember, bs could be non-numeric like "normal" for fontWeight, so we should default to a blank suffix in that case. 29922 29923 if (bs === "" || bs === "auto") { 29924 if (p === "width" || p === "height") { 29925 bn = _getDimension(target, p, _cs); 29926 bsfx = "px"; 29927 } else if (p === "left" || p === "top") {
29928 bn = _calculateOffset(target, p, _cs); 29929 bsfx = "px"; 29930 } else { 29931 bn = (p !== "opacity") ? 0 : 1; 29932 bsfx = ""; 29933 } 29934 } 29935 29936 rel = (isStr && es.charAt(1) === "="); 29937 if (rel) { 29938 en = parseInt(es.charAt(0) + "1", 10); 29939 es = es.substr(2); 29940 en *= parseFloat(es); 29941 esfx = es.replace(_suffixExp, ""); 29942 } else { 29943 en = parseFloat(es); 29944 esfx = isStr ? es.replace(_suffixExp, "") : ""; 29945 } 29946 29947 if (esfx === "") { 29948 esfx = (p in _suffixMap) ? _suffixMap[p] : bsfx; //populate the end suffix, prioritizing the map, then if none is found, use the beginning suffix. 29949 } 29950 29951 es = (en || en === 0) ? (rel ? en + bn : en) + esfx : vars[p]; //ensures that any += or -= prefixes are taken care of. Record the end value before normalizing the suffix because we always want to end the tween on exactly what they intended even if it doesn't match the beginning value's suffix. 29952 //if the beginning/ending suffixes don't match, normalize them... 29953 if (bsfx !== esfx) if (esfx !== "" || p === "lineHeight") if (en || en === 0) if (bn) { //note: if the beginning value (bn) is 0, we don't need to convert units! 29954 bn = _convertToPixels(target, p, bn, bsfx); 29955 if (esfx === "%") { 29956 bn /= _convertToPixels(target, p, 100, "%") / 100; 29957 if (vars.strictUnits !== true) { //some browsers report only "px" values instead of allowing "%" with getComputedStyle(), so we assume that if we're tweening to a %, we should start there too unless strictUnits:true is defined. This approach is particularly useful for responsive designs that use from() tweens. 29958 bs = bn + "%"; 29959 } 29960 29961 } else if (esfx === "em" || esfx === "rem" || esfx === "vw" || esfx === "vh") { 29962 bn /= _convertToPixels(target, p, 1, esfx); 29963 29964 //otherwise convert to pixels. 29965 } else if (esfx !== "px") { 29966 en = _convertToPixels(target, p, en, esfx); 29967 esfx = "px"; //we don't use bsfx after this, so we don't need to set it to px too. 29968 } 29969 if (rel) if (en || en === 0) { 29970 es = (en + bn) + esfx; //the changes we made affect relative calculations, so adjust the end value here. 29971 } 29972 } 29973 29974 if (rel) { 29975 en += bn; 29976 } 29977 29978 if ((bn || bn === 0) && (en || en === 0)) { //faster than isNaN(). Also, previously we required en !== bn but that doesn't really gain much performance and it prevents _parseToProxy() from working properly if beginning and ending values match but need to get tweened by an external plugin anyway. For example, a bezier tween where the target starts at left:0 and has these points: [{left:50},{left:0}] wouldn't work properly because when parsing the last point, it'd match the first (current) one and a non-tweening CSSPropTween would be recorded when we actually need a normal tween (type:0) so that things get updated during the tween properly. 29979 pt = new CSSPropTween(style, p, bn, en - bn, pt, 0, p, (_autoRound !== false && (esfx === "px" || p === "zIndex")), 0, bs, es); 29980 pt.xs0 = esfx; 29981 //DEBUG: _log("tween "+p+" from "+pt.b+" ("+bn+esfx+") to "+pt.e+" with suffix: "+pt.xs0); 29982 } else if (style[p] === undefined || !es && (es + "" === "NaN" || es == null)) { 29983 _log("invalid " + p + " tween value: " + vars[p]); 29984 } else { 29985 pt = new CSSPropTween(style, p, en || bn || 0, 0, pt, -1, p, false, 0, bs, es); 29986 pt.xs0 = (es === "none" && (p === "display" || p.indexOf("Style") !== -1)) ? bs : es; //intermediate value should typically be set immediately (end value) except for "display" or things like borderTopStyle, borderBottomStyle, etc. which should use the beginning value during the tween. 29987 //DEBUG: _log("non-tweening value "+p+": "+pt.xs0); 29988 } 29989 } 29990 } 29991 if (plugin) if (pt && !pt.plugin) { 29992 pt.plugin = plugin; 29993 } 29994 } 29995 return pt; 29996 }; 29997 29998 29999 //gets called every time the tween updates, passing the new ratio (typically a value between 0 and 1, but not always (for example, if an Elastic.easeOut is used, the value can jump above 1 mid-tween). It will always start and 0 and end at 1. 30000 p.setRatio = function(v) { 30001 var pt = this._firstPT, 30002 min = 0.000001, 30003 val, str, i; 30004 //at the end of the tween, we set the values to exactly what we received in order to make sure non-tweening values (like "position" or "float" or whatever) are set and so that if the beginning/ending suffixes (units) didn't match and we normalized to px, the value that the user passed in is used here. We check to see if the tween is at its beginning in case it's a from() tween in which case the ratio will actually go from 1 to 0 over the course of the tween (backwards). 30005 if (v === 1 && (this._tween._time === this._tween._duration || this._tween._time === 0)) { 30006 while (pt) { 30007 if (pt.type !== 2) { 30008 if (pt.r && pt.type !== -1) { 30009 val = pt.r(pt.s + pt.c); 30010 if (!pt.type) { 30011 pt.t[pt.p] = val + pt.xs0; 30012 } else if (pt.type === 1) { //complex value (one that typically has multiple numbers inside a string, like "rect(5px,10px,20px,25px)" 30013 i = pt.l; 30014 str = pt.xs0 + val + pt.xs1; 30015 for (i = 1; i < pt.l; i++) {
30016 str += pt["xn"+i] + pt["xs"+(i+1)]; 30017 } 30018 pt.t[pt.p] = str; 30019 } 30020 } else { 30021 pt.t[pt.p] = pt.e; 30022 } 30023 } else { 30024 pt.setRatio(v); 30025 } 30026 pt = pt._next; 30027 } 30028 30029 } else if (v || !(this._tween._time === this._tween._duration || this._tween._time === 0) || this._tween._rawPrevTime === -0.000001) { 30030 while (pt) { 30031 val = pt.c * v + pt.s; 30032 if (pt.r) { 30033 val = pt.r(val); 30034 } else if (val < min) if (val > -min) { 30035 val = 0; 30036 } 30037 if (!pt.type) { 30038 pt.t[pt.p] = val + pt.xs0; 30039 } else if (pt.type === 1) { //complex value (one that typically has multiple numbers inside a string, like "rect(5px,10px,20px,25px)" 30040 i = pt.l; 30041 if (i === 2) { 30042 pt.t[pt.p] = pt.xs0 + val + pt.xs1 + pt.xn1 + pt.xs2; 30043 } else if (i === 3) { 30044 pt.t[pt.p] = pt.xs0 + val + pt.xs1 + pt.xn1 + pt.xs2 + pt.xn2 + pt.xs3; 30045 } else if (i === 4) { 30046 pt.t[pt.p] = pt.xs0 + val + pt.xs1 + pt.xn1 + pt.xs2 + pt.xn2 + pt.xs3 + pt.xn3 + pt.xs4; 30047 } else if (i === 5) { 30048 pt.t[pt.p] = pt.xs0 + val + pt.xs1 + pt.xn1 + pt.xs2 + pt.xn2 + pt.xs3 + pt.xn3 + pt.xs4 + pt.xn4 + pt.xs5; 30049 } else { 30050 str = pt.xs0 + val + pt.xs1; 30051 for (i = 1; i < pt.l; i++) { 30052 str += pt["xn"+i] + pt["xs"+(i+1)]; 30053 } 30054 pt.t[pt.p] = str; 30055 } 30056 30057 } else if (pt.type === -1) { //non-tweening value 30058 pt.t[pt.p] = pt.xs0; 30059 30060 } else if (pt.setRatio) { //custom setRatio() for things like SpecialProps, external plugins, etc. 30061 pt.setRatio(v); 30062 } 30063 pt = pt._next; 30064 } 30065 30066 //if the tween is reversed all the way back to the beginning, we need to restore the original values which may have different units (like % instead of px or em or whatever). 30067 } else { 30068 while (pt) { 30069 if (pt.type !== 2) { 30070 pt.t[pt.p] = pt.b; 30071 } else { 30072 pt.setRatio(v); 30073 } 30074 pt = pt._next; 30075 } 30076 } 30077 }; 30078 30079 /** 30080 * @private 30081 * Forces rendering of the target's transforms (rotation, scale, etc.) whenever the CSSPlugin's setRatio() is called. 30082 * Basically, this tells the CSSPlugin to create a CSSPropTween (type 2) after instantiation that runs last in the linked 30083 * list and calls the appropriate (3D or 2D) rendering function. We separate this into its own method so that we can call 30084 * it from other plugins like BezierPlugin if, for example, it needs to apply an autoRotation and this CSSPlugin 30085 * doesn't have any transform-related properties of its own. You can call this method as many times as you 30086 * want and it won't create duplicate CSSPropTweens. 30087 * 30088 * @param {boolean} threeD if true, it should apply 3D tweens (otherwise, just 2D ones are fine and typically faster) 30089 */ 30090 p._enableTransforms = function(threeD) { 30091 this._transform = this._transform || _getTransform(this._target, _cs, true); //ensures that the element has a _gsTransform property with the appropriate values. 30092 this._transformType = (!(this._transform.svg && _useSVGTransformAttr) && (threeD || this._transformType === 3)) ? 3 : 2; 30093 }; 30094 30095 var lazySet = function(v) { 30096 this.t[this.p] = this.e; 30097 this.data._linkCSSP(this, this._next, null, true); //we purposefully keep this._next even though it'd make sense to null it, but this is a performance optimization, as this happens during the while (pt) {} loop in setRatio() at the bottom of which it sets pt = pt._next, so if we null it, the linked list will be broken in that loop. 30098 }; 30099 /** @private Gives us a way to set a value on the first render (and only the first render). **/ 30100 p._addLazySet = function(t, p, v) { 30101 var pt = this._firstPT = new CSSPropTween(t, p, 0, 0, this._firstPT, 2); 30102 pt.e = v; 30103 pt.setRatio = lazySet; 30104 pt.data = this; 30105 }; 30106 30107 /** @private **/ 30108 p._linkCSSP = function(pt, next, prev, remove) { 30109 if (pt) { 30110 if (next) { 30111 next._prev = pt; 30112 } 30113 if (pt._next) { 30114 pt._next._prev = pt._prev; 30115 } 30116 if (pt._prev) { 30117 pt._prev._next = pt._next; 30118 } else if (this._firstPT === pt) { 30119 this._firstPT = pt._next; 30120 remove = true; //just to prevent resetting this._firstPT 5 lines down in case pt._next is null. (optimized for speed) 30121 } 30122 if (prev) { 30123 prev._next = pt; 30124 } else if (!remove && this._firstPT === null) { 30125 this._firstPT = pt; 30126 } 30127 pt._next = next; 30128 pt._prev = prev; 30129 } 30130 return pt; 30131 }; 30132 30133 p._mod = function(lookup) { 30134 var pt = this._firstPT; 30135 while (pt) { 30136 if (typeof(lookup[pt.p]) === "function") { //only gets called by RoundPropsPlugin (ModifyPlugin manages all the rendering internally for CSSPlugin properties that need modification). Remember, we handle rounding a bit differently in this plugin for performance reasons, leveraging "r" as an indicator that the value should be roun
30136ded internally. 30137 pt.r = lookup[pt.p]; 30138 } 30139 pt = pt._next; 30140 } 30141 }; 30142 30143 //we need to make sure that if alpha or autoAlpha is killed, opacity is too. And autoAlpha affects the "visibility" property. 30144 p._kill = function(lookup) { 30145 var copy = lookup, 30146 pt, p, xfirst; 30147 if (lookup.autoAlpha || lookup.alpha) { 30148 copy = {}; 30149 for (p in lookup) { //copy the lookup so that we're not changing the original which may be passed elsewhere. 30150 copy[p] = lookup[p]; 30151 } 30152 copy.opacity = 1; 30153 if (copy.autoAlpha) { 30154 copy.visibility = 1; 30155 } 30156 } 30157 if (lookup.className && (pt = this._classNamePT)) { //for className tweens, we need to kill any associated CSSPropTweens too; a linked list starts at the className's "xfirst". 30158 xfirst = pt.xfirst; 30159 if (xfirst && xfirst._prev) { 30160 this._linkCSSP(xfirst._prev, pt._next, xfirst._prev._prev); //break off the prev 30161 } else if (xfirst === this._firstPT) { 30162 this._firstPT = pt._next; 30163 } 30164 if (pt._next) { 30165 this._linkCSSP(pt._next, pt._next._next, xfirst._prev); 30166 } 30167 this._classNamePT = null; 30168 } 30169 pt = this._firstPT; 30170 while (pt) { 30171 if (pt.plugin && pt.plugin !== p && pt.plugin._kill) { //for plugins that are registered with CSSPlugin, we should notify them of the kill. 30172 pt.plugin._kill(lookup); 30173 p = pt.plugin; 30174 } 30175 pt = pt._next; 30176 } 30177 return TweenPlugin.prototype._kill.call(this, copy); 30178 }; 30179 30180 30181 30182 //used by cascadeTo() for gathering all the style properties of each child element into an array for comparison. 30183 var _getChildStyles = function(e, props, targets) { 30184 var children, i, child, type; 30185 if (e.slice) { 30186 i = e.length; 30187 while (--i > -1) { 30188 _getChildStyles(e[i], props, targets); 30189 } 30190 return; 30191 } 30192 children = e.childNodes; 30193 i = children.length; 30194 while (--i > -1) { 30195 child = children[i]; 30196 type = child.type; 30197 if (child.style) { 30198 props.push(_getAllStyles(child)); 30199 if (targets) { 30200 targets.push(child); 30201 } 30202 } 30203 if ((type === 1 || type === 9 || type === 11) && child.childNodes.length) { 30204 _getChildStyles(child, props, targets); 30205 } 30206 } 30207 }; 30208 30209 /** 30210 * Typically only useful for className tweens that may affect child elements, this method creates a TweenLite 30211 * and then compares the style properties of all the target's child elements at the tween's start and end, and 30212 * if any are different, it also creates tweens for those and returns an array containing ALL of the resulting 30213 * tweens (so that you can easily add() them to a TimelineLite, for example). The reason this functionality is 30214 * wrapped into a separate static method of CSSPlugin instead of being integrated into all regular className tweens 30215 * is because it creates entirely new tweens that may have completely different targets than the original tween, 30216 * so if they were all lumped into the original tween instance, it would be inconsistent with the rest of the API 30217 * and it would create other problems. For example: 30218 * - If I create a tween of elementA, that tween instance may suddenly change its target to include 50 other elements (unintuitive if I specifically defined the target I wanted) 30219 * - We can't just create new independent tweens because otherwise, what happens if the original/parent tween is reversed or pause or dropped into a TimelineLite for tight control? You'd expect that tween's behavior to affect all the others. 30220 * - Analyzing every style property of every child before and after the tween is an expensive operation when there are many children, so this behavior shouldn't be imposed on all className tweens by default, especially since it's probably rare that this extra functionality is needed. 30221 * 30222 * @param {Object} target object to be tweened 30223 * @param {number} Duration in seconds (or frames for frames-based tweens) 30224 * @param {Object} Object containing the end values, like {className:"newClass", ease:Linear.easeNone} 30225 * @return {Array} An array of TweenLite instances 30226 */ 30227 CSSPlugin.cascadeTo = function(target, duration, vars) { 30228 var tween = TweenLite.to(target, duration, vars), 30229 results = [tween], 30230 b = [], 30231 e = [], 30232 targets = [], 30233 _reservedProps = TweenLite._internals.reservedProps, 30234 i, difs, p, from; 30235 target = tween._targets || tween.target; 30236 _getChildStyles(target, b, targets); 30237 tween.render(duration, true, true); 30238 _getChildStyles(target, e); 30239 tween.render(0, true, true); 30240 tween._enabled(true); 30241 i = targets.length; 30242 while (--i > -1) { 30243 difs = _cssDif(targets[i], b[i], e[i]); 30244 if (difs.firstMPT) { 30245 difs = difs.difs; 30246 for (p in vars) { 30247 if (_reservedProps[p]) { 30248 difs[p] = vars[p]; 30249 } 30250 } 30251 from = {}; 30252 for (p in difs) { 30253 from[p] = b[i][p]; 30254 } 30255 results.push(TweenLite.fromTo(targets[i], duration, from, difs)); 30256 } 30257 } 30258 return results; 30259 }; 30260 30261 TweenPlugin.activate([CSSPlugin]); 30262 return CSSPlugin; 30263 30264 }, true); 30265 30266 30267 30268 30269 30270 30271 30272 30273 30274 30275 30276 /* 30277 * ---------------------------------------------------------------- 30278 * RoundPropsPlugin 30279 * ---------------------------------------------------------------- 30280 */ 30281 (function() { 30282 30283 var RoundPropsPlugin = _gsScope._gsDefine.plugin({ 30284 propName: "roundProps", 30285 version: "1.7.0", 30286 priority: -1, 30287 API: 2, 30288 30289 //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run. 30290 init: function(target, value, tween) { 30291 this._tween = tween; 30292 return true; 30293 } 30294 30295 }), 30296 _getRoundFunc = function(v) { //pass in 0.1 get a function that'll round to the nearest tenth, or 5 to round to the closest 5, or 0.001 to the closest 1000th, etc. 30297 var p = v < 1 ? Math.pow(10, (v + "").length - 2) : 1; //to avoid floating point math errors (like 24 * 0.1 == 2.4000000000000004), we chop off at a specific number of decimal places (much faster than toFixed() 30298 return function(n) { 30299 return ((Math.round(n / v) * v * p) | 0) / p; 30300 }; 30301 }, 30302 _roundLinkedList = function(node, mod) { 30303 while (node) { 30304 if (!node.f && !node.blob) { 30305 node.m = mod || Math.round; 30306 } 30307 node = node._next; 30308 } 30309 }, 30310 p = RoundPropsPlugin.prototype; 30311 30312 p._onInitAllProps = function() { 30313 var tween = this._tween,
30314 rp = tween.vars.roundProps, 30315 lookup = {}, 30316 rpt = tween._propLookup.roundProps, 30317 pt, next, i, p; 30318 if (typeof(rp) === "object" && !rp.push) { 30319 for (p in rp) { 30320 lookup[p] = _getRoundFunc(rp[p]); 30321 } 30322 } else { 30323 if (typeof(rp) === "string") { 30324 rp = rp.split(","); 30325 } 30326 i = rp.length; 30327 while (--i > -1) { 30328 lookup[rp[i]] = Math.round; 30329 } 30330 } 30331 30332 for (p in lookup) { 30333 pt = tween._firstPT; 30334 while (pt) { 30335 next = pt._next; //record here, because it may get removed 30336 if (pt.pg) { 30337 pt.t._mod(lookup); 30338 } else if (pt.n === p) { 30339 if (pt.f === 2 && pt.t) { //a blob (text containing multiple numeric values) 30340 _roundLinkedList(pt.t._firstPT, lookup[p]); 30341 } else { 30342 this._add(pt.t, p, pt.s, pt.c, lookup[p]); 30343 //remove from linked list 30344 if (next) { 30345 next._prev = pt._prev; 30346 } 30347 if (pt._prev) { 30348 pt._prev._next = next; 30349 } else if (tween._firstPT === pt) { 30350 tween._firstPT = next; 30351 } 30352 pt._next = pt._prev = null; 30353 tween._propLookup[p] = rpt; 30354 } 30355 } 30356 pt = next; 30357 } 30358 } 30359 return false; 30360 }; 30361 30362 p._add = function(target, p, s, c, mod) { 30363 this._addTween(target, p, s, s + c, p, mod || Math.round); 30364 this._overwriteProps.push(p); 30365 }; 30366 30367 }()); 30368 30369 30370 30371 30372 30373 30374 30375 30376 30377 30378 /* 30379 * ---------------------------------------------------------------- 30380 * AttrPlugin 30381 * ---------------------------------------------------------------- 30382 */ 30383 30384 (function() { 30385 30386 _gsScope._gsDefine.plugin({ 30387 propName: "attr", 30388 API: 2, 30389 version: "0.6.1", 30390 30391 //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run. 30392 init: function(target, value, tween, index) { 30393 var p, end; 30394 if (typeof(target.setAttribute) !== "function") { 30395 return false; 30396 } 30397 for (p in value) { 30398 end = value[p]; 30399 if (typeof(end) === "function") { 30400 end = end(index, target); 30401 } 30402 this._addTween(target, "setAttribute", target.getAttribute(p) + "", end + "", p, false, p); 30403 this._overwriteProps.push(p); 30404 } 30405 return true; 30406 } 30407 30408 }); 30409 30410 }()); 30411 30412 30413 30414 30415 30416 30417 30418 30419 30420 30421 /* 30422 * ---------------------------------------------------------------- 30423 * DirectionalRotationPlugin 30424 * ---------------------------------------------------------------- 30425 */ 30426 _gsScope._gsDefine.plugin({ 30427 propName: "directionalRotation", 30428 version: "0.3.1", 30429 API: 2, 30430 30431 //called when the tween renders for the first time. This is where initial values should be recorded and any setup routines should run. 30432 init: function(target, value, tween, index) { 30433 if (typeof(value) !== "object") { 30434 value = {rotation:value}; 30435 } 30436 this.finals = {}; 30437 var cap = (value.useRadians === true) ? Math.PI * 2 : 360, 30438 min = 0.000001, 30439 p, v, start, end, dif, split; 30440 for (p in value) { 30441 if (p !== "useRadians") { 30442 end = value[p]; 30443 if (typeof(end) === "function") { 30444 end = end(index, target); 30445 } 30446 split = (end + "").split("_"); 30447 v = split[0]; 30448 start = parseFloat( (typeof(target[p]) !== "function") ? target[p] : target[ ((p.indexOf("set") || typeof(target["get" + p.substr(3)]) !== "function") ? p : "get" + p.substr(3)) ]() ); 30449 end = this.finals[p] = (typeof(v) === "string" && v.charAt(1) === "=") ? start + parseInt(v.charAt(0) + "1", 10) * Number(v.substr(2)) : Number(v) || 0; 30450 dif = end - start; 30451 if (split.length) { 30452 v = split.join("_"); 30453 if (v.indexOf("short") !== -1) { 30454 dif = dif % cap; 30455 if (dif !== dif % (cap / 2)) { 30456 dif = (dif < 0) ? dif + cap : dif - cap; 30457 } 30458 } 30459 if (v.indexOf("_cw") !== -1 && dif < 0) { 30460 dif = ((dif + cap * 9999999999) % cap) - ((dif / cap) | 0) * cap; 30461 } else if (v.indexOf("ccw") !== -1 && dif > 0) { 30462 dif = ((dif - cap * 9999999999) % cap) - ((dif / cap) | 0) * cap; 30463 } 30464 } 30465 if (dif > min || dif < -min) { 30466 this._addTween(target, p, start, start + dif, p); 30467 this._overwriteProps.push(p); 30468 } 30469 } 30470 } 30471 return true; 30472 }, 30473 30474 //called each time the values should be updated, and the ratio gets passed as the only parameter (typically it's a value between 0 and 1, but it can exceed those when using an ease like Elastic.easeOut or Back.easeOut, etc.)
30475 set: function(ratio) { 30476 var pt; 30477 if (ratio !== 1) { 30478 this._super.setRatio.call(this, ratio); 30479 } else { 30480 pt = this._firstPT; 30481 while (pt) { 30482 if (pt.f) { 30483 pt.t[pt.p](this.finals[pt.p]); 30484 } else { 30485 pt.t[pt.p] = this.finals[pt.p]; 30486 } 30487 pt = pt._next; 30488 } 30489 } 30490 } 30491 30492 })._autoCSS = true; 30493 30494 30495 30496 30497 30498 30499 30500 30501 30502 30503 30504 /* 30505 * ---------------------------------------------------------------- 30506 * EasePack 30507 * ---------------------------------------------------------------- 30508 */ 30509 _gsScope._gsDefine("easing.Back", ["easing.Ease"], function(Ease) { 30510 30511 var w = (_gsScope.GreenSockGlobals || _gsScope), 30512 gs = w.com.greensock, 30513 _2PI = Math.PI * 2, 30514 _HALF_PI = Math.PI / 2, 30515 _class = gs._class, 30516 _create = function(n, f) { 30517 var C = _class("easing." + n, function(){}, true), 30518 p = C.prototype = new Ease(); 30519 p.constructor = C; 30520 p.getRatio = f; 30521 return C; 30522 }, 30523 _easeReg = Ease.register || function(){}, //put an empty function in place just as a safety measure in case someone loads an OLD version of TweenLite.js where Ease.register doesn't exist. 30524 _wrap = function(name, EaseOut, EaseIn, EaseInOut, aliases) { 30525 var C = _class("easing."+name, { 30526 easeOut:new EaseOut(), 30527 easeIn:new EaseIn(), 30528 easeInOut:new EaseInOut() 30529 }, true); 30530 _easeReg(C, name); 30531 return C; 30532 }, 30533 EasePoint = function(time, value, next) { 30534 this.t = time; 30535 this.v = value; 30536 if (next) { 30537 this.next = next; 30538 next.prev = this; 30539 this.c = next.v - value; 30540 this.gap = next.t - time; 30541 } 30542 }, 30543 30544 //Back 30545 _createBack = function(n, f) { 30546 var C = _class("easing." + n, function(overshoot) { 30547 this._p1 = (overshoot || overshoot === 0) ? overshoot : 1.70158; 30548 this._p2 = this._p1 * 1.525; 30549 }, true), 30550 p = C.prototype = new Ease(); 30551 p.constructor = C; 30552 p.getRatio = f; 30553 p.config = function(overshoot) { 30554 return new C(overshoot); 30555 }; 30556 return C; 30557 }, 30558 30559 Back = _wrap("Back", 30560 _createBack("BackOut", function(p) { 30561 return ((p = p - 1) * p * ((this._p1 + 1) * p + this._p1) + 1); 30562 }), 30563 _createBack("BackIn", function(p) { 30564 return p * p * ((this._p1 + 1) * p - this._p1); 30565 }), 30566 _createBack("BackInOut", function(p) { 30567 return ((p *= 2) < 1) ? 0.5 * p * p * ((this._p2 + 1) * p - this._p2) : 0.5 * ((p -= 2) * p * ((this._p2 + 1) * p + this._p2) + 2); 30568 }) 30569 ), 30570 30571 30572 //SlowMo 30573 SlowMo = _class("easing.SlowMo", function(linearRatio, power, yoyoMode) { 30574 power = (power || power === 0) ? power : 0.7; 30575 if (linearRatio == null) { 30576 linearRatio = 0.7; 30577 } else if (linearRatio > 1) { 30578 linearRatio = 1; 30579 } 30580 this._p = (linearRatio !== 1) ? power : 0; 30581 this._p1 = (1 - linearRatio) / 2; 30582 this._p2 = linearRatio; 30583 this._p3 = this._p1 + this._p2; 30584 this._calcEnd = (yoyoMode === true); 30585 }, true), 30586 p = SlowMo.prototype = new Ease(), 30587 SteppedEase, ExpoScaleEase, RoughEase, _createElastic; 30588 30589 p.constructor = SlowMo; 30590 p.getRatio = function(p) { 30591 var r = p + (0.5 - p) * this._p; 30592 if (p < this._p1) { 30593 return this._calcEnd ? 1 - ((p = 1 - (p / this._p1)) * p) : r - ((p = 1 - (p / this._p1)) * p * p * p * r); 30594 } else if (p > this._p3) { 30595 return this._calcEnd ? (p === 1 ? 0 : 1 - (p = (p - this._p3) / this._p1) * p) : r + ((p - r) * (p = (p - this._p3) / this._p1) * p * p * p); //added p === 1 ? 0 to avoid floating point rounding errors from affecting the final value, like 1 - 0.7 = 0.30000000000000004 instead of 0.3 30596 } 30597 return this._calcEnd ? 1 : r; 30598 }; 30599 SlowMo.ease = new SlowMo(0.7, 0.7); 30600 30601 p.config = SlowMo.config = function(linearRatio, power, yoyoMode) { 30602 return new SlowMo(linearRatio, power, yoyoMode); 30603 }; 30604 30605 30606 //SteppedEase 30607 SteppedEase = _class("easing.SteppedEase", function(steps, immediateStart) { 30608 steps = steps || 1; 30609 this._p1 = 1 / steps; 30610 this._p2 = steps + (immediateStart ? 0 : 1); 30611 this._p3 = immediateStart ? 1 : 0; 30612 }, true); 30613 p = SteppedEase.prototype = new Ease(); 30614 p.constructor = SteppedEase; 30615 p.getRatio = function(p) { 30616 if (p < 0) { 30617 p = 0; 30618 } else if (p >= 1) { 30619 p = 0.999999999; 30620 } 30621 return (((this._p2 * p) | 0) + this._p3) * this._p1; 30622 }; 30623 p.config = SteppedEase.config = function(steps, immediateStart) { 30624 return new SteppedEase(steps, immediateStart); 30625 }; 30626 30627 //ExpoScaleEase 30628 ExpoScaleEase = _class("easing.ExpoScaleEase", function(start, end, ease) { 30629 this._p1 = Math.log(end / start); 30630 this._p2 = end - start; 30631 this._p3 = start; 30632 this._ease = ease; 30633 }, true); 30634 p = ExpoScaleEase.prototype = new Ease(); 30635 p.constructor = ExpoScaleEase; 30636 p.getRatio = function(p) { 30637 if (this._ease) { 30638 p = this._ease.getRatio(p); 30639 } 30640 return (this._p3 * Math.exp(this._p1 * p) - this._p3) / this._p2; 30641 }; 30642 p.config = ExpoScaleEase.config = function(start, end, ease) { 30643 return new ExpoScaleEase(start, end, ease); 30644 }; 30645 30646 30647 //RoughEase 30648 RoughEase = _class("easing.RoughEase", function(vars) { 30649 vars = vars || {}; 30650 var taper = vars.taper || "none", 30651 a = [], 30652 cnt = 0, 30653 points = (vars.points || 20) | 0, 30654 i = points, 30655 randomize = (vars.randomize !== false), 30656 clamp = (vars.clamp === true), 30657 template = (vars.template instanceof Ease) ? vars.template : null,
30658 strength = (typeof(vars.strength) === "number") ? vars.strength * 0.4 : 0.4, 30659 x, y, bump, invX, obj, pnt; 30660 while (--i > -1) { 30661 x = randomize ? Math.random() : (1 / points) * i; 30662 y = template ? template.getRatio(x) : x; 30663 if (taper === "none") { 30664 bump = strength; 30665 } else if (taper === "out") { 30666 invX = 1 - x; 30667 bump = invX * invX * strength; 30668 } else if (taper === "in") { 30669 bump = x * x * strength; 30670 } else if (x < 0.5) { //"both" (start) 30671 invX = x * 2; 30672 bump = invX * invX * 0.5 * strength; 30673 } else { //"both" (end) 30674 invX = (1 - x) * 2; 30675 bump = invX * invX * 0.5 * strength; 30676 } 30677 if (randomize) { 30678 y += (Math.random() * bump) - (bump * 0.5); 30679 } else if (i % 2) { 30680 y += bump * 0.5; 30681 } else { 30682 y -= bump * 0.5; 30683 } 30684 if (clamp) { 30685 if (y > 1) { 30686 y = 1; 30687 } else if (y < 0) { 30688 y = 0; 30689 } 30690 } 30691 a[cnt++] = {x:x, y:y}; 30692 } 30693 a.sort(function(a, b) { 30694 return a.x - b.x; 30695 }); 30696 30697 pnt = new EasePoint(1, 1, null); 30698 i = points; 30699 while (--i > -1) { 30700 obj = a[i]; 30701 pnt = new EasePoint(obj.x, obj.y, pnt); 30702 } 30703 30704 this._prev = new EasePoint(0, 0, (pnt.t !== 0) ? pnt : pnt.next); 30705 }, true); 30706 p = RoughEase.prototype = new Ease(); 30707 p.constructor = RoughEase; 30708 p.getRatio = function(p) { 30709 var pnt = this._prev; 30710 if (p > pnt.t) { 30711 while (pnt.next && p >= pnt.t) { 30712 pnt = pnt.next; 30713 } 30714 pnt = pnt.prev; 30715 } else { 30716 while (pnt.prev && p <= pnt.t) { 30717 pnt = pnt.prev; 30718 } 30719 } 30720 this._prev = pnt; 30721 return (pnt.v + ((p - pnt.t) / pnt.gap) * pnt.c); 30722 }; 30723 p.config = function(vars) { 30724 return new RoughEase(vars); 30725 }; 30726 RoughEase.ease = new RoughEase(); 30727 30728 30729 //Bounce 30730 _wrap("Bounce", 30731 _create("BounceOut", function(p) { 30732 if (p < 1 / 2.75) { 30733 return 7.5625 * p * p; 30734 } else if (p < 2 / 2.75) { 30735 return 7.5625 * (p -= 1.5 / 2.75) * p + 0.75; 30736 } else if (p < 2.5 / 2.75) { 30737 return 7.5625 * (p -= 2.25 / 2.75) * p + 0.9375; 30738 } 30739 return 7.5625 * (p -= 2.625 / 2.75) * p + 0.984375; 30740 }), 30741 _create("BounceIn", function(p) { 30742 if ((p = 1 - p) < 1 / 2.75) { 30743 return 1 - (7.5625 * p * p); 30744 } else if (p < 2 / 2.75) { 30745 return 1 - (7.5625 * (p -= 1.5 / 2.75) * p + 0.75); 30746 } else if (p < 2.5 / 2.75) { 30747 return 1 - (7.5625 * (p -= 2.25 / 2.75) * p + 0.9375); 30748 } 30749 return 1 - (7.5625 * (p -= 2.625 / 2.75) * p + 0.984375); 30750 }), 30751 _create("BounceInOut", function(p) { 30752 var invert = (p < 0.5); 30753 if (invert) { 30754 p = 1 - (p * 2); 30755 } else { 30756 p = (p * 2) - 1; 30757 } 30758 if (p < 1 / 2.75) { 30759 p = 7.5625 * p * p; 30760 } else if (p < 2 / 2.75) { 30761 p = 7.5625 * (p -= 1.5 / 2.75) * p + 0.75; 30762 } else if (p < 2.5 / 2.75) { 30763 p = 7.5625 * (p -= 2.25 / 2.75) * p + 0.9375; 30764 } else { 30765 p = 7.5625 * (p -= 2.625 / 2.75) * p + 0.984375; 30766 } 30767 return invert ? (1 - p) * 0.5 : p * 0.5 + 0.5; 30768 }) 30769 ); 30770 30771 30772 //CIRC 30773 _wrap("Circ", 30774 _create("CircOut", function(p) { 30775 return Math.sqrt(1 - (p = p - 1) * p); 30776 }), 30777 _create("CircIn", function(p) { 30778 return -(Math.sqrt(1 - (p * p)) - 1); 30779 }), 30780 _create("CircInOut", function(p) { 30781 return ((p*=2) < 1) ? -0.5 * (Math.sqrt(1 - p * p) - 1) : 0.5 * (Math.sqrt(1 - (p -= 2) * p) + 1); 30782 }) 30783 ); 30784 30785 30786 //Elastic 30787 _createElastic = function(n, f, def) { 30788 var C = _class("easing." + n, function(amplitude, period) { 30789 this._p1 = (amplitude >= 1) ? amplitude : 1; //note: if amplitude is < 1, we simply adjust the period for a more natural feel. Otherwise the math doesn't work right and the curve starts at 1. 30790 this._p2 = (period || def) / (amplitude < 1 ? amplitude : 1); 30791 this._p3 = this._p2 / _2PI * (Math.asin(1 / this._p1) || 0); 30792 this._p2 = _2PI / this._p2; //precalculate to optimize 30793 }, true), 30794 p = C.prototype = new Ease(); 30795 p.constructor = C; 30796 p.getRatio = f; 30797 p.config = function(amplitude, period) { 30798 return new C(amplitude, period); 30799 }; 30800 return C; 30801 }; 30802 _wrap("Elastic", 30803 _createElastic("ElasticOut", function(p) { 30804 return this._p1 * Math.pow(2, -10 * p) * Math.sin( (p - this._p3) * this._p2 ) + 1; 30805 }, 0.3), 30806 _createElastic("ElasticIn", function(p) { 30807 return -(this._p1 * Math.pow(2, 10 * (p -= 1)) * Math.sin( (p - this._p3) * this._p2 )); 30808 }, 0.3), 30809 _createElastic("ElasticInOut", function(p) { 30810 return ((p *= 2) < 1) ? -0.5 * (this._p1 * Math.pow(2, 10 * (p -= 1)) * Math.sin( (p - this._p3) * this._p2)) : this._p1 * Math.pow(2, -10 *(p -= 1)) * Math.sin( (p - this._p3) * this._p2 ) * 0.5 + 1; 30811 }, 0.45) 30812 ); 30813 30814 30815 //Expo 30816 _wrap("Expo", 30817 _create("ExpoOut", function(p) { 30818 return 1 - Math.pow(2, -10 * p); 30819 }), 30820 _create("ExpoIn", function(p) { 30821 return Math.pow(2, 10 * (p - 1)) - 0.001; 30822 }), 30823 _create("ExpoInOut", function(p) { 30824 return ((p *= 2) < 1) ? 0.5 * Math.pow(2, 10 * (p - 1)) : 0.5 * (2 - Math.pow(2, -10 * (p - 1))); 30825 }) 30826 ); 30827 30828 30829 //Sine 30830 _wrap("Sine", 30831 _create("SineOut", function(p) { 30832 return Math.sin(p * _HALF_PI); 30833 }), 30834 _create("SineIn", function(p) { 30835 return -Math.cos(p * _HALF_PI) + 1; 30836 }), 30837 _create("SineInOut", function(p) { 30838 return -0.5 * (Math.cos(Math.PI * p) - 1); 30839 }) 30840 ); 30841 30842 _class("easing.EaseLookup", { 30843 find:function(s) { 30844 return Ease.map[s]; 30845 } 30846 }, true); 30847 30848 //register the non-standard eases 30849 _easeReg(w.SlowMo, "SlowMo", "ease,"); 30850 _easeReg(RoughEase, "RoughEase", "ease,");
30851 _easeReg(SteppedEase, "SteppedEase", "ease,"); 30852 30853 return Back; 30854 30855 }, true); 30856 30857 30858 }); 30859 30860 if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case TweenLite was already loaded separately. 30861 30862 30863 30864 30865 30866 30867 30868 30869 30870 30871 30872 /* 30873 * ---------------------------------------------------------------- 30874 * Base classes like TweenLite, SimpleTimeline, Ease, Ticker, etc. 30875 * ---------------------------------------------------------------- 30876 */ 30877 (function(window, moduleName) { 30878 30879 "use strict"; 30880 var _exports = {}, 30881 _doc = window.document, 30882 _globals = window.GreenSockGlobals = window.GreenSockGlobals || window, 30883 existingModule = _globals[moduleName]; 30884 if (existingModule) { 30885 if (typeof(module) !== "undefined" && module.exports) { //node 30886 module.exports = existingModule; 30887 } 30888 return existingModule; //in case the core set of classes is already loaded, don't instantiate twice. 30889 } 30890 var _namespace = function(ns) { 30891 var a = ns.split("."), 30892 p = _globals, i; 30893 for (i = 0; i < a.length; i++) { 30894 p[a[i]] = p = p[a[i]] || {}; 30895 } 30896 return p; 30897 }, 30898 gs = _namespace("com.greensock"), 30899 _tinyNum = 0.00000001, 30900 _slice = function(a) { //don't use Array.prototype.slice.call(target, 0) because that doesn't work in IE8 with a NodeList that's returned by querySelectorAll() 30901 var b = [], 30902 l = a.length, 30903 i; 30904 for (i = 0; i !== l; b.push(a[i++])) {} 30905 return b; 30906 }, 30907 _emptyFunc = function() {}, 30908 _isArray = (function() { //works around issues in iframe environments where the Array global isn't shared, thus if the object originates in a different window/iframe, "(obj instanceof Array)" will evaluate false. We added some speed optimizations to avoid Object.prototype.toString.call() unless it's absolutely necessary because it's VERY slow (like 20x slower) 30909 var toString = Object.prototype.toString, 30910 array = toString.call([]); 30911 return function(obj) { 30912 return obj != null && (obj instanceof Array || (typeof(obj) === "object" && !!obj.push && toString.call(obj) === array)); 30913 }; 30914 }()), 30915 a, i, p, _ticker, _tickerActive, 30916 _defLookup = {}, 30917 30918 /** 30919 * @constructor 30920 * Defines a GreenSock class, optionally with an array of dependencies that must be instantiated first and passed into the definition. 30921 * This allows users to load GreenSock JS files in any order even if they have interdependencies (like CSSPlugin extends TweenPlugin which is 30922 * inside TweenLite.js, but if CSSPlugin is loaded first, it should wait to run its code until TweenLite.js loads and instantiates TweenPlugin 30923 * and then pass TweenPlugin to CSSPlugin's definition). This is all done automatically and internally. 30924 * 30925 * Every definition will be added to a "com.greensock" global object (typically window, but if a window.GreenSockGlobals object is found, 30926 * it will go there as of v1.7). For example, TweenLite will be found at window.com.greensock.TweenLite and since it's a global class that should be available anywhere, 30927 * it is ALSO referenced at window.TweenLite. However some classes aren't considered global, like the base com.greensock.core.Animation class, so 30928 * those will only be at the package like window.com.greensock.core.Animation. Again, if you define a GreenSockGlobals object on the window, everything 30929 * gets tucked neatly inside there instead of on the window directly. This allows you to do advanced things like load multiple versions of GreenSock 30930 * files and put them into distinct objects (imagine a banner ad uses a newer version but the main site uses an older one). In that case, you could 30931 * sandbox the banner one like: 30932 * 30933 * <script> 30934 * var gs = window.GreenSockGlobals = {}; //the newer version we're about to load could now be referenced in a "gs" object, like gs.TweenLite.to(...). Use whatever alias you want as long as it's unique, "gs" or "banner" or whatever. 30935 * </script> 30936 * <script src="js/greensock/v1.7/TweenMax.js"></script> 30937 * <script> 30938 * window.GreenSockGlobals = window._gsQueue = window._gsDefine = null; //reset it back to null (along with the special _gsQueue variable) so that the next load of TweenMax affects the window and we can reference things directly like TweenLite.to(...) 30939 * </script> 30940 * <script src="js/greensock/v1.6/TweenMax.js"></script> 30941 * <script> 30942 * gs.TweenLite.to(...); //would use v1.7 30943 * TweenLite.to(...); //would use v1.6 30944 * </script> 30945 * 30946 * @param {!string} ns The namespace of the class definition, leaving off "com.greensock." as that's assumed. For example, "TweenLite" or "plugins.CSSPlugin" or "easing.Back". 30947 * @param {!Array.<string>}
30947 dependencies An array of dependencies (described as their namespaces minus "com.greensock." prefix). For example ["TweenLite","plugins.TweenPlugin","core.Animation"] 30948 * @param {!function():Object} func The function that should be called and passed the resolved dependencies which will return the actual class for this definition. 30949 * @param {boolean=} global If true, the class will be added to the global scope (typically window unless you define a window.GreenSockGlobals object) 30950 */ 30951 Definition = function(ns, dependencies, func, global) { 30952 this.sc = (_defLookup[ns]) ? _defLookup[ns].sc : []; //subclasses 30953 _defLookup[ns] = this; 30954 this.gsClass = null; 30955 this.func = func; 30956 var _classes = []; 30957 this.check = function(init) { 30958 var i = dependencies.length, 30959 missing = i, 30960 cur, a, n, cl; 30961 while (--i > -1) { 30962 if ((cur = _defLookup[dependencies[i]] || new Definition(dependencies[i], [])).gsClass) { 30963 _classes[i] = cur.gsClass; 30964 missing--; 30965 } else if (init) { 30966 cur.sc.push(this); 30967 } 30968 } 30969 if (missing === 0 && func) { 30970 a = ("com.greensock." + ns).split("."); 30971 n = a.pop(); 30972 cl = _namespace(a.join("."))[n] = this.gsClass = func.apply(func, _classes); 30973 30974 //exports to multiple environments 30975 if (global) { 30976 _globals[n] = _exports[n] = cl; //provides a way to avoid global namespace pollution. By default, the main classes like TweenLite, Power1, Strong, etc. are added to window unless a GreenSockGlobals is defined. So if you want to have things added to a custom object instead, just do something like window.GreenSockGlobals = {} before loading any GreenSock files. You can even set up an alias like window.GreenSockGlobals = windows.gs = {} so that you can access everything like gs.TweenLite. Also remember that ALL classes are added to the window.com.greensock object (in their respective packages, like com.greensock.easing.Power1, com.greensock.TweenLite, etc.) 30977 if (typeof(module) !== "undefined" && module.exports) { //node 30978 if (ns === moduleName) { 30979 module.exports = _exports[moduleName] = cl; 30980 for (i in _exports) { 30981 cl[i] = _exports[i]; 30982 } 30983 } else if (_exports[moduleName]) { 30984 _exports[moduleName][n] = cl; 30985 } 30986 } else if (true){ //AMD 30987 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() { return cl; }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 30988 } 30989 } 30990 for (i = 0; i < this.sc.length; i++) { 30991 this.sc[i].check(); 30992 } 30993 } 30994 }; 30995 this.check(true); 30996 }, 30997 30998 //used to create Definition instances (which basically registers a class that has dependencies). 30999 _gsDefine = window._gsDefine = function(ns, dependencies, func, global) { 31000 return new Definition(ns, dependencies, func, global); 31001 }, 31002 31003 //a quick way to create a class that doesn't have any dependencies. Returns the class, but first registers it in the GreenSock namespace so that other classes can grab it (other classes might be dependent on the class). 31004 _class = gs._class = function(ns, func, global) { 31005 func = func || function() {}; 31006 _gsDefine(ns, [], function(){ return func; }, global); 31007 return func; 31008 }; 31009 31010 _gsDefine.globals = _globals; 31011 31012 31013 31014 /* 31015 * ---------------------------------------------------------------- 31016 * Ease 31017 * ---------------------------------------------------------------- 31018 */ 31019 var _baseParams = [0, 0, 1, 1], 31020 Ease = _class("easing.Ease", function(func, extraParams, type, power) { 31021 this._func = func; 31022 this._type = type || 0; 31023 this._power = power || 0; 31024 this._params = extraParams ? _baseParams.concat(extraParams) : _baseParams; 31025 }, true), 31026 _easeMap = Ease.map = {}, 31027 _easeReg = Ease.register = function(ease, names, types, create) { 31028 var na = names.split(","), 31029 i = na.length, 31030 ta = (types || "easeIn,easeOut,easeInOut").split(","), 31031 e, name, j, type; 31032 while (--i > -1) { 31033 name = na[i]; 31034 e = create ? _class("easing."+name, null, true) : gs.easing[name] || {}; 31035 j = ta.length; 31036 while (--j > -1) { 31037 type = ta[j]; 31038 _easeMap[name + "." + type] = _easeMap[type + name] = e[type] = ease.getRatio ? ease : ease[type] || new ease(); 31039 } 31040 } 31041 }; 31042 31043 p = Ease.prototype; 31044 p._calcEnd = false;
31045 p.getRatio = function(p) { 31046 if (this._func) { 31047 this._params[0] = p; 31048 return this._func.apply(null, this._params); 31049 } 31050 var t = this._type, 31051 pw = this._power, 31052 r = (t === 1) ? 1 - p : (t === 2) ? p : (p < 0.5) ? p * 2 : (1 - p) * 2; 31053 if (pw === 1) { 31054 r *= r; 31055 } else if (pw === 2) { 31056 r *= r * r; 31057 } else if (pw === 3) { 31058 r *= r * r * r; 31059 } else if (pw === 4) { 31060 r *= r * r * r * r; 31061 } 31062 return (t === 1) ? 1 - r : (t === 2) ? r : (p < 0.5) ? r / 2 : 1 - (r / 2); 31063 }; 31064 31065 //create all the standard eases like Linear, Quad, Cubic, Quart, Quint, Strong, Power0, Power1, Power2, Power3, and Power4 (each with easeIn, easeOut, and easeInOut) 31066 a = ["Linear","Quad","Cubic","Quart","Quint,Strong"]; 31067 i = a.length; 31068 while (--i > -1) { 31069 p = a[i]+",Power"+i; 31070 _easeReg(new Ease(null,null,1,i), p, "easeOut", true); 31071 _easeReg(new Ease(null,null,2,i), p, "easeIn" + ((i === 0) ? ",easeNone" : "")); 31072 _easeReg(new Ease(null,null,3,i), p, "easeInOut"); 31073 } 31074 _easeMap.linear = gs.easing.Linear.easeIn; 31075 _easeMap.swing = gs.easing.Quad.easeInOut; //for jQuery folks 31076 31077 31078 /* 31079 * ---------------------------------------------------------------- 31080 * EventDispatcher 31081 * ---------------------------------------------------------------- 31082 */ 31083 var EventDispatcher = _class("events.EventDispatcher", function(target) { 31084 this._listeners = {}; 31085 this._eventTarget = target || this; 31086 }); 31087 p = EventDispatcher.prototype; 31088 31089 p.addEventListener = function(type, callback, scope, useParam, priority) { 31090 priority = priority || 0; 31091 var list = this._listeners[type], 31092 index = 0, 31093 listener, i; 31094 if (this === _ticker && !_tickerActive) { 31095 _ticker.wake(); 31096 } 31097 if (list == null) { 31098 this._listeners[type] = list = []; 31099 } 31100 i = list.length; 31101 while (--i > -1) { 31102 listener = list[i]; 31103 if (listener.c === callback && listener.s === scope) { 31104 list.splice(i, 1); 31105 } else if (index === 0 && listener.pr < priority) { 31106 index = i + 1; 31107 } 31108 } 31109 list.splice(index, 0, {c:callback, s:scope, up:useParam, pr:priority}); 31110 }; 31111 31112 p.removeEventListener = function(type, callback) { 31113 var list = this._listeners[type], i; 31114 if (list) { 31115 i = list.length; 31116 while (--i > -1) { 31117 if (list[i].c === callback) { 31118 list.splice(i, 1); 31119 return; 31120 } 31121 } 31122 } 31123 }; 31124 31125 p.dispatchEvent = function(type) { 31126 var list = this._listeners[type], 31127 i, t, listener; 31128 if (list) { 31129 i = list.length; 31130 if (i > 1) { 31131 list = list.slice(0); //in case addEventListener() is called from within a listener/callback (otherwise the index could change, resulting in a skip) 31132 } 31133 t = this._eventTarget; 31134 while (--i > -1) { 31135 listener = list[i]; 31136 if (listener) { 31137 if (listener.up) { 31138 listener.c.call(listener.s || t, {type:type, target:t}); 31139 } else { 31140 listener.c.call(listener.s || t); 31141 } 31142 } 31143 } 31144 } 31145 }; 31146 31147 31148 /* 31149 * ---------------------------------------------------------------- 31150 * Ticker 31151 * ---------------------------------------------------------------- 31152 */ 31153 var _reqAnimFrame = window.requestAnimationFrame, 31154 _cancelAnimFrame = window.cancelAnimationFrame, 31155 _getTime = Date.now || function() {return new Date().getTime();}, 31156 _lastUpdate = _getTime(); 31157 31158 //now try to determine the requestAnimationFrame and cancelAnimationFrame functions and if none are found, we'll use a setTimeout()/clearTimeout() polyfill. 31159 a = ["ms","moz","webkit","o"]; 31160 i = a.length; 31161 while (--i > -1 && !_reqAnimFrame) { 31162 _reqAnimFrame = window[a[i] + "RequestAnimationFrame"]; 31163 _cancelAnimFrame = window[a[i] + "CancelAnimationFrame"] || window[a[i] + "CancelRequestAnimationFrame"]; 31164 } 31165 31166 _class("Ticker", function(fps, useRAF) { 31167 var _self = this, 31168 _startTime = _getTime(), 31169 _useRAF = (useRAF !== false && _reqAnimFrame) ? "auto" : false, 31170 _lagThreshold = 500, 31171 _adjustedLag = 33, 31172 _tickWord = "tick", //helps reduce gc burden 31173 _fps, _req, _id, _gap, _nextTime, 31174 _tick = function(manual) {
31175 var elapsed = _getTime() - _lastUpdate, 31176 overlap, dispatch; 31177 if (elapsed > _lagThreshold) { 31178 _startTime += elapsed - _adjustedLag; 31179 } 31180 _lastUpdate += elapsed; 31181 _self.time = (_lastUpdate - _startTime) / 1000; 31182 overlap = _self.time - _nextTime; 31183 if (!_fps || overlap > 0 || manual === true) { 31184 _self.frame++; 31185 _nextTime += overlap + (overlap >= _gap ? 0.004 : _gap - overlap); 31186 dispatch = true; 31187 } 31188 if (manual !== true) { //make sure the request is made before we dispatch the "tick" event so that timing is maintained. Otherwise, if processing the "tick" requires a bunch of time (like 15ms) and we're using a setTimeout() that's based on 16.7ms, it'd technically take 31.7ms between frames otherwise. 31189 _id = _req(_tick); 31190 } 31191 if (dispatch) { 31192 _self.dispatchEvent(_tickWord); 31193 } 31194 }; 31195 31196 EventDispatcher.call(_self); 31197 _self.time = _self.frame = 0; 31198 _self.tick = function() { 31199 _tick(true); 31200 }; 31201 31202 _self.lagSmoothing = function(threshold, adjustedLag) { 31203 if (!arguments.length) { //if lagSmoothing() is called with no arguments, treat it like a getter that returns a boolean indicating if it's enabled or not. This is purposely undocumented and is for internal use. 31204 return (_lagThreshold < 1 / _tinyNum); 31205 } 31206 _lagThreshold = threshold || (1 / _tinyNum); //zero should be interpreted as basically unlimited 31207 _adjustedLag = Math.min(adjustedLag, _lagThreshold, 0); 31208 }; 31209 31210 _self.sleep = function() { 31211 if (_id == null) { 31212 return; 31213 } 31214 if (!_useRAF || !_cancelAnimFrame) { 31215 clearTimeout(_id); 31216 } else { 31217 _cancelAnimFrame(_id); 31218 } 31219 _req = _emptyFunc; 31220 _id = null; 31221 if (_self === _ticker) { 31222 _tickerActive = false; 31223 } 31224 }; 31225 31226 _self.wake = function(seamless) { 31227 if (_id !== null) { 31228 _self.sleep(); 31229 } else if (seamless) { 31230 _startTime += -_lastUpdate + (_lastUpdate = _getTime()); 31231 } else if (_self.frame > 10) { //don't trigger lagSmoothing if we're just waking up, and make sure that at least 10 frames have elapsed because of the iOS bug that we work around below with the 1.5-second setTimout(). 31232 _lastUpdate = _getTime() - _lagThreshold + 5; 31233 } 31234 _req = (_fps === 0) ? _emptyFunc : (!_useRAF || !_reqAnimFrame) ? function(f) { return setTimeout(f, ((_nextTime - _self.time) * 1000 + 1) | 0); } : _reqAnimFrame; 31235 if (_self === _ticker) { 31236 _tickerActive = true; 31237 } 31238 _tick(2); 31239 }; 31240 31241 _self.fps = function(value) { 31242 if (!arguments.length) { 31243 return _fps; 31244 } 31245 _fps = value; 31246 _gap = 1 / (_fps || 60); 31247 _nextTime = this.time + _gap; 31248 _self.wake(); 31249 }; 31250 31251 _self.useRAF = function(value) { 31252 if (!arguments.length) { 31253 return _useRAF; 31254 } 31255 _self.sleep(); 31256 _useRAF = value; 31257 _self.fps(_fps); 31258 }; 31259 _self.fps(fps); 31260 31261 //a bug in iOS 6 Safari occasionally prevents the requestAnimationFrame from working initially, so we use a 1.5-second timeout that automatically falls back to setTimeout() if it senses this condition. 31262 setTimeout(function() { 31263 if (_useRAF === "auto" && _self.frame < 5 && (_doc || {}).visibilityState !== "hidden") { 31264 _self.useRAF(false); 31265 } 31266 }, 1500); 31267 }); 31268 31269 p = gs.Ticker.prototype = new gs.events.EventDispatcher(); 31270 p.constructor = gs.Ticker; 31271 31272 31273 /* 31274 * ---------------------------------------------------------------- 31275 * Animation 31276 * ---------------------------------------------------------------- 31277 */ 31278 var Animation = _class("core.Animation", function(duration, vars) { 31279 this.vars = vars = vars || {}; 31280 this._duration = this._totalDuration = duration || 0; 31281 this._delay = Number(vars.delay) || 0; 31282 this._timeScale = 1; 31283 this._active = !!vars.immediateRender; 31284 this.data = vars.data; 31285 this._reversed = !!vars.reversed; 31286 31287 if (!_rootTimeline) { 31288 return; 31289 } 31290 if (!_tickerActive) { //some browsers (like iOS 6 Safari) shut down JavaScript execution when the tab is disabled and they [occasionally] neglect to start up requestAnimationFrame again when returning - this code ensures that the engine starts up again properly. 31291 _ticker.wake(); 31292 } 31293 31294 var tl = this.vars.useFrames ? _rootFramesTimeline : _rootTimeline; 31295 tl.add(this, tl._time); 31296 31297 if (this.vars.paused) { 31298 this.paused(true); 31299 } 31300 }); 31301 31302 _ticker = Animation.ticker = new gs.Ticker(); 31303 p = Animation.prototype; 31304 p._dirty = p._gc = p._initted = p._paused = false;
31305 p._totalTime = p._time = 0; 31306 p._rawPrevTime = -1; 31307 p._next = p._last = p._onUpdate = p._timeline = p.timeline = null; 31308 p._paused = false; 31309 31310 31311 //some browsers (like iOS) occasionally drop the requestAnimationFrame event when the user switches to a different tab and then comes back again, so we use a 2-second setTimeout() to sense if/when that condition occurs and then wake() the ticker. 31312 var _checkTimeout = function() { 31313 if (_tickerActive && _getTime() - _lastUpdate > 2000 && ((_doc || {}).visibilityState !== "hidden" || !_ticker.lagSmoothing())) { //note: if the tab is hidden, we should still wake if lagSmoothing has been disabled. 31314 _ticker.wake(); 31315 } 31316 var t = setTimeout(_checkTimeout, 2000); 31317 if (t.unref) { 31318 // allows a node process to exit even if the timeoutâs callback hasn't been invoked. Without it, the node process could hang as this function is called every two seconds. 31319 t.unref(); 31320 } 31321 }; 31322 _checkTimeout(); 31323 31324 31325 p.play = function(from, suppressEvents) { 31326 if (from != null) { 31327 this.seek(from, suppressEvents); 31328 } 31329 return this.reversed(false).paused(false); 31330 }; 31331 31332 p.pause = function(atTime, suppressEvents) { 31333 if (atTime != null) { 31334 this.seek(atTime, suppressEvents); 31335 } 31336 return this.paused(true); 31337 }; 31338 31339 p.resume = function(from, suppressEvents) { 31340 if (from != null) { 31341 this.seek(from, suppressEvents); 31342 } 31343 return this.paused(false); 31344 }; 31345 31346 p.seek = function(time, suppressEvents) { 31347 return this.totalTime(Number(time), suppressEvents !== false); 31348 }; 31349 31350 p.restart = function(includeDelay, suppressEvents) { 31351 return this.reversed(false).paused(false).totalTime(includeDelay ? -this._delay : 0, (suppressEvents !== false), true); 31352 }; 31353 31354 p.reverse = function(from, suppressEvents) { 31355 if (from != null) { 31356 this.seek((from || this.totalDuration()), suppressEvents); 31357 } 31358 return this.reversed(true).paused(false); 31359 }; 31360 31361 p.render = function(time, suppressEvents, force) { 31362 //stub - we override this method in subclasses. 31363 }; 31364 31365 p.invalidate = function() { 31366 this._time = this._totalTime = 0; 31367 this._initted = this._gc = false; 31368 this._rawPrevTime = -1; 31369 if (this._gc || !this.timeline) { 31370 this._enabled(true); 31371 } 31372 return this; 31373 }; 31374 31375 p.isActive = function() { 31376 var tl = this._timeline, //the 2 root timelines won't have a _timeline; they're always active. 31377 startTime = this._startTime, 31378 rawTime; 31379 return (!tl || (!this._gc && !this._paused && tl.isActive() && (rawTime = tl.rawTime(true)) >= startTime && rawTime < startTime + this.totalDuration() / this._timeScale - _tinyNum)); 31380 }; 31381 31382 p._enabled = function (enabled, ignoreTimeline) { 31383 if (!_tickerActive) { 31384 _ticker.wake(); 31385 } 31386 this._gc = !enabled; 31387 this._active = this.isActive(); 31388 if (ignoreTimeline !== true) { 31389 if (enabled && !this.timeline) { 31390 this._timeline.add(this, this._startTime - this._delay); 31391 } else if (!enabled && this.timeline) { 31392 this._timeline._remove(this, true); 31393 } 31394 } 31395 return false; 31396 }; 31397 31398 31399 p._kill = function(vars, target) { 31400 return this._enabled(false, false); 31401 }; 31402 31403 p.kill = function(vars, target) { 31404 this._kill(vars, target); 31405 return this; 31406 }; 31407 31408 p._uncache = function(includeSelf) { 31409 var tween = includeSelf ? this : this.timeline; 31410 while (tween) { 31411 tween._dirty = true; 31412 tween = tween.timeline; 31413 } 31414 return this; 31415 }; 31416 31417 p._swapSelfInParams = function(params) { 31418 var i = params.length, 31419 copy = params.concat(); 31420 while (--i > -1) { 31421 if (params[i] === "{self}") { 31422 copy[i] = this; 31423 } 31424 } 31425 return copy; 31426 }; 31427 31428 p._callback = function(type) { 31429 var v = this.vars, 31430 callback = v[type], 31431 params = v[type + "Params"], 31432 scope = v[type + "Scope"] || v.callbackScope || this, 31433 l = params ? params.length : 0; 31434 switch (l) { //speed optimization; call() is faster than apply() so use it when there are only a few parameters (which is by far most common). Previously we simply did var v = this.vars; v[type].apply(v[type + "Scope"] || v.callbackScope || this, v[type + "Params"] || _blankArray); 31435 case 0: callback.call(scope); break; 31436 case 1: callback.call(scope, params[0]); break; 31437 case 2: callback.call(scope, params[0], params[1]); break; 31438 default: callback.apply(scope, params); 31439 } 31440 }; 31441 31442 //----Animation getters/setters -------------------------------------------------------- 31443 31444 p.eventCallback = function(type, callback, params, scope) { 31445 if ((type || "").substr(0,2) === "on") { 31446 var v = this.vars; 31447 if (arguments.length === 1) { 31448 return v[type]; 31449 } 31450 if (callback == null) { 31451 delete v[type]; 31452 } else { 31453 v[type] = callback; 31454 v[type + "Params"] = (_isArray(params) && params.join("").indexOf("{self}") !== -1) ? this._swapSelfInParams(params) : params; 31455 v[type + "Scope"] = scope; 31456 } 31457 if (type === "onUpdate") { 31458 this._onUpdate = callback; 31459 } 31460 } 31461 return this; 31462 }; 31463 31464 p.delay = function(value) { 31465 if (!arguments.length) { 31466 return this._delay; 31467 } 31468 if (this._timeline.smoothChildTiming) { 31469 this.startTime( this._startTime + value - this._delay ); 31470 }
31471 this._delay = value; 31472 return this; 31473 }; 31474 31475 p.duration = function(value) { 31476 if (!arguments.length) { 31477 this._dirty = false; 31478 return this._duration; 31479 } 31480 this._duration = this._totalDuration = value; 31481 this._uncache(true); //true in case it's a TweenMax or TimelineMax that has a repeat - we'll need to refresh the totalDuration. 31482 if (this._timeline.smoothChildTiming) if (this._time > 0) if (this._time < this._duration) if (value !== 0) { 31483 this.totalTime(this._totalTime * (value / this._duration), true); 31484 } 31485 return this; 31486 }; 31487 31488 p.totalDuration = function(value) { 31489 this._dirty = false; 31490 return (!arguments.length) ? this._totalDuration : this.duration(value); 31491 }; 31492 31493 p.time = function(value, suppressEvents) { 31494 if (!arguments.length) { 31495 return this._time; 31496 } 31497 if (this._dirty) { 31498 this.totalDuration(); 31499 } 31500 return this.totalTime((value > this._duration) ? this._duration : value, suppressEvents); 31501 }; 31502 31503 p.totalTime = function(time, suppressEvents, uncapped) { 31504 if (!_tickerActive) { 31505 _ticker.wake(); 31506 } 31507 if (!arguments.length) { 31508 return this._totalTime; 31509 } 31510 if (this._timeline) { 31511 if (time < 0 && !uncapped) { 31512 time += this.totalDuration(); 31513 } 31514 if (this._timeline.smoothChildTiming) { 31515 if (this._dirty) { 31516 this.totalDuration(); 31517 } 31518 var totalDuration = this._totalDuration, 31519 tl = this._timeline; 31520 if (time > totalDuration && !uncapped) { 31521 time = totalDuration; 31522 } 31523 this._startTime = (this._paused ? this._pauseTime : tl._time) - ((!this._reversed ? time : totalDuration - time) / this._timeScale); 31524 if (!tl._dirty) { //for performance improvement. If the parent's cache is already dirty, it already took care of marking the ancestors as dirty too, so skip the function call here. 31525 this._uncache(false); 31526 } 31527 //in case any of the ancestor timelines had completed but should now be enabled, we should reset their totalTime() which will also ensure that they're lined up properly and enabled. Skip for animations that are on the root (wasteful). Example: a TimelineLite.exportRoot() is performed when there's a paused tween on the root, the export will not complete until that tween is unpaused, but imagine a child gets restarted later, after all [unpaused] tweens have completed. The startTime of that child would get pushed out, but one of the ancestors may have completed. 31528 if (tl._timeline) { 31529 while (tl._timeline) { 31530 if (tl._timeline._time !== (tl._startTime + tl._totalTime) / tl._timeScale) { 31531 tl.totalTime(tl._totalTime, true); 31532 } 31533 tl = tl._timeline; 31534 } 31535 } 31536 } 31537 if (this._gc) { 31538 this._enabled(true, false); 31539 } 31540 if (this._totalTime !== time || this._duration === 0) { 31541 if (_lazyTweens.length) { 31542 _lazyRender(); 31543 } 31544 this.render(time, suppressEvents, false); 31545 if (_lazyTweens.length) { //in case rendering caused any tweens to lazy-init, we should render them because typically when someone calls seek() or time() or progress(), they expect an immediate render. 31546 _lazyRender(); 31547 } 31548 } 31549 } 31550 return this; 31551 }; 31552 31553 p.progress = p.totalProgress = function(value, suppressEvents) { 31554 var duration = this.duration(); 31555 return (!arguments.length) ? (duration ? this._time / duration : this.ratio) : this.totalTime(duration * value, suppressEvents); 31556 }; 31557 31558 p.startTime = function(value) { 31559 if (!arguments.length) { 31560 return this._startTime; 31561 } 31562 if (value !== this._startTime) { 31563 this._startTime = value; 31564 if (this.timeline) if (this.timeline._sortChildren) { 31565 this.timeline.add(this, value - this._delay); //ensures that any necessary re-sequencing of Animations in the timeline occurs to make sure the rendering order is correct. 31566 } 31567 } 31568 return this; 31569 }; 31570 31571 p.endTime = function(includeRepeats) { 31572 return this._startTime + ((includeRepeats != false) ? this.totalDuration() : this.duration()) / this._timeScale; 31573 }; 31574 31575 p.timeScale = function(value) { 31576 if (!arguments.length) { 31577 return this._timeScale; 31578 } 31579 var pauseTime, t; 31580 value = value || _tinyNum; //can't allow zero because it'll throw the math off 31581 if (this._timeline && this._timeline.smoothChildTiming) { 31582 pauseTime = this._pauseTime; 31583 t = (pauseTime || pauseTime === 0) ? pauseTime : this._timeline.totalTime(); 31584 this._startTime = t - ((t - this._startTime) * this._timeScale / value); 31585 } 31586 this._timeScale = value; 31587 t = this.timeline; 31588 while (t && t.timeline) { //must update the duration/totalDuration of all ancestor timelines immediately in case in the middle of a render loop, one tween alters another tween's timeScale which shoves its startTime before 0, forcing the parent timeline to shift around and shiftChildren() which could affect that next tween's render (startTime). Doesn't matter for the root timeline though. 31589 t._dirty = true; 31590 t.totalDuration(); 31591 t = t.timeline; 31592 } 31593 return this; 31594 }; 31595 31596 p.reversed = function(value) { 31597 if (!arguments.length) { 31598 return this._reversed; 31599 } 31600 if (value != this._reversed) { 31601 this._reversed = value; 31602 this.totalTime(((this._timeline && !this._timeline.smoothChildTiming) ? this.totalDuration() - this._totalTime : this._totalTime), true); 31603 } 31604 return this; 31605 }; 31606 31607 p.paused = function(value) { 31608 if (!arguments.length) { 31609 return this._paused; 31610 } 31611 var tl = this._timeline, 31612 raw, elapsed; 31613 if (value != this._paused) if (tl) { 31614 if (!_tickerActive && !value) { 31615 _ticker.wake(); 31616 } 31617 raw = tl.rawTime();
31618 elapsed = raw - this._pauseTime; 31619 if (!value && tl.smoothChildTiming) { 31620 this._startTime += elapsed; 31621 this._uncache(false); 31622 } 31623 this._pauseTime = value ? raw : null; 31624 this._paused = value; 31625 this._active = this.isActive(); 31626 if (!value && elapsed !== 0 && this._initted && this.duration()) { 31627 raw = tl.smoothChildTiming ? this._totalTime : (raw - this._startTime) / this._timeScale; 31628 this.render(raw, (raw === this._totalTime), true); //in case the target's properties changed via some other tween or manual update by the user, we should force a render. 31629 } 31630 } 31631 if (this._gc && !value) { 31632 this._enabled(true, false); 31633 } 31634 return this; 31635 }; 31636 31637 31638 /* 31639 * ---------------------------------------------------------------- 31640 * SimpleTimeline 31641 * ---------------------------------------------------------------- 31642 */ 31643 var SimpleTimeline = _class("core.SimpleTimeline", function(vars) { 31644 Animation.call(this, 0, vars); 31645 this.autoRemoveChildren = this.smoothChildTiming = true; 31646 }); 31647 31648 p = SimpleTimeline.prototype = new Animation(); 31649 p.constructor = SimpleTimeline; 31650 p.kill()._gc = false; 31651 p._first = p._last = p._recent = null; 31652 p._sortChildren = false; 31653 31654 p.add = p.insert = function(child, position, align, stagger) { 31655 var prevTween, st; 31656 child._startTime = Number(position || 0) + child._delay; 31657 if (child._paused) if (this !== child._timeline) { //we only adjust the _pauseTime if it wasn't in this timeline already. Remember, sometimes a tween will be inserted again into the same timeline when its startTime is changed so that the tweens in the TimelineLite/Max are re-ordered properly in the linked list (so everything renders in the proper order). 31658 child._pauseTime = this.rawTime() - (child._timeline.rawTime() - child._pauseTime); 31659 } 31660 if (child.timeline) { 31661 child.timeline._remove(child, true); //removes from existing timeline so that it can be properly added to this one. 31662 } 31663 child.timeline = child._timeline = this; 31664 if (child._gc) { 31665 child._enabled(true, true); 31666 } 31667 prevTween = this._last; 31668 if (this._sortChildren) { 31669 st = child._startTime; 31670 while (prevTween && prevTween._startTime > st) { 31671 prevTween = prevTween._prev; 31672 } 31673 } 31674 if (prevTween) { 31675 child._next = prevTween._next; 31676 prevTween._next = child; 31677 } else { 31678 child._next = this._first; 31679 this._first = child; 31680 } 31681 if (child._next) { 31682 child._next._prev = child; 31683 } else { 31684 this._last = child; 31685 } 31686 child._prev = prevTween; 31687 this._recent = child; 31688 if (this._timeline) { 31689 this._uncache(true); 31690 } 31691 return this; 31692 }; 31693 31694 p._remove = function(tween, skipDisable) { 31695 if (tween.timeline === this) { 31696 if (!skipDisable) { 31697 tween._enabled(false, true); 31698 } 31699 31700 if (tween._prev) { 31701 tween._prev._next = tween._next; 31702 } else if (this._first === tween) { 31703 this._first = tween._next; 31704 } 31705 if (tween._next) { 31706 tween._next._prev = tween._prev; 31707 } else if (this._last === tween) { 31708 this._last = tween._prev; 31709 } 31710 tween._next = tween._prev = tween.timeline = null; 31711 if (tween === this._recent) { 31712 this._recent = this._last; 31713 } 31714 31715 if (this._timeline) { 31716 this._uncache(true); 31717 } 31718 } 31719 return this; 31720 }; 31721 31722 p.render = function(time, suppressEvents, force) { 31723 var tween = this._first, 31724 next; 31725 this._totalTime = this._time = this._rawPrevTime = time; 31726 while (tween) { 31727 next = tween._next; //record it here because the value could change after rendering... 31728 if (tween._active || (time >= tween._startTime && !tween._paused && !tween._gc)) { 31729 if (!tween._reversed) { 31730 tween.render((time - tween._startTime) * tween._timeScale, suppressEvents, force); 31731 } else { 31732 tween.render(((!tween._dirty) ? tween._totalDuration : tween.totalDuration()) - ((time - tween._startTime) * tween._timeScale), suppressEvents, force); 31733 } 31734 } 31735 tween = next; 31736 } 31737 }; 31738 31739 p.rawTime = function() { 31740 if (!_tickerActive) { 31741 _ticker.wake(); 31742 } 31743 return this._totalTime; 31744 }; 31745 31746 /* 31747 * ---------------------------------------------------------------- 31748 * TweenLite 31749 * ---------------------------------------------------------------- 31750 */ 31751 var TweenLite = _class("TweenLite", function(target, duration, vars) { 31752 Animation.call(this, duration, vars); 31753 this.render = TweenLite.prototype.render; //speed optimization (avoid prototype lookup on this "hot" method) 31754 31755 if (target == null) { 31756 throw "Cannot tween a null target."; 31757 } 31758 31759 this.target = target = (typeof(target) !== "string") ? target : TweenLite.selector(target) || target; 31760 31761 var isSelector = (target.jquery || (target.length && target !== window && target[0] && (target[0] === window || (target[0].nodeType && target[0].style && !target.nodeType)))),
31762 overwrite = this.vars.overwrite, 31763 i, targ, targets; 31764 31765 this._overwrite = overwrite = (overwrite == null) ? _overwriteLookup[TweenLite.defaultOverwrite] : (typeof(overwrite) === "number") ? overwrite >> 0 : _overwriteLookup[overwrite]; 31766 31767 if ((isSelector || target instanceof Array || (target.push && _isArray(target))) && typeof(target[0]) !== "number") { 31768 this._targets = targets = _slice(target); //don't use Array.prototype.slice.call(target, 0) because that doesn't work in IE8 with a NodeList that's returned by querySelectorAll() 31769 this._propLookup = []; 31770 this._siblings = []; 31771 for (i = 0; i < targets.length; i++) { 31772 targ = targets[i]; 31773 if (!targ) { 31774 targets.splice(i--, 1); 31775 continue; 31776 } else if (typeof(targ) === "string") { 31777 targ = targets[i--] = TweenLite.selector(targ); //in case it's an array of strings 31778 if (typeof(targ) === "string") { 31779 targets.splice(i+1, 1); //to avoid an endless loop (can't imagine why the selector would return a string, but just in case) 31780 } 31781 continue; 31782 } else if (targ.length && targ !== window && targ[0] && (targ[0] === window || (targ[0].nodeType && targ[0].style && !targ.nodeType))) { //in case the user is passing in an array of selector objects (like jQuery objects), we need to check one more level and pull things out if necessary. Also note that <select> elements pass all the criteria regarding length and the first child having style, so we must also check to ensure the target isn't an HTML node itself. 31783 targets.splice(i--, 1); 31784 this._targets = targets = targets.concat(_slice(targ)); 31785 continue; 31786 } 31787 this._siblings[i] = _register(targ, this, false); 31788 if (overwrite === 1) if (this._siblings[i].length > 1) { 31789 _applyOverwrite(targ, this, null, 1, this._siblings[i]); 31790 } 31791 } 31792 31793 } else { 31794 this._propLookup = {}; 31795 this._siblings = _register(target, this, false); 31796 if (overwrite === 1) if (this._siblings.length > 1) { 31797 _applyOverwrite(target, this, null, 1, this._siblings); 31798 } 31799 } 31800 if (this.vars.immediateRender || (duration === 0 && this._delay === 0 && this.vars.immediateRender !== false)) { 31801 this._time = -_tinyNum; //forces a render without having to set the render() "force" parameter to true because we want to allow lazying by default (using the "force" parameter always forces an immediate full render) 31802 this.render(Math.min(0, -this._delay)); //in case delay is negative 31803 } 31804 }, true), 31805 _isSelector = function(v) { 31806 return (v && v.length && v !== window && v[0] && (v[0] === window || (v[0].nodeType && v[0].style && !v.nodeType))); //we cannot check "nodeType" if the target is window from within an iframe, otherwise it will trigger a security error in some browsers like Firefox. 31807 }, 31808 _autoCSS = function(vars, target) { 31809 var css = {}, 31810 p; 31811 for (p in vars) { 31812 if (!_reservedProps[p] && (!(p in target) || p === "transform" || p === "x" || p === "y" || p === "width" || p === "height" || p === "className" || p === "border") && (!_plugins[p] || (_plugins[p] && _plugins[p]._autoCSS))) { //note: <img> elements contain read-only "x" and "y" properties. We should also prioritize editing css width/height rather than the element's properties. 31813 css[p] = vars[p]; 31814 delete vars[p]; 31815 } 31816 } 31817 vars.css = css; 31818 }; 31819 31820 p = TweenLite.prototype = new Animation(); 31821 p.constructor = TweenLite; 31822 p.kill()._gc = false; 31823 31824 //----TweenLite defaults, overwrite management, and root updates ---------------------------------------------------- 31825 31826 p.ratio = 0; 31827 p._firstPT = p._targets = p._overwrittenProps = p._startAt = null; 31828 p._notifyPluginsOfEnabled = p._lazy = false; 31829 31830 TweenLite.version = "2.1.3"; 31831 TweenLite.defaultEase = p._ease = new Ease(null, null, 1, 1); 31832 TweenLite.defaultOverwrite = "auto"; 31833 TweenLite.ticker = _ticker; 31834 TweenLite.autoSleep = 120; 31835 TweenLite.lagSmoothing = function(threshold, adjustedLag) {
31836 _ticker.lagSmoothing(threshold, adjustedLag); 31837 }; 31838 31839 TweenLite.selector = window.$ || window.jQuery || function(e) { 31840 var selector = window.$ || window.jQuery; 31841 if (selector) { 31842 TweenLite.selector = selector; 31843 return selector(e); 31844 } 31845 if (!_doc) { //in some dev environments (like Angular 6), GSAP gets loaded before the document is defined! So re-query it here if/when necessary. 31846 _doc = window.document; 31847 } 31848 return (!_doc) ? e : (_doc.querySelectorAll ? _doc.querySelectorAll(e) : _doc.getElementById((e.charAt(0) === "#") ? e.substr(1) : e)); 31849 }; 31850 31851 var _lazyTweens = [], 31852 _lazyLookup = {}, 31853 _numbersExp = /(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/ig, 31854 _relExp = /[\+-]=-?[\.\d]/, 31855 //_nonNumbersExp = /(?:([\-+](?!(\d|=)))|[^\d\-+=e]|(e(?![\-+][\d])))+/ig, 31856 _setRatio = function(v) { 31857 var pt = this._firstPT, 31858 min = 0.000001, 31859 val; 31860 while (pt) { 31861 val = !pt.blob ? pt.c * v + pt.s : (v === 1 && this.end != null) ? this.end : v ? this.join("") : this.start; 31862 if (pt.m) { 31863 val = pt.m.call(this._tween, val, this._target || pt.t, this._tween); 31864 } else if (val < min) if (val > -min && !pt.blob) { //prevents issues with converting very small numbers to strings in the browser 31865 val = 0; 31866 } 31867 if (!pt.f) { 31868 pt.t[pt.p] = val; 31869 } else if (pt.fp) { 31870 pt.t[pt.p](pt.fp, val); 31871 } else { 31872 pt.t[pt.p](val); 31873 } 31874 pt = pt._next; 31875 } 31876 }, 31877 _blobRound = function(v) { 31878 return (((v * 1000) | 0) / 1000) + ""; 31879 }, 31880 //compares two strings (start/end), finds the numbers that are different and spits back an array representing the whole value but with the changing values isolated as elements. For example, "rgb(0,0,0)" and "rgb(100,50,0)" would become ["rgb(", 0, ",", 50, ",0)"]. Notice it merges the parts that are identical (performance optimization). The array also has a linked list of PropTweens attached starting with _firstPT that contain the tweening data (t, p, s, c, f, etc.). It also stores the starting value as a "start" property so that we can revert to it if/when necessary, like when a tween rewinds fully. If the quantity of numbers differs between the start and end, it will always prioritize the end value(s). The pt parameter is optional - it's for a PropTween that will be appended to the end of the linked list and is typically for actually setting the value after all of the elements have been updated (with array.join("")). 31881 _blobDif = function(start, end, filter, pt) { 31882 var a = [], 31883 charIndex = 0, 31884 s = "", 31885 color = 0, 31886 startNums, endNums, num, i, l, nonNumbers, currentNum; 31887 a.start = start; 31888 a.end = end; 31889 start = a[0] = start + ""; //ensure values are strings 31890 end = a[1] = end + ""; 31891 if (filter) { 31892 filter(a); //pass an array with the starting and ending values and let the filter do whatever it needs to the values. 31893 start = a[0]; 31894 end = a[1]; 31895 } 31896 a.length = 0; 31897 startNums = start.match(_numbersExp) || []; 31898 endNums = end.match(_numbersExp) || []; 31899 if (pt) { 31900 pt._next = null; 31901 pt.blob = 1; 31902 a._firstPT = a._applyPT = pt; //apply last in the linked list (which means inserting it first) 31903 } 31904 l = endNums.length; 31905 for (i = 0; i < l; i++) { 31906 currentNum = endNums[i]; 31907 nonNumbers = end.substr(charIndex, end.indexOf(currentNum, charIndex)-charIndex); 31908 s += (nonNumbers || !i) ? nonNumbers : ","; //note: SVG spec allows omission of comma/space when a negative sign is wedged between two numbers, like 2.5-5.3 instead of 2.5,-5.3 but when tweening, the negative value may switch to positive, so we insert the comma just in case. 31909 charIndex += nonNumbers.length; 31910 if (color) { //sense rgba() values and round them. 31911 color = (color + 1) % 5; 31912 } else if (nonNumbers.substr(-5) === "rgba(") { 31913 color = 1; 31914 } 31915 if (currentNum === startNums[i] || startNums.length <= i) { 31916 s += currentNum; 31917 } else { 31918 if (s) { 31919 a.push(s); 31920 s = ""; 31921 } 31922 num = parseFloat(startNums[i]); 31923 a.push(num); 31924 a._firstPT = {_next: a._firstPT, t:a, p: a.length-1, s:num, c:((currentNum.charAt(1) === "=") ? parseInt(currentNum.charAt(0) + "1", 10) * parseFloat(currentNum.substr(2)) : (parseFloat(currentNum) - num)) || 0, f:0, m:(color && color < 4) ? Math.round : _blobRound}; //limiting to 3 decimal places and casting as a string can really help performance when array.join() is called! 31925 //note: we don't set _prev because we'll never need to remove individual PropTweens from this list. 31926 } 31927 charIndex += currentNum.length; 31928 } 31929 s += end.substr(charIndex); 31930 if (s) { 31931 a.push(s); 31932 } 31933 a.setRatio = _setRatio; 31934 if (_relExp.test(end)) { //if the end string contains relative values, delete it so that on the final render (in _setRatio()), we don't actually set it to the string with += or -= characters (forces it to use the calculated value). 31935 a.end = null; 31936 } 31937 return a; 31938 }, 31939 //note: "funcParam" is only necessary for function-based getters/setters that require an extra parameter like getAttribute("width") and setAttribute("width", value). In this example, funcParam would be "width". Used by AttrPlugin for example. 31940 _addPropTween = function(target, prop, start, end, overwriteProp, mod, funcParam, stringFilter, index) { 31941 if (typeof(end) === "function") { 31942 end = end(index || 0, target); 31943 } 31944 var type = typeof(target[prop]), 31945 getterName = (type !== "function") ? "" : ((prop.indexOf("set") || typeof(target["get" + prop.substr(3)]) !== "function") ? prop : "get" + prop.substr(3)), 31946 s = (start !== "get") ? start : !getterName ? target[prop] : funcParam ? target[getterName](funcParam) : target[getterName](), 31947 isRelative = (typeof(end) === "string" && end.charAt(1) === "="), 31948 pt = {t:target, p:prop, s:s, f:(type === "function"), pg:0, n:overwriteProp || prop, m:(!mod ? 0 : (typeof(mod) === "function") ? mod : Math.round), pr:0, c:isRelative ? parseInt(end.charAt(0) + "1", 10) * parseFloat(end.substr(2)) : (parseFloat(end) - s) || 0}, 31949 blob; 31950 31951 if (typeof(s) !== "number" || (typeof(end) !== "number" && !isRelative)) { 31952 if (funcParam || isNaN(s) || (!isRelative && isNaN(end)) || typeof(s) === "boolean" || typeof(end) === "boolean") { 31953 //a blob (string that has multiple numbers in it) 31954 pt.fp = funcParam; 31955 blob = _blobDif(s, (isRelative ? (parseFloat(pt.s) + pt.c) + (pt.s + "").replace(/[0-9\-\.]/g, "") : end), stringFilter || TweenLite.defaultStringFilter, pt); 31956 pt = {t: blob, p: "setRatio", s: 0, c: 1, f: 2, pg: 0, n: overwriteProp || prop, pr: 0, m: 0}; //"2" indicates it's a Blob property tween. Needed for RoundPropsPlugin for example. 31957 } else { 31958 pt.s = parseFloat(s); 31959 if (!isRelative) { 31960 pt.c = (parseFloat(end) - pt.s) || 0; 31961 } 31962 } 31963 } 31964 if (pt.c) { //only add it to the linked list if there's a change. 31965 if ((pt._next = this._firstPT)) { 31966 pt._next._prev = pt; 31967 } 31968 this._firstPT = pt; 31969 return pt; 31970 } 31971 }, 31972 _internals = TweenLite._internals = {isArray:_isArray, isSelector:_isSelector, lazyTweens:_lazyTweens, blobDif:_blobDif}, //gives us a way to expose certain private values to other GreenSock classes without contaminating tha main TweenLite object. 31973 _plugins = TweenLite._plugins = {}, 31974 _tweenLookup = _internals.tweenLookup = {}, 31975 _tweenLookupNum = 0, 31976 _reservedProps = _internals.reservedProps = {ease:1, delay:1, overwrite:1, onComplete:1, onCompleteParams:1, onCompleteScope:1, useFrames:1, runBackwards:1, startAt:1, onUp
31976date:1, onUpdateParams:1, onUpdateScope:1, onStart:1, onStartParams:1, onStartScope:1, onReverseComplete:1, onReverseCompleteParams:1, onReverseCompleteScope:1, onRepeat:1, onRepeatParams:1, onRepeatScope:1, easeParams:1, yoyo:1, immediateRender:1, repeat:1, repeatDelay:1, data:1, paused:1, reversed:1, autoCSS:1, lazy:1, onOverwrite:1, callbackScope:1, stringFilter:1, id:1, yoyoEase:1, stagger:1}, 31977 _overwriteLookup = {none:0, all:1, auto:2, concurrent:3, allOnStart:4, preexisting:5, "true":1, "false":0}, 31978 _rootFramesTimeline = Animation._rootFramesTimeline = new SimpleTimeline(), 31979 _rootTimeline = Animation._rootTimeline = new SimpleTimeline(), 31980 _nextGCFrame = 30, 31981 _lazyRender = _internals.lazyRender = function() { 31982 var l = _lazyTweens.length, 31983 i, tween; 31984 _lazyLookup = {}; 31985 for (i = 0; i < l; i++) { 31986 tween = _lazyTweens[i]; 31987 if (tween && tween._lazy !== false) { 31988 tween.render(tween._lazy[0], tween._lazy[1], true); 31989 tween._lazy = false; 31990 } 31991 } 31992 _lazyTweens.length = 0; 31993 }; 31994 31995 _rootTimeline._startTime = _ticker.time; 31996 _rootFramesTimeline._startTime = _ticker.frame; 31997 _rootTimeline._active = _rootFramesTimeline._active = true; 31998 setTimeout(_lazyRender, 1); //on some mobile devices, there isn't a "tick" before code runs which means any lazy renders wouldn't run before the next official "tick". 31999 32000 Animation._updateRoot = TweenLite.render = function() { 32001 var i, a, p; 32002 if (_lazyTweens.length) { //if code is run outside of the requestAnimationFrame loop, there may be tweens queued AFTER the engine refreshed, so we need to ensure any pending renders occur before we refresh again. 32003 _lazyRender(); 32004 } 32005 _rootTimeline.render((_ticker.time - _rootTimeline._startTime) * _rootTimeline._timeScale, false, false); 32006 _rootFramesTimeline.render((_ticker.frame - _rootFramesTimeline._startTime) * _rootFramesTimeline._timeScale, false, false); 32007 if (_lazyTweens.length) { 32008 _lazyRender(); 32009 } 32010 if (_ticker.frame >= _nextGCFrame) { //dump garbage every 120 frames or whatever the user sets TweenLite.autoSleep to 32011 _nextGCFrame = _ticker.frame + (parseInt(TweenLite.autoSleep, 10) || 120); 32012 for (p in _tweenLookup) { 32013 a = _tweenLookup[p].tweens; 32014 i = a.length; 32015 while (--i > -1) { 32016 if (a[i]._gc) { 32017 a.splice(i, 1); 32018 } 32019 } 32020 if (a.length === 0) { 32021 delete _tweenLookup[p]; 32022 } 32023 } 32024 //if there are no more tweens in the root timelines, or if they're all paused, make the _timer sleep to reduce load on the CPU slightly 32025 p = _rootTimeline._first; 32026 if (!p || p._paused) if (TweenLite.autoSleep && !_rootFramesTimeline._first && _ticker._listeners.tick.length === 1) { 32027 while (p && p._paused) { 32028 p = p._next; 32029 } 32030 if (!p) { 32031 _ticker.sleep(); 32032 } 32033 } 32034 } 32035 }; 32036 32037 _ticker.addEventListener("tick", Animation._updateRoot); 32038 32039 var _register = function(target, tween, scrub) { 32040 var id = target._gsTweenID, a, i; 32041 if (!_tweenLookup[id || (target._gsTweenID = id = "t" + (_tweenLookupNum++))]) { 32042 _tweenLookup[id] = {target:target, tweens:[]}; 32043 } 32044 if (tween) { 32045 a = _tweenLookup[id].tweens; 32046 a[(i = a.length)] = tween; 32047 if (scrub) { 32048 while (--i > -1) { 32049 if (a[i] === tween) { 32050 a.splice(i, 1); 32051 } 32052 } 32053 } 32054 } 32055 return _tweenLookup[id].tweens; 32056 }, 32057 _onOverwrite = function(overwrittenTween, overwritingTween, target, killedProps) { 32058 var func = overwrittenTween.vars.onOverwrite, r1, r2; 32059 if (func) { 32060 r1 = func(overwrittenTween, overwritingTween, target, killedProps); 32061 } 32062 func = TweenLite.onOverwrite; 32063 if (func) { 32064 r2 = func(overwrittenTween, overwritingTween, target, killedProps); 32065 } 32066 return (r1 !== false && r2 !== false); 32067 }, 32068 _applyOverwrite = function(target, tween, props, mode, siblings) { 32069 var i, changed, curTween, l; 32070 if (mode === 1 || mode >= 4) { 32071 l = siblings.length; 32072 for (i = 0; i < l; i++) { 32073 if ((curTween = siblings[i]) !== tween) { 32074 if (!curTween._gc) { 32075 if (curTween._kill(null, target, tween)) { 32076 changed = true; 32077 } 32078 } 32079 } else if (mode === 5) { 32080 break; 32081 } 32082 } 32083 return changed; 32084 } 32085 //NOTE: Add tiny amount to overcome floating point errors that can cause the startTime to be VERY slightly off (when a tween's time() is set for example) 32086 var startTime = tween._startTime + _tinyNum, 32087 overlaps = [], 32088 oCount = 0, 32089 zeroDur = (tween._duration === 0), 32090 globalStart; 32091 i = siblings.length; 32092 while (--i > -1) { 32093 if ((curTween = siblings[i]) === tween || curTween._gc || curTween._paused) { 32094 //ignore 32095 } else if (curTween._timeline !== tween._timeline) { 32096 globalStart = globalStart || _checkOverlap(tween, 0, zeroDur); 32097 if (_checkOverlap(curTween, globalStart, zeroDur) === 0) { 32098 overlaps[oCount++] = curTween; 32099 } 32100 } else if (curTween._startTime <= startTime) if (curTween._startTime + curTween.totalDuration() / curTween._timeScale > startTime) if (!((zeroDur || !curTween._initted) && startTime - curTween._startTime <= _tinyNum * 2)) { 32101 overlaps[oCount++] = curTween; 32102 } 32103 } 32104 32105 i = oCount; 32106 while (--i > -1) { 32107 curTween = overlaps[i]; 32108 l = curTween._firstPT; //we need to discern if there were property tweens originally; if they all get removed in the next line's _kill() call, the tween should be killed. See https://github.com/greensock/GreenSock-JS/issues/278 32109 if (mode === 2) if (curTween._kill(props, target, tween)) { 32110 changed = true; 32111 } 32112 if (mode !== 2 || (!curTween._firstPT && curTween._initted && l)) { 32113 if (mode !== 2 && !_onOverwrite(curTween, tween)) { 32114 continue; 32115 } 32116 if (curTween._enabled(false, false)) { //if all property tweens have been overwritten, kill the tween. 32117 changed = true; 32118 } 32119 } 32120 } 32121 return changed; 32122 }, 32123 _checkOverlap = function(tween, reference, zeroDur) { 32124 var tl = tween._timeline, 32125 ts = tl._timeScale, 32126 t = tween._startTime; 32127 while (tl._timeline) { 32128 t += tl._startTime; 32129 ts *= tl._timeScale; 32130 if (tl._paused) { 32131 return -100; 32132 } 32133 tl = tl._timeline; 32134 } 32135 t /= ts; 32136 return (t > reference) ? t - reference : ((zeroDur && t === reference) || (!tween._initted && t - reference < 2 * _tinyNum)) ? _tinyNum : ((t += tween.totalDuration() / tween._timeScale / ts) > reference + _tinyNum) ? 0 : t - reference - _tinyNum; 32137 }; 32138 32139 32140 //---- TweenLite instance methods ----------------------------------------------------------------------------- 32141 32142 p._init = function() { 32143 var v = this.vars, 32144 op = this._overwrittenProps, 32145 dur = this._duration, 32146 immediate = !!v.immediateRender, 32147 ease = v.ease, 32148 startAt = this._startAt, 32149 i, initPlugins, pt, p, startVars, l; 32150 if (v.startAt) { 32151 if (startAt) { 32152 startAt.render(-1, true); //if we've run a startAt previously (when the tween instantiated), we should revert it so that the values re-instantiate correctly particularly for relative tweens. Without this, a TweenLite.fromTo(obj, 1, {x:"+=100"}, {x:"-=100"}), for example, would actually jump to +=200 because the startAt would run twice, doubling the relative change. 32153 startAt.kill(); 32154 } 32155 startVars = {}; 32156 for (p in v.startAt) { //copy the properties/values into a new object to avoid collisions, like var to = {x:0}, from = {x:500}; timeline.fromTo(e, 1, from, to).fromTo(e, 1, to, from); 32157 startVars[p] = v.startAt[p]; 32158 } 32159 startVars.data = "isStart"; 32160 startVars.overwrite = false;
32161 startVars.immediateRender = true; 32162 startVars.lazy = (immediate && v.lazy !== false); 32163 startVars.startAt = startVars.delay = null; //no nesting of startAt objects allowed (otherwise it could cause an infinite loop). 32164 startVars.onUpdate = v.onUpdate; 32165 startVars.onUpdateParams = v.onUpdateParams; 32166 startVars.onUpdateScope = v.onUpdateScope || v.callbackScope || this; 32167 this._startAt = TweenLite.to(this.target || {}, 0, startVars); 32168 if (immediate) { 32169 if (this._time > 0) { 32170 this._startAt = null; //tweens that render immediately (like most from() and fromTo() tweens) shouldn't revert when their parent timeline's playhead goes backward past the startTime because the initial render could have happened anytime and it shouldn't be directly correlated to this tween's startTime. Imagine setting up a complex animation where the beginning states of various objects are rendered immediately but the tween doesn't happen for quite some time - if we revert to the starting values as soon as the playhead goes backward past the tween's startTime, it will throw things off visually. Reversion should only happen in TimelineLite/Max instances where immediateRender was false (which is the default in the convenience methods like from()). 32171 } else if (dur !== 0) { 32172 return; //we skip initialization here so that overwriting doesn't occur until the tween actually begins. Otherwise, if you create several immediateRender:true tweens of the same target/properties to drop into a TimelineLite or TimelineMax, the last one created would overwrite the first ones because they didn't get placed into the timeline yet before the first render occurs and kicks in overwriting. 32173 } 32174 } 32175 } else if (v.runBackwards && dur !== 0) { 32176 //from() tweens must be handled uniquely: their beginning values must be rendered but we don't want overwriting to occur yet (when time is still 0). Wait until the tween actually begins before doing all the routines like overwriting. At that time, we should render at the END of the tween to ensure that things initialize correctly (remember, from() tweens go backwards) 32177 if (startAt) { 32178 startAt.render(-1, true); 32179 startAt.kill(); 32180 this._startAt = null; 32181 } else { 32182 if (this._time !== 0) { //in rare cases (like if a from() tween runs and then is invalidate()-ed), immediateRender could be true but the initial forced-render gets skipped, so there's no need to force the render in this context when the _time is greater than 0 32183 immediate = false; 32184 } 32185 pt = {}; 32186 for (p in v) { //copy props into a new object and skip any reserved props, otherwise onComplete or onUpdate or onStart could fire. We should, however, permit autoCSS to go through. 32187 if (!_reservedProps[p] || p === "autoCSS") { 32188 pt[p] = v[p]; 32189 } 32190 } 32191 pt.overwrite = 0; 32192 pt.data = "isFromStart"; //we tag the tween with as "isFromStart" so that if [inside a plugin] we need to only do something at the very END of a tween, we have a way of identifying this tween as merely the one that's setting the beginning values for a "from()" tween. For example, clearProps in CSSPlugin should only get applied at the very END of a tween and without this tag, from(...{height:100, clearProps:"height", delay:1}) would wipe the height at the beginning of the tween and after 1 second, it'd kick back in. 32193 pt.lazy = (immediate && v.lazy !== false); 32194 pt.immediateRender = immediate; //zero-duration tweens render immediately by default, but if we're not specifically instructed to render this tween immediately, we should skip this and merely _init() to record the starting values (rendering them immediately would push them to completion which is wasteful in that case - we'd have to render(-1) immediately after) 32195 this._startAt = TweenLite.to(this.target, 0, pt); 32196 if (!immediate) { 32197 this._startAt._init(); //ensures that the initial values are recorded 32198 this._startAt._enabled(false); //no need to have the tween render on the next cycle. Disable it because we'll always manually control the renders of the _startAt tween. 32199 if (this.vars.immediateRender) { 32200 this._startAt = null; 32201 } 32202 } else if (this._time === 0) { 32203 return; 32204 } 32205 } 32206 } 32207 this._ease = ease = (!ease) ? TweenLite.defaultEase : (ease instanceof Ease) ? ease : (typeof(ease) === "function") ? new Ease(ease, v.easeParams) : _easeMap[ease] || TweenLite.defaultEase; 32208 if (v.easeParams instanceof Array && ease.config) { 32209 this._ease = ease.config.apply(ease, v.easeParams); 32210 } 32211 this._easeType = this._ease._type; 32212 this._easePower = this._ease._power; 32213 this._firstPT = null; 32214 32215 if (this._targets) { 32216 l = this._targets.length; 32217 for (i = 0; i < l; i++) { 32218 if ( this._initProps( this._targets[i], (this._propLookup[i] = {}), this._siblings[i], (op ? op[i] : null), i) ) { 32219 initPlugins = true; 32220 } 32221 } 32222 } else { 32223 initPlugins = this._initProps(this.target, this._propLookup, this._siblings, op, 0); 32224 } 32225 32226 if (initPlugins) { 32227 TweenLite._onPluginEvent("_onInitAllProps", this); //reorders the array in order of priority. Uses a static TweenPlugin method in order to minimize file size in TweenLite 32228 } 32229 if (op) if (!this._firstPT) if (typeof(this.target) !== "function") { //if all tweening properties have been overwritten, kill the tween. If the target is a function, it's probably a delayedCall so let it live. 32230 this._enabled(false, false); 32231 } 32232 if (v.runBackwards) { 32233 pt = this._firstPT; 32234 while (pt) { 32235 pt.s += pt.c; 32236 pt.c = -pt.c; 32237 pt = pt._next; 32238 } 32239 } 32240 this._onUpdate = v.onUpdate; 32241 this._initted = true; 32242 }; 32243 32244 p._initProps = function(target, propLookup, siblings, overwrittenProps, index) { 32245 var p, i, initPlugins, plugin, pt, v; 32246 if (target == null) { 32247 return false;
32248 } 32249 if (_lazyLookup[target._gsTweenID]) { 32250 _lazyRender(); //if other tweens of the same target have recently initted but haven't rendered yet, we've got to force the render so that the starting values are correct (imagine populating a timeline with a bunch of sequential tweens and then jumping to the end) 32251 } 32252 32253 if (!this.vars.css) if (target.style) if (target !== window && target.nodeType) if (_plugins.css) if (this.vars.autoCSS !== false) { //it's so common to use TweenLite/Max to animate the css of DOM elements, we assume that if the target is a DOM element, that's what is intended (a convenience so that users don't have to wrap things in css:{}, although we still recommend it for a slight performance boost and better specificity). Note: we cannot check "nodeType" on the window inside an iframe. 32254 _autoCSS(this.vars, target); 32255 } 32256 for (p in this.vars) { 32257 v = this.vars[p]; 32258 if (_reservedProps[p]) { 32259 if (v) if ((v instanceof Array) || (v.push && _isArray(v))) if (v.join("").indexOf("{self}") !== -1) { 32260 this.vars[p] = v = this._swapSelfInParams(v, this); 32261 } 32262 32263 } else if (_plugins[p] && (plugin = new _plugins[p]())._onInitTween(target, this.vars[p], this, index)) { 32264 32265 //t - target [object] 32266 //p - property [string] 32267 //s - start [number] 32268 //c - change [number] 32269 //f - isFunction [boolean] 32270 //n - name [string] 32271 //pg - isPlugin [boolean] 32272 //pr - priority [number] 32273 //m - mod [function | 0] 32274 this._firstPT = pt = {_next:this._firstPT, t:plugin, p:"setRatio", s:0, c:1, f:1, n:p, pg:1, pr:plugin._priority, m:0}; 32275 i = plugin._overwriteProps.length; 32276 while (--i > -1) { 32277 propLookup[plugin._overwriteProps[i]] = this._firstPT; 32278 } 32279 if (plugin._priority || plugin._onInitAllProps) { 32280 initPlugins = true; 32281 } 32282 if (plugin._onDisable || plugin._onEnable) { 32283 this._notifyPluginsOfEnabled = true; 32284 } 32285 if (pt._next) { 32286 pt._next._prev = pt; 32287 } 32288 32289 } else { 32290 propLookup[p] = _addPropTween.call(this, target, p, "get", v, p, 0, null, this.vars.stringFilter, index); 32291 } 32292 } 32293 32294 if (overwrittenProps) if (this._kill(overwrittenProps, target)) { //another tween may have tried to overwrite properties of this tween before init() was called (like if two tweens start at the same time, the one created second will run first) 32295 return this._initProps(target, propLookup, siblings, overwrittenProps, index); 32296 } 32297 if (this._overwrite > 1) if (this._firstPT) if (siblings.length > 1) if (_applyOverwrite(target, this, propLookup, this._overwrite, siblings)) { 32298 this._kill(propLookup, target); 32299 return this._initProps(target, propLookup, siblings, overwrittenProps, index); 32300 } 32301 if (this._firstPT) if ((this.vars.lazy !== false && this._duration) || (this.vars.lazy && !this._duration)) { //zero duration tweens don't lazy render by default; everything else does. 32302 _lazyLookup[target._gsTweenID] = true; 32303 } 32304 return initPlugins; 32305 }; 32306 32307 p.render = function(time, suppressEvents, force) { 32308 var self = this, 32309 prevTime = self._time, 32310 duration = self._duration, 32311 prevRawPrevTime = self._rawPrevTime, 32312 isComplete, callback, pt, rawPrevTime; 32313 if (time >= duration - _tinyNum && time >= 0) { //to work around occasional floating point math artifacts. 32314 self._totalTime = self._time = duration; 32315 self.ratio = self._ease._calcEnd ? self._ease.getRatio(1) : 1; 32316 if (!self._reversed ) { 32317 isComplete = true; 32318 callback = "onComplete"; 32319 force = (force || self._timeline.autoRemoveChildren); //otherwise, if the animation is unpaused/activated after it's already finished, it doesn't get removed from the parent timeline. 32320 } 32321 if (duration === 0) if (self._initted || !self.vars.lazy || force) { //zero-duration tweens are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered. 32322 if (self._startTime === self._timeline._duration) { //if a zero-duration tween is at the VERY end of a timeline and that timeline renders at its end, it will typically add a tiny bit of cushion to the render time to prevent roun
32322ding errors from getting in the way of tweens rendering their VERY end. If we then reverse() that timeline, the zero-duration tween will trigger its onReverseComplete even though technically the playhead didn't pass over it again. It's a very specific edge case we must accommodate. 32323 time = 0; 32324 } 32325 if (prevRawPrevTime < 0 || (time <= 0 && time >= -_tinyNum) || (prevRawPrevTime === _tinyNum && self.data !== "isPause")) if (prevRawPrevTime !== time) { //note: when this.data is "isPause", it's a callback added by addPause() on a timeline that we should not be triggered when LEAVING its exact start time. In other words, tl.addPause(1).play(1) shouldn't pause. 32326 force = true; 32327 if (prevRawPrevTime > _tinyNum) { 32328 callback = "onReverseComplete"; 32329 } 32330 } 32331 self._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. 32332 } 32333 32334 } else if (time < _tinyNum) { //to work around occasional floating point math artifacts, round super small values to 0. 32335 self._totalTime = self._time = 0; 32336 self.ratio = self._ease._calcEnd ? self._ease.getRatio(0) : 0; 32337 if (prevTime !== 0 || (duration === 0 && prevRawPrevTime > 0)) { 32338 callback = "onReverseComplete"; 32339 isComplete = self._reversed; 32340 } 32341 if (time > -_tinyNum) { 32342 time = 0; 32343 } else if (time < 0) { 32344 self._active = false; 32345 if (duration === 0) if (self._initted || !self.vars.lazy || force) { //zero-duration tweens are tricky because we must discern the momentum/direction of time in order to determine whether the starting values should be rendered or the ending values. If the "playhead" of its timeline goes past the zero-duration tween in the forward direction or lands directly on it, the end values should be rendered, but if the timeline's "playhead" moves past it in the backward direction (from a postitive time to a negative time), the starting values must be rendered. 32346 if (prevRawPrevTime >= 0 && !(prevRawPrevTime === _tinyNum && self.data === "isPause")) { 32347 force = true; 32348 } 32349 self._rawPrevTime = rawPrevTime = (!suppressEvents || time || prevRawPrevTime === time) ? time : _tinyNum; //when the playhead arrives at EXACTLY time 0 (right on top) of a zero-duration tween, we need to discern if events are suppressed so that when the playhead moves again (next time), it'll trigger the callback. If events are NOT suppressed, obviously the callback would be triggered in this render. Basically, the callback should fire either when the playhead ARRIVES or LEAVES this exact spot, not both. Imagine doing a timeline.seek(0) and there's a callback that sits at 0. Since events are suppressed on that seek() by default, nothing will fire, but when the playhead moves off of that position, the callback should fire. This behavior is what people intuitively expect. We set the _rawPrevTime to be a precise tiny number to indicate this scenario rather than using another property/variable which would increase memory usage. This technique is less readable, but more efficient. 32350 } 32351 } 32352 if (!self._initted || (self._startAt && self._startAt.progress())) { //if we render the very beginning (time == 0) of a fromTo(), we must force the render (normal tweens wouldn't need to render at a time of 0 when the prevTime was also 0). This is also mandatory to make sure overwriting kicks in immediately. Also, we check progress() because if startAt has already rendered at its end, we should force a render at its beginning. Otherwise, if you put the playhead directly on top of where a fromTo({immediateRender:false}) starts, and then move it backwards, the from() won't revert its values. 32353 force = true; 32354 } 32355 } else { 32356 self._totalTime = self._time = time; 32357 32358 if (self._easeType) { 32359 var r = time / duration, type = self._easeType, pow = self._easePower; 32360 if (type === 1 || (type === 3 && r >= 0.5)) { 32361 r = 1 - r; 32362 } 32363 if (type === 3) { 32364 r *= 2; 32365 } 32366 if (pow === 1) { 32367 r *= r; 32368 } else if (pow === 2) { 32369 r *= r * r; 32370 } else if (pow === 3) { 32371 r *= r * r * r; 32372 } else if (pow === 4) { 32373 r *= r * r * r * r; 32374 } 32375 self.ratio = (type === 1) ? 1 - r : (type === 2) ? r : (time / duration < 0.5) ? r / 2 : 1 - (r / 2); 32376 } else { 32377 self.ratio = self._ease.getRatio(time / duration); 32378 } 32379 } 32380 32381 if (self._time === prevTime && !force) { 32382 return; 32383 } else if (!self._initted) { 32384 self._init(); 32385 if (!self._initted || self._gc) { //immediateRender tweens typically won't initialize until the playhead advances (_time is greater than 0) in order to ensure that over
32385writing occurs properly. Also, if all of the tweening properties have been overwritten (which would cause _gc to be true, as set in _init()), we shouldn't continue otherwise an onStart callback could be called for example. 32386 return; 32387 } else if (!force && self._firstPT && ((self.vars.lazy !== false && self._duration) || (self.vars.lazy && !self._duration))) { 32388 self._time = self._totalTime = prevTime; 32389 self._rawPrevTime = prevRawPrevTime; 32390 _lazyTweens.push(self); 32391 self._lazy = [time, suppressEvents]; 32392 return; 32393 } 32394 //_ease is initially set to defaultEase, so now that init() has run, _ease is set properly and we need to recalculate the ratio. Overall this is faster than using conditional logic earlier in the method to avoid having to set ratio twice because we only init() once but renderTime() gets called VERY frequently. 32395 if (self._time && !isComplete) { 32396 self.ratio = self._ease.getRatio(self._time / duration); 32397 } else if (isComplete && self._ease._calcEnd) { 32398 self.ratio = self._ease.getRatio((self._time === 0) ? 0 : 1); 32399 } 32400 } 32401 if (self._lazy !== false) { //in case a lazy render is pending, we should flush it because the new render is occurring now (imagine a lazy tween instantiating and then immediately the user calls tween.seek(tween.duration()), skipping to the end - the end render would be forced, and then if we didn't flush the lazy render, it'd fire AFTER the seek(), rendering it at the wrong time. 32402 self._lazy = false; 32403 } 32404 if (!self._active) if (!self._paused && self._time !== prevTime && time >= 0) { 32405 self._active = true; //so that if the user renders a tween (as opposed to the timeline rendering it), the timeline is forced to re-render and align it with the proper time/frame on the next rendering cycle. Maybe the tween already finished but the user manually re-renders it as halfway done. 32406 } 32407 if (prevTime === 0) { 32408 if (self._startAt) { 32409 if (time >= 0) { 32410 self._startAt.render(time, true, force); 32411 } else if (!callback) { 32412 callback = "_dummyGS"; //if no callback is defined, use a dummy value just so that the condition at the end evaluates as true because _startAt should render AFTER the normal render loop when the time is negative. We could handle this in a more intuitive way, of course, but the render loop is the MOST important thing to optimize, so this technique allows us to avoid adding extra conditional logic in a high-frequency area. 32413 } 32414 } 32415 if (self.vars.onStart) if (self._time !== 0 || duration === 0) if (!suppressEvents) { 32416 self._callback("onStart"); 32417 } 32418 } 32419 pt = self._firstPT; 32420 while (pt) { 32421 if (pt.f) { 32422 pt.t[pt.p](pt.c * self.ratio + pt.s); 32423 } else { 32424 pt.t[pt.p] = pt.c * self.ratio + pt.s; 32425 } 32426 pt = pt._next; 32427 } 32428 32429 if (self._onUpdate) { 32430 if (time < 0) if (self._startAt && time !== -0.0001) { //if the tween is positioned at the VERY beginning (_startTime 0) of its parent timeline, it's illegal for the playhead to go back further, so we should not render the recorded startAt values. 32431 self._startAt.render(time, true, force); //note: for performance reasons, we tuck this conditional logic inside less traveled areas (most tweens don't have an onUpdate). We'd just have it at the end before the onComplete, but the values should be updated before any onUpdate is called, so we ALSO put it here and then if it's not called, we do so later near the onComplete. 32432 } 32433 if (!suppressEvents) if (self._time !== prevTime || isComplete || force) { 32434 self._callback("onUpdate"); 32435 } 32436 } 32437 if (callback) if (!self._gc || force) { //check _gc because there's a chance that kill() could be called in an onUpdate 32438 if (time < 0 && self._startAt && !self._onUpdate && time !== -0.0001) { //-0.0001 is a special value that we use when looping back to the beginning of a repeated TimelineMax, in which case we shouldn't render the _startAt values. 32439 self._startAt.render(time, true, force); 32440 } 32441 if (isComplete) { 32442 if (self._timeline.autoRemoveChildren) { 32443 self._enabled(false, false); 32444 } 32445 self._active = false;
32446 } 32447 if (!suppressEvents && self.vars[callback]) { 32448 self._callback(callback); 32449 } 32450 if (duration === 0 && self._rawPrevTime === _tinyNum && rawPrevTime !== _tinyNum) { //the onComplete or onReverseComplete could trigger movement of the playhead and for zero-duration tweens (which must discern direction) that land directly back on their start time, we don't want to fire again on the next render. Think of several addPause()'s in a timeline that forces the playhead to a certain spot, but what if it's already paused and another tween is tweening the "time" of the timeline? Each time it moves [forward] past that spot, it would move back, and since suppressEvents is true, it'd reset _rawPrevTime to _tinyNum so that when it begins again, the callback would fire (so ultimately it could bounce back and forth during that tween). Again, this is a very uncommon scenario, but possible nonetheless. 32451 self._rawPrevTime = 0; 32452 } 32453 } 32454 }; 32455 32456 p._kill = function(vars, target, overwritingTween) { 32457 if (vars === "all") { 32458 vars = null; 32459 } 32460 if (vars == null) if (target == null || target === this.target) { 32461 this._lazy = false; 32462 return this._enabled(false, false); 32463 } 32464 target = (typeof(target) !== "string") ? (target || this._targets || this.target) : TweenLite.selector(target) || target; 32465 var simultaneousOverwrite = (overwritingTween && this._time && overwritingTween._startTime === this._startTime && this._timeline === overwritingTween._timeline), 32466 firstPT = this._firstPT, 32467 i, overwrittenProps, p, pt, propLookup, changed, killProps, record, killed; 32468 if ((_isArray(target) || _isSelector(target)) && typeof(target[0]) !== "number") { 32469 i = target.length; 32470 while (--i > -1) { 32471 if (this._kill(vars, target[i], overwritingTween)) { 32472 changed = true; 32473 } 32474 } 32475 } else { 32476 if (this._targets) { 32477 i = this._targets.length; 32478 while (--i > -1) { 32479 if (target === this._targets[i]) { 32480 propLookup = this._propLookup[i] || {}; 32481 this._overwrittenProps = this._overwrittenProps || []; 32482 overwrittenProps = this._overwrittenProps[i] = vars ? this._overwrittenProps[i] || {} : "all"; 32483 break; 32484 } 32485 } 32486 } else if (target !== this.target) { 32487 return false; 32488 } else { 32489 propLookup = this._propLookup; 32490 overwrittenProps = this._overwrittenProps = vars ? this._overwrittenProps || {} : "all"; 32491 } 32492 32493 if (propLookup) { 32494 killProps = vars || propLookup; 32495 record = (vars !== overwrittenProps && overwrittenProps !== "all" && vars !== propLookup && (typeof(vars) !== "object" || !vars._tempKill)); //_tempKill is a super-secret way to delete a particular tweening property but NOT have it remembered as an official overwritten property (like in BezierPlugin) 32496 if (overwritingTween && (TweenLite.onOverwrite || this.vars.onOverwrite)) { 32497 for (p in killProps) { 32498 if (propLookup[p]) { 32499 if (!killed) { 32500 killed = []; 32501 } 32502 killed.push(p); 32503 } 32504 } 32505 if ((killed || !vars) && !_onOverwrite(this, overwritingTween, target, killed)) { //if the onOverwrite returned false, that means the user wants to override the overwriting (cancel it). 32506 return false; 32507 } 32508 } 32509 32510 for (p in killProps) { 32511 if ((pt = propLookup[p])) { 32512 if (simultaneousOverwrite) { //if another tween overwrites this one and they both start at exactly the same time, yet this tween has already rendered once (for example, at 0.001) because it's first in the queue, we should revert the values to where they were at 0 so that the starting values aren't contaminated on the overwriting tween. 32513 if (pt.f) { 32514 pt.t[pt.p](pt.s); 32515 } else { 32516 pt.t[pt.p] = pt.s; 32517 } 32518 changed = true; 32519 } 32520 if (pt.pg && pt.t._kill(killProps)) { 32521 changed = true; //some plugins need to be notified so they can perform cleanup tasks first 32522 } 32523 if (!pt.pg || pt.t._overwriteProps.length === 0) { 32524 if (pt._prev) { 32525 pt._prev._next = pt._next; 32526 } else if (pt === this._firstPT) { 32527 this._firstPT = pt._next; 32528 } 32529 if (pt._next) { 32530 pt._next._prev = pt._prev; 32531 } 32532 pt._next = pt._prev = null; 32533 } 32534 delete propLookup[p]; 32535 } 32536 if (record) { 32537 overwrittenProps[p] = 1; 32538 } 32539 } 32540 if (!this._firstPT && this._initted && firstPT) { //if all tweening properties are killed, kill the tween. Without this line, if there's a tween with multiple targets and then you killTweensOf() each target individually, the tween would technically still remain active and fire its onComplete even though there aren't any more properties tweening. 32541 this._enabled(false, false); 32542 } 32543 } 32544 } 32545 return changed; 32546 }; 32547 32548 p.invalidate = function() { 32549 if (this._notifyPluginsOfEnabled) { 32550 TweenLite._onPluginEvent("_onDisable", this); 32551 } 32552 var t = this._time; 32553 this._firstPT = this._overwrittenProps = this._startAt = this._onUpdate = null; 32554 this._notifyPluginsOfEnabled = this._active = this._lazy = false;
32555 this._propLookup = (this._targets) ? {} : []; 32556 Animation.prototype.invalidate.call(this); 32557 if (this.vars.immediateRender) { 32558 this._time = -_tinyNum; //forces a render without having to set the render() "force" parameter to true because we want to allow lazying by default (using the "force" parameter always forces an immediate full render) 32559 this.render(t, false, this.vars.lazy !== false); 32560 } 32561 return this; 32562 }; 32563 32564 p._enabled = function(enabled, ignoreTimeline) { 32565 if (!_tickerActive) { 32566 _ticker.wake(); 32567 } 32568 if (enabled && this._gc) { 32569 var targets = this._targets, 32570 i; 32571 if (targets) { 32572 i = targets.length; 32573 while (--i > -1) { 32574 this._siblings[i] = _register(targets[i], this, true); 32575 } 32576 } else { 32577 this._siblings = _register(this.target, this, true); 32578 } 32579 } 32580 Animation.prototype._enabled.call(this, enabled, ignoreTimeline); 32581 if (this._notifyPluginsOfEnabled) if (this._firstPT) { 32582 return TweenLite._onPluginEvent((enabled ? "_onEnable" : "_onDisable"), this); 32583 } 32584 return false; 32585 }; 32586 32587 32588 //----TweenLite static methods ----------------------------------------------------- 32589 32590 TweenLite.to = function(target, duration, vars) { 32591 return new TweenLite(target, duration, vars); 32592 }; 32593 32594 TweenLite.from = function(target, duration, vars) { 32595 vars.runBackwards = true; 32596 vars.immediateRender = (vars.immediateRender != false); 32597 return new TweenLite(target, duration, vars); 32598 }; 32599 32600 TweenLite.fromTo = function(target, duration, fromVars, toVars) { 32601 toVars.startAt = fromVars; 32602 toVars.immediateRender = (toVars.immediateRender != false && fromVars.immediateRender != false); 32603 return new TweenLite(target, duration, toVars); 32604 }; 32605 32606 TweenLite.delayedCall = function(delay, callback, params, scope, useFrames) { 32607 return new TweenLite(callback, 0, {delay:delay, onComplete:callback, onCompleteParams:params, callbackScope:scope, onReverseComplete:callback, onReverseCompleteParams:params, immediateRender:false, lazy:false, useFrames:useFrames, overwrite:0}); 32608 }; 32609 32610 TweenLite.set = function(target, vars) { 32611 return new TweenLite(target, 0, vars); 32612 }; 32613 32614 TweenLite.getTweensOf = function(target, onlyActive) { 32615 if (target == null) { return []; } 32616 target = (typeof(target) !== "string") ? target : TweenLite.selector(target) || target; 32617 var i, a, j, t; 32618 if ((_isArray(target) || _isSelector(target)) && typeof(target[0]) !== "number") { 32619 i = target.length; 32620 a = []; 32621 while (--i > -1) { 32622 a = a.concat(TweenLite.getTweensOf(target[i], onlyActive)); 32623 } 32624 i = a.length; 32625 //now get rid of any duplicates (tweens of arrays of objects could cause duplicates) 32626 while (--i > -1) { 32627 t = a[i]; 32628 j = i; 32629 while (--j > -1) { 32630 if (t === a[j]) { 32631 a.splice(i, 1); 32632 } 32633 } 32634 } 32635 } else if (target._gsTweenID) { 32636 a = _register(target).concat(); 32637 i = a.length; 32638 while (--i > -1) { 32639 if (a[i]._gc || (onlyActive && !a[i].isActive())) { 32640 a.splice(i, 1); 32641 } 32642 } 32643 } 32644 return a || []; 32645 }; 32646 32647 TweenLite.killTweensOf = TweenLite.killDelayedCallsTo = function(target, onlyActive, vars) { 32648 if (typeof(onlyActive) === "object") { 32649 vars = onlyActive; //for backwards compatibility (before "onlyActive" parameter was inserted) 32650 onlyActive = false; 32651 } 32652 var a = TweenLite.getTweensOf(target, onlyActive), 32653 i = a.length; 32654 while (--i > -1) { 32655 a[i]._kill(vars, target); 32656 } 32657 }; 32658 32659 32660 32661 /* 32662 * ---------------------------------------------------------------- 32663 * TweenPlugin (could easily be split out as a separate file/class, but included for ease of use (so that people don't need to include another script call before loading plugins which is easy to forget) 32664 * ---------------------------------------------------------------- 32665 */ 32666 var TweenPlugin = _class("plugins.TweenPlugin", function(props, priority) { 32667 this._overwriteProps = (props || "").split(","); 32668 this._propName = this._overwriteProps[0]; 32669 this._priority = priority || 0; 32670 this._super = TweenPlugin.prototype; 32671 }, true); 32672 32673 p = TweenPlugin.prototype; 32674 TweenPlugin.version = "1.19.0"; 32675 TweenPlugin.API = 2; 32676 p._firstPT = null; 32677 p._addTween = _addPropTween; 32678 p.setRatio = _setRatio; 32679 32680 p._kill = function(lookup) { 32681 var a = this._overwriteProps, 32682 pt = this._firstPT, 32683 i; 32684 if (lookup[this._propName] != null) { 32685 this._overwriteProps = []; 32686 } else { 32687 i = a.length; 32688 while (--i > -1) { 32689 if (lookup[a[i]] != null) { 32690 a.splice(i, 1); 32691 } 32692 } 32693 } 32694 while (pt) { 32695 if (lookup[pt.n] != null) { 32696 if (pt._next) { 32697 pt._next._prev = pt._prev; 32698 } 32699 if (pt._prev) { 32700 pt._prev._next = pt._next; 32701 pt._prev = null; 32702 } else if (this._firstPT === pt) { 32703 this._firstPT = pt._next; 32704 } 32705 } 32706 pt = pt._next; 32707 } 32708 return false;
32709 }; 32710 32711 p._mod = p._roundProps = function(lookup) { 32712 var pt = this._firstPT, 32713 val; 32714 while (pt) { 32715 val = lookup[this._propName] || (pt.n != null && lookup[ pt.n.split(this._propName + "_").join("") ]); 32716 if (val && typeof(val) === "function") { //some properties that are very plugin-specific add a prefix named after the _propName plus an underscore, so we need to ignore that extra stuff here. 32717 if (pt.f === 2) { 32718 pt.t._applyPT.m = val; 32719 } else { 32720 pt.m = val; 32721 } 32722 } 32723 pt = pt._next; 32724 } 32725 }; 32726 32727 TweenLite._onPluginEvent = function(type, tween) { 32728 var pt = tween._firstPT, 32729 changed, pt2, first, last, next; 32730 if (type === "_onInitAllProps") { 32731 //sorts the PropTween linked list in order of priority because some plugins need to render earlier/later than others, like MotionBlurPlugin applies its effects after all x/y/alpha tweens have rendered on each frame. 32732 while (pt) { 32733 next = pt._next; 32734 pt2 = first; 32735 while (pt2 && pt2.pr > pt.pr) { 32736 pt2 = pt2._next; 32737 } 32738 if ((pt._prev = pt2 ? pt2._prev : last)) { 32739 pt._prev._next = pt; 32740 } else { 32741 first = pt; 32742 } 32743 if ((pt._next = pt2)) { 32744 pt2._prev = pt; 32745 } else { 32746 last = pt; 32747 } 32748 pt = next; 32749 } 32750 pt = tween._firstPT = first; 32751 } 32752 while (pt) { 32753 if (pt.pg) if (typeof(pt.t[type]) === "function") if (pt.t[type]()) { 32754 changed = true; 32755 } 32756 pt = pt._next; 32757 } 32758 return changed; 32759 }; 32760 32761 TweenPlugin.activate = function(plugins) { 32762 var i = plugins.length; 32763 while (--i > -1) { 32764 if (plugins[i].API === TweenPlugin.API) { 32765 _plugins[(new plugins[i]())._propName] = plugins[i]; 32766 } 32767 } 32768 return true; 32769 }; 32770 32771 //provides a more concise way to define plugins that have no dependencies besides TweenPlugin and TweenLite, wrapping common boilerplate stuff into one function (added in 1.9.0). You don't NEED to use this to define a plugin - the old way still works and can be useful in certain (rare) situations. 32772 _gsDefine.plugin = function(config) { 32773 if (!config || !config.propName || !config.init || !config.API) { throw "illegal plugin definition."; } 32774 var propName = config.propName, 32775 priority = config.priority || 0, 32776 overwriteProps = config.overwriteProps, 32777 map = {init:"_onInitTween", set:"setRatio", kill:"_kill", round:"_mod", mod:"_mod", initAll:"_onInitAllProps"}, 32778 Plugin = _class("plugins." + propName.charAt(0).toUpperCase() + propName.substr(1) + "Plugin", 32779 function() { 32780 TweenPlugin.call(this, propName, priority); 32781 this._overwriteProps = overwriteProps || []; 32782 }, (config.global === true)), 32783 p = Plugin.prototype = new TweenPlugin(propName), 32784 prop; 32785 p.constructor = Plugin; 32786 Plugin.API = config.API; 32787 for (prop in map) { 32788 if (typeof(config[prop]) === "function") { 32789 p[map[prop]] = config[prop]; 32790 } 32791 } 32792 Plugin.version = config.version; 32793 TweenPlugin.activate([Plugin]); 32794 return Plugin; 32795 }; 32796 32797 32798 //now run through all the dependencies discovered and if any are missing, log that to the console as a warning. This is why it's best to have TweenLite load last - it can check all the dependencies for you. 32799 a = window._gsQueue; 32800 if (a) { 32801 for (i = 0; i < a.length; i++) { 32802 a[i](); 32803 } 32804 for (p in _defLookup) { 32805 if (!_defLookup[p].func) { 32806 window.console.log("GSAP encountered missing dependency: " + p); 32807 } 32808 } 32809 } 32810 32811 _tickerActive = false; //ensures that the first official animation forces a ticker.tick() to update the time when it is instantiated 32812 32813 })((typeof(module) !== "undefined" && module.exports && typeof(global) !== "undefined") ? global : this || window, "TweenMax"); 32814 /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) 32815 32816/***/ }), 32817/* 336 */ 32818/***/ (function(module, exports, __webpack_require__) { 32819 32820 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/* 32821 * jQuery Easing v1.4.1 - http://gsgd.co.uk/sandbox/jquery/easing/ 32822 * Open source under the BSD License. 32823 * Copyright © 2008 George McGinley Smith 32824 * All rights reserved. 32825 * https://raw.github.com/gdsmith/jquery-easing/master/LICENSE 32826 */ 32827 32828 (function (factory) { 32829 if (true) { 32830 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(1)], __WEBPACK_AMD_DEFINE_RESULT__ = function ($) { 32831 return factory($); 32832 }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 32833 } else if (typeof module === "object" && typeof module.exports === "object") { 32834 exports = factory(require('jquery')); 32835 } else { 32836 factory(jQuery); 32837 } 32838 })(function($){ 32839 32840 // Preserve the original jQuery "swing" easing as "jswing" 32841 $.easing.jswing = $.easing.swing; 32842 32843 var pow = Math.pow, 32844 sqrt = Math.sqrt, 32845 sin = Math.sin, 32846 cos = Math.cos, 32847 PI = Math.PI,
vendor: 5,066 bytes, lines 32848-33036
32848 c1 = 1.70158, 32849 c2 = c1 * 1.525, 32850 c3 = c1 + 1, 32851 c4 = ( 2 * PI ) / 3, 32852 c5 = ( 2 * PI ) / 4.5; 32853 32854 // x is the fraction of animation progress, in the range 0..1 32855 function bounceOut(x) { 32856 var n1 = 7.5625, 32857 d1 = 2.75; 32858 if ( x < 1/d1 ) { 32859 return n1*x*x; 32860 } else if ( x < 2/d1 ) { 32861 return n1*(x-=(1.5/d1))*x + 0.75; 32862 } else if ( x < 2.5/d1 ) { 32863 return n1*(x-=(2.25/d1))*x + 0.9375; 32864 } else { 32865 return n1*(x-=(2.625/d1))*x + 0.984375; 32866 } 32867 } 32868 32869 $.extend( $.easing, 32870 { 32871 def: 'easeOutQuad', 32872 swing: function (x) { 32873 return $.easing[$.easing.def](x); 32874 }, 32875 easeInQuad: function (x) { 32876 return x * x; 32877 }, 32878 easeOutQuad: function (x) { 32879 return 1 - ( 1 - x ) * ( 1 - x ); 32880 }, 32881 easeInOutQuad: function (x) { 32882 return x < 0.5 ? 32883 2 * x * x : 32884 1 - pow( -2 * x + 2, 2 ) / 2; 32885 }, 32886 easeInCubic: function (x) { 32887 return x * x * x; 32888 }, 32889 easeOutCubic: function (x) { 32890 return 1 - pow( 1 - x, 3 ); 32891 }, 32892 easeInOutCubic: function (x) { 32893 return x < 0.5 ? 32894 4 * x * x * x : 32895 1 - pow( -2 * x + 2, 3 ) / 2; 32896 }, 32897 easeInQuart: function (x) { 32898 return x * x * x * x; 32899 }, 32900 easeOutQuart: function (x) { 32901 return 1 - pow( 1 - x, 4 ); 32902 }, 32903 easeInOutQuart: function (x) { 32904 return x < 0.5 ? 32905 8 * x * x * x * x : 32906 1 - pow( -2 * x + 2, 4 ) / 2; 32907 }, 32908 easeInQuint: function (x) { 32909 return x * x * x * x * x; 32910 }, 32911 easeOutQuint: function (x) { 32912 return 1 - pow( 1 - x, 5 ); 32913 }, 32914 easeInOutQuint: function (x) { 32915 return x < 0.5 ? 32916 16 * x * x * x * x * x : 32917 1 - pow( -2 * x + 2, 5 ) / 2; 32918 }, 32919 easeInSine: function (x) { 32920 return 1 - cos( x * PI/2 ); 32921 }, 32922 easeOutSine: function (x) { 32923 return sin( x * PI/2 ); 32924 }, 32925 easeInOutSine: function (x) { 32926 return -( cos( PI * x ) - 1 ) / 2; 32927 }, 32928 easeInExpo: function (x) { 32929 return x === 0 ? 0 : pow( 2, 10 * x - 10 ); 32930 }, 32931 easeOutExpo: function (x) { 32932 return x === 1 ? 1 : 1 - pow( 2, -10 * x ); 32933 }, 32934 easeInOutExpo: function (x) { 32935 return x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? 32936 pow( 2, 20 * x - 10 ) / 2 : 32937 ( 2 - pow( 2, -20 * x + 10 ) ) / 2; 32938 }, 32939 easeInCirc: function (x) { 32940 return 1 - sqrt( 1 - pow( x, 2 ) ); 32941 }, 32942 easeOutCirc: function (x) { 32943 return sqrt( 1 - pow( x - 1, 2 ) ); 32944 }, 32945 easeInOutCirc: function (x) { 32946 return x < 0.5 ? 32947 ( 1 - sqrt( 1 - pow( 2 * x, 2 ) ) ) / 2 : 32948 ( sqrt( 1 - pow( -2 * x + 2, 2 ) ) + 1 ) / 2; 32949 }, 32950 easeInElastic: function (x) { 32951 return x === 0 ? 0 : x === 1 ? 1 : 32952 -pow( 2, 10 * x - 10 ) * sin( ( x * 10 - 10.75 ) * c4 ); 32953 }, 32954 easeOutElastic: function (x) { 32955 return x === 0 ? 0 : x === 1 ? 1 : 32956 pow( 2, -10 * x ) * sin( ( x * 10 - 0.75 ) * c4 ) + 1; 32957 }, 32958 easeInOutElastic: function (x) { 32959 return x === 0 ? 0 : x === 1 ? 1 : x < 0.5 ? 32960 -( pow( 2, 20 * x - 10 ) * sin( ( 20 * x - 11.125 ) * c5 )) / 2 : 32961 pow( 2, -20 * x + 10 ) * sin( ( 20 * x - 11.125 ) * c5 ) / 2 + 1; 32962 }, 32963 easeInBack: function (x) { 32964 return c3 * x * x * x - c1 * x * x; 32965 }, 32966 easeOutBack: function (x) { 32967 return 1 + c3 * pow( x - 1, 3 ) + c1 * pow( x - 1, 2 ); 32968 }, 32969 easeInOutBack: function (x) { 32970 return x < 0.5 ? 32971 ( pow( 2 * x, 2 ) * ( ( c2 + 1 ) * 2 * x - c2 ) ) / 2 : 32972 ( pow( 2 * x - 2, 2 ) *( ( c2 + 1 ) * ( x * 2 - 2 ) + c2 ) + 2 ) / 2; 32973 }, 32974 easeInBounce: function (x) { 32975 return 1 - bounceOut( 1 - x ); 32976 }, 32977 easeOutBounce: bounceOut, 32978 easeInOutBounce: function (x) { 32979 return x < 0.5 ? 32980 ( 1 - bounceOut( 1 - 2 * x ) ) / 2 : 32981 ( 1 + bounceOut( 2 * x - 1 ) ) / 2; 32982 } 32983 }); 32984 32985 }); 32986 32987 32988/***/ }), 32989/* 337 */ 32990/***/ (function(module, exports, __webpack_require__) { 32991 32992 var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** 32993 * Flickity fade v1.0.0 32994 * Fade between Flickity slides 32995 */ 32996 32997 /* jshint browser: true, undef: true, unused: true */ 32998 32999 ( function( window, factory ) { 33000 // universal module definition 33001 /*globals define, module, require */ 33002 if ( true ) { 33003 // AMD 33004 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 33005 __webpack_require__(338), 33006 __webpack_require__(342), 33007 ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 33008 } else if ( typeof module == 'object' && module.exports ) { 33009 // CommonJS 33010 module.exports = factory( 33011 require('flickity'), 33012 require('fizzy-ui-utils') 33013 ); 33014 } else { 33015 // browser global 33016 factory( 33017 window.Flickity, 33018 window.fizzyUIUtils 33019 ); 33020 } 33021 33022 }( this, function factory( Flickity, utils ) { 33023 33024 // ---- Slide ---- // 33025 33026 var Slide = Flickity.Slide; 33027 33028 var slideUpdateTarget = Slide.prototype.updateTarget; 33029 Slide.prototype.updateTarget = function() { 33030 slideUpdateTarget.apply( this, arguments ); 33031 if ( !this.parent.options.fade ) { 33032 return; 33033 } 33034 // position cells at selected target 33035 var slideTargetX = this.target - this.x; 33036 var firstCellX = this.cells[0].x;
33037 this.cells.forEach( function( cell ) { 33038 var targetX = cell.x - firstCellX - slideTargetX; 33039 cell.renderPosition( targetX ); 33040 }); 33041 }; 33042 33043 Slide.prototype.setOpacity = function( alpha ) { 33044 this.cells.forEach( function( cell ) { 33045 cell.element.style.opacity = alpha; 33046 }); 33047 }; 33048 33049 // ---- Flickity ---- // 33050 33051 var proto = Flickity.prototype; 33052 33053 Flickity.createMethods.push('_createFade'); 33054 33055 proto._createFade = function() { 33056 this.fadeIndex = this.selectedIndex; 33057 this.prevSelectedIndex = this.selectedIndex; 33058 this.on( 'select', this.onSelectFade ); 33059 this.on( 'dragEnd', this.onDragEndFade ); 33060 this.on( 'settle', this.onSettleFade ); 33061 this.on( 'activate', this.onActivateFade ); 33062 this.on( 'deactivate', this.onDeactivateFade ); 33063 }; 33064 33065 var updateSlides = proto.updateSlides; 33066 proto.updateSlides = function() { 33067 updateSlides.apply( this, arguments ); 33068 if ( !this.options.fade ) { 33069 return; 33070 } 33071 // set initial opacity 33072 this.slides.forEach( function( slide, i ) { 33073 var alpha = i == this.selectedIndex ? 1 : 0; 33074 slide.setOpacity( alpha ); 33075 }, this ); 33076 }; 33077 33078 /* ---- events ---- */ 33079 33080 proto.onSelectFade = function() { 33081 // in case of resize, keep fadeIndex within current count 33082 this.fadeIndex = Math.min( this.prevSelectedIndex, this.slides.length - 1 ); 33083 this.prevSelectedIndex = this.selectedIndex; 33084 }; 33085 33086 proto.onSettleFade = function() { 33087 delete this.didDragEnd; 33088 if ( !this.options.fade ) { 33089 return; 33090 } 33091 // set full and 0 opacity on selected & faded slides 33092 this.selectedSlide.setOpacity( 1 ); 33093 var fadedSlide = this.slides[ this.fadeIndex ]; 33094 if ( fadedSlide && this.fadeIndex != this.selectedIndex ) { 33095 this.slides[ this.fadeIndex ].setOpacity( 0 ); 33096 } 33097 }; 33098 33099 proto.onDragEndFade = function() { 33100 // set flag 33101 this.didDragEnd = true; 33102 }; 33103 33104 proto.onActivateFade = function() { 33105 if ( this.options.fade ) { 33106 this.element.classList.add('is-fade'); 33107 } 33108 }; 33109 33110 proto.onDeactivateFade = function() { 33111 if ( !this.options.fade ) { 33112 return; 33113 } 33114 this.element.classList.remove('is-fade'); 33115 // reset opacity 33116 this.slides.forEach( function( slide ) { 33117 slide.setOpacity(''); 33118 }); 33119 }; 33120 33121 /* ---- position & fading ---- */ 33122 33123 var positionSlider = proto.positionSlider; 33124 proto.positionSlider = function() { 33125 if ( !this.options.fade ) { 33126 positionSlider.apply( this, arguments ); 33127 return; 33128 } 33129 33130 this.fadeSlides(); 33131 this.dispatchScrollEvent(); 33132 }; 33133 33134 var positionSliderAtSelected = proto.positionSliderAtSelected; 33135 proto.positionSliderAtSelected = function() { 33136 if ( this.options.fade ) { 33137 // position fade slider at origin 33138 this.setTranslateX( 0 ); 33139 } 33140 positionSliderAtSelected.apply( this, arguments ); 33141 }; 33142 33143 proto.fadeSlides = function() { 33144 if ( this.slides.length < 2 ) { 33145 return; 33146 } 33147 // get slides to fade-in & fade-out 33148 var indexes = this.getFadeIndexes(); 33149 var fadeSlideA = this.slides[ indexes.a ]; 33150 var fadeSlideB = this.slides[ indexes.b ]; 33151 var distance = this.wrapDifference( fadeSlideA.target, fadeSlideB.target ); 33152 var progress = this.wrapDifference( fadeSlideA.target, -this.x ); 33153 progress = progress / distance; 33154 33155 fadeSlideA.setOpacity( 1 - progress ); 33156 fadeSlideB.setOpacity( progress ); 33157 33158 // hide previous slide 33159 var fadeHideIndex = indexes.a; 33160 if ( this.isDragging ) { 33161 fadeHideIndex = progress > 0.5 ? indexes.a : indexes.b; 33162 } 33163 var isNewHideIndex = this.fadeHideIndex != undefined && 33164 this.fadeHideIndex != fadeHideIndex && 33165 this.fadeHideIndex != indexes.a && 33166 this.fadeHideIndex != indexes.b; 33167 if ( isNewHideIndex ) { 33168 // new fadeHideSlide set, hide previous 33169 this.slides[ this.fadeHideIndex ].setOpacity( 0 ); 33170 } 33171 this.fadeHideIndex = fadeHideIndex; 33172 }; 33173 33174 proto.getFadeIndexes = function() { 33175 if ( !this.isDragging && !this.didDragEnd ) { 33176 return { 33177 a: this.fadeIndex, 33178 b: this.selectedIndex, 33179 }; 33180 } 33181 if ( this.options.wrapAround ) { 33182 return this.getFadeDragWrapIndexes(); 33183 } else { 33184 return this.getFadeDragLimitIndexes(); 33185 } 33186 }; 33187 33188 proto.getFadeDragWrapIndexes = function() { 33189 var distances = this.slides.map( function( slide, i ) {
33190 return this.getSlideDistance( -this.x, i ); 33191 }, this ); 33192 var absDistances = distances.map( function( distance ) { 33193 return Math.abs( distance ); 33194 }); 33195 var minDistance = Math.min.apply( Math, absDistances ); 33196 var closestIndex = absDistances.indexOf( minDistance ); 33197 var distance = distances[ closestIndex ]; 33198 var len = this.slides.length; 33199 33200 var delta = distance >= 0 ? 1 : -1; 33201 return { 33202 a: closestIndex, 33203 b: utils.modulo( closestIndex + delta, len ), 33204 }; 33205 }; 33206 33207 proto.getFadeDragLimitIndexes = function() { 33208 // calculate closest previous slide 33209 var dragIndex = 0; 33210 for ( var i=0; i < this.slides.length - 1; i++ ) { 33211 var slide = this.slides[i]; 33212 if ( -this.x < slide.target ) { 33213 break; 33214 } 33215 dragIndex = i; 33216 } 33217 return { 33218 a: dragIndex, 33219 b: dragIndex + 1, 33220 }; 33221 }; 33222 33223 proto.wrapDifference = function( a, b ) { 33224 var diff = b - a; 33225 33226 if ( !this.options.wrapAround ) { 33227 return diff; 33228 } 33229 33230 var diffPlus = diff + this.slideableWidth; 33231 var diffMinus = diff - this.slideableWidth; 33232 if ( Math.abs( diffPlus ) < Math.abs( diff ) ) { 33233 diff = diffPlus; 33234 } 33235 if ( Math.abs( diffMinus ) < Math.abs( diff ) ) { 33236 diff = diffMinus; 33237 } 33238 return diff; 33239 }; 33240 33241 // ---- wrapAround ---- // 33242 33243 var _getWrapShiftCells = proto._getWrapShiftCells; 33244 proto._getWrapShiftCells = function() { 33245 if ( !this.options.fade ) { 33246 _getWrapShiftCells.apply( this, arguments ); 33247 } 33248 }; 33249 33250 var shiftWrapCells = proto.shiftWrapCells; 33251 proto.shiftWrapCells = function() { 33252 if ( !this.options.fade ) { 33253 shiftWrapCells.apply( this, arguments ); 33254 } 33255 }; 33256 33257 return Flickity; 33258 33259 })); 33260 33261 33262/***/ }), 33263/* 338 */ 33264/***/ (function(module, exports, __webpack_require__) { 33265 33266 var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 33267 * Flickity v2.3.0 33268 * Touch, responsive, flickable carousels 33269 * 33270 * Licensed GPLv3 for open source use 33271 * or Flickity Commercial License for commercial use 33272 * 33273 * https://flickity.metafizzy.co 33274 * Copyright 2015-2021 Metafizzy 33275 */ 33276 33277 ( function( window, factory ) { 33278 // universal module definition 33279 if ( true ) { 33280 // AMD 33281 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 33282 __webpack_require__(339), 33283 __webpack_require__(347), 33284 __webpack_require__(350), 33285 __webpack_require__(351), 33286 __webpack_require__(352), 33287 __webpack_require__(353), 33288 __webpack_require__(354), 33289 ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 33290 } else if ( typeof module == 'object' && module.exports ) { 33291 // CommonJS 33292 module.exports = factory( 33293 require('./flickity'), 33294 require('./drag'), 33295 require('./prev-next-button'), 33296 require('./page-dots'), 33297 require('./player'), 33298 require('./add-remove-cell'), 33299 require('./lazyload') 33300 ); 33301 } 33302 33303 } )( window, function factory( Flickity ) { 33304 return Flickity; 33305 } ); 33306 33307 33308/***/ }), 33309/* 339 */ 33310/***/ (function(module, exports, __webpack_require__) { 33311 33312 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Flickity main 33313 /* eslint-disable max-params */ 33314 ( function( window, factory ) { 33315 // universal module definition 33316 if ( true ) { 33317 // AMD 33318 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 33319 __webpack_require__(340), 33320 __webpack_require__(341), 33321 __webpack_require__(342), 33322 __webpack_require__(344), 33323 __webpack_require__(345), 33324 __webpack_require__(346), 33325 ], __WEBPACK_AMD_DEFINE_RESULT__ = function( EvEmitter, getSize, utils, Cell, Slide, animatePrototype ) { 33326 return factory( window, EvEmitter, getSize, utils, Cell, Slide, animatePrototype ); 33327 }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 33328 } else if ( typeof module == 'object' && module.exports ) { 33329 // CommonJS 33330 module.exports = factory( 33331 window, 33332 require('ev-emitter'), 33333 require('get-size'), 33334 require('fizzy-ui-utils'), 33335 require('./cell'), 33336 require('./slide'), 33337 require('./animate') 33338 ); 33339 } else { 33340 // browser global 33341 var _Flickity = window.Flickity; 33342 33343 window.Flickity = factory( 33344 window, 33345 window.EvEmitter, 33346 window.getSize, 33347 window.fizzyUIUtils, 33348 _Flickity.Cell, 33349 _Flickity.Slide, 33350 _Flickity.animatePrototype 33351 ); 33352 } 33353 33354 }( window, function factory( window, EvEmitter, getSize, 33355 utils, Cell, Slide, animatePrototype ) { 33356 33357 /* eslint-enable max-params */ 33358 'use strict'; 33359 33360 // vars 33361 var jQuery = window.jQuery; 33362 var getComputedStyle = window.getComputedStyle; 33363 var console = window.console; 33364 33365 function moveElements( elems, toElem ) { 33366 elems = utils.makeArray( elems ); 33367 while ( elems.length ) { 33368 toElem.appendChild( elems.shift() ); 33369 } 33370 } 33371 33372 // -------------------------- Flickity -------------------------- // 33373 33374 // globally unique identifiers 33375 var GUID = 0; 33376 // internal store of all Flickity intances 33377 var instances = {}; 33378 33379 function Flickity( element, options ) { 33380 var queryElement = utils.getQueryElement( element ); 33381 if ( !queryElement ) { 33382 if ( console ) { 33383 console.error( 'Bad element for Flickity: ' + ( queryElement || element ) ); 33384 } 33385 return; 33386 } 33387 this.element = queryElement; 33388 // do not initialize twice on same element 33389 if ( this.element.flickityGUID ) { 33390 var instance = instances[ this.element.flickityGUID ]; 33391 if ( instance ) instance.option( options ); 33392 return instance; 33393 } 33394 33395 // add jQuery 33396 if ( jQuery ) { 33397 this.$element = jQuery( this.element ); 33398 } 33399 // options 33400 this.options = utils.extend( {}, this.constructor.defaults ); 33401 this.option( options ); 33402 33403 // kick things off 33404 this._create(); 33405 } 33406 33407 Flickity.defaults = { 33408 accessibility: true, 33409 // adaptiveHeight: false, 33410 cellAlign: 'center', 33411 // cellSelector: undefined,
33412 // contain: false, 33413 freeScrollFriction: 0.075, // friction when free-scrolling 33414 friction: 0.28, // friction when selecting 33415 namespaceJQueryEvents: true, 33416 // initialIndex: 0, 33417 percentPosition: true, 33418 resize: true, 33419 selectedAttraction: 0.025, 33420 setGallerySize: true, 33421 // watchCSS: false, 33422 // wrapAround: false 33423 }; 33424 33425 // hash of methods triggered on _create() 33426 Flickity.createMethods = []; 33427 33428 var proto = Flickity.prototype; 33429 // inherit EventEmitter 33430 utils.extend( proto, EvEmitter.prototype ); 33431 33432 proto._create = function() { 33433 // add id for Flickity.data 33434 var id = this.guid = ++GUID; 33435 this.element.flickityGUID = id; // expando 33436 instances[ id ] = this; // associate via id 33437 // initial properties 33438 this.selectedIndex = 0; 33439 // how many frames slider has been in same position 33440 this.restingFrames = 0; 33441 // initial physics properties 33442 this.x = 0; 33443 this.velocity = 0; 33444 this.originSide = this.options.rightToLeft ? 'right' : 'left'; 33445 // create viewport & slider 33446 this.viewport = document.createElement('div'); 33447 this.viewport.className = 'flickity-viewport'; 33448 this._createSlider(); 33449 33450 if ( this.options.resize || this.options.watchCSS ) { 33451 window.addEventListener( 'resize', this ); 33452 } 33453 33454 // add listeners from on option 33455 for ( var eventName in this.options.on ) { 33456 var listener = this.options.on[ eventName ]; 33457 this.on( eventName, listener ); 33458 } 33459 33460 Flickity.createMethods.forEach( function( method ) { 33461 this[ method ](); 33462 }, this ); 33463 33464 if ( this.options.watchCSS ) { 33465 this.watchCSS(); 33466 } else { 33467 this.activate(); 33468 } 33469 33470 }; 33471 33472 /** 33473 * set options 33474 * @param {Object} opts - options to extend 33475 */ 33476 proto.option = function( opts ) { 33477 utils.extend( this.options, opts ); 33478 }; 33479 33480 proto.activate = function() { 33481 if ( this.isActive ) { 33482 return; 33483 } 33484 this.isActive = true; 33485 this.element.classList.add('flickity-enabled'); 33486 if ( this.options.rightToLeft ) { 33487 this.element.classList.add('flickity-rtl'); 33488 } 33489 33490 this.getSize(); 33491 // move initial cell elements so they can be loaded as cells 33492 var cellElems = this._filterFindCellElements( this.element.children ); 33493 moveElements( cellElems, this.slider ); 33494 this.viewport.appendChild( this.slider ); 33495 this.element.appendChild( this.viewport ); 33496 // get cells from children 33497 this.reloadCells(); 33498 33499 if ( this.options.accessibility ) { 33500 // allow element to focusable 33501 this.element.tabIndex = 0; 33502 // listen for key presses 33503 this.element.addEventListener( 'keydown', this ); 33504 } 33505 33506 this.emitEvent('activate'); 33507 this.selectInitialIndex(); 33508 // flag for initial activation, for using initialIndex 33509 this.isInitActivated = true; 33510 // ready event. #493 33511 this.dispatchEvent('ready'); 33512 }; 33513 33514 // slider positions the cells 33515 proto._createSlider = function() { 33516 // slider element does all the positioning 33517 var slider = document.createElement('div'); 33518 slider.className = 'flickity-slider'; 33519 slider.style[ this.originSide ] = 0; 33520 this.slider = slider; 33521 }; 33522 33523 proto._filterFindCellElements = function( elems ) { 33524 return utils.filterFindElements( elems, this.options.cellSelector ); 33525 }; 33526 33527 // goes through all children 33528 proto.reloadCells = function() { 33529 // collection of item elements 33530 this.cells = this._makeCells( this.slider.children ); 33531 this.positionCells(); 33532 this._getWrapShiftCells(); 33533 this.setGallerySize(); 33534 }; 33535 33536 /** 33537 * turn elements into Flickity.Cells 33538 * @param {[Array, NodeList, HTMLElement]} elems - elements to make into cells 33539 * @returns {Array} items - collection of new Flickity Cells 33540 */ 33541 proto._makeCells = function( elems ) { 33542 var cellElems = this._filterFindCellElements( elems ); 33543 33544 // create new Flickity for collection 33545 var cells = cellElems.map( function( cellElem ) { 33546 return new Cell( cellElem, this ); 33547 }, this ); 33548 33549 return cells; 33550 }; 33551 33552 proto.getLastCell = function() { 33553 return this.cells[ this.cells.length - 1 ]; 33554 }; 33555 33556 proto.getLastSlide = function() { 33557 return this.slides[ this.slides.length - 1 ]; 33558 }; 33559 33560 // positions all cells 33561 proto.positionCells = function() { 33562 // size all cells 33563 this._sizeCells( this.cells ); 33564 // position all cells 33565 this._positionCells( 0 ); 33566 }; 33567 33568 /** 33569 * position certain cells 33570 * @param {Integer} index - which cell to start with 33571 */ 33572 proto._positionCells = function( index ) { 33573 index = index || 0; 33574 // also measure maxCellHeight 33575 // start 0 if positioning all cells 33576 this.maxCellHeight = index ? this.maxCellHeight || 0 : 0; 33577 var cellX = 0; 33578 // get cellX 33579 if ( index > 0 ) { 33580 var startCell = this.cells[ index - 1 ]; 33581 cellX = startCell.x + startCell.size.outerWidth; 33582 } 33583 var len = this.cells.length; 33584 for ( var i = index; i < len; i++ ) { 33585 var cell = this.cells[i]; 33586 cell.setPosition( cellX ); 33587 cellX += cell.size.outerWidth; 33588 this.maxCellHeight = Math.max( cell.size.outerHeight, this.maxCellHeight ); 33589 } 33590 // keep track of cellX for wrap-around 33591 this.slideableWidth = cellX; 33592 // slides 33593 this.updateSlides(); 33594 // contain slides target 33595 this._containSlides(); 33596 // update slidesWidth 33597 this.slidesWidth = len ? this.getLastSlide().target - this.slides[0].target : 0; 33598 }; 33599 33600 /** 33601 * cell.getSize() on multiple cells 33602 * @param {Array} cells - cells to size 33603 */ 33604 proto._sizeCells = function( cells ) {
33605 cells.forEach( function( cell ) { 33606 cell.getSize(); 33607 } ); 33608 }; 33609 33610 // -------------------------- -------------------------- // 33611 33612 proto.updateSlides = function() { 33613 this.slides = []; 33614 if ( !this.cells.length ) { 33615 return; 33616 } 33617 33618 var slide = new Slide( this ); 33619 this.slides.push( slide ); 33620 var isOriginLeft = this.originSide == 'left'; 33621 var nextMargin = isOriginLeft ? 'marginRight' : 'marginLeft'; 33622 33623 var canCellFit = this._getCanCellFit(); 33624 33625 this.cells.forEach( function( cell, i ) { 33626 // just add cell if first cell in slide 33627 if ( !slide.cells.length ) { 33628 slide.addCell( cell ); 33629 return; 33630 } 33631 33632 var slideWidth = ( slide.outerWidth - slide.firstMargin ) + 33633 ( cell.size.outerWidth - cell.size[ nextMargin ] ); 33634 33635 if ( canCellFit.call( this, i, slideWidth ) ) { 33636 slide.addCell( cell ); 33637 } else { 33638 // doesn't fit, new slide 33639 slide.updateTarget(); 33640 33641 slide = new Slide( this ); 33642 this.slides.push( slide ); 33643 slide.addCell( cell ); 33644 } 33645 }, this ); 33646 // last slide 33647 slide.updateTarget(); 33648 // update .selectedSlide 33649 this.updateSelectedSlide(); 33650 }; 33651 33652 proto._getCanCellFit = function() { 33653 var groupCells = this.options.groupCells; 33654 if ( !groupCells ) { 33655 return function() { 33656 return false; 33657 }; 33658 } else if ( typeof groupCells == 'number' ) { 33659 // group by number. 3 -> [0,1,2], [3,4,5], ... 33660 var number = parseInt( groupCells, 10 ); 33661 return function( i ) { 33662 return ( i % number ) !== 0; 33663 }; 33664 } 33665 // default, group by width of slide 33666 // parse '75% 33667 var percentMatch = typeof groupCells == 'string' && 33668 groupCells.match( /^(\d+)%$/ ); 33669 var percent = percentMatch ? parseInt( percentMatch[1], 10 ) / 100 : 1; 33670 return function( i, slideWidth ) { 33671 /* eslint-disable-next-line no-invalid-this */ 33672 return slideWidth <= ( this.size.innerWidth + 1 ) * percent; 33673 }; 33674 }; 33675 33676 // alias _init for jQuery plugin .flickity() 33677 proto._init = 33678 proto.reposition = function() { 33679 this.positionCells(); 33680 this.positionSliderAtSelected(); 33681 }; 33682 33683 proto.getSize = function() { 33684 this.size = getSize( this.element ); 33685 this.setCellAlign(); 33686 this.cursorPosition = this.size.innerWidth * this.cellAlign; 33687 }; 33688 33689 var cellAlignShorthands = { 33690 // cell align, then based on origin side 33691 center: { 33692 left: 0.5, 33693 right: 0.5, 33694 }, 33695 left: { 33696 left: 0, 33697 right: 1, 33698 }, 33699 right: { 33700 right: 0, 33701 left: 1, 33702 }, 33703 }; 33704 33705 proto.setCellAlign = function() { 33706 var shorthand = cellAlignShorthands[ this.options.cellAlign ]; 33707 this.cellAlign = shorthand ? shorthand[ this.originSide ] : this.options.cellAlign; 33708 }; 33709 33710 proto.setGallerySize = function() { 33711 if ( this.options.setGallerySize ) { 33712 var height = this.options.adaptiveHeight && this.selectedSlide ? 33713 this.selectedSlide.height : this.maxCellHeight; 33714 this.viewport.style.height = height + 'px'; 33715 } 33716 }; 33717 33718 proto._getWrapShiftCells = function() { 33719 // only for wrap-around 33720 if ( !this.options.wrapAround ) { 33721 return; 33722 } 33723 // unshift previous cells 33724 this._unshiftCells( this.beforeShiftCells ); 33725 this._unshiftCells( this.afterShiftCells ); 33726 // get before cells 33727 // initial gap 33728 var gapX = this.cursorPosition; 33729 var cellIndex = this.cells.length - 1; 33730 this.beforeShiftCells = this._getGapCells( gapX, cellIndex, -1 ); 33731 // get after cells 33732 // ending gap between last cell and end of gallery viewport 33733 gapX = this.size.innerWidth - this.cursorPosition; 33734 // start cloning at first cell, working forwards 33735 this.afterShiftCells = this._getGapCells( gapX, 0, 1 ); 33736 }; 33737 33738 proto._getGapCells = function( gapX, cellIndex, increment ) { 33739 // keep adding cells until the cover the initial gap 33740 var cells = []; 33741 while ( gapX > 0 ) { 33742 var cell = this.cells[ cellIndex ]; 33743 if ( !cell ) { 33744 break; 33745 } 33746 cells.push( cell ); 33747 cellIndex += increment; 33748 gapX -= cell.size.outerWidth; 33749 } 33750 return cells; 33751 }; 33752 33753 // ----- contain ----- // 33754 33755 // contain cell targets so no excess sliding 33756 proto._containSlides = function() { 33757 if ( !this.options.contain || this.options.wrapAround || !this.cells.length ) { 33758 return; 33759 } 33760 var isRightToLeft = this.options.rightToLeft; 33761 var beginMargin = isRightToLeft ? 'marginRight' : 'marginLeft'; 33762 var endMargin = isRightToLeft ? 'marginLeft' : 'marginRight'; 33763 var contentWidth = this.slideableWidth - this.getLastCell().size[ endMargin ]; 33764 // content is less than gallery size 33765 var isContentSmaller = contentWidth < this.size.innerWidth; 33766 // bounds 33767 var beginBound = this.cursorPosition + this.cells[0].size[ beginMargin ]; 33768 var endBound = contentWidth - this.size.innerWidth * ( 1 - this.cellAlign ); 33769 // contain each cell target
33770 this.slides.forEach( function( slide ) { 33771 if ( isContentSmaller ) { 33772 // all cells fit inside gallery 33773 slide.target = contentWidth * this.cellAlign; 33774 } else { 33775 // contain to bounds 33776 slide.target = Math.max( slide.target, beginBound ); 33777 slide.target = Math.min( slide.target, endBound ); 33778 } 33779 }, this ); 33780 }; 33781 33782 // ----- ----- // 33783 33784 /** 33785 * emits events via eventEmitter and jQuery events 33786 * @param {String} type - name of event 33787 * @param {Event} event - original event 33788 * @param {Array} args - extra arguments 33789 */ 33790 proto.dispatchEvent = function( type, event, args ) { 33791 var emitArgs = event ? [ event ].concat( args ) : args; 33792 this.emitEvent( type, emitArgs ); 33793 33794 if ( jQuery && this.$element ) { 33795 // default trigger with type if no event 33796 type += this.options.namespaceJQueryEvents ? '.flickity' : ''; 33797 var $event = type; 33798 if ( event ) { 33799 // create jQuery event 33800 var jQEvent = new jQuery.Event( event ); 33801 jQEvent.type = type; 33802 $event = jQEvent; 33803 } 33804 this.$element.trigger( $event, args ); 33805 } 33806 }; 33807 33808 // -------------------------- select -------------------------- // 33809 33810 /** 33811 * @param {Integer} index - index of the slide 33812 * @param {Boolean} isWrap - will wrap-around to last/first if at the end 33813 * @param {Boolean} isInstant - will immediately set position at selected cell 33814 */ 33815 proto.select = function( index, isWrap, isInstant ) { 33816 if ( !this.isActive ) { 33817 return; 33818 } 33819 index = parseInt( index, 10 ); 33820 this._wrapSelect( index ); 33821 33822 if ( this.options.wrapAround || isWrap ) { 33823 index = utils.modulo( index, this.slides.length ); 33824 } 33825 // bail if invalid index 33826 if ( !this.slides[ index ] ) { 33827 return; 33828 } 33829 var prevIndex = this.selectedIndex; 33830 this.selectedIndex = index; 33831 this.updateSelectedSlide(); 33832 if ( isInstant ) { 33833 this.positionSliderAtSelected(); 33834 } else { 33835 this.startAnimation(); 33836 } 33837 if ( this.options.adaptiveHeight ) { 33838 this.setGallerySize(); 33839 } 33840 // events 33841 this.dispatchEvent( 'select', null, [ index ] ); 33842 // change event if new index 33843 if ( index != prevIndex ) { 33844 this.dispatchEvent( 'change', null, [ index ] ); 33845 } 33846 // old v1 event name, remove in v3 33847 this.dispatchEvent('cellSelect'); 33848 }; 33849 33850 // wraps position for wrapAround, to move to closest slide. #113 33851 proto._wrapSelect = function( index ) { 33852 var len = this.slides.length; 33853 var isWrapping = this.options.wrapAround && len > 1; 33854 if ( !isWrapping ) { 33855 return index; 33856 } 33857 var wrapIndex = utils.modulo( index, len ); 33858 // go to shortest 33859 var delta = Math.abs( wrapIndex - this.selectedIndex ); 33860 var backWrapDelta = Math.abs( ( wrapIndex + len ) - this.selectedIndex ); 33861 var forewardWrapDelta = Math.abs( ( wrapIndex - len ) - this.selectedIndex ); 33862 if ( !this.isDragSelect && backWrapDelta < delta ) { 33863 index += len; 33864 } else if ( !this.isDragSelect && forewardWrapDelta < delta ) { 33865 index -= len; 33866 } 33867 // wrap position so slider is within normal area 33868 if ( index < 0 ) { 33869 this.x -= this.slideableWidth; 33870 } else if ( index >= len ) { 33871 this.x += this.slideableWidth; 33872 } 33873 }; 33874 33875 proto.previous = function( isWrap, isInstant ) { 33876 this.select( this.selectedIndex - 1, isWrap, isInstant ); 33877 }; 33878 33879 proto.next = function( isWrap, isInstant ) { 33880 this.select( this.selectedIndex + 1, isWrap, isInstant ); 33881 }; 33882 33883 proto.updateSelectedSlide = function() { 33884 var slide = this.slides[ this.selectedIndex ]; 33885 // selectedIndex could be outside of slides, if triggered before resize() 33886 if ( !slide ) { 33887 return; 33888 } 33889 // unselect previous selected slide 33890 this.unselectSelectedSlide(); 33891 // update new selected slide 33892 this.selectedSlide = slide; 33893 slide.select(); 33894 this.selectedCells = slide.cells; 33895 this.selectedElements = slide.getCellElements(); 33896 // HACK: selectedCell & selectedElement is first cell in slide, backwards compatibility 33897 // Remove in v3? 33898 this.selectedCell = slide.cells[0]; 33899 this.selectedElement = this.selectedElements[0]; 33900 }; 33901 33902 proto.unselectSelectedSlide = function() { 33903 if ( this.selectedSlide ) { 33904 this.selectedSlide.unselect(); 33905 } 33906 }; 33907 33908 proto.selectInitialIndex = function() { 33909 var initialIndex = this.options.initialIndex; 33910 // already activated, select previous selectedIndex 33911 if ( this.isInitActivated ) { 33912 this.select( this.selectedIndex, false, true ); 33913 return; 33914 } 33915 // select with selector string 33916 if ( initialIndex && typeof initialIndex == 'string' ) { 33917 var cell = this.queryCell( initialIndex ); 33918 if ( cell ) { 33919 this.selectCell( initialIndex, false, true ); 33920 return; 33921 } 33922 } 33923 33924 var index = 0; 33925 // select with number 33926 if ( initialIndex && this.slides[ initialIndex ] ) { 33927 index = initialIndex; 33928 } 33929 // select instantly 33930 this.select( index, false, true ); 33931 }; 33932 33933 /** 33934 * select slide from number or cell element 33935 * @param {[Element, Number]} value - zero-based index or element to select 33936 * @param {Boolean} isWrap - enables wrapping around for extra index 33937 * @param {Boolean} isInstant - disables slide animation 33938 */ 33939 proto.selectCell = function( value, isWrap, isInstant ) { 33940 // get cell 33941 var cell = this.queryCell( value ); 33942 if ( !cell ) { 33943 return; 33944 } 33945 33946 var index = this.getCellSlideIndex( cell ); 33947 this.select( index, isWrap, isInstant ); 33948 }; 33949 33950 proto.getCellSlideIndex = function( cell ) { 33951 // get index of slides that has cell 33952 for ( var i = 0; i < this.slides.length; i++ ) { 33953 var slide = this.slides[i]; 33954 var index = slide.cells.indexOf( cell ); 33955 if ( index != -1 ) { 33956 return i; 33957 } 33958 } 33959 }; 33960 33961 // -------------------------- get cells -------------------------- // 33962 33963 /** 33964 * get Flickity.Cell, given an Element 33965 * @param {Element} elem - matching cell element 33966 * @returns {Flickity.Cell} cell - matching cell 33967 */ 33968 proto.getCell = function( elem ) { 33969 // loop through cells to get the one that matches 33970 for ( var i = 0; i < this.cells.length; i++ ) { 33971 var cell = this.cells[i]; 33972 if ( cell.element == elem ) { 33973 return cell; 33974 } 33975 } 33976 }; 33977 33978 /** 33979 * get collection of Flickity.Cells, given Elements 33980 * @param {[Element, Array, NodeList]} elems - multiple elements 33981 * @returns {Array} cells - Flickity.Cells 33982 */ 33983 proto.getCells = function( elems ) { 33984 elems = utils.makeArray( elems ); 33985 var cells = [];
33986 elems.forEach( function( elem ) { 33987 var cell = this.getCell( elem ); 33988 if ( cell ) { 33989 cells.push( cell ); 33990 } 33991 }, this ); 33992 return cells; 33993 }; 33994 33995 /** 33996 * get cell elements 33997 * @returns {Array} cellElems 33998 */ 33999 proto.getCellElements = function() { 34000 return this.cells.map( function( cell ) { 34001 return cell.element; 34002 } ); 34003 }; 34004 34005 /** 34006 * get parent cell from an element 34007 * @param {Element} elem - child element 34008 * @returns {Flickit.Cell} cell - parent cell 34009 */ 34010 proto.getParentCell = function( elem ) { 34011 // first check if elem is cell 34012 var cell = this.getCell( elem ); 34013 if ( cell ) { 34014 return cell; 34015 } 34016 // try to get parent cell elem 34017 elem = utils.getParent( elem, '.flickity-slider > *' ); 34018 return this.getCell( elem ); 34019 }; 34020 34021 /** 34022 * get cells adjacent to a slide 34023 * @param {Integer} adjCount - number of adjacent slides 34024 * @param {Integer} index - index of slide to start 34025 * @returns {Array} cells - array of Flickity.Cells 34026 */ 34027 proto.getAdjacentCellElements = function( adjCount, index ) { 34028 if ( !adjCount ) { 34029 return this.selectedSlide.getCellElements(); 34030 } 34031 index = index === undefined ? this.selectedIndex : index; 34032 34033 var len = this.slides.length; 34034 if ( 1 + ( adjCount * 2 ) >= len ) { 34035 return this.getCellElements(); 34036 } 34037 34038 var cellElems = []; 34039 for ( var i = index - adjCount; i <= index + adjCount; i++ ) { 34040 var slideIndex = this.options.wrapAround ? utils.modulo( i, len ) : i; 34041 var slide = this.slides[ slideIndex ]; 34042 if ( slide ) { 34043 cellElems = cellElems.concat( slide.getCellElements() ); 34044 } 34045 } 34046 return cellElems; 34047 }; 34048 34049 /** 34050 * select slide from number or cell element 34051 * @param {[Element, String, Number]} selector - element, selector string, or index 34052 * @returns {Flickity.Cell} - matching cell 34053 */ 34054 proto.queryCell = function( selector ) { 34055 if ( typeof selector == 'number' ) { 34056 // use number as index 34057 return this.cells[ selector ]; 34058 } 34059 if ( typeof selector == 'string' ) { 34060 // do not select invalid selectors from hash: #123, #/. #791 34061 if ( selector.match( /^[#.]?[\d/]/ ) ) { 34062 return; 34063 } 34064 // use string as selector, get element 34065 selector = this.element.querySelector( selector ); 34066 } 34067 // get cell from element 34068 return this.getCell( selector ); 34069 }; 34070 34071 // -------------------------- events -------------------------- // 34072 34073 proto.uiChange = function() { 34074 this.emitEvent('uiChange'); 34075 }; 34076 34077 // keep focus on element when child UI elements are clicked 34078 proto.childUIPointerDown = function( event ) { 34079 // HACK iOS does not allow touch events to bubble up?! 34080 if ( event.type != 'touchstart' ) { 34081 event.preventDefault(); 34082 } 34083 this.focus(); 34084 }; 34085 34086 // ----- resize ----- // 34087 34088 proto.onresize = function() { 34089 this.watchCSS(); 34090 this.resize(); 34091 }; 34092 34093 utils.debounceMethod( Flickity, 'onresize', 150 ); 34094 34095 proto.resize = function() { 34096 // #1177 disable resize behavior when animating or dragging for iOS 15 34097 if ( !this.isActive || this.isAnimating || this.isDragging ) { 34098 return; 34099 } 34100 this.getSize(); 34101 // wrap values 34102 if ( this.options.wrapAround ) { 34103 this.x = utils.modulo( this.x, this.slideableWidth ); 34104 } 34105 this.positionCells(); 34106 this._getWrapShiftCells(); 34107 this.setGallerySize(); 34108 this.emitEvent('resize'); 34109 // update selected index for group slides, instant 34110 // TODO: position can be lost between groups of various numbers 34111 var selectedElement = this.selectedElements && this.selectedElements[0]; 34112 this.selectCell( selectedElement, false, true ); 34113 }; 34114 34115 // watches the :after property, activates/deactivates 34116 proto.watchCSS = function() { 34117 var watchOption = this.options.watchCSS; 34118 if ( !watchOption ) { 34119 return; 34120 } 34121 34122 var afterContent = getComputedStyle( this.element, ':after' ).content; 34123 // activate if :after { content: 'flickity' } 34124 if ( afterContent.indexOf('flickity') != -1 ) { 34125 this.activate(); 34126 } else { 34127 this.deactivate(); 34128 } 34129 }; 34130 34131 // ----- keydown ----- // 34132 34133 // go previous/next if left/right keys pressed 34134 proto.onkeydown = function( event ) { 34135 // only work if element is in focus 34136 var isNotFocused = document.activeElement && document.activeElement != this.element; 34137 if ( !this.options.accessibility || isNotFocused ) { 34138 return; 34139 } 34140 34141 var handler = Flickity.keyboardHandlers[ event.keyCode ]; 34142 if ( handler ) { 34143 handler.call( this ); 34144 } 34145 }; 34146 34147 Flickity.keyboardHandlers = { 34148 // left arrow 34149 37: function() { 34150 var leftMethod = this.options.rightToLeft ? 'next' : 'previous'; 34151 this.uiChange(); 34152 this[ leftMethod ](); 34153 }, 34154 // right arrow 34155 39: function() { 34156 var rightMethod = this.options.rightToLeft ? 'previous' : 'next'; 34157 this.uiChange(); 34158 this[ rightMethod ](); 34159 }, 34160 }; 34161 34162 // ----- focus ----- // 34163 34164 proto.focus = function() { 34165 // TODO remove scrollTo once focus options gets more support 34166 // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus ... 34167 // #Browser_compatibility 34168 var prevScrollY = window.pageYOffset; 34169 this.element.focus({ preventScroll: true }); 34170 // hack to fix scroll jump after focus, #76 34171 if ( window.pageYOffset != prevScrollY ) { 34172 window.scrollTo( window.pageXOffset, prevScrollY ); 34173 } 34174 }; 34175 34176 // -------------------------- destroy -------------------------- // 34177 34178 // deactivate all Flickity functionality, but keep stuff available 34179 proto.deactivate = function() { 34180 if ( !this.isActive ) { 34181 return; 34182 } 34183 this.element.classList.remove('flickity-enabled'); 34184 this.element.classList.remove('flickity-rtl'); 34185 this.unselectSelectedSlide(); 34186 // destroy cells
vendor: 7,555 bytes, lines 34187-34467
34187 this.cells.forEach( function( cell ) { 34188 cell.destroy(); 34189 } ); 34190 this.element.removeChild( this.viewport ); 34191 // move child elements back into element 34192 moveElements( this.slider.children, this.element ); 34193 if ( this.options.accessibility ) { 34194 this.element.removeAttribute('tabIndex'); 34195 this.element.removeEventListener( 'keydown', this ); 34196 } 34197 // set flags 34198 this.isActive = false; 34199 this.emitEvent('deactivate'); 34200 }; 34201 34202 proto.destroy = function() { 34203 this.deactivate(); 34204 window.removeEventListener( 'resize', this ); 34205 this.allOff(); 34206 this.emitEvent('destroy'); 34207 if ( jQuery && this.$element ) { 34208 jQuery.removeData( this.element, 'flickity' ); 34209 } 34210 delete this.element.flickityGUID; 34211 delete instances[ this.guid ]; 34212 }; 34213 34214 // -------------------------- prototype -------------------------- // 34215 34216 utils.extend( proto, animatePrototype ); 34217 34218 // -------------------------- extras -------------------------- // 34219 34220 /** 34221 * get Flickity instance from element 34222 * @param {[Element, String]} elem - element or selector string 34223 * @returns {Flickity} - Flickity instance 34224 */ 34225 Flickity.data = function( elem ) { 34226 elem = utils.getQueryElement( elem ); 34227 var id = elem && elem.flickityGUID; 34228 return id && instances[ id ]; 34229 }; 34230 34231 utils.htmlInit( Flickity, 'flickity' ); 34232 34233 if ( jQuery && jQuery.bridget ) { 34234 jQuery.bridget( 'flickity', Flickity ); 34235 } 34236 34237 // set internal jQuery, for Webpack + jQuery v3, #478 34238 Flickity.setJQuery = function( jq ) { 34239 jQuery = jq; 34240 }; 34241 34242 Flickity.Cell = Cell; 34243 Flickity.Slide = Slide; 34244 34245 return Flickity; 34246 34247 } ) ); 34248 34249 34250/***/ }), 34251/* 340 */ 34252/***/ (function(module, exports, __webpack_require__) { 34253 34254 var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/** 34255 * EvEmitter v1.1.0 34256 * Lil' event emitter 34257 * MIT License 34258 */ 34259 34260 /* jshint unused: true, undef: true, strict: true */ 34261 34262 ( function( global, factory ) { 34263 // universal module definition 34264 /* jshint strict: false */ /* globals define, module, window */ 34265 if ( true ) { 34266 // AMD - RequireJS 34267 !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 34268 } else if ( typeof module == 'object' && module.exports ) { 34269 // CommonJS - Browserify, Webpack 34270 module.exports = factory(); 34271 } else { 34272 // Browser globals 34273 global.EvEmitter = factory(); 34274 } 34275 34276 }( typeof window != 'undefined' ? window : this, function() { 34277 34278 "use strict"; 34279 34280 function EvEmitter() {} 34281 34282 var proto = EvEmitter.prototype; 34283 34284 proto.on = function( eventName, listener ) { 34285 if ( !eventName || !listener ) { 34286 return; 34287 } 34288 // set events hash 34289 var events = this._events = this._events || {}; 34290 // set listeners array 34291 var listeners = events[ eventName ] = events[ eventName ] || []; 34292 // only add once 34293 if ( listeners.indexOf( listener ) == -1 ) { 34294 listeners.push( listener ); 34295 } 34296 34297 return this; 34298 }; 34299 34300 proto.once = function( eventName, listener ) { 34301 if ( !eventName || !listener ) { 34302 return; 34303 } 34304 // add event 34305 this.on( eventName, listener ); 34306 // set once flag 34307 // set onceEvents hash 34308 var onceEvents = this._onceEvents = this._onceEvents || {}; 34309 // set onceListeners object 34310 var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {}; 34311 // set flag 34312 onceListeners[ listener ] = true; 34313 34314 return this; 34315 }; 34316 34317 proto.off = function( eventName, listener ) { 34318 var listeners = this._events && this._events[ eventName ]; 34319 if ( !listeners || !listeners.length ) { 34320 return; 34321 } 34322 var index = listeners.indexOf( listener ); 34323 if ( index != -1 ) { 34324 listeners.splice( index, 1 ); 34325 } 34326 34327 return this; 34328 }; 34329 34330 proto.emitEvent = function( eventName, args ) { 34331 var listeners = this._events && this._events[ eventName ]; 34332 if ( !listeners || !listeners.length ) { 34333 return; 34334 } 34335 // copy over to avoid interference if .off() in listener 34336 listeners = listeners.slice(0); 34337 args = args || []; 34338 // once stuff 34339 var onceListeners = this._onceEvents && this._onceEvents[ eventName ]; 34340 34341 for ( var i=0; i < listeners.length; i++ ) { 34342 var listener = listeners[i] 34343 var isOnce = onceListeners && onceListeners[ listener ]; 34344 if ( isOnce ) { 34345 // remove listener 34346 // remove before trigger to prevent recursion 34347 this.off( eventName, listener ); 34348 // unset once flag 34349 delete onceListeners[ listener ]; 34350 } 34351 // trigger listener 34352 listener.apply( this, args ); 34353 } 34354 34355 return this; 34356 }; 34357 34358 proto.allOff = function() { 34359 delete this._events; 34360 delete this._onceEvents; 34361 }; 34362 34363 return EvEmitter; 34364 34365 })); 34366 34367 34368/***/ }), 34369/* 341 */ 34370/***/ (function(module, exports, __webpack_require__) { 34371 34372 var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 34373 * getSize v2.0.3 34374 * measure size of elements 34375 * MIT license 34376 */ 34377 34378 /* jshint browser: true, strict: true, undef: true, unused: true */ 34379 /* globals console: false */ 34380 34381 ( function( window, factory ) { 34382 /* jshint strict: false */ /* globals define, module */ 34383 if ( true ) { 34384 // AMD 34385 !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 34386 } else if ( typeof module == 'object' && module.exports ) { 34387 // CommonJS 34388 module.exports = factory(); 34389 } else { 34390 // browser global 34391 window.getSize = factory(); 34392 } 34393 34394 })( window, function factory() { 34395 'use strict'; 34396 34397 // -------------------------- helpers -------------------------- // 34398 34399 // get a number from a string, not a percentage 34400 function getStyleSize( value ) { 34401 var num = parseFloat( value ); 34402 // not a percent like '100%', and a number 34403 var isValid = value.indexOf('%') == -1 && !isNaN( num ); 34404 return isValid && num; 34405 } 34406 34407 function noop() {} 34408 34409 var logError = typeof console == 'undefined' ? noop : 34410 function( message ) { 34411 console.error( message ); 34412 }; 34413 34414 // -------------------------- measurements -------------------------- // 34415 34416 var measurements = [ 34417 'paddingLeft', 34418 'paddingRight', 34419 'paddingTop', 34420 'paddingBottom', 34421 'marginLeft', 34422 'marginRight', 34423 'marginTop', 34424 'marginBottom', 34425 'borderLeftWidth', 34426 'borderRightWidth', 34427 'borderTopWidth', 34428 'borderBottomWidth' 34429 ]; 34430 34431 var measurementsLength = measurements.length; 34432 34433 function getZeroSize() { 34434 var size = { 34435 width: 0, 34436 height: 0, 34437 innerWidth: 0, 34438 innerHeight: 0, 34439 outerWidth: 0, 34440 outerHeight: 0 34441 }; 34442 for ( var i=0; i < measurementsLength; i++ ) { 34443 var measurement = measurements[i]; 34444 size[ measurement ] = 0; 34445 } 34446 return size; 34447 } 34448 34449 // -------------------------- getStyle -------------------------- // 34450 34451 /** 34452 * getStyle, get style of element, check for Firefox bug 34453 * https://bugzilla.mozilla.org/show_bug.cgi?id=548397 34454 */ 34455 function getStyle( elem ) { 34456 var style = getComputedStyle( elem ); 34457 if ( !style ) { 34458 logError( 'Style returned ' + style + 34459 '. Are you running this code in a hidden iframe on Firefox? ' + 34460 'See https://bit.ly/getsizebug1' ); 34461 } 34462 return style; 34463 } 34464 34465 // -------------------------- setup -------------------------- // 34466 34467 var isSetup = false;
vendor: 10,891 bytes, lines 34468-34859
34468 34469 var isBoxSizeOuter; 34470 34471 /** 34472 * setup 34473 * check isBoxSizerOuter 34474 * do on first getSize() rather than on page load for Firefox bug 34475 */ 34476 function setup() { 34477 // setup once 34478 if ( isSetup ) { 34479 return; 34480 } 34481 isSetup = true; 34482 34483 // -------------------------- box sizing -------------------------- // 34484 34485 /** 34486 * Chrome & Safari measure the outer-width on style.width on border-box elems 34487 * IE11 & Firefox<29 measures the inner-width 34488 */ 34489 var div = document.createElement('div'); 34490 div.style.width = '200px'; 34491 div.style.padding = '1px 2px 3px 4px'; 34492 div.style.borderStyle = 'solid'; 34493 div.style.borderWidth = '1px 2px 3px 4px'; 34494 div.style.boxSizing = 'border-box'; 34495 34496 var body = document.body || document.documentElement; 34497 body.appendChild( div ); 34498 var style = getStyle( div ); 34499 // round value for browser zoom. desandro/masonry#928 34500 isBoxSizeOuter = Math.round( getStyleSize( style.width ) ) == 200; 34501 getSize.isBoxSizeOuter = isBoxSizeOuter; 34502 34503 body.removeChild( div ); 34504 } 34505 34506 // -------------------------- getSize -------------------------- // 34507 34508 function getSize( elem ) { 34509 setup(); 34510 34511 // use querySeletor if elem is string 34512 if ( typeof elem == 'string' ) { 34513 elem = document.querySelector( elem ); 34514 } 34515 34516 // do not proceed on non-objects 34517 if ( !elem || typeof elem != 'object' || !elem.nodeType ) { 34518 return; 34519 } 34520 34521 var style = getStyle( elem ); 34522 34523 // if hidden, everything is 0 34524 if ( style.display == 'none' ) { 34525 return getZeroSize(); 34526 } 34527 34528 var size = {}; 34529 size.width = elem.offsetWidth; 34530 size.height = elem.offsetHeight; 34531 34532 var isBorderBox = size.isBorderBox = style.boxSizing == 'border-box'; 34533 34534 // get all measurements 34535 for ( var i=0; i < measurementsLength; i++ ) { 34536 var measurement = measurements[i]; 34537 var value = style[ measurement ]; 34538 var num = parseFloat( value ); 34539 // any 'auto', 'medium' value will be 0 34540 size[ measurement ] = !isNaN( num ) ? num : 0; 34541 } 34542 34543 var paddingWidth = size.paddingLeft + size.paddingRight; 34544 var paddingHeight = size.paddingTop + size.paddingBottom; 34545 var marginWidth = size.marginLeft + size.marginRight; 34546 var marginHeight = size.marginTop + size.marginBottom; 34547 var borderWidth = size.borderLeftWidth + size.borderRightWidth; 34548 var borderHeight = size.borderTopWidth + size.borderBottomWidth; 34549 34550 var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter; 34551 34552 // overwrite width and height if we can get it from style 34553 var styleWidth = getStyleSize( style.width ); 34554 if ( styleWidth !== false ) { 34555 size.width = styleWidth + 34556 // add padding and border unless it's already including it 34557 ( isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth ); 34558 } 34559 34560 var styleHeight = getStyleSize( style.height ); 34561 if ( styleHeight !== false ) { 34562 size.height = styleHeight + 34563 // add padding and border unless it's already including it 34564 ( isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight ); 34565 } 34566 34567 size.innerWidth = size.width - ( paddingWidth + borderWidth ); 34568 size.innerHeight = size.height - ( paddingHeight + borderHeight ); 34569 34570 size.outerWidth = size.width + marginWidth; 34571 size.outerHeight = size.height + marginHeight; 34572 34573 return size; 34574 } 34575 34576 return getSize; 34577 34578 }); 34579 34580 34581/***/ }), 34582/* 342 */ 34583/***/ (function(module, exports, __webpack_require__) { 34584 34585 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/** 34586 * Fizzy UI utils v2.0.7 34587 * MIT license 34588 */ 34589 34590 /*jshint browser: true, undef: true, unused: true, strict: true */ 34591 34592 ( function( window, factory ) { 34593 // universal module definition 34594 /*jshint strict: false */ /*globals define, module, require */ 34595 34596 if ( true ) { 34597 // AMD 34598 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 34599 __webpack_require__(343) 34600 ], __WEBPACK_AMD_DEFINE_RESULT__ = function( matchesSelector ) { 34601 return factory( window, matchesSelector ); 34602 }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 34603 } else if ( typeof module == 'object' && module.exports ) { 34604 // CommonJS 34605 module.exports = factory( 34606 window, 34607 require('desandro-matches-selector') 34608 ); 34609 } else { 34610 // browser global 34611 window.fizzyUIUtils = factory( 34612 window, 34613 window.matchesSelector 34614 ); 34615 } 34616 34617 }( window, function factory( window, matchesSelector ) { 34618 34619 'use strict'; 34620 34621 var utils = {}; 34622 34623 // ----- extend ----- // 34624 34625 // extends objects 34626 utils.extend = function( a, b ) { 34627 for ( var prop in b ) { 34628 a[ prop ] = b[ prop ]; 34629 } 34630 return a; 34631 }; 34632 34633 // ----- modulo ----- // 34634 34635 utils.modulo = function( num, div ) { 34636 return ( ( num % div ) + div ) % div; 34637 }; 34638 34639 // ----- makeArray ----- // 34640 34641 var arraySlice = Array.prototype.slice; 34642 34643 // turn element or nodeList into an array 34644 utils.makeArray = function( obj ) { 34645 if ( Array.isArray( obj ) ) { 34646 // use object if already an array 34647 return obj; 34648 } 34649 // return empty array if undefined or null. #6 34650 if ( obj === null || obj === undefined ) { 34651 return []; 34652 } 34653 34654 var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number'; 34655 if ( isArrayLike ) { 34656 // convert nodeList to array 34657 return arraySlice.call( obj ); 34658 } 34659 34660 // array of single index 34661 return [ obj ]; 34662 }; 34663 34664 // ----- removeFrom ----- // 34665 34666 utils.removeFrom = function( ary, obj ) { 34667 var index = ary.indexOf( obj ); 34668 if ( index != -1 ) { 34669 ary.splice( index, 1 ); 34670 } 34671 }; 34672 34673 // ----- getParent ----- // 34674 34675 utils.getParent = function( elem, selector ) { 34676 while ( elem.parentNode && elem != document.body ) { 34677 elem = elem.parentNode; 34678 if ( matchesSelector( elem, selector ) ) { 34679 return elem; 34680 } 34681 } 34682 }; 34683 34684 // ----- getQueryElement ----- // 34685 34686 // use element as selector string 34687 utils.getQueryElement = function( elem ) { 34688 if ( typeof elem == 'string' ) { 34689 return document.querySelector( elem ); 34690 } 34691 return elem; 34692 }; 34693 34694 // ----- handleEvent ----- // 34695 34696 // enable .ontype to trigger from .addEventListener( elem, 'type' ) 34697 utils.handleEvent = function( event ) { 34698 var method = 'on' + event.type; 34699 if ( this[ method ] ) { 34700 this[ method ]( event ); 34701 } 34702 }; 34703 34704 // ----- filterFindElements ----- // 34705 34706 utils.filterFindElements = function( elems, selector ) { 34707 // make array of elems 34708 elems = utils.makeArray( elems ); 34709 var ffElems = []; 34710 34711 elems.forEach( function( elem ) { 34712 // check that elem is an actual element 34713 if ( !( elem instanceof HTMLElement ) ) { 34714 return; 34715 } 34716 // add elem if no selector 34717 if ( !selector ) { 34718 ffElems.push( elem ); 34719 return; 34720 } 34721 // filter & find items if we have a selector 34722 // filter 34723 if ( matchesSelector( elem, selector ) ) { 34724 ffElems.push( elem ); 34725 } 34726 // find children 34727 var childElems = elem.querySelectorAll( selector ); 34728 // concat childElems to filterFound array 34729 for ( var i=0; i < childElems.length; i++ ) { 34730 ffElems.push( childElems[i] ); 34731 } 34732 }); 34733 34734 return ffElems; 34735 }; 34736 34737 // ----- debounceMethod ----- // 34738 34739 utils.debounceMethod = function( _class, methodName, threshold ) { 34740 threshold = threshold || 100; 34741 // original method 34742 var method = _class.prototype[ methodName ]; 34743 var timeoutName = methodName + 'Timeout'; 34744 34745 _class.prototype[ methodName ] = function() { 34746 var timeout = this[ timeoutName ]; 34747 clearTimeout( timeout ); 34748 34749 var args = arguments; 34750 var _this = this; 34751 this[ timeoutName ] = setTimeout( function() { 34752 method.apply( _this, args ); 34753 delete _this[ timeoutName ]; 34754 }, threshold ); 34755 }; 34756 }; 34757 34758 // ----- docReady ----- // 34759 34760 utils.docReady = function( callback ) { 34761 var readyState = document.readyState; 34762 if ( readyState == 'complete' || readyState == 'interactive' ) { 34763 // do async to allow for other scripts to run. metafizzy/flickity#441 34764 setTimeout( callback ); 34765 } else { 34766 document.addEventListener( 'DOMContentLoaded', callback ); 34767 } 34768 }; 34769 34770 // ----- htmlInit ----- // 34771 34772 // http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/ 34773 utils.toDashed = function( str ) { 34774 return str.replace( /(.)([A-Z])/g, function( match, $1, $2 ) { 34775 return $1 + '-' + $2; 34776 }).toLowerCase(); 34777 }; 34778 34779 var console = window.console; 34780 /** 34781 * allow user to initialize classes via [data-namespace] or .js-namespace class 34782 * htmlInit( Widget, 'widgetName' ) 34783 * options are parsed from data-namespace-options 34784 */ 34785 utils.htmlInit = function( WidgetClass, namespace ) { 34786 utils.docReady( function() { 34787 var dashedNamespace = utils.toDashed( namespace ); 34788 var dataAttr = 'data-' + dashedNamespace; 34789 var dataAttrElems = document.querySelectorAll( '[' + dataAttr + ']' ); 34790 var jsDashElems = document.querySelectorAll( '.js-' + dashedNamespace ); 34791 var elems = utils.makeArray( dataAttrElems ) 34792 .concat( utils.makeArray( jsDashElems ) ); 34793 var dataOptionsAttr = dataAttr + '-options'; 34794 var jQuery = window.jQuery; 34795 34796 elems.forEach( function( elem ) { 34797 var attr = elem.getAttribute( dataAttr ) || 34798 elem.getAttribute( dataOptionsAttr ); 34799 var options; 34800 try { 34801 options = attr && JSON.parse( attr ); 34802 } catch ( error ) { 34803 // log error, do not initialize 34804 if ( console ) { 34805 console.error( 'Error parsing ' + dataAttr + ' on ' + elem.className + 34806 ': ' + error ); 34807 } 34808 return; 34809 } 34810 // initialize 34811 var instance = new WidgetClass( elem, options ); 34812 // make available via $().data('namespace') 34813 if ( jQuery ) { 34814 jQuery.data( elem, namespace, instance ); 34815 } 34816 }); 34817 34818 }); 34819 }; 34820 34821 // ----- ----- // 34822 34823 return utils; 34824 34825 })); 34826 34827 34828/***/ }), 34829/* 343 */ 34830/***/ (function(module, exports, __webpack_require__) { 34831 34832 var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;/** 34833 * matchesSelector v2.0.2 34834 * matchesSelector( element, '.selector' ) 34835 * MIT license 34836 */ 34837 34838 /*jshint browser: true, strict: true, undef: true, unused: true */ 34839 34840 ( function( window, factory ) { 34841 /*global define: false, module: false */ 34842 'use strict'; 34843 // universal module definition 34844 if ( true ) { 34845 // AMD 34846 !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 34847 } else if ( typeof module == 'object' && module.exports ) { 34848 // CommonJS 34849 module.exports = factory(); 34850 } else { 34851 // browser global 34852 window.matchesSelector = factory(); 34853 } 34854 34855 }( window, function factory() { 34856 'use strict'; 34857 34858 var matchesMethod = ( function() { 34859 var ElemProto = window.Element.prototype;
34860 // check for the standard method name first 34861 if ( ElemProto.matches ) { 34862 return 'matches'; 34863 } 34864 // check un-prefixed 34865 if ( ElemProto.matchesSelector ) { 34866 return 'matchesSelector'; 34867 } 34868 // check vendor prefixes 34869 var prefixes = [ 'webkit', 'moz', 'ms', 'o' ]; 34870 34871 for ( var i=0; i < prefixes.length; i++ ) { 34872 var prefix = prefixes[i]; 34873 var method = prefix + 'MatchesSelector'; 34874 if ( ElemProto[ method ] ) { 34875 return method; 34876 } 34877 } 34878 })(); 34879 34880 return function matchesSelector( elem, selector ) { 34881 return elem[ matchesMethod ]( selector ); 34882 }; 34883 34884 })); 34885 34886 34887/***/ }), 34888/* 344 */ 34889/***/ (function(module, exports, __webpack_require__) { 34890 34891 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Flickity.Cell 34892 ( function( window, factory ) { 34893 // universal module definition 34894 if ( true ) { 34895 // AMD 34896 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 34897 __webpack_require__(341), 34898 ], __WEBPACK_AMD_DEFINE_RESULT__ = function( getSize ) { 34899 return factory( window, getSize ); 34900 }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 34901 } else if ( typeof module == 'object' && module.exports ) { 34902 // CommonJS 34903 module.exports = factory( 34904 window, 34905 require('get-size') 34906 ); 34907 } else { 34908 // browser global 34909 window.Flickity = window.Flickity || {}; 34910 window.Flickity.Cell = factory( 34911 window, 34912 window.getSize 34913 ); 34914 } 34915 34916 }( window, function factory( window, getSize ) { 34917 34918 'use strict'; 34919 34920 function Cell( elem, parent ) { 34921 this.element = elem; 34922 this.parent = parent; 34923 34924 this.create(); 34925 } 34926 34927 var proto = Cell.prototype; 34928 34929 proto.create = function() { 34930 this.element.style.position = 'absolute'; 34931 this.element.setAttribute( 'aria-hidden', 'true' ); 34932 this.x = 0; 34933 this.shift = 0; 34934 this.element.style[ this.parent.originSide ] = 0; 34935 }; 34936 34937 proto.destroy = function() { 34938 // reset style 34939 this.unselect(); 34940 this.element.style.position = ''; 34941 var side = this.parent.originSide; 34942 this.element.style[ side ] = ''; 34943 this.element.style.transform = ''; 34944 this.element.removeAttribute('aria-hidden'); 34945 }; 34946 34947 proto.getSize = function() { 34948 this.size = getSize( this.element ); 34949 }; 34950 34951 proto.setPosition = function( x ) { 34952 this.x = x; 34953 this.updateTarget(); 34954 this.renderPosition( x ); 34955 }; 34956 34957 // setDefaultTarget v1 method, backwards compatibility, remove in v3 34958 proto.updateTarget = proto.setDefaultTarget = function() { 34959 var marginProperty = this.parent.originSide == 'left' ? 'marginLeft' : 'marginRight'; 34960 this.target = this.x + this.size[ marginProperty ] + 34961 this.size.width * this.parent.cellAlign; 34962 }; 34963 34964 proto.renderPosition = function( x ) { 34965 // render position of cell with in slider 34966 var sideOffset = this.parent.originSide === 'left' ? 1 : -1; 34967 34968 var adjustedX = this.parent.options.percentPosition ? 34969 x * sideOffset * ( this.parent.size.innerWidth / this.size.width ) : 34970 x * sideOffset; 34971 34972 this.element.style.transform = 'translateX(' + 34973 this.parent.getPositionValue( adjustedX ) + ')'; 34974 }; 34975 34976 proto.select = function() { 34977 this.element.classList.add('is-selected'); 34978 this.element.removeAttribute('aria-hidden'); 34979 }; 34980 34981 proto.unselect = function() { 34982 this.element.classList.remove('is-selected'); 34983 this.element.setAttribute( 'aria-hidden', 'true' ); 34984 }; 34985 34986 /** 34987 * @param {Integer} shift - 0, 1, or -1 34988 */ 34989 proto.wrapShift = function( shift ) { 34990 this.shift = shift; 34991 this.renderPosition( this.x + this.parent.slideableWidth * shift ); 34992 }; 34993 34994 proto.remove = function() { 34995 this.element.parentNode.removeChild( this.element ); 34996 }; 34997 34998 return Cell; 34999 35000 } ) ); 35001 35002 35003/***/ }), 35004/* 345 */ 35005/***/ (function(module, exports, __webpack_require__) { 35006 35007 var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;// slide 35008 ( function( window, factory ) { 35009 // universal module definition 35010 if ( true ) { 35011 // AMD 35012 !(__WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.call(exports, __webpack_require__, exports, module)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 35013 } else if ( typeof module == 'object' && module.exports ) { 35014 // CommonJS 35015 module.exports = factory(); 35016 } else { 35017 // browser global 35018 window.Flickity = window.Flickity || {}; 35019 window.Flickity.Slide = factory(); 35020 } 35021 35022 }( window, function factory() { 35023 'use strict'; 35024 35025 function Slide( parent ) { 35026 this.parent = parent; 35027 this.isOriginLeft = parent.originSide == 'left'; 35028 this.cells = []; 35029 this.outerWidth = 0; 35030 this.height = 0; 35031 } 35032 35033 var proto = Slide.prototype; 35034 35035 proto.addCell = function( cell ) { 35036 this.cells.push( cell ); 35037 this.outerWidth += cell.size.outerWidth; 35038 this.height = Math.max( cell.size.outerHeight, this.height ); 35039 // first cell stuff 35040 if ( this.cells.length == 1 ) { 35041 this.x = cell.x; // x comes from first cell 35042 var beginMargin = this.isOriginLeft ? 'marginLeft' : 'marginRight'; 35043 this.firstMargin = cell.size[ beginMargin ]; 35044 } 35045 }; 35046 35047 proto.updateTarget = function() { 35048 var endMargin = this.isOriginLeft ? 'marginRight' : 'marginLeft'; 35049 var lastCell = this.getLastCell(); 35050 var lastMargin = lastCell ? lastCell.size[ endMargin ] : 0; 35051 var slideWidth = this.outerWidth - ( this.firstMargin + lastMargin ); 35052 this.target = this.x + this.firstMargin + slideWidth * this.parent.cellAlign; 35053 }; 35054 35055 proto.getLastCell = function() { 35056 return this.cells[ this.cells.length - 1 ]; 35057 }; 35058 35059 proto.select = function() {
35060 this.cells.forEach( function( cell ) { 35061 cell.select(); 35062 } ); 35063 }; 35064 35065 proto.unselect = function() { 35066 this.cells.forEach( function( cell ) { 35067 cell.unselect(); 35068 } ); 35069 }; 35070 35071 proto.getCellElements = function() { 35072 return this.cells.map( function( cell ) { 35073 return cell.element; 35074 } ); 35075 }; 35076 35077 return Slide; 35078 35079 } ) ); 35080 35081 35082/***/ }), 35083/* 346 */ 35084/***/ (function(module, exports, __webpack_require__) { 35085 35086 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// animate 35087 ( function( window, factory ) { 35088 // universal module definition 35089 if ( true ) { 35090 // AMD 35091 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 35092 __webpack_require__(342), 35093 ], __WEBPACK_AMD_DEFINE_RESULT__ = function( utils ) { 35094 return factory( window, utils ); 35095 }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 35096 } else if ( typeof module == 'object' && module.exports ) { 35097 // CommonJS 35098 module.exports = factory( 35099 window, 35100 require('fizzy-ui-utils') 35101 ); 35102 } else { 35103 // browser global 35104 window.Flickity = window.Flickity || {}; 35105 window.Flickity.animatePrototype = factory( 35106 window, 35107 window.fizzyUIUtils 35108 ); 35109 } 35110 35111 }( window, function factory( window, utils ) { 35112 35113 'use strict'; 35114 35115 // -------------------------- animate -------------------------- // 35116 35117 var proto = {}; 35118 35119 proto.startAnimation = function() { 35120 if ( this.isAnimating ) { 35121 return; 35122 } 35123 35124 this.isAnimating = true; 35125 this.restingFrames = 0; 35126 this.animate(); 35127 }; 35128 35129 proto.animate = function() { 35130 this.applyDragForce(); 35131 this.applySelectedAttraction(); 35132 35133 var previousX = this.x; 35134 35135 this.integratePhysics(); 35136 this.positionSlider(); 35137 this.settle( previousX ); 35138 // animate next frame 35139 if ( this.isAnimating ) { 35140 var _this = this; 35141 requestAnimationFrame( function animateFrame() { 35142 _this.animate(); 35143 } ); 35144 } 35145 }; 35146 35147 proto.positionSlider = function() { 35148 var x = this.x; 35149 // wrap position around 35150 if ( this.options.wrapAround && this.cells.length > 1 ) { 35151 x = utils.modulo( x, this.slideableWidth ); 35152 x -= this.slideableWidth; 35153 this.shiftWrapCells( x ); 35154 } 35155 35156 this.setTranslateX( x, this.isAnimating ); 35157 this.dispatchScrollEvent(); 35158 }; 35159 35160 proto.setTranslateX = function( x, is3d ) { 35161 x += this.cursorPosition; 35162 // reverse if right-to-left and using transform 35163 x = this.options.rightToLeft ? -x : x; 35164 var translateX = this.getPositionValue( x ); 35165 // use 3D transforms for hardware acceleration on iOS 35166 // but use 2D when settled, for better font-rendering 35167 this.slider.style.transform = is3d ? 35168 'translate3d(' + translateX + ',0,0)' : 'translateX(' + translateX + ')'; 35169 }; 35170 35171 proto.dispatchScrollEvent = function() { 35172 var firstSlide = this.slides[0]; 35173 if ( !firstSlide ) { 35174 return; 35175 } 35176 var positionX = -this.x - firstSlide.target; 35177 var progress = positionX / this.slidesWidth; 35178 this.dispatchEvent( 'scroll', null, [ progress, positionX ] ); 35179 }; 35180 35181 proto.positionSliderAtSelected = function() { 35182 if ( !this.cells.length ) { 35183 return; 35184 } 35185 this.x = -this.selectedSlide.target; 35186 this.velocity = 0; // stop wobble 35187 this.positionSlider(); 35188 }; 35189 35190 proto.getPositionValue = function( position ) { 35191 if ( this.options.percentPosition ) { 35192 // percent position, round to 2 digits, like 12.34% 35193 return ( Math.round( ( position / this.size.innerWidth ) * 10000 ) * 0.01 ) + '%'; 35194 } else { 35195 // pixel positioning 35196 return Math.round( position ) + 'px'; 35197 } 35198 }; 35199 35200 proto.settle = function( previousX ) { 35201 // keep track of frames where x hasn't moved 35202 var isResting = !this.isPointerDown && 35203 Math.round( this.x * 100 ) == Math.round( previousX * 100 ); 35204 if ( isResting ) { 35205 this.restingFrames++; 35206 } 35207 // stop animating if resting for 3 or more frames 35208 if ( this.restingFrames > 2 ) { 35209 this.isAnimating = false; 35210 delete this.isFreeScrolling; 35211 // render position with translateX when settled 35212 this.positionSlider(); 35213 this.dispatchEvent( 'settle', null, [ this.selectedIndex ] ); 35214 } 35215 }; 35216 35217 proto.shiftWrapCells = function( x ) { 35218 // shift before cells 35219 var beforeGap = this.cursorPosition + x; 35220 this._shiftCells( this.beforeShiftCells, beforeGap, -1 ); 35221 // shift after cells 35222 var afterGap = this.size.innerWidth - ( x + this.slideableWidth + this.cursorPosition ); 35223 this._shiftCells( this.afterShiftCells, afterGap, 1 ); 35224 }; 35225 35226 proto._shiftCells = function( cells, gap, shift ) { 35227 for ( var i = 0; i < cells.length; i++ ) { 35228 var cell = cells[i]; 35229 var cellShift = gap > 0 ? shift : 0; 35230 cell.wrapShift( cellShift ); 35231 gap -= cell.size.outerWidth; 35232 } 35233 }; 35234 35235 proto._unshiftCells = function( cells ) { 35236 if ( !cells || !cells.length ) { 35237 return; 35238 } 35239 for ( var i = 0; i < cells.length; i++ ) { 35240 cells[i].wrapShift( 0 ); 35241 } 35242 }; 35243 35244 // -------------------------- physics -------------------------- // 35245 35246 proto.integratePhysics = function() { 35247 this.x += this.velocity; 35248 this.velocity *= this.getFrictionFactor(); 35249 }; 35250 35251 proto.applyForce = function( force ) { 35252 this.velocity += force; 35253 }; 35254 35255 proto.getFrictionFactor = function() { 35256 return 1 - this.options[ this.isFreeScrolling ? 'freeScrollFriction' : 'friction' ]; 35257 }; 35258 35259 proto.getRestingPosition = function() { 35260 // my thanks to Steven Wittens, who simplified this math greatly 35261 return this.x + this.velocity / ( 1 - this.getFrictionFactor() ); 35262 }; 35263 35264 proto.applyDragForce = function() { 35265 if ( !this.isDraggable || !this.isPointerDown ) { 35266 return; 35267 } 35268 // change the position to drag position by applying force 35269 var dragVelocity = this.dragX - this.x; 35270 var dragForce = dragVelocity - this.velocity; 35271 this.applyForce( dragForce ); 35272 }; 35273 35274 proto.applySelectedAttraction = function() { 35275 // do not attract if pointer down or no slides 35276 var dragDown = this.isDraggable && this.isPointerDown; 35277 if ( dragDown || this.isFreeScrolling || !this.slides.length ) { 35278 return; 35279 } 35280 var distance = this.selectedSlide.target * -1 - this.x; 35281 var force = distance * this.options.selectedAttraction; 35282 this.applyForce( force ); 35283 }; 35284 35285 return proto; 35286 35287 } ) ); 35288 35289
vendor: 8,041 bytes, lines 35290-35560
35290/***/ }), 35291/* 347 */ 35292/***/ (function(module, exports, __webpack_require__) { 35293 35294 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// drag 35295 ( function( window, factory ) { 35296 // universal module definition 35297 if ( true ) { 35298 // AMD 35299 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 35300 __webpack_require__(339), 35301 __webpack_require__(348), 35302 __webpack_require__(342), 35303 ], __WEBPACK_AMD_DEFINE_RESULT__ = function( Flickity, Unidragger, utils ) { 35304 return factory( window, Flickity, Unidragger, utils ); 35305 }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 35306 } else if ( typeof module == 'object' && module.exports ) { 35307 // CommonJS 35308 module.exports = factory( 35309 window, 35310 require('./flickity'), 35311 require('unidragger'), 35312 require('fizzy-ui-utils') 35313 ); 35314 } else { 35315 // browser global 35316 window.Flickity = factory( 35317 window, 35318 window.Flickity, 35319 window.Unidragger, 35320 window.fizzyUIUtils 35321 ); 35322 } 35323 35324 }( window, function factory( window, Flickity, Unidragger, utils ) { 35325 35326 'use strict'; 35327 35328 // ----- defaults ----- // 35329 35330 utils.extend( Flickity.defaults, { 35331 draggable: '>1', 35332 dragThreshold: 3, 35333 } ); 35334 35335 // ----- create ----- // 35336 35337 Flickity.createMethods.push('_createDrag'); 35338 35339 // -------------------------- drag prototype -------------------------- // 35340 35341 var proto = Flickity.prototype; 35342 utils.extend( proto, Unidragger.prototype ); 35343 proto._touchActionValue = 'pan-y'; 35344 35345 // -------------------------- -------------------------- // 35346 35347 proto._createDrag = function() { 35348 this.on( 'activate', this.onActivateDrag ); 35349 this.on( 'uiChange', this._uiChangeDrag ); 35350 this.on( 'deactivate', this.onDeactivateDrag ); 35351 this.on( 'cellChange', this.updateDraggable ); 35352 // TODO updateDraggable on resize? if groupCells & slides change 35353 }; 35354 35355 proto.onActivateDrag = function() { 35356 this.handles = [ this.viewport ]; 35357 this.bindHandles(); 35358 this.updateDraggable(); 35359 }; 35360 35361 proto.onDeactivateDrag = function() { 35362 this.unbindHandles(); 35363 this.element.classList.remove('is-draggable'); 35364 }; 35365 35366 proto.updateDraggable = function() { 35367 // disable dragging if less than 2 slides. #278 35368 if ( this.options.draggable == '>1' ) { 35369 this.isDraggable = this.slides.length > 1; 35370 } else { 35371 this.isDraggable = this.options.draggable; 35372 } 35373 if ( this.isDraggable ) { 35374 this.element.classList.add('is-draggable'); 35375 } else { 35376 this.element.classList.remove('is-draggable'); 35377 } 35378 }; 35379 35380 // backwards compatibility 35381 proto.bindDrag = function() { 35382 this.options.draggable = true; 35383 this.updateDraggable(); 35384 }; 35385 35386 proto.unbindDrag = function() { 35387 this.options.draggable = false; 35388 this.updateDraggable(); 35389 }; 35390 35391 proto._uiChangeDrag = function() { 35392 delete this.isFreeScrolling; 35393 }; 35394 35395 // -------------------------- pointer events -------------------------- // 35396 35397 proto.pointerDown = function( event, pointer ) { 35398 if ( !this.isDraggable ) { 35399 this._pointerDownDefault( event, pointer ); 35400 return; 35401 } 35402 var isOkay = this.okayPointerDown( event ); 35403 if ( !isOkay ) { 35404 return; 35405 } 35406 35407 this._pointerDownPreventDefault( event ); 35408 this.pointerDownFocus( event ); 35409 // blur 35410 if ( document.activeElement != this.element ) { 35411 // do not blur if already focused 35412 this.pointerDownBlur(); 35413 } 35414 35415 // stop if it was moving 35416 this.dragX = this.x; 35417 this.viewport.classList.add('is-pointer-down'); 35418 // track scrolling 35419 this.pointerDownScroll = getScrollPosition(); 35420 window.addEventListener( 'scroll', this ); 35421 35422 this._pointerDownDefault( event, pointer ); 35423 }; 35424 35425 // default pointerDown logic, used for staticClick 35426 proto._pointerDownDefault = function( event, pointer ) { 35427 // track start event position 35428 // Safari 9 overrides pageX and pageY. These values needs to be copied. #779 35429 this.pointerDownPointer = { 35430 pageX: pointer.pageX, 35431 pageY: pointer.pageY, 35432 }; 35433 // bind move and end events 35434 this._bindPostStartEvents( event ); 35435 this.dispatchEvent( 'pointerDown', event, [ pointer ] ); 35436 }; 35437 35438 var focusNodes = { 35439 INPUT: true, 35440 TEXTAREA: true, 35441 SELECT: true, 35442 }; 35443 35444 proto.pointerDownFocus = function( event ) { 35445 var isFocusNode = focusNodes[ event.target.nodeName ]; 35446 if ( !isFocusNode ) { 35447 this.focus(); 35448 } 35449 }; 35450 35451 proto._pointerDownPreventDefault = function( event ) { 35452 var isTouchStart = event.type == 'touchstart'; 35453 var isTouchPointer = event.pointerType == 'touch'; 35454 var isFocusNode = focusNodes[ event.target.nodeName ]; 35455 if ( !isTouchStart && !isTouchPointer && !isFocusNode ) { 35456 event.preventDefault(); 35457 } 35458 }; 35459 35460 // ----- move ----- // 35461 35462 proto.hasDragStarted = function( moveVector ) { 35463 return Math.abs( moveVector.x ) > this.options.dragThreshold; 35464 }; 35465 35466 // ----- up ----- // 35467 35468 proto.pointerUp = function( event, pointer ) { 35469 delete this.isTouchScrolling; 35470 this.viewport.classList.remove('is-pointer-down'); 35471 this.dispatchEvent( 'pointerUp', event, [ pointer ] ); 35472 this._dragPointerUp( event, pointer ); 35473 }; 35474 35475 proto.pointerDone = function() { 35476 window.removeEventListener( 'scroll', this ); 35477 delete this.pointerDownScroll; 35478 }; 35479 35480 // -------------------------- dragging -------------------------- // 35481 35482 proto.dragStart = function( event, pointer ) { 35483 if ( !this.isDraggable ) { 35484 return; 35485 } 35486 this.dragStartPosition = this.x; 35487 this.startAnimation(); 35488 window.removeEventListener( 'scroll', this ); 35489 this.dispatchEvent( 'dragStart', event, [ pointer ] ); 35490 }; 35491 35492 proto.pointerMove = function( event, pointer ) { 35493 var moveVector = this._dragPointerMove( event, pointer ); 35494 this.dispatchEvent( 'pointerMove', event, [ pointer, moveVector ] ); 35495 this._dragMove( event, pointer, moveVector ); 35496 }; 35497 35498 proto.dragMove = function( event, pointer, moveVector ) { 35499 if ( !this.isDraggable ) { 35500 return; 35501 } 35502 event.preventDefault(); 35503 35504 this.previousDragX = this.dragX; 35505 // reverse if right-to-left 35506 var direction = this.options.rightToLeft ? -1 : 1; 35507 if ( this.options.wrapAround ) { 35508 // wrap around move. #589 35509 moveVector.x %= this.slideableWidth; 35510 } 35511 var dragX = this.dragStartPosition + moveVector.x * direction; 35512 35513 if ( !this.options.wrapAround && this.slides.length ) { 35514 // slow drag 35515 var originBound = Math.max( -this.slides[0].target, this.dragStartPosition ); 35516 dragX = dragX > originBound ? ( dragX + originBound ) * 0.5 : dragX; 35517 var endBound = Math.min( -this.getLastSlide().target, this.dragStartPosition ); 35518 dragX = dragX < endBound ? ( dragX + endBound ) * 0.5 : dragX; 35519 } 35520 35521 this.dragX = dragX; 35522 35523 this.dragMoveTime = new Date(); 35524 this.dispatchEvent( 'dragMove', event, [ pointer, moveVector ] ); 35525 }; 35526 35527 proto.dragEnd = function( event, pointer ) { 35528 if ( !this.isDraggable ) { 35529 return; 35530 } 35531 if ( this.options.freeScroll ) { 35532 this.isFreeScrolling = true; 35533 } 35534 // set selectedIndex based on where flick will end up 35535 var index = this.dragEndRestingSelect(); 35536 35537 if ( this.options.freeScroll && !this.options.wrapAround ) { 35538 // if free-scroll & not wrap around 35539 // do not free-scroll if going outside of bounding slides 35540 // so bounding slides can attract slider, and keep it in bounds 35541 var restingX = this.getRestingPosition(); 35542 this.isFreeScrolling = -restingX > this.slides[0].target && 35543 -restingX < this.getLastSlide().target; 35544 } else if ( !this.options.freeScroll && index == this.selectedIndex ) { 35545 // boost selection if selected index has not changed 35546 index += this.dragEndBoostSelect(); 35547 } 35548 delete this.previousDragX; 35549 // apply selection 35550 // TODO refactor this, selecting here feels weird 35551 // HACK, set flag so dragging stays in correct direction 35552 this.isDragSelect = this.options.wrapAround; 35553 this.select( index ); 35554 delete this.isDragSelect; 35555 this.dispatchEvent( 'dragEnd', event, [ pointer ] ); 35556 }; 35557 35558 proto.dragEndRestingSelect = function() { 35559 var restingX = this.getRestingPosition(); 35560 // how far away from selected slide
35561 var distance = Math.abs( this.getSlideDistance( -restingX, this.selectedIndex ) ); 35562 // get closet resting going up and going down 35563 var positiveResting = this._getClosestResting( restingX, distance, 1 ); 35564 var negativeResting = this._getClosestResting( restingX, distance, -1 ); 35565 // use closer resting for wrap-around 35566 var index = positiveResting.distance < negativeResting.distance ? 35567 positiveResting.index : negativeResting.index; 35568 return index; 35569 }; 35570 35571 /** 35572 * given resting X and distance to selected cell 35573 * get the distance and index of the closest cell 35574 * @param {Number} restingX - estimated post-flick resting position 35575 * @param {Number} distance - distance to selected cell 35576 * @param {Integer} increment - +1 or -1, going up or down 35577 * @returns {Object} - { distance: {Number}, index: {Integer} } 35578 */ 35579 proto._getClosestResting = function( restingX, distance, increment ) { 35580 var index = this.selectedIndex; 35581 var minDistance = Infinity; 35582 var condition = this.options.contain && !this.options.wrapAround ? 35583 // if contain, keep going if distance is equal to minDistance 35584 function( dist, minDist ) { 35585 return dist <= minDist; 35586 } : function( dist, minDist ) { 35587 return dist < minDist; 35588 }; 35589 while ( condition( distance, minDistance ) ) { 35590 // measure distance to next cell 35591 index += increment; 35592 minDistance = distance; 35593 distance = this.getSlideDistance( -restingX, index ); 35594 if ( distance === null ) { 35595 break; 35596 } 35597 distance = Math.abs( distance ); 35598 } 35599 return { 35600 distance: minDistance, 35601 // selected was previous index 35602 index: index - increment, 35603 }; 35604 }; 35605 35606 /** 35607 * measure distance between x and a slide target 35608 * @param {Number} x - horizontal position 35609 * @param {Integer} index - slide index 35610 * @returns {Number} - slide distance 35611 */ 35612 proto.getSlideDistance = function( x, index ) { 35613 var len = this.slides.length; 35614 // wrap around if at least 2 slides 35615 var isWrapAround = this.options.wrapAround && len > 1; 35616 var slideIndex = isWrapAround ? utils.modulo( index, len ) : index; 35617 var slide = this.slides[ slideIndex ]; 35618 if ( !slide ) { 35619 return null; 35620 } 35621 // add distance for wrap-around slides 35622 var wrap = isWrapAround ? this.slideableWidth * Math.floor( index/len ) : 0; 35623 return x - ( slide.target + wrap ); 35624 }; 35625 35626 proto.dragEndBoostSelect = function() { 35627 // do not boost if no previousDragX or dragMoveTime 35628 if ( this.previousDragX === undefined || !this.dragMoveTime || 35629 // or if drag was held for 100 ms 35630 new Date() - this.dragMoveTime > 100 ) { 35631 return 0; 35632 } 35633 35634 var distance = this.getSlideDistance( -this.dragX, this.selectedIndex ); 35635 var delta = this.previousDragX - this.dragX; 35636 if ( distance > 0 && delta > 0 ) { 35637 // boost to next if moving towards the right, and positive velocity 35638 return 1; 35639 } else if ( distance < 0 && delta < 0 ) { 35640 // boost to previous if moving towards the left, and negative velocity 35641 return -1; 35642 } 35643 return 0; 35644 }; 35645 35646 // ----- staticClick ----- // 35647 35648 proto.staticClick = function( event, pointer ) { 35649 // get clickedCell, if cell was clicked 35650 var clickedCell = this.getParentCell( event.target ); 35651 var cellElem = clickedCell && clickedCell.element; 35652 var cellIndex = clickedCell && this.cells.indexOf( clickedCell ); 35653 this.dispatchEvent( 'staticClick', event, [ pointer, cellElem, cellIndex ] ); 35654 }; 35655 35656 // ----- scroll ----- // 35657 35658 proto.onscroll = function() { 35659 var scroll = getScrollPosition(); 35660 var scrollMoveX = this.pointerDownScroll.x - scroll.x; 35661 var scrollMoveY = this.pointerDownScroll.y - scroll.y; 35662 // cancel click/tap if scroll is too much 35663 if ( Math.abs( scrollMoveX ) > 3 || Math.abs( scrollMoveY ) > 3 ) { 35664 this._pointerDone(); 35665 } 35666 }; 35667 35668 // ----- utils ----- // 35669 35670 function getScrollPosition() { 35671 return { 35672 x: window.pageXOffset, 35673 y: window.pageYOffset, 35674 }; 35675 } 35676 35677 // ----- ----- // 35678 35679 return Flickity; 35680 35681 } ) ); 35682 35683 35684/***/ }), 35685/* 348 */ 35686/***/ (function(module, exports, __webpack_require__) { 35687 35688 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 35689 * Unidragger v2.4.0 35690 * Draggable base class 35691 * MIT license 35692 */ 35693 35694 /*jshint browser: true, unused: true, undef: true, strict: true */ 35695 35696 ( function( window, factory ) { 35697 // universal module definition 35698 /*jshint strict: false */ /*globals define, module, require */ 35699 35700 if ( true ) { 35701 // AMD 35702 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 35703 __webpack_require__(349) 35704 ], __WEBPACK_AMD_DEFINE_RESULT__ = function( Unipointer ) { 35705 return factory( window, Unipointer ); 35706 }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 35707 } else if ( typeof module == 'object' && module.exports ) { 35708 // CommonJS 35709 module.exports = factory( 35710 window, 35711 require('unipointer') 35712 ); 35713 } else { 35714 // browser global 35715 window.Unidragger = factory( 35716 window, 35717 window.Unipointer 35718 ); 35719 } 35720 35721 }( window, function factory( window, Unipointer ) { 35722 35723 'use strict'; 35724 35725 // -------------------------- Unidragger -------------------------- // 35726 35727 function Unidragger() {} 35728 35729 // inherit Unipointer & EvEmitter 35730 var proto = Unidragger.prototype = Object.create( Unipointer.prototype ); 35731 35732 // ----- bind start ----- // 35733 35734 proto.bindHandles = function() { 35735 this._bindHandles( true ); 35736 }; 35737 35738 proto.unbindHandles = function() { 35739 this._bindHandles( false ); 35740 }; 35741 35742 /** 35743 * Add or remove start event 35744 * @param {Boolean} isAdd 35745 */ 35746 proto._bindHandles = function( isAdd ) { 35747 // munge isAdd, default to true 35748 isAdd = isAdd === undefined ? true : isAdd; 35749 // bind each handle 35750 var bindMethod = isAdd ? 'addEventListener' : 'removeEventListener'; 35751 var touchAction = isAdd ? this._touchActionValue : ''; 35752 for ( var i=0; i < this.handles.length; i++ ) { 35753 var handle = this.handles[i]; 35754 this._bindStartEvent( handle, isAdd ); 35755 handle[ bindMethod ]( 'click', this ); 35756 // touch-action: none to override browser touch gestures. metafizzy/flickity#540 35757 if ( window.PointerEvent ) { 35758 handle.style.touchAction = touchAction; 35759 } 35760 } 35761 }; 35762
35763 // prototype so it can be overwriteable by Flickity 35764 proto._touchActionValue = 'none'; 35765 35766 // ----- start event ----- // 35767 35768 /** 35769 * pointer start 35770 * @param {Event} event 35771 * @param {Event or Touch} pointer 35772 */ 35773 proto.pointerDown = function( event, pointer ) { 35774 var isOkay = this.okayPointerDown( event ); 35775 if ( !isOkay ) { 35776 return; 35777 } 35778 // track start event position 35779 // Safari 9 overrides pageX and pageY. These values needs to be copied. flickity#842 35780 this.pointerDownPointer = { 35781 pageX: pointer.pageX, 35782 pageY: pointer.pageY, 35783 }; 35784 35785 event.preventDefault(); 35786 this.pointerDownBlur(); 35787 // bind move and end events 35788 this._bindPostStartEvents( event ); 35789 this.emitEvent( 'pointerDown', [ event, pointer ] ); 35790 }; 35791 35792 // nodes that have text fields 35793 var cursorNodes = { 35794 TEXTAREA: true, 35795 INPUT: true, 35796 SELECT: true, 35797 OPTION: true, 35798 }; 35799 35800 // input types that do not have text fields 35801 var clickTypes = { 35802 radio: true, 35803 checkbox: true, 35804 button: true, 35805 submit: true, 35806 image: true, 35807 file: true, 35808 }; 35809 35810 // dismiss inputs with text fields. flickity#403, flickity#404 35811 proto.okayPointerDown = function( event ) { 35812 var isCursorNode = cursorNodes[ event.target.nodeName ]; 35813 var isClickType = clickTypes[ event.target.type ]; 35814 var isOkay = !isCursorNode || isClickType; 35815 if ( !isOkay ) { 35816 this._pointerReset(); 35817 } 35818 return isOkay; 35819 }; 35820 35821 // kludge to blur previously focused input 35822 proto.pointerDownBlur = function() { 35823 var focused = document.activeElement; 35824 // do not blur body for IE10, metafizzy/flickity#117 35825 var canBlur = focused && focused.blur && focused != document.body; 35826 if ( canBlur ) { 35827 focused.blur(); 35828 } 35829 }; 35830 35831 // ----- move event ----- // 35832 35833 /** 35834 * drag move 35835 * @param {Event} event 35836 * @param {Event or Touch} pointer 35837 */ 35838 proto.pointerMove = function( event, pointer ) { 35839 var moveVector = this._dragPointerMove( event, pointer ); 35840 this.emitEvent( 'pointerMove', [ event, pointer, moveVector ] ); 35841 this._dragMove( event, pointer, moveVector ); 35842 }; 35843 35844 // base pointer move logic 35845 proto._dragPointerMove = function( event, pointer ) { 35846 var moveVector = { 35847 x: pointer.pageX - this.pointerDownPointer.pageX, 35848 y: pointer.pageY - this.pointerDownPointer.pageY 35849 }; 35850 // start drag if pointer has moved far enough to start drag 35851 if ( !this.isDragging && this.hasDragStarted( moveVector ) ) { 35852 this._dragStart( event, pointer ); 35853 } 35854 return moveVector; 35855 }; 35856 35857 // condition if pointer has moved far enough to start drag 35858 proto.hasDragStarted = function( moveVector ) { 35859 return Math.abs( moveVector.x ) > 3 || Math.abs( moveVector.y ) > 3; 35860 }; 35861 35862 // ----- end event ----- // 35863 35864 /** 35865 * pointer up 35866 * @param {Event} event 35867 * @param {Event or Touch} pointer 35868 */ 35869 proto.pointerUp = function( event, pointer ) { 35870 this.emitEvent( 'pointerUp', [ event, pointer ] ); 35871 this._dragPointerUp( event, pointer ); 35872 }; 35873 35874 proto._dragPointerUp = function( event, pointer ) { 35875 if ( this.isDragging ) { 35876 this._dragEnd( event, pointer ); 35877 } else { 35878 // pointer didn't move enough for drag to start 35879 this._staticClick( event, pointer ); 35880 } 35881 }; 35882 35883 // -------------------------- drag -------------------------- // 35884 35885 // dragStart 35886 proto._dragStart = function( event, pointer ) { 35887 this.isDragging = true; 35888 // prevent clicks
35889 this.isPreventingClicks = true; 35890 this.dragStart( event, pointer ); 35891 }; 35892 35893 proto.dragStart = function( event, pointer ) { 35894 this.emitEvent( 'dragStart', [ event, pointer ] ); 35895 }; 35896 35897 // dragMove 35898 proto._dragMove = function( event, pointer, moveVector ) { 35899 // do not drag if not dragging yet 35900 if ( !this.isDragging ) { 35901 return; 35902 } 35903 35904 this.dragMove( event, pointer, moveVector ); 35905 }; 35906 35907 proto.dragMove = function( event, pointer, moveVector ) { 35908 event.preventDefault(); 35909 this.emitEvent( 'dragMove', [ event, pointer, moveVector ] ); 35910 }; 35911 35912 // dragEnd 35913 proto._dragEnd = function( event, pointer ) { 35914 // set flags 35915 this.isDragging = false; 35916 // re-enable clicking async 35917 setTimeout( function() { 35918 delete this.isPreventingClicks; 35919 }.bind( this ) ); 35920 35921 this.dragEnd( event, pointer ); 35922 }; 35923 35924 proto.dragEnd = function( event, pointer ) { 35925 this.emitEvent( 'dragEnd', [ event, pointer ] ); 35926 }; 35927 35928 // ----- onclick ----- // 35929 35930 // handle all clicks and prevent clicks when dragging 35931 proto.onclick = function( event ) {
vendor: 5,183 bytes, lines 35932-36126
35932 if ( this.isPreventingClicks ) { 35933 event.preventDefault(); 35934 } 35935 }; 35936 35937 // ----- staticClick ----- // 35938 35939 // triggered after pointer down & up with no/tiny movement 35940 proto._staticClick = function( event, pointer ) { 35941 // ignore emulated mouse up clicks 35942 if ( this.isIgnoringMouseUp && event.type == 'mouseup' ) { 35943 return; 35944 } 35945 35946 this.staticClick( event, pointer ); 35947 35948 // set flag for emulated clicks 300ms after touchend 35949 if ( event.type != 'mouseup' ) { 35950 this.isIgnoringMouseUp = true; 35951 // reset flag after 300ms 35952 setTimeout( function() { 35953 delete this.isIgnoringMouseUp; 35954 }.bind( this ), 400 ); 35955 } 35956 }; 35957 35958 proto.staticClick = function( event, pointer ) { 35959 this.emitEvent( 'staticClick', [ event, pointer ] ); 35960 }; 35961 35962 // ----- utils ----- // 35963 35964 Unidragger.getPointerPoint = Unipointer.getPointerPoint; 35965 35966 // ----- ----- // 35967 35968 return Unidragger; 35969 35970 })); 35971 35972 35973/***/ }), 35974/* 349 */ 35975/***/ (function(module, exports, __webpack_require__) { 35976 35977 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 35978 * Unipointer v2.4.0 35979 * base class for doing one thing with pointer event 35980 * MIT license 35981 */ 35982 35983 /*jshint browser: true, undef: true, unused: true, strict: true */ 35984 35985 ( function( window, factory ) { 35986 // universal module definition 35987 /* jshint strict: false */ /*global define, module, require */ 35988 if ( true ) { 35989 // AMD 35990 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 35991 __webpack_require__(340) 35992 ], __WEBPACK_AMD_DEFINE_RESULT__ = function( EvEmitter ) { 35993 return factory( window, EvEmitter ); 35994 }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 35995 } else if ( typeof module == 'object' && module.exports ) { 35996 // CommonJS 35997 module.exports = factory( 35998 window, 35999 require('ev-emitter') 36000 ); 36001 } else { 36002 // browser global 36003 window.Unipointer = factory( 36004 window, 36005 window.EvEmitter 36006 ); 36007 } 36008 36009 }( window, function factory( window, EvEmitter ) { 36010 36011 'use strict'; 36012 36013 function noop() {} 36014 36015 function Unipointer() {} 36016 36017 // inherit EvEmitter 36018 var proto = Unipointer.prototype = Object.create( EvEmitter.prototype ); 36019 36020 proto.bindStartEvent = function( elem ) { 36021 this._bindStartEvent( elem, true ); 36022 }; 36023 36024 proto.unbindStartEvent = function( elem ) { 36025 this._bindStartEvent( elem, false ); 36026 }; 36027 36028 /** 36029 * Add or remove start event 36030 * @param {Boolean} isAdd - remove if falsey 36031 */ 36032 proto._bindStartEvent = function( elem, isAdd ) { 36033 // munge isAdd, default to true 36034 isAdd = isAdd === undefined ? true : isAdd; 36035 var bindMethod = isAdd ? 'addEventListener' : 'removeEventListener'; 36036 36037 // default to mouse events 36038 var startEvent = 'mousedown'; 36039 if ( 'ontouchstart' in window ) { 36040 // HACK prefer Touch Events as you can preventDefault on touchstart to 36041 // disable scroll in iOS & mobile Chrome metafizzy/flickity#1177 36042 startEvent = 'touchstart'; 36043 } else if ( window.PointerEvent ) { 36044 // Pointer Events 36045 startEvent = 'pointerdown'; 36046 } 36047 elem[ bindMethod ]( startEvent, this ); 36048 }; 36049 36050 // trigger handler methods for events 36051 proto.handleEvent = function( event ) { 36052 var method = 'on' + event.type; 36053 if ( this[ method ] ) { 36054 this[ method ]( event ); 36055 } 36056 }; 36057 36058 // returns the touch that we're keeping track of 36059 proto.getTouch = function( touches ) { 36060 for ( var i=0; i < touches.length; i++ ) { 36061 var touch = touches[i]; 36062 if ( touch.identifier == this.pointerIdentifier ) { 36063 return touch; 36064 } 36065 } 36066 }; 36067 36068 // ----- start event ----- // 36069 36070 proto.onmousedown = function( event ) { 36071 // dismiss clicks from right or middle buttons 36072 var button = event.button; 36073 if ( button && ( button !== 0 && button !== 1 ) ) { 36074 return; 36075 } 36076 this._pointerDown( event, event ); 36077 }; 36078 36079 proto.ontouchstart = function( event ) { 36080 this._pointerDown( event, event.changedTouches[0] ); 36081 }; 36082 36083 proto.onpointerdown = function( event ) { 36084 this._pointerDown( event, event ); 36085 }; 36086 36087 /** 36088 * pointer start 36089 * @param {Event} event 36090 * @param {Event or Touch} pointer 36091 */ 36092 proto._pointerDown = function( event, pointer ) { 36093 // dismiss right click and other pointers 36094 // button = 0 is okay, 1-4 not 36095 if ( event.button || this.isPointerDown ) { 36096 return; 36097 } 36098 36099 this.isPointerDown = true; 36100 // save pointer identifier to match up touch events 36101 this.pointerIdentifier = pointer.pointerId !== undefined ? 36102 // pointerId for pointer events, touch.indentifier for touch events 36103 pointer.pointerId : pointer.identifier; 36104 36105 this.pointerDown( event, pointer ); 36106 }; 36107 36108 proto.pointerDown = function( event, pointer ) { 36109 this._bindPostStartEvents( event ); 36110 this.emitEvent( 'pointerDown', [ event, pointer ] ); 36111 }; 36112 36113 // hash of events to be bound after start event 36114 var postStartEvents = { 36115 mousedown: [ 'mousemove', 'mouseup' ], 36116 touchstart: [ 'touchmove', 'touchend', 'touchcancel' ], 36117 pointerdown: [ 'pointermove', 'pointerup', 'pointercancel' ], 36118 }; 36119 36120 proto._bindPostStartEvents = function( event ) { 36121 if ( !event ) { 36122 return; 36123 } 36124 // get proper events to match start event 36125 var events = postStartEvents[ event.type ]; 36126 // bind events to node
36127 events.forEach( function( eventName ) { 36128 window.addEventListener( eventName, this ); 36129 }, this ); 36130 // save these arguments 36131 this._boundPointerEvents = events; 36132 }; 36133 36134 proto._unbindPostStartEvents = function() { 36135 // check for _boundEvents, in case dragEnd triggered twice (old IE8 bug) 36136 if ( !this._boundPointerEvents ) { 36137 return; 36138 } 36139 this._boundPointerEvents.forEach( function( eventName ) { 36140 window.removeEventListener( eventName, this ); 36141 }, this ); 36142 36143 delete this._boundPointerEvents; 36144 }; 36145 36146 // ----- move event ----- // 36147 36148 proto.onmousemove = function( event ) { 36149 this._pointerMove( event, event ); 36150 }; 36151 36152 proto.onpointermove = function( event ) { 36153 if ( event.pointerId == this.pointerIdentifier ) { 36154 this._pointerMove( event, event ); 36155 } 36156 }; 36157 36158 proto.ontouchmove = function( event ) { 36159 var touch = this.getTouch( event.changedTouches ); 36160 if ( touch ) { 36161 this._pointerMove( event, touch ); 36162 } 36163 }; 36164 36165 /** 36166 * pointer move 36167 * @param {Event} event 36168 * @param {Event or Touch} pointer 36169 * @private 36170 */ 36171 proto._pointerMove = function( event, pointer ) { 36172 this.pointerMove( event, pointer ); 36173 }; 36174 36175 // public 36176 proto.pointerMove = function( event, pointer ) { 36177 this.emitEvent( 'pointerMove', [ event, pointer ] ); 36178 }; 36179 36180 // ----- end event ----- // 36181 36182 36183 proto.onmouseup = function( event ) { 36184 this._pointerUp( event, event ); 36185 }; 36186 36187 proto.onpointerup = function( event ) { 36188 if ( event.pointerId == this.pointerIdentifier ) { 36189 this._pointerUp( event, event ); 36190 } 36191 }; 36192 36193 proto.ontouchend = function( event ) { 36194 var touch = this.getTouch( event.changedTouches ); 36195 if ( touch ) { 36196 this._pointerUp( event, touch ); 36197 } 36198 }; 36199 36200 /** 36201 * pointer up 36202 * @param {Event} event 36203 * @param {Event or Touch} pointer 36204 * @private 36205 */ 36206 proto._pointerUp = function( event, pointer ) { 36207 this._pointerDone(); 36208 this.pointerUp( event, pointer ); 36209 }; 36210 36211 // public 36212 proto.pointerUp = function( event, pointer ) { 36213 this.emitEvent( 'pointerUp', [ event, pointer ] ); 36214 }; 36215 36216 // ----- pointer done ----- // 36217 36218 // triggered on pointer up & pointer cancel 36219 proto._pointerDone = function() { 36220 this._pointerReset(); 36221 this._unbindPostStartEvents(); 36222 this.pointerDone(); 36223 }; 36224 36225 proto._pointerReset = function() { 36226 // reset properties 36227 this.isPointerDown = false; 36228 delete this.pointerIdentifier; 36229 }; 36230 36231 proto.pointerDone = noop; 36232 36233 // ----- pointer cancel ----- // 36234 36235 proto.onpointercancel = function( event ) { 36236 if ( event.pointerId == this.pointerIdentifier ) { 36237 this._pointerCancel( event, event ); 36238 } 36239 }; 36240 36241 proto.ontouchcancel = function( event ) { 36242 var touch = this.getTouch( event.changedTouches ); 36243 if ( touch ) { 36244 this._pointerCancel( event, touch ); 36245 } 36246 }; 36247 36248 /** 36249 * pointer cancel 36250 * @param {Event} event 36251 * @param {Event or Touch} pointer 36252 * @private 36253 */ 36254 proto._pointerCancel = function( event, pointer ) { 36255 this._pointerDone(); 36256 this.pointerCancel( event, pointer ); 36257 }; 36258 36259 // public 36260 proto.pointerCancel = function( event, pointer ) { 36261 this.emitEvent( 'pointerCancel', [ event, pointer ] ); 36262 }; 36263 36264 // ----- ----- // 36265 36266 // utility function for getting x/y coords from event 36267 Unipointer.getPointerPoint = function( pointer ) { 36268 return { 36269 x: pointer.pageX, 36270 y: pointer.pageY 36271 }; 36272 }; 36273 36274 // ----- ----- // 36275 36276 return Unipointer; 36277 36278 })); 36279 36280 36281/***/ }), 36282/* 350 */ 36283/***/ (function(module, exports, __webpack_require__) { 36284 36285 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// prev/next buttons 36286 ( function( window, factory ) { 36287 // universal module definition 36288 if ( true ) { 36289 // AMD 36290 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 36291 __webpack_require__(339), 36292 __webpack_require__(349), 36293 __webpack_require__(342), 36294 ], __WEBPACK_AMD_DEFINE_RESULT__ = function( Flickity, Unipointer, utils ) { 36295 return factory( window, Flickity, Unipointer, utils ); 36296 }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 36297 } else if ( typeof module == 'object' && module.exports ) { 36298 // CommonJS 36299 module.exports = factory( 36300 window, 36301 require('./flickity'), 36302 require('unipointer'), 36303 require('fizzy-ui-utils') 36304 ); 36305 } else { 36306 // browser global 36307 factory( 36308 window, 36309 window.Flickity, 36310 window.Unipointer, 36311 window.fizzyUIUtils 36312 ); 36313 } 36314 36315 }( window, function factory( window, Flickity, Unipointer, utils ) { 36316 'use strict'; 36317 36318 var svgURI = 'http://www.w3.org/2000/svg'; 36319 36320 // -------------------------- PrevNextButton -------------------------- // 36321 36322 function PrevNextButton( direction, parent ) { 36323 this.direction = direction; 36324 this.parent = parent; 36325 this._create(); 36326 } 36327 36328 PrevNextButton.prototype = Object.create( Unipointer.prototype ); 36329 36330 PrevNextButton.prototype._create = function() { 36331 // properties 36332 this.isEnabled = true; 36333 this.isPrevious = this.direction == -1; 36334 var leftDirection = this.parent.options.rightToLeft ? 1 : -1; 36335 this.isLeft = this.direction == leftDirection; 36336 36337 var element = this.element = document.createElement('button'); 36338 element.className = 'flickity-button flickity-prev-next-button'; 36339 element.className += this.isPrevious ? ' previous' : ' next'; 36340 // prevent button from submitting form http://stackoverflow.com/a/10836076/182183 36341 element.setAttribute( 'type', 'button' ); 36342 // init as disabled 36343 this.disable(); 36344 36345 element.setAttribute( 'aria-label', this.isPrevious ? 'Previous' : 'Next' ); 36346 36347 // create arrow 36348 var svg = this.createSVG(); 36349 element.appendChild( svg ); 36350 // events 36351 this.parent.on( 'select', this.update.bind( this ) ); 36352 this.on( 'pointerDown', this.parent.childUIPointerDown.bind( this.parent ) ); 36353 }; 36354 36355 PrevNextButton.prototype.activate = function() { 36356 this.bindStartEvent( this.element ); 36357 this.element.addEventListener( 'click', this ); 36358 // add to DOM 36359 this.parent.element.appendChild( this.element ); 36360 }; 36361 36362 PrevNextButton.prototype.deactivate = function() { 36363 // remove from DOM 36364 this.parent.element.removeChild( this.element ); 36365 // click events 36366 this.unbindStartEvent( this.element ); 36367 this.element.removeEventListener( 'click', this ); 36368 }; 36369 36370 PrevNextButton.prototype.createSVG = function() { 36371 var svg = document.createElementNS( svgURI, 'svg' ); 36372 svg.setAttribute( 'class', 'flickity-button-icon' ); 36373 svg.setAttribute( 'viewBox', '0 0 100 100' ); 36374 var path = document.createElementNS( svgURI, 'path' ); 36375 var pathMovements = getArrowMovements( this.parent.options.arrowShape ); 36376 path.setAttribute( 'd', pathMovements ); 36377 path.setAttribute( 'class', 'arrow' ); 36378 // rotate arrow 36379 if ( !this.isLeft ) { 36380 path.setAttribute( 'transform', 'translate(100, 100) rotate(180) ' ); 36381 } 36382 svg.appendChild( path ); 36383 return svg; 36384 }; 36385 36386 // get SVG path movmement 36387 function getArrowMovements( shape ) { 36388 // use shape as movement if string 36389 if ( typeof shape == 'string' ) { 36390 return shape; 36391 } 36392 // create movement string 36393 return 'M ' + shape.x0 + ',50' + 36394 ' L ' + shape.x1 + ',' + ( shape.y1 + 50 ) + 36395 ' L ' + shape.x2 + ',' + ( shape.y2 + 50 ) + 36396 ' L ' + shape.x3 + ',50 ' + 36397 ' L ' + shape.x2 + ',' + ( 50 - shape.y2 ) + 36398 ' L ' + shape.x1 + ',' + ( 50 - shape.y1 ) + 36399 ' Z'; 36400 } 36401 36402 PrevNextButton.prototype.handleEvent = utils.handleEvent; 36403 36404 PrevNextButton.prototype.onclick = function() { 36405 if ( !this.isEnabled ) { 36406 return; 36407 } 36408 this.parent.uiChange(); 36409 var method = this.isPrevious ? 'previous' : 'next'; 36410 this.parent[ method ](); 36411 }; 36412 36413 // ----- ----- // 36414 36415 PrevNextButton.prototype.enable = function() { 36416 if ( this.isEnabled ) { 36417 return; 36418 } 36419 this.element.disabled = false;
36420 this.isEnabled = true; 36421 }; 36422 36423 PrevNextButton.prototype.disable = function() { 36424 if ( !this.isEnabled ) { 36425 return; 36426 } 36427 this.element.disabled = true; 36428 this.isEnabled = false; 36429 }; 36430 36431 PrevNextButton.prototype.update = function() { 36432 // index of first or last slide, if previous or next 36433 var slides = this.parent.slides; 36434 // enable is wrapAround and at least 2 slides 36435 if ( this.parent.options.wrapAround && slides.length > 1 ) { 36436 this.enable(); 36437 return; 36438 } 36439 var lastIndex = slides.length ? slides.length - 1 : 0; 36440 var boundIndex = this.isPrevious ? 0 : lastIndex; 36441 var method = this.parent.selectedIndex == boundIndex ? 'disable' : 'enable'; 36442 this[ method ](); 36443 }; 36444 36445 PrevNextButton.prototype.destroy = function() { 36446 this.deactivate(); 36447 this.allOff(); 36448 }; 36449 36450 // -------------------------- Flickity prototype -------------------------- // 36451 36452 utils.extend( Flickity.defaults, { 36453 prevNextButtons: true, 36454 arrowShape: { 36455 x0: 10, 36456 x1: 60, y1: 50, 36457 x2: 70, y2: 40, 36458 x3: 30, 36459 }, 36460 } ); 36461 36462 Flickity.createMethods.push('_createPrevNextButtons'); 36463 var proto = Flickity.prototype; 36464 36465 proto._createPrevNextButtons = function() { 36466 if ( !this.options.prevNextButtons ) { 36467 return; 36468 } 36469 36470 this.prevButton = new PrevNextButton( -1, this ); 36471 this.nextButton = new PrevNextButton( 1, this ); 36472 36473 this.on( 'activate', this.activatePrevNextButtons ); 36474 }; 36475 36476 proto.activatePrevNextButtons = function() { 36477 this.prevButton.activate(); 36478 this.nextButton.activate(); 36479 this.on( 'deactivate', this.deactivatePrevNextButtons ); 36480 }; 36481 36482 proto.deactivatePrevNextButtons = function() { 36483 this.prevButton.deactivate(); 36484 this.nextButton.deactivate(); 36485 this.off( 'deactivate', this.deactivatePrevNextButtons ); 36486 }; 36487 36488 // -------------------------- -------------------------- // 36489 36490 Flickity.PrevNextButton = PrevNextButton; 36491 36492 return Flickity; 36493 36494 } ) ); 36495 36496 36497/***/ }), 36498/* 351 */ 36499/***/ (function(module, exports, __webpack_require__) { 36500 36501 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// page dots 36502 ( function( window, factory ) { 36503 // universal module definition 36504 if ( true ) { 36505 // AMD 36506 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 36507 __webpack_require__(339), 36508 __webpack_require__(349), 36509 __webpack_require__(342), 36510 ], __WEBPACK_AMD_DEFINE_RESULT__ = function( Flickity, Unipointer, utils ) { 36511 return factory( window, Flickity, Unipointer, utils ); 36512 }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 36513 } else if ( typeof module == 'object' && module.exports ) { 36514 // CommonJS 36515 module.exports = factory( 36516 window, 36517 require('./flickity'), 36518 require('unipointer'), 36519 require('fizzy-ui-utils') 36520 ); 36521 } else { 36522 // browser global 36523 factory( 36524 window, 36525 window.Flickity, 36526 window.Unipointer, 36527 window.fizzyUIUtils 36528 ); 36529 } 36530 36531 }( window, function factory( window, Flickity, Unipointer, utils ) { 36532 36533 // -------------------------- PageDots -------------------------- // 36534 36535 'use strict'; 36536 36537 function PageDots( parent ) { 36538 this.parent = parent; 36539 this._create(); 36540 } 36541 36542 PageDots.prototype = Object.create( Unipointer.prototype ); 36543 36544 PageDots.prototype._create = function() { 36545 // create holder element 36546 this.holder = document.createElement('ol'); 36547 this.holder.className = 'flickity-page-dots'; 36548 // create dots, array of elements 36549 this.dots = []; 36550 // events 36551 this.handleClick = this.onClick.bind( this ); 36552 this.on( 'pointerDown', this.parent.childUIPointerDown.bind( this.parent ) ); 36553 }; 36554 36555 PageDots.prototype.activate = function() { 36556 this.setDots(); 36557 this.holder.addEventListener( 'click', this.handleClick ); 36558 this.bindStartEvent( this.holder ); 36559 // add to DOM 36560 this.parent.element.appendChild( this.holder ); 36561 }; 36562 36563 PageDots.prototype.deactivate = function() { 36564 this.holder.removeEventListener( 'click', this.handleClick ); 36565 this.unbindStartEvent( this.holder ); 36566 // remove from DOM 36567 this.parent.element.removeChild( this.holder ); 36568 }; 36569 36570 PageDots.prototype.setDots = function() { 36571 // get difference between number of slides and number of dots 36572 var delta = this.parent.slides.length - this.dots.length; 36573 if ( delta > 0 ) { 36574 this.addDots( delta ); 36575 } else if ( delta < 0 ) { 36576 this.removeDots( -delta ); 36577 } 36578 }; 36579 36580 PageDots.prototype.addDots = function( count ) { 36581 var fragment = document.createDocumentFragment(); 36582 var newDots = []; 36583 var length = this.dots.length; 36584 var max = length + count; 36585 36586 for ( var i = length; i < max; i++ ) { 36587 var dot = document.createElement('li'); 36588 dot.className = 'dot'; 36589 dot.setAttribute( 'aria-label', 'Page dot ' + ( i + 1 ) ); 36590 fragment.appendChild( dot ); 36591 newDots.push( dot ); 36592 } 36593 36594 this.holder.appendChild( fragment ); 36595 this.dots = this.dots.concat( newDots ); 36596 }; 36597 36598 PageDots.prototype.removeDots = function( count ) { 36599 // remove from this.dots collection 36600 var removeDots = this.dots.splice( this.dots.length - count, count ); 36601 // remove from DOM
36602 removeDots.forEach( function( dot ) { 36603 this.holder.removeChild( dot ); 36604 }, this ); 36605 }; 36606 36607 PageDots.prototype.updateSelected = function() { 36608 // remove selected class on previous 36609 if ( this.selectedDot ) { 36610 this.selectedDot.className = 'dot'; 36611 this.selectedDot.removeAttribute('aria-current'); 36612 } 36613 // don't proceed if no dots 36614 if ( !this.dots.length ) { 36615 return; 36616 } 36617 this.selectedDot = this.dots[ this.parent.selectedIndex ]; 36618 this.selectedDot.className = 'dot is-selected'; 36619 this.selectedDot.setAttribute( 'aria-current', 'step' ); 36620 }; 36621 36622 PageDots.prototype.onTap = // old method name, backwards-compatible 36623 PageDots.prototype.onClick = function( event ) { 36624 var target = event.target; 36625 // only care about dot clicks 36626 if ( target.nodeName != 'LI' ) { 36627 return; 36628 } 36629 36630 this.parent.uiChange(); 36631 var index = this.dots.indexOf( target ); 36632 this.parent.select( index ); 36633 }; 36634 36635 PageDots.prototype.destroy = function() { 36636 this.deactivate(); 36637 this.allOff(); 36638 }; 36639 36640 Flickity.PageDots = PageDots; 36641 36642 // -------------------------- Flickity -------------------------- // 36643 36644 utils.extend( Flickity.defaults, { 36645 pageDots: true, 36646 } ); 36647 36648 Flickity.createMethods.push('_createPageDots'); 36649 36650 var proto = Flickity.prototype; 36651 36652 proto._createPageDots = function() { 36653 if ( !this.options.pageDots ) { 36654 return; 36655 } 36656 this.pageDots = new PageDots( this ); 36657 // events 36658 this.on( 'activate', this.activatePageDots ); 36659 this.on( 'select', this.updateSelectedPageDots ); 36660 this.on( 'cellChange', this.updatePageDots ); 36661 this.on( 'resize', this.updatePageDots ); 36662 this.on( 'deactivate', this.deactivatePageDots ); 36663 }; 36664 36665 proto.activatePageDots = function() { 36666 this.pageDots.activate(); 36667 }; 36668 36669 proto.updateSelectedPageDots = function() { 36670 this.pageDots.updateSelected(); 36671 }; 36672 36673 proto.updatePageDots = function() { 36674 this.pageDots.setDots(); 36675 }; 36676 36677 proto.deactivatePageDots = function() { 36678 this.pageDots.deactivate(); 36679 }; 36680 36681 // ----- ----- // 36682 36683 Flickity.PageDots = PageDots; 36684 36685 return Flickity; 36686 36687 } ) ); 36688 36689 36690/***/ }), 36691/* 352 */ 36692/***/ (function(module, exports, __webpack_require__) { 36693 36694 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// player & autoPlay 36695 ( function( window, factory ) { 36696 // universal module definition 36697 if ( true ) { 36698 // AMD 36699 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 36700 __webpack_require__(340), 36701 __webpack_require__(342), 36702 __webpack_require__(339), 36703 ], __WEBPACK_AMD_DEFINE_RESULT__ = function( EvEmitter, utils, Flickity ) { 36704 return factory( EvEmitter, utils, Flickity ); 36705 }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 36706 } else if ( typeof module == 'object' && module.exports ) { 36707 // CommonJS 36708 module.exports = factory( 36709 require('ev-emitter'), 36710 require('fizzy-ui-utils'), 36711 require('./flickity') 36712 ); 36713 } else { 36714 // browser global 36715 factory( 36716 window.EvEmitter, 36717 window.fizzyUIUtils, 36718 window.Flickity 36719 ); 36720 } 36721 36722 }( window, function factory( EvEmitter, utils, Flickity ) { 36723 36724 'use strict'; 36725 36726 // -------------------------- Player -------------------------- // 36727 36728 function Player( parent ) { 36729 this.parent = parent; 36730 this.state = 'stopped'; 36731 // visibility change event handler 36732 this.onVisibilityChange = this.visibilityChange.bind( this ); 36733 this.onVisibilityPlay = this.visibilityPlay.bind( this ); 36734 } 36735 36736 Player.prototype = Object.create( EvEmitter.prototype ); 36737 36738 // start play 36739 Player.prototype.play = function() { 36740 if ( this.state == 'playing' ) { 36741 return; 36742 } 36743 // do not play if page is hidden, start playing when page is visible 36744 var isPageHidden = document.hidden; 36745 if ( isPageHidden ) { 36746 document.addEventListener( 'visibilitychange', this.onVisibilityPlay ); 36747 return; 36748 } 36749 36750 this.state = 'playing'; 36751 // listen to visibility change 36752 document.addEventListener( 'visibilitychange', this.onVisibilityChange ); 36753 // start ticking 36754 this.tick(); 36755 }; 36756 36757 Player.prototype.tick = function() { 36758 // do not tick if not playing 36759 if ( this.state != 'playing' ) { 36760 return; 36761 } 36762 36763 var time = this.parent.options.autoPlay; 36764 // default to 3 seconds 36765 time = typeof time == 'number' ? time : 3000; 36766 var _this = this; 36767 // HACK: reset ticks if stopped and started within interval 36768 this.clear(); 36769 this.timeout = setTimeout( function() { 36770 _this.parent.next( true ); 36771 _this.tick(); 36772 }, time ); 36773 }; 36774 36775 Player.prototype.stop = function() { 36776 this.state = 'stopped'; 36777 this.clear(); 36778 // remove visibility change event 36779 document.removeEventListener( 'visibilitychange', this.onVisibilityChange ); 36780 }; 36781 36782 Player.prototype.clear = function() { 36783 clearTimeout( this.timeout ); 36784 }; 36785 36786 Player.prototype.pause = function() { 36787 if ( this.state == 'playing' ) { 36788 this.state = 'paused'; 36789 this.clear(); 36790 } 36791 }; 36792 36793 Player.prototype.unpause = function() { 36794 // re-start play if paused 36795 if ( this.state == 'paused' ) { 36796 this.play(); 36797 } 36798 }; 36799 36800 // pause if page visibility is hidden, unpause if visible 36801 Player.prototype.visibilityChange = function() { 36802 var isPageHidden = document.hidden; 36803 this[ isPageHidden ? 'pause' : 'unpause' ](); 36804 }; 36805 36806 Player.prototype.visibilityPlay = function() { 36807 this.play(); 36808 document.removeEventListener( 'visibilitychange', this.onVisibilityPlay ); 36809 }; 36810 36811 // -------------------------- Flickity -------------------------- // 36812 36813 utils.extend( Flickity.defaults, { 36814 pauseAutoPlayOnHover: true, 36815 } ); 36816 36817 Flickity.createMethods.push('_createPlayer'); 36818 var proto = Flickity.prototype; 36819 36820 proto._createPlayer = function() { 36821 this.player = new Player( this ); 36822 36823 this.on( 'activate', this.activatePlayer ); 36824 this.on( 'uiChange', this.stopPlayer ); 36825 this.on( 'pointerDown', this.stopPlayer ); 36826 this.on( 'deactivate', this.deactivatePlayer ); 36827 }; 36828 36829 proto.activatePlayer = function() { 36830 if ( !this.options.autoPlay ) { 36831 return; 36832 } 36833 this.player.play(); 36834 this.element.addEventListener( 'mouseenter', this ); 36835 }; 36836 36837 // Player API, don't hate the ... thanks I know where the door is 36838 36839 proto.playPlayer = function() { 36840 this.player.play(); 36841 }; 36842 36843 proto.stopPlayer = function() { 36844 this.player.stop(); 36845 }; 36846 36847 proto.pausePlayer = function() { 36848 this.player.pause(); 36849 }; 36850 36851 proto.unpausePlayer = function() { 36852 this.player.unpause(); 36853 }; 36854 36855 proto.deactivatePlayer = function() { 36856 this.player.stop(); 36857 this.element.removeEventListener( 'mouseenter', this ); 36858 }; 36859 36860 // ----- mouseenter/leave ----- // 36861 36862 // pause auto-play on hover 36863 proto.onmouseenter = function() { 36864 if ( !this.options.pauseAutoPlayOnHover ) { 36865 return; 36866 } 36867 this.player.pause(); 36868 this.element.addEventListener( 'mouseleave', this ); 36869 }; 36870 36871 // resume auto-play on hover off 36872 proto.onmouseleave = function() { 36873 this.player.unpause(); 36874 this.element.removeEventListener( 'mouseleave', this ); 36875 }; 36876 36877 // ----- ----- // 36878 36879 Flickity.Player = Player; 36880 36881 return Flickity; 36882 36883 } ) ); 36884 36885
36886/***/ }), 36887/* 353 */ 36888/***/ (function(module, exports, __webpack_require__) { 36889 36890 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// add, remove cell 36891 ( function( window, factory ) { 36892 // universal module definition 36893 if ( true ) { 36894 // AMD 36895 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 36896 __webpack_require__(339), 36897 __webpack_require__(342), 36898 ], __WEBPACK_AMD_DEFINE_RESULT__ = function( Flickity, utils ) { 36899 return factory( window, Flickity, utils ); 36900 }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 36901 } else if ( typeof module == 'object' && module.exports ) { 36902 // CommonJS 36903 module.exports = factory( 36904 window, 36905 require('./flickity'), 36906 require('fizzy-ui-utils') 36907 ); 36908 } else { 36909 // browser global 36910 factory( 36911 window, 36912 window.Flickity, 36913 window.fizzyUIUtils 36914 ); 36915 } 36916 36917 }( window, function factory( window, Flickity, utils ) { 36918 36919 'use strict'; 36920 36921 // append cells to a document fragment 36922 function getCellsFragment( cells ) { 36923 var fragment = document.createDocumentFragment(); 36924 cells.forEach( function( cell ) { 36925 fragment.appendChild( cell.element ); 36926 } ); 36927 return fragment; 36928 } 36929 36930 // -------------------------- add/remove cell prototype -------------------------- // 36931 36932 var proto = Flickity.prototype; 36933 36934 /** 36935 * Insert, prepend, or append cells 36936 * @param {[Element, Array, NodeList]} elems - Elements to insert 36937 * @param {Integer} index - Zero-based number to insert 36938 */ 36939 proto.insert = function( elems, index ) { 36940 var cells = this._makeCells( elems ); 36941 if ( !cells || !cells.length ) { 36942 return; 36943 } 36944 var len = this.cells.length; 36945 // default to append 36946 index = index === undefined ? len : index; 36947 // add cells with document fragment 36948 var fragment = getCellsFragment( cells ); 36949 // append to slider 36950 var isAppend = index == len; 36951 if ( isAppend ) { 36952 this.slider.appendChild( fragment ); 36953 } else { 36954 var insertCellElement = this.cells[ index ].element; 36955 this.slider.insertBefore( fragment, insertCellElement ); 36956 } 36957 // add to this.cells 36958 if ( index === 0 ) { 36959 // prepend, add to start 36960 this.cells = cells.concat( this.cells ); 36961 } else if ( isAppend ) { 36962 // append, add to end 36963 this.cells = this.cells.concat( cells ); 36964 } else { 36965 // insert in this.cells 36966 var endCells = this.cells.splice( index, len - index ); 36967 this.cells = this.cells.concat( cells ).concat( endCells ); 36968 } 36969 36970 this._sizeCells( cells ); 36971 this.cellChange( index, true ); 36972 }; 36973 36974 proto.append = function( elems ) { 36975 this.insert( elems, this.cells.length ); 36976 }; 36977 36978 proto.prepend = function( elems ) { 36979 this.insert( elems, 0 ); 36980 }; 36981 36982 /** 36983 * Remove cells 36984 * @param {[Element, Array, NodeList]} elems - ELements to remove 36985 */ 36986 proto.remove = function( elems ) { 36987 var cells = this.getCells( elems ); 36988 if ( !cells || !cells.length ) { 36989 return; 36990 } 36991 36992 var minCellIndex = this.cells.length - 1; 36993 // remove cells from collection & DOM 36994 cells.forEach( function( cell ) { 36995 cell.remove(); 36996 var index = this.cells.indexOf( cell ); 36997 minCellIndex = Math.min( index, minCellIndex ); 36998 utils.removeFrom( this.cells, cell ); 36999 }, this ); 37000 37001 this.cellChange( minCellIndex, true ); 37002 }; 37003 37004 /** 37005 * logic to be run after a cell's size changes 37006 * @param {Element} elem - cell's element 37007 */ 37008 proto.cellSizeChange = function( elem ) { 37009 var cell = this.getCell( elem ); 37010 if ( !cell ) { 37011 return; 37012 } 37013 cell.getSize(); 37014 37015 var index = this.cells.indexOf( cell ); 37016 this.cellChange( index ); 37017 }; 37018 37019 /** 37020 * logic any time a cell is changed: added, removed, or size changed 37021 * @param {Integer} changedCellIndex - index of the changed cell, optional 37022 * @param {Boolean} isPositioningSlider - Positions slider after selection 37023 */ 37024 proto.cellChange = function( changedCellIndex, isPositioningSlider ) { 37025 var prevSelectedElem = this.selectedElement; 37026 this._positionCells( changedCellIndex ); 37027 this._getWrapShiftCells(); 37028 this.setGallerySize(); 37029 // update selectedIndex 37030 // try to maintain position & select previous selected element 37031 var cell = this.getCell( prevSelectedElem ); 37032 if ( cell ) { 37033 this.selectedIndex = this.getCellSlideIndex( cell ); 37034 } 37035 this.selectedIndex = Math.min( this.slides.length - 1, this.selectedIndex ); 37036 37037 this.emitEvent( 'cellChange', [ changedCellIndex ] ); 37038 // position slider 37039 this.select( this.selectedIndex ); 37040 // do not position slider after lazy load 37041 if ( isPositioningSlider ) { 37042 this.positionSliderAtSelected(); 37043 } 37044 }; 37045 37046 // ----- ----- // 37047 37048 return Flickity; 37049 37050 } ) ); 37051 37052
37053/***/ }), 37054/* 354 */ 37055/***/ (function(module, exports, __webpack_require__) { 37056 37057 var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// lazyload 37058 ( function( window, factory ) { 37059 // universal module definition 37060 if ( true ) { 37061 // AMD 37062 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 37063 __webpack_require__(339), 37064 __webpack_require__(342), 37065 ], __WEBPACK_AMD_DEFINE_RESULT__ = function( Flickity, utils ) { 37066 return factory( window, Flickity, utils ); 37067 }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 37068 } else if ( typeof module == 'object' && module.exports ) { 37069 // CommonJS 37070 module.exports = factory( 37071 window, 37072 require('./flickity'), 37073 require('fizzy-ui-utils') 37074 ); 37075 } else { 37076 // browser global 37077 factory( 37078 window, 37079 window.Flickity, 37080 window.fizzyUIUtils 37081 ); 37082 } 37083 37084 }( window, function factory( window, Flickity, utils ) { 37085 'use strict'; 37086 37087 Flickity.createMethods.push('_createLazyload'); 37088 var proto = Flickity.prototype; 37089 37090 proto._createLazyload = function() { 37091 this.on( 'select', this.lazyLoad ); 37092 }; 37093 37094 proto.lazyLoad = function() { 37095 var lazyLoad = this.options.lazyLoad; 37096 if ( !lazyLoad ) { 37097 return; 37098 } 37099 // get adjacent cells, use lazyLoad option for adjacent count 37100 var adjCount = typeof lazyLoad == 'number' ? lazyLoad : 0; 37101 var cellElems = this.getAdjacentCellElements( adjCount ); 37102 // get lazy images in those cells 37103 var lazyImages = [];
37104 cellElems.forEach( function( cellElem ) { 37105 var lazyCellImages = getCellLazyImages( cellElem ); 37106 lazyImages = lazyImages.concat( lazyCellImages ); 37107 } ); 37108 // load lazy images 37109 lazyImages.forEach( function( img ) { 37110 new LazyLoader( img, this ); 37111 }, this ); 37112 }; 37113 37114 function getCellLazyImages( cellElem ) { 37115 // check if cell element is lazy image 37116 if ( cellElem.nodeName == 'IMG' ) { 37117 var lazyloadAttr = cellElem.getAttribute('data-flickity-lazyload'); 37118 var srcAttr = cellElem.getAttribute('data-flickity-lazyload-src'); 37119 var srcsetAttr = cellElem.getAttribute('data-flickity-lazyload-srcset'); 37120 if ( lazyloadAttr || srcAttr || srcsetAttr ) { 37121 return [ cellElem ]; 37122 } 37123 } 37124 // select lazy images in cell 37125 var lazySelector = 'img[data-flickity-lazyload], ' + 37126 'img[data-flickity-lazyload-src], img[data-flickity-lazyload-srcset]'; 37127 var imgs = cellElem.querySelectorAll( lazySelector ); 37128 return utils.makeArray( imgs ); 37129 } 37130 37131 // -------------------------- LazyLoader -------------------------- // 37132 37133 /** 37134 * class to handle loading images 37135 * @param {Image} img - Image element 37136 * @param {Flickity} flickity - Flickity instance 37137 */ 37138 function LazyLoader( img, flickity ) { 37139 this.img = img; 37140 this.flickity = flickity; 37141 this.load(); 37142 } 37143 37144 LazyLoader.prototype.handleEvent = utils.handleEvent; 37145 37146 LazyLoader.prototype.load = function() { 37147 this.img.addEventListener( 'load', this ); 37148 this.img.addEventListener( 'error', this ); 37149 // get src & srcset 37150 var src = this.img.getAttribute('data-flickity-lazyload') || 37151 this.img.getAttribute('data-flickity-lazyload-src'); 37152 var srcset = this.img.getAttribute('data-flickity-lazyload-srcset'); 37153 // set src & serset 37154 this.img.src = src; 37155 if ( srcset ) { 37156 this.img.setAttribute( 'srcset', srcset ); 37157 } 37158 // remove attr 37159 this.img.removeAttribute('data-flickity-lazyload'); 37160 this.img.removeAttribute('data-flickity-lazyload-src'); 37161 this.img.removeAttribute('data-flickity-lazyload-srcset'); 37162 }; 37163 37164 LazyLoader.prototype.onload = function( event ) { 37165 this.complete( event, 'flickity-lazyloaded' ); 37166 }; 37167 37168 LazyLoader.prototype.onerror = function( event ) { 37169 this.complete( event, 'flickity-lazyerror' ); 37170 }; 37171 37172 LazyLoader.prototype.complete = function( event, className ) { 37173 // unbind events 37174 this.img.removeEventListener( 'load', this ); 37175 this.img.removeEventListener( 'error', this ); 37176 37177 var cell = this.flickity.getParentCell( this.img ); 37178 var cellElem = cell && cell.element; 37179 this.flickity.cellSizeChange( cellElem ); 37180 37181 this.img.classList.add( className ); 37182 this.flickity.dispatchEvent( 'lazyLoad', event, cellElem ); 37183 }; 37184 37185 // ----- ----- // 37186 37187 Flickity.LazyLoader = LazyLoader; 37188 37189 return Flickity; 37190 37191 } ) ); 37192 37193 37194/***/ }), 37195/* 355 */ 37196/***/ (function(module, exports, __webpack_require__) { 37197 37198 var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 37199 * Flickity asNavFor v2.0.1 37200 * enable asNavFor for Flickity 37201 */ 37202 37203 /*jshint browser: true, undef: true, unused: true, strict: true*/ 37204 37205 ( function( window, factory ) { 37206 // universal module definition 37207 /*jshint strict: false */ /*globals define, module, require */ 37208 if ( true ) { 37209 // AMD 37210 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [ 37211 __webpack_require__(338), 37212 __webpack_require__(342) 37213 ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 37214 } else if ( typeof module == 'object' && module.exports ) { 37215 // CommonJS 37216 module.exports = factory( 37217 require('flickity'), 37218 require('fizzy-ui-utils') 37219 ); 37220 } else { 37221 // browser global 37222 window.Flickity = factory( 37223 window.Flickity, 37224 window.fizzyUIUtils 37225 ); 37226 } 37227 37228 }( window, function factory( Flickity, utils ) { 37229 37230 'use strict'; 37231 37232 // -------------------------- asNavFor prototype -------------------------- // 37233 37234 // Flickity.defaults.asNavFor = null; 37235 37236 Flickity.createMethods.push('_createAsNavFor'); 37237 37238 var proto = Flickity.prototype; 37239 37240 proto._createAsNavFor = function() { 37241 this.on( 'activate', this.activateAsNavFor ); 37242 this.on( 'deactivate', this.deactivateAsNavFor ); 37243 this.on( 'destroy', this.destroyAsNavFor ); 37244 37245 var asNavForOption = this.options.asNavFor; 37246 if ( !asNavForOption ) { 37247 return; 37248 } 37249 // HACK do async, give time for other flickity to be initalized 37250 var _this = this; 37251 setTimeout( function initNavCompanion() { 37252 _this.setNavCompanion( asNavForOption ); 37253 }); 37254 }; 37255 37256 proto.setNavCompanion = function( elem ) { 37257 elem = utils.getQueryElement( elem ); 37258 var companion = Flickity.data( elem ); 37259 // stop if no companion or companion is self 37260 if ( !companion || companion == this ) { 37261 return; 37262 } 37263 37264 this.navCompanion = companion; 37265 // companion select 37266 var _this = this; 37267 this.onNavCompanionSelect = function() { 37268 _this.navCompanionSelect(); 37269 }; 37270 companion.on( 'select', this.onNavCompanionSelect ); 37271 // click 37272 this.on( 'staticClick', this.onNavStaticClick ); 37273 37274 this.navCompanionSelect( true ); 37275 }; 37276 37277 proto.navCompanionSelect = function( isInstant ) { 37278 if ( !this.navCompanion ) { 37279 return; 37280 } 37281 // select slide that matches first cell of slide 37282 var selectedCell = this.navCompanion.selectedCells[0]; 37283 var firstIndex = this.navCompanion.cells.indexOf( selectedCell ); 37284 var lastIndex = firstIndex + this.navCompanion.selectedCells.length - 1; 37285 var selectIndex = Math.floor( lerp( firstIndex, lastIndex, 37286 this.navCompanion.cellAlign ) ); 37287 this.selectCell( selectIndex, false, isInstant ); 37288 // set nav selected class 37289 this.removeNavSelectedElements();
37290 // stop if companion has more cells than this one 37291 if ( selectIndex >= this.cells.length ) { 37292 return; 37293 } 37294 37295 var selectedCells = this.cells.slice( firstIndex, lastIndex + 1 ); 37296 this.navSelectedElements = selectedCells.map( function( cell ) { 37297 return cell.element; 37298 }); 37299 this.changeNavSelectedClass('add'); 37300 }; 37301 37302 function lerp( a, b, t ) { 37303 return ( b - a ) * t + a; 37304 } 37305 37306 proto.changeNavSelectedClass = function( method ) { 37307 this.navSelectedElements.forEach( function( navElem ) { 37308 navElem.classList[ method ]('is-nav-selected'); 37309 }); 37310 }; 37311 37312 proto.activateAsNavFor = function() { 37313 this.navCompanionSelect( true ); 37314 }; 37315 37316 proto.removeNavSelectedElements = function() { 37317 if ( !this.navSelectedElements ) { 37318 return; 37319 } 37320 this.changeNavSelectedClass('remove'); 37321 delete this.navSelectedElements; 37322 }; 37323 37324 proto.onNavStaticClick = function( event, pointer, cellElement, cellIndex ) { 37325 if ( typeof cellIndex == 'number' ) { 37326 this.navCompanion.selectCell( cellIndex ); 37327 } 37328 }; 37329 37330 proto.deactivateAsNavFor = function() { 37331 this.removeNavSelectedElements(); 37332 }; 37333 37334 proto.destroyAsNavFor = function() { 37335 if ( !this.navCompanion ) { 37336 return; 37337 } 37338 this.navCompanion.off( 'select', this.onNavCompanionSelect ); 37339 this.off( 'staticClick', this.onNavStaticClick ); 37340 delete this.navCompanion; 37341 }; 37342 37343 // ----- ----- // 37344 37345 return Flickity; 37346 37347 })); 37348 37349 37350/***/ }), 37351/* 356 */ 37352/***/ (function(module, exports, __webpack_require__) { 37353 37354 'use strict'; 37355 37356 var stringify = __webpack_require__(357); 37357 var parse = __webpack_require__(360); 37358 var formats = __webpack_require__(359); 37359 37360 module.exports = { 37361 formats: formats, 37362 parse: parse, 37363 stringify: stringify 37364 }; 37365 37366 37367/***/ }), 37368/* 357 */ 37369/***/ (function(module, exports, __webpack_require__) { 37370 37371 'use strict'; 37372 37373 var utils = __webpack_require__(358); 37374 var formats = __webpack_require__(359); 37375 var has = Object.prototype.hasOwnProperty; 37376 37377 var arrayPrefixGenerators = { 37378 brackets: function brackets(prefix) { // eslint-disable-line func-name-matching 37379 return prefix + '[]'; 37380 }, 37381 comma: 'comma', 37382 indices: function indices(prefix, key) { // eslint-disable-line func-name-matching 37383 return prefix + '[' + key + ']'; 37384 }, 37385 repeat: function repeat(prefix) { // eslint-disable-line func-name-matching 37386 return prefix; 37387 } 37388 }; 37389 37390 var isArray = Array.isArray; 37391 var push = Array.prototype.push; 37392 var pushToArray = function (arr, valueOrArray) { 37393 push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]); 37394 }; 37395 37396 var toISO = Date.prototype.toISOString; 37397 37398 var defaults = { 37399 addQueryPrefix: false, 37400 allowDots: false, 37401 charset: 'utf-8', 37402 charsetSentinel: false, 37403 delimiter: '&', 37404 encode: true, 37405 encoder: utils.encode, 37406 encodeValuesOnly: false, 37407 formatter: formats.formatters[formats['default']], 37408 // deprecated 37409 indices: false, 37410 serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching 37411 return toISO.call(date); 37412 }, 37413 skipNulls: false, 37414 strictNullHandling: false 37415 }; 37416 37417 var stringify = function stringify( // eslint-disable-line func-name-matching 37418 object, 37419 prefix, 37420 generateArrayPrefix, 37421 strictNullHandling, 37422 skipNulls, 37423 encoder, 37424 filter, 37425 sort, 37426 allowDots, 37427 serializeDate, 37428 formatter, 37429 encodeValuesOnly, 37430 charset 37431 ) { 37432 var obj = object; 37433 if (typeof filter === 'function') { 37434 obj = filter(prefix, obj); 37435 } else if (obj instanceof Date) { 37436 obj = serializeDate(obj); 37437 } else if (generateArrayPrefix === 'comma' && isArray(obj)) { 37438 obj = obj.join(','); 37439 } 37440 37441 if (obj === null) { 37442 if (strictNullHandling) { 37443 return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset) : prefix; 37444 } 37445 37446 obj = ''; 37447 } 37448 37449 if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) { 37450 if (encoder) { 37451 var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset); 37452 return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset))]; 37453 } 37454 return [formatter(prefix) + '=' + formatter(String(obj))]; 37455 } 37456 37457 var values = []; 37458 37459 if (typeof obj === 'undefined') { 37460 return values; 37461 } 37462 37463 var objKeys; 37464 if (isArray(filter)) { 37465 objKeys = filter; 37466 } else { 37467 var keys = Object.keys(obj); 37468 objKeys = sort ? keys.sort(sort) : keys; 37469 } 37470 37471 for (var i = 0; i < objKeys.length; ++i) { 37472 var key = objKeys[i]; 37473 37474 if (skipNulls && obj[key] === null) { 37475 continue; 37476 } 37477 37478 if (isArray(obj)) { 37479 pushToArray(values, stringify( 37480 obj[key], 37481 typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix, 37482 generateArrayPrefix,
vendor: 5,230 bytes, lines 37483-37638
37483 strictNullHandling, 37484 skipNulls, 37485 encoder, 37486 filter, 37487 sort, 37488 allowDots, 37489 serializeDate, 37490 formatter, 37491 encodeValuesOnly, 37492 charset 37493 )); 37494 } else { 37495 pushToArray(values, stringify( 37496 obj[key], 37497 prefix + (allowDots ? '.' + key : '[' + key + ']'), 37498 generateArrayPrefix, 37499 strictNullHandling, 37500 skipNulls, 37501 encoder, 37502 filter, 37503 sort, 37504 allowDots, 37505 serializeDate, 37506 formatter, 37507 encodeValuesOnly, 37508 charset 37509 )); 37510 } 37511 } 37512 37513 return values; 37514 }; 37515 37516 var normalizeStringifyOptions = function normalizeStringifyOptions(opts) { 37517 if (!opts) { 37518 return defaults; 37519 } 37520 37521 if (opts.encoder !== null && opts.encoder !== undefined && typeof opts.encoder !== 'function') { 37522 throw new TypeError('Encoder has to be a function.'); 37523 } 37524 37525 var charset = opts.charset || defaults.charset; 37526 if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { 37527 throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); 37528 } 37529 37530 var format = formats['default']; 37531 if (typeof opts.format !== 'undefined') { 37532 if (!has.call(formats.formatters, opts.format)) { 37533 throw new TypeError('Unknown format option provided.'); 37534 } 37535 format = opts.format; 37536 } 37537 var formatter = formats.formatters[format]; 37538 37539 var filter = defaults.filter; 37540 if (typeof opts.filter === 'function' || isArray(opts.filter)) { 37541 filter = opts.filter; 37542 } 37543 37544 return { 37545 addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, 37546 allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, 37547 charset: charset, 37548 charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, 37549 delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, 37550 encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, 37551 encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, 37552 encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, 37553 filter: filter, 37554 formatter: formatter, 37555 serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, 37556 skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, 37557 sort: typeof opts.sort === 'function' ? opts.sort : null, 37558 strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling 37559 }; 37560 }; 37561 37562 module.exports = function (object, opts) { 37563 var obj = object; 37564 var options = normalizeStringifyOptions(opts); 37565 37566 var objKeys; 37567 var filter; 37568 37569 if (typeof options.filter === 'function') { 37570 filter = options.filter; 37571 obj = filter('', obj); 37572 } else if (isArray(options.filter)) { 37573 filter = options.filter; 37574 objKeys = filter; 37575 } 37576 37577 var keys = []; 37578 37579 if (typeof obj !== 'object' || obj === null) { 37580 return ''; 37581 } 37582 37583 var arrayFormat; 37584 if (opts && opts.arrayFormat in arrayPrefixGenerators) { 37585 arrayFormat = opts.arrayFormat; 37586 } else if (opts && 'indices' in opts) { 37587 arrayFormat = opts.indices ? 'indices' : 'repeat'; 37588 } else { 37589 arrayFormat = 'indices'; 37590 } 37591 37592 var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; 37593 37594 if (!objKeys) { 37595 objKeys = Object.keys(obj); 37596 } 37597 37598 if (options.sort) { 37599 objKeys.sort(options.sort); 37600 } 37601 37602 for (var i = 0; i < objKeys.length; ++i) { 37603 var key = objKeys[i]; 37604 37605 if (options.skipNulls && obj[key] === null) { 37606 continue; 37607 } 37608 pushToArray(keys, stringify( 37609 obj[key], 37610 key, 37611 generateArrayPrefix, 37612 options.strictNullHandling, 37613 options.skipNulls, 37614 options.encode ? options.encoder : null, 37615 options.filter, 37616 options.sort, 37617 options.allowDots, 37618 options.serializeDate, 37619 options.formatter, 37620 options.encodeValuesOnly, 37621 options.charset 37622 )); 37623 } 37624 37625 var joined = keys.join(options.delimiter); 37626 var prefix = options.addQueryPrefix === true ? '?' : ''; 37627 37628 if (options.charsetSentinel) { 37629 if (options.charset === 'iso-8859-1') { 37630 // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark 37631 prefix += 'utf8=%26%2310003%3B&'; 37632 } else { 37633 // encodeURIComponent('â') 37634 prefix += 'utf8=%E2%9C%93&'; 37635 } 37636 } 37637 37638 return joined.length >
vendor: 4,901 bytes, lines 37638-37814
37638 0 ? prefix + joined : ''; 37639 }; 37640 37641 37642/***/ }), 37643/* 358 */ 37644/***/ (function(module, exports) { 37645 37646 'use strict'; 37647 37648 var has = Object.prototype.hasOwnProperty; 37649 var isArray = Array.isArray; 37650 37651 var hexTable = (function () { 37652 var array = []; 37653 for (var i = 0; i < 256; ++i) { 37654 array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); 37655 } 37656 37657 return array; 37658 }()); 37659 37660 var compactQueue = function compactQueue(queue) { 37661 while (queue.length > 1) { 37662 var item = queue.pop(); 37663 var obj = item.obj[item.prop]; 37664 37665 if (isArray(obj)) { 37666 var compacted = []; 37667 37668 for (var j = 0; j < obj.length; ++j) { 37669 if (typeof obj[j] !== 'undefined') { 37670 compacted.push(obj[j]); 37671 } 37672 } 37673 37674 item.obj[item.prop] = compacted; 37675 } 37676 } 37677 }; 37678 37679 var arrayToObject = function arrayToObject(source, options) { 37680 var obj = options && options.plainObjects ? Object.create(null) : {}; 37681 for (var i = 0; i < source.length; ++i) { 37682 if (typeof source[i] !== 'undefined') { 37683 obj[i] = source[i]; 37684 } 37685 } 37686 37687 return obj; 37688 }; 37689 37690 var merge = function merge(target, source, options) { 37691 if (!source) { 37692 return target; 37693 } 37694 37695 if (typeof source !== 'object') { 37696 if (isArray(target)) { 37697 target.push(source); 37698 } else if (target && typeof target === 'object') { 37699 if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) { 37700 target[source] = true; 37701 } 37702 } else { 37703 return [target, source]; 37704 } 37705 37706 return target; 37707 } 37708 37709 if (!target || typeof target !== 'object') { 37710 return [target].concat(source); 37711 } 37712 37713 var mergeTarget = target; 37714 if (isArray(target) && !isArray(source)) { 37715 mergeTarget = arrayToObject(target, options); 37716 } 37717 37718 if (isArray(target) && isArray(source)) { 37719 source.forEach(function (item, i) { 37720 if (has.call(target, i)) { 37721 var targetItem = target[i]; 37722 if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { 37723 target[i] = merge(targetItem, item, options); 37724 } else { 37725 target.push(item); 37726 } 37727 } else { 37728 target[i] = item; 37729 } 37730 }); 37731 return target; 37732 } 37733 37734 return Object.keys(source).reduce(function (acc, key) { 37735 var value = source[key]; 37736 37737 if (has.call(acc, key)) { 37738 acc[key] = merge(acc[key], value, options); 37739 } else { 37740 acc[key] = value; 37741 } 37742 return acc; 37743 }, mergeTarget); 37744 }; 37745 37746 var assign = function assignSingleSource(target, source) { 37747 return Object.keys(source).reduce(function (acc, key) { 37748 acc[key] = source[key]; 37749 return acc; 37750 }, target); 37751 }; 37752 37753 var decode = function (str, decoder, charset) { 37754 var strWithoutPlus = str.replace(/\+/g, ' '); 37755 if (charset === 'iso-8859-1') { 37756 // unescape never throws, no try...catch needed: 37757 return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); 37758 } 37759 // utf-8 37760 try { 37761 return decodeURIComponent(strWithoutPlus); 37762 } catch (e) { 37763 return strWithoutPlus; 37764 } 37765 }; 37766 37767 var encode = function encode(str, defaultEncoder, charset) { 37768 // This code was originally written by Brian White (mscdex) for the io.js core querystring library. 37769 // It has been adapted here for stricter adherence to RFC 3986 37770 if (str.length === 0) { 37771 return str; 37772 } 37773 37774 var string = typeof str === 'string' ? str : String(str); 37775 37776 if (charset === 'iso-8859-1') { 37777 return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { 37778 return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; 37779 }); 37780 } 37781 37782 var out = ''; 37783 for (var i = 0; i < string.length; ++i) { 37784 var c = string.charCodeAt(i); 37785 37786 if ( 37787 c === 0x2D // - 37788 || c === 0x2E // . 37789 || c === 0x5F // _ 37790 || c === 0x7E // ~ 37791 || (c >= 0x30 && c <= 0x39) // 0-9 37792 || (c >= 0x41 && c <= 0x5A) // a-z 37793 || (c >= 0x61 && c <= 0x7A) // A-Z 37794 ) { 37795 out += string.charAt(i); 37796 continue; 37797 } 37798 37799 if (c < 0x80) { 37800 out = out + hexTable[c]; 37801 continue; 37802 } 37803 37804 if (c < 0x800) { 37805 out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]); 37806 continue; 37807 } 37808 37809 if (c < 0xD800 || c >= 0xE000) { 37810 out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); 37811 continue; 37812 } 37813 37814 i += 1;
vendor: 2,040 bytes, lines 37815-37898
37815 c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); 37816 out += hexTable[0xF0 | (c >> 18)] 37817 + hexTable[0x80 | ((c >> 12) & 0x3F)] 37818 + hexTable[0x80 | ((c >> 6) & 0x3F)] 37819 + hexTable[0x80 | (c & 0x3F)]; 37820 } 37821 37822 return out; 37823 }; 37824 37825 var compact = function compact(value) { 37826 var queue = [{ obj: { o: value }, prop: 'o' }]; 37827 var refs = []; 37828 37829 for (var i = 0; i < queue.length; ++i) { 37830 var item = queue[i]; 37831 var obj = item.obj[item.prop]; 37832 37833 var keys = Object.keys(obj); 37834 for (var j = 0; j < keys.length; ++j) { 37835 var key = keys[j]; 37836 var val = obj[key]; 37837 if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { 37838 queue.push({ obj: obj, prop: key }); 37839 refs.push(val); 37840 } 37841 } 37842 } 37843 37844 compactQueue(queue); 37845 37846 return value; 37847 }; 37848 37849 var isRegExp = function isRegExp(obj) { 37850 return Object.prototype.toString.call(obj) === '[object RegExp]'; 37851 }; 37852 37853 var isBuffer = function isBuffer(obj) { 37854 if (!obj || typeof obj !== 'object') { 37855 return false; 37856 } 37857 37858 return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); 37859 }; 37860 37861 var combine = function combine(a, b) { 37862 return [].concat(a, b); 37863 }; 37864 37865 module.exports = { 37866 arrayToObject: arrayToObject, 37867 assign: assign, 37868 combine: combine, 37869 compact: compact, 37870 decode: decode, 37871 encode: encode, 37872 isBuffer: isBuffer, 37873 isRegExp: isRegExp, 37874 merge: merge 37875 }; 37876 37877 37878/***/ }), 37879/* 359 */ 37880/***/ (function(module, exports) { 37881 37882 'use strict'; 37883 37884 var replace = String.prototype.replace; 37885 var percentTwenties = /%20/g; 37886 37887 module.exports = { 37888 'default': 'RFC3986', 37889 formatters: { 37890 RFC1738: function (value) { 37891 return replace.call(value, percentTwenties, '+'); 37892 }, 37893 RFC3986: function (value) { 37894 return value; 37895 } 37896 }, 37897 RFC1738: 'RFC1738', 37898 RFC3986: 'RFC3986'
vendor: 8,802 bytes, lines 37899-38151
37899 }; 37900 37901 37902/***/ }), 37903/* 360 */ 37904/***/ (function(module, exports, __webpack_require__) { 37905 37906 'use strict'; 37907 37908 var utils = __webpack_require__(358); 37909 37910 var has = Object.prototype.hasOwnProperty; 37911 37912 var defaults = { 37913 allowDots: false, 37914 allowPrototypes: false, 37915 arrayLimit: 20, 37916 charset: 'utf-8', 37917 charsetSentinel: false, 37918 comma: false, 37919 decoder: utils.decode, 37920 delimiter: '&', 37921 depth: 5, 37922 ignoreQueryPrefix: false, 37923 interpretNumericEntities: false, 37924 parameterLimit: 1000, 37925 parseArrays: true, 37926 plainObjects: false, 37927 strictNullHandling: false 37928 }; 37929 37930 var interpretNumericEntities = function (str) { 37931 return str.replace(/&#(\d+);/g, function ($0, numberStr) { 37932 return String.fromCharCode(parseInt(numberStr, 10)); 37933 }); 37934 }; 37935 37936 // This is what browsers will submit when the â character occurs in an 37937 // application/x-www-form-urlencoded body and the encoding of the page containing 37938 // the form is iso-8859-1, or when the submitted form has an accept-charset 37939 // attribute of iso-8859-1. Presumably also with other charsets that do not contain 37940 // the â character, such as us-ascii. 37941 var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓') 37942 37943 // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded. 37944 var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('â') 37945 37946 var parseValues = function parseQueryStringValues(str, options) { 37947 var obj = {}; 37948 var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str; 37949 var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit; 37950 var parts = cleanStr.split(options.delimiter, limit); 37951 var skipIndex = -1; // Keep track of where the utf8 sentinel was found 37952 var i; 37953 37954 var charset = options.charset; 37955 if (options.charsetSentinel) { 37956 for (i = 0; i < parts.length; ++i) { 37957 if (parts[i].indexOf('utf8=') === 0) { 37958 if (parts[i] === charsetSentinel) { 37959 charset = 'utf-8'; 37960 } else if (parts[i] === isoSentinel) { 37961 charset = 'iso-8859-1'; 37962 } 37963 skipIndex = i; 37964 i = parts.length; // The eslint settings do not allow break; 37965 } 37966 } 37967 } 37968 37969 for (i = 0; i < parts.length; ++i) { 37970 if (i === skipIndex) { 37971 continue; 37972 } 37973 var part = parts[i]; 37974 37975 var bracketEqualsPos = part.indexOf(']='); 37976 var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1; 37977 37978 var key, val; 37979 if (pos === -1) { 37980 key = options.decoder(part, defaults.decoder, charset); 37981 val = options.strictNullHandling ? null : ''; 37982 } else { 37983 key = options.decoder(part.slice(0, pos), defaults.decoder, charset); 37984 val = options.decoder(part.slice(pos + 1), defaults.decoder, charset); 37985 } 37986 37987 if (val && options.interpretNumericEntities && charset === 'iso-8859-1') { 37988 val = interpretNumericEntities(val); 37989 } 37990 37991 if (val && options.comma && val.indexOf(',') > -1) { 37992 val = val.split(','); 37993 } 37994 37995 if (has.call(obj, key)) { 37996 obj[key] = utils.combine(obj[key], val); 37997 } else { 37998 obj[key] = val; 37999 } 38000 } 38001 38002 return obj; 38003 }; 38004 38005 var parseObject = function (chain, val, options) { 38006 var leaf = val; 38007 38008 for (var i = chain.length - 1; i >= 0; --i) { 38009 var obj; 38010 var root = chain[i]; 38011 38012 if (root === '[]' && options.parseArrays) { 38013 obj = [].concat(leaf); 38014 } else { 38015 obj = options.plainObjects ? Object.create(null) : {}; 38016 var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root; 38017 var index = parseInt(cleanRoot, 10); 38018 if (!options.parseArrays && cleanRoot === '') { 38019 obj = { 0: leaf }; 38020 } else if ( 38021 !isNaN(index) 38022 && root !== cleanRoot 38023 && String(index) === cleanRoot 38024 && index >= 0 38025 && (options.parseArrays && index <= options.arrayLimit) 38026 ) { 38027 obj = []; 38028 obj[index] = leaf; 38029 } else { 38030 obj[cleanRoot] = leaf; 38031 } 38032 } 38033 38034 leaf = obj; 38035 } 38036 38037 return leaf; 38038 }; 38039 38040 var parseKeys = function parseQueryStringKeys(givenKey, val, options) { 38041 if (!givenKey) { 38042 return; 38043 } 38044 38045 // Transform dot notation to bracket notation 38046 var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey; 38047 38048 // The regex chunks 38049 38050 var brackets = /(\[[^[\]]*])/; 38051 var child = /(\[[^[\]]*])/g; 38052 38053 // Get the parent 38054 38055 var segment = brackets.exec(key); 38056 var parent = segment ? key.slice(0, segment.index) : key; 38057 38058 // Stash the parent if it exists 38059 38060 var keys = []; 38061 if (parent) { 38062 // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties 38063 if (!options.plainObjects && has.call(Object.prototype, parent)) { 38064 if (!options.allowPrototypes) { 38065 return; 38066 } 38067 } 38068 38069 keys.push(parent); 38070 } 38071 38072 // Loop through children appending to the array until we hit depth 38073 38074 var i = 0; 38075 while ((segment = child.exec(key)) !== null && i < options.depth) { 38076 i += 1; 38077 if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) { 38078 if (!options.allowPrototypes) { 38079 return; 38080 } 38081 } 38082 keys.push(segment[1]); 38083 } 38084 38085 // If there's a remainder, just add whatever is left 38086 38087 if (segment) { 38088 keys.push('[' + key.slice(segment.index) + ']'); 38089 } 38090 38091 return parseObject(keys, val, options); 38092 }; 38093 38094 var normalizeParseOptions = function normalizeParseOptions(opts) { 38095 if (!opts) { 38096 return defaults; 38097 } 38098 38099 if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') { 38100 throw new TypeError('Decoder has to be a function.'); 38101 } 38102 38103 if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { 38104 throw new Error('The charset option must be either utf-8, iso-8859-1, or undefined'); 38105 } 38106 var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset; 38107 38108 return { 38109 allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots, 38110 allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes, 38111 arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit, 38112 charset: charset, 38113 charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, 38114 comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma, 38115 decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder, 38116 delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter, 38117 depth: typeof opts.depth === 'number' ? opts.depth : defaults.depth, 38118 ignoreQueryPrefix: opts.ignoreQueryPrefix === true, 38119 interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities, 38120 parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit, 38121 parseArrays: opts.parseArrays !== false, 38122 plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects, 38123 strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling 38124 }; 38125 }; 38126 38127 module.exports = function (str, opts) { 38128 var options = normalizeParseOptions(opts); 38129 38130 if (str === '' || str === null || typeof str === 'undefined') { 38131 return options.plainObjects ? Object.create(null) : {}; 38132 } 38133 38134 var tempObj = typeof str === 'string' ? parseValues(str, options) : str; 38135 var obj = options.plainObjects ? Object.create(null) : {}; 38136 38137 // Iterate over the keys and setup the new object 38138 38139 var keys = Object.keys(tempObj); 38140 for (var i = 0; i < keys.length; ++i) { 38141 var key = keys[i]; 38142 var newObj = parseKeys(key, tempObj[key], options); 38143 obj = utils.merge(obj, newObj, options); 38144 } 38145 38146 return utils.compact(obj); 38147 }; 38148 38149 38150/***/ }) 38151/******/ ]);
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.