1var ACT = ACT || {}; 2ACT.HeaderNotifications = (function($) { 3 var notificationTitle = ""; 4 var notificationIcon = ""; 5 var noNotificationsText = ""; 6 var notifications = []; 7 8 /** 9 * Init header notifications, update notification number 10 * and populate popover with correct content 11 * 12 * @param {string} title - Title for the notification popover 13 * @param {string} icon - Icon used to close notifcation popover 14 * @param {string} noNotificationsText - Text to show when there are no notifications 15 * @param {string} notifications - An array of notifications 16 */ 17 var init = function(title, icon, noneText, allNotifications) { 18 noNotificationsText = noneText; 19 notificationTitle = title; 20 notificationIcon = icon; 21 notifications = filterNotifications(allNotifications); 22 }; 23 24 /** 25 * Add header notification listeners 26 */ 27 var addListeners = function() { 28 //Set cookie when header notifications are viewed 29 $(".header-notification", "header").on("shown.bs.popover", function() { 30 $.cookie("header-notifications-viewed", "true"); 31 }); 32 33 //Set listener to capture close icon click 34 $("header").on("click", ".header-notifications-close", function() { 35 $(".header-notification:visible").click(); 36 }); 37 38 //Set listener to capture click not in popover 39 $(document).on('click', function(e) { 40 $('[data-toggle="popover"]').each(function() { 41 //the 'is' for buttons that trigger popups 42 //the 'has' for icons within a button that triggers a popup 43 if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) { 44 (($(this).popover('hide').data('bs.popover')||{}).inState||{}).click = false; 45 } 46 47 }); 48 }); 49 }; 50 51 /** 52 * Loop through notifications and filter for ones that are still valid 53 * based on notification start and end date 54 * 55 * @param {array} notifications - An array of notifications 56 */ 57 var filterNotifications = function(allNotifications) { 58 var arr = []; 59 var i = 0; 60 61 for (i=0; i < allNotifications.length; i++) { 62 if (isNowBetween(allNotifications[i].startDate, allNotifications[i].endDate)) 63 arr.push(allNotifications[i]); 64 } 65 66 return arr; 67 }; 68 69 /** 70 * Get notifications 71 */ 72 var getNotifications = function(){ 73 return notifications; 74 }; 75 76 /** 77 * Get notification count 78 */ 79 var getNotificationContent = function(){ 80 var content = getNoNotificationsText(); 81 82 //If notifications to show update content with list of notifications 83 //and update number of notifications 84 if (getNotificationCount() > 0 ) { 85 var template = compileTemplate(); 86 content = template({ 87 notificationTitle:getNotificationTitle(), 88 notificationIcon:getNotificationIcon(), 89 notifications:getNotifications() 90 }); 91 } 92 93 return content; 94 }; 95 96 /** 97 * Get notification count 98 */ 99 var getNotificationCount = function(){ 100 return notifications.length; 101 }; 102 103 /** 104 * Get notification close icon 105 */ 106 var getNotificationIcon = function(){ 107 return notificationIcon; 108 }; 109 110 /** 111 * Get no notifications text 112 */ 113 var getNoNotificationsText = function(){ 114 return noNotificationsText; 115 }; 116 117 /** 118 * Get notification title 119 */ 120 var getNotificationTitle = function(){ 121 return notificationTitle; 122 }; 123 124 125 /** 126 * Check if now is between start date and end date 127 * 128 * @param {string} startDateString - Start date as a string 129 * @param {string} endDateString - End date as a string 130 */ 131 var isNowBetween = function(startDateString, endDateString) { 132 var now = new Date(); 133 var startDate = new Date(startDateString); 134 var endDate = new Date(endDateString); 135 136 if (startDate <= now && endDate >= now) { 137 return true; 138 } else { 139 return false; 140 } 141 }; 142 143 /** 144 * Render popover and display notification count 145 */ 146 var render = function() { 147 displayNotificationCount(); 148 149 //Set popover options 150 $(".header-notification", "header").popover({ 151 html:true, 152 content:getNotificationContent(), 153 container:"header", 154 placement:"bottom", 155 template:'<div class="popover header-notifications-popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' 156 }); 157 }; 158 159 /** 160 * Show notifications on page load 161 */ 162 var showNotificationsOnPageLoad = function() { 163 if(getNotificationCount() > 0 && ! $.cookie("header-notifications-viewed")) { 164 $(".header-notification:visible", "header").popover("show"); 165 } 166 }; 167 168 /** 169 * Update the display of number of notifications 170 */ 171 var displayNotificationCount = function() { 172 var num = getNotificationCount(); 173 174 if (num > 0 ) { 175 $(".header-notifications-number").html(num).show(); 176 } 177 }; 178 179 /** 180 * Compile the header notification template 181 * @return {function} - Handlebars js function for rendering template 182 */ 183 var compileTemplate = function() { 184 var source = $(".headerNotificationTemplate").html(); 185 return Handlebars.compile(source); 186 }; 187 188 return { 189 init:init, 190 addListeners:addListeners, 191 getNotifications:getNotifications, 192 getNotificationContent:getNotificationContent, 193 getNotificationCount:getNotificationCount, 194 getNotificationIcon:getNotificationIcon, 195 getNoNotificationsText:getNoNotificationsText, 196 getNotificationTitle:getNotificationTitle, 197 render:render, 198 showNotificationsOnPageLoad:showNotificationsOnPageLoad 199 }; 200})(jQuery); 201$(document).ready(function() { 202 $(".exp-tray .panel").on("show.bs.collapse", function() { 203 $(this).find('.tray-toggle').toggleClass('icon-arrow-up2 icon-arrow-down2'); 204 }); 205 206 $(".exp-tray .panel").on("hide.bs.collapse", function() { 207 $(this).find('.tray-toggle').toggleClass('icon-arrow-up2 icon-arrow-down2'); 208 }); 209}); 210var ACT = ACT || {}; 211ACT.UsGlobalModal = (function ($) { 212 var MODAL_IDENTIFIER = "#usGlobalModal"; 213 var US_GLOBAL_MODAL_COOKIE_NAME = "us-global-modal-cookie";
214 var US_GLOBAL_MODAL_COOKIE_EXPIRATION_DAYS = 30; 215 216 var comparison = ""; 217 var compareCountryCodes = ""; 218 var userCountryCode = ""; 219 var enabled = false; 220 221 /** 222 * Init with currentPath and root path for us and intl ACT page 223 * 224 * @param {string} 225 * compare - How the country codes are being compared 226 * @param {string} 227 * countryCodes - Comma separated list of country codes to check against 228 * @param {boolean} 229 * isEnabled - Is modal enabled 230 * 231 * returns void 232 */ 233 var init = function (compare, countryCodes, isEnabled) { 234 comparison = compare; 235 compareCountryCodes = countryCodes; 236 enabled = isEnabled; 237 }; 238 239 /** 240 * Checks if the all the needed variables are set to determine if the modal 241 * should open or not 242 * 243 * returns boolean 244 */ 245 var isModalReady = function () { 246 if (compareCountryCodes != "" && comparison != "" && userCountryCode != "" && enabled) { 247 return true; 248 } 249 250 return false; 251 }; 252 253 /** 254 * Checks to see if the modal should be shown to the user 255 * 256 * returns boolean 257 */ 258 var showModal = function () { 259 if (comparison == "equals") { 260 return (compareCountryCodes.indexOf(userCountryCode) > -1); 261 } else { 262 return (compareCountryCodes.indexOf(userCountryCode) == -1); 263 } 264 }; 265 266 /** 267 * Opens the modal if all the variables are set, and the user's country 268 * code compares correctly the country code list 269 * 270 * returns void 271 */ 272 var openModal = function () { 273 if ($.cookie(US_GLOBAL_MODAL_COOKIE_NAME) != 1) { 274 if (isModalReady() && showModal()) { 275 $(MODAL_IDENTIFIER).modal('show'); 276 $.cookie(US_GLOBAL_MODAL_COOKIE_NAME, 1, { 277 expires : US_GLOBAL_MODAL_COOKIE_EXPIRATION_DAYS, 278 path : '/' 279 }); 280 } 281 } 282 }; 283 284 /** 285 * Sets the country code 286 * 287 * @param {string} 288 * cCode - Country 289 * 290 * returns void 291 */ 292 var setUserCountryCode = function (cCode) { 293 userCountryCode = cCode; 294 }; 295 296 return { 297 init : init, 298 isModalReady : isModalReady, 299 openModal : openModal, 300 setUserCountryCode : setUserCountryCode, 301 showModal : showModal, 302 303 }; 304})($); 305/******************************************************************************* 306 * Copyright 2020 Adobe 307 * 308 * Licensed under the Apache License, Version 2.0 (the "License"); 309 * you may not use this file except in compliance with the License. 310 * You may obtain a copy of the License at 311 * 312 * http://www.apache.org/licenses/LICENSE-2.0 313 * 314 * Unless required by applicable law or agreed to in writing, software 315 * distributed under the License is distributed on an "AS IS" BASIS, 316 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 317 * See the License for the specific language governing permissions and 318 * limitations under the License. 319 ******************************************************************************/ 320(function() { 321 "use strict"; 322 323 window.CQ = window.CQ || {}; 324 window.CQ.CoreComponents = window.CQ.CoreComponents || {}; 325 window.CQ.CoreComponents.container = window.CQ.CoreComponents.container || {}; 326 window.CQ.CoreComponents.container.utils = {}; 327 328 /** 329 * Utilities for Container Components (accordion, tabs) 330 * 331 * @namespace 332 * @alias CQ.CoreComponents.container.utils 333 * @type {{}} 334 */ 335 window.CQ.CoreComponents.container.utils = { 336 337 /** 338 * Removes the hash from the URL. 339 */ 340 removeUrlHash: function() { 341 history.replaceState(undefined, undefined, " "); 342 }, 343 344 /** 345 * Updates the URL hash with the panel ID without scrolling to it. 346 * 347 * @param {Object} component The container component (e.g. Accordion, Carousel, Tabs). 348 * @param {String} itemType The type of the item as defined in the component. 349 * @param {Number} index The index of the container item 350 */ 351 updateUrlHash: function(component, itemType, index) { 352 if (component && component._elements && component._elements[itemType] && 353 component._elements[itemType][index] && component._elements[itemType][index].id) { 354 var ID = component._elements[itemType][index].id; 355 history.replaceState(undefined, undefined, "#" + ID); 356 } 357 }, 358 359 /** 360 * Returns the index of the component item (accordion, carousel, tabs) that: 361 * - either corresponds to the deep link in the URL fragment 362 * - or contains the element that corresponds to the deep link in the URL fragment 363 * 364 * @param {Object} component The container component (Accordion, Carousel or Tabs). 365 * @param {String} itemType The type of the item as defined in the component. 366 * @param {String} itemContentType The type of the item content as defined in the component. 367 * @returns {Number} the index within the items array if the item exists, -1 otherwise. 368 */ 369 getDeepLinkItemIdx: function(component, itemType, itemContentType) { 370 if (window.location.hash) { 371 var deepLinkId = window.location.hash.substring(1); 372 if (deepLinkId && document.getElementById(deepLinkId) && 373 component && component._config && component._config.element && 374 component._elements[itemType] && 375 component._config.element.querySelector("[id='" + deepLinkId + "']")) { 376 for (var i = 0; i < component._elements[itemType].length; i++) { 377 var item = component._elements[itemType][i]; 378 var itemContentContainsId = false;
379 if (component._elements[itemContentType]) { 380 var itemContent = component._elements[itemContentType][i]; 381 itemContentContainsId = itemContent && itemContent.querySelector("[id='" + deepLinkId + "']"); 382 } 383 if (item.id === deepLinkId || itemContentContainsId) { 384 return i; 385 } 386 } 387 } 388 return -1; 389 } 390 return -1; 391 }, 392 393 /** 394 * Returns the item of the container component (accordion, carousel, tabs) that: 395 * - either corresponds to the deep link in the URL fragment 396 * - or contains the element that corresponds to the deep link in the URL fragment 397 * 398 * @param {Object} component The Accordion or Tabs component. 399 * @param {String} itemType The type of the item as defined in the component. 400 * @param {String} itemContentType The type of the item content as defined in the component. 401 * @returns {Object} the item if it exists, undefined otherwise. 402 */ 403 getDeepLinkItem: function(component, itemType, itemContentType) { 404 var idx = window.CQ.CoreComponents.container.utils.getDeepLinkItemIdx(component, itemType, itemContentType); 405 if (component && component._elements && component._elements[itemType]) { 406 return component._elements[itemType][idx]; 407 } 408 }, 409 410 /** 411 * Scrolls the browser on page reload (if URI contains URI fragment) to the item of the container component (accordion, tabs) 412 that corresponds to the deep link in the URI fragment. 413 * This method fixes the issue existent with Chrome and related browsers, which are not scrolling on page reload (if URI contains URI fragment) 414 to the element that corresponds to the deep link in the URI fragment. 415 * Small setTimeout is needed, otherwise the scrolling will not work on Chrome. 416 */ 417 scrollToAnchor: function() { 418 setTimeout(function() { 419 if (window.location.hash) { 420 var id = decodeURIComponent(window.location.hash.substring(1)); 421 var anchorElement = document.getElementById(id); 422 if (anchorElement && anchorElement.offsetTop) { 423 anchorElement.scrollIntoView(); 424 } 425 } 426 }, 100); 427 } 428 }; 429}()); 430 431/******************************************************************************* 432 * Copyright 2019 Adobe 433 * 434 * Licensed under the Apache License, Version 2.0 (the "License"); 435 * you may not use this file except in compliance with the License. 436 * You may obtain a copy of the License at 437 * 438 * http://www.apache.org/licenses/LICENSE2.0 439 * 440 * Unless required by applicable law or agreed to in writing, software 441 * distributed under the License is distributed on an "AS IS" BASIS, 442 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 443 * See the License for the specific language governing permissions and 444 * limitations under the License. 445 ******************************************************************************/ 446 447/** 448 * Element.matches() 449 * https://developer.mozilla.org/enUS/docs/Web/API/Element/matches#Polyfill 450 */ 451if (!Element.prototype.matches) { 452 Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; 453} 454 455// eslint-disable-next-line valid-jsdoc 456/** 457 * Element.closest() 458 * https://developer.mozilla.org/enUS/docs/Web/API/Element/closest#Polyfill 459 */ 460if (!Element.prototype.closest) { 461 Element.prototype.closest = function(s) { 462 "use strict"; 463 var el = this; 464 if (!document.documentElement.contains(el)) { 465 return null; 466 } 467 do { 468 if (el.matches(s)) { 469 return el; 470 } 471 el = el.parentElement || el.parentNode; 472 } while (el !== null && el.nodeType === 1); 473 return null; 474 }; 475} 476 477/******************************************************************************* 478 * Copyright 2019 Adobe 479 * 480 * Licensed under the Apache License, Version 2.0 (the "License");
481 * you may not use this file except in compliance with the License. 482 * You may obtain a copy of the License at 483 * 484 * http://www.apache.org/licenses/LICENSE-2.0 485 * 486 * Unless required by applicable law or agreed to in writing, software 487 * distributed under the License is distributed on an "AS IS" BASIS, 488 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 489 * See the License for the specific language governing permissions and 490 * limitations under the License. 491 ******************************************************************************/ 492(function() { 493 "use strict"; 494 495 var containerUtils = window.CQ && window.CQ.CoreComponents && window.CQ.CoreComponents.container && window.CQ.CoreComponents.container.utils ? window.CQ.CoreComponents.container.utils : undefined; 496 if (!containerUtils) { 497 // eslint-disable-next-line no-console 498 console.warn("Accordion: container utilities at window.CQ.CoreComponents.container.utils are not available. This can lead to missing features. Ensure the core.wcm.components.commons.site.container client library is included on the page."); 499 } 500 var dataLayerEnabled; 501 var dataLayer; 502 var dataLayerName; 503 var delay = 100; 504 505 var NS = "cmp"; 506 var IS = "accordion"; 507 508 var keyCodes = { 509 ENTER: 13, 510 SPACE: 32, 511 END: 35, 512 HOME: 36, 513 ARROW_LEFT: 37, 514 ARROW_UP: 38, 515 ARROW_RIGHT: 39, 516 ARROW_DOWN: 40 517 }; 518 519 var selectors = { 520 self: "[data-" + NS + '-is="' + IS + '"]' 521 }; 522
523 var cssClasses = { 524 button: { 525 disabled: "cmp-accordion__button--disabled", 526 expanded: "cmp-accordion__button--expanded" 527 }, 528 panel: { 529 hidden: "cmp-accordion__panel--hidden", 530 expanded: "cmp-accordion__panel--expanded" 531 } 532 }; 533 534 var dataAttributes = { 535 item: { 536 expanded: "data-cmp-expanded" 537 } 538 }; 539 540 var properties = { 541 /** 542 * Determines whether a single accordion item is forced to be expanded at a time. 543 * Expanding one item will collapse all others. 544 * 545 * @memberof Accordion 546 * @type {Boolean} 547 * @default false 548 */ 549 "singleExpansion": { 550 "default": false, 551 "transform": function(value) { 552 return !(value === null || typeof value === "undefined"); 553 } 554 } 555 }; 556 557 /** 558 * Accordion Configuration. 559 * 560 * @typedef {Object} AccordionConfig Represents an Accordion configuration 561 * @property {HTMLElement} element The HTMLElement representing the Accordion 562 * @property {Object} options The Accordion options 563 */ 564 565 /** 566 * Accordion. 567 * 568 * @class Accordion 569 * @classdesc An interactive Accordion component for toggling panels of related content 570 * @param {AccordionConfig} config The Accordion configuration 571 */ 572 function Accordion(config) { 573 var that = this; 574 575 if (config && config.element) { 576 init(config); 577 } 578 579 /** 580 * Initializes the Accordion. 581 * 582 * @private 583 * @param {AccordionConfig} config The Accordion configuration 584 */ 585 function init(config) { 586 that._config = config; 587 588 // prevents multiple initialization 589 config.element.removeAttribute("data-" + NS + "-is"); 590 591 setupProperties(config.options); 592 cacheElements(config.element); 593 594 if (that._elements["item"]) { 595 // ensures multiple element types are arrays. 596 that._elements["item"] = Array.isArray(that._elements["item"]) ? that._elements["item"] : [that._elements["item"]]; 597 that._elements["button"] = Array.isArray(that._elements["button"]) ? that._elements["button"] : [that._elements["button"]]; 598 that._elements["panel"] = Array.isArray(that._elements["panel"]) ? that._elements["panel"] : [that._elements["panel"]]; 599 600 if (that._properties.singleExpansion) { 601 var expandedItems = getExpandedItems(); 602 // multiple expanded items annotated, display the last item open. 603 if (expandedItems.length > 1) { 604 toggle(expandedItems.length - 1); 605 } 606 } 607 608 refreshItems(); 609 bindEvents(); 610 scrollToDeepLinkIdInAccordion(); 611 } 612 if (window.Granite && window.Granite.author && window.Granite.author.MessageChannel) { 613 /* 614 * Editor message handling: 615 * - subscribe to "cmp.panelcontainer" message requests sent by the editor frame 616 * - check that the message data panel container type is correct and that the id (path) matches this specific Accordion component 617 * - if so, route the "navigate" operation to enact a navigation of the Accordion based on index data 618 */ 619 window.CQ.CoreComponents.MESSAGE_CHANNEL = window.CQ.CoreComponents.MESSAGE_CHANNEL || new window.Granite.author.MessageChannel("cqauthor", window); 620 window.CQ.CoreComponents.MESSAGE_CHANNEL.subscribeRequestMessage("cmp.panelcontainer", function(message) { 621 if (message.data && message.data.type === "cmp-accordion" && message.data.id === that._elements.self.dataset["cmpPanelcontainerId"]) { 622 if (message.data.operation === "navigate") { 623 // switch to single expansion mode when navigating in edit mode. 624 var singleExpansion = that._properties.singleExpansion; 625 that._properties.singleExpansion = true; 626 toggle(message.data.index); 627 628 // revert to the configured state. 629 that._properties.singleExpansion = singleExpansion; 630 } 631 } 632 }); 633 } 634 } 635 636 /**
637 * Displays the panel containing the element that corresponds to the deep link in the URI fragment 638 * and scrolls the browser to this element. 639 */ 640 function scrollToDeepLinkIdInAccordion() { 641 if (containerUtils) { 642 var deepLinkItemIdx = containerUtils.getDeepLinkItemIdx(that, "item", "item"); 643 if (deepLinkItemIdx > -1) { 644 var deepLinkItem = that._elements["item"][deepLinkItemIdx]; 645 if (deepLinkItem && !deepLinkItem.hasAttribute(dataAttributes.item.expanded)) { 646 // if single expansion: close all accordion items 647 if (that._properties.singleExpansion) { 648 for (var j = 0; j < that._elements["item"].length; j++) { 649 if (that._elements["item"][j].hasAttribute(dataAttributes.item.expanded)) { 650 setItemExpanded(that._elements["item"][j], false, true); 651 } 652 } 653 } 654 // expand the accordion item containing the deep link 655 setItemExpanded(deepLinkItem, true, true); 656 } 657 var hashId = window.location.hash.substring(1); 658 if (hashId) { 659 var hashItem = document.querySelector("[id='" + hashId + "']"); 660 if (hashItem) { 661 hashItem.scrollIntoView(); 662 } 663 } 664 } 665 } 666 } 667 668 /** 669 * Caches the Accordion elements as defined via the {@code data-accordion-hook="ELEMENT_NAME"} markup API. 670 * 671 * @private 672 * @param {HTMLElement} wrapper The Accordion wrapper element 673 */ 674 function cacheElements(wrapper) { 675 that._elements = {}; 676 that._elements.self = wrapper; 677 var hooks = that._elements.self.querySelectorAll("[data-" + NS + "-hook-" + IS + "]"); 678 679 for (var i = 0; i < hooks.length; i++) { 680 var hook = hooks[i]; 681 if (hook.closest("." + NS + "-" + IS) === that._elements.self) { // only process own accordion elements 682 var capitalized = IS; 683 capitalized = capitalized.charAt(0).toUpperCase() + capitalized.slice(1); 684 var key = hook.dataset[NS + "Hook" + capitalized]; 685 if (that._elements[key]) { 686 if (!Array.isArray(that._elements[key])) { 687 var tmp = that._elements[key]; 688 that._elements[key] = [tmp]; 689 } 690 that._elements[key].push(hook); 691 } else { 692 that._elements[key] = hook; 693 } 694 } 695 } 696 } 697 698 /** 699 * Sets up properties for the Accordion based on the passed options. 700 * 701 * @private 702 * @param {Object} options The Accordion options 703 */ 704 function setupProperties(options) { 705 that._properties = {}; 706 707 for (var key in properties) { 708 if (Object.prototype.hasOwnProperty.call(properties, key)) { 709 var property = properties[key]; 710 var value = null; 711 712 if (options && options[key] != null) { 713 value = options[key]; 714 715 // transform the provided option 716 if (property && typeof property.transform === "function") { 717 value = property.transform(value); 718 } 719 } 720 721 if (value === null) { 722 // value still null, take the property default 723 value = properties[key]["default"]; 724 } 725 726 that._properties[key] = value; 727 } 728 } 729 } 730 731 /** 732 * Binds Accordion event handling. 733 * 734 * @private 735 */ 736 function bindEvents() { 737 window.addEventListener("hashchange", scrollToDeepLinkIdInAccordion, false); 738 var buttons = that._elements["button"]; 739 if (buttons) { 740 for (var i = 0; i < buttons.length; i++) { 741 (function(index) { 742 buttons[i].addEventListener("click", function(event) { 743 toggle(index); 744 focusButton(index); 745 }); 746 buttons[i].addEventListener("keydown", function(event) { 747 onButtonKeyDown(event, index); 748 }); 749 })(i); 750 } 751 } 752 } 753 754 /** 755 * Handles button keydown events. 756 * 757 * @private 758 * @param {Object} event The keydown event 759 * @param {Number} index The index of the button triggering the event 760 */ 761 function onButtonKeyDown(event, index) { 762 var lastIndex = that._elements["button"].length - 1; 763 764 switch (event.keyCode) { 765 case keyCodes.ARROW_LEFT: 766 case keyCodes.ARROW_UP: 767 event.preventDefault(); 768 if (index > 0) { 769 focusButton(index - 1); 770 } 771 break; 772 case keyCodes.ARROW_RIGHT: 773 case keyCodes.ARROW_DOWN: 774 event.preventDefault(); 775 if (index < lastIndex) { 776 focusButton(index + 1); 777 } 778 break; 779 case keyCodes.HOME: 780 event.preventDefault(); 781 focusButton(0); 782 break; 783 case keyCodes.END: 784 event.preventDefault(); 785 focusButton(lastIndex); 786 break;
787 case keyCodes.ENTER: 788 case keyCodes.SPACE: 789 event.preventDefault(); 790 toggle(index); 791 focusButton(index); 792 break; 793 default: 794 return; 795 } 796 } 797 798 /** 799 * General handler for toggle of an item. 800 * 801 * @private 802 * @param {Number} index The index of the item to toggle 803 */ 804 function toggle(index) { 805 var item = that._elements["item"][index]; 806 if (item) { 807 if (that._properties.singleExpansion) { 808 // ensure only a single item is expanded if single expansion is enabled. 809 for (var i = 0; i < that._elements["item"].length; i++) { 810 if (that._elements["item"][i] !== item) { 811 var expanded = getItemExpanded(that._elements["item"][i]); 812 if (expanded) { 813 setItemExpanded(that._elements["item"][i], false); 814 } 815 } 816 } 817 } 818 setItemExpanded(item, !getItemExpanded(item)); 819 820 if (dataLayerEnabled) { 821 var accordionId = that._elements.self.id; 822 var expandedItems = getExpandedItems() 823 .map(function(item) { 824 return getDataLayerId(item); 825 }); 826 827 var uploadPayload = { component: {} }; 828 uploadPayload.component[accordionId] = { shownItems: expandedItems }; 829 830 var removePayload = { component: {} }; 831 removePayload.component[accordionId] = { shownItems: undefined }; 832 833 dataLayer.push(removePayload); 834 dataLayer.push(uploadPayload); 835 } 836 } 837 } 838 839 /** 840 * Sets an item's expanded state based on the provided flag and refreshes its internals. 841 * 842 * @private 843 * @param {HTMLElement} item The item to mark as expanded, or not expanded 844 * @param {Boolean} expanded true to mark the item expanded, false otherwise 845 * @param {Boolean} keepHash true to keep the hash in the URL, false to update it 846 */ 847 function setItemExpanded(item, expanded, keepHash) { 848 if (expanded) { 849 item.setAttribute(dataAttributes.item.expanded, ""); 850 var index = that._elements["item"].indexOf(item); 851 if (!keepHash && containerUtils) { 852 containerUtils.updateUrlHash(that, "item", index); 853 } 854 if (dataLayerEnabled) { 855 dataLayer.push({ 856 event: "cmp:show", 857 eventInfo: { 858 path: "component." + getDataLayerId(item) 859 } 860 }); 861 } 862 863 } else { 864 item.removeAttribute(dataAttributes.item.expanded); 865 if (!keepHash && containerUtils) { 866 containerUtils.removeUrlHash(); 867 } 868 if (dataLayerEnabled) { 869 dataLayer.push({ 870 event: "cmp:hide", 871 eventInfo: { 872 path: "component." + getDataLayerId(item) 873 } 874 }); 875 } 876 } 877 refreshItem(item); 878 } 879 880 /** 881 * Gets an item's expanded state. 882 * 883 * @private 884 * @param {HTMLElement} item The item for checking its expanded state 885 * @returns {Boolean} true if the item is expanded, false otherwise 886 */ 887 function getItemExpanded(item) { 888 return item && item.dataset && item.dataset["cmpExpanded"] !== undefined; 889 } 890 891 /** 892 * Refreshes an item based on its expanded state. 893 * 894 * @private 895 * @param {HTMLElement} item The item to refresh 896 */ 897 function refreshItem(item) { 898 var expanded = getItemExpanded(item); 899 if (expanded) { 900 expandItem(item); 901 } else { 902 collapseItem(item); 903 } 904 } 905 906 /** 907 * Refreshes all items based on their expanded state. 908 * 909 * @private 910 */ 911 function refreshItems() { 912 for (var i = 0; i < that._elements["item"].length; i++) { 913 refreshItem(that._elements["item"][i]); 914 } 915 } 916 917 /** 918 * Returns all expanded items. 919 * 920 * @private 921 * @returns {HTMLElement[]} The expanded items 922 */ 923 function getExpandedItems() { 924 var expandedItems = []; 925 926 for (var i = 0; i < that._elements["item"].length; i++) { 927 var item = that._elements["item"][i]; 928 var expanded = getItemExpanded(item); 929 if (expanded) { 930 expandedItems.push(item); 931 } 932 } 933 934 return expandedItems; 935 } 936 937 /** 938 * Annotates the item and its internals with 939 * the necessary style and accessibility attributes to indicate it is expanded. 940 * 941 * @private 942 * @param {HTMLElement} item The item to annotate as expanded 943 */ 944 function expandItem(item) { 945 var index = that._elements["item"].indexOf(item); 946 if (index > -1) { 947 var button = that._elements["button"][index]; 948 var panel = that._elements["panel"][index];
949 button.classList.add(cssClasses.button.expanded); 950 // used to fix some known screen readers issues in reading the correct state of the 'aria-expanded' attribute 951 // e.g. https://bugs.webkit.org/show_bug.cgi?id=210934 952 setTimeout(function() { 953 button.setAttribute("aria-expanded", true); 954 }, delay); 955 panel.classList.add(cssClasses.panel.expanded); 956 panel.classList.remove(cssClasses.panel.hidden); 957 panel.setAttribute("aria-hidden", false); 958 } 959 } 960 961 /** 962 * Annotates the item and its internals with 963 * the necessary style and accessibility attributes to indicate it is not expanded. 964 * 965 * @private 966 * @param {HTMLElement} item The item to annotate as not expanded 967 */ 968 function collapseItem(item) { 969 var index = that._elements["item"].indexOf(item); 970 if (index > -1) { 971 var button = that._elements["button"][index]; 972 var panel = that._elements["panel"][index]; 973 button.classList.remove(cssClasses.button.expanded); 974 // used to fix some known screen readers issues in reading the correct state of the 'aria-expanded' attribute 975 // e.g. https://bugs.webkit.org/show_bug.cgi?id=210934 976 setTimeout(function() { 977 button.setAttribute("aria-expanded", false); 978 }, delay); 979 panel.classList.add(cssClasses.panel.hidden); 980 panel.classList.remove(cssClasses.panel.expanded); 981 panel.setAttribute("aria-hidden", true); 982 } 983 } 984 985 /** 986 * Focuses the button at the provided index. 987 * 988 * @private 989 * @param {Number} index The index of the button to focus 990 */ 991 function focusButton(index) { 992 var button = that._elements["button"][index]; 993 button.focus(); 994 } 995 } 996 997 /** 998 * Reads options data from the Accordion wrapper element, defined via {@code data-cmp-*} data attributes. 999 * 1000 * @private 1001 * @param {HTMLElement} element The Accordion element to read options data from 1002 * @returns {Object} The options read from the component data attributes 1003 */ 1004 function readData(element) { 1005 var data = element.dataset; 1006 var options = []; 1007 var capitalized = IS; 1008 capitalized = capitalized.charAt(0).toUpperCase() + capitalized.slice(1); 1009 var reserved = ["is", "hook" + capitalized]; 1010 1011 for (var key in data) { 1012 if (Object.prototype.hasOwnProperty.call(data, key)) { 1013 var value = data[key]; 1014 1015 if (key.indexOf(NS) === 0) { 1016 key = key.slice(NS.length); 1017 key = key.charAt(0).toLowerCase() + key.substring(1); 1018 1019 if (reserved.indexOf(key) === -1) { 1020 options[key] = value; 1021 } 1022 } 1023 } 1024 } 1025 1026 return options; 1027 } 1028 1029 /** 1030 * Parses the dataLayer string and returns the ID 1031 * 1032 * @private 1033 * @param {HTMLElement} item the accordion item 1034 * @returns {String} dataLayerId or undefined 1035 */ 1036 function getDataLayerId(item) { 1037 if (item) { 1038 if (item.dataset.cmpDataLayer) { 1039 return Object.keys(JSON.parse(item.dataset.cmpDataLayer))[0]; 1040 } else { 1041 return item.id; 1042 } 1043 } 1044 return null; 1045 } 1046 1047 /** 1048 * Document ready handler and DOM mutation observers. Initializes Accordion components as necessary. 1049 * 1050 * @private 1051 */ 1052 function onDocumentReady() { 1053 dataLayerEnabled = document.body.hasAttribute("data-cmp-data-layer-enabled"); 1054 if (dataLayerEnabled) { 1055 dataLayerName = document.body.getAttribute("data-cmp-data-layer-name") || "adobeDataLayer"; 1056 dataLayer = window[dataLayerName] = window[dataLayerName] || []; 1057 } 1058 1059 var elements = document.querySelectorAll(selectors.self); 1060 for (var i = 0; i < elements.length; i++) { 1061 new Accordion({ element: elements[i], options: readData(elements[i]) }); 1062 } 1063 1064 var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; 1065 var body = document.querySelector("body"); 1066 var observer = new MutationObserver(function(mutations) { 1067 mutations.forEach(function(mutation) { 1068 // needed for IE 1069 var nodesArray = [].slice.call(mutation.addedNodes); 1070 if (nodesArray.length > 0) { 1071 nodesArray.forEach(function(addedNode) { 1072 if (addedNode.querySelectorAll) { 1073 var elementsArray = [].slice.call(addedNode.querySelectorAll(selectors.self)); 1074 elementsArray.forEach(function(element) { 1075 new Accordion({ element: element, options: readData(element) }); 1076 }); 1077 } 1078 }); 1079 } 1080 }); 1081 }); 1082 1083 observer.observe(body, { 1084 subtree: true, 1085 childList: true, 1086 characterData: true 1087 }); 1088 } 1089 1090 if (document.readyState !== "loading") { 1091 onDocumentReady(); 1092 } else { 1093 document.addEventListener("DOMContentLoaded", onDocumentReady); 1094 } 1095 1096 if (containerUtils) { 1097 window.addEventListener("load", containerUtils.scrollToAnchor, false); 1098 } 1099 1100}()); 1101 1102/******************************************************************************* 1103 * Copyright 2018 Adobe 1104 * 1105 * Licensed under the Apache License, Version 2.0 (the "License");
1106 * you may not use this file except in compliance with the License. 1107 * You may obtain a copy of the License at 1108 * 1109 * http://www.apache.org/licenses/LICENSE2.0 1110 * 1111 * Unless required by applicable law or agreed to in writing, software 1112 * distributed under the License is distributed on an "AS IS" BASIS, 1113 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1114 * See the License for the specific language governing permissions and 1115 * limitations under the License. 1116 ******************************************************************************/ 1117 1118/** 1119 * Element.matches() 1120 * https://developer.mozilla.org/enUS/docs/Web/API/Element/matches#Polyfill 1121 */ 1122if (!Element.prototype.matches) { 1123 Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; 1124} 1125 1126// eslint-disable-next-line valid-jsdoc 1127/** 1128 * Element.closest() 1129 * https://developer.mozilla.org/enUS/docs/Web/API/Element/closest#Polyfill 1130 */ 1131if (!Element.prototype.closest) { 1132 Element.prototype.closest = function(s) { 1133 "use strict"; 1134 var el = this; 1135 if (!document.documentElement.contains(el)) { 1136 return null; 1137 } 1138 do { 1139 if (el.matches(s)) { 1140 return el; 1141 } 1142 el = el.parentElement || el.parentNode; 1143 } while (el !== null && el.nodeType === 1); 1144 return null; 1145 }; 1146} 1147 1148/******************************************************************************* 1149 * Copyright 2018 Adobe 1150 * 1151 * Licensed under the Apache License, Version 2.0 (the "License"); 1152 * you may not use this file except in compliance with the License. 1153 * You may obtain a copy of the License at 1154 * 1155 * http://www.apache.org/licenses/LICENSE-2.0 1156 * 1157 * Unless required by applicable law or agreed to in writing, software 1158 * distributed under the License is distributed on an "AS IS" BASIS, 1159 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1160 * See the License for the specific language governing permissions and 1161 * limitations under the License. 1162 ******************************************************************************/ 1163/* global 1164 CQ 1165 */ 1166(function() { 1167 "use strict"; 1168 1169 var containerUtils = window.CQ && window.CQ.CoreComponents && window.CQ.CoreComponents.container && window.CQ.CoreComponents.container.utils ? window.CQ.CoreComponents.container.utils : undefined; 1170 if (!containerUtils) { 1171 // eslint-disable-next-line no-console 1172 console.warn("Tabs: container utilities at window.CQ.CoreComponents.container.utils are not available. This can lead to missing features. Ensure the core.wcm.components.commons.site.container client library is included on the page."); 1173 } 1174 var dataLayerEnabled; 1175 var dataLayer; 1176 var dataLayerName; 1177 1178 var NS = "cmp"; 1179 var IS = "tabs"; 1180 1181 var keyCodes = { 1182 END: 35, 1183 HOME: 36, 1184 ARROW_LEFT: 37, 1185 ARROW_UP: 38, 1186 ARROW_RIGHT: 39, 1187 ARROW_DOWN: 40 1188 }; 1189 1190 var selectors = { 1191 self: "[data-" + NS + '-is="' + IS + '"]', 1192 active: { 1193 tab: "cmp-tabs__tab--active", 1194 tabpanel: "cmp-tabs__tabpanel--active" 1195 } 1196 }; 1197 1198 /** 1199 * Tabs Configuration 1200 * 1201 * @typedef {Object} TabsConfig Represents a Tabs configuration 1202 * @property {HTMLElement} element The HTMLElement representing the Tabs 1203 * @property {Object} options The Tabs options 1204 */ 1205 1206 /** 1207 * Tabs 1208 * 1209 * @class Tabs 1210 * @classdesc An interactive Tabs component for navigating a list of tabs 1211 * @param {TabsConfig} config The Tabs configuration 1212 */ 1213 function Tabs(config) { 1214 var that = this; 1215 1216 if (config && config.element) { 1217 init(config); 1218 } 1219 1220 /** 1221 * Initializes the Tabs 1222 * 1223 * @private 1224 * @param {TabsConfig} config The Tabs configuration 1225 */ 1226 function init(config) { 1227 that._config = config; 1228 1229 // prevents multiple initialization 1230 config.element.removeAttribute("data-" + NS + "-is"); 1231 1232 cacheElements(config.element); 1233 that._active = getActiveIndex(that._elements["tab"]); 1234 1235 if (that._elements.tabpanel) { 1236 refreshActive(); 1237 bindEvents(); 1238 scrollToDeepLinkIdInTabs(); 1239 } 1240 1241 if (window.Granite && window.Granite.author && window.Granite.author.MessageChannel) { 1242 /* 1243 * Editor message handling: 1244 * - subscribe to "cmp.panelcontainer" message requests sent by the editor frame
1245 * - check that the message data panel container type is correct and that the id (path) matches this specific Tabs component 1246 * - if so, route the "navigate" operation to enact a navigation of the Tabs based on index data 1247 */ 1248 CQ.CoreComponents.MESSAGE_CHANNEL = CQ.CoreComponents.MESSAGE_CHANNEL || new window.Granite.author.MessageChannel("cqauthor", window); 1249 CQ.CoreComponents.MESSAGE_CHANNEL.subscribeRequestMessage("cmp.panelcontainer", function(message) { 1250 if (message.data && message.data.type === "cmp-tabs" && message.data.id === that._elements.self.dataset["cmpPanelcontainerId"]) { 1251 if (message.data.operation === "navigate") { 1252 navigate(message.data.index); 1253 } 1254 } 1255 }); 1256 } 1257 } 1258 1259 /** 1260 * Displays the panel containing the element that corresponds to the deep link in the URI fragment 1261 * and scrolls the browser to this element. 1262 */ 1263 function scrollToDeepLinkIdInTabs() { 1264 if (containerUtils) { 1265 var deepLinkItemIdx = containerUtils.getDeepLinkItemIdx(that, "tab", "tabpanel"); 1266 if (deepLinkItemIdx > -1) { 1267 var deepLinkItem = that._elements["tab"][deepLinkItemIdx]; 1268 if (deepLinkItem && that._elements["tab"][that._active].id !== deepLinkItem.id) { 1269 navigateAndFocusTab(deepLinkItemIdx, true); 1270 } 1271 var hashId = window.location.hash.substring(1); 1272 if (hashId) { 1273 var hashItem = document.querySelector("[id='" + hashId + "']"); 1274 if (hashItem) { 1275 hashItem.scrollIntoView(); 1276 } 1277 } 1278 } 1279 } 1280 } 1281 1282 /** 1283 * Returns the index of the active tab, if no tab is active returns 0 1284 * 1285 * @param {Array} tabs Tab elements 1286 * @returns {Number} Index of the active tab, 0 if none is active 1287 */ 1288 function getActiveIndex(tabs) { 1289 if (tabs) { 1290 for (var i = 0; i < tabs.length; i++) { 1291 if (tabs[i].classList.contains(selectors.active.tab)) { 1292 return i; 1293 } 1294 } 1295 } 1296 return 0; 1297 } 1298 1299 /** 1300 * Caches the Tabs elements as defined via the {@code data-tabs-hook="ELEMENT_NAME"} markup API 1301 * 1302 * @private 1303 * @param {HTMLElement} wrapper The Tabs wrapper element 1304 */ 1305 function cacheElements(wrapper) { 1306 that._elements = {}; 1307 that._elements.self = wrapper; 1308 var hooks = that._elements.self.querySelectorAll("[data-" + NS + "-hook-" + IS + "]"); 1309 1310 for (var i = 0; i < hooks.length; i++) { 1311 var hook = hooks[i]; 1312 if (hook.closest("." + NS + "-" + IS) === that._elements.self) { // only process own tab elements 1313 var capitalized = IS; 1314 capitalized = capitalized.charAt(0).toUpperCase() + capitalized.slice(1); 1315 var key = hook.dataset[NS + "Hook" + capitalized]; 1316 if (that._elements[key]) { 1317 if (!Array.isArray(that._elements[key])) { 1318 var tmp = that._elements[key]; 1319 that._elements[key] = [tmp]; 1320 } 1321 that._elements[key].push(hook); 1322 } else { 1323 that._elements[key] = hook; 1324 } 1325 } 1326 } 1327 } 1328 1329 /** 1330 * Binds Tabs event handling 1331 * 1332 * @private 1333 */ 1334 function bindEvents() { 1335 window.addEventListener("hashchange", scrollToDeepLinkIdInTabs, false); 1336 var tabs = that._elements["tab"]; 1337 if (tabs) { 1338 for (var i = 0; i < tabs.length; i++) { 1339 (function(index) { 1340 tabs[i].addEventListener("click", function(event) { 1341 navigateAndFocusTab(index); 1342 }); 1343 tabs[i].addEventListener("keydown", function(event) { 1344 onKeyDown(event); 1345 }); 1346 })(i); 1347 } 1348 } 1349 } 1350 1351 /** 1352 * Handles tab keydown events 1353 * 1354 * @private 1355 * @param {Object} event The keydown event 1356 */ 1357 function onKeyDown(event) { 1358 var index = that._active; 1359 var lastIndex = that._elements["tab"].length - 1; 1360 1361 switch (event.keyCode) { 1362 case keyCodes.ARROW_LEFT: 1363 case keyCodes.ARROW_UP: 1364 event.preventDefault(); 1365 if (index > 0) { 1366 navigateAndFocusTab(index - 1); 1367 } 1368 break; 1369 case keyCodes.ARROW_RIGHT: 1370 case keyCodes.ARROW_DOWN: 1371 event.preventDefault(); 1372 if (index < lastIndex) { 1373 navigateAndFocusTab(index + 1); 1374 } 1375 break; 1376 case keyCodes.HOME: 1377 event.preventDefault(); 1378 navigateAndFocusTab(0); 1379 break; 1380 case keyCodes.END: 1381 event.preventDefault(); 1382 navigateAndFocusTab(lastIndex); 1383 break; 1384 default: 1385 return; 1386 } 1387 } 1388 1389 /** 1390 * Refreshes the tab markup based on the current {@code Tabs#_active} index 1391 * 1392 * @private 1393 */ 1394 function refreshActive() { 1395 var tabpanels = that._elements["tabpanel"]; 1396 var tabs = that._elements["tab"]; 1397 1398 if (tabpanels) { 1399 if (Array.isArray(tabpanels)) { 1400 for (var i = 0; i < tabpanels.length; i++) { 1401 if (i === parseInt(that._active)) { 1402 tabpanels[i].classList.add(selectors.active.tabpanel); 1403 tabpanels[i].removeAttribute("aria-hidden"); 1404 tabs[i].classList.add(selectors.active.tab); 1405 tabs[i].setAttribute("aria-selected", true); 1406 tabs[i].setAttribute("tabindex", "0"); 1407 } else { 1408 tabpanels[i].classList.remove(selectors.active.tabpanel); 1409 tabpanels[i].setAttribute("aria-hidden", true); 1410 tabs[i].classList.remove(selectors.active.tab); 1411 tabs[i].setAttribute("aria-selected", false); 1412 tabs[i].setAttribute("tabindex", "-1"); 1413 } 1414 } 1415 } else { 1416 // only one tab 1417 tabpanels.classList.add(selectors.active.tabpanel); 1418 tabs.classList.add(selectors.active.tab); 1419 } 1420 } 1421 } 1422 1423 /** 1424 * Focuses the element and prevents scrolling the element into view 1425 * 1426 * @param {HTMLElement} element Element to focus 1427 */ 1428 function focusWithoutScroll(element) { 1429 var x = window.scrollX || window.pageXOffset; 1430 var y = window.scrollY || window.pageYOffset; 1431 element.focus(); 1432 window.scrollTo(x, y); 1433 } 1434 1435 /** 1436 * Navigates to the tab at the provided index 1437 * 1438 * @private 1439 * @param {Number} index The index of the tab to navigate to 1440 */ 1441 function navigate(index) { 1442 that._active = index; 1443 refreshActive(); 1444 } 1445 1446 /** 1447 * Navigates to the item at the provided index and ensures the active tab gains focus 1448 * 1449 * @private 1450 * @param {Number} index The index of the item to navigate to 1451 * @param {Boolean} keepHash true to keep the hash in the URL, false to update it 1452 */ 1453 function navigateAndFocusTab(index, keepHash) { 1454 var exActive = that._active; 1455 if (!keepHash && containerUtils) { 1456 containerUtils.updateUrlHash(that, "tab", index); 1457 } 1458 navigate(index); 1459 focusWithoutScroll(that._elements["tab"][index]); 1460 1461 if (dataLayerEnabled) { 1462 1463 var activeItem = getDataLayerId(that._elements.tabpanel[index]); 1464 var exActiveItem = getDataLayerId(that._elements.tabpanel[exActive]); 1465 1466 dataLayer.push({ 1467 event: "cmp:show", 1468 eventInfo: { 1469 path: "component." + activeItem 1470 } 1471 }); 1472 1473 dataLayer.push({ 1474 event: "cmp:hide", 1475 eventInfo: { 1476 path: "component." + exActiveItem 1477 } 1478 }); 1479 1480 var tabsId = that._elements.self.id; 1481 var uploadPayload = { component: {} }; 1482 uploadPayload.component[tabsId] = { shownItems: [activeItem] }; 1483 1484 var removePayload = { component: {} }; 1485 removePayload.component[tabsId] = { shownItems: undefined }; 1486 1487 dataLayer.push(removePayload); 1488 dataLayer.push(uploadPayload); 1489 } 1490 } 1491 } 1492 1493 /**
1494 * Reads options data from the Tabs wrapper element, defined via {@code data-cmp-*} data attributes 1495 * 1496 * @private 1497 * @param {HTMLElement} element The Tabs element to read options data from 1498 * @returns {Object} The options read from the component data attributes 1499 */ 1500 function readData(element) { 1501 var data = element.dataset; 1502 var options = []; 1503 var capitalized = IS; 1504 capitalized = capitalized.charAt(0).toUpperCase() + capitalized.slice(1); 1505 var reserved = ["is", "hook" + capitalized]; 1506 1507 for (var key in data) { 1508 if (Object.prototype.hasOwnProperty.call(data, key)) { 1509 var value = data[key]; 1510 1511 if (key.indexOf(NS) === 0) { 1512 key = key.slice(NS.length); 1513 key = key.charAt(0).toLowerCase() + key.substring(1); 1514 1515 if (reserved.indexOf(key) === -1) { 1516 options[key] = value; 1517 } 1518 } 1519 } 1520 } 1521 1522 return options; 1523 } 1524 1525 /** 1526 * Parses the dataLayer string and returns the ID 1527 * 1528 * @private 1529 * @param {HTMLElement} item the accordion item 1530 * @returns {String} dataLayerId or undefined 1531 */ 1532 function getDataLayerId(item) { 1533 if (item) { 1534 if (item.dataset.cmpDataLayer) { 1535 return Object.keys(JSON.parse(item.dataset.cmpDataLayer))[0]; 1536 } else { 1537 return item.id; 1538 } 1539 } 1540 return null; 1541 } 1542 1543 /** 1544 * Document ready handler and DOM mutation observers. Initializes Tabs components as necessary. 1545 * 1546 * @private 1547 */ 1548 function onDocumentReady() { 1549 dataLayerEnabled = document.body.hasAttribute("data-cmp-data-layer-enabled"); 1550 if (dataLayerEnabled) { 1551 dataLayerName = document.body.getAttribute("data-cmp-data-layer-name") || "adobeDataLayer"; 1552 dataLayer = window[dataLayerName] = window[dataLayerName] || []; 1553 } 1554 1555 var elements = document.querySelectorAll(selectors.self); 1556 for (var i = 0; i < elements.length; i++) { 1557 new Tabs({ element: elements[i], options: readData(elements[i]) }); 1558 } 1559 1560 var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; 1561 var body = document.querySelector("body"); 1562 var observer = new MutationObserver(function(mutations) { 1563 mutations.forEach(function(mutation) { 1564 // needed for IE 1565 var nodesArray = [].slice.call(mutation.addedNodes); 1566 if (nodesArray.length > 0) { 1567 nodesArray.forEach(function(addedNode) { 1568 if (addedNode.querySelectorAll) { 1569 var elementsArray = [].slice.call(addedNode.querySelectorAll(selectors.self)); 1570 elementsArray.forEach(function(element) { 1571 new Tabs({ element: element, options: readData(element) }); 1572 }); 1573 } 1574 }); 1575 } 1576 }); 1577 }); 1578 1579 observer.observe(body, { 1580 subtree: true, 1581 childList: true, 1582 characterData: true 1583 }); 1584 } 1585 1586 if (document.readyState !== "loading") { 1587 onDocumentReady(); 1588 } else { 1589 document.addEventListener("DOMContentLoaded", onDocumentReady); 1590 } 1591 1592 if (containerUtils) { 1593 window.addEventListener("load", containerUtils.scrollToAnchor, false); 1594 } 1595 1596}()); 1597 1598/******************************************************************************* 1599 * Copyright 2022 Adobe 1600 * 1601 * Licensed under the Apache License, Version 2.0 (the "License"); 1602 * you may not use this file except in compliance with the License. 1603 * You may obtain a copy of the License at 1604 * 1605 * http://www.apache.org/licenses/LICENSE-2.0 1606 * 1607 * Unless required by applicable law or agreed to in writing, software 1608 * distributed under the License is distributed on an "AS IS" BASIS, 1609 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1610 * See the License for the specific language governing permissions and 1611 * limitations under the License. 1612 ******************************************************************************/ 1613(function(document) { 1614 "use strict"; 1615 1616 window.CMP = window.CMP || {}; 1617 window.CMP.utils = (function() { 1618 var NS = "cmp"; 1619 1620 /**
1621 * Reads options data from the Component wrapper element, defined via {@code data-cmp-*} data attributes 1622 * 1623 * @param {HTMLElement} element The component element to read options data from 1624 * @param {String} is The component identifier 1625 * @returns {String[]} The options read from the component data attributes 1626 */ 1627 var readData = function(element, is) { 1628 var data = element.dataset; 1629 var options = []; 1630 var capitalized = is; 1631 capitalized = capitalized.charAt(0).toUpperCase() + capitalized.slice(1); 1632 var reserved = ["is", "hook" + capitalized]; 1633 1634 for (var key in data) { 1635 if (Object.prototype.hasOwnProperty.call(data, key)) { 1636 var value = data[key]; 1637 1638 if (key.indexOf(NS) === 0) { 1639 key = key.slice(NS.length); 1640 key = key.charAt(0).toLowerCase() + key.substring(1); 1641 1642 if (reserved.indexOf(key) === -1) { 1643 options[key] = value; 1644 } 1645 } 1646 } 1647 } 1648 return options; 1649 }; 1650 1651 /** 1652 * Set up the final properties of a component by evaluating the transform function or fall back to the default value on demand 1653 * @param {String[]} options the options to transform 1654 * @param {Object} properties object of properties of property functions 1655 * @returns {Object} transformed properties 1656 */ 1657 var setupProperties = function(options, properties) { 1658 var transformedProperties = {}; 1659 1660 for (var key in properties) { 1661 if (Object.prototype.hasOwnProperty.call(properties, key)) { 1662 var property = properties[key]; 1663 if (options && options[key] != null) { 1664 if (property && typeof property.transform === "function") { 1665 transformedProperties[key] = property.transform(options[key]); 1666 } else { 1667 transformedProperties[key] = options[key]; 1668 } 1669 } else { 1670 transformedProperties[key] = properties[key]["default"]; 1671 } 1672 } 1673 } 1674 return transformedProperties; 1675 }; 1676 1677 1678 return { 1679 readData: readData, 1680 setupProperties: setupProperties 1681 }; 1682 }()); 1683}(window.document)); 1684 1685/******************************************************************************* 1686 * Copyright 2018 Adobe 1687 * 1688 * Licensed under the Apache License, Version 2.0 (the "License"); 1689 * you may not use this file except in compliance with the License. 1690 * You may obtain a copy of the License at 1691 * 1692 * http://www.apache.org/licenses/LICENSE-2.0 1693 * 1694 * Unless required by applicable law or agreed to in writing, software 1695 * distributed under the License is distributed on an "AS IS" BASIS, 1696 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1697 * See the License for the specific language governing permissions and 1698 * limitations under the License. 1699 ******************************************************************************/ 1700(function() { 1701 "use strict"; 1702 1703 var containerUtils = window.CQ && window.CQ.CoreComponents && window.CQ.CoreComponents.container && window.CQ.CoreComponents.container.utils ? window.CQ.CoreComponents.container.utils : undefined; 1704 if (!containerUtils) { 1705 // eslint-disable-next-line no-console 1706 console.warn("Tabs: container utilities at window.CQ.CoreComponents.container.utils are not available. This can lead to missing features. Ensure the core.wcm.components.commons.site.container client library is included on the page."); 1707 } 1708 var dataLayerEnabled; 1709 var dataLayer; 1710 var dataLayerName; 1711 1712 var NS = "cmp"; 1713 var IS = "carousel"; 1714 1715 var keyCodes = { 1716 SPACE: 32, 1717 END: 35, 1718 HOME: 36, 1719 ARROW_LEFT: 37, 1720 ARROW_UP: 38, 1721 ARROW_RIGHT: 39, 1722 ARROW_DOWN: 40 1723 }; 1724 1725 var selectors = { 1726 self: "[data-" + NS + '-is="' + IS + '"]' 1727 }; 1728 1729 var properties = { 1730 /** 1731 * Determines whether the Carousel will automatically transition between slides 1732 * 1733 * @memberof Carousel
1734 * @type {Boolean} 1735 * @default false 1736 */ 1737 "autoplay": { 1738 "default": false, 1739 "transform": function(value) { 1740 return !(value === null || typeof value === "undefined"); 1741 } 1742 }, 1743 /** 1744 * Duration (in milliseconds) before automatically transitioning to the next slide 1745 * 1746 * @memberof Carousel 1747 * @type {Number} 1748 * @default 5000 1749 */ 1750 "delay": { 1751 "default": 5000, 1752 "transform": function(value) { 1753 value = parseFloat(value); 1754 return !isNaN(value) ? value : null; 1755 } 1756 }, 1757 /** 1758 * Determines whether automatic pause on hovering the carousel is disabled 1759 * 1760 * @memberof Carousel 1761 * @type {Boolean} 1762 * @default false 1763 */ 1764 "autopauseDisabled": { 1765 "default": false, 1766 "transform": function(value) { 1767 return !(value === null || typeof value === "undefined"); 1768 } 1769 } 1770 }; 1771 1772 /** 1773 * Carousel Configuration 1774 * 1775 * @typedef {Object} CarouselConfig Represents a Carousel configuration 1776 * @property {HTMLElement} element The HTMLElement representing the Carousel 1777 * @property {*[]} options The Carousel options 1778 */ 1779 1780 /** 1781 * Carousel 1782 * 1783 * @class Carousel 1784 * @classdesc An interactive Carousel component for navigating a list of generic items 1785 * @param {CarouselConfig} config The Carousel configuration 1786 */ 1787 function Carousel(config) { 1788 var that = this; 1789 1790 if (config && config.element) { 1791 init(config); 1792 } 1793 1794 /** 1795 * Initializes the Carousel 1796 * 1797 * @private 1798 * @param {CarouselConfig} config The Carousel configuration 1799 */ 1800 function init(config) { 1801 that._config = config; 1802 1803 // prevents multiple initialization 1804 config.element.removeAttribute("data-" + NS + "-is"); 1805 1806 setupProperties(config.options); 1807 cacheElements(config.element); 1808 1809 that._active = 0; 1810 that._paused = false; 1811 1812 if (that._elements.item) { 1813 initializeActive(); 1814 bindEvents(); 1815 resetAutoplayInterval(); 1816 refreshPlayPauseActions(); 1817 scrollToDeepLinkIdInCarousel(); 1818 } 1819 1820 // TODO: This section is only relevant in edit mode and should move to the editor clientLib 1821 if (window.Granite && window.Granite.author && window.Granite.author.MessageChannel) { 1822 /* 1823 * Editor message handling: 1824 * - subscribe to "cmp.panelcontainer" message requests sent by the editor frame 1825 * - check that the message data panel container type is correct and that the id (path) matches this specific Carousel component 1826 * - if so, route the "navigate" operation to enact a navigation of the Carousel based on index data 1827 */ 1828 window.CQ = window.CQ || {}; 1829 window.CQ.CoreComponents = window.CQ.CoreComponents || {}; 1830 window.CQ.CoreComponents.MESSAGE_CHANNEL = window.CQ.CoreComponents.MESSAGE_CHANNEL || new window.Granite.author.MessageChannel("cqauthor", window); 1831 window.CQ.CoreComponents.MESSAGE_CHANNEL.subscribeRequestMessage("cmp.panelcontainer", function(message) { 1832 if (message.data && message.data.type === "cmp-carousel" && message.data.id === that._elements.self.dataset["cmpPanelcontainerId"]) { 1833 if (message.data.operation === "navigate") { 1834 navigate(message.data.index); 1835 } 1836 } 1837 }); 1838 } 1839 } 1840 1841 /** 1842 * Displays the slide containing the element that corresponds to the deep link in the URI fragment 1843 * and scrolls the browser to this element. 1844 */ 1845 function scrollToDeepLinkIdInCarousel() { 1846 if (containerUtils) { 1847 var deepLinkItemIdx = containerUtils.getDeepLinkItemIdx(that, "item", "item"); 1848 if (deepLinkItemIdx > -1) { 1849 var deepLinkItem = that._elements["item"][deepLinkItemIdx]; 1850 if (deepLinkItem && that._elements["item"][that._active].id !== deepLinkItem.id) { 1851 navigateAndFocusIndicator(deepLinkItemIdx, true); 1852 // pause the carousel auto-rotation 1853 pause(); 1854 } 1855 var hashId = window.location.hash.substring(1); 1856 if (hashId) { 1857 var hashItem = document.querySelector("[id='" + hashId + "']"); 1858 if (hashItem) { 1859 hashItem.scrollIntoView(); 1860 } 1861 } 1862 } 1863 } 1864 } 1865 1866 /** 1867 * Caches the Carousel elements as defined via the {@code data-carousel-hook="ELEMENT_NAME"} markup API 1868 * 1869 * @private 1870 * @param {HTMLElement} wrapper The Carousel wrapper element 1871 */ 1872 function cacheElements(wrapper) { 1873 that._elements = {}; 1874 that._elements.self = wrapper; 1875 var hooks = that._elements.self.querySelectorAll("[data-" + NS + "-hook-" + IS + "]"); 1876 1877 for (var i = 0; i < hooks.length; i++) { 1878 var hook = hooks[i]; 1879 var capitalized = IS; 1880 capitalized = capitalized.charAt(0).toUpperCase() + capitalized.slice(1); 1881 var key = hook.dataset[NS + "Hook" + capitalized]; 1882 if (that._elements[key]) { 1883 if (!Array.isArray(that._elements[key])) { 1884 var tmp = that._elements[key]; 1885 that._elements[key] = [tmp]; 1886 } 1887 that._elements[key].push(hook); 1888 } else { 1889 that._elements[key] = hook; 1890 } 1891 } 1892 } 1893 1894 /** 1895 * Sets up properties for the Carousel based on the passed options. 1896 * 1897 * @private 1898 * @param {Object} options The Carousel options 1899 */ 1900 function setupProperties(options) { 1901 that._properties = {}; 1902 1903 for (var key in properties) { 1904 if (Object.prototype.hasOwnProperty.call(properties, key)) { 1905 var property = properties[key]; 1906 var value = null; 1907 1908 if (options && options[key] != null) { 1909 value = options[key]; 1910 1911 // transform the provided option 1912 if (property && typeof property.transform === "function") { 1913 value = property.transform(value); 1914 } 1915 } 1916 1917 if (value === null) { 1918 // value still null, take the property default 1919 value = properties[key]["default"]; 1920 } 1921 1922 that._properties[key] = value; 1923 } 1924 } 1925 } 1926 1927 /** 1928 * Binds Carousel event handling 1929 * 1930 * @private 1931 */ 1932 function bindEvents() { 1933 window.addEventListener("hashchange", scrollToDeepLinkIdInCarousel, false); 1934 if (that._elements["previous"]) { 1935 that._elements["previous"].addEventListener("click", function() { 1936 var index = getPreviousIndex(); 1937 navigate(index); 1938 if (dataLayerEnabled) { 1939 dataLayer.push({ 1940 event: "cmp:show", 1941 eventInfo: { 1942 path: "component." + getDataLayerId(that._elements.item[index]) 1943 } 1944 }); 1945 } 1946 }); 1947 } 1948 1949 if (that._elements["next"]) { 1950 that._elements["next"].addEventListener("click", function() { 1951 var index = getNextIndex(); 1952 navigate(index); 1953 if (dataLayerEnabled) { 1954 dataLayer.push({ 1955 event: "cmp:show", 1956 eventInfo: { 1957 path: "component." + getDataLayerId(that._elements.item[index]) 1958 } 1959 }); 1960 } 1961 }); 1962 } 1963 1964 var indicators = that._elements["indicator"]; 1965 if (indicators) { 1966 for (var i = 0; i < indicators.length; i++) { 1967 (function(index) { 1968 indicators[i].addEventListener("click", function(event) { 1969 navigateAndFocusIndicator(index); 1970 // pause the carousel auto-rotation 1971 pause(); 1972 }); 1973 })(i); 1974 } 1975 } 1976 1977 if (that._elements["pause"]) { 1978 if (that._properties.autoplay) { 1979 that._elements["pause"].addEventListener("click", onPauseClick); 1980 } 1981 } 1982 1983 if (that._elements["play"]) { 1984 if (that._properties.autoplay) { 1985 that._elements["play"].addEventListener("click", onPlayClick); 1986 } 1987 } 1988 1989 that._elements.self.addEventListener("keydown", onKeyDown); 1990 1991 if (!that._properties.autopauseDisabled) { 1992 that._elements.self.addEventListener("mouseenter", onMouseEnter); 1993 that._elements.self.addEventListener("mouseleave", onMouseLeave); 1994 } 1995 1996 // for accessibility we pause animation when a element get focused 1997 var items = that._elements["item"]; 1998 if (items) { 1999 for (var j = 0; j < items.length; j++) { 2000 items[j].addEventListener("focusin", onMouseEnter); 2001 items[j].addEventListener("focusout", onMouseLeave); 2002 } 2003 } 2004 } 2005 2006 /**
2007 * Handles carousel keydown events 2008 * 2009 * @private 2010 * @param {Object} event The keydown event 2011 */ 2012 function onKeyDown(event) { 2013 var index = that._active; 2014 var lastIndex = that._elements["indicator"].length - 1; 2015 2016 switch (event.keyCode) { 2017 case keyCodes.ARROW_LEFT: 2018 case keyCodes.ARROW_UP: 2019 event.preventDefault(); 2020 if (index > 0) { 2021 navigateAndFocusIndicator(index - 1); 2022 } 2023 break; 2024 case keyCodes.ARROW_RIGHT: 2025 case keyCodes.ARROW_DOWN: 2026 event.preventDefault(); 2027 if (index < lastIndex) { 2028 navigateAndFocusIndicator(index + 1); 2029 } 2030 break; 2031 case keyCodes.HOME: 2032 event.preventDefault(); 2033 navigateAndFocusIndicator(0); 2034 break; 2035 case keyCodes.END: 2036 event.preventDefault(); 2037 navigateAndFocusIndicator(lastIndex); 2038 break; 2039 case keyCodes.SPACE: 2040 if (that._properties.autoplay && (event.target !== that._elements["previous"] && event.target !== that._elements["next"])) { 2041 event.preventDefault(); 2042 if (!that._paused) { 2043 pause(); 2044 } else { 2045 play(); 2046 } 2047 } 2048 if (event.target === that._elements["pause"]) { 2049 that._elements["play"].focus(); 2050 } 2051 if (event.target === that._elements["play"]) { 2052 that._elements["pause"].focus(); 2053 } 2054 break; 2055 default: 2056 return; 2057 } 2058 } 2059 2060 /** 2061 * Handles carousel mouseenter events 2062 * 2063 * @private 2064 * @param {Object} event The mouseenter event 2065 */ 2066 function onMouseEnter(event) { 2067 clearAutoplayInterval(); 2068 } 2069 2070 /** 2071 * Handles carousel mouseleave events 2072 * 2073 * @private 2074 * @param {Object} event The mouseleave event 2075 */ 2076 function onMouseLeave(event) { 2077 resetAutoplayInterval(); 2078 } 2079 2080 /** 2081 * Handles pause element click events 2082 * 2083 * @private 2084 * @param {Object} event The click event 2085 */ 2086 function onPauseClick(event) { 2087 pause(); 2088 that._elements["play"].focus(); 2089 } 2090 2091 /** 2092 * Handles play element click events 2093 * 2094 * @private 2095 * @param {Object} event The click event 2096 */ 2097 function onPlayClick() { 2098 play(); 2099 that._elements["pause"].focus(); 2100 } 2101 2102 /** 2103 * Pauses the playing of the Carousel. Sets {@code Carousel#_paused} marker. 2104 * Only relevant when autoplay is enabled 2105 * 2106 * @private 2107 */ 2108 function pause() { 2109 that._paused = true; 2110 clearAutoplayInterval(); 2111 refreshPlayPauseActions(); 2112 } 2113 2114 /** 2115 * Enables the playing of the Carousel. Sets {@code Carousel#_paused} marker. 2116 * Only relevant when autoplay is enabled 2117 * 2118 * @private 2119 */ 2120 function play() { 2121 that._paused = false; 2122 2123 // If the Carousel is hovered, don't begin auto transitioning until the next mouse leave event 2124 var hovered = false; 2125 if (that._elements.self.parentElement) { 2126 hovered = that._elements.self.parentElement.querySelector(":hover") === that._elements.self; 2127 } 2128 if (that._properties.autopauseDisabled || !hovered) { 2129 resetAutoplayInterval(); 2130 } 2131 2132 refreshPlayPauseActions(); 2133 } 2134 2135 /** 2136 * Refreshes the play/pause action markup based on the {@code Carousel#_paused} state 2137 * 2138 * @private 2139 */ 2140 function refreshPlayPauseActions() {
2141 setActionDisabled(that._elements["pause"], that._paused); 2142 setActionDisabled(that._elements["play"], !that._paused); 2143 } 2144 2145 /** 2146 * Initialize {@code Carousel#_active} based on the active item of the carousel. 2147 */ 2148 function initializeActive() { 2149 var items = that._elements["item"]; 2150 if (items && Array.isArray(items)) { 2151 for (var i = 0; i < items.length; i++) { 2152 if (items[i].classList.contains("cmp-carousel__item--active")) { 2153 that._active = i; 2154 break; 2155 } 2156 } 2157 } 2158 } 2159 2160 /** 2161 * Refreshes the item markup based on the current {@code Carousel#_active} index 2162 * 2163 * @private 2164 */ 2165 function refreshActive() { 2166 var items = that._elements["item"]; 2167 var indicators = that._elements["indicator"]; 2168 2169 if (items) { 2170 if (Array.isArray(items)) { 2171 for (var i = 0; i < items.length; i++) { 2172 if (i === parseInt(that._active)) { 2173 items[i].classList.add("cmp-carousel__item--active"); 2174 items[i].removeAttribute("aria-hidden"); 2175 indicators[i].classList.add("cmp-carousel__indicator--active"); 2176 indicators[i].setAttribute("aria-selected", true); 2177 indicators[i].setAttribute("tabindex", "0"); 2178 } else { 2179 items[i].classList.remove("cmp-carousel__item--active"); 2180 items[i].setAttribute("aria-hidden", true); 2181 indicators[i].classList.remove("cmp-carousel__indicator--active"); 2182 indicators[i].setAttribute("aria-selected", false); 2183 indicators[i].setAttribute("tabindex", "-1"); 2184 } 2185 } 2186 } else { 2187 // only one item 2188 items.classList.add("cmp-carousel__item--active"); 2189 indicators.classList.add("cmp-carousel__indicator--active"); 2190 } 2191 } 2192 } 2193 2194 /** 2195 * Focuses the element and prevents scrolling the element into view 2196 * 2197 * @param {HTMLElement} element Element to focus 2198 */ 2199 function focusWithoutScroll(element) { 2200 var x = window.scrollX || window.pageXOffset; 2201 var y = window.scrollY || window.pageYOffset; 2202 element.focus(); 2203 window.scrollTo(x, y); 2204 } 2205 2206 /** 2207 * Retrieves the next active index, with looping 2208 * 2209 * @private 2210 * @returns {Number} Index of the next carousel item 2211 */ 2212 function getNextIndex() { 2213 return that._active === (that._elements["item"].length - 1) ? 0 : that._active + 1; 2214 } 2215 2216 /** 2217 * Retrieves the previous active index, with looping 2218 * 2219 * @private 2220 * @returns {Number} Index of the previous carousel item 2221 */ 2222 function getPreviousIndex() { 2223 return that._active === 0 ? (that._elements["item"].length - 1) : that._active - 1; 2224 } 2225 2226 /** 2227 * Navigates to the item at the provided index 2228 * 2229 * @private 2230 * @param {Number} index The index of the item to navigate to 2231 * @param {Boolean} keepHash true to keep the hash in the URL, false to update it 2232 */ 2233 function navigate(index, keepHash) { 2234 if (index < 0 || index > (that._elements["item"].length - 1)) { 2235 return; 2236 } 2237 2238 that._active = index; 2239 refreshActive(); 2240 2241 if (!keepHash && containerUtils) { 2242 containerUtils.updateUrlHash(that, "item", index); 2243 } 2244 2245 if (dataLayerEnabled) { 2246 var carouselId = that._elements.self.id; 2247 var activeItem = getDataLayerId(that._elements.item[index]); 2248 var updatePayload = { component: {} }; 2249 updatePayload.component[carouselId] = { shownItems: [activeItem] }; 2250 2251 var removePayload = { component: {} }; 2252 removePayload.component[carouselId] = { shownItems: undefined }; 2253 2254 dataLayer.push(removePayload); 2255 dataLayer.push(updatePayload); 2256 } 2257 2258 // reset the autoplay transition interval following navigation, if not already hovering the carousel
2259 if (that._elements.self.parentElement) { 2260 if (that._elements.self.parentElement.querySelector(":hover") !== that._elements.self) { 2261 resetAutoplayInterval(); 2262 } 2263 } 2264 } 2265 2266 /** 2267 * Navigates to the item at the provided index and ensures the active indicator gains focus 2268 * 2269 * @private 2270 * @param {Number} index The index of the item to navigate to 2271 * @param {Boolean} keepHash true to keep the hash in the URL, false to update it 2272 */ 2273 function navigateAndFocusIndicator(index, keepHash) { 2274 navigate(index, keepHash); 2275 focusWithoutScroll(that._elements["indicator"][index]); 2276 2277 if (dataLayerEnabled) { 2278 dataLayer.push({ 2279 event: "cmp:show", 2280 eventInfo: { 2281 path: "component." + getDataLayerId(that._elements.item[index]) 2282 } 2283 }); 2284 } 2285 } 2286 2287 /** 2288 * Starts/resets automatic slide transition interval 2289 * 2290 * @private 2291 */ 2292 function resetAutoplayInterval() { 2293 if (that._paused || !that._properties.autoplay) { 2294 return; 2295 } 2296 clearAutoplayInterval(); 2297 that._autoplayIntervalId = window.setInterval(function() { 2298 if (document.visibilityState && document.hidden) { 2299 return; 2300 } 2301 var indicators = that._elements["indicators"]; 2302 if (indicators !== document.activeElement && indicators.contains(document.activeElement)) { 2303 // if an indicator has focus, ensure we switch focus following navigation 2304 navigateAndFocusIndicator(getNextIndex(), true); 2305 } else { 2306 navigate(getNextIndex(), true); 2307 } 2308 }, that._properties.delay); 2309 } 2310 2311 /** 2312 * Clears/pauses automatic slide transition interval 2313 * 2314 * @private 2315 */ 2316 function clearAutoplayInterval() { 2317 window.clearInterval(that._autoplayIntervalId); 2318 that._autoplayIntervalId = null; 2319 } 2320 2321 /** 2322 * Sets the disabled state for an action and toggles the appropriate CSS classes 2323 * 2324 * @private 2325 * @param {HTMLElement} action Action to disable 2326 * @param {Boolean} [disable] {@code true} to disable, {@code false} to enable 2327 */ 2328 function setActionDisabled(action, disable) { 2329 if (!action) { 2330 return; 2331 } 2332 if (disable !== false) { 2333 action.disabled = true; 2334 action.classList.add("cmp-carousel__action--disabled"); 2335 } else { 2336 action.disabled = false; 2337 action.classList.remove("cmp-carousel__action--disabled"); 2338 } 2339 } 2340 } 2341 2342 /** 2343 * Parses the dataLayer string and returns the ID 2344 * 2345 * @private 2346 * @param {HTMLElement} item the accordion item 2347 * @returns {String} dataLayerId or undefined 2348 */ 2349 function getDataLayerId(item) { 2350 if (item) { 2351 if (item.dataset.cmpDataLayer) { 2352 return Object.keys(JSON.parse(item.dataset.cmpDataLayer))[0]; 2353 } else { 2354 return item.id; 2355 } 2356 } 2357 return null; 2358 } 2359 2360 /** 2361 * Document ready handler and DOM mutation observers. Initializes Carousel components as necessary. 2362 * 2363 * @private 2364 */ 2365 function onDocumentReady() { 2366 dataLayerEnabled = document.body.hasAttribute("data-cmp-data-layer-enabled"); 2367 if (dataLayerEnabled) { 2368 dataLayerName = document.body.getAttribute("data-cmp-data-layer-name") || "adobeDataLayer"; 2369 dataLayer = window[dataLayerName] = window[dataLayerName] || []; 2370 } 2371 2372 var elements = document.querySelectorAll(selectors.self); 2373 for (var i = 0; i < elements.length; i++) { 2374 new Carousel({ element: elements[i], options: CMP.utils.readData(elements[i], IS) }); 2375 } 2376 2377 var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; 2378 var body = document.querySelector("body"); 2379 var observer = new MutationObserver(function(mutations) { 2380 mutations.forEach(function(mutation) { 2381 // needed for IE 2382 var nodesArray = [].slice.call(mutation.addedNodes); 2383 if (nodesArray.length > 0) { 2384 nodesArray.forEach(function(addedNode) { 2385 if (addedNode.querySelectorAll) { 2386 var elementsArray = [].slice.call(addedNode.querySelectorAll(selectors.self)); 2387 elementsArray.forEach(function(element) { 2388 new Carousel({ element: element, options: CMP.utils.readData(element, IS) }); 2389 }); 2390 } 2391 }); 2392 } 2393 }); 2394 }); 2395 2396 observer.observe(body, { 2397 subtree: true, 2398 childList: true, 2399 characterData: true 2400 }); 2401 } 2402 2403 var documentReady = document.readyState !== "loading" ? Promise.resolve() : new Promise(function(resolve) { 2404 document.addEventListener("DOMContentLoaded", resolve); 2405 }); 2406 Promise.all([documentReady]).then(onDocumentReady); 2407 2408 if (containerUtils) { 2409 window.addEventListener("load", containerUtils.scrollToAnchor, false); 2410 } 2411 2412}()); 2413 2414/******************************************************************************* 2415 * Copyright 2022 Adobe 2416 * 2417 * Licensed under the Apache License, Version 2.0 (the "License");
2418 * you may not use this file except in compliance with the License. 2419 * You may obtain a copy of the License at 2420 * 2421 * http://www.apache.org/licenses/LICENSE-2.0 2422 * 2423 * Unless required by applicable law or agreed to in writing, software 2424 * distributed under the License is distributed on an "AS IS" BASIS, 2425 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2426 * See the License for the specific language governing permissions and 2427 * limitations under the License. 2428 ******************************************************************************/ 2429(function(document) { 2430 "use strict"; 2431 2432 window.CMP = window.CMP || {}; 2433 window.CMP.utils = (function() { 2434 var NS = "cmp"; 2435 2436 /** 2437 * Reads options data from the Component wrapper element, defined via {@code data-cmp-*} data attributes 2438 * 2439 * @param {HTMLElement} element The component element to read options data from 2440 * @param {String} is The component identifier 2441 * @returns {String[]} The options read from the component data attributes 2442 */ 2443 var readData = function(element, is) { 2444 var data = element.dataset; 2445 var options = []; 2446 var capitalized = is; 2447 capitalized = capitalized.charAt(0).toUpperCase() + capitalized.slice(1); 2448 var reserved = ["is", "hook" + capitalized]; 2449 2450 for (var key in data) { 2451 if (Object.prototype.hasOwnProperty.call(data, key)) { 2452 var value = data[key]; 2453 2454 if (key.indexOf(NS) === 0) { 2455 key = key.slice(NS.length); 2456 key = key.charAt(0).toLowerCase() + key.substring(1); 2457 2458 if (reserved.indexOf(key) === -1) { 2459 options[key] = value; 2460 } 2461 } 2462 } 2463 } 2464 return options; 2465 }; 2466 2467 /** 2468 * Set up the final properties of a component by evaluating the transform function or fall back to the default value on demand 2469 * @param {String[]} options the options to transform 2470 * @param {Object} properties object of properties of property functions 2471 * @returns {Object} transformed properties 2472 */ 2473 var setupProperties = function(options, properties) { 2474 var transformedProperties = {}; 2475 2476 for (var key in properties) { 2477 if (Object.prototype.hasOwnProperty.call(properties, key)) { 2478 var property = properties[key]; 2479 if (options && options[key] != null) { 2480 if (property && typeof property.transform === "function") { 2481 transformedProperties[key] = property.transform(options[key]); 2482 } else { 2483 transformedProperties[key] = options[key]; 2484 } 2485 } else { 2486 transformedProperties[key] = properties[key]["default"]; 2487 } 2488 } 2489 } 2490 return transformedProperties; 2491 }; 2492 2493 2494 return { 2495 readData: readData, 2496 setupProperties: setupProperties 2497 }; 2498 }()); 2499}(window.document)); 2500 2501/******************************************************************************* 2502 * Copyright 2022 Adobe 2503 * 2504 * Licensed under the Apache License, Version 2.0 (the "License"); 2505 * you may not use this file except in compliance with the License. 2506 * You may obtain a copy of the License at 2507 * 2508 * http://www.apache.org/licenses/LICENSE-2.0 2509 * 2510 * Unless required by applicable law or agreed to in writing, software 2511 * distributed under the License is distributed on an "AS IS" BASIS, 2512 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2513 * See the License for the specific language governing permissions and 2514 * limitations under the License. 2515 ******************************************************************************/ 2516(function(document) { 2517 "use strict"; 2518 2519 window.CMP = window.CMP || {}; 2520 window.CMP.image = window.CMP.image || {}; 2521 window.CMP.image.dynamicMedia = (function() { 2522 var autoSmartCrops = {}; 2523 var SRC_URI_TEMPLATE_WIDTH_VAR = "{.width}"; 2524 var SRC_URI_TEMPLATE_DPR_VAR = "{dpr}";
2525 var SRC_URI_DPR_OFF = "dpr=off"; 2526 var SRC_URI_DPR_ON = "dpr=on,{dpr}"; 2527 var dpr = window.devicePixelRatio || 1; 2528 var config = { 2529 minWidth: 20 2530 }; 2531 2532 /** 2533 * get auto smart crops from dm 2534 * @param {String} src the src uri 2535 * @returns {{}} the smart crop json object 2536 */ 2537 var getAutoSmartCrops = function(src) { 2538 var request = new XMLHttpRequest(); 2539 var url = src.split(SRC_URI_TEMPLATE_WIDTH_VAR)[0] + "?req=set,json"; 2540 request.open("GET", url, false); 2541 request.onload = function() { 2542 if (request.status >= 200 && request.status < 400) { 2543 // success status 2544 var responseText = request.responseText; 2545 var rePayload = new RegExp(/^(?:\/\*jsonp\*\/)?\s*([^()]+)\(([\s\S]+),\s*"[0-9]*"\);?$/gmi); 2546 var rePayloadJSON = new RegExp(/^{[\s\S]*}$/gmi); 2547 var resPayload = rePayload.exec(responseText); 2548 var payload; 2549 if (resPayload) { 2550 var payloadStr = resPayload[2]; 2551 if (rePayloadJSON.test(payloadStr)) { 2552 payload = JSON.parse(payloadStr); 2553 } 2554 2555 } 2556 // check "relation" - only in case of smartcrop preset 2557 if (payload && payload.set.relation && payload.set.relation.length > 0) { 2558 for (var i = 0; i < payload.set.relation.length; i++) { 2559 autoSmartCrops[parseInt(payload.set.relation[i].userdata.SmartCropWidth)] = 2560 ":" + payload.set.relation[i].userdata.SmartCropDef; 2561 } 2562 } 2563 } else { 2564 // error status 2565 } 2566 }; 2567 request.send(); 2568 return autoSmartCrops; 2569 }; 2570 2571 /** 2572 * Build and return the srcset value based on the available auto smart crops 2573 * @param {String} src the src uri 2574 * @param {Object} smartCrops the smart crops object 2575 * @returns {String} the srcset 2576 */ 2577 var getSrcSet = function(src, smartCrops) { 2578 var srcset; 2579 var keys = Object.keys(smartCrops); 2580 if (keys.length > 0) { 2581 srcset = []; 2582 for (var key in autoSmartCrops) { 2583 srcset.push(src.replace(SRC_URI_TEMPLATE_WIDTH_VAR, smartCrops[key]) + " " + key + "w"); 2584 } 2585 } 2586 return srcset.join(","); 2587 }; 2588 2589 /** 2590 * Get the optimal width based on the available sizes 2591 * @param {[Number]} sizes the available sizes 2592 * @param {Number} width the element width 2593 * @returns {String} the optimal width 2594 */ 2595 function getOptimalWidth(sizes, width) { 2596 var len = sizes.length; 2597 var key = 0; 2598 2599 while ((key < len - 1) && (sizes[key] < width)) { 2600 key++; 2601 } 2602 2603 return sizes[key] !== undefined ? sizes[key].toString() : width; 2604 } 2605 2606 /** 2607 * Get the width of an element or parent element if the width is smaller than the minimum width 2608 * @param {HTMLElement} component the image component 2609 * @param {HTMLElement | Node} parent the parent element 2610 * @returns {Number} the width of the element 2611 */ 2612 var getWidth = function(component, parent) { 2613 var width = component.offsetWidth; 2614 while (width < config.minWidth && parent && !component._autoWidth) { 2615 width = parent.offsetWidth; 2616 parent = parent.parentNode; 2617 } 2618 return width; 2619 }; 2620 2621 /** 2622 * Set the src and srcset attribute for a Dynamic Media Image which auto smart crops enabled. 2623 * @param {HTMLElement} component the image component 2624 * @param {{}} properties the component properties 2625 */ 2626 var setDMAttributes = function(component, properties) { 2627 // for v3 we first have to turn the dpr on
2628 var src = properties.src.replace(SRC_URI_DPR_OFF, SRC_URI_DPR_ON); 2629 src = src.replace(SRC_URI_TEMPLATE_DPR_VAR, dpr); 2630 var smartCrops = {}; 2631 var width; 2632 if (properties["smartcroprendition"] === "SmartCrop:Auto") { 2633 smartCrops = getAutoSmartCrops(src); 2634 } 2635 var hasWidths = (properties.widths && properties.widths.length > 0) || Object.keys(smartCrops).length > 0; 2636 if (hasWidths) { 2637 var image = component.querySelector("img"); 2638 var elemWidth = getWidth(component, component.parentNode); 2639 if (properties["smartcroprendition"] === "SmartCrop:Auto") { 2640 image.setAttribute("srcset", CMP.image.dynamicMedia.getSrcSet(src, smartCrops)); 2641 width = getOptimalWidth(Object.keys(smartCrops, elemWidth)); 2642 image.setAttribute("src", CMP.image.dynamicMedia.getSrc(src, smartCrops[width])); 2643 } else { 2644 width = getOptimalWidth(properties.widths, elemWidth); 2645 image.setAttribute("src", CMP.image.dynamicMedia.getSrc(src, width)); 2646 } 2647 } 2648 }; 2649 2650 /** 2651 * Get the src attribute based on the optimal width 2652 * @param {String} src the src uri 2653 * @param {String} width the element width 2654 * @returns {String} the final src attribute 2655 */ 2656 var getSrc = function(src, width) { 2657 if (src.indexOf(SRC_URI_TEMPLATE_WIDTH_VAR) > -1) { 2658 src = src.replace(SRC_URI_TEMPLATE_WIDTH_VAR, width); 2659 } 2660 return src; 2661 }; 2662 2663 2664 return { 2665 getAutoSmartCrops: getAutoSmartCrops, 2666 getSrcSet: getSrcSet, 2667 getSrc: getSrc, 2668 setDMAttributes: setDMAttributes, 2669 getWidth: getWidth 2670 }; 2671 }()); 2672 document.dispatchEvent(new CustomEvent("core.wcm.components.commons.site.image.dynamic-media.loaded")); 2673}(window.document)); 2674 2675/******************************************************************************* 2676 * Copyright 2022 Adobe 2677 * 2678 * Licensed under the Apache License, Version 2.0 (the "License"); 2679 * you may not use this file except in compliance with the License. 2680 * You may obtain a copy of the License at 2681 * 2682 * http://www.apache.org/licenses/LICENSE-2.0 2683 * 2684 * Unless required by applicable law or agreed to in writing, software 2685 * distributed under the License is distributed on an "AS IS" BASIS, 2686 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2687 * See the License for the specific language governing permissions and 2688 * limitations under the License. 2689 ******************************************************************************/ 2690(function(document) { 2691 2692 "use strict"; 2693 2694 window.CMP = window.CMP || {}; 2695 window.CMP.image = window.CMP.image || {}; 2696 window.CMP.image.v3 = (function() { 2697 var IS = "image"; 2698 2699 var selectors = { 2700 self: "[data-cmp-hook-image='imageV3']" 2701 }; 2702 2703 var properties = { 2704 "widths": { 2705 "default": [], 2706 "transform": function(value) { 2707 var widths = []; 2708 value.split(",").forEach(function(item) { 2709 item = parseFloat(item); 2710 if (!isNaN(item)) { 2711 widths.push(item); 2712 } 2713 }); 2714 return widths; 2715 } 2716 }, 2717 "dmimage": { 2718 "default": false, 2719 "transform": function(value) { 2720 return !(value === null || typeof value === "undefined"); 2721 } 2722 }, 2723 "src": { 2724 "transform": function(value) { 2725 return decodeURIComponent(value); 2726 } 2727 }, 2728 "smartcroprendition": "" 2729 }; 2730 2731 function Image(config) { 2732 var that = this; 2733 /** 2734 * Init the image if the image is from dynamic media 2735 * @param {HTMLElement} component the image component 2736 */ 2737 that.initImage = function(component) { 2738 var options = CMP.utils.readData(component, IS); 2739 that._properties = CMP.utils.setupProperties(options, properties); 2740 if (that._properties.dmimage) { 2741 // use encoded src for dynamic media 2742 that._properties.src = options["src"]; 2743 CMP.image.dynamicMedia.setDMAttributes(component, that._properties); 2744 } 2745 }; 2746 that.initImage(config.element); 2747 } 2748 2749 return { 2750 init: function() { 2751 var elements = document.querySelectorAll(selectors.self); 2752 for (var i = 0; i < elements.length; i++) { 2753 new Image({ element: elements[i], options: CMP.utils.readData(elements[i], IS) }); 2754 } 2755 2756 var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; 2757 var body = document.querySelector("body"); 2758 var observer = new MutationObserver(function(mutations) { 2759 mutations.forEach(function(mutation) { 2760 // needed for IE 2761 var nodesArray = [].slice.call(mutation.addedNodes); 2762 if (nodesArray.length > 0) { 2763 nodesArray.forEach(function(addedNode) { 2764 if (addedNode.querySelectorAll) { 2765 var elementsArray = [].slice.call(addedNode.querySelectorAll(selectors.self)); 2766 elementsArray.forEach(function(element) { 2767 new Image({ element: element, options: CMP.utils.readData(element, IS) }); 2768 }); 2769 } 2770 }); 2771 } 2772 }); 2773 }); 2774 2775 observer.observe(body, { 2776 subtree: true, 2777 childList: true, 2778 characterData: true 2779 }); 2780 } 2781 }; 2782 }()); 2783 2784 var documentReady = document.readyState !== "loading" ? Promise.resolve() : new Promise(function(resolve) { 2785 document.addEventListener("DOMContentLoaded", resolve); 2786 }); 2787 Promise.all([documentReady]).then(window.CMP.image.v3.init); 2788}(window.document)); 2789 2790/******************************************************************************* 2791 * Copyright 2017 Adobe 2792 * 2793 * Licensed under the Apache License, Version 2.0 (the "License");
2794 * you may not use this file except in compliance with the License. 2795 * You may obtain a copy of the License at 2796 * 2797 * http://www.apache.org/licenses/LICENSE-2.0 2798 * 2799 * Unless required by applicable law or agreed to in writing, software 2800 * distributed under the License is distributed on an "AS IS" BASIS, 2801 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2802 * See the License for the specific language governing permissions and 2803 * limitations under the License. 2804 ******************************************************************************/ 2805(function() { 2806 "use strict"; 2807 2808 var NS = "cmp"; 2809 var IS = "search"; 2810 2811 var DELAY = 300; // time before fetching new results when the user is typing a search string 2812 var LOADING_DISPLAY_DELAY = 300; // minimum time during which the loading indicator is displayed 2813 var PARAM_RESULTS_OFFSET = "resultsOffset"; 2814 2815 var keyCodes = { 2816 TAB: 9, 2817 ENTER: 13, 2818 ESCAPE: 27, 2819 ARROW_UP: 38, 2820 ARROW_DOWN: 40 2821 }; 2822 2823 var selectors = { 2824 self: "[data-" + NS + '-is="' + IS + '"]', 2825 item: { 2826 self: "[data-" + NS + "-hook-" + IS + '="item"]', 2827 title: "[data-" + NS + "-hook-" + IS + '="itemTitle"]', 2828 focused: "." + NS + "-search__item--is-focused" 2829 } 2830 }; 2831 2832 var properties = { 2833 /** 2834 * The minimum required length of the search term before results are fetched. 2835 * 2836 * @memberof Search 2837 * @type {Number} 2838 * @default 3 2839 */ 2840 minLength: { 2841 "default": 3, 2842 transform: function(value) { 2843 value = parseFloat(value); 2844 return isNaN(value) ? null : value; 2845 } 2846 }, 2847 /** 2848 * The maximal number of results fetched by a search request. 2849 * 2850 * @memberof Search 2851 * @type {Number} 2852 * @default 10 2853 */ 2854 resultsSize: { 2855 "default": 10, 2856 transform: function(value) { 2857 value = parseFloat(value); 2858 return isNaN(value) ? null : value; 2859 } 2860 } 2861 }; 2862 2863 var idCount = 0; 2864 2865 function readData(element) { 2866 var data = element.dataset; 2867 var options = []; 2868 var capitalized = IS; 2869 capitalized = capitalized.charAt(0).toUpperCase() + capitalized.slice(1); 2870 var reserved = ["is", "hook" + capitalized]; 2871 2872 for (var key in data) { 2873 if (Object.prototype.hasOwnProperty.call(data, key)) { 2874 var value = data[key]; 2875 2876 if (key.indexOf(NS) === 0) { 2877 key = key.slice(NS.length); 2878 key = key.charAt(0).toLowerCase() + key.substring(1); 2879 2880 if (reserved.indexOf(key) === -1) { 2881 options[key] = value; 2882 } 2883 } 2884 } 2885 } 2886 2887 return options; 2888 } 2889 2890 function toggleShow(element, show) { 2891 if (element) { 2892 if (show !== false) { 2893 element.style.display = "block"; 2894 element.setAttribute("aria-hidden", false); 2895 } else { 2896 element.style.display = "none"; 2897 element.setAttribute("aria-hidden", true); 2898 } 2899 } 2900 } 2901 2902 function serialize(form) { 2903 var query = []; 2904 if (form && form.elements) { 2905 for (var i = 0; i < form.elements.length; i++) { 2906 var node = form.elements[i]; 2907 if (!node.disabled && node.name) { 2908 var param = [node.name, encodeURIComponent(node.value)]; 2909 query.push(param.join("=")); 2910 } 2911 } 2912 } 2913 return query.join("&"); 2914 } 2915 2916 function mark(node, regex) { 2917 if (!node || !regex) { 2918 return; 2919 } 2920 2921 // text nodes 2922 if (node.nodeType === 3) { 2923 var nodeValue = node.nodeValue; 2924 var match = regex.exec(nodeValue); 2925 2926 if (nodeValue && match) { 2927 var element = document.createElement("mark"); 2928 element.className = NS + "-search__item-mark"; 2929 element.appendChild(document.createTextNode(match[0])); 2930 2931 var after = node.splitText(match.index); 2932 after.nodeValue = after.nodeValue.substring(match[0].length); 2933 node.parentNode.insertBefore(element, after); 2934 } 2935 } else if (node.hasChildNodes()) { 2936 for (var i = 0; i < node.childNodes.length; i++) { 2937 // recurse 2938 mark(node.childNodes[i], regex); 2939 } 2940 } 2941 } 2942 2943 function Search(config) { 2944 if (config.element) { 2945 // prevents multiple initialization 2946 config.element.removeAttribute("data-" + NS + "-is"); 2947 } 2948 2949 this._cacheElements(config.element); 2950 this._setupProperties(config.options); 2951 2952 this._action = this._elements.form.getAttribute("action"); 2953 this._resultsOffset = 0; 2954 this._hasMoreResults = true; 2955 2956 this._elements.input.addEventListener("input", this._onInput.bind(this)); 2957 this._elements.input.addEventListener("focus", this._onInput.bind(this)); 2958 this._elements.input.addEventListener("keydown", this._onKeydown.bind(this)); 2959 this._elements.clear.addEventListener("click", this._onClearClick.bind(this)); 2960 document.addEventListener("click", this._onDocumentClick.bind(this)); 2961 this._elements.results.addEventListener("scroll", this._onScroll.bind(this)); 2962 2963 this._makeAccessible(); 2964 } 2965 2966 Search.prototype._displayResults = function() { 2967 if (this._elements.input.value.length === 0) { 2968 toggleShow(this._elements.clear, false); 2969 this._cancelResults(); 2970 } else if (this._elements.input.value.length < this._properties.minLength) { 2971 toggleShow(this._elements.clear, true); 2972 } else { 2973 this._updateResults(); 2974 toggleShow(this._elements.clear, true); 2975 } 2976 }; 2977 2978 Search.prototype._onScroll = function(event) { 2979 // fetch new results when the results to be scrolled down are less than the visible results 2980 if (this._elements.results.scrollTop + 2 * this._elements.results.clientHeight >= this._elements.results.scrollHeight) { 2981 this._resultsOffset += this._properties.resultsSize; 2982 this._displayResults(); 2983 } 2984 }; 2985 2986 Search.prototype._onInput = function(event) { 2987 var self = this; 2988 self._cancelResults(); 2989 // start searching when the search term reaches the minimum length 2990 this._timeout = setTimeout(function() { 2991 self._displayResults(); 2992 }, DELAY); 2993 }; 2994 2995 Search.prototype._onKeydown = function(event) { 2996 var self = this; 2997 2998 switch (event.keyCode) { 2999 case keyCodes.TAB: 3000 if (self._resultsOpen()) { 3001 toggleShow(self._elements.results, false); 3002 self._elements.input.setAttribute("aria-expanded", "false"); 3003 } 3004 break;
3005 case keyCodes.ENTER: 3006 event.preventDefault(); 3007 if (self._resultsOpen()) { 3008 var focused = self._elements.results.querySelector(selectors.item.focused); 3009 if (focused) { 3010 focused.click(); 3011 } 3012 } 3013 break; 3014 case keyCodes.ESCAPE: 3015 self._cancelResults(); 3016 break; 3017 case keyCodes.ARROW_UP: 3018 if (self._resultsOpen()) { 3019 event.preventDefault(); 3020 self._stepResultFocus(true); 3021 } 3022 break; 3023 case keyCodes.ARROW_DOWN: 3024 if (self._resultsOpen()) { 3025 event.preventDefault(); 3026 self._stepResultFocus(); 3027 } else { 3028 // test the input and if necessary fetch and display the results 3029 self._onInput(); 3030 } 3031 break; 3032 default: 3033 return; 3034 } 3035 }; 3036 3037 Search.prototype._onClearClick = function(event) { 3038 event.preventDefault(); 3039 this._elements.input.value = ""; 3040 toggleShow(this._elements.clear, false); 3041 toggleShow(this._elements.results, false); 3042 this._elements.input.setAttribute("aria-expanded", "false"); 3043 }; 3044 3045 Search.prototype._onDocumentClick = function(event) { 3046 var inputContainsTarget = this._elements.input.contains(event.target); 3047 var resultsContainTarget = this._elements.results.contains(event.target); 3048 3049 if (!(inputContainsTarget || resultsContainTarget)) { 3050 toggleShow(this._elements.results, false); 3051 this._elements.input.setAttribute("aria-expanded", "false"); 3052 } 3053 }; 3054 3055 Search.prototype._resultsOpen = function() { 3056 return this._elements.results.style.display !== "none"; 3057 }; 3058 3059 Search.prototype._makeAccessible = function() { 3060 var id = NS + "-search-results-" + idCount; 3061 this._elements.input.setAttribute("aria-owns", id); 3062 this._elements.results.id = id; 3063 idCount++; 3064 }; 3065 3066 Search.prototype._generateItems = function(data, results) { 3067 var self = this; 3068 3069 data.forEach(function(item) { 3070 var el = document.createElement("span"); 3071 el.innerHTML = self._elements.itemTemplate.innerHTML; 3072 el.querySelectorAll(selectors.item.title)[0].appendChild(document.createTextNode(item.title)); 3073 el.querySelectorAll(selectors.item.self)[0].setAttribute("href", self._safeHref(item.url)); 3074 results.innerHTML += el.innerHTML; 3075 }); 3076 }; 3077 3078 Search.prototype._safeHref = function(href) { 3079 var a = document.createElement("a"); 3080 a.href = href; 3081 return a.pathname; 3082 }; 3083 3084 Search.prototype._markResults = function() { 3085 var nodeList = this._elements.results.querySelectorAll(selectors.item.self); 3086 var escapedTerm = this._elements.input.value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); 3087 var regex = new RegExp("(" + escapedTerm + ")", "gi"); 3088 3089 for (var i = this._resultsOffset - 1; i < nodeList.length; ++i) { 3090 var result = nodeList[i]; 3091 mark(result, regex); 3092 } 3093 }; 3094 3095 Search.prototype._stepResultFocus = function(reverse) { 3096 var results = this._elements.results.querySelectorAll(selectors.item.self); 3097 var focused = this._elements.results.querySelector(selectors.item.focused); 3098 var newFocused; 3099 var index = Array.prototype.indexOf.call(results, focused); 3100 var focusedCssClass = NS + "-search__item--is-focused"; 3101 3102 if (results.length > 0) { 3103 3104 if (!reverse) { 3105 // highlight the next result 3106 if (index < 0) { 3107 results[0].classList.add(focusedCssClass); 3108 results[0].setAttribute("aria-selected", "true"); 3109 } else if (index + 1 < results.length) { 3110 results[index].classList.remove(focusedCssClass); 3111 results[index].setAttribute("aria-selected", "false"); 3112 results[index + 1].classList.add(focusedCssClass); 3113 results[index + 1].setAttribute("aria-selected", "true"); 3114 } 3115 3116 // if the last visible result is partially hidden, scroll up until it's completely visible 3117 newFocused = this._elements.results.querySelector(selectors.item.focused); 3118 if (newFocused) { 3119 var bottomHiddenHeight = newFocused.offsetTop + newFocused.offsetHeight - this._elements.results.scrollTop - this._elements.results.clientHeight; 3120 if (bottomHiddenHeight > 0) { 3121 this._elements.results.scrollTop += bottomHiddenHeight; 3122 } else { 3123 this._onScroll(); 3124 } 3125 } 3126 3127 } else { 3128 // highlight the previous result 3129 if (index >= 1) { 3130 results[index].classList.remove(focusedCssClass); 3131 results[index].setAttribute("aria-selected", "false"); 3132 results[index - 1].classList.add(focusedCssClass); 3133 results[index - 1].setAttribute("aria-selected", "true"); 3134 } 3135 3136 // if the first visible result is partially hidden, scroll down until it's completely visible 3137 newFocused = this._elements.results.querySelector(selectors.item.focused); 3138 if (newFocused) { 3139 var topHiddenHeight = this._elements.results.scrollTop - newFocused.offsetTop; 3140 if (topHiddenHeight > 0) { 3141 this._elements.results.scrollTop -= topHiddenHeight; 3142 } 3143 } 3144 } 3145 } 3146 }; 3147 3148 Search.prototype._updateResults = function() { 3149 var self = this; 3150 if (self._hasMoreResults) { 3151 var request = new XMLHttpRequest(); 3152 var url = self._action + "?" + serialize(self._elements.form) + "&" + PARAM_RESULTS_OFFSET + "=" + self._resultsOffset; 3153 3154 request.open("GET", url, true); 3155 request.onload = function() { 3156 // when the results are loaded: hide the loading indicator and display the search icon after a minimum period 3157 setTimeout(function() { 3158 toggleShow(self._elements.loadingIndicator, false); 3159 toggleShow(self._elements.icon, true); 3160 }, LOADING_DISPLAY_DELAY); 3161 if (request.status >= 200 && request.status < 400) { 3162 // success status 3163 var data = JSON.parse(request.responseText); 3164 if (data.length > 0) { 3165 self._generateItems(data, self._elements.results); 3166 self._markResults(); 3167 toggleShow(self._elements.results, true); 3168 self._elements.input.setAttribute("aria-expanded", "true"); 3169 } else { 3170 self._hasMoreResults = false;
3171 } 3172 // the total number of results is not a multiple of the fetched results: 3173 // -> we reached the end of the query 3174 if (self._elements.results.querySelectorAll(selectors.item.self).length % self._properties.resultsSize > 0) { 3175 self._hasMoreResults = false; 3176 } 3177 } else { 3178 // error status 3179 } 3180 }; 3181 // when the results are loading: display the loading indicator and hide the search icon 3182 toggleShow(self._elements.loadingIndicator, true); 3183 toggleShow(self._elements.icon, false); 3184 request.send(); 3185 } 3186 }; 3187 3188 Search.prototype._cancelResults = function() { 3189 clearTimeout(this._timeout); 3190 this._elements.results.scrollTop = 0; 3191 this._resultsOffset = 0; 3192 this._hasMoreResults = true; 3193 this._elements.results.innerHTML = ""; 3194 this._elements.input.setAttribute("aria-expanded", "false"); 3195 }; 3196 3197 Search.prototype._cacheElements = function(wrapper) { 3198 this._elements = {}; 3199 this._elements.self = wrapper; 3200 var hooks = this._elements.self.querySelectorAll("[data-" + NS + "-hook-" + IS + "]"); 3201 3202 for (var i = 0; i < hooks.length; i++) { 3203 var hook = hooks[i]; 3204 var capitalized = IS; 3205 capitalized = capitalized.charAt(0).toUpperCase() + capitalized.slice(1); 3206 var key = hook.dataset[NS + "Hook" + capitalized]; 3207 this._elements[key] = hook; 3208 } 3209 }; 3210 3211 Search.prototype._setupProperties = function(options) { 3212 this._properties = {}; 3213 3214 for (var key in properties) { 3215 if (Object.prototype.hasOwnProperty.call(properties, key)) { 3216 var property = properties[key]; 3217 if (options && options[key] != null) { 3218 if (property && typeof property.transform === "function") { 3219 this._properties[key] = property.transform(options[key]); 3220 } else { 3221 this._properties[key] = options[key]; 3222 } 3223 } else { 3224 this._properties[key] = properties[key]["default"]; 3225 } 3226 } 3227 } 3228 }; 3229 3230 function onDocumentReady() { 3231 var elements = document.querySelectorAll(selectors.self); 3232 for (var i = 0; i < elements.length; i++) { 3233 new Search({ element: elements[i], options: readData(elements[i]) }); 3234 } 3235 3236 var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; 3237 var body = document.querySelector("body"); 3238 var observer = new MutationObserver(function(mutations) { 3239 mutations.forEach(function(mutation) { 3240 // needed for IE 3241 var nodesArray = [].slice.call(mutation.addedNodes); 3242 if (nodesArray.length > 0) { 3243 nodesArray.forEach(function(addedNode) { 3244 if (addedNode.querySelectorAll) { 3245 var elementsArray = [].slice.call(addedNode.querySelectorAll(selectors.self)); 3246 elementsArray.forEach(function(element) { 3247 new Search({ element: element, options: readData(element) }); 3248 }); 3249 } 3250 }); 3251 } 3252 }); 3253 }); 3254 3255 observer.observe(body, { 3256 subtree: true, 3257 childList: true, 3258 characterData: true 3259 }); 3260 } 3261 3262 if (document.readyState !== "loading") { 3263 onDocumentReady(); 3264 } else { 3265 document.addEventListener("DOMContentLoaded", onDocumentReady); 3266 } 3267 3268})(); 3269 3270/******************************************************************************* 3271 * Copyright 2016 Adobe 3272 * 3273 * Licensed under the Apache License, Version 2.0 (the "License"); 3274 * you may not use this file except in compliance with the License. 3275 * You may obtain a copy of the License at 3276 * 3277 * http://www.apache.org/licenses/LICENSE-2.0 3278 * 3279 * Unless required by applicable law or agreed to in writing, softw
3279are 3280 * distributed under the License is distributed on an "AS IS" BASIS, 3281 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3282 * See the License for the specific language governing permissions and 3283 * limitations under the License. 3284 ******************************************************************************/ 3285(function() { 3286 "use strict"; 3287 3288 var NS = "cmp"; 3289 var IS = "formText"; 3290 var IS_DASH = "form-text"; 3291 var SELF_SELECTOR = "[data-" + NS + '-is="' + IS + '"]'; 3292 3293 var selectors = { 3294 self: SELF_SELECTOR, 3295 validationMessage: SELF_SELECTOR + " .cmp-form-text__validation-message" 3296 }; 3297 3298 var displayValidationMessage = false; 3299 3300 var properties = { 3301 /** 3302 * A validation message to display if there is a type mismatch between the user input and expected input. 3303 * 3304 * @type {String} 3305 */ 3306 constraintMessage: "", 3307 /** 3308 * A validation message to display if no input is supplied, but input is expected for the field. 3309 * 3310 * @type {String} 3311 */ 3312 requiredMessage: "" 3313 }; 3314 3315 function readData(element) { 3316 var data = element.dataset; 3317 var options = []; 3318 var capitalized = IS; 3319 capitalized = capitalized.charAt(0).toUpperCase() + capitalized.slice(1); 3320 var reserved = ["is", "hook" + capitalized]; 3321 3322 for (var key in data) { 3323 if (Object.prototype.hasOwnProperty.call(data, key)) { 3324 var value = data[key]; 3325 3326 if (key.indexOf(NS) === 0) { 3327 key = key.slice(NS.length); 3328 key = key.charAt(0).toLowerCase() + key.substring(1); 3329 3330 if (reserved.indexOf(key) === -1) { 3331 options[key] = value; 3332 } 3333 } 3334 } 3335 } 3336 3337 return options; 3338 } 3339 3340 function FormText(config) { 3341 if (config.element) { 3342 // prevents multiple initialization 3343 config.element.removeAttribute("data-" + NS + "-is"); 3344 } 3345 3346 this._cacheElements(config.element); 3347 this._setupProperties(config.options); 3348 3349 this._elements.input.addEventListener("invalid", this._onInvalid.bind(this)); 3350 this._elements.input.addEventListener("input", this._onInput.bind(this)); 3351 if (displayValidationMessage) { 3352 this._elements.input.checkValidity(); 3353 } 3354 } 3355 3356 FormText.prototype._onInvalid = function(event) { 3357 event.target.setCustomValidity(""); 3358 if (event.target.validity.typeMismatch) { 3359 if (this._properties.constraintMessage) { 3360 event.target.setCustomValidity(this._properties.constraintMessage); 3361 } 3362 } else if (event.target.validity.valueMissing) { 3363 if (this._properties.requiredMessage) { 3364 event.target.setCustomValidity(this._properties.requiredMessage); 3365 } 3366 } 3367 if (displayValidationMessage) { 3368 var validationMessage = event.target.parentElement.querySelector(".cmp-form-text__validation-message"); 3369 if (validationMessage) { 3370 validationMessage.innerText = event.target.validationMessage; 3371 } 3372 } 3373 }; 3374 3375 FormText.prototype._onInput = function(event) { 3376 event.target.setCustomValidity(""); 3377 if (displayValidationMessage) { 3378 event.target.checkValidity(); 3379 } 3380 }; 3381 3382 FormText.prototype._cacheElements = function(wrapper) { 3383 this._elements = {}; 3384 this._elements.self = wrapper; 3385 var hooks = this._elements.self.querySelectorAll("[data-" + NS + "-hook-" + IS_DASH + "]"); 3386 for (var i = 0; i < hooks.length; i++) { 3387 var hook = hooks[i]; 3388 var capitalized = IS; 3389 capitalized = capitalized.charAt(0).toUpperCase() + capitalized.slice(1); 3390 var key = hook.dataset[NS + "Hook" + capitalized]; 3391 this._elements[key] = hook; 3392 } 3393 }; 3394 3395 FormText.prototype._setupProperties = function(options) { 3396 this._properties = {}; 3397 3398 for (var key in properties) { 3399 if (Object.prototype.hasOwnProperty.call(properties, key)) { 3400 var property = properties[key]; 3401 if (options && options[key] != null) { 3402 if (property && typeof property.transform === "function") { 3403 this._properties[key] = property.transform(options[key]); 3404 } else { 3405 this._properties[key] = options[key]; 3406 } 3407 } else { 3408 this._properties[key] = properties[key]["default"]; 3409 } 3410 } 3411 } 3412 }; 3413 3414 function onDocumentReady() {
3415 var validationMessages = document.querySelectorAll(selectors.validationMessage); 3416 if (validationMessages && validationMessages.length > 0) { 3417 displayValidationMessage = true; 3418 } 3419 3420 var elements = document.querySelectorAll(selectors.self); 3421 for (var i = 0; i < elements.length; i++) { 3422 new FormText({ element: elements[i], options: readData(elements[i]) }); 3423 } 3424 3425 var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; 3426 var body = document.querySelector("body"); 3427 var observer = new MutationObserver(function(mutations) { 3428 mutations.forEach(function(mutation) { 3429 // needed for IE 3430 var nodesArray = [].slice.call(mutation.addedNodes); 3431 if (nodesArray.length > 0) { 3432 nodesArray.forEach(function(addedNode) { 3433 if (addedNode.querySelectorAll) { 3434 var elementsArray = [].slice.call(addedNode.querySelectorAll(selectors.self)); 3435 elementsArray.forEach(function(element) { 3436 new FormText({ element: element, options: readData(element) }); 3437 }); 3438 } 3439 }); 3440 } 3441 }); 3442 }); 3443 3444 observer.observe(body, { 3445 subtree: true, 3446 childList: true, 3447 characterData: true 3448 }); 3449 } 3450 3451 if (document.readyState !== "loading") { 3452 onDocumentReady(); 3453 } else { 3454 document.addEventListener("DOMContentLoaded", onDocumentReady); 3455 } 3456 3457})(); 3458 3459/* 3460 * Copyright 2016 Adobe 3461 * 3462 * Licensed under the Apache License, Version 2.0 (the "License"); 3463 * you may not use this file except in compliance with the License. 3464 * You may obtain a copy of the License at 3465 * 3466 * http://www.apache.org/licenses/LICENSE-2.0 3467 * 3468 * Unless required by applicable law or agreed to in writing, software 3469 * distributed under the License is distributed on an "AS IS" BASIS, 3470 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3471 * See the License for the specific language governing permissions and 3472 * limitations under the License. 3473 */ 3474(function(d, s, id) { 3475 "use strict"; 3476 3477 var js; 3478 var fjs = d.getElementsByTagName(s)[0]; 3479 if (d.getElementById(id)) { 3480 return; 3481 } 3482 js = d.createElement(s); js.id = id; 3483 js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.7"; 3484 fjs.parentNode.insertBefore(js, fjs); 3485}(document, "script", "facebook-jssdk")); 3486 3487/******************************************************************************* 3488 * Copyright 2020 Adobe 3489 * 3490 * Licensed under the Apache License, Version 2.0 (the "License"); 3491 * you may not use this file except in compliance with the License. 3492 * You may obtain a copy of the License at 3493 * 3494 * http://www.apache.org/licenses/LICENSE-2.0 3495 * 3496 * Unless required by applicable law or agreed to in writing, software 3497 * distributed under the License is distributed on an "AS IS" BASIS, 3498 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 3499 * See the License for the specific language governing permissions and 3500 * limitations under the License. 3501 ******************************************************************************/ 3502(function() { 3503 "use strict"; 3504 3505 var NS = "cmp"; 3506 var IS = "pdfviewer"; 3507 var SDK_URL = "https://acrobatservices.adobe.com/view-sdk/viewer.js"; 3508 var SDK_READY_EVENT = "adobe_dc_view_sdk.ready"; 3509 3510 var selectors = { 3511 self: "[data-" + NS + '-is="' + IS + '"]', 3512 sdkScript: 'script[src="' + SDK_URL + '"]' 3513 }; 3514 3515 function initSDK() { 3516 var sdkIncluded = document.querySelectorAll(selectors.sdkScript).length > 0; 3517 if (!window.adobe_dc_view_sdk && !sdkIncluded) { 3518 var dcv = document.createElement("script"); 3519 dcv.type = "text/javascript"; 3520 dcv.src = SDK_URL; 3521 document.body.appendChild(dcv); 3522 } 3523 } 3524 3525 function previewPdf(component) { 3526 // prevents multiple initialization 3527 component.removeAttribute("data-" + NS + "-is"); 3528 3529 // add the view sdk to the page 3530 initSDK(); 3531 3532 // manage the preview 3533 if (component.dataset && component.id) { 3534 if (window.AdobeDC && window.AdobeDC.View) { 3535 dcView(component); 3536 } else { 3537 document.addEventListener(SDK_READY_EVENT, function() { 3538 dcView(component); 3539 }); 3540 } 3541 } 3542 } 3543 3544 function dcView(component) { 3545 var adobeDCView = new window.AdobeDC.View({ 3546 clientId: component.dataset.cmpClientId, 3547 divId: component.id + "-content", 3548 reportSuiteId: component.dataset.cmpReportSuiteId, 3549 locale: typeof Granite !== "undefined" && Granite && Granite.I18n ? Granite.I18n.getLocale() : navigator.language || navigator.userLanguage 3550 }); 3551 adobeDCView.previewFile({ 3552 content: { location: { url: component.dataset.cmpDocumentPath } }, 3553 metaData: { fileName: component.dataset.cmpDocumentFileName } 3554 }, JSON.parse(component.dataset.cmpViewerConfigJson)); 3555 } 3556 3557 /** 3558 * Document ready handler and DOM mutation observers. Initializes Accordion components as necessary. 3559 * 3560 * @private 3561 */ 3562 function onDocumentReady() { 3563 var elements = document.querySelectorAll(selectors.self); 3564 for (var i = 0; i < elements.length; i++) { 3565 previewPdf(elements[i]); 3566 } 3567 3568 var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; 3569 var body = document.querySelector("body"); 3570 var observer = new MutationObserver(function(mutations) { 3571 mutations.forEach(function(mutation) { 3572 // needed for IE 3573 var nodesArray = [].slice.call(mutation.addedNodes); 3574 if (nodesArray.length > 0) { 3575 nodesArray.forEach(function(addedNode) { 3576 if (addedNode.querySelectorAll) { 3577 var elementsArray = [].slice.call(addedNode.querySelectorAll(selectors.self)); 3578 elementsArray.forEach(function(element) { 3579 previewPdf(element); 3580 }); 3581 } 3582 }); 3583 } 3584 }); 3585 }); 3586 3587 observer.observe(body, { 3588 subtree: true, 3589 childList: true, 3590 characterData: true 3591 }); 3592 3593 } 3594 3595 if (document.readyState !== "loading") { 3596 onDocumentReady(); 3597 } else { 3598 document.addEventListener("DOMContentLoaded", onDocumentReady); 3599 } 3600}()); 3601 3602/* ======================================================================== 3603 * Bootstrap: alert.js v3.3.7 3604 * http://getbootstrap.com/javascript/#alerts 3605 * ======================================================================== 3606 * Copyright 2011-2016 Twitter, Inc. 3607 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 3608 * ======================================================================== */ 3609 3610 3611+function ($) { 3612 'use strict'; 3613 3614 // ALERT CLASS DEFINITION 3615 // ====================== 3616 3617 var dismiss = '[data-dismiss="alert"]' 3618 var Alert = function (el) { 3619 $(el).on('click', dismiss, this.close) 3620 } 3621 3622 Alert.VERSION = '3.3.7' 3623 3624 Alert.TRANSITION_DURATION = 150 3625 3626 Alert.prototype.close = function (e) { 3627 var $this = $(this) 3628 var selector = $this.attr('data-target') 3629 3630 if (!selector) { 3631 selector = $this.attr('href') 3632 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 3633 } 3634 3635 var $parent = $(selector === '#' ? [] : selector) 3636 3637 if (e) e.preventDefault() 3638 3639 if (!$parent.length) { 3640 $parent = $this.closest('.alert') 3641 } 3642 3643 $parent.trigger(e = $.Event('close.bs.alert')) 3644 3645 if (e.isDefaultPrevented()) return 3646 3647 $parent.removeClass('in') 3648 3649 function removeElement() { 3650 // detach from parent, fire event then clean up data 3651 $parent.detach().trigger('closed.bs.alert').remove() 3652 } 3653 3654 $.support.transition && $parent.hasClass('fade') ? 3655 $parent 3656 .one('bsTransitionEnd', removeElement) 3657 .emulateTransitionEnd(Alert.TRANSITION_DURATION) : 3658 removeElement() 3659 } 3660 3661 3662 // ALERT PLUGIN DEFINITION 3663 // ======================= 3664 3665 function Plugin(option) { 3666 return this.each(function () { 3667 var $this = $(this) 3668 var data = $this.data('bs.alert') 3669
3670 if (!data) $this.data('bs.alert', (data = new Alert(this))) 3671 if (typeof option == 'string') data[option].call($this) 3672 }) 3673 } 3674 3675 var old = $.fn.alert 3676 3677 $.fn.alert = Plugin 3678 $.fn.alert.Constructor = Alert 3679 3680 3681 // ALERT NO CONFLICT 3682 // ================= 3683 3684 $.fn.alert.noConflict = function () { 3685 $.fn.alert = old 3686 return this 3687 } 3688 3689 3690 // ALERT DATA-API 3691 // ============== 3692 3693 $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) 3694 3695}(jQuery); 3696 3697/** 3698 * Bootstrap Multiselect (https://github.com/davidstutz/bootstrap-multiselect) 3699 * 3700 * Apache License, Version 2.0: 3701 * Copyright (c) 2012 - 2015 David Stutz 3702 * 3703 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 3704 * use this file except in compliance with the License. You may obtain a 3705 * copy of the License at http://www.apache.org/licenses/LICENSE-2.0 3706 * 3707 * Unless required by applicable law or agreed to in writing, software 3708 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 3709 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 3710 * License for the specific language governing permissions and limitations 3711 * under the License. 3712 * 3713 * BSD 3-Clause License: 3714 * Copyright (c) 2012 - 2015 David Stutz 3715 * All rights reserved. 3716 * 3717 * Redistribution and use in source and binary forms, with or without 3718 * modification, are permitted provided that the following conditions are met: 3719 * - Redistributions of source code must retain the above copyright notice, 3720 * this list of conditions and the following disclaimer. 3721 * - Redistributions in binary form must reproduce the above copyright notice, 3722 * this list of conditions and the following disclaimer in the documentation 3723 * and/or other materials provided with the distribution. 3724 * - Neither the name of David Stutz nor the names of its contributors may be 3725 * used to endorse or promote products derived from this software without 3726 * specific prior written permission. 3727 * 3728 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 3729 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 3730 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 3731 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 3732 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 3733 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 3734 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 3735 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 3736 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 3737 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 3738 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3739 */ 3740!function ($) { 3741 "use strict";// jshint ;_; 3742 3743 if (typeof ko !== 'undefined' && ko.bindingHandlers && !ko.bindingHandlers.multiselect) { 3744 ko.bindingHandlers.multiselect = { 3745 after: ['options', 'value', 'selectedOptions'], 3746 3747 init: function(element, valueAccessor, allBindings, viewModel, bindingContext) { 3748 var $element = $(element); 3749 var config = ko.toJS(valueAccessor()); 3750 3751 $element.multiselect(config); 3752 3753 if (allBindings.has('options')) { 3754 var options = allBindings.get('options'); 3755 if (ko.isObservable(options)) { 3756 ko.computed({ 3757 read: function() { 3758 options(); 3759 setTimeout(function() { 3760 var ms = $element.data('multiselect'); 3761 if (ms) 3762 ms.updateOriginalOptions();//Not sure how beneficial this is. 3763 $element.multiselect('rebuild'); 3764 }, 1); 3765 }, 3766 disposeWhenNodeIsRemoved: element 3767 }); 3768 } 3769 } 3770 3771 //value and selectedOptions are two-way, so these will be triggered even by our own actions. 3772 //It needs some way to tell if they are triggered because of us or because of outside change. 3773 //It doesn't loop but it's a waste of processing. 3774 if (allBindings.has('value')) { 3775 var value = allBindings.get('value'); 3776 if (ko.isObservable(value)) { 3777 ko.computed({ 3778 read: function() {
3779 value(); 3780 setTimeout(function() { 3781 $element.multiselect('refresh'); 3782 }, 1); 3783 }, 3784 disposeWhenNodeIsRemoved: element 3785 }).extend({ rateLimit: 100, notifyWhenChangesStop: true }); 3786 } 3787 } 3788 3789 //Switched from arrayChange subscription to general subscription using 'refresh'. 3790 //Not sure performance is any better using 'select' and 'deselect'. 3791 if (allBindings.has('selectedOptions')) { 3792 var selectedOptions = allBindings.get('selectedOptions'); 3793 if (ko.isObservable(selectedOptions)) { 3794 ko.computed({ 3795 read: function() { 3796 selectedOptions(); 3797 setTimeout(function() { 3798 $element.multiselect('refresh'); 3799 }, 1); 3800 }, 3801 disposeWhenNodeIsRemoved: element 3802 }).extend({ rateLimit: 100, notifyWhenChangesStop: true }); 3803 } 3804 } 3805 3806 ko.utils.domNodeDisposal.addDisposeCallback(element, function() { 3807 $element.multiselect('destroy'); 3808 }); 3809 }, 3810 3811 update: function(element, valueAccessor, allBindings, viewModel, bindingContext) { 3812 var $element = $(element); 3813 var config = ko.toJS(valueAccessor()); 3814 3815 $element.multiselect('setOptions', config); 3816 $element.multiselect('rebuild'); 3817 } 3818 }; 3819 } 3820 3821 function forEach(array, callback) { 3822 for (var index = 0; index < array.length; ++index) { 3823 callback(array[index], index); 3824 } 3825 } 3826 3827 /** 3828 * Constructor to create a new multiselect using the given select. 3829 * 3830 * @param {jQuery} select 3831 * @param {Object} options 3832 * @returns {Multiselect} 3833 */ 3834 function Multiselect(select, options) { 3835 3836 this.$select = $(select); 3837 this.options = this.mergeOptions($.extend({}, options, this.$select.data())); 3838 3839 // Initialization. 3840 // We have to clone to create a new reference. 3841 this.originalOptions = this.$select.clone()[0].options; 3842 this.query = ''; 3843 this.searchTimeout = null; 3844 this.lastToggledInput = null 3845 3846 this.options.multiple = this.$select.attr('multiple') === "multiple"; 3847 this.options.onChange = $.proxy(this.options.onChange, this); 3848 this.options.onDropdownShow = $.proxy(this.options.onDropdownShow, this); 3849 this.options.onDropdownHide = $.proxy(this.options.onDropdownHide, this); 3850 this.options.onDropdownShown = $.proxy(this.options.onDropdownShown, this); 3851 this.options.onDropdownHidden = $.proxy(this.options.onDropdownHidden, this); 3852 3853 // Build select all if enabled. 3854 this.buildContainer(); 3855 this.buildButton(); 3856 this.buildDropdown(); 3857 this.buildSelectAll(); 3858 this.buildDropdownOptions(); 3859 this.buildFilter(); 3860 3861 this.updateButtonText(); 3862 this.updateSelectAll(); 3863 3864 if (this.options.disableIfEmpty && $('option', this.$select).length <= 0) { 3865 this.disable(); 3866 } 3867 3868 this.$select.hide().after(this.$container); 3869 }; 3870 3871 Multiselect.prototype = { 3872 3873 defaults: { 3874 /** 3875 * Default text function will either print 'None selected' in case no 3876 * option is selected or a list of the selected options up to a length 3877 * of 3 selected options. 3878 * 3879 * @param {jQuery} options 3880 * @param {jQuery} select 3881 * @returns {String} 3882 */ 3883 buttonText: function(options, select) { 3884 if (options.length === 0) { 3885 return this.nonSelectedText; 3886 } 3887 else if (this.allSelectedText && options.length == $('option', $(select)).length) { 3888 if (this.selectAllNumber) { 3889 return this.allSelectedText + ' (' + options.length + ')'; 3890 } 3891 else { 3892 return this.allSelectedText; 3893 } 3894 } 3895 else if (options.length >
3895 this.numberDisplayed) { 3896 return options.length + ' ' + this.nSelectedText; 3897 } 3898 else { 3899 var selected = ''; 3900 options.each(function() { 3901 var label = ($(this).attr('label') !== undefined) ? $(this).attr('label') : $(this).text(); 3902 3903 selected += label + ', '; 3904 }); 3905 3906 return selected.substr(0, selected.length - 2); 3907 } 3908 }, 3909 /** 3910 * Updates the title of the button similar to the buttonText function. 3911 * 3912 * @param {jQuery} options 3913 * @param {jQuery} select 3914 * @returns {@exp;selected@call;substr} 3915 */ 3916 buttonTitle: function(options, select) { 3917 if (options.length === 0) { 3918 return this.nonSelectedText; 3919 } 3920 else { 3921 var selected = ''; 3922 options.each(function () { 3923 selected += $(this).text() + ', '; 3924 }); 3925 return selected.substr(0, selected.length - 2); 3926 } 3927 }, 3928 /** 3929 * Create a label. 3930 * 3931 * @param {jQuery} element 3932 * @returns {String} 3933 */ 3934 optionLabel: function(element){ 3935 return $(element).attr('label') || $(element).text(); 3936 }, 3937 /** 3938 * Triggered on change of the multiselect. 3939 * 3940 * Not triggered when selecting/deselecting options manually. 3941 * 3942 * @param {jQuery} option 3943 * @param {Boolean} checked 3944 */ 3945 onChange : function(option, checked) { 3946 3947 }, 3948 /** 3949 * Triggered when the dropdown is shown. 3950 * 3951 * @param {jQuery} event 3952 */ 3953 onDropdownShow: function(event) { 3954 3955 }, 3956 /** 3957 * Triggered when the dropdown is hidden. 3958 * 3959 * @param {jQuery} event 3960 */ 3961 onDropdownHide: function(event) { 3962 3963 }, 3964 /** 3965 * Triggered after the dropdown is shown. 3966 * 3967 * @param {jQuery} event 3968 */ 3969 onDropdownShown: function(event) { 3970 3971 }, 3972 /** 3973 * Triggered after the dropdown is hidden. 3974 * 3975 * @param {jQuery} event 3976 */ 3977 onDropdownHidden: function(event) { 3978 3979 }, 3980 /** 3981 * Triggered on select all. 3982 */ 3983 onSelectAll: function() { 3984 3985 }, 3986 enableHTML: false, 3987 buttonClass: 'btn btn-default', 3988 inheritClass: false, 3989 buttonWidth: 'auto', 3990 buttonContainer: '<div class="btn-group" />', 3991 dropRight: false, 3992 selectedClass: 'active', 3993 // Maximum height of the dropdown menu. 3994 // If maximum height is exceeded a scrollbar will be displayed. 3995 maxHeight: false, 3996 checkboxName: false, 3997 includeSelectAllOption: false, 3998 includeSelectAllIfMoreThan: 0, 3999 selectAllText: ' Select all', 4000 selectAllValue: 'multiselect-all', 4001 selectAllName: false, 4002 selectAllNumber: true, 4003 enableFiltering: false, 4004 enableCaseInsensitiveFiltering: false, 4005 enableClickableOptGroups: false, 4006 filterPlaceholder: 'Search', 4007 // possible options: 'text', 'value', 'both' 4008 filterBehavior: 'text', 4009 includeFilterClearBtn: true, 4010 preventInputChangeEvent: false, 4011 nonSelectedText: 'None selected', 4012 nSelectedText: 'selected', 4013 allSelectedText: 'All selected', 4014 numberDisplayed: 3, 4015 disableIfEmpty: false, 4016 templates: { 4017 button: '<button type="button" class="multiselect dropdown-toggle" data-toggle="dropdown"><span class="multiselect-selected-text"></span> <b class="caret"></b></button>', 4018 ul: '<ul class="multiselect-container dropdown-menu"></ul>', 4019 filter: '<li class="multiselect-item filter"><div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span><input class="form-control multiselect-search" type="text"></div></li>', 4020 filterClearBtn: '<span class="input-group-btn"><button class="btn btn-default multiselect-clear-filter" type="button"><i class="glyphicon glyphicon-remove-circle"></i></button></span>', 4021 li: '<li><a tabindex="0"><label></label></a></li>', 4022 divider: '<li class="multiselect-item divider"></li>', 4023 liGroup: '<li class="multiselect-item multiselect-group"><label></label></li>' 4024 } 4025 }, 4026 4027 constructor: Multiselect, 4028 4029 /** 4030 * Builds the container of the multiselect. 4031 */ 4032 buildContainer: function() { 4033 this.$container = $(this.options.buttonContainer); 4034 this.$container.on('show.bs.dropdown', this.options.onDropdownShow); 4035 this.$container.on('hide.bs.dropdown', this.options.onDropdownHide); 4036 this.$container.on('shown.bs.dropdown', this.options.onDropdownShown); 4037 this.$container.on('hidden.bs.dropdown', this.options.onDropdownHidden
vendor: 6,190 bytes, lines 4037-4211
4037); 4038 }, 4039 4040 /** 4041 * Builds the button of the multiselect. 4042 */ 4043 buildButton: function() { 4044 this.$button = $(this.options.templates.button).addClass(this.options.buttonClass); 4045 if (this.$select.attr('class') && this.options.inheritClass) { 4046 this.$button.addClass(this.$select.attr('class')); 4047 } 4048 // Adopt active state. 4049 if (this.$select.prop('disabled')) { 4050 this.disable(); 4051 } 4052 else { 4053 this.enable(); 4054 } 4055 4056 // Manually add button width if set. 4057 if (this.options.buttonWidth && this.options.buttonWidth !== 'auto') { 4058 this.$button.css({ 4059 'width' : this.options.buttonWidth, 4060 'overflow' : 'hidden', 4061 'text-overflow' : 'ellipsis' 4062 }); 4063 this.$container.css({ 4064 'width': this.options.buttonWidth 4065 }); 4066 } 4067 4068 // Keep the tab index from the select. 4069 var tabindex = this.$select.attr('tabindex'); 4070 if (tabindex) { 4071 this.$button.attr('tabindex', tabindex); 4072 } 4073 4074 this.$container.prepend(this.$button); 4075 }, 4076 4077 /** 4078 * Builds the ul representing the dropdown menu. 4079 */ 4080 buildDropdown: function() { 4081 4082 // Build ul. 4083 this.$ul = $(this.options.templates.ul); 4084 4085 if (this.options.dropRight) { 4086 this.$ul.addClass('pull-right'); 4087 } 4088 4089 // Set max height of dropdown menu to activate auto scrollbar. 4090 if (this.options.maxHeight) { 4091 // TODO: Add a class for this option to move the css declarations. 4092 this.$ul.css({ 4093 'max-height': this.options.maxHeight + 'px', 4094 'overflow-y': 'auto', 4095 'overflow-x': 'hidden' 4096 }); 4097 } 4098 4099 this.$container.append(this.$ul); 4100 }, 4101 4102 /** 4103 * Build the dropdown options and binds all nessecary events. 4104 * 4105 * Uses createDivider and createOptionValue to create the necessary options. 4106 */ 4107 buildDropdownOptions: function() { 4108 4109 this.$select.children().each($.proxy(function(index, element) { 4110 4111 var $element = $(element); 4112 // Support optgroups and options without a group simultaneously. 4113 var tag = $element.prop('tagName') 4114 .toLowerCase(); 4115 4116 if ($element.prop('value') === this.options.selectAllValue) { 4117 return; 4118 } 4119 4120 if (tag === 'optgroup') { 4121 this.createOptgroup(element); 4122 } 4123 else if (tag === 'option') { 4124 4125 if ($element.data('role') === 'divider') { 4126 this.createDivider(); 4127 } 4128 else { 4129 this.createOptionValue(element); 4130 } 4131 4132 } 4133 4134 // Other illegal tags will be ignored. 4135 }, this)); 4136 4137 // Bind the change event on the dropdown elements. 4138 $('li input', this.$ul).on('change', $.proxy(function(event) { 4139 var $target = $(event.target); 4140 4141 var checked = $target.prop('checked') || false; 4142 var isSelectAllOption = $target.val() === this.options.selectAllValue; 4143 4144 // Apply or unapply the configured selected class. 4145 if (this.options.selectedClass) { 4146 if (checked) { 4147 $target.closest('li') 4148 .addClass(this.options.selectedClass); 4149 } 4150 else { 4151 $target.closest('li') 4152 .removeClass(this.options.selectedClass); 4153 } 4154 } 4155 4156 // Get the corresponding option. 4157 var value = $target.val(); 4158 var $option = this.getOptionByValue(value); 4159 4160 var $optionsNotThis = $('option', this.$select).not($option); 4161 var $checkboxesNotThis = $('input', this.$container).not($target); 4162 4163 if (isSelectAllOption) { 4164 if (checked) { 4165 this.selectAll(); 4166 } 4167 else { 4168 this.deselectAll(); 4169 } 4170 } 4171 4172 if(!isSelectAllOption){ 4173 if (checked) { 4174 $option.prop('selected', true); 4175 4176 if (this.options.multiple) { 4177 // Simply select additional option. 4178 $option.prop('selected', true); 4179 } 4180 else { 4181 // Unselect all other options and corresponding checkboxes. 4182 if (this.options.selectedClass) { 4183 $($checkboxesNotThis).closest('li').removeClass(this.options.selectedClass); 4184 } 4185 4186 $($checkboxesNotThis).prop('checked', false); 4187 $optionsNotThis.prop('selected', false); 4188 4189 // It's a single selection, so close. 4190 this.$button.click(); 4191 } 4192 4193 if (this.options.selectedClass === "active") { 4194 $optionsNotThis.closest("a").css("outline", ""); 4195 } 4196 } 4197 else { 4198 // Unselect option. 4199 $option.prop('selected', false); 4200 } 4201 } 4202 4203 this.$select.change(); 4204 4205 this.updateButtonText(); 4206 this.updateSelectAll(); 4207 4208 this.options.onChange($option, checked); 4209 4210 if(this.options.preventInputChangeEvent) { 4211 return false;
4212 } 4213 }, this)); 4214 4215 $('li a', this.$ul).on('mousedown', function(e) { 4216 if (e.shiftKey) { 4217 // Prevent selecting text by Shift+click 4218 return false; 4219 } 4220 }); 4221 4222 $('li a', this.$ul).on('touchstart click', $.proxy(function(event) { 4223 event.stopPropagation(); 4224 4225 var $target = $(event.target); 4226 4227 if (event.shiftKey && this.options.multiple) { 4228 if($target.is("label")){ // Handles checkbox selection manually (see https://github.com/davidstutz/bootstrap-multiselect/issues/431) 4229 event.preventDefault(); 4230 $target = $target.find("input"); 4231 $target.prop("checked", !$target.prop("checked")); 4232 } 4233 var checked = $target.prop('checked') || false; 4234 4235 if (this.lastToggledInput !== null && this.lastToggledInput !== $target) { // Make sure we actually have a range 4236 var from = $target.closest("li").index(); 4237 var to = this.lastToggledInput.closest("li").index(); 4238 4239 if (from > to) { // Swap the indices 4240 var tmp = to; 4241 to = from; 4242 from = tmp; 4243 } 4244 4245 // Make sure we grab all elements since slice excludes the last index 4246 ++to; 4247 4248 // Change the checkboxes and underlying options 4249 var range = this.$ul.find("li").slice(from, to).find("input"); 4250 4251 range.prop('checked', checked); 4252 4253 if (this.options.selectedClass) { 4254 range.closest('li') 4255 .toggleClass(this.options.selectedClass, checked); 4256 } 4257 4258 for (var i = 0, j = range.length; i < j; i++) { 4259 var $checkbox = $(range[i]); 4260 4261 var $option = this.getOptionByValue($checkbox.val()); 4262 4263 $option.prop('selected', checked); 4264 } 4265 } 4266 4267 // Trigger the select "change" event 4268 $target.trigger("change"); 4269 } 4270 4271 // Remembers last clicked option 4272 if($target.is("input") && !$target.closest("li").is(".multiselect-item")){ 4273 this.lastToggledInput = $target; 4274 } 4275 4276 $target.blur(); 4277 }, this)); 4278 4279 // Keyboard support. 4280 this.$container.off('keydown.multiselect').on('keydown.multiselect', $.proxy(function(event) { 4281 if ($('input[type="text"]', this.$container).is(':focus')) { 4282 return; 4283 } 4284 4285 if (event.keyCode === 9 && this.$container.hasClass('open')) { 4286 this.$button.click(); 4287 } 4288 else { 4289 var $items = $(this.$container).find("li:not(.divider):not(.disabled) a").filter(":visible"); 4290 4291 if (!$items.length) { 4292 return; 4293 } 4294 4295 var index = $items.index($items.filter(':focus')); 4296 4297 // Navigation up. 4298 if (event.keyCode === 38 && index > 0) { 4299 index--; 4300 } 4301 // Navigate down. 4302 else if (event.keyCode === 40 && index < $items.length - 1) { 4303 index++; 4304 } 4305 else if (!~index) { 4306 index = 0; 4307 } 4308 4309 var $current = $items.eq(index); 4310 $current.focus(); 4311 4312 if (event.keyCode === 32 || event.keyCode === 13) { 4313 var $checkbox = $current.find('input'); 4314 4315 $checkbox.prop("checked", !$checkbox.prop("checked")); 4316 $checkbox.change(); 4317 } 4318 4319 event.stopPropagation(); 4320 event.preventDefault(); 4321 } 4322 }, this)); 4323 4324 if(this.options.enableClickableOptGroups && this.options.multiple) { 4325 $('li.multiselect-group', this.$ul).on('click', $.proxy(function(event) { 4326 event.stopPropagation(); 4327 4328 var group = $(event.target).parent(); 4329 4330 // Search all option in optgroup 4331 var $options = group.nextUntil('li.multiselect-group'); 4332 var $visibleOptions = $options.filter(":visible:not(.disabled)"); 4333 4334 // check or uncheck items 4335 var allChecked = true; 4336 var optionInputs = $visibleOptions.find('input'); 4337 optionInputs.each(function() { 4338 allChecked = allChecked && $(this).prop('checked'); 4339 }); 4340 4341 optionInputs.prop('checked', !allChecked).trigger('change'); 4342 }, this)); 4343 } 4344 }, 4345 4346 /** 4347 * Create an option using the given select option. 4348 * 4349 * @param {jQuery} element 4350 */ 4351 createOptionValue: function(element) { 4352 var $element = $(element); 4353 if ($element.is(':selected')) { 4354 $element.prop('selected', true); 4355 } 4356
4357 // Support the label attribute on options. 4358 var label = this.options.optionLabel(element); 4359 var value = $element.val(); 4360 var inputType = this.options.multiple ? "checkbox" : "radio"; 4361 4362 var $li = $(this.options.templates.li); 4363 var $label = $('label', $li); 4364 $label.addClass(inputType); 4365 4366 if (this.options.enableHTML) { 4367 $label.html(" " + label); 4368 } 4369 else { 4370 $label.text(" " + label); 4371 } 4372 4373 var $checkbox = $('<input/>').attr('type', inputType); 4374 4375 if (this.options.checkboxName) { 4376 $checkbox.attr('name', this.options.checkboxName); 4377 } 4378 $label.prepend($checkbox,'<span/>'); 4379 4380 var selected = $element.prop('selected') || false; 4381 $checkbox.val(value); 4382 4383 if (value === this.options.selectAllValue) { 4384 $li.addClass("multiselect-item multiselect-all"); 4385 $checkbox.parent().parent() 4386 .addClass('multiselect-all'); 4387 } 4388 4389 $label.attr('title', $element.attr('title')); 4390 4391 this.$ul.append($li); 4392 4393 if ($element.is(':disabled')) { 4394 $checkbox.attr('disabled', 'disabled') 4395 .prop('disabled', true) 4396 .closest('a') 4397 .attr("tabindex", "-1") 4398 .closest('li') 4399 .addClass('disabled'); 4400 } 4401 4402 $checkbox.prop('checked', selected); 4403 4404 if (selected && this.options.selectedClass) { 4405 $checkbox.closest('li') 4406 .addClass(this.options.selectedClass); 4407 } 4408 }, 4409 4410 /** 4411 * Creates a divider using the given select option. 4412 * 4413 * @param {jQuery} element 4414 */ 4415 createDivider: function(element) { 4416 var $divider = $(this.options.templates.divider); 4417 this.$ul.append($divider); 4418 }, 4419 4420 /** 4421 * Creates an optgroup. 4422 * 4423 * @param {jQuery} group 4424 */ 4425 createOptgroup: function(group) { 4426 var groupName = $(group).prop('label'); 4427 4428 // Add a header for the group. 4429 var $li = $(this.options.templates.liGroup); 4430 4431 if (this.options.enableHTML) { 4432 $('label', $li).html(groupName); 4433 } 4434 else { 4435 $('label', $li).text(groupName); 4436 } 4437 4438 if (this.options.enableClickableOptGroups) { 4439 $li.addClass('multiselect-group-clickable'); 4440 } 4441 4442 this.$ul.append($li); 4443 4444 if ($(group).is(':disabled')) { 4445 $li.addClass('disabled'); 4446 } 4447 4448 // Add the options of the group. 4449 $('option', group).each($.proxy(function(index, element) { 4450 this.createOptionValue(element); 4451 }, this)); 4452 }, 4453 4454 /** 4455 * Build the selct all. 4456 * 4457 * Checks if a select all has already been created. 4458 */ 4459 buildSelectAll: function() { 4460 if (typeof this.options.selectAllValue === 'number') { 4461 this.options.selectAllValue = this.options.selectAllValue.toString(); 4462 } 4463 4464 var alreadyHasSelectAll = this.hasSelectAll(); 4465 4466 if (!alreadyHasSelectAll && this.options.includeSelectAllOption && this.options.multiple 4467 && $('option', this.$select).length > this.options.includeSelectAllIfMoreThan) { 4468 4469 // Check whether to add a divider after the select all. 4470 if (this.options.includeSelectAllDivider) { 4471 this.$ul.prepend($(this.options.templates.divider)); 4472 } 4473 4474 var $li = $(this.options.templates.li); 4475 $('label', $li).addClass("checkbox"); 4476 4477 if (this.options.enableHTML) { 4478 $('label', $li).html(" " + this.options.selectAllText); 4479 } 4480 else { 4481 $('label', $li).text(" " + this.options.selectAllText); 4482 } 4483 4484 if (this.options.selectAllName) { 4485 $('label', $li).prepend('<input type="checkbox" name="' + this.options.selectAllName + '" />'); 4486 } 4487 else { 4488 $('label', $li).prepend('<input type="checkbox" />'); 4489 } 4490 4491 var $checkbox = $('input', $li); 4492 $checkbox.val(this.options.selectAllValue); 4493 4494 $li.addClass("multiselect-item multiselect-all"); 4495 $checkbox.parent().parent() 4496 .addClass('multiselect-all'); 4497 4498 this.$ul.prepend($li); 4499 4500 $checkbox.prop('checked', false); 4501 } 4502 }, 4503 4504 /** 4505 * Builds the filter. 4506 */ 4507 buildFilter: function() { 4508 4509 // Build filter if filtering OR case insensitive filtering is enabled and the number of options exceeds (or equals) enableFilterLength. 4510 if (this.options.enableFiltering || this.options.enableCaseInsensitiveFiltering) { 4511 var enableFilterLength = Math.max(this.options.enableFiltering, this.options.enableCaseInsensitiveFiltering); 4512 4513 if (this.$select.find('option').length >= enableFilterLength) { 4514 4515 this.$filter = $(this.options.templates.filter); 4516 $('input', this.$filter).attr('placeholder', this.options.filterPlaceholder); 4517 4518 // Adds optional filter clear button 4519 if(this.options.includeFilterClearBtn){ 4520 var clearBtn = $(this.options.templates.filterClearBtn); 4521 clearBtn.on('click', $.proxy(function(event){ 4522 clearTimeout(this.searchTimeout); 4523 this.$filter.find('.multiselect-search').val(''); 4524 $('li', this.$ul).show().removeClass("filter-hidden"); 4525 this.updateSelectAll(); 4526 }, this)); 4527 this.$filter.find('.input-group').append(clearBtn); 4528 } 4529 4530 this.$ul.prepend(this.$filter); 4531 4532 this.$filter.val(this.query).on('click', function(event) { 4533 event.stopPropagation(); 4534 }).on('input keydown', $.proxy(function(event) { 4535 // Cancel enter key default behaviour 4536 if (event.which === 13) { 4537 event.preventDefault(); 4538 } 4539 4540 // This is useful to catch "keydown" events after the browser has updated the control. 4541 clearTimeout(this.searchTimeout); 4542 4543 this.searchTimeout = this.asyncFunction($.proxy(function() { 4544 4545 if (this.query !== event.target.value) { 4546 this.query = event.target.value; 4547 4548 var currentGroup, currentGroupVisible; 4549 $.each($('li', this.$ul), $.proxy(function(index, element) { 4550 var value = $('input', element).length > 0 ? $('input', element).val() : ""; 4551 var text = $('label', element).text(); 4552 4553 var filterCandidate = ''; 4554 if ((this.options.filterBehavior === 'text')) { 4555 filterCandidate = text; 4556 } 4557 else if ((this.options.filterBehavior === 'value')) { 4558 filterCandidate = value; 4559 } 4560 else if (this.options.filterBehavior === 'both') { 4561 filterCandidate = text + '\n' + value; 4562 } 4563 4564 if (value !== this.options.selectAllValue && text) { 4565 // By default lets assume that element is not 4566 // interesting for this search. 4567 var showElement = false;
4568 4569 if (this.options.enableCaseInsensitiveFiltering && filterCandidate.toLowerCase().indexOf(this.query.toLowerCase()) > -1) { 4570 showElement = true; 4571 } 4572 else if (filterCandidate.indexOf(this.query) > -1) { 4573 showElement = true; 4574 } 4575 4576 // Toggle current element (group or group item) according to showElement boolean. 4577 $(element).toggle(showElement).toggleClass('filter-hidden', !showElement); 4578 4579 // Differentiate groups and group items. 4580 if ($(element).hasClass('multiselect-group')) { 4581 // Remember group status. 4582 currentGroup = element; 4583 currentGroupVisible = showElement; 4584 } 4585 else { 4586 // Show group name when at least one of its items is visible. 4587 if (showElement) { 4588 $(currentGroup).show().removeClass('filter-hidden'); 4589 } 4590 4591 // Show all group items when group name satisfies filter. 4592 if (!showElement && currentGroupVisible) { 4593 $(element).show().removeClass('filter-hidden'); 4594 } 4595 } 4596 } 4597 }, this)); 4598 } 4599 4600 this.updateSelectAll(); 4601 }, this), 300, this); 4602 }, this)); 4603 } 4604 } 4605 }, 4606 4607 /** 4608 * Unbinds the whole plugin. 4609 */ 4610 destroy: function() { 4611 this.$container.remove(); 4612 this.$select.show(); 4613 this.$select.data('multiselect', null); 4614 }, 4615 4616 /** 4617 * Refreshs the multiselect based on the selected options of the select. 4618 */ 4619 refresh: function() { 4620 $('option', this.$select).each($.proxy(function(index, element) { 4621 var $input = $('li input', this.$ul).filter(function() { 4622 return $(this).val() === $(element).val(); 4623 }); 4624 4625 if ($(element).is(':selected')) { 4626 $input.prop('checked', true); 4627 4628 if (this.options.selectedClass) { 4629 $input.closest('li') 4630 .addClass(this.options.selectedClass); 4631 } 4632 } 4633 else { 4634 $input.prop('checked', false); 4635 4636 if (this.options.selectedClass) { 4637 $input.closest('li') 4638 .removeClass(this.options.selectedClass); 4639 } 4640 } 4641 4642 if ($(element).is(":disabled")) { 4643 $input.attr('disabled', 'disabled') 4644 .prop('disabled', true) 4645 .closest('li') 4646 .addClass('disabled'); 4647 } 4648 else { 4649 $input.prop('disabled', false) 4650 .closest('li') 4651 .removeClass('disabled'); 4652 } 4653 }, this)); 4654 4655 this.updateButtonText(); 4656 this.updateSelectAll(); 4657 }, 4658 4659 /** 4660 * Select all options of the given values. 4661 * 4662 * If triggerOnChange is set to true, the on change event is triggered if 4663 * and only if one value is passed. 4664 * 4665 * @param {Array} selectValues 4666 * @param {Boolean} triggerOnChange 4667 */ 4668 select: function(selectValues, triggerOnChange) { 4669 if(!$.isArray(selectValues)) { 4670 selectValues = [selectValues]; 4671 } 4672 4673 for (var i = 0; i < selectValues.length; i++) { 4674 var value = selectValues[i]; 4675 4676 if (value === null || value === undefined) { 4677 continue; 4678 } 4679 4680 var $option = this.getOptionByValue(value); 4681 var $checkbox = this.getInputByValue(value); 4682 4683 if($option === undefined || $checkbox === undefined) { 4684 continue; 4685 } 4686 4687 if (!this.options.multiple) { 4688 this.deselectAll(false); 4689 } 4690 4691 if (this.options.selectedClass) { 4692 $checkbox.closest('li') 4693 .addClass(this.options.selectedClass); 4694 } 4695 4696 $checkbox.prop('checked', true); 4697 $option.prop('selected', true); 4698 } 4699 4700 this.updateButtonText(); 4701 this.updateSelectAll(); 4702 4703 if (triggerOnChange && selectValues.length === 1) { 4704 this.options.onChange($option, true); 4705 } 4706 }, 4707 4708 /** 4709 * Clears all selected items. 4710 */ 4711 clearSelection: function () { 4712 this.deselectAll(false); 4713 this.updateButtonText(); 4714 this.updateSelectAll(); 4715 }, 4716 4717 /** 4718 * Deselects all options of the given values. 4719 * 4720 * If triggerOnChange is set to true, the on change event is triggered, if 4721 * and only if one value is passed. 4722 * 4723 * @param {Array} deselectValues 4724 * @param {Boolean} triggerOnChange 4725 */ 4726 deselect: function(deselectValues, triggerOnChange) { 4727 if(!$.isArray(deselectValues)) { 4728 deselectValues = [deselectValues]; 4729 } 4730 4731 for (var i = 0; i < deselectValues.length; i++) { 4732 var value = deselectValues[i]; 4733 4734 if (value === null || value === undefined) { 4735 continue; 4736 } 4737 4738 var $option = this.getOptionByValue(value); 4739 var $checkbox = this.getInputByValue(value); 4740 4741 if($option === undefined || $checkbox === undefined) { 4742 continue; 4743 } 4744 4745 if (this.options.selectedClass) { 4746 $checkbox.closest('li') 4747 .removeClass(this.options.selectedClass); 4748 } 4749 4750 $checkbox.prop('checked', false); 4751 $option.prop('selected', false); 4752 } 4753 4754 this.updateButtonText(); 4755 this.updateSelectAll(); 4756 4757 if (triggerOnChange && deselectValues.length === 1) { 4758 this.options.onChange($option, false); 4759 } 4760 }, 4761 4762 /** 4763 * Selects all enabled & visible options. 4764 * 4765 * If justVisible is true or not specified, only visible options are selected. 4766 * 4767 * @param {Boolean} justVisible 4768 * @param {Boolean} triggerOnSelectAll 4769 */ 4770 selectAll: function (justVisible, triggerOnSelectAll) { 4771 var justVisible = typeof justVisible === 'undefined' ? true : justVisible; 4772 var allCheckboxes = $("li input[type='checkbox']:enabled", this.$ul); 4773 var visibleCheckboxes = allCheckboxes.filter(":visible"); 4774 var allCheckboxesCount = allCheckboxes.length; 4775 var visibleCheckboxesCount = visibleCheckboxes.length; 4776 4777 if(justVisible) { 4778 visibleCheckboxes.prop('checked', true); 4779 $("li:not(.divider):not(.disabled)", this.$ul).filter(":visible").addClass(this.options.selectedClass); 4780 } 4781 else { 4782 allCheckboxes.prop('checked', true); 4783 $("li:not(.divider):not(.disabled)", this.$ul).addClass(this.options.selectedClass); 4784 } 4785 4786 if (allCheckboxesCount === visibleCheckboxesCount || justVisible === false) { 4787 $("option:enabled", this.$select).prop('selected', true); 4788 } 4789 else { 4790 var values = visibleCheckboxes.map(function() { 4791 return $(this).val(); 4792 }).get(); 4793 4794 $("option:enabled", this.$select).filter(function(index) { 4795 return $.inArray($(this).val(), values) !== -1; 4796 }).prop('selected', true); 4797 } 4798 4799 if (triggerOnSelectAll) { 4800 this.options.onSelectAll(); 4801 } 4802 }, 4803 4804 /** 4805 * Deselects all options. 4806 * 4807 * If justVisible is true or not specified, only visible options are deselected. 4808 * 4809 * @param {Boolean} justVisible 4810 */ 4811 deselectAll: function (justVisible) { 4812 var justVisible = typeof justVisible === 'undefined' ? true : justVisible; 4813 4814 if(justVisible) { 4815 var visibleCheckboxes = $("li input[type='checkbox']:not(:disabled)", this.$ul).filter(":visible"); 4816 visibleCheckboxes.prop('checked', false); 4817 4818 var values = visibleCheckboxes.map(function() { 4819 return $(this).val(); 4820 }).get(); 4821 4822 $("option:enabled", this.$select).filter(function(index) { 4823 return $.inArray($(this).val(), values) !== -1; 4824 }).prop('selected', false); 4825 4826 if (this.options.selectedClass) { 4827 $("li:not(.divider):not(.disabled)", this.$ul).filter(":visible").removeClass(this.options.selectedClass); 4828 } 4829 } 4830 else { 4831 $("li input[type='checkbox']:enabled", this.$ul).prop('checked', false); 4832 $("option:enabled", this.$select).prop('selected', false); 4833 4834 if (this.options.selectedClass) { 4835 $("li:not(.divider):not(.disabled)", this.$ul).removeClass(this.options.selectedClass); 4836 } 4837 } 4838 }, 4839 4840 /** 4841 * Rebuild the plugin. 4842 * 4843 * Rebuilds the dropdown, the filter and the select all option. 4844 */ 4845 rebuild: function() { 4846 this.$ul.html(''); 4847 4848 // Important to distinguish between radios and checkboxes. 4849 this.options.multiple = this.$select.attr('multiple') === "multiple"; 4850 4851 this.buildSelectAll(); 4852 this.buildDropdownOptions(); 4853 this.buildFilter(); 4854 4855 this.updateButtonText(); 4856 this.updateSelectAll(); 4857 4858 if (this.options.disableIfEmpty && $('option', this.$select).length <= 0) { 4859 this.disable(); 4860 } 4861 else { 4862 this.enable(); 4863 } 4864 4865 if (this.options.dropRight) { 4866 this.$ul.addClass('pull-right'); 4867 } 4868 }, 4869 4870 /** 4871 * The provided data will be used to build the dropdown. 4872 */ 4873 dataprovider: function(dataprovider) { 4874 4875 var groupCounter = 0; 4876 var $select = this.$select.empty(); 4877 4878 $.each(dataprovider, function (index, option) { 4879 var $tag; 4880 4881 if ($.isArray(option.children)) { // create optiongroup tag 4882 groupCounter++; 4883 4884 $tag = $('<optgroup/>').attr({ 4885 label: option.label || 'Group ' + groupCounter, 4886 disabled: !!option.disabled 4887 }); 4888
4889 forEach(option.children, function(subOption) { // add children option tags 4890 $tag.append($('<option/>').attr({ 4891 value: subOption.value, 4892 label: subOption.label || subOption.value, 4893 title: subOption.title, 4894 selected: !!subOption.selected, 4895 disabled: !!subOption.disabled 4896 })); 4897 }); 4898 } 4899 else { 4900 $tag = $('<option/>').attr({ 4901 value: option.value, 4902 label: option.label || option.value, 4903 title: option.title, 4904 selected: !!option.selected, 4905 disabled: !!option.disabled 4906 }); 4907 } 4908 4909 $select.append($tag); 4910 }); 4911 4912 this.rebuild(); 4913 }, 4914 4915 /** 4916 * Enable the multiselect. 4917 */ 4918 enable: function() { 4919 this.$select.prop('disabled', false); 4920 this.$button.prop('disabled', false) 4921 .removeClass('disabled'); 4922 }, 4923 4924 /** 4925 * Disable the multiselect. 4926 */ 4927 disable: function() { 4928 this.$select.prop('disabled', true); 4929 this.$button.prop('disabled', true) 4930 .addClass('disabled'); 4931 }, 4932 4933 /** 4934 * Set the options. 4935 * 4936 * @param {Array} options 4937 */ 4938 setOptions: function(options) { 4939 this.options = this.mergeOptions(options); 4940 }, 4941 4942 /** 4943 * Merges the given options with the default options. 4944 * 4945 * @param {Array} options 4946 * @returns {Array} 4947 */ 4948 mergeOptions: function(options) { 4949 return $.extend(true, {}, this.defaults, this.options, options); 4950 }, 4951 4952 /** 4953 * Checks whether a select all checkbox is present. 4954 * 4955 * @returns {Boolean} 4956 */ 4957 hasSelectAll: function() { 4958 return $('li.multiselect-all', this.$ul).length > 0; 4959 }, 4960 4961 /** 4962 * Updates the select all checkbox based on the currently displayed and selected checkboxes. 4963 */ 4964 updateSelectAll: function() { 4965 if (this.hasSelectAll()) { 4966 var allBoxes = $("li:not(.multiselect-item):not(.filter-hidden) input:enabled", this.$ul); 4967 var allBoxesLength = allBoxes.length; 4968 var checkedBoxesLength = allBoxes.filter(":checked").length; 4969 var selectAllLi = $("li.multiselect-all", this.$ul); 4970 var selectAllInput = selectAllLi.find("input"); 4971 4972 if (checkedBoxesLength > 0 && checkedBoxesLength === allBoxesLength) { 4973 selectAllInput.prop("checked", true); 4974 selectAllLi.addClass(this.options.selectedClass); 4975 this.options.onSelectAll(); 4976 } 4977 else { 4978 selectAllInput.prop("checked", false); 4979 selectAllLi.removeClass(this.options.selectedClass); 4980 } 4981 } 4982 }, 4983 4984 /** 4985 * Update the button text and its title based on the currently selected options. 4986 */ 4987 updateButtonText: function() { 4988 var options = this.getSelected(); 4989 4990 // First update the displayed button text. 4991 if (this.options.enableHTML) { 4992 $('.multiselect .multiselect-selected-text', this.$container).html(this.options.buttonText(options, this.$select)); 4993 } 4994 else { 4995 $('.multiselect .multiselect-selected-text', this.$container).text(this.options.buttonText(options, this.$select)); 4996 } 4997 4998 // Now update the title attribute of the button. 4999 $('.multiselect', this.$container).attr('title', this.options.buttonTitle(options, this.$select)); 5000 }, 5001 5002 /** 5003 * Get all selected options. 5004 * 5005 * @returns {jQUery} 5006 */ 5007 getSelected: function() { 5008 return $('option', this.$select).filter(":selected"); 5009 }, 5010 5011 /** 5012 * Gets a select option by its value. 5013 * 5014 * @param {String} value 5015 * @returns {jQuery} 5016 */ 5017 getOptionByValue: function (value) { 5018 5019 var options = $('option', this.$select); 5020 var valueToCompare = value.toString(); 5021 5022 for (var i = 0; i < options.length; i = i + 1) { 5023 var option = options[i]; 5024 if (option.value === valueToCompare) { 5025 return $(option); 5026 } 5027 } 5028 }, 5029 5030 /** 5031 * Get the input (radio/checkbox) by its value. 5032 * 5033 * @param {String} value 5034 * @returns {jQuery} 5035 */ 5036 getInputByValue: function (value) { 5037 5038 var checkboxes = $('li input', this.$ul); 5039 var valueToCompare = value.toString(); 5040 5041 for (var i = 0; i < checkboxes.length; i = i + 1) { 5042 var checkbox = checkboxes[i]; 5043 if (checkbox.value === valueToCompare) { 5044 return $(checkbox); 5045 } 5046 } 5047 }, 5048 5049 /** 5050 * Used for knockout integration. 5051 */ 5052 updateOriginalOptions: function() { 5053 this.originalOptions = this.$select.clone()[0].options; 5054 }, 5055 5056 asyncFunction: function(callback, timeout, self) { 5057 var args = Array.prototype.slice.call(arguments, 3); 5058 return setTimeout(function() { 5059 callback.apply(self || window, args); 5060 }, timeout); 5061 }, 5062 5063 setAllSelectedText: function(allSelectedText) { 5064 this.options.allSelectedText = allSelectedText; 5065 this.updateButtonText(); 5066 } 5067 }; 5068 5069 $.fn.multiselect = function(option, parameter, extraOptions) { 5070 return this.each(function() { 5071 var data = $(this).data('multiselect'); 5072 var options = typeof option === 'object' && option; 5073 5074 // Initialize the multiselect. 5075 if (!data) { 5076 data = new Multiselect(this, options); 5077 $(this).data('multiselect', data); 5078 } 5079 5080 // Call multiselect method. 5081 if (typeof option === 'string') { 5082 data[option](parameter, extraOptions); 5083 5084 if (option === 'destroy') { 5085 $(this).data('multiselect', false); 5086 } 5087 } 5088 }); 5089 }; 5090 5091 $.fn.multiselect.Constructor = Multiselect; 5092 5093 $(function() { 5094 $("select[data-role=multiselect]").multiselect(); 5095 }); 5096 5097}(window.jQuery); 5098 5099(function ($) { 5100 "use strict"; 5101 5102 //<editor-fold desc="Shims"> 5103 if (!String.prototype.includes) { 5104 (function () { 5105 "use strict"; // needed to support `apply`/`call` with `undefined`/`null` 5106 var toString = {}.toString; 5107 var defineProperty = (function () { 5108 // IE 8 only supports `Object.defineProperty` on DOM elements 5109 try { 5110 var object = {}; 5111 var $defineProperty = Object.defineProperty; 5112 var result = 5113 $defineProperty(object, object, object) && $defineProperty; 5114 } catch (error) {} 5115 return result; 5116 })(); 5117 var indexOf = "".indexOf; 5118 var includes = function (search) { 5119 if (this == null) { 5120 throw TypeError(); 5121 } 5122 var string = String(this); 5123 if (search && toString.call(search) == "[object RegExp]") { 5124 throw TypeError(); 5125 } 5126 var stringLength = string.length; 5127 var searchString = String(search); 5128 var searchLength = searchString.length; 5129 var position = arguments.length > 1 ? arguments[1] : undefined; 5130 // `ToInteger` 5131 var pos = position ? Number(position) : 0; 5132 if (pos != pos) { 5133 // better `isNaN` 5134 pos = 0; 5135 } 5136 var start = Math.min(Math.max(pos, 0), stringLength); 5137 // Avoid the `indexOf` call if no match is possible 5138 if (searchLength + start > stringLength) { 5139 return false;
5140 } 5141 return indexOf.call(string, searchString, pos) != -1; 5142 }; 5143 if (defineProperty) { 5144 defineProperty(String.prototype, "includes", { 5145 value: includes, 5146 configurable: true, 5147 writable: true, 5148 }); 5149 } else { 5150 String.prototype.includes = includes; 5151 } 5152 })(); 5153 } 5154 5155 if (!String.prototype.startsWith) { 5156 (function () { 5157 "use strict"; // needed to support `apply`/`call` with `undefined`/`null` 5158 var defineProperty = (function () { 5159 // IE 8 only supports `Object.defineProperty` on DOM elements 5160 try { 5161 var object = {}; 5162 var $defineProperty = Object.defineProperty; 5163 var result = 5164 $defineProperty(object, object, object) && $defineProperty; 5165 } catch (error) {} 5166 return result; 5167 })(); 5168 var toString = {}.toString; 5169 var startsWith = function (search) { 5170 if (this == null) { 5171 throw TypeError(); 5172 } 5173 var string = String(this); 5174 if (search && toString.call(search) == "[object RegExp]") { 5175 throw TypeError(); 5176 } 5177 var stringLength = string.length; 5178 var searchString = String(search); 5179 var searchLength = searchString.length; 5180 var position = arguments.length > 1 ? arguments[1] : undefined; 5181 // `ToInteger` 5182 var pos = position ? Number(position) : 0; 5183 if (pos != pos) { 5184 // better `isNaN` 5185 pos = 0; 5186 } 5187 var start = Math.min(Math.max(pos, 0), stringLength); 5188 // Avoid the `indexOf` call if no match is possible 5189 if (searchLength + start > stringLength) { 5190 return false; 5191 } 5192 var index = -1; 5193 while (++index < searchLength) { 5194 if ( 5195 string.charCodeAt(start + index) != searchString.charCodeAt(index) 5196 ) { 5197 return false; 5198 } 5199 } 5200 return true; 5201 }; 5202 if (defineProperty) { 5203 defineProperty(String.prototype, "startsWith", { 5204 value: startsWith, 5205 configurable: true, 5206 writable: true, 5207 }); 5208 } else { 5209 String.prototype.startsWith = startsWith; 5210 } 5211 })(); 5212 } 5213 5214 if (!Object.keys) { 5215 Object.keys = function ( 5216 o, // object 5217 k, // key 5218 r // result array 5219 ) { 5220 // initialize object and result 5221 r = []; 5222 // iterate over object keys 5223 // fill result array with non-prototypical keys 5224 for (k in o) r.hasOwnProperty.call(o, k) && r.push(k); 5225 // return result 5226 return r; 5227 }; 5228 } 5229 //</editor-fold> 5230 5231 // Case insensitive contains search 5232 $.expr[":"].icontains = function (obj, index, meta) { 5233 var $obj = $(obj); 5234 var haystack = ($obj.data("tokens") || $obj.text()).toUpperCase(); 5235 return haystack.includes(meta[3].toUpperCase()); 5236 }; 5237 5238 // Case insensitive begins search 5239 $.expr[":"].ibegins = function (obj, index, meta) { 5240 var $obj = $(obj); 5241 var haystack = ($obj.data("tokens") || $obj.text()).toUpperCase(); 5242 return haystack.startsWith(meta[3].toUpperCase()); 5243 }; 5244 5245 // Case and accent insensitive contains search 5246 $.expr[":"].aicontains = function (obj, index, meta) { 5247 var $obj = $(obj); 5248 var haystack = ( 5249 $obj.data("tokens") || 5250 $obj.data("normalizedText") || 5251 $obj.text() 5252 ).toUpperCase(); 5253 return haystack.includes(meta[3].toUpperCase()); 5254 }; 5255 5256 // Case and accent insensitive begins search 5257 $.expr[":"].aibegins = function (obj, index, meta) { 5258 var $obj = $(obj); 5259 var haystack = ( 5260 $obj.data("tokens") || 5261 $obj.data("normalizedText") || 5262 $obj.text() 5263 ).toUpperCase(); 5264 return haystack.startsWith(meta[3].toUpperCase()); 5265 }; 5266 5267 /** 5268 * Remove all diatrics from the given text. 5269 * @access private 5270 * @param {String} text 5271 * @returns {String} 5272 */ 5273 function normalizeToBase(text) { 5274 var rExps = [ 5275 { re: /[\xC0-\xC6]/g, ch: "A" }, 5276 { re: /[\xE0-\xE6]/g, ch: "a" }, 5277 { re: /[\xC8-\xCB]/g, ch: "E" }, 5278 { re: /[\xE8-\xEB]/g, ch: "e" }, 5279 { re: /[\xCC-\xCF]/g, ch: "I" }, 5280 { re: /[\xEC-\xEF]/g, ch: "i" }, 5281 { re: /[\xD2-\xD6]/g, ch: "O" },
5282 { re: /[\xF2-\xF6]/g, ch: "o" }, 5283 { re: /[\xD9-\xDC]/g, ch: "U" }, 5284 { re: /[\xF9-\xFC]/g, ch: "u" }, 5285 { re: /[\xC7-\xE7]/g, ch: "c" }, 5286 { re: /[\xD1]/g, ch: "N" }, 5287 { re: /[\xF1]/g, ch: "n" }, 5288 ]; 5289 $.each(rExps, function () { 5290 text = text.replace(this.re, this.ch); 5291 }); 5292 return text; 5293 } 5294 5295 function htmlEscape(html) { 5296 var escapeMap = { 5297 "&": "&", 5298 "<": "<", 5299 ">": ">", 5300 '"': """, 5301 "'": "'", 5302 "`": "`", 5303 }; 5304 var source = "(?:" + Object.keys(escapeMap).join("|") + ")", 5305 testRegexp = new RegExp(source), 5306 replaceRegexp = new RegExp(source, "g"), 5307 string = html == null ? "" : "" + html; 5308 return testRegexp.test(string) 5309 ? string.replace(replaceRegexp, function (match) { 5310 return escapeMap[match]; 5311 }) 5312 : string; 5313 } 5314 5315 var Selectpicker = function (element, options, e) { 5316 if (e) { 5317 e.stopPropagation(); 5318 e.preventDefault(); 5319 } 5320 5321 this.$element = $(element); 5322 this.$newElement = null; 5323 this.$button = null; 5324 this.$menu = null; 5325 this.$lis = null; 5326 this.options = options; 5327 5328 // If we have no title yet, try to pull it from the html title attribute (jQuery doesnt' pick it up as it's not a 5329 // data-attribute) 5330 if (this.options.title === null) { 5331 this.options.title = this.$element.attr("title"); 5332 } 5333 5334 //Expose public methods 5335 this.val = Selectpicker.prototype.val; 5336 this.render = Selectpicker.prototype.render; 5337 this.refresh = Selectpicker.prototype.refresh; 5338 this.setStyle = Selectpicker.prototype.setStyle; 5339 this.selectAll = Selectpicker.prototype.selectAll; 5340 this.deselectAll = Selectpicker.prototype.deselectAll; 5341 this.destroy = Selectpicker.prototype.remove; 5342 this.remove = Selectpicker.prototype.remove; 5343 this.show = Selectpicker.prototype.show; 5344 this.hide = Selectpicker.prototype.hide; 5345 5346 this.init(); 5347 }; 5348 5349 Selectpicker.VERSION = "1.7.2"; 5350 5351 // part of this is duplicated in i18n/defaults-en_US.js. Make sure to update both. 5352 Selectpicker.DEFAULTS = { 5353 noneSelectedText: "Nothing selected", 5354 noneResultsText: "No results matched {0}", 5355 countSelectedText: function (numSelected, numTotal) { 5356 return numSelected == 1 ? "{0} item selected" : "{0} items selected"; 5357 }, 5358 maxOptionsText: function (numAll, numGroup) { 5359 return [ 5360 numAll == 1 5361 ? "Limit reached ({n} item max)" 5362 : "Limit reached ({n} items max)", 5363 numGroup == 1 5364 ? "Group limit reached ({n} item max)" 5365 : "Group limit reached ({n} items max)", 5366 ]; 5367 }, 5368 selectAllText: "Select All", 5369 deselectAllText: "Deselect All", 5370 doneButton: false, 5371 doneButtonText: "Close", 5372 multipleSeparator: ", ", 5373 styleBase: "btn", 5374 style: "btn-default", 5375 size: "auto", 5376 title: null, 5377 selectedTextFormat: "values", 5378 width: false, 5379 container: false, 5380 hideDisabled: false, 5381 showSubtext: false, 5382 showIcon: true, 5383 showContent: true, 5384 dropupAuto: true, 5385 header: false, 5386 liveSearch: false, 5387 liveSearchPlaceholder: null, 5388 liveSearchNormalize: false, 5389 liveSearchStyle: "contains", 5390 actionsBox: false, 5391 iconBase: "glyphicon", 5392 tickIcon: "glyphicon-ok", 5393 maxOptions: false, 5394 mobile: false, 5395 selectOnTab: false, 5396 dropdownAlignRight: false, 5397 }; 5398 5399 Selectpicker.prototype = { 5400 constructor: Selectpicker, 5401 5402 init: function () { 5403 var that = this, 5404 id = this.$element.attr("id"); 5405 5406 this.$element.addClass("bs-select-hidden"); 5407 // store originalIndex (key) and newIndex (value) in this.liObj for fast accessibility 5408 // allows us to do this.$lis.eq(that.liObj[index]) instead of this.$lis.filter('[data-original-index="' + index + '"]') 5409 this.liObj = {}; 5410 this.multiple = this.$element.prop("multiple"); 5411 this.autofocus = this.$element.prop("autofocus"); 5412 this.$newElement = this.createView(); 5413 this.$element.after(this.$newElement); 5414 this.$button = this.$newElement.children("button"); 5415 this.$menu = this.$newElement.children(".dropdown-menu"); 5416 this.$menuInner = this.$menu.children(".inner"); 5417 this.$searchbox = this.$menu.find("input"); 5418 5419 if (this.options.dropdownAlignRight) 5420 this.$menu.addClass("dropdown-menu-right"); 5421 5422 if (typeof id !== "undefined") { 5423 this.$button.attr("data-id", id); 5424 $('label[for="' + id + '"]').click(function (e) { 5425 e.preventDefault(); 5426 that.$button.focus(); 5427 }); 5428 } 5429 5430 this.checkDisabled(); 5431 this.clickListener(); 5432 if (this.options.liveSearch) this.liveSearchListener(); 5433 this.render(); 5434 this.setStyle(); 5435 this.setWidth(); 5436 if (this.options.container) this.selectPosition(); 5437 this.$menu.data("this", this); 5438 this.$newElement.data("this", this); 5439 if (this.options.mobile) this.mobile(); 5440 5441 this.$newElement.on("hide.bs.dropdown", function (e) { 5442 that.$element.trigger("hide.bs.select", e); 5443 }); 5444 5445 this.$newElement.on("hidden.bs.dropdown", function (e) { 5446 that.$element.trigger("hidden.bs.select", e); 5447 }); 5448 5449 this.$newElement.on("show.bs.dropdown", function (e) { 5450 that.$element.trigger("show.bs.select", e); 5451 }); 5452 5453 this.$newElement.on("shown.bs.dropdown", function (e) { 5454 that.$element.trigger("shown.bs.select", e); 5455 }); 5456 5457 setTimeout(function () { 5458 that.$element.trigger("loaded.bs.select"); 5459 }); 5460 }, 5461 5462 createDropdown: function () { 5463 // Options 5464 // If we are multiple, then add the show-tick class by default 5465 var multiple = this.multiple ? " show-tick" : "", 5466 inputGroup = this.$element.parent().hasClass("input-group") 5467 ? " input-group-btn" 5468 : "", 5469 autofocus = this.autofocus ? " autofocus" : ""; 5470 // Elements 5471 var header = this.options.header 5472 ? '<div class="popover-title"><button type="button" class="close" aria-hidden="true">×</button>' + 5473 this.options.header + 5474 "</div>" 5475 : ""; 5476 var searchbox = this.options.liveSearch 5477 ? '<div class="bs-searchbox">' + 5478 '<input type="text" class="form-control" autocomplete="off"' + 5479 (null === this.options.liveSearchPlaceholder 5480 ? "" 5481 : ' placeholder="' + 5482 htmlEscape(this.options.liveSearchPlaceholder) + 5483 '"') + 5484 ">" + 5485 "</div>" 5486 : ""; 5487 var actionsbox = 5488 this.multiple && this.options.actionsBox 5489 ? '<div class="bs-actionsbox">' + 5490 '<div class="btn-group btn-group-sm btn-block">' + 5491 '<button type="button" class="actions-btn bs-select-all btn btn-default">' + 5492 this.options.selectAllText + 5493 "</button>" + 5494 '<button type="button" class="actions-btn bs-deselect-all btn btn-default">' + 5495 this.options.deselectAllText + 5496 "</button>" + 5497 "</div>" + 5498 "</div>" 5499 : ""; 5500 var donebutton = 5501 this.multiple && this.options.doneButton 5502 ? '<div class="bs-donebutton">' + 5503 '<div class="btn-group btn-block">' + 5504 '<button type="button" class="btn btn-sm btn-default">' + 5505 this.options.doneButtonText + 5506 "</button>" + 5507 "</div>" + 5508 "</div>" 5509 : ""; 5510 var drop = 5511 '<div class="btn-group bootstrap-select' + 5512 multiple + 5513 inputGroup + 5514 '">' + 5515 '<button type="button" class="' + 5516 this.options.styleBase + 5517 ' dropdown-toggle" data-toggle="dropdown"' + 5518 autofocus + 5519 ">" + 5520 '<span class="filter-option pull-left"></span> ' + 5521 '<span class="caret"></span>' + 5522 "</button>" + 5523 '<div class="dropdown-menu open">' + 5524 header + 5525 searchbox + 5526 actionsbox + 5527 '<ul class="dropdown-menu inner" role="menu">' + 5528 "</ul>" + 5529 donebutton + 5530 "</div>" + 5531 "</div>"; 5532 5533 return $(drop); 5534 }, 5535 5536 createView: function () { 5537 var $drop = this.createDropdown(), 5538 li = this.createLi(); 5539 5540 $drop.find("ul")[0].innerHTML = li; 5541 return $drop; 5542 }, 5543 5544 reloadLi: function () { 5545 //Remove all children. 5546 this.destroyLi(); 5547 //Re build 5548 var li = this.createLi(); 5549 this.$menuInner[0].innerHTML = li; 5550 }, 5551 5552 destroyLi: function () { 5553 this.$menu.find("li").remove(); 5554 }, 5555 5556 createLi: function () { 5557 var that = this, 5558 _li = [], 5559 optID = 0, 5560 titleOption = document.createElement("option"), 5561 liIndex = -1; // increment liIndex whenever a new <li> element is created to ensure liObj is correct 5562 5563 // Helper functions 5564 /** 5565 * @param content 5566 * @param [index] 5567 * @param [classes] 5568 * @param [optgroup] 5569 * @returns {string} 5570 */ 5571 var generateLI = function (content, index, classes, optgroup) { 5572 return ( 5573 "<li" + 5574 ((typeof classes !== "undefined") & ("" !== classes) 5575 ? ' class="' + classes + '"' 5576 : "") + 5577 ((typeof index !== "undefined") & (null !== index) 5578 ? ' data-original-index="' + index + '"' 5579 : "") + 5580 ((typeof optgroup !== "undefined") & (null !== optgroup) 5581 ? 'data-optgroup="' + optgroup + '"' 5582 : "") + 5583 ">" + 5584 content + 5585 "</li>" 5586 ); 5587 }; 5588 5589 /** 5590 * @param text 5591 * @param [classes] 5592 * @param [inline] 5593 * @param [tokens] 5594 * @returns {string} 5595 */ 5596 var generateA = function (text, classes, inline, tokens) { 5597 return ( 5598 '<a tabindex="0"' + 5599 (typeof classes !== "undefined" ? ' class="' + classes + '"' : "") + 5600 (typeof inline !== "undefined" ? ' style="' + inline + '"' : "") + 5601 (that.options.liveSearchNormalize 5602 ? ' data-normalized-text="' + 5603 normalizeToBase(htmlEscape(text)) + 5604 '"' 5605 : "") + 5606 (typeof tokens !== "undefined" || tokens !== null 5607 ? ' data-tokens="' + tokens + '"' 5608 : "") + 5609 ">" + 5610 text + 5611 '<span class="' + 5612 that.options.iconBase + 5613 " " + 5614 that.options.tickIcon + 5615 ' check-mark"></span>' + 5616 "</a>" 5617 ); 5618 }; 5619 5620 if (this.options.title && !this.multiple) { 5621 // this option doesn't create a new <li> element, but does add a new option, so liIndex is decreased 5622 // since liObj is recalculated on every refresh, liIndex needs to be decreased even if the titleOption is already appended 5623 liIndex--; 5624 5625 if (!this.$element.find(".bs-title-option").length) {
5626 // Use native JS to prepend option (faster) 5627 var element = this.$element[0]; 5628 titleOption.className = "bs-title-option"; 5629 titleOption.appendChild(document.createTextNode(this.options.title)); 5630 titleOption.value = ""; 5631 element.insertBefore(titleOption, element.firstChild); 5632 // Check if selected attribute is already set on an option. If not, select the titleOption option. 5633 if ( 5634 element.options[element.selectedIndex].getAttribute("selected") === 5635 null 5636 ) 5637 titleOption.selected = true; 5638 } 5639 } 5640 5641 this.$element.find("option").each(function (index) { 5642 var $this = $(this); 5643 5644 liIndex++; 5645 5646 if ($this.hasClass("bs-title-option")) return; 5647 5648 // Get the class and text for the option 5649 var optionClass = this.className || "", 5650 inline = this.style.cssText, 5651 text = $this.data("content") ? $this.data("content") : $this.html(), 5652 tokens = $this.data("tokens") ? $this.data("tokens") : null, 5653 subtext = 5654 typeof $this.data("subtext") !== "undefined" 5655 ? '<small class="text-muted">' + 5656 $this.data("subtext") + 5657 "</small>" 5658 : "", 5659 icon = 5660 typeof $this.data("icon") !== "undefined" 5661 ? '<span class="' + 5662 that.options.iconBase + 5663 " " + 5664 $this.data("icon") + 5665 '"></span> ' 5666 : "", 5667 isDisabled = 5668 this.disabled || 5669 (this.parentElement.tagName === "OPTGROUP" && 5670 this.parentElement.disabled); 5671 5672 if (icon !== "" && isDisabled) { 5673 icon = "<span>" + icon + "</span>"; 5674 } 5675 5676 if (that.options.hideDisabled && isDisabled) { 5677 liIndex--; 5678 return; 5679 } 5680 5681 if (!$this.data("content")) { 5682 // Prepend any icon and append any subtext to the main text. 5683 text = icon + '<span class="text">' + text + subtext + "</span>"; 5684 } 5685 5686 if ( 5687 this.parentElement.tagName === "OPTGROUP" && 5688 $this.data("divider") !== true 5689 ) { 5690 if ($this.index() === 0) { 5691 // Is it the first option of the optgroup? 5692 optID += 1; 5693 5694 // Get the opt group label 5695 var label = this.parentElement.label, 5696 labelSubtext = 5697 typeof $this.parent().data("subtext") !== "undefined" 5698 ? '<small class="text-muted">' + 5699 $this.parent().data("subtext") + 5700 "</small>" 5701 : "", 5702 labelIcon = $this.parent().data("icon") 5703 ? '<span class="' + 5704 that.options.iconBase + 5705 " " + 5706 $this.parent().data("icon") + 5707 '"></span> ' 5708 : "", 5709 optGroupClass = " " + this.parentElement.className || ""; 5710 5711 label = 5712 labelIcon + 5713 '<span class="text">' + 5714 label + 5715 labelSubtext + 5716 "</span>"; 5717 5718 if (index !== 0 && _li.length > 0) { 5719 // Is it NOT the first option of the select && are there elements in the dropdown? 5720 liIndex++; 5721 _li.push(generateLI("", null, "divider", optID + "div")); 5722 } 5723 liIndex++; 5724 _li.push( 5725 generateLI(label, null, "dropdown-header" + optGroupClass, optID) 5726 ); 5727 } 5728 _li.push( 5729 generateLI( 5730 generateA( 5731 text, 5732 "opt " + optionClass + optGroupClass, 5733 inline, 5734 tokens 5735 ), 5736 index, 5737 "", 5738 optID 5739 ) 5740 ); 5741 } else if ($this.data("divider") === true) { 5742 _li.push(generateLI("", index, "divider")); 5743 } else if ($this.data("hidden") === true) { 5744 _li.push( 5745 generateLI( 5746 generateA(text, optionClass, inline, tokens), 5747 index, 5748 "hidden is-hidden" 5749 ) 5750 ); 5751 } else { 5752 if ( 5753 this.previousElementSibling && 5754 this.previousElementSibling.tagName === "OPTGROUP" 5755 ) { 5756 liIndex++; 5757 _li.push(generateLI("", null, "divider", optID + "div")); 5758 } 5759 _li.push( 5760 generateLI(generateA(text, optionClass, inline, tokens), index) 5761 ); 5762 } 5763 5764 that.liObj[index] = liIndex; 5765 }); 5766 5767 //If we are not multiple, we don't have a selected item, and we don't have a title, select the first element so something is set in the button 5768 if ( 5769 !this.multiple && 5770 this.$element.find("option:selected").length === 0 && 5771 !this.options.title 5772 ) { 5773 this.$element 5774 .find("option") 5775 .eq(0) 5776 .prop("selected", true) 5777 .attr("selected", "selected"); 5778 } 5779 5780 return _li.join(""); 5781 }, 5782 5783 findLis: function () { 5784 if (this.$lis == null) this.$lis = this.$menu.find("li"); 5785 return this.$lis; 5786 }, 5787 5788 /** 5789 * @param [updateLi] defaults to true 5790 */ 5791 render: function (updateLi) { 5792 var that = this, 5793 notDisabled; 5794 5795 //Update the LI to match the SELECT 5796 if (updateLi !== false) { 5797 this.$element.find("option").each(function (index) { 5798 var $lis = that.findLis().eq(that.liObj[index]); 5799 5800 that.setDisabled( 5801 index, 5802 this.disabled || 5803 (this.parentElement.tagName === "OPTGROUP" && 5804 this.parentElement.disabled), 5805 $lis 5806 ); 5807 that.setSelected(index, this.selected, $lis); 5808 }); 5809 } 5810 5811 this.tabIndex(); 5812 5813 var selectedItems = this.$element 5814 .find("option") 5815 .map(function () { 5816 if (this.selected) { 5817 if ( 5818 that.options.hideDisabled && 5819 (this.disabled || 5820 (this.parentElement.tagName === "OPTGROUP" && 5821 this.parentElement.disabled)) 5822 ) 5823 return false;
5824 5825 var $this = $(this), 5826 icon = 5827 $this.data("icon") && that.options.showIcon 5828 ? '<i class="' + 5829 that.options.iconBase + 5830 " " + 5831 $this.data("icon") + 5832 '"></i> ' 5833 : "", 5834 subtext; 5835 5836 if ( 5837 that.options.showSubtext && 5838 $this.data("subtext") && 5839 !that.multiple 5840 ) { 5841 subtext = 5842 ' <small class="text-muted">' + 5843 $this.data("subtext") + 5844 "</small>"; 5845 } else { 5846 subtext = ""; 5847 } 5848 if (typeof $this.attr("title") !== "undefined") { 5849 return $this.attr("title"); 5850 } else if ($this.data("content") && that.options.showContent) { 5851 return $this.data("content"); 5852 } else { 5853 return icon + $this.html() + subtext; 5854 } 5855 } 5856 }) 5857 .toArray(); 5858 5859 //Fixes issue in IE10 occurring when no default option is selected and at least one option is disabled 5860 //Convert all the values into a comma delimited string 5861 var title = !this.multiple 5862 ? selectedItems[0] 5863 : selectedItems.join(this.options.multipleSeparator); 5864 5865 //If this is multi select, and the selectText type is count, the show 1 of 2 selected etc.. 5866 if ( 5867 this.multiple && 5868 this.options.selectedTextFormat.indexOf("count") > -1 5869 ) { 5870 var max = this.options.selectedTextFormat.split(">"); 5871 if ( 5872 (max.length > 1 && selectedItems.length > max[1]) || 5873 (max.length == 1 && selectedItems.length >= 2) 5874 ) { 5875 notDisabled = this.options.hideDisabled ? ", [disabled]" : ""; 5876 var totalCount = this.$element 5877 .find("option") 5878 .not( 5879 '[data-divider="true"], [data-hidden="true"]' + notDisabled 5880 ).length, 5881 tr8nText = 5882 typeof this.options.countSelectedText === "function" 5883 ? this.options.countSelectedText( 5884 selectedItems.length, 5885 totalCount 5886 ) 5887 : this.options.countSelectedText; 5888 title = tr8nText 5889 .replace("{0}", selectedItems.length.toString()) 5890 .replace("{1}", totalCount.toString()); 5891 } 5892 } 5893 5894 if (this.options.title == undefined) { 5895 this.options.title = this.$element.attr("title"); 5896 } 5897 5898 if (this.options.selectedTextFormat == "static") { 5899 title = this.options.title; 5900 } 5901 5902 //If we dont have a title, then use the default, or if nothing is set at all, use the not selected text 5903 if (!title) { 5904 title = 5905 typeof this.options.title !== "undefined" 5906 ? this.options.title 5907 : this.options.noneSelectedText; 5908 } 5909 5910 //strip all html-tags and trim the result 5911 this.$button.attr("title", $.trim(title.replace(/<[^>]*>?/g, ""))); 5912 this.$button.children(".filter-option").html(title); 5913 5914 this.$element.trigger("rendered.bs.select"); 5915 }, 5916 5917 /** 5918 * @param [style] 5919 * @param [status] 5920 */ 5921 setStyle: function (style, status) { 5922 if (this.$element.attr("class")) { 5923 this.$newElement.addClass( 5924 this.$element 5925 .attr("class") 5926 .replace( 5927 /selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi, 5928 "" 5929 ) 5930 ); 5931 } 5932 5933 var buttonClass = style ? style : this.options.style; 5934 5935 if (status == "add") { 5936 this.$button.addClass(buttonClass); 5937 } else if (status == "remove") { 5938 this.$button.removeClass(buttonClass); 5939 } else { 5940 this.$button.removeClass(this.options.style); 5941 this.$button.addClass(buttonClass); 5942 } 5943 }, 5944 5945 liHeight: function (refresh) { 5946 if (!refresh && (this.options.size === false || this.sizeInfo)) return; 5947 5948 var newElement = document.createElement("div"), 5949 menu = document.createElement("div"), 5950 menuInner = document.createElement("ul"), 5951 divider = document.createElement("li"), 5952 li = document.createElement("li"), 5953 a = document.createElement("a"), 5954 text = document.createElement("span"), 5955 header = this.options.header 5956 ? this.$menu.find(".popover-title")[0].cloneNode(true) 5957 : null, 5958 search = this.options.liveSearch ? document.createElement("div") : null, 5959 actions = 5960 this.options.actionsBox && this.multiple 5961 ? this.$menu.find(".bs-actionsbox")[0].cloneNode(true) 5962 : null, 5963 doneButton = 5964 this.options.doneButton && this.multiple 5965 ? this.$menu.find(".bs-donebutton")[0].cloneNode(true) 5966 : null; 5967 5968 text.className = "text"; 5969 newElement.className = this.$menu[0].parentNode.className + " open"; 5970 menu.className = "dropdown-menu open"; 5971 menuInner.className = "dropdown-menu inner"; 5972 divider.className = "divider"; 5973 5974 text.appendChild(document.createTextNode("Inner text")); 5975 a.appendChild(text); 5976 li.appendChild(a); 5977 menuInner.appendChild(li); 5978 menuInner.appendChild(divider); 5979 if (header) menu.appendChild(header); 5980 if (search) { 5981 // create a span instead of input as creating an input element is slower 5982 var input = document.createElement("span"); 5983 search.className = "bs-searchbox"; 5984 input.className = "form-control"; 5985 search.appendChild(input); 5986 menu.appendChild(search); 5987 } 5988 if (actions) menu.appendChild(actions); 5989 menu.appendChild(menuInner); 5990 if (doneButton) menu.appendChild(doneButton); 5991 newElement.appendChild(menu); 5992 5993 document.body.appendChild(newElement); 5994 5995 var liHeight = a.offsetHeight, 5996 headerHeight = header ? header.offsetHeight : 0, 5997 searchHeight = search ? search.offsetHeight : 0, 5998 actionsHeight = actions ? actions.offsetHeight : 0, 5999 doneButtonHeight = doneButton ? doneButton.offsetHeight : 0, 6000 dividerHeight = $(divider).outerHeight(true), 6001 // fall back to jQuery if getComputedStyle is not supported 6002 menuStyle = getComputedStyle ? getComputedStyle(menu) : false, 6003 $menu = menuStyle ? $(menu) : null, 6004 menuPadding = 6005 parseInt(menuStyle ? menuStyle.paddingTop : $menu.css("paddingTop")) + 6006 parseInt( 6007 menuStyle ? menuStyle.paddingBottom : $menu.css("paddingBottom") 6008 ) + 6009 parseInt( 6010 menuStyle ? menuStyle.borderTopWidth : $menu.css("borderTopWidth") 6011 ) + 6012 parseInt( 6013 menuStyle 6014 ? menuStyle.borderBottomWidth 6015 : $menu.css("borderBottomWidth") 6016 ), 6017 menuExtras = 6018 menuPadding + 6019 parseInt(menuStyle ? menuStyle.marginTop : $menu.css("marginTop")) + 6020 parseInt( 6021 menuStyle ? menuStyle.marginBottom : $menu.css("marginBottom") 6022 ) + 6023 2; 6024 6025 document.body.removeChild(newElement); 6026 6027 this.sizeInfo = { 6028 liHeight: liHeight, 6029 headerHeight: headerHeight, 6030 searchHeight: searchHeight, 6031 actionsHeight: actionsHeight, 6032 doneButtonHeight: doneButtonHeight,
6033 dividerHeight: dividerHeight, 6034 menuPadding: menuPadding, 6035 menuExtras: menuExtras, 6036 }; 6037 }, 6038 6039 setSize: function () { 6040 this.findLis(); 6041 this.liHeight(); 6042 var that = this, 6043 $menu = this.$menu, 6044 $menuInner = this.$menuInner, 6045 $window = $(window), 6046 selectHeight = this.$newElement[0].offsetHeight, 6047 liHeight = this.sizeInfo["liHeight"], 6048 headerHeight = this.sizeInfo["headerHeight"], 6049 searchHeight = this.sizeInfo["searchHeight"], 6050 actionsHeight = this.sizeInfo["actionsHeight"], 6051 doneButtonHeight = this.sizeInfo["doneButtonHeight"], 6052 divHeight = this.sizeInfo["dividerHeight"], 6053 menuPadding = this.sizeInfo["menuPadding"], 6054 menuExtras = this.sizeInfo["menuExtras"], 6055 notDisabled = this.options.hideDisabled ? ".disabled" : "", 6056 menuHeight, 6057 getHeight, 6058 selectOffsetTop, 6059 selectOffsetBot, 6060 posVert = function () { 6061 selectOffsetTop = that.$newElement.offset().top - $window.scrollTop(); 6062 selectOffsetBot = $window.height() - selectOffsetTop - selectHeight; 6063 }; 6064 6065 posVert(); 6066 6067 if (this.options.header) $menu.css("padding-top", 0); 6068 6069 if (this.options.size === "auto") { 6070 var getSize = function () { 6071 var minHeight, 6072 hasClass = function (className, include) { 6073 return function (element) { 6074 if (include) { 6075 return element.classList 6076 ? element.classList.contains(className) 6077 : $(element).hasClass(className); 6078 } else { 6079 return !(element.classList 6080 ? element.classList.contains(className) 6081 : $(element).hasClass(className)); 6082 } 6083 }; 6084 }, 6085 lis = that.$menuInner[0].getElementsByTagName("li"), 6086 lisVisible = Array.prototype.filter 6087 ? Array.prototype.filter.call(lis, hasClass("hidden", false)) 6088 : that.$lis.not(".hidden"), 6089 optGroup = Array.prototype.filter 6090 ? Array.prototype.filter.call( 6091 lisVisible, 6092 hasClass("dropdown-header", true) 6093 ) 6094 : lisVisible.filter(".dropdown-header"); 6095 6096 posVert(); 6097 menuHeight = selectOffsetBot - menuExtras; 6098 6099 if (that.options.container) { 6100 if (!$menu.data("height")) $menu.data("height", $menu.height()); 6101 getHeight = $menu.data("height"); 6102 } else { 6103 getHeight = $menu.height(); 6104 } 6105 6106 if (that.options.dropupAuto) { 6107 that.$newElement.toggleClass( 6108 "dropup", 6109 selectOffsetTop > selectOffsetBot && 6110 menuHeight - menuExtras < getHeight 6111 ); 6112 } 6113 if (that.$newElement.hasClass("dropup")) { 6114 menuHeight = selectOffsetTop - menuExtras; 6115 } 6116 6117 if (lisVisible.length + optGroup.length > 3) { 6118 minHeight = liHeight * 3 + menuExtras - 2; 6119 } else { 6120 minHeight = 0; 6121 } 6122 6123 $menu.css({ 6124 "max-height": menuHeight + "px", 6125 overflow: "hidden", 6126 "min-height": 6127 minHeight + 6128 headerHeight + 6129 searchHeight + 6130 actionsHeight + 6131 doneButtonHeight + 6132 "px", 6133 }); 6134 $menuInner.css({ 6135 "max-height": 6136 menuHeight - 6137 headerHeight - 6138 searchHeight - 6139 actionsHeight - 6140 doneButtonHeight - 6141 menuPadding + 6142 "px", 6143 "overflow-y": "auto", 6144 "min-height": Math.max(minHeight - menuPadding, 0) + "px", 6145 }); 6146 }; 6147 getSize(); 6148 this.$searchbox 6149 .off("input.getSize propertychange.getSize") 6150 .on("input.getSize propertychange.getSize", getSize); 6151 $window 6152 .off("resize.getSize scroll.getSize")
6153 .on("resize.getSize scroll.getSize", getSize); 6154 } else if ( 6155 this.options.size && 6156 this.options.size != "auto" && 6157 this.$lis.not(notDisabled).length > this.options.size 6158 ) { 6159 var optIndex = this.$lis 6160 .not(".divider") 6161 .not(notDisabled) 6162 .children() 6163 .slice(0, this.options.size) 6164 .last() 6165 .parent() 6166 .index(), 6167 divLength = this.$lis 6168 .slice(0, optIndex + 1) 6169 .filter(".divider").length; 6170 menuHeight = 6171 liHeight * this.options.size + divLength * divHeight + menuPadding; 6172 6173 if (that.options.container) { 6174 if (!$menu.data("height")) $menu.data("height", $menu.height()); 6175 getHeight = $menu.data("height"); 6176 } else { 6177 getHeight = $menu.height(); 6178 } 6179 6180 if (that.options.dropupAuto) { 6181 //noinspection JSUnusedAssignment 6182 this.$newElement.toggleClass( 6183 "dropup", 6184 selectOffsetTop > selectOffsetBot && 6185 menuHeight - menuExtras < getHeight 6186 ); 6187 } 6188 $menu.css({ 6189 "max-height": 6190 menuHeight + 6191 headerHeight + 6192 searchHeight + 6193 actionsHeight + 6194 doneButtonHeight + 6195 "px", 6196 overflow: "hidden", 6197 "min-height": "", 6198 }); 6199 $menuInner.css({ 6200 "max-height": menuHeight - menuPadding + "px", 6201 "overflow-y": "auto", 6202 "min-height": "", 6203 }); 6204 } 6205 }, 6206 6207 setWidth: function () { 6208 if (this.options.width === "auto") { 6209 this.$menu.css("min-width", "0"); 6210 6211 // Get correct width if element is hidden 6212 var $selectClone = this.$menu.parent().clone().appendTo("body"), 6213 $selectClone2 = this.options.container 6214 ? this.$newElement.clone().appendTo("body") 6215 : $selectClone, 6216 ulWidth = $selectClone.children(".dropdown-menu").outerWidth(), 6217 btnWidth = $selectClone2 6218 .css("width", "auto") 6219 .children("button") 6220 .outerWidth(); 6221 6222 $selectClone.remove(); 6223 $selectClone2.remove(); 6224 6225 // Set width to whatever's larger, button title or longest option 6226 this.$newElement.css("width", Math.max(ulWidth, btnWidth) + "px"); 6227 } else if (this.options.width === "fit") { 6228 // Remove inline min-width so width can be changed from 'auto' 6229 this.$menu.css("min-width", ""); 6230 this.$newElement.css("width", "").addClass("fit-width"); 6231 } else if (this.options.width) { 6232 // Remove inline min-width so width can be changed from 'auto' 6233 this.$menu.css("min-width", ""); 6234 this.$newElement.css("width", this.options.width); 6235 } else { 6236 // Remove inline min-width/width so width can be changed 6237 this.$menu.css("min-width", ""); 6238 this.$newElement.css("width", ""); 6239 } 6240 // Remove fit-width class if width is changed programmatically 6241 if ( 6242 this.$newElement.hasClass("fit-width") && 6243 this.options.width !== "fit" 6244 ) { 6245 this.$newElement.removeClass("fit-width"); 6246 } 6247 }, 6248 6249 selectPosition: function () { 6250 var that = this, 6251 drop = "<div />", 6252 $drop = $(drop), 6253 pos, 6254 actualHeight, 6255 getPlacement = function ($element) { 6256 $drop 6257 .addClass( 6258 $element.attr("class").replace(/form-control|fit-width/gi, "") 6259 ) 6260 .toggleClass("dropup", $element.hasClass("dropup")); 6261 pos = $element.offset(); 6262 actualHeight = $element.hasClass("dropup") 6263 ? 0 6264 : $element[0].offsetHeight; 6265 $drop.css({ 6266 top: pos.top + actualHeight, 6267 left: pos.left, 6268 width: $element[0].offsetWidth, 6269 position: "absolute", 6270 }); 6271 }; 6272 6273 this.$newElement.on("click", function () { 6274 if (that.isDisabled()) { 6275 return; 6276 } 6277 getPlacement($(this)); 6278 $drop.appendTo(that.options.container); 6279 $drop.toggleClass("open", !$(this).hasClass("open")); 6280 $drop.append(that.$menu); 6281 }); 6282 6283 $(window).on("resize scroll", function () { 6284 getPlacement(that.$newElement); 6285 }); 6286 6287 this.$element.on("hide.bs.select", function () { 6288 that.$menu.data("height", that.$menu.height()); 6289 $drop.detach(); 6290 }); 6291 }, 6292 6293 setSelected: function (index, selected, $lis) { 6294 if (!$lis) { 6295 var $lis = this.findLis().eq(this.liObj[index]); 6296 } 6297 6298 $lis.toggleClass("selected", selected); 6299 }, 6300 6301 setDisabled: function (index, disabled, $lis) { 6302 if (!$lis) { 6303 var $lis = this.findLis().eq(this.liObj[index]); 6304 } 6305 6306 if (disabled) { 6307 $lis 6308 .addClass("disabled") 6309 .children("a") 6310 .attr("href", "#") 6311 .attr("tabindex", -1); 6312 } else { 6313 $lis 6314 .removeClass("disabled") 6315 .children("a") 6316 .removeAttr("href") 6317 .attr("tabindex", 0); 6318 } 6319 }, 6320 6321 isDisabled: function () { 6322 return this.$element[0].disabled; 6323 }, 6324 6325 checkDisabled: function () { 6326 var that = this; 6327 6328 if (this.isDisabled()) { 6329 this.$newElement.addClass("disabled"); 6330 this.$button.addClass("disabled").attr("tabindex", -1); 6331 } else { 6332 if (this.$button.hasClass("disabled")) { 6333 this.$newElement.removeClass("disabled"); 6334 this.$button.removeClass("disabled"); 6335 } 6336 6337 if ( 6338 this.$button.attr("tabindex") == -1 && 6339 !this.$element.data("tabindex") 6340 ) { 6341 this.$button.removeAttr("tabindex"); 6342 } 6343 } 6344 6345 this.$button.click(function () { 6346 return !that.isDisabled(); 6347 }); 6348 }, 6349 6350 tabIndex: function () { 6351 if (this.$element.is("[tabindex]")) { 6352 this.$element.data("tabindex", this.$element.attr("tabindex")); 6353 this.$button.attr("tabindex", this.$element.data("tabindex")); 6354 } 6355 }, 6356 6357 clickListener: function () { 6358 var that = this, 6359 $document = $(document); 6360 6361 this.$newElement.on( 6362 "touchstart.dropdown", 6363 ".dropdown-menu", 6364 function (e) { 6365 e.stopPropagation(); 6366 } 6367 ); 6368 6369 $document.data("spaceSelect", false); 6370 6371 this.$button.on("keyup", function (e) { 6372 if ( 6373 /(32)/.test(e.keyCode.toString(10)) && 6374 $document.data("spaceSelect") 6375 ) { 6376 e.preventDefault(); 6377 $document.data("spaceSelect", false); 6378 } 6379 }); 6380 6381 this.$newElement.on("click", function () { 6382 that.setSize(); 6383 that.$element.on("shown.bs.select", function () { 6384 if (!that.options.liveSearch && !that.multiple) { 6385 that.$menu.find(".selected a").focus(); 6386 } else if (!that.multiple) { 6387 var selectedIndex = that.liObj[that.$element[0].selectedIndex]; 6388 6389 if (typeof selectedIndex !== "number") return; 6390 6391 // scroll to selected option 6392 var offset = 6393 that.$lis.eq(selectedIndex)[0].offsetTop - 6394 that.$menuInner[0].offsetTop; 6395 offset = 6396 offset - 6397 that.$menuInner[0].offsetHeight / 2 + 6398 that.sizeInfo.liHeight / 2; 6399 that.$menuInner[0].scrollTop = offset; 6400 } 6401 }); 6402 }); 6403 6404 this.$menu.on("click", "li a", function (e) { 6405 var $this = $(this), 6406 clickedIndex = $this.parent().data("originalIndex"), 6407 prevValue = that.$element.val(), 6408 prevIndex = that.$element.prop("selectedIndex"); 6409 6410 // Don't close on multi choice menu 6411 if (that.multiple) { 6412 e.stopPropagation(); 6413 } 6414 6415 e.preventDefault(); 6416 6417 //Don't run if we have been disabled 6418 if (!that.isDisabled() && !$this.parent().hasClass("disabled")) { 6419 var $options = that.$element.find("option"), 6420 $option = $options.eq(clickedIndex), 6421 state = $option.prop("selected"), 6422 $optgroup = $option.parent("optgroup"), 6423 maxOptions = that.options.maxOptions, 6424 maxOptionsGrp = $optgroup.data("maxOptions") || false; 6425 6426 if (!that.multiple) { 6427 // Deselect all others if not multi select box 6428 $options.prop("selected", false); 6429 $option.prop("selected", true); 6430 that.$menu.find(".selected").removeClass("selected"); 6431 that.setSelected(clickedIndex, true); 6432 } else { 6433 // Toggle the one we have chosen if we are multi select. 6434 $option.prop("selected", !state); 6435 that.setSelected(clickedIndex, !state); 6436 $this.blur(); 6437 6438 if (maxOptions !== false || maxOptionsGrp !== false) { 6439 var maxReached = maxOptions < $options.filter(":selected").length, 6440 maxReachedGrp = 6441 maxOptionsGrp < $optgroup.find("option:selected").length; 6442 6443 if ( 6444 (maxOptions && maxReached) || 6445 (maxOptionsGrp && maxReachedGrp) 6446 ) { 6447 if (maxOptions && maxOptions == 1) { 6448 $options.prop("selected", false); 6449 $option.prop("selected", true); 6450 that.$menu.find(".selected").removeClass("selected"); 6451 that.setSelected(clickedIndex, true); 6452 } else if (maxOptionsGrp && maxOptionsGrp == 1) { 6453 $optgroup.find("option:selected").prop("selected", false); 6454 $option.prop("selected", true); 6455 var optgroupID = $this.parent().data("optgroup"); 6456 that.$menu 6457 .find('[data-optgroup="' + optgroupID + '"]') 6458 .removeClass("selected"); 6459 that.setSelected(clickedIndex, true); 6460 } else { 6461 var maxOptionsArr = 6462 typeof that.options.maxOptionsText === "function" 6463 ? that.options.maxOptionsText(maxOptions, maxOptionsGrp) 6464 : that.options.maxOptionsText, 6465 maxTxt = maxOptionsArr[0].replace("{n}", maxOptions), 6466 maxTxtGrp = maxOptionsArr[1].replace("{n}", maxOptionsGrp), 6467 $notify = $('<div class="notify"></div>'); 6468 // If {var} is set in array, replace it 6469 /** @deprecated */ 6470 if (maxOptionsArr[2]) { 6471 maxTxt = maxTxt.replace( 6472 "{var}", 6473 maxOptionsArr[2][maxOptions > 1 ? 0 : 1] 6474 ); 6475 maxTxtGrp = maxTxtGrp.replace( 6476 "{var}", 6477 maxOptionsArr[2][maxOptionsGrp > 1 ? 0 : 1] 6478 ); 6479 } 6480 6481 $option.prop("selected", false); 6482 6483 that.$menu.append($notify); 6484 6485 if (maxOptions && maxReached) { 6486 $notify.append($("<div>" + maxTxt + "</div>")); 6487 that.$element.trigger("maxReached.bs.select"); 6488 } 6489 6490 if (maxOptionsGrp && maxReachedGrp) { 6491 $notify.append($("<div>" + maxTxtGrp + "</div>")); 6492 that.$element.trigger("maxReachedGrp.bs.select"); 6493 } 6494 6495 setTimeout(function () { 6496 that.setSelected(clickedIndex, false); 6497 }, 10); 6498 6499 $notify.delay(750).fadeOut(300, function () { 6500 $(this).remove(); 6501 }); 6502 } 6503 } 6504 } 6505 } 6506 6507 if (!that.multiple) { 6508 that.$button.focus(); 6509 } else if (that.options.liveSearch) { 6510 that.$searchbox.focus(); 6511 } 6512 6513 // Trigger select 'change' 6514 if ( 6515 (prevValue != that.$element.val() && that.multiple) || 6516 (prevIndex != that.$element.prop("selectedIndex") && !that.multiple) 6517 ) { 6518 that.$element.change(); 6519 // $option.prop('selected') is current option state (selected/unselected). state is previous option state. 6520 that.$element.trigger("changed.bs.select", [ 6521 clickedIndex, 6522 $option.prop("selected"), 6523 state, 6524 ]); 6525 } 6526 } 6527 }); 6528 6529 this.$menu.on( 6530 "click", 6531 "li.disabled a, .popover-title, .popover-title :not(.close)", 6532 function (e) { 6533 if (e.currentTarget == this) { 6534 e.preventDefault(); 6535 e.stopPropagation(); 6536 if (that.options.liveSearch && !$(e.target).hasClass("close")) { 6537 that.$searchbox.focus(); 6538 } else { 6539 that.$button.focus(); 6540 } 6541 } 6542 } 6543 ); 6544 6545 this.$menu.on("click", "li.divider, li.dropdown-header", function (e) { 6546 e.preventDefault(); 6547 e.stopPropagation(); 6548 if (that.options.liveSearch) { 6549 that.$searchbox.focus(); 6550 } else { 6551 that.$button.focus(); 6552 } 6553 }); 6554 6555 this.$menu.on("click", ".popover-title .close", function () { 6556 that.$button.click(); 6557 }); 6558 6559 this.$searchbox.on("click", function (e) { 6560 e.stopPropagation(); 6561 }); 6562 6563 this.$menu.on("click", ".actions-btn", function (e) { 6564 if (that.options.liveSearch) { 6565 that.$searchbox.focus(); 6566 } else { 6567 that.$button.focus(); 6568 } 6569 6570 e.preventDefault(); 6571 e.stopPropagation(); 6572 6573 if ($(this).hasClass("bs-select-all")) { 6574 that.selectAll(); 6575 } else { 6576 that.deselectAll(); 6577 } 6578 that.$element.change(); 6579 }); 6580 6581 this.$element.change(function () { 6582 that.render(false); 6583 }); 6584 }, 6585 6586 liveSearchListener: function () { 6587 var that = this, 6588 $no_results = $('<li class="no-results"></li>'); 6589 6590 this.$newElement.on( 6591 "click.dropdown.data-api touchstart.dropdown.data-api", 6592 function () { 6593 that.$menuInner.find(".active").removeClass("active"); 6594 if (!!that.$searchbox.val()) { 6595 that.$searchbox.val(""); 6596 that.$lis.not(".is-hidden").removeClass("hidden"); 6597 if (!!$no_results.parent().length) $no_results.remove(); 6598 } 6599 if (!that.multiple) 6600 that.$menuInner.find(".selected").addClass("active"); 6601 setTimeout(function () { 6602 that.$searchbox.focus(); 6603 }, 10); 6604 } 6605 ); 6606 6607 this.$searchbox.on( 6608 "click.dropdown.data-api focus.dropdown.data-api touchend.dropdown.data-api", 6609 function (e) { 6610 e.stopPropagation(); 6611 } 6612 ); 6613 6614 this.$searchbox.on("input propertychange", function () { 6615 if (that.$searchbox.val()) { 6616 var $searchBase = that.$lis 6617 .not(".is-hidden") 6618 .removeClass("hidden") 6619 .children("a"); 6620 if (that.options.liveSearchNormalize) { 6621 $searchBase = $searchBase.not( 6622 ":a" + 6623 that._searchStyle() + 6624 "(" + 6625 normalizeToBase(that.$searchbox.val()) + 6626 ")" 6627 ); 6628 } else { 6629 $searchBase = $searchBase.not( 6630 ":" + that._searchStyle() + "(" + that.$searchbox.val() + ")" 6631 ); 6632 } 6633 $searchBase.parent().addClass("hidden"); 6634 6635 that.$lis.filter(".dropdown-header").each(function () { 6636 var $this = $(this), 6637 optgroup = $this.data("optgroup"); 6638 6639 if ( 6640 that.$lis 6641 .filter("[data-optgroup=" + optgroup + "]") 6642 .not($this) 6643 .not(".hidden").length === 0 6644 ) { 6645 $this.addClass("hidden"); 6646 that.$lis 6647 .filter("[data-optgroup=" + optgroup + "div]") 6648 .addClass("hidden"); 6649 } 6650 }); 6651 6652 var $lisVisible = that.$lis.not(".hidden"); 6653 6654 // hide divider if first or last visible, or if followed by another divider 6655 $lisVisible.each(function (index) { 6656 var $this = $(this); 6657 6658 if ( 6659 $this.hasClass("divider") && 6660 ($this.index() ==
6660= $lisVisible.eq(0).index() || 6661 $this.index() === $lisVisible.last().index() || 6662 $lisVisible.eq(index + 1).hasClass("divider")) 6663 ) { 6664 $this.addClass("hidden"); 6665 } 6666 }); 6667 6668 if (!that.$lis.not(".hidden, .no-results").length) { 6669 if (!!$no_results.parent().length) { 6670 $no_results.remove(); 6671 } 6672 $no_results 6673 .html( 6674 that.options.noneResultsText.replace( 6675 "{0}", 6676 '"' + htmlEscape(that.$searchbox.val()) + '"' 6677 ) 6678 ) 6679 .show(); 6680 that.$menuInner.append($no_results); 6681 } else if (!!$no_results.parent().length) { 6682 $no_results.remove(); 6683 } 6684 } else { 6685 that.$lis.not(".is-hidden").removeClass("hidden"); 6686 if (!!$no_results.parent().length) { 6687 $no_results.remove(); 6688 } 6689 } 6690 6691 that.$lis.filter(".active").removeClass("active"); 6692 that.$lis 6693 .not(".hidden, .divider, .dropdown-header") 6694 .eq(0) 6695 .addClass("active") 6696 .children("a") 6697 .focus(); 6698 $(this).focus(); 6699 }); 6700 }, 6701 6702 _searchStyle: function () { 6703 var style = "icontains"; 6704 switch (this.options.liveSearchStyle) { 6705 case "begins": 6706 case "startsWith": 6707 style = "ibegins"; 6708 break; 6709 case "contains": 6710 default: 6711 break; //no need to change the default 6712 } 6713 6714 return style; 6715 }, 6716 6717 val: function (value) { 6718 if (typeof value !== "undefined") { 6719 this.$element.val(value); 6720 this.render(); 6721 6722 return this.$element; 6723 } else { 6724 return this.$element.val(); 6725 } 6726 }, 6727 6728 selectAll: function () { 6729 this.findLis(); 6730 this.$element 6731 .find("option:enabled") 6732 .not("[data-divider], [data-hidden]") 6733 .prop("selected", true); 6734 this.$lis 6735 .not(".divider, .dropdown-header, .disabled, .hidden") 6736 .addClass("selected"); 6737 this.render(false); 6738 }, 6739 6740 deselectAll: function () { 6741 this.findLis(); 6742 this.$element 6743 .find("option:enabled") 6744 .not("[data-divider], [data-hidden]") 6745 .prop("selected", false); 6746 this.$lis 6747 .not(".divider, .dropdown-header, .disabled, .hidden") 6748 .removeClass("selected"); 6749 this.render(false); 6750 }, 6751 6752 keydown: function (e) { 6753 var $this = $(this), 6754 $parent = $this.is("input") ? $this.parent().parent() : $this.parent(), 6755 $items, 6756 that = $parent.data("this"), 6757 index, 6758 next, 6759 first, 6760 last, 6761 prev, 6762 nextPrev, 6763 prevIndex, 6764 isActive, 6765 selector = ":not(.disabled, .hidden, .dropdown-header, .divider)", 6766 keyCodeMap = { 6767 32: " ", 6768 48: "0", 6769 49: "1", 6770 50: "2", 6771 51: "3", 6772 52: "4", 6773 53: "5", 6774 54: "6", 6775 55: "7", 6776 56: "8", 6777 57: "9", 6778 59: ";", 6779 65: "a", 6780 66: "b", 6781 67: "c", 6782 68: "d", 6783 69: "e", 6784 70: "f", 6785 71: "g", 6786 72: "h", 6787 73: "i", 6788 74: "j", 6789 75: "k", 6790 76: "l", 6791 77: "m", 6792 78: "n", 6793 79: "o", 6794 80: "p", 6795 81: "q", 6796 82: "r", 6797 83: "s", 6798 84: "t", 6799 85: "u", 6800 86: "v", 6801 87: "w", 6802 88: "x", 6803 89: "y", 6804 90: "z", 6805 96: "0", 6806 97: "1", 6807 98: "2", 6808 99: "3", 6809 100: "4", 6810 101: "5", 6811 102: "6", 6812 103: "7", 6813 104: "8", 6814 105: "9", 6815 }; 6816 6817 if (that.options.liveSearch) $parent = $this.parent().parent(); 6818 6819 if (that.options.container) $parent = that.$menu; 6820 6821 $items = $("[role=menu] li a", $parent); 6822 6823 isActive = that.$menu.parent().hasClass("open"); 6824 6825 if ( 6826 !isActive && 6827 ((e.keyCode >= 48 && e.keyCode <= 57) || 6828 (event.keyCode >= 65 && event.keyCode <= 90)) 6829 ) { 6830 if (!that.options.container) { 6831 that.setSize(); 6832 that.$menu.parent().addClass("open"); 6833 isActive = true; 6834 } else { 6835 that.$newElement.trigger("click"); 6836 } 6837 that.$searchbox.focus(); 6838 } 6839 6840 if (that.options.liveSearch) { 6841 if ( 6842 /(^9$|27)/.test(e.keyCode.toString(10)) && 6843 isActive && 6844 that.$menu.find(".active").length === 0 6845 ) { 6846 e.preventDefault(); 6847 that.$menu.parent().removeClass("open"); 6848 if (that.options.container) that.$newElement.removeClass("open"); 6849 that.$button.focus(); 6850 } 6851 // $items contains li elements when liveSearch is enabled 6852 $items = $( 6853 "[role=menu] li:not(.disabled, .hidden, .dropdown-header, .divider)", 6854 $parent 6855 ); 6856 if (!$this.val() && !/(38|40)/.test(e.keyCode.toString(10))) { 6857 if ($items.filter(".active").length === 0) { 6858 $items = that.$newElement.find("li"); 6859 if (that.options.liveSearchNormalize) { 6860 $items = $items.filter( 6861 ":a" + 6862 that._searchStyle() + 6863 "(" + 6864 normalizeToBase(keyCodeMap[e.keyCode]) + 6865 ")" 6866 ); 6867 } else { 6868 $items = $items.filter( 6869 ":" + that._searchStyle() + "(" + keyCodeMap[e.keyCode] + ")" 6870 ); 6871 } 6872 } 6873 } 6874 } 6875 6876 if (!$items.length) return; 6877 6878 if (/(38|40)/.test(e.keyCode.toString(10))) { 6879 index = $items.index($items.filter(":focus")); 6880 first = $items.parent(selector).first().data("originalIndex"); 6881 last = $items.parent(selector).last().data("originalIndex"); 6882 next = $items 6883 .eq(index) 6884 .parent() 6885 .nextAll(selector) 6886 .eq(0) 6887 .data("originalIndex"); 6888 prev = $items 6889 .eq(index) 6890 .parent() 6891 .prevAll(selector) 6892 .eq(0) 6893 .data("originalIndex"); 6894 nextPrev = $items 6895 .eq(next) 6896 .parent() 6897 .prevAll(selector) 6898 .eq(0) 6899 .data("originalIndex"); 6900 6901 if (that.options.liveSearch) { 6902 $items.each(function (i) { 6903 if (!$(this).hasClass("disabled")) { 6904 $(this).data("index", i); 6905 } 6906 }); 6907 index = $items.index($items.filter(".active")); 6908 first = $items.first().data("index");
6909 last = $items.last().data("index"); 6910 next = $items.eq(index).nextAll().eq(0).data("index"); 6911 prev = $items.eq(index).prevAll().eq(0).data("index"); 6912 nextPrev = $items.eq(next).prevAll().eq(0).data("index"); 6913 } 6914 6915 prevIndex = $this.data("prevIndex"); 6916 6917 if (e.keyCode == 38) { 6918 if (that.options.liveSearch) index -= 1; 6919 if (index != nextPrev && index > prev) index = prev; 6920 if (index < first) index = first; 6921 if (index == prevIndex) index = last; 6922 } else if (e.keyCode == 40) { 6923 if (that.options.liveSearch) index += 1; 6924 if (index == -1) index = 0; 6925 if (index != nextPrev && index < next) index = next; 6926 if (index > last) index = last; 6927 if (index == prevIndex) index = first; 6928 } 6929 6930 $this.data("prevIndex", index); 6931 6932 if (!that.options.liveSearch) { 6933 $items.eq(index).focus(); 6934 } else { 6935 e.preventDefault(); 6936 if (!$this.hasClass("dropdown-toggle")) { 6937 $items 6938 .removeClass("active") 6939 .eq(index) 6940 .addClass("active") 6941 .children("a") 6942 .focus(); 6943 $this.focus(); 6944 } 6945 } 6946 } else if (!$this.is("input")) { 6947 var keyIndex = [], 6948 count, 6949 prevKey; 6950 6951 $items.each(function () { 6952 if (!$(this).parent().hasClass("disabled")) { 6953 if ( 6954 $.trim($(this).text().toLowerCase()).substring(0, 1) == 6955 keyCodeMap[e.keyCode] 6956 ) { 6957 keyIndex.push($(this).parent().index()); 6958 } 6959 } 6960 }); 6961 6962 count = $(document).data("keycount"); 6963 count++; 6964 $(document).data("keycount", count); 6965 6966 prevKey = $.trim($(":focus").text().toLowerCase()).substring(0, 1); 6967 6968 if (prevKey != keyCodeMap[e.keyCode]) { 6969 count = 1; 6970 $(document).data("keycount", count); 6971 } else if (count >= keyIndex.length) { 6972 $(document).data("keycount", 0); 6973 if (count > keyIndex.length) count = 1; 6974 } 6975 6976 $items.eq(keyIndex[count - 1]).focus(); 6977 } 6978 6979 // Select focused option if "Enter", "Spacebar" or "Tab" (when selectOnTab is true) are pressed inside the menu. 6980 if ( 6981 (/(13|32)/.test(e.keyCode.toString(10)) || 6982 (/(^9$)/.test(e.keyCode.toString(10)) && that.options.selectOnTab)) && 6983 isActive 6984 ) { 6985 if (!/(32)/.test(e.keyCode.toString(10))) e.preventDefault(); 6986 if (!that.options.liveSearch) { 6987 var elem = $(":focus"); 6988 elem.click(); 6989 // Bring back focus for multiselects 6990 elem.focus(); 6991 // Prevent screen from scrolling if the user hit the spacebar 6992 e.preventDefault(); 6993 // Fixes spacebar selection of dropdown items in FF & IE 6994 $(document).data("spaceSelect", true); 6995 } else if (!/(32)/.test(e.keyCode.toString(10))) { 6996 that.$menu.find(".active a").click(); 6997 $this.focus(); 6998 } 6999 $(document).data("keycount", 0); 7000 } 7001 7002 if ( 7003 (/(^9$|27)/.test(e.keyCode.toString(10)) && 7004 isActive && 7005 (that.multiple || that.options.liveSearch)) || 7006 (/(27)/.test(e.keyCode.toString(10)) && !isActive) 7007 ) { 7008 that.$menu.parent().removeClass("open"); 7009 if (that.options.container) that.$newElement.removeClass("open"); 7010 that.$button.focus(); 7011 } 7012 }, 7013 7014 mobile: function () { 7015 this.$element.addClass("mobile-device").appendTo(this.$newElement); 7016 if (this.options.container) this.$menu.hide(); 7017 }, 7018 7019 refresh: function () { 7020 this.$lis = null; 7021 this.reloadLi(); 7022 this.render(); 7023 this.checkDisabled(); 7024 this.liHeight(true); 7025 this.setStyle(); 7026 this.setWidth(); 7027 if (this.$lis) this.$searchbox.trigger("propertychange"); 7028 7029 this.$element.trigger("refreshed.bs.select"); 7030 }, 7031 7032 hide: function () { 7033 this.$newElement.hide(); 7034 }, 7035 7036 show: function () { 7037 this.$newElement.show(); 7038 }, 7039 7040 remove: function () { 7041 this.$newElement.remove(); 7042 this.$element.remove(); 7043 }, 7044 }; 7045 7046 // SELECTPICKER PLUGIN DEFINITION 7047 // ============================== 7048 function Plugin(option, event) { 7049 // get the args of the outer function.. 7050 var args = arguments; 7051 // The arguments of the function are explicitly re-defined from the argument list, because the shift causes them
7052 // to get lost/corrupted in android 2.3 and IE9 #715 #775 7053 var _option = option, 7054 _event = event; 7055 [].shift.apply(args); 7056 7057 var value; 7058 var chain = this.each(function () { 7059 var $this = $(this); 7060 if ($this.is("select")) { 7061 var data = $this.data("selectpicker"), 7062 options = typeof _option == "object" && _option; 7063 7064 if (!data) { 7065 var config = $.extend( 7066 {}, 7067 Selectpicker.DEFAULTS, 7068 $.fn.selectpicker.defaults || {}, 7069 $this.data(), 7070 options 7071 ); 7072 $this.data( 7073 "selectpicker", 7074 (data = new Selectpicker(this, config, _event)) 7075 ); 7076 } else if (options) { 7077 for (var i in options) { 7078 if (options.hasOwnProperty(i)) { 7079 data.options[i] = options[i]; 7080 } 7081 } 7082 } 7083 7084 if (typeof _option == "string") { 7085 if (data[_option] instanceof Function) { 7086 value = data[_option].apply(data, args); 7087 } else { 7088 value = data.options[_option]; 7089 } 7090 } 7091 } 7092 }); 7093 7094 if (typeof value !== "undefined") { 7095 //noinspection JSUnusedAssignment 7096 return value; 7097 } else { 7098 return chain; 7099 } 7100 } 7101 7102 var old = $.fn.selectpicker; 7103 $.fn.selectpicker = Plugin; 7104 $.fn.selectpicker.Constructor = Selectpicker; 7105 7106 // SELECTPICKER NO CONFLICT 7107 // ======================== 7108 $.fn.selectpicker.noConflict = function () { 7109 $.fn.selectpicker = old; 7110 return this; 7111 }; 7112 7113 $(document) 7114 .data("keycount", 0) 7115 .on( 7116 "keydown", 7117 '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="menu"], .bs-searchbox input', 7118 Selectpicker.prototype.keydown 7119 ) 7120 .on( 7121 "focusin.modal", 7122 '.bootstrap-select [data-toggle=dropdown], .bootstrap-select [role="menu"], .bs-searchbox input', 7123 function (e) { 7124 e.stopPropagation(); 7125 } 7126 ); 7127 7128 // SELECTPICKER DATA-API 7129 // ===================== 7130 $(window).on("load.bs.select.data-api", function () { 7131 $(".selectpicker").each(function () { 7132 var $selectpicker = $(this); 7133 Plugin.call($selectpicker, $selectpicker.data()); 7134 }); 7135 }); 7136})
vendor: 24,545 bytes, lines 7136-7975
7136(jQuery); 7137 7138/* ======================================================================== 7139 * Bootstrap: collapse.js v3.3.7 7140 * http://getbootstrap.com/javascript/#collapse 7141 * ======================================================================== 7142 * Copyright 2011-2016 Twitter, Inc. 7143 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 7144 * ======================================================================== */ 7145 7146/* jshint latedef: false */ 7147 7148+function ($) { 7149 'use strict'; 7150 7151 // COLLAPSE PUBLIC CLASS DEFINITION 7152 // ================================ 7153 7154 var Collapse = function (element, options) { 7155 this.$element = $(element) 7156 this.options = $.extend({}, Collapse.DEFAULTS, options) 7157 this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' + 7158 '[data-toggle="collapse"][data-target="#' + element.id + '"]') 7159 this.transitioning = null 7160 7161 if (this.options.parent) { 7162 this.$parent = this.getParent() 7163 } else { 7164 this.addAriaAndCollapsedClass(this.$element, this.$trigger) 7165 } 7166 7167 if (this.options.toggle) this.toggle() 7168 } 7169 7170 Collapse.VERSION = '3.3.7' 7171 7172 Collapse.TRANSITION_DURATION = 350 7173 7174 Collapse.DEFAULTS = { 7175 toggle: true 7176 } 7177 7178 Collapse.prototype.dimension = function () { 7179 var hasWidth = this.$element.hasClass('width') 7180 return hasWidth ? 'width' : 'height' 7181 } 7182 7183 Collapse.prototype.show = function () { 7184 if (this.transitioning || this.$element.hasClass('in')) return 7185 7186 var activesData 7187 var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing') 7188 7189 if (actives && actives.length) { 7190 activesData = actives.data('bs.collapse') 7191 if (activesData && activesData.transitioning) return 7192 } 7193 7194 var startEvent = $.Event('show.bs.collapse') 7195 this.$element.trigger(startEvent) 7196 if (startEvent.isDefaultPrevented()) return 7197 7198 if (actives && actives.length) { 7199 Plugin.call(actives, 'hide') 7200 activesData || actives.data('bs.collapse', null) 7201 } 7202 7203 var dimension = this.dimension() 7204 7205 this.$element 7206 .removeClass('collapse') 7207 .addClass('collapsing')[dimension](0) 7208 .attr('aria-expanded', true) 7209 7210 this.$trigger 7211 .removeClass('collapsed') 7212 .attr('aria-expanded', true) 7213 7214 this.transitioning = 1 7215 7216 var complete = function () { 7217 this.$element 7218 .removeClass('collapsing') 7219 .addClass('collapse in')[dimension]('') 7220 this.transitioning = 0 7221 this.$element 7222 .trigger('shown.bs.collapse') 7223 } 7224 7225 if (!$.support.transition) return complete.call(this) 7226 7227 var scrollSize = $.camelCase(['scroll', dimension].join('-')) 7228 7229 this.$element 7230 .one('bsTransitionEnd', $.proxy(complete, this)) 7231 .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]) 7232 } 7233 7234 Collapse.prototype.hide = function () { 7235 if (this.transitioning || !this.$element.hasClass('in')) return 7236 7237 var startEvent = $.Event('hide.bs.collapse') 7238 this.$element.trigger(startEvent) 7239 if (startEvent.isDefaultPrevented()) return 7240 7241 var dimension = this.dimension() 7242 7243 this.$element[dimension](this.$element[dimension]())[0].offsetHeight 7244 7245 this.$element 7246 .addClass('collapsing') 7247 .removeClass('collapse in') 7248 .attr('aria-expanded', false) 7249 7250 this.$trigger 7251 .addClass('collapsed') 7252 .attr('aria-expanded', false) 7253 7254 this.transitioning = 1 7255 7256 var complete = function () { 7257 this.transitioning = 0 7258 this.$element 7259 .removeClass('collapsing') 7260 .addClass('collapse') 7261 .trigger('hidden.bs.collapse') 7262 } 7263 7264 if (!$.support.transition) return complete.call(this) 7265 7266 this.$element 7267 [dimension](0) 7268 .one('bsTransitionEnd', $.proxy(complete, this)) 7269 .emulateTransitionEnd(Collapse.TRANSITION_DURATION) 7270 } 7271 7272 Collapse.prototype.toggle = function () { 7273 this[this.$element.hasClass('in') ? 'hide' : 'show']() 7274 } 7275 7276 Collapse.prototype.getParent = function () { 7277 return $(this.options.parent) 7278 .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]') 7279 .each($.proxy(function (i, element) { 7280 var $element = $(element) 7281 this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element) 7282 }, this)) 7283 .end() 7284 } 7285 7286 Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) { 7287 var isOpen = $element.hasClass('in') 7288 7289 $element.attr('aria-expanded', isOpen) 7290 $trigger 7291 .toggleClass('collapsed', !isOpen) 7292 .attr('aria-expanded', isOpen) 7293 } 7294 7295 function getTargetFromTrigger($trigger) { 7296 var href 7297 var target = $trigger.attr('data-target') 7298 || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') // strip for ie7 7299 7300 return $(target) 7301 } 7302 7303 7304 // COLLAPSE PLUGIN DEFINITION 7305 // ========================== 7306 7307 function Plugin(option) { 7308 return this.each(function () { 7309 var $this = $(this) 7310 var data = $this.data('bs.collapse') 7311 var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) 7312 7313 if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false 7314 if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) 7315 if (typeof option == 'string') data[option]() 7316 }) 7317 } 7318 7319 var old = $.fn.collapse 7320 7321 $.fn.collapse = Plugin 7322 $.fn.collapse.Constructor = Collapse 7323 7324 7325 // COLLAPSE NO CONFLICT 7326 // ==================== 7327 7328 $.fn.collapse.noConflict = function () { 7329 $.fn.collapse = old 7330 return this 7331 } 7332 7333 7334 // COLLAPSE DATA-API 7335 // ================= 7336 7337 $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) { 7338 var $this = $(this) 7339 7340 if (!$this.attr('data-target')) e.preventDefault() 7341 7342 var $target = getTargetFromTrigger($this) 7343 var data = $target.data('bs.collapse') 7344 var option = data ? 'toggle' : $this.data() 7345 7346 Plugin.call($target, option) 7347 }) 7348 7349}(jQuery); 7350 7351/* ======================================================================== 7352 * Bootstrap: dropdown.js v3.3.7 7353 * http://getbootstrap.com/javascript/#dropdowns 7354 * ======================================================================== 7355 * Copyright 2011-2016 Twitter, Inc. 7356 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 7357 * ======================================================================== */ 7358 7359 7360+function ($) { 7361 'use strict'; 7362 7363 // DROPDOWN CLASS DEFINITION 7364 // ========================= 7365 7366 var backdrop = '.dropdown-backdrop' 7367 var toggle = '[data-toggle="dropdown"]' 7368 var Dropdown = function (element) { 7369 $(element).on('click.bs.dropdown', this.toggle) 7370 } 7371 7372 Dropdown.VERSION = '3.3.7' 7373 7374 function getParent($this) { 7375 var selector = $this.attr('data-target') 7376 7377 if (!selector) { 7378 selector = $this.attr('href') 7379 selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 7380 } 7381 7382 var $parent = selector && $(selector) 7383 7384 return $parent && $parent.length ? $parent : $this.parent() 7385 } 7386 7387 function clearMenus(e) { 7388 if (e && e.which === 3) return 7389 $(backdrop).remove() 7390 $(toggle).each(function () { 7391 var $this = $(this) 7392 var $parent = getParent($this) 7393 var relatedTarget = { relatedTarget: this } 7394 7395 if (!$parent.hasClass('open')) return 7396 7397 if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return 7398 7399 $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) 7400 7401 if (e.isDefaultPrevented()) return 7402 7403 $this.attr('aria-expanded', 'false') 7404 $parent.removeClass('open').trigger($.Event('hidden.bs.dropdown', relatedTarget)) 7405 }) 7406 } 7407 7408 Dropdown.prototype.toggle = function (e) { 7409 var $this = $(this) 7410 7411 if ($this.is('.disabled, :disabled')) return 7412 7413 var $parent = getParent($this) 7414 var isActive = $parent.hasClass('open') 7415 7416 clearMenus() 7417 7418 if (!isActive) { 7419 if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { 7420 // if mobile we use a backdrop because click events don't delegate 7421 $(document.createElement('div')) 7422 .addClass('dropdown-backdrop') 7423 .insertAfter($(this)) 7424 .on('click', clearMenus) 7425 } 7426 7427 var relatedTarget = { relatedTarget: this } 7428 $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget)) 7429 7430 if (e.isDefaultPrevented()) return 7431 7432 $this 7433 .trigger('focus') 7434 .attr('aria-expanded', 'true') 7435 7436 $parent 7437 .toggleClass('open') 7438 .trigger($.Event('shown.bs.dropdown', relatedTarget)) 7439 } 7440 7441 return false 7442 } 7443 7444 Dropdown.prototype.keydown = function (e) { 7445 if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return 7446 7447 var $this = $(this) 7448 7449 e.preventDefault() 7450 e.stopPropagation() 7451 7452 if ($this.is('.disabled, :disabled')) return 7453 7454 var $parent = getParent($this) 7455 var isActive = $parent.hasClass('open') 7456 7457 if (!isActive && e.which != 27 || isActive && e.which == 27) { 7458 if (e.which == 27) $parent.find(toggle).trigger('focus') 7459 return $this.trigger('click') 7460 } 7461 7462 var desc = ' li:not(.disabled):visible a' 7463 var $items = $parent.find('.dropdown-menu' + desc) 7464 7465 if (!$items.length) return 7466 7467 var index = $items.index(e.target) 7468 7469 if (e.which == 38 && index > 0) index-- // up 7470 if (e.which == 40 && index < $items.length - 1) index++ // down 7471 if (!~index) index = 0 7472 7473 $items.eq(index).trigger('focus') 7474 } 7475 7476 7477 // DROPDOWN PLUGIN DEFINITION 7478 // ========================== 7479 7480 function Plugin(option) { 7481 return this.each(function () { 7482 var $this = $(this) 7483 var data = $this.data('bs.dropdown') 7484 7485 if (!data) $this.data('bs.dropdown', (data = new Dropdown(this))) 7486 if (typeof option == 'string') data[option].call($this) 7487 }) 7488 } 7489 7490 var old = $.fn.dropdown 7491 7492 $.fn.dropdown = Plugin 7493 $.fn.dropdown.Constructor = Dropdown 7494 7495 7496 // DROPDOWN NO CONFLICT 7497 // ==================== 7498 7499 $.fn.dropdown.noConflict = function () { 7500 $.fn.dropdown = old 7501 return this 7502 } 7503 7504 7505 // APPLY TO STANDARD DROPDOWN ELEMENTS 7506 // =================================== 7507 7508 $(document) 7509 .on('click.bs.dropdown.data-api', clearMenus) 7510 .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) 7511 .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) 7512 .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown) 7513 .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown) 7514 7515}(jQuery); 7516 7517/* ======================================================================== 7518 * Bootstrap: modal.js v3.3.7 7519 * http://getbootstrap.com/javascript/#modals 7520 * ======================================================================== 7521 * Copyright 2011-2016 Twitter, Inc. 7522 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 7523 * ======================================================================== */ 7524 7525 7526+function ($) { 7527 'use strict'; 7528 7529 // MODAL CLASS DEFINITION 7530 // ====================== 7531 7532 var Modal = function (element, options) { 7533 this.options = options 7534 this.$body = $(document.body) 7535 this.$element = $(element) 7536 this.$dialog = this.$element.find('.modal-dialog') 7537 this.$backdrop = null 7538 this.isShown = null 7539 this.originalBodyPad = null 7540 this.scrollbarWidth = 0 7541 this.ignoreBackdropClick = false 7542 7543 if (this.options.remote) { 7544 this.$element 7545 .find('.modal-content') 7546 .load(this.options.remote, $.proxy(function () { 7547 this.$element.trigger('loaded.bs.modal') 7548 }, this)) 7549 } 7550 } 7551 7552 Modal.VERSION = '3.3.7' 7553 7554 Modal.TRANSITION_DURATION = 300 7555 Modal.BACKDROP_TRANSITION_DURATION = 150 7556 7557 Modal.DEFAULTS = { 7558 backdrop: true, 7559 keyboard: true, 7560 show: true 7561 } 7562 7563 Modal.prototype.toggle = function (_relatedTarget) { 7564 return this.isShown ? this.hide() : this.show(_relatedTarget) 7565 } 7566 7567 Modal.prototype.show = function (_relatedTarget) { 7568 var that = this 7569 var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }) 7570 7571 this.$element.trigger(e) 7572 7573 if (this.isShown || e.isDefaultPrevented()) return 7574 7575 this.isShown = true 7576 7577 this.checkScrollbar() 7578 this.setScrollbar() 7579 this.$body.addClass('modal-open') 7580 7581 this.escape() 7582 this.resize() 7583 7584 this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) 7585 7586 this.$dialog.on('mousedown.dismiss.bs.modal', function () { 7587 that.$element.one('mouseup.dismiss.bs.modal', function (e) { 7588 if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true 7589 }) 7590 }) 7591 7592 this.backdrop(function () { 7593 var transition = $.support.transition && that.$element.hasClass('fade') 7594 7595 if (!that.$element.parent().length) { 7596 that.$element.appendTo(that.$body) // don't move modals dom position 7597 } 7598 7599 that.$element 7600 .show() 7601 .scrollTop(0) 7602 7603 that.adjustDialog() 7604 7605 if (transition) { 7606 that.$element[0].offsetWidth // force reflow 7607 } 7608 7609 that.$element.addClass('in') 7610 7611 that.enforceFocus() 7612 7613 var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) 7614 7615 transition ? 7616 that.$dialog // wait for modal to slide in 7617 .one('bsTransitionEnd', function () { 7618 that.$element.trigger('focus').trigger(e) 7619 }) 7620 .emulateTransitionEnd(Modal.TRANSITION_DURATION) : 7621 that.$element.trigger('focus').trigger(e) 7622 }) 7623 } 7624 7625 Modal.prototype.hide = function (e) { 7626 if (e) e.preventDefault() 7627 7628 e = $.Event('hide.bs.modal') 7629 7630 this.$element.trigger(e) 7631 7632 if (!this.isShown || e.isDefaultPrevented()) return 7633 7634 this.isShown = false 7635 7636 this.escape() 7637 this.resize() 7638 7639 $(document).off('focusin.bs.modal') 7640 7641 this.$element 7642 .removeClass('in') 7643 .off('click.dismiss.bs.modal') 7644 .off('mouseup.dismiss.bs.modal') 7645 7646 this.$dialog.off('mousedown.dismiss.bs.modal') 7647 7648 $.support.transition && this.$element.hasClass('fade') ? 7649 this.$element 7650 .one('bsTransitionEnd', $.proxy(this.hideModal, this)) 7651 .emulateTransitionEnd(Modal.TRANSITION_DURATION) : 7652 this.hideModal() 7653 } 7654 7655 Modal.prototype.enforceFocus = function () { 7656 $(document) 7657 .off('focusin.bs.modal') // guard against infinite focus loop 7658 .on('focusin.bs.modal', $.proxy(function (e) { 7659 if (document !== e.target && 7660 this.$element[0] !== e.target && 7661 !this.$element.has(e.target).length) { 7662 this.$element.trigger('focus') 7663 } 7664 }, this)) 7665 } 7666 7667 Modal.prototype.escape = function () { 7668 if (this.isShown && this.options.keyboard) { 7669 this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) { 7670 e.which == 27 && this.hide() 7671 }, this)) 7672 } else if (!this.isShown) { 7673 this.$element.off('keydown.dismiss.bs.modal') 7674 } 7675 } 7676 7677 Modal.prototype.resize = function () { 7678 if (this.isShown) { 7679 $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this)) 7680 } else { 7681 $(window).off('resize.bs.modal') 7682 } 7683 } 7684 7685 Modal.prototype.hideModal = function () { 7686 var that = this 7687 this.$element.hide() 7688 this.backdrop(function () { 7689 that.$body.removeClass('modal-open') 7690 that.resetAdjustments() 7691 that.resetScrollbar() 7692 that.$element.trigger('hidden.bs.modal') 7693 }) 7694 } 7695 7696 Modal.prototype.removeBackdrop = function () { 7697 this.$backdrop && this.$backdrop.remove() 7698 this.$backdrop = null 7699 } 7700 7701 Modal.prototype.backdrop = function (callback) { 7702 var that = this 7703 var animate = this.$element.hasClass('fade') ? 'fade' : '' 7704 7705 if (this.isShown && this.options.backdrop) { 7706 var doAnimate = $.support.transition && animate 7707 7708 this.$backdrop = $(document.createElement('div')) 7709 .addClass('modal-backdrop ' + animate) 7710 .appendTo(this.$body) 7711 7712 this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) { 7713 if (this.ignoreBackdropClick) { 7714 this.ignoreBackdropClick = false 7715 return 7716 } 7717 if (e.target !== e.currentTarget) return 7718 this.options.backdrop == 'static' 7719 ? this.$element[0].focus() 7720 : this.hide() 7721 }, this)) 7722 7723 if (doAnimate) this.$backdrop[0].offsetWidth // force reflow 7724 7725 this.$backdrop.addClass('in') 7726 7727 if (!callback) return 7728 7729 doAnimate ? 7730 this.$backdrop 7731 .one('bsTransitionEnd', callback) 7732 .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : 7733 callback() 7734 7735 } else if (!this.isShown && this.$backdrop) { 7736 this.$backdrop.removeClass('in') 7737 7738 var callbackRemove = function () { 7739 that.removeBackdrop() 7740 callback && callback() 7741 } 7742 $.support.transition && this.$element.hasClass('fade') ? 7743 this.$backdrop 7744 .one('bsTransitionEnd', callbackRemove) 7745 .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : 7746 callbackRemove() 7747 7748 } else if (callback) { 7749 callback() 7750 } 7751 } 7752 7753 // these following methods are used to handle overflowing modals 7754 7755 Modal.prototype.handleUpdate = function () { 7756 this.adjustDialog() 7757 } 7758 7759 Modal.prototype.adjustDialog = function () { 7760 var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight 7761 7762 this.$element.css({ 7763 paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '', 7764 paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : '' 7765 }) 7766 } 7767 7768 Modal.prototype.resetAdjustments = function () { 7769 this.$element.css({ 7770 paddingLeft: '', 7771 paddingRight: '' 7772 }) 7773 } 7774 7775 Modal.prototype.checkScrollbar = function () { 7776 var fullWindowWidth = window.innerWidth 7777 if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8 7778 var documentElementRect = document.documentElement.getBoundingClientRect() 7779 fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left) 7780 } 7781 this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth 7782 this.scrollbarWidth = this.measureScrollbar() 7783 } 7784 7785 Modal.prototype.setScrollbar = function () { 7786 var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10) 7787 this.originalBodyPad = document.body.style.paddingRight || '' 7788 if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth) 7789 } 7790 7791 Modal.prototype.resetScrollbar = function () { 7792 this.$body.css('padding-right', this.originalBodyPad) 7793 } 7794 7795 Modal.prototype.measureScrollbar = function () { // thx walsh 7796 var scrollDiv = document.createElement('div') 7797 scrollDiv.className = 'modal-scrollbar-measure' 7798 this.$body.append(scrollDiv) 7799 var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth 7800 this.$body[0].removeChild(scrollDiv) 7801 return scrollbarWidth 7802 } 7803 7804 7805 // MODAL PLUGIN DEFINITION 7806 // ======================= 7807 7808 function Plugin(option, _relatedTarget) { 7809 return this.each(function () { 7810 var $this = $(this) 7811 var data = $this.data('bs.modal') 7812 var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) 7813 7814 if (!data) $this.data('bs.modal', (data = new Modal(this, options))) 7815 if (typeof option == 'string') data[option](_relatedTarget) 7816 else if (options.show) data.show(_relatedTarget) 7817 }) 7818 } 7819 7820 var old = $.fn.modal 7821 7822 $.fn.modal = Plugin 7823 $.fn.modal.Constructor = Modal 7824 7825 7826 // MODAL NO CONFLICT 7827 // ================= 7828 7829 $.fn.modal.noConflict = function () { 7830 $.fn.modal = old 7831 return this 7832 } 7833 7834 7835 // MODAL DATA-API 7836 // ============== 7837 7838 $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { 7839 var $this = $(this) 7840 var href = $this.attr('href') 7841 var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) // strip for ie7 7842 var option = $target.data('bs.modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) 7843 7844 if ($this.is('a')) e.preventDefault() 7845 7846 $target.one('show.bs.modal', function (showEvent) { 7847 if (showEvent.isDefaultPrevented()) return // only register focus restorer if modal will actually get shown 7848 $target.one('hidden.bs.modal', function () { 7849 $this.is(':visible') && $this.trigger('focus') 7850 }) 7851 }) 7852 Plugin.call($target, option, this) 7853 }) 7854 7855}(jQuery); 7856 7857/* ======================================================================== 7858 * Bootstrap: tooltip.js v3.3.7 7859 * http://getbootstrap.com/javascript/#tooltip 7860 * Inspired by the original jQuery.tipsy by Jason Frame 7861 * ======================================================================== 7862 * Copyright 2011-2016 Twitter, Inc. 7863 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 7864 * ======================================================================== */ 7865 7866 7867+function ($) { 7868 'use strict'; 7869 7870 // TOOLTIP PUBLIC CLASS DEFINITION 7871 // =============================== 7872 7873 var Tooltip = function (element, options) { 7874 this.type = null 7875 this.options = null 7876 this.enabled = null 7877 this.timeout = null 7878 this.hoverState = null 7879 this.$element = null 7880 this.inState = null 7881 7882 this.init('tooltip', element, options) 7883 } 7884 7885 Tooltip.VERSION = '3.3.7' 7886 7887 Tooltip.TRANSITION_DURATION = 150 7888 7889 Tooltip.DEFAULTS = { 7890 animation: true, 7891 placement: 'top', 7892 selector: false, 7893 template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', 7894 trigger: 'hover focus', 7895 title: '', 7896 delay: 0, 7897 html: false, 7898 container: false, 7899 viewport: { 7900 selector: 'body', 7901 padding: 0 7902 } 7903 } 7904 7905 Tooltip.prototype.init = function (type, element, options) { 7906 this.enabled = true 7907 this.type = type 7908 this.$element = $(element) 7909 this.options = this.getOptions(options) 7910 this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport)) 7911 this.inState = { click: false, hover: false, focus: false } 7912 7913 if (this.$element[0] instanceof document.constructor && !this.options.selector) { 7914 throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!') 7915 } 7916 7917 var triggers = this.options.trigger.split(' ') 7918 7919 for (var i = triggers.length; i--;) { 7920 var trigger = triggers[i] 7921 7922 if (trigger == 'click') { 7923 this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) 7924 } else if (trigger != 'manual') { 7925 var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin' 7926 var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout' 7927 7928 this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) 7929 this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) 7930 } 7931 } 7932 7933 this.options.selector ? 7934 (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : 7935 this.fixTitle() 7936 } 7937 7938 Tooltip.prototype.getDefaults = function () { 7939 return Tooltip.DEFAULTS 7940 } 7941 7942 Tooltip.prototype.getOptions = function (options) { 7943 options = $.extend({}, this.getDefaults(), this.$element.data(), options) 7944 7945 if (options.delay && typeof options.delay == 'number') { 7946 options.delay = { 7947 show: options.delay, 7948 hide: options.delay 7949 } 7950 } 7951 7952 return options 7953 } 7954 7955 Tooltip.prototype.getDelegateOptions = function () { 7956 var options = {} 7957 var defaults = this.getDefaults() 7958 7959 this._options && $.each(this._options, function (key, value) { 7960 if (defaults[key] != value) options[key] = value 7961 }) 7962 7963 return options 7964 } 7965 7966 Tooltip.prototype.enter = function (obj) { 7967 var self = obj instanceof this.constructor ? 7968 obj : $(obj.currentTarget).data('bs.' + this.type) 7969 7970 if (!self) { 7971 self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) 7972 $(obj.currentTarget).data('bs.' + this.type, self) 7973 } 7974 7975 if (obj instanceof $.Event) {
vendor: 9,753 bytes, lines 7976-8254
7976 self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true 7977 } 7978 7979 if (self.tip().hasClass('in') || self.hoverState == 'in') { 7980 self.hoverState = 'in' 7981 return 7982 } 7983 7984 clearTimeout(self.timeout) 7985 7986 self.hoverState = 'in' 7987 7988 if (!self.options.delay || !self.options.delay.show) return self.show() 7989 7990 self.timeout = setTimeout(function () { 7991 if (self.hoverState == 'in') self.show() 7992 }, self.options.delay.show) 7993 } 7994 7995 Tooltip.prototype.isInStateTrue = function () { 7996 for (var key in this.inState) { 7997 if (this.inState[key]) return true 7998 } 7999 8000 return false 8001 } 8002 8003 Tooltip.prototype.leave = function (obj) { 8004 var self = obj instanceof this.constructor ? 8005 obj : $(obj.currentTarget).data('bs.' + this.type) 8006 8007 if (!self) { 8008 self = new this.constructor(obj.currentTarget, this.getDelegateOptions()) 8009 $(obj.currentTarget).data('bs.' + this.type, self) 8010 } 8011 8012 if (obj instanceof $.Event) { 8013 self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false 8014 } 8015 8016 if (self.isInStateTrue()) return 8017 8018 clearTimeout(self.timeout) 8019 8020 self.hoverState = 'out' 8021 8022 if (!self.options.delay || !self.options.delay.hide) return self.hide() 8023 8024 self.timeout = setTimeout(function () { 8025 if (self.hoverState == 'out') self.hide() 8026 }, self.options.delay.hide) 8027 } 8028 8029 Tooltip.prototype.show = function () { 8030 var e = $.Event('show.bs.' + this.type) 8031 8032 if (this.hasContent() && this.enabled) { 8033 this.$element.trigger(e) 8034 8035 var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]) 8036 if (e.isDefaultPrevented() || !inDom) return 8037 var that = this 8038 8039 var $tip = this.tip() 8040 8041 var tipId = this.getUID(this.type) 8042 8043 this.setContent() 8044 $tip.attr('id', tipId) 8045 this.$element.attr('aria-describedby', tipId) 8046 8047 if (this.options.animation) $tip.addClass('fade') 8048 8049 var placement = typeof this.options.placement == 'function' ? 8050 this.options.placement.call(this, $tip[0], this.$element[0]) : 8051 this.options.placement 8052 8053 var autoToken = /\s?auto?\s?/i 8054 var autoPlace = autoToken.test(placement) 8055 if (autoPlace) placement = placement.replace(autoToken, '') || 'top' 8056 8057 $tip 8058 .detach() 8059 .css({ top: 0, left: 0, display: 'block' }) 8060 .addClass(placement) 8061 .data('bs.' + this.type, this) 8062 8063 this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) 8064 this.$element.trigger('inserted.bs.' + this.type) 8065 8066 var pos = this.getPosition() 8067 var actualWidth = $tip[0].offsetWidth 8068 var actualHeight = $tip[0].offsetHeight 8069 8070 if (autoPlace) { 8071 var orgPlacement = placement 8072 var viewportDim = this.getPosition(this.$viewport) 8073 8074 placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' : 8075 placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' : 8076 placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' : 8077 placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' : 8078 placement 8079 8080 $tip 8081 .removeClass(orgPlacement) 8082 .addClass(placement) 8083 } 8084 8085 var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight) 8086 8087 this.applyPlacement(calculatedOffset, placement) 8088 8089 var complete = function () { 8090 var prevHoverState = that.hoverState 8091 that.$element.trigger('shown.bs.' + that.type) 8092 that.hoverState = null 8093 8094 if (prevHoverState == 'out') that.leave(that) 8095 } 8096 8097 $.support.transition && this.$tip.hasClass('fade') ? 8098 $tip 8099 .one('bsTransitionEnd', complete) 8100 .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : 8101 complete() 8102 } 8103 } 8104 8105 Tooltip.prototype.applyPlacement = function (offset, placement) { 8106 var $tip = this.tip() 8107 var width = $tip[0].offsetWidth 8108 var height = $tip[0].offsetHeight 8109 8110 // manually read margins because getBoundingClientRect includes difference 8111 var marginTop = parseInt($tip.css('margin-top'), 10) 8112 var marginLeft = parseInt($tip.css('margin-left'), 10) 8113 8114 // we must check for NaN for ie 8/9 8115 if (isNaN(marginTop)) marginTop = 0 8116 if (isNaN(marginLeft)) marginLeft = 0 8117 8118 offset.top += marginTop 8119 offset.left += marginLeft 8120 8121 // $.fn.offset doesn't round pixel values 8122 // so we use setOffset directly with our own function B-0 8123 $.offset.setOffset($tip[0], $.extend({ 8124 using: function (props) { 8125 $tip.css({ 8126 top: Math.round(props.top), 8127 left: Math.round(props.left) 8128 }) 8129 } 8130 }, offset), 0) 8131 8132 $tip.addClass('in') 8133 8134 // check to see if placing tip in new offset caused the tip to resize itself 8135 var actualWidth = $tip[0].offsetWidth 8136 var actualHeight = $tip[0].offsetHeight 8137 8138 if (placement == 'top' && actualHeight != height) { 8139 offset.top = offset.top + height - actualHeight 8140 } 8141 8142 var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight) 8143 8144 if (delta.left) offset.left += delta.left 8145 else offset.top += delta.top 8146 8147 var isVertical = /top|bottom/.test(placement) 8148 var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight 8149 var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight' 8150 8151 $tip.offset(offset) 8152 this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical) 8153 } 8154 8155 Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) { 8156 this.arrow() 8157 .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%') 8158 .css(isVertical ? 'top' : 'left', '') 8159 } 8160 8161 Tooltip.prototype.setContent = function () { 8162 var $tip = this.tip() 8163 var title = this.getTitle() 8164 8165 $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) 8166 $tip.removeClass('fade in top bottom left right') 8167 } 8168 8169 Tooltip.prototype.hide = function (callback) { 8170 var that = this 8171 var $tip = $(this.$tip) 8172 var e = $.Event('hide.bs.' + this.type) 8173 8174 function complete() { 8175 if (that.hoverState != 'in') $tip.detach() 8176 if (that.$element) { // TODO: Check whether guarding this code with this `if` is really necessary. 8177 that.$element 8178 .removeAttr('aria-describedby') 8179 .trigger('hidden.bs.' + that.type) 8180 } 8181 callback && callback() 8182 } 8183 8184 this.$element.trigger(e) 8185 8186 if (e.isDefaultPrevented()) return 8187 8188 $tip.removeClass('in') 8189 8190 $.support.transition && $tip.hasClass('fade') ? 8191 $tip 8192 .one('bsTransitionEnd', complete) 8193 .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : 8194 complete() 8195 8196 this.hoverState = null 8197 8198 return this 8199 } 8200 8201 Tooltip.prototype.fixTitle = function () { 8202 var $e = this.$element 8203 if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') { 8204 $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') 8205 } 8206 } 8207 8208 Tooltip.prototype.hasContent = function () { 8209 return this.getTitle() 8210 } 8211 8212 Tooltip.prototype.getPosition = function ($element) { 8213 $element = $element || this.$element 8214 8215 var el = $element[0] 8216 var isBody = el.tagName == 'BODY' 8217 8218 var elRect = el.getBoundingClientRect() 8219 if (elRect.width == null) { 8220 // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093 8221 elRect = $.extend({}, elRect, { width: elRect.right - elRect.left, height: elRect.bottom - elRect.top }) 8222 } 8223 var isSvg = window.SVGElement && el instanceof window.SVGElement 8224 // Avoid using $.offset() on SVGs since it gives incorrect results in jQuery 3. 8225 // See https://github.com/twbs/bootstrap/issues/20280 8226 var elOffset = isBody ? { top: 0, left: 0 } : (isSvg ? null : $element.offset()) 8227 var scroll = { scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop() } 8228 var outerDims = isBody ? { width: $(window).width(), height: $(window).height() } : null 8229 8230 return $.extend({}, elRect, scroll, outerDims, elOffset) 8231 } 8232 8233 Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { 8234 return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : 8235 placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : 8236 placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : 8237 /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } 8238 8239 } 8240 8241 Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) { 8242 var delta = { top: 0, left: 0 } 8243 if (!this.$viewport) return delta 8244 8245 var viewportPadding = this.options.viewport && this.options.viewport.padding || 0 8246 var viewportDimensions = this.getPosition(this.$viewport) 8247 8248 if (/right|left/.test(placement)) { 8249 var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll 8250 var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight 8251 if (topEdgeOffset < viewportDimensions.top) { // top overflow 8252 delta.top = viewportDimensions.top - topEdgeOffset 8253 } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow 8254 delta.top = viewportDimensions.top + viewportDimensions.height - bottom
vendor: 11,120 bytes, lines 8254-8661
8254EdgeOffset 8255 } 8256 } else { 8257 var leftEdgeOffset = pos.left - viewportPadding 8258 var rightEdgeOffset = pos.left + viewportPadding + actualWidth 8259 if (leftEdgeOffset < viewportDimensions.left) { // left overflow 8260 delta.left = viewportDimensions.left - leftEdgeOffset 8261 } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow 8262 delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset 8263 } 8264 } 8265 8266 return delta 8267 } 8268 8269 Tooltip.prototype.getTitle = function () { 8270 var title 8271 var $e = this.$element 8272 var o = this.options 8273 8274 title = $e.attr('data-original-title') 8275 || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) 8276 8277 return title 8278 } 8279 8280 Tooltip.prototype.getUID = function (prefix) { 8281 do prefix += ~~(Math.random() * 1000000) 8282 while (document.getElementById(prefix)) 8283 return prefix 8284 } 8285 8286 Tooltip.prototype.tip = function () { 8287 if (!this.$tip) { 8288 this.$tip = $(this.options.template) 8289 if (this.$tip.length != 1) { 8290 throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!') 8291 } 8292 } 8293 return this.$tip 8294 } 8295 8296 Tooltip.prototype.arrow = function () { 8297 return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')) 8298 } 8299 8300 Tooltip.prototype.enable = function () { 8301 this.enabled = true 8302 } 8303 8304 Tooltip.prototype.disable = function () { 8305 this.enabled = false 8306 } 8307 8308 Tooltip.prototype.toggleEnabled = function () { 8309 this.enabled = !this.enabled 8310 } 8311 8312 Tooltip.prototype.toggle = function (e) { 8313 var self = this 8314 if (e) { 8315 self = $(e.currentTarget).data('bs.' + this.type) 8316 if (!self) { 8317 self = new this.constructor(e.currentTarget, this.getDelegateOptions()) 8318 $(e.currentTarget).data('bs.' + this.type, self) 8319 } 8320 } 8321 8322 if (e) { 8323 self.inState.click = !self.inState.click 8324 if (self.isInStateTrue()) self.enter(self) 8325 else self.leave(self) 8326 } else { 8327 self.tip().hasClass('in') ? self.leave(self) : self.enter(self) 8328 } 8329 } 8330 8331 Tooltip.prototype.destroy = function () { 8332 var that = this 8333 clearTimeout(this.timeout) 8334 this.hide(function () { 8335 that.$element.off('.' + that.type).removeData('bs.' + that.type) 8336 if (that.$tip) { 8337 that.$tip.detach() 8338 } 8339 that.$tip = null 8340 that.$arrow = null 8341 that.$viewport = null 8342 that.$element = null 8343 }) 8344 } 8345 8346 8347 // TOOLTIP PLUGIN DEFINITION 8348 // ========================= 8349 8350 function Plugin(option) { 8351 return this.each(function () { 8352 var $this = $(this) 8353 var data = $this.data('bs.tooltip') 8354 var options = typeof option == 'object' && option 8355 8356 if (!data && /destroy|hide/.test(option)) return 8357 if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) 8358 if (typeof option == 'string') data[option]() 8359 }) 8360 } 8361 8362 var old = $.fn.tooltip 8363 8364 $.fn.tooltip = Plugin 8365 $.fn.tooltip.Constructor = Tooltip 8366 8367 8368 // TOOLTIP NO CONFLICT 8369 // =================== 8370 8371 $.fn.tooltip.noConflict = function () { 8372 $.fn.tooltip = old 8373 return this 8374 } 8375 8376}(jQuery); 8377 8378/* ======================================================================== 8379 * Bootstrap: popover.js v3.3.7 8380 * http://getbootstrap.com/javascript/#popovers 8381 * ======================================================================== 8382 * Copyright 2011-2016 Twitter, Inc. 8383 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 8384 * ======================================================================== */ 8385 8386 8387+function ($) { 8388 'use strict'; 8389 8390 // POPOVER PUBLIC CLASS DEFINITION 8391 // =============================== 8392 8393 var Popover = function (element, options) { 8394 this.init('popover', element, options) 8395 } 8396 8397 if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') 8398 8399 Popover.VERSION = '3.3.7' 8400 8401 Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { 8402 placement: 'right', 8403 trigger: 'click', 8404 content: '', 8405 template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' 8406 }) 8407 8408 8409 // NOTE: POPOVER EXTENDS tooltip.js 8410 // ================================ 8411 8412 Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype) 8413 8414 Popover.prototype.constructor = Popover 8415 8416 Popover.prototype.getDefaults = function () { 8417 return Popover.DEFAULTS 8418 } 8419 8420 Popover.prototype.setContent = function () { 8421 var $tip = this.tip() 8422 var title = this.getTitle() 8423 var content = this.getContent() 8424 8425 $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) 8426 $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events 8427 this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text' 8428 ](content) 8429 8430 $tip.removeClass('fade top bottom left right in') 8431 8432 // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do 8433 // this manually by checking the contents. 8434 if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide() 8435 } 8436 8437 Popover.prototype.hasContent = function () { 8438 return this.getTitle() || this.getContent() 8439 } 8440 8441 Popover.prototype.getContent = function () { 8442 var $e = this.$element 8443 var o = this.options 8444 8445 return $e.attr('data-content') 8446 || (typeof o.content == 'function' ? 8447 o.content.call($e[0]) : 8448 o.content) 8449 } 8450 8451 Popover.prototype.arrow = function () { 8452 return (this.$arrow = this.$arrow || this.tip().find('.arrow')) 8453 } 8454 8455 8456 // POPOVER PLUGIN DEFINITION 8457 // ========================= 8458 8459 function Plugin(option) { 8460 return this.each(function () { 8461 var $this = $(this) 8462 var data = $this.data('bs.popover') 8463 var options = typeof option == 'object' && option 8464 8465 if (!data && /destroy|hide/.test(option)) return 8466 if (!data) $this.data('bs.popover', (data = new Popover(this, options))) 8467 if (typeof option == 'string') data[option]() 8468 }) 8469 } 8470 8471 var old = $.fn.popover 8472 8473 $.fn.popover = Plugin 8474 $.fn.popover.Constructor = Popover 8475 8476 8477 // POPOVER NO CONFLICT 8478 // =================== 8479 8480 $.fn.popover.noConflict = function () { 8481 $.fn.popover = old 8482 return this 8483 } 8484 8485}(jQuery); 8486 8487/* ======================================================================== 8488 * Bootstrap: scrollspy.js v3.3.7 8489 * http://getbootstrap.com/javascript/#scrollspy 8490 * ======================================================================== 8491 * Copyright 2011-2016 Twitter, Inc. 8492 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 8493 * ======================================================================== */ 8494 8495 8496+function ($) { 8497 'use strict'; 8498 8499 // SCROLLSPY CLASS DEFINITION 8500 // ========================== 8501 8502 function ScrollSpy(element, options) { 8503 this.$body = $(document.body) 8504 this.$scrollElement = $(element).is(document.body) ? $(window) : $(element) 8505 this.options = $.extend({}, ScrollSpy.DEFAULTS, options) 8506 this.selector = (this.options.target || '') + ' .nav li > a' 8507 this.offsets = [] 8508 this.targets = [] 8509 this.activeTarget = null 8510 this.scrollHeight = 0 8511 8512 this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this)) 8513 this.refresh() 8514 this.process() 8515 } 8516 8517 ScrollSpy.VERSION = '3.3.7' 8518 8519 ScrollSpy.DEFAULTS = { 8520 offset: 10 8521 } 8522 8523 ScrollSpy.prototype.getScrollHeight = function () { 8524 return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight) 8525 } 8526 8527 ScrollSpy.prototype.refresh = function () { 8528 var that = this 8529 var offsetMethod = 'offset' 8530 var offsetBase = 0 8531 8532 this.offsets = [] 8533 this.targets = [] 8534 this.scrollHeight = this.getScrollHeight() 8535 8536 if (!$.isWindow(this.$scrollElement[0])) { 8537 offsetMethod = 'position' 8538 offsetBase = this.$scrollElement.scrollTop() 8539 } 8540 8541 this.$body 8542 .find(this.selector) 8543 .map(function () { 8544 var $el = $(this) 8545 var href = $el.data('target') || $el.attr('href') 8546 var $href = /^#./.test(href) && $(href) 8547 8548 return ($href 8549 && $href.length 8550 && $href.is(':visible') 8551 && [[$href[offsetMethod]().top + offsetBase, href]]) || null 8552 }) 8553 .sort(function (a, b) { return a[0] - b[0] }) 8554 .each(function () { 8555 that.offsets.push(this[0]) 8556 that.targets.push(this[1]) 8557 }) 8558 } 8559 8560 ScrollSpy.prototype.process = function () { 8561 var scrollTop = this.$scrollElement.scrollTop() + this.options.offset 8562 var scrollHeight = this.getScrollHeight() 8563 var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height() 8564 var offsets = this.offsets 8565 var targets = this.targets 8566 var activeTarget = this.activeTarget 8567 var i 8568 8569 if (this.scrollHeight != scrollHeight) { 8570 this.refresh() 8571 } 8572 8573 if (scrollTop >= maxScroll) { 8574 return activeTarget != (i = targets[targets.length - 1]) && this.activate(i) 8575 } 8576 8577 if (activeTarget && scrollTop < offsets[0]) { 8578 this.activeTarget = null 8579 return this.clear() 8580 } 8581 8582 for (i = offsets.length; i--;) { 8583 activeTarget != targets[i] 8584 && scrollTop >= offsets[i] 8585 && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1]) 8586 && this.activate(targets[i]) 8587 } 8588 } 8589 8590 ScrollSpy.prototype.activate = function (target) { 8591 this.activeTarget = target 8592 8593 this.clear() 8594 8595 var selector = this.selector + 8596 '[data-target="' + target + '"],' + 8597 this.selector + '[href="' + target + '"]' 8598 8599 var active = $(selector) 8600 .parents('li') 8601 .addClass('active') 8602 8603 if (active.parent('.dropdown-menu').length) { 8604 active = active 8605 .closest('li.dropdown') 8606 .addClass('active') 8607 } 8608 8609 active.trigger('activate.bs.scrollspy') 8610 } 8611 8612 ScrollSpy.prototype.clear = function () { 8613 $(this.selector) 8614 .parentsUntil(this.options.target, '.active') 8615 .removeClass('active') 8616 } 8617 8618 8619 // SCROLLSPY PLUGIN DEFINITION 8620 // =========================== 8621 8622 function Plugin(option) { 8623 return this.each(function () { 8624 var $this = $(this) 8625 var data = $this.data('bs.scrollspy') 8626 var options = typeof option == 'object' && option 8627 8628 if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options))) 8629 if (typeof option == 'string') data[option]() 8630 }) 8631 } 8632 8633 var old = $.fn.scrollspy 8634 8635 $.fn.scrollspy = Plugin 8636 $.fn.scrollspy.Constructor = ScrollSpy 8637 8638 8639 // SCROLLSPY NO CONFLICT 8640 // ===================== 8641 8642 $.fn.scrollspy.noConflict = function () { 8643 $.fn.scrollspy = old 8644 return this 8645 } 8646 8647 8648 // SCROLLSPY DATA-API 8649 // ================== 8650 8651 $(window).on('load.bs.scrollspy.data-api', function () { 8652 $('[data-spy="scroll"]').each(function () { 8653 var $spy = $(this) 8654 Plugin.call($spy, $spy.data()) 8655 }) 8656 }) 8657 8658}(jQuery); 8659 8660/* ======================================================================== 8661 * Bootstrap: t
8661ransition.js v3.3.7 8662 * http://getbootstrap.com/javascript/#transitions 8663 * ======================================================================== 8664 * Copyright 2011-2016 Twitter, Inc. 8665 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 8666 * ======================================================================== */ 8667 8668 8669+function ($) { 8670 'use strict'; 8671 8672 // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) 8673 // ============================================================ 8674 8675 function transitionEnd() { 8676 var el = document.createElement('bootstrap') 8677 8678 var transEndEventNames = { 8679 WebkitTransition : 'webkitTransitionEnd', 8680 MozTransition : 'transitionend', 8681 OTransition : 'oTransitionEnd otransitionend', 8682 transition : 'transitionend' 8683 } 8684 8685 for (var name in transEndEventNames) { 8686 if (el.style[name] !== undefined) { 8687 return { end: transEndEventNames[name] } 8688 } 8689 } 8690 8691 return false // explicit for ie8 ( ._.) 8692 } 8693 8694 // http://blog.alexmaccaw.com/css-transitions 8695 $.fn.emulateTransitionEnd = function (duration) { 8696 var called = false 8697 var $el = this 8698 $(this).one('bsTransitionEnd', function () { called = true }) 8699 var callback = function () { if (!called) $($el).trigger($.support.transition.end) } 8700 setTimeout(callback, duration) 8701 return this 8702 } 8703 8704 $(function () { 8705 $.support.transition = transitionEnd() 8706 8707 if (!$.support.transition) return 8708 8709 $.event.special.bsTransitionEnd = { 8710 bindType: $.support.transition.end, 8711 delegateType: $.support.transition.end, 8712 handle: function (e) { 8713 if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments) 8714 } 8715 } 8716 }) 8717 8718}(jQuery); 8719 8720// Chosen, a Select Box Enhancer for jQuery and Protoype 8721// by Patrick Filler for Harvest, http://getharvest.com 8722// 8723// Version 0.9.8 8724// Full source at https://github.com/harvesthq/chosen 8725// Copyright (c) 2011 Harvest http://getharvest.com 8726 8727// MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md 8728// This file is generated by `cake build`, do not edit it by hand. 8729((function(){var a;a=function(){function a(){this.options_index=0,this.parsed=[]}return a.prototype.add_node=function(a){return a.nodeName==="OPTGROUP"?this.add_group(a):this.add_option(a)},a.prototype.add_group=function(a){var b,c,d,e,f,g;b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:a.label,children:0,disabled:a.disabled}),f=a.childNodes,g=[];for(d=0,e=f.length;d<e;d++)c=f[d],g.push(this.add_option(c,b,a.disabled));return g},a.prototype.add_option=function(a,b,c){if(a.nodeName==="OPTION")return a.text!==""?(b!=null&&(this.parsed[b].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:a.value,text:a.text,html:a.innerHTML,selected:a.selected,disabled:c===!0?c:a.disabled,group_array_index:b,classes:a.className,style:a.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},a}(),a.select_to_array=function(b){var c,d,e,f,g;d=new a,g=b.childNodes;for(e=0,f=g.length;e<f;e++)c=g[e],d.add_node(c);return d.parsed},this.SelectParser=a})).call(this),function(){var a,b;b=this,a=function(){function a(a,b){this.form_field=a,this.options=b!=null?b:{},this.set_default_values(),this.is_multiple=this.form_field.multiple,this.default_text_default=this.is_multiple?"Select Some Options":"Select an Option",this.setup(),this.set_up_html(),this.register_observers(),this.finish_setup()}return a.prototype.set_default_values=function(){var a=this;return this.click_test_action=function(b){return a.test_active_click(b)},this.activate_action=function(b){return a.activate_field(b)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.result_single_selected=null,this.allow_single_deselect=this.options.allow_single_deselect!=null&&this.form_field.options[0]!=null&&this.form_field.options[0].text===""?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.search_contains=this.options.search_contains||!1,this.choices=0,this.max_selected_options=this.options.max_selected_options||Infinity,this.results_none_found=this.options.no_results_text||"No results match"},a.prototype.mouse_enter=function(){return this.mouse_on_container=!0},a.prototype.mouse_leave=function(){return this.mouse_on_container=!1},a.prototype.input_focus=function(a){var b=this;if(!this.active_field)return setTimeout(function(){return b.container_mousedown()},50)},a.prototype.input_blur=function(a){var b=this;if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(){return b.blur_test()},100)},a.prototype.result_add_option=function(a){var b,c;return a.disabled?"":(a.dom_id=this.container_id+"_o_"+a.array_index,b=a.selected&&this.is_multiple?[]:["active-result"],a.selected&&b.push("result-selected"),a.group_array_index!=null&&b.pu
8729sh("group-option"),a.classes!==""&&b.push(a.classes),c=a.style.cssText!==""?' style="'+a.style+'"':"",'<li id="'+a.dom_id+'" class="'+b.join(" ")+'"'+c+">"+a.html+"</li>")},a.prototype.results_update_field=function(){return this.result_clear_highlight(),this.result_single_selected=null,this.results_build()},a.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},a.prototype.results_search=function(a){return this.results_showing?this.winnow_results():this.results_show()},a.prototype.keyup_checker=function(a){var b,c;b=(c=a.which)!=null?c:a.keyCode,this.search_field_scale();switch(b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:a.preventDefault();if(this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},a.prototype.generate_field_id=function(){var a;return a=this.generate_random_id(),this.form_field.id=a,a},a.prototype.generate_random_char=function(){var a,b,c;return a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",c=Math.floor(Math.random()*a.length),b=a.substring(c,c+1)},a}(),b.AbstractChosen=a}.call(this),function(){var a,b,c,d,e=Object.prototype.hasOwnProperty,f=function(a,b){function d(){this.constructor=a}for(var c in b)e.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};d=this,a=jQuery,a.fn.extend({chosen:function(c){return!a.browser.msie||a.browser.version!=="6.0"&&a.browser.version!=="7.0"?this.each(function(d){var e;e=a(this);if(!e.hasClass("chosen-done"))return e.data("chosen",new b(this,c))}):this}}),b=function(b){function e(){e.__super__.constructor.apply(this,arguments)}return f(e,b),e.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},e.prototype.finish_setup=function(){return this.form_field_jq.addClass("chosen-done")},e.prototype.set_up_html=function(){var b,d,e,f;return this.container_id=this.form_field.id.length?this.form_field.id.replace(/[^\w]/g,"_"):this.generate_field_id(),this.container_id+="_chosen",this.f_width=this.form_field_jq.outerWidth(),this.default_text=this.form_field_jq.data("placeholder")?this.form_field_jq.data("placeholder"):this.default_text_default,b=a("<div />",{id:this.container_id,"class":"chosen-container form-control chosen-select"+(this.is_rtl?" chosen-rtl":""),style:"width: "+this.f_width+"px;"}),this.is_multiple?b.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop" style="left:-9000px;"><ul class="chosen-results"></ul></div>'):b.html('<a href="javascript:void(0)" class="chosen-single chosen-default"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chosen-drop" style="left:-9000px;"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>'),this.form_field_jq.hide().after(b),this.container=a("#"+this.container_id),this.container.addClass("chosen-container-"+(this.is_multiple?"multi":"single")),this.dropdown=this.container.find("div.chosen-drop").first(),d=this.container.height(),e=this.f_width-c(this.dropdown),this.dropdown.css({width:e+"px",top:d+"px"}),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first(),f=e-c(this.search_container)-c(this.search_field),this.search_field.css({width:f+"px"})),this.results_build(),this.set_tab_index(),this.form_field_jq.trigger("liszt:ready",{chosen:this})},e.prototype.register_observers=function(){var a=this;return this.container.mousedown(function(b){return a.container_mousedown(b)}),this.container.mouseup(function(b){return a.container_mouseup(b)}
8729),this.container.mouseenter(function(b){return a.mouse_enter(b)}),this.container.mouseleave(function(b){return a.mouse_leave(b)}),this.search_results.mouseup(function(b){return a.search_results_mouseup(b)}),this.search_results.mouseover(function(b){return a.search_results_mouseover(b)}),this.search_results.mouseout(function(b){return a.search_results_mouseout(b)}),this.form_field_jq.bind("chosen:updated",function(b){return a.results_update_field(b)}),this.search_field.blur(function(b){return a.input_blur(b)}),this.search_field.keyup(function(b){return a.keyup_checker(b)}),this.search_field.keydown(function(b){return a.keydown_checker(b)}),this.is_multiple?(this.search_choices.click(function(b){return a.choices_click(b)}),this.search_field.focus(function(b){return a.input_focus(b)})):this.container.click(function(a){return a.preventDefault()})},e.prototype.search_field_disabled=function(){this.is_disabled=this.form_field_jq[0].disabled;if(this.is_disabled)return this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus",this.activate_action),this.close_field();this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1;if(!this.is_multiple)return this.selected_item.bind("focus",this.activate_action)},e.prototype.container_mousedown=function(b){var c;if(!this.is_disabled)return c=b!=null?a(b.target).hasClass("search-choice-close"):!1,b&&b.type==="mousedown"&&!this.results_showing&&b.stopPropagation(),!this.pending_destroy_click&&!c?(this.active_field?!this.is_multiple&&b&&(a(b.target)[0]===this.selected_item[0]||a(b.target).parents("a.chosen-single").length)&&(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(document).click(this.click_test_action),this.results_show()),this.activate_field()):this.pending_destroy_click=!1},e.prototype.container_mouseup=function(a){if(a.target.nodeName==="ABBR")return this.results_reset(a)},e.prototype.blur_test=function(a){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},e.prototype.close_field=function(){return a(document).unbind("click",this.click_test_action),this.is_multiple||(this.selected_item.attr("tabindex",this.search_field.attr("tabindex")),this.search_field.attr("tabindex",-1)),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.winnow_results_clear(),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},e.prototype.activate_field=function(){return!this.is_multiple&&!this.active_field&&(this.search_field.attr("tabindex",this.selected_item.attr("tabindex")),this.selected_item.attr("tabindex",-1)),this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},e.prototype.test_active_click=function(b){return a(b.target).parents("#"+this.container_id).length?this.active_field=!0:this.close_field()},e.prototype.results_build=function(){var a,b,c,e,f;this.parsing=!0,this.results_data=d.SelectParser.select_to_array(this.form_field),this.is_multiple&&this.choices>0?(this.search_choices.find("li.search-choice").remove(),this.choices=0):this.is_multiple||(this.selected_item.find("span").text(this.default_text),this.form_field.options.length<=this.disable_search_threshold?this.container.addClass("chosen-container-single-nosearch"):this.container.removeClass("chosen-container-single-nosearch")),a="",f=this.results_data;for(c=0,e=f.length;c<e;c++)b=f[c],b.group?a+=this.result_add_group(b):b.empty||(a+=this.result_add_option(b),b.selected&&this.is_multiple?this.choice_build(b):b.selected&&!this.is_multiple&&(this.selected_item.removeClass("chosen-default").find("span").text(b.text),this.allow_single_deselect&&this.single_deselect_control_build()));return this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.search_results.html(a),this.parsing=!1},e.prototype.result_add_group=function(b){return b.disabled?"":(b.dom_id=this.container_id+"_g_"+b.array_index,'<li id="'+b.dom_id+'" class="group-result">'+a("<div />").text(b.label).html()+"</li>")},e.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight();if(b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(c<f)return this.search_results.scrollTop(c)}},e.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},e.prototype.results_show=function(){var a;if(!this.is_multiple)this.selected_item.addClass("chosen-single-with-drop"),this.result_single_selected&&this.result_do_highlight(this.result_single_selected);else if(this.max_selected_options<=this.choices)return this.form_field_jq.trigger("liszt:maxselected",{chosen:this}),!1;return a=this.is_multiple?this.container.height():this.container.height()-1,this.dropdown.css({top:a+"px",left:0}),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results()},e.prototype.results_hide=function(){return this.is_multiple||this.selected_item.removeClass("chosen-single-with-drop"),this.result_clear_highlight(),this.dropdown.css({left:"-9000px"}),this.results_showing=!1},e.prototype.set_tab_index=function(a){var b;if(this.form_field_jq.attr("tabindex"))return b=this.form_field_jq.attr("tabindex"),this.form_field_jq.attr("tabindex",-1),this.is_multiple?this.search_field.attr("tabindex",b):(this.selected_item.attr("tabindex",b),this.search_field.attr("tabindex",-1))},e.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},e.prototype.search_results_mouseup=function(b){var c;c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first();if(c.length)return this.result_highlight=c,this.result_select(b)},e.prototype.search_results_mouseover=function(b){var c;c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first();if(c)return this.result_do_highlight(c)},e.prototype.search_results_mouseout=function(b){if(a(b.target).hasClass("active-result"))return this.result_clear_highlight()},e.prototype.choices_click=function(b){b.preventDefault();if(this.active_field&&!a(b.target).hasClass("search-choice")&&!this.results_showing)return this.results_show()},e.prototype.choice_build=function(b){var c,d,e=this;return this.is_multiple&&this.max_selected_options<=this.choices?(this.form_field_jq.trigger("liszt:maxselected",{chosen:this}),!1):(c=this.container_id+"_c_"+b.array_index,this.choices+=1,this.search_container.before('<li class="search-choice" id="'+c+'"><span>'+b.html+'</span><a href="javascript:void(0)" class="search-choice-close" rel="'+b.array_index+'"></a></li>'),d=a("#"+c).find("a").first(),d.click(function(a){return e.choice_destroy_link_click(a)}))},e.prototype.choice_destroy_link_click=function(b){return b.preventDefault(),this.is_disabled?b.stopPropagation:(this.pending_destroy_click=!0,this.choice_destroy(a(b.target)))},e.prototype.choice_destroy=function(a){return this.choices-=1,this.show_search_field_default(),this.is_multiple&&this.choices>0&&this.search_field.val().length<1&&this.results_hide(),this.result_deselect(a.attr("rel")),a.parents("li").first().remove()},e.prototype.results_reset=function(b){this.form_field.options[0].selected=!0,this.selected_item.find("span").text(this.default_text),this.is_multiple||this.selected_item.addClass("chosen-default"),this.show_search_field_default(),a(b.target).remove(),this.form_field_jq.trigger("change");if(this.active_field)return this.results_hide()},e.prototype.result_select=function(a){var b,c,d,e;if(this.result_highlight)return b=this.result_highlight,c=b.attr("id"),this.result_clear_highlight(),this.is_multiple?this.result_deactivate(b):(this.search_results.find(".result-selected").removeClass("result-selected"),this.result_single_selected=b,this.selected_item.removeClass("chosen-default")),b.addClass("result-selected"),e=c.substr(c.lastIndexOf("_")+1),d=this.results_data[e],d.selected=!0,this.form_field.options[d.options_index].selected=!0,this.is_multiple?this.choice_build(d):(this.selected_item.find("span").first().text(d.text),this.allow_single_deselect&&this.single_deselect_control_build()),(!a.metaKey||!this.is_multiple)&&this.results_hide(),this.search_field.val(""),this.form_field_jq.trigger("change"),this.search_field_scale()},e.prototype.result_activate=function(a){return a.addClass("active-result")},e.prototype.result_deactivate=function(a){return a.removeClass("active-result")},e.prototype.result_deselect=function(b){var c,d;return d=this.results_data[b],d.selected=!1,this.form_field.options[d.options_index].selected=!1,c=a("#"+this.container_id+"_o_"+b),c.removeClass("result-selected").addClass("active-result").show(),this.result_clear_highlight(),this.winnow_results(),this.form_field_jq.trigger("change"),this.search_field_scale()},e.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect&&this.selected_item.find("abbr").length<1)return this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>')},e.prototype.winnow_results=function(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s;this.no_results_clear(),j=0,k=this.search_field.val()===this.default_text?"":a("<div/>").text(a.trim(this.search_field.val())).html(),g=this.search_contains?"":"^",f=new RegExp(g+k.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),n=new RegExp(k.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),s=this.results_data;for(o=0,q=s.length;o<q;o++){c=s[o];if(!c.disabled&&!c.empty)if(c.group)a("#"+c.dom_id).css("display","none");else if(!this.is_multiple||!c.selected){b=!1,i=c.dom_id,h=a("#"+i);if(f.test(c.html))b=!0,j+=1;else if(c.html.indexOf(" ")>=0||c.html.indexOf("[")===0){e=c.html.replace(/\[|\]/g,"").split(" ");if(e.length)for(p=0,r=e.length;p<r;p++)d=e[p],f.test(d)&&(b=!0,j+=1)}b?(k.length?(l=c.html.search(n),m=c.html.substr(0,l+k.length)+"</em>"+c.html.substr(l+k.length),m=m.substr(0,l)+"<em>"+m.substr(l)):m=c.html,h.html(m),this.result_activate(h),c.group_array_index!=null&&a("#"+this.results_data[c.group_array_index].dom_id).css("display","list-item")):(this.result_highlight&&i===this.result_highlight.attr("id")&&this.result_clear_highlight(),this.result_deactivate(h))}}return j<1&&k.length?this.no_results(k):this.winnow_results_set_highlight()},e.prototype.winnow_results_clear=function(){var b,c,d,e,f;this.search_field.val(""),c=this.search_results.find("li"),f=[];for(d=0,e=c.length;d<e;d++)b=c[d],b=a(b),b.hasClass("group-result")?f.push(b.css("display","auto")):!this.is_multiple||!b.hasClass("result-selected")?f.push(this.result_activate(b)):f.push(void 0);return f},e.prototype.winnow_results_set_highlight=function(){var a,b;if(!this.result_highlight){b=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),a=b.length?b.first():this.search_results.find(".active-result").first();if(a!=null)return this.result_do_highlight(a)}},e.prototype.no_results=function(b){var c;return c=a('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),c.find("span").first().html(b),this.search_results.append(c)},e.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},e.prototype.keydown_arrow=function(){var b,c;this.result_highlight?this.results_showing&&(c=this.result_highlight.nextAll("li.active-result").first(),c&&this.result_do_highlight(c)):(b=this.search_results.find("li.active-result").first(),b&&this.result_do_highlight(a(b)));if(!this.results_showing)return this.results_show()},e.prototype.keyup_arrow=function(){var a;if(!this.results_showing&&!this.is_multiple)return this.results_show();if(this.result_highlight)return a=this.result_highlight.prevAll("li.active-result"),a.length?this.result_do_highlight(a.first()):(this.choices>0&&this.results_hide(),this.result_clear_highlight())},e.prototype.keydown_backstroke=function(){return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(this.pending_backstroke=this.search_container.siblings("li.search-choice").last(),this.pending_backstroke.addClass("search-choice-focus"))},e.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},e.prototype.keydown_checker=function(a){var b,c;b=(c=a.which)!=null?c:a.keyCode,this.search_field_scale(),b!==8&&this.pending_backstroke&&this.clear_backstroke();switch(b){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:this.keydown_arrow()}},e.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i,j;if(this.is_multiple){d=0,h=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",g=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"];for(i=0,j=g.length;i<j;i++)e=g[i],f+=e+":"+this.search_field.css(e)+";";return c=a("<div />",{style:f}),c.text(this.search_field.val()),a("body").append(c),h=c.width()+25,c.remove(),h>this.f_width-10&&(h=this.f_width-10),this.search_field.css({width:h+"px"}),b=this.container.height(),this.dropdown.css({top:b+"px"})}},e.prototype.generate_random_id=function(){var b;b="sel"+this.generate_random_char()+this.generate_random_char()+this.generate_random_char();while(a("#"+b).length>0)b+=this.generate_random_char();return b},e}(AbstractChosen),c=function(a){var b;return b=a.outerWidth()-a.width()},d.get_side_border_padding=c}.call(this); 8730/* 8731 * jQuery hashchange event - v1.3 - 7/21/2010 8732 * http://benalman.com/projects/jquery-hashchange-plugin/ 8733 * 8734 * Copyright (c) 2010 "Cowboy" Ben Alman 8735 * Dual licensed under the MIT and GPL licenses. 8736 * http://benalman.com/about/license/ 8737 */ 8738(function($,window,undefined){'$:nomunge';var str_hashchange='hashchange',doc=document,fake_onhashchange,special=$.event.special,doc_mode=doc.documentMode,supports_onhashchange='on'+str_hashchange in window&&(doc_mode===undefined||doc_mode>7);function get_fragment(url){url=url||location.href;var index=url.indexOf('#');return index===-1?'#':url.substr(index);};$.fn[str_hashchange]=function(fn){return fn?this.bind(str_hashchange,fn):this.trigger(str_hashchange);};$.fn[str_hashchange].delay=50;special[str_hashchange]=$.extend(special[str_hashchange],{setup:function(){if(supports_onhashchange){return false;} 8739$(fake_onhashchange.start);},teardown:function(){if(supports_onhashchange){return false;} 8740$(fake_onhashchange.stop);}});fake_onhashchange=(function(){var self={},timeout_id,last_hash=get_fragment(),fn_retval=function(val){return val;},history_set=fn_retval,history_get=fn_retval;self.start=function(){timeout_id||poll();};self.stop=function(){timeout_id&&clearTimeout(timeout_id);timeout_id=undefined;};function poll(){var hash=get_fragment(),history_hash=history_get(last_hash);
8740if(hash!==last_hash){history_set(last_hash=hash,history_hash);$(window).trigger(str_hashchange);}else if(history_hash!==last_hash){location.href=location.href.replace(/#.*/,'')+history_hash;} 8741timeout_id=setTimeout(poll,$.fn[str_hashchange].delay);};window.attachEvent&&!window.addEventListener&&!supports_onhashchange&&(function(){var iframe,iframe_src;self.start=function(){if(!iframe){iframe_src=$.fn[str_hashchange].src;iframe_src=iframe_src&&iframe_src+get_fragment();iframe=$('<iframe tabindex="-1" title="empty"/>').hide().one('load',function(){iframe_src||history_set(get_fragment());poll();}).attr('src',iframe_src||'javascript:0').insertAfter('body')[0].contentWindow;doc.onpropertychange=function(){try{if(event.propertyName==='title'){iframe.document.title=doc.title;}}catch(e){}};}};self.stop=fn_retval;history_get=function(){return get_fragment(iframe.location.href);};history_set=function(hash,history_hash){var iframe_doc=iframe.document,domain=$.fn[str_hashchange].domain;if(hash!==history_hash){iframe_doc.title=doc.title;iframe_doc.open();domain&&iframe_doc.write('<script>document.domain="'+domain+'"</script>');iframe_doc.close();iframe.location.hash=hash;}};})();return self;})();})(jQuery,this); 8742/*! 8743 * jQuery Cookie Plugin v1.4.1 8744 * https://github.com/carhartl/jquery-cookie 8745 * 8746 * Copyright 2013 Klaus Hartl 8747 * Released under the MIT license 8748 */ 8749(function (factory) { 8750 if (typeof define === 'function' && define.amd) { 8751 // AMD 8752 define(['jquery'], factory); 8753 } else if (typeof exports === 'object') { 8754 // CommonJS 8755 factory(require('jquery')); 8756 } else { 8757 // Browser globals 8758 factory(jQuery); 8759 } 8760}(function ($) { 8761 8762 var pluses = /\+/g; 8763 8764 function encode(s) { 8765 return config.raw ? s : encodeURIComponent(s); 8766 } 8767 8768 function decode(s) { 8769 return config.raw ? s : decodeURIComponent(s); 8770 } 8771 8772 function stringifyCookieValue(value) { 8773 return encode(config.json ? JSON.stringify(value) : String(value)); 8774 } 8775 8776 function parseCookieValue(s) { 8777 if (s.indexOf('"') === 0) { 8778 // This is a quoted cookie as according to RFC2068, unescape... 8779 s = s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); 8780 } 8781 8782 try { 8783 // Replace server-side written pluses with spaces. 8784 // If we can't decode the cookie, ignore it, it's unusable. 8785 // If we can't parse the cookie, ignore it, it's unusable. 8786 s = decodeURIComponent(s.replace(pluses, ' ')); 8787 return config.json ? JSON.parse(s) : s; 8788 } catch(e) {} 8789 } 8790 8791 function read(s, converter) { 8792 var value = config.raw ? s : parseCookieValue(s); 8793 return $.isFunction(converter) ? converter(value) : value; 8794 } 8795 8796 var config = $.cookie = function (key, value, options) { 8797 8798 // Write 8799 8800 if (value !== undefined && !$.isFunction(value)) { 8801 options = $.extend({}, config.defaults, options); 8802 8803 if (typeof options.expires === 'number') { 8804 var days = options.expires, t = options.expires = new Date(); 8805 t.setTime(+t + days * 864e+5); 8806 } 8807 8808 return (document.cookie = [ 8809 encode(key), '=', stringifyCookieValue(value), 8810 options.expires ? '; expires=' + options.expires.toUTCString() : '', // use expires attribute, max-age is not supported by IE 8811 options.path ? '; path=' + options.path : '', 8812 options.domain ? '; domain=' + options.domain : '', 8813 options.secure ? '; secure' : '' 8814 ].join('')); 8815 } 8816 8817 // Read 8818 8819 var result = key ? undefined : {}; 8820 8821 // To prevent the for loop in the first place assign an empty array 8822 // in case there are no cookies at all. Also prevents odd result when 8823 // calling $.cookie(). 8824 var cookies = document.cookie ? document.cookie.split('; ') : []; 8825 8826 for (var i = 0, l = cookies.length; i < l; i++) { 8827 var parts = cookies[i].split('='); 8828 var name = decode(parts.shift()); 8829 var cookie = parts.join('='); 8830 8831 if (key && key === name) { 8832 // If second argument (value) is a function it's a converter... 8833 result = read(cookie, value); 8834 break; 8835 } 8836 8837 // Prevent storing a cookie that we couldn't decode. 8838 if (!key && (cookie = read(cookie)) !== undefined) { 8839 result[name] = cookie; 8840 } 8841 } 8842 8843 return result; 8844 }; 8845 8846 config.defaults = {}; 8847 8848 $.removeCookie = function (key, options) { 8849 if ($.cookie(key) === undefined) { 8850 return false;
8851 } 8852 8853 // Must not alter options, thus extending a fresh object... 8854 $.cookie(key, '', $.extend({}, options, { expires: -1 })); 8855 return !$.cookie(key); 8856 }; 8857 8858})); 8859 8860/*! 8861 * jQuery Form Plugin 8862 * version: 3.51.0-2014.06.20 8863 * Requires jQuery v1.5 or later 8864 * Copyright (c) 2014 M. Alsup 8865 * Examples and documentation at: http://malsup.com/jquery/form/ 8866 * Project repository: https://github.com/malsup/form 8867 * Dual licensed under the MIT and GPL licenses. 8868 * https://github.com/malsup/form#copyright-and-license 8869 */ 8870!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):e("undefined"!=typeof jQuery?jQuery:window.Zepto)}(function(e){"use strict";function t(t){var r=t.data;t.isDefaultPrevented()||(t.preventDefault(),e(t.target).ajaxSubmit(r))}function r(t){var r=t.target,a=e(r);if(!a.is("[type=submit],[type=image]")){var n=a.closest("[type=submit]");if(0===n.length)return;r=n[0]}var i=this;if(i.clk=r,"image"==r.type)if(void 0!==t.offsetX)i.clk_x=t.offsetX,i.clk_y=t.offsetY;else if("function"==typeof e.fn.offset){var o=a.offset();i.clk_x=t.pageX-o.left,i.clk_y=t.pageY-o.top}else i.clk_x=t.pageX-r.offsetLeft,i.clk_y=t.pageY-r.offsetTop;setTimeout(function(){i.clk=i.clk_x=i.clk_y=null},100)}function a(){if(e.fn.ajaxSubmit.debug){var t="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(t):window.opera&&window.opera.postError&&window.opera.postError(t)}}var n={};n.fileapi=void 0!==e("<input type='file'/>").get(0).files,n.formdata=void 0!==window.FormData;var i=!!e.fn.prop;e.fn.attr2=function(){if(!i)return this.attr.apply(this,arguments);var e=this.prop.apply(this,arguments);return e&&e.jquery||"string"==typeof e?e:this.attr.apply(this,arguments)},e.fn.ajaxSubmit=function(t){function r(r){var a,n,i=e.param(r,t.traditional).split("&"),o=i.length,s=[];for(a=0;o>a;a++)i[a]=i[a].replace(/\+/g," "),n=i[a].split("="),s.push([decodeURIComponent(n[0]),decodeURIComponent(n[1])]);return s}function o(a){for(var n=new FormData,i=0;i<a.length;i++)n.append(a[i].name,a[i].value);if(t.extraData){var o=r(t.extraData);for(i=0;i<o.length;i++)o[i]&&n.append(o[i][0],o[i][1])}t.data=null;var s=e.extend(!0,{},e.ajaxSettings,t,{contentType:!1,processData:!1,cache:!1,type:u||"POST"});t.uploadProgress&&(s.xhr=function(){var r=e.ajaxSettings.xhr();return r.upload&&r.upload.addEventListener("progress",function(e){var r=0,a=e.loaded||e.position,n=e.total;e.lengthComputable&&(r=Math.ceil(a/n*100)),t.uploadProgress(e,a,n,r)},!1),r}),s.data=null;var c=s.beforeSend;return s.beforeSend=function(e,r){r.data=t.formData?t.formData:n,c&&c.call(this,e,r)},e.ajax(s)}function s(r){function n(e){var t=null;try{e.contentWindow&&(t=e.contentWindow.document)}catch(r){a("cannot get iframe.contentWindow document: "+r)}if(t)return t;try{t=e.contentDocument?e.contentDocument:e.document}catch(r){a("cannot get iframe.contentDocument: "+r),t=e.document}return t}function o(){function t(){try{var e=n(g).readyState;a("state = "+e),e&&"uninitialized"==e.toLowerCase()&&setTimeout(t,50)}catch(r){a("Server abort: ",r," (",r.name,")"),s(k),j&&clearTimeout(j),j=void 0}}var r=f.attr2("target"),i=f.attr2("action"),o="multipart/form-data",c=f.attr("enctype")||f.attr("encoding")||o;w.setAttribute("target",p),(!u||/post/i.test(u))&&w.setAttribute("method","POST"),i!=m.url&&w.setAttribute("action",m.url),m.skipEncodingOverride||u&&!/post/i.test(u)||f.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),m.timeout&&(j=setTimeout(function(){T=!0,s(D)},m.timeout));var l=[];try{if(m.extraData)for(var d in m.extraData)m.extraData.hasOwnProperty(d)&&l.push(e.isPlainObject(m.extraData[d])&&m.extraData[d].hasOwnProperty("name")&&m.extraData[d].hasOwnProperty("value")?e('<input type="hidden" name="'+m.extraData[d].name+'">').val(m.extraData[d].value).appendTo(w)[0]:e('<input type="hidden" name="'+d+'">').val(m.extraData[d]).appendTo(w)[0]);m.iframeTarget||v.appendTo("body"),g.attachEvent?g.attachEvent("onload",s):g.addEventListener("load",s,!1),setTimeout(t,15);try{w.submit()}catch(h){var x=document.createElement("form").submit;x.apply(w)}}finally{w.setAttribute("action",i),w.setAttribute("enctype",c),r?w.setAttribute("target",r):f.removeAttr("target"),e(l).remove()}}function s(t){if(!x.aborted&&!F){if(M=n(g),M||(a("cannot access response document"),t=k),t===D&&x)return x.abort("timeout"),void S.reject(x,"timeout");if(t==k&&x)return x.abort("server abort"),void S.reject(x,"error","server abort");if(M&&M.location.href!=m.iframeSrc||T){g.detachEvent?g.detachEvent("onload",s):g.removeEventListener("load",s,!1);var r,i="success";try{if(T)throw"timeout";var o="xml"==m.dataType||M.XMLDocument||e.isXMLDoc(M);if(a("isXml="+o),!o&&window.opera&&(null===M.body||!M.body.innerHTML)&&--O)return a("requeing onLoad callback, DOM not available"),void setTimeout(s,250);var u=M.body?M.body:M.documentElement;x.responseText=u?u.innerHTML:null,x.responseXML=M.XMLDocument?M.XMLDocument:M,o&&(m.dataType="xml"),x.getResponseHeader=function(e){var t={"content-type":m.dataType};return t[e.toLowerCase()]},u&&(x.status=Number(u.getAttribute("status"))||x.status,x.statusText=u.getAttribute("statusText")||x.statusText);var c=(m.dataType||"").toLowerCase(),l=/(json|script|text)/.test(c);if(l||m.textarea){var f=M.getElementsByTagName("textarea")[0];if(f)x.responseText=f.value,x.status=Number(f.getAttribute("status"))||x.status,x.statusText=f.getAttribute("statusText")||x.statusText;else if(l){var p=M.getElementsByTagName("pre")[0],h=M.getElementsByTagName("body")[0];p?x.responseText=p.textContent?p.textContent:p.innerText:h&&(x.responseText=h.textContent?h.textContent:h.innerText)}}else"xml"==c&&!x.responseXML&&x.responseText&&(x.responseXML=X(x.responseText));try{E=_(x,c,m)}catch(y){i="parsererror",x.error=r=y||i}}catch(y){a("error caught: ",y),i="error",x.error=r=y||i}x.aborted&&(a("upload aborted"),i=null),x.status&&(i=x.status>=200&&x.status<300||304===x.status?"success":"error"),"success"===i?(m.success&&m.success.call(m.context,E,"success",x),S.resolve(x.responseText,"success",x),d&&e.event.trigger("ajaxSuccess",[x,m])):i&&(void 0===r&&(r=x.statusText),m.error&&m.error.call(m.context,x,i,r),S.reject(x,"error",r),d&&e.event.trigger("ajaxError",[x,m,r])),d&&e.event.trigger("ajaxComplete",[x,m]),d&&!--e.active&&e.event.trigger("ajaxStop"),m.complete&&m.complete.call(m.context,x,i),F=!0,m.timeout&&clearTimeout(j),setTimeout(function(){m.iframeTarget?v.attr("src",m.iframeSrc):v.remove(),x.responseXML=null},100)}}}var c,l,m,d,p,v,g,x,y,b,T,j,w=f[0],S=e.Deferred();if(S.abort=function(e){x.abort(e)},r)for(l=0;l<h.length;l++)c=e(h[l]),i?c.prop("disabled",!1):c.removeAttr("disabled");if(m=e.extend(!0,{},e.ajaxSettings,t),m.context=m.context||m,p="jqFormIO"+(new Date).getTime(),m.iframeTarget?(v=e(m.iframeTarget),b=v.attr2("name"),b?p=b:v.attr2("name",p)):(v=e('<iframe name="'+p+'" src="'+m.iframeSrc+'" />'),v.css({position:"absolute",top:"-1000px",left:"-1000px"})),g=v[0],x={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(t){var r="timeout"===t?"timeout":"aborted";a("aborting upload... "+r),this.aborted=1;try{g.contentWindow.document.execCommand&&g.contentWindow.document.execCommand("Stop")}catch(n){}v.attr("src",m.iframeSrc),x.error=r,m.error&&m.error.call(m.context,x,r,t),d&&e.event.trigger("ajaxError",[x,m,r]),m.complete&&m.complete.call(m.context,x,r)}},d=m.global,d&&0===e.active++&&e.event.trigger("ajaxStart"),d&&e.event.trigger("ajaxSend",[x,m]),m.beforeSend&&m.beforeSend.c
8870all(m.context,x,m)===!1)return m.global&&e.active--,S.reject(),S;if(x.aborted)return S.reject(),S;y=w.clk,y&&(b=y.name,b&&!y.disabled&&(m.extraData=m.extraData||{},m.extraData[b]=y.value,"image"==y.type&&(m.extraData[b+".x"]=w.clk_x,m.extraData[b+".y"]=w.clk_y)));var D=1,k=2,A=e("meta[name=csrf-token]").attr("content"),L=e("meta[name=csrf-param]").attr("content");L&&A&&(m.extraData=m.extraData||{},m.extraData[L]=A),m.forceSync?o():setTimeout(o,10);var E,M,F,O=50,X=e.parseXML||function(e,t){return window.ActiveXObject?(t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!=t.documentElement.nodeName?t:null},C=e.parseJSON||function(e){return window.eval("("+e+")")},_=function(t,r,a){var n=t.getResponseHeader("content-type")||"",i="xml"===r||!r&&n.indexOf("xml")>=0,o=i?t.responseXML:t.responseText;return i&&"parsererror"===o.documentElement.nodeName&&e.error&&e.error("parsererror"),a&&a.dataFilter&&(o=a.dataFilter(o,r)),"string"==typeof o&&("json"===r||!r&&n.indexOf("json")>=0?o=C(o):("script"===r||!r&&n.indexOf("javascript")>=0)&&e.globalEval(o)),o};return S}if(!this.length)return a("ajaxSubmit: skipping submit process - no element selected"),this;var u,c,l,f=this;"function"==typeof t?t={success:t}:void 0===t&&(t={}),u=t.type||this.attr2("method"),c=t.url||this.attr2("action"),l="string"==typeof c?e.trim(c):"",l=l||window.location.href||"",l&&(l=(l.match(/^([^#]+)/)||[])[1]),t=e.extend(!0,{url:l,success:e.ajaxSettings.success,type:u||e.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},t);var m={};if(this.trigger("form-pre-serialize",[this,t,m]),m.veto)return a("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(t.beforeSerialize&&t.beforeSerialize(this,t)===!1)return a("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var d=t.traditional;void 0===d&&(d=e.ajaxSettings.traditional);var p,h=[],v=this.formToArray(t.semantic,h);if(t.data&&(t.extraData=t.data,p=e.param(t.data,d)),t.beforeSubmit&&t.beforeSubmit(v,this,t)===!1)return a("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[v,this,t,m]),m.veto)return a("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var g=e.param(v,d);p&&(g=g?g+"&"+p:p),"GET"==t.type.toUpperCase()?(t.url+=(t.url.indexOf("?")>=0?"&":"?")+g,t.data=null):t.data=g;var x=[];if(t.resetForm&&x.push(function(){f.resetForm()}),t.clearForm&&x.push(function(){f.clearForm(t.includeHidden)}),!t.dataType&&t.target){var y=t.success||function(){};x.push(function(r){var a=t.replaceTarget?"replaceWith":"html";e(t.target)[a](r).each(y,arguments)})}else t.success&&x.push(t.success);if(t.success=function(e,r,a){for(var n=t.context||this,i=0,o=x.length;o>i;i++)x[i].apply(n,[e,r,a||f,f])},t.error){var b=t.error;t.error=function(e,r,a){var n=t.context||this;b.apply(n,[e,r,a,f])}}if(t.complete){var T=t.complete;t.complete=function(e,r){var a=t.context||this;T.apply(a,[e,r,f])}}var j=e("input[type=file]:enabled",this).filter(function(){return""!==e(this).val()}),w=j.length>0,S="multipart/form-data",D=f.attr("enctype")==S||f.attr("encoding")==S,k=n.fileapi&&n.formdata;a("fileAPI :"+k);var A,L=(w||D)&&!k;t.iframe!==!1&&(t.iframe||L)?t.closeKeepAlive?e.get(t.closeKeepAlive,function(){A=s(v)}):A=s(v):A=(w||D)&&k?o(v):e.ajax(t),f.removeData("jqxhr").data("jqxhr",A);for(var E=0;E<h.length;E++)h[E]=null;return this.trigger("form-submit-notify",[this,t]),this},e.fn.ajaxForm=function(n){if(n=n||{},n.delegation=n.delegation&&e.isFunction(e.fn.on),!n.delegation&&0===this.length){var i={s:this.selector,c:this.context};return!e.isReady&&i.s?(a("DOM not ready, queuing ajaxForm"),e(function(){e(i.s,i.c).ajaxForm(n)}),this):(a("terminating; zero elements found by selector"+(e.isReady?"":" (DOM not ready)")),this)}return n.delegation?(e(document).off("submit.form-plugin",this.selector,t).off("click.form-plugin",this.selector,r).on("submit.form-plugin",this.selector,n,t).on("click.form-plugin",this.selector,n,r),this):this.ajaxFormUnbind().bind("submit.form-plugin",n,t).bind("click.form-plugin",n,r)},e.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")},e.fn.formToArray=function(t,r){var a=[];if(0===this.length)return a;var i,o=this[0],s=this.attr("id"),u=t?o.getElementsByTagName("*"):o.elements;if(u&&!/MSIE [678]/.test(navigator.userAgent)&&(u=e(u).get()),s&&(i=e(':input[form="'+s+'"]').get(),i.length&&(u=(u||[]).concat(i))),!u||!u.length)return a;var c,l,f,m,d,p,h;for(c=0,p=u.length;p>c;c++)if(d=u[c],f=d.name,f&&!d.disabled)if(t&&o.clk&&"image"==d.type)o.clk==d&&(a.push({name:f,value:e(d).val(),type:d.type}),a.push({name:f+".x",value:o.clk_x},{name:f+".y",value:o.clk_y}));else if(m=e.fieldValue(d,!0),m&&m.constructor==Array)for(r&&r.push(d),l=0,h=m.length;h>l;l++)a.push({name:f,value:m[l]});else if(n.fileapi&&"file"==d.type){r&&r.push(d);var v=d.files;if(v.length)for(l=0;l<v.length;l++)a.push({name:f,value:v[l],type:d.type});else a.push({name:f,value:"",type:d.type})}else null!==m&&"undefined"!=typeof m&&(r&&r.push(d),a.push({name:f,value:m,type:d.type,required:d.required}));if(!t&&o.clk){var g=e(o.clk),x=g[0];f=x.name,f&&!x.disabled&&"image"==x.type&&(a.push({name:f,value:g.val()}),a.push({name:f+".x",value:o.clk_x},{name:f+".y",value:o.clk_y}))}return a}
8870,e.fn.formSerialize=function(t){return e.param(this.formToArray(t))},e.fn.fieldSerialize=function(t){var r=[];return this.each(function(){var a=this.name;if(a){var n=e.fieldValue(this,t);if(n&&n.constructor==Array)for(var i=0,o=n.length;o>i;i++)r.push({name:a,value:n[i]});else null!==n&&"undefined"!=typeof n&&r.push({name:this.name,value:n})}}),e.param(r)},e.fn.fieldValue=function(t){for(var r=[],a=0,n=this.length;n>a;a++){var i=this[a],o=e.fieldValue(i,t);null===o||"undefined"==typeof o||o.constructor==Array&&!o.length||(o.constructor==Array?e.merge(r,o):r.push(o))}return r},e.fieldValue=function(t,r){var a=t.name,n=t.type,i=t.tagName.toLowerCase();if(void 0===r&&(r=!0),r&&(!a||t.disabled||"reset"==n||"button"==n||("checkbox"==n||"radio"==n)&&!t.checked||("submit"==n||"image"==n)&&t.form&&t.form.clk!=t||"select"==i&&-1==t.selectedIndex))return null;if("select"==i){var o=t.selectedIndex;if(0>o)return null;for(var s=[],u=t.options,c="select-one"==n,l=c?o+1:u.length,f=c?o:0;l>f;f++){var m=u[f];if(m.selected){var d=m.value;if(d||(d=m.attributes&&m.attributes.value&&!m.attributes.value.specified?m.text:m.value),c)return d;s.push(d)}}return s}return e(t).val()},e.fn.clearForm=function(t){return this.each(function(){e("input,select,textarea",this).clearFields(t)})},e.fn.clearFields=e.fn.clearInputs=function(t){var r=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var a=this.type,n=this.tagName.toLowerCase();r.test(a)||"textarea"==n?this.value="":"checkbox"==a||"radio"==a?this.checked=!1:"select"==n?this.selectedIndex=-1:"file"==a?/MSIE/.test(navigator.userAgent)?e(this).replaceWith(e(this).clone(!0)):e(this).val(""):t&&(t===!0&&/hidden/.test(a)||"string"==typeof t&&e(this).is(t))&&(this.value="")})},e.fn.resetForm=function(){return this.each(function(){("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset()})},e.fn.enable=function(e){return void 0===e&&(e=!0),this.each(function(){this.disabled=!e})},e.fn.selected=function(t){return void 0===t&&(t=!0),this.each(function(){var r=this.type;if("checkbox"==r||"radio"==r)this.checked=t;else if("option"==this.tagName.toLowerCase()){var a=e(this).parent("select");t&&a[0]&&"select-one"==a[0].type&&a.find("option").selected(!1),this.selected=t}})},e.fn.ajaxSubmit.debug=!1}); 8871/** 8872 * Copyright (c) 2009 Sergiy Kovalchuk ([email protected]) 8873 * 8874 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) 8875 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. 8876 * 8877 * Following code is based on Element.mask() implementation from ExtJS framework (http://extjs.com/) 8878 * 8879 */ 8880(function(a){a.fn.mask=function(c,b){a(this).each(function(){if(b!==undefined&&b>0){var d=a(this);d.data("_mask_timeout",setTimeout(function(){a.maskElement(d,c)},b))}else{a.maskElement(a(this),c)}})};a.fn.unmask=function(){a(this).each(function(){a.unmaskElement(a(this))})};a.fn.isMasked=function(){return this.hasClass("masked")};a.maskElement=function(d,c){if(d.data("_mask_timeout")!==undefined){clearTimeout(d.data("_mask_timeout"));d.removeData("_mask_timeout")}if(d.isMasked()){a.unmaskElement(d)}if(d.css("position")=="static"){d.addClass("masked-relative")}d.addClass("masked");var e=a('<div class="loadmask"></div>');if(navigator.userAgent.toLowerCase().indexOf("msie")>-1){e.height(d.height()+parseInt(d.css("padding-top"))+parseInt(d.css("padding-bottom")));e.width(d.width()+parseInt(d.css("padding-left"))+parseInt(d.css("padding-right")))}if(navigator.userAgent.toLowerCase().indexOf("msie 6")>-1){d.find("select").addClass("masked-hidden")}d.append(e);if(c!==undefined){var b=a('<div class="loadmask-msg" style="display:none;"></div>');b.append("<div>"+c+"</div>");d.append(b);b.css("top",Math.round(d.height()/2-(b.height()-parseInt(b.css("padding-top"))-parseInt(b.css("padding-bottom")))/2)+"px");b.css("left",Math.round(d.width()/2-(b.width()-parseInt(b.css("padding-left"))-parseInt(b.css("padding-right")))/2)+"px");b.show()}};a.unmaskElement=function(b){if(b.data("_mask_timeout")!==undefined){clearTimeout(b.data("_mask_timeout"));b.removeData("_mask_timeout")}b.find(".loadmask-msg,.loadmask").remove();b.removeClass("masked");b.removeClass("masked-relative");b.find("select").removeClass("masked-hidden")}})(jQuery); 8881/** 8882* jquery-match-height 0.7.0 by @liabru 8883* http://brm.io/jquery-match-height/ 8884* License: MIT 8885*/ 8886 8887;(function(factory) { // eslint-disable-line no-extra-semi 8888 'use strict'; 8889 if (typeof define === 'function' && define.amd) { 8890 // AMD 8891 define(['jquery'], factory); 8892 } else if (typeof module !== 'undefined' && module.exports) { 8893 // CommonJS 8894 module.exports = factory(require('jquery')); 8895 } else { 8896 // Global 8897 factory(jQuery); 8898 } 8899})(function($) { 8900 /* 8901 * internal 8902 */ 8903 8904 var _previousResizeWidth = -1, 8905 _updateTimeout = -1; 8906 8907 /* 8908 * _parse 8909 * value parse utility function 8910 */ 8911 8912 var _parse = function(value) { 8913 // parse value and convert NaN to 0 8914 return parseFloat(value) || 0; 8915 }; 8916 8917 /* 8918 * _rows 8919 * utility function returns array of jQuery selections representing each row 8920 * (as displayed after float wrapping applied by browser) 8921 */ 8922 8923 var _rows = function(elements) { 8924 var tolerance = 1, 8925 $elements = $(elements), 8926 lastTop = null, 8927 rows = []; 8928 8929 // group elements by their top position 8930 $elements.each(function(){ 8931 var $that = $(this), 8932 top = $that.offset().top - _parse($that.css('margin-top')), 8933 lastRow = rows.length > 0 ? rows[rows.length - 1] : null; 8934 8935 if (lastRow === null) { 8936 // first item on the row, so just push it 8937 rows.push($that); 8938 } else { 8939 // if the row top is the same, add to the row group 8940 if (Math.floor(Math.abs(lastTop - top)) <= tolerance) { 8941 rows[rows.length - 1] = lastRow.add($that); 8942 } else { 8943 // otherwise start a new row group 8944 rows.push($that); 8945 } 8946 } 8947 8948 // keep track of the last row top 8949 lastTop = top; 8950 }); 8951 8952 return rows; 8953 }; 8954 8955 /* 8956 * _parseOptions 8957 * handle plugin options 8958 */ 8959 8960 var _parseOptions = function(options) { 8961 var opts = { 8962 byRow: true, 8963 property: 'height', 8964 target: null, 8965 remove: false 8966 }; 8967 8968 if (typeof options === 'object') { 8969 return $.extend(opts, options); 8970 } 8971 8972 if (typeof options === 'boolean') { 8973 opts.byRow = options; 8974 } else if (options === 'remove') { 8975 opts.remove = true; 8976 } 8977 8978 return opts; 8979 }; 8980 8981 /* 8982 * matchHeight 8983 * plugin definition 8984 */ 8985 8986 var matchHeight = $.fn.matchHeight = function(options) { 8987 var opts = _parseOptions(options); 8988 8989 // handle remove 8990 if (opts.remove) { 8991 var that = this; 8992 8993 // remove fixed height from all selected elements 8994 this.css(opts.property, ''); 8995 8996 // remove selected elements from all groups 8997 $.each(matchHeight._groups, function(key, group) { 8998 group.elements = group.elements.not(that); 8999 }); 9000 9001 // TODO: cleanup empty groups 9002 9003 return this; 9004 } 9005 9006 if (this.length <= 1 && !opts.target) { 9007 return this; 9008 } 9009 9010 // keep track of this group so we can re-apply later on load and resize events 9011 matchHeight._groups.push({ 9012 elements: this, 9013 options: opts 9014 }); 9015 9016 // match each element's height to the tallest element in the selection 9017 matchHeight._apply(this, opts); 9018 9019 return this; 9020 }; 9021 9022 /* 9023 * plugin global options 9024 */ 9025 9026 matchHeight.version = 'master'; 9027 matchHeight._groups = []; 9028 matchHeight._throttle = 80; 9029 matchHeight._maintainScroll = false;
vendor: 8,503 bytes, lines 9030-9288
9030 matchHeight._beforeUpdate = null; 9031 matchHeight._afterUpdate = null; 9032 matchHeight._rows = _rows; 9033 matchHeight._parse = _parse; 9034 matchHeight._parseOptions = _parseOptions; 9035 9036 /* 9037 * matchHeight._apply 9038 * apply matchHeight to given elements 9039 */ 9040 9041 matchHeight._apply = function(elements, options) { 9042 var opts = _parseOptions(options), 9043 $elements = $(elements), 9044 rows = [$elements]; 9045 9046 // take note of scroll position 9047 var scrollTop = $(window).scrollTop(), 9048 htmlHeight = $('html').outerHeight(true); 9049 9050 // get hidden parents 9051 var $hiddenParents = $elements.parents().filter(':hidden'); 9052 9053 // cache the original inline style 9054 $hiddenParents.each(function() { 9055 var $that = $(this); 9056 $that.data('style-cache', $that.attr('style')); 9057 }); 9058 9059 // temporarily must force hidden parents visible 9060 $hiddenParents.css('display', 'block'); 9061 9062 // get rows if using byRow, otherwise assume one row 9063 if (opts.byRow && !opts.target) { 9064 9065 // must first force an arbitrary equal height so floating elements break evenly 9066 $elements.each(function() { 9067 var $that = $(this), 9068 display = $that.css('display'); 9069 9070 // temporarily force a usable display value 9071 if (display !== 'inline-block' && display !== 'flex' && display !== 'inline-flex') { 9072 display = 'block'; 9073 } 9074 9075 // cache the original inline style 9076 $that.data('style-cache', $that.attr('style')); 9077 9078 $that.css({ 9079 'display': display, 9080 'padding-top': '0', 9081 'padding-bottom': '0', 9082 'margin-top': '0', 9083 'margin-bottom': '0', 9084 'border-top-width': '0', 9085 'border-bottom-width': '0', 9086 'height': '100px', 9087 'overflow': 'hidden' 9088 }); 9089 }); 9090 9091 // get the array of rows (based on element top position) 9092 rows = _rows($elements); 9093 9094 // revert original inline styles 9095 $elements.each(function() { 9096 var $that = $(this); 9097 $that.attr('style', $that.data('style-cache') || ''); 9098 }); 9099 } 9100 9101 $.each(rows, function(key, row) { 9102 var $row = $(row), 9103 targetHeight = 0; 9104 9105 if (!opts.target) { 9106 // skip apply to rows with only one item 9107 if (opts.byRow && $row.length <= 1) { 9108 $row.css(opts.property, ''); 9109 return; 9110 } 9111 9112 // iterate the row and find the max height 9113 $row.each(function(){ 9114 var $that = $(this), 9115 style = $that.attr('style'), 9116 display = $that.css('display'); 9117 9118 // temporarily force a usable display value 9119 if (display !== 'inline-block' && display !== 'flex' && display !== 'inline-flex') { 9120 display = 'block'; 9121 } 9122 9123 // ensure we get the correct actual height (and not a previously set height value) 9124 var css = { 'display': display }; 9125 css[opts.property] = ''; 9126 $that.css(css); 9127 9128 // find the max height (including padding, but not margin) 9129 if ($that.outerHeight(false) > targetHeight) { 9130 targetHeight = $that.outerHeight(false); 9131 } 9132 9133 // revert styles 9134 if (style) { 9135 $that.attr('style', style); 9136 } else { 9137 $that.css('display', ''); 9138 } 9139 }); 9140 } else { 9141 // if target set, use the height of the target element 9142 targetHeight = opts.target.outerHeight(false); 9143 } 9144 9145 // iterate the row and apply the height to all elements 9146 $row.each(function(){ 9147 var $that = $(this), 9148 verticalPadding = 0; 9149 9150 // don't apply to a target 9151 if (opts.target && $that.is(opts.target)) { 9152 return; 9153 } 9154 9155 // handle padding and border correctly (required when not using border-box) 9156 if ($that.css('box-sizing') !== 'border-box') { 9157 verticalPadding += _parse($that.css('border-top-width')) + _parse($that.css('border-bottom-width')); 9158 verticalPadding += _parse($that.css('padding-top')) + _parse($that.css('padding-bottom')); 9159 } 9160 9161 // set the height (accounting for padding and border) 9162 $that.css(opts.property, (targetHeight - verticalPadding) + 'px'); 9163 }); 9164 }); 9165 9166 // revert hidden parents 9167 $hiddenParents.each(function() { 9168 var $that = $(this); 9169 $that.attr('style', $that.data('style-cache') || null); 9170 }); 9171 9172 // restore scroll position if enabled 9173 if (matchHeight._maintainScroll) { 9174 $(window).scrollTop((scrollTop / htmlHeight) * $('html').outerHeight(true)); 9175 } 9176 9177 return this; 9178 }; 9179 9180 /* 9181 * matchHeight._applyDataApi 9182 * applies matchHeight to all elements with a data-match-height attribute 9183 */ 9184 9185 matchHeight._applyDataApi = function() { 9186 var groups = {}; 9187 9188 // generate groups by their groupId set by elements using data-match-height 9189 $('[data-match-height], [data-mh]').each(function() { 9190 var $this = $(this), 9191 groupId = $this.attr('data-mh') || $this.attr('data-match-height'); 9192 9193 if (groupId in groups) { 9194 groups[groupId] = groups[groupId].add($this); 9195 } else { 9196 groups[groupId] = $this; 9197 } 9198 }); 9199 9200 // apply matchHeight to each group 9201 $.each(groups, function() { 9202 this.matchHeight(true); 9203 }); 9204 }; 9205 9206 /* 9207 * matchHeight._update 9208 * updates matchHeight on all current groups with their correct options 9209 */ 9210 9211 var _update = function(event) { 9212 if (matchHeight._beforeUpdate) { 9213 matchHeight._beforeUpdate(event, matchHeight._groups); 9214 } 9215 9216 $.each(matchHeight._groups, function() { 9217 matchHeight._apply(this.elements, this.options); 9218 }); 9219 9220 if (matchHeight._afterUpdate) { 9221 matchHeight._afterUpdate(event, matchHeight._groups); 9222 } 9223 }; 9224 9225 matchHeight._update = function(throttle, event) { 9226 // prevent update if fired from a resize event 9227 // where the viewport width hasn't actually changed 9228 // fixes an event looping bug in IE8 9229 if (event && event.type === 'resize') { 9230 var windowWidth = $(window).width(); 9231 if (windowWidth === _previousResizeWidth) { 9232 return; 9233 } 9234 _previousResizeWidth = windowWidth; 9235 } 9236 9237 // throttle updates 9238 if (!throttle) { 9239 _update(event); 9240 } else if (_updateTimeout === -1) { 9241 _updateTimeout = setTimeout(function() { 9242 _update(event); 9243 _updateTimeout = -1; 9244 }, matchHeight._throttle); 9245 } 9246 }; 9247 9248 /* 9249 * bind events 9250 */ 9251 9252 // apply on DOM ready event 9253 $(matchHeight._applyDataApi); 9254 9255 // update heights on load and resize events 9256 $(window).bind('load', function(event) { 9257 matchHeight._update(false, event); 9258 }); 9259 9260 // throttled update heights on resize events 9261 $(window).bind('resize orientationchange', function(event) { 9262 matchHeight._update(true, event); 9263 }); 9264 9265}); 9266/* 9267 * jQuery resize event - v1.1 - 3/14/2010 9268 * http://benalman.com/projects/jquery-resize-plugin/ 9269 * 9270 * Copyright (c) 2010 "Cowboy" Ben Alman 9271 * Dual licensed under the MIT and GPL licenses. 9272 * http://benalman.com/about/license/ 9273 */ 9274(function ($, h, c) { 9275 var a = $([]), 9276 e = ($.resize = $.extend($.resize, {})), 9277 i, 9278 k = "setTimeout", 9279 j = "resize", 9280 d = j + "-special-event", 9281 b = "delay", 9282 f = "throttleWindow"; 9283 e[b] = 250; 9284 e[f] = true; 9285 $.event.special[j] = { 9286 setup: function () { 9287 if (!e[f] && this[k]) { 9288 return false;
9289 } 9290 var l = $(this); 9291 a = a.add(l); 9292 $.data(this, d, { w: l.width(), h: l.height() }); 9293 if (a.length === 1) { 9294 g(); 9295 } 9296 }, 9297 teardown: function () { 9298 if (!e[f] && this[k]) { 9299 return false; 9300 } 9301 var l = $(this); 9302 a = a.not(l); 9303 l.removeData(d); 9304 if (!a.length) { 9305 clearTimeout(i); 9306 } 9307 }, 9308 add: function (l) { 9309 if (!e[f] && this[k]) { 9310 return false; 9311 } 9312 var n; 9313 function m(s, o, p) { 9314 var q = $(this), 9315 r = $.data(this, d); 9316 if (r) { 9317 r.w = o !== c ? o : q.width(); 9318 r.h = p !== c ? p : q.height(); 9319 } 9320 n.apply(this, arguments); 9321 } 9322 if ($.isFunction(l)) { 9323 n = l; 9324 return m; 9325 } else { 9326 n = l.handler; 9327 l.handler = m; 9328 } 9329 }, 9330 }; 9331 function g() { 9332 i = h[k](function () { 9333 a.each(function () { 9334 var n = $(this), 9335 m = n.width(), 9336 l = n.height(), 9337 o = $.data(this, d); 9338 if (m !== o.w || l !== o.h) { 9339 n.trigger(j, [(o.w = m), (o.h = l)]); 9340 } 9341 }); 9342 g(); 9343 }, e[b]); 9344 } 9345})(jQuery, this); 9346 9347(function ($) { 9348 var queryParser = function (a) { 9349 var i, p, b = {}; 9350 if (a === "") { 9351 return {}; 9352 } 9353 for (i = 0; i < a.length; i += 1) { 9354 p = a[i].split('='); 9355 if (p.length === 2) { 9356 b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " ")); 9357 } 9358 } 9359 return b; 9360 }; 9361 $.queryParams = function () { 9362 return queryParser(window.location.search.substr(1).split('&')); 9363 }; 9364 $.hashParams = function () { 9365 return queryParser(window.location.hash.substr(1).split('&')); 9366 }; 9367 9368 var ident = 0; 9369 9370 window.Swiftype = window.Swiftype || {}; 9371 Swiftype.root_url = Swiftype.root_url || 'https://api.swiftype.com'; 9372 Swiftype.pingUrl = function (endpoint, callback) { 9373 var to = setTimeout(callback, 350); 9374 var img = new Image(); 9375 img.onload = img.onerror = function () { 9376 clearTimeout(to); 9377 callback(); 9378 }; 9379 img.src = endpoint; 9380 return false; 9381 }; 9382 Swiftype.pingAutoSelection = function (engineKey, docId, value, callback) { 9383 var params = { 9384 t : new Date().getTime(), 9385 engine_key : engineKey, 9386 doc_id : docId, 9387 prefix : value 9388 }; 9389 var url = Swiftype.root_url + '/api/v1/public/analytics/pas?' 9390 + $.param(params); 9391 Swiftype.pingUrl(url, callback); 9392 }; 9393 Swiftype.findSelectedSection = function () { 9394 var sectionText = $.hashParams().sts; 9395 if (!sectionText) { 9396 return; 9397 } 9398 9399 function normalizeText(str) { 9400 var out = str.replace(/\s+/g, ''); 9401 out = out.toLowerCase(); 9402 return out; 9403 } 9404 9405 sectionText = normalizeText(sectionText); 9406 9407 $('h1, h2, h3, h4, h5, h6').each(function (idx) { 9408 $this = $(this); 9409 if (normalizeText($this.text()).indexOf(sectionText) >= 0) { 9410 this.scrollIntoView(true); 9411 return false; 9412 } 9413 }); 9414 }; 9415 9416 Swiftype.htmlEscape = Swiftype.htmlEscape 9417 || function htmlEscape(str) { 9418 return String(str).replace(/&/g, '&').replace(/"/g, 9419 '"').replace(/'/g, ''').replace(/</g, '<') 9420 .replace(/>/g, '>'); 9421 }; 9422 9423 $.fn.swiftype = function (options) { 9424 Swiftype.findSelectedSection(); 9425 var options = $.extend({}, $.fn.swiftype.defaults, options); 9426 9427 return this 9428 .each(function () { 9429 var $this = $(this); 9430 var config = $.meta ? $.extend({}, options, $this.data()) 9431 : options; 9432 $this.attr('autocomplete', 'off'); 9433 $this.data('swiftype-config-autocomplete', config); 9434 $this.submitted = false; 9435 $this.cache = new LRUCache(10); 9436 $this.emptyQueries = []; 9437 9438 $this.isEmpty = function (query) { 9439 return $.inArray(normalize(query), this.emptyQueries) >= 0 9440 }; 9441 9442 $this.addEmpty = function (query) { 9443 $this.emptyQueries.unshift(normalize(query)); 9444 }; 9445 9446 var styles = config.dropdownStylesFunction($this);
vendor: 2,560 bytes, lines 9447-9507
9447 var $swiftypeWidget = $('<div class="' 9448 + config.widgetContainerClass + '" />'); 9449 var $listContainer = $('<div />').addClass( 9450 config.suggestionListClass).appendTo( 9451 $swiftypeWidget).css(styles).hide(); 9452 $swiftypeWidget 9453 .appendTo(config.autocompleteContainingElement); 9454 var $list = $('<' + config.suggestionListType + ' />') 9455 .appendTo($listContainer); 9456 9457 $this.data('swiftype-list', $list); 9458 9459 $this.abortCurrent = function () { 9460 if ($this.currentRequest) { 9461 $this.currentRequest.abort(); 9462 } 9463 }; 9464 9465 $this.showList = function () { 9466 if (handleFunctionParam(config.disableAutocomplete) === false) { 9467 $listContainer.show(); 9468 } 9469 }; 9470 9471 $this.hideList = function (sync) { 9472 if (sync) { 9473 $listContainer.hide(); 9474 } else { 9475 setTimeout(function () { 9476 $listContainer.hide(); 9477 }, 10); 9478 } 9479 }; 9480 9481 $this.showNoResults = function () { 9482 $list.empty(); 9483 if (config.noResultsMessage === undefined) { 9484 $this.hideList(); 9485 } else { 9486 $list.append($('<li />', { 9487 'class' : config.noResultsClass 9488 }).text(config.noResultsMessage)); 9489 $this.showList(); 9490 } 9491 }; 9492 9493 $this.focused = function () { 9494 return $this.is(':focus'); 9495 }; 9496 9497 $this.submitting = function () { 9498 $this.submitted = true; 9499 }; 9500 9501 $this.listResults = function () { 9502 return $(config.resultListSelector, $list).filter( 9503 ':not(.' + config.noResultsClass + ')'); 9504 }; 9505 9506 $this.activeResult = function () { 9507 return $this.listResults().filter(
9508 '.' + config.activeItemClass).first(); 9509 }; 9510 9511 $this.prevResult = function () { 9512 var list = $this.listResults(), currentIdx = list 9513 .index($this.activeResult()), nextIdx = currentIdx - 1, next = list 9514 .eq(nextIdx); 9515 $this.listResults().removeClass(config.activeItemClass); 9516 if (nextIdx >= 0) { 9517 next.addClass(config.activeItemClass); 9518 } 9519 }; 9520 9521 $this.nextResult = function () { 9522 var list = $this.listResults(), currentIdx = list 9523 .index($this.activeResult()), nextIdx = currentIdx + 1, next = list 9524 .eq(nextIdx); 9525 $this.listResults().removeClass(config.activeItemClass); 9526 if (nextIdx >= 0) { 9527 next.addClass(config.activeItem
vendor: 14,132 bytes, lines 9527-9926
9527Class); 9528 } 9529 }; 9530 9531 $this.selectedCallback = function (data) { 9532 return function () { 9533 var value = $this.val(), callback = function () { 9534 config.onComplete(data, value); 9535 }; 9536 Swiftype.pingAutoSelection(config.engineKey, 9537 data['id'], value, callback); 9538 }; 9539 }; 9540 9541 $this.registerResult = function ($element, data) { 9542 $element.data('swiftype-item', data); 9543 $element.click($this.selectedCallback(data)).mouseover( 9544 function () { 9545 $this.listResults().removeClass( 9546 config.activeItemClass); 9547 $element.addClass(config.activeItemClass); 9548 }); 9549 }; 9550 9551 $this.getContext = function () { 9552 return { 9553 config : config, 9554 list : $list, 9555 registerResult : $this.registerResult 9556 }; 9557 }; 9558 9559 var typingDelayPointer; 9560 var suppressKey = false; 9561 $this.lastValue = ''; 9562 $this.keyup(function (event) { 9563 if (suppressKey) { 9564 suppressKey = false; 9565 return; 9566 } 9567 9568 // ignore arrow keys, shift 9569 if (((event.which > 36) && (event.which < 41)) 9570 || (event.which == 16)) 9571 return; 9572 9573 if (config.typingDelay > 0) { 9574 clearTimeout(typingDelayPointer); 9575 typingDelayPointer = setTimeout(function () { 9576 processInput($this); 9577 }, config.typingDelay); 9578 } else { 9579 processInput($this); 9580 } 9581 }); 9582 9583 $this.styleDropdown = function () { 9584 $listContainer 9585 .css(config.dropdownStylesFunction($this)); 9586 }; 9587 9588 $(window).resize(function (event) { 9589 $this.styleDropdown(); 9590 }); 9591 9592 $this.keydown(function (event) { 9593 $this.styleDropdown(); 9594 // enter = 13; up = 38; down = 40; esc = 27 9595 var $active = $this.activeResult(); 9596 switch (event.which) { 9597 case 13: 9598 if (($active.length !== 0) 9599 && ($list.is(':visible'))) { 9600 event.preventDefault(); 9601 $this.selectedCallback( 9602 $active.data('swiftype-item'))(); 9603 } else if ($this.currentRequest) { 9604 $this.submitting(); 9605 } 9606 $this.hideList(); 9607 suppressKey = true; 9608 break; 9609 case 38: 9610 event.preventDefault(); 9611 if ($active.length === 0) { 9612 $this.listResults().last().addClass( 9613 config.activeItemClass); 9614 } else { 9615 $this.prevResult(); 9616 } 9617 break; 9618 case 40: 9619 event.preventDefault(); 9620 if ($active.length === 0) { 9621 $this.listResults().first().addClass( 9622 config.activeItemClass); 9623 } else if ($active != $this.listResults().last()) { 9624 $this.nextResult(); 9625 } 9626 break; 9627 case 27: 9628 $this.hideList(); 9629 suppressKey = true; 9630 break; 9631 default: 9632 $this.submitted = false; 9633 break; 9634 } 9635 }); 9636 9637 // opera wants keypress rather than keydown to prevent the 9638 // form submit 9639 $this.keypress(function (event) { 9640 if ((event.which == 13) 9641 && ($this.activeResult().length > 0)) { 9642 event.preventDefault(); 9643 } 9644 }); 9645 9646 // stupid hack to get around loss of focus on mousedown 9647 var mouseDown = false; 9648 var blurWait = false; 9649 $(document).bind('mousedown.swiftype' + ++ident, 9650 function () { 9651 mouseDown = true; 9652 }); 9653 $(document).bind('mouseup.swiftype' + ident, function () { 9654 mouseDown = false; 9655 if (blurWait) { 9656 blurWait = false; 9657 $this.hideList(); 9658 } 9659 }); 9660 $this.blur(function () { 9661 if (mouseDown) { 9662 blurWait = true; 9663 } else { 9664 $this.hideList(); 9665 } 9666 }); 9667 $this.focus(function () { 9668 setTimeout(function () { 9669 $this.select() 9670 }, 10); 9671 if ($this.listResults().length > 0) { 9672 $this.showList(); 9673 } 9674 }); 9675 }); 9676 }; 9677 9678 var normalize = function (str) { 9679 return $.trim(str).toLowerCase(); 9680 }; 9681 9682 var callRemote = function ($this, term) { 9683 $this.abortCurrent(); 9684 9685 var params = {}, config = $this.data('swiftype-config-autocomplete'); 9686 9687 params['q'] = term; 9688 params['engine_key'] = config.engineKey; 9689 params['search_fields'] = handleFunctionParam(config.searchFields); 9690 params['fetch_fields'] = handleFunctionParam(config.fetchFields); 9691 params['filters'] = handleFunctionParam(config.filters); 9692 params['document_types'] = handleFunctionParam(config.documentTypes); 9693 params['functional_boosts'] = handleFunctionParam(config.functionalBoosts); 9694 params['sort_field'] = handleFunctionParam(config.sortField); 9695 params['sort_direction'] = handleFunctionParam(config.sortDirection); 9696 params['per_page'] = config.resultLimit; 9697 params['highlight_fields'] = config.highlightFields; 9698 9699 var endpoint = Swiftype.root_url 9700 + '/api/v1/public/engines/suggest.json'; 9701 $this.currentRequest = $.ajax({ 9702 type : 'GET', 9703 dataType : 'jsonp', 9704 url : endpoint, 9705 data : params 9706 }).done(function (data) { 9707 var norm = normalize(term); 9708 if (data.record_count > 0) { 9709 $this.cache.put(norm, data.records); 9710 } else { 9711 $this.addEmpty(norm); 9712 $this.showNoResults(); 9713 return; 9714 } 9715 processData($this, data.records, term); 9716 }); 9717 }; 9718 9719 var getResults = function ($this, term) { 9720 var norm = normalize(term); 9721 if ($this.isEmpty(norm)) { 9722 $this.showNoResults(); 9723 return; 9724 } 9725 var cached = $this.cache.get(norm); 9726 if (cached) { 9727 processData($this, cached, term); 9728 } else { 9729 callRemote($this, term); 9730 } 9731 }; 9732 9733 // private helpers 9734 var processInput = function ($this) { 9735 var term = $this.val(); 9736 var config = $this.data('swiftype-config-autocomplete'); 9737 9738 if (term === $this.lastValue || term.length < config.minTermLength) { 9739 return; 9740 } 9741 $this.lastValue = term; 9742 if ($.trim(term) === '') { 9743 $this.data('swiftype-list').empty() 9744 $this.hideList(); 9745 return; 9746 } 9747 if (typeof $this.data('swiftype-config-autocomplete').engineKey !== 'undefined') { 9748 getResults($this, term); 9749 } 9750 }; 9751 9752 var processData = function ($this, data, term) { 9753 var $list = $this.data('swiftype-list'), config = $this 9754 .data('swiftype-config-autocomplete'); 9755 9756 $list.empty(); 9757 $this.hideList(true); 9758 9759 config.resultRenderFunction($this.getContext(), data); 9760 9761 var totalItems = $this.listResults().length; 9762 if ((totalItems > 0 && $this.focused()) 9763 || (config.noResultsMessage !== undefined)) { 9764 if ($this.submitted) { 9765 $this.submitted = false; 9766 } else { 9767 $this.showList(); 9768 } 9769 } 9770 }; 9771 9772 var defaultResultRenderFunction = function (ctx, results) { 9773 var $list = ctx.list, config = ctx.config; 9774 9775 $.each(results, function (document_type, items) { 9776 $.each(items, function (idx, item) { 9777 ctx.registerResult($( 9778 '<li>' + config.renderFunction(document_type, item) 9779 + '</li>').appendTo($list), item); 9780 }); 9781 }); 9782 }; 9783 9784 var defaultRenderFunction = function (document_type, item) { 9785 return '<p class="title">' + Swiftype.htmlEscape(item['title']) 9786 + '</p>'; 9787 }; 9788 9789 var defaultOnComplete = function (item, prefix) { 9790 window.location = item['url']; 9791 }; 9792 9793 var defaultDropdownStylesFunction = function ($this) { 9794 var config = $this.data('swiftype-config-autocomplete'); 9795 var $attachEl = config.attachTo ? $(config.attachTo) : $this; 9796 var offset = $attachEl.offset(); 9797 var styles = { 9798 'position' : 'absolute', 9799 'z-index' : 9999, 9800 'top' : offset.top + $attachEl.outerHeight() + 1, 9801 'left' : offset.left 9802 }; 9803 if (config.setWidth) { 9804 styles['width'] = $attachEl.outerWidth() - 2; 9805 } 9806 return styles; 9807 }; 9808 9809 var handleFunctionParam = function (field) { 9810 if (field !== undefined) { 9811 var evald = field; 9812 if (typeof evald === 'function') { 9813 evald = evald.call(); 9814 } 9815 return evald; 9816 } 9817 return undefined; 9818 }; 9819 9820 // simple client-side LRU Cache, based on https://github.com/rsms/js-lru 9821 9822 function LRUCache(limit) { 9823 this.size = 0; 9824 this.limit = limit; 9825 this._keymap = {}; 9826 } 9827 9828 LRUCache.prototype.put = function (key, value) { 9829 var entry = { 9830 key : key, 9831 value : value 9832 }; 9833 this._keymap[key] = entry; 9834 if (this.tail) { 9835 this.tail.newer = entry; 9836 entry.older = this.tail; 9837 } else { 9838 this.head = entry; 9839 } 9840 this.tail = entry; 9841 if (this.size === this.limit) { 9842 return this.shift(); 9843 } else { 9844 this.size++; 9845 } 9846 }; 9847 9848 LRUCache.prototype.shift = function () { 9849 var entry = this.head; 9850 if (entry) { 9851 if (this.head.newer) { 9852 this.head = this.head.newer; 9853 this.head.older = undefined; 9854 } else { 9855 this.head = undefined; 9856 } 9857 entry.newer = entry.older = undefined; 9858 delete this._keymap[entry.key]; 9859 } 9860 return entry; 9861 }; 9862 9863 LRUCache.prototype.get = function (key, returnEntry) { 9864 var entry = this._keymap[key]; 9865 if (entry === undefined) 9866 return; 9867 if (entry === this.tail) { 9868 return entry.value; 9869 } 9870 if (entry.newer) { 9871 if (entry === this.head) 9872 this.head = entry.newer; 9873 entry.newer.older = entry.older; 9874 } 9875 if (entry.older) 9876 entry.older.newer = entry.newer; 9877 entry.newer = undefined; 9878 entry.older = this.tail; 9879 if (this.tail) 9880 this.tail.newer = entry; 9881 this.tail = entry; 9882 return returnEntry ? entry : entry.value; 9883 }; 9884 9885 LRUCache.prototype.remove = function (key) { 9886 var entry = this._keymap[key]; 9887 if (!entry) 9888 return; 9889 delete this._keymap[entry.key]; 9890 if (entry.newer && entry.older) { 9891 entry.older.newer = entry.newer; 9892 entry.newer.older = entry.older; 9893 } else if (entry.newer) { 9894 entry.newer.older = undefined; 9895 this.head = entry.newer; 9896 } else if (entry.older) { 9897 entry.older.newer = undefined; 9898 this.tail = entry.older; 9899 } else { 9900 this.head = this.tail = undefined; 9901 } 9902 9903 this.size--; 9904 return entry.value; 9905 }; 9906 9907 LRUCache.prototype.clear = function () { 9908 this.head = this.tail = undefined; 9909 this.size = 0; 9910 this._keymap = {}; 9911 }; 9912 9913 if (typeof Object.keys === 'function') { 9914 LRUCache.prototype.keys = function () { 9915 return Object.keys(this._keymap); 9916 }; 9917 } else { 9918 LRUCache.prototype.keys = function () { 9919 var keys = []; 9920 for ( var k in this._keymap) 9921 keys.push(k); 9922 return keys; 9923 }; 9924 } 9925 9926 $.fn.swiftype.defaults = {
9927 activeItemClass : 'active', 9928 attachTo : undefined, 9929 documentTypes : undefined, 9930 filters : undefined, 9931 engineKey : undefined, 9932 searchFields : undefined, 9933 functionalBoosts : undefined, 9934 sortField : undefined, 9935 sortDirection : undefined, 9936 fetchFields : undefined, 9937 highlightFields : undefined, 9938 minTermLength : 3, 9939 noResultsClass : 'noResults', 9940 noResultsMessage : undefined, 9941 onComplete : defaultOnComplete, 9942 resultRenderFunction : defaultResultRenderFunction, 9943 renderFunction : defaultRenderFunction, 9944 dropdownStylesFunction : defaultDropdownStylesFunction, 9945 resultLimit : undefined, 9946 suggestionListType : 'ul', 9947 suggestionListClass : 'autocomplete', 9948 resultListSelector : 'li', 9949 setWidth : true, 9950 typingDelay : 80, 9951 disableAutocomplete : false, 9952 autocompleteContainingElement : 'body', 9953 widgetContainerClass : 'swiftype-widget' 9954 }; 9955 9956})(jQuery); 9957 9958(function ($) { 9959 var queryParser = function (a) { 9960 var i, p, b = {}; 9961 if (a === "") { 9962 return {}; 9963 } 9964 for (i = 0; i < a.length; i += 1) { 9965 p = a[i].split('='); 9966 if (p.length === 2) { 9967 b[p[0]] = decodeURIComponent(p[1].replace(/\+/g, " ")); 9968 } 9969 } 9970 return b; 9971 }; 9972 $.queryParams = function () { 9973 return queryParser(window.location.search.substr(1).split('&')); 9974 }; 9975 $.hashParams = function () { 9976 return queryParser(window.location.hash.substr(1).split('&')); 9977 }; 9978 9979 9980 window.Swiftype = window.Swiftype || {}; 9981 Swiftype.root_url = Swiftype.root_url || 'https://api.swiftype.com'; 9982 Swiftype.pingUrl = function(endpoint, callback) { 9983 var to = setTimeout(callback, 350); 9984 var img = new Image(); 9985 img.onload = img.onerror = function() { 9986 clearTimeout(to); 9987 callback(); 9988 }; 9989 img.src = endpoint; 9990 return false; 9991 }; 9992 Swiftype.pingSearchResultClick = function (engineKey, docId, callback) { 9993 var params = { 9994 t: new Date().getTime(), 9995 engine_key: engineKey, 9996 doc_id: docId, 9997 q: Swiftype.currentQuery 9998 }; 9999 var url = Swiftype.root_url + '/api/v1/public/analytics/pc?' + $.param(params); 10000 Swiftype.pingUrl(url, callback); 10001 }; 10002 10003 $.fn.swiftypeSearch = function (options) { 10004 var options = $.extend({}, $.fn.swiftypeSearch.defaults, options); 10005 10006 return this.each(function () { 10007 var $this = $(this); 10008 var config = $.meta ? $.extend({}, options, $this.data()) : options; 10009 $this.data('swiftype-config-search', config); 10010 10011 $this.selectedCallback = function (data) { 10012 return function (e) { 10013 var $el = $(this); 10014 e.preventDefault(); 10015 Swiftype.pingSearchResultClick(config.engineKey, data['id'], function() { 10016 config.onComplete($el); 10017 }); 10018 }; 10019 }; 10020 10021 $this.registerResult = function ($element, data) { 10022 $element.data('swiftype-item', data); 10023 $('a', $element).click($this.selectedCallback(data)); 10024 }; 10025 10026 $this.getContentCache = function () { 10027 return $('#' + contentCacheId); 10028 }; 10029 10030 var $resultContainer = $(config.resultContainingElement), 10031 initialContentOfResultContainer = $resultContainer.html(), 10032 contentCacheId = 'st-content-cache', 10033 $contentCache = $this.getContentCache(); 10034 10035 var setSearchHash = function (query, page) { 10036 location.hash = "stq=" + encodeURIComponent(query) + "&stp=" + page; 10037 }; 10038 10039 var submitSearch = function (query, options) { 10040 options = $.extend({ 10041 page: 1 10042 }, options); 10043 var params = {}; 10044 10045 if (!$contentCache.length) { 10046 $resultContainer.after("<div id='" + contentCacheId + "' style='display: none;'></div>"); 10047 $contentCache.html(initialContentOfResultContainer).hide(); 10048 } 10049 config.loadingFunction(query, $resultContainer); 10050 10051 Swiftype.currentQuery = query; 10052 params['q'] = query; 10053 params['engine_key'] = config.engineKey; 10054 params['page'] = options.page; 10055 10056 function handleFunctionParam(field) { 10057 if (field !== undefined) { 10058 var evald = field; 10059 if (typeof evald === 'function') { 10060 evald = evald.call(); 10061 } 10062 return evald; 10063 } 10064 return undefined; 10065 } 10066 10067 params['per_page'] = handleFunctionParam(config.perPage); 10068 params['search_fields'] = handleFunctionParam(config.searchFields); 10069 params['fetch_fields'] = handleFunctionParam(config.fetchFields); 10070 params['facets'] = handleFunctionParam(config.facets); 10071 params['filters'] = handleFunctionParam(config.filters); 10072 params['document_types'] = handleFunctionParam(config.documentTypes); 10073 params['functional_boosts'] = handleFunctionParam(config.functionalBoosts); 10074 params['sort_field'] = handleFunctionParam(config.sortField); 10075 params['sort_direction'] = handleFunctionParam(config.sortDirection); 10076 params['spelling'] = handleFunctionParam(config.spelling); 10077 params['highlight_fields'] = handleFunctionParam(config.highlightFields); 10078 10079 $.ajax({ 10080 dataType: "json", 10081 url: Swiftype.root_url + "/api/v1/public/engines/search.json?callback=?", 10082 data: params, 10083 xhrFields: { withCredentials: true },
10084 success: renderSearchResults 10085 }); 10086 }; 10087 10088 $(window).hashchange(function () { 10089 var params = $.hashParams(); 10090 if (params.stq) { 10091 submitSearch(params.stq, { 10092 page: params.stp 10093 }); 10094 } else { 10095 var $contentCache = $this.getContentCache(); 10096 if ($contentCache.length) { 10097 $resultContainer.html($contentCache.html()); 10098 $contentCache.remove(); 10099 } 10100 } 10101 }); 10102 10103 var $containingForm = $this.parents('form'); 10104 if ($containingForm) { 10105 $containingForm.bind('submit', function (e) { 10106 e.preventDefault(); 10107 var searchQuery = $this.val(); 10108 setSearchHash(searchQuery, 1); 10109 }); 10110 } 10111 10112 $(document).on('click', '[data-hash][data-page]', function (e) { 10113 e.preventDefault(); 10114 var $this = $(this); 10115 setSearchHash($.hashParams().stq, $this.data('page')); 10116 }); 10117 10118 $(document).on('click', '[data-hash][data-spelling-suggestion]', function (e) { 10119 e.preventDefault(); 10120 var $this = $(this); 10121 setSearchHash($this.data('spelling-suggestion'), 1); 10122 }); 10123 10124 var renderSearchResults = function (data) { 10125 if (typeof config.preRenderFunction === 'function') { 10126 config.preRenderFunction.call($this, data); 10127 } 10128 10129 config.renderResultsFunction($this.getContext(), data); 10130 10131 if (typeof config.postRenderFunction === 'function') { 10132 config.postRenderFunction.call($this, data); 10133 } 10134 }; 10135 10136 $this.getContext = function () { 10137 return { 10138 config: config, 10139 resultContainer: $resultContainer, 10140 registerResult: $this.registerResult 10141 }; 10142 }; 10143 10144 $(window).hashchange(); // if the swiftype query hash is present onload (maybe the user is pressing the back button), submit a query onload 10145 }); 10146 }; 10147 10148 var renderPagination = function (ctx, resultInfo) { 10149 var maxPagesType, maxPages = -1, 10150 config = ctx.config; 10151 $.each(resultInfo, function(documentType, typeInfo) { 10152 if (typeInfo.num_pages > maxPages) { 10153 maxPagesType = documentType; 10154 maxPages = typeInfo.num_pages; 10155 } 10156 }); 10157 var currentPage = resultInfo[maxPagesType].current_page, 10158 totalPages = resultInfo[maxPagesType].num_pages; 10159 10160 $(config.renderPaginationForType(maxPagesType, currentPage, totalPages)).appendTo(ctx.resultContainer); 10161 }; 10162 10163 10164 var normalize = function (str) { 10165 return $.trim(str).toLowerCase(); 10166 }; 10167 10168 function htmlEscape(str) { 10169 return String(str).replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, ''').replace(/</g, '<').replace(/>/g, '>'); 10170 } 10171 10172 var defaultRenderResultsFunction = function (ctx, data) { 10173 var $resultContainer = ctx.resultContainer, 10174 config = ctx.config; 10175 10176 $resultContainer.html(''); 10177 10178 $.each(data.records, function (documentType, items) { 10179 $.each(items, function (idx, item) { 10180 ctx.registerResult($(config.renderFunction(documentType, item)).appendTo($resultContainer), item); 10181 }); 10182 }); 10183 10184 renderPagination(ctx, data.info); 10185 }; 10186 10187 var defaultRenderFunction = function (document_type, item) { 10188 return '<div class="st-result"><h3 class="title"><a href="' + item['url'] + '" class="st-search-result-link">' + htmlEscape(item['title']) + '</a></h3></div>'; 10189 }; 10190 10191 var defaultLoadingFunction = function(query, $resultContainer) { 10192 $resultContainer.html('<p class="st-loading-message">loading...</p>'); 10193 }; 10194 10195 var defaultOnComplete = function(elem) { 10196 window.location = elem.attr('href'); 10197 }; 10198 10199 var defaultPostRenderFunction = function(data) { 10200 var totalResultCount = 0; 10201 var $resultContainer = this.getContext().resultContainer; 10202 var spellingSuggestion = null; 10203 10204 if (data['info']) { 10205 $.each(data['info'], function(index, value) { 10206 totalResultCount += value['total_result_count']; 10207 if ( value['spelling_suggestion'] ) { 10208 spellingSuggestion = value['spelling_suggestion']['text']; 10209 } 10210 10211 }); 10212 } 10213 10214 if (totalResultCount === 0) { 10215 $resultContainer.html("<div id='st-no-results' class='st-no-results'>No results found.</div>"); 10216 } 10217 10218 if (spellingSuggestion !== null) { 10219 $resultContainer.append('<div class="st-spelling-suggestion">Did you mean <a href="#" data-hash="true" data-spelling-suggestion="' + spellingSuggestion + '">' + spellingSuggestion + '</a>?</div>'); 10220 } 10221 }; 10222 10223 10224 var defaultRenderPaginationForType = function (type, currentPage, totalPages) { 10225 var pages = '<div class="st-page">', 10226 previousPage, nextPage; 10227 if (currentPage != 1) { 10228 previousPage = currentPage - 1; 10229 pages = pages + '<a href="#" class="st-prev" data-hash="true" data-page="' + previousPage + '">« previous</a>'; 10230 } 10231 if (currentPage < totalPages) { 10232 nextPage = currentPage + 1; 10233 pages = pages + '<a href="#" class="st-next" data-hash="true" data-page="' + nextPage + '">next »</a>'; 10234 } 10235 pages += '</div>'; 10236 return pages; 10237 }; 10238 10239 10240 $.fn.swiftypeSearch.defaults = { 10241 attachTo: undefined, 10242 documentTypes: undefined, 10243 facets: undefined, 10244 filters: undefined, 10245 engineKey: undefined, 10246 searchFields: undefined, 10247 functionalBoosts: undefined, 10248 sortField: undefined, 10249 sortDirection: undefined, 10250 fetchFields: undefined, 10251 highlightFields: undefined, 10252 preRenderFunction: undefined, 10253 postRenderFunction: defaultPostRenderFunction, 10254 loadingFunction: defaultLoadingFunction, 10255 renderResultsFunction: defaultRenderResultsFunction, 10256 renderFunction: defaultRenderFunction, 10257 renderPaginationForType: defaultRenderPaginationForType, 10258 onComplete: defaultOnComplete, 10259 perPage: 10, 10260 spelling: 'strict' 10261 }; 10262})(jQuery); 10263 10264/** 10265 * jQuery Unveil 10266 * A very lightweight jQuery plugin to lazy load images 10267 * http://luis-almeida.github.com/unveil 10268 * 10269 * Licensed under the MIT license. 10270 * Copyright 2013 LuÃs Almeida 10271 * https://github.com/luis-almeida 10272 */ 10273 10274;(function($) { 10275 10276 $.fn.unveil = function(threshold, callback) { 10277 10278 var $w = $(window), 10279 th = threshold || 0, 10280 retina = window.devicePixelRatio > 1, 10281 attrib = retina? "data-src-retina" : "data-src", 10282 images = this, 10283 loaded; 10284 10285 this.one("unveil", function() { 10286 var source = this.getAttribute(attrib); 10287 source = source || this.getAttribute("data-src"); 10288 if (source) { 10289 this.setAttribute("src", source); 10290 if (typeof callback === "function") callback.call(this); 10291 } 10292 }); 10293 10294 function unveil() { 10295 var inview = images.filter(function() { 10296 var $e = $(this); 10297 if ($e.is(":hidden")) return; 10298 10299 var wt = $w.scrollTop(), 10300 wb = wt + $w.height(), 10301 et = $e.offset().top, 10302 eb = et + $e.height(); 10303 10304 return eb >= wt - th && et <= wb + th; 10305 }); 10306 10307 loaded = inview.trigger("unveil"); 10308 images = images.not(loaded); 10309 } 10310 10311 $w.on("scroll.unveil resize.unveil lookup.unveil", unveil); 10312 10313 unveil(); 10314 10315 return this; 10316 10317 }; 10318 10319})(window.jQuery || window.Zepto); 10320 10321/*! jQuery UI - v1.12.1 - 2021-05-21 10322* http://jqueryui.com 10323* Includes: keycode.js, widgets/datepicker.js 10324* Copyright jQuery Foundation and other contributors; Licensed MIT */ 10325 10326!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(M){M.ui=M.ui||{};var r;M.ui.version="1.12.1",M.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38};function e(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
10326ay","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},M.extend(this._defaults,this.regional[""]),this.regional.en=M.extend(!0,{},this.regional[""]),this.regional["en-US"]=M.extend(!0,{},this.regional.en),this.dpDiv=a(M("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function a(e){var t="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.on("mouseout",t,function(){M(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&M(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&M(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",t,n)}function n(){M.datepicker._isDisabledDatepicker((r.inline?r.dpDiv.parent():r.input)[0])||(M(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),M(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&M(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&M(this).addClass("ui-datepicker-next-hover"))}function o(e,t){for(var a in M.extend(e,t),t)null==t[a]&&(e[a]=t[a]);return e}M.extend(M.ui,{datepicker:{version:"1.12.1"}}),M.extend(e.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(e){return o(this._defaults,e||{}),this},_attachDatepicker:function(e,t){var a,i=e.nodeName.toLowerCase(),s="div"===i||"span"===i;e.id||(this.uuid+=1,e.id="dp"+this.uuid),(a=this._newInst(M(e),s)).settings=M.extend({},t||{}),"input"===i?this._connectDatepicker(e,a):s&&this._inlineDatepicker(e,a)},_newInst:function(e,t){return{id:e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1"),input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:t,dpDiv:t?a(M("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,t){var a=M(e);t.append=M([]),t.trigger=M([]),a.hasClass(this.markerClassName)||(this._attachments(a,t),a.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(t),M.data(e,"datepicker",t),t.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,t){var a,i=this._get(t,"appendText"),s=this._get(t,"isRTL");t.append&&t.append.remove(),i&&(t.append=M("<span class='"+this._appendClass+"'>"+i+"</span>"),e[s?"before":"after"](t.append)),e.off("focus",this._showDatepicker),t.trigger&&t.trigger.remove(),"focus"!==(a=this._get(t,"showOn"))&&"both"!==a||e.on("focus",this._showDatepicker),"button"!==a&&"both"!==a||(i=this._get(t,"buttonText"),a=this._get(t,"buttonImage"),t.trigger=M(this._get(t,"buttonImageOnly")?M("<img/>").addClass(this._triggerClass).attr({src:a,alt:i,title:i}):M("<button type='button'></button>").addClass(this._triggerClass).html(a?M("<img/>").attr({src:a,alt:i,title:i}):i)),e[s?"before":"after"](t.trigger),t.trigger.on("click",function(){return M.datepicker._datepickerShowing&&M.datepicker._lastInput===e[0]?M.datepicker._hideDatepicker():(M.datepicker._datepickerShowing&&M.datepicker._lastInput!==e[0]&&M.datepicker._hideDatepicker(),M.datepicker._showDatepicker(e[0])),!1}))},_autoSize:function(e){var t,a,i,s,r,n;this._get(e,"autoSize")&&!e.inline&&(r=new Date(2009,11,20),(n=this._get(e,"dateFormat")).match(/[DM]/)&&(t=function(e){for(s=i=a=0;s<e.length;s++)e[s].length>a&&(a=e[s].length,i=s);return i},r.setMonth(t(this._get(e,n.match(/MM/)?"monthNames":"monthNamesShort"))),r.setDate(t(this._get(e,n.match(/DD/)?"dayNames":"dayNamesShort"))+20-r.getDay())),e.input.attr("size",this._formatDate(e,r).length))},_inlineDatepicker:function(e,t){var a=M(e);a.hasClass(this.markerClassName)||(a.addClass(this.markerClassName).append(t.dpDiv),M.data(e,"datepicker",t),this._setDate(t,this._getDefaultDate(t),!0),this._updateDatepicker(t),this._updateAlternate(t),t.settings.disabled&&this._disableDatepicker(e),t.dpDiv.css("display","block"))},_dialogDatepicker:function(e,t,a,i,s){var r,n=this._dialogInst;return n||(this.uuid+=1,r="dp"+this.uuid,this._dialogInput=M("<input type='text' id='"+r+"' style='position: absolute; top: -100px; width: 0px;'/>
10326"),this._dialogInput.on("keydown",this._doKeyDown),M("body").append(this._dialogInput),(n=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},M.data(this._dialogInput[0],"datepicker",n)),o(n.settings,i||{}),t=t&&t.constructor===Date?this._formatDate(n,t):t,this._dialogInput.val(t),this._pos=s?s.length?s:[s.pageX,s.pageY]:null,this._pos||(r=document.documentElement.clientWidth,i=document.documentElement.clientHeight,t=document.documentElement.scrollLeft||document.body.scrollLeft,s=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[r/2-100+t,i/2-150+s]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),n.settings.onSelect=a,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),M.blockUI&&M.blockUI(this.dpDiv),M.data(this._dialogInput[0],"datepicker",n),this},_destroyDatepicker:function(e){var t,a=M(e),i=M.data(e,"datepicker");a.hasClass(this.markerClassName)&&(t=e.nodeName.toLowerCase(),M.removeData(e,"datepicker"),"input"===t?(i.append.remove(),i.trigger.remove(),a.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):"div"!==t&&"span"!==t||a.removeClass(this.markerClassName).empty(),r===i&&(r=null))},_enableDatepicker:function(t){var e,a=M(t),i=M.data(t,"datepicker");a.hasClass(this.markerClassName)&&("input"===(e=t.nodeName.toLowerCase())?(t.disabled=!1,i.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==e&&"span"!==e||((a=a.children("."+this._inlineClass)).children().removeClass("ui-state-disabled"),a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=M.map(this._disabledInputs,function(e){return e===t?null:e}))},_disableDatepicker:function(t){var e,a=M(t),i=M.data(t,"datepicker");a.hasClass(this.markerClassName)&&("input"===(e=t.nodeName.toLowerCase())?(t.disabled=!0,i.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==e&&"span"!==e||((a=a.children("."+this._inlineClass)).children().addClass("ui-state-disabled"),a.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=M.map(this._disabledInputs,function(e){return e===t?null:e}),this._disabledInputs[this._disabledInputs.length]=t)},_isDisabledDatepicker:function(e){if(!e)return!1;for(var t=0;t<this._disabledInputs.length;t++)if(this._disabledInputs[t]===e)return!0;return!1},_getInst:function(e){try{return M.data(e,"datepicker")}catch(e){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,t,a){var i,s,r,n,d=this._getInst(e);if(2===arguments.length&&"string"==typeof t)return"defaults"===t?M.extend({},M.datepicker._defaults):d?"all"===t?M.extend({},d.settings):this._get(d,t):null;i=t||{},"string"==typeof t&&((i={})[t]=a),d&&(this._curInst===d&&this._hideDatepicker(),s=this._getDateDatepicker(e,!0),r=this._getMinMaxDate(d,"min"),n=this._getMinMaxDate(d,"max"),o(d.settings,i),null!==r&&void 0!==i.dateFormat&&void 0===i.minDate&&(d.settings.minDate=this._formatDate(d,r)),null!==n&&void 0!==i.dateFormat&&void 0===i.maxDate&&(d.settings.maxDate=this._formatDate(d,n)),"disabled"in i&&(i.disabled?this._disableDatepicker(e):this._enableDatepicker(e)),this._attachments(M(e),d),this._autoSize(d),this._setDate(d,s),this._updateAlternate(d),this._updateDatepicker(d))},_changeDatepicker:function(e,t,a){this._optionDatepicker(e,t,a)},_refreshDatepicker:function(e){e=this._getInst(e);e&&this._updateDatepicker(e)},_setDateDatepicker:function(e,t){e=this._getInst(e);e&&(this._setDate(e,t),this._updateDatepicker(e),this._updateAlternate(e))},_getDateDatepicker:function(e,t){e=this._getInst(e);return e&&!e.inline&&this._setDateFromField(e,t),e?this._getDate(e):null},_doKeyDown:function(e){var t,a,i=M.datepicker._getInst(e.target),s=!0,r=i.dpDiv.is(".ui-datepicker-rtl");if(i._keyEvent=!0,M.datepicker._datepickerShowing)switch(e.keyCode){case 9:M.datepicker._hideDatepicker(),s=!1;break;case 13:return(a=M("td."+M.datepicker._dayOverClass+":not(."+M.datepicker._currentClass+")",i.dpDiv))[0]&&M.datepicker._selectDay(e.target,i.selectedMonth,i.selectedYear,a[0]),(t=M.datepicker._get(i,"onSelect"))?(a=M.datepicker._formatDate(i),t.apply(i.input?i.input[0]:null,[a,i])):M.datepicker._hideDatepicker(),!1;case 27:M.datepicker._hideDatepicker();break;case 33:M.datepicker._adjustDate(e.target,e.ctrlKey?-M.datepicker._get(i,"stepBigMonths"):-M.datepicker._get(i,"stepMonths"),"M");break;case 34:M.datepicker._adjustDate(e.target,e.ctrlKey?+M.datepicker._get(i,"stepBigMonths"):+M.datepicker._get(i,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&M.datepicker._clearDate(e.target),s=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&M.datepicker._gotoToday(e.target),s=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&M.datepicker._adjustDate(e.target,r?1:-1,"D"),s=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&M.datepicker._adjustDate(e.target,e.ctrlKey?-M.datepicker._get(i,"stepBigMonths"):-M.datepicker._get(i,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&M.datepicker._adjustDate(e.target,-7,"D"),s=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&M.datepicker._adjustDate(e.target,r?-1:1,"D"),s=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&M.datepicker._adjustDate(e.target,e.ctrlKey?+M.datepicker._get(i,"stepBigMonths"):+M.datepicker._get(i,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&M.datepicker._adjustDate(e.target,7,"D"),s=e.ctrlKey||e.metaKey;break;default:s=!1}else 36===e.keyCode&&e.ctrlKey?M.datepicker._showDatepicker(this):s=!1;s&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var t,a=M.datepicker._getInst(e.target);if(M.datepicker._get(a,"constrainInput"))return t=M.datepicker._possibleChars(M.datepicker._get(a,"dateFormat")),a=String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),e.ctrlKey||e.metaKey||a<" "||!t||-1<t.indexOf(a)},_doKeyUp:function(e){var t=M.datepicker._getInst(e.target);if(t.input.val()!==t.lastVal)try{M.datepicker.parseDate(M.datepicker._get(t,"dateFormat"),t.input?t.input.val():null,M.datepicker._getFormatConfig(t))&&(M.datepicker._setDateFromField(t),M.datepicker._updateAlternate(t),M.datepicker._updateDatepicker(t))}catch(e){}return!0},_showDatepicker:function(e){var t,a,i,s;"input"!==(e=e.target||e).nodeName.toLowerCase()&&(e=M("input",e.parentNode)[0]),M.datepicker._isDisabledDatepicker(e)||M.datepicker._lastInput===e||(s=M.datepicker._getInst(e),M.datepicker._curInst&&M.datepicker._curInst!==s&&(M.datepicker._curInst.dpDiv.stop(!0,!0),s&&M.datepicker._datepickerShowing&&M.datepicker._hideDatepicker(M.datepicker._curInst.input[0])),!1!==(a=(i=M.datepicker._get(s,"beforeShow"))?i.apply(e,[e,s]):{})&&(o(s.settings,a),s.lastVal=null,M.datepicker._lastInput=e,M.datepicker._setDateFromField(s),M.datepicker._inDialog&&(e.value=""),M.datepicker._pos||(M.datepicker._pos=M.datepicker._findPos(e),M.datepicker._pos[1]+=e.offsetHeight),t=!1,M(e).parents().each(function(){return!(t|="fixed"===M(this).css("position"))}),i={left:M.datepicker._pos[0],top:M.datepicker._pos[1]},M.datepicker._pos=null,s.dpDiv.empty(),s.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),M.datepicker._updateDatepicker(s),i=M.datepicker._checkOffset(s,i,t),s.dpDiv.css({position:M.datepicker._inDialog&&M.blockUI?"static":t?"fixed":"absolute",display:"none",left:i.left+"px",to
vendor: 5,373 bytes, line 10326
10326p:i.top+"px"}),s.inline||(a=M.datepicker._get(s,"showAnim"),i=M.datepicker._get(s,"duration"),s.dpDiv.css("z-index",function(e){for(var t,a;e.length&&e[0]!==document;){if(("absolute"===(t=e.css("position"))||"relative"===t||"fixed"===t)&&(a=parseInt(e.css("zIndex"),10),!isNaN(a)&&0!==a))return a;e=e.parent()}return 0}(M(e))+1),M.datepicker._datepickerShowing=!0,M.effects&&M.effects.effect[a]?s.dpDiv.show(a,M.datepicker._get(s,"showOptions"),i):s.dpDiv[a||"show"](a?i:null),M.datepicker._shouldFocusInput(s)&&s.input.trigger("focus"),M.datepicker._curInst=s)))},_updateDatepicker:function(e){this.maxRows=4,(r=e).dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var t,a=this._getNumberOfMonths(e),i=a[1],s=e.dpDiv.find("."+this._dayOverClass+" a");0<s.length&&n.apply(s.get(0)),e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),1<i&&e.dpDiv.addClass("ui-datepicker-multi-"+i).css("width",17*i+"em"),e.dpDiv[(1!==a[0]||1!==a[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===M.datepicker._curInst&&M.datepicker._datepickerShowing&&M.datepicker._shouldFocusInput(e)&&e.input.trigger("focus"),e.yearshtml&&(t=e.yearshtml,setTimeout(function(){t===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),t=e.yearshtml=null},0))},_shouldFocusInput:function(e){return e.input&&e.input.is(":visible")&&!e.input.is(":disabled")&&!e.input.is(":focus")},_checkOffset:function(e,t,a){var i=e.dpDiv.outerWidth(),s=e.dpDiv.outerHeight(),r=e.input?e.input.outerWidth():0,n=e.input?e.input.outerHeight():0,d=document.documentElement.clientWidth+(a?0:M(document).scrollLeft()),o=document.documentElement.clientHeight+(a?0:M(document).scrollTop());return t.left-=this._get(e,"isRTL")?i-r:0,t.left-=a&&t.left===e.input.offset().left?M(document).scrollLeft():0,t.top-=a&&t.top===e.input.offset().top+n?M(document).scrollTop():0,t.left-=Math.min(t.left,t.left+i>d&&i<d?Math.abs(t.left+i-d):0),t.top-=Math.min(t.top,t.top+s>o&&s<o?Math.abs(s+n):0),t},_findPos:function(e){for(var t=this._getInst(e),a=this._get(t,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||M.expr.filters.hidden(e));)e=e[a?"previousSibling":"nextSibling"];return[(t=M(e).offset()).left,t.top]},_hideDatepicker:function(e){var t,a,i=this._curInst;!i||e&&i!==M.data(e,"datepicker")||this._datepickerShowing&&(t=this._get(i,"showAnim"),a=this._get(i,"duration"),e=function(){M.datepicker._tidyDialog(i)},M.effects&&(M.effects.effect[t]||M.effects[t])?i.dpDiv.hide(t,M.datepicker._get(i,"showOptions"),a,e):i.dpDiv["slideDown"===t?"slideUp":"fadeIn"===t?"fadeOut":"hide"](t?a:null,e),t||e(),this._datepickerShowing=!1,(e=this._get(i,"onClose"))&&e.apply(i.input?i.input[0]:null,[i.input?i.input.val():"",i]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),M.blockUI&&(M.unblockUI(),M("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(e){var t;M.datepicker._curInst&&(t=M(e.target),e=M.datepicker._getInst(t[0]),(t[0].id===M.datepicker._mainDivId||0!==t.parents("#"+M.datepicker._mainDivId).length||t.hasClass(M.datepicker.markerClassName)||t.closest("."+M.datepicker._triggerClass).length||!M.datepicker._datepickerShowing||M.datepicker._inDialog&&M.blockUI)&&(!t.hasClass(M.datepicker.markerClassName)||M.datepicker._curInst===e)||M.datepicker._hideDatepicker())},_adjustDate:function(e,t,a){var i=M(e),e=this._getInst(i[0]);this._isDisabledDatepicker(i[0])||(this._adjustInstDate(e,t+("M"===a?this._get(e,"showCurrentAtPos"):0),a),this._updateDatepicker(e))},_gotoToday:function(e){var t=M(e),a=this._getInst(t[0]);this._get(a,"gotoCurrent")&&a.currentDay?(a.selectedDay=a.currentDay,a.drawMonth=a.selectedMonth=a.currentMonth,a.drawYear=a.selectedYear=a.currentYear):(e=new Date,a.selectedDay=e.getDate(),a.drawMonth=a.selectedMonth=e.getMonth(),a.drawYear=a.selectedYear=e.getFullYear()),this._notifyChange(a),this._adjustDate(t)},_selectMonthYear:function(e,t,a){var i=M(e),e=this._getInst(i[0]);e["selected"+("M"===a?"Month":"Year")]=e["draw"+("M"===a?"Month":"Year")]=parseInt(t.options[t.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(i)},_selectDay:function(e,t,a,i){var s=M(e);M(i).hasClass(this._unselectableClass)||this._isDisabledDatepicker(s[0])||((s=this._getInst(s[0])).selectedDay=s.currentDay=M("a",i).html(),s.selectedMonth=s.currentMonth=t,s.selectedYear=s.currentYear=a,this._selectDate(e,this._formatDate(s,s.currentDay,s.currentMonth,s.currentYear)))},_clearDate:function(e){e=M(e);this._selectDate(e,"")},_selectDate:function(e,t){var a=M(e),e=this._getInst(a[0]);t=null!=t?t:this._formatDate(e),e.input&&e.input.val(t),this._updateAlternate(e),(a=this._get(e,"onSelect"))?a.apply(e.input?e.input[0]:null,[t,e]):e.input&&e.input.trigger("change"),e.inline?this._updateDatepicker(e):(this._hideDatepicker(),this._lastInput=e.input[0],"object"!=typeof e.input[0]&&e.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(e){var t,a,i=this._get(e,"altField");i&&(t=this._get(e,"altFormat")||this._get(e,"dateFormat"),a=this._getDate(e),e=this.formatDate(t,a,this._getFormatConfig(e)),M(i).val(e))}
vendor: 10,763 bytes, line 10326
10326,noWeekends:function(e){e=e.getDay();return[0<e&&e<6,""]},iso8601Week:function(e){var t=new Date(e.getTime());return t.setDate(t.getDate()+4-(t.getDay()||7)),e=t.getTime(),t.setMonth(0),t.setDate(1),Math.floor(Math.round((e-t)/864e5)/7)+1},parseDate:function(t,s,e){if(null==t||null==s)throw"Invalid arguments";if(""===(s="object"==typeof s?s.toString():s+""))return null;function r(e){return(e=v+1<t.length&&t.charAt(v+1)===e)&&v++,e}function a(e){var t=r(e),t="@"===e?14:"!"===e?20:"y"===e&&t?4:"o"===e?3:2,t=new RegExp("^\\d{"+("y"===e?t:1)+","+t+"}");if(!(t=s.substring(l).match(t)))throw"Missing number at position "+l;return l+=t[0].length,parseInt(t[0],10)}function i(e,t,a){var i=-1,t=M.map(r(e)?a:t,function(e,t){return[[t,e]]}).sort(function(e,t){return-(e[1].length-t[1].length)});if(M.each(t,function(e,t){var a=t[1];if(s.substr(l,a.length).toLowerCase()===a.toLowerCase())return i=t[0],l+=a.length,!1}),-1!==i)return i+1;throw"Unknown name at position "+l}function n(){if(s.charAt(l)!==t.charAt(v))throw"Unexpected literal at position "+l;l++}for(var d,o,c,l=0,h=(e?e.shortYearCutoff:null)||this._defaults.shortYearCutoff,h="string"!=typeof h?h:(new Date).getFullYear()%100+parseInt(h,10),u=(e?e.dayNamesShort:null)||this._defaults.dayNamesShort,p=(e?e.dayNames:null)||this._defaults.dayNames,g=(e?e.monthNamesShort:null)||this._defaults.monthNamesShort,_=(e?e.monthNames:null)||this._defaults.monthNames,f=-1,k=-1,D=-1,m=-1,y=!1,v=0;v<t.length;v++)if(y)"'"!==t.charAt(v)||r("'")?n():y=!1;else switch(t.charAt(v)){case"d":D=a("d");break;case"D":i("D",u,p);break;case"o":m=a("o");break;case"m":k=a("m");break;case"M":k=i("M",g,_);break;case"y":f=a("y");break;case"@":f=(c=new Date(a("@"))).getFullYear(),k=c.getMonth()+1,D=c.getDate();break;case"!":f=(c=new Date((a("!")-this._ticksTo1970)/1e4)).getFullYear(),k=c.getMonth()+1,D=c.getDate();break;case"'":r("'")?n():y=!0;break;default:n()}if(l<s.length&&(o=s.substr(l),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===f?f=(new Date).getFullYear():f<100&&(f+=(new Date).getFullYear()-(new Date).getFullYear()%100+(f<=h?0:-100)),-1<m)for(k=1,D=m;;){if(D<=(d=this._getDaysInMonth(f,k-1)))break;k++,D-=d}if((c=this._daylightSavingAdjust(new Date(f,k-1,D))).getFullYear()!==f||c.getMonth()+1!==k||c.getDate()!==D)throw"Invalid date";return c},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(t,e,a){if(!e)return"";function s(e){return(e=n+1<t.length&&t.charAt(n+1)===e)&&n++,e}function i(e,t,a){var i=""+t;if(s(e))for(;i.length<a;)i="0"+i;return i}function r(e,t,a,i){return(s(e)?i:a)[t]}var n,d=(a?a.dayNamesShort:null)||this._defaults.dayNamesShort,o=(a?a.dayNames:null)||this._defaults.dayNames,c=(a?a.monthNamesShort:null)||this._defaults.monthNamesShort,l=(a?a.monthNames:null)||this._defaults.monthNames,h="",u=!1;if(e)for(n=0;n<t.length;n++)if(u)"'"!==t.charAt(n)||s("'")?h+=t.charAt(n):u=!1;else switch(t.charAt(n)){case"d":h+=i("d",e.getDate(),2);break;case"D":h+=r("D",e.getDay(),d,o);break;case"o":h+=i("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":h+=i("m",e.getMonth()+1,2);break;case"M":h+=r("M",e.getMonth(),c,l);break;case"y":h+=s("y")?e.getFullYear():(e.getFullYear()%100<10?"0":"")+e.getFullYear()%100;break;case"@":h+=e.getTime();break;case"!":h+=1e4*e.getTime()+this._ticksTo1970;break;case"'":s("'")?h+="'":u=!0;break;default:h+=t.charAt(n)}return h},_possibleChars:function(t){function e(e){return(e=s+1<t.length&&t.charAt(s+1)===e)&&s++,e}for(var a="",i=!1,s=0;s<t.length;s++)if(i)"'"!==t.charAt(s)||e("'")?a+=t.charAt(s):i=!1;else switch(t.charAt(s)){case"d":case"m":case"y":case"@":a+="0123456789";break;case"D":case"M":return null;case"'":e("'")?a+="'":i=!0;break;default:a+=t.charAt(s)}return a},_get:function(e,t){return(void 0!==e.settings[t]?e.settings:this._defaults)[t]},_setDateFromField:function(e,t){if(e.input.val()!==e.lastVal){var a=this._get(e,"dateFormat"),i=e.lastVal=e.input?e.input.val():null,s=this._getDefaultDate(e),r=s,n=this._getFormatConfig(e);try{r=this.parseDate(a,i,n)||s}catch(e){i=t?"":i}e.selectedDay=r.getDate(),e.drawMonth=e.selectedMonth=r.getMonth(),e.drawYear=e.selectedYear=r.getFullYear(),e.currentDay=i?r.getDate():0,e.currentMonth=i?r.getMonth():0,e.currentYear=i?r.getFullYear():0,this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(d,e,t){var a,i,e=null==e||""===e?t:"string"==typeof e?function(e){try{return M.datepicker.parseDate(M.datepicker._get(d,"dateFormat"),e,M.datepicker._getFormatConfig(d))}catch(e){}for(var t=(e.toLowerCase().match(/^c/)?M.datepicker._getDate(d):null)||new Date,a=t.getFullYear(),i=t.getMonth(),s=t.getDate(),r=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,n=r.exec(e);n;){switch(n[2]||"d"){case"d":case"D":s+=parseInt(n[1],10);break;case"w":case"W":s+=7*parseInt(n[1],10);break;case"m":case"M":i+=parseInt(n[1],10),s=Math.min(s,M.datepicker._getDaysInMonth(a,i));break;case"y":case"Y":a+=parseInt(n[1],10),s=Math.min(s,M.datepicker._getDaysInMonth(a,i))}n=r.exec(e)}return new Date(a,i,s)}(e):"number"==typeof e?isNaN(e)?t:(a=e,(i=new Date).setDate(i.getDate()+a),i):new Date(e.getTime());return(e=e&&"Invalid Date"===e.toString()?t:e)&&(e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0)),this._daylightSavingAdjust(e)},_daylightSavingAdjust:function(e){return e?(e.setHours(12<e.getHours()?e.getHours()+2:0),e):null},_setDate:function(e,t,a){var i=!t,s=e.selectedMonth,r=e.selectedYear,t=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=t.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=t.getMonth(),e.drawYear=e.selectedYear=e.currentYear=t.getFullYear(),s===e.selectedMonth&&r===e.selectedYear||a||this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(i?"":this._formatDate(e))},_getDate:function(e){return!e.currentYear||e.input&&""===e.input.val()?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay))},_attachHandlers:function(e){var t=this._get(e,"stepMonths"),a="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){M.datepicker._adjustDate(a,-t,"M")},next:function(){M.datepicker._adjustDate(a,+t,"M")},hide:function(){M.datepicker._hideDatepicker()},today:function(){M.datepicker._gotoToday(a)},selectDay:function(){return M.datepicker._selectDay(a,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return M.datepicker._selectMonthYear(a,this,"M"),!1},selectYear:function(){return M.datepicker._selectMonthYear(a,this,"Y"),!1}};M(this).on(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t,a,i,s,r,n,d,o,c,l,h,u,p,g,_,f,k,D,m,y,v,M,b,w,C,I,x,Y,S,N,F,T=new Date,A=this._daylightSavingAdjust(new Date(T.getFullYear(),T.getMonth(),T.getDate())),K=this._get(e,"isRTL"),j=this._get(e,"showButtonPanel"),O=this._get(e,"hideIfNoPrevNext"),E=this._get(e,"navigationAsDateFormat"),R=this._getNumberOfMonths(e),P=this._get(e,"showCurrentAtPos"),T=this._get(e,"stepMonths"),L=1!==R[0]||1!==R[1],W=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),H=this._getMinMaxDate(e,"min"),U=this._getMinMaxDate(e,"max"),z=e.drawMonth-P,B=e.drawYear;if(z<0&&(z+=12,B--),U)for(t=this._daylightSavingAdjust(new Date(U.getFullYear(),U.getMonth()-R[0]*R[1]+1,U.getDate())),t=H&&t<H?H:t;this._daylightSavingAdjust(new Date(B,z,1))>t;)--z<0&&(z=11,B--);for(e.drawMonth=z,e.drawYear=B,P=this._get(e,"prevText"),P=E?this.formatDate(P,this._daylightSavingAdjust(new Date(B,z-T,1)),this._getFormatConfig(e)):P,a=this._canAdjustMonth(e,-1,B,z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+P+"'><span class='ui-icon ui-icon-circle-triangle-"+(K?"e":"w")+"'>"+P+"</span></a>":O?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+P+"'><span class='ui-icon ui-icon-circle-triangle-"+(K?"e":"w")+"'>"+P+"</span></a>",P=this._get(e,"nextText"),P=E?this.formatDate(P,this._daylightSavingAdjust(new Date(B,z+T,1)),this._getFormatConfig(e)):P,i=this._canAdjustMonth(e,1,B,z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+P+"'><span class='ui-icon ui-icon-circle-triangle-"+(K?"w":"e")+"'>"+P+"</span></a>":O?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+P+"'><span class='ui-icon ui-icon-circle-triangle-"+(K?"w":"e")+"'>"+P+"</span></a>",O=this._get(e,"currentText"),P=this._get(e,"gotoCurrent")&&e.currentDay?W:A,O=E?this.formatDate(O,P,this._getFormatConfig(e)):O,E=e.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(e,"closeText")+"</button>",E=j?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(K?E:"")+(this._isInRange(e,P)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+O+"</button>":"")+(K?"":E)+"</div>":"",s=parseInt(this._get(e,"firstDay"),10),s=isNaN(s)?0:s,r=this._get(e,"showWeek"),n=this._get(e,"dayNames"),d=this._get(e,"dayNamesMin"),o=this._get(e,"monthNames"),c=this._get(e,"monthNamesShort"),l=this._get(e,"beforeShowDay"),h=this._get(e,"showOtherMonths"),u=this._get(e,"selectOtherMonths"),p=this._getDefaultDate(e),g="",f=0;f<R[0];f++){for(k="",this.maxRows=4,D=0;D<R[1];D++){if(m=this._daylightSavingAdjust(new Date(B,z,e.selectedDay)),b=" ui-corner-all",y="",L){if(y+="<div class='ui-datepicker-group",1<R[1])switch(D){case 0:y+=" ui-datepicker-group-first",b=" ui-corner-"+(K?"right":"left");break;case R[1]-1:y+=" ui-datepicker-group-last",b=" ui-corner-"+(K?"left":"right");break;default:y+=" ui-datepicker-group-middle",b=""}y+="'>"}for(y+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+b+"'>"+(/all|left/.test(b)&&0===f?K?i:a:"")+(/all|right/.test(b)&&0===f?K?a:i:"")+this._generateMonthYearHeader(e,z,B,H,U,0<f||0<D,o,c)+"</div><table class='ui-datepicker-calendar'><thead><tr>",v=r?"<th class='ui-datepicker-week-col'>"+this._get(e,"weekHeader")+"</th>":"",_=0;_<7;_++)v+="<th scope='col'"+(5<=(_+s+6)%7?" class='ui-datepicker-week-end'":"")+"><span title='"+n[M=(_+s)%7]+"'>"+d[M]+"</span></th>";
vendor: 5,560 bytes, line 10326
10326for(y+=v+"</tr></thead><tbody>",w=this._getDaysInMonth(B,z),B===e.selectedYear&&z===e.selectedMonth&&(e.selectedDay=Math.min(e.selectedDay,w)),b=(this._getFirstDayOfMonth(B,z)-s+7)%7,w=Math.ceil((b+w)/7),C=L&&this.maxRows>w?this.maxRows:w,this.maxRows=C,I=this._daylightSavingAdjust(new Date(B,z,1-b)),x=0;x<C;x++){for(y+="<tr>",Y=r?"<td class='ui-datepicker-week-col'>"+this._get(e,"calculateWeek")(I)+"</td>":"",_=0;_<7;_++)S=l?l.apply(e.input?e.input[0]:null,[I]):[!0,""],F=(N=I.getMonth()!==z)&&!u||!S[0]||H&&I<H||U&&U<I,Y+="<td class='"+(5<=(_+s+6)%7?" ui-datepicker-week-end":"")+(N?" ui-datepicker-other-month":"")+(I.getTime()===m.getTime()&&z===e.selectedMonth&&e._keyEvent||p.getTime()===I.getTime()&&p.getTime()===m.getTime()?" "+this._dayOverClass:"")+(F?" "+this._unselectableClass+" ui-state-disabled":"")+(N&&!h?"":" "+S[1]+(I.getTime()===W.getTime()?" "+this._currentClass:"")+(I.getTime()===A.getTime()?" ui-datepicker-today":""))+"'"+(N&&!h||!S[2]?"":" title='"+S[2].replace(/'/g,"'")+"'")+(F?"":" data-handler='selectDay' data-event='click' data-month='"+I.getMonth()+"' data-year='"+I.getFullYear()+"'")+">"+(N&&!h?" ":F?"<span class='ui-state-default'>"+I.getDate()+"</span>":"<a class='ui-state-default"+(I.getTime()===A.getTime()?" ui-state-highlight":"")+(I.getTime()===W.getTime()?" ui-state-active":"")+(N?" ui-priority-secondary":"")+"' href='#'>"+I.getDate()+"</a>")+"</td>",I.setDate(I.getDate()+1),I=this._daylightSavingAdjust(I);y+=Y+"</tr>"}11<++z&&(z=0,B++),k+=y+="</tbody></table>"+(L?"</div>"+(0<R[0]&&D===R[1]-1?"<div class='ui-datepicker-row-break'></div>":""):"")}g+=k}return g+=E,e._keyEvent=!1,g},_generateMonthYearHeader:function(e,t,a,i,s,r,n,d){var o,c,l,h,u,p,g,_=this._get(e,"changeMonth"),f=this._get(e,"changeYear"),k=this._get(e,"showMonthAfterYear"),D="<div class='ui-datepicker-title'>",m="";if(r||!_)m+="<span class='ui-datepicker-month'>"+n[t]+"</span>";else{for(o=i&&i.getFullYear()===a,c=s&&s.getFullYear()===a,m+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",l=0;l<12;l++)(!o||l>=i.getMonth())&&(!c||l<=s.getMonth())&&(m+="<option value='"+l+"'"+(l===t?" selected='selected'":"")+">"+d[l]+"</option>");m+="</select>"}if(k||(D+=m+(!r&&_&&f?"":" ")),!e.yearshtml)if(e.yearshtml="",r||!f)D+="<span class='ui-datepicker-year'>"+a+"</span>";else{for(h=this._get(e,"yearRange").split(":"),u=(new Date).getFullYear(),p=(n=function(e){e=e.match(/c[+\-].*/)?a+parseInt(e.substring(1),10):e.match(/[+\-].*/)?u+parseInt(e,10):parseInt(e,10);return isNaN(e)?u:e})(h[0]),g=Math.max(p,n(h[1]||"")),p=i?Math.max(p,i.getFullYear()):p,g=s?Math.min(g,s.getFullYear()):g,e.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";p<=g;p++)e.yearshtml+="<option value='"+p+"'"+(p===a?" selected='selected'":"")+">"+p+"</option>";e.yearshtml+="</select>",D+=e.yearshtml,e.yearshtml=null}return D+=this._get(e,"yearSuffix"),k&&(D+=(!r&&_&&f?"":" ")+m),D+="</div>"},_adjustInstDate:function(e,t,a){var i=e.selectedYear+("Y"===a?t:0),s=e.selectedMonth+("M"===a?t:0),t=Math.min(e.selectedDay,this._getDaysInMonth(i,s))+("D"===a?t:0),t=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(i,s,t)));e.selectedDay=t.getDate(),e.drawMonth=e.selectedMonth=t.getMonth(),e.drawYear=e.selectedYear=t.getFullYear(),"M"!==a&&"Y"!==a||this._notifyChange(e)},_restrictMinMax:function(e,t){var a=this._getMinMaxDate(e,"min"),e=this._getMinMaxDate(e,"max"),t=a&&t<a?a:t;return e&&e<t?e:t},_notifyChange:function(e){var t=this._get(e,"onChangeMonthYear");t&&t.apply(e.input?e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){e=this._get(e,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(e,t){return this._determineDate(e,this._get(e,t+"Date"),null)},_getDaysInMonth:function(e,t){return 32-this._daylightSavingAdjust(new Date(e,t,32)).getDate()},_getFirstDayOfMonth:function(e,t){return new Date(e,t,1).getDay()},_canAdjustMonth:function(e,t,a,i){var s=this._getNumberOfMonths(e),s=this._daylightSavingAdjust(new Date(a,i+(t<0?t:s[0]*s[1]),1));return t<0&&s.setDate(this._getDaysInMonth(s.getFullYear(),s.getMonth())),this._isInRange(e,s)},_isInRange:function(e,t){var a=this._getMinMaxDate(e,"min"),i=this._getMinMaxDate(e,"max"),s=null,r=null,n=this._get(e,"yearRange");return n&&(e=n.split(":"),n=(new Date).getFullYear(),s=parseInt(e[0],10),r=parseInt(e[1],10),e[0].match(/[+\-].*/)&&(s+=n),e[1].match(/[+\-].*/)&&(r+=n)),(!a||t.getTime()>=a.getTime())&&(!i||t.getTime()<=i.getTime())&&(!s||t.getFullYear()>=s)&&(!r||t.getFullYear()<=r)},_getFormatConfig:function(e){var t=this._get(e,"shortYearCutoff");return{shortYearCutoff:t="string"!=typeof t?t:(new Date).getFullYear()%100+parseInt(t,10),dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,"dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,t,a,i){t||(e.currentDay=e.selectedDay,e.currentMonth=e.selectedMonth,e.currentYear=e.selectedYear);t=t?"object"==typeof t?t:this._daylightSavingAdjust(new Date(i,a,t)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),t,this._getFormatConfig(e))}}),M.fn.datepicker=function(e){if(!this.length)return this;M.datepicker.initialized||(M(document).on("mousedown",M.datepicker._checkExternalClick),M.datepicker.initialized=!0),0===M("#"+M.datepicker._mainDivId).length&&M("body").append(M.datepicker.dpDiv);
10326var t=Array.prototype.slice.call(arguments,1);return"string"==typeof e&&("isDisabled"===e||"getDate"===e||"widget"===e)||"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?M.datepicker["_"+e+"Datepicker"].apply(M.datepicker,[this[0]].concat(t)):this.each(function(){"string"==typeof e?M.datepicker["_"+e+"Datepicker"].apply(M.datepicker,[this].concat(t)):M.datepicker._attachDatepicker(this,e)})},M.datepicker=new e,M.datepicker.initialized=!1,M.datepicker.uuid=(new Date).getTime(),M.datepicker.version="1.12.1";M.datepicker}); 10327!function(e){if(!e.hasInitialised){var t={escapeRegExp:function(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},hasClass:function(e,t){var i=" ";return 1===e.nodeType&&(i+e.className+i).replace(/[\n\t]/g,i).indexOf(i+t+i)>=0},addClass:function(e,t){e.className+=" "+t},removeClass:function(e,t){var i=new RegExp("\\b"+this.escapeRegExp(t)+"\\b");e.className=e.className.replace(i,"")},interpolateString:function(e,t){var i=/{{([a-z][a-z0-9\-_]*)}}/gi;return e.replace(i,function(e){return t(arguments[1])||""})},getCookie:function(e){var t="; "+document.cookie,i=t.split("; "+e+"=");return 2!=i.length?void 0:i.pop().split(";").shift()}
10327,setCookie:function(e,t,i,n,o){var s=new Date;s.setDate(s.getDate()+(i||365));var r=[e+"="+t,"expires="+s.toUTCString(),"path="+(o||"/")];n&&r.push("domain="+n),document.cookie=r.join(";")},deepExtend:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(i in e&&this.isPlainObject(e[i])&&this.isPlainObject(t[i])?this.deepExtend(e[i],t[i]):e[i]=t[i]);return e},throttle:function(e,t){var i=!1;return function(){i||(e.apply(this,arguments),i=!0,setTimeout(function(){i=!1},t))}},hash:function(e){var t,i,n,o=0;if(0===e.length)return o;for(t=0,n=e.length;t<n;++t)i=e.charCodeAt(t),o=(o<<5)-o+i,o|=0;return o},normaliseHex:function(e){return"#"==e[0]&&(e=e.substr(1)),3==e.length&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),e},getContrast:function(e){e=this.normaliseHex(e);var t=parseInt(e.substr(0,2),16),i=parseInt(e.substr(2,2),16),n=parseInt(e.substr(4,2),16),o=(299*t+587*i+114*n)/1e3;return o>=128?"#000":"#fff"},getLuminance:function(e){var t=parseInt(this.normaliseHex(e),16),i=38,n=(t>>16)+i,o=(t>>8&255)+i,s=(255&t)+i,r=(16777216+65536*(n<255?n<1?0:n:255)+256*(o<255?o<1?0:o:255)+(s<255?s<1?0:s:255)).toString(16).slice(1);return"#"+r},isMobile:function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)},isPlainObject:function(e){return"object"==typeof e&&null!==e&&e.constructor==Object}};
10327e.status={deny:"deny",allow:"allow",dismiss:"dismiss"},e.transitionEnd=function(){var e=document.createElement("div"),t={t:"transitionend",OT:"oTransitionEnd",msT:"MSTransitionEnd",MozT:"transitionend",WebkitT:"webkitTransitionEnd"};for(var i in t)if(t.hasOwnProperty(i)&&"undefined"!=typeof e.style[i+"ransition"])return t[i];return""}(),e.hasTransition=!!e.transitionEnd;var i=Object.keys(e.status).map(t.escapeRegExp);e.customStyles={},e.Popup=function(){function n(){this.initialise.apply(this,arguments)}function o(e){this.openingTimeout=null,t.removeClass(e,"cc-invisible")}function s(t){t.style.display="none",t.removeEventListener(e.transitionEnd,this.afterTransition),this.afterTransition=null}function r(){var t=this.options.onInitialise.bind(this);if(!window.navigator.cookieEnabled)return t(e.status.deny),!0;if(window.CookiesOK||window.navigator.CookiesOK)return t(e.status.allow),!0;var i=Object.keys(e.status),n=this.getStatus(),o=i.indexOf(n)>=0;return o&&t(n),o}function a(){var e=this.options.position.split("-"),t=[];return e.forEach(function(e){t.push("cc-"+e)}),t}function c(){var e=this.options,i="top"==e.position||"bottom"==e.position?"banner":"floating";t.isMobile()&&(i="floating");var n=["cc-"+i,"cc-type-"+e.type,"cc-theme-"+e.theme];e["static"]&&n.push("cc-static"),n.push.apply(n,a.call(this));p.call(this,this.options.palette);return this.customStyleSelector&&n.push(this.customStyleSelector),n}function l(){var e={},i=this.options;i.showLink||(i.elements.link="",i.elements.messagelink=i.elements.message),Object.keys(i.elements).forEach(function(n){e[n]=t.interpolateString(i.elements[n],function(e){var t=i.content[e];return e&&"string"==typeof t&&t.length?t:""})});var n=i.compliance[i.type];n||(n=i.compliance.info),e.compliance=t.interpolateString(n,function(t){return e[t]});var o=i.layouts[i.layout];return o||(o=i.layouts.basic),t.interpolateString(o,function(t){return e[t]})}function u(i){var n=this.options,o=document.createElement("div"),s=n.container&&1===n.container.nodeType?n.container:document.body;o.innerHTML=i;var r=o.children[0];return r.style.display="none",t.hasClass(r,"cc-window")&&e.hasTransition&&t.addClass(r,"cc-invisible"),this.onButtonClick=h.bind(this),r.addEventListener("click",this.onButtonClick),n.autoAttach&&(s.firstChild?s.insertBefore(r,s.firstChild):s.appendChild(r)),r}function h(n){var o=n.target;if(t.hasClass(o,"cc-btn")){var s=o.className.match(new RegExp("\\bcc-("+i.join("|")+")\\b")),r=s&&s[1]||!1;r&&(this.setStatus(r),this.close(!0))}t.hasClass(o,"cc-close")&&(this.setStatus(e.status.dismiss),this.close(!0)),t.hasClass(o,"cc-revoke")&&this.revokeChoice()}function p(e){var i=t.hash(JSON.stringify(e)),n="cc-color-override-"+i,o=t.isPlainObject(e);return this.customStyleSelector=o?n:null,o&&d(i,e,"."+n),o}function d(i,n,o){if(e.customStyles[i])return void++e.customStyles[i].references;var s={},r=n.popup,a=n.button,c=n.highlight;r&&(r.text=r.text?r.text:t.getContrast(r.background),r.link=r.link?r.link:r.text,s[o+".cc-window"]=["color: "+r.text,"background-color: "+r.background],s[o+".cc-revoke"]=["color: "+r.text,"background-color: "+r.background],s[o+" .cc-link,"+o+" .cc-link:active,"+o+" .cc-link:visited"]=["color: "+r.link],a&&(a.text=a.text?a.text:t.getContrast(a.background),a.border=a.border?a.border:"transparent",s[o+" .cc-btn"]=["color: "+a.text,"border-color: "+a.border,"background-color: "+a.background],"transparent"!=a.background&&(s[o+" .cc-btn:hover, "+o+" .cc-btn:focus"]=["background-color: "+v(a.background)]),c?(c.text=c.text?c.text:t.getContrast(c.background),c.border=c.border?c.border:"transparent",s[o+" .cc-highlight .cc-btn:first-child"]=["color: "+c.text,"border-color: "+c.border,"background-color: "+c.background]):s[o+" .cc-highlight .cc-btn:first-child"]=["color: "+r.text]));var l=document.createElement("style");document.head.appendChild(l),e.customStyles[i]={references:1,element:l.sheet};var u=-1;for(var h in s)s.hasOwnProperty(h)&&l.sheet.insertRule(h+"{"+s[h].join(";")+"}",++u)}function v(e){return e=t.normaliseHex(e),"000000"==e?"#222":t.getLuminance(e)}function f(i){if(t.isPlainObject(i)){var n=t.hash(JSON.stringify(i)),o=e.customStyles[n];if(o&&!--o.references){var s=o.element.ownerNode;s&&s.parentNode&&s.parentNode.removeChild(s),e.customStyles[n]=null}}}function m(e,t){for(var i=0,n=e.length;i<n;++i){var o=e[i];if(o instanceof RegExp&&o.test(t)||"string"==typeof o&&o.length&&o===t)return!0}return!1}function b(){var t=this.setStatus.bind(this),i=this.options.dismissOnTimeout;"number"==typeof i&&i>
10327=0&&(this.dismissTimeout=window.setTimeout(function(){t(e.status.dismiss)},Math.floor(i)));var n=this.options.dismissOnScroll;if("number"==typeof n&&n>=0){var o=function(i){window.pageYOffset>Math.floor(n)&&(t(e.status.dismiss),window.removeEventListener("scroll",o),this.onWindowScroll=null)};this.onWindowScroll=o,window.addEventListener("scroll",o)}}function y(){if("info"!=this.options.type&&(this.options.revokable=!0),t.isMobile()&&(this.options.animateRevokable=!1),this.options.revokable){var e=a.call(this);this.options.animateRevokable&&e.push("cc-animate"),this.customStyleSelector&&e.push(this.customStyleSelector);var i=this.options.revokeBtn.replace("{{classes}}",e.join(" "));this.revokeBtn=u.call(this,i);var n=this.revokeBtn;if(this.options.animateRevokable){var o=t.throttle(function(e){var i=!1,o=20,s=window.innerHeight-20;t.hasClass(n,"cc-top")&&e.clientY<o&&(i=!0),t.hasClass(n,"cc-bottom")&&e.clientY>s&&(i=!0),i?t.hasClass(n,"cc-active")||t.addClass(n,"cc-active"):t.hasClass(n,"cc-active")&&t.removeClass(n,"cc-active")},200);this.onMouseMove=o,window.addEventListener("mousemove",o)}}}var g={enabled:!0,container:null,cookie:{name:"cookieconsent_status",path:"/",domain:"",expiryDays:365},onPopupOpen:function(){},onPopupClose:function(){},onInitialise:function(e){},onStatusChange:function(e,t){},onRevokeChoice:function(){},content:{header:"Cookies used on the website!",message:"This website uses cookies to ensure you get the best experience on our website.",dismiss:"Got it!",allow:"Allow cookies",deny:"Decline",link:"Learn more",href:"http://cookie
10327sandyou.com",close:"❌"},elements:{header:'<span class="cc-header">{{header}}</span> ',message:'<span id="cookieconsent:desc" class="cc-message">{{message}}</span>',messagelink:'<span id="cookieconsent:desc" class="cc-message">{{message}} <a aria-label="learn more about cookies" role=button tabindex="0" class="cc-link" href="{{href}}" target="_blank">{{link}}</a></span>',dismiss:'<a aria-label="dismiss cookie message" role=button tabindex="0" class="cc-btn cc-dismiss">{{dismiss}}</a>',allow:'<a aria-label="allow cookies" role=button tabindex="0" class="cc-btn cc-allow">{{allow}}</a>',deny:'<a aria-label="deny cookies" role=button tabindex="0" class="cc-btn cc-deny">{{deny}}</a>',link:'<a aria-label="learn more about cookies" role=button tabindex="0" class="cc-link" href="{{href}}" target="_blank">{{link}}</a>',close:'<span aria-label="dismiss cookie message" role=button tabindex="0" class="cc-close">{{close}}</span>'},window:'<div role="dialog" aria-live="polite" aria-label="cookieconsent" aria-describedby="cookieconsent:desc" class="cc-window {{classes}}"><!--googleoff: all-->{{children}}<!--googleon: all--></div>',revokeBtn:'<div class="cc-revoke {{classes}}">Cookie Policy</div>',compliance:{info:'<div class="cc-compliance">{{dismiss}}</div>',"opt-in":'<div class="cc-compliance cc-highlight">{{dismiss}}{{allow}}</div>',"opt-out":'<div class="cc-compliance cc-highlight">{{deny}}{{dismiss}}</div>'},type:"info",layouts:{basic:"{{messagelink}}{{compliance}}","basic-close":"{{messagelink}}{{compliance}}{{close}}","basic-header":"{{header}}{{message}}{{link}}{{compliance}}"},layout:"basic",position:"bottom",theme:"block","static":!1,palette:null,revokable:!1,animateRevokable:!0,showLink:!0,dismissOnScroll:!1,dismissOnTimeout:!1,autoOpen:!0,autoAttach:!0,whitelistPage:[],blacklistPage:[],overrideHTML:null};return n.prototype.initialise=function(e){this.options&&this.destroy(),t.deepExtend(this.options={},g),t.isPlainObject(e)&&t.deepExtend(this.options,e),r.call(this)&&(this.options.enabled=!1),m(this.options.blacklistPage,location.pathname)&&(this.options.enabled=!1),m(this.options.whitelistPage,location.pathname)&&(this.options.enabled=!0);var i=this.options.window.replace("{{classes}}",c.call(this).join(" ")).replace("{{children}}",l.call(this)),n=this.options.overrideHTML;if("string"==typeof n&&n.length&&(i=n),this.options["static"]){var o=u.call(this,'<div class="cc-grower">'+i+"</div>");o.style.display="",this.element=o.firstChild,this.element.style.display="none",t.addClass(this.element,"cc-invisible")}else this.element=u.call(this,i);b.call(this),y.call(this),this.options.autoOpen&&this.autoOpen()},n.prototype.destroy=function(){this.onButtonClick&&this.element&&(this.element.removeEventListener("click",this.onButtonClick),this.onButtonClick=null),this.dismissTimeout&&(clearTimeout(this.dismissTimeout),this.dismissTimeout=null),this.onWindowScroll&&(window.removeEventListener("scroll",this.onWindowScroll),this.onWindowScroll=null),this.onMouseMove&&(window.removeEventListener("mousemove",this.onMouseMove),this.onMouseMove=null),this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null,this.revokeBtn&&this.revokeBtn.parentNode&&this.revokeBtn.parentNode.removeChild(this.revokeBtn),this.revokeBtn=null,f(this.options.palette),this.options=null},n.prototype.open=function(t){if(this.element)return this.isOpen()||(e.hasTransition?this.fadeIn():this.element.style.display="",this.options.revokable&&this.toggleRevokeButton(),this.options.onPopupOpen.call(this)),this},n.prototype.close=function(t){if(this.element)return this.isOpen()&&(e.hasTransition?this.fadeOut():this.element.style.display="none",t&&this.options.revokable&&this.toggleRevokeButton(!0),this.options.onPopupClose.call(this)),this},n.prototype.fadeIn=function(){var i=this.element;if(e.hasTransition&&i&&(this.afterTransition&&s.call(this,i),t.hasClass(i,"cc-invisible"))){if(i.style.display="",this.options["static"]){var n=this.element.clientHeight;this.element.parentNode.style.maxHeight=n+"px"}var r=20;this.openingTimeout=setTimeout(o.bind(this,i),r)}},n.prototype.fadeOut=function(){var i=this.element;e.hasTransition&&i&&(this.openingTimeout&&(clearTimeout(this.openingTimeout),o.bind(this,i)),t.hasClass(i,"cc-invisible")||(this.options["static"]&&(this.element.parentNode.style.maxHeight=""),this.afterTransition=s.bind(this,i),i.addEventListener(e.transitionEnd,this.afterTransition),t.addClass(i,"cc-invisible")))},n.prototype.isOpen=function(){return this.element&&""==this.element.style.display&&(!e.hasTransition||!t.hasClass(this.element,"cc-invisible"))},n.prototype.toggleRevokeButton=function(e){this.revokeBtn&&(this.revokeBtn.style.display=e?"":"none")},n.prototype.revokeChoice=function(e){this.options.enabled=!0,this.clearStatus(),this.options.onRevokeChoice.call(this),e||this.autoOpen()},n.prototype.hasAnswered=function(t){return Object.keys(e.status).indexOf(this.getStatus())>=0}
vendor: 4,979 bytes, line 10327
10327,n.prototype.hasConsented=function(t){var i=this.getStatus();return i==e.status.allow||i==e.status.dismiss},n.prototype.autoOpen=function(e){!this.hasAnswered()&&this.options.enabled&&this.open()},n.prototype.setStatus=function(i){var n=this.options.cookie,o=t.getCookie(n.name),s=Object.keys(e.status).indexOf(o)>=0;Object.keys(e.status).indexOf(i)>=0?(t.setCookie(n.name,i,n.expiryDays,n.domain,n.path),this.options.onStatusChange.call(this,i,s)):this.clearStatus()},n.prototype.getStatus=function(){return t.getCookie(this.options.cookie.name)},n.prototype.clearStatus=function(){var e=this.options.cookie;t.setCookie(e.name,"",-1,e.domain,e.path)},n}(),e.Location=function(){function e(e){t.deepExtend(this.options={},s),t.isPlainObject(e)&&t.deepExtend(this.options,e),this.currentServiceIndex=-1}function i(e,t,i){var n,o=document.createElement("script");o.type="text/"+(e.type||"javascript"),o.src=e.src||e,o.async=!1,o.onreadystatechange=o.onload=function(){var e=o.readyState;clearTimeout(n),t.done||e&&!/loaded|complete/.test(e)||(t.done=!0,t(),o.onreadystatechange=o.onload=null)},document.body.appendChild(o),n=setTimeout(function(){t.done=!0,t(),o.onreadystatechange=o.onload=null},i)}function n(e,t,i,n,o){var s=new(window.XMLHttpRequest||window.ActiveXObject)("MSXML2.XMLHTTP.3.0");if(s.open(n?"POST":"GET",e,1),s.setRequestHeader("X-Requested-With","XMLHttpRequest"),s.setRequestHeader("Content-type","application/x-www-form-urlencoded"),Array.isArray(o))for(var r=0,a=o.length;r<a;++r){var c=o[r].split(":",2);s.setRequestHeader(c[0].replace(/^\s+|\s+$/g,""),c[1].replace(/^\s+|\s+$/g,""))}"function"==typeof t&&(s.onreadystatechange=function(){s.readyState>3&&t(s)}),s.send(n)}function o(e){return new Error("Error ["+(e.code||"UNKNOWN")+"]: "+e.error)}var s={timeout:5e3,services:["freegeoip","ipinfo","maxmind"],serviceDefinitions:{freegeoip:function(){return{url:"//freegeoip.net/json/?callback={callback}",isScript:!0,callback:function(e,t){try{var i=JSON.parse(t);return i.error?o(i):{code:i.country_code}}catch(n){return o({error:"Invalid response ("+n+")"})}}}},ipinfo:function(){return{url:"//ipinfo.io",headers:["Accept: application/json"],callback:function(e,t){try{var i=JSON.parse(t);return i.error?o(i):{code:i.country}}catch(n){return o({error:"Invalid response ("+n+")"})}}}},ipinfodb:function(e){return{url:"//api.ipinfodb.com/v3/ip-country/?key={api_key}&format=json&callback={callback}",isScript:!0,callback:function(e,t){try{var i=JSON.parse(t);return"ERROR"==i.statusCode?o({error:i.statusMessage}):{code:i.countryCode}}catch(n){return o({error:"Invalid response ("+n+")"})}}}},maxmind:function(){return{url:"//js.maxmind.com/js/apis/geoip2/v2.1/geoip2.js",isScript:!0,callback:function(e){return window.geoip2?void geoip2.country(function(t){try{e({code:t.country.iso_code})}catch(i){e(o(i))}},function(t){e(o(t))}):void e(new Error("Unexpected response format. The downloaded script should have exported `geoip2` to the global scope"))}}}}};return e.prototype.getNextService=function(){var e;do e=this.getServiceByIdx(++this.currentServiceIndex);while(this.currentServiceIndex<this.options.services.length&&!e);return e},e.prototype.getServiceByIdx=function(e){var i=this.options.services[e];if("function"==typeof i){var n=i();return n.name&&t.deepExtend(n,this.options.serviceDefinitions[n.name](n)),n}return"string"==typeof i?this.options.serviceDefinitions[i]():t.isPlainObject(i)?this.options.serviceDefinitions[i.name](i):null},e.prototype.locate=function(e,t){var i=this.getNextService();return i?(this.callbackComplete=e,this.callbackError=t,void this.runService(i,this.runNextServiceOnError.bind(this))):void t(new Error("No services to run"))},e.prototype.setupUrl=function(e){var t=this.getCurrentServiceOpts();return e.url.replace(/\{(.*?)\}/g,function(i,n){if("callback"===n){var o="callback"+Date.now();return window[o]=function(t){e.__JSONP_DATA=JSON.stringify(t)},o}if(n in t.interpolateUrl)return t.interpolateUrl[n]})},e.prototype.runService=function(e,t){var o=this;if(e&&e.url&&e.callback){var s=e.isScript?i:n,r=this.setupUrl(e);s(r,function(i){var n=i?i.responseText:"";e.__JSONP_DATA&&(n=e.__JSONP_DATA,delete e.__JSONP_DATA),o.runServiceCallback.call(o,t,e,n)},this.options.timeout,e.data,e.headers)}},e.prototype.runServiceCallback=function(e,t,i){var n=this,o=function(t){s||n.onServiceResult.call(n,e,t)},s=t.callback(o,i);s&&this.onServiceResult.call(this,e,s)},e.prototype.onServiceResult=function(e,t){t instanceof Error||t&&t.error?e.call(this,t,null):e.call(this,null,t)},e.prototype.runNextServiceOnError=function(e,t){if(e){this.logError(e);var i=this.getNextService();i?this.runService(i,this.runNextServiceOnError.bind(this)):this.completeService.call(this,this.callbackError,new Error("All services failed"))}else this.completeService.call(this,this.callbackComplete,t)},e.prototype.getCurrentServiceOpts=function(){var e=this.options.services[this.currentServiceIndex];return"string"==typeof e?{name:e}
10327:"function"==typeof e?e():t.isPlainObject(e)?e:{}},e.prototype.completeService=function(e,t){this.currentServiceIndex=-1,e&&e(t)},e.prototype.logError=function(e){var t=this.currentServiceIndex,i=this.getServiceByIdx(t);console.error("The service["+t+"] ("+i.url+") responded with the following error",e)},e}(),e.Law=function(){function e(e){this.initialise.apply(this,arguments)}var i={regionalLaw:!0,hasLaw:["AT","BE","BG","HR","CZ","CY","DK","EE","FI","FR","DE","EL","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","SK","SI","ES","SE","GB","UK"],revokable:["HR","CY","DK","EE","FR","DE","LV","LT","NL","PT","ES"],explicitAction:["HR","IT","ES"]};return e.prototype.initialise=function(e){t.deepExtend(this.options={},i),t.isPlainObject(e)&&t.deepExtend(this.options,e)},e.prototype.get=function(e){var t=this.options;return{hasLaw:t.hasLaw.indexOf(e)>=0,revokable:t.revokable.indexOf(e)>=0,explicitAction:t.explicitAction.indexOf(e)>=0}},e.prototype.applyLaw=function(e,t){var i=this.get(t);return i.hasLaw||(e.enabled=!1),this.options.regionalLaw&&(i.revokable&&(e.revokable=!0),i.explicitAction&&(e.dismissOnScroll=!1,e.dismissOnTimeout=!1)),e},e}(),e.initialise=function(t,i,n){var o=new e.Law(t.law);i||(i=function(){}),n||(n=function(){}),e.getCountryCode(t,function(n){delete t.law,delete t.location,n.code&&(t=o.applyLaw(t,n.code)),i(new e.Popup(t))},function(i){delete t.law,delete t.location,n(i,new e.Popup(t))})},e.getCountryCode=function(t,i,n){if(t.law&&t.law.countryCode)return void i({code:t.law.countryCode});if(t.location){var o=new e.Location(t.location);return void o.locate(function(e){i(e||{})},n)}i({})},e.utils=t,e.hasInitialised=!0,window.cookieconsent=e}}(window.cookieconsent||{});
vendor: 18,323 bytes, lines 10328-10333
10328/*! Hammer.JS - v2.0.4 - 2014-09-28 10329 * http://hammerjs.github.io/ 10330 * 10331 * Copyright (c) 2014 Jorik Tangelder; 10332 * Licensed under the MIT license */ 10333!function(a,b,c,d){"use strict";function e(a,b,c){return setTimeout(k(a,c),b)}function f(a,b,c){return Array.isArray(a)?(g(a,c[b],c),!0):!1}function g(a,b,c){var e;if(a)if(a.forEach)a.forEach(b,c);else if(a.length!==d)for(e=0;e<a.length;)b.call(c,a[e],e,a),e++;else for(e in a)a.hasOwnProperty(e)&&b.call(c,a[e],e,a)}function h(a,b,c){for(var e=Object.keys(b),f=0;f<e.length;)(!c||c&&a[e[f]]===d)&&(a[e[f]]=b[e[f]]),f++;return a}function i(a,b){return h(a,b,!0)}function j(a,b,c){var d,e=b.prototype;d=a.prototype=Object.create(e),d.constructor=a,d._super=e,c&&h(d,c)}function k(a,b){return function(){return a.apply(b,arguments)}}function l(a,b){return typeof a==kb?a.apply(b?b[0]||d:d,b):a}function m(a,b){return a===d?b:a}function n(a,b,c){g(r(b),function(b){a.addEventListener(b,c,!1)})}function o(a,b,c){g(r(b),function(b){a.removeEventListener(b,c,!1)})}function p(a,b){for(;a;){if(a==b)return!0;a=a.parentNode}return!1}function q(a,b){return a.indexOf(b)>-1}function r(a){return a.trim().split(/\s+/g)}function s(a,b,c){if(a.indexOf&&!c)return a.indexOf(b);for(var d=0;d<a.length;){if(c&&a[d][c]==b||!c&&a[d]===b)return d;d++}return-1}function t(a){return Array.prototype.slice.call(a,0)}function u(a,b,c){for(var d=[],e=[],f=0;f<a.length;){var g=b?a[f][b]:a[f];s(e,g)<0&&d.push(a[f]),e[f]=g,f++}return c&&(d=b?d.sort(function(a,c){return a[b]>c[b]}):d.sort()),d}function v(a,b){for(var c,e,f=b[0].toUpperCase()+b.slice(1),g=0;g<ib.length;){if(c=ib[g],e=c?c+f:b,e in a)return e;g++}return d}function w(){return ob++}function x(a){var b=a.ownerDocument;return b.defaultView||b.parentWindow}function y(a,b){var c=this;this.manager=a,this.callback=b,this.element=a.element,this.target=a.options.inputTarget,this.domHandler=function(b){l(a.options.enable,[a])&&c.handler(b)},this.init()}function z(a){var b,c=a.options.inputClass;return new(b=c?c:rb?N:sb?Q:qb?S:M)(a,A)}function A(a,b,c){var d=c.pointers.length,e=c.changedPointers.length,f=b&yb&&d-e===0,g=b&(Ab|Bb)&&d-e===0;c.isFirst=!!f,c.isFinal=!!g,f&&(a.session={}),c.eventType=b,B(a,c),a.emit("hammer.input",c),a.recognize(c),a.session.prevInput=c}function B(a,b){var c=a.session,d=b.pointers,e=d.length;c.firstInput||(c.firstInput=E(b)),e>1&&!c.firstMultiple?c.firstMultiple=E(b):1===e&&(c.firstMultiple=!1);var f=c.firstInput,g=c.firstMultiple,h=g?g.center:f.center,i=b.center=F(d);b.timeStamp=nb(),b.deltaTime=b.timeStamp-f.timeStamp,b.angle=J(h,i),b.distance=I(h,i),C(c,b),b.offsetDirection=H(b.deltaX,b.deltaY),b.scale=g?L(g.pointers,d):1,b.rotation=g?K(g.pointers,d):0,D(c,b);var j=a.element;p(b.srcEvent.target,j)&&(j=b.srcEvent.target),b.target=j}function C(a,b){var c=b.center,d=a.offsetDelta||{},e=a.prevDelta||{},f=a.prevInput||{};(b.eventType===yb||f.eventType===Ab)&&(e=a.prevDelta={x:f.deltaX||0,y:f.deltaY||0},d=a.offsetDelta={x:c.x,y:c.y}),b.deltaX=e.x+(c.x-d.x),b.deltaY=e.y+(c.y-d.y)}function D(a,b){var c,e,f,g,h=a.lastInterval||b,i=b.timeStamp-h.timeStamp;if(b.eventType!=Bb&&(i>xb||h.velocity===d)){var j=h.deltaX-b.deltaX,k=h.deltaY-b.deltaY,l=G(i,j,k);e=l.x,f=l.y,c=mb(l.x)>mb(l.y)?l.x:l.y,g=H(j,k),a.lastInterval=b}else c=h.velocity,e=h.velocityX,f=h.velocityY,g=h.direction;b.velocity=c,b.velocityX=e,b.velocityY=f,b.direction=g}function E(a){for(var b=[],c=0;c<a.pointers.length;)b[c]={clientX:lb(a.pointers[c].clientX),clientY:lb(a.pointers[c].clientY)},c++;return{timeStamp:nb(),pointers:b,center:F(b),deltaX:a.deltaX,deltaY:a.deltaY}}function F(a){var b=a.length;if(1===b)return{x:lb(a[0].clientX),y:lb(a[0].clientY)};for(var c=0,d=0,e=0;b>e;)c+=a[e].clientX,d+=a[e].clientY,e++;return{x:lb(c/b),y:lb(d/b)}}function G(a,b,c){return{x:b/a||0,y:c/a||0}}function H(a,b){return a===b?Cb:mb(a)>=mb(b)?a>0?Db:Eb:b>0?Fb:Gb}function I(a,b,c){c||(c=Kb);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return Math.sqrt(d*d+e*e)}function J(a,b,c){c||(c=Kb);var d=b[c[0]]-a[c[0]],e=b[c[1]]-a[c[1]];return 180*Math.atan2(e,d)/Math.PI}function K(a,b){return J(b[1],b[0],Lb)-J(a[1],a[0],Lb)}function L(a,b){return I(b[0],b[1],Lb)/I(a[0],a[1],Lb)}function M(){this.evEl=Nb,this.evWin=Ob,this.allow=!0,this.pressed=!1,y.apply(this,arguments)}function N(){this.evEl=Rb,this.evWin=Sb,y.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function O(){this.evTarget=Ub,this.evWin=Vb,this.started=!1,y.apply(this,arguments)}function P(a,b){var c=t(a.touches),d=t(a.changedTouches);return b&(Ab|Bb)&&(c=u(c.concat(d),"identifier",!0)),[c,d]}function Q(){this.evTarget=Xb,this.targetIds={},y.apply(this,arguments)}function R(a,b){var c=t(a.touches),d=this.targetIds;if(b&(yb|zb)&&1===c.length)return d[c[0].identifier]=!0,[c,c];var e,f,g=t(a.changedTouches),h=[],i=this.target;if(f=c.filter(function(a){return p(a.target,i)}),b===yb)for(e=0;e<f.length;)d[f[e].identifier]=!0,e++;for(e=0;e<g.length;)d[g[e].identifier]&&h.push(g[e]),b&(Ab|Bb)&&delete d[g[e].identifier],e++;return h.length?[u(f.concat(h),"identifier",!0),h]:void 0}function S(){y.apply(this,arguments);var a=k(this.handler,this);this.touch=new Q(this.manager,a),this.mouse=new M(this.manager,a)}function T(a,b){this.manager=a,this.set(b)}function U(a){if(q(a,bc))return bc;var b=q(a,cc),c=q(a,dc);return b&&c?cc+" "+dc:b||c?b?cc:dc:q(a,ac)?ac:_b}function V(a){this.id=w(),this.manager=null,this.options=i(a||{},this.defaults),this.options.enable=m(this.options.enable,!0),this.state=ec,this.simultaneous={},this.requireFail=[]}function W(a){return a&jc?"cancel":a&hc?"end":a&gc?"move":a&fc?"start":""}function X(a){return a==Gb?"down":a==Fb?"up":a==Db?"left":a==Eb?"right":""}function Y(a,b){var c=b.manager;return c?c.get(a):a}function Z(){V.apply(this,arguments)}function $(){Z.apply(this,arguments),this.pX=null,this.pY=null}function _(){Z.apply(this,arguments)}function ab(){V.apply(this,arguments),this._timer=null,this._input=null}function bb(){Z.apply(this,arguments)}function cb(){Z.apply(this,arguments)}function db(){V.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function eb(a,b){return b=b||{},b.recognizers=m(b.recognizers,eb.defaults.preset),new fb(a,b)}function fb(a,b){b=b||{},this.options=i(b,eb.defaults),this.options.inputTarget=this.options.inputTarget||a,this.handlers={},this.session={},this.recognizers=[],this.element=a,this.input=z(this),this.touchAction=new T(this,this.options.touchAction),gb(this,!0),g(b.recognizers,function(a){var b=this.add(new a[0](a[1]));a[2]&&b.recognizeWith(a[2]),a[3]&&b.requireFailure(a[3])},this)}function gb(a,b){var c=a.element;g(a.options.cssProps,function(a,d){c.style[v(c.style,d)]=b?a:""})}function hb(a,c){var d=b.createEvent("Event");d.initEvent(a,!0,!0),d.gesture=c,c.target.dispatchEvent(d)}var ib=["","webkit","moz","MS","ms","o"],jb=b.createElement("div"),kb="function",lb=Math.round,mb=Math.abs,nb=Date.now,ob=1,pb=/mobile|tablet|ip(ad|hone|od)|android/i,qb="ontouchstart"in a,rb=v(a,"PointerEvent")!==d,sb=qb&&pb.test(navigator.userAgent),tb="touch",ub="pen",vb="mouse",wb="kinect",xb=25,yb=1,zb=2,Ab=4,Bb=8,Cb=1,Db=2,Eb=4,Fb=8,Gb=16,Hb=Db|Eb,Ib=Fb|Gb,Jb=Hb|Ib,Kb=["x","y"],Lb=["clientX","clientY"];y.prototype={handler:function(){},init:function(){this.evEl&&n(this.element,this.evEl,this.domHandler),this.evTarget&&n(this.target,this.evTarget,this.domHandler),this.evWin&&n(x(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&o(this.element,this.evEl,this.domHandler),this.evTarget&&o(this.target,this.evTarget,this.domHandler),this.evWin&&o(x(this.element),this.evWin,this.domHandler)}};var Mb={mousedown:yb,mousemove:zb,mouseup:Ab},Nb="mousedown",Ob="mousemove mouseup";j(M,y,{handler:function(a){var b=Mb[a.type];b&yb&&0===a.button&&(this.pressed=!0),b&zb&&1!==a.which&&(b=Ab),this.pressed&&this.allow&&(b&Ab&&(this.pressed=!1),this.callback(this.manager,b,{pointers:[a],changedPointers:[a],pointerType:vb,srcEvent:a}))}});var Pb={pointerdown:yb,pointermove:zb,pointerup:Ab,pointercancel:Bb,pointerout:Bb},Qb={2:tb,3:ub,4:vb,5:wb},Rb="pointerdown",Sb="pointermove pointerup pointercancel";a.MSPointerEvent&&(Rb="MSPointerDown",Sb="MSPointerMove MSPointerUp MSPointerCancel"),j(N,y,{handler:function(a){var b=this.store,c=!1,d=a.type.toLowerCase().replace("ms",""),e=Pb[d],f=Qb[a.pointerType]||a.pointerType,g=f==tb,h=s(b,a.pointerId,"pointerId");e&yb&&(0===a.button||g)?0>h&&(b.push(a),h=b.length-1):e&(Ab|Bb)&&(c=!0),0>h||(b[h]=a,this.callback(this.manager,e,{pointers:b,changedPointers:[a],pointerType:f,srcEvent:a}),c&&b.splice(h,1))}});var Tb={touchstart:yb,touchmove:zb,touchend:Ab,touchcancel:Bb},Ub="touchstart",Vb="touchstart touchmove touchend touchcancel";j(O,y,{handler:function(a){var b=Tb[a.type];if(b===yb&&(this.started=!0),this.started){var c=P.call(this,a,b);b&(Ab|Bb)&&c[0].length-c[1].length===0&&(this.started=!1),this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:tb,srcEvent:a})}}});var Wb={touchstart:yb,touchmove:zb,touchend:Ab,touchcancel:Bb},Xb="touchstart touchmove touchend touchcancel";j(Q,y,{handler:function(a){var b=Wb[a.type],c=R.call(this,a,b);c&&this.callback(this.manager,b,{pointers:c[0],changedPointers:c[1],pointerType:tb,srcEvent:a})}}),j(S,y,{handler:function(a,b,c){var d=c.pointerType==tb,e=c.pointerType==vb;if(d)this.mouse.allow=!1;else if(e&&!this.mouse.allow)return;b&(Ab|Bb)&&(this.mouse.allow=!0),this.callback(a,b,c)},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var Yb=v(jb.style,"touchAction"),Zb=Yb!==d,$b="compute",_b="auto",ac="manipulation",bc="none",cc="pan-x",dc="pan-y";T.prototype={set:function(a){a==$b&&(a=this.compute()),Zb&&(this.manager.element.style[Yb]=a),this.actions=a.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var a=[];return g(this.manager.recognizers,function(b){l(b.options.enable,[b])&&(a=a.concat(b.getTouchAction()))}),U(a.join(" "))},preventDefaults:function(a){if(!Zb){var b=a.srcEvent,c=a.offsetDirection;if(this.manager.session.prevented)return void b.preventDefault();var d=this.actions,e=q(d,bc),f=q(d,dc),g=q(d,cc);return e||f&&c&Hb||g&&c&Ib?this.preventSrc(b):void 0}},preventSrc:function(a){this.manager.session.prevented=!0,a.preventDefault()}};var ec=1,fc=2,gc=4,hc=8,ic=hc,jc=16,kc=32;V.prototype={defaults:{},set:function(a){return h(this.options,a),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(a){if(f(a,"recognizeWith",this))return this;var b=this.simultaneous;return a=Y(a,this),b[a.id]||(b[a.id]=a,a.recognizeWith(this)),this},dropRecognizeWith:function(a){return f(a,"dropRecognizeWith",this)?this:(a=Y(a,this),delete this.simultaneous[a.id],this)},requireFailure:function(a){if(f(a,"requireFailure",this))return this;var b=this.requireFail;return a=Y(a,this),-1===s(b,a)&&(b.push(a),a.requireFailure(this)),this},dropRequireFailure:function(a){if(f(a,"dropRequireFailure",this))return this;a=Y(a,this);var b=s(this.requireFail,a);return b>-1&&this.requireFail.splice(b,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(a){return!!this.simultaneous[a.id]},emit:function(a){function b(b){c.manager.emit(c.options.event+(b?W(d):""),a)}var c=this,d=this.state;hc>d&&b(!0),b(),d>=hc&&b(!0)},tryEmit:function(a){return this.canEmit()?this.emit(a):void(this.state=kc)},canEmit:function(){for(var a=0;a<this.requireFail.length;){if(!(this.requireFail[a].state&(kc|ec)))return!1;a++}return!0},recognize:function(a){var b=h({},a);return l(this.options.enable,[this,b])?(this.state&(ic|jc|kc)&&(this.state=ec),this.state=this.process(b),void(this.state&(fc|gc|hc|jc)&&this.tryEmit(b))):(this.reset(),void(this.state=kc))},process:function(){},getTouchAction:function(){},reset:function(){}},j(Z,V,{defaults:{pointers:1},attrTest:function(a){var b=this.options.pointers;return 0===b||a.pointers.length===b},process:function(a){var b=this.state,c=a.eventType,d=b&(fc|gc),e=this.attrTest(a);return d&&(c&Bb||!e)?b|jc:d||e?c&Ab?b|hc:b&fc?b|gc:fc:kc}}),j($,Z,{defaults:{event:"pan",threshold:10,pointers:1,direction:Jb},getTouchAction:function(){var a=this.options.direction,b=[];return a&Hb&&b.push(dc),a&Ib&&b.push(cc),b},directionTest:function(a){var b=this.options,c=!0,d=a.distance,e=a.direction,f=a.deltaX,g=a.deltaY;return e&b.direction||(b.direction&Hb?(e=0===f?Cb:0>f?Db:Eb,c=f!=this.pX,d=Math.abs(a.deltaX)):(e=0===g?Cb:0>g?Fb:Gb,c=g!=this.pY,d=Math.abs(a.deltaY))),a.direction=e,c&&d>b.threshold&&e&b.direction},attrTest:function(a){return Z.prototype.attrTest.call(this,a)&&(this.state&fc||!(this.state&fc)&&this.directionTest(a))},emit:function(a){this.pX=a.deltaX,this.pY=a.deltaY;var b=X(a.direction);b&&this.manager.emit(this.options.event+b,a),this._super.emit.call(this,a)}}),j(_,Z,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[bc]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.scale-1)>this.options.threshold||this.state&fc)},emit:function(a){if(this._super.emit.call(this,a),1!==a.scale){var b=a.scale<1?"in":"out";this.manager.emit(this.options.event+b,a)}}}),j(ab,V,{defaults:{event:"press",pointers:1,time:500,threshold:5},getTouchAction:function(){return[_b]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime>b.time;if(this._input=a,!d||!c||a.eventType&(Ab|Bb)&&!f)this.reset();else if(a.eventType&yb)this.reset(),this._timer=e(function(){this.state=ic,this.tryEmit()},b.time,this);else if(a.eventType&Ab)return ic;return kc},reset:function(){clearTimeout(this._timer)},emit:function(a){this.state===ic&&(a&&a.eventType&Ab?this.manager.emit(this.options.event+"up",a):(this._input.timeStamp=nb(),this.manager.emit(this.options.event,this._input)))}}),j(bb,Z,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[bc]},attrTest:function(a){return this._super.attrTest.call(this,a)&&(Math.abs(a.rotation)>this.options.threshold||this.state&fc)}}),j(cb,Z,{defaults:{event:"swipe",threshold:10,velocity:.65,direction:Hb|Ib,pointers:1},getTouchAction:function(){return $.prototype.getTouchAction.call(this)},attrTest:function(a){var b,c=this.options.direction;return c&(Hb|Ib)?b=a.velocity:c&Hb?b=a.velocityX:c&Ib&&(b=a.velocityY),this._super.attrTest.call(this,a)&&c&a.direction&&a.distance>this.options.threshold&&mb(b)>this.options.velocity&&a.eventType&Ab},emit:function(a){var b=X(a.direction);b&&this.manager.emit(this.options.event+b,a),this.manager.emit(this.options.event,a)}}),j(db,V,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:2,posThreshold:10},getTouchAction:function(){return[ac]},process:function(a){var b=this.options,c=a.pointers.length===b.pointers,d=a.distance<b.threshold,f=a.deltaTime<b.time;if(this.reset(),a.eventType&yb&&0===this.count)return this.failTimeout();if(d&&f&&c){if(a.eventType!=Ab)return this.failTimeout();var g=this.pTime?a.timeStamp-this.pTime<b.interval:!0,h=!this.pCenter||I(this.pCenter,a.center)<b.posThreshold;this.pTime=a.timeStamp,this.pCenter=a.center,h&&g?this.count+=1:this.count=1,this._input=a;var i=this.count%b.taps;if(0===i)return this.hasRequireFailures()?(this._timer=e(function(){this.state=ic,this.tryEmit()},b.interval,this),fc):ic}return kc},failTimeout:function(){return this._timer=e(function(){this.state=kc},this.options.interval,this),kc},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==ic&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),eb.VERSION="2.0.4",eb.defaults={domEvents:!1,touchAction:$b,enable:!0,inputTarget:null,inputClass:null,preset:[[bb,{enable:!1}],[_,{enable:!1},["rotate"]],[cb,{direction:Hb}],[$,{direction:Hb},["swipe"]],[db],[db,{event:"doubletap",taps:2},["tap"]],[ab]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var lc=1,mc=2;fb.prototype={set:function(a){return h(this.options,a),a.touchAction&&this.touchAction.update(),a.inputTarget&&(this.input.destroy(),this.input.target=a.inputTarget,this.input.init()),this},stop:function(a){this.session.stopped=a?mc:lc},recognize:function(a){var b=this.session;if(!b.stopped){this.touchAction.preventDefaults(a);var c,d=this.recognizers,e=b.curRecognizer;(!e||e&&e.state&ic)&&(e=b.curRecognizer=null);for(var f=0;f<d.length;)c=d[f],b.stopped===mc||e&&c!=e&&!c.canRecognizeWith(e)?c.reset():c.recognize(a),!e&&c.state&(fc|gc|hc)&&(e=b.curRecognizer=c),f++}},get:function(a){if(a instanceof V)return a;for(var b=this.recognizers,c=0;c<b.length;c++)if(b[c].options.event==a)return b[c];return null},add:function(a){if(f(a,"add",this))return this;var b=this.get(a.options.event);return b&&this.remove(b),this.recognizers.push(a),a.manager=this,this.touchAction.update(),a},remove:function(a){if(f(a,"remove",this))return this;var b=this.recognizers;return a=this.get(a),b.splice(s(b,a),1),this.touchAction.update(),this},on:function(a,b){var c=this.handlers;return g(r(a),function(a){c[a]=c[a]||[],c[a].push(b)}),this},off:function(a,b){var c=this.handlers;return g(r(a),function(a){b?c[a].splice(s(c[a],b),1):delete c[a]}),this},emit:function(a,b){this.options.domEvents&&hb(a,b);var c=this.handlers[a]&&this.handlers[a].slice();if(c&&c.length){b.type=a,b.preventDefault=function(){b.srcEvent.preventDefault()};for(var d=0;d<c.length;)c[d](b),d++}},destroy:function(){this.element&&gb(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},h(eb,{INPUT_START:yb,INPUT_MOVE:zb,INPUT_END:Ab,INPUT_CANCEL:Bb,STATE_POSSIBLE:ec,STATE_BEGAN:fc,STATE_CHANGED:gc,STATE_ENDED:hc,STATE_RECOGNIZED:ic,STATE_CANCELLED:jc,STATE_FAILED:kc,DIRECTION_NONE:Cb,DIRECTION_LEFT:Db,DIRECTION_RIGHT:Eb,DIRECTION_UP:Fb,DIRECTION_DOWN:Gb,DIRECTION_HORIZONTAL:Hb,DIRECTION_VERTICAL:Ib,DIRECTION_ALL:Jb,Manager:fb,Input:y,TouchAction:T,TouchInput:Q,MouseInput:M,PointerEventInput:N,TouchMouseInput:S,SingleTouchInput:O,Recognizer:V,AttrRecognizer:Z,Tap:db,Pan:$,Swipe:cb,Pinch:_,Rotate:bb,Press:ab,on:n,off:o,each:g,merge:i,extend:h,inherit:j,bindFn:k,prefixed:v}),typeof define==kb&&define.amd?define(function(){return eb}):"undefined"!=typeof module&&module.exports?module.exports=eb:a[c]=eb}(window,document,"Hammer");
10334
vendor: 36,856 bytes, lines 10335-10362
10335/**! 10336 10337 @license 10338 handlebars v4.7.9 10339 10340Copyright (C) 2011-2019 by Yehuda Katz 10341 10342Permission is hereby granted, free of charge, to any person obtaining a copy 10343of this software and associated documentation files (the "Software"), to deal 10344in the Software without restriction, including without limitation the rights 10345to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10346copies of the Software, and to permit persons to whom the Software is 10347furnished to do so, subject to the following conditions: 10348 10349The above copyright notice and this permission notice shall be included in 10350all copies or substantial portions of the Software. 10351 10352THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 10353IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 10354FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 10355AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 10356LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 10357OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 10358THE SOFTWARE. 10359 10360*/ 10361!function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b():"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?exports.Handlebars=b():a.Handlebars=b()}(this,function(){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){"use strict";function d(){var a=r();return a.compile=function(b,c){return k.compile(b,c,a)},a.precompile=function(b,c){return k.precompile(b,c,a)},a.AST=i["default"],a.Compiler=k.Compiler,a.JavaScriptCompiler=m["default"],a.Parser=j.parser,a.parse=j.parse,a.parseWithoutProcessing=j.parseWithoutProcessing,a}var e=c(1)["default"];b.__esModule=!0;var f=c(2),g=e(f),h=c(83),i=e(h),j=c(84),k=c(89),l=c(90),m=e(l),n=c(87),o=e(n),p=c(82),q=e(p),r=g["default"].create,s=d();s.create=d,q["default"](s),s.Visitor=o["default"],s["default"]=s,b["default"]=s,a.exports=b["default"]},function(a,b){"use strict";b["default"]=function(a){return a&&a.__esModule?a:{"default":a}},b.__esModule=!0},function(a,b,c){"use strict";function d(){var a=new h.HandlebarsEnvironment;return n.extend(a,h),a.SafeString=j["default"],a.Exception=l["default"],a.Utils=n,a.escapeExpression=n.escapeExpression,a.VM=p,a.template=function(b){return p.template(b,a)},a}var e=c(3)["default"],f=c(1)["default"];b.__esModule=!0;var g=c(4),h=e(g),i=c(76),j=f(i),k=c(6),l=f(k),m=c(5),n=e(m),o=c(77),p=e(o),q=c(82),r=f(q),s=d();s.create=d,r["default"](s),s["default"]=s,b["default"]=s,a.exports=b["default"]},function(a,b){"use strict";b["default"]=function(a){if(a&&a.__esModule)return a;var b={};if(null!=a)for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b["default"]=a,b},b.__esModule=!0},function(a,b,c){"use strict";function d(a,b,c){this.helpers=a||{},this.partials=b||{},this.decorators=c||{},i.registerDefaultHelpers(this),j.registerDefaultDecorators(this)}var e=c(1)["default"];b.__esModule=!0,b.HandlebarsEnvironment=d;var f=c(5),g=c(6),h=e(g),i=c(10),j=c(70),k=c(72),l=e(k),m=c(73),n="4.7.9";b.VERSION=n;var o=8;b.COMPILER_REVISION=o;var p=7;b.LAST_COMPATIBLE_COMPILER_REVISION=p;var q={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};b.REVISION_CHANGES=q;var r="[object Object]";d.prototype={constructor:d,logger:l["default"],log:l["default"].log,registerHelper:function(a,b){if(f.toString.call(a)===r){if(b)throw new h["default"]("Arg not supported with multiple helpers");f.extend(this.helpers,a)}else this.helpers[a]=b},unregisterHelper:function(a){delete this.helpers[a]},registerPartial:function(a,b){if(f.toString.call(a)===r)f.extend(this.partials,a);else{if("undefined"==typeof b)throw new h["default"]('Attempting to register a partial called "'+a+'" as undefined');this.partials[a]=b}},unregisterPartial:function(a){delete this.partials[a]},registerDecorator:function(a,b){if(f.toString.call(a)===r){if(b)throw new h["default"]("Arg not supported with multiple decorators");f.extend(this.decorators,a)}else this.decorators[a]=b},unregisterDecorator:function(a){delete this.decorators[a]},resetLoggedPropertyAccesses:function(){m.resetLoggedProperties()}};var s=l["default"].log;b.log=s,b.createFrame=f.createFrame,b.logger=l["default"]},function(a,b){"use strict";function c(a){return k[a]}function d(a){for(var b=1;b<arguments.length;b++)for(var c in arguments[b])Object.prototype.hasOwnProperty.call(arguments[b],c)&&(a[c]=arguments[b][c]);return a}function e(a,b){for(var c=0,d=a.length;c<d;c++)if(a[c]===b)return c;return-1}function f(a){if("string"!=typeof a){if(a&&a.toHTML)return a.toHTML();if(null==a)return"";if(!a)return a+"";a=""+a}return m.test(a)?a.replace(l,c):a}function g(a){return!a&&0!==a||!(!p(a)||0!==a.length)}function h(a){var b=d({},a);return b._parent=a,b}function i(a,b){return a.path=b,a}function j(a,b){return(a?a+".":"")+b}b.__esModule=!0,b.extend=d,b.indexOf=e,b.escapeExpression=f,b.isEmpty=g,b.createFrame=h,b.blockParams=i,b.appendContextPath=j;var k={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},l=/[&<>"'`=]/g,m=/[&<>"'`=]/,n=Object.prototype.toString;b.toString=n;var o=function(a){return"function"==typeof a};o(/x/)&&(b.isFunction=o=function(a){return"function"==typeof a&&"[object Function]"===n.call(a)}),b.isFunction=o;var p=Array.isArray||function(a){return!(!a||"object"!=typeof a)&&"[object Array]"===n.call(a)};b.isArray=p},function(a,b,c){"use strict";function d(a,b){var c=b&&b.loc,g=void 0,h=void 0,i=void 0,j=void 0;c&&(g=c.start.line,h=c.end.line,i=c.start.column,j=c.end.column,a+=" - "+g+":"+i);for(var k=Error.prototype.constructor.call(this,a),l=0;l<f.length;l++)this[f[l]]=k[f[l]];Error.captureStackTrace&&Error.captureStackTrace(this,d);try{c&&(this.lineNumber=g,this.endLineNumber=h,e?(Object.defineProperty(this,"column",{value:i,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:j,enumerable:!0})):(this.column=i,this.endColumn=j))}catch(m){}}var e=c(7)["default"];b.__esModule=!0;var f=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];d.prototype=new Error,b["default"]=d,a.exports=b["default"]},function(a,b,c){a.exports={"default":c(8),__esModule:!0}},function(a,b,c){var d=c(9);a.exports=function(a,b,c){return d.setDesc(a,b,c)}},function(a,b){var c=Object;a.exports={create:c.create,getProto:c.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:c.getOwnPropertyDescriptor,setDesc:c.defineProperty,setDescs:c.defineProperties,getKeys:c.keys,getNames:c.getOwnPropertyNames,getSymbols:c.getOwnPropertySymbols,each:[].forEach}},function(a,b,c){"use strict";function d(a){h["default"](a),j["default"](a),l["default"](a),n["default"](a),p["default"](a),r["default"](a),t["default"](a)}function e(a,b,c){a.helpers[b]&&(a.hooks[b]=a.helpers[b],c||(a.helpers[b]=void 0))}var f=c(1)["default"];b.__esModule=!0,b.registerDefaultHelpers=d,b.moveHelperToHooks=e;var g=c(11),h=f(g),i=c(12),j=f(i),k=c(65),l=f(k),m=c(66),n=f(m),o=c(67),p=f(o),q=c(68),r=f(q),s=c(69),t=f(s)},function(a,b,c){"use strict";b.__esModule=!0;var d=c(5);b["default"]=function(a){a.registerHelper("blockHelperMissing",function(b,c){var e=c.inverse,f=c.fn;if(b===!0)return f(this);if(b===!1||null==b)return e(this);if(d.isArray(b))return b.length>0?(c.ids&&(c.ids=[c.name]),a.helpers.each(b,c)):e(this);if(c.data&&c.ids){var g=d.createFrame(c.data);g.contextPath=d.appendContextPath(c.data.contextPath,c.name),c={data:g}}return f(b,c)})},a.exports=b["default"]},function(a,b,c){"use strict";var d=c(13)["default"],e=c(43)["default"],f=c(55)["default"],g=c(60)["default"],h=c(1)["default"];b.__esModule=!0;var i=c(5),j=c(6),k=h(j);b["default"]=function(a){a.registerHelper("each",function(a,b){function c(b,c,d){n&&(n.key=b,n.index=c,n.first=0===c,n.last=!!d,o&&(n.contextPath=o+b)),m+=h(a[b],{data:n,blockParams:i.blockParams([a[b],b],[o+b,null])})}if(!b)throw new k["default"]("Must pass iterator to #each");var h=b.fn,j=b.inverse,l=0,m="",n=void 0,o=void 0;if(b.data&&b.ids&&(o=i.appendContextPath(b.data.contextPath,b.ids[0])+"."),i.isFunction(a)&&(a=a.call(this)),b.data&&(n=i.createFrame(b.data)),a&&"object"==typeof a)if(i.isArray(a))for(var p=a.length;l<p;l++)l in a&&c(l,l,l===a.length-1);else if("function"==typeof d&&a[e]){for(var q=[],r=f(a),s=r.next();!s.done;s=r.next())q.push(s.value);a=q;for(var p=a.length;l<p;l++)c(l,l,l===a.length-1)}else!function(){var b=void 0;g(a).forEach(function(a){void 0!==b&&c(b,l-1),b=a,l++}),void 0!==b&&c(b,l-1,!0)}();return 0===l&&(m=j(this)),m})},a.exports=b["default"]},function(a,b,c){a.exports={"default":c(14),__esModule:!0}},function(a,b,c){c(15),c(42),a.exports=c(21).Symbol},function(a,b,c){"use strict";var d=c(9),e=c(16),f=c(17),g=c(18),h=c(20),i=c(24),j=c(19),k=c(27),l=c(28),m=c(30),n=c(29),o=c(31),p=c(36),q=c(37),r=c(38),s=c(39),t=c(32),u=c(26),v=d.getDesc,w=d.setDesc,x=d.create,y=p.get,z=e.Symbol,A=e.JSON,B=A&&A.stringify,C=!1,D=n("_hidden"),E=d.isEnum,F=k("symbol-registry"),G=k("symbols"),H="function"==typeof z,I=Object.prototype,J=g&&j(function(){return 7!=x(w({},"a",{get:function(){return w(this,"a",{value:7}).a}})).a})?function(a,b,c){var d=v(I,b);d&&delete I[b],w(a,b,c),d&&a!==I&&w(I,b,d)}:w,K=function(a){var b=G[a]=x(z.prototype);return b._k=a,g&&C&&J(I,a,{configurable:!0,set:function(b){f(this,D)&&f(this[D],a)&&(this[D][a]=!1),J(this,a,u(1,b))}}),b},L=function(a){return"symbol"==typeof a},M=function(a,b,c){return c&&f(G,b)?(c.enumerable?(f(a,D)&&a[D][b]&&(a[D][b]=!1),c=x(c,{enumerable:u(0,!1)})):(f(a,D)||w(a,D,u(1,{})),a[D][b]=!0),J(a,b,c)):w(a,b,c)},N=function(a,b){s(a);for(var c,d=q(b=t(b)),e=0,f=d.length;f>e;)M(a,c=d[e++],b[c]);return a},O=function(a,b){return void 0===b?x(a):N(x(a),b)},P=function(a){var b=E.call(this,a);return!(b||!f(this,a)||!f(G,a)||f(this,D)&&this[D][a])||b},Q=function(a,b){var c=v(a=t(a),b);return!c||!f(G,b)||f(a,D)&&a[D][b]||(c.enumerable=!0),c},R=function(a){for(var b,c=y(t(a)),d=[],e=0;c.length>e;)f(G,b=c[e++])||b==D||d.push(b);return d},S=function(a){for(var b,c=y(t(a)),d=[],e=0;c.length>e;)f(G,b=c[e++])&&d.push(G[b]);return d},T=function(a){if(void 0!==a&&!L(a)){for(var b,c,d=[a],e=1,f=arguments;f.length>e;)d.push(f[e++]);return b=d[1],"function"==typeof b&&(c=b),!c&&r(b)||(b=function(a,b){if(c&&(b=c.call(this,a,b)),!L(b))return b}),d[1]=b,B.apply(A,d)}},U=j(function(){var a=z();return"[null]"!=B([a])||"{}"!=B({a:a})||"{}"!=B(Object(a))});H||(z=function(){if(L(this))throw TypeError("Symbol is not a constructor");return K(m(arguments.length>0?arguments[0]:void 0))},i(z.prototype,"toString",function(){return this._k}),L=function(a){return a instanceof z},d.create=O,d.isEnum=P,d.getDesc=Q,d.setDesc=M,d.setDescs=N,d.getNames=p.get=R,d.getSymbols=S,g&&!c(41)&&i(I,"propertyIsEnumerable",P,!0));var V={"for":function(a){return f(F,a+="")?F[a]:F[a]=z(a)},keyFor:function(a){return o(F,a)},useSetter:function(){C=!0},useSimple:function(){C=!1}};d.each.call("hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),function(a){var b=n(a);V[a]=H?b:K(b)}),C=!0,h(h.G+h.W,{Symbol:z}),h(h.S,"Symbol",V),h(h.S+h.F*!H,"Object",{create:O,defineProperty:M,defineProperties:N,getOwnPropertyDescriptor:Q,getOwnPropertyNames:R,getOwnPropertySymbols:S}),A&&h(h.S+h.F*(!H||U),"JSON",{stringify:T}),l(z,"Symbol"),l(Math,"Math",!0),l(e.JSON,"JSON",!0)},function(a,b){var c=a.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=c)},function(a,b){var c={}.hasOwnProperty;a.exports=function(a,b){return c.call(a,b)}},function(a,b,c){a.exports=!c(19)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(a,b){a.exports=function(a){try{return!!a()}catch(b){return!0}}},function(a,b,c){var d=c(16),e=c(21),f=c(22),g="prototype",h=function(a,b,c){var i,j,k,l=a&h.F,m=a&h.G,n=a&h.S,o=a&h.P,p=a&h.B,q=a&h.W,r=m?e:e[b]||(e[b]={}),s=m?d:n?d[b]:(d[b]||{})[g];m&&(c=b);for(i in c)j=!l&&s&&i in s,j&&i in r||(k=j?s[i]:c[i],r[i]=m&&"function"!=typeof s[i]?c[i]:p&&j?f(k,d):q&&s[i]==k?function(a){var b=function(b){return this instanceof a?new a(b):a(b)};return b[g]=a[g],b}(k):o&&"function"==typeof k?f(Function.call,k):k,o&&((r[g]||(r[g]={}))[i]=k))};h.F=1,h.G=2,h.S=4,h.P=8,h.B=16,h.W=32,a.exports=h},function(a,b){var c=a.exports={version:"1.2.6"};"number"==typeof __e&&(__e=c)},function(a,b,c){var d=c(23);a.exports=function(a,b,c){if(d(a),void 0===b)return a;switch(c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}}},function(a,b){a.exports=function(a){if("function"!=typeof a)throw TypeError(a+" is not a function!");return a}},function(a,b,c){a.exports=c(25)},function(a,b,c){var d=c(9),e=c(26);a.exports=c(18)?function(a,b,c){return d.setDesc(a,b,e(1,c))}:function(a,b,c){return a[b]=c,a}},function(a,b){a.exports=function(a,b){return{enumerable:!(1&a),configurable:!(2&a),writable:!(4&a),value:b}}},function(a,b,c){var d=c(16),e="__core-js_shared__",f=d[e]||(d[e]={});a.exports=function(a){return f[a]||(f[a]={})}},function(a,b,c){var d=c(9).setDesc,e=c(17),f=c(29)("toStringTag");a.exports=function(a,b,c){a&&!e(a=c?a:a.prototype,f)&&d(a,f,{configurable:!0,value:b})}},function(a,b,c){var d=c(27)("wks"),e=c(30),f=c(16).Symbol;a.exports=function(a){return d[a]||(d[a]=f&&f[a]||(f||e)("Symbol."+a))}},function(a,b){var c=0,d=Math.random();a.exports=function(a){return"Symbol(".concat(void 0===a?"":a,")_",(++c+d).toString(36))}},function(a,b,c){var d=c(9),e=c(32);a.exports=function(a,b){for(var c,f=e(a),g=d.getKeys(f),h=g.length,i=0;h>i;)if(f[c=g[i++]]===b)return c}},function(a,b,c){var d=c(33),e=c(35);a.exports=function(a){return d(e(a))}},function(a,b,c){var d=c(34);a.exports=Object("z").propertyIsEnumerable(0)?Object:function(a){return"String"==d(a)?a.split(""):Object(a)}},function(a,b){var c={}.toString;a.exports=function(a){return c.call(a).slice(8,-1)}},function(a,b){a.exports=function(a){if(void 0==a)throw TypeError("Can't call method on "+a);return a}},function(a,b,c){var d=c(32),e=c(9).getNames,f={}.toString,g="object"==typeof window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],h=function(a){try{return e(a)}catch(b){return g.slice()}};a.exports.get=function(a){return g&&"[object Window]"==f.call(a)?h(a):e(d(a))}},function(a,b,c){var d=c(9);a.exports=function(a){var b=d.getKeys(a),c=d.getSymbols;if(c)for(var e,f=c(a),g=d.isEnum,h=0;f.length>h;)g.call(a,e=f[h++])&&b.push(e);return b}},function(a,b,c){var d=c(34);a.exports=Array.isArray||function(a){return"Array"==d(a)}},function(a,b,c){var d=c(40);a.exports=function(a){if(!d(a))throw TypeError(a+" is not an object!");return a}},function(a,b){a.exports=function(a){return"object"==typeof a?null!==a:"function"==typeof a}},function(a,b){a.exports=!0},function(a,b){},function(a,b,c){a.exports={"default":c(44),__esModule:!0}},function(a,b,c){c(45),c(51),a.exports=c(29)("iterator")},function(a,b,c){"use strict";var d=c(46)(!0);c(48)(String,"String",function(a){this._t=String(a),this._i=0},function(){var a,b=this._t,c=this._i;return c>=b.length?{value:void 0,done:!0}:(a=d(b,c),this._i+=a.length,{value:a,done:!1})})},function(a,b,c){var d=c(47),e=c(35);a.exports=function(a){return function(b,c){var f,g,h=String(e(b)),i=d(c),j=h.length;return i<0||i>=j?a?"":void 0:(f=h.charCodeAt(i),f<55296||f>56319||i+1===j||(g=h.charCodeAt(i+1))<56320||g>57343?a?h.charAt(i):f:a?h.slice(i,i+2):(f-55296<<10)+(g-56320)+65536)}}},function(a,b){var c=Math.ceil,d=Math.floor;a.exports=function(a){return isNaN(a=+a)?0:(a>0?d:c)(a)}},function(a,b,c){"use strict";var d=c(41),e=c(20),f=c(24),g=c(25),h=c(17),i=c(49),j=c(50),k=c(28),l=c(9).getProto,m=c(29)("iterator"),n=!([].keys&&"next"in[].keys()),o="@@iterator",p="keys",q="values",r=function(){return this};a.exports=function(a,b,c,s,t,u,v){j(c,b,s);var w,x,y=function(a){if(!n&&a in C)return C[a];switch(a){case p:return function(){return new c(this,a)};case q:return function(){return new c(this,a)}}return function(){return new c(this,a)}},z=b+" Iterator",A=t==q,B=!1,C=a.prototype,D=C[m]||C[o]||t&&C[t],E=D||y(t);if(D){var F=l(E.call(new a));k(F,z,!0),!d&&h(C,o)&&g(F,m,r),A&&D.name!==q&&(B=!0,E=function(){return D.call(this)})}if(d&&!v||!n&&!B&&C[m]||g(C,m,E),i[b]=E,i[z]=r,t)if(w={values:A?E:y(q),keys:u?E:y(p),entries:A?y("entries"):E},v)for(x in w)x in C||f(C,x,w[x]);else e(e.P+e.F*(n||B),b,w);return w}},function(a,b){a.exports={}},function(a,b,c){"use strict";var d=c(9),e=c(26),f=c(28),g={};c(25)(g,c(29)("iterator"),function(){return this}),a.exports=function(a,b,c){a.prototype=d.create(g,{next:e(1,c)}),f(a,b+" Iterator")}},function(a,b,c){c(52);var d=c(49);d.NodeList=d.HTMLCollection=d.Array},function(a,b,c){"use strict";var d=c(53),e=c(54),f=c(49),g=c(32);a.exports=c(48)(Array,"Array",function(a,b){this._t=g(a),this._i=0,this._k=b},function(){var a=this._t,b=this._k,c=this._i++;return!a||c>=a.length?(this._t=void 0,e(1)):"keys"==b?e(0,c):"values"==b?e(0,a[c]):e(0,[c,a[c]])},"values"),f.Arguments=f.Array,d("keys"),d("values"),d("entries")},function(a,b){a.exports=function(){}},function(a,b){a.exports=function(a,b){return{value:b,done:!!a}}},function(a,b,c){a.exports={"default":c(56),__esModule:!0}},function(a,b,c){c(51),c(45),a.exports=c(57)},function(a,b,c){var d=c(39),e=c(58);a.exports=c(21).getIterator=function(a){var b=e(a);if("function"!=typeof b)throw TypeError(a+" is not iterable!");return d(b.call(a))}},function(a,b,c){var d=c(59),e=c(29)("iterator"),f=c(49);a.exports=c(21).getIteratorMethod=function(a){if(void 0!=a)return a[e]||a["@@iterator"]||f[d(a)]}},function(a,b,c){var d=c(34),e=c(29)("toStringTag"),f="Arguments"==d(function(){return arguments}());a.exports=function(a){var b,c,g;return void 0===a?"Undefined":null===a?"Null":"string"==typeof(c=(b=Object(a))[e])?c:f?d(b):"Object"==(g=d(b))&&"function"==typeof b.callee?"Arguments":g}},function(a,b,c){a.exports={"default":c(61),__esModule:!0}},function(a,b,c){c(62),a.exports=c(21).Object.keys},function(a,b,c){var d=c(63);c(64)("keys",function(a){return function(b){return a(d(b))}})},function(a,b,c){var d=c(35);a.exports=function(a){return Object(d(a))}},function(a,b,c){var d=c(20),e=c(21),f=c(19);a.exports=function(a,b){var c=(e.Object||{})[a]||Object[a],g={};g[a]=b(c),d(d.S+d.F*f(function(){c(1)}),"Object",g)}},function(a,b,c){"use strict";var d=c(1)["default"];b.__esModule=!0;var e=c(6),f=d(e);b["default"]=function(a){a.registerHelper("helperMissing",function(){if(1!==arguments.length)throw new f["default"]('Missing helper: "'+arguments[arguments.length-1].name+'"')})},a.exports=b["default"]},function(a,b,c){"use strict";var d=c(1)["default"];b.__esModule=!0;var e=c(5),f=c(6),g=d(f);b["default"]=function(a){a.registerHelper("if",function(a,b){if(2!=arguments.length)throw new g["default"]("#if requires exactly one argument");return e.isFunction(a)&&(a=a.call(this)),!b.hash.includeZero&&!a||e.isEmpty(a)?b.inverse(this):b.fn(this)}),a.registerHelper("unless",function(b,c){if(2!=arguments.length)throw new g["default"]("#unless requires exactly one argument");return a.helpers["if"].call(this,b,{fn:c.inverse,inverse:c.fn,hash:c.hash})})},a.exports=b["default"]},function(a,b){"use strict";b.__esModule=!0,b["default"]=function(a){a.registerHelper("log",function(){for(var b=[void 0],c=arguments[arguments.length-1],d=0;d<arguments.length-1;d++)b.push(arguments[d]);var e=1;null!=c.hash.level?e=c.hash.level:c.data&&null!=c.data.level&&(e=c.data.level),b[0]=e,a.log.apply(a,b)})},a.exports=b["default"]},function(a,b){"use strict";b.__esModule=!0,b["default"]=function(a){a.registerHelper("lookup",function(a,b,c){return a?c.lookupProperty(a,b):a})},a.exports=b["default"]},function(a,b,c){"use strict";var d=c(1)["default"];b.__esModule=!0;var e=c(5),f=c(6),g=d(f);b["default"]=function(a){a.registerHelper("with",function(a,b){if(2!=arguments.length)throw new g["default"]("#with requires exactly one argument");e.isFunction(a)&&(a=a.call(this));var c=b.fn;if(e.isEmpty(a))return b.inverse(this);var d=b.data;return b.data&&b.ids&&(d=e.createFrame(b.data),d.contextPath=e.appendContextPath(b.data.contextPath,b.ids[0])),c(a,{data:d,blockParams:e.blockParams([a],[d&&d.contextPath])})})},a.exports=b["default"]},function(a,b,c){"use strict";function d(a){g["default"](a)}var e=c(1)["default"];b.__esModule=!0,b.registerDefaultDecorators=d;var f=c(71),g=e(f)},function(a,b,c){"use strict";b.__esModule=!0;var d=c(5);b["default"]=function(a){a.registerDecorator("inline",function(a,b,c,e){var f=a;return b.partials||(b.partials={},f=function(e,f){var g=c.partials;c.partials=d.extend({},g,b.partials);var h=a(e,f);return c.partials=g,h}),b.partials[e.args[0]]=e.fn,f})},a.exports=b["default"]},function(a,b,c){"use strict";b.__esModule=!0;var d=c(5),e={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(a){if("string"==typeof a){var b=d.indexOf(e.methodMap,a.toLowerCase());a=b>=0?b:parseInt(a,10)}return a},log:function(a){if(a=e.lookupLevel(a),"undefined"!=typeof console&&e.lookupLevel(e.level)<=a){var b=e.methodMap[a];console[b]||(b="log");for(var c=arguments.length,d=Array(c>1?c-1:0),f=1;f<c;f++)d[f-1]=arguments[f];console[b].apply(console,d)}}};b["default"]=e,a.exports=b["default"]},function(a,b,c){"use strict";function d(a){var b=i(null);b.__proto__=!1,l.extend(b,a.allowedProtoProperties);var c=i(null);return c.constructor=!1,c.__defineGetter__=!1,c.__defineSetter__=!1,c.__lookupGetter__=!1,c.__lookupSetter__=!1,l.extend(c,a.allowedProtoMethods),{properties:{whitelist:b,defaultValue:a.allowProtoPropertiesByDefault},methods:{whitelist:c,defaultValue:a.allowProtoMethodsByDefault}}}function e(a,b,c){return"function"==typeof a?f(b.methods,c):f(b.properties,c)}function f(a,b){return void 0!==a.whitelist[b]?a.whitelist[b]===!0:void 0!==a.defaultValue?a.defaultValue:(g(b),!1)}function g(a){o[a]!==!0&&(o[a]=!0,n["default"].log("error",'Handlebars: Access has been denied to resolve the property "'+a+'" because it is not an "own property" of its parent.\nYou can add a runtime option to disable the check or this warning:\nSee https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details'))}function h(){j(o).forEach(function(a){delete o[a]})}var i=c(74)["default"],j=c(60)["default"],k=c(1)["default"];b.__esModule=!0,b.createProtoAccessControl=d,b.resultIsAllowed=e,b.resetLoggedProperties=h;var l=c(5),m=c(72),n=k(m),o=i(null)},function(a,b,c){a.exports={"default":c(75),__esModule:!0}},function(a,b,c){var d=c(9);a.exports=function(a,b){return d.create(a,b)}},function(a,b){"use strict";function c(a){this.string=a}b.__esModule=!0,c.prototype.toString=c.prototype.toHTML=function(){return""+this.string},b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(a){var b=a&&a[0]||1,c=w.COMPILER_REVISION;if(!(b>=w.LAST_COMPATIBLE_COMPILER_REVISION&&b<=w.COMPILER_REVISION)){if(b<w.LAST_COMPATIBLE_COMPILER_REVISION){var d=w.REVISION_CHANGES[c],e=w.REVISION_CHANGES[b];throw new v["default"]("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+d+") or downgrade your runtime to an older version ("+e+").")}throw new v["default"]("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+a[1]+").")}}function e(a,b){function c(c,d,e){e.hash&&(d=t.extend({},d,e.hash),e.ids&&(e.ids[0]=!0)),c=b.VM.resolvePartial.call(this,c,d,e),e.hooks=this.hooks,e.protoAccessControl=this.protoAccessControl;var f=b.VM.invokePartial.call(this,c,d,e);if(null==f&&b.compile&&(e.partials[e.name]=b.compile(c,a.compilerOptions,b),f=e.partials[e.name](d,e)),null!=f){if(e.indent){for(var g=f.split("\n"),h=0,i=g.length;h<i&&(g[h]||h+1!==i);h++)g[h]=e.indent+g[h];f=g.join("\n")}return f}throw new v["default"]("The partial "+e.name+" could not be compiled when running in runtime-only mode")}function d(b){function c(b){return""+a.main(g,b,g.helpers,g.partials,f,i,h)}var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],f=e.data;d._setup(e),!e.partial&&a.useData&&(f=k(b,f));var h=void 0,i=a.useBlockParams?[]:void 0;return a.useDepths&&(h=e.depths?b!=e.depths[0]?[b].concat(e.depths):e.depths:[b]),(c=l(a.main,c,g,e.depths||[],f,i))(b,e)}if(!b)throw new v["default"]("No environment passed to template");if(!a||!a.main)throw new v["default"]("Unknown template object: "+typeof a);a.main.decorator=a.main_d,b.VM.checkRevision(a.compiler);var e=a.compiler&&7===a.compiler[0],g={strict:function(a,b,c){if(!(a&&b in a))throw new v["default"]('"'+b+'" not defined in '+a,{loc:c});return g.lookupProperty(a,b)},lookupProperty:function(a,b){var c=a[b];return null==c?c:Object.prototype.hasOwnProperty.call(a,b)?c:z.resultIsAllowed(c,g.protoAccessControl,b)?c:void 0},lookup:function(a,b){for(var c=a.length,d=0;d<c;d++){var e=a[d]&&g.lookupProperty(a[d],b);if(null!=e)return e}},lambda:function(a,b){return"function"==typeof a?a.call(b):a},escapeExpression:t.escapeExpression,invokePartial:c,fn:function(b){var c=a[b];return c.decorator=a[b+"_d"],c},programs:[],program:function(a,b,c,d,e){var g=this.programs[a],h=this.fn(a);return b||e||d||c?g=f(this,a,h,b,c,d,e):g||(g=this.programs[a]=f(this,a,h)),g},data:function(a,b){for(;a&&b--;)a=a._parent;return a},mergeIfNeeded:function(a,b){var c=a||b;return a&&b&&a!==b&&(c=t.extend({},b,a)),c},nullContext:o({}),noop:b.VM.noop,compilerInfo:a.compiler};return d.isTop=!0,d._setup=function(c){if(c.partial)g.protoAccessControl=c.protoAccessControl,g.helpers=c.helpers,g.partials=c.partials,g.decorators=c.decorators,g.hooks=c.hooks;else{var d={};m(d,b.helpers,g),m(d,c.helpers,g),g.helpers=d,a.usePartial&&(g.partials=g.mergeIfNeeded(c.partials,b.partials)),(a.usePartial||a.useDecorators)&&(g.decorators=t.extend({},b.decorators,c.decorators)),g.hooks={},g.protoAccessControl=z.createProtoAccessControl(c);var f=c.allowCallsToHelperMissing||e;x.moveHelperToHooks(g,"helperMissing",f),x.moveHelperToHooks(g,"blockHelperMissing",f)}},d._child=function(b,c,d,e){if(a.useBlockParams&&!d)throw new v["default"]("must pass block params");if(a.useDepths&&!e)throw new v["default"]("must pass parent depths");return f(g,b,a[b],c,0,d,e)},d}function f(a,b,c,d,e,f,g){function h(b){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],h=g;return!g||b==g[0]||b===a.nullContext&&null===g[0]||(h=[b].concat(g)),c(a,b,a.helpers,a.partials,e.data||d,f&&[e.blockParams].concat(f),h)}return h=l(c,h,a,g,d,f),h.program=b,h.depth=g?g.length:0,h.blockParams=e||0,h}function g(a,b,c){return a?a.call||c.name||(c.name=a,a=j(c.partials,a)):a="@partial-block"===c.name?j(c.data,"partial-block"):j(c.partials,c.name),a}function h(a,b,c){var d=j(c.data,"partial-block");c.partial=!0,c.ids&&(c.data.contextPath=c.ids[0]||c.data.contextPath);var e=void 0;if(c.fn&&c.fn!==i&&!function(){c.data=w.createFrame(c.data);var a=c.fn;e=c.data["partial-block"]=function(b){var c=arguments.length<=1||void 0===arguments[1]?{}:arguments[1];return c.data=w.createFrame(c.data),c.data["partial-block"]=d,a(b,c)},a.partials&&(c.partials=t.extend({},c.partials,a.partials))}(),void 0===a&&e&&(a=e),void 0===a)throw new v["default"]("The partial "+c.name+" could not be found");if(a instanceof Function)return a(b,c)}function i(){return""}function j(a,b){if(a&&Object.prototype.hasOwnProperty.call(a,b))return a[b]}function k(a,b){return b&&"root"in b||(b=b?w.createFrame(b):{},b.root=a),b}function l(a,b,c,d,e,f){if(a.decorator){var g={};b=a.decorator(b,g,c,d&&d[0],e,f,d),t.extend(b,g)}return b}function m(a,b,c){b&&p(b).forEach(function(d){var e=b[d];a[d]=n(e,c)})}function n(a,b){var c=b.lookupProperty;return y.wrapHelper(a,function(a){return a.lookupProperty=c,a})}var o=c(78)["default"],p=c(60)["default"],q=c(3)["default"],r=c(1)["default"];b.__esModule=!0,b.checkRevision=d,b.template=e,b.wrapProgram=f,b.resolvePartial=g,b.invokePartial=h,b.noop=i;var s=c(5),t=q(s),u=c(6),v=r(u),w=c(4),x=c(10),y=c(81),z=c(73)},function(a,b,c){a.exports={"default":c(79),__esModule:!0}},function(a,b,c){c(80),a.exports=c(21).Object.seal},function(a,b,c){var d=c(40);c(64)("seal",function(a){return function(b){return a&&d(b)?a(b):b}})},function(a,b){"use strict";function c(a,b){if("function"!=typeof a)return a;var c=function(){var c=arguments[arguments.length-1];return arguments[arguments.length-1]=b(c),a.apply(this,arguments)};return c}b.__esModule=!0,b.wrapHelper=c},function(a,b){"use strict";b.__esModule=!0,b["default"]=function(a){!function(){"object"!=typeof globalThis&&(Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__)}();var b=globalThis.Handlebars;a.noConflict=function(){return globalThis.Handlebars===a&&(globalThis.Handlebars=b),a}},a.exports=b["default"]},function(a,b){"use strict";b.__esModule=!0;var c={helpers:{helperExpression:function(a){return"SubExpression"===a.type||("MustacheStatement"===a.type||"BlockStatement"===a.type)&&!!(a.params&&a.params.length||a.hash)},scopedId:function(a){return/^\.|this\b/.test(a.original)},simpleId:function(a){return 1===a.parts.length&&!c.helpers.scopedId(a)&&!a.depth}}};b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b){if("Program"===a.type)return f(a),a;m["default"].yy=u,u.locInfo=function(a){return new u.SourceLocation(b&&b.srcName,a)};var c=m["default"].parse(a);return c}function e(a,b){var c=d(a,b),e=new o["default"](b);return e.accept(c)}function f(a){g(a)}function g(a){if(null!=a){if(Array.isArray(a))return void a.forEach(g);if("object"==typeof a){if("PathExpression"===a.type){if(!h(a.depth))throw new s["default"]("Invalid AST: PathExpression.depth must be an integer");if(!Array.isArray(a.parts))throw new s["default"]("Invalid AST: PathExpression.parts must be an array");for(var b=0;b<a.parts.length;b++)if("string"!=typeof a.parts[b])throw new s["default"]("Invalid AST: PathExpression.parts must only contain strings")}else if("NumberLiteral"===a.type){if("number"!=typeof a.value||!isFinite(a.value))throw new s["default"]("Invalid AST: NumberLiteral.value must be a number")}else if("BooleanLiteral"===a.type&&"boolean"!=typeof a.value)throw new s["default"]("Invalid AST: BooleanLiteral.value must be a boolean");i(a).forEach(function(b){"loc"!==b&&g(a[b])})}}}function h(a){return"number"==typeof a&&isFinite(a)&&Math.floor(a)===a&&a>=0}var i=c(60)["default"],j=c(1)["default"],k=c(3)["default"];b.__esModule=!0,b.parseWithoutProcessing=d,b.parse=e;var l=c(85),m=j(l),n=c(86),o=j(n),p=c(88),q=k(p),r=c(6),s=j(r),t=c(5);b.parser=m["default"];var u={};t.extend(u,q)},function(a,b){"use strict";b.__esModule=!0;var c=function(){function a(){this.yy={}}var b={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA", 1036287:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(a,b,c,d,e,f,g){var h=f.length-1;switch(e){case 1:return f[h-1];case 2:this.$=d.prepareProgram(f[h]);break;case 3:this.$=f[h];break;case 4:this.$=f[h];break;case 5:this.$=f[h];break;case 6:this.$=f[h];break;case 7:this.$=f[h];break;case 8:this.$=f[h];break;case 9:this.$={type:"CommentStatement",value:d.stripComment(f[h]),strip:d.stripFlags(f[h],f[h]),loc:d.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:f[h],value:f[h],loc:d.locInfo(this._$)};break;case 11:this.$=d.prepareRawBlock(f[h-2],f[h-1],f[h],this._$);break;case 12:this.$={path:f[h-3],params:f[h-2],hash:f[h-1]};break;case 13:this.$=d.prepareBlock(f[h-3],f[h-2],f[h-1],f[h],!1,this._$);break;case 14:this.$=d.prepareBlock(f[h-3],f[h-2],f[h-1],f[h],!0,this._$);break;case 15:this.$={open:f[h-5],path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 16:this.$={path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 17:this.$={path:f[h-4],params:f[h-3],hash:f[h-2],blockParams:f[h-1],strip:d.stripFlags(f[h-5],f[h])};break;case 18:this.$={strip:d.stripFlags(f[h-1],f[h-1]),program:f[h]};break;case 19:var i=d.prepareBlock(f[h-2],f[h-1],f[h],f[h],!1,this._$),j=d.prepareProgram([i],f[h-1].loc);j.chained=!0,this.$={strip:f[h-2].strip,program:j,chain:!0};break;case 20:this.$=f[h];break;case 21:this.$={path:f[h-1],strip:d.stripFlags(f[h-2],f[h])};break;case 22:this.$=d.prepareMustache(f[h-3],f[h-2],f[h-1],f[h-4],d.stripFlags(f[h-4],f[h]),this._$);break;case 23:this.$=d.prepareMustache(f[h-3],f[h-2],f[h-1],f[h-4],d.stripFlags(f[h-4],f[h]),this._$);break;case 24:this.$={type:"PartialStatement",name:f[h-3],params:f[h-2],hash:f[h-1],indent:"",strip:d.stripFlags(f[h-4],f[h]),loc:d.locInfo(this._$)};break;case 25:this.$=d.preparePartialBlock(f[h-2],f[h-1],f[h],this._$);break;case 26:this.$={path:f[h-3],params:f[h-2],hash:f[h-1],strip:d.stripFlags(f[h-4],f[h])};break;case 27:this.$=f[h];break;case 28:this.$=f[h];break;case 29:this.$={type:"SubExpression",path:f[h-3],params:f[h-2],hash:f[h-1],loc:d.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:f[h],loc:d.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:d.id(f[h-2]),value:f[h],loc:d.locInfo(this._$)};break;case 32:this.$=d.id(f[h-1]);break;case 33:this.$=f[h];break;case 34:this.$=f[h];break;case 35:this.$={type:"StringLiteral",value:f[h],original:f[h],loc:d.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(f[h]),original:Number(f[h]),loc:d.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:"true"===f[h],original:"true"===f[h],loc:d.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:d.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:d.locInfo(this._$)};break;case 40:this.$=f[h];break;case 41:this.$=f[h];break;case 42:this.$=d.preparePath(!0,f[h],this._$);break;case 43:this.$=d.preparePath(!1,f[h],this._$);break;
vendor: 4,162 bytes, line 10362
10362case 44:f[h-2].push({part:d.id(f[h]),original:f[h],separator:f[h-1]}),this.$=f[h-2];break;case 45:this.$=[{part:d.id(f[h]),original:f[h]}];break;case 46:this.$=[];break;case 47:f[h-1].push(f[h]);break;case 48:this.$=[];break;case 49:f[h-1].push(f[h]);break;case 50:this.$=[];break;case 51:f[h-1].push(f[h]);break;case 58:this.$=[];break;case 59:f[h-1].push(f[h]);break;case 64:this.$=[];break;case 65:f[h-1].push(f[h]);break;case 70:this.$=[];break;case 71:f[h-1].push(f[h]);break;case 78:this.$=[];break;case 79:f[h-1].push(f[h]);break;case 82:this.$=[];break;case 83:f[h-1].push(f[h]);break;case 86:this.$=[];break;case 87:f[h-1].push(f[h]);break;case 90:this.$=[];break;case 91:f[h-1].push(f[h]);break;case 94:this.$=[];break;case 95:f[h-1].push(f[h]);break;case 98:this.$=[f[h]];break;case 99:f[h-1].push(f[h]);break;case 100:this.$=[f[h]];break;case 101:f[h-1].push(f[h])}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37
vendor: 4,114 bytes, line 10362
10362],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]}
vendor: 44,243 bytes, lines 10362-10363
10362,{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(a,b){throw new Error(a)},parse:function(a){function b(){var a;return a=c.lexer.lex()||1,"number"!=typeof a&&(a=c.symbols_[a]||a),a}var c=this,d=[0],e=[null],f=[],g=this.table,h="",i=0,j=0,k=0;this.lexer.setInput(a),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var l=this.lexer.yylloc;f.push(l);var m=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var n,o,p,q,r,s,t,u,v,w={};;){if(p=d[d.length-1],this.defaultActions[p]?q=this.defaultActions[p]:(null!==n&&"undefined"!=typeof n||(n=b()),q=g[p]&&g[p][n]),"undefined"==typeof q||!q.length||!q[0]){var x="";if(!k){v=[];for(s in g[p])this.terminals_[s]&&s>2&&v.push("'"+this.terminals_[s]+"'");x=this.lexer.showPosition?"Parse error on line "+(i+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[n]||n)+"'":"Parse error on line "+(i+1)+": Unexpected "+(1==n?"end of input":"'"+(this.terminals_[n]||n)+"'"),this.parseError(x,{text:this.lexer.match,token:this.terminals_[n]||n,line:this.lexer.yylineno,loc:l,expected:v})}}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+p+", token: "+n);switch(q[0]){case 1:d.push(n),e.push(this.lexer.yytext),f.push(this.lexer.yylloc),d.push(q[1]),n=null,o?(n=o,o=null):(j=this.lexer.yyleng,h=this.lexer.yytext,i=this.lexer.yylineno,l=this.lexer.yylloc,k>0&&k--);break;case 2:if(t=this.productions_[q[1]][1],w.$=e[e.length-t],w._$={first_line:f[f.length-(t||1)].first_line,last_line:f[f.length-1].last_line,first_column:f[f.length-(t||1)].first_column,last_column:f[f.length-1].last_column},m&&(w._$.range=[f[f.length-(t||1)].range[0],f[f.length-1].range[1]]),r=this.performAction.call(w,h,j,i,this.yy,q[1],e,f),"undefined"!=typeof r)return r;t&&(d=d.slice(0,-1*t*2),e=e.slice(0,-1*t),f=f.slice(0,-1*t)),d.push(this.productions_[q[1]][0]),e.push(w.$),f.push(w._$),u=g[d[d.length-2]][d[d.length-1]],d.push(u);break;case 3:return!0}}return!0}},c=function(){var a={EOF:1,parseError:function(a,b){if(!this.yy.parser)throw new Error(a);this.yy.parser.parseError(a,b)},setInput:function(a){return this._input=a,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var b=a.match(/(?:\r\n?|\n).*/g);return b?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},unput:function(a){var b=a.length,c=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-b-1),this.offset-=b;var d=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var e=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===d.length?this.yylloc.first_column:0)+d[d.length-c.length].length-c[0].length:this.yylloc.first_column-b},this.options.ranges&&(this.yylloc.range=[e[0],e[0]+this.yyleng-b]),this},more:function(){return this._more=!0,this},less:function(a){this.unput(this.match.slice(a))},pastInput:function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var a=this.pastInput(),b=new Array(a.length+1).join("-");return a+this.upcomingInput()+"\n"+b+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var a,b,c,d,e;this._more||(this.yytext="",this.match="");for(var f=this._currentRules(),g=0;g<f.length&&(c=this._input.match(this.rules[f[g]]),!c||b&&!(c[0].length>b[0].length)||(b=c,d=g,this.options.flex));g++);return b?(e=b[0].match(/(?:\r\n?|\n).*/g),e&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+b[0].length},this.yytext+=b[0],this.match+=b[0],this.matches=b,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(b[0].length),this.matched+=b[0],a=this.performAction.call(this,this.yy,this,f[d],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a?a:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var a=this.next();return"undefined"!=typeof a?a:this.lex()},begin:function(a){this.conditionStack.push(a)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(a){this.begin(a)}};return a.options={},a.performAction=function(a,b,c,d){function e(a,c){return b.yytext=b.yytext.substring(a,b.yyleng-c+a)}switch(c){case 0:if("\\\\"===b.yytext.slice(-2)?(e(0,1),this.begin("mu")):"\\"===b.yytext.slice(-1)?(e(0,1),this.begin("emu")):this.begin("mu"),b.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;case 3:return this.begin("raw"),15;case 4:return this.popState(),"raw"===this.conditionStack[this.conditionStack.length-1]?15:(e(5,9),"END_RAW_BLOCK");case 5:return 15;case 6:return this.popState(),14;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;case 16:return this.popState(),44;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(b.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;case 30:return this.popState(),33;case 31:return b.yytext=e(1,2).replace(/\\"/g,'"'),80;case 32:return b.yytext=e(1,2).replace(/\\'/g,"'"),80;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return b.yytext=b.yytext.replace(/\\([\\\]])/g,"$1"),72;case 43:return"INVALID";case 44:return 5}},a.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^\/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],a.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},a}();return b.lexer=c,a.prototype=b,b.Parser=a,new a}();b["default"]=c,a.exports=b["default"]},function(a,b,c){"use strict";function d(){var a=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];this.options=a}function e(a,b,c){void 0===b&&(b=a.length);var d=a[b-1],e=a[b-2];return d?"ContentStatement"===d.type?(e||!c?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(d.original):void 0:c}function f(a,b,c){void 0===b&&(b=-1);var d=a[b+1],e=a[b+2];return d?"ContentStatement"===d.type?(e||!c?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(d.original):void 0:c}function g(a,b,c){var d=a[null==b?0:b+1];if(d&&"ContentStatement"===d.type&&(c||!d.rightStripped)){var e=d.value;d.value=d.value.replace(c?/^\s+/:/^[ \t]*\r?\n?/,""),d.rightStripped=d.value!==e}}function h(a,b,c){var d=a[null==b?a.length-1:b-1];if(d&&"ContentStatement"===d.type&&(c||!d.leftStripped)){var e=d.value;return d.value=d.value.replace(c?/\s+$/:/[ \t]+$/,""),d.leftStripped=d.value!==e,d.leftStripped}}var i=c(1)["default"];b.__esModule=!0;var j=c(87),k=i(j);d.prototype=new k["default"],d.prototype.Program=function(a){var b=!this.options.ignoreStandalone,c=!this.isRootSeen;this.isRootSeen=!0;for(var d=a.body,i=0,j=d.length;i<j;i++){var k=d[i],l=this.accept(k);if(l){var m=e(d,i,c),n=f(d,i,c),o=l.openStandalone&&m,p=l.closeStandalone&&n,q=l.inlineStandalone&&m&&n;l.close&&g(d,i,!0),l.open&&h(d,i,!0),b&&q&&(g(d,i),h(d,i)&&"PartialStatement"===k.type&&(k.indent=/([ \t]+$)/.exec(d[i-1].original)[1])),b&&o&&(g((k.program||k.inverse).body),h(d,i)),b&&p&&(g(d,i),h((k.inverse||k.program).body))}}return a},d.prototype.BlockStatement=d.prototype.DecoratorBlock=d.prototype.PartialBlockStatement=function(a){this.accept(a.program),this.accept(a.inverse);var b=a.program||a.inverse,c=a.program&&a.inverse,d=c,i=c;if(c&&c.chained)for(d=c.body[0].program;i.chained;)i=i.body[i.body.length-1].program;var j={open:a.openStrip.open,close:a.closeStrip.close,openStandalone:f(b.body),closeStandalone:e((d||b).body)};if(a.openStrip.close&&g(b.body,null,!0),c){var k=a.inverseStrip;k.open&&h(b.body,null,!0),k.close&&g(d.body,null,!0),a.closeStrip.open&&h(i.body,null,!0),!this.options.ignoreStandalone&&e(b.body)&&f(d.body)&&(h(b.body),g(d.body))}else a.closeStrip.open&&h(b.body,null,!0);return j},d.prototype.Decorator=d.prototype.MustacheStatement=function(a){return a.strip},d.prototype.PartialStatement=d.prototype.CommentStatement=function(a){var b=a.strip||{};return{inlineStandalone:!0,open:b.open,close:b.close}},b["default"]=d,a.exports=b["default"]},function(a,b,c){"use strict";function d(){this.parents=[]}function e(a){this.acceptRequired(a,"path"),this.acceptArray(a.params),this.acceptKey(a,"hash")}function f(a){e.call(this,a),this.acceptKey(a,"program"),this.acceptKey(a,"inverse")}function g(a){this.acceptRequired(a,"name"),this.acceptArray(a.params),this.acceptKey(a,"hash")}var h=c(1)["default"];b.__esModule=!0;var i=c(6),j=h(i);d.prototype={constructor:d,mutating:!1,acceptKey:function(a,b){var c=this.accept(a[b]);if(this.mutating){if(c&&!d.prototype[c.type])throw new j["default"]('Unexpected node type "'+c.type+'" found when accepting '+b+" on "+a.type);a[b]=c}},acceptRequired:function(a,b){if(this.acceptKey(a,b),!a[b])throw new j["default"](a.type+" requires "+b)},acceptArray:function(a){for(var b=0,c=a.length;b<c;b++)this.acceptKey(a,b),a[b]||(a.splice(b,1),b--,c--)},accept:function(a){if(a){if(!this[a.type])throw new j["default"]("Unknown type: "+a.type,a);this.current&&this.parents.unshift(this.current),this.current=a;var b=this[a.type](a);return this.current=this.parents.shift(),!this.mutating||b?b:b!==!1?a:void 0}},Program:function(a){this.acceptArray(a.body)},MustacheStatement:e,Decorator:e,BlockStatement:f,DecoratorBlock:f,PartialStatement:g,PartialBlockStatement:function(a){g.call(this,a),this.acceptKey(a,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:e,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(a){this.acceptArray(a.pairs)},HashPair:function(a){this.acceptRequired(a,"value")}},b["default"]=d,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b){if(b=b.path?b.path.original:b,a.path.original!==b){var c={loc:a.path.loc};throw new q["default"](a.path.original+" doesn't match "+b,c)}}function e(a,b){this.source=a,this.start={line:b.first_line,column:b.first_column},this.end={line:b.last_line,column:b.last_column}}function f(a){return/^\[.*\]$/.test(a)?a.substring(1,a.length-1):a}function g(a,b){return{open:"~"===a.charAt(2),close:"~"===b.charAt(b.length-3)}}function h(a){return a.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function i(a,b,c){c=this.locInfo(c);for(var d=a?"@":"",e=[],f=0,g=0,h=b.length;g<h;g++){var i=b[g].part,j=b[g].original!==i;if(d+=(b[g].separator||"")+i,j||".."!==i&&"."!==i&&"this"!==i)e.push(i);else{if(e.length>0)throw new q["default"]("Invalid path: "+d,{loc:c});".."===i&&f++}}return{type:"PathExpression",data:a,depth:f,parts:e,original:d,loc:c}}function j(a,b,c,d,e,f){var g=d.charAt(3)||d.charAt(2),h="{"!==g&&"&"!==g,i=/\*/.test(d);return{type:i?"Decorator":"MustacheStatement",path:a,params:b,hash:c,escaped:h,strip:e,loc:this.locInfo(f)}}function k(a,b,c,e){d(a,c),e=this.locInfo(e);var f={type:"Program",body:b,strip:{},loc:e};return{type:"BlockStatement",path:a.path,params:a.params,hash:a.hash,program:f,openStrip:{},inverseStrip:{},closeStrip:{},loc:e}}function l(a,b,c,e,f,g){e&&e.path&&d(a,e);var h=/\*/.test(a.open);b.blockParams=a.blockParams;var i=void 0,j=void 0;if(c){if(h)throw new q["default"]("Unexpected inverse block on decorator",c);c.chain&&(c.program.body[0].closeStrip=e.strip),j=c.strip,i=c.program}return f&&(f=i,i=b,b=f),{type:h?"DecoratorBlock":"BlockStatement",path:a.path,params:a.params,hash:a.hash,program:b,inverse:i,openStrip:a.strip,inverseStrip:j,closeStrip:e&&e.strip,loc:this.locInfo(g)}}function m(a,b){if(!b&&a.length){var c=a[0].loc,d=a[a.length-1].loc;c&&d&&(b={source:c.source,start:{line:c.start.line,column:c.start.column},end:{line:d.end.line,column:d.end.column}})}return{type:"Program",body:a,strip:{},loc:b}}function n(a,b,c,e){return d(a,c),{type:"PartialBlockStatement",name:a.path,params:a.params,hash:a.hash,program:b,openStrip:a.strip,closeStrip:c&&c.strip,loc:this.locInfo(e)}}var o=c(1)["default"];b.__esModule=!0,b.SourceLocation=e,b.id=f,b.stripFlags=g,b.stripComment=h,b.preparePath=i,b.prepareMustache=j,b.prepareRawBlock=k,b.prepareBlock=l,b.prepareProgram=m,b.preparePartialBlock=n;var p=c(6),q=o(p)},function(a,b,c){"use strict";function d(){}function e(a,b,c){if(null==a||"string"!=typeof a&&"Program"!==a.type)throw new l["default"]("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+a);b=b||{},"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var d=c.parse(a,b),e=(new c.Compiler).compile(d,b);return(new c.JavaScriptCompiler).compile(e,b)}function f(a,b,c){function d(){var d=c.parse(a,b),e=(new c.Compiler).compile(d,b),f=(new c.JavaScriptCompiler).compile(e,b,void 0,!0);return c.template(f)}function e(a,b){return f||(f=d()),f.call(this,a,b)}if(void 0===b&&(b={}),null==a||"string"!=typeof a&&"Program"!==a.type)throw new l["default"]("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+a);b=m.extend({},b),"data"in b||(b.data=!0),b.compat&&(b.useDepths=!0);var f=void 0;return e._setup=function(a){return f||(f=d()),f._setup(a)},e._child=function(a,b,c,e){return f||(f=d()), 10363f._child(a,b,c,e)},e}function g(a,b){if(a===b)return!0;if(m.isArray(a)&&m.isArray(b)&&a.length===b.length){for(var c=0;c<a.length;c++)if(!g(a[c],b[c]))return!1;return!0}}function h(a){if(!a.path.parts){var b=a.path;a.path={type:"PathExpression",data:!1,depth:0,parts:[b.original+""],original:b.original+"",loc:b.loc}}}var i=c(74)["default"],j=c(1)["default"];b.__esModule=!0,b.Compiler=d,b.precompile=e,b.compile=f;var k=c(6),l=j(k),m=c(5),n=c(83),o=j(n),p=[].slice;d.prototype={compiler:d,equals:function(a){var b=this.opcodes.length;if(a.opcodes.length!==b)return!1;for(var c=0;c<b;c++){var d=this.opcodes[c],e=a.opcodes[c];if(d.opcode!==e.opcode||!g(d.args,e.args))return!1}b=this.children.length;for(var c=0;c<b;c++)if(!this.children[c].equals(a.children[c]))return!1;return!0},guid:0,compile:function(a,b){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=b,this.stringParams=b.stringParams,this.trackIds=b.trackIds,b.blockParams=b.blockParams||[],b.knownHelpers=m.extend(i(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0,lookup:!0},b.knownHelpers),this.accept(a)},compileProgram:function(a){var b=new this.compiler,c=b.compile(a,this.options),d=this.guid++;return this.usePartial=this.usePartial||c.usePartial,this.children[d]=c,this.useDepths=this.useDepths||c.useDepths,d},accept:function(a){if(!this[a.type])throw new l["default"]("Unknown type: "+a.type,a);this.sourceNode.unshift(a);var b=this[a.type](a);return this.sourceNode.shift(),b},Program:function(a){this.options.blockParams.unshift(a.blockParams);for(var b=a.body,c=b.length,d=0;d<c;d++)this.accept(b[d]);return this.options.blockParams.shift(),this.isSimple=1===c,this.blockParams=a.blockParams?a.blockParams.length:0,this},BlockStatement:function(a){h(a);var b=a.program,c=a.inverse;b=b&&this.compileProgram(b),c=c&&this.compileProgram(c);var d=this.classifySexpr(a);"helper"===d?this.helperSexpr(a,b,c):"simple"===d?(this.simpleSexpr(a),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("emptyHash"),this.opcode("blockValue",a.path.original)):(this.ambiguousSexpr(a,b,c),this.opcode("pushProgram",b),this.opcode("pushProgram",c),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue")),this.opcode("append")},DecoratorBlock:function(a){var b=a.program&&this.compileProgram(a.program),c=this.setupFullMustacheParams(a,b,void 0),d=a.path;this.useDecorators=!0,this.opcode("registerDecorator",c.length,d.original)},PartialStatement:function(a){this.usePartial=!0;var b=a.program;b&&(b=this.compileProgram(a.program));var c=a.params;if(c.length>1)throw new l["default"]("Unsupported number of partial arguments: "+c.length,a);c.length||(this.options.explicitPartialContext?this.opcode("pushLiteral","undefined"):c.push({type:"PathExpression",parts:[],depth:0}));var d=a.name.original,e="SubExpression"===a.name.type;e&&this.accept(a.name),this.setupFullMustacheParams(a,b,void 0,!0);var f=a.indent||"";this.options.preventIndent&&f&&(this.opcode("appendContent",f),f=""),this.opcode("invokePartial",e,d,f),this.opcode("append")},PartialBlockStatement:function(a){this.PartialStatement(a)},MustacheStatement:function(a){this.SubExpression(a),a.escaped&&!this.options.noEscape?this.opcode("appendEscaped"):this.opcode("append")},Decorator:function(a){this.DecoratorBlock(a)},ContentStatement:function(a){a.value&&this.opcode("appendContent",a.value)},CommentStatement:function(){},SubExpression:function(a){h(a);var b=this.classifySexpr(a);"simple"===b?this.simpleSexpr(a):"helper"===b?this.helperSexpr(a):this.ambiguousSexpr(a)},ambiguousSexpr:function(a,b,c){var d=a.path,e=d.parts[0],f=null!=b||null!=c;this.opcode("getContext",d.depth),this.opcode("pushProgram",b),this.opcode("pushProgram",c),d.strict=!0,this.accept(d),this.opcode("invokeAmbiguous",e,f)},simpleSexpr:function(a){var b=a.path;b.strict=!0,this.accept(b),this.opcode("resolvePossibleLambda")},helperSexpr:function(a,b,c){var d=this.setupFullMustacheParams(a,b,c),e=a.path,f=e.parts[0];if(this.options.knownHelpers[f])this.opcode("invokeKnownHelper",d.length,f);else{if(this.options.knownHelpersOnly)throw new l["default"]("You specified knownHelpersOnly, but used the unknown helper "+f,a);e.strict=!0,e.falsy=!0,this.accept(e),this.opcode("invokeHelper",d.length,e.original,o["default"].helpers.simpleId(e))}},PathExpression:function(a){this.addDepth(a.depth),this.opcode("getContext",a.depth);var b=a.parts[0],c=o["default"].helpers.scopedId(a),d=!a.depth&&!c&&this.blockParamIndex(b);d?this.opcode("lookupBlockParam",d,a.parts):b?a.data?(this.options.data=!0,this.opcode("lookupData",a.depth,a.parts,a.strict)):this.opcode("lookupOnContext",a.parts,a.falsy,a.strict,c):this.opcode("pushContext")},StringLiteral:function(a){this.opcode("pushString",a.value)},NumberLiteral:function(a){this.opcode("pushLiteral",a.value)},BooleanLiteral:function(a){this.opcode("pushLiteral",a.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(a){var b=a.pairs,c=0,d=b.length;for(this.opcode("pushHash");c<d;c++)this.pushParam(b[c].value);for(;c--;)this.opcode("assignToHash",b[c].key);this.opcode("popHash")},opcode:function(a){this.opcodes.push({opcode:a,args:p.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(a){a&&(this.useDepths=!0)},classifySexpr:function(a){var b=o["default"].helpers.simpleId(a.path),c=b&&!!this.blockParamIndex(a.path.parts[0]),d=!c&&o["default"].helpers.helperExpression(a),e=!c&&(d||b);if(e&&!d){var f=a.path.parts[0],g=this.options;g.knownHelpers[f]?d=!0:g.knownHelpersOnly&&(e=!1)}return d?"helper":e?"ambiguous":"simple"},pushParams:function(a){for(var b=0,c=a.length;b<c;b++)this.pushParam(a[b])},pushParam:function(a){var b=null!=a.value?a.value:a.original||"";if(this.stringParams)b.replace&&(b=b.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".")),a.depth&&this.addDepth(a.depth),this.opcode("getContext",a.depth||0),this.opcode("pushStringParam",b,a.type),"SubExpression"===a.type&&this.accept(a);else{if(this.trackIds){var c=void 0;if(!a.parts||o["default"].helpers.scopedId(a)||a.depth||(c=this.blockParamIndex(a.parts[0])),c){var d=a.parts.slice(1).join(".");this.opcode("pushId","BlockParam",c,d)}else b=a.original||b,b.replace&&(b=b.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"")),this.opcode("pushId",a.type,b)}this.accept(a)}},setupFullMustacheParams:function(a,b,c,d){var e=a.params;return this.pushParams(e),this.opcode("pushProgram",b),this.opcode("pushProgram",c),a.hash?this.accept(a.hash):this.opcode("emptyHash",d),e},blockParamIndex:function(a){for(var b=0,c=this.options.blockParams.length;b<c;b++){var d=this.options.blockParams[b],e=d&&m.indexOf(d,a);if(d&&e>=0)return[b,e]}}}},function(a,b,c){"use strict";function d(a){this.value=a}function e(){}function f(a,b,c,d,e){var f=b.popStack(),g=c.length;a&&g--;for(var h=d;h<g;h++)f=b.nameLookup(f,c[h],e);return a?[b.aliasable("container.strict"),"(",f,", ",b.quotedString(c[g]),", ",JSON.stringify(b.source.currentLocation)," )"]:f}var g=c(60)["default"],h=c(1)["default"];b.__esModule=!0;var i=c(4),j=c(6),k=h(j),l=c(5),m=c(91),n=h(m);e.prototype={nameLookup:function(a,b){return this.internalNameLookup(a,b)},depthedLookup:function(a){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(a),")"]},compilerInfo:function(){var a=i.COMPILER_REVISION,b=i.REVISION_CHANGES[a];return[a,b]},appendToBuffer:function(a,b,c){return l.isArray(a)||(a=[a]),a=this.source.wrap(a,b),this.environment.isSimple?["return ",a,";"]:c?["buffer += ",a,";"]:(a.appendToBuffer=!0,a)},initializeBuffer:function(){return this.quotedString("")},internalNameLookup:function(a,b){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",a,",",JSON.stringify(b),")"]},lookupPropertyFunctionIsUsed:!1,compile:function(a,b,c,d){this.environment=a,this.options=b,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!d,this.name=this.environment.name,this.isChild=!!c,this.context=c||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(a,b),this.useDepths=this.useDepths||a.useDepths||a.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||a.useBlockParams;var e=a.opcodes,f=void 0,g=void 0,h=void 0,i=void 0;for(h=0,i=e.length;h<i;h++)f=e[h],this.source.currentLocation=f.loc,g=g||f.loc,this[f.opcode].apply(this,f.args);if(this.source.currentLocation=g,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new k["default"]("Compile completed with content left on stack");this.decorators.isEmpty()?this.decorators=void 0:(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),";\n"]),this.decorators.push("return fn;"),d?this.decorators=Function.apply(this,["fn","props","container","depth0","data","blockParams","depths",this.decorators.merge()]):(this.decorators.prepend("function(fn, props, container, depth0, data, blockParams, depths) {\n"),this.decorators.push("}\n"),this.decorators=this.decorators.merge()));var j=this.createFunctionContext(d);if(this.isChild)return j;var l={compiler:this.compilerInfo(),main:j};this.decorators&&(l.main_d=this.decorators,l.useDecorators=!0);var m=this.context,n=m.programs,o=m.decorators;for(h=0,i=n.length;h<i;h++)l[h]=n[h],o[h]&&(l[h+"_d"]=o[h],l.useDecorators=!0);return this.environment.usePartial&&(l.usePartial=!0),this.options.data&&(l.useData=!0),this.useDepths&&(l.useDepths=!0),this.useBlockParams&&(l.useBlockParams=!0),this.options.compat&&(l.compat=!0),d?l.compilerOptions=this.options:(l.compiler=JSON.stringify(l.compiler),this.source.currentLocation={start:{line:1,column:0}},l=this.objectLiteral(l),b.srcName?(l=l.toStringWithSourceMap({file:b.destName}),l.map=l.map&&l.map.toString()):l=l.toString()),l},preamble:function(){this.lastContext=0,this.source=new n["default"](this.options.srcName),this.decorators=new n["default"](this.options.srcName)},createFunctionContext:function(a){var b=this,c="",d=this.stackVars.concat(this.registers.list);d.length>0&&(c+=", "+d.join(", "));var e=0;g(this.aliases).forEach(function(a){var d=b.aliases[a];d.children&&d.referenceCount>1&&(c+=", alias"+ ++e+"="+a,d.children[0]="alias"+e)}),this.lookupPropertyFunctionIsUsed&&(c+=", "+this.lookupPropertyFunctionVarDeclaration());var f=["container","depth0","helpers","partials","data"];(this.useBlockParams||this.useDepths)&&f.push("blockParams"),this.useDepths&&f.push("depths");var h=this.mergeSource(c);return a?(f.push(h),Function.apply(this,f)):this.source.wrap(["function(",f.join(","),") {\n ",h,"}"])},mergeSource:function(a){var b=this.environment.isSimple,c=!this.forceBuffer,d=void 0,e=void 0,f=void 0,g=void 0;return this.source.each(function(a){a.appendToBuffer?(f?a.prepend(" + "):f=a,g=a):(f&&(e?f.prepend("buffer += "):d=!0,g.add(";"),f=g=void 0),e=!0,b||(c=!1))}),c?f?(f.prepend("return "),g.add(";")):e||this.source.push('return "";'):(a+=", buffer = "+(d?"":this.initializeBuffer()),f?(f.prepend("return buffer + "),g.add(";")):this.source.push("return buffer;")),a&&this.source.prepend("var "+a.substring(2)+(d?"":";\n")),this.source.merge()},lookupPropertyFunctionVarDeclaration:function(){return"\n lookupProperty = container.lookupProperty || function(parent, propertyName) {\n if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {\n return parent[propertyName];\n }\n return undefined\n }\n ".trim()},blockValue:function(a){var b=this.aliasable("container.hooks.blockHelperMissing"),c=[this.contextName(0)];this.setupHelperArgs(a,0,c);var d=this.popStack();c.splice(1,0,d),this.push(this.source.functionCall(b,"call",c))},ambiguousBlockValue:function(){var a=this.aliasable("container.hooks.blockHelperMissing"),b=[this.contextName(0)];this.setupHelperArgs("",0,b,!0),this.flushInline();var c=this.topStack();b.splice(1,0,c),this.pushSource(["if (!",this.lastHelper,") { ",c," = ",this.source.functionCall(a,"call",b),"}"])},appendContent:function(a){this.pendingContent?a=this.pendingContent+a:this.pendingLocation=this.source.currentLocation,this.pendingContent=a},append:function(){if(this.isInline())this.replaceStack(function(a){return[" != null ? ",a,' : ""']}),this.pushSource(this.appendToBuffer(this.popStack()));else{var a=this.popStack();this.pushSource(["if (",a," != null) { ",this.appendToBuffer(a,void 0,!0)," }"]),this.environment.isSimple&&this.pushSource(["else { ",this.appendToBuffer("''",void 0,!0)," }"])}},appendEscaped:function(){this.pushSource(this.appendToBuffer([this.aliasable("container.escapeExpression"),"(",this.popStack(),")"]))},getContext:function(a){this.lastContext=a},pushContext:function(){this.pushStackLiteral(this.contextName(this.lastContext))},lookupOnContext:function(a,b,c,d){var e=0;d||!this.options.compat||this.lastContext?this.pushContext():this.push(this.depthedLookup(a[e++])),this.resolvePath("context",a,e,b,c)},lookupBlockParam:function(a,b){this.useBlockParams=!0,this.push(["blockParams[",a[0],"][",a[1],"]"]),this.resolvePath("context",b,1)},lookupData:function(a,b,c){a?this.pushStackLiteral("container.data(data, "+a+")"):this.pushStackLiteral("data"),this.resolvePath("data",b,0,!0,c)},resolvePath:function(a,b,c,d,e){var g=this;if(this.options.strict||this.options.assumeObjects)return void this.push(f(this.options.strict&&e,this,b,c,a));for(var h=b.length,i=function(c){g.replaceStack(function(e){var f=g.nameLookup(e,b[c],a);return d?[" && ",f]:[" != null ? ",f," : ",e]})},j=c;j<h;j++)i(j)},resolvePossibleLambda:function(){this.push([this.aliasable("container.lambda"),"(",this.popStack(),", ",this.contextName(0),")"])},pushStringParam:function(a,b){this.pushContext(),this.pushString(b),"SubExpression"!==b&&("string"==typeof a?this.pushString(a):this.pushStackLiteral(a))},emptyHash:function(a){this.trackIds&&this.push("{}"),this.stringParams&&(this.push("{}"),this.push("{}")),this.pushStackLiteral(a?"undefined":"{}")},pushHash:function(){this.hash&&this.hashes.push(this.hash),this.hash={values:{},types:[],contexts:[],ids:[]}},popHash:function(){var a=this.hash;this.hash=this.hashes.pop(),this.trackIds&&this.push(this.objectLiteral(a.ids)),this.stringParams&&(this.push(this.objectLiteral(a.contexts)),this.push(this.objectLiteral(a.types))),this.push(this.objectLiteral(a.values))},pushString:function(a){this.pushStackLiteral(this.quotedString(a))},pushLiteral:function(a){this.pushStackLiteral(a)},pushProgram:function(a){null!=a?this.pushStackLiteral(this.programExpression(a)):this.pushStackLiteral(null)},registerDecorator:function(a,b){var c=this.nameLookup("decorators",b,"decorator"),d=this.setupHelperArgs(b,a);this.decorators.push(["var decorator = ",c,";"]),this.decorators.push(['if (typeof decorator !== "function") { throw new Error(',this.quotedString('Missing decorator: "'+b+'"'),"); }"]),this.decorators.push(["fn = ",this.decorators.functionCall("decorator","",["fn","props","container",d])," || fn;"])},invokeHelper:function(a,b,c){var d=this.popStack(),e=this.setupHelper(a,b),f=[];c&&f.push(e.name),f.push(d),this.options.strict||f.push(this.aliasable("container.hooks.helperMissing"));var g=["(",this.itemsSeparatedBy(f,"||"),")"],h=this.source.functionCall(g,"call",e.callParams);this.push(h)},itemsSeparatedBy:function(a,b){var c=[];c.push(a[0]);for(var d=1;d<a.length;d++)c.push(b,a[d]);return c},invokeKnownHelper:function(a,b){var c=this.setupHelper(a,b);this.push(this.source.functionCall(c.name,"call",c.callParams))},invokeAmbiguous:function(a,b){this.useRegister("helper");var c=this.popStack();this.emptyHash();var d=this.setupHelper(0,a,b),e=this.lastHelper=this.nameLookup("helpers",a,"helper"),f=["(","(helper = ",e," || ",c,")"];this.options.strict||(f[0]="(helper = ",f.push(" != null ? helper : ",this.aliasable("container.hooks.helperMissing"))),this.push(["(",f,d.paramsInit?["),(",d.paramsInit]:[],"),","(typeof helper === ",this.aliasable('"function"')," ? ",this.source.functionCall("helper","call",d.callParams)," : helper))"])},invokePartial:function(a,b,c){var d=[],e=this.setupParams(b,1,d);a&&(b=this.popStack(),delete e.name),c&&(e.indent=JSON.stringify(c)),e.helpers="helpers",e.partials="partials",e.decorators="container.decorators",a?d.unshift(b):d.unshift(this.nameLookup("partials",b,"partial")),this.options.compat&&(e.depths="depths"),e=this.objectLiteral(e),d.push(e),this.push(this.source.functionCall("container.invokePartial","",d))},assignToHash:function(a){var b=this.popStack(),c=void 0,d=void 0,e=void 0;this.trackIds&&(e=this.popStack()),this.stringParams&&(d=this.popStack(),c=this.popStack());var f=this.hash;c&&(f.contexts[a]=c),d&&(f.types[a]=d),e&&(f.ids[a]=e),f.values[a]=b},pushId:function(a,b,c){"BlockParam"===a?this.pushStackLiteral("blockParams["+b[0]+"].path["+b[1]+"]"+(c?" + "+JSON.stringify("."+c):"")):"PathExpression"===a?this.pushString(b):"SubExpression"===a?this.pushStackLiteral("true"):this.pushStackLiteral("null")},compiler:e,compileChildren:function(a,b){for(var c=a.children,d=void 0,e=void 0,f=0,g=c.length;f<g;f++){d=c[f],e=new this.compiler;var h=this.matchExistingProgram(d);if(null==h){var i=this.context.programs.push("")-1;d.index=i,d.name="program"+i,this.context.programs[i]=e.compile(d,b,this.context,!this.precompile),this.context.decorators[i]=e.decorators,this.context.environments[i]=d,this.useDepths=this.useDepths||e.useDepths,this.useBlockParams=this.useBlockParams||e.useBlockParams,d.useDepths=this.useDepths,d.useBlockParams=this.useBlockParams}else d.index=h.index,d.name="program"+h.index,this.useDepths=this.useDepths||h.useDepths,this.useBlockParams=this.useBlockParams||h.useBlockParams}},matchExistingProgram:function(a){for(var b=0,c=this.context.environments.length;b<c;b++){var d=this.context.environments[b];if(d&&d.equals(a))return d}},programExpression:function(a){var b=this.environment.children[a],c=[b.index,"data",b.blockParams];return(this.useBlockParams||this.useDepths)&&c.push("blockParams"),this.useDepths&&c.push("depths"),"container.program("+c.join(", ")+")"},useRegister:function(a){this.registers[a]||(this.registers[a]=!0,this.registers.list.push(a))},push:function(a){return a instanceof d||(a=this.source.wrap(a)),this.inlineStack.push(a),a},pushStackLiteral:function(a){this.push(new d(a))},pushSource:function(a){this.pendingContent&&(this.source.push(this.appendToBuffer(this.source.quotedString(this.pendingContent),this.pendingLocation)),this.pendingContent=void 0),a&&this.source.push(a)},replaceStack:function(a){var b=["("],c=void 0,e=void 0,f=void 0;if(!this.isInline())throw new k["default"]("replaceStack on non-inline");var g=this.popStack(!0);if(g instanceof d)c=[g.value],b=["(",c],f=!0;else{e=!0;var h=this.incrStack();b=["((",this.push(h)," = ",g,")"],c=this.topStack()}var i=a.call(this,c);f||this.popStack(),e&&this.stackSlot--,this.push(b.concat(i,")"))},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var a=this.inlineStack;this.inlineStack=[];for(var b=0,c=a.length;b<c;b++){var e=a[b];if(e instanceof d)this.compileStack.push(e);else{var f=this.incrStack();this.pushSource([f," = ",e,";"]),this.compileStack.push(f)}}},isInline:function(){return this.inlineStack.length},popStack:function(a){var b=this.isInline(),c=(b?this.inlineStack:this.compileStack).pop();if(!a&&c instanceof d)return c.value;if(!b){if(!this.stackSlot)throw new k["default"]("Invalid stack pop");this.stackSlot--}return c},topStack:function(){var a=this.isInline()?this.inlineStack:this.compileStack,b=a[a.length-1];return b instanceof d?b.value:b},contextName:function(a){return this.useDepths&&a?"depths["+a+"]":"depth"+a},quotedString:function(a){return this.source.quotedString(a)},objectLiteral:function(a){return this.source.objectLiteral(a)},aliasable:function(a){var b=this.aliases[a];return b?(b.referenceCount++,b):(b=this.aliases[a]=this.source.wrap(a),b.aliasable=!0,b.referenceCount=1,b)},setupHelper:function(a,b,c){var d=[],e=this.setupHelperArgs(b,a,d,c),f=this.nameLookup("helpers",b,"helper"),g=this.aliasable(this.contextName(0)+" != null ? "+this.contextName(0)+" : (container.nullContext || {})");return{params:d,paramsInit:e,name:f,callParams:[g].concat(d)}},setupParams:function(a,b,c){var d={},e=[],f=[],g=[],h=!c,i=void 0;h&&(c=[]),d.name=this.quotedString(a),d.hash=this.popStack(),this.trackIds&&(d.hashIds=this.popStack()),this.stringParams&&(d.hashTypes=this.popStack(),d.hashContexts=this.popStack());var j=this.popStack(),k=this.popStack();(k||j)&&(d.fn=k||"container.noop",d.inverse=j||"container.noop");for(var l=b;l--;)i=this.popStack(),c[l]=i,this.trackIds&&(g[l]=this.popStack()),this.stringParams&&(f[l]=this.popStack(),e[l]=this.popStack());return h&&(d.args=this.source.generateArray(c)),this.trackIds&&(d.ids=this.source.generateArray(g)),this.stringParams&&(d.types=this.source.generateArray(f),d.contexts=this.source.generateArray(e)),this.options.data&&(d.data="data"),this.useBlockParams&&(d.blockParams="blockParams"),d},setupHelperArgs:function(a,b,c,d){var e=this.setupParams(a,b,c);return e.loc=JSON.stringify(this.source.currentLocation),e=this.objectLiteral(e),d?(this.useRegister("options"),c.push("options"),["options=",e]):c?(c.push(e),""):e}},function(){for(var a="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield await null true false".split(" "),b=e.RESERVED_WORDS={},c=0,d=a.length;c<d;c++)b[a[c]]=!0}(),e.isValidJavaScriptVariableName=function(a){return!e.RESERVED_WORDS[a]&&/^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(a)},b["default"]=e,a.exports=b["default"]},function(a,b,c){"use strict";function d(a,b,c){if(g.isArray(a)){for(var d=[],e=0,f=a.length;e<f;e++)d.push(b.wrap(a[e],c));return d}return"boolean"==typeof a||"number"==typeof a?a+"":a}function e(a){this.srcFile=a,this.source=[]}var f=c(60)["default"];b.__esModule=!0;var g=c(5),h=void 0;try{}catch(i){}h||(h=function(a,b,c,d){this.src="",d&&this.add(d)},h.prototype={add:function(a){g.isArray(a)&&(a=a.join("")),this.src+=a},prepend:function(a){g.isArray(a)&&(a=a.join("")),this.src=a+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}}),e.prototype={isEmpty:function(){return!this.source.length},prepend:function(a,b){this.source.unshift(this.wrap(a,b))},push:function(a,b){this.source.push(this.wrap(a,b))},merge:function(){var a=this.empty();return this.each(function(b){a.add([" ",b,"\n"])}),a},each:function(a){for(var b=0,c=this.source.length;b<c;b++)a(this.source[b])},empty:function(){var a=this.currentLocation||{start:{}};return new h(a.start.line,a.start.column,this.srcFile)},wrap:function(a){var b=arguments.length<=1||void 0===arguments[1]?this.currentLocation||{start:{}}:arguments[1];return a instanceof h?a:(a=d(a,this,b),new h(b.start.line,b.start.column,this.srcFile,a))},functionCall:function(a,b,c){return c=this.generateList(c),this.wrap([a,b?"."+b+"(":"(",c,")"])},quotedString:function(a){return'"'+(a+"").replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(a){var b=this,c=[];f(a).forEach(function(e){var f=d(a[e],b);"undefined"!==f&&c.push([b.quotedString(e),":",f])});var e=this.generateList(c);return e.prepend("{"),e.add("}"),e},generateList:function(a){for(var b=this.empty(),c=0,e=a.length;c<e;c++)c&&b.add(","),b.add(d(a[c],this));return b},generateArray:function(a){var b=this.generateList(a);return b.prepend("["),b.add("]"),b}},b["default"]=e,a.exports=b["default"]}])});
10363 10364var ACT = ACT || {}; 10365var Modernizr = Modernizr || undefined; 10366ACT.Utils = (function ($, $MZ, undefined) { 10367 10368 var debounce = function (func, wait, immediate) { 10369 var timeout; 10370 return function () { 10371 var context = this; 10372 var args = arguments; 10373 var later = function () { 10374 timeout = null; 10375 if (!immediate) 10376 func.apply(context, args); 10377 }; 10378 var callNow = immediate && !timeout; 10379 clearTimeout(timeout); 10380 timeout = setTimeout(later, wait); 10381 if (callNow) 10382 func.apply(context, args); 10383 }; 10384 }; 10385 10386 var getVideoHeight = function (width, aspectRatio) { 10387 var height; 10388 10389 if (aspectRatio == 'widescreen') { 10390 height = (width / 16) * 9; 10391 } else { 10392 height = (width / 4) * 3; 10393 } 10394 10395 return height; 10396 }; 10397 10398 var adjustVideoHeight = function (videoId, aspectRatio) { 10399 var containerWidth = parseInt($("#" + videoId).width()); 10400 var containerHeight = this.getVideoHeight(containerWidth, aspectRatio); 10401 10402 $("#" + videoId).height(containerHeight).css('line-height', 10403 containerHeight + 'px').find(".thumbnail-video-container") 10404 .height(containerHeight); 10405 }; 10406 10407 /* 10408 * register listener to wait for final event before executing callback on 10409 * event handler. specially useful in events like resize which during 10410 * transition can call callback method 4-5 times which is of no use. 10411 */ 10412 var waitForFinalEvent = (function () { 10413 var timers = {}; 10414 return function (callback, ms, uniqueId) { 10415 if (!uniqueId) { 10416 uniqueId = getUUID(); 10417 } 10418 if (timers[uniqueId]) { 10419 clearTimeout(timers[uniqueId]); 10420 } 10421 timers[uniqueId] = setTimeout(callback, ms); 10422 }; 10423 })(); 10424 10425 var getDayOfWeek = function (index) { 10426 var weekDays = [ "Sunday", "Monday", "Tuesday", "Wednesday", 10427 "Thursday", "Friday", "Saturday" ]; 10428 10429 return weekDays[index]; 10430 }; 10431 10432 var getDayOfWeekAbbrev = function (index) { 10433 var weekDays = [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ]; 10434 10435 return weekDays[index]; 10436 }; 10437 10438 var getUrlParameter = function getUrlParameter(sParam) { 10439 var sPageURL = decodeURIComponent(window.location.search.substring(1)), sURLVariables = sPageURL 10440 .split('&'), sParameterName, i; 10441 for (i = 0; i < sURLVariables.length; i++) { 10442 sParameterName = sURLVariables[i].split('='); 10443 10444 if (sParameterName[0] === sParam) { 10445 return sParameterName[1] === undefined ? true 10446 : sParameterName[1]; 10447 } 10448 } 10449 }; 10450 10451 /* get unique ID */ 10452 var getUUID = function () { 10453 var d = new Date().getTime(); 10454 var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, 10455 function (c) { 10456 var r = (d + Math.random() * 16) % 16 | 0; 10457 d = Math.floor(d / 16); 10458 return (c == 'x' ? r : (r & 0x3 | 0x8)).toString(16); 10459 }); 10460 return uuid; 10461 }; 10462 10463 var EMPTY_STRING = ""; 10464 var isEmpty = function (object) { 10465 if (object == null) { 10466 return true; 10467 } else if (typeof object === 'undefined') { 10468 return true; 10469 } else if (typeof object === 'string' && object.trim() === "") { 10470 return true; 10471 } else { 10472 return false; 10473 } 10474 }; 10475 10476 var isNotEmpty = function (object) { 10477 return !isEmpty(object); 10478 }; 10479 10480 var isArray = function (object) { 10481 if (isNotEmpty(object) 10482 && Object.prototype.toString.call(object) === '[object Array]') { 10483 return true; 10484 } else { 10485 return false; 10486 } 10487 }; 10488 10489 var isNotArray = function (object) { 10490 return !isArray(object); 10491 }; 10492 10493 var getString = function (object) { 10494 if (isNotEmpty(object) && typeof object === 'string') { 10495 return object; 10496 } else if (isNotEmpty(object) && typeof object !== 'string') { 10497 return EMPTY_STRING + object; 10498 } else { 10499 return EMPTY_STRING; 10500 } 10501 }; 10502 10503 var getHashCode = function (value) { 10504 var types = { 10505 'string' : hash, 10506 'number' : hash, 10507 'boolean' : hash, 10508 'object' : object 10509 // functions are excluded because they are not representative of the 10510 // state of an object 10511 // types 'undefined' or 'null' will have a hash of 0 10512 }; 10513 var type = typeof value; 10514 10515 return value != null && types[type] ? types[type](value) + hash(type) 10516 : 0; 10517 }; 10518 10519 /** 10520 * Turns a url into "a" element, which can then by used to extract 10521 * properties: protocol, hostname, pathname, and port 10522 * 10523 * @param {string} 10524 * url - An internet address 10525 */ 10526 var getLocation = function (url) { 10527 var loc = document.createElement("a"); 10528 loc.href = url; 10529 return loc; 10530 }; 10531 10532 /** 10533 * Extract the domain from a url 10534 * 10535 * @param {string} 10536 * url - An internet address 10537 */ 10538 var extractDomain = function (url) { 10539 return getLocation(url).hostname; 10540 }; 10541 10542 var servletDirectory = "services"; 10543 10544 /** 10545 * Returns a path including protocol, domain, directory based on the url 10546 * passed in. This path can then be prefixed to the servlet being called. 10547 * 10548 * Examples: getServletPath('http://domain-a/en.html') - would return 10549 * 'http://domain-a/services/' getServletPath('https://domain-b/en.html') - 10550 * would return 'https://domain-b/services/'
10551 * getServletPath('http://domain-c/en.html', true) - would return 10552 * 'https://domain-c/services/' 10553 * 10554 * @param {string} 10555 * url - An internet address 10556 * @param {string} 10557 * forceSSL - Force the servlet path to use ssl, defaults to 10558 * false 10559 */ 10560 var getServletPath = function (url, forceSSL) { 10561 var forceSSL = typeof forceSSL != 'undefined' ? forceSSL : false; 10562 var path; 10563 var urlParts = getLocation(url); 10564 10565 if (forceSSL && urlParts.hostname.indexOf("localhost") == -1) 10566 path = "https://"; 10567 else 10568 path = urlParts.protocol + "//"; 10569 10570 path += urlParts.hostname; 10571 10572 if (urlParts.port.length 10573 && (urlParts.port == '4502' || urlParts.port == '4503')) 10574 path += ":" + urlParts.port; 10575 10576 path += "/" + servletDirectory + "/"; 10577 10578 return path; 10579 }; 10580 10581 var hasOwnProperty = Object.prototype.hasOwnProperty; 10582 10583 // Hashes a string 10584 var hash = function (string) { 10585 var string = string.toString(); 10586 var hash = 0; 10587 var i; 10588 for (i = 0; i < string.length; i++) { 10589 hash = (((hash << 5) - hash) + string.charCodeAt(i)) & 0xFFFFFFFF; 10590 } 10591 10592 return hash; 10593 }; 10594 10595/** 10596 * Returns whether the current screen is mobile, tablet or desktop base on 10597 * screen width. Sizes correspond with bootstrap breakpoints. 10598 */ 10599 var getBootstrapScreenSize = function () { 10600 var width = $(window).width(); 10601 10602 if (width < 768) 10603 return "mobile"; 10604 else if (width < 992) 10605 return "tablet"; 10606 else 10607 return "desktop"; 10608 }; 10609 10610 /** 10611 * Returns whether the current screen is mobile based on bootstrap 10612 * breakpoint. 10613 */ 10614 var isBootstrapMobile = function () { 10615 if (getBootstrapScreenSize() == "mobile") { 10616 return true; 10617 } 10618 return false; 10619 }; 10620 10621 /** 10622 * Returns whether the current screen is tablet based on bootstrap 10623 * breakpoint. 10624 */ 10625 var isBootstrapTablet = function () { 10626 if (getBootstrapScreenSize() == "tablet") { 10627 return true; 10628 } 10629 10630 return false; 10631 }; 10632 10633 /** 10634 * Returns whether the current screen is desktop based on bootstrap 10635 * breakpoint. 10636 */ 10637 var isBootstrapDesktop = function () { 10638 if (getBootstrapScreenSize() == "desktop") { 10639 return true; 10640 } 10641 10642 return false; 10643 }; 10644 10645 // Deep hashes an object 10646 var object = function (obj) { 10647 var result = 0; 10648 for ( var property in obj) { 10649 if (hasOwnProperty.call(obj, property)) { 10650 result += hash(property + value(obj[property])); 10651 } 10652 } 10653 return result; 10654 }; 10655 10656 var parseResponseHeaders = function (headerStr) { 10657 var headers = {}; 10658 if (!headerStr) { 10659 return headers; 10660 } 10661 var headerPairs = headerStr.split('\u000d\u000a'); 10662 for (var i = 0, ilen = headerPairs.length; i < ilen; i++) { 10663 var headerPair = headerPairs[i]; 10664 var index = headerPair.indexOf('\u003a\u0020'); 10665 if (index > 0) { 10666 var key = headerPair.substring(0, index).toLowerCase(); 10667 var val = headerPair.substring(index + 2); 10668 headers[key] = val; 10669 } 10670 } 10671 return headers; 10672 }; 10673 10674 return { 10675 debounce : debounce, 10676 waitForFinalEvent : waitForFinalEvent, 10677 getDayOfWeekAbbrev : getDayOfWeekAbbrev, 10678 getDayOfWeek : getDayOfWeek, 10679 getUUID : getUUID, 10680 getUrlParameter : getUrlParameter, 10681 waitForFinalEvent : waitForFinalEvent, 10682 isBootstrapMobile : isBootstrapMobile, 10683 isBootstrapTablet : isBootstrapTablet, 10684 isBootstrapDesktop : isBootstrapDesktop, 10685 isEmpty : isEmpty, 10686 isNotEmpty : isNotEmpty, 10687 isArray : isArray, 10688 isNotArray : isNotArray, 10689 getString : getString, 10690 getServletPath : getServletPath, 10691 hashCode : getHashCode, 10692 extractDomain : extractDomain, 10693 getVideoHeight : getVideoHeight, 10694 adjustVideoHeight : adjustVideoHeight, 10695 parseResponseHeaders : parseResponseHeaders 10696 }; 10697 10698})(jQuery, Modernizr); 10699function ACT_AdaptiveImage(uuid, backgroundImage, defaultImage) { 10700 var id = "#" + uuid;
10701 var isBackgroundImage = backgroundImage != undefined ? backgroundImage : false; 10702 var currentWidth = 99999; 10703 var imagePath = defaultImage; 10704 10705 $(id + " > .adaptive-image").each(function() { 10706 var c1 = parseInt($(this).data("width")) >= parseInt($(window).width()); 10707 var c2 = parseInt($(this).data("width")) < parseInt(currentWidth); 10708 if (c1 && c2) { 10709 imagePath = $(this).data("path"); 10710 currentWidth = parseInt($(this).data("width")); 10711 } 10712 }); 10713 10714 if (imagePath.length) { 10715 if (isBackgroundImage) { 10716 $(id).css("background-image", "url(" + imagePath + ")"); 10717 } 10718 else { 10719 $(id + " > img").attr("data-src", imagePath); 10720 } 10721 } 10722} 10723 10724var ACT = ACT || {}; 10725ACT.BackToTop = (function () { 10726 var defaults = { 10727 "minimumHeight" : 0, 10728 "scollToTopId" : "backToTop", 10729 "showScrollToTopOffset" : 60 10730 }; 10731 var options = {}; 10732 10733 /** 10734 * Set the options based on what was passed in and the defaults 10735 * 10736 * @param {json} 10737 * opts - Json object of options 10738 * 10739 * returns void 10740 */ 10741 var defaultOptions = function (opts) { 10742 for ( var prop in defaults) { 10743 if (typeof opts != "undefined" && typeof opts[prop] != "undefined") { 10744 options[prop] = opts[prop]; 10745 } else { 10746 options[prop] = defaults[prop]; 10747 } 10748 } 10749 }; 10750 10751 /** 10752 * Init the script with the passed in options 10753 * 10754 * @param {json} 10755 * opts - Json object of options 10756 * 10757 * returns void 10758 */ 10759 var init = function (opts) { 10760 defaultOptions(opts); 10761 }; 10762 10763 /** 10764 * Hide scroll to top button 10765 * 10766 * returns void 10767 */ 10768 var hideScrollToTop = function () { 10769 document.getElementById(options.scollToTopId).style.display = "none"; 10770 }; 10771 10772 /** 10773 * Displays or hides the scroll to top based on document height and scroll 10774 * top offset 10775 * 10776 * returns void 10777 */ 10778 var scrollFunction = function () { 10779 var height = Math.max(document.body.scrollHeight, 10780 document.body.offsetHeight, 10781 document.documentElement.clientHeight, 10782 document.documentElement.scrollHeight, 10783 document.documentElement.offsetHeight); 10784 10785 if (height >= options.minimumHeight 10786 && (document.body.scrollTop > options.showScrollToTopOffset || document.documentElement.scrollTop > options.showScrollToTopOffset)) { 10787 showScrollToTop(); 10788 } else { 10789 hideScrollToTop(); 10790 } 10791 }; 10792 10793 /** 10794 * Scroll to top of page 10795 * 10796 * returns void 10797 */ 10798 var scrollToTop = function () { 10799 document.body.scrollTop = 0; 10800 document.documentElement.scrollTop = 0; 10801 }; 10802 10803 /** 10804 * Show scroll to top button 10805 * 10806 * returns void 10807 */ 10808 var showScrollToTop = function () { 10809 document.getElementById(options.scollToTopId).style.display = "block"; 10810 }; 10811 10812 return { 10813 init : init, 10814 scrollFunction : scrollFunction, 10815 scrollToTop : scrollToTop 10816 }; 10817})(); 10818 10819$(document).ready(function () { 10820 ACT.BackToTop.init(); 10821 $(window).scroll(function () { 10822 ACT.BackToTop.scrollFunction(); 10823 }); 10824 $("#scrollToTop").on("click", function () { 10825 ACT.BackToTop.scrollToTop(); 10826 }); 10827}); 10828var ACT = ACT || {}; 10829ACT.doCookieConsent = function (countryCode) { 10830 var law = new cookieconsent.Law({}); 10831 var countryOpts = law.get(countryCode.code); 10832 var type = "informational"; 10833 var message = "This website uses cookies to ensure you get the best experience. To learn more visit our privacy policy. If you continue to use our website, that means you consent to the use of cookies."; 10834 10835 if (countryOpts.hasLaw) { 10836 type = "opt-out"; 10837 message = "This website uses cookies to ensure your get the best experience. To learn more visit our privacy policy. Click âI agreeâ to receive our recommended website experience, or choose the opt-out option to disable non-essential website cookies."; 10838 } 10839 10840 var cookieConsentOptions = { 10841 "palette" : { 10842 "popup" : { 10843 "background" : "#000000" 10844 }, 10845 "button" : { 10846 "background" : "#107F9E" 10847 } 10848 }, 10849 "type" : type, 10850 "content" : { 10851 "message" : message, 10852 "dismiss" : "I Agree", 10853 "deny" : "Opt out", 10854 "href" : "http://www.act.org/content/act/en/privacy-policy.html" 10855 }, 10856 onInitialise : function (status) { 10857 var type = this.options.type; 10858 var didConsent = this.hasConsented(); 10859 if (didConsent) { 10860 ACT.CookieManager.loadScripts(); 10861 } 10862 if (!didConsent) { 10863 ACT.CookieManager.removeCookies(); 10864 // disable cookies 10865 } 10866 }, 10867 onStatusChange : function (status, chosenBefore) { 10868 var type = this.options.type; 10869 var didConsent = this.hasConsented(); 10870 10871 if (didConsent) { 10872 ACT.CookieManager.loadScripts(); 10873 } 10874 if (!didConsent) { 10875 ACT.CookieManager.removeCookies(); 10876 } 10877 } 10878 }; 10879 cookieconsent.initialise(cookieConsentOptions); 10880}; 10881var ACT = ACT || {}; 10882ACT.CookieManager = (function ($) { 10883 // Array of cookies that should be removed when user opts out 10884 var cookieNames = [ 10885 "s_vnum", 10886 "s_cc", 10887 "__ar_v4", 10888 "_sdsat_landing_page", 10889 "_sdsat_session_count", 10890 "_sdsat_lt_pages_viewed", 10891 "_sdsat_pages_viewed", 10892 "_sdsat_traffic_source", 10893 "mbox", 10894 "_sdsat_Visit Number", 10895 "_sdsat_Days Since Last Visit", 10896 "AMCVS_06E7EB4D5537B6B80A4C98A5%40AdobeOrg", 10897 "__sharethis_cookie_test__", 10898 "__unam", 10899 "s_getNewRepeat", 10900 "s_invisit", 10901 "gpv_pn", 10902 "_sdsat_days_since_count", 10903 "_sdsat_days_since_count_s", 10904 "AMCV_06E7EB4D5537B6B80A4C98A5%40AdobeOrg", 10905 "_ga", 10906 "_gid", 10907 "visitor_id311641", 10908 "visitor_id311641-hash", 10909 "__ar_v4", 10910 ]; 10911 10912 /** 10913 * Load java script libraries 10914 * 10915 * returns void 10916 */ 10917 var loadScripts = function () { 10918 adrollScript(); 10919 adwordsScript(); 10920 pardotScript(); 10921 twitterPixelScript(); 10922 if ($("#stitchologyEnabled").length) { 10923 stitchologyCore(); 10924 stitchologyScroll(); 10925 stitchologyRageClicks(); 10926 stitchologyDeadClicks(); 10927 stitichologyErrorClicks(); 10928 } 10929 }; 10930 10931 /** 10932 * Load adroll script 10933 * 10934 * returns void 10935 */ 10936 var adrollScript = function () { 10937 adroll_adv_id = "FQG74ZXRUJBIHFFLI46ZCK"; 10938 adroll_pix_id = "CCVU5GRMTBAKTFMHNQ6TKC"; 10939 (function () { 10940 var _onload = function () { 10941 if ( 10942 document.readyState && 10943 !/loaded|complete/.test(document.readyState) 10944 ) { 10945 setTimeout(_onload, 10); 10946 return; 10947 } 10948 if (!window.__adroll_loaded) { 10949 __adroll_loaded = true; 10950 setTimeout(_onload, 50); 10951 return; 10952 } 10953 var scr = document.createElement("script"); 10954 var host = 10955 "https:" == document.location.protocol 10956 ? "https://s.adroll.com" 10957 : "http://a.adroll.com"; 10958 scr.setAttribute("async", "true"); 10959 scr.type = "text/javascript";
10960 scr.src = host + "/j/roundtrip.js"; 10961 ( 10962 (document.getElementsByTagName("head") || [null])[0] || 10963 document.getElementsByTagName("script")[0].parentNode 10964 ).appendChild(scr); 10965 }; 10966 if (window.addEventListener) { 10967 window.addEventListener("load", _onload, false); 10968 } else { 10969 window.attachEvent("onload", _onload); 10970 } 10971 })(); 10972 }; 10973 10974 /** 10975 * Load adwords script 10976 * 10977 * returns void 10978 */ 10979 var adwordsScript = function () { 10980 $.getScript( 10981 "https://www.googletagmanager.com/gtag/js?id=AW-968052812", 10982 function () { 10983
vendor: 172 bytes, lines 10983-10988
10983window.dataLayer = window.dataLayer || []; 10984 function gtag() { 10985 dataLayer.push(arguments); 10986 } 10987 gtag("js", new Date()); 10988 gtag("config", "
10988AW-968052812
vendor: 12 bytes, lines 10988-10989
10988"); 10989
10989gtag("event", "conversion", { 10990 send_to: "AW-968052812/dL4wCJyA23oQzKDNzQM", 10991 }); 10992 } 10993 ); 10994 }; 10995 10996 /** 10997 * Load pardot script 10998 * 10999 * returns void 11000 */ 11001 var pardotScript = function () { 11002 piAId = "312641"; 11003 piCId = "1237"; 11004 11005 (function () { 11006 function async_load() { 11007 var s = document.createElement("script"); 11008 s.type = "text/javascript"; 11009 s.src = 11010 ("https:" == document.location.protocol 11011 ? "https://pi" 11012 : "http://cdn") + ".pardot.com/pd.js"; 11013 var c = document.getElementsByTagName("script")[0]; 11014 c.parentNode.insertBefore(s, c); 11015 } 11016 if (window.attachEvent) { 11017 window.attachEvent("onload", async_load); 11018 } else { 11019 window.addEventListener("load", async_load, false); 11020 } 11021 })(); 11022 }; 11023 11024 /** 11025 * Loop through and remove cookies 11026 * 11027 * returns void 11028 */ 11029 var removeCookies = function () { 11030 var i = 0; 11031 11032 for (i = 0; i < cookieNames.length; i++) { 11033 $.removeCookie(cookieNames[i]); 11034 } 11035 }; 11036 11037 /** 11038 * Load twitter pixel script 11039 * 11040 * returns void 11041 */ 11042 var twitterPixelScript = function () { 11043 !(function (e, t, n, s, u, a) { 11044 e.twq || 11045 ((s = e.twq = 11046 function () { 11047 s.exe ? s.exe.apply(s, arguments) : s.queue.push(arguments); 11048 }), 11049 (s.version = "1.1"), 11050 (s.queue = []), 11051 (u = t.createElement(n)), 11052 (u.async = !0), 11053 (u.src = "//static.ads-twitter.com/uwt.js"), 11054 (a = t.getElementsByTagName(n)[0]), 11055 a.parentNode.insertBefore(u, a)); 11056 })(window, document, "script"); 11057 // Insert Twitter Pixel ID and Standard Event data below 11058 twq("init", "nw4ag"); 11059 twq("track", "PageView"); 11060 }; 11061 11062 var stitchologyCore = function () { 11063 var _paq = (window._paq = window._paq || []); 11064 /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ 11065 _paq.push(["trackPageView"]); 11066 _paq.push(["enableLinkTracking"]); 11067 (function () { 11068 var u = "https://stitchology.me/stitchology/"; 11069 _paq.push(["setTrackerUrl", u + "js/tracker.php"]); 11070 _paq.push(["setSiteId", "109"]); 11071 var d = document, 11072 g = d.createElement("script"), 11073 s = d.getElementsByTagName("script")[0]; 11074 g.async = true; 11075 g.src = u + "js/tracker.php"; 11076 s.parentNode.insertBefore(g, s); 11077 })(); 11078 }; 11079 11080 var stitchologyScroll = function () { 11081 var doc_title = document.title; 11082 var maxScrollHeight = 11083 document.documentElement.scrollHeight - 11084 document.documentElement.clientHeight; 11085 var percentagesArr = [25, 50, 75, 100]; 11086 const showed = {}; 11087 let timeout; 11088 let previousPercentage; 11089 window.addEventListener("scroll", function (event) { 11090 var scrollVal = this.scrollY; 11091 var scrollPercentage = Math.round((scrollVal / maxScrollHeight) * 100); 11092 let currentPercentage = 0; 11093 let i = 0; 11094 while (percentagesArr[i] <= scrollPercentage) { 11095 currentPercentage = percentagesArr[i++]; 11096 } 11097 if (previousPercentage !== currentPercentage) { 11098 clearTimeout(timeout); 11099 timeout = 11100 currentPercentage !== 0 && !showed[currentPercentage] 11101 ? setTimeout(() => { 11102 _paq.push([ 11103 "trackEvent", 11104 "scrolling", 11105 doc_title, 11106 currentPercentage + "%", 11107 currentPercentage, 11108 ]); 11109 showed[currentPercentage] = true; 11110 }, 500) 11111 : null; 11112 previousPercentage = currentPercentage; 11113 } 11114 }); 11115 window.addEventListener("resize", () => { 11116 maxScrollHeight = 11117 document.documentElement.scrollHeight - 11118 document.documentElement.clientHeight; 11119 }); 11120 }; 11121 11122 var stitchologyRageClicks = function () { 11123 (function () { 11124 "use strict"; 11125 var getSelectorFromTarget = function (target) { 11126 var className = target.className !== "" ? "." + target.className : ""; 11127 var targetId = target.id !== "" ? "#" + target.id : ""; 11128 return [target.nodeName, className, targetId].join(" "); 11129 }; 11130 var detectRageClicks = function (subscribe, _a) { 11131 var interval = _a.interval, 11132 limit = _a.limit; 11133 var count = 1; 11134 var countClear = setInterval(function () { 11135 count = 1; 11136 }, interval); 11137 var listener = function (event) { 11138 if (count === limit) { 11139 subscribe(getSelectorFromTarget(event.target), function () { 11140 clearInterval(countClear); 11141 document.removeEventListener("click", listener); 11142 }); 11143 } 11144 count++; 11145 }; 11146 document.addEventListener("click", listener); 11147 }; 11148 detectRageClicks( 11149 function (target, unsubscribe) { 11150 window._paq.push([ 11151 "trackEvent", 11152 "ClickTracking", 11153 "RageClick", 11154 target, 11155 ]); 11156 }, 11157 { interval: 750, limit: 3 } 11158 ); 11159 })(); 11160 }; 11161 11162 var stitchologyDeadClicks = function () { 11163 (function () { 11164 "use strict"; 11165 var getSelectorFromTarget = function (target) { 11166 var className = target.className !== "" ? "." + target.className : ""; 11167 var targetId = target.id !== "" ? "#" + target.id : ""; 11168 return [target.nodeName, className, targetId].join(" "); 11169 }; 11170 var detectDeadClicks = function (subscribe, _a) { 11171 var interval = _a.interval, 11172 limit = _a.limit; 11173 var clickCounts = {}; 11174 var countClear = setInterval(function () { 11175 clickCounts = {}; 11176 }, interval); 11177 var listener = function (event) { 11178 var selector = getSelectorFromTarget(event.target); 11179 clickCounts[selector] = clickCounts[selector] 11180 ? clickCounts[selector] + 1 11181 : 1; 11182 if (clickCounts[selector] === limit) { 11183 subscribe(selector, function () { 11184 clearInterval(countClear); 11185 document.removeEventListener("click", listener); 11186 }); 11187 } 11188 }; 11189 document.addEventListener("click", listener); 11190 }; 11191 detectDeadClicks( 11192 function (target, unsubscribe) { 11193 window._paq.push([ 11194 "trackEvent", 11195 "ClickTracking", 11196 "DeadClick", 11197 target, 11198 ]); 11199 }, 11200 { interval: 1000, limit: 2 } 11201 ); 11202 })(); 11203 }; 11204 11205 var stitichologyErrorClicks = function () { 11206 (function () { 11207 "use strict"; 11208 var getSelectorFromTarget = function (target) { 11209 var className = target.className !== "" ? "." + target.className : ""; 11210 var targetId = target.id !== "" ? "#" + target.id : ""; 11211 return [target.nodeName, className, targetId].join(" "); 11212 }; 11213 var detectErrorClicks = function (subscribe) { 11214 var error; 11215 window.onerror = function (msg) { 11216 error = msg; 11217 }; 11218 var listener = function (event) { 11219 var selector = getSelectorFromTarget(event.target); 11220 setTimeout(function () { 11221 if (error) { 11222 subscribe(selector, error, function () { 11223 document.removeEventListener("click", listener); 11224 }); 11225 } 11226 error = undefined; 11227 }, 0); 11228 }; 11229 document.addEventListener("click", listener); 11230 }; 11231 detectErrorClicks( 11232 function (target, error, unsubscribe) { 11233 window._paq.push([ 11234 "trackEvent", 11235 "ClickTracking", 11236 "ErrorClick", 11237 target, 11238 ]); 11239 }, 11240 { interval: 1000, limit: 2 } 11241 ); 11242 })(); 11243 }; 11244 11245 return { 11246 loadScripts: loadScripts, 11247 removeCookies: removeCookies, 11248 }; 11249})($); 11250 11251var ACT = ACT || {}; 11252ACT.countryCodeCallback = function (countryCode) { 11253 if (!$("#oneTrustEnabled").length) { 11254 ACT.doCookieConsent(countryCode); 11255 } 11256 try { 11257 ACT.UsGlobalModal.setUserCountryCode(countryCode.code); 11258 ACT.UsGlobalModal.openModal(); 11259 } catch (e) {} 11260}; 11261 11262$(document).ready(function () { 11263 ACT.CountryCodeService.getCountryCode(ACT.countryCodeCallback); 11264}); 11265 11266/** 11267 * Service to get country code by either using the user's built-in browser 11268 * geolocation or googles geolocation service. 11269 * 11270 * Service is passed jQuery($) and is dependent on the google maps a
11270pi 11271 * (https://maps.googleapis.com/maps/api/js) being loaded. 11272 * 11273 * Sample Call To Get Country Code: 11274 * ACT.CountryCodeService.getCountryCode(function(data){console.log(data);}); 11275 */ 11276var ACT = ACT || {}; 11277ACT.CountryCodeService = (function ($) { 11278 var CLOUDFRONT_ASSET = "/content/dam/universal/unsecured/system/country-code.png"; 11279 var COUNTRY_CODE_COOKIE_NAME = "act-country-code"; 11280 var COUNTRY_CODE_HEADER_NAME = "cloudfront-viewer-country"; 11281 var DEFAULT_COUNTRY_CODE = "US"; 11282 11283 /** 11284 * Get country code from cookie or get location based on ip 11285 * 11286 * @param {function} 11287 * doneCallback - Callback function to pass the country code json 11288 * to upon completion. Ex: {"code":US} 11289 * 11290 * returns void 11291 */ 11292 var getCountryCode = function (doneCallback) { 11293 if (hasCountryCodeCookie()) { 11294 var cookieCountryCode = $.cookie(COUNTRY_CODE_COOKIE_NAME); 11295 // Replace " surrounding country code 11296 var cleanCountryCode = cookieCountryCode.replace(/"/g, ''); 11297 doneCallback({ 11298 "code" : cleanCountryCode 11299 }); 11300 } else { 11301 locate(doneCallback); 11302 } 11303 }; 11304 11305 /** 11306 * Checks if country code cookie exists 11307 * 11308 * returns {boolean} 11309 */ 11310 var hasCountryCodeCookie = function () { 11311 var countryCode = $.cookie(COUNTRY_CODE_COOKIE_NAME); 11312 if (typeof countryCode != 'undefined') { 11313 return true; 11314 } 11315 11316 return false; 11317 }; 11318 11319 /** 11320 * Locate country code by using built-in browser functionality or google 11321 * geolocation service 11322 * 11323 * @param {function} 11324 * doneCallback - Callback function to pass the country code json 11325 * to upon completion. Ex: {"code":US} 11326 * 11327 * returns void 11328 */ 11329 var locate = function (doneCallback) { 11330 locateByService(doneCallback); 11331 }; 11332 11333 /** 11334 * Locate longitude and latitude using google geolocation service 11335 * 11336 * @param {function} 11337 * doneCallback - Callback function to pass the country code json 11338 * to upon completion. Ex: {"code":US} 11339 * 11340 * returns void 11341 */ 11342 var locateByService = function (doneCallback) { 11343 var req = new XMLHttpRequest(); 11344 req.open('GET', CLOUDFRONT_ASSET, false); 11345 req.send(null); 11346 var headers = req.getAllResponseHeaders(); 11347 headers = ACT.Utils.parseResponseHeaders(headers); 11348 var countryCode = headers[COUNTRY_CODE_HEADER_NAME]; 11349 if (typeof countryCode == 'undefined' || countryCode == "") { 11350 countryCode = DEFAULT_COUNTRY_CODE; 11351 } 11352 $.cookie(COUNTRY_CODE_COOKIE_NAME, countryCode, { 11353 path : '/' 11354 }); 11355 doneCallback({ 11356 "code" : countryCode 11357 }); 11358 }; 11359 11360 return { 11361 getCountryCode : getCountryCode 11362 }; 11363})($); 11364var ACT = ACT || {}; 11365ACT.Pagination = (function () { 11366 var numResults; 11367 var resultsPerPage; 11368 var lastPage; 11369 var firstPage = 1; 11370 var currentPage = 1; 11371 11372 var init = function (count, resPerPage) { 11373 numResults = count; 11374 resultsPerPage = resPerPage; 11375 currentPage = firstPage; 11376 calculateLastPage(); 11377 }; 11378 11379 var back = function () { 11380 var page = currentPage - 1; 11381 setCurrentPage(page); 11382 }; 11383 11384 var buildPageDisplay = function (start, end) { 11385 var tempPage; 11386 var pages = []; 11387 11388 for (i = start; i <= end; i++) { 11389 tempPage = { 11390 display : i, 11391 value : i, 11392 current : (i == currentPage) 11393 }; 11394 11395 pages.push(tempPage); 11396 } 11397 11398 return pages; 11399 }; 11400 11401 var calculateLastPage = function () { 11402 lastPage = Math.ceil(numResults / resultsPerPage); 11403 }; 11404 11405 var displayFiveOrLess = function () { 11406 return buildPageDisplay(1, lastPage); 11407 }; 11408 11409 var displaySixOrMore = function () { 11410 var pages; 11411 11412 if ((currentPage - firstPage) <= 4) { 11413 pages = buildPageDisplay(firstPage, 5); 11414 pages.push(getSpacerPage()); 11415 pages.push({ 11416 display : lastPage, 11417 value : lastPage, 11418 current : false 11419 }); 11420 } else if ((lastPage - currentPage) <= 4) { 11421 pages = buildPageDisplay(lastPage - 4, lastPage); 11422 pages.unshift(getSpacerPage()); 11423 pages.unshift({ 11424 display : firstPage, 11425 value : firstPage, 11426 current : false 11427 }); 11428 } else { 11429 pages = buildPageDisplay(currentPage - 1, currentPage + 1); 11430 pages.unshift(getSpacerPage()); 11431 pages.unshift({ 11432 display : firstPage, 11433 value : firstPage, 11434 current : false 11435 }); 11436 pages.push(getSpacerPage()); 11437 pages.push({ 11438 display : lastPage, 11439 value : lastPage, 11440 current : false 11441 }); 11442 } 11443 11444 return pages; 11445 }; 11446 11447 var getCurrentPage = function () { 11448 return currentPage; 11449 }; 11450 11451 var getEndRecord = function () { 11452 var endRecord = currentPage * resultsPerPage; 11453 11454 if (endRecord > numResults) { 11455 return numResults; 11456 } 11457 return endRecord; 11458 }; 11459 11460 var getFirstPage = function () { 11461 return firstPage; 11462 }; 11463 11464 var getLastPage = function () { 11465 return lastPage; 11466 }; 11467 11468 var getPaginationDisplay = function () { 11469 var display = { 11470 back : (!onFirstPage()), 11471 backPage : currentPage - 1, 11472 next : (!onLastPage()), 11473 nextPage : currentPage + 1, 11474 pageDisplay : [] 11475 }; 11476 11477 if (lastPage <= 5) { 11478 display.pageDisplay = displayFiveOrLess(); 11479 } else { 11480 display.pageDisplay = displaySixOrMore(); 11481 } 11482
11483 return display; 11484 }; 11485 11486 var getSpacerPage = function () { 11487 return { 11488 display : "...", 11489 value : "", 11490 current : false 11491 }; 11492 }; 11493 11494 var getStartRecord = function () { 11495 return ((currentPage - 1) * resultsPerPage) + 1; 11496 }; 11497 11498 var next = function () { 11499 var page = currentPage + 1; 11500 setCurrentPage(page); 11501 }; 11502 11503 var onFirstPage = function () { 11504 return (firstPage == currentPage); 11505 }; 11506 11507 var onLastPage = function () { 11508 return (lastPage == currentPage); 11509 }; 11510 11511 var setCurrentPage = function (page) { 11512 if (typeof page == 'number') { 11513 if (page > lastPage) { 11514 currentPage = lastPage; 11515 } else if (page < firstPage) { 11516 currentPage = firstPage; 11517 } else { 11518 currentPage = page; 11519 } 11520 } else { 11521 currentPage = firstPage; 11522 } 11523 }; 11524 11525 return { 11526 init : init, 11527 getEndRecord : getEndRecord, 11528 getFirstPage : getFirstPage, 11529 getLastPage : getLastPage, 11530 getPaginationDisplay : getPaginationDisplay, 11531 getStartRecord : getStartRecord, 11532 next : next, 11533 getCurrentPage : getCurrentPage, 11534 setCurrentPage : setCurrentPage, 11535 back : back 11536 }; 11537})(); 11538var ACT = ACT || {}; 11539ACT.SwiftypeSearch = (function () { 11540 var ENGINE_KEY_INPUT_SELECTOR = "#stEngineKey"; 11541 var ERROR_PAGE_WRAPPER_SELECTOR = ".error-page-wrapper"; 11542 var ERROR_SEARCH_FORM_SELECTOR = "#errorSearchform"; 11543 var HEADER_SEARCH_FORM_SELECTOR = "#searchform"; 11544 var HEADER_SEARCH_POPOVER_SELECTOR = ".popover.header-search-popover"; 11545 var PAGINATION_TEMPLATE_SELECTOR = "#siteSearchPaginationTemplate"; 11546 var RESULTS_PER_PAGE_INPUT_SELECTOR = "#stResultsPerPage"; 11547 var RESULTS_URL_INPUT_SELECTOR = "#stResultsUrl"; 11548 var SEARCH_INPUT_SELECTOR = ".st-search-input"; 11549 var SEARCH_RESULTS_SELECTOR = "#searchResultsContainer"; 11550 var SEARCH_RESULTS_FORM_SELECTOR = "#searchResultsForm"; 11551 var engineKey; 11552 var resultsUrl; 11553 var resultsPerPage; 11554 11555 var init = function () { 11556 engineKey = $(ENGINE_KEY_INPUT_SELECTOR, HEADER_SEARCH_FORM_SELECTOR).val(); 11557 resultsUrl = $( 11558 RESULTS_URL_INPUT_SELECTOR, 11559 HEADER_SEARCH_FORM_SELECTOR 11560 ).val(); 11561 resultsPerPage = $( 11562 RESULTS_PER_PAGE_INPUT_SELECTOR, 11563 HEADER_SEARCH_FORM_SELECTOR 11564 ).val(); 11565 }; 11566 11567 var addListeners = function () { 11568 // auto complete 11569 $(SEARCH_INPUT_SELECTOR).swiftype({ 11570 engineKey: engineKey, 11571 suggestionListClass: "site-search-autocomplete", 11572 }); 11573 11574 $(".header-search", "header").on("shown.bs.popover", function () { 11575 $(HEADER_SEARCH_POPOVER_SELECTOR + " " + SEARCH_INPUT_SELECTOR).swiftype({ 11576 engineKey: engineKey, 11577 suggestionListClass: "site-search-autocomplete", 11578 }); 11579 $(HEADER_SEARCH_POPOVER_SELECTOR + " " + SEARCH_INPUT_SELECTOR).focus(); 11580 }); 11581 11582 $(SEARCH_INPUT_SELECTOR, SEARCH_RESULTS_FORM_SELECTOR).swiftypeSearch({ 11583 engineKey: engineKey, 11584 resultContainingElement: SEARCH_RESULTS_SELECTOR, 11585 perPage: resultsPerPage, 11586 renderResultsFunction: customResultsRenderer, 11587 }); 11588 11589 $("header").on("submit", HEADER_SEARCH_FORM_SELECTOR, function (event) { 11590 event.preventDefault(); 11591 var query = $( 11592 SEARCH_INPUT_SELECTOR, 11593 HEADER_SEARCH_POPOVER_SELECTOR 11594 ).val(); 11595 window.location = resultsUrl + "#stq=" + query; 11596 }); 11597 11598 $(ERROR_PAGE_WRAPPER_SELECTOR).on( 11599 "submit", 11600 ERROR_SEARCH_FORM_SELECTOR, 11601 function (event) { 11602 event.preventDefault(); 11603 var query = $(SEARCH_INPUT_SELECTOR, ERROR_SEARCH_FORM_SELECTOR).val(); 11604 window.location = resultsUrl + "#stq=" + query; 11605 } 11606 ); 11607 }; 11608 11609 var customItemRender = function (document_type, item) { 11610 let snippet = ""; 11611 if (typeof item.description !== "undefined") { 11612 snippet = '<p class="snippet">' + item.description + "</p>"; 11613 } else if ( 11614 typeof item.highlight !== "undefined" && 11615 typeof item.highlight.body !== "undefined" 11616 ) { 11617 snippet = '<p class="snippet">' + item.highlight.body + "</p>"; 11618 } 11619 return ( 11620 '<div class="st-result search-result"><p class="title"><a href="' + 11621 item.url + 11622 '" class="st-search-result-link">' + 11623 item.title + 11624 "</a></p>" + 11625 snippet + 11626 '<hr class="horizontal-line act-pastel-black-bg" /></div>' 11627 ); 11628 }; 11629 11630 var customResultsRenderer = function (ctx, data) { 11631 var $resultContainer = ctx.resultContainer; 11632 var config = ctx.config; 11633 11634 $(".st-search-input").val(data.info.page.query); 11635 $resultContainer.html(""); 11636 11637 $.each(data.records, function (documentType, items) { 11638 $.each(items, function (idx, item) { 11639 ctx.registerResult( 11640 $(customItemRender(documentType, item)).appendTo($resultContainer), 11641 item 11642 ); 11643 }); 11644 }); 11645 11646 customRenderPagination(ctx, data.info); 11647 sendToAnalytics(data.info.page.query); 11648 }; 11649 11650 var customRenderPagination = function (ctx, resultInfo) { 11651 ACT.Pagination.init( 11652 resultInfo.page.total_result_count, 11653 resultInfo.page.per_page 11654 ); 11655 ACT.Pagination.setCurrentPage(resultInfo.page.current_page); 11656 11657 var source = $(PAGINATION_TEMPLATE_SELECTOR).html(); 11658 var compiledPaginationTemplate = Handlebars.compile(source); 11659 11660 $(ctx.resultContainer).prepend( 11661 customRenderRecords( 11662 ACT.Pagination.getStartRecord(), 11663 ACT.Pagination.getEndRecord(), 11664 resultInfo.page.total_result_count 11665 ) 11666 ); 11667 $( 11668 compiledPaginationTemplate(ACT.Pagination.getPaginationDisplay()) 11669 ).appendTo(ctx.resultContainer); 11670 }; 11671 11672 var customRenderRecords = function (startRecord, endRecord, totalRecords) { 11673 return ( 11674 "<p>Showing records " + 11675 startRecord + 11676 " - " + 11677 endRecord + 11678 " of " + 11679 totalRecords + 11680 "</p>" 11681 ); 11682 }; 11683 11684 var sendToAnalytics = function (searchTerm) { 11685 var track = "/search?stq=" + searchTerm; 11686 window.dataLayer = window.dataLayer || []; 11687 window.dataLayer.push({ 11688 event: "Pageview", 11689 url: track, 11690 }); 11691 }; 11692 11693 return { 11694 init: init, 11695 addListeners: addListeners, 11696 }; 11697})(); 11698 11699$(document).ready(function () { 11700 ACT.SwiftypeSearch.init(); 11701 ACT.SwiftypeSearch.addListeners(); 11702}); 11703 11704var ACT = ACT || {}; 11705ACT.VideoPlayer = (function () { 11706 11707 const LIMELIGHT_VIDEO_LINK = "https://link.videoplatform.limelight.com/media/?embedMode=html&htmlPlayerFilename=limelightjs-player.js&auto
11707play=true&width=100%&height=100%"; 11708 const YOUTUBE_VIDEO_LINK = "https://www.youtube.com/embed/"; 11709 const MODAL_SELECTOR = "#modal-video-player"; 11710 const MODAL_DIALOG_SELECTOR = MODAL_SELECTOR + " .modal-dialog"; 11711 const MODAL_BODY_SELECTOR = MODAL_DIALOG_SELECTOR + " .modal-body"; 11712 const MODAL_VIDEO_CONTAINER_SELECTOR = MODAL_BODY_SELECTOR + " .js-video-container"; 11713 11714 /** 11715 * Returns the dimensions of the video container 11716 * 11717 * @param {jquery obj} $this - The jquery container where the video will be placed 11718 * @param {boolean} inline - Whether the video is played inline or in a modal 11719 * @param {string} aspectRatio - The aspect ratio of the video (widescreen or standard) 11720 */ 11721 var getVideoDimensions = function($this, inline, aspectRatio) { 11722 var dimensions = {}; 11723 11724 if (!inline) { 11725 dimensions.width = $(MODAL_DIALOG_SELECTOR).width() - parseInt($(MODAL_BODY_SELECTOR).css('padding-left')) - parseInt($(MODAL_BODY_SELECTOR).css('padding-right')); 11726 } 11727 else { 11728 dimensions.width = $this.parents('.js-video-container').width(); 11729 } 11730 11731 dimensions.height = ACT.Utils.getVideoHeight(dimensions.width, aspectRatio); 11732 11733 return dimensions; 11734 }; 11735 11736 var getTarget = function($this, inline) { 11737 if (inline) { 11738 return $this.parents('.js-video-container'); 11739 } 11740 11741 return $(MODAL_VIDEO_CONTAINER_SELECTOR); 11742 }; 11743 11744 var generateLimelightUrl = function(mediaId) { 11745 var url = LIMELIGHT_VIDEO_LINK + "&mediaId=" + mediaId; 11746 return url; 11747 }; 11748 11749 var generateYouTubeUrl = function(mediaId) { 11750 var url = YOUTUBE_VIDEO_LINK + mediaId + '?&autoplay=1'; 11751 return url; 11752 }; 11753 11754 var generateIframe = function(width, height, url) { 11755 return '<iframe width="' + width + '" height="' + height + '" src="' + url + '" frameborder="0" scrolling="no" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>' 11756 }; 11757 11758 var play = function($this) { 11759 var inline = $this.hasClass('play-inline'); 11760 var mediaId = $this.data('mediaid'); 11761 var videoType = $this.data('videotype'); 11762 var aspectRatio = $this.data('aspectratio'); 11763 var $container = getTarget($this, inline); 11764 var url; 11765 var dimensions; 11766 11767 if (typeof aspectRatio == 'undefined' || aspectRatio == '') { 11768 aspectRatio = "standard"; 11769 } 11770 11771 if (videoType == "limelight") { 11772 url = generateLimelightUrl(mediaId); 11773 } 11774 else { 11775 url = generateYouTubeUrl(mediaId); 11776 } 11777 11778 if (!inline) { 11779 $(MODAL_SELECTOR).modal('show'); 11780 setTimeout(function() { 11781 dimensions = getVideoDimensions($this, inline, aspectRatio); 11782 $container.html(generateIframe(dimensions.width, dimensions.height, url)); 11783 }, 250); 11784 } 11785 else { 11786 dimensions = getVideoDimensions($this, inline, aspectRatio); 11787 $container.html(generateIframe(dimensions.width, dimensions.height, url)); 11788 } 11789 }; 11790 11791 var stopModal = function() { 11792 $(MODAL_VIDEO_CONTAINER_SELECTOR).html(''); 11793 }; 11794 11795 return { 11796 stopModal : stopModal, 11797 play : play 11798 }; 11799})(); 11800 11801$(document).ready(function() { 11802 $('body').on( 11803 'click touchstart', 11804 '.play-video', 11805 function(event) { 11806 event.preventDefault(); 11807 ACT.VideoPlayer.play($(this)); 11808 } 11809 ); 11810 11811 $('#modal-video-player').on('hide.bs.modal', function (event) { 11812 ACT.VideoPlayer.stopModal(); 11813 }); 11814}); 11815$(document) 11816 .ready( 11817 function () { 11818 function alignModal() { 11819 var modalDialog = $(this).find(".modal-content"); 11820 modalDialog.css("margin-top", Math.max(0, ($(window) 11821 .height() - modalDialog.outerHeight()) / 2)); 11822 } 11823 $(".modal").on("shown.bs.modal", alignModal); 11824 $(window).on("resize", function () { 11825 $(".modal:visible").each(alignModal); 11826 }); 11827 11828 $('.panel-collapse a') 11829 .click( 11830 function () { 11831 var url = $(this).attr('href'); 11832 if (url != '' && url != undefined) { 11833 if (url.indexOf('#') != -1) { 11834 var ID = url.substring(url 11835 .indexOf('#') + 1); 11836 if (ID.length) { 11837 var parentdiv = $( 11838 "a[name='" + ID 11839 + "']") 11840 .closest( 11841 '.tray-content-wrapper'); 11842 if (!$(parentdiv).is( 11843 ':visible')) { 11844 $(parentdiv).siblings( 11845 ".exp-tray") 11846 .click(); 11847 } 11848 ; 11849 var parenttabdiv = $( 11850 "a[name='" + ID 11851 + "']") 11852 .closest( 11853 '.panel-inner'); 11854 var indexno = parenttabdiv 11855 .closest( 11856 '.content-panel-tab') 11857 .find( 11858 '.panel-inner') 11859 .index(parenttabdiv); 11860 if (!$(parenttabdiv).is( 11861 ':visible')) { 11862 parenttabdiv 11863 .closest( 11864 '.content-panel-tab') 11865 .siblings( 11866 '.title-bar-tab') 11867 .find( 11868 '.sub-cat-tabs li:eq(' 11869 + indexno 11870 + ') a') 11871 .click(); 11872 } 11873 ; 11874 setTimeout( 11875 function () { 11876 if (typeof ($("a[name='" 11877 + ID 11878 + "']")) != 'undefined' 11879 && typeof ($("a[name='" 11880 + ID 11881 + "']") 11882 .offset()) != 'undefined') { 11883 $( 11884 "html, body") 11885 .animate( 11886 { 11887 scrollTop : $( 11888 "a[name='" 11889 + ID 11890 + "']") 11891 .offset().top - 110 11892 }, 11893 { 11894 duration : 600 11895 }); 11896 } 11897 11898 }, 800); 11899 } 11900 ; 11901 } 11902 } 11903 ; 11904 11905 }); 11906 $('.list-view-tiles').on('click', '.row-clicable', 11907 function () { 11908 $(this).find('.flip').click(); 11909 }).on('click', '.flip', function (e) { 11910 e.stopPropagation(); 11911 }); 11912 $('.list-view-tiles').on( 11913 'click', 11914 '.flip', 11915 function (i) { 11916 $(this).toggleClass("add-icon"); 11917 $(this).toggleClass("minus-icon"); 11918 $(this).parent('.result-head').next( 11919 '.result-detail').slideToggle(590); 11920 }); 11921 11922 }); 11923var ACT = ACT || {}; 11924 11925ACT.HashScroll = { 11926 init: function () { 11927 var hash; 11928 if (window.location && window.location & window.location.hash) { 11929 hash = window.location.hash.substring(1); 11930 } 11931 11932 if ( 11933 typeof hash !== "undefined" && 11934 ($("a[name='" + hash + "']").length || $("#" + hash).length) 11935 ) { 11936 if ($("a[name='" + hash + "']").length) { 11937 $hashElement = $("a[name='" + hash + "']"); 11938 } else { 11939 $hashElement = $("#" + hash); 11940 } 11941 11942 $parentPanel = $hashElement.closest(".panel-collapse"); 11943 11944 if (!$parentPanel.is(":visible")) { 11945 try { 11946 $parentPanel 11947 .closest(".panel") 11948 .find(".panel-heading .panel-title a") 11949 .click(); 11950 } catch (e) {} 11951 } 11952 11953 $("html, body").animate( 11954 { 11955 scrollTop: 11956 $hashElement.offset().top - 11957 $(".navbar:visible").height() - 11958 parseInt($(".navbar:visible").css("margin-bottom")), 11959 }, 11960 { 11961 duration: 300, 11962 } 11963 ); 11964 } 11965 }, 11966}; 11967 11968$(window).on("load", function () { 11969 setTimeout(ACT.HashScroll.init, 500); 11970}); 11971 11972$(window).on("hashchange", function () { 11973 setTimeout(ACT.HashScroll.init, 500); 11974}); 11975 11976(function ($, undefined) { 11977 var defaults = {
11978 autoPlay: false, 11979 pause: 4000, 11980 speed: 500, 11981 easing: "swing", 11982 slideSelector: "*", 11983 11984 controls: false, 11985 nextText: "Next", 11986 prevText: "Prev", 11987 next: "", 11988 prev: "", 11989 infiniteLoop: false, 11990 11991 ticker: true, 11992 tickerWrapperClass: ".ticker-container", 11993 tickerClass: ".ticker", 11994 tickerActiveClass: ".inview", 11995 11996 touchEnabled: false, 11997 responsive: false, 11998 sCurrent: 0, 11999 }; 12000 12001 var ActCarousel = function ($el, conf) { 12002 var config = {}; 12003 var cState = { 12004 current: 0, 12005 moveSlides: 1, 12006 count: 0, 12007 initPosX: 0, 12008 lastPosX: 0, 12009 }; 12010 var wrapper = $el; 12011 12012 var cleanup_carousel = function (el) { 12013 var _this = el; 12014 if (config.ticker) { 12015 $(_this) 12016 .children(":first") 12017 .css({ 12018 width: "", 12019 "margin-left": "", 12020 }) 12021 .children(config.slideSelector) 12022 .css({ 12023 width: "", 12024 float: "", 12025 }) 12026 .end() 12027 .end() 12028 .find(config.tickerWrapperClass) 12029 .remove(); 12030 } 12031 if ( 12032 $(_this).children(":first").children(config.slideSelector).length == 0 12033 ) { 12034 throw "No slide found with specified selector: " + config.slideSelector; 12035 } 12036 12037 setSlideCount( 12038 $(_this).children(":first").children(config.slideSelector).length 12039 ); 12040 setSlideWidth( 12041 $(_this) 12042 .children(":first") 12043 .children(config.slideSelector + ":first") 12044 .outerWidth() 12045 ); 12046 setSlidesInView( 12047 Math.round( 12048 $(_this).outerWidth() / 12049 $(_this) 12050 .children(":first") 12051 .children(config.slideSelector + ":first") 12052 .outerWidth() 12053 ) 12054 ); 12055 setMoveAtOnce(1); 12056 12057 return _this; 12058 }; 12059 12060 var setup_carousel_ticker = function (el) { 12061 var _this = el; 12062 if (config.ticker && slideCount() > slidesInView()) { 12063 $(_this).append( 12064 $("<div></div>").attr({ 12065 class: config.tickerWrapperClass.replace(/\./g, " ").trim(), 12066 }) 12067 ); 12068 12069 for (var i = 0; i < slideCount(); i++) { 12070 $(_this) 12071 .find(config.tickerWrapperClass) 12072 .append( 12073 $("<div></div>").attr({ 12074 class: config.tickerClass.replace(/\./g, " ").trim(), 12075 index: "" + i, 12076 }) 12077 ); 12078 } 12079 } 12080 12081 $(_this) 12082 .find(config.tickerClass) 12083 .click(function () { 12084 slideTo(parseInt($(this).attr("index"))); 12085 }); 12086 12087 return _this; 12088 }; 12089 12090 var setup_carousel_viewport = function (el) { 12091 var _this = el; 12092 $(_this) 12093 .children(":first") 12094 .css({ 12095 width: slideWidth() * slideCount(), 12096 }) 12097 .children(config.slideSelector) 12098 .css({ 12099 width: slideWidth(), 12100 float: "left", 12101 }); 12102 12103 /* */ 12104 if (slideCount() <= slidesInView()) { 12105 $(config.next).hide(); 12106 $(config.prev).hide(); 12107 } 12108 12109 slideTo(current(), 0); 12110 return _this; 12111 }; 12112 12113 var getUUID = function () { 12114 var d = new Date().getTime(); 12115 var uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace( 12116 /[xy]/g, 12117 function (c) { 12118 var r = (d + Math.random() * 16) % 16 | 0; 12119 d = Math.floor(d / 16); 12120 return (c == "x" ? r : (r & 0x3) | 0x8).toString(16); 12121 } 12122 ); 12123 return uuid; 12124 }; 12125 12126 var waitForFinalEvent = (function () { 12127 var timers = {}; 12128 return function (callback, ms, uniqueId) { 12129 if (!uniqueId) { 12130 uniqueId = getUUID(); 12131 } 12132 if (timers[uniqueId]) { 12133 clearTimeout(timers[uniqueId]); 12134 } 12135 timers[uniqueId] = setTimeout(callback, ms); 12136 }; 12137 })(); 12138 12139 var init = function (conf) { 12140 config = $.extend({}, defaults, conf); 12141 config = $.extend(config, { 12142 UUID: getUUID(), 12143 TWC: config.tickerWrapperClass.replace(/\./g, " ").trim(), 12144 TC: config.tickerClass.replace(/\./g, " ").trim(), 12145 TAC: config.tickerActiveClass.replace(/\./g, " ").trim(), 12146 }); 12147 12148 cleanup_carousel(wrapper); 12149 setup_carousel_ticker(wrapper); 12150 setup_carousel_viewport(wrapper); 12151 12152 $(config.next).click(function () { 12153 next(); 12154 }); 12155 $(config.prev).click(function () { 12156 prev(); 12157 }); 12158 12159 $(wrapper) 12160 .children(":first") 12161 .keydown(function (e) { 12162 switch (e.which) { 12163 case 37: 12164 prev(); 12165 break; 12166 12167 case 39: 12168 next(); 12169 break; 12170 12171 default: 12172 return; // exit this handler for other keys 12173 } 12174 e.preventDefault(); // prevent the default action (scroll / move 12175 // caret) 12176 }); 12177 12178 if (config.responsive) { 12179 $(window).resize(function () { 12180 waitForFinalEvent( 12181 function () { 12182 cleanup_carousel(wrapper); 12183 setup_carousel_ticker(wrapper); 12184 setup_carousel_viewport(wrapper); 12185 slideTo(current(), 0); 12186 }, 12187 200, 12188 config.UUID 12189 ); 12190 }); 12191 } 12192 12193 window.requestAnimFrame = (function () { 12194 return ( 12195 window.requestAnimationFrame || 12196 window.webkitRequestAnimationFrame || 12197 window.mozRequestAnimationFrame || 12198 window.oRequestAnimationFrame || 12199 window.msRequestAnimationFrame || 12200 function (callback) { 12201 window.setTimeout(callback, 1000 / 60); 12202 } 12203 ); 12204 })(); 12205 addTouchEvents(); 12206 }; 12207 12208 var newXTransform = 0; 12209 12210 var addTouchEvents = function () { 12211 $(wrapper).css({ 12212 "-ms-touch-action": "pan-x", 12213 "touch-action": "pan-x", 12214 }); 12215 12216 var hammer = new Hammer($(wrapper).children(":first")[0]); 12217 hammer.on("swipeleft", function (event, data) { 12218 next(); 12219 }); 12220 hammer.on("swiperight", function (event, data) { 12221 prev(); 12222 }); 12223 }; 12224 12225 var handleGestureMove = function (data) { 12226 if (config.isAnimating) { 12227 return; 12228 } 12229 12230 config.isAnimating = true;
12231 window.requestAnimFrame(function () { 12232 if (!config.isAnimating) { 12233 return; 12234 } 12235 12236 var newXTransform = 12237 -(current() * slideWidth()) + (data.end.x - data.start.x); 12238 newXTransform = limitValueToSlider(newXTransform); 12239 var transformStyle = "translateX(" + newXTransform + "px)"; 12240 $(wrapper).children(":first").css({ "margin-left": newXTransform }); 12241 12242 config.isAnimating = false; 12243 }); 12244 }.bind(this); 12245 12246 var limitValueToSlider = function (value) { 12247 var min = -(slideCount() - slidesMove()) * slideWidth(); 12248 var max = 0; 12249 if (value > max) { 12250 value = max; 12251 } else if (value < min) { 12252 value = min; 12253 } 12254 12255 return value; 12256 }; 12257 12258 var activate_current = function () { 12259 $(wrapper).find(config.tickerActiveClass).removeClass(config.TAC); 12260 for (var i = 0; i < slidesInView(); i++) { 12261 $(wrapper) 12262 .find('[index="' + (current() + i) + '"]') 12263 .addClass(config.TAC); 12264 } 12265 $(wrapper).find("[index]").removeClass("active"); 12266 $(wrapper) 12267 .find('[index="' + current() + '"]') 12268 .addClass("active"); 12269 }; 12270 12271 var next = function () { 12272 var index = 12273 current() + slidesInView() + 1 > slideCount() 12274 ? slideCount() - slidesInView() 12275 : current() + 1; 12276 if (config.infiniteLoop) { 12277 index = current() == slideCount() - slidesInView() ? 0 : index; 12278 } 12279 slideTo(index); 12280 }; 12281 12282 var prev = function () { 12283 var index = current() < 0 ? 0 : current() - 1; 12284 if (config.infiniteLoop) { 12285 index = current() == 0 ? slideCount() - slidesInView() : index; 12286 } 12287 slideTo(index); 12288 }; 12289 12290 var first = function () { 12291 $(wrapper) 12292 .children(":first") 12293 .animate( 12294 { 12295 "margin-left": "+=" + current() * slideWidth() + "px", 12296 }, 12297 config.speed, 12298 config.easing 12299 ); 12300 setCurrent(0); 12301 activate_current(); 12302 }; 12303 12304 var last = function () { 12305 $(wrapper) 12306 .children(":first") 12307 .animate( 12308 { 12309 "margin-left": "-=" + current() * slideWidth() + "px", 12310 }, 12311 config.speed, 12312 config.easing 12313 ); 12314 setCurrent(slideCount()); 12315 activate_current(); 12316 }; 12317 12318 var slideTo = function (index, speed) { 12319 var initialLimit = 0; 12320 var endLimit = slideCount() - slidesInView(); 12321 var sp = typeof speed == "undefined" ? config.speed : speed; 12322 12323 if (index >= current() && index > endLimit) { 12324 index = endLimit; 12325 } else if (index < current() && index < initialLimit) { 12326 index = 0; 12327 } 12328 12329 index = index < initialLimit ? initialLimit : index; 12330 12331 $(wrapper) 12332 .children(":first") 12333 .stop() 12334 .animate( 12335 { 12336 "margin-left": -(index * slideWidth()), 12337 }, 12338 sp, 12339 config.easing 12340 ); 12341 12342 setCurrent(index); 12343 activate_current(); 12344 }; 12345 12346 var current = function () { 12347 return cState.current; 12348 }; 12349 12350 var slideCount = function () { 12351 return cState.count; 12352 }; 12353 12354 var slidesMove = function () { 12355 return cState.moveSlides; 12356 }; 12357 12358 var slideWidth = function () { 12359 return cState.swidth; 12360 }; 12361 12362 var swipeStartX = function () { 12363 return cState.initPosX; 12364 }; 12365 12366 var swipeEndX = function () { 12367 return cState.lastPosX; 12368 }; 12369 12370 var slidesInView = function () { 12371 return cState.slidesInView; 12372 }; 12373 12374 var setSlideCount = function (count) { 12375 cState.count = count; 12376 }; 12377 12378 var setSlideWidth = function (width) { 12379 cState.swidth = width; 12380 }; 12381 12382 var setMoveAtOnce = function (num) { 12383 cState.moveSlides = num; 12384 }; 12385 12386 var setCurrent = function (current) { 12387 cState.current = current; 12388 }; 12389 12390 var setSlidesInView = function (num) { 12391 cState.slidesInView = num; 12392 }; 12393 12394 var setSwipeStartX = function (xPos) { 12395 cState.initPosX = xPos; 12396 }; 12397 12398 var setSwipeEndX = function (xPos) { 12399 cState.lastPosX = xPos; 12400 }; 12401 12402 init(conf); 12403 12404 return { 12405 next: next, 12406 prev: prev, 12407 first: first, 12408 last: last, 12409 slideTo: slideTo, 12410 slideCount: slideCount, 12411 }; 12412 }; 12413 12414 $.fn.carousel = function (conf) { 12415 return this.each(function (index, el) {
12416 el.ActCarousel = new ActCarousel(el, conf); 12417 }); 12418 }; 12419})(jQuery); 12420 12421(function($, Utils, undefined) { 12422 12423 if(typeof Utils == 'undefined'){ 12424 throw "ACT.Utils not defined."; 12425 } 12426 12427 var pointerDown = 'MSPointerDown', 12428 pointerUp = 'MSPointerUp', 12429 pointerMove = 'MSPointerMove', 12430 UUID = Utils.getUUID(); 12431 12432 var SWIPELEFT = "swipeleft", 12433 SWIPERIGHT = "swiperight", 12434 SWIPEUP = "swipeup", 12435 SWIPEDOWN = "swipedown", 12436 SWIPING = "swiping", 12437 NOSWIPE = "noswipe"; 12438 12439 if (window.PointerEvent || window.navigator.msPointerEnabled) { 12440 pointerDown = 'pointerdown'; 12441 pointerUp = 'pointerup'; 12442 pointerMove = 'pointermove'; 12443 }else if('ontouchstart' in window){ 12444 pointerDown = 'touchstart'; 12445 pointerUp = 'touchend'; 12446 pointerMove = 'touchmove'; 12447 }else if('onmousedown' in window){ 12448 pointerDown = 'mousedown'; 12449 pointerUp = 'mouseup'; 12450 pointerMove = 'mousemove'; 12451 } 12452 12453 var trigger = function(node,event,data){ 12454 $.event.trigger(event,data,node); 12455 }, 12456 settings = { 12457 /* Ratio of distance over target finger must travel to be considered a swipe. */ 12458 threshold : 0.4, 12459 /* Faster fingers can travel shorter distances to be considered 12460 swipes. 'sensitivity' controls how much. Bigger is shorter. */ 12461 sensitivity : 5 12462 }; 12463 12464 var start={'x':0,'y':0,'t':0},end={'x':0,'y':0,'t':0}; 12465 12466 var getTouchMetadata = function(evt) { 12467 var d = new Date(); 12468 var t = d.getTime(); 12469 var originalEvent = evt.originalEvent?evt.originalEvent:evt; 12470 var point = {}; 12471 12472 if (originalEvent.changedTouches) { 12473 // Prefer Touch Events 12474 point.x = originalEvent.changedTouches[0].clientX; 12475 point.y = originalEvent.changedTouches[0].clientY; 12476 } else { 12477 // Either Mouse event or Pointer Event 12478 point.x = originalEvent.clientX; 12479 point.y = originalEvent.clientY; 12480 } 12481 point.w = evt.currentTarget.offsetWidth; 12482 point.h = evt.currentTarget.offsetHeight; 12483 point.t = t; 12484 return point; 12485 }; 12486 12487 var getType = function(){ 12488 var dx = Math.round(end.x - start.x), 12489 dy = Math.round(end.y - start.y), 12490 dt = Math.round(end.t - start.t), 12491 vx = Math.abs(dx/dt), 12492 vy = Math.abs(dy/dt), 12493 w = start.w, 12494 h = start.h, 12495 th = settings.threshold, 12496 sn = settings.sensitivity, 12497 dirX = dx<0?-1:1, 12498 dirY = dy>0?-1:1; 12499 if(vx>vy){ 12500 if(Math.abs(dx) > w*th || vx*sn > 1){ 12501 if(dx<0){ 12502 return SWIPELEFT; 12503 }else{ 12504 return SWIPERIGHT; 12505 } 12506 } 12507 }else{ 12508 if(Math.abs(dy) > h*th || vy*sn > 1){ 12509 if(dy<0){ 12510 return SWIPEUP; 12511 }else{ 12512 return SWIPEDOWN; 12513 } 12514 } 12515 } 12516 }; 12517 12518 if(true){ 12519 $.event.special.noswipe = 12520 $.event.special.swipeleft = 12521 $.event.special.swiperight = 12522 $.event.special.swipeup = 12523 $.event.special.swipedown = 12524 $.event.special.swiping = { 12525 12526 setup: function( data, namespaces, eventHandle ) { 12527 var thisElem = this; 12528 $(thisElem).bind(pointerDown, function(event) { 12529 event.stopPropagation(); 12530 var evt = (typeof event.touches !== 'undefined')? event : event.originalEvent; 12531 if (evt.touches && evt.touches.length > 1) { 12532 return; 12533 } 12534 start = getTouchMetadata(evt); 12535 12536 $(thisElem).bind(pointerMove, function(event) { 12537 event.stopPropagation(); 12538 var evt = (typeof event.touches !== 'undefined')? event : event.originalEvent; 12539 end = getTouchMetadata(evt); 12540 12541 $(thisElem).trigger(SWIPING, {start:start, end:end}); 12542 }); 12543 $(thisElem).bind(pointerUp, function(event) { 12544 event.stopPropagation(); 12545 var evt = (typeof event.touches !== 'undefined')? event : event.originalEvent; 12546 if (evt.touches && evt.touches.length > 1) { 12547 return; 12548 } 12549 12550 end = getTouchMetadata(evt); 12551 12552 Utils.waitForFinalEvent(function() { 12553 var type = getType(); 12554 evt.type = type; 12555 12556 $(thisElem).unbind(pointerMove); 12557 $(thisElem).unbind(pointerUp); 12558 12559 switch(type){ 12560 case SWIPELEFT: 12561 $(thisElem).trigger(SWIPELEFT, {start:start, end:end}); 12562 break; 12563 case SWIPERIGHT: 12564 $(thisElem).trigger(SWIPERIGHT, {start:start, end:end}); 12565 break; 12566 case SWIPEUP: 12567 $(thisElem).trigger(SWIPEUP, {start:start, end:end}); 12568 break; 12569 case SWIPEDOWN: 12570 $(thisElem).trigger(SWIPEDOWN, {start:start, end:end}); 12571 break; 12572 default: 12573 $(thisElem).trigger(NOSWIPE, {start:start, end:end}); 12574 break; 12575 } 12576 12577 }, 100, "touchend-"+UUID); 12578 }); 12579 }); 12580 return true; 12581 }, 12582 12583 teardown: function( namespaces ) { 12584 12585 var thisElem = this; 12586 $(thisElem).unbind(pointerDown); 12587 $(thisElem).unbind(pointerMove); 12588 $(thisElem).unbind(pointerUp); 12589 return true; 12590 } 12591 }; 12592 } 12593 12594})(jQuery, ACT.Utils); 12595var toggleSelection = function () { 12596 var flag = 1;
12597 $(".arrowToggle").click(function () { 12598 if (flag == 1) { 12599 $(this).addClass("active"); 12600 flag = 0; 12601 } else { 12602 flag = 1; 12603 $(this).removeClass("active"); 12604 } 12605 }); 12606 $(".arrowToggle").blur(function () { 12607 flag = 1; 12608 $(this).removeClass("active"); 12609 }); 12610 12611 $(document).click(function (e) { 12612 var container = $(".arrowToggle"); 12613 if (!container.is(e.target) && container.has(e.target).length === 0) { 12614 $(".arrowToggle").removeClass("active"); 12615 } 12616 }); 12617}; 12618 12619var isExternal = function (url) { 12620 var match = url.match( 12621 /^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/ 12622 ); 12623 12624 if ( 12625 match != null && 12626 typeof match[2] === "string" && 12627 match[2].length > 0 && 12628 match[2].replace( 12629 new RegExp( 12630 ":(" + { "http:": 80, "https:": 443 }[location.protocol] + ")?$" 12631 ), 12632 "" 12633 ) !== location.host 12634 ) { 12635 return true; 12636 } else { 12637 return false; 12638 } 12639}; 12640 12641/* 12642 * This will check domain of passed url depending on that popup will be 12643 * opened up. 12644 */ 12645var filterDomains = function (url) { 12646 var availDomain = ACT.Utils.extractDomain(url); 12647 var isDomainMatched = false; 12648 var domainList = 12649 $(".partner-domains") !== undefined 12650 ? $(".partner-domains").text().split(",") 12651 : ""; 12652 let rootDomain = ""; 12653 if (availDomain.split(".").length > 2) { 12654 rootDomain = availDomain 12655 .split(".") 12656 .reduce((prevValue, currentValue, index) => { 12657 if (index > 0) { 12658 return prevValue + "." + currentValue; 12659 } 12660 return prevValue; 12661 }, ""); 12662 12663 rootDomain = rootDomain.substring(1, rootDomain.length); 12664 } 12665 for (var i = 0; i < domainList.length; i++) { 12666 if (domainList[i] !== "") { 12667 if ( 12668 availDomain.indexOf( 12669 domainList[i].trim(), 12670 availDomain.length - domainList[i].trim().length 12671 ) > -1 || 12672 rootDomain.indexOf( 12673 domainList[i].trim(), 12674 rootDomain.length - domainList[i].trim().length 12675 ) > -1 12676 ) { 12677 isDomainMatched = true; 12678 } 12679 } 12680 } 12681 return isDomainMatched; 12682}; 12683 12684/* Modifying anchors to open external links in new tab */ 12685var addTarget = function () { 12686 $("a").each(function () { 12687 var ref = $(this).attr("href"); 12688 if (ref !== undefined) { 12689 var ext = ref.split(".").pop(); 12690 if ( 12691 (ref.startsWith("http") && isExternal(ref) && !filterDomains(ref)) || 12692 (!isExternal(ref) && ext == "pdf") 12693 ) { 12694 $(this).attr("target", "_blank"); 12695 } 12696 } 12697 }); 12698 12699 // Ensure all links in navbar don't open in new window 12700 $(".nav.navbar-nav.navbar-right > li > a", "header").attr("target", "_self"); 12701 $(".footer-top-row li > a", "footer").attr("target", "_self"); 12702}; 12703 12704function browserSupportsCSSProperty(propertyName) { 12705 var elm = document.createElement("div"); 12706 propertyName = propertyName.toLowerCase(); 12707 12708 if (elm.style[propertyName] != undefined) return true; 12709 12710 var propertyNameCapital = 12711 propertyName.charAt(0).toUpperCase() + propertyName.substr(1), 12712 domPrefixes = "Webkit Moz ms O".split(" "); 12713 12714 for (var i = 0; i < domPrefixes.length; i++) { 12715 if (elm.style[domPrefixes[i] + propertyNameCapital] != undefined) 12716 return true; 12717 } 12718 12719 return false; 12720} 12721 12722$(document).ready(function () { 12723 // Match height of adjacent component designed to match their height. 12724 $(".component-mhg").matchHeight({ 12725 byRow: true, 12726 }); 12727 12728 $("#contactOverlay").on("hide.bs.modal", function (event) { 12729 location.reload(true); 12730 }); 12731 12732 //addTarget(); 12733 12734 toggleSelection(); 12735 12736 $("body").on("focus mouseover", "a[target='_blank']", function () { 12737 if (!$(this).hasClass("new-window-link")) { 12738 $(this) 12739 .addClass("new-window-link") 12740 .append( 12741 '<span class="new-window-msg"><i class="fa fa-warning"></i> Opens a new tab</span>' 12742 ); 12743 } 12744 }); 12745 12746 /* 12747 * This method opens up modal windows when clicked from any link configured 12748 * to open one. 12749 */ 12750 $("a[href^=modal_]").bind("click", function (e) { 12751 e.preventDefault(); 12752 var href = $(this).attr("href"); 12753 var modal_div = document.getElementById(href); 12754 if (modal_div !== null) { 12755 $(modal_div).removeClass("hidden"); 12756 $(modal_div).modal("show"); 12757 } 12758 }); 12759 12760 $(".modal-windows a.red-caret, .modal-windows a.gradient-btn").click( 12761 function () { 12762 var loc = $(this).attr("href"); 12763 var isPopupReq = isExternal(loc) && filterDomains(loc); 12764 if (!isPopupReq) { 12765 $(this).closest("div[role='dialog']").hide(); 12766 } 12767 } 12768 ); 12769 12770 /* 12771 * This method checks whether the external link request has come up from a 12772 * modal window or not. 12773 */ 12774 var checkRequestSource = function (anchor) { 12775 var isInModalWindow = $(anchor).closest(".modal-dialog.modal
12775-windows"); 12776 if ($(isInModalWindow).size() > 0) { 12777 return true; 12778 } 12779 return false; 12780 }; 12781 12782 var openExternalLink = function (loc) { 12783 var win = window.open(loc, "_blank"); 12784 win.focus(); 12785 }; 12786 /* 12787 * Tablaeu component related script $(".tableau-continer").each(function(){ 12788 * $(this).mCustomScrollbar({ theme: "dark-thick", axis:"yx" }); }); 12789 */ 12790 // fallback for loader ⦠12791 if (!browserSupportsCSSProperty("animation")) { 12792 $(".spinner").append( 12793 "<img src='/etc/designs/act/clientlibs/act-commons/images/loader.GIF' alt='' />" 12794 ); 12795 } 12796 12797 // Notification CallOut Pod Js 12798 var notywcmmode = $("#mode").val(); 12799 if (notywcmmode != "publish") { 12800 $.cookie("notyAlert", "", { path: "/" }); 12801 } 12802 if ($.cookie("notyAlert")) { 12803 var notyCookieVal = $.cookie("notyAlert"); 12804 if ($.type(notyCookieVal) === "string" && $.isNumeric(notyCookieVal)) { 12805 var notyArrVal = notyCookieVal.split(","); 12806 if ($.inArray(notificationId.toString(), notyArrVal) != -1) { 12807 $("#" + notificationId).addClass("hide"); 12808 } 12809 } 12810 } 12811 $(".notification > .close-button").click(function () { 12812 var notyArr = null; 12813 if (notywcmmode == "publish") { 12814 notyArr = []; 12815 $(this).parent().addClass("hide"); 12816 var noty = $(this).parent().attr("id"); 12817 notyArr.push(noty); 12818 if (typeof $.cookie("notyAlert") != "undefined") { 12819 notyArr.push($.cookie("notyAlert")); 12820 } 12821 $.cookie("notyAlert", notyArr, { path: "/" }); 12822 } 12823 }); 12824}); 12825 12826$(function () { 12827 $('[data-toggle="popover"]').popover(); 12828}); 12829 12830(function($) { 12831 $("table").each(function() { 12832 $(this).replaceWith( "<div class='table-responsive'>" + $(this)[0].outerHTML + "</div>" ); 12833 }); 12834})(jQuery); 12835 12836
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.