(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i= 0; i--) { (0, _methods.removeAttributeValue)(accTabsTriggers[i], 'gr-acc-tabs-trigger', 'active', true); (0, _methods.removeAttributeValue)(accTabsTargets[i], 'gr-acc-tabs-target', 'active', true); } if (!trigger.collapsable) { (0, _methods.toggleAttributeValue)(trigger, 'gr-acc-tabs-trigger', 'active', true); if (id === '') { var triggerIndex = (0, _indexOf.default)(Array.prototype).call(trigger.parentNode.querySelectorAll('[gr-acc-tabs-trigger]'), trigger); (0, _methods.toggleAttributeValue)(accTabsTargets[triggerIndex], 'gr-acc-tabs-target', 'active', true); } else { (0, _methods.toggleAttributeValue)(this.selector.querySelectorAll('[gr-acc-tabs-target~="' + id + '"]')[0], 'gr-acc-tabs-target', 'active', true); } this.onOpenTab(); } (0, _methods.removeAttributeValue)(this.selector, 'gr-expander', 'processing'); if (window.groots.verbose) { console.warn(this.pluginName + ': processed'); } } } // Destroy - remove listeners to prevent from memory leak }, { key: "destroy", value: function destroy() { window.removeEventListener('resize', this.resizeHandler); (0, _methods.removeAttributeValue)(this.selector, 'gr-equalizer', 'ready processing'); if (window.groots.verbose) { console.warn(this.pluginName + ': destroyed'); } } }]); return GrAccTabs; }(); var _default = GrAccTabs; // Auto-Instantiation // ---------------------------------------------------------------------- exports.default = _default; (function () { var all = document.querySelectorAll('[gr-acc-tabs]'); window.groots.plugins.grAccTabs = {}; if (all.length) { window.groots.plugins.grAccTabs.instances = {}; var index = -1; while (all[++index]) { window.groots.plugins.grAccTabs.instances[index] = new GrAccTabs(all[index]); } } })(); },{"../../utilities/_methods.js":11,"@babel/runtime-corejs3/core-js-stable/instance/bind":21,"@babel/runtime-corejs3/core-js-stable/instance/for-each":23,"@babel/runtime-corejs3/core-js-stable/instance/index-of":25,"@babel/runtime-corejs3/core-js-stable/object/define-property":30,"@babel/runtime-corejs3/helpers/classCallCheck":39,"@babel/runtime-corejs3/helpers/createClass":40,"@babel/runtime-corejs3/helpers/interopRequireDefault":42,"core-js/modules/es.string.split":265}],3:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault"); require("core-js/modules/es.string.split"); var _Object$defineProperty2 = require("@babel/runtime-corejs3/core-js-stable/object/define-property"); _Object$defineProperty2(exports, "__esModule", { value: true }); exports.default = void 0; var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/define-property")); var _defineProperties = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/define-properties")); var _getOwnPropertyDescriptors = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors")); var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each")); var _getOwnPropertyDescriptor = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor")); var _filter = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/filter")); var _getOwnPropertySymbols = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols")); var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys")); var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes")); var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind")); var _defineProperty3 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/defineProperty")); var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck")); var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass")); var _methods = require("../../utilities/_methods.js"); function ownKeys(object, enumerableOnly) { var keys = (0, _keys.default)(object); if (_getOwnPropertySymbols.default) { var symbols = (0, _getOwnPropertySymbols.default)(object); if (enumerableOnly) symbols = (0, _filter.default)(symbols).call(symbols, function (sym) { return (0, _getOwnPropertyDescriptor.default)(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { var _context6; (0, _forEach.default)(_context6 = ownKeys(source, true)).call(_context6, function (key) { (0, _defineProperty3.default)(target, key, source[key]); }); } else if (_getOwnPropertyDescriptors.default) { (0, _defineProperties.default)(target, (0, _getOwnPropertyDescriptors.default)(source)); } else { var _context7; (0, _forEach.default)(_context7 = ownKeys(source)).call(_context7, function (key) { (0, _defineProperty2.default)(target, key, (0, _getOwnPropertyDescriptor.default)(source, key)); }); } } return target; } // TODO: slide direction; calculate if the option list has enough space to // expand bewteen end of viewport and dropdown var GrDropdown = /*#__PURE__*/ function () { function GrDropdown(selector, options) { (0, _classCallCheck2.default)(this, GrDropdown); this.pluginName = 'grDropdown'; this.default = { trigger: '[gr-dropdown-trigger]', target: '[gr-dropdown-target]' }; // Merge defaults with user's settings this.config = _objectSpread({}, this.default, {}, options); // Create global references this.selector = typeof selector === 'string' ? document.querySelector(selector) : selector; // Get elements this.trigger = this.selector.querySelector(this.config.trigger); this.target = this.selector.querySelector(this.config.target); // Retrieve plugin custom parameters this.params = this.selector.getAttribute('gr-dropdown').split(' '); this.init(); } // Methods // ---------------------------------------------------------------------- (0, _createClass2.default)(GrDropdown, [{ key: "init", value: function init() { if (this.selector === null) { throw new Error(this.pluginName + ': fail - something wrong with your selector'); } else { var _context2; // ready this.ready = true; (0, _methods.toggleAttributeValue)(this.selector, 'gr-dropdown', 'ready'); if (window.window.groots.verbose) { console.warn(this.pluginName + ': ready'); } // binding var arr = ['handleClick', 'handleDocumentClick', 'handleMouseEnter', 'handleMouseLeave', 'handleAnimationEnd', 'handleAnimationStart']; for (var index = 0; index < arr.length; index++) { var _context; var method = arr[index]; this[method] = (0, _bind.default)(_context = this[method]).call(_context, this); } // addEventListener if ('ontouchstart' in document === false && (0, _includes.default)(_context2 = this.params).call(_context2, 'hover')) { this.selector.addEventListener('mouseenter', this.handleMouseEnter); this.selector.addEventListener('mouseleave', this.handleMouseLeave); } else { this.trigger.addEventListener('click', this.handleClick); document.addEventListener('click', this.handleDocumentClick); } this.target.addEventListener('animationstart', this.handleAnimationStart); this.target.addEventListener('animationend', this.handleAnimationEnd); } } // Destroy - remove listeners to prevent from memory leak }, { key: "destroy", value: function destroy() { var _context3; if (window.groots.verbose) { console.warn(this.pluginName + ': destroyed'); } (0, _methods.removeAttributeValue)(this.selector, 'gr-dropdown', 'ready active'); if ('ontouchstart' in document === false && (0, _includes.default)(_context3 = this.params).call(_context3, 'hover')) { this.selector.removeEventListener('mouseenter', this.handleMouseEnter); this.selector.removeEventListener('mouseleave', this.handleMouseLeave); } else { this.trigger.removeEventListener('click', this.handleClick); document.removeEventListener('click', this.handleDocumentClick); } this.target.removeEventListener('animationstart', this.handleAnimationStart); this.target.removeEventListener('animationend', this.handleAnimationEnd); } }, { key: "moveTarget", value: function moveTarget() { var _context4; if (window.groots.verbose) { console.warn(this.pluginName + ' moveTarget'); } this.params = this.selector.getAttribute('gr-dropdown').split(' '); this.isOpen = (0, _includes.default)(_context4 = this.params).call(_context4, 'active') ? false : true; (0, _methods.toggleAttributeValue)(this.selector, 'gr-dropdown', 'active', true); if (this.isOpen) { (0, _methods.removeAttributeValue)(this.selector, 'gr-dropdown', 'slide-out'); (0, _methods.toggleAttributeValue)(this.selector, 'gr-dropdown', 'slide-in'); } else { (0, _methods.removeAttributeValue)(this.selector, 'gr-dropdown', 'slide-in'); (0, _methods.toggleAttributeValue)(this.selector, 'gr-dropdown', 'slide-out'); } } }, { key: "handleAnimationStart", value: function handleAnimationStart() { if (window.groots.verbose) { console.warn(this.pluginName + ' animation start'); } (0, _methods.toggleAttributeValue)(this.selector, 'gr-dropdown', 'animating'); } }, { key: "handleAnimationEnd", value: function handleAnimationEnd() { if (window.groots.verbose) { console.warn(this.pluginName + ' animation end'); } (0, _methods.removeAttributeValue)(this.selector, 'gr-dropdown', 'animating'); (0, _methods.removeAttributeValue)(this.selector, 'gr-dropdown', 'slide-out'); (0, _methods.removeAttributeValue)(this.selector, 'gr-dropdown', 'slide-in'); } }, { key: "handleClick", value: function handleClick() { if (window.groots.verbose) { console.warn(this.pluginName + ' click'); } this.moveTarget(); } }, { key: "handleMouseEnter", value: function handleMouseEnter() { if (window.groots.verbose) { console.warn(this.pluginName + ' mouseenter'); } this.moveTarget(); } }, { key: "handleMouseLeave", value: function handleMouseLeave() { if (window.groots.verbose) { console.warn(this.pluginName + ' mouseleave'); } this.moveTarget(); } }, { key: "handleDocumentClick", value: function handleDocumentClick(event) { var _context5; this.params = this.selector.getAttribute('gr-dropdown').split(' '); if (!event.target.closest('[gr-dropdown]') && (0, _includes.default)(_context5 = this.params).call(_context5, 'active')) { if (window.groots.verbose) { console.warn('here'); console.warn(this.pluginName + ' clicked outside'); } this.moveTarget(); } } }]); return GrDropdown; }(); var _default = GrDropdown; // Auto-Instantiation // ---------------------------------------------------------------------- exports.default = _default; (function () { var all = document.querySelectorAll('[gr-dropdown]'); window.groots.plugins.grDropdown = {}; if (all.length) { window.groots.plugins.grDropdown.instances = {}; var index = -1; while (all[++index]) { window.groots.plugins.grDropdown.instances[index] = new GrDropdown(all[index]); } } })(); },{"../../utilities/_methods.js":11,"@babel/runtime-corejs3/core-js-stable/instance/bind":21,"@babel/runtime-corejs3/core-js-stable/instance/filter":22,"@babel/runtime-corejs3/core-js-stable/instance/for-each":23,"@babel/runtime-corejs3/core-js-stable/instance/includes":24,"@babel/runtime-corejs3/core-js-stable/object/define-properties":29,"@babel/runtime-corejs3/core-js-stable/object/define-property":30,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptor":31,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-descriptors":32,"@babel/runtime-corejs3/core-js-stable/object/get-own-property-symbols":33,"@babel/runtime-corejs3/core-js-stable/object/keys":34,"@babel/runtime-corejs3/helpers/classCallCheck":39,"@babel/runtime-corejs3/helpers/createClass":40,"@babel/runtime-corejs3/helpers/defineProperty":41,"@babel/runtime-corejs3/helpers/interopRequireDefault":42,"core-js/modules/es.string.split":265}],4:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault"); require("core-js/modules/es.string.split"); var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property"); _Object$defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys")); var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map")); var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind")); var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/parse-int")); var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck")); var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass")); var _methods = require("../../utilities/_methods.js"); var _grScrollTo = _interopRequireDefault(require("../grScrollTo/grScrollTo")); // ========================================================================== // Expander // Author: Globalia // Licensed under the WTFPL license // ========================================================================== var GrExpander = /*#__PURE__*/ function () { function GrExpander(selector) { (0, _classCallCheck2.default)(this, GrExpander); this.pluginName = 'grExpander'; // Create global references this.selector = typeof selector === 'string' ? document.querySelector(selector) : selector; this.trigger = this.selector.querySelector('[gr-expander-trigger]'); this.target = this.selector.querySelector('[gr-expander-target]'); this.scrollto = false; this.id = ''; // Set default parameters this.grid = false; this.selectorPaddingBottom = 0; // Retrieve plugin custom parameters this.param = this.selector.getAttribute('gr-expander').split(' '); // Overwrite with custom parameters for (var i = 0, len = this.param.length; i < len; i++) { var attr = this.param[i]; if (attr === 'grid') { this.grid = true; this.selectorPaddingBottom = (0, _parseInt2.default)(window.getComputedStyle(this.selector, null).getPropertyValue('padding-bottom'), 10); } else if (attr === 'scrollto') { this.scrollto = true; } else if (isNaN(attr)) { this.id = attr; } } this.init(); } // Methods // -------------------------------------------------------------------------- (0, _createClass2.default)(GrExpander, [{ key: "init", value: function init() { if (this.selector === null) { throw new Error(this.pluginName + ': fail - something wrong with your selector'); } else { var arr = ['handleClick']; for (var i = 0, len = arr.length; i < len; i++) { var _context; var method = arr[i]; this[method] = (0, _bind.default)(_context = this[method]).call(_context, this); } // addEventListener this.trigger.addEventListener('click', this.handleClick); (0, _methods.toggleAttributeValue)(this.selector, 'gr-expander', 'ready'); if (window.groots.verbose) { console.warn(this.pluginName + ': ready'); } } } }, { key: "handleClick", value: function handleClick(event) { event.preventDefault(); if ((0, _methods.hasAttributeValue)(this.selector, 'gr-expander', 'active')) { var _context2; this.collapse(); (0, _map.default)(_context2 = (0, _keys.default)(window.groots.plugins.grExpander.instances)).call(_context2, function (index) { var instance = window.groots.plugins.grExpander.instances[index]; instance.selector.classList.remove('is-blur'); }); } else { var _context3; (0, _map.default)(_context3 = (0, _keys.default)(window.groots.plugins.grExpander.instances)).call(_context3, function (index) { var instance = window.groots.plugins.grExpander.instances[index]; instance.selector.classList.add('is-blur'); instance.collapse(); }); this.expand(); } } }, { key: "expand", value: function expand() { if (window.groots.verbose) { console.warn(this.pluginName + ': expand'); } var targetH = this.target.scrollHeight; this.target.style.height = targetH + 'px'; if (this.scrollto) { new _grScrollTo.default(false, this.selector, 0); } if (this.grid) { var selectorPaddingBottom = this.selectorPaddingBottom + targetH; this.selector.style.paddingBottom = selectorPaddingBottom + 'px'; } (0, _methods.toggleAttributeValue)(this.selector, 'gr-expander', 'active'); if ((0, _methods.hasAttributeValue)(this.selector, 'gr-expander', 'active')) { this.selector.classList.remove('is-blur'); } } }, { key: "collapse", value: function collapse() { if (window.groots.verbose) { console.warn(this.pluginName + ': collapse'); } this.target.style.height = 0; if (this.grid) { this.selector.style.paddingBottom = this.selectorPaddingBottom + 'px'; } (0, _methods.removeAttributeValue)(this.selector, 'gr-expander', 'active'); } }, { key: "update", value: function update() { if (window.groots.verbose) { console.warn(this.pluginName + ': update height'); } var targetH = this.target.scrollHeight; this.target.style.height = targetH + 'px'; if (this.grid) { var selectorPaddingBottom = this.selectorPaddingBottom + targetH; this.selector.style.paddingBottom = selectorPaddingBottom + 'px'; } } // Destroy - remove listeners to prevent from memory leak }, { key: "destroy", value: function destroy() { this.trigger.removeEventListener('click', this.handleClick); (0, _methods.removeAttributeValue)(this.selector, 'gr-expander', 'ready processing'); if (window.groots.verbose) { console.warn(this.pluginName + ': destroyed'); } } }]); return GrExpander; }(); var _default = GrExpander; // Auto-Instantiation // -------------------------------------------------------------------------- exports.default = _default; (function () { var all = document.querySelectorAll('[gr-expander]'); window.groots.plugins.grExpander = {}; if (all.length) { window.groots.plugins.grExpander.instances = {}; var index = -1; while (all[++index]) { window.groots.plugins.grExpander.instances[index] = new GrExpander(all[index]); } } })(); },{"../../utilities/_methods.js":11,"../grScrollTo/grScrollTo":10,"@babel/runtime-corejs3/core-js-stable/instance/bind":21,"@babel/runtime-corejs3/core-js-stable/instance/map":26,"@babel/runtime-corejs3/core-js-stable/object/define-property":30,"@babel/runtime-corejs3/core-js-stable/object/keys":34,"@babel/runtime-corejs3/core-js-stable/parse-int":35,"@babel/runtime-corejs3/helpers/classCallCheck":39,"@babel/runtime-corejs3/helpers/createClass":40,"@babel/runtime-corejs3/helpers/interopRequireDefault":42,"core-js/modules/es.string.split":265}],5:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault"); var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property"); _Object$defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind")); var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck")); var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass")); var _methods = require("../../utilities/_methods.js"); // ========================================================================== // Form label // Author: Globalia // Licensed under the WTFPL license // ========================================================================== var GrFormLabel = /*#__PURE__*/ function () { function GrFormLabel(selector) { (0, _classCallCheck2.default)(this, GrFormLabel); this.pluginName = 'grFormLabel'; // Create global references this.selector = typeof selector === 'string' ? document.querySelector(selector) : selector; // Set default parameters this.input = document.getElementById(this.selector.getAttribute('for')); // Init plugin this.init(); } // Methods // ---------------------------------------------------------------------- (0, _createClass2.default)(GrFormLabel, [{ key: "init", value: function init() { if (this.selector === null) { throw new Error(this.pluginName + ': fail - something wrong with your selector'); } else { // Bind all event handlers for referencability var arr = ['handleFocus']; for (var i = 0, len = arr.length; i < len; i++) { var _context; var method = arr[i]; this[method] = (0, _bind.default)(_context = this[method]).call(_context, this); } // Add event listener(s) this.input.addEventListener('focus', this.handleFocus); this.input.addEventListener('focusout', this.handleFocus); // Active label if field is not filled if (this.input.value === '') { (0, _methods.addAttributeValue)(this.selector, 'gr-form-label', 'active'); this.input.classList.add('is-active'); } // Flag the plugin as ready this.ready = true; (0, _methods.addAttributeValue)(this.selector, 'gr-form-label', 'ready'); if (window.groots.verbose) { console.warn(this.pluginName + ': ready'); } } } }, { key: "handleFocus", value: function handleFocus() { if (this.input.value === '') { this.moveLabel(); } } }, { key: "moveLabel", value: function moveLabel() { if (window.groots.verbose) { console.warn(this.pluginName + ': move label'); } if ((0, _methods.hasAttributeValue)(this.selector, 'gr-form-label', 'active')) { (0, _methods.removeAttributeValue)(this.selector, 'gr-form-label', 'active'); this.input.classList.remove('is-active'); } else { (0, _methods.addAttributeValue)(this.selector, 'gr-form-label', 'active'); this.input.classList.add('is-active'); } if (window.groots.verbose) { console.warn(this.pluginName + ': move label back to it\'s initial position'); } } // Destroy - remove listeners to prevent from memory leak }, { key: "destroy", value: function destroy() { (0, _methods.removeAttributeValue)(this.selector, 'gr-form-label', 'ready processing'); if (window.groots.verbose) { console.warn(this.pluginName + ': destroyed'); } } }]); return GrFormLabel; }(); var _default = GrFormLabel; // Auto-Instantiation // ---------------------------------------------------------------------- exports.default = _default; (function () { var all = document.querySelectorAll('[gr-form-label]'); window.groots.plugins.grFormLabel = {}; if (all.length) { window.groots.plugins.grFormLabel.instances = {}; var index = -1; while (all[++index]) { window.groots.plugins.grFormLabel.instances[index] = new GrFormLabel(all[index]); } } })(); },{"../../utilities/_methods.js":11,"@babel/runtime-corejs3/core-js-stable/instance/bind":21,"@babel/runtime-corejs3/core-js-stable/object/define-property":30,"@babel/runtime-corejs3/helpers/classCallCheck":39,"@babel/runtime-corejs3/helpers/createClass":40,"@babel/runtime-corejs3/helpers/interopRequireDefault":42}],6:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault"); var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property"); _Object$defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys")); var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck")); var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass")); var _methods = require("../../utilities/_methods.js"); var _grFormUpload = _interopRequireDefault(require("../grFormUpload/grFormUpload")); // ========================================================================== // Form normalize // Author: Globalia // Licensed under the WTFPL license // ========================================================================== var GrFormNormalize = /*#__PURE__*/ function () { function GrFormNormalize(selector) { (0, _classCallCheck2.default)(this, GrFormNormalize); this.pluginName = 'grFormNormalize'; // Create global references this.selector = typeof selector === 'string' ? document.querySelector(selector) : selector; // Init this.init(); } // Methods // -------------------------------------------------------------------------- (0, _createClass2.default)(GrFormNormalize, [{ key: "init", value: function init() { this.normelizeHubspot(); if (window.groots.plugins.grFormSelect !== undefined) { // Re-initialize form selects var selects = this.selector.querySelectorAll('select'); if (selects.length) { var globIndex = -1; var index = -1; if (window.groots.plugins.grFormSelect.instances === undefined) { window.groots.plugins.grFormSelect.instances = {}; } else { globIndex = (0, _keys.default)(window.groots.plugins.grFormSelect.instances).length; } while (selects[++index]) { window.groots.plugins.grFormSelect.instances[globIndex] = new GrFormSelect(selects[index]); } } } if (window.groots.plugins.grFormUpload !== undefined) { // Re-initialize form file inputs var fileInputs = this.selector.querySelectorAll('input[type="file"]'); if (fileInputs.length) { var _globIndex = -1; var _index = -1; if (window.groots.plugins.grFormUpload.instances === undefined) { window.groots.plugins.grFormUpload.instances = {}; } else { _globIndex = (0, _keys.default)(window.groots.plugins.grFormUpload.instances).length; } while (fileInputs[++_index]) { window.groots.plugins.grFormUpload.instances[_globIndex] = new _grFormUpload.default(fileInputs[_index]); } } } (0, _methods.toggleAttributeValue)(this.selector, 'gr-form-normalize', 'ready'); if (window.groots.verbose) { console.warn(this.pluginName + ': ready'); } } }, { key: "normelizeHubspot", value: function normelizeHubspot() { if (window.groots.verbose) { console.warn(this.pluginName + ': processing start'); } (0, _methods.toggleAttributeValue)(this.selector, 'gr-form-normalize', 'processing'); // Make sure that checkbox and radio are positionned before their label var checkboxes = this.selector.querySelectorAll('input[type="checkbox"]'); for (var i = checkboxes.length - 1; i >= 0; i--) { var label = this.selector.querySelector('label[for="' + checkboxes[i].getAttribute('id') + '"].hs-form-booleancheckbox-display, label[for="' + checkboxes[i].getAttribute('id') + '"].hs-form-checkbox-display'); checkboxes[i].parentNode.parentNode.insertBefore(checkboxes[i], label); } var radios = this.selector.querySelectorAll('input[type="radio"]'); for (var _i = radios.length - 1; _i >= 0; _i--) { var _label = this.selector.querySelector('label[for="' + radios[_i].getAttribute('id') + '"].hs-form-radio-display'); radios[_i].parentNode.parentNode.insertBefore(radios[_i], _label); } // Make sure that file input labels are positionned after var fileInputs = this.selector.querySelectorAll('input[type="file"]'); for (var _i2 = fileInputs.length - 1; _i2 >= 0; _i2--) { var _label2 = this.selector.querySelector('label[for="' + fileInputs[_i2].getAttribute('id') + '"]'); fileInputs[_i2].parentNode.insertBefore(_label2, fileInputs[_i2].nextSibling); } (0, _methods.removeAttributeValue)(this.selector, 'gr-form-normalize', 'processing'); if (window.groots.verbose) { console.warn(this.pluginName + ': processed'); } } // Destroy - remove listeners to prevent from memory leak }, { key: "destroy", value: function destroy() { (0, _methods.removeAttributeValue)(this.selector, 'gr-form-normalize', 'ready processing'); if (window.groots.verbose) { console.warn(this.pluginName + ': destroyed'); } } }]); return GrFormNormalize; }(); var _default = GrFormNormalize; // Auto-Instantiation // ---------------------------------------------------------------------- exports.default = _default; (function () { var all = document.querySelectorAll('[gr-form-normalize]'); window.groots.plugins.grFormNormalize = {}; window.addEventListener('load', function () { if (all.length) { window.groots.plugins.grFormNormalize.instances = {}; var index = -1; while (all[++index]) { window.groots.plugins.grFormNormalize.instances[index] = new GrFormNormalize(all[index]); } } }, false); })(); },{"../../utilities/_methods.js":11,"../grFormUpload/grFormUpload":7,"@babel/runtime-corejs3/core-js-stable/object/define-property":30,"@babel/runtime-corejs3/core-js-stable/object/keys":34,"@babel/runtime-corejs3/helpers/classCallCheck":39,"@babel/runtime-corejs3/helpers/createClass":40,"@babel/runtime-corejs3/helpers/interopRequireDefault":42}],7:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault"); require("core-js/modules/es.string.replace"); var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property"); _Object$defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind")); var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck")); var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass")); var _methods = require("../../utilities/_methods.js"); // ========================================================================== // Form Upload // Author: Globalia // Licensed under the WTFPL license // ========================================================================== var GrFormUpload = /*#__PURE__*/ function () { function GrFormUpload(selector) { (0, _classCallCheck2.default)(this, GrFormUpload); this.pluginName = 'grFormUpload'; this.selector = typeof selector === 'string' ? document.querySelector(selector) : selector; this.init(); } // Methods // ---------------------------------------------------------------------- (0, _createClass2.default)(GrFormUpload, [{ key: "init", value: function init() { if (this.selector === null) { throw new Error(this.pluginName + ': fail - something wrong with your selector'); } else { // Bind all event handlers for referencability var arr = ['changeHandler']; for (var i = 0, len = arr.length; i < len; i++) { var _context; var method = arr[i]; this[method] = (0, _bind.default)(_context = this[method]).call(_context, this); } window.addEventListener('change', this.changeHandler); this.build(); (0, _methods.toggleAttributeValue)(this.selector, 'gr-form-upload', 'ready'); if (window.groots.verbose) { console.warn(this.pluginName + ': ready'); } } } }, { key: "build", value: function build() { if (window.groots.verbose) { console.warn(this.pluginName + ': processing'); } (0, _methods.toggleAttributeValue)(this.selector, 'gr-form-upload', 'processing'); var fake_label = document.createElement('label'); var fake_label_inner = document.createElement('span'); fake_label.appendChild(fake_label_inner); fake_label.setAttribute('for', this.selector.id); fake_label_inner.innerHTML = this.selector.getAttribute('placeholder') !== null ? this.selector.getAttribute('placeholder') : 'Browse for file...'; var collection = [this.selector, fake_label]; var wrapper = document.createElement('div'); wrapper.setAttribute('gr-form', 'upload-wrapper'); (0, _methods.wrapAll)(collection, wrapper); (0, _methods.removeAttributeValue)(this.selector, 'gr-form-upload', 'processing'); } }, { key: "changeHandler", value: function changeHandler() { if (window.groots.verbose) { console.warn(this.pluginName + ': changed'); } if (this.selector.value !== '') { var filename = this.selector.value.replace(/^.*[\\\/]/, ''); this.selector.parentNode.querySelector('label span').innerHTML = filename; } else { this.selector.parentNode.querySelector('label span').innerHTML = this.selector.getAttribute('placeholder') !== null ? this.selector.getAttribute('placeholder') : 'Browse for file...'; } } }]); return GrFormUpload; }(); var _default = GrFormUpload; // Auto-Instantiation // ---------------------------------------------------------------------- exports.default = _default; (function () { var all = document.querySelectorAll('[gr-form] input[type=file]'); window.groots.plugins.grFormUpload = {}; if (all.length) { window.groots.plugins.grFormUpload.instances = {}; var index = -1; while (all[++index]) { window.groots.plugins.grFormUpload.instances[index] = new GrFormUpload(all[index]); } } })(); },{"../../utilities/_methods.js":11,"@babel/runtime-corejs3/core-js-stable/instance/bind":21,"@babel/runtime-corejs3/core-js-stable/object/define-property":30,"@babel/runtime-corejs3/helpers/classCallCheck":39,"@babel/runtime-corejs3/helpers/createClass":40,"@babel/runtime-corejs3/helpers/interopRequireDefault":42,"core-js/modules/es.string.replace":264}],8:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault"); require("core-js/modules/es.function.name"); require("core-js/modules/es.regexp.constructor"); require("core-js/modules/es.regexp.to-string"); require("core-js/modules/es.string.split"); var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property"); _Object$defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind")); var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of")); var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck")); var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass")); var _methods = require("../../utilities/_methods.js"); // ========================================================================== // JavaScript Component // Author: Globalia // Licensed under the WTFPL license // ========================================================================== var GrFormValidation = /*#__PURE__*/ function () { function GrFormValidation(selector) { var _context, _context2; (0, _classCallCheck2.default)(this, GrFormValidation); // Create global references this.pluginName = 'grFormValidation'; this.selector = typeof selector === 'string' ? document.querySelector(selector) : selector; this.requiredFields = []; this.fieldContainer = '[gr-form~=field]'; this.isValid; this.lang = (0, _indexOf.default)(_context = document.documentElement.lang).call(_context, 'fr') !== -1 ? 'fr' : 'en'; this.country = (0, _indexOf.default)(_context2 = document.documentElement.lang).call(_context2, 'us') !== -1 ? 'us' : 'ca'; this.messages = { en: { email: 'This value should be a valid email.', url: 'This value should be a valid url.', number: 'This value should be a valid number.', alphanumeric: 'This value should be alphanumeric.', required: 'This value is required.', postalcode: 'This value is not a valid postal code.', minlength: 'This value is too short. It should have %s characters or more.', maxlength: 'This value is too long. It should have %s characters or fewer.', length: 'This value length is invalid. It should be between %s and %s characters long.' }, fr: { email: 'Cette valeur n\'est pas une adresse email valide.', url: 'Cette valeur n\'est pas une URL valide.', number: 'Cette valeur doit être un nombre.', alphanumeric: 'Cette valeur doit être alphanumérique.', required: 'Ce champ est requis.', postalcode: 'Cette valeur doit être un code postal valide.', minlength: 'Cette chaîne est trop courte. Elle doit avoir au minimum %s caractères.', maxlength: 'Cette chaîne est trop longue. Elle doit avoir au maximum %s caractères.', length: 'Cette valeur doit contenir entre %s et %s caractères.' } }; this.patterns = { alphanumeric: /^\w+$/i, number: /^-?(\d*\.)?\d+(e[-+]?\d+)?$/i, postalcode: { ca: /^[A-Za-z]\d[A-Za-z][ -]?\d[A-Za-z]\d$/, us: /(^\d{5}$)|(^\d{5}-\d{4}$)/ }, email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, url: new RegExp('^' + // protocol identifier '(?:(?:https?|ftp)://)?' + // ** mod: make scheme optional // user:pass authentication '(?:\\S+(?::\\S*)?@)?' + '(?:' + // IP address exclusion '(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])' + '(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}' + '(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))' + '|' + // host name "(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)" + // domain name "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*" + // TLD identifier "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))" + ')' + // port number '(?::\\d{2,5})?' + // resource path '(?:/\\S*)?' + '$', 'i') }; // Retrieve plugin custom parameters this.param = this.selector.getAttribute('gr-form-validation').split(' '); // Overwrite with custom parameters for (var index = 0; index < this.param.length; index++) { if (this.param[index] !== '') { var fieldContainer = this.param[index]; if (isNaN(fieldContainer)) this.fieldContainer = fieldContainer; } } // If binding on element wrapper if (this.selector.tagName !== 'FORM' && this.selector.querySelector('form') !== null) { if (this.selector.querySelector('form') !== null) { this.selector = this.selector.querySelector('form'); } } // Prevent execution if no forms if (this.selector.tagName === 'FORM') { // Init plugin this.init(); } } // Methods // ---------------------------------------------------------------------- (0, _createClass2.default)(GrFormValidation, [{ key: "init", value: function init() { if (this.selector === null) { throw new Error(this.pluginName + ': fail - something wrong with your selector'); } else { // Bind all event handlers for referencability var arr = ['handleSubmit']; for (var i = 0, len = arr.length; i < len; i++) { var _context3; var method = arr[i]; this[method] = (0, _bind.default)(_context3 = this[method]).call(_context3, this); } // Get all required fields for (var i = 0; i < this.selector.elements.length; i++) { if (this.selector.elements[i].hasAttribute('required')) { this.requiredFields.push(this.selector.elements[i]); } } // addEventListener this.selector.addEventListener('submit', this.handleSubmit); // Flag the plugin as ready this.ready = true; (0, _methods.toggleAttributeValue)(this.selector, 'gr-form-validation', 'ready'); if (window.groots.verbose) { console.warn(this.pluginName + '(' + this.selector.id + '): ready'); } } } }, { key: "handleSubmit", value: function handleSubmit(event) { if (window.groots.verbose) { console.warn(this.pluginName + ': processing start'); } // Default true if no errors this.isValid = true; (0, _methods.toggleAttributeValue)(this.selector, 'gr-form-validation', 'processing'); // Loop through all required fields for (var i = 0; i < this.requiredFields.length; i++) { this.requiredFields[i].isValid = true; this.requiredFields[i].errorTypes = []; // Remove past messages this.removeMessages(this.requiredFields[i]); if (this.requiredFields[i].value === '' || this.requiredFields[i].value === 'default') { // Check if fields are empty this.requiredFields[i].isValid = false; this.requiredFields[i].errorTypes.push('required'); } else { switch (this.requiredFields[i].type) { case 'email': // Check if email fields are valid this.requiredFields[i].isValid = this.validateField('email', this.requiredFields[i].value); this.requiredFields[i].errorTypes.push('email'); break; case 'radio': // Check if required radios are checked this.validateRadio(this.requiredFields[i].name); this.requiredFields[i].errorTypes.push('required'); break; case 'checkbox': // Check if required checkboxes are checked this.requiredFields[i].isValid = this.requiredFields[i].checked; this.requiredFields[i].errorTypes.push('required'); break; } // Check if custom types are valids switch (this.requiredFields[i].getAttribute('gr-form-validation-type')) { case 'number': this.requiredFields[i].isValid = this.validateField('number', this.requiredFields[i].value); this.requiredFields[i].errorTypes.push('number'); break; case 'alphanumeric': this.requiredFields[i].isValid = this.validateField('alphanumeric', this.requiredFields[i].value); this.requiredFields[i].errorTypes.push('alphanumeric'); break; case 'postalcode': this.requiredFields[i].isValid = this.validateField('postalcode', this.requiredFields[i].value); this.requiredFields[i].errorTypes.push('postalcode'); break; case 'url': this.requiredFields[i].isValid = this.validateField('url', this.requiredFields[i].value); this.requiredFields[i].errorTypes.push('url'); break; } // Check for length limitations if (this.requiredFields[i].getAttribute('minlength') && this.requiredFields[i].getAttribute('maxlength')) { var valueLength = this.requiredFields[i].value.length; if (valueLength > this.requiredFields[i].getAttribute('maxlength') || valueLength < this.requiredFields[i].getAttribute('minlength')) { this.requiredFields[i].errorTypes.push('length'); } } else if (this.requiredFields[i].getAttribute('minlength')) { if (this.requiredFields[i].value.length < this.requiredFields[i].getAttribute('minlength')) { this.requiredFields[i].errorTypes.push('minlength'); } } else if (this.requiredFields[i].getAttribute('maxlength')) { if (this.requiredFields[i].value.length > this.requiredFields[i].getAttribute('minlength')) { this.requiredFields[i].errorTypes.push('maxlength'); } } } // Flag form as not valid if there is at least one error if (this.isValid && !this.requiredFields[i].isValid) { this.isValid = false; } if (!this.requiredFields[i].isValid) { for (var j = 0; j < this.requiredFields[i].errorTypes.length; j++) { this.addMessages(this.requiredFields[i].errorTypes[j], this.requiredFields[i]); } } } (0, _methods.removeAttributeValue)(this.selector, 'gr-form-validation', 'processing'); if (window.groots.verbose) { console.warn(this.pluginName + ': processed'); } // Do not submit form if not valid if (!this.isValid) { event.preventDefault(); } } }, { key: "addMessages", value: function addMessages(type, field) { var fieldContainer = field.closest(this.fieldContainer); if (fieldContainer === null) fieldContainer = field.closest('div'); // If there is a file upload wrapper from grFormUpload, get parent to get field container if ((0, _methods.hasAttributeValue)(fieldContainer, 'gr-form', 'upload-wrapper')) { fieldContainer = fieldContainer.parentNode; } // Add message list var errorList, errorEl, errorMsg; if (!document.contains(fieldContainer.querySelector('[gr-form-validation-error-list]'))) { // Construct message list errorList = document.createElement('ul'); errorMsg = this.messages[this.lang][type]; errorList.setAttribute('gr-form-validation-error-list', ''); if (type === 'length') { errorMsg = (0, _methods.sprintf)(errorMsg, [field.getAttribute('minlength'), field.getAttribute('maxlength')]); } else if (type === 'minlength') { errorMsg = (0, _methods.sprintf)(errorMsg, [field.getAttribute('minlength')]); } else if (type === 'maxlength') { errorMsg = (0, _methods.sprintf)(errorMsg, [field.getAttribute('maxlength')]); } errorList.innerHTML = '
  • ' + errorMsg + '
  • '; // Append message list fieldContainer.setAttribute('gr-form-validation-error', ''); fieldContainer.appendChild(errorList); } else { // Get message list errorList = fieldContainer.querySelector('[gr-form-validation-error-list]'); // Construct message errorEl = document.createElement('li'); errorMsg = this.messages[this.lang][type]; if (type === 'length') { errorMsg = (0, _methods.sprintf)(errorMsg, [field.getAttribute('minlength'), field.getAttribute('maxlength')]); } else if (type === 'minlength') { errorMsg = (0, _methods.sprintf)(errorMsg, [field.getAttribute('minlength')]); } else if (type === 'maxlength') { errorMsg = (0, _methods.sprintf)(errorMsg, [field.getAttribute('maxlength')]); } // Append message errorEl.appendChild(document.createTextNode(errorMsg)); errorList.appendChild(errorEl); } } }, { key: "removeMessages", value: function removeMessages(field) { var fieldContainer = field.closest(this.fieldContainer); if (fieldContainer === null) fieldContainer = field.closest('div'); if (document.contains(fieldContainer.querySelector('[gr-form-validation-error-list]'))) { fieldContainer.removeAttribute('gr-form-validation-error'); fieldContainer.removeChild(fieldContainer.querySelector('[gr-form-validation-error-list]')); } } }, { key: "validateField", value: function validateField(type, value) { // Get regex pattern for this type var regex; if (type === 'postalcode') { regex = this.patterns[type][this.country]; } else { regex = this.patterns[type]; } // Test the value with the pattern return regex.test(String(value).toLowerCase()); } }, { key: "validateRadio", value: function validateRadio(radioName, radioIndex) { var isValid = false; // Go through radio group to check if any of them is checked var i = 0; while (i < this.requiredFields.length && !isValid) { if (this.requiredFields[i].type === 'radio' && this.requiredFields[i].name === radioName && this.requiredFields[i].checked) { isValid = true; } i++; } // Update validation booleans for all radios of the group for (var j = 0; j < this.requiredFields.length; ++j) { if (this.requiredFields[j].type === 'radio' && this.requiredFields[j].name === radioName) { this.requiredFields[j].isValid = isValid; } } return isValid; } // Destroy - remove listeners to prevent from memory leak }, { key: "destroy", value: function destroy() { (0, _methods.removeAttributeValue)(this.selector, 'gr-form-validation', 'ready processing'); if (window.groots.verbose) { console.warn(this.pluginName + ': destroyed'); } } }]); return GrFormValidation; }(); var _default = GrFormValidation; // Auto-Instantiation // ---------------------------------------------------------------------- exports.default = _default; (function () { var all = document.querySelectorAll('[gr-form-validation]'); window.groots.plugins.grFormValidation = {}; if (all.length) { window.groots.plugins.grFormValidation.instances = {}; var index = -1; while (all[++index]) { window.groots.plugins.grFormValidation.instances[index] = new GrFormValidation(all[index]); } } })(); },{"../../utilities/_methods.js":11,"@babel/runtime-corejs3/core-js-stable/instance/bind":21,"@babel/runtime-corejs3/core-js-stable/instance/index-of":25,"@babel/runtime-corejs3/core-js-stable/object/define-property":30,"@babel/runtime-corejs3/helpers/classCallCheck":39,"@babel/runtime-corejs3/helpers/createClass":40,"@babel/runtime-corejs3/helpers/interopRequireDefault":42,"core-js/modules/es.function.name":261,"core-js/modules/es.regexp.constructor":262,"core-js/modules/es.regexp.to-string":263,"core-js/modules/es.string.split":265}],9:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault"); require("core-js/modules/es.string.split"); var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property"); _Object$defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys")); var _includes = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/includes")); var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind")); var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck")); var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass")); var _methods = require("../../utilities/_methods.js"); // ========================================================================== // Responsive Navigation // Author: Globalia // Licensed under the WTFPL license // ========================================================================== var GrNavigation = /*#__PURE__*/ function () { function GrNavigation(selector) { (0, _classCallCheck2.default)(this, GrNavigation); this.pluginName = 'grNavigation'; // Create global references this.selector = typeof selector === 'string' ? document.querySelector(selector) : selector; // Set default parameters this.config = { trigger: '[gr-nav-trigger]', target: '[gr-nav-panel]', subtrigger: '[gr-subnav-trigger]', subtarget: '[gr-subnav-panel]' }; // Create overlay if not already added if (!document.querySelector('[gr-overlay]')) { var overlay = document.createElement('div'); overlay.setAttribute('gr-overlay', ''); document.body.appendChild(overlay); this.overlay = overlay; } else { this.overlay = document.querySelector('[gr-overlay]'); } // Init plugin this.init(); } // Methods // ---------------------------------------------------------------------- (0, _createClass2.default)(GrNavigation, [{ key: "init", value: function init() { if (this.selector === null) { throw new Error(this.pluginName + ': fail - something wrong with your selector'); } else { // Bind all event handlers for referencability var arr = ['resizeHandler', 'mouseclickHandler', 'keyupHandler']; for (var i = 0, len = arr.length; i < len; i++) { var _context; var method = arr[i]; this[method] = (0, _bind.default)(_context = this[method]).call(_context, this); } window.addEventListener('resize', this.resizeHandler); document.addEventListener('click', this.mouseclickHandler); document.addEventListener('keyup', this.keyupHandler); // Flag the plugin as ready this.ready = true; (0, _methods.toggleAttributeValue)(this.selector, 'gr-nav', 'ready'); if (window.groots.verbose) { console.warn(this.pluginName + ': ready'); } } } }, { key: "resizeHandler", value: function resizeHandler() { (0, _methods.removeAttributeValue)(this.selector, 'gr-nav', 'active'); (0, _methods.removeAttributeValue)(this.selector.querySelector(this.config.trigger), 'gr-nav-trigger', 'active'); (0, _methods.removeAttributeValue)(this.selector.querySelector(this.config.target), 'gr-nav-panel', 'active'); (0, _methods.removeAttributeValue)(this.selector.querySelector(this.config.subtrigger), 'gr-subnav-trigger', 'active'); (0, _methods.removeAttributeValue)(this.selector.querySelector(this.config.subtarget), 'gr-subnav-panel', 'active'); (0, _methods.removeAttributeValue)(this.overlay, 'gr-overlay', 'visible'); } }, { key: "mouseclickHandler", value: function mouseclickHandler(event) { if (event.target.closest('[gr-nav-trigger]')) { event.preventDefault(); var trigger = event.target.closest('[gr-nav-trigger]'); (0, _methods.toggleAttributeValue)(this.selector, 'gr-nav', 'active'); (0, _methods.toggleAttributeValue)(trigger, 'gr-nav-trigger', 'active'); (0, _methods.toggleAttributeValue)(this.selector.querySelector('[gr-nav-panel]'), 'gr-nav-panel', 'active'); document.querySelector('body').classList.toggle('nav-is-open'); // Remove subnav triggers and panels active states var subNavTriggers = this.selector.querySelectorAll('[gr-subnav-trigger]'); var subNavPanels = this.selector.querySelectorAll('[gr-subnav-panel]'); for (var i = subNavTriggers.length - 1; i >= 0; i--) { (0, _methods.removeAttributeValue)(subNavTriggers[i], 'gr-subnav-trigger', 'active', true); } for (var i = subNavPanels.length - 1; i >= 0; i--) { (0, _methods.removeAttributeValue)(subNavPanels[i], 'gr-subnav-panel', 'active', true); } (0, _methods.toggleAttributeValue)(this.overlay, 'gr-overlay', 'visible'); } else if (event.target.closest('[gr-subnav-trigger]')) { var trigger = event.target.closest('[gr-subnav-trigger]'); var canTrigger = true; var isActive = false; var values = trigger.getAttribute('gr-subnav-trigger').split(' '); var id = ''; var breakpoint = ''; // Get id and breakpoint attributes values if (values[0] !== '' || values.length > 1) { for (var i = 0, len = values.length; i < len; i++) { var _context2; var attr = values[i]; if ((0, _includes.default)(_context2 = (0, _keys.default)(window.groots.breakpoints)).call(_context2, attr)) { breakpoint = attr; } else if (attr === 'active') { isActive = true; } else { id = attr; } } } // If breakpoint is set, check if subnav can be triggered on click if (breakpoint !== '') { canTrigger = (0, _methods.maxWidth)(breakpoint) || document.body.classList.contains('u-is-touch'); } if (canTrigger) { event.preventDefault(); if (isActive) { if (id !== '') { // Toggle all triggers that have this id var subNavTriggerswithID = this.selector.querySelectorAll('[gr-subnav-trigger~="' + id + '"]'); for (var i = subNavTriggerswithID.length - 1; i >= 0; i--) { (0, _methods.removeAttributeValue)(subNavTriggerswithID[i], 'gr-subnav-trigger', 'active', true); } // Match the panel id (0, _methods.removeAttributeValue)(this.selector.querySelector('[gr-subnav-panel~="' + id + '"]'), 'gr-subnav-panel', 'active', true); } else { // Toggle the trigger (0, _methods.removeAttributeValue)(trigger, 'gr-subnav-trigger', 'active', true); // Toggle the next sibling which is the panel (0, _methods.removeAttributeValue)(trigger.nextElementSibling, 'gr-subnav-panel', 'active', true); } // Remove overlay if subnav is not open in desktop menu if (!(0, _methods.hasAttributeValue)(this.selector.querySelector(this.config.target), 'gr-nav-panel', 'active')) { (0, _methods.removeAttributeValue)(this.overlay, 'gr-overlay', 'visible'); } } else { // Remove subnav triggers and panels active states var subNavTriggers = this.selector.querySelectorAll('[gr-subnav-trigger]'); var subNavPanels = this.selector.querySelectorAll('[gr-subnav-panel]'); for (var i = subNavTriggers.length - 1; i >= 0; i--) { (0, _methods.removeAttributeValue)(subNavTriggers[i], 'gr-subnav-trigger', 'active', true); } for (var i = subNavPanels.length - 1; i >= 0; i--) { (0, _methods.removeAttributeValue)(subNavPanels[i], 'gr-subnav-panel', 'active', true); } if (id !== '') { // Toggle all triggers that have this id var subNavTriggerswithID = this.selector.querySelectorAll('[gr-subnav-trigger~="' + id + '"]'); for (var i = subNavTriggerswithID.length - 1; i >= 0; i--) { (0, _methods.addAttributeValue)(subNavTriggerswithID[i], 'gr-subnav-trigger', 'active', true); } // Match the panel id (0, _methods.addAttributeValue)(this.selector.querySelector('[gr-subnav-panel~="' + id + '"]'), 'gr-subnav-panel', 'active', true); } else { // Toggle the trigger (0, _methods.addAttributeValue)(trigger, 'gr-subnav-trigger', 'active', true); // Toggle the next sibling which is the panel (0, _methods.addAttributeValue)(trigger.nextElementSibling, 'gr-subnav-panel', 'active', true); } // Add overlay if subnav is not open in desktop menu if (!(0, _methods.hasAttributeValue)(this.selector.querySelector(this.config.target), 'gr-nav-panel', 'active')) { (0, _methods.addAttributeValue)(this.overlay, 'gr-overlay', 'visible'); } } } } else if (event.target === this.overlay) { (0, _methods.removeAttributeValue)(this.selector, 'gr-nav', 'active'); (0, _methods.removeAttributeValue)(this.selector.querySelector(this.config.trigger), 'gr-nav-trigger', 'active'); (0, _methods.removeAttributeValue)(this.selector.querySelector(this.config.target), 'gr-nav-panel', 'active'); // Remove subnav triggers and panels active states var subNavTriggers = this.selector.querySelectorAll('[gr-subnav-trigger]'); var subNavPanels = this.selector.querySelectorAll('[gr-subnav-panel]'); for (var i = subNavTriggers.length - 1; i >= 0; i--) { (0, _methods.removeAttributeValue)(subNavTriggers[i], 'gr-subnav-trigger', 'active', true); } for (var i = subNavPanels.length - 1; i >= 0; i--) { (0, _methods.removeAttributeValue)(subNavPanels[i], 'gr-subnav-panel', 'active', true); } (0, _methods.removeAttributeValue)(this.overlay, 'gr-overlay', 'visible'); } } }, { key: "keyupHandler", value: function keyupHandler(event) { event.preventDefault(); if (event.keyCode === 27) { (0, _methods.removeAttributeValue)(this.selector, 'gr-nav', 'active'); (0, _methods.removeAttributeValue)(this.selector.querySelector(this.config.trigger), 'gr-nav-trigger', 'active'); (0, _methods.removeAttributeValue)(this.selector.querySelector(this.config.target), 'gr-nav-panel', 'active'); (0, _methods.removeAttributeValue)(this.selector.querySelector(this.config.subtrigger), 'gr-subnav-trigger', 'active'); (0, _methods.removeAttributeValue)(this.selector.querySelector(this.config.subtarget), 'gr-subnav-panel', 'active'); (0, _methods.removeAttributeValue)(this.overlay, 'gr-overlay', 'visible'); } } // Destroy - remove listeners to prevent from memory leak }, { key: "destroy", value: function destroy() { window.removeEventListener('resize', this.resizeHandler); document.removeEventListener('click', this.mouseclickHandler); document.removeEventListener('keyup', this.keyupHandler); (0, _methods.removeAttributeValue)(this.selector, 'gr-nav', 'ready active'); (0, _methods.removeAttributeValue)(this.selector.querySelector(this.config.trigger), 'gr-nav-trigger', 'active'); (0, _methods.removeAttributeValue)(this.selector.querySelector(this.config.target), 'gr-nav-panel', 'active'); (0, _methods.removeAttributeValue)(this.selector.querySelector(this.config.subtrigger), 'gr-subnav-trigger', 'active'); (0, _methods.removeAttributeValue)(this.selector.querySelector(this.config.subtarget), 'gr-subnav-panel', 'active'); (0, _methods.removeAttributeValue)(this.overlay, 'gr-overlay', 'visible'); if (window.groots.verbose) { console.warn(this.pluginName + ': destroyed'); } } }]); return GrNavigation; }(); var _default = GrNavigation; // Auto-Instantiation // ---------------------------------------------------------------------- exports.default = _default; (function () { var all = document.querySelectorAll('[gr-nav]'); window.groots.plugins.grNavigation = {}; if (all.length) { window.groots.plugins.grNavigation.instances = {}; var index = -1; while (all[++index]) { window.groots.plugins.grNavigation.instances[index] = new GrNavigation(all[index]); } } })(); },{"../../utilities/_methods.js":11,"@babel/runtime-corejs3/core-js-stable/instance/bind":21,"@babel/runtime-corejs3/core-js-stable/instance/includes":24,"@babel/runtime-corejs3/core-js-stable/object/define-property":30,"@babel/runtime-corejs3/core-js-stable/object/keys":34,"@babel/runtime-corejs3/helpers/classCallCheck":39,"@babel/runtime-corejs3/helpers/createClass":40,"@babel/runtime-corejs3/helpers/interopRequireDefault":42,"core-js/modules/es.string.split":265}],10:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault"); require("core-js/modules/es.string.split"); var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property"); _Object$defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind")); var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/parse-int")); var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck")); var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass")); var _methods = require("../../utilities/_methods.js"); // ========================================================================== // ScrollTo // Author: Globalia // Licensed under the WTFPL license // ========================================================================== var GrScrollTo = /*#__PURE__*/ function () { function GrScrollTo(selector) { var target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document.body; var offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; (0, _classCallCheck2.default)(this, GrScrollTo); this.pluginName = 'grScrollTo'; // Create global references this.selector = typeof selector === 'string' ? document.querySelector(selector) : selector; // Set default parameters this.target = target; this.extraHeight = offset; if (this.selector) { // Retrieve plugin custom parameters this.param = this.selector.getAttribute('gr-scroll-to').split(' '); // Overwrite with custom parameters if (this.param[0] !== '') { for (var i = 0, len = this.param.length; i < len; i++) { var attr = this.param[i]; if (!isNaN(attr)) this.extraHeight = (0, _parseInt2.default)(attr, 10); if (attr.charAt(0) === '#' || attr.charAt(0) === '.') this.target = attr; } } } // Get target element this.targetEl = typeof this.target === 'string' ? document.querySelector(this.target) : this.target; // Init plugin this.init(); } // Methods // ---------------------------------------------------------------------- (0, _createClass2.default)(GrScrollTo, [{ key: "init", value: function init() { if (this.selector === null) { throw new Error(this.pluginName + ': fail - something wrong with your selector'); } else { if (this.selector) { var _context; // Bind all event handlers for referencability this['clickHandler'] = (0, _bind.default)(_context = this['clickHandler']).call(_context, this); this.selector.addEventListener('click', this.clickHandler); (0, _methods.toggleAttributeValue)(this.selector, 'gr-scroll-to', 'ready'); } else { this.goToEl(); } if (window.groots.verbose) { console.warn(this.pluginName + ': ready'); } } } }, { key: "clickHandler", value: function clickHandler(event) { event.preventDefault(); this.goToEl(); } }, { key: "goToEl", value: function goToEl() { if (this.selector) (0, _methods.toggleAttributeValue)(this.selector, 'gr-scroll-to', 'processing'); // Get values var start = window.pageYOffset; var startTime = 'now' in window.performance ? performance.now() : new Date().getTime(); var extraHeight = this.extraHeight; if (this.targetEl !== document.body) { var nav = document.querySelector('[gr-nav]'); if ((0, _methods.hasAttributeValue)(nav, 'gr-nav', 'sticky')) { extraHeight += nav.offsetHeight; } } var documentHeight = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight); var windowHeight = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight; var destinationOffset = window.pageYOffset + this.targetEl.getBoundingClientRect().top - extraHeight; var destinationOffsetToScroll = Math.round(documentHeight - destinationOffset < windowHeight ? documentHeight - windowHeight : destinationOffset); // Animate if ('requestAnimationFrame' in window === false) { window.scroll(0, destinationOffsetToScroll); return; } function scroll() { var now = 'now' in window.performance ? performance.now() : new Date().getTime(); var time = Math.min(1, (now - startTime) / 600); var timeFunction = (0, _methods.easeOutCubic)(time); window.scroll(0, Math.ceil(timeFunction * (destinationOffsetToScroll - start) + start)); if (window.pageYOffset === destinationOffsetToScroll) { return; } requestAnimationFrame(scroll); } scroll(); if (this.selector) (0, _methods.removeAttributeValue)(this.selector, 'gr-scroll-to', 'processing'); if (window.groots.verbose) { console.warn(this.pluginName + ': processed'); } } // Destroy - remove listeners to prevent from memory leak }, { key: "destroy", value: function destroy() { this.selector.removeEventListener('click', this.clickHandler); if (this.selector) (0, _methods.removeAttributeValue)(this.selector, 'gr-scroll-to', 'ready processing'); if (window.groots.verbose) { console.warn(this.pluginName + ': destroyed'); } } }]); return GrScrollTo; }(); var _default = GrScrollTo; // Auto-Instantiation // ---------------------------------------------------------------------- exports.default = _default; (function () { var all = document.querySelectorAll('[gr-scroll-to]'); window.groots.plugins.grScrollTo = {}; if (all.length) { window.groots.plugins.grScrollTo.instances = {}; var index = -1; while (all[++index]) { window.groots.plugins.grScrollTo.instances[index] = new GrScrollTo(all[index]); } } })(); },{"../../utilities/_methods.js":11,"@babel/runtime-corejs3/core-js-stable/instance/bind":21,"@babel/runtime-corejs3/core-js-stable/object/define-property":30,"@babel/runtime-corejs3/core-js-stable/parse-int":35,"@babel/runtime-corejs3/helpers/classCallCheck":39,"@babel/runtime-corejs3/helpers/createClass":40,"@babel/runtime-corejs3/helpers/interopRequireDefault":42,"core-js/modules/es.string.split":265}],11:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault"); require("core-js/modules/es.array.join"); require("core-js/modules/es.string.replace"); require("core-js/modules/es.string.split"); var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property"); _Object$defineProperty(exports, "__esModule", { value: true }); exports.easeOutCubic = exports.wrapAll = exports.sprintf = exports.offset = exports.getClosest = exports.hasAttributeValue = exports.toggleAttributeValue = exports.removeAttributeValue = exports.addAttributeValue = exports.isVisible = exports.isTouch = exports.maxWidth = exports.minWidth = exports.debounce = exports.throttle = exports.objectAssign = void 0; var _splice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/splice")); var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/index-of")); var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/parse-int")); var _setTimeout2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set-timeout")); var _now = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/date/now")); var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/assign")); // ========================================================================== // Groots Methods // ========================================================================== // Copy the values of all properties from a source object to a target object var objectAssign = _assign.default || function (srcObj) { // eslint-disable-line for (var i = 1; i < arguments.length; i++) { for (var objProperty in arguments[i]) { if (Object.prototype.hasOwnProperty.call(arguments[i], objProperty)) srcObj[objProperty] = arguments[i][objProperty]; } } return srcObj; }; // Delays invoking function until after limit in milliseconds have elapsed since the last time the function was invoked exports.objectAssign = objectAssign; var throttle = function throttle(func, limit) { var lastFunc; var lastRan; return function () { var context = this; var args = arguments; if (!lastRan) { func.apply(context, args); lastRan = (0, _now.default)(); } else { clearTimeout(lastFunc); lastFunc = (0, _setTimeout2.default)(function () { if ((0, _now.default)() - lastRan >= limit) { func.apply(context, args); lastRan = (0, _now.default)(); } }, limit - ((0, _now.default)() - lastRan)); } }; }; // Delays invoking function until event stop, can add delay exports.throttle = throttle; var debounce = function debounce(func, delay) { var inDebounce; return function () { var context = this; var args = arguments; clearTimeout(inDebounce); inDebounce = (0, _setTimeout2.default)(function () { return func.apply(context, args); }, delay); }; }; // Check if viewport is larger than breakpoint (based on breakpoints defined in SASS) exports.debounce = debounce; var minWidth = function minWidth(breakpoint) { if (typeof breakpoint === 'undefined') breakpoint = 'md'; return window.innerWidth >= (0, _parseInt2.default)(window.groots.breakpoints[breakpoint], 10); }; // Check if viewport is smaller than breakpoint (based on breakpoints defined in SASS) exports.minWidth = minWidth; var maxWidth = function maxWidth(breakpoint) { if (typeof breakpoint === 'undefined') breakpoint = 'md'; return window.innerWidth < (0, _parseInt2.default)(window.groots.breakpoints[breakpoint], 10) - 1; }; // Check if touch device exports.maxWidth = maxWidth; var isTouch = function isTouch() { return 'ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch || navigator.maxTouchPoints > 0 || window.navigator.msMaxTouchPoints > 0; }; // Check if element is visible exports.isTouch = isTouch; var isVisible = function isVisible(el) { var windowWidth = window.innerWidth, windowHeight = window.innerHeight; if (windowWidth === null || windowHeight === null) return false; var rect = el.getBoundingClientRect(); var elTop = rect.top; var elLeft = rect.left; var elWidth = rect.width; var elHeight = rect.height; return elTop < windowHeight && elTop + elHeight > 0 && elLeft < windowWidth && elLeft + elWidth > 0; }; // Add an attribute value exports.isVisible = isVisible; var addAttributeValue = function addAttributeValue(el, attribute, value, toggleClass) { if (toggleClass === undefined) toggleClass = false; if (!el || !el.hasAttribute(attribute)) return; var values = el.getAttribute(attribute).split(' '); var existingIndex = (0, _indexOf.default)(values).call(values, value); if (existingIndex < 0) values.push(value); if (toggleClass) el.classList.add('gr-' + value); el.setAttribute(attribute, values.join(' ')); }; // Remove attribute value(s) exports.addAttributeValue = addAttributeValue; var removeAttributeValue = function removeAttributeValue(el, attribute, value, removeClass) { if (removeClass === undefined) removeClass = false; if (!el || !el.hasAttribute(attribute)) return; var values = el.getAttribute(attribute).split(' '); var valuesToRemove = value.split(' '); for (var i = valuesToRemove.length - 1; i >= 0; i--) { var existingIndex = (0, _indexOf.default)(values).call(values, valuesToRemove[i]); if (existingIndex >= 0) (0, _splice.default)(values).call(values, existingIndex, 1); if (removeClass) el.classList.remove('gr-' + valuesToRemove[i]); } el.setAttribute(attribute, values.join(' ')); }; // Toggle an attribute value exports.removeAttributeValue = removeAttributeValue; var toggleAttributeValue = function toggleAttributeValue(el, attribute, value, toggleClass) { if (toggleClass === undefined) toggleClass = false; if (!el || !el.hasAttribute(attribute)) return; var values = el.getAttribute(attribute).split(' '); var existingIndex = (0, _indexOf.default)(values).call(values, value); if (existingIndex >= 0) (0, _splice.default)(values).call(values, existingIndex, 1);else values.push(value); if (toggleClass) el.classList.toggle('gr-' + value); el.setAttribute(attribute, values.join(' ')); }; // Check if element has attribute value exports.toggleAttributeValue = toggleAttributeValue; var hasAttributeValue = function hasAttributeValue(el, attribute, value) { if (!el || !el.hasAttribute(attribute)) return; var values = el.getAttribute(attribute).split(' '); var existingIndex = (0, _indexOf.default)(values).call(values, value); if (existingIndex >= 0) { return true; } else { return false; } }; // Get closest ancestor element with given selector exports.hasAttributeValue = hasAttributeValue; var getClosest = function getClosest(el, selector) { for (; el && el !== document; el = el.parentNode) { if (el.matches(selector)) return el; } return null; }; // Get coordinates of element exports.getClosest = getClosest; var offset = function offset(el) { el = el.getBoundingClientRect(); var scrollTop = window.pageYOffset; return { left: el.left + window.scrollX, top: el.top + scrollTop }; }; // Replace %s variables in a string exports.offset = offset; var sprintf = function sprintf(template, values) { return template.replace(/%s/g, function () { return values.shift(); }); }; // Wrap wrapper around nodes exports.sprintf = sprintf; var wrapAll = function wrapAll(nodes, wrapper) { // Cache the current parent and previous sibling of the first node. var parent = nodes[0].parentNode; var previousSibling = nodes[0].previousSibling; // Place each node in wrapper. // - If nodes is an array, we must increment the index we grab from // after each loop. // - If nodes is a NodeList, each node is automatically removed from // the NodeList when it is removed from its parent with appendChild. for (var i = 0; nodes.length - i; wrapper.firstChild === nodes[0] && i++) { wrapper.appendChild(nodes[i]); } // Place the wrapper just after the cached previousSibling, // or if that is null, just before the first child. var nextSibling = previousSibling ? previousSibling.nextSibling : parent.firstChild; parent.insertBefore(wrapper, nextSibling); return wrapper; }; // Easing function exports.wrapAll = wrapAll; var easeOutCubic = function easeOutCubic(time) { return --time * time * time + 1; }; exports.easeOutCubic = easeOutCubic; },{"@babel/runtime-corejs3/core-js-stable/date/now":20,"@babel/runtime-corejs3/core-js-stable/instance/index-of":25,"@babel/runtime-corejs3/core-js-stable/instance/splice":27,"@babel/runtime-corejs3/core-js-stable/object/assign":28,"@babel/runtime-corejs3/core-js-stable/object/define-property":30,"@babel/runtime-corejs3/core-js-stable/parse-int":35,"@babel/runtime-corejs3/core-js-stable/set-timeout":37,"@babel/runtime-corejs3/helpers/interopRequireDefault":42,"core-js/modules/es.array.join":260,"core-js/modules/es.string.replace":264,"core-js/modules/es.string.split":265}],12:[function(require,module,exports){ "use strict"; require("core-js/modules/es.string.replace"); var _methods = require("./_methods.js"); // ========================================================================== // Responsive CSS to JS // ========================================================================== document.addEventListener('DOMContentLoaded', function () { // Breakpoints to JS var breakpointsList = window.getComputedStyle(document.querySelector('body'), ':before').getPropertyValue('content'); breakpointsList = breakpointsList.replace(/^['"]+|\s+|\\|(;\s?})+|['"]$/g, ''); window.groots.breakpoints = JSON.parse(breakpointsList); // Set touch CSS helper if ((0, _methods.isTouch)()) document.body.classList.add('u-is-touch'); }); },{"./_methods.js":11,"core-js/modules/es.string.replace":264}],13:[function(require,module,exports){ "use strict"; (function () { 'use strict'; var windowPopup = document.querySelectorAll('[gr-popup]'); if (windowPopup.length > 0) { for (var x = 0, len = windowPopup.length; x < len; x++) { windowPopup[x].addEventListener('click', function (event) { event.preventDefault(); var w = window, d = document, de = d.documentElement, g = d.getElementsByTagName('body')[0], x = w.innerWidth || de.clientWidth || g.clientWidth, y = w.innerHeight || de.clientHeight || g.clientHeight; var winHeight = 400, winWidth = 600, winTop = y / 2 - winHeight / 2, winLeft = x / 2 - winWidth / 2, url = this.getAttribute('href'); window.open(url, '_blank', 'top=' + winTop + ',left=' + winLeft + ',toolbar=0,status=0,width=' + winWidth + ',height=' + winHeight); }); } } })(); },{}],14:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault"); require("core-js/modules/es.symbol"); require("core-js/modules/es.symbol.description"); require("core-js/modules/es.regexp.constructor"); require("core-js/modules/es.regexp.to-string"); require("core-js/modules/es.string.split"); var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property"); _Object$defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each")); var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/parse-int")); var _bind = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/bind")); var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck")); var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass")); var _methods = require("../../core/utilities/_methods.js"); // ========================================================================== // JavaScript Component // Author: Globalia // Licensed under the WTFPL license // ========================================================================== var GrHubspotSearch = /*#__PURE__*/ function () { function GrHubspotSearch(selector) { (0, _classCallCheck2.default)(this, GrHubspotSearch); this.pluginName = 'grHubspotSearch'; // Create global references this.selector = typeof selector === 'string' ? document.querySelector(selector) : selector; // Set default parameters this.option = true; // Retrieve plugin custom parameters this.param = this.selector.getAttribute('gr-hubspot-search').split(' '); this.params = this.urlParams('term'); this.lang = document.documentElement.lang; this.template = this.selector.querySelector('.hs-search'); this.prevLink = this.selector.querySelector('.hs-search__prev'); this.totalContainer = document.querySelector('.hs-search__total'); this.nextLink = this.selector.querySelector('.hs-search__next'); this.pagination = this.selector.querySelector('.hs-search__pagination'); this.container = this.selector.querySelector('.hs-search__container'); this.searchPath = this.selector.querySelector('.hs-search__pagination').getAttribute('data-search-path'); // Overwrite with custom parameters for (var index = 0; index < this.param.length; index++) { var attr = this.param[index]; this.target = attr; } // Init plugin this.init(); } // Methods // ---------------------------------------------------------------------- (0, _createClass2.default)(GrHubspotSearch, [{ key: "init", value: function init() { if (this.selector === null) { throw new Error(this.pluginName + ': fail - something wrong with your selector'); } else { // Bind all event handlers for referencability var arr = []; for (var i = 0, len = arr.length; i < len; i++) { var _context; var method = arr[i]; this[method] = (0, _bind.default)(_context = this[method]).call(_context, this); } // Flag the plugin as ready this.ready = true; (0, _methods.toggleAttributeValue)(this.selector, 'gr-hubspot-search', 'ready'); this.process(); if (window.groots.verbose) { console.warn(this.pluginName + '(' + this.selector.id + '): ready'); } } } }, { key: "process", value: function process() { if (window.groots.verbose) { console.warn(this.pluginName + ': processing start'); } (0, _methods.toggleAttributeValue)(this.selector, 'gr-hubspot-search', 'processing'); this.httpRequest(); (0, _methods.removeAttributeValue)(this.selector, 'gr-hubspot-search', 'processing'); if (window.groots.verbose) { console.warn(this.pluginName + ': processed'); } } }, { key: "urlParams", value: function urlParams(name) { // eslint-disable-next-line var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href); if (results === null) { return null; } else { return decodeURI(results[1]) || 0; } } }, { key: "getTerm", value: function getTerm() { return encodeURI(this.urlParams('term')) || ''; } }, { key: "getOffset", value: function getOffset() { return (0, _parseInt2.default)(this.urlParams('offset')) || 0; } }, { key: "getLimit", value: function getLimit() { return (0, _parseInt2.default)(this.urlParams('limit')); } }, { key: "addResult", value: function addResult(title, url, description, type, featuredImage, publishedDate) { var result = this.template.cloneNode(true); result.querySelector('.hs-search__title').innerHTML = title; result.querySelector('.hs-search__link').href = url; if (publishedDate) { result.querySelector('.hs-search__date').innerHTML = this.formatDate(publishedDate); } if (featuredImage !== undefined) { result.querySelector('.hs-search-featuredImage').style.backgroundImage = 'url(' + featuredImage + '?length=600)'; } // result.querySelector('.hs-search__content').innerHTML = description.replace(/(<([^>]+)>)/ig, ''); if (type === 'LANDING_PAGE') { result.querySelector('.hs-search__link').setAttribute('target', '_blank'); } this.container.appendChild(result); } }, { key: "fillResults", value: function fillResults(results) { var _context2; var that = this; (0, _forEach.default)(_context2 = results.results).call(_context2, function (result) { that.addResult(result.title, result.url, result.description, result.type, result.featuredImageUrl, result.publishedDate); }); } }, { key: "emptyResults", value: function emptyResults(searchedTerm) { if (this.lang === 'en') { this.container.innerHTML = '

    Sorry. There are no results for ' + searchedTerm + '

    ' + '

    Try rewording your query, or browse through our site.

    '; } else if (this.lang === 'fr') { this.container.innerHTML = '

    Pardon. Il n\'y a pas de résultats pour ' + searchedTerm + '

    ' + '

    Essayez de reformuler votre requête ou parcourez notre site.

    '; } } }, { key: "setSearchBarDefault", value: function setSearchBarDefault(searchedTerm) { var searchBars = document.querySelectorAll('.form-search__input'); (0, _forEach.default)(Array.prototype).call(searchBars, function (el) { el.value = decodeURIComponent(searchedTerm); }); } }, { key: "paginate", value: function paginate(results) { var updatedLimit = this.getLimit() || results.limit; this.totalContainer.innerHTML = results.total; function hasPreviousPage() { return results.page > 0; } function hasNextPage() { return results.offset < results.total - updatedLimit; } if (hasPreviousPage()) { var urlPrev = '/' + this.searchPath + '?term=' + this.getTerm() + '&pathPrefix=%2F' + this.lang + '&offset=' + (results.page * updatedLimit - (0, _parseInt2.default)(updatedLimit)); this.prevLink.href = urlPrev; } else { this.prevLink.classList.add('pagination__link--disabled'); } if (hasNextPage()) { var urlNext = '/' + this.searchPath + '?term=' + this.getTerm() + '&pathPrefix=%2F' + this.lang + '&offset=' + (results.page * updatedLimit + (0, _parseInt2.default)(updatedLimit)); this.nextLink.href = urlNext; } else { this.nextLink.classList.add('pagination__link--disabled'); } } }, { key: "httpRequest", value: function httpRequest() { var SEARCH_URL = '/_hcms/search/', requestUrl = SEARCH_URL + '?term=' + this.getTerm() + '&offset=' + this.getOffset() + '&analytics=false&limit=8&minScore=0.01', request = new XMLHttpRequest(), that = this; request.open('GET', requestUrl, true); request.onload = function () { if (request.status >= 200 && request.status < 400) { var data = JSON.parse(request.responseText); if (data.total > 0) { that.fillResults(data); that.paginate(data); that.pagination.classList.add('is-active'); } else { that.emptyResults(data.searchTerm); } } else { console.error('Server reached, error retrieving results.'); } document.querySelector('.hs-search-results').classList.remove('is-loading'); }; request.onerror = function () { console.error('Could not reach the server.'); }; request.send(); } }, { key: "formatDate", value: function formatDate(date) { var monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; date = new Date(date); var day = date.getDate(); var monthIndex = date.getMonth(); var year = date.getFullYear(); return monthNames[monthIndex] + ' ' + day + ', ' + year; } // Destroy - remove listeners to prevent from memory leak }, { key: "destroy", value: function destroy() { (0, _methods.removeAttributeValue)(this.selector, 'gr-hubspot-search', 'ready processing'); if (window.groots.verbose) { console.warn(this.pluginName + '(' + this.selector.id + '): destroyed'); } } }]); return GrHubspotSearch; }(); var _default = GrHubspotSearch; // Auto-Instantiation // ---------------------------------------------------------------------- exports.default = _default; (function () { var all = document.querySelectorAll('[gr-hubspot-search]'); window.groots.plugins.grComponent = {}; if (all.length) { window.groots.plugins.grComponent.instances = {}; var index = -1; while (all[++index]) { window.groots.plugins.grComponent.instances[index] = new GrHubspotSearch(all[index]); } } })(); },{"../../core/utilities/_methods.js":11,"@babel/runtime-corejs3/core-js-stable/instance/bind":21,"@babel/runtime-corejs3/core-js-stable/instance/for-each":23,"@babel/runtime-corejs3/core-js-stable/object/define-property":30,"@babel/runtime-corejs3/core-js-stable/parse-int":35,"@babel/runtime-corejs3/helpers/classCallCheck":39,"@babel/runtime-corejs3/helpers/createClass":40,"@babel/runtime-corejs3/helpers/interopRequireDefault":42,"core-js/modules/es.regexp.constructor":262,"core-js/modules/es.regexp.to-string":263,"core-js/modules/es.string.split":265,"core-js/modules/es.symbol":267,"core-js/modules/es.symbol.description":266}],15:[function(require,module,exports){ "use strict"; var _methods = require("../../core/utilities/_methods.js"); (function () { var links = document.querySelectorAll('.nav__link'), nav_trigger = document.querySelector('[gr-nav-trigger]'), index, max; if (links) { for (index = 0, max = links.length; index < max; index++) { links[index].addEventListener('click', function (e) { toggleActive(this); }); } } function toggleActive(el) { if (!el.classList.contains('nav__link--subnav') && (0, _methods.maxWidth)('md')) { for (index = 0, max = links.length; index < max; index++) { links[index].classList.remove('is-active'); } nav_trigger.click(); el.classList.add('is-active'); } else if (el.classList.contains('nav__link--subnav')) { el.classList.toggle('is-active'); } } })(); },{"../../core/utilities/_methods.js":11}],16:[function(require,module,exports){ "use strict"; (function (global) { 'use strict'; var Flickity = require('flickity'); var sliderBanner = document.querySelector('[slider-banner-init]'), sliderBannerNext = document.querySelector('[slider-next]'), sliderBannerPrev = document.querySelector('[slider-prev]'), sliderPager = document.querySelector('[slider-pager]'), sliderTitleEntry = document.querySelector('[data-title-entry]'), sliderSubtitleEntry = document.querySelector('[data-subtitle-entry]'); if (sliderBanner) { var flky = new Flickity(sliderBanner, { accessibility: true, adaptiveHeight: true, autoPlay: 5000, pageDots: false, wrapAround: true, prevNextButtons: false }); var slideCount = flky.slides.length, dot = document.createElement('div'), allDots; // Add the class to the dot dot.classList.add('slider-banner__dot'); // Append a dot for every slide for (var i = 0; i < slideCount; i++) { sliderPager.appendChild(dot.cloneNode(true)); } // Select all dot generated allDots = document.querySelectorAll('.slider-banner__dot'); // Show the first slide info in the nav if (sliderTitleEntry && sliderSubtitleEntry) { sliderTitleEntry.innerHTML = flky.selectedElement.getAttribute('data-title'); sliderSubtitleEntry.innerHTML = flky.selectedElement.getAttribute('data-subtitle'); } // Add active to the first slide and when we click on the dots, change the select. for (var x = 0; x < allDots.length; x++) { allDots[0].classList.add('is-selected'); allDots[x].setAttribute('slide-index', x); allDots[x].addEventListener('click', function () { flky.select(this.getAttribute('slide-index')); flky.pausePlayer(); }); } // Remove the selected class from others and add it to the current slide index flky.on('select', function (index) { for (var y = 0; y < allDots.length; y++) { allDots[y].classList.remove('is-selected'); } allDots[flky.selectedIndex].classList.add('is-selected'); if (sliderTitleEntry && sliderSubtitleEntry) { sliderTitleEntry.innerHTML = flky.selectedElement.getAttribute('data-title'); sliderSubtitleEntry.innerHTML = flky.selectedElement.getAttribute('data-subtitle'); } }); } // Click next event if (sliderBannerNext) { sliderBannerNext.addEventListener('click', function (e) { e.preventDefault(); flky.next(); flky.pausePlayer(); }); } // Click prev event if (sliderBannerPrev) { sliderBannerPrev.addEventListener('click', function (e) { e.preventDefault(); flky.previous(); flky.pausePlayer(); }); } })(window.groots); },{"flickity":276}],17:[function(require,module,exports){ "use strict"; var _methods = require("../../core/utilities/_methods.js"); (function (global) { 'use strict'; var Flickity = require('flickity'); var slider = document.querySelectorAll('[slider-init]'), sliderNext = document.querySelector('[slider-next]'), sliderPrev = document.querySelector('[slider-prev]'); if (slider) { for (var i = 0, max = slider.length; i < max; i++) { var dots = false; if (slider[i].getAttribute('slider-init') === 'dots-true') { dots = true; } var flky = new Flickity(slider[i], { accessibility: true, adaptiveHeight: true, // autoPlay: 5000, pageDots: dots, wrapAround: true, prevNextButtons: true }); } } if (sliderNext) { sliderNext.addEventListener('click', function (e) { e.preventDefault(); flky.next(); }); } if (sliderPrev) { sliderPrev.addEventListener('click', function (e) { e.preventDefault(); flky.previous(); }); } })(window.groots); },{"../../core/utilities/_methods.js":11,"flickity":276}],18:[function(require,module,exports){ "use strict"; (function () {})(); },{}],19:[function(require,module,exports){ "use strict"; var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault"); var _setInterval2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set-interval")); require("../../core/_core.js"); require("../../core/utilities/_responsive.js"); require("../../core/components/grDropdown/grDropdown"); require("../../core/components/grExpander/grExpander"); require("../../core/components/grFormLabel/grFormLabel"); require("../../core/components/grFormUpload/grFormUpload"); require("../../core/components/grFormNormalize/grFormNormalize"); require("../../core/components/grFormValidation/grFormValidation"); require("../../core/components/grAccTabs/grAccTabs"); require("../../core/components/grNavigation/grNavigation"); require("../../core/components/grScrollTo/grScrollTo"); require("./_nav-links.js"); require("./_tabs.js"); require("./_slider-banner"); require("./_sliders.js"); require("./_gr-popup.js"); require("./_hubspot-search.js"); // ========================================================================== // groots Starter Kit // Author: Globalia // Licensed under the WTFPL license // ========================================================================== // Import Groots core JS // Display debug informations window.groots.verbose = false; // Import responsive helpers (function () { 'use strict'; var select = document.querySelector('[gr-trigger-link]'); if (!select) { return; } select.addEventListener('change', triggerTab); function triggerTab() { var url = select[this.selectedIndex].getAttribute('value'); if (url) { document.location.href = url; } } })(); (function () { 'use strict'; var btn_back_top = document.querySelector('[gr-backtop]'); var userHasScrolled = false; if (!btn_back_top) { return false; } window.addEventListener('scroll', function () { userHasScrolled = true; }); var checkFrame = (0, _setInterval2.default)(function () { if (userHasScrolled) { userHasScrolled = false; console.log('Someone scrolled me!'); btn_back_top.classList.add('is-scrolling'); } else { console.log('stop scroll'); btn_back_top.classList.remove('is-scrolling'); } }, 250); })(); },{"../../core/_core.js":1,"../../core/components/grAccTabs/grAccTabs":2,"../../core/components/grDropdown/grDropdown":3,"../../core/components/grExpander/grExpander":4,"../../core/components/grFormLabel/grFormLabel":5,"../../core/components/grFormNormalize/grFormNormalize":6,"../../core/components/grFormUpload/grFormUpload":7,"../../core/components/grFormValidation/grFormValidation":8,"../../core/components/grNavigation/grNavigation":9,"../../core/components/grScrollTo/grScrollTo":10,"../../core/utilities/_responsive.js":12,"./_gr-popup.js":13,"./_hubspot-search.js":14,"./_nav-links.js":15,"./_slider-banner":16,"./_sliders.js":17,"./_tabs.js":18,"@babel/runtime-corejs3/core-js-stable/set-interval":36,"@babel/runtime-corejs3/helpers/interopRequireDefault":42}],20:[function(require,module,exports){ module.exports = require("core-js-pure/stable/date/now"); },{"core-js-pure/stable/date/now":171}],21:[function(require,module,exports){ module.exports = require("core-js-pure/stable/instance/bind"); },{"core-js-pure/stable/instance/bind":172}],22:[function(require,module,exports){ module.exports = require("core-js-pure/stable/instance/filter"); },{"core-js-pure/stable/instance/filter":173}],23:[function(require,module,exports){ module.exports = require("core-js-pure/stable/instance/for-each"); },{"core-js-pure/stable/instance/for-each":174}],24:[function(require,module,exports){ module.exports = require("core-js-pure/stable/instance/includes"); },{"core-js-pure/stable/instance/includes":175}],25:[function(require,module,exports){ module.exports = require("core-js-pure/stable/instance/index-of"); },{"core-js-pure/stable/instance/index-of":176}],26:[function(require,module,exports){ module.exports = require("core-js-pure/stable/instance/map"); },{"core-js-pure/stable/instance/map":177}],27:[function(require,module,exports){ module.exports = require("core-js-pure/stable/instance/splice"); },{"core-js-pure/stable/instance/splice":178}],28:[function(require,module,exports){ module.exports = require("core-js-pure/stable/object/assign"); },{"core-js-pure/stable/object/assign":179}],29:[function(require,module,exports){ module.exports = require("core-js-pure/stable/object/define-properties"); },{"core-js-pure/stable/object/define-properties":180}],30:[function(require,module,exports){ module.exports = require("core-js-pure/stable/object/define-property"); },{"core-js-pure/stable/object/define-property":181}],31:[function(require,module,exports){ module.exports = require("core-js-pure/stable/object/get-own-property-descriptor"); },{"core-js-pure/stable/object/get-own-property-descriptor":182}],32:[function(require,module,exports){ module.exports = require("core-js-pure/stable/object/get-own-property-descriptors"); },{"core-js-pure/stable/object/get-own-property-descriptors":183}],33:[function(require,module,exports){ module.exports = require("core-js-pure/stable/object/get-own-property-symbols"); },{"core-js-pure/stable/object/get-own-property-symbols":184}],34:[function(require,module,exports){ module.exports = require("core-js-pure/stable/object/keys"); },{"core-js-pure/stable/object/keys":185}],35:[function(require,module,exports){ module.exports = require("core-js-pure/stable/parse-int"); },{"core-js-pure/stable/parse-int":186}],36:[function(require,module,exports){ module.exports = require("core-js-pure/stable/set-interval"); },{"core-js-pure/stable/set-interval":187}],37:[function(require,module,exports){ module.exports = require("core-js-pure/stable/set-timeout"); },{"core-js-pure/stable/set-timeout":188}],38:[function(require,module,exports){ module.exports = require("core-js-pure/features/object/define-property"); },{"core-js-pure/features/object/define-property":66}],39:[function(require,module,exports){ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } module.exports = _classCallCheck; },{}],40:[function(require,module,exports){ var _Object$defineProperty = require("../core-js/object/define-property"); function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; _Object$defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } module.exports = _createClass; },{"../core-js/object/define-property":38}],41:[function(require,module,exports){ var _Object$defineProperty = require("../core-js/object/define-property"); function _defineProperty(obj, key, value) { if (key in obj) { _Object$defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } module.exports = _defineProperty; },{"../core-js/object/define-property":38}],42:[function(require,module,exports){ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } module.exports = _interopRequireDefault; },{}],43:[function(require,module,exports){ require('../../../modules/es.array.filter'); var entryVirtual = require('../../../internals/entry-virtual'); module.exports = entryVirtual('Array').filter; },{"../../../internals/entry-virtual":89,"../../../modules/es.array.filter":150}],44:[function(require,module,exports){ require('../../../modules/es.array.for-each'); var entryVirtual = require('../../../internals/entry-virtual'); module.exports = entryVirtual('Array').forEach; },{"../../../internals/entry-virtual":89,"../../../modules/es.array.for-each":151}],45:[function(require,module,exports){ require('../../../modules/es.array.includes'); var entryVirtual = require('../../../internals/entry-virtual'); module.exports = entryVirtual('Array').includes; },{"../../../internals/entry-virtual":89,"../../../modules/es.array.includes":152}],46:[function(require,module,exports){ require('../../../modules/es.array.index-of'); var entryVirtual = require('../../../internals/entry-virtual'); module.exports = entryVirtual('Array').indexOf; },{"../../../internals/entry-virtual":89,"../../../modules/es.array.index-of":153}],47:[function(require,module,exports){ require('../../../modules/es.array.map'); var entryVirtual = require('../../../internals/entry-virtual'); module.exports = entryVirtual('Array').map; },{"../../../internals/entry-virtual":89,"../../../modules/es.array.map":155}],48:[function(require,module,exports){ require('../../../modules/es.array.splice'); var entryVirtual = require('../../../internals/entry-virtual'); module.exports = entryVirtual('Array').splice; },{"../../../internals/entry-virtual":89,"../../../modules/es.array.splice":156}],49:[function(require,module,exports){ require('../../modules/es.date.now'); var path = require('../../internals/path'); module.exports = path.Date.now; },{"../../internals/path":130,"../../modules/es.date.now":157}],50:[function(require,module,exports){ require('../../../modules/es.function.bind'); var entryVirtual = require('../../../internals/entry-virtual'); module.exports = entryVirtual('Function').bind; },{"../../../internals/entry-virtual":89,"../../../modules/es.function.bind":158}],51:[function(require,module,exports){ var bind = require('../function/virtual/bind'); var FunctionPrototype = Function.prototype; module.exports = function (it) { var own = it.bind; return it === FunctionPrototype || (it instanceof Function && own === FunctionPrototype.bind) ? bind : own; }; },{"../function/virtual/bind":50}],52:[function(require,module,exports){ var filter = require('../array/virtual/filter'); var ArrayPrototype = Array.prototype; module.exports = function (it) { var own = it.filter; return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.filter) ? filter : own; }; },{"../array/virtual/filter":43}],53:[function(require,module,exports){ var arrayIncludes = require('../array/virtual/includes'); var stringIncludes = require('../string/virtual/includes'); var ArrayPrototype = Array.prototype; var StringPrototype = String.prototype; module.exports = function (it) { var own = it.includes; if (it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.includes)) return arrayIncludes; if (typeof it === 'string' || it === StringPrototype || (it instanceof String && own === StringPrototype.includes)) { return stringIncludes; } return own; }; },{"../array/virtual/includes":45,"../string/virtual/includes":65}],54:[function(require,module,exports){ var indexOf = require('../array/virtual/index-of'); var ArrayPrototype = Array.prototype; module.exports = function (it) { var own = it.indexOf; return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.indexOf) ? indexOf : own; }; },{"../array/virtual/index-of":46}],55:[function(require,module,exports){ var map = require('../array/virtual/map'); var ArrayPrototype = Array.prototype; module.exports = function (it) { var own = it.map; return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.map) ? map : own; }; },{"../array/virtual/map":47}],56:[function(require,module,exports){ var splice = require('../array/virtual/splice'); var ArrayPrototype = Array.prototype; module.exports = function (it) { var own = it.splice; return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.splice) ? splice : own; }; },{"../array/virtual/splice":48}],57:[function(require,module,exports){ require('../../modules/es.object.assign'); var path = require('../../internals/path'); module.exports = path.Object.assign; },{"../../internals/path":130,"../../modules/es.object.assign":159}],58:[function(require,module,exports){ require('../../modules/es.object.define-properties'); var path = require('../../internals/path'); var Object = path.Object; var defineProperties = module.exports = function defineProperties(T, D) { return Object.defineProperties(T, D); }; if (Object.defineProperties.sham) defineProperties.sham = true; },{"../../internals/path":130,"../../modules/es.object.define-properties":160}],59:[function(require,module,exports){ require('../../modules/es.object.define-property'); var path = require('../../internals/path'); var Object = path.Object; var defineProperty = module.exports = function defineProperty(it, key, desc) { return Object.defineProperty(it, key, desc); }; if (Object.defineProperty.sham) defineProperty.sham = true; },{"../../internals/path":130,"../../modules/es.object.define-property":161}],60:[function(require,module,exports){ require('../../modules/es.object.get-own-property-descriptor'); var path = require('../../internals/path'); var Object = path.Object; var getOwnPropertyDescriptor = module.exports = function getOwnPropertyDescriptor(it, key) { return Object.getOwnPropertyDescriptor(it, key); }; if (Object.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor.sham = true; },{"../../internals/path":130,"../../modules/es.object.get-own-property-descriptor":162}],61:[function(require,module,exports){ require('../../modules/es.object.get-own-property-descriptors'); var path = require('../../internals/path'); module.exports = path.Object.getOwnPropertyDescriptors; },{"../../internals/path":130,"../../modules/es.object.get-own-property-descriptors":163}],62:[function(require,module,exports){ require('../../modules/es.symbol'); var path = require('../../internals/path'); module.exports = path.Object.getOwnPropertySymbols; },{"../../internals/path":130,"../../modules/es.symbol":167}],63:[function(require,module,exports){ require('../../modules/es.object.keys'); var path = require('../../internals/path'); module.exports = path.Object.keys; },{"../../internals/path":130,"../../modules/es.object.keys":164}],64:[function(require,module,exports){ require('../modules/es.parse-int'); var path = require('../internals/path'); module.exports = path.parseInt; },{"../internals/path":130,"../modules/es.parse-int":165}],65:[function(require,module,exports){ require('../../../modules/es.string.includes'); var entryVirtual = require('../../../internals/entry-virtual'); module.exports = entryVirtual('String').includes; },{"../../../internals/entry-virtual":89,"../../../modules/es.string.includes":166}],66:[function(require,module,exports){ module.exports = require('../../es/object/define-property'); },{"../../es/object/define-property":59}],67:[function(require,module,exports){ module.exports = function (it) { if (typeof it != 'function') { throw TypeError(String(it) + ' is not a function'); } return it; }; },{}],68:[function(require,module,exports){ var isObject = require('../internals/is-object'); module.exports = function (it) { if (!isObject(it) && it !== null) { throw TypeError("Can't set " + String(it) + ' as a prototype'); } return it; }; },{"../internals/is-object":106}],69:[function(require,module,exports){ module.exports = function () { /* empty */ }; },{}],70:[function(require,module,exports){ var isObject = require('../internals/is-object'); module.exports = function (it) { if (!isObject(it)) { throw TypeError(String(it) + ' is not an object'); } return it; }; },{"../internals/is-object":106}],71:[function(require,module,exports){ 'use strict'; var $forEach = require('../internals/array-iteration').forEach; var sloppyArrayMethod = require('../internals/sloppy-array-method'); // `Array.prototype.forEach` method implementation // https://tc39.github.io/ecma262/#sec-array.prototype.foreach module.exports = sloppyArrayMethod('forEach') ? function forEach(callbackfn /* , thisArg */) { return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } : [].forEach; },{"../internals/array-iteration":73,"../internals/sloppy-array-method":137}],72:[function(require,module,exports){ var toIndexedObject = require('../internals/to-indexed-object'); var toLength = require('../internals/to-length'); var toAbsoluteIndex = require('../internals/to-absolute-index'); // `Array.prototype.{ indexOf, includes }` methods implementation var createMethod = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIndexedObject($this); var length = toLength(O.length); var index = toAbsoluteIndex(fromIndex, length); var value; // Array#includes uses SameValueZero equality algorithm // eslint-disable-next-line no-self-compare if (IS_INCLUDES && el != el) while (length > index) { value = O[index++]; // eslint-disable-next-line no-self-compare if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not } else for (;length > index; index++) { if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0; } return !IS_INCLUDES && -1; }; }; module.exports = { // `Array.prototype.includes` method // https://tc39.github.io/ecma262/#sec-array.prototype.includes includes: createMethod(true), // `Array.prototype.indexOf` method // https://tc39.github.io/ecma262/#sec-array.prototype.indexof indexOf: createMethod(false) }; },{"../internals/to-absolute-index":139,"../internals/to-indexed-object":140,"../internals/to-length":142}],73:[function(require,module,exports){ var bind = require('../internals/bind-context'); var IndexedObject = require('../internals/indexed-object'); var toObject = require('../internals/to-object'); var toLength = require('../internals/to-length'); var arraySpeciesCreate = require('../internals/array-species-create'); var push = [].push; // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex }` methods implementation var createMethod = function (TYPE) { var IS_MAP = TYPE == 1; var IS_FILTER = TYPE == 2; var IS_SOME = TYPE == 3; var IS_EVERY = TYPE == 4; var IS_FIND_INDEX = TYPE == 6; var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; return function ($this, callbackfn, that, specificCreate) { var O = toObject($this); var self = IndexedObject(O); var boundFunction = bind(callbackfn, that, 3); var length = toLength(self.length); var index = 0; var create = specificCreate || arraySpeciesCreate; var target = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; var value, result; for (;length > index; index++) if (NO_HOLES || index in self) { value = self[index]; result = boundFunction(value, index, O); if (TYPE) { if (IS_MAP) target[index] = result; // map else if (result) switch (TYPE) { case 3: return true; // some case 5: return value; // find case 6: return index; // findIndex case 2: push.call(target, value); // filter } else if (IS_EVERY) return false; // every } } return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target; }; }; module.exports = { // `Array.prototype.forEach` method // https://tc39.github.io/ecma262/#sec-array.prototype.foreach forEach: createMethod(0), // `Array.prototype.map` method // https://tc39.github.io/ecma262/#sec-array.prototype.map map: createMethod(1), // `Array.prototype.filter` method // https://tc39.github.io/ecma262/#sec-array.prototype.filter filter: createMethod(2), // `Array.prototype.some` method // https://tc39.github.io/ecma262/#sec-array.prototype.some some: createMethod(3), // `Array.prototype.every` method // https://tc39.github.io/ecma262/#sec-array.prototype.every every: createMethod(4), // `Array.prototype.find` method // https://tc39.github.io/ecma262/#sec-array.prototype.find find: createMethod(5), // `Array.prototype.findIndex` method // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex findIndex: createMethod(6) }; },{"../internals/array-species-create":75,"../internals/bind-context":76,"../internals/indexed-object":102,"../internals/to-length":142,"../internals/to-object":143}],74:[function(require,module,exports){ var fails = require('../internals/fails'); var wellKnownSymbol = require('../internals/well-known-symbol'); var SPECIES = wellKnownSymbol('species'); module.exports = function (METHOD_NAME) { return !fails(function () { var array = []; var constructor = array.constructor = {}; constructor[SPECIES] = function () { return { foo: 1 }; }; return array[METHOD_NAME](Boolean).foo !== 1; }); }; },{"../internals/fails":92,"../internals/well-known-symbol":147}],75:[function(require,module,exports){ var isObject = require('../internals/is-object'); var isArray = require('../internals/is-array'); var wellKnownSymbol = require('../internals/well-known-symbol'); var SPECIES = wellKnownSymbol('species'); // `ArraySpeciesCreate` abstract operation // https://tc39.github.io/ecma262/#sec-arrayspeciescreate module.exports = function (originalArray, length) { var C; if (isArray(originalArray)) { C = originalArray.constructor; // cross-realm fallback if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; else if (isObject(C)) { C = C[SPECIES]; if (C === null) C = undefined; } } return new (C === undefined ? Array : C)(length === 0 ? 0 : length); }; },{"../internals/is-array":104,"../internals/is-object":106,"../internals/well-known-symbol":147}],76:[function(require,module,exports){ var aFunction = require('../internals/a-function'); // optional / simple context binding module.exports = function (fn, that, length) { aFunction(fn); if (that === undefined) return fn; switch (length) { case 0: return function () { return fn.call(that); }; case 1: return function (a) { return fn.call(that, a); }; case 2: return function (a, b) { return fn.call(that, a, b); }; case 3: return function (a, b, c) { return fn.call(that, a, b, c); }; } return function (/* ...args */) { return fn.apply(that, arguments); }; }; },{"../internals/a-function":67}],77:[function(require,module,exports){ var toString = {}.toString; module.exports = function (it) { return toString.call(it).slice(8, -1); }; },{}],78:[function(require,module,exports){ var classofRaw = require('../internals/classof-raw'); var wellKnownSymbol = require('../internals/well-known-symbol'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); // ES3 wrong here var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments'; // fallback for IE11 Script Access Denied error var tryGet = function (it, key) { try { return it[key]; } catch (error) { /* empty */ } }; // getting tag from ES6+ `Object.prototype.toString` module.exports = function (it) { var O, tag, result; return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case : typeof (tag = tryGet(O = Object(it), TO_STRING_TAG)) == 'string' ? tag // builtinTag case : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback : (result = classofRaw(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : result; }; },{"../internals/classof-raw":77,"../internals/well-known-symbol":147}],79:[function(require,module,exports){ var wellKnownSymbol = require('../internals/well-known-symbol'); var MATCH = wellKnownSymbol('match'); module.exports = function (METHOD_NAME) { var regexp = /./; try { '/./'[METHOD_NAME](regexp); } catch (e) { try { regexp[MATCH] = false; return '/./'[METHOD_NAME](regexp); } catch (f) { /* empty */ } } return false; }; },{"../internals/well-known-symbol":147}],80:[function(require,module,exports){ var fails = require('../internals/fails'); module.exports = !fails(function () { function F() { /* empty */ } F.prototype.constructor = null; return Object.getPrototypeOf(new F()) !== F.prototype; }); },{"../internals/fails":92}],81:[function(require,module,exports){ 'use strict'; var IteratorPrototype = require('../internals/iterators-core').IteratorPrototype; var create = require('../internals/object-create'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); var setToStringTag = require('../internals/set-to-string-tag'); var Iterators = require('../internals/iterators'); var returnThis = function () { return this; }; module.exports = function (IteratorConstructor, NAME, next) { var TO_STRING_TAG = NAME + ' Iterator'; IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(1, next) }); setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true); Iterators[TO_STRING_TAG] = returnThis; return IteratorConstructor; }; },{"../internals/create-property-descriptor":82,"../internals/iterators":110,"../internals/iterators-core":109,"../internals/object-create":115,"../internals/set-to-string-tag":134}],82:[function(require,module,exports){ module.exports = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; },{}],83:[function(require,module,exports){ 'use strict'; var toPrimitive = require('../internals/to-primitive'); var definePropertyModule = require('../internals/object-define-property'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); module.exports = function (object, key, value) { var propertyKey = toPrimitive(key); if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor(0, value)); else object[propertyKey] = value; }; },{"../internals/create-property-descriptor":82,"../internals/object-define-property":117,"../internals/to-primitive":144}],84:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var createIteratorConstructor = require('../internals/create-iterator-constructor'); var getPrototypeOf = require('../internals/object-get-prototype-of'); var setPrototypeOf = require('../internals/object-set-prototype-of'); var setToStringTag = require('../internals/set-to-string-tag'); var hide = require('../internals/hide'); var redefine = require('../internals/redefine'); var wellKnownSymbol = require('../internals/well-known-symbol'); var IS_PURE = require('../internals/is-pure'); var Iterators = require('../internals/iterators'); var IteratorsCore = require('../internals/iterators-core'); var IteratorPrototype = IteratorsCore.IteratorPrototype; var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS; var ITERATOR = wellKnownSymbol('iterator'); var KEYS = 'keys'; var VALUES = 'values'; var ENTRIES = 'entries'; var returnThis = function () { return this; }; module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) { createIteratorConstructor(IteratorConstructor, NAME, next); var getIterationMethod = function (KIND) { if (KIND === DEFAULT && defaultIterator) return defaultIterator; if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND]; switch (KIND) { case KEYS: return function keys() { return new IteratorConstructor(this, KIND); }; case VALUES: return function values() { return new IteratorConstructor(this, KIND); }; case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); }; } return function () { return new IteratorConstructor(this); }; }; var TO_STRING_TAG = NAME + ' Iterator'; var INCORRECT_VALUES_NAME = false; var IterablePrototype = Iterable.prototype; var nativeIterator = IterablePrototype[ITERATOR] || IterablePrototype['@@iterator'] || DEFAULT && IterablePrototype[DEFAULT]; var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT); var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator; var CurrentIteratorPrototype, methods, KEY; // fix native if (anyNativeIterator) { CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable())); if (IteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) { if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) { if (setPrototypeOf) { setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype); } else if (typeof CurrentIteratorPrototype[ITERATOR] != 'function') { hide(CurrentIteratorPrototype, ITERATOR, returnThis); } } // Set @@toStringTag to native iterators setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true); if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis; } } // fix Array#{values, @@iterator}.name in V8 / FF if (DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) { INCORRECT_VALUES_NAME = true; defaultIterator = function values() { return nativeIterator.call(this); }; } // define iterator if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) { hide(IterablePrototype, ITERATOR, defaultIterator); } Iterators[NAME] = defaultIterator; // export additional methods if (DEFAULT) { methods = { values: getIterationMethod(VALUES), keys: IS_SET ? defaultIterator : getIterationMethod(KEYS), entries: getIterationMethod(ENTRIES) }; if (FORCED) for (KEY in methods) { if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) { redefine(IterablePrototype, KEY, methods[KEY]); } } else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods); } return methods; }; },{"../internals/create-iterator-constructor":81,"../internals/export":91,"../internals/hide":99,"../internals/is-pure":107,"../internals/iterators":110,"../internals/iterators-core":109,"../internals/object-get-prototype-of":122,"../internals/object-set-prototype-of":126,"../internals/redefine":131,"../internals/set-to-string-tag":134,"../internals/well-known-symbol":147}],85:[function(require,module,exports){ var path = require('../internals/path'); var has = require('../internals/has'); var wrappedWellKnownSymbolModule = require('../internals/wrapped-well-known-symbol'); var defineProperty = require('../internals/object-define-property').f; module.exports = function (NAME) { var Symbol = path.Symbol || (path.Symbol = {}); if (!has(Symbol, NAME)) defineProperty(Symbol, NAME, { value: wrappedWellKnownSymbolModule.f(NAME) }); }; },{"../internals/has":97,"../internals/object-define-property":117,"../internals/path":130,"../internals/wrapped-well-known-symbol":149}],86:[function(require,module,exports){ var fails = require('../internals/fails'); // Thank's IE8 for his funny defineProperty module.exports = !fails(function () { return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7; }); },{"../internals/fails":92}],87:[function(require,module,exports){ var global = require('../internals/global'); var isObject = require('../internals/is-object'); var document = global.document; // typeof document.createElement is 'object' in old IE var EXISTS = isObject(document) && isObject(document.createElement); module.exports = function (it) { return EXISTS ? document.createElement(it) : {}; }; },{"../internals/global":96,"../internals/is-object":106}],88:[function(require,module,exports){ // iterable DOM collections // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods module.exports = { CSSRuleList: 0, CSSStyleDeclaration: 0, CSSValueList: 0, ClientRectList: 0, DOMRectList: 0, DOMStringList: 0, DOMTokenList: 1, DataTransferItemList: 0, FileList: 0, HTMLAllCollection: 0, HTMLCollection: 0, HTMLFormElement: 0, HTMLSelectElement: 0, MediaList: 0, MimeTypeArray: 0, NamedNodeMap: 0, NodeList: 1, PaintRequestList: 0, Plugin: 0, PluginArray: 0, SVGLengthList: 0, SVGNumberList: 0, SVGPathSegList: 0, SVGPointList: 0, SVGStringList: 0, SVGTransformList: 0, SourceBufferList: 0, StyleSheetList: 0, TextTrackCueList: 0, TextTrackList: 0, TouchList: 0 }; },{}],89:[function(require,module,exports){ var path = require('../internals/path'); module.exports = function (CONSTRUCTOR) { return path[CONSTRUCTOR + 'Prototype']; }; },{"../internals/path":130}],90:[function(require,module,exports){ // IE8- don't enum bug keys module.exports = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; },{}],91:[function(require,module,exports){ 'use strict'; var global = require('../internals/global'); var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; var isForced = require('../internals/is-forced'); var path = require('../internals/path'); var bind = require('../internals/bind-context'); var hide = require('../internals/hide'); var has = require('../internals/has'); var wrapConstructor = function (NativeConstructor) { var Wrapper = function (a, b, c) { if (this instanceof NativeConstructor) { switch (arguments.length) { case 0: return new NativeConstructor(); case 1: return new NativeConstructor(a); case 2: return new NativeConstructor(a, b); } return new NativeConstructor(a, b, c); } return NativeConstructor.apply(this, arguments); }; Wrapper.prototype = NativeConstructor.prototype; return Wrapper; }; /* options.target - name of the target object options.global - target is the global object options.stat - export as static methods of target options.proto - export as prototype methods of target options.real - real prototype method for the `pure` version options.forced - export even if the native feature is available options.bind - bind methods to the target, required for the `pure` version options.wrap - wrap constructors to preventing global pollution, required for the `pure` version options.unsafe - use the simple assignment of property instead of delete + defineProperty options.sham - add a flag to not completely full polyfills options.enumerable - export as enumerable property options.noTargetGet - prevent calling a getter on target */ module.exports = function (options, source) { var TARGET = options.target; var GLOBAL = options.global; var STATIC = options.stat; var PROTO = options.proto; var nativeSource = GLOBAL ? global : STATIC ? global[TARGET] : (global[TARGET] || {}).prototype; var target = GLOBAL ? path : path[TARGET] || (path[TARGET] = {}); var targetPrototype = target.prototype; var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE; var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor; for (key in source) { FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contains in native USE_NATIVE = !FORCED && nativeSource && has(nativeSource, key); targetProperty = target[key]; if (USE_NATIVE) if (options.noTargetGet) { descriptor = getOwnPropertyDescriptor(nativeSource, key); nativeProperty = descriptor && descriptor.value; } else nativeProperty = nativeSource[key]; // export native or implementation sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key]; if (USE_NATIVE && typeof targetProperty === typeof sourceProperty) continue; // bind timers to global for call from export context if (options.bind && USE_NATIVE) resultProperty = bind(sourceProperty, global); // wrap global constructors for prevent changs in this version else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty); // make static versions for prototype methods else if (PROTO && typeof sourceProperty == 'function') resultProperty = bind(Function.call, sourceProperty); // default case else resultProperty = sourceProperty; // add a flag to not completely full polyfills if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) { hide(resultProperty, 'sham', true); } target[key] = resultProperty; if (PROTO) { VIRTUAL_PROTOTYPE = TARGET + 'Prototype'; if (!has(path, VIRTUAL_PROTOTYPE)) hide(path, VIRTUAL_PROTOTYPE, {}); // export virtual prototype methods path[VIRTUAL_PROTOTYPE][key] = sourceProperty; // export real prototype methods if (options.real && targetPrototype && !targetPrototype[key]) hide(targetPrototype, key, sourceProperty); } } }; },{"../internals/bind-context":76,"../internals/global":96,"../internals/has":97,"../internals/hide":99,"../internals/is-forced":105,"../internals/object-get-own-property-descriptor":118,"../internals/path":130}],92:[function(require,module,exports){ module.exports = function (exec) { try { return !!exec(); } catch (error) { return true; } }; },{}],93:[function(require,module,exports){ 'use strict'; var aFunction = require('../internals/a-function'); var isObject = require('../internals/is-object'); var slice = [].slice; var factories = {}; var construct = function (C, argsLength, args) { if (!(argsLength in factories)) { for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']'; // eslint-disable-next-line no-new-func factories[argsLength] = Function('C,a', 'return new C(' + list.join(',') + ')'); } return factories[argsLength](C, args); }; // `Function.prototype.bind` method implementation // https://tc39.github.io/ecma262/#sec-function.prototype.bind module.exports = Function.bind || function bind(that /* , ...args */) { var fn = aFunction(this); var partArgs = slice.call(arguments, 1); var boundFunction = function bound(/* args... */) { var args = partArgs.concat(slice.call(arguments)); return this instanceof boundFunction ? construct(fn, args.length, args) : fn.apply(that, args); }; if (isObject(fn.prototype)) boundFunction.prototype = fn.prototype; return boundFunction; }; },{"../internals/a-function":67,"../internals/is-object":106}],94:[function(require,module,exports){ var shared = require('../internals/shared'); module.exports = shared('native-function-to-string', Function.toString); },{"../internals/shared":136}],95:[function(require,module,exports){ var path = require('../internals/path'); var global = require('../internals/global'); var aFunction = function (variable) { return typeof variable == 'function' ? variable : undefined; }; module.exports = function (namespace, method) { return arguments.length < 2 ? aFunction(path[namespace]) || aFunction(global[namespace]) : path[namespace] && path[namespace][method] || global[namespace] && global[namespace][method]; }; },{"../internals/global":96,"../internals/path":130}],96:[function(require,module,exports){ (function (global){ var O = 'object'; var check = function (it) { return it && it.Math == Math && it; }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 module.exports = // eslint-disable-next-line no-undef check(typeof globalThis == O && globalThis) || check(typeof window == O && window) || check(typeof self == O && self) || check(typeof global == O && global) || // eslint-disable-next-line no-new-func Function('return this')(); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],97:[function(require,module,exports){ var hasOwnProperty = {}.hasOwnProperty; module.exports = function (it, key) { return hasOwnProperty.call(it, key); }; },{}],98:[function(require,module,exports){ module.exports = {}; },{}],99:[function(require,module,exports){ var DESCRIPTORS = require('../internals/descriptors'); var definePropertyModule = require('../internals/object-define-property'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); module.exports = DESCRIPTORS ? function (object, key, value) { return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)); } : function (object, key, value) { object[key] = value; return object; }; },{"../internals/create-property-descriptor":82,"../internals/descriptors":86,"../internals/object-define-property":117}],100:[function(require,module,exports){ var getBuiltIn = require('../internals/get-built-in'); module.exports = getBuiltIn('document', 'documentElement'); },{"../internals/get-built-in":95}],101:[function(require,module,exports){ var DESCRIPTORS = require('../internals/descriptors'); var fails = require('../internals/fails'); var createElement = require('../internals/document-create-element'); // Thank's IE8 for his funny defineProperty module.exports = !DESCRIPTORS && !fails(function () { return Object.defineProperty(createElement('div'), 'a', { get: function () { return 7; } }).a != 7; }); },{"../internals/descriptors":86,"../internals/document-create-element":87,"../internals/fails":92}],102:[function(require,module,exports){ var fails = require('../internals/fails'); var classof = require('../internals/classof-raw'); var split = ''.split; // fallback for non-array-like ES3 and non-enumerable old V8 strings module.exports = fails(function () { // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346 // eslint-disable-next-line no-prototype-builtins return !Object('z').propertyIsEnumerable(0); }) ? function (it) { return classof(it) == 'String' ? split.call(it, '') : Object(it); } : Object; },{"../internals/classof-raw":77,"../internals/fails":92}],103:[function(require,module,exports){ var NATIVE_WEAK_MAP = require('../internals/native-weak-map'); var global = require('../internals/global'); var isObject = require('../internals/is-object'); var hide = require('../internals/hide'); var objectHas = require('../internals/has'); var sharedKey = require('../internals/shared-key'); var hiddenKeys = require('../internals/hidden-keys'); var WeakMap = global.WeakMap; var set, get, has; var enforce = function (it) { return has(it) ? get(it) : set(it, {}); }; var getterFor = function (TYPE) { return function (it) { var state; if (!isObject(it) || (state = get(it)).type !== TYPE) { throw TypeError('Incompatible receiver, ' + TYPE + ' required'); } return state; }; }; if (NATIVE_WEAK_MAP) { var store = new WeakMap(); var wmget = store.get; var wmhas = store.has; var wmset = store.set; set = function (it, metadata) { wmset.call(store, it, metadata); return metadata; }; get = function (it) { return wmget.call(store, it) || {}; }; has = function (it) { return wmhas.call(store, it); }; } else { var STATE = sharedKey('state'); hiddenKeys[STATE] = true; set = function (it, metadata) { hide(it, STATE, metadata); return metadata; }; get = function (it) { return objectHas(it, STATE) ? it[STATE] : {}; }; has = function (it) { return objectHas(it, STATE); }; } module.exports = { set: set, get: get, has: has, enforce: enforce, getterFor: getterFor }; },{"../internals/global":96,"../internals/has":97,"../internals/hidden-keys":98,"../internals/hide":99,"../internals/is-object":106,"../internals/native-weak-map":112,"../internals/shared-key":135}],104:[function(require,module,exports){ var classof = require('../internals/classof-raw'); // `IsArray` abstract operation // https://tc39.github.io/ecma262/#sec-isarray module.exports = Array.isArray || function isArray(arg) { return classof(arg) == 'Array'; }; },{"../internals/classof-raw":77}],105:[function(require,module,exports){ var fails = require('../internals/fails'); var replacement = /#|\.prototype\./; var isForced = function (feature, detection) { var value = data[normalize(feature)]; return value == POLYFILL ? true : value == NATIVE ? false : typeof detection == 'function' ? fails(detection) : !!detection; }; var normalize = isForced.normalize = function (string) { return String(string).replace(replacement, '.').toLowerCase(); }; var data = isForced.data = {}; var NATIVE = isForced.NATIVE = 'N'; var POLYFILL = isForced.POLYFILL = 'P'; module.exports = isForced; },{"../internals/fails":92}],106:[function(require,module,exports){ module.exports = function (it) { return typeof it === 'object' ? it !== null : typeof it === 'function'; }; },{}],107:[function(require,module,exports){ module.exports = true; },{}],108:[function(require,module,exports){ var isObject = require('../internals/is-object'); var classof = require('../internals/classof-raw'); var wellKnownSymbol = require('../internals/well-known-symbol'); var MATCH = wellKnownSymbol('match'); // `IsRegExp` abstract operation // https://tc39.github.io/ecma262/#sec-isregexp module.exports = function (it) { var isRegExp; return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) == 'RegExp'); }; },{"../internals/classof-raw":77,"../internals/is-object":106,"../internals/well-known-symbol":147}],109:[function(require,module,exports){ 'use strict'; var getPrototypeOf = require('../internals/object-get-prototype-of'); var hide = require('../internals/hide'); var has = require('../internals/has'); var wellKnownSymbol = require('../internals/well-known-symbol'); var IS_PURE = require('../internals/is-pure'); var ITERATOR = wellKnownSymbol('iterator'); var BUGGY_SAFARI_ITERATORS = false; var returnThis = function () { return this; }; // `%IteratorPrototype%` object // https://tc39.github.io/ecma262/#sec-%iteratorprototype%-object var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator; if ([].keys) { arrayIterator = [].keys(); // Safari 8 has buggy iterators w/o `next` if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true; else { PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator)); if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype; } } if (IteratorPrototype == undefined) IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() if (!IS_PURE && !has(IteratorPrototype, ITERATOR)) hide(IteratorPrototype, ITERATOR, returnThis); module.exports = { IteratorPrototype: IteratorPrototype, BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS }; },{"../internals/has":97,"../internals/hide":99,"../internals/is-pure":107,"../internals/object-get-prototype-of":122,"../internals/well-known-symbol":147}],110:[function(require,module,exports){ arguments[4][98][0].apply(exports,arguments) },{"dup":98}],111:[function(require,module,exports){ var fails = require('../internals/fails'); module.exports = !!Object.getOwnPropertySymbols && !fails(function () { // Chrome 38 Symbol has incorrect toString conversion // eslint-disable-next-line no-undef return !String(Symbol()); }); },{"../internals/fails":92}],112:[function(require,module,exports){ var global = require('../internals/global'); var nativeFunctionToString = require('../internals/function-to-string'); var WeakMap = global.WeakMap; module.exports = typeof WeakMap === 'function' && /native code/.test(nativeFunctionToString.call(WeakMap)); },{"../internals/function-to-string":94,"../internals/global":96}],113:[function(require,module,exports){ var isRegExp = require('../internals/is-regexp'); module.exports = function (it) { if (isRegExp(it)) { throw TypeError("The method doesn't accept regular expressions"); } return it; }; },{"../internals/is-regexp":108}],114:[function(require,module,exports){ 'use strict'; var DESCRIPTORS = require('../internals/descriptors'); var fails = require('../internals/fails'); var objectKeys = require('../internals/object-keys'); var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); var toObject = require('../internals/to-object'); var IndexedObject = require('../internals/indexed-object'); var nativeAssign = Object.assign; // `Object.assign` method // https://tc39.github.io/ecma262/#sec-object.assign // should work with symbols and should have deterministic property order (V8 bug) module.exports = !nativeAssign || fails(function () { var A = {}; var B = {}; // eslint-disable-next-line no-undef var symbol = Symbol(); var alphabet = 'abcdefghijklmnopqrst'; A[symbol] = 7; alphabet.split('').forEach(function (chr) { B[chr] = chr; }); return nativeAssign({}, A)[symbol] != 7 || objectKeys(nativeAssign({}, B)).join('') != alphabet; }) ? function assign(target, source) { // eslint-disable-line no-unused-vars var T = toObject(target); var argumentsLength = arguments.length; var index = 1; var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; var propertyIsEnumerable = propertyIsEnumerableModule.f; while (argumentsLength > index) { var S = IndexedObject(arguments[index++]); var keys = getOwnPropertySymbols ? objectKeys(S).concat(getOwnPropertySymbols(S)) : objectKeys(S); var length = keys.length; var j = 0; var key; while (length > j) { key = keys[j++]; if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key]; } } return T; } : nativeAssign; },{"../internals/descriptors":86,"../internals/fails":92,"../internals/indexed-object":102,"../internals/object-get-own-property-symbols":121,"../internals/object-keys":124,"../internals/object-property-is-enumerable":125,"../internals/to-object":143}],115:[function(require,module,exports){ var anObject = require('../internals/an-object'); var defineProperties = require('../internals/object-define-properties'); var enumBugKeys = require('../internals/enum-bug-keys'); var hiddenKeys = require('../internals/hidden-keys'); var html = require('../internals/html'); var documentCreateElement = require('../internals/document-create-element'); var sharedKey = require('../internals/shared-key'); var IE_PROTO = sharedKey('IE_PROTO'); var PROTOTYPE = 'prototype'; var Empty = function () { /* empty */ }; // Create object with fake `null` prototype: use iframe Object with cleared prototype var createDict = function () { // Thrash, waste and sodomy: IE GC bug var iframe = documentCreateElement('iframe'); var length = enumBugKeys.length; var lt = '<'; var script = 'script'; var gt = '>'; var js = 'java' + script + ':'; var iframeDocument; iframe.style.display = 'none'; html.appendChild(iframe); iframe.src = String(js); iframeDocument = iframe.contentWindow.document; iframeDocument.open(); iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt); iframeDocument.close(); createDict = iframeDocument.F; while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]]; return createDict(); }; // `Object.create` method // https://tc39.github.io/ecma262/#sec-object.create module.exports = Object.create || function create(O, Properties) { var result; if (O !== null) { Empty[PROTOTYPE] = anObject(O); result = new Empty(); Empty[PROTOTYPE] = null; // add "__proto__" for Object.getPrototypeOf polyfill result[IE_PROTO] = O; } else result = createDict(); return Properties === undefined ? result : defineProperties(result, Properties); }; hiddenKeys[IE_PROTO] = true; },{"../internals/an-object":70,"../internals/document-create-element":87,"../internals/enum-bug-keys":90,"../internals/hidden-keys":98,"../internals/html":100,"../internals/object-define-properties":116,"../internals/shared-key":135}],116:[function(require,module,exports){ var DESCRIPTORS = require('../internals/descriptors'); var definePropertyModule = require('../internals/object-define-property'); var anObject = require('../internals/an-object'); var objectKeys = require('../internals/object-keys'); // `Object.defineProperties` method // https://tc39.github.io/ecma262/#sec-object.defineproperties module.exports = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var keys = objectKeys(Properties); var length = keys.length; var index = 0; var key; while (length > index) definePropertyModule.f(O, key = keys[index++], Properties[key]); return O; }; },{"../internals/an-object":70,"../internals/descriptors":86,"../internals/object-define-property":117,"../internals/object-keys":124}],117:[function(require,module,exports){ var DESCRIPTORS = require('../internals/descriptors'); var IE8_DOM_DEFINE = require('../internals/ie8-dom-define'); var anObject = require('../internals/an-object'); var toPrimitive = require('../internals/to-primitive'); var nativeDefineProperty = Object.defineProperty; // `Object.defineProperty` method // https://tc39.github.io/ecma262/#sec-object.defineproperty exports.f = DESCRIPTORS ? nativeDefineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPrimitive(P, true); anObject(Attributes); if (IE8_DOM_DEFINE) try { return nativeDefineProperty(O, P, Attributes); } catch (error) { /* empty */ } if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported'); if ('value' in Attributes) O[P] = Attributes.value; return O; }; },{"../internals/an-object":70,"../internals/descriptors":86,"../internals/ie8-dom-define":101,"../internals/to-primitive":144}],118:[function(require,module,exports){ var DESCRIPTORS = require('../internals/descriptors'); var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); var toIndexedObject = require('../internals/to-indexed-object'); var toPrimitive = require('../internals/to-primitive'); var has = require('../internals/has'); var IE8_DOM_DEFINE = require('../internals/ie8-dom-define'); var nativeGetOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor exports.f = DESCRIPTORS ? nativeGetOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) { O = toIndexedObject(O); P = toPrimitive(P, true); if (IE8_DOM_DEFINE) try { return nativeGetOwnPropertyDescriptor(O, P); } catch (error) { /* empty */ } if (has(O, P)) return createPropertyDescriptor(!propertyIsEnumerableModule.f.call(O, P), O[P]); }; },{"../internals/create-property-descriptor":82,"../internals/descriptors":86,"../internals/has":97,"../internals/ie8-dom-define":101,"../internals/object-property-is-enumerable":125,"../internals/to-indexed-object":140,"../internals/to-primitive":144}],119:[function(require,module,exports){ var toIndexedObject = require('../internals/to-indexed-object'); var nativeGetOwnPropertyNames = require('../internals/object-get-own-property-names').f; var toString = {}.toString; var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []; var getWindowNames = function (it) { try { return nativeGetOwnPropertyNames(it); } catch (error) { return windowNames.slice(); } }; // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window module.exports.f = function getOwnPropertyNames(it) { return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : nativeGetOwnPropertyNames(toIndexedObject(it)); }; },{"../internals/object-get-own-property-names":120,"../internals/to-indexed-object":140}],120:[function(require,module,exports){ var internalObjectKeys = require('../internals/object-keys-internal'); var enumBugKeys = require('../internals/enum-bug-keys'); var hiddenKeys = enumBugKeys.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method // https://tc39.github.io/ecma262/#sec-object.getownpropertynames exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return internalObjectKeys(O, hiddenKeys); }; },{"../internals/enum-bug-keys":90,"../internals/object-keys-internal":123}],121:[function(require,module,exports){ exports.f = Object.getOwnPropertySymbols; },{}],122:[function(require,module,exports){ var has = require('../internals/has'); var toObject = require('../internals/to-object'); var sharedKey = require('../internals/shared-key'); var CORRECT_PROTOTYPE_GETTER = require('../internals/correct-prototype-getter'); var IE_PROTO = sharedKey('IE_PROTO'); var ObjectPrototype = Object.prototype; // `Object.getPrototypeOf` method // https://tc39.github.io/ecma262/#sec-object.getprototypeof module.exports = CORRECT_PROTOTYPE_GETTER ? Object.getPrototypeOf : function (O) { O = toObject(O); if (has(O, IE_PROTO)) return O[IE_PROTO]; if (typeof O.constructor == 'function' && O instanceof O.constructor) { return O.constructor.prototype; } return O instanceof Object ? ObjectPrototype : null; }; },{"../internals/correct-prototype-getter":80,"../internals/has":97,"../internals/shared-key":135,"../internals/to-object":143}],123:[function(require,module,exports){ var has = require('../internals/has'); var toIndexedObject = require('../internals/to-indexed-object'); var indexOf = require('../internals/array-includes').indexOf; var hiddenKeys = require('../internals/hidden-keys'); module.exports = function (object, names) { var O = toIndexedObject(object); var i = 0; var result = []; var key; for (key in O) !has(hiddenKeys, key) && has(O, key) && result.push(key); // Don't enum bug & hidden keys while (names.length > i) if (has(O, key = names[i++])) { ~indexOf(result, key) || result.push(key); } return result; }; },{"../internals/array-includes":72,"../internals/has":97,"../internals/hidden-keys":98,"../internals/to-indexed-object":140}],124:[function(require,module,exports){ var internalObjectKeys = require('../internals/object-keys-internal'); var enumBugKeys = require('../internals/enum-bug-keys'); // `Object.keys` method // https://tc39.github.io/ecma262/#sec-object.keys module.exports = Object.keys || function keys(O) { return internalObjectKeys(O, enumBugKeys); }; },{"../internals/enum-bug-keys":90,"../internals/object-keys-internal":123}],125:[function(require,module,exports){ 'use strict'; var nativePropertyIsEnumerable = {}.propertyIsEnumerable; var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug var NASHORN_BUG = getOwnPropertyDescriptor && !nativePropertyIsEnumerable.call({ 1: 2 }, 1); // `Object.prototype.propertyIsEnumerable` method implementation // https://tc39.github.io/ecma262/#sec-object.prototype.propertyisenumerable exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) { var descriptor = getOwnPropertyDescriptor(this, V); return !!descriptor && descriptor.enumerable; } : nativePropertyIsEnumerable; },{}],126:[function(require,module,exports){ var anObject = require('../internals/an-object'); var aPossiblePrototype = require('../internals/a-possible-prototype'); // `Object.setPrototypeOf` method // https://tc39.github.io/ecma262/#sec-object.setprototypeof // Works with __proto__ only. Old v8 can't work with null proto objects. /* eslint-disable no-proto */ module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () { var CORRECT_SETTER = false; var test = {}; var setter; try { setter = Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set; setter.call(test, []); CORRECT_SETTER = test instanceof Array; } catch (error) { /* empty */ } return function setPrototypeOf(O, proto) { anObject(O); aPossiblePrototype(proto); if (CORRECT_SETTER) setter.call(O, proto); else O.__proto__ = proto; return O; }; }() : undefined); },{"../internals/a-possible-prototype":68,"../internals/an-object":70}],127:[function(require,module,exports){ 'use strict'; var classof = require('../internals/classof'); var wellKnownSymbol = require('../internals/well-known-symbol'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var test = {}; test[TO_STRING_TAG] = 'z'; // `Object.prototype.toString` method implementation // https://tc39.github.io/ecma262/#sec-object.prototype.tostring module.exports = String(test) !== '[object z]' ? function toString() { return '[object ' + classof(this) + ']'; } : test.toString; },{"../internals/classof":78,"../internals/well-known-symbol":147}],128:[function(require,module,exports){ var getBuiltIn = require('../internals/get-built-in'); var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names'); var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); var anObject = require('../internals/an-object'); // all object keys, includes non-enumerable and symbols module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { var keys = getOwnPropertyNamesModule.f(anObject(it)); var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; return getOwnPropertySymbols ? keys.concat(getOwnPropertySymbols(it)) : keys; }; },{"../internals/an-object":70,"../internals/get-built-in":95,"../internals/object-get-own-property-names":120,"../internals/object-get-own-property-symbols":121}],129:[function(require,module,exports){ var global = require('../internals/global'); var trim = require('../internals/string-trim').trim; var whitespaces = require('../internals/whitespaces'); var nativeParseInt = global.parseInt; var hex = /^[+-]?0[Xx]/; var FORCED = nativeParseInt(whitespaces + '08') !== 8 || nativeParseInt(whitespaces + '0x16') !== 22; // `parseInt` method // https://tc39.github.io/ecma262/#sec-parseint-string-radix module.exports = FORCED ? function parseInt(string, radix) { var S = trim(String(string)); return nativeParseInt(S, (radix >>> 0) || (hex.test(S) ? 16 : 10)); } : nativeParseInt; },{"../internals/global":96,"../internals/string-trim":138,"../internals/whitespaces":148}],130:[function(require,module,exports){ arguments[4][98][0].apply(exports,arguments) },{"dup":98}],131:[function(require,module,exports){ var hide = require('../internals/hide'); module.exports = function (target, key, value, options) { if (options && options.enumerable) target[key] = value; else hide(target, key, value); }; },{"../internals/hide":99}],132:[function(require,module,exports){ // `RequireObjectCoercible` abstract operation // https://tc39.github.io/ecma262/#sec-requireobjectcoercible module.exports = function (it) { if (it == undefined) throw TypeError("Can't call method on " + it); return it; }; },{}],133:[function(require,module,exports){ var global = require('../internals/global'); var hide = require('../internals/hide'); module.exports = function (key, value) { try { hide(global, key, value); } catch (error) { global[key] = value; } return value; }; },{"../internals/global":96,"../internals/hide":99}],134:[function(require,module,exports){ var defineProperty = require('../internals/object-define-property').f; var hide = require('../internals/hide'); var has = require('../internals/has'); var toString = require('../internals/object-to-string'); var wellKnownSymbol = require('../internals/well-known-symbol'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var METHOD_REQUIRED = toString !== ({}).toString; module.exports = function (it, TAG, STATIC, SET_METHOD) { if (it) { var target = STATIC ? it : it.prototype; if (!has(target, TO_STRING_TAG)) { defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG }); } if (SET_METHOD && METHOD_REQUIRED) hide(target, 'toString', toString); } }; },{"../internals/has":97,"../internals/hide":99,"../internals/object-define-property":117,"../internals/object-to-string":127,"../internals/well-known-symbol":147}],135:[function(require,module,exports){ var shared = require('../internals/shared'); var uid = require('../internals/uid'); var keys = shared('keys'); module.exports = function (key) { return keys[key] || (keys[key] = uid(key)); }; },{"../internals/shared":136,"../internals/uid":145}],136:[function(require,module,exports){ var global = require('../internals/global'); var setGlobal = require('../internals/set-global'); var IS_PURE = require('../internals/is-pure'); var SHARED = '__core-js_shared__'; var store = global[SHARED] || setGlobal(SHARED, {}); (module.exports = function (key, value) { return store[key] || (store[key] = value !== undefined ? value : {}); })('versions', []).push({ version: '3.1.3', mode: IS_PURE ? 'pure' : 'global', copyright: '© 2019 Denis Pushkarev (zloirock.ru)' }); },{"../internals/global":96,"../internals/is-pure":107,"../internals/set-global":133}],137:[function(require,module,exports){ 'use strict'; var fails = require('../internals/fails'); module.exports = function (METHOD_NAME, argument) { var method = [][METHOD_NAME]; return !method || !fails(function () { // eslint-disable-next-line no-useless-call,no-throw-literal method.call(null, argument || function () { throw 1; }, 1); }); }; },{"../internals/fails":92}],138:[function(require,module,exports){ var requireObjectCoercible = require('../internals/require-object-coercible'); var whitespaces = require('../internals/whitespaces'); var whitespace = '[' + whitespaces + ']'; var ltrim = RegExp('^' + whitespace + whitespace + '*'); var rtrim = RegExp(whitespace + whitespace + '*$'); // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation var createMethod = function (TYPE) { return function ($this) { var string = String(requireObjectCoercible($this)); if (TYPE & 1) string = string.replace(ltrim, ''); if (TYPE & 2) string = string.replace(rtrim, ''); return string; }; }; module.exports = { // `String.prototype.{ trimLeft, trimStart }` methods // https://tc39.github.io/ecma262/#sec-string.prototype.trimstart start: createMethod(1), // `String.prototype.{ trimRight, trimEnd }` methods // https://tc39.github.io/ecma262/#sec-string.prototype.trimend end: createMethod(2), // `String.prototype.trim` method // https://tc39.github.io/ecma262/#sec-string.prototype.trim trim: createMethod(3) }; },{"../internals/require-object-coercible":132,"../internals/whitespaces":148}],139:[function(require,module,exports){ var toInteger = require('../internals/to-integer'); var max = Math.max; var min = Math.min; // Helper for a popular repeating case of the spec: // Let integer be ? ToInteger(index). // If integer < 0, let result be max((length + integer), 0); else let result be min(length, length). module.exports = function (index, length) { var integer = toInteger(index); return integer < 0 ? max(integer + length, 0) : min(integer, length); }; },{"../internals/to-integer":141}],140:[function(require,module,exports){ // toObject with fallback for non-array-like ES3 strings var IndexedObject = require('../internals/indexed-object'); var requireObjectCoercible = require('../internals/require-object-coercible'); module.exports = function (it) { return IndexedObject(requireObjectCoercible(it)); }; },{"../internals/indexed-object":102,"../internals/require-object-coercible":132}],141:[function(require,module,exports){ var ceil = Math.ceil; var floor = Math.floor; // `ToInteger` abstract operation // https://tc39.github.io/ecma262/#sec-tointeger module.exports = function (argument) { return isNaN(argument = +argument) ? 0 : (argument > 0 ? floor : ceil)(argument); }; },{}],142:[function(require,module,exports){ var toInteger = require('../internals/to-integer'); var min = Math.min; // `ToLength` abstract operation // https://tc39.github.io/ecma262/#sec-tolength module.exports = function (argument) { return argument > 0 ? min(toInteger(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 }; },{"../internals/to-integer":141}],143:[function(require,module,exports){ var requireObjectCoercible = require('../internals/require-object-coercible'); // `ToObject` abstract operation // https://tc39.github.io/ecma262/#sec-toobject module.exports = function (argument) { return Object(requireObjectCoercible(argument)); }; },{"../internals/require-object-coercible":132}],144:[function(require,module,exports){ var isObject = require('../internals/is-object'); // `ToPrimitive` abstract operation // https://tc39.github.io/ecma262/#sec-toprimitive // instead of the ES6 spec version, we didn't implement @@toPrimitive case // and the second argument - flag - preferred type is a string module.exports = function (input, PREFERRED_STRING) { if (!isObject(input)) return input; var fn, val; if (PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; if (typeof (fn = input.valueOf) == 'function' && !isObject(val = fn.call(input))) return val; if (!PREFERRED_STRING && typeof (fn = input.toString) == 'function' && !isObject(val = fn.call(input))) return val; throw TypeError("Can't convert object to primitive value"); }; },{"../internals/is-object":106}],145:[function(require,module,exports){ var id = 0; var postfix = Math.random(); module.exports = function (key) { return 'Symbol(' + String(key === undefined ? '' : key) + ')_' + (++id + postfix).toString(36); }; },{}],146:[function(require,module,exports){ var getBuiltIn = require('../internals/get-built-in'); module.exports = getBuiltIn('navigator', 'userAgent') || ''; },{"../internals/get-built-in":95}],147:[function(require,module,exports){ var global = require('../internals/global'); var shared = require('../internals/shared'); var uid = require('../internals/uid'); var NATIVE_SYMBOL = require('../internals/native-symbol'); var Symbol = global.Symbol; var store = shared('wks'); module.exports = function (name) { return store[name] || (store[name] = NATIVE_SYMBOL && Symbol[name] || (NATIVE_SYMBOL ? Symbol : uid)('Symbol.' + name)); }; },{"../internals/global":96,"../internals/native-symbol":111,"../internals/shared":136,"../internals/uid":145}],148:[function(require,module,exports){ // a string of all valid unicode whitespaces // eslint-disable-next-line max-len module.exports = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF'; },{}],149:[function(require,module,exports){ exports.f = require('../internals/well-known-symbol'); },{"../internals/well-known-symbol":147}],150:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var $filter = require('../internals/array-iteration').filter; var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); // `Array.prototype.filter` method // https://tc39.github.io/ecma262/#sec-array.prototype.filter // with adding support of @@species $({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('filter') }, { filter: function filter(callbackfn /* , thisArg */) { return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); },{"../internals/array-iteration":73,"../internals/array-method-has-species-support":74,"../internals/export":91}],151:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var forEach = require('../internals/array-for-each'); // `Array.prototype.forEach` method // https://tc39.github.io/ecma262/#sec-array.prototype.foreach $({ target: 'Array', proto: true, forced: [].forEach != forEach }, { forEach: forEach }); },{"../internals/array-for-each":71,"../internals/export":91}],152:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var $includes = require('../internals/array-includes').includes; var addToUnscopables = require('../internals/add-to-unscopables'); // `Array.prototype.includes` method // https://tc39.github.io/ecma262/#sec-array.prototype.includes $({ target: 'Array', proto: true }, { includes: function includes(el /* , fromIndex = 0 */) { return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); } }); // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables addToUnscopables('includes'); },{"../internals/add-to-unscopables":69,"../internals/array-includes":72,"../internals/export":91}],153:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var $indexOf = require('../internals/array-includes').indexOf; var sloppyArrayMethod = require('../internals/sloppy-array-method'); var nativeIndexOf = [].indexOf; var NEGATIVE_ZERO = !!nativeIndexOf && 1 / [1].indexOf(1, -0) < 0; var SLOPPY_METHOD = sloppyArrayMethod('indexOf'); // `Array.prototype.indexOf` method // https://tc39.github.io/ecma262/#sec-array.prototype.indexof $({ target: 'Array', proto: true, forced: NEGATIVE_ZERO || SLOPPY_METHOD }, { indexOf: function indexOf(searchElement /* , fromIndex = 0 */) { return NEGATIVE_ZERO // convert -0 to +0 ? nativeIndexOf.apply(this, arguments) || 0 : $indexOf(this, searchElement, arguments.length > 1 ? arguments[1] : undefined); } }); },{"../internals/array-includes":72,"../internals/export":91,"../internals/sloppy-array-method":137}],154:[function(require,module,exports){ 'use strict'; var toIndexedObject = require('../internals/to-indexed-object'); var addToUnscopables = require('../internals/add-to-unscopables'); var Iterators = require('../internals/iterators'); var InternalStateModule = require('../internals/internal-state'); var defineIterator = require('../internals/define-iterator'); var ARRAY_ITERATOR = 'Array Iterator'; var setInternalState = InternalStateModule.set; var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR); // `Array.prototype.entries` method // https://tc39.github.io/ecma262/#sec-array.prototype.entries // `Array.prototype.keys` method // https://tc39.github.io/ecma262/#sec-array.prototype.keys // `Array.prototype.values` method // https://tc39.github.io/ecma262/#sec-array.prototype.values // `Array.prototype[@@iterator]` method // https://tc39.github.io/ecma262/#sec-array.prototype-@@iterator // `CreateArrayIterator` internal method // https://tc39.github.io/ecma262/#sec-createarrayiterator module.exports = defineIterator(Array, 'Array', function (iterated, kind) { setInternalState(this, { type: ARRAY_ITERATOR, target: toIndexedObject(iterated), // target index: 0, // next index kind: kind // kind }); // `%ArrayIteratorPrototype%.next` method // https://tc39.github.io/ecma262/#sec-%arrayiteratorprototype%.next }, function () { var state = getInternalState(this); var target = state.target; var kind = state.kind; var index = state.index++; if (!target || index >= target.length) { state.target = undefined; return { value: undefined, done: true }; } if (kind == 'keys') return { value: index, done: false }; if (kind == 'values') return { value: target[index], done: false }; return { value: [index, target[index]], done: false }; }, 'values'); // argumentsList[@@iterator] is %ArrayProto_values% // https://tc39.github.io/ecma262/#sec-createunmappedargumentsobject // https://tc39.github.io/ecma262/#sec-createmappedargumentsobject Iterators.Arguments = Iterators.Array; // https://tc39.github.io/ecma262/#sec-array.prototype-@@unscopables addToUnscopables('keys'); addToUnscopables('values'); addToUnscopables('entries'); },{"../internals/add-to-unscopables":69,"../internals/define-iterator":84,"../internals/internal-state":103,"../internals/iterators":110,"../internals/to-indexed-object":140}],155:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var $map = require('../internals/array-iteration').map; var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); // `Array.prototype.map` method // https://tc39.github.io/ecma262/#sec-array.prototype.map // with adding support of @@species $({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('map') }, { map: function map(callbackfn /* , thisArg */) { return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); } }); },{"../internals/array-iteration":73,"../internals/array-method-has-species-support":74,"../internals/export":91}],156:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var toAbsoluteIndex = require('../internals/to-absolute-index'); var toInteger = require('../internals/to-integer'); var toLength = require('../internals/to-length'); var toObject = require('../internals/to-object'); var arraySpeciesCreate = require('../internals/array-species-create'); var createProperty = require('../internals/create-property'); var arrayMethodHasSpeciesSupport = require('../internals/array-method-has-species-support'); var max = Math.max; var min = Math.min; var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded'; // `Array.prototype.splice` method // https://tc39.github.io/ecma262/#sec-array.prototype.splice // with adding support of @@species $({ target: 'Array', proto: true, forced: !arrayMethodHasSpeciesSupport('splice') }, { splice: function splice(start, deleteCount /* , ...items */) { var O = toObject(this); var len = toLength(O.length); var actualStart = toAbsoluteIndex(start, len); var argumentsLength = arguments.length; var insertCount, actualDeleteCount, A, k, from, to; if (argumentsLength === 0) { insertCount = actualDeleteCount = 0; } else if (argumentsLength === 1) { insertCount = 0; actualDeleteCount = len - actualStart; } else { insertCount = argumentsLength - 2; actualDeleteCount = min(max(toInteger(deleteCount), 0), len - actualStart); } if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) { throw TypeError(MAXIMUM_ALLOWED_LENGTH_EXCEEDED); } A = arraySpeciesCreate(O, actualDeleteCount); for (k = 0; k < actualDeleteCount; k++) { from = actualStart + k; if (from in O) createProperty(A, k, O[from]); } A.length = actualDeleteCount; if (insertCount < actualDeleteCount) { for (k = actualStart; k < len - actualDeleteCount; k++) { from = k + actualDeleteCount; to = k + insertCount; if (from in O) O[to] = O[from]; else delete O[to]; } for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1]; } else if (insertCount > actualDeleteCount) { for (k = len - actualDeleteCount; k > actualStart; k--) { from = k + actualDeleteCount - 1; to = k + insertCount - 1; if (from in O) O[to] = O[from]; else delete O[to]; } } for (k = 0; k < insertCount; k++) { O[k + actualStart] = arguments[k + 2]; } O.length = len - actualDeleteCount + insertCount; return A; } }); },{"../internals/array-method-has-species-support":74,"../internals/array-species-create":75,"../internals/create-property":83,"../internals/export":91,"../internals/to-absolute-index":139,"../internals/to-integer":141,"../internals/to-length":142,"../internals/to-object":143}],157:[function(require,module,exports){ var $ = require('../internals/export'); // `Date.now` method // https://tc39.github.io/ecma262/#sec-date.now $({ target: 'Date', stat: true }, { now: function now() { return new Date().getTime(); } }); },{"../internals/export":91}],158:[function(require,module,exports){ var $ = require('../internals/export'); var bind = require('../internals/function-bind'); // `Function.prototype.bind` method // https://tc39.github.io/ecma262/#sec-function.prototype.bind $({ target: 'Function', proto: true }, { bind: bind }); },{"../internals/export":91,"../internals/function-bind":93}],159:[function(require,module,exports){ var $ = require('../internals/export'); var assign = require('../internals/object-assign'); // `Object.assign` method // https://tc39.github.io/ecma262/#sec-object.assign $({ target: 'Object', stat: true, forced: Object.assign !== assign }, { assign: assign }); },{"../internals/export":91,"../internals/object-assign":114}],160:[function(require,module,exports){ var $ = require('../internals/export'); var DESCRIPTORS = require('../internals/descriptors'); var defineProperties = require('../internals/object-define-properties'); // `Object.defineProperties` method // https://tc39.github.io/ecma262/#sec-object.defineproperties $({ target: 'Object', stat: true, forced: !DESCRIPTORS, sham: !DESCRIPTORS }, { defineProperties: defineProperties }); },{"../internals/descriptors":86,"../internals/export":91,"../internals/object-define-properties":116}],161:[function(require,module,exports){ var $ = require('../internals/export'); var DESCRIPTORS = require('../internals/descriptors'); var objectDefinePropertyModile = require('../internals/object-define-property'); // `Object.defineProperty` method // https://tc39.github.io/ecma262/#sec-object.defineproperty $({ target: 'Object', stat: true, forced: !DESCRIPTORS, sham: !DESCRIPTORS }, { defineProperty: objectDefinePropertyModile.f }); },{"../internals/descriptors":86,"../internals/export":91,"../internals/object-define-property":117}],162:[function(require,module,exports){ var $ = require('../internals/export'); var fails = require('../internals/fails'); var toIndexedObject = require('../internals/to-indexed-object'); var nativeGetOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; var DESCRIPTORS = require('../internals/descriptors'); var FAILS_ON_PRIMITIVES = fails(function () { nativeGetOwnPropertyDescriptor(1); }); var FORCED = !DESCRIPTORS || FAILS_ON_PRIMITIVES; // `Object.getOwnPropertyDescriptor` method // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptor $({ target: 'Object', stat: true, forced: FORCED, sham: !DESCRIPTORS }, { getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) { return nativeGetOwnPropertyDescriptor(toIndexedObject(it), key); } }); },{"../internals/descriptors":86,"../internals/export":91,"../internals/fails":92,"../internals/object-get-own-property-descriptor":118,"../internals/to-indexed-object":140}],163:[function(require,module,exports){ var $ = require('../internals/export'); var DESCRIPTORS = require('../internals/descriptors'); var ownKeys = require('../internals/own-keys'); var toIndexedObject = require('../internals/to-indexed-object'); var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); var createProperty = require('../internals/create-property'); // `Object.getOwnPropertyDescriptors` method // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors $({ target: 'Object', stat: true, sham: !DESCRIPTORS }, { getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) { var O = toIndexedObject(object); var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; var keys = ownKeys(O); var result = {}; var index = 0; var key, descriptor; while (keys.length > index) { descriptor = getOwnPropertyDescriptor(O, key = keys[index++]); if (descriptor !== undefined) createProperty(result, key, descriptor); } return result; } }); },{"../internals/create-property":83,"../internals/descriptors":86,"../internals/export":91,"../internals/object-get-own-property-descriptor":118,"../internals/own-keys":128,"../internals/to-indexed-object":140}],164:[function(require,module,exports){ var $ = require('../internals/export'); var toObject = require('../internals/to-object'); var nativeKeys = require('../internals/object-keys'); var fails = require('../internals/fails'); var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); }); // `Object.keys` method // https://tc39.github.io/ecma262/#sec-object.keys $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, { keys: function keys(it) { return nativeKeys(toObject(it)); } }); },{"../internals/export":91,"../internals/fails":92,"../internals/object-keys":124,"../internals/to-object":143}],165:[function(require,module,exports){ var $ = require('../internals/export'); var parseIntImplementation = require('../internals/parse-int'); // `parseInt` method // https://tc39.github.io/ecma262/#sec-parseint-string-radix $({ global: true, forced: parseInt != parseIntImplementation }, { parseInt: parseIntImplementation }); },{"../internals/export":91,"../internals/parse-int":129}],166:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var notARegExp = require('../internals/not-a-regexp'); var requireObjectCoercible = require('../internals/require-object-coercible'); var correctIsRegExpLogic = require('../internals/correct-is-regexp-logic'); // `String.prototype.includes` method // https://tc39.github.io/ecma262/#sec-string.prototype.includes $({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, { includes: function includes(searchString /* , position = 0 */) { return !!~String(requireObjectCoercible(this)) .indexOf(notARegExp(searchString), arguments.length > 1 ? arguments[1] : undefined); } }); },{"../internals/correct-is-regexp-logic":79,"../internals/export":91,"../internals/not-a-regexp":113,"../internals/require-object-coercible":132}],167:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var global = require('../internals/global'); var IS_PURE = require('../internals/is-pure'); var DESCRIPTORS = require('../internals/descriptors'); var NATIVE_SYMBOL = require('../internals/native-symbol'); var fails = require('../internals/fails'); var has = require('../internals/has'); var isArray = require('../internals/is-array'); var isObject = require('../internals/is-object'); var anObject = require('../internals/an-object'); var toObject = require('../internals/to-object'); var toIndexedObject = require('../internals/to-indexed-object'); var toPrimitive = require('../internals/to-primitive'); var createPropertyDescriptor = require('../internals/create-property-descriptor'); var nativeObjectCreate = require('../internals/object-create'); var objectKeys = require('../internals/object-keys'); var getOwnPropertyNamesModule = require('../internals/object-get-own-property-names'); var getOwnPropertyNamesExternal = require('../internals/object-get-own-property-names-external'); var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols'); var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); var definePropertyModule = require('../internals/object-define-property'); var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable'); var hide = require('../internals/hide'); var redefine = require('../internals/redefine'); var shared = require('../internals/shared'); var sharedKey = require('../internals/shared-key'); var hiddenKeys = require('../internals/hidden-keys'); var uid = require('../internals/uid'); var wellKnownSymbol = require('../internals/well-known-symbol'); var wrappedWellKnownSymbolModule = require('../internals/wrapped-well-known-symbol'); var defineWellKnownSymbol = require('../internals/define-well-known-symbol'); var setToStringTag = require('../internals/set-to-string-tag'); var InternalStateModule = require('../internals/internal-state'); var $forEach = require('../internals/array-iteration').forEach; var HIDDEN = sharedKey('hidden'); var SYMBOL = 'Symbol'; var PROTOTYPE = 'prototype'; var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); var setInternalState = InternalStateModule.set; var getInternalState = InternalStateModule.getterFor(SYMBOL); var ObjectPrototype = Object[PROTOTYPE]; var $Symbol = global.Symbol; var JSON = global.JSON; var nativeJSONStringify = JSON && JSON.stringify; var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; var nativeDefineProperty = definePropertyModule.f; var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f; var nativePropertyIsEnumerable = propertyIsEnumerableModule.f; var AllSymbols = shared('symbols'); var ObjectPrototypeSymbols = shared('op-symbols'); var StringToSymbolRegistry = shared('string-to-symbol-registry'); var SymbolToStringRegistry = shared('symbol-to-string-registry'); var WellKnownSymbolsStore = shared('wks'); var QObject = global.QObject; // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 var setSymbolDescriptor = DESCRIPTORS && fails(function () { return nativeObjectCreate(nativeDefineProperty({}, 'a', { get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; } })).a != 7; }) ? function (O, P, Attributes) { var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P); if (ObjectPrototypeDescriptor) delete ObjectPrototype[P]; nativeDefineProperty(O, P, Attributes); if (ObjectPrototypeDescriptor && O !== ObjectPrototype) { nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor); } } : nativeDefineProperty; var wrap = function (tag, description) { var symbol = AllSymbols[tag] = nativeObjectCreate($Symbol[PROTOTYPE]); setInternalState(symbol, { type: SYMBOL, tag: tag, description: description }); if (!DESCRIPTORS) symbol.description = description; return symbol; }; var isSymbol = NATIVE_SYMBOL && typeof $Symbol.iterator == 'symbol' ? function (it) { return typeof it == 'symbol'; } : function (it) { return Object(it) instanceof $Symbol; }; var $defineProperty = function defineProperty(O, P, Attributes) { if (O === ObjectPrototype) $defineProperty(ObjectPrototypeSymbols, P, Attributes); anObject(O); var key = toPrimitive(P, true); anObject(Attributes); if (has(AllSymbols, key)) { if (!Attributes.enumerable) { if (!has(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {})); O[HIDDEN][key] = true; } else { if (has(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false; Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) }); } return setSymbolDescriptor(O, key, Attributes); } return nativeDefineProperty(O, key, Attributes); }; var $defineProperties = function defineProperties(O, Properties) { anObject(O); var properties = toIndexedObject(Properties); var keys = objectKeys(properties).concat($getOwnPropertySymbols(properties)); $forEach(keys, function (key) { if (!DESCRIPTORS || $propertyIsEnumerable.call(properties, key)) $defineProperty(O, key, properties[key]); }); return O; }; var $create = function create(O, Properties) { return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties); }; var $propertyIsEnumerable = function propertyIsEnumerable(V) { var P = toPrimitive(V, true); var enumerable = nativePropertyIsEnumerable.call(this, P); if (this === ObjectPrototype && has(AllSymbols, P) && !has(ObjectPrototypeSymbols, P)) return false; return enumerable || !has(this, P) || !has(AllSymbols, P) || has(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true; }; var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) { var it = toIndexedObject(O); var key = toPrimitive(P, true); if (it === ObjectPrototype && has(AllSymbols, key) && !has(ObjectPrototypeSymbols, key)) return; var descriptor = nativeGetOwnPropertyDescriptor(it, key); if (descriptor && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) { descriptor.enumerable = true; } return descriptor; }; var $getOwnPropertyNames = function getOwnPropertyNames(O) { var names = nativeGetOwnPropertyNames(toIndexedObject(O)); var result = []; $forEach(names, function (key) { if (!has(AllSymbols, key) && !has(hiddenKeys, key)) result.push(key); }); return result; }; var $getOwnPropertySymbols = function getOwnPropertySymbols(O) { var IS_OBJECT_PROTOTYPE = O === ObjectPrototype; var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O)); var result = []; $forEach(names, function (key) { if (has(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || has(ObjectPrototype, key))) { result.push(AllSymbols[key]); } }); return result; }; // `Symbol` constructor // https://tc39.github.io/ecma262/#sec-symbol-constructor if (!NATIVE_SYMBOL) { $Symbol = function Symbol() { if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor'); var description = !arguments.length || arguments[0] === undefined ? undefined : String(arguments[0]); var tag = uid(description); var setter = function (value) { if (this === ObjectPrototype) setter.call(ObjectPrototypeSymbols, value); if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value)); }; if (DESCRIPTORS && USE_SETTER) setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter }); return wrap(tag, description); }; redefine($Symbol[PROTOTYPE], 'toString', function toString() { return getInternalState(this).tag; }); propertyIsEnumerableModule.f = $propertyIsEnumerable; definePropertyModule.f = $defineProperty; getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor; getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames; getOwnPropertySymbolsModule.f = $getOwnPropertySymbols; if (DESCRIPTORS) { // https://github.com/tc39/proposal-Symbol-description nativeDefineProperty($Symbol[PROTOTYPE], 'description', { configurable: true, get: function description() { return getInternalState(this).description; } }); if (!IS_PURE) { redefine(ObjectPrototype, 'propertyIsEnumerable', $propertyIsEnumerable, { unsafe: true }); } } wrappedWellKnownSymbolModule.f = function (name) { return wrap(wellKnownSymbol(name), name); }; } $({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, { Symbol: $Symbol }); $forEach(objectKeys(WellKnownSymbolsStore), function (name) { defineWellKnownSymbol(name); }); $({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, { // `Symbol.for` method // https://tc39.github.io/ecma262/#sec-symbol.for 'for': function (key) { var string = String(key); if (has(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string]; var symbol = $Symbol(string); StringToSymbolRegistry[string] = symbol; SymbolToStringRegistry[symbol] = string; return symbol; }, // `Symbol.keyFor` method // https://tc39.github.io/ecma262/#sec-symbol.keyfor keyFor: function keyFor(sym) { if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol'); if (has(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym]; }, useSetter: function () { USE_SETTER = true; }, useSimple: function () { USE_SETTER = false; } }); $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, { // `Object.create` method // https://tc39.github.io/ecma262/#sec-object.create create: $create, // `Object.defineProperty` method // https://tc39.github.io/ecma262/#sec-object.defineproperty defineProperty: $defineProperty, // `Object.defineProperties` method // https://tc39.github.io/ecma262/#sec-object.defineproperties defineProperties: $defineProperties, // `Object.getOwnPropertyDescriptor` method // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors getOwnPropertyDescriptor: $getOwnPropertyDescriptor }); $({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL }, { // `Object.getOwnPropertyNames` method // https://tc39.github.io/ecma262/#sec-object.getownpropertynames getOwnPropertyNames: $getOwnPropertyNames, // `Object.getOwnPropertySymbols` method // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols getOwnPropertySymbols: $getOwnPropertySymbols }); // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives // https://bugs.chromium.org/p/v8/issues/detail?id=3443 $({ target: 'Object', stat: true, forced: fails(function () { getOwnPropertySymbolsModule.f(1); }) }, { getOwnPropertySymbols: function getOwnPropertySymbols(it) { return getOwnPropertySymbolsModule.f(toObject(it)); } }); // `JSON.stringify` method behavior with symbols // https://tc39.github.io/ecma262/#sec-json.stringify JSON && $({ target: 'JSON', stat: true, forced: !NATIVE_SYMBOL || fails(function () { var symbol = $Symbol(); // MS Edge converts symbol values to JSON as {} return nativeJSONStringify([symbol]) != '[null]' // WebKit converts symbol values to JSON as null || nativeJSONStringify({ a: symbol }) != '{}' // V8 throws on boxed symbols || nativeJSONStringify(Object(symbol)) != '{}'; }) }, { stringify: function stringify(it) { var args = [it]; var index = 1; var replacer, $replacer; while (arguments.length > index) args.push(arguments[index++]); $replacer = replacer = args[1]; if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined if (!isArray(replacer)) replacer = function (key, value) { if (typeof $replacer == 'function') value = $replacer.call(this, key, value); if (!isSymbol(value)) return value; }; args[1] = replacer; return nativeJSONStringify.apply(JSON, args); } }); // `Symbol.prototype[@@toPrimitive]` method // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@toprimitive if (!$Symbol[PROTOTYPE][TO_PRIMITIVE]) hide($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); // `Symbol.prototype[@@toStringTag]` property // https://tc39.github.io/ecma262/#sec-symbol.prototype-@@tostringtag setToStringTag($Symbol, SYMBOL); hiddenKeys[HIDDEN] = true; },{"../internals/an-object":70,"../internals/array-iteration":73,"../internals/create-property-descriptor":82,"../internals/define-well-known-symbol":85,"../internals/descriptors":86,"../internals/export":91,"../internals/fails":92,"../internals/global":96,"../internals/has":97,"../internals/hidden-keys":98,"../internals/hide":99,"../internals/internal-state":103,"../internals/is-array":104,"../internals/is-object":106,"../internals/is-pure":107,"../internals/native-symbol":111,"../internals/object-create":115,"../internals/object-define-property":117,"../internals/object-get-own-property-descriptor":118,"../internals/object-get-own-property-names":120,"../internals/object-get-own-property-names-external":119,"../internals/object-get-own-property-symbols":121,"../internals/object-keys":124,"../internals/object-property-is-enumerable":125,"../internals/redefine":131,"../internals/set-to-string-tag":134,"../internals/shared":136,"../internals/shared-key":135,"../internals/to-indexed-object":140,"../internals/to-object":143,"../internals/to-primitive":144,"../internals/uid":145,"../internals/well-known-symbol":147,"../internals/wrapped-well-known-symbol":149}],168:[function(require,module,exports){ require('./es.array.iterator'); var DOMIterables = require('../internals/dom-iterables'); var global = require('../internals/global'); var hide = require('../internals/hide'); var Iterators = require('../internals/iterators'); var wellKnownSymbol = require('../internals/well-known-symbol'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); for (var COLLECTION_NAME in DOMIterables) { var Collection = global[COLLECTION_NAME]; var CollectionPrototype = Collection && Collection.prototype; if (CollectionPrototype && !CollectionPrototype[TO_STRING_TAG]) { hide(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME); } Iterators[COLLECTION_NAME] = Iterators.Array; } },{"../internals/dom-iterables":88,"../internals/global":96,"../internals/hide":99,"../internals/iterators":110,"../internals/well-known-symbol":147,"./es.array.iterator":154}],169:[function(require,module,exports){ var $ = require('../internals/export'); var global = require('../internals/global'); var userAgent = require('../internals/user-agent'); var slice = [].slice; var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check var wrap = function (scheduler) { return function (handler, timeout /* , ...arguments */) { var boundArgs = arguments.length > 2; var args = boundArgs ? slice.call(arguments, 2) : undefined; return scheduler(boundArgs ? function () { // eslint-disable-next-line no-new-func (typeof handler == 'function' ? handler : Function(handler)).apply(this, args); } : handler, timeout); }; }; // ie9- setTimeout & setInterval additional parameters fix // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers $({ global: true, bind: true, forced: MSIE }, { // `setTimeout` method // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout setTimeout: wrap(global.setTimeout), // `setInterval` method // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval setInterval: wrap(global.setInterval) }); },{"../internals/export":91,"../internals/global":96,"../internals/user-agent":146}],170:[function(require,module,exports){ module.exports = require('../../../es/array/virtual/for-each'); },{"../../../es/array/virtual/for-each":44}],171:[function(require,module,exports){ module.exports = require('../../es/date/now'); },{"../../es/date/now":49}],172:[function(require,module,exports){ module.exports = require('../../es/instance/bind'); },{"../../es/instance/bind":51}],173:[function(require,module,exports){ module.exports = require('../../es/instance/filter'); },{"../../es/instance/filter":52}],174:[function(require,module,exports){ require('../../modules/web.dom-collections.iterator'); var forEach = require('../array/virtual/for-each'); var classof = require('../../internals/classof'); var ArrayPrototype = Array.prototype; var DOMIterables = { DOMTokenList: true, NodeList: true }; module.exports = function (it) { var own = it.forEach; return it === ArrayPrototype || (it instanceof Array && own === ArrayPrototype.forEach) // eslint-disable-next-line no-prototype-builtins || DOMIterables.hasOwnProperty(classof(it)) ? forEach : own; }; },{"../../internals/classof":78,"../../modules/web.dom-collections.iterator":168,"../array/virtual/for-each":170}],175:[function(require,module,exports){ module.exports = require('../../es/instance/includes'); },{"../../es/instance/includes":53}],176:[function(require,module,exports){ module.exports = require('../../es/instance/index-of'); },{"../../es/instance/index-of":54}],177:[function(require,module,exports){ module.exports = require('../../es/instance/map'); },{"../../es/instance/map":55}],178:[function(require,module,exports){ module.exports = require('../../es/instance/splice'); },{"../../es/instance/splice":56}],179:[function(require,module,exports){ module.exports = require('../../es/object/assign'); },{"../../es/object/assign":57}],180:[function(require,module,exports){ module.exports = require('../../es/object/define-properties'); },{"../../es/object/define-properties":58}],181:[function(require,module,exports){ arguments[4][66][0].apply(exports,arguments) },{"../../es/object/define-property":59,"dup":66}],182:[function(require,module,exports){ module.exports = require('../../es/object/get-own-property-descriptor'); },{"../../es/object/get-own-property-descriptor":60}],183:[function(require,module,exports){ module.exports = require('../../es/object/get-own-property-descriptors'); },{"../../es/object/get-own-property-descriptors":61}],184:[function(require,module,exports){ module.exports = require('../../es/object/get-own-property-symbols'); },{"../../es/object/get-own-property-symbols":62}],185:[function(require,module,exports){ module.exports = require('../../es/object/keys'); },{"../../es/object/keys":63}],186:[function(require,module,exports){ module.exports = require('../es/parse-int'); },{"../es/parse-int":64}],187:[function(require,module,exports){ require('../modules/web.timers'); module.exports = require('../internals/path').setInterval; },{"../internals/path":130,"../modules/web.timers":169}],188:[function(require,module,exports){ require('../modules/web.timers'); module.exports = require('../internals/path').setTimeout; },{"../internals/path":130,"../modules/web.timers":169}],189:[function(require,module,exports){ arguments[4][67][0].apply(exports,arguments) },{"dup":67}],190:[function(require,module,exports){ arguments[4][68][0].apply(exports,arguments) },{"../internals/is-object":220,"dup":68}],191:[function(require,module,exports){ 'use strict'; var charAt = require('../internals/string-multibyte').charAt; // `AdvanceStringIndex` abstract operation // https://tc39.github.io/ecma262/#sec-advancestringindex module.exports = function (S, index, unicode) { return index + (unicode ? charAt(S, index).length : 1); }; },{"../internals/string-multibyte":250}],192:[function(require,module,exports){ arguments[4][70][0].apply(exports,arguments) },{"../internals/is-object":220,"dup":70}],193:[function(require,module,exports){ arguments[4][72][0].apply(exports,arguments) },{"../internals/to-absolute-index":251,"../internals/to-indexed-object":252,"../internals/to-length":254,"dup":72}],194:[function(require,module,exports){ arguments[4][73][0].apply(exports,arguments) },{"../internals/array-species-create":195,"../internals/bind-context":196,"../internals/indexed-object":215,"../internals/to-length":254,"../internals/to-object":255,"dup":73}],195:[function(require,module,exports){ arguments[4][75][0].apply(exports,arguments) },{"../internals/is-array":218,"../internals/is-object":220,"../internals/well-known-symbol":258,"dup":75}],196:[function(require,module,exports){ arguments[4][76][0].apply(exports,arguments) },{"../internals/a-function":189,"dup":76}],197:[function(require,module,exports){ arguments[4][77][0].apply(exports,arguments) },{"dup":77}],198:[function(require,module,exports){ var has = require('../internals/has'); var ownKeys = require('../internals/own-keys'); var getOwnPropertyDescriptorModule = require('../internals/object-get-own-property-descriptor'); var definePropertyModule = require('../internals/object-define-property'); module.exports = function (target, source) { var keys = ownKeys(source); var defineProperty = definePropertyModule.f; var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f; for (var i = 0; i < keys.length; i++) { var key = keys[i]; if (!has(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key)); } }; },{"../internals/has":210,"../internals/object-define-property":227,"../internals/object-get-own-property-descriptor":228,"../internals/own-keys":236}],199:[function(require,module,exports){ arguments[4][82][0].apply(exports,arguments) },{"dup":82}],200:[function(require,module,exports){ arguments[4][85][0].apply(exports,arguments) },{"../internals/has":210,"../internals/object-define-property":227,"../internals/path":237,"../internals/wrapped-well-known-symbol":259,"dup":85}],201:[function(require,module,exports){ arguments[4][86][0].apply(exports,arguments) },{"../internals/fails":205,"dup":86}],202:[function(require,module,exports){ arguments[4][87][0].apply(exports,arguments) },{"../internals/global":209,"../internals/is-object":220,"dup":87}],203:[function(require,module,exports){ arguments[4][90][0].apply(exports,arguments) },{"dup":90}],204:[function(require,module,exports){ var global = require('../internals/global'); var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f; var hide = require('../internals/hide'); var redefine = require('../internals/redefine'); var setGlobal = require('../internals/set-global'); var copyConstructorProperties = require('../internals/copy-constructor-properties'); var isForced = require('../internals/is-forced'); /* options.target - name of the target object options.global - target is the global object options.stat - export as static methods of target options.proto - export as prototype methods of target options.real - real prototype method for the `pure` version options.forced - export even if the native feature is available options.bind - bind methods to the target, required for the `pure` version options.wrap - wrap constructors to preventing global pollution, required for the `pure` version options.unsafe - use the simple assignment of property instead of delete + defineProperty options.sham - add a flag to not completely full polyfills options.enumerable - export as enumerable property options.noTargetGet - prevent calling a getter on target */ module.exports = function (options, source) { var TARGET = options.target; var GLOBAL = options.global; var STATIC = options.stat; var FORCED, target, key, targetProperty, sourceProperty, descriptor; if (GLOBAL) { target = global; } else if (STATIC) { target = global[TARGET] || setGlobal(TARGET, {}); } else { target = (global[TARGET] || {}).prototype; } if (target) for (key in source) { sourceProperty = source[key]; if (options.noTargetGet) { descriptor = getOwnPropertyDescriptor(target, key); targetProperty = descriptor && descriptor.value; } else targetProperty = target[key]; FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contained in target if (!FORCED && targetProperty !== undefined) { if (typeof sourceProperty === typeof targetProperty) continue; copyConstructorProperties(sourceProperty, targetProperty); } // add a flag to not completely full polyfills if (options.sham || (targetProperty && targetProperty.sham)) { hide(sourceProperty, 'sham', true); } // extend global redefine(target, key, sourceProperty, options); } }; },{"../internals/copy-constructor-properties":198,"../internals/global":209,"../internals/hide":212,"../internals/is-forced":219,"../internals/object-get-own-property-descriptor":228,"../internals/redefine":238,"../internals/set-global":243}],205:[function(require,module,exports){ arguments[4][92][0].apply(exports,arguments) },{"dup":92}],206:[function(require,module,exports){ 'use strict'; var hide = require('../internals/hide'); var redefine = require('../internals/redefine'); var fails = require('../internals/fails'); var wellKnownSymbol = require('../internals/well-known-symbol'); var regexpExec = require('../internals/regexp-exec'); var SPECIES = wellKnownSymbol('species'); var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () { // #replace needs built-in support for named groups. // #match works fine because it just return the exec results, even if it has // a "grops" property. var re = /./; re.exec = function () { var result = []; result.groups = { a: '7' }; return result; }; return ''.replace(re, '$') !== '7'; }); // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec // Weex JS has frozen built-in prototypes, so use try / catch wrapper var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () { var re = /(?:)/; var originalExec = re.exec; re.exec = function () { return originalExec.apply(this, arguments); }; var result = 'ab'.split(re); return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b'; }); module.exports = function (KEY, length, exec, sham) { var SYMBOL = wellKnownSymbol(KEY); var DELEGATES_TO_SYMBOL = !fails(function () { // String methods call symbol-named RegEp methods var O = {}; O[SYMBOL] = function () { return 7; }; return ''[KEY](O) != 7; }); var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () { // Symbol-named RegExp methods call .exec var execCalled = false; var re = /a/; re.exec = function () { execCalled = true; return null; }; if (KEY === 'split') { // RegExp[@@split] doesn't call the regex's exec method, but first creates // a new one. We need to return the patched regex when creating the new one. re.constructor = {}; re.constructor[SPECIES] = function () { return re; }; } re[SYMBOL](''); return !execCalled; }); if ( !DELEGATES_TO_SYMBOL || !DELEGATES_TO_EXEC || (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) || (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC) ) { var nativeRegExpMethod = /./[SYMBOL]; var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) { if (regexp.exec === regexpExec) { if (DELEGATES_TO_SYMBOL && !forceStringMethod) { // The native String method already delegates to @@method (this // polyfilled function), leasing to infinite recursion. // We avoid it by directly calling the native @@method method. return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) }; } return { done: true, value: nativeMethod.call(str, regexp, arg2) }; } return { done: false }; }); var stringMethod = methods[0]; var regexMethod = methods[1]; redefine(String.prototype, KEY, stringMethod); redefine(RegExp.prototype, SYMBOL, length == 2 // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue) // 21.2.5.11 RegExp.prototype[@@split](string, limit) ? function (string, arg) { return regexMethod.call(string, this, arg); } // 21.2.5.6 RegExp.prototype[@@match](string) // 21.2.5.9 RegExp.prototype[@@search](string) : function (string) { return regexMethod.call(string, this); } ); if (sham) hide(RegExp.prototype[SYMBOL], 'sham', true); } }; },{"../internals/fails":205,"../internals/hide":212,"../internals/redefine":238,"../internals/regexp-exec":240,"../internals/well-known-symbol":258}],207:[function(require,module,exports){ arguments[4][94][0].apply(exports,arguments) },{"../internals/shared":247,"dup":94}],208:[function(require,module,exports){ arguments[4][95][0].apply(exports,arguments) },{"../internals/global":209,"../internals/path":237,"dup":95}],209:[function(require,module,exports){ (function (global){ var O = 'object'; var check = function (it) { return it && it.Math == Math && it; }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 module.exports = // eslint-disable-next-line no-undef check(typeof globalThis == O && globalThis) || check(typeof window == O && window) || check(typeof self == O && self) || check(typeof global == O && global) || // eslint-disable-next-line no-new-func Function('return this')(); }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{}],210:[function(require,module,exports){ arguments[4][97][0].apply(exports,arguments) },{"dup":97}],211:[function(require,module,exports){ arguments[4][98][0].apply(exports,arguments) },{"dup":98}],212:[function(require,module,exports){ arguments[4][99][0].apply(exports,arguments) },{"../internals/create-property-descriptor":199,"../internals/descriptors":201,"../internals/object-define-property":227,"dup":99}],213:[function(require,module,exports){ arguments[4][100][0].apply(exports,arguments) },{"../internals/get-built-in":208,"dup":100}],214:[function(require,module,exports){ arguments[4][101][0].apply(exports,arguments) },{"../internals/descriptors":201,"../internals/document-create-element":202,"../internals/fails":205,"dup":101}],215:[function(require,module,exports){ arguments[4][102][0].apply(exports,arguments) },{"../internals/classof-raw":197,"../internals/fails":205,"dup":102}],216:[function(require,module,exports){ var isObject = require('../internals/is-object'); var setPrototypeOf = require('../internals/object-set-prototype-of'); // makes subclassing work correct for wrapped built-ins module.exports = function ($this, dummy, Wrapper) { var NewTarget, NewTargetPrototype; if ( // it can work only with native `setPrototypeOf` setPrototypeOf && // we haven't completely correct pre-ES6 way for getting `new.target`, so use this typeof (NewTarget = dummy.constructor) == 'function' && NewTarget !== Wrapper && isObject(NewTargetPrototype = NewTarget.prototype) && NewTargetPrototype !== Wrapper.prototype ) setPrototypeOf($this, NewTargetPrototype); return $this; }; },{"../internals/is-object":220,"../internals/object-set-prototype-of":235}],217:[function(require,module,exports){ arguments[4][103][0].apply(exports,arguments) },{"../internals/global":209,"../internals/has":210,"../internals/hidden-keys":211,"../internals/hide":212,"../internals/is-object":220,"../internals/native-weak-map":224,"../internals/shared-key":246,"dup":103}],218:[function(require,module,exports){ arguments[4][104][0].apply(exports,arguments) },{"../internals/classof-raw":197,"dup":104}],219:[function(require,module,exports){ arguments[4][105][0].apply(exports,arguments) },{"../internals/fails":205,"dup":105}],220:[function(require,module,exports){ arguments[4][106][0].apply(exports,arguments) },{"dup":106}],221:[function(require,module,exports){ module.exports = false; },{}],222:[function(require,module,exports){ arguments[4][108][0].apply(exports,arguments) },{"../internals/classof-raw":197,"../internals/is-object":220,"../internals/well-known-symbol":258,"dup":108}],223:[function(require,module,exports){ arguments[4][111][0].apply(exports,arguments) },{"../internals/fails":205,"dup":111}],224:[function(require,module,exports){ arguments[4][112][0].apply(exports,arguments) },{"../internals/function-to-string":207,"../internals/global":209,"dup":112}],225:[function(require,module,exports){ arguments[4][115][0].apply(exports,arguments) },{"../internals/an-object":192,"../internals/document-create-element":202,"../internals/enum-bug-keys":203,"../internals/hidden-keys":211,"../internals/html":213,"../internals/object-define-properties":226,"../internals/shared-key":246,"dup":115}],226:[function(require,module,exports){ arguments[4][116][0].apply(exports,arguments) },{"../internals/an-object":192,"../internals/descriptors":201,"../internals/object-define-property":227,"../internals/object-keys":233,"dup":116}],227:[function(require,module,exports){ arguments[4][117][0].apply(exports,arguments) },{"../internals/an-object":192,"../internals/descriptors":201,"../internals/ie8-dom-define":214,"../internals/to-primitive":256,"dup":117}],228:[function(require,module,exports){ arguments[4][118][0].apply(exports,arguments) },{"../internals/create-property-descriptor":199,"../internals/descriptors":201,"../internals/has":210,"../internals/ie8-dom-define":214,"../internals/object-property-is-enumerable":234,"../internals/to-indexed-object":252,"../internals/to-primitive":256,"dup":118}],229:[function(require,module,exports){ arguments[4][119][0].apply(exports,arguments) },{"../internals/object-get-own-property-names":230,"../internals/to-indexed-object":252,"dup":119}],230:[function(require,module,exports){ arguments[4][120][0].apply(exports,arguments) },{"../internals/enum-bug-keys":203,"../internals/object-keys-internal":232,"dup":120}],231:[function(require,module,exports){ arguments[4][121][0].apply(exports,arguments) },{"dup":121}],232:[function(require,module,exports){ arguments[4][123][0].apply(exports,arguments) },{"../internals/array-includes":193,"../internals/has":210,"../internals/hidden-keys":211,"../internals/to-indexed-object":252,"dup":123}],233:[function(require,module,exports){ arguments[4][124][0].apply(exports,arguments) },{"../internals/enum-bug-keys":203,"../internals/object-keys-internal":232,"dup":124}],234:[function(require,module,exports){ arguments[4][125][0].apply(exports,arguments) },{"dup":125}],235:[function(require,module,exports){ arguments[4][126][0].apply(exports,arguments) },{"../internals/a-possible-prototype":190,"../internals/an-object":192,"dup":126}],236:[function(require,module,exports){ arguments[4][128][0].apply(exports,arguments) },{"../internals/an-object":192,"../internals/get-built-in":208,"../internals/object-get-own-property-names":230,"../internals/object-get-own-property-symbols":231,"dup":128}],237:[function(require,module,exports){ module.exports = require('../internals/global'); },{"../internals/global":209}],238:[function(require,module,exports){ var global = require('../internals/global'); var shared = require('../internals/shared'); var hide = require('../internals/hide'); var has = require('../internals/has'); var setGlobal = require('../internals/set-global'); var nativeFunctionToString = require('../internals/function-to-string'); var InternalStateModule = require('../internals/internal-state'); var getInternalState = InternalStateModule.get; var enforceInternalState = InternalStateModule.enforce; var TEMPLATE = String(nativeFunctionToString).split('toString'); shared('inspectSource', function (it) { return nativeFunctionToString.call(it); }); (module.exports = function (O, key, value, options) { var unsafe = options ? !!options.unsafe : false; var simple = options ? !!options.enumerable : false; var noTargetGet = options ? !!options.noTargetGet : false; if (typeof value == 'function') { if (typeof key == 'string' && !has(value, 'name')) hide(value, 'name', key); enforceInternalState(value).source = TEMPLATE.join(typeof key == 'string' ? key : ''); } if (O === global) { if (simple) O[key] = value; else setGlobal(key, value); return; } else if (!unsafe) { delete O[key]; } else if (!noTargetGet && O[key]) { simple = true; } if (simple) O[key] = value; else hide(O, key, value); // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative })(Function.prototype, 'toString', function toString() { return typeof this == 'function' && getInternalState(this).source || nativeFunctionToString.call(this); }); },{"../internals/function-to-string":207,"../internals/global":209,"../internals/has":210,"../internals/hide":212,"../internals/internal-state":217,"../internals/set-global":243,"../internals/shared":247}],239:[function(require,module,exports){ var classof = require('./classof-raw'); var regexpExec = require('./regexp-exec'); // `RegExpExec` abstract operation // https://tc39.github.io/ecma262/#sec-regexpexec module.exports = function (R, S) { var exec = R.exec; if (typeof exec === 'function') { var result = exec.call(R, S); if (typeof result !== 'object') { throw TypeError('RegExp exec method returned something other than an Object or null'); } return result; } if (classof(R) !== 'RegExp') { throw TypeError('RegExp#exec called on incompatible receiver'); } return regexpExec.call(R, S); }; },{"./classof-raw":197,"./regexp-exec":240}],240:[function(require,module,exports){ 'use strict'; var regexpFlags = require('./regexp-flags'); var nativeExec = RegExp.prototype.exec; // This always refers to the native implementation, because the // String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js, // which loads this file before patching the method. var nativeReplace = String.prototype.replace; var patchedExec = nativeExec; var UPDATES_LAST_INDEX_WRONG = (function () { var re1 = /a/; var re2 = /b*/g; nativeExec.call(re1, 'a'); nativeExec.call(re2, 'a'); return re1.lastIndex !== 0 || re2.lastIndex !== 0; })(); // nonparticipating capturing group, copied from es5-shim's String#split patch. var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined; var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED; if (PATCH) { patchedExec = function exec(str) { var re = this; var lastIndex, reCopy, match, i; if (NPCG_INCLUDED) { reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re)); } if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex; match = nativeExec.call(re, str); if (UPDATES_LAST_INDEX_WRONG && match) { re.lastIndex = re.global ? match.index + match[0].length : lastIndex; } if (NPCG_INCLUDED && match && match.length > 1) { // Fix browsers whose `exec` methods don't consistently return `undefined` // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/ nativeReplace.call(match[0], reCopy, function () { for (i = 1; i < arguments.length - 2; i++) { if (arguments[i] === undefined) match[i] = undefined; } }); } return match; }; } module.exports = patchedExec; },{"./regexp-flags":241}],241:[function(require,module,exports){ 'use strict'; var anObject = require('../internals/an-object'); // `RegExp.prototype.flags` getter implementation // https://tc39.github.io/ecma262/#sec-get-regexp.prototype.flags module.exports = function () { var that = anObject(this); var result = ''; if (that.global) result += 'g'; if (that.ignoreCase) result += 'i'; if (that.multiline) result += 'm'; if (that.dotAll) result += 's'; if (that.unicode) result += 'u'; if (that.sticky) result += 'y'; return result; }; },{"../internals/an-object":192}],242:[function(require,module,exports){ arguments[4][132][0].apply(exports,arguments) },{"dup":132}],243:[function(require,module,exports){ arguments[4][133][0].apply(exports,arguments) },{"../internals/global":209,"../internals/hide":212,"dup":133}],244:[function(require,module,exports){ 'use strict'; var getBuiltIn = require('../internals/get-built-in'); var definePropertyModule = require('../internals/object-define-property'); var wellKnownSymbol = require('../internals/well-known-symbol'); var DESCRIPTORS = require('../internals/descriptors'); var SPECIES = wellKnownSymbol('species'); module.exports = function (CONSTRUCTOR_NAME) { var Constructor = getBuiltIn(CONSTRUCTOR_NAME); var defineProperty = definePropertyModule.f; if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) { defineProperty(Constructor, SPECIES, { configurable: true, get: function () { return this; } }); } }; },{"../internals/descriptors":201,"../internals/get-built-in":208,"../internals/object-define-property":227,"../internals/well-known-symbol":258}],245:[function(require,module,exports){ var defineProperty = require('../internals/object-define-property').f; var has = require('../internals/has'); var wellKnownSymbol = require('../internals/well-known-symbol'); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); module.exports = function (it, TAG, STATIC) { if (it && !has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) { defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG }); } }; },{"../internals/has":210,"../internals/object-define-property":227,"../internals/well-known-symbol":258}],246:[function(require,module,exports){ arguments[4][135][0].apply(exports,arguments) },{"../internals/shared":247,"../internals/uid":257,"dup":135}],247:[function(require,module,exports){ arguments[4][136][0].apply(exports,arguments) },{"../internals/global":209,"../internals/is-pure":221,"../internals/set-global":243,"dup":136}],248:[function(require,module,exports){ arguments[4][137][0].apply(exports,arguments) },{"../internals/fails":205,"dup":137}],249:[function(require,module,exports){ var anObject = require('../internals/an-object'); var aFunction = require('../internals/a-function'); var wellKnownSymbol = require('../internals/well-known-symbol'); var SPECIES = wellKnownSymbol('species'); // `SpeciesConstructor` abstract operation // https://tc39.github.io/ecma262/#sec-speciesconstructor module.exports = function (O, defaultConstructor) { var C = anObject(O).constructor; var S; return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? defaultConstructor : aFunction(S); }; },{"../internals/a-function":189,"../internals/an-object":192,"../internals/well-known-symbol":258}],250:[function(require,module,exports){ var toInteger = require('../internals/to-integer'); var requireObjectCoercible = require('../internals/require-object-coercible'); // `String.prototype.{ codePointAt, at }` methods implementation var createMethod = function (CONVERT_TO_STRING) { return function ($this, pos) { var S = String(requireObjectCoercible($this)); var position = toInteger(pos); var size = S.length; var first, second; if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined; first = S.charCodeAt(position); return first < 0xD800 || first > 0xDBFF || position + 1 === size || (second = S.charCodeAt(position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? S.charAt(position) : first : CONVERT_TO_STRING ? S.slice(position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000; }; }; module.exports = { // `String.prototype.codePointAt` method // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat codeAt: createMethod(false), // `String.prototype.at` method // https://github.com/mathiasbynens/String.prototype.at charAt: createMethod(true) }; },{"../internals/require-object-coercible":242,"../internals/to-integer":253}],251:[function(require,module,exports){ arguments[4][139][0].apply(exports,arguments) },{"../internals/to-integer":253,"dup":139}],252:[function(require,module,exports){ arguments[4][140][0].apply(exports,arguments) },{"../internals/indexed-object":215,"../internals/require-object-coercible":242,"dup":140}],253:[function(require,module,exports){ arguments[4][141][0].apply(exports,arguments) },{"dup":141}],254:[function(require,module,exports){ arguments[4][142][0].apply(exports,arguments) },{"../internals/to-integer":253,"dup":142}],255:[function(require,module,exports){ arguments[4][143][0].apply(exports,arguments) },{"../internals/require-object-coercible":242,"dup":143}],256:[function(require,module,exports){ arguments[4][144][0].apply(exports,arguments) },{"../internals/is-object":220,"dup":144}],257:[function(require,module,exports){ arguments[4][145][0].apply(exports,arguments) },{"dup":145}],258:[function(require,module,exports){ arguments[4][147][0].apply(exports,arguments) },{"../internals/global":209,"../internals/native-symbol":223,"../internals/shared":247,"../internals/uid":257,"dup":147}],259:[function(require,module,exports){ arguments[4][149][0].apply(exports,arguments) },{"../internals/well-known-symbol":258,"dup":149}],260:[function(require,module,exports){ 'use strict'; var $ = require('../internals/export'); var IndexedObject = require('../internals/indexed-object'); var toIndexedObject = require('../internals/to-indexed-object'); var sloppyArrayMethod = require('../internals/sloppy-array-method'); var nativeJoin = [].join; var ES3_STRINGS = IndexedObject != Object; var SLOPPY_METHOD = sloppyArrayMethod('join', ','); // `Array.prototype.join` method // https://tc39.github.io/ecma262/#sec-array.prototype.join $({ target: 'Array', proto: true, forced: ES3_STRINGS || SLOPPY_METHOD }, { join: function join(separator) { return nativeJoin.call(toIndexedObject(this), separator === undefined ? ',' : separator); } }); },{"../internals/export":204,"../internals/indexed-object":215,"../internals/sloppy-array-method":248,"../internals/to-indexed-object":252}],261:[function(require,module,exports){ var DESCRIPTORS = require('../internals/descriptors'); var defineProperty = require('../internals/object-define-property').f; var FunctionPrototype = Function.prototype; var FunctionPrototypeToString = FunctionPrototype.toString; var nameRE = /^\s*function ([^ (]*)/; var NAME = 'name'; // Function instances `.name` property // https://tc39.github.io/ecma262/#sec-function-instances-name if (DESCRIPTORS && !(NAME in FunctionPrototype)) { defineProperty(FunctionPrototype, NAME, { configurable: true, get: function () { try { return FunctionPrototypeToString.call(this).match(nameRE)[1]; } catch (error) { return ''; } } }); } },{"../internals/descriptors":201,"../internals/object-define-property":227}],262:[function(require,module,exports){ var DESCRIPTORS = require('../internals/descriptors'); var global = require('../internals/global'); var isForced = require('../internals/is-forced'); var inheritIfRequired = require('../internals/inherit-if-required'); var defineProperty = require('../internals/object-define-property').f; var getOwnPropertyNames = require('../internals/object-get-own-property-names').f; var isRegExp = require('../internals/is-regexp'); var getFlags = require('../internals/regexp-flags'); var redefine = require('../internals/redefine'); var fails = require('../internals/fails'); var setSpecies = require('../internals/set-species'); var wellKnownSymbol = require('../internals/well-known-symbol'); var MATCH = wellKnownSymbol('match'); var NativeRegExp = global.RegExp; var RegExpPrototype = NativeRegExp.prototype; var re1 = /a/g; var re2 = /a/g; // "new" should create a new object, old webkit bug var CORRECT_NEW = new NativeRegExp(re1) !== re1; var FORCED = DESCRIPTORS && isForced('RegExp', (!CORRECT_NEW || fails(function () { re2[MATCH] = false; // RegExp constructor can alter flags and IsRegExp works correct with @@match return NativeRegExp(re1) != re1 || NativeRegExp(re2) == re2 || NativeRegExp(re1, 'i') != '/a/i'; }))); // `RegExp` constructor // https://tc39.github.io/ecma262/#sec-regexp-constructor if (FORCED) { var RegExpWrapper = function RegExp(pattern, flags) { var thisIsRegExp = this instanceof RegExpWrapper; var patternIsRegExp = isRegExp(pattern); var flagsAreUndefined = flags === undefined; return !thisIsRegExp && patternIsRegExp && pattern.constructor === RegExpWrapper && flagsAreUndefined ? pattern : inheritIfRequired(CORRECT_NEW ? new NativeRegExp(patternIsRegExp && !flagsAreUndefined ? pattern.source : pattern, flags) : NativeRegExp((patternIsRegExp = pattern instanceof RegExpWrapper) ? pattern.source : pattern, patternIsRegExp && flagsAreUndefined ? getFlags.call(pattern) : flags) , thisIsRegExp ? this : RegExpPrototype, RegExpWrapper); }; var proxy = function (key) { key in RegExpWrapper || defineProperty(RegExpWrapper, key, { configurable: true, get: function () { return NativeRegExp[key]; }, set: function (it) { NativeRegExp[key] = it; } }); }; var keys = getOwnPropertyNames(NativeRegExp); var index = 0; while (keys.length > index) proxy(keys[index++]); RegExpPrototype.constructor = RegExpWrapper; RegExpWrapper.prototype = RegExpPrototype; redefine(global, 'RegExp', RegExpWrapper); } // https://tc39.github.io/ecma262/#sec-get-regexp-@@species setSpecies('RegExp'); },{"../internals/descriptors":201,"../internals/fails":205,"../internals/global":209,"../internals/inherit-if-required":216,"../internals/is-forced":219,"../internals/is-regexp":222,"../internals/object-define-property":227,"../internals/object-get-own-property-names":230,"../internals/redefine":238,"../internals/regexp-flags":241,"../internals/set-species":244,"../internals/well-known-symbol":258}],263:[function(require,module,exports){ 'use strict'; var redefine = require('../internals/redefine'); var anObject = require('../internals/an-object'); var fails = require('../internals/fails'); var flags = require('../internals/regexp-flags'); var TO_STRING = 'toString'; var RegExpPrototype = RegExp.prototype; var nativeToString = RegExpPrototype[TO_STRING]; var NOT_GENERIC = fails(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; }); // FF44- RegExp#toString has a wrong name var INCORRECT_NAME = nativeToString.name != TO_STRING; // `RegExp.prototype.toString` method // https://tc39.github.io/ecma262/#sec-regexp.prototype.tostring if (NOT_GENERIC || INCORRECT_NAME) { redefine(RegExp.prototype, TO_STRING, function toString() { var R = anObject(this); var p = String(R.source); var rf = R.flags; var f = String(rf === undefined && R instanceof RegExp && !('flags' in RegExpPrototype) ? flags.call(R) : rf); return '/' + p + '/' + f; }, { unsafe: true }); } },{"../internals/an-object":192,"../internals/fails":205,"../internals/redefine":238,"../internals/regexp-flags":241}],264:[function(require,module,exports){ 'use strict'; var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic'); var anObject = require('../internals/an-object'); var toObject = require('../internals/to-object'); var toLength = require('../internals/to-length'); var toInteger = require('../internals/to-integer'); var requireObjectCoercible = require('../internals/require-object-coercible'); var advanceStringIndex = require('../internals/advance-string-index'); var regExpExec = require('../internals/regexp-exec-abstract'); var max = Math.max; var min = Math.min; var floor = Math.floor; var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d\d?|<[^>]*>)/g; var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d\d?)/g; var maybeToString = function (it) { return it === undefined ? it : String(it); }; // @@replace logic fixRegExpWellKnownSymbolLogic('replace', 2, function (REPLACE, nativeReplace, maybeCallNative) { return [ // `String.prototype.replace` method // https://tc39.github.io/ecma262/#sec-string.prototype.replace function replace(searchValue, replaceValue) { var O = requireObjectCoercible(this); var replacer = searchValue == undefined ? undefined : searchValue[REPLACE]; return replacer !== undefined ? replacer.call(searchValue, O, replaceValue) : nativeReplace.call(String(O), searchValue, replaceValue); }, // `RegExp.prototype[@@replace]` method // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace function (regexp, replaceValue) { var res = maybeCallNative(nativeReplace, regexp, this, replaceValue); if (res.done) return res.value; var rx = anObject(regexp); var S = String(this); var functionalReplace = typeof replaceValue === 'function'; if (!functionalReplace) replaceValue = String(replaceValue); var global = rx.global; if (global) { var fullUnicode = rx.unicode; rx.lastIndex = 0; } var results = []; while (true) { var result = regExpExec(rx, S); if (result === null) break; results.push(result); if (!global) break; var matchStr = String(result[0]); if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode); } var accumulatedResult = ''; var nextSourcePosition = 0; for (var i = 0; i < results.length; i++) { result = results[i]; var matched = String(result[0]); var position = max(min(toInteger(result.index), S.length), 0); var captures = []; // NOTE: This is equivalent to // captures = result.slice(1).map(maybeToString) // but for some reason `nativeSlice.call(result, 1, result.length)` (called in // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it. for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j])); var namedCaptures = result.groups; if (functionalReplace) { var replacerArgs = [matched].concat(captures, position, S); if (namedCaptures !== undefined) replacerArgs.push(namedCaptures); var replacement = String(replaceValue.apply(undefined, replacerArgs)); } else { replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue); } if (position >= nextSourcePosition) { accumulatedResult += S.slice(nextSourcePosition, position) + replacement; nextSourcePosition = position + matched.length; } } return accumulatedResult + S.slice(nextSourcePosition); } ]; // https://tc39.github.io/ecma262/#sec-getsubstitution function getSubstitution(matched, str, position, captures, namedCaptures, replacement) { var tailPos = position + matched.length; var m = captures.length; var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED; if (namedCaptures !== undefined) { namedCaptures = toObject(namedCaptures); symbols = SUBSTITUTION_SYMBOLS; } return nativeReplace.call(replacement, symbols, function (match, ch) { var capture; switch (ch.charAt(0)) { case '$': return '$'; case '&': return matched; case '`': return str.slice(0, position); case "'": return str.slice(tailPos); case '<': capture = namedCaptures[ch.slice(1, -1)]; break; default: // \d\d? var n = +ch; if (n === 0) return match; if (n > m) { var f = floor(n / 10); if (f === 0) return match; if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1); return match; } capture = captures[n - 1]; } return capture === undefined ? '' : capture; }); } }); },{"../internals/advance-string-index":191,"../internals/an-object":192,"../internals/fix-regexp-well-known-symbol-logic":206,"../internals/regexp-exec-abstract":239,"../internals/require-object-coercible":242,"../internals/to-integer":253,"../internals/to-length":254,"../internals/to-object":255}],265:[function(require,module,exports){ 'use strict'; var fixRegExpWellKnownSymbolLogic = require('../internals/fix-regexp-well-known-symbol-logic'); var isRegExp = require('../internals/is-regexp'); var anObject = require('../internals/an-object'); var requireObjectCoercible = require('../internals/require-object-coercible'); var speciesConstructor = require('../internals/species-constructor'); var advanceStringIndex = require('../internals/advance-string-index'); var toLength = require('../internals/to-length'); var callRegExpExec = require('../internals/regexp-exec-abstract'); var regexpExec = require('../internals/regexp-exec'); var fails = require('../internals/fails'); var arrayPush = [].push; var min = Math.min; var MAX_UINT32 = 0xFFFFFFFF; // babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError var SUPPORTS_Y = !fails(function () { return !RegExp(MAX_UINT32, 'y'); }); // @@split logic fixRegExpWellKnownSymbolLogic('split', 2, function (SPLIT, nativeSplit, maybeCallNative) { var internalSplit; if ( 'abbc'.split(/(b)*/)[1] == 'c' || 'test'.split(/(?:)/, -1).length != 4 || 'ab'.split(/(?:ab)*/).length != 2 || '.'.split(/(.?)(.?)/).length != 4 || '.'.split(/()()/).length > 1 || ''.split(/.?/).length ) { // based on es5-shim implementation, need to rework it internalSplit = function (separator, limit) { var string = String(requireObjectCoercible(this)); var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; if (lim === 0) return []; if (separator === undefined) return [string]; // If `separator` is not a regex, use native split if (!isRegExp(separator)) { return nativeSplit.call(string, separator, lim); } var output = []; var flags = (separator.ignoreCase ? 'i' : '') + (separator.multiline ? 'm' : '') + (separator.unicode ? 'u' : '') + (separator.sticky ? 'y' : ''); var lastLastIndex = 0; // Make `global` and avoid `lastIndex` issues by working with a copy var separatorCopy = new RegExp(separator.source, flags + 'g'); var match, lastIndex, lastLength; while (match = regexpExec.call(separatorCopy, string)) { lastIndex = separatorCopy.lastIndex; if (lastIndex > lastLastIndex) { output.push(string.slice(lastLastIndex, match.index)); if (match.length > 1 && match.index < string.length) arrayPush.apply(output, match.slice(1)); lastLength = match[0].length; lastLastIndex = lastIndex; if (output.length >= lim) break; } if (separatorCopy.lastIndex === match.index) separatorCopy.lastIndex++; // Avoid an infinite loop } if (lastLastIndex === string.length) { if (lastLength || !separatorCopy.test('')) output.push(''); } else output.push(string.slice(lastLastIndex)); return output.length > lim ? output.slice(0, lim) : output; }; // Chakra, V8 } else if ('0'.split(undefined, 0).length) { internalSplit = function (separator, limit) { return separator === undefined && limit === 0 ? [] : nativeSplit.call(this, separator, limit); }; } else internalSplit = nativeSplit; return [ // `String.prototype.split` method // https://tc39.github.io/ecma262/#sec-string.prototype.split function split(separator, limit) { var O = requireObjectCoercible(this); var splitter = separator == undefined ? undefined : separator[SPLIT]; return splitter !== undefined ? splitter.call(separator, O, limit) : internalSplit.call(String(O), separator, limit); }, // `RegExp.prototype[@@split]` method // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split // // NOTE: This cannot be properly polyfilled in engines that don't support // the 'y' flag. function (regexp, limit) { var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== nativeSplit); if (res.done) return res.value; var rx = anObject(regexp); var S = String(this); var C = speciesConstructor(rx, RegExp); var unicodeMatching = rx.unicode; var flags = (rx.ignoreCase ? 'i' : '') + (rx.multiline ? 'm' : '') + (rx.unicode ? 'u' : '') + (SUPPORTS_Y ? 'y' : 'g'); // ^(? + rx + ) is needed, in combination with some S slicing, to // simulate the 'y' flag. var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags); var lim = limit === undefined ? MAX_UINT32 : limit >>> 0; if (lim === 0) return []; if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : []; var p = 0; var q = 0; var A = []; while (q < S.length) { splitter.lastIndex = SUPPORTS_Y ? q : 0; var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q)); var e; if ( z === null || (e = min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p ) { q = advanceStringIndex(S, q, unicodeMatching); } else { A.push(S.slice(p, q)); if (A.length === lim) return A; for (var i = 1; i <= z.length - 1; i++) { A.push(z[i]); if (A.length === lim) return A; } q = p = e; } } A.push(S.slice(p)); return A; } ]; }, !SUPPORTS_Y); },{"../internals/advance-string-index":191,"../internals/an-object":192,"../internals/fails":205,"../internals/fix-regexp-well-known-symbol-logic":206,"../internals/is-regexp":222,"../internals/regexp-exec":240,"../internals/regexp-exec-abstract":239,"../internals/require-object-coercible":242,"../internals/species-constructor":249,"../internals/to-length":254}],266:[function(require,module,exports){ // `Symbol.prototype.description` getter // https://tc39.github.io/ecma262/#sec-symbol.prototype.description 'use strict'; var $ = require('../internals/export'); var DESCRIPTORS = require('../internals/descriptors'); var global = require('../internals/global'); var has = require('../internals/has'); var isObject = require('../internals/is-object'); var defineProperty = require('../internals/object-define-property').f; var copyConstructorProperties = require('../internals/copy-constructor-properties'); var NativeSymbol = global.Symbol; if (DESCRIPTORS && typeof NativeSymbol == 'function' && (!('description' in NativeSymbol.prototype) || // Safari 12 bug NativeSymbol().description !== undefined )) { var EmptyStringDescriptionStore = {}; // wrap Symbol constructor for correct work with undefined description var SymbolWrapper = function Symbol() { var description = arguments.length < 1 || arguments[0] === undefined ? undefined : String(arguments[0]); var result = this instanceof SymbolWrapper ? new NativeSymbol(description) // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)' : description === undefined ? NativeSymbol() : NativeSymbol(description); if (description === '') EmptyStringDescriptionStore[result] = true; return result; }; copyConstructorProperties(SymbolWrapper, NativeSymbol); var symbolPrototype = SymbolWrapper.prototype = NativeSymbol.prototype; symbolPrototype.constructor = SymbolWrapper; var symbolToString = symbolPrototype.toString; var native = String(NativeSymbol('test')) == 'Symbol(test)'; var regexp = /^Symbol\((.*)\)[^)]+$/; defineProperty(symbolPrototype, 'description', { configurable: true, get: function description() { var symbol = isObject(this) ? this.valueOf() : this; var string = symbolToString.call(symbol); if (has(EmptyStringDescriptionStore, symbol)) return ''; var desc = native ? string.slice(7, -1) : string.replace(regexp, '$1'); return desc === '' ? undefined : desc; } }); $({ global: true, forced: true }, { Symbol: SymbolWrapper }); } },{"../internals/copy-constructor-properties":198,"../internals/descriptors":201,"../internals/export":204,"../internals/global":209,"../internals/has":210,"../internals/is-object":220,"../internals/object-define-property":227}],267:[function(require,module,exports){ arguments[4][167][0].apply(exports,arguments) },{"../internals/an-object":192,"../internals/array-iteration":194,"../internals/create-property-descriptor":199,"../internals/define-well-known-symbol":200,"../internals/descriptors":201,"../internals/export":204,"../internals/fails":205,"../internals/global":209,"../internals/has":210,"../internals/hidden-keys":211,"../internals/hide":212,"../internals/internal-state":217,"../internals/is-array":218,"../internals/is-object":220,"../internals/is-pure":221,"../internals/native-symbol":223,"../internals/object-create":225,"../internals/object-define-property":227,"../internals/object-get-own-property-descriptor":228,"../internals/object-get-own-property-names":230,"../internals/object-get-own-property-names-external":229,"../internals/object-get-own-property-symbols":231,"../internals/object-keys":233,"../internals/object-property-is-enumerable":234,"../internals/redefine":238,"../internals/set-to-string-tag":245,"../internals/shared":247,"../internals/shared-key":246,"../internals/to-indexed-object":252,"../internals/to-object":255,"../internals/to-primitive":256,"../internals/uid":257,"../internals/well-known-symbol":258,"../internals/wrapped-well-known-symbol":259,"dup":167}],268:[function(require,module,exports){ /** * matchesSelector v2.0.2 * matchesSelector( element, '.selector' ) * MIT license */ /*jshint browser: true, strict: true, undef: true, unused: true */ ( function( window, factory ) { /*global define: false, module: false */ 'use strict'; // universal module definition if ( typeof define == 'function' && define.amd ) { // AMD define( factory ); } else if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory(); } else { // browser global window.matchesSelector = factory(); } }( window, function factory() { 'use strict'; var matchesMethod = ( function() { var ElemProto = window.Element.prototype; // check for the standard method name first if ( ElemProto.matches ) { return 'matches'; } // check un-prefixed if ( ElemProto.matchesSelector ) { return 'matchesSelector'; } // check vendor prefixes var prefixes = [ 'webkit', 'moz', 'ms', 'o' ]; for ( var i=0; i < prefixes.length; i++ ) { var prefix = prefixes[i]; var method = prefix + 'MatchesSelector'; if ( ElemProto[ method ] ) { return method; } } })(); return function matchesSelector( elem, selector ) { return elem[ matchesMethod ]( selector ); }; })); },{}],269:[function(require,module,exports){ /** * EvEmitter v1.1.0 * Lil' event emitter * MIT License */ /* jshint unused: true, undef: true, strict: true */ ( function( global, factory ) { // universal module definition /* jshint strict: false */ /* globals define, module, window */ if ( typeof define == 'function' && define.amd ) { // AMD - RequireJS define( factory ); } else if ( typeof module == 'object' && module.exports ) { // CommonJS - Browserify, Webpack module.exports = factory(); } else { // Browser globals global.EvEmitter = factory(); } }( typeof window != 'undefined' ? window : this, function() { "use strict"; function EvEmitter() {} var proto = EvEmitter.prototype; proto.on = function( eventName, listener ) { if ( !eventName || !listener ) { return; } // set events hash var events = this._events = this._events || {}; // set listeners array var listeners = events[ eventName ] = events[ eventName ] || []; // only add once if ( listeners.indexOf( listener ) == -1 ) { listeners.push( listener ); } return this; }; proto.once = function( eventName, listener ) { if ( !eventName || !listener ) { return; } // add event this.on( eventName, listener ); // set once flag // set onceEvents hash var onceEvents = this._onceEvents = this._onceEvents || {}; // set onceListeners object var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {}; // set flag onceListeners[ listener ] = true; return this; }; proto.off = function( eventName, listener ) { var listeners = this._events && this._events[ eventName ]; if ( !listeners || !listeners.length ) { return; } var index = listeners.indexOf( listener ); if ( index != -1 ) { listeners.splice( index, 1 ); } return this; }; proto.emitEvent = function( eventName, args ) { var listeners = this._events && this._events[ eventName ]; if ( !listeners || !listeners.length ) { return; } // copy over to avoid interference if .off() in listener listeners = listeners.slice(0); args = args || []; // once stuff var onceListeners = this._onceEvents && this._onceEvents[ eventName ]; for ( var i=0; i < listeners.length; i++ ) { var listener = listeners[i] var isOnce = onceListeners && onceListeners[ listener ]; if ( isOnce ) { // remove listener // remove before trigger to prevent recursion this.off( eventName, listener ); // unset once flag delete onceListeners[ listener ]; } // trigger listener listener.apply( this, args ); } return this; }; proto.allOff = function() { delete this._events; delete this._onceEvents; }; return EvEmitter; })); },{}],270:[function(require,module,exports){ /** * Fizzy UI utils v2.0.7 * MIT license */ /*jshint browser: true, undef: true, unused: true, strict: true */ ( function( window, factory ) { // universal module definition /*jshint strict: false */ /*globals define, module, require */ if ( typeof define == 'function' && define.amd ) { // AMD define( [ 'desandro-matches-selector/matches-selector' ], function( matchesSelector ) { return factory( window, matchesSelector ); }); } else if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory( window, require('desandro-matches-selector') ); } else { // browser global window.fizzyUIUtils = factory( window, window.matchesSelector ); } }( window, function factory( window, matchesSelector ) { 'use strict'; var utils = {}; // ----- extend ----- // // extends objects utils.extend = function( a, b ) { for ( var prop in b ) { a[ prop ] = b[ prop ]; } return a; }; // ----- modulo ----- // utils.modulo = function( num, div ) { return ( ( num % div ) + div ) % div; }; // ----- makeArray ----- // var arraySlice = Array.prototype.slice; // turn element or nodeList into an array utils.makeArray = function( obj ) { if ( Array.isArray( obj ) ) { // use object if already an array return obj; } // return empty array if undefined or null. #6 if ( obj === null || obj === undefined ) { return []; } var isArrayLike = typeof obj == 'object' && typeof obj.length == 'number'; if ( isArrayLike ) { // convert nodeList to array return arraySlice.call( obj ); } // array of single index return [ obj ]; }; // ----- removeFrom ----- // utils.removeFrom = function( ary, obj ) { var index = ary.indexOf( obj ); if ( index != -1 ) { ary.splice( index, 1 ); } }; // ----- getParent ----- // utils.getParent = function( elem, selector ) { while ( elem.parentNode && elem != document.body ) { elem = elem.parentNode; if ( matchesSelector( elem, selector ) ) { return elem; } } }; // ----- getQueryElement ----- // // use element as selector string utils.getQueryElement = function( elem ) { if ( typeof elem == 'string' ) { return document.querySelector( elem ); } return elem; }; // ----- handleEvent ----- // // enable .ontype to trigger from .addEventListener( elem, 'type' ) utils.handleEvent = function( event ) { var method = 'on' + event.type; if ( this[ method ] ) { this[ method ]( event ); } }; // ----- filterFindElements ----- // utils.filterFindElements = function( elems, selector ) { // make array of elems elems = utils.makeArray( elems ); var ffElems = []; elems.forEach( function( elem ) { // check that elem is an actual element if ( !( elem instanceof HTMLElement ) ) { return; } // add elem if no selector if ( !selector ) { ffElems.push( elem ); return; } // filter & find items if we have a selector // filter if ( matchesSelector( elem, selector ) ) { ffElems.push( elem ); } // find children var childElems = elem.querySelectorAll( selector ); // concat childElems to filterFound array for ( var i=0; i < childElems.length; i++ ) { ffElems.push( childElems[i] ); } }); return ffElems; }; // ----- debounceMethod ----- // utils.debounceMethod = function( _class, methodName, threshold ) { threshold = threshold || 100; // original method var method = _class.prototype[ methodName ]; var timeoutName = methodName + 'Timeout'; _class.prototype[ methodName ] = function() { var timeout = this[ timeoutName ]; clearTimeout( timeout ); var args = arguments; var _this = this; this[ timeoutName ] = setTimeout( function() { method.apply( _this, args ); delete _this[ timeoutName ]; }, threshold ); }; }; // ----- docReady ----- // utils.docReady = function( callback ) { var readyState = document.readyState; if ( readyState == 'complete' || readyState == 'interactive' ) { // do async to allow for other scripts to run. metafizzy/flickity#441 setTimeout( callback ); } else { document.addEventListener( 'DOMContentLoaded', callback ); } }; // ----- htmlInit ----- // // http://jamesroberts.name/blog/2010/02/22/string-functions-for-javascript-trim-to-camel-case-to-dashed-and-to-underscore/ utils.toDashed = function( str ) { return str.replace( /(.)([A-Z])/g, function( match, $1, $2 ) { return $1 + '-' + $2; }).toLowerCase(); }; var console = window.console; /** * allow user to initialize classes via [data-namespace] or .js-namespace class * htmlInit( Widget, 'widgetName' ) * options are parsed from data-namespace-options */ utils.htmlInit = function( WidgetClass, namespace ) { utils.docReady( function() { var dashedNamespace = utils.toDashed( namespace ); var dataAttr = 'data-' + dashedNamespace; var dataAttrElems = document.querySelectorAll( '[' + dataAttr + ']' ); var jsDashElems = document.querySelectorAll( '.js-' + dashedNamespace ); var elems = utils.makeArray( dataAttrElems ) .concat( utils.makeArray( jsDashElems ) ); var dataOptionsAttr = dataAttr + '-options'; var jQuery = window.jQuery; elems.forEach( function( elem ) { var attr = elem.getAttribute( dataAttr ) || elem.getAttribute( dataOptionsAttr ); var options; try { options = attr && JSON.parse( attr ); } catch ( error ) { // log error, do not initialize if ( console ) { console.error( 'Error parsing ' + dataAttr + ' on ' + elem.className + ': ' + error ); } return; } // initialize var instance = new WidgetClass( elem, options ); // make available via $().data('namespace') if ( jQuery ) { jQuery.data( elem, namespace, instance ); } }); }); }; // ----- ----- // return utils; })); },{"desandro-matches-selector":268}],271:[function(require,module,exports){ // add, remove cell ( function( window, factory ) { // universal module definition /* jshint strict: false */ if ( typeof define == 'function' && define.amd ) { // AMD define( [ './flickity', 'fizzy-ui-utils/utils' ], function( Flickity, utils ) { return factory( window, Flickity, utils ); }); } else if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory( window, require('./flickity'), require('fizzy-ui-utils') ); } else { // browser global factory( window, window.Flickity, window.fizzyUIUtils ); } }( window, function factory( window, Flickity, utils ) { 'use strict'; // append cells to a document fragment function getCellsFragment( cells ) { var fragment = document.createDocumentFragment(); cells.forEach( function( cell ) { fragment.appendChild( cell.element ); }); return fragment; } // -------------------------- add/remove cell prototype -------------------------- // var proto = Flickity.prototype; /** * Insert, prepend, or append cells * @param {Element, Array, NodeList} elems * @param {Integer} index */ proto.insert = function( elems, index ) { var cells = this._makeCells( elems ); if ( !cells || !cells.length ) { return; } var len = this.cells.length; // default to append index = index === undefined ? len : index; // add cells with document fragment var fragment = getCellsFragment( cells ); // append to slider var isAppend = index == len; if ( isAppend ) { this.slider.appendChild( fragment ); } else { var insertCellElement = this.cells[ index ].element; this.slider.insertBefore( fragment, insertCellElement ); } // add to this.cells if ( index === 0 ) { // prepend, add to start this.cells = cells.concat( this.cells ); } else if ( isAppend ) { // append, add to end this.cells = this.cells.concat( cells ); } else { // insert in this.cells var endCells = this.cells.splice( index, len - index ); this.cells = this.cells.concat( cells ).concat( endCells ); } this._sizeCells( cells ); this.cellChange( index, true ); }; proto.append = function( elems ) { this.insert( elems, this.cells.length ); }; proto.prepend = function( elems ) { this.insert( elems, 0 ); }; /** * Remove cells * @param {Element, Array, NodeList} elems */ proto.remove = function( elems ) { var cells = this.getCells( elems ); if ( !cells || !cells.length ) { return; } var minCellIndex = this.cells.length - 1; // remove cells from collection & DOM cells.forEach( function( cell ) { cell.remove(); var index = this.cells.indexOf( cell ); minCellIndex = Math.min( index, minCellIndex ); utils.removeFrom( this.cells, cell ); }, this ); this.cellChange( minCellIndex, true ); }; /** * logic to be run after a cell's size changes * @param {Element} elem - cell's element */ proto.cellSizeChange = function( elem ) { var cell = this.getCell( elem ); if ( !cell ) { return; } cell.getSize(); var index = this.cells.indexOf( cell ); this.cellChange( index ); }; /** * logic any time a cell is changed: added, removed, or size changed * @param {Integer} changedCellIndex - index of the changed cell, optional */ proto.cellChange = function( changedCellIndex, isPositioningSlider ) { var prevSelectedElem = this.selectedElement; this._positionCells( changedCellIndex ); this._getWrapShiftCells(); this.setGallerySize(); // update selectedIndex // try to maintain position & select previous selected element var cell = this.getCell( prevSelectedElem ); if ( cell ) { this.selectedIndex = this.getCellSlideIndex( cell ); } this.selectedIndex = Math.min( this.slides.length - 1, this.selectedIndex ); this.emitEvent( 'cellChange', [ changedCellIndex ] ); // position slider this.select( this.selectedIndex ); // do not position slider after lazy load if ( isPositioningSlider ) { this.positionSliderAtSelected(); } }; // ----- ----- // return Flickity; })); },{"./flickity":275,"fizzy-ui-utils":270}],272:[function(require,module,exports){ // animate ( function( window, factory ) { // universal module definition /* jshint strict: false */ if ( typeof define == 'function' && define.amd ) { // AMD define( [ 'fizzy-ui-utils/utils' ], function( utils ) { return factory( window, utils ); }); } else if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory( window, require('fizzy-ui-utils') ); } else { // browser global window.Flickity = window.Flickity || {}; window.Flickity.animatePrototype = factory( window, window.fizzyUIUtils ); } }( window, function factory( window, utils ) { 'use strict'; // -------------------------- animate -------------------------- // var proto = {}; proto.startAnimation = function() { if ( this.isAnimating ) { return; } this.isAnimating = true; this.restingFrames = 0; this.animate(); }; proto.animate = function() { this.applyDragForce(); this.applySelectedAttraction(); var previousX = this.x; this.integratePhysics(); this.positionSlider(); this.settle( previousX ); // animate next frame if ( this.isAnimating ) { var _this = this; requestAnimationFrame( function animateFrame() { _this.animate(); }); } }; proto.positionSlider = function() { var x = this.x; // wrap position around if ( this.options.wrapAround && this.cells.length > 1 ) { x = utils.modulo( x, this.slideableWidth ); x = x - this.slideableWidth; this.shiftWrapCells( x ); } this.setTranslateX( x, this.isAnimating ); this.dispatchScrollEvent(); }; proto.setTranslateX = function( x, is3d ) { x += this.cursorPosition; // reverse if right-to-left and using transform x = this.options.rightToLeft ? -x : x; var translateX = this.getPositionValue( x ); // use 3D tranforms for hardware acceleration on iOS // but use 2D when settled, for better font-rendering this.slider.style.transform = is3d ? 'translate3d(' + translateX + ',0,0)' : 'translateX(' + translateX + ')'; }; proto.dispatchScrollEvent = function() { var firstSlide = this.slides[0]; if ( !firstSlide ) { return; } var positionX = -this.x - firstSlide.target; var progress = positionX / this.slidesWidth; this.dispatchEvent( 'scroll', null, [ progress, positionX ] ); }; proto.positionSliderAtSelected = function() { if ( !this.cells.length ) { return; } this.x = -this.selectedSlide.target; this.velocity = 0; // stop wobble this.positionSlider(); }; proto.getPositionValue = function( position ) { if ( this.options.percentPosition ) { // percent position, round to 2 digits, like 12.34% return ( Math.round( ( position / this.size.innerWidth ) * 10000 ) * 0.01 )+ '%'; } else { // pixel positioning return Math.round( position ) + 'px'; } }; proto.settle = function( previousX ) { // keep track of frames where x hasn't moved if ( !this.isPointerDown && Math.round( this.x * 100 ) == Math.round( previousX * 100 ) ) { this.restingFrames++; } // stop animating if resting for 3 or more frames if ( this.restingFrames > 2 ) { this.isAnimating = false; delete this.isFreeScrolling; // render position with translateX when settled this.positionSlider(); this.dispatchEvent( 'settle', null, [ this.selectedIndex ] ); } }; proto.shiftWrapCells = function( x ) { // shift before cells var beforeGap = this.cursorPosition + x; this._shiftCells( this.beforeShiftCells, beforeGap, -1 ); // shift after cells var afterGap = this.size.innerWidth - ( x + this.slideableWidth + this.cursorPosition ); this._shiftCells( this.afterShiftCells, afterGap, 1 ); }; proto._shiftCells = function( cells, gap, shift ) { for ( var i=0; i < cells.length; i++ ) { var cell = cells[i]; var cellShift = gap > 0 ? shift : 0; cell.wrapShift( cellShift ); gap -= cell.size.outerWidth; } }; proto._unshiftCells = function( cells ) { if ( !cells || !cells.length ) { return; } for ( var i=0; i < cells.length; i++ ) { cells[i].wrapShift( 0 ); } }; // -------------------------- physics -------------------------- // proto.integratePhysics = function() { this.x += this.velocity; this.velocity *= this.getFrictionFactor(); }; proto.applyForce = function( force ) { this.velocity += force; }; proto.getFrictionFactor = function() { return 1 - this.options[ this.isFreeScrolling ? 'freeScrollFriction' : 'friction' ]; }; proto.getRestingPosition = function() { // my thanks to Steven Wittens, who simplified this math greatly return this.x + this.velocity / ( 1 - this.getFrictionFactor() ); }; proto.applyDragForce = function() { if ( !this.isDraggable || !this.isPointerDown ) { return; } // change the position to drag position by applying force var dragVelocity = this.dragX - this.x; var dragForce = dragVelocity - this.velocity; this.applyForce( dragForce ); }; proto.applySelectedAttraction = function() { // do not attract if pointer down or no slides var dragDown = this.isDraggable && this.isPointerDown; if ( dragDown || this.isFreeScrolling || !this.slides.length ) { return; } var distance = this.selectedSlide.target * -1 - this.x; var force = distance * this.options.selectedAttraction; this.applyForce( force ); }; return proto; })); },{"fizzy-ui-utils":270}],273:[function(require,module,exports){ // Flickity.Cell ( function( window, factory ) { // universal module definition /* jshint strict: false */ if ( typeof define == 'function' && define.amd ) { // AMD define( [ 'get-size/get-size' ], function( getSize ) { return factory( window, getSize ); }); } else if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory( window, require('get-size') ); } else { // browser global window.Flickity = window.Flickity || {}; window.Flickity.Cell = factory( window, window.getSize ); } }( window, function factory( window, getSize ) { 'use strict'; function Cell( elem, parent ) { this.element = elem; this.parent = parent; this.create(); } var proto = Cell.prototype; proto.create = function() { this.element.style.position = 'absolute'; this.element.setAttribute( 'aria-hidden', 'true' ); this.x = 0; this.shift = 0; }; proto.destroy = function() { // reset style this.unselect(); this.element.style.position = ''; var side = this.parent.originSide; this.element.style[ side ] = ''; }; proto.getSize = function() { this.size = getSize( this.element ); }; proto.setPosition = function( x ) { this.x = x; this.updateTarget(); this.renderPosition( x ); }; // setDefaultTarget v1 method, backwards compatibility, remove in v3 proto.updateTarget = proto.setDefaultTarget = function() { var marginProperty = this.parent.originSide == 'left' ? 'marginLeft' : 'marginRight'; this.target = this.x + this.size[ marginProperty ] + this.size.width * this.parent.cellAlign; }; proto.renderPosition = function( x ) { // render position of cell with in slider var side = this.parent.originSide; this.element.style[ side ] = this.parent.getPositionValue( x ); }; proto.select = function() { this.element.classList.add('is-selected'); this.element.removeAttribute('aria-hidden'); }; proto.unselect = function() { this.element.classList.remove('is-selected'); this.element.setAttribute( 'aria-hidden', 'true' ); }; /** * @param {Integer} factor - 0, 1, or -1 **/ proto.wrapShift = function( shift ) { this.shift = shift; this.renderPosition( this.x + this.parent.slideableWidth * shift ); }; proto.remove = function() { this.element.parentNode.removeChild( this.element ); }; return Cell; })); },{"get-size":282}],274:[function(require,module,exports){ // drag ( function( window, factory ) { // universal module definition /* jshint strict: false */ if ( typeof define == 'function' && define.amd ) { // AMD define( [ './flickity', 'unidragger/unidragger', 'fizzy-ui-utils/utils' ], function( Flickity, Unidragger, utils ) { return factory( window, Flickity, Unidragger, utils ); }); } else if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory( window, require('./flickity'), require('unidragger'), require('fizzy-ui-utils') ); } else { // browser global window.Flickity = factory( window, window.Flickity, window.Unidragger, window.fizzyUIUtils ); } }( window, function factory( window, Flickity, Unidragger, utils ) { 'use strict'; // ----- defaults ----- // utils.extend( Flickity.defaults, { draggable: '>1', dragThreshold: 3, }); // ----- create ----- // Flickity.createMethods.push('_createDrag'); // -------------------------- drag prototype -------------------------- // var proto = Flickity.prototype; utils.extend( proto, Unidragger.prototype ); proto._touchActionValue = 'pan-y'; // -------------------------- -------------------------- // var isTouch = 'createTouch' in document; var isTouchmoveScrollCanceled = false; proto._createDrag = function() { this.on( 'activate', this.onActivateDrag ); this.on( 'uiChange', this._uiChangeDrag ); this.on( 'deactivate', this.onDeactivateDrag ); this.on( 'cellChange', this.updateDraggable ); // TODO updateDraggable on resize? if groupCells & slides change // HACK - add seemingly innocuous handler to fix iOS 10 scroll behavior // #457, RubaXa/Sortable#973 if ( isTouch && !isTouchmoveScrollCanceled ) { window.addEventListener( 'touchmove', function() {}); isTouchmoveScrollCanceled = true; } }; proto.onActivateDrag = function() { this.handles = [ this.viewport ]; this.bindHandles(); this.updateDraggable(); }; proto.onDeactivateDrag = function() { this.unbindHandles(); this.element.classList.remove('is-draggable'); }; proto.updateDraggable = function() { // disable dragging if less than 2 slides. #278 if ( this.options.draggable == '>1' ) { this.isDraggable = this.slides.length > 1; } else { this.isDraggable = this.options.draggable; } if ( this.isDraggable ) { this.element.classList.add('is-draggable'); } else { this.element.classList.remove('is-draggable'); } }; // backwards compatibility proto.bindDrag = function() { this.options.draggable = true; this.updateDraggable(); }; proto.unbindDrag = function() { this.options.draggable = false; this.updateDraggable(); }; proto._uiChangeDrag = function() { delete this.isFreeScrolling; }; // -------------------------- pointer events -------------------------- // proto.pointerDown = function( event, pointer ) { if ( !this.isDraggable ) { this._pointerDownDefault( event, pointer ); return; } var isOkay = this.okayPointerDown( event ); if ( !isOkay ) { return; } this._pointerDownPreventDefault( event ); this.pointerDownFocus( event ); // blur if ( document.activeElement != this.element ) { // do not blur if already focused this.pointerDownBlur(); } // stop if it was moving this.dragX = this.x; this.viewport.classList.add('is-pointer-down'); // track scrolling this.pointerDownScroll = getScrollPosition(); window.addEventListener( 'scroll', this ); this._pointerDownDefault( event, pointer ); }; // default pointerDown logic, used for staticClick proto._pointerDownDefault = function( event, pointer ) { // track start event position // Safari 9 overrides pageX and pageY. These values needs to be copied. #779 this.pointerDownPointer = { pageX: pointer.pageX, pageY: pointer.pageY, }; // bind move and end events this._bindPostStartEvents( event ); this.dispatchEvent( 'pointerDown', event, [ pointer ] ); }; var focusNodes = { INPUT: true, TEXTAREA: true, SELECT: true, }; proto.pointerDownFocus = function( event ) { var isFocusNode = focusNodes[ event.target.nodeName ]; if ( !isFocusNode ) { this.focus(); } }; proto._pointerDownPreventDefault = function( event ) { var isTouchStart = event.type == 'touchstart'; var isTouchPointer = event.pointerType == 'touch'; var isFocusNode = focusNodes[ event.target.nodeName ]; if ( !isTouchStart && !isTouchPointer && !isFocusNode ) { event.preventDefault(); } }; // ----- move ----- // proto.hasDragStarted = function( moveVector ) { return Math.abs( moveVector.x ) > this.options.dragThreshold; }; // ----- up ----- // proto.pointerUp = function( event, pointer ) { delete this.isTouchScrolling; this.viewport.classList.remove('is-pointer-down'); this.dispatchEvent( 'pointerUp', event, [ pointer ] ); this._dragPointerUp( event, pointer ); }; proto.pointerDone = function() { window.removeEventListener( 'scroll', this ); delete this.pointerDownScroll; }; // -------------------------- dragging -------------------------- // proto.dragStart = function( event, pointer ) { if ( !this.isDraggable ) { return; } this.dragStartPosition = this.x; this.startAnimation(); window.removeEventListener( 'scroll', this ); this.dispatchEvent( 'dragStart', event, [ pointer ] ); }; proto.pointerMove = function( event, pointer ) { var moveVector = this._dragPointerMove( event, pointer ); this.dispatchEvent( 'pointerMove', event, [ pointer, moveVector ] ); this._dragMove( event, pointer, moveVector ); }; proto.dragMove = function( event, pointer, moveVector ) { if ( !this.isDraggable ) { return; } event.preventDefault(); this.previousDragX = this.dragX; // reverse if right-to-left var direction = this.options.rightToLeft ? -1 : 1; if ( this.options.wrapAround ) { // wrap around move. #589 moveVector.x = moveVector.x % this.slideableWidth; } var dragX = this.dragStartPosition + moveVector.x * direction; if ( !this.options.wrapAround && this.slides.length ) { // slow drag var originBound = Math.max( -this.slides[0].target, this.dragStartPosition ); dragX = dragX > originBound ? ( dragX + originBound ) * 0.5 : dragX; var endBound = Math.min( -this.getLastSlide().target, this.dragStartPosition ); dragX = dragX < endBound ? ( dragX + endBound ) * 0.5 : dragX; } this.dragX = dragX; this.dragMoveTime = new Date(); this.dispatchEvent( 'dragMove', event, [ pointer, moveVector ] ); }; proto.dragEnd = function( event, pointer ) { if ( !this.isDraggable ) { return; } if ( this.options.freeScroll ) { this.isFreeScrolling = true; } // set selectedIndex based on where flick will end up var index = this.dragEndRestingSelect(); if ( this.options.freeScroll && !this.options.wrapAround ) { // if free-scroll & not wrap around // do not free-scroll if going outside of bounding slides // so bounding slides can attract slider, and keep it in bounds var restingX = this.getRestingPosition(); this.isFreeScrolling = -restingX > this.slides[0].target && -restingX < this.getLastSlide().target; } else if ( !this.options.freeScroll && index == this.selectedIndex ) { // boost selection if selected index has not changed index += this.dragEndBoostSelect(); } delete this.previousDragX; // apply selection // TODO refactor this, selecting here feels weird // HACK, set flag so dragging stays in correct direction this.isDragSelect = this.options.wrapAround; this.select( index ); delete this.isDragSelect; this.dispatchEvent( 'dragEnd', event, [ pointer ] ); }; proto.dragEndRestingSelect = function() { var restingX = this.getRestingPosition(); // how far away from selected slide var distance = Math.abs( this.getSlideDistance( -restingX, this.selectedIndex ) ); // get closet resting going up and going down var positiveResting = this._getClosestResting( restingX, distance, 1 ); var negativeResting = this._getClosestResting( restingX, distance, -1 ); // use closer resting for wrap-around var index = positiveResting.distance < negativeResting.distance ? positiveResting.index : negativeResting.index; return index; }; /** * given resting X and distance to selected cell * get the distance and index of the closest cell * @param {Number} restingX - estimated post-flick resting position * @param {Number} distance - distance to selected cell * @param {Integer} increment - +1 or -1, going up or down * @returns {Object} - { distance: {Number}, index: {Integer} } */ proto._getClosestResting = function( restingX, distance, increment ) { var index = this.selectedIndex; var minDistance = Infinity; var condition = this.options.contain && !this.options.wrapAround ? // if contain, keep going if distance is equal to minDistance function( d, md ) { return d <= md; } : function( d, md ) { return d < md; }; while ( condition( distance, minDistance ) ) { // measure distance to next cell index += increment; minDistance = distance; distance = this.getSlideDistance( -restingX, index ); if ( distance === null ) { break; } distance = Math.abs( distance ); } return { distance: minDistance, // selected was previous index index: index - increment }; }; /** * measure distance between x and a slide target * @param {Number} x * @param {Integer} index - slide index */ proto.getSlideDistance = function( x, index ) { var len = this.slides.length; // wrap around if at least 2 slides var isWrapAround = this.options.wrapAround && len > 1; var slideIndex = isWrapAround ? utils.modulo( index, len ) : index; var slide = this.slides[ slideIndex ]; if ( !slide ) { return null; } // add distance for wrap-around slides var wrap = isWrapAround ? this.slideableWidth * Math.floor( index / len ) : 0; return x - ( slide.target + wrap ); }; proto.dragEndBoostSelect = function() { // do not boost if no previousDragX or dragMoveTime if ( this.previousDragX === undefined || !this.dragMoveTime || // or if drag was held for 100 ms new Date() - this.dragMoveTime > 100 ) { return 0; } var distance = this.getSlideDistance( -this.dragX, this.selectedIndex ); var delta = this.previousDragX - this.dragX; if ( distance > 0 && delta > 0 ) { // boost to next if moving towards the right, and positive velocity return 1; } else if ( distance < 0 && delta < 0 ) { // boost to previous if moving towards the left, and negative velocity return -1; } return 0; }; // ----- staticClick ----- // proto.staticClick = function( event, pointer ) { // get clickedCell, if cell was clicked var clickedCell = this.getParentCell( event.target ); var cellElem = clickedCell && clickedCell.element; var cellIndex = clickedCell && this.cells.indexOf( clickedCell ); this.dispatchEvent( 'staticClick', event, [ pointer, cellElem, cellIndex ] ); }; // ----- scroll ----- // proto.onscroll = function() { var scroll = getScrollPosition(); var scrollMoveX = this.pointerDownScroll.x - scroll.x; var scrollMoveY = this.pointerDownScroll.y - scroll.y; // cancel click/tap if scroll is too much if ( Math.abs( scrollMoveX ) > 3 || Math.abs( scrollMoveY ) > 3 ) { this._pointerDone(); } }; // ----- utils ----- // function getScrollPosition() { return { x: window.pageXOffset, y: window.pageYOffset }; } // ----- ----- // return Flickity; })); },{"./flickity":275,"fizzy-ui-utils":270,"unidragger":283}],275:[function(require,module,exports){ // Flickity main ( function( window, factory ) { // universal module definition /* jshint strict: false */ if ( typeof define == 'function' && define.amd ) { // AMD define( [ 'ev-emitter/ev-emitter', 'get-size/get-size', 'fizzy-ui-utils/utils', './cell', './slide', './animate' ], function( EvEmitter, getSize, utils, Cell, Slide, animatePrototype ) { return factory( window, EvEmitter, getSize, utils, Cell, Slide, animatePrototype ); }); } else if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory( window, require('ev-emitter'), require('get-size'), require('fizzy-ui-utils'), require('./cell'), require('./slide'), require('./animate') ); } else { // browser global var _Flickity = window.Flickity; window.Flickity = factory( window, window.EvEmitter, window.getSize, window.fizzyUIUtils, _Flickity.Cell, _Flickity.Slide, _Flickity.animatePrototype ); } }( window, function factory( window, EvEmitter, getSize, utils, Cell, Slide, animatePrototype ) { 'use strict'; // vars var jQuery = window.jQuery; var getComputedStyle = window.getComputedStyle; var console = window.console; function moveElements( elems, toElem ) { elems = utils.makeArray( elems ); while ( elems.length ) { toElem.appendChild( elems.shift() ); } } // -------------------------- Flickity -------------------------- // // globally unique identifiers var GUID = 0; // internal store of all Flickity intances var instances = {}; function Flickity( element, options ) { var queryElement = utils.getQueryElement( element ); if ( !queryElement ) { if ( console ) { console.error( 'Bad element for Flickity: ' + ( queryElement || element ) ); } return; } this.element = queryElement; // do not initialize twice on same element if ( this.element.flickityGUID ) { var instance = instances[ this.element.flickityGUID ]; instance.option( options ); return instance; } // add jQuery if ( jQuery ) { this.$element = jQuery( this.element ); } // options this.options = utils.extend( {}, this.constructor.defaults ); this.option( options ); // kick things off this._create(); } Flickity.defaults = { accessibility: true, // adaptiveHeight: false, cellAlign: 'center', // cellSelector: undefined, // contain: false, freeScrollFriction: 0.075, // friction when free-scrolling friction: 0.28, // friction when selecting namespaceJQueryEvents: true, // initialIndex: 0, percentPosition: true, resize: true, selectedAttraction: 0.025, setGallerySize: true // watchCSS: false, // wrapAround: false }; // hash of methods triggered on _create() Flickity.createMethods = []; var proto = Flickity.prototype; // inherit EventEmitter utils.extend( proto, EvEmitter.prototype ); proto._create = function() { // add id for Flickity.data var id = this.guid = ++GUID; this.element.flickityGUID = id; // expando instances[ id ] = this; // associate via id // initial properties this.selectedIndex = 0; // how many frames slider has been in same position this.restingFrames = 0; // initial physics properties this.x = 0; this.velocity = 0; this.originSide = this.options.rightToLeft ? 'right' : 'left'; // create viewport & slider this.viewport = document.createElement('div'); this.viewport.className = 'flickity-viewport'; this._createSlider(); if ( this.options.resize || this.options.watchCSS ) { window.addEventListener( 'resize', this ); } // add listeners from on option for ( var eventName in this.options.on ) { var listener = this.options.on[ eventName ]; this.on( eventName, listener ); } Flickity.createMethods.forEach( function( method ) { this[ method ](); }, this ); if ( this.options.watchCSS ) { this.watchCSS(); } else { this.activate(); } }; /** * set options * @param {Object} opts */ proto.option = function( opts ) { utils.extend( this.options, opts ); }; proto.activate = function() { if ( this.isActive ) { return; } this.isActive = true; this.element.classList.add('flickity-enabled'); if ( this.options.rightToLeft ) { this.element.classList.add('flickity-rtl'); } this.getSize(); // move initial cell elements so they can be loaded as cells var cellElems = this._filterFindCellElements( this.element.children ); moveElements( cellElems, this.slider ); this.viewport.appendChild( this.slider ); this.element.appendChild( this.viewport ); // get cells from children this.reloadCells(); if ( this.options.accessibility ) { // allow element to focusable this.element.tabIndex = 0; // listen for key presses this.element.addEventListener( 'keydown', this ); } this.emitEvent('activate'); this.selectInitialIndex(); // flag for initial activation, for using initialIndex this.isInitActivated = true; // ready event. #493 this.dispatchEvent('ready'); }; // slider positions the cells proto._createSlider = function() { // slider element does all the positioning var slider = document.createElement('div'); slider.className = 'flickity-slider'; slider.style[ this.originSide ] = 0; this.slider = slider; }; proto._filterFindCellElements = function( elems ) { return utils.filterFindElements( elems, this.options.cellSelector ); }; // goes through all children proto.reloadCells = function() { // collection of item elements this.cells = this._makeCells( this.slider.children ); this.positionCells(); this._getWrapShiftCells(); this.setGallerySize(); }; /** * turn elements into Flickity.Cells * @param {Array or NodeList or HTMLElement} elems * @returns {Array} items - collection of new Flickity Cells */ proto._makeCells = function( elems ) { var cellElems = this._filterFindCellElements( elems ); // create new Flickity for collection var cells = cellElems.map( function( cellElem ) { return new Cell( cellElem, this ); }, this ); return cells; }; proto.getLastCell = function() { return this.cells[ this.cells.length - 1 ]; }; proto.getLastSlide = function() { return this.slides[ this.slides.length - 1 ]; }; // positions all cells proto.positionCells = function() { // size all cells this._sizeCells( this.cells ); // position all cells this._positionCells( 0 ); }; /** * position certain cells * @param {Integer} index - which cell to start with */ proto._positionCells = function( index ) { index = index || 0; // also measure maxCellHeight // start 0 if positioning all cells this.maxCellHeight = index ? this.maxCellHeight || 0 : 0; var cellX = 0; // get cellX if ( index > 0 ) { var startCell = this.cells[ index - 1 ]; cellX = startCell.x + startCell.size.outerWidth; } var len = this.cells.length; for ( var i=index; i < len; i++ ) { var cell = this.cells[i]; cell.setPosition( cellX ); cellX += cell.size.outerWidth; this.maxCellHeight = Math.max( cell.size.outerHeight, this.maxCellHeight ); } // keep track of cellX for wrap-around this.slideableWidth = cellX; // slides this.updateSlides(); // contain slides target this._containSlides(); // update slidesWidth this.slidesWidth = len ? this.getLastSlide().target - this.slides[0].target : 0; }; /** * cell.getSize() on multiple cells * @param {Array} cells */ proto._sizeCells = function( cells ) { cells.forEach( function( cell ) { cell.getSize(); }); }; // -------------------------- -------------------------- // proto.updateSlides = function() { this.slides = []; if ( !this.cells.length ) { return; } var slide = new Slide( this ); this.slides.push( slide ); var isOriginLeft = this.originSide == 'left'; var nextMargin = isOriginLeft ? 'marginRight' : 'marginLeft'; var canCellFit = this._getCanCellFit(); this.cells.forEach( function( cell, i ) { // just add cell if first cell in slide if ( !slide.cells.length ) { slide.addCell( cell ); return; } var slideWidth = ( slide.outerWidth - slide.firstMargin ) + ( cell.size.outerWidth - cell.size[ nextMargin ] ); if ( canCellFit.call( this, i, slideWidth ) ) { slide.addCell( cell ); } else { // doesn't fit, new slide slide.updateTarget(); slide = new Slide( this ); this.slides.push( slide ); slide.addCell( cell ); } }, this ); // last slide slide.updateTarget(); // update .selectedSlide this.updateSelectedSlide(); }; proto._getCanCellFit = function() { var groupCells = this.options.groupCells; if ( !groupCells ) { return function() { return false; }; } else if ( typeof groupCells == 'number' ) { // group by number. 3 -> [0,1,2], [3,4,5], ... var number = parseInt( groupCells, 10 ); return function( i ) { return ( i % number ) !== 0; }; } // default, group by width of slide // parse '75% var percentMatch = typeof groupCells == 'string' && groupCells.match(/^(\d+)%$/); var percent = percentMatch ? parseInt( percentMatch[1], 10 ) / 100 : 1; return function( i, slideWidth ) { return slideWidth <= ( this.size.innerWidth + 1 ) * percent; }; }; // alias _init for jQuery plugin .flickity() proto._init = proto.reposition = function() { this.positionCells(); this.positionSliderAtSelected(); }; proto.getSize = function() { this.size = getSize( this.element ); this.setCellAlign(); this.cursorPosition = this.size.innerWidth * this.cellAlign; }; var cellAlignShorthands = { // cell align, then based on origin side center: { left: 0.5, right: 0.5 }, left: { left: 0, right: 1 }, right: { right: 0, left: 1 } }; proto.setCellAlign = function() { var shorthand = cellAlignShorthands[ this.options.cellAlign ]; this.cellAlign = shorthand ? shorthand[ this.originSide ] : this.options.cellAlign; }; proto.setGallerySize = function() { if ( this.options.setGallerySize ) { var height = this.options.adaptiveHeight && this.selectedSlide ? this.selectedSlide.height : this.maxCellHeight; this.viewport.style.height = height + 'px'; } }; proto._getWrapShiftCells = function() { // only for wrap-around if ( !this.options.wrapAround ) { return; } // unshift previous cells this._unshiftCells( this.beforeShiftCells ); this._unshiftCells( this.afterShiftCells ); // get before cells // initial gap var gapX = this.cursorPosition; var cellIndex = this.cells.length - 1; this.beforeShiftCells = this._getGapCells( gapX, cellIndex, -1 ); // get after cells // ending gap between last cell and end of gallery viewport gapX = this.size.innerWidth - this.cursorPosition; // start cloning at first cell, working forwards this.afterShiftCells = this._getGapCells( gapX, 0, 1 ); }; proto._getGapCells = function( gapX, cellIndex, increment ) { // keep adding cells until the cover the initial gap var cells = []; while ( gapX > 0 ) { var cell = this.cells[ cellIndex ]; if ( !cell ) { break; } cells.push( cell ); cellIndex += increment; gapX -= cell.size.outerWidth; } return cells; }; // ----- contain ----- // // contain cell targets so no excess sliding proto._containSlides = function() { if ( !this.options.contain || this.options.wrapAround || !this.cells.length ) { return; } var isRightToLeft = this.options.rightToLeft; var beginMargin = isRightToLeft ? 'marginRight' : 'marginLeft'; var endMargin = isRightToLeft ? 'marginLeft' : 'marginRight'; var contentWidth = this.slideableWidth - this.getLastCell().size[ endMargin ]; // content is less than gallery size var isContentSmaller = contentWidth < this.size.innerWidth; // bounds var beginBound = this.cursorPosition + this.cells[0].size[ beginMargin ]; var endBound = contentWidth - this.size.innerWidth * ( 1 - this.cellAlign ); // contain each cell target this.slides.forEach( function( slide ) { if ( isContentSmaller ) { // all cells fit inside gallery slide.target = contentWidth * this.cellAlign; } else { // contain to bounds slide.target = Math.max( slide.target, beginBound ); slide.target = Math.min( slide.target, endBound ); } }, this ); }; // ----- ----- // /** * emits events via eventEmitter and jQuery events * @param {String} type - name of event * @param {Event} event - original event * @param {Array} args - extra arguments */ proto.dispatchEvent = function( type, event, args ) { var emitArgs = event ? [ event ].concat( args ) : args; this.emitEvent( type, emitArgs ); if ( jQuery && this.$element ) { // default trigger with type if no event type += this.options.namespaceJQueryEvents ? '.flickity' : ''; var $event = type; if ( event ) { // create jQuery event var jQEvent = jQuery.Event( event ); jQEvent.type = type; $event = jQEvent; } this.$element.trigger( $event, args ); } }; // -------------------------- select -------------------------- // /** * @param {Integer} index - index of the slide * @param {Boolean} isWrap - will wrap-around to last/first if at the end * @param {Boolean} isInstant - will immediately set position at selected cell */ proto.select = function( index, isWrap, isInstant ) { if ( !this.isActive ) { return; } index = parseInt( index, 10 ); this._wrapSelect( index ); if ( this.options.wrapAround || isWrap ) { index = utils.modulo( index, this.slides.length ); } // bail if invalid index if ( !this.slides[ index ] ) { return; } var prevIndex = this.selectedIndex; this.selectedIndex = index; this.updateSelectedSlide(); if ( isInstant ) { this.positionSliderAtSelected(); } else { this.startAnimation(); } if ( this.options.adaptiveHeight ) { this.setGallerySize(); } // events this.dispatchEvent( 'select', null, [ index ] ); // change event if new index if ( index != prevIndex ) { this.dispatchEvent( 'change', null, [ index ] ); } // old v1 event name, remove in v3 this.dispatchEvent('cellSelect'); }; // wraps position for wrapAround, to move to closest slide. #113 proto._wrapSelect = function( index ) { var len = this.slides.length; var isWrapping = this.options.wrapAround && len > 1; if ( !isWrapping ) { return index; } var wrapIndex = utils.modulo( index, len ); // go to shortest var delta = Math.abs( wrapIndex - this.selectedIndex ); var backWrapDelta = Math.abs( ( wrapIndex + len ) - this.selectedIndex ); var forewardWrapDelta = Math.abs( ( wrapIndex - len ) - this.selectedIndex ); if ( !this.isDragSelect && backWrapDelta < delta ) { index += len; } else if ( !this.isDragSelect && forewardWrapDelta < delta ) { index -= len; } // wrap position so slider is within normal area if ( index < 0 ) { this.x -= this.slideableWidth; } else if ( index >= len ) { this.x += this.slideableWidth; } }; proto.previous = function( isWrap, isInstant ) { this.select( this.selectedIndex - 1, isWrap, isInstant ); }; proto.next = function( isWrap, isInstant ) { this.select( this.selectedIndex + 1, isWrap, isInstant ); }; proto.updateSelectedSlide = function() { var slide = this.slides[ this.selectedIndex ]; // selectedIndex could be outside of slides, if triggered before resize() if ( !slide ) { return; } // unselect previous selected slide this.unselectSelectedSlide(); // update new selected slide this.selectedSlide = slide; slide.select(); this.selectedCells = slide.cells; this.selectedElements = slide.getCellElements(); // HACK: selectedCell & selectedElement is first cell in slide, backwards compatibility // Remove in v3? this.selectedCell = slide.cells[0]; this.selectedElement = this.selectedElements[0]; }; proto.unselectSelectedSlide = function() { if ( this.selectedSlide ) { this.selectedSlide.unselect(); } }; proto.selectInitialIndex = function() { var initialIndex = this.options.initialIndex; // already activated, select previous selectedIndex if ( this.isInitActivated ) { this.select( this.selectedIndex, false, true ); return; } // select with selector string if ( initialIndex && typeof initialIndex == 'string' ) { var cell = this.queryCell( initialIndex ); if ( cell ) { this.selectCell( initialIndex, false, true ); return; } } var index = 0; // select with number if ( initialIndex && this.slides[ initialIndex ] ) { index = initialIndex; } // select instantly this.select( index, false, true ); }; /** * select slide from number or cell element * @param {Element or Number} elem */ proto.selectCell = function( value, isWrap, isInstant ) { // get cell var cell = this.queryCell( value ); if ( !cell ) { return; } var index = this.getCellSlideIndex( cell ); this.select( index, isWrap, isInstant ); }; proto.getCellSlideIndex = function( cell ) { // get index of slides that has cell for ( var i=0; i < this.slides.length; i++ ) { var slide = this.slides[i]; var index = slide.cells.indexOf( cell ); if ( index != -1 ) { return i; } } }; // -------------------------- get cells -------------------------- // /** * get Flickity.Cell, given an Element * @param {Element} elem * @returns {Flickity.Cell} item */ proto.getCell = function( elem ) { // loop through cells to get the one that matches for ( var i=0; i < this.cells.length; i++ ) { var cell = this.cells[i]; if ( cell.element == elem ) { return cell; } } }; /** * get collection of Flickity.Cells, given Elements * @param {Element, Array, NodeList} elems * @returns {Array} cells - Flickity.Cells */ proto.getCells = function( elems ) { elems = utils.makeArray( elems ); var cells = []; elems.forEach( function( elem ) { var cell = this.getCell( elem ); if ( cell ) { cells.push( cell ); } }, this ); return cells; }; /** * get cell elements * @returns {Array} cellElems */ proto.getCellElements = function() { return this.cells.map( function( cell ) { return cell.element; }); }; /** * get parent cell from an element * @param {Element} elem * @returns {Flickit.Cell} cell */ proto.getParentCell = function( elem ) { // first check if elem is cell var cell = this.getCell( elem ); if ( cell ) { return cell; } // try to get parent cell elem elem = utils.getParent( elem, '.flickity-slider > *' ); return this.getCell( elem ); }; /** * get cells adjacent to a slide * @param {Integer} adjCount - number of adjacent slides * @param {Integer} index - index of slide to start * @returns {Array} cells - array of Flickity.Cells */ proto.getAdjacentCellElements = function( adjCount, index ) { if ( !adjCount ) { return this.selectedSlide.getCellElements(); } index = index === undefined ? this.selectedIndex : index; var len = this.slides.length; if ( 1 + ( adjCount * 2 ) >= len ) { return this.getCellElements(); } var cellElems = []; for ( var i = index - adjCount; i <= index + adjCount ; i++ ) { var slideIndex = this.options.wrapAround ? utils.modulo( i, len ) : i; var slide = this.slides[ slideIndex ]; if ( slide ) { cellElems = cellElems.concat( slide.getCellElements() ); } } return cellElems; }; /** * select slide from number or cell element * @param {Element, Selector String, or Number} selector */ proto.queryCell = function( selector ) { if ( typeof selector == 'number' ) { // use number as index return this.cells[ selector ]; } if ( typeof selector == 'string' ) { // do not select invalid selectors from hash: #123, #/. #791 if ( selector.match(/^[#\.]?[\d\/]/) ) { return; } // use string as selector, get element selector = this.element.querySelector( selector ); } // get cell from element return this.getCell( selector ); }; // -------------------------- events -------------------------- // proto.uiChange = function() { this.emitEvent('uiChange'); }; // keep focus on element when child UI elements are clicked proto.childUIPointerDown = function( event ) { // HACK iOS does not allow touch events to bubble up?! if ( event.type != 'touchstart' ) { event.preventDefault(); } this.focus(); }; // ----- resize ----- // proto.onresize = function() { this.watchCSS(); this.resize(); }; utils.debounceMethod( Flickity, 'onresize', 150 ); proto.resize = function() { if ( !this.isActive ) { return; } this.getSize(); // wrap values if ( this.options.wrapAround ) { this.x = utils.modulo( this.x, this.slideableWidth ); } this.positionCells(); this._getWrapShiftCells(); this.setGallerySize(); this.emitEvent('resize'); // update selected index for group slides, instant // TODO: position can be lost between groups of various numbers var selectedElement = this.selectedElements && this.selectedElements[0]; this.selectCell( selectedElement, false, true ); }; // watches the :after property, activates/deactivates proto.watchCSS = function() { var watchOption = this.options.watchCSS; if ( !watchOption ) { return; } var afterContent = getComputedStyle( this.element, ':after' ).content; // activate if :after { content: 'flickity' } if ( afterContent.indexOf('flickity') != -1 ) { this.activate(); } else { this.deactivate(); } }; // ----- keydown ----- // // go previous/next if left/right keys pressed proto.onkeydown = function( event ) { // only work if element is in focus var isNotFocused = document.activeElement && document.activeElement != this.element; if ( !this.options.accessibility ||isNotFocused ) { return; } var handler = Flickity.keyboardHandlers[ event.keyCode ]; if ( handler ) { handler.call( this ); } }; Flickity.keyboardHandlers = { // left arrow 37: function() { var leftMethod = this.options.rightToLeft ? 'next' : 'previous'; this.uiChange(); this[ leftMethod ](); }, // right arrow 39: function() { var rightMethod = this.options.rightToLeft ? 'previous' : 'next'; this.uiChange(); this[ rightMethod ](); }, }; // ----- focus ----- // proto.focus = function() { // TODO remove scrollTo once focus options gets more support // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#Browser_compatibility var prevScrollY = window.pageYOffset; this.element.focus({ preventScroll: true }); // hack to fix scroll jump after focus, #76 if ( window.pageYOffset != prevScrollY ) { window.scrollTo( window.pageXOffset, prevScrollY ); } }; // -------------------------- destroy -------------------------- // // deactivate all Flickity functionality, but keep stuff available proto.deactivate = function() { if ( !this.isActive ) { return; } this.element.classList.remove('flickity-enabled'); this.element.classList.remove('flickity-rtl'); this.unselectSelectedSlide(); // destroy cells this.cells.forEach( function( cell ) { cell.destroy(); }); this.element.removeChild( this.viewport ); // move child elements back into element moveElements( this.slider.children, this.element ); if ( this.options.accessibility ) { this.element.removeAttribute('tabIndex'); this.element.removeEventListener( 'keydown', this ); } // set flags this.isActive = false; this.emitEvent('deactivate'); }; proto.destroy = function() { this.deactivate(); window.removeEventListener( 'resize', this ); this.allOff(); this.emitEvent('destroy'); if ( jQuery && this.$element ) { jQuery.removeData( this.element, 'flickity' ); } delete this.element.flickityGUID; delete instances[ this.guid ]; }; // -------------------------- prototype -------------------------- // utils.extend( proto, animatePrototype ); // -------------------------- extras -------------------------- // /** * get Flickity instance from element * @param {Element} elem * @returns {Flickity} */ Flickity.data = function( elem ) { elem = utils.getQueryElement( elem ); var id = elem && elem.flickityGUID; return id && instances[ id ]; }; utils.htmlInit( Flickity, 'flickity' ); if ( jQuery && jQuery.bridget ) { jQuery.bridget( 'flickity', Flickity ); } // set internal jQuery, for Webpack + jQuery v3, #478 Flickity.setJQuery = function( jq ) { jQuery = jq; }; Flickity.Cell = Cell; Flickity.Slide = Slide; return Flickity; })); },{"./animate":272,"./cell":273,"./slide":281,"ev-emitter":269,"fizzy-ui-utils":270,"get-size":282}],276:[function(require,module,exports){ /*! * Flickity v2.2.1 * Touch, responsive, flickable carousels * * Licensed GPLv3 for open source use * or Flickity Commercial License for commercial use * * https://flickity.metafizzy.co * Copyright 2015-2019 Metafizzy */ ( function( window, factory ) { // universal module definition /* jshint strict: false */ if ( typeof define == 'function' && define.amd ) { // AMD define( [ './flickity', './drag', './prev-next-button', './page-dots', './player', './add-remove-cell', './lazyload' ], factory ); } else if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory( require('./flickity'), require('./drag'), require('./prev-next-button'), require('./page-dots'), require('./player'), require('./add-remove-cell'), require('./lazyload') ); } })( window, function factory( Flickity ) { /*jshint strict: false*/ return Flickity; }); },{"./add-remove-cell":271,"./drag":274,"./flickity":275,"./lazyload":277,"./page-dots":278,"./player":279,"./prev-next-button":280}],277:[function(require,module,exports){ // lazyload ( function( window, factory ) { // universal module definition /* jshint strict: false */ if ( typeof define == 'function' && define.amd ) { // AMD define( [ './flickity', 'fizzy-ui-utils/utils' ], function( Flickity, utils ) { return factory( window, Flickity, utils ); }); } else if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory( window, require('./flickity'), require('fizzy-ui-utils') ); } else { // browser global factory( window, window.Flickity, window.fizzyUIUtils ); } }( window, function factory( window, Flickity, utils ) { 'use strict'; Flickity.createMethods.push('_createLazyload'); var proto = Flickity.prototype; proto._createLazyload = function() { this.on( 'select', this.lazyLoad ); }; proto.lazyLoad = function() { var lazyLoad = this.options.lazyLoad; if ( !lazyLoad ) { return; } // get adjacent cells, use lazyLoad option for adjacent count var adjCount = typeof lazyLoad == 'number' ? lazyLoad : 0; var cellElems = this.getAdjacentCellElements( adjCount ); // get lazy images in those cells var lazyImages = []; cellElems.forEach( function( cellElem ) { var lazyCellImages = getCellLazyImages( cellElem ); lazyImages = lazyImages.concat( lazyCellImages ); }); // load lazy images lazyImages.forEach( function( img ) { new LazyLoader( img, this ); }, this ); }; function getCellLazyImages( cellElem ) { // check if cell element is lazy image if ( cellElem.nodeName == 'IMG' ) { var lazyloadAttr = cellElem.getAttribute('data-flickity-lazyload'); var srcAttr = cellElem.getAttribute('data-flickity-lazyload-src'); var srcsetAttr = cellElem.getAttribute('data-flickity-lazyload-srcset'); if ( lazyloadAttr || srcAttr || srcsetAttr ) { return [ cellElem ]; } } // select lazy images in cell var lazySelector = 'img[data-flickity-lazyload], ' + 'img[data-flickity-lazyload-src], img[data-flickity-lazyload-srcset]'; var imgs = cellElem.querySelectorAll( lazySelector ); return utils.makeArray( imgs ); } // -------------------------- LazyLoader -------------------------- // /** * class to handle loading images */ function LazyLoader( img, flickity ) { this.img = img; this.flickity = flickity; this.load(); } LazyLoader.prototype.handleEvent = utils.handleEvent; LazyLoader.prototype.load = function() { this.img.addEventListener( 'load', this ); this.img.addEventListener( 'error', this ); // get src & srcset var src = this.img.getAttribute('data-flickity-lazyload') || this.img.getAttribute('data-flickity-lazyload-src'); var srcset = this.img.getAttribute('data-flickity-lazyload-srcset'); // set src & serset this.img.src = src; if ( srcset ) { this.img.setAttribute( 'srcset', srcset ); } // remove attr this.img.removeAttribute('data-flickity-lazyload'); this.img.removeAttribute('data-flickity-lazyload-src'); this.img.removeAttribute('data-flickity-lazyload-srcset'); }; LazyLoader.prototype.onload = function( event ) { this.complete( event, 'flickity-lazyloaded' ); }; LazyLoader.prototype.onerror = function( event ) { this.complete( event, 'flickity-lazyerror' ); }; LazyLoader.prototype.complete = function( event, className ) { // unbind events this.img.removeEventListener( 'load', this ); this.img.removeEventListener( 'error', this ); var cell = this.flickity.getParentCell( this.img ); var cellElem = cell && cell.element; this.flickity.cellSizeChange( cellElem ); this.img.classList.add( className ); this.flickity.dispatchEvent( 'lazyLoad', event, cellElem ); }; // ----- ----- // Flickity.LazyLoader = LazyLoader; return Flickity; })); },{"./flickity":275,"fizzy-ui-utils":270}],278:[function(require,module,exports){ // page dots ( function( window, factory ) { // universal module definition /* jshint strict: false */ if ( typeof define == 'function' && define.amd ) { // AMD define( [ './flickity', 'unipointer/unipointer', 'fizzy-ui-utils/utils' ], function( Flickity, Unipointer, utils ) { return factory( window, Flickity, Unipointer, utils ); }); } else if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory( window, require('./flickity'), require('unipointer'), require('fizzy-ui-utils') ); } else { // browser global factory( window, window.Flickity, window.Unipointer, window.fizzyUIUtils ); } }( window, function factory( window, Flickity, Unipointer, utils ) { // -------------------------- PageDots -------------------------- // 'use strict'; function PageDots( parent ) { this.parent = parent; this._create(); } PageDots.prototype = Object.create( Unipointer.prototype ); PageDots.prototype._create = function() { // create holder element this.holder = document.createElement('ol'); this.holder.className = 'flickity-page-dots'; // create dots, array of elements this.dots = []; // events this.handleClick = this.onClick.bind( this ); this.on( 'pointerDown', this.parent.childUIPointerDown.bind( this.parent ) ); }; PageDots.prototype.activate = function() { this.setDots(); this.holder.addEventListener( 'click', this.handleClick ); this.bindStartEvent( this.holder ); // add to DOM this.parent.element.appendChild( this.holder ); }; PageDots.prototype.deactivate = function() { this.holder.removeEventListener( 'click', this.handleClick ); this.unbindStartEvent( this.holder ); // remove from DOM this.parent.element.removeChild( this.holder ); }; PageDots.prototype.setDots = function() { // get difference between number of slides and number of dots var delta = this.parent.slides.length - this.dots.length; if ( delta > 0 ) { this.addDots( delta ); } else if ( delta < 0 ) { this.removeDots( -delta ); } }; PageDots.prototype.addDots = function( count ) { var fragment = document.createDocumentFragment(); var newDots = []; var length = this.dots.length; var max = length + count; for ( var i = length; i < max; i++ ) { var dot = document.createElement('li'); dot.className = 'dot'; dot.setAttribute( 'aria-label', 'Page dot ' + ( i + 1 ) ); fragment.appendChild( dot ); newDots.push( dot ); } this.holder.appendChild( fragment ); this.dots = this.dots.concat( newDots ); }; PageDots.prototype.removeDots = function( count ) { // remove from this.dots collection var removeDots = this.dots.splice( this.dots.length - count, count ); // remove from DOM removeDots.forEach( function( dot ) { this.holder.removeChild( dot ); }, this ); }; PageDots.prototype.updateSelected = function() { // remove selected class on previous if ( this.selectedDot ) { this.selectedDot.className = 'dot'; this.selectedDot.removeAttribute('aria-current'); } // don't proceed if no dots if ( !this.dots.length ) { return; } this.selectedDot = this.dots[ this.parent.selectedIndex ]; this.selectedDot.className = 'dot is-selected'; this.selectedDot.setAttribute( 'aria-current', 'step' ); }; PageDots.prototype.onTap = // old method name, backwards-compatible PageDots.prototype.onClick = function( event ) { var target = event.target; // only care about dot clicks if ( target.nodeName != 'LI' ) { return; } this.parent.uiChange(); var index = this.dots.indexOf( target ); this.parent.select( index ); }; PageDots.prototype.destroy = function() { this.deactivate(); this.allOff(); }; Flickity.PageDots = PageDots; // -------------------------- Flickity -------------------------- // utils.extend( Flickity.defaults, { pageDots: true }); Flickity.createMethods.push('_createPageDots'); var proto = Flickity.prototype; proto._createPageDots = function() { if ( !this.options.pageDots ) { return; } this.pageDots = new PageDots( this ); // events this.on( 'activate', this.activatePageDots ); this.on( 'select', this.updateSelectedPageDots ); this.on( 'cellChange', this.updatePageDots ); this.on( 'resize', this.updatePageDots ); this.on( 'deactivate', this.deactivatePageDots ); }; proto.activatePageDots = function() { this.pageDots.activate(); }; proto.updateSelectedPageDots = function() { this.pageDots.updateSelected(); }; proto.updatePageDots = function() { this.pageDots.setDots(); }; proto.deactivatePageDots = function() { this.pageDots.deactivate(); }; // ----- ----- // Flickity.PageDots = PageDots; return Flickity; })); },{"./flickity":275,"fizzy-ui-utils":270,"unipointer":284}],279:[function(require,module,exports){ // player & autoPlay ( function( window, factory ) { // universal module definition /* jshint strict: false */ if ( typeof define == 'function' && define.amd ) { // AMD define( [ 'ev-emitter/ev-emitter', 'fizzy-ui-utils/utils', './flickity' ], function( EvEmitter, utils, Flickity ) { return factory( EvEmitter, utils, Flickity ); }); } else if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory( require('ev-emitter'), require('fizzy-ui-utils'), require('./flickity') ); } else { // browser global factory( window.EvEmitter, window.fizzyUIUtils, window.Flickity ); } }( window, function factory( EvEmitter, utils, Flickity ) { 'use strict'; // -------------------------- Player -------------------------- // function Player( parent ) { this.parent = parent; this.state = 'stopped'; // visibility change event handler this.onVisibilityChange = this.visibilityChange.bind( this ); this.onVisibilityPlay = this.visibilityPlay.bind( this ); } Player.prototype = Object.create( EvEmitter.prototype ); // start play Player.prototype.play = function() { if ( this.state == 'playing' ) { return; } // do not play if page is hidden, start playing when page is visible var isPageHidden = document.hidden; if ( isPageHidden ) { document.addEventListener( 'visibilitychange', this.onVisibilityPlay ); return; } this.state = 'playing'; // listen to visibility change document.addEventListener( 'visibilitychange', this.onVisibilityChange ); // start ticking this.tick(); }; Player.prototype.tick = function() { // do not tick if not playing if ( this.state != 'playing' ) { return; } var time = this.parent.options.autoPlay; // default to 3 seconds time = typeof time == 'number' ? time : 3000; var _this = this; // HACK: reset ticks if stopped and started within interval this.clear(); this.timeout = setTimeout( function() { _this.parent.next( true ); _this.tick(); }, time ); }; Player.prototype.stop = function() { this.state = 'stopped'; this.clear(); // remove visibility change event document.removeEventListener( 'visibilitychange', this.onVisibilityChange ); }; Player.prototype.clear = function() { clearTimeout( this.timeout ); }; Player.prototype.pause = function() { if ( this.state == 'playing' ) { this.state = 'paused'; this.clear(); } }; Player.prototype.unpause = function() { // re-start play if paused if ( this.state == 'paused' ) { this.play(); } }; // pause if page visibility is hidden, unpause if visible Player.prototype.visibilityChange = function() { var isPageHidden = document.hidden; this[ isPageHidden ? 'pause' : 'unpause' ](); }; Player.prototype.visibilityPlay = function() { this.play(); document.removeEventListener( 'visibilitychange', this.onVisibilityPlay ); }; // -------------------------- Flickity -------------------------- // utils.extend( Flickity.defaults, { pauseAutoPlayOnHover: true }); Flickity.createMethods.push('_createPlayer'); var proto = Flickity.prototype; proto._createPlayer = function() { this.player = new Player( this ); this.on( 'activate', this.activatePlayer ); this.on( 'uiChange', this.stopPlayer ); this.on( 'pointerDown', this.stopPlayer ); this.on( 'deactivate', this.deactivatePlayer ); }; proto.activatePlayer = function() { if ( !this.options.autoPlay ) { return; } this.player.play(); this.element.addEventListener( 'mouseenter', this ); }; // Player API, don't hate the ... thanks I know where the door is proto.playPlayer = function() { this.player.play(); }; proto.stopPlayer = function() { this.player.stop(); }; proto.pausePlayer = function() { this.player.pause(); }; proto.unpausePlayer = function() { this.player.unpause(); }; proto.deactivatePlayer = function() { this.player.stop(); this.element.removeEventListener( 'mouseenter', this ); }; // ----- mouseenter/leave ----- // // pause auto-play on hover proto.onmouseenter = function() { if ( !this.options.pauseAutoPlayOnHover ) { return; } this.player.pause(); this.element.addEventListener( 'mouseleave', this ); }; // resume auto-play on hover off proto.onmouseleave = function() { this.player.unpause(); this.element.removeEventListener( 'mouseleave', this ); }; // ----- ----- // Flickity.Player = Player; return Flickity; })); },{"./flickity":275,"ev-emitter":269,"fizzy-ui-utils":270}],280:[function(require,module,exports){ // prev/next buttons ( function( window, factory ) { // universal module definition /* jshint strict: false */ if ( typeof define == 'function' && define.amd ) { // AMD define( [ './flickity', 'unipointer/unipointer', 'fizzy-ui-utils/utils' ], function( Flickity, Unipointer, utils ) { return factory( window, Flickity, Unipointer, utils ); }); } else if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory( window, require('./flickity'), require('unipointer'), require('fizzy-ui-utils') ); } else { // browser global factory( window, window.Flickity, window.Unipointer, window.fizzyUIUtils ); } }( window, function factory( window, Flickity, Unipointer, utils ) { 'use strict'; var svgURI = 'http://www.w3.org/2000/svg'; // -------------------------- PrevNextButton -------------------------- // function PrevNextButton( direction, parent ) { this.direction = direction; this.parent = parent; this._create(); } PrevNextButton.prototype = Object.create( Unipointer.prototype ); PrevNextButton.prototype._create = function() { // properties this.isEnabled = true; this.isPrevious = this.direction == -1; var leftDirection = this.parent.options.rightToLeft ? 1 : -1; this.isLeft = this.direction == leftDirection; var element = this.element = document.createElement('button'); element.className = 'flickity-button flickity-prev-next-button'; element.className += this.isPrevious ? ' previous' : ' next'; // prevent button from submitting form http://stackoverflow.com/a/10836076/182183 element.setAttribute( 'type', 'button' ); // init as disabled this.disable(); element.setAttribute( 'aria-label', this.isPrevious ? 'Previous' : 'Next' ); // create arrow var svg = this.createSVG(); element.appendChild( svg ); // events this.parent.on( 'select', this.update.bind( this ) ); this.on( 'pointerDown', this.parent.childUIPointerDown.bind( this.parent ) ); }; PrevNextButton.prototype.activate = function() { this.bindStartEvent( this.element ); this.element.addEventListener( 'click', this ); // add to DOM this.parent.element.appendChild( this.element ); }; PrevNextButton.prototype.deactivate = function() { // remove from DOM this.parent.element.removeChild( this.element ); // click events this.unbindStartEvent( this.element ); this.element.removeEventListener( 'click', this ); }; PrevNextButton.prototype.createSVG = function() { var svg = document.createElementNS( svgURI, 'svg'); svg.setAttribute( 'class', 'flickity-button-icon' ); svg.setAttribute( 'viewBox', '0 0 100 100' ); var path = document.createElementNS( svgURI, 'path'); var pathMovements = getArrowMovements( this.parent.options.arrowShape ); path.setAttribute( 'd', pathMovements ); path.setAttribute( 'class', 'arrow' ); // rotate arrow if ( !this.isLeft ) { path.setAttribute( 'transform', 'translate(100, 100) rotate(180) ' ); } svg.appendChild( path ); return svg; }; // get SVG path movmement function getArrowMovements( shape ) { // use shape as movement if string if ( typeof shape == 'string' ) { return shape; } // create movement string return 'M ' + shape.x0 + ',50' + ' L ' + shape.x1 + ',' + ( shape.y1 + 50 ) + ' L ' + shape.x2 + ',' + ( shape.y2 + 50 ) + ' L ' + shape.x3 + ',50 ' + ' L ' + shape.x2 + ',' + ( 50 - shape.y2 ) + ' L ' + shape.x1 + ',' + ( 50 - shape.y1 ) + ' Z'; } PrevNextButton.prototype.handleEvent = utils.handleEvent; PrevNextButton.prototype.onclick = function() { if ( !this.isEnabled ) { return; } this.parent.uiChange(); var method = this.isPrevious ? 'previous' : 'next'; this.parent[ method ](); }; // ----- ----- // PrevNextButton.prototype.enable = function() { if ( this.isEnabled ) { return; } this.element.disabled = false; this.isEnabled = true; }; PrevNextButton.prototype.disable = function() { if ( !this.isEnabled ) { return; } this.element.disabled = true; this.isEnabled = false; }; PrevNextButton.prototype.update = function() { // index of first or last slide, if previous or next var slides = this.parent.slides; // enable is wrapAround and at least 2 slides if ( this.parent.options.wrapAround && slides.length > 1 ) { this.enable(); return; } var lastIndex = slides.length ? slides.length - 1 : 0; var boundIndex = this.isPrevious ? 0 : lastIndex; var method = this.parent.selectedIndex == boundIndex ? 'disable' : 'enable'; this[ method ](); }; PrevNextButton.prototype.destroy = function() { this.deactivate(); this.allOff(); }; // -------------------------- Flickity prototype -------------------------- // utils.extend( Flickity.defaults, { prevNextButtons: true, arrowShape: { x0: 10, x1: 60, y1: 50, x2: 70, y2: 40, x3: 30 } }); Flickity.createMethods.push('_createPrevNextButtons'); var proto = Flickity.prototype; proto._createPrevNextButtons = function() { if ( !this.options.prevNextButtons ) { return; } this.prevButton = new PrevNextButton( -1, this ); this.nextButton = new PrevNextButton( 1, this ); this.on( 'activate', this.activatePrevNextButtons ); }; proto.activatePrevNextButtons = function() { this.prevButton.activate(); this.nextButton.activate(); this.on( 'deactivate', this.deactivatePrevNextButtons ); }; proto.deactivatePrevNextButtons = function() { this.prevButton.deactivate(); this.nextButton.deactivate(); this.off( 'deactivate', this.deactivatePrevNextButtons ); }; // -------------------------- -------------------------- // Flickity.PrevNextButton = PrevNextButton; return Flickity; })); },{"./flickity":275,"fizzy-ui-utils":270,"unipointer":284}],281:[function(require,module,exports){ // slide ( function( window, factory ) { // universal module definition /* jshint strict: false */ if ( typeof define == 'function' && define.amd ) { // AMD define( factory ); } else if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory(); } else { // browser global window.Flickity = window.Flickity || {}; window.Flickity.Slide = factory(); } }( window, function factory() { 'use strict'; function Slide( parent ) { this.parent = parent; this.isOriginLeft = parent.originSide == 'left'; this.cells = []; this.outerWidth = 0; this.height = 0; } var proto = Slide.prototype; proto.addCell = function( cell ) { this.cells.push( cell ); this.outerWidth += cell.size.outerWidth; this.height = Math.max( cell.size.outerHeight, this.height ); // first cell stuff if ( this.cells.length == 1 ) { this.x = cell.x; // x comes from first cell var beginMargin = this.isOriginLeft ? 'marginLeft' : 'marginRight'; this.firstMargin = cell.size[ beginMargin ]; } }; proto.updateTarget = function() { var endMargin = this.isOriginLeft ? 'marginRight' : 'marginLeft'; var lastCell = this.getLastCell(); var lastMargin = lastCell ? lastCell.size[ endMargin ] : 0; var slideWidth = this.outerWidth - ( this.firstMargin + lastMargin ); this.target = this.x + this.firstMargin + slideWidth * this.parent.cellAlign; }; proto.getLastCell = function() { return this.cells[ this.cells.length - 1 ]; }; proto.select = function() { this.cells.forEach( function( cell ) { cell.select(); }); }; proto.unselect = function() { this.cells.forEach( function( cell ) { cell.unselect(); }); }; proto.getCellElements = function() { return this.cells.map( function( cell ) { return cell.element; }); }; return Slide; })); },{}],282:[function(require,module,exports){ /*! * getSize v2.0.3 * measure size of elements * MIT license */ /* jshint browser: true, strict: true, undef: true, unused: true */ /* globals console: false */ ( function( window, factory ) { /* jshint strict: false */ /* globals define, module */ if ( typeof define == 'function' && define.amd ) { // AMD define( factory ); } else if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory(); } else { // browser global window.getSize = factory(); } })( window, function factory() { 'use strict'; // -------------------------- helpers -------------------------- // // get a number from a string, not a percentage function getStyleSize( value ) { var num = parseFloat( value ); // not a percent like '100%', and a number var isValid = value.indexOf('%') == -1 && !isNaN( num ); return isValid && num; } function noop() {} var logError = typeof console == 'undefined' ? noop : function( message ) { console.error( message ); }; // -------------------------- measurements -------------------------- // var measurements = [ 'paddingLeft', 'paddingRight', 'paddingTop', 'paddingBottom', 'marginLeft', 'marginRight', 'marginTop', 'marginBottom', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth', 'borderBottomWidth' ]; var measurementsLength = measurements.length; function getZeroSize() { var size = { width: 0, height: 0, innerWidth: 0, innerHeight: 0, outerWidth: 0, outerHeight: 0 }; for ( var i=0; i < measurementsLength; i++ ) { var measurement = measurements[i]; size[ measurement ] = 0; } return size; } // -------------------------- getStyle -------------------------- // /** * getStyle, get style of element, check for Firefox bug * https://bugzilla.mozilla.org/show_bug.cgi?id=548397 */ function getStyle( elem ) { var style = getComputedStyle( elem ); if ( !style ) { logError( 'Style returned ' + style + '. Are you running this code in a hidden iframe on Firefox? ' + 'See https://bit.ly/getsizebug1' ); } return style; } // -------------------------- setup -------------------------- // var isSetup = false; var isBoxSizeOuter; /** * setup * check isBoxSizerOuter * do on first getSize() rather than on page load for Firefox bug */ function setup() { // setup once if ( isSetup ) { return; } isSetup = true; // -------------------------- box sizing -------------------------- // /** * Chrome & Safari measure the outer-width on style.width on border-box elems * IE11 & Firefox<29 measures the inner-width */ var div = document.createElement('div'); div.style.width = '200px'; div.style.padding = '1px 2px 3px 4px'; div.style.borderStyle = 'solid'; div.style.borderWidth = '1px 2px 3px 4px'; div.style.boxSizing = 'border-box'; var body = document.body || document.documentElement; body.appendChild( div ); var style = getStyle( div ); // round value for browser zoom. desandro/masonry#928 isBoxSizeOuter = Math.round( getStyleSize( style.width ) ) == 200; getSize.isBoxSizeOuter = isBoxSizeOuter; body.removeChild( div ); } // -------------------------- getSize -------------------------- // function getSize( elem ) { setup(); // use querySeletor if elem is string if ( typeof elem == 'string' ) { elem = document.querySelector( elem ); } // do not proceed on non-objects if ( !elem || typeof elem != 'object' || !elem.nodeType ) { return; } var style = getStyle( elem ); // if hidden, everything is 0 if ( style.display == 'none' ) { return getZeroSize(); } var size = {}; size.width = elem.offsetWidth; size.height = elem.offsetHeight; var isBorderBox = size.isBorderBox = style.boxSizing == 'border-box'; // get all measurements for ( var i=0; i < measurementsLength; i++ ) { var measurement = measurements[i]; var value = style[ measurement ]; var num = parseFloat( value ); // any 'auto', 'medium' value will be 0 size[ measurement ] = !isNaN( num ) ? num : 0; } var paddingWidth = size.paddingLeft + size.paddingRight; var paddingHeight = size.paddingTop + size.paddingBottom; var marginWidth = size.marginLeft + size.marginRight; var marginHeight = size.marginTop + size.marginBottom; var borderWidth = size.borderLeftWidth + size.borderRightWidth; var borderHeight = size.borderTopWidth + size.borderBottomWidth; var isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter; // overwrite width and height if we can get it from style var styleWidth = getStyleSize( style.width ); if ( styleWidth !== false ) { size.width = styleWidth + // add padding and border unless it's already including it ( isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth ); } var styleHeight = getStyleSize( style.height ); if ( styleHeight !== false ) { size.height = styleHeight + // add padding and border unless it's already including it ( isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight ); } size.innerWidth = size.width - ( paddingWidth + borderWidth ); size.innerHeight = size.height - ( paddingHeight + borderHeight ); size.outerWidth = size.width + marginWidth; size.outerHeight = size.height + marginHeight; return size; } return getSize; }); },{}],283:[function(require,module,exports){ /*! * Unidragger v2.3.0 * Draggable base class * MIT license */ /*jshint browser: true, unused: true, undef: true, strict: true */ ( function( window, factory ) { // universal module definition /*jshint strict: false */ /*globals define, module, require */ if ( typeof define == 'function' && define.amd ) { // AMD define( [ 'unipointer/unipointer' ], function( Unipointer ) { return factory( window, Unipointer ); }); } else if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory( window, require('unipointer') ); } else { // browser global window.Unidragger = factory( window, window.Unipointer ); } }( window, function factory( window, Unipointer ) { 'use strict'; // -------------------------- Unidragger -------------------------- // function Unidragger() {} // inherit Unipointer & EvEmitter var proto = Unidragger.prototype = Object.create( Unipointer.prototype ); // ----- bind start ----- // proto.bindHandles = function() { this._bindHandles( true ); }; proto.unbindHandles = function() { this._bindHandles( false ); }; /** * Add or remove start event * @param {Boolean} isAdd */ proto._bindHandles = function( isAdd ) { // munge isAdd, default to true isAdd = isAdd === undefined ? true : isAdd; // bind each handle var bindMethod = isAdd ? 'addEventListener' : 'removeEventListener'; var touchAction = isAdd ? this._touchActionValue : ''; for ( var i=0; i < this.handles.length; i++ ) { var handle = this.handles[i]; this._bindStartEvent( handle, isAdd ); handle[ bindMethod ]( 'click', this ); // touch-action: none to override browser touch gestures. metafizzy/flickity#540 if ( window.PointerEvent ) { handle.style.touchAction = touchAction; } } }; // prototype so it can be overwriteable by Flickity proto._touchActionValue = 'none'; // ----- start event ----- // /** * pointer start * @param {Event} event * @param {Event or Touch} pointer */ proto.pointerDown = function( event, pointer ) { var isOkay = this.okayPointerDown( event ); if ( !isOkay ) { return; } // track start event position this.pointerDownPointer = pointer; event.preventDefault(); this.pointerDownBlur(); // bind move and end events this._bindPostStartEvents( event ); this.emitEvent( 'pointerDown', [ event, pointer ] ); }; // nodes that have text fields var cursorNodes = { TEXTAREA: true, INPUT: true, SELECT: true, OPTION: true, }; // input types that do not have text fields var clickTypes = { radio: true, checkbox: true, button: true, submit: true, image: true, file: true, }; // dismiss inputs with text fields. flickity#403, flickity#404 proto.okayPointerDown = function( event ) { var isCursorNode = cursorNodes[ event.target.nodeName ]; var isClickType = clickTypes[ event.target.type ]; var isOkay = !isCursorNode || isClickType; if ( !isOkay ) { this._pointerReset(); } return isOkay; }; // kludge to blur previously focused input proto.pointerDownBlur = function() { var focused = document.activeElement; // do not blur body for IE10, metafizzy/flickity#117 var canBlur = focused && focused.blur && focused != document.body; if ( canBlur ) { focused.blur(); } }; // ----- move event ----- // /** * drag move * @param {Event} event * @param {Event or Touch} pointer */ proto.pointerMove = function( event, pointer ) { var moveVector = this._dragPointerMove( event, pointer ); this.emitEvent( 'pointerMove', [ event, pointer, moveVector ] ); this._dragMove( event, pointer, moveVector ); }; // base pointer move logic proto._dragPointerMove = function( event, pointer ) { var moveVector = { x: pointer.pageX - this.pointerDownPointer.pageX, y: pointer.pageY - this.pointerDownPointer.pageY }; // start drag if pointer has moved far enough to start drag if ( !this.isDragging && this.hasDragStarted( moveVector ) ) { this._dragStart( event, pointer ); } return moveVector; }; // condition if pointer has moved far enough to start drag proto.hasDragStarted = function( moveVector ) { return Math.abs( moveVector.x ) > 3 || Math.abs( moveVector.y ) > 3; }; // ----- end event ----- // /** * pointer up * @param {Event} event * @param {Event or Touch} pointer */ proto.pointerUp = function( event, pointer ) { this.emitEvent( 'pointerUp', [ event, pointer ] ); this._dragPointerUp( event, pointer ); }; proto._dragPointerUp = function( event, pointer ) { if ( this.isDragging ) { this._dragEnd( event, pointer ); } else { // pointer didn't move enough for drag to start this._staticClick( event, pointer ); } }; // -------------------------- drag -------------------------- // // dragStart proto._dragStart = function( event, pointer ) { this.isDragging = true; // prevent clicks this.isPreventingClicks = true; this.dragStart( event, pointer ); }; proto.dragStart = function( event, pointer ) { this.emitEvent( 'dragStart', [ event, pointer ] ); }; // dragMove proto._dragMove = function( event, pointer, moveVector ) { // do not drag if not dragging yet if ( !this.isDragging ) { return; } this.dragMove( event, pointer, moveVector ); }; proto.dragMove = function( event, pointer, moveVector ) { event.preventDefault(); this.emitEvent( 'dragMove', [ event, pointer, moveVector ] ); }; // dragEnd proto._dragEnd = function( event, pointer ) { // set flags this.isDragging = false; // re-enable clicking async setTimeout( function() { delete this.isPreventingClicks; }.bind( this ) ); this.dragEnd( event, pointer ); }; proto.dragEnd = function( event, pointer ) { this.emitEvent( 'dragEnd', [ event, pointer ] ); }; // ----- onclick ----- // // handle all clicks and prevent clicks when dragging proto.onclick = function( event ) { if ( this.isPreventingClicks ) { event.preventDefault(); } }; // ----- staticClick ----- // // triggered after pointer down & up with no/tiny movement proto._staticClick = function( event, pointer ) { // ignore emulated mouse up clicks if ( this.isIgnoringMouseUp && event.type == 'mouseup' ) { return; } this.staticClick( event, pointer ); // set flag for emulated clicks 300ms after touchend if ( event.type != 'mouseup' ) { this.isIgnoringMouseUp = true; // reset flag after 300ms setTimeout( function() { delete this.isIgnoringMouseUp; }.bind( this ), 400 ); } }; proto.staticClick = function( event, pointer ) { this.emitEvent( 'staticClick', [ event, pointer ] ); }; // ----- utils ----- // Unidragger.getPointerPoint = Unipointer.getPointerPoint; // ----- ----- // return Unidragger; })); },{"unipointer":284}],284:[function(require,module,exports){ /*! * Unipointer v2.3.0 * base class for doing one thing with pointer event * MIT license */ /*jshint browser: true, undef: true, unused: true, strict: true */ ( function( window, factory ) { // universal module definition /* jshint strict: false */ /*global define, module, require */ if ( typeof define == 'function' && define.amd ) { // AMD define( [ 'ev-emitter/ev-emitter' ], function( EvEmitter ) { return factory( window, EvEmitter ); }); } else if ( typeof module == 'object' && module.exports ) { // CommonJS module.exports = factory( window, require('ev-emitter') ); } else { // browser global window.Unipointer = factory( window, window.EvEmitter ); } }( window, function factory( window, EvEmitter ) { 'use strict'; function noop() {} function Unipointer() {} // inherit EvEmitter var proto = Unipointer.prototype = Object.create( EvEmitter.prototype ); proto.bindStartEvent = function( elem ) { this._bindStartEvent( elem, true ); }; proto.unbindStartEvent = function( elem ) { this._bindStartEvent( elem, false ); }; /** * Add or remove start event * @param {Boolean} isAdd - remove if falsey */ proto._bindStartEvent = function( elem, isAdd ) { // munge isAdd, default to true isAdd = isAdd === undefined ? true : isAdd; var bindMethod = isAdd ? 'addEventListener' : 'removeEventListener'; // default to mouse events var startEvent = 'mousedown'; if ( window.PointerEvent ) { // Pointer Events startEvent = 'pointerdown'; } else if ( 'ontouchstart' in window ) { // Touch Events. iOS Safari startEvent = 'touchstart'; } elem[ bindMethod ]( startEvent, this ); }; // trigger handler methods for events proto.handleEvent = function( event ) { var method = 'on' + event.type; if ( this[ method ] ) { this[ method ]( event ); } }; // returns the touch that we're keeping track of proto.getTouch = function( touches ) { for ( var i=0; i < touches.length; i++ ) { var touch = touches[i]; if ( touch.identifier == this.pointerIdentifier ) { return touch; } } }; // ----- start event ----- // proto.onmousedown = function( event ) { // dismiss clicks from right or middle buttons var button = event.button; if ( button && ( button !== 0 && button !== 1 ) ) { return; } this._pointerDown( event, event ); }; proto.ontouchstart = function( event ) { this._pointerDown( event, event.changedTouches[0] ); }; proto.onpointerdown = function( event ) { this._pointerDown( event, event ); }; /** * pointer start * @param {Event} event * @param {Event or Touch} pointer */ proto._pointerDown = function( event, pointer ) { // dismiss right click and other pointers // button = 0 is okay, 1-4 not if ( event.button || this.isPointerDown ) { return; } this.isPointerDown = true; // save pointer identifier to match up touch events this.pointerIdentifier = pointer.pointerId !== undefined ? // pointerId for pointer events, touch.indentifier for touch events pointer.pointerId : pointer.identifier; this.pointerDown( event, pointer ); }; proto.pointerDown = function( event, pointer ) { this._bindPostStartEvents( event ); this.emitEvent( 'pointerDown', [ event, pointer ] ); }; // hash of events to be bound after start event var postStartEvents = { mousedown: [ 'mousemove', 'mouseup' ], touchstart: [ 'touchmove', 'touchend', 'touchcancel' ], pointerdown: [ 'pointermove', 'pointerup', 'pointercancel' ], }; proto._bindPostStartEvents = function( event ) { if ( !event ) { return; } // get proper events to match start event var events = postStartEvents[ event.type ]; // bind events to node events.forEach( function( eventName ) { window.addEventListener( eventName, this ); }, this ); // save these arguments this._boundPointerEvents = events; }; proto._unbindPostStartEvents = function() { // check for _boundEvents, in case dragEnd triggered twice (old IE8 bug) if ( !this._boundPointerEvents ) { return; } this._boundPointerEvents.forEach( function( eventName ) { window.removeEventListener( eventName, this ); }, this ); delete this._boundPointerEvents; }; // ----- move event ----- // proto.onmousemove = function( event ) { this._pointerMove( event, event ); }; proto.onpointermove = function( event ) { if ( event.pointerId == this.pointerIdentifier ) { this._pointerMove( event, event ); } }; proto.ontouchmove = function( event ) { var touch = this.getTouch( event.changedTouches ); if ( touch ) { this._pointerMove( event, touch ); } }; /** * pointer move * @param {Event} event * @param {Event or Touch} pointer * @private */ proto._pointerMove = function( event, pointer ) { this.pointerMove( event, pointer ); }; // public proto.pointerMove = function( event, pointer ) { this.emitEvent( 'pointerMove', [ event, pointer ] ); }; // ----- end event ----- // proto.onmouseup = function( event ) { this._pointerUp( event, event ); }; proto.onpointerup = function( event ) { if ( event.pointerId == this.pointerIdentifier ) { this._pointerUp( event, event ); } }; proto.ontouchend = function( event ) { var touch = this.getTouch( event.changedTouches ); if ( touch ) { this._pointerUp( event, touch ); } }; /** * pointer up * @param {Event} event * @param {Event or Touch} pointer * @private */ proto._pointerUp = function( event, pointer ) { this._pointerDone(); this.pointerUp( event, pointer ); }; // public proto.pointerUp = function( event, pointer ) { this.emitEvent( 'pointerUp', [ event, pointer ] ); }; // ----- pointer done ----- // // triggered on pointer up & pointer cancel proto._pointerDone = function() { this._pointerReset(); this._unbindPostStartEvents(); this.pointerDone(); }; proto._pointerReset = function() { // reset properties this.isPointerDown = false; delete this.pointerIdentifier; }; proto.pointerDone = noop; // ----- pointer cancel ----- // proto.onpointercancel = function( event ) { if ( event.pointerId == this.pointerIdentifier ) { this._pointerCancel( event, event ); } }; proto.ontouchcancel = function( event ) { var touch = this.getTouch( event.changedTouches ); if ( touch ) { this._pointerCancel( event, touch ); } }; /** * pointer cancel * @param {Event} event * @param {Event or Touch} pointer * @private */ proto._pointerCancel = function( event, pointer ) { this._pointerDone(); this.pointerCancel( event, pointer ); }; // public proto.pointerCancel = function( event, pointer ) { this.emitEvent( 'pointerCancel', [ event, pointer ] ); }; // ----- ----- // // utility function for getting x/y coords from event Unipointer.getPointerPoint = function( pointer ) { return { x: pointer.pageX, y: pointer.pageY }; }; // ----- ----- // return Unipointer; })); },{"ev-emitter":269}]},{},[19]) //# sourceMappingURL=soucybaron-landing.js.map