diff --git a/dist/dd-manager.js b/dist/dd-manager.js index e1276c4..1feb865 100644 --- a/dist/dd-manager.js +++ b/dist/dd-manager.js @@ -1262,7 +1262,7 @@ }()); }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"_process":50}],2:[function(require,module,exports){ +},{"_process":49}],2:[function(require,module,exports){ var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; ;(function (exports) { @@ -4278,7 +4278,7 @@ function coerce(val) { return val; } -},{"ms":49}],46:[function(require,module,exports){ +},{"ms":48}],46:[function(require,module,exports){ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = nBytes * 8 - mLen - 1 @@ -4400,153 +4400,6 @@ module.exports = isArray || function (val) { }; },{}],48:[function(require,module,exports){ -/*! - * JavaScript Cookie v2.1.0 - * https://github.com/js-cookie/js-cookie - * - * Copyright 2006, 2015 Klaus Hartl & Fagner Brack - * Released under the MIT license - */ -(function (factory) { - if (typeof define === 'function' && define.amd) { - define(factory); - } else if (typeof exports === 'object') { - module.exports = factory(); - } else { - var _OldCookies = window.Cookies; - var api = window.Cookies = factory(); - api.noConflict = function () { - window.Cookies = _OldCookies; - return api; - }; - } -}(function () { - function extend () { - var i = 0; - var result = {}; - for (; i < arguments.length; i++) { - var attributes = arguments[ i ]; - for (var key in attributes) { - result[key] = attributes[key]; - } - } - return result; - } - - function init (converter) { - function api (key, value, attributes) { - var result; - - // Write - - if (arguments.length > 1) { - attributes = extend({ - path: '/' - }, api.defaults, attributes); - - if (typeof attributes.expires === 'number') { - var expires = new Date(); - expires.setMilliseconds(expires.getMilliseconds() + attributes.expires * 864e+5); - attributes.expires = expires; - } - - try { - result = JSON.stringify(value); - if (/^[\{\[]/.test(result)) { - value = result; - } - } catch (e) {} - - if (!converter.write) { - value = encodeURIComponent(String(value)) - .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); - } else { - value = converter.write(value, key); - } - - key = encodeURIComponent(String(key)); - key = key.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent); - key = key.replace(/[\(\)]/g, escape); - - return (document.cookie = [ - key, '=', value, - attributes.expires && '; expires=' + attributes.expires.toUTCString(), // use expires attribute, max-age is not supported by IE - attributes.path && '; path=' + attributes.path, - attributes.domain && '; domain=' + attributes.domain, - attributes.secure ? '; secure' : '' - ].join('')); - } - - // Read - - if (!key) { - result = {}; - } - - // To prevent the for loop in the first place assign an empty array - // in case there are no cookies at all. Also prevents odd result when - // calling "get()" - var cookies = document.cookie ? document.cookie.split('; ') : []; - var rdecode = /(%[0-9A-Z]{2})+/g; - var i = 0; - - for (; i < cookies.length; i++) { - var parts = cookies[i].split('='); - var name = parts[0].replace(rdecode, decodeURIComponent); - var cookie = parts.slice(1).join('='); - - if (cookie.charAt(0) === '"') { - cookie = cookie.slice(1, -1); - } - - try { - cookie = converter.read ? - converter.read(cookie, name) : converter(cookie, name) || - cookie.replace(rdecode, decodeURIComponent); - - if (this.json) { - try { - cookie = JSON.parse(cookie); - } catch (e) {} - } - - if (key === name) { - result = cookie; - break; - } - - if (!key) { - result[name] = cookie; - } - } catch (e) {} - } - - return result; - } - - api.get = api.set = api; - api.getJSON = function () { - return api.apply({ - json: true - }, [].slice.call(arguments)); - }; - api.defaults = {}; - - api.remove = function (key, attributes) { - api(key, '', extend(attributes, { - expires: -1 - })); - }; - - api.withConverter = init; - - return api; - } - - return init(function () {}); -})); - -},{}],49:[function(require,module,exports){ /** * Helpers. */ @@ -4673,7 +4526,7 @@ function plural(ms, n, name) { return Math.ceil(ms / n) + ' ' + name + 's'; } -},{}],50:[function(require,module,exports){ +},{}],49:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -4766,422 +4619,7 @@ process.chdir = function (dir) { }; process.umask = function() { return 0; }; -},{}],51:[function(require,module,exports){ -(function (global){ -"use strict" -// Module export pattern from -// https://github.com/umdjs/umd/blob/master/returnExports.js -;(function (root, factory) { - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - define([], factory); - } else if (typeof exports === 'object') { - // Node. Does not work with strict CommonJS, but - // only CommonJS-like environments that support module.exports, - // like Node. - module.exports = factory(); - } else { - // Browser globals (root is window) - root.store = factory(); - } -}(this, function () { - - // Store.js - var store = {}, - win = (typeof window != 'undefined' ? window : global), - doc = win.document, - localStorageName = 'localStorage', - scriptTag = 'script', - storage - - store.disabled = false - store.version = '1.3.20' - store.set = function(key, value) {} - store.get = function(key, defaultVal) {} - store.has = function(key) { return store.get(key) !== undefined } - store.remove = function(key) {} - store.clear = function() {} - store.transact = function(key, defaultVal, transactionFn) { - if (transactionFn == null) { - transactionFn = defaultVal - defaultVal = null - } - if (defaultVal == null) { - defaultVal = {} - } - var val = store.get(key, defaultVal) - transactionFn(val) - store.set(key, val) - } - store.getAll = function() {} - store.forEach = function() {} - - store.serialize = function(value) { - return JSON.stringify(value) - } - store.deserialize = function(value) { - if (typeof value != 'string') { return undefined } - try { return JSON.parse(value) } - catch(e) { return value || undefined } - } - - // Functions to encapsulate questionable FireFox 3.6.13 behavior - // when about.config::dom.storage.enabled === false - // See https://github.com/marcuswestin/store.js/issues#issue/13 - function isLocalStorageNameSupported() { - try { return (localStorageName in win && win[localStorageName]) } - catch(err) { return false } - } - - if (isLocalStorageNameSupported()) { - storage = win[localStorageName] - store.set = function(key, val) { - if (val === undefined) { return store.remove(key) } - storage.setItem(key, store.serialize(val)) - return val - } - store.get = function(key, defaultVal) { - var val = store.deserialize(storage.getItem(key)) - return (val === undefined ? defaultVal : val) - } - store.remove = function(key) { storage.removeItem(key) } - store.clear = function() { storage.clear() } - store.getAll = function() { - var ret = {} - store.forEach(function(key, val) { - ret[key] = val - }) - return ret - } - store.forEach = function(callback) { - for (var i=0; idocument.w=window') - storageContainer.close() - storageOwner = storageContainer.w.frames[0].document - storage = storageOwner.createElement('div') - } catch(e) { - // somehow ActiveXObject instantiation failed (perhaps some special - // security settings or otherwse), fall back to per-path storage - storage = doc.createElement('div') - storageOwner = doc.body - } - var withIEStorage = function(storeFunction) { - return function() { - var args = Array.prototype.slice.call(arguments, 0) - args.unshift(storage) - // See http://msdn.microsoft.com/en-us/library/ms531081(v=VS.85).aspx - // and http://msdn.microsoft.com/en-us/library/ms531424(v=VS.85).aspx - storageOwner.appendChild(storage) - storage.addBehavior('#default#userData') - storage.load(localStorageName) - var result = storeFunction.apply(store, args) - storageOwner.removeChild(storage) - return result - } - } - - // In IE7, keys cannot start with a digit or contain certain chars. - // See https://github.com/marcuswestin/store.js/issues/40 - // See https://github.com/marcuswestin/store.js/issues/83 - var forbiddenCharsRegex = new RegExp("[!\"#$%&'()*+,/\\\\:;<=>?@[\\]^`{|}~]", "g") - var ieKeyFix = function(key) { - return key.replace(/^d/, '___$&').replace(forbiddenCharsRegex, '___') - } - store.set = withIEStorage(function(storage, key, val) { - key = ieKeyFix(key) - if (val === undefined) { return store.remove(key) } - storage.setAttribute(key, store.serialize(val)) - storage.save(localStorageName) - return val - }) - store.get = withIEStorage(function(storage, key, defaultVal) { - key = ieKeyFix(key) - var val = store.deserialize(storage.getAttribute(key)) - return (val === undefined ? defaultVal : val) - }) - store.remove = withIEStorage(function(storage, key) { - key = ieKeyFix(key) - storage.removeAttribute(key) - storage.save(localStorageName) - }) - store.clear = withIEStorage(function(storage) { - var attributes = storage.XMLDocument.documentElement.attributes - storage.load(localStorageName) - for (var i=attributes.length-1; i>=0; i--) { - storage.removeAttribute(attributes[i].name) - } - storage.save(localStorageName) - }) - store.getAll = function(storage) { - var ret = {} - store.forEach(function(key, val) { - ret[key] = val - }) - return ret - } - store.forEach = withIEStorage(function(storage, callback) { - var attributes = storage.XMLDocument.documentElement.attributes - for (var i=0, attr; attr=attributes[i]; ++i) { - callback(attr.name, store.deserialize(storage.getAttribute(attr.name))) - } - }) - } - - try { - var testKey = '__storejs__' - store.set(testKey, testKey) - if (store.get(testKey) != testKey) { store.disabled = true } - store.remove(testKey) - } catch(e) { - store.disabled = true - } - store.enabled = !store.disabled - - return store -})); - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],52:[function(require,module,exports){ -(function (global){ - -var rng; - -if (global.crypto && crypto.getRandomValues) { - // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto - // Moderately fast, high quality - var _rnds8 = new Uint8Array(16); - rng = function whatwgRNG() { - crypto.getRandomValues(_rnds8); - return _rnds8; - }; -} - -if (!rng) { - // Math.random()-based (RNG) - // - // If all else fails, use Math.random(). It's fast, but is of unspecified - // quality. - var _rnds = new Array(16); - rng = function() { - for (var i = 0, r; i < 16; i++) { - if ((i & 0x03) === 0) r = Math.random() * 0x100000000; - _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff; - } - - return _rnds; - }; -} - -module.exports = rng; - - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],53:[function(require,module,exports){ -// uuid.js -// -// Copyright (c) 2010-2012 Robert Kieffer -// MIT License - http://opensource.org/licenses/mit-license.php - -// Unique ID creation requires a high quality random # generator. We feature -// detect to determine the best RNG source, normalizing to a function that -// returns 128-bits of randomness, since that's what's usually required -var _rng = require('./rng'); - -// Maps for number <-> hex string conversion -var _byteToHex = []; -var _hexToByte = {}; -for (var i = 0; i < 256; i++) { - _byteToHex[i] = (i + 0x100).toString(16).substr(1); - _hexToByte[_byteToHex[i]] = i; -} - -// **`parse()` - Parse a UUID into it's component bytes** -function parse(s, buf, offset) { - var i = (buf && offset) || 0, ii = 0; - - buf = buf || []; - s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) { - if (ii < 16) { // Don't overflow! - buf[i + ii++] = _hexToByte[oct]; - } - }); - - // Zero out remaining bytes if string was short - while (ii < 16) { - buf[i + ii++] = 0; - } - - return buf; -} - -// **`unparse()` - Convert UUID byte array (ala parse()) into a string** -function unparse(buf, offset) { - var i = offset || 0, bth = _byteToHex; - return bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]]; -} - -// **`v1()` - Generate time-based UUID** -// -// Inspired by https://github.com/LiosK/UUID.js -// and http://docs.python.org/library/uuid.html - -// random #'s we need to init node and clockseq -var _seedBytes = _rng(); - -// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) -var _nodeId = [ - _seedBytes[0] | 0x01, - _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5] -]; - -// Per 4.2.2, randomize (14 bit) clockseq -var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff; - -// Previous uuid creation time -var _lastMSecs = 0, _lastNSecs = 0; - -// See https://github.com/broofa/node-uuid for API details -function v1(options, buf, offset) { - var i = buf && offset || 0; - var b = buf || []; - - options = options || {}; - - var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; - - // UUID timestamps are 100 nano-second units since the Gregorian epoch, - // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so - // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' - // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. - var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime(); - - // Per 4.2.1.2, use count of uuid's generated during the current clock - // cycle to simulate higher resolution clock - var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; - - // Time since last uuid creation (in msecs) - var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; - - // Per 4.2.1.2, Bump clockseq on clock regression - if (dt < 0 && options.clockseq === undefined) { - clockseq = clockseq + 1 & 0x3fff; - } - - // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new - // time interval - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { - nsecs = 0; - } - - // Per 4.2.1.2 Throw error if too many uuids are requested - if (nsecs >= 10000) { - throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); - } - - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; - - // Per 4.1.4 - Convert from unix epoch to Gregorian epoch - msecs += 12219292800000; - - // `time_low` - var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; - b[i++] = tl >>> 24 & 0xff; - b[i++] = tl >>> 16 & 0xff; - b[i++] = tl >>> 8 & 0xff; - b[i++] = tl & 0xff; - - // `time_mid` - var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; - b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; - - // `time_high_and_version` - b[i++] = tmh >>> 24 & 0xf | 0x10; // include version - b[i++] = tmh >>> 16 & 0xff; - - // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) - b[i++] = clockseq >>> 8 | 0x80; - - // `clock_seq_low` - b[i++] = clockseq & 0xff; - - // `node` - var node = options.node || _nodeId; - for (var n = 0; n < 6; n++) { - b[i + n] = node[n]; - } - - return buf ? buf : unparse(b); -} - -// **`v4()` - Generate random UUID** - -// See https://github.com/broofa/node-uuid for API details -function v4(options, buf, offset) { - // Deprecated - 'format' argument, as supported in v1.2 - var i = buf && offset || 0; - - if (typeof(options) == 'string') { - buf = options == 'binary' ? new Array(16) : null; - options = null; - } - options = options || {}; - - var rnds = options.random || (options.rng || _rng)(); - - // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - rnds[6] = (rnds[6] & 0x0f) | 0x40; - rnds[8] = (rnds[8] & 0x3f) | 0x80; - - // Copy bytes to buffer, if provided - if (buf) { - for (var ii = 0; ii < 16; ii++) { - buf[i + ii] = rnds[ii]; - } - } - - return buf || unparse(rnds); -} - -// Export public API -var uuid = v4; -uuid.v1 = v1; -uuid.v4 = v4; -uuid.parse = parse; -uuid.unparse = unparse; - -module.exports = uuid; - -},{"./rng":52}],54:[function(require,module,exports){ +},{}],50:[function(require,module,exports){ 'use strict'; exports.__esModule = true; @@ -5329,7 +4767,7 @@ var AutoEvents = (function () { exports['default'] = AutoEvents; -},{"./DOMComponentsTracking.js":56,"component-type":6}],55:[function(require,module,exports){ +},{"./DOMComponentsTracking.js":52,"component-type":6}],51:[function(require,module,exports){ 'use strict'; exports.__esModule = true; @@ -5453,7 +4891,7 @@ var DDHelper = (function () { exports['default'] = DDHelper; -},{"./functions/getProperty.js":68,"component-clone":4}],56:[function(require,module,exports){ +},{"./functions/getProperty.js":63,"component-clone":4}],52:[function(require,module,exports){ 'use strict'; exports.__esModule = true; @@ -5541,11 +4979,11 @@ var DOMComponentsTracking = (function () { var _defineDocBoundaries = function _defineDocBoundaries() { _this2.docViewTop = $window.scrollTop(); _this2.docViewBottom = _this2.docViewTop + $window.height(); - _this2.docViewLeft = 0; - _this2.docViewRight = $window.width(); + _this2.docViewLeft = $window.scrollLeft(); + _this2.docViewRight = _this2.docViewLeft + $window.width(); var maxWebsiteWidth = _this2.options.maxWebsiteWidth; - if (maxWebsiteWidth && maxWebsiteWidth < _this2.docViewRight) { + if (maxWebsiteWidth && maxWebsiteWidth < _this2.docViewRight && _this2.docViewLeft === 0) { _this2.docViewLeft = (_this2.docViewRight - maxWebsiteWidth) / 2; _this2.docViewRight = _this2.docViewLeft + maxWebsiteWidth; } @@ -5693,6 +5131,7 @@ var DOMComponentsTracking = (function () { DOMComponentsTracking.prototype.isVisible = function isVisible($elem) { var el = $elem[0]; + var $window = window.jQuery(window); var elemOffset = $elem.offset(); var elemWidth = $elem.width(); @@ -5715,10 +5154,12 @@ var DOMComponentsTracking = (function () { return false; } - var elementFromPoint = document.elementFromPoint(elemLeft - this.docViewLeft + elemWidth / 2, elemTop - this.docViewTop + elemHeight / 2); + var elementFromPoint = document.elementFromPoint(elemLeft - $window.scrollLeft() + elemWidth / 2, elemTop - $window.scrollTop() + elemHeight / 2); + while (elementFromPoint && elementFromPoint !== el && elementFromPoint.parentNode !== document) { elementFromPoint = elementFromPoint.parentNode; } + return !!elementFromPoint && elementFromPoint === el; }; @@ -5740,7 +5181,7 @@ var DOMComponentsTracking = (function () { exports['default'] = DOMComponentsTracking; -},{"./functions/each.js":66}],57:[function(require,module,exports){ +},{"./functions/each.js":61}],53:[function(require,module,exports){ 'use strict'; exports.__esModule = true; @@ -5749,10 +5190,6 @@ var _htmlGlobals = require('./functions/htmlGlobals.js'); var _htmlGlobals2 = _interopRequireDefault(_htmlGlobals); -var _uuid = require('uuid'); - -var _uuid2 = _interopRequireDefault(_uuid); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } @@ -5764,31 +5201,18 @@ function _classCallCheck(instance, Constructor) { } var DigitalDataEnricher = (function () { - function DigitalDataEnricher(digitalData, storage, options) { + function DigitalDataEnricher(digitalData) { _classCallCheck(this, DigitalDataEnricher); this.digitalData = digitalData; - this.storage = storage; - this.options = Object.assign({ - sessionLength: 3600 - }, options); } DigitalDataEnricher.prototype.setDigitalData = function setDigitalData(digitalData) { this.digitalData = digitalData; }; - DigitalDataEnricher.prototype.setStorage = function setStorage(storage) { - this.storage = storage; - }; - - DigitalDataEnricher.prototype.getStorage = function getStorage() { - return this.storage; - }; - DigitalDataEnricher.prototype.enrichDigitalData = function enrichDigitalData() { this.enrichPageData(); - this.enrichUserData(); this.enrichContextData(); }; @@ -5803,11 +5227,6 @@ var DigitalDataEnricher = (function () { page.hash = page.hash || this.getHtmlGlobals().getLocation().hash; }; - DigitalDataEnricher.prototype.enrichUserData = function enrichUserData() { - var user = this.digitalData.user; - user.anonymousId = this.getUserAnonymousId(); - }; - DigitalDataEnricher.prototype.enrichContextData = function enrichContextData() { var context = this.digitalData.context; context.userAgent = this.getHtmlGlobals().getNavigator().userAgent; @@ -5822,25 +5241,12 @@ var DigitalDataEnricher = (function () { return _htmlGlobals2['default']; }; - DigitalDataEnricher.prototype.getUserAnonymousId = function getUserAnonymousId() { - var anonymousId = this.storage.get('user.anonymousId'); - if (!anonymousId) { - anonymousId = (0, _uuid2['default'])(); - this.storage.set('user.anonymousId', anonymousId); - } - return anonymousId; - }; - - DigitalDataEnricher.prototype.getOption = function getOption(name) { - return this.options[name]; - }; - return DigitalDataEnricher; })(); exports['default'] = DigitalDataEnricher; -},{"./functions/htmlGlobals.js":70,"uuid":53}],58:[function(require,module,exports){ +},{"./functions/htmlGlobals.js":65}],54:[function(require,module,exports){ 'use strict'; exports.__esModule = true; @@ -5999,7 +5405,7 @@ var EventDataEnricher = (function () { exports['default'] = EventDataEnricher; -},{"./DDHelper.js":55,"component-type":6}],59:[function(require,module,exports){ +},{"./DDHelper.js":51,"component-type":6}],55:[function(require,module,exports){ 'use strict'; exports.__esModule = true; @@ -6353,7 +5759,7 @@ var EventManager = (function () { exports['default'] = EventManager; -},{"./DDHelper.js":55,"./EventDataEnricher.js":58,"./functions/after.js":64,"./functions/deleteProperty.js":65,"./functions/jsonIsEqual.js":71,"./functions/noop.js":75,"./functions/size.js":77,"async":1,"component-clone":4,"debug":44}],60:[function(require,module,exports){ +},{"./DDHelper.js":51,"./EventDataEnricher.js":54,"./functions/after.js":59,"./functions/deleteProperty.js":60,"./functions/jsonIsEqual.js":66,"./functions/noop.js":70,"./functions/size.js":72,"async":1,"component-clone":4,"debug":44}],56:[function(require,module,exports){ 'use strict'; function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; } @@ -6539,6 +5945,10 @@ var Integration = (function (_EventEmitter) { // abstract }; + Integration.prototype.enrichDigitalData = function enrichDigitalData() { + // abstract + }; + Integration.prototype.trackEvent = function trackEvent() { // abstract }; @@ -6548,127 +5958,7 @@ var Integration = (function (_EventEmitter) { exports['default'] = Integration; -},{"./DDHelper.js":55,"./functions/deleteProperty.js":65,"./functions/each.js":66,"./functions/format.js":67,"./functions/loadIframe.js":72,"./functions/loadPixel.js":73,"./functions/loadScript.js":74,"./functions/noop.js":75,"async":1,"component-emitter":5,"debug":44}],61:[function(require,module,exports){ -'use strict'; - -exports.__esModule = true; - -var _store = require('store'); - -var _store2 = _interopRequireDefault(_store); - -var _jsCookie = require('js-cookie'); - -var _jsCookie2 = _interopRequireDefault(_jsCookie); - -var _debug = require('debug'); - -var _debug2 = _interopRequireDefault(_debug); - -var _topDomain = require('./functions/topDomain.js'); - -var _topDomain2 = _interopRequireDefault(_topDomain); - -function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { 'default': obj }; -} - -function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError("Cannot call a class as a function"); - } -} - -var Storage = (function () { - function Storage(options) { - _classCallCheck(this, Storage); - - this.options = Object.assign({ - cookieDomain: (0, _topDomain2['default'])(location.href), - cookieMaxAge: 31536000000, // default to a year - prefix: 'ddl:' - }, options); - - // http://curl.haxx.se/rfc/cookie_spec.html - // https://publicsuffix.org/list/effective_tld_names.dat - // - // try setting a dummy cookie with the options - // if the cookie isn't set, it probably means - // that the domain is on the public suffix list - // like myapp.herokuapp.com or localhost / ip. - if (this.getOption('cookieDomain')) { - _jsCookie2['default'].set('__tld__', true, { - domain: this.getOption('cookieDomain') - }); - if (!this.get('__tld__')) { - (0, _debug2['default'])('fallback to domain=null'); - this.setOption('cookieDomain', null); - } - _jsCookie2['default'].remove('__tld__'); - } - } - - Storage.prototype.set = function set(key, val, exp) { - key = this.prefix + key; - if (_store2['default'].enabled) { - _store2['default'].set(key, { - val: val, - exp: exp, - time: new Date().getTime() - }); - } else { - exp = exp || this.getOption('cookieMaxAge'); - var expDays = exp / 86400; - _jsCookie2['default'].set(key, val, { - expires: expDays, - domain: this.getOption('cookieDomain') - }); - } - }; - - Storage.prototype.get = function get(key) { - key = this.prefix + key; - if (_store2['default'].enabled) { - var info = _store2['default'].get(key); - if (!info) { - return null; - } - if (new Date().getTime() - info.time > info.exp) { - return null; - } - return info.val; - } - return _jsCookie2['default'].get(key); - }; - - Storage.prototype.remove = function remove(key) { - key = this.prefix + key; - if (_store2['default'].enabled) { - return _store2['default'].remove(key); - } - _jsCookie2['default'].remove(key); - }; - - Storage.prototype.clear = function clear() { - if (_store2['default'].enabled) { - return _store2['default'].clear(); - } - }; - - Storage.prototype.isEnabled = function isEnabled() { - return _store2['default'].enabled; - }; - - Storage.prototype.getOption = function getOption(name) { - return this.options[name]; - }; - - return Storage; -})(); - -exports['default'] = Storage; - -},{"./functions/topDomain.js":79,"debug":44,"js-cookie":48,"store":51}],62:[function(require,module,exports){ +},{"./DDHelper.js":51,"./functions/deleteProperty.js":60,"./functions/each.js":61,"./functions/format.js":62,"./functions/loadIframe.js":67,"./functions/loadPixel.js":68,"./functions/loadScript.js":69,"./functions/noop.js":70,"async":1,"component-emitter":5,"debug":44}],57:[function(require,module,exports){ 'use strict'; var _integrations; @@ -6695,15 +5985,19 @@ var _FacebookPixel = require('./integrations/FacebookPixel.js'); var _FacebookPixel2 = _interopRequireDefault(_FacebookPixel); +var _SegmentStream = require('./integrations/SegmentStream.js'); + +var _SegmentStream2 = _interopRequireDefault(_SegmentStream); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -var integrations = (_integrations = {}, _integrations[_GoogleAnalytics2['default'].getName()] = _GoogleAnalytics2['default'], _integrations[_GoogleTagManager2['default'].getName()] = _GoogleTagManager2['default'], _integrations[_FacebookPixel2['default'].getName()] = _FacebookPixel2['default'], _integrations[_Driveback2['default'].getName()] = _Driveback2['default'], _integrations[_RetailRocket2['default'].getName()] = _RetailRocket2['default'], _integrations); +var integrations = (_integrations = {}, _integrations[_GoogleAnalytics2['default'].getName()] = _GoogleAnalytics2['default'], _integrations[_GoogleTagManager2['default'].getName()] = _GoogleTagManager2['default'], _integrations[_FacebookPixel2['default'].getName()] = _FacebookPixel2['default'], _integrations[_Driveback2['default'].getName()] = _Driveback2['default'], _integrations[_RetailRocket2['default'].getName()] = _RetailRocket2['default'], _integrations[_SegmentStream2['default'].getName()] = _SegmentStream2['default'], _integrations); exports['default'] = integrations; -},{"./integrations/Driveback.js":82,"./integrations/FacebookPixel.js":83,"./integrations/GoogleAnalytics.js":84,"./integrations/GoogleTagManager.js":85,"./integrations/RetailRocket.js":86}],63:[function(require,module,exports){ +},{"./integrations/Driveback.js":75,"./integrations/FacebookPixel.js":76,"./integrations/GoogleAnalytics.js":77,"./integrations/GoogleTagManager.js":78,"./integrations/RetailRocket.js":79,"./integrations/SegmentStream.js":80}],58:[function(require,module,exports){ 'use strict'; function _typeof2(obj) { return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; } @@ -6754,10 +6048,6 @@ var _DigitalDataEnricher = require('./DigitalDataEnricher.js'); var _DigitalDataEnricher2 = _interopRequireDefault(_DigitalDataEnricher); -var _Storage = require('./Storage.js'); - -var _Storage2 = _interopRequireDefault(_Storage); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } @@ -6766,6 +6056,8 @@ function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj === 'undefined' ? 'undefined' : _typeof2(obj); } +var ddManager = undefined; + /** * @type {string} * @private @@ -6796,12 +6088,6 @@ var _digitalData = {}; */ var _ddListener = []; -/** - * @type {Storage} - * @private - */ -var _storage = undefined; - /** * @type {Object} * @private @@ -6853,9 +6139,44 @@ function _prepareGlobals() { } } -var ddManager = { +function _initializeIntegrations(settings, onReady) { + var ready = (0, _after2['default'])((0, _size2['default'])(_integrations), onReady); - VERSION: '1.0.7', + if (settings && (typeof settings === 'undefined' ? 'undefined' : _typeof(settings)) === 'object') { + var integrationSettings = settings.integrations; + if (integrationSettings) { + (0, _each2['default'])(integrationSettings, function (name, options) { + if (typeof _availableIntegrations[name] === 'function') { + var integration = new _availableIntegrations[name](_digitalData, (0, _componentClone2['default'])(options)); + ddManager.addIntegration(integration); + } + }); + } + + if ((0, _size2['default'])(_integrations) > 0) { + (0, _each2['default'])(_integrations, function (name, integration) { + if (!integration.isLoaded() || integration.getOption('noConflict')) { + integration.once('ready', function () { + integration.enrichDigitalData(); + _eventManager.addCallback(['on', 'event', function (event) { + integration.trackEvent(event); + }]); + ready(); + }); + integration.initialize(); + } else { + ready(); + } + }); + } else { + ready(); + } + } +} + +ddManager = { + + VERSION: '1.0.9', setAvailableIntegrations: function setAvailableIntegrations(availableIntegrations) { _availableIntegrations = availableIntegrations; @@ -6922,15 +6243,8 @@ var ddManager = { _prepareGlobals(); - // initialize storage - _storage = new _Storage2['default']({ - cookieDomain: settings.domain - }); - // initialize digital data enricher - var digitalDataEnricher = new _DigitalDataEnricher2['default'](_digitalData, _storage, { - sessionLength: settings.sessionLength - }); + var digitalDataEnricher = new _DigitalDataEnricher2['default'](_digitalData); digitalDataEnricher.enrichDigitalData(); // initialize event manager @@ -6939,41 +6253,12 @@ var ddManager = { _eventManager.setAutoEvents(new _AutoEvents2['default'](settings.autoEvents)); } - if (settings && (typeof settings === 'undefined' ? 'undefined' : _typeof(settings)) === 'object') { - var integrationSettings = settings.integrations; - if (integrationSettings) { - (0, _each2['default'])(integrationSettings, function (name, options) { - if (typeof _availableIntegrations[name] === 'function') { - var integration = new _availableIntegrations[name](_digitalData, (0, _componentClone2['default'])(options)); - ddManager.addIntegration(integration); - } - }); - } - } - - var ready = (0, _after2['default'])((0, _size2['default'])(_integrations), function () { + _initializeIntegrations(settings, function () { _eventManager.initialize(); _isReady = true; ddManager.emit('ready'); }); - if ((0, _size2['default'])(_integrations) > 0) { - (0, _each2['default'])(_integrations, function (name, integration) { - if (!integration.isLoaded() || integration.getOption('noConflict')) { - integration.once('ready', ready); - integration.initialize(); - } else { - ready(); - } - // add event listeners for integration - _eventManager.addCallback(['on', 'event', function (event) { - integration.trackEvent(event); - }]); - }); - } else { - ready(); - } - _isInitialized = true; ddManager.emit('initialize', settings); }, @@ -7054,7 +6339,7 @@ ddManager.on = ddManager.addEventListener = function (event, handler) { exports['default'] = ddManager; -},{"./AutoEvents.js":54,"./DDHelper.js":55,"./DigitalDataEnricher.js":57,"./EventManager.js":59,"./Integration.js":60,"./Storage.js":61,"./functions/after.js":64,"./functions/each.js":66,"./functions/size.js":77,"async":1,"component-clone":4,"component-emitter":5}],64:[function(require,module,exports){ +},{"./AutoEvents.js":50,"./DDHelper.js":51,"./DigitalDataEnricher.js":53,"./EventManager.js":55,"./Integration.js":56,"./functions/after.js":59,"./functions/each.js":61,"./functions/size.js":72,"async":1,"component-clone":4,"component-emitter":5}],59:[function(require,module,exports){ "use strict"; exports.__esModule = true; @@ -7068,7 +6353,7 @@ exports["default"] = function (times, fn) { }; }; -},{}],65:[function(require,module,exports){ +},{}],60:[function(require,module,exports){ "use strict"; exports.__esModule = true; @@ -7081,7 +6366,7 @@ exports["default"] = function (obj, prop) { } }; -},{}],66:[function(require,module,exports){ +},{}],61:[function(require,module,exports){ "use strict"; exports.__esModule = true; @@ -7094,7 +6379,7 @@ exports["default"] = function (obj, fn) { } }; -},{}],67:[function(require,module,exports){ +},{}],62:[function(require,module,exports){ "use strict"; exports.__esModule = true; @@ -7133,7 +6418,7 @@ function format(str) { }); } -},{}],68:[function(require,module,exports){ +},{}],63:[function(require,module,exports){ 'use strict'; exports.__esModule = true; @@ -7162,7 +6447,7 @@ function _keyToArray(key) { return key.split('.'); } -},{}],69:[function(require,module,exports){ +},{}],64:[function(require,module,exports){ 'use strict'; exports.__esModule = true; @@ -7177,7 +6462,7 @@ function getQueryParam(name, queryString) { return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' ')); } -},{}],70:[function(require,module,exports){ +},{}],65:[function(require,module,exports){ "use strict"; exports.__esModule = true; @@ -7195,7 +6480,7 @@ exports["default"] = { } }; -},{}],71:[function(require,module,exports){ +},{}],66:[function(require,module,exports){ 'use strict'; exports.__esModule = true; @@ -7210,7 +6495,7 @@ function jsonIsEqual(json1, json2) { return json1 === json2; } -},{}],72:[function(require,module,exports){ +},{}],67:[function(require,module,exports){ 'use strict'; exports.__esModule = true; @@ -7270,7 +6555,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -},{"./scriptOnLoad.js":76,"async":1}],73:[function(require,module,exports){ +},{"./scriptOnLoad.js":71,"async":1}],68:[function(require,module,exports){ 'use strict'; exports.__esModule = true; @@ -7306,7 +6591,7 @@ function error(fn, message, img) { }; } -},{}],74:[function(require,module,exports){ +},{}],69:[function(require,module,exports){ 'use strict'; exports.__esModule = true; @@ -7365,14 +6650,14 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } -},{"./scriptOnLoad.js":76,"async":1}],75:[function(require,module,exports){ +},{"./scriptOnLoad.js":71,"async":1}],70:[function(require,module,exports){ "use strict"; exports.__esModule = true; exports["default"] = function () {}; -},{}],76:[function(require,module,exports){ +},{}],71:[function(require,module,exports){ 'use strict'; exports.__esModule = true; @@ -7427,7 +6712,7 @@ function attachEvent(el, fn) { }); } -},{}],77:[function(require,module,exports){ +},{}],72:[function(require,module,exports){ "use strict"; exports.__esModule = true; @@ -7440,7 +6725,7 @@ exports["default"] = function (obj) { return size; }; -},{}],78:[function(require,module,exports){ +},{}],73:[function(require,module,exports){ 'use strict'; exports.__esModule = true; @@ -7467,144 +6752,7 @@ function throwError(code, message) { throw error; } -},{"debug":44}],79:[function(require,module,exports){ -'use strict'; - -exports.__esModule = true; -exports['default'] = topDomain; - -var _url = require('./url.js'); - -var _jsCookie = require('js-cookie'); - -var _jsCookie2 = _interopRequireDefault(_jsCookie); - -function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { 'default': obj }; -} - -/** - * Levels returns all levels of the given url. - * - * @param {String} url - * @return {Array} - * @api public - */ -function getLevels(url) { - var host = (0, _url.parse)(url).hostname; - var parts = host.split('.'); - var last = parts[parts.length - 1]; - var levels = []; - - // Ip address. - if (parts.length === 4 && parseInt(last, 10) === last) { - return levels; - } - - // Localhost. - if (parts.length <= 1) { - return levels; - } - - // Create levels. - for (var i = parts.length - 2; i >= 0; --i) { - levels.push(parts.slice(i).join('.')); - } - - return levels; -} - -/** - * Get the top domain. - * - * The function constructs the levels of domain - * and attempts to set a global cookie on each one - * when it succeeds it returns the top level domain. - * - * The method returns an empty string when the hostname - * is an ip or `localhost`. - * - * Example levels: - * - * domain.levels('http://www.google.co.uk'); - * // => ["co.uk", "google.co.uk", "www.google.co.uk"] - * - * Example: - * - * domain('http://localhost:3000/baz'); - * // => '' - * domain('http://dev:3000/baz'); - * // => '' - * domain('http://127.0.0.1:3000/baz'); - * // => '' - * domain('http://example.com/baz'); - * // => 'example.com' - * - * @param {String} url - * @return {String} - * @api public - */ - -function topDomain(url) { - var levels = getLevels(url); - - // Lookup the real top level one. - for (var i = 0; i < levels.length; ++i) { - var cname = '__tld__'; - var domain = levels[i]; - var opts = { - domain: '.' + domain - }; - _jsCookie2['default'].set(cname, 1, opts); - if (_jsCookie2['default'].get(cname)) { - _jsCookie2['default'].set(cname, null, opts); - return domain; - } - } - - return ''; -} - -},{"./url.js":80,"js-cookie":48}],80:[function(require,module,exports){ -'use strict'; - -exports.__esModule = true; -exports.parse = parse; -/** - * Return default port for `protocol`. - * - * @param {String} protocol - * @return {String} - * @api private - */ -function port(protocol) { - switch (protocol) { - case 'http:': - return 80; - case 'https:': - return 443; - default: - return location.port; - } -} - -function parse(url) { - var a = document.createElement('a'); - a.href = url; - return { - href: a.href, - host: a.host || location.host, - port: a.port === '0' || a.port === '' ? port(a.protocol) : a.port, - hash: a.hash, - hostname: a.hostname || location.hostname, - pathname: a.pathname.charAt(0) !== '/' ? '/' + a.pathname : a.pathname, - protocol: !a.protocol || a.protocol === ':' ? location.protocol : a.protocol, - search: a.search, - query: a.search.slice(1) - }; -} - -},{}],81:[function(require,module,exports){ +},{"debug":44}],74:[function(require,module,exports){ 'use strict'; require('./polyfill.js'); @@ -7626,7 +6774,7 @@ _ddManager2['default'].processEarlyStubCalls(); window.ddManager = _ddManager2['default']; -},{"./availableIntegrations.js":62,"./ddManager.js":63,"./polyfill.js":87}],82:[function(require,module,exports){ +},{"./availableIntegrations.js":57,"./ddManager.js":58,"./polyfill.js":81}],75:[function(require,module,exports){ 'use strict'; function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; } @@ -7736,7 +6884,7 @@ var Driveback = (function (_Integration) { exports['default'] = Driveback; -},{"./../Integration.js":60,"./../functions/deleteProperty.js":65,"./../functions/noop.js":75}],83:[function(require,module,exports){ +},{"./../Integration.js":56,"./../functions/deleteProperty.js":60,"./../functions/noop.js":70}],76:[function(require,module,exports){ 'use strict'; function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; } @@ -7927,7 +7075,7 @@ var FacebookPixel = (function (_Integration) { exports['default'] = FacebookPixel; -},{"./../Integration.js":60,"./../functions/deleteProperty.js":65,"component-type":6}],84:[function(require,module,exports){ +},{"./../Integration.js":56,"./../functions/deleteProperty.js":60,"component-type":6}],77:[function(require,module,exports){ 'use strict'; function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; } @@ -8046,8 +7194,9 @@ var GoogleAnalytics = (function (_Integration) { metrics: {}, dimensions: {}, contentGroupings: {}, - namespace: undefined, - noConflict: false + namespace: 'ddl', + noConflict: false, + filterEvents: [] }, options); var _this = _possibleConstructorReturn(this, _Integration.call(this, digitalData, optionsWithDefaults)); @@ -8099,7 +7248,7 @@ var GoogleAnalytics = (function (_Integration) { cookieDomain: this.getOption('domain'), siteSpeedSampleRate: this.getOption('siteSpeedSampleRate'), allowLinker: true, - name: this.getOption('namespace') + name: this.getOption('namespace') ? this.getOption('namespace') : undefined }); // display advertising @@ -8203,47 +7352,48 @@ var GoogleAnalytics = (function (_Integration) { }; GoogleAnalytics.prototype.trackEvent = function trackEvent(event) { - if (this.getOption('trackOnlyCustomEvents')) { - if (['Viewed Page', 'Viewed Product', 'Clicked Product', 'Viewed Product Detail', 'Added Product', 'Removed Product', 'Completed Transaction', 'Refunded Transaction', 'Viewed Product Category', 'Viewed Checkout Step', 'Completed Checkout Step'].indexOf(event.name) < 0) { + var filterEvents = this.getOption('filterEvents') || []; + if (filterEvents.indexOf(event.name) >= 0) { + return; + } + + if (event.name === 'Viewed Page') { + if (!this.getOption('noConflict')) { + this.onViewedPage(event); + } + } else if (this.getOption('enhancedEcommerce')) { + if (event.name === 'Viewed Product') { + this.onViewedProduct(event); + } else if (event.name === 'Clicked Product') { + this.onClickedProduct(event); + } else if (event.name === 'Viewed Product Detail') { + this.onViewedProductDetail(event); + } else if (event.name === 'Added Product') { + this.onAddedProduct(event); + } else if (event.name === 'Removed Product') { + this.onRemovedProduct(event); + } else if (event.name === 'Completed Transaction') { + this.onCompletedTransactionEnhanced(event); + } else if (event.name === 'Refunded Transaction') { + this.onRefundedTransaction(event); + } else if (event.name === 'Viewed Product Category') { + this.onViewedProductCategory(event); + } else if (event.name === 'Viewed Campaign') { + this.onViewedCampaign(event); + } else if (event.name === 'Clicked Campaign') { + this.onClickedCampaign(event); + } else if (event.name === 'Viewed Checkout Step') { + this.onViewedCheckoutStep(event); + } else if (event.name === 'Completed Checkout Step') { + this.onCompletedCheckoutStep(event); + } else { this.onCustomEvent(event); } } else { - if (event.name === 'Viewed Page') { - this.onViewedPage(event); - } else if (this.getOption('enhancedEcommerce')) { - if (event.name === 'Viewed Product') { - this.onViewedProduct(event); - } else if (event.name === 'Clicked Product') { - this.onClickedProduct(event); - } else if (event.name === 'Viewed Product Detail') { - this.onViewedProductDetail(event); - } else if (event.name === 'Added Product') { - this.onAddedProduct(event); - } else if (event.name === 'Removed Product') { - this.onRemovedProduct(event); - } else if (event.name === 'Completed Transaction') { - this.onCompletedTransactionEnhanced(event); - } else if (event.name === 'Refunded Transaction') { - this.onRefundedTransaction(event); - } else if (event.name === 'Viewed Product Category') { - this.onViewedProductCategory(event); - } else if (event.name === 'Viewed Campaign') { - this.onViewedCampaign(event); - } else if (event.name === 'Clicked Campaign') { - this.onClickedCampaign(event); - } else if (event.name === 'Viewed Checkout Step') { - this.onViewedCheckoutStep(event); - } else if (event.name === 'Completed Checkout Step') { - this.onCompletedCheckoutStep(event); - } else { - this.onCustomEvent(event); - } + if (event.name === 'Completed Transaction') { + this.onCompletedTransaction(event); } else { - if (event.name === 'Completed Transaction') { - this.onCompletedTransaction(event); - } else { - this.onCustomEvent(event); - } + this.onCustomEvent(event); } } }; @@ -8603,7 +7753,7 @@ var GoogleAnalytics = (function (_Integration) { exports['default'] = GoogleAnalytics; -},{"./../Integration.js":60,"./../functions/deleteProperty.js":65,"./../functions/each.js":66,"./../functions/getProperty.js":68,"./../functions/size.js":77,"component-clone":4,"component-type":6}],85:[function(require,module,exports){ +},{"./../Integration.js":56,"./../functions/deleteProperty.js":60,"./../functions/each.js":61,"./../functions/getProperty.js":63,"./../functions/size.js":72,"component-clone":4,"component-type":6}],78:[function(require,module,exports){ 'use strict'; function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; } @@ -8699,7 +7849,7 @@ var GoogleTagManager = (function (_Integration) { exports['default'] = GoogleTagManager; -},{"./../Integration.js":60,"./../functions/deleteProperty.js":65}],86:[function(require,module,exports){ +},{"./../Integration.js":56,"./../functions/deleteProperty.js":60}],79:[function(require,module,exports){ 'use strict'; function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; } @@ -8770,7 +7920,7 @@ var RetailRocket = (function (_Integration) { type: 'script', attr: { id: 'rrApi-jssdk', - src: '//cdn.retailrocket.ru/content/javascript/api.js' + src: '//cdn.retailrocket.ru/content/javascript/tracking.js' } }); return _this; @@ -9037,7 +8187,171 @@ var RetailRocket = (function (_Integration) { exports['default'] = RetailRocket; -},{"./../Integration.js":60,"./../functions/deleteProperty.js":65,"./../functions/format.js":67,"./../functions/getQueryParam.js":69,"./../functions/throwError.js":78,"component-type":6}],87:[function(require,module,exports){ +},{"./../Integration.js":56,"./../functions/deleteProperty.js":60,"./../functions/format.js":62,"./../functions/getQueryParam.js":64,"./../functions/throwError.js":73,"component-type":6}],80:[function(require,module,exports){ +'use strict'; + +function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; } + +exports.__esModule = true; + +var _Integration2 = require('./../Integration.js'); + +var _Integration3 = _interopRequireDefault(_Integration2); + +var _deleteProperty = require('./../functions/deleteProperty.js'); + +var _deleteProperty2 = _interopRequireDefault(_deleteProperty); + +var _each = require('./../functions/each.js'); + +var _each2 = _interopRequireDefault(_each); + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : { 'default': obj }; +} + +function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +} + +function _possibleConstructorReturn(self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + }return call && ((typeof call === 'undefined' ? 'undefined' : _typeof(call)) === "object" || typeof call === "function") ? call : self; +} + +function _inherits(subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === 'undefined' ? 'undefined' : _typeof(superClass))); + }subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } });if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; +} + +var SegmentStream = (function (_Integration) { + _inherits(SegmentStream, _Integration); + + function SegmentStream(digitalData, options) { + _classCallCheck(this, SegmentStream); + + var optionsWithDefaults = Object.assign({ + sessionLength: 1800, // 30 min + storagePrefix: 'ss:' + }, options); + + var _this = _possibleConstructorReturn(this, _Integration.call(this, digitalData, optionsWithDefaults)); + + _this.addTag({ + type: 'script', + attr: { + id: 'segmentstream-sdk', + src: '//cdn.driveback.ru/js/segmentstream.js' + } + }); + return _this; + } + + SegmentStream.getName = function getName() { + return 'SegmentStream'; + }; + + SegmentStream.prototype.initialize = function initialize() { + var _this2 = this; + + var ssApi = window.ssApi = window.ssApi || []; + + if (ssApi.initialize) return; + + if (ssApi.invoked) { + throw new Error('SegmentStream snippet included twice.'); + } + + ssApi.invoked = true; + + ssApi.methods = ['initialize', 'track', 'getData', 'getAnonymousId', 'pushOnReady']; + + ssApi.factory = function (method) { + return function stub() { + var args = Array.prototype.slice.call(arguments); + args.unshift(method); + ssApi.push(args); + return ssApi; + }; + }; + + for (var i = 0; i < ssApi.methods.length; i++) { + var key = ssApi.methods[i]; + ssApi[key] = ssApi.factory(key); + } + + ssApi.initialize(this._options); + ssApi.pushOnReady(function () { + _this2.ready(); + }); + this.load(); + }; + + SegmentStream.prototype.isLoaded = function isLoaded() { + return !!(window.ssApi && window.ssApi.initialize); + }; + + SegmentStream.prototype.reset = function reset() { + (0, _deleteProperty2['default'])(window, 'ssApi'); + }; + + SegmentStream.prototype.enrichDigitalData = function enrichDigitalData() { + var _this3 = this; + + function lowercaseFirstLetter(string) { + return string.charAt(0).toLowerCase() + string.slice(1); + } + var attributes = window.ssApi.getData().attributes; + this._digitalData.user.ssAttributes = {}; + this._digitalData.user.anonymousId = window.ssApi.getAnonymousId(); + (0, _each2['default'])(attributes, function (name, value) { + var key = lowercaseFirstLetter(name); + _this3._digitalData.user.ssAttributes[key] = value; + }); + }; + + SegmentStream.prototype.trackEvent = function trackEvent(event) { + var methods = { + 'Viewed Page': 'onViewedPage', + 'Viewed Product Detail': 'onViewedProductDetail', + 'Added Product': 'onAddedProduct' + }; + + var method = methods[event.name]; + if (method) { + this[method](event); + } + }; + + SegmentStream.prototype.onViewedPage = function onViewedPage() { + window.ssApi.track('Viewed Page'); + this.enrichDigitalData(); + }; + + SegmentStream.prototype.onViewedProductDetail = function onViewedProductDetail(event) { + window.ssApi.track('Viewed Product Detail', { + price: event.product.unitSalePrice || event.product.unitPrice || 0 + }); + this.enrichDigitalData(); + }; + + SegmentStream.prototype.onAddedProduct = function onAddedProduct(event) { + window.ssApi.track('Added Product', { + price: event.product.unitSalePrice || event.product.unitPrice || 0 + }); + this.enrichDigitalData(); + }; + + return SegmentStream; +})(_Integration3['default']); + +exports['default'] = SegmentStream; + +},{"./../Integration.js":56,"./../functions/deleteProperty.js":60,"./../functions/each.js":61}],81:[function(require,module,exports){ 'use strict'; require('core-js/modules/es5'); @@ -9046,4 +8360,4 @@ require('core-js/modules/es6.object.assign'); require('core-js/modules/es6.string.trim'); -},{"core-js/modules/es5":41,"core-js/modules/es6.object.assign":42,"core-js/modules/es6.string.trim":43}]},{},[81]); +},{"core-js/modules/es5":41,"core-js/modules/es6.object.assign":42,"core-js/modules/es6.string.trim":43}]},{},[74]); diff --git a/dist/dd-manager.min.js b/dist/dd-manager.min.js index ca70ab1..6312982 100644 --- a/dist/dd-manager.min.js +++ b/dist/dd-manager.min.js @@ -1,4 +1,4 @@ -!function t(e,n,r){function o(a,c){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!c&&u)return u(a,!0);if(i)return i(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var f=n[a]={exports:{}};e[a][0].call(f.exports,function(t){var n=e[a][1][t];return o(n?n:t)},f,f.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a=0&&t.length%1===0}function f(t,e){for(var n=-1,r=t.length;++nr?r:null}):(n=N(t),e=n.length,function(){return r++,e>r?n[r]:null})}function m(t,e){return e=null==e?t.length-1:+e,function(){for(var n=Math.max(arguments.length-e,0),r=Array(n),o=0;n>o;o++)r[o]=arguments[o+e];switch(e){case 0:return t.call(this,r);case 1:return t.call(this,arguments[0],r)}}}function v(t){return function(e,n,r){return t(e,r)}}function w(t){return function(e,n,o){o=u(o||r),e=e||[];var i=y(e);if(0>=t)return o(null);var a=!1,s=0,f=!1;!function l(){if(a&&0>=s)return o(null);for(;t>s&&!f;){var r=i();if(null===r)return a=!0,void(0>=s&&o(null));s+=1,n(e[r],r,c(function(t){s-=1,t?(o(t),f=!0):l()}))}}()}}function b(t){return function(e,n,r){return t(R.eachOf,e,n,r)}}function E(t){return function(e,n,r,o){return t(w(n),e,r,o)}}function k(t){return function(e,n,r){return t(R.eachOfSeries,e,n,r)}}function A(t,e,n,o){o=u(o||r),e=e||[];var i=s(e)?[]:{};t(e,function(t,e,r){n(t,function(t,n){i[e]=n,r(t)})},function(t){o(t,i)})}function _(t,e,n,r){var o=[];t(e,function(t,e,r){n(t,function(n){n&&o.push({index:e,value:t}),r()})},function(){r(l(o.sort(function(t,e){return t.index-e.index}),function(t){return t.value}))})}function j(t,e,n,r){_(t,e,function(t,e){n(t,function(t){e(!t)})},r)}function P(t,e,n){return function(r,o,i,a){function c(){a&&a(n(!1,void 0))}function u(t,r,o){return a?void i(t,function(r){a&&e(r)&&(a(n(!0,t)),a=i=!1),o()}):o()}arguments.length>3?t(r,o,u,c):(a=i,i=o,t(r,u,c))}}function I(t,e){return e}function C(t,e,n){n=n||r;var o=s(e)?[]:{};t(e,function(t,e,n){t(m(function(t,r){r.length<=1&&(r=r[0]),o[e]=r,n(t)}))},function(t){n(t,o)})}function O(t,e,n,r){var o=[];t(e,function(t,e,r){n(t,function(t,e){o=o.concat(e||[]),r(t)})},function(t){r(t,o)})}function S(t,e,n){function o(t,e,n,o){if(null!=o&&"function"!=typeof o)throw new Error("task callback must be a function");return t.started=!0,U(e)||(e=[e]),0===e.length&&t.idle()?R.setImmediate(function(){t.drain()}):(f(e,function(e){var i={data:e,callback:o||r};n?t.tasks.unshift(i):t.tasks.push(i),t.tasks.length===t.concurrency&&t.saturated()}),void R.setImmediate(t.process))}function i(t,e){return function(){a-=1;var n=!1,r=arguments;f(e,function(t){f(u,function(e,r){e!==t||n||(u.splice(r,1),n=!0)}),t.callback.apply(t,r)}),t.tasks.length+a===0&&t.drain(),t.process()}}if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var a=0,u=[],s={tasks:[],concurrency:e,payload:n,saturated:r,empty:r,drain:r,started:!1,paused:!1,push:function(t,e){o(s,t,!1,e)},kill:function(){s.drain=r,s.tasks=[]},unshift:function(t,e){o(s,t,!0,e)},process:function(){if(!s.paused&&a=e;e++)R.setImmediate(s.process)}}};return s}function D(t){return m(function(e,n){e.apply(null,n.concat([m(function(e,n){"object"==typeof console&&(e?console.error&&console.error(e):console[t]&&f(n,function(e){console[t](e)}))})]))})}function x(t){return function(e,n,r){t(d(e),n,r)}}function T(t){return m(function(e,n){var r=m(function(n){var r=this,o=n.pop();return t(e,function(t,e,o){t.apply(r,n.concat([o]))},o)});return n.length?r.apply(this,n):r})}function $(t){return m(function(e){var n=e.pop();e.push(function(){var t=arguments;r?R.setImmediate(function(){n.apply(null,t)}):n.apply(null,t)});var r=!0;t.apply(this,e),r=!1})}var L,R={},M="object"==typeof self&&self.self===self&&self||"object"==typeof n&&n.global===n&&n||this;null!=M&&(L=M.async),R.noConflict=function(){return M.async=L,R};var B=Object.prototype.toString,U=Array.isArray||function(t){return"[object Array]"===B.call(t)},V=function(t){var e=typeof t;return"function"===e||"object"===e&&!!t},N=Object.keys||function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(n);return e},q="function"==typeof setImmediate&&setImmediate,z=q?function(t){q(t)}:function(t){setTimeout(t,0)};"object"==typeof t&&"function"==typeof t.nextTick?R.nextTick=t.nextTick:R.nextTick=z,R.setImmediate=q?z:R.nextTick,R.forEach=R.each=function(t,e,n){return R.eachOf(t,v(e),n)},R.forEachSeries=R.eachSeries=function(t,e,n){return R.eachOfSeries(t,v(e),n)},R.forEachLimit=R.eachLimit=function(t,e,n,r){return w(e)(t,v(n),r)},R.forEachOf=R.eachOf=function(t,e,n){function o(t){s--,t?n(t):null===i&&0>=s&&n(null)}n=u(n||r),t=t||[];for(var i,a=y(t),s=0;null!=(i=a());)s+=1,e(t[i],i,c(o));0===s&&n(null)},R.forEachOfSeries=R.eachOfSeries=function(t,e,n){function o(){var r=!0;return null===a?n(null):(e(t[a],a,c(function(t){if(t)n(t);else{if(a=i(),null===a)return n(null);r?R.setImmediate(o):o()}})),void(r=!1))}n=u(n||r),t=t||[];var i=y(t),a=i();o()},R.forEachOfLimit=R.eachOfLimit=function(t,e,n,r){w(e)(t,n,r)},R.map=b(A),R.mapSeries=k(A),R.mapLimit=E(A),R.inject=R.foldl=R.reduce=function(t,e,n,r){R.eachOfSeries(t,function(t,r,o){n(e,t,function(t,n){e=n,o(t)})},function(t){r(t,e)})},R.foldr=R.reduceRight=function(t,e,n,r){var i=l(t,o).reverse();R.reduce(i,e,n,r)},R.transform=function(t,e,n,r){3===arguments.length&&(r=n,n=e,e=U(t)?[]:{}),R.eachOf(t,function(t,r,o){n(e,t,r,o)},function(t){r(t,e)})},R.select=R.filter=b(_),R.selectLimit=R.filterLimit=E(_),R.selectSeries=R.filterSeries=k(_),R.reject=b(j),R.rejectLimit=E(j),R.rejectSeries=k(j),R.any=R.some=P(R.eachOf,i,o),R.someLimit=P(R.eachOfLimit,i,o),R.all=R.every=P(R.eachOf,a,a),R.everyLimit=P(R.eachOfLimit,a,a),R.detect=P(R.eachOf,o,I),R.detectSeries=P(R.eachOfSeries,o,I),R.detectLimit=P(R.eachOfLimit,o,I),R.sortBy=function(t,e,n){function r(t,e){var n=t.criteria,r=e.criteria;return r>n?-1:n>r?1:0}R.map(t,function(t,n){e(t,function(e,r){e?n(e):n(null,{value:t,criteria:r})})},function(t,e){return t?n(t):void n(null,l(e.sort(r),function(t){return t.value}))})},R.auto=function(t,e,n){function o(t){y.unshift(t)}function i(t){var e=g(y,t);e>=0&&y.splice(e,1)}function a(){s--,f(y.slice(0),function(t){t()})}n||(n=e,e=null),n=u(n||r);var c=N(t),s=c.length;if(!s)return n(null);e||(e=s);var l={},d=0,y=[];o(function(){s||n(null,l)}),f(c,function(r){function c(){return e>d&&p(v,function(t,e){return t&&l.hasOwnProperty(e)},!0)&&!l.hasOwnProperty(r)}function u(){c()&&(d++,i(u),f[f.length-1](y,l))}for(var s,f=U(t[r])?t[r]:[t[r]],y=m(function(t,e){if(d--,e.length<=1&&(e=e[0]),t){var o={};h(l,function(t,e){o[e]=t}),o[r]=e,n(t,o)}else l[r]=e,R.setImmediate(a)}),v=f.slice(0,f.length-1),w=v.length;w--;){if(!(s=t[v[w]]))throw new Error("Has inexistant dependency");if(U(s)&&g(s,r)>=0)throw new Error("Has cyclic dependencies")}c()?(d++,f[f.length-1](y,l)):o(u)})},R.retry=function(t,e,n){function r(t,e){if("number"==typeof e)t.times=parseInt(e,10)||i;else{if("object"!=typeof e)throw new Error("Unsupported argument type for 'times': "+typeof e);t.times=parseInt(e.times,10)||i,t.interval=parseInt(e.interval,10)||a}}function o(t,e){function n(t,n){return function(r){t(function(t,e){r(!t||n,{err:t,result:e})},e)}}function r(t){return function(e){setTimeout(function(){e(null)},t)}}for(;u.times;){var o=!(u.times-=1);c.push(n(u.task,o)),!o&&u.interval>0&&c.push(r(u.interval))}R.series(c,function(e,n){n=n[n.length-1],(t||u.callback)(n.err,n.result)})}var i=5,a=0,c=[],u={times:i,interval:a},s=arguments.length;if(1>s||s>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=s&&"function"==typeof t&&(n=e,e=t),"function"!=typeof t&&r(u,t),u.callback=n,u.task=e,u.callback?o():o},R.waterfall=function(t,e){function n(t){return m(function(r,o){if(r)e.apply(null,[r].concat(o));else{var i=t.next();i?o.push(n(i)):o.push(e),$(t).apply(null,o)}})}if(e=u(e||r),!U(t)){var o=new Error("First argument to waterfall must be an array of functions");return e(o)}return t.length?void n(R.iterator(t))():e()},R.parallel=function(t,e){C(R.eachOf,t,e)},R.parallelLimit=function(t,e,n){C(w(e),t,n)},R.series=function(t,e){C(R.eachOfSeries,t,e)},R.iterator=function(t){function e(n){function r(){return t.length&&t[n].apply(null,arguments),r.next()}return r.next=function(){return nr;){var i=r+(o-r+1>>>1);n(e,t[i])>=0?r=i:o=i-1}return r}function i(t,e,i,a){if(null!=a&&"function"!=typeof a)throw new Error("task callback must be a function");return t.started=!0,U(e)||(e=[e]),0===e.length?R.setImmediate(function(){t.drain()}):void f(e,function(e){var c={data:e,priority:i,callback:"function"==typeof a?a:r};t.tasks.splice(o(t.tasks,c,n)+1,0,c),t.tasks.length===t.concurrency&&t.saturated(),R.setImmediate(t.process)})}var a=R.queue(t,e);return a.push=function(t,e,n){i(a,t,e,n)},delete a.unshift,a},R.cargo=function(t,e){return S(t,1,e)},R.log=D("log"),R.dir=D("dir"),R.memoize=function(t,e){var n={},r={};e=e||o;var i=m(function(o){var i=o.pop(),a=e.apply(null,o);a in n?R.setImmediate(function(){i.apply(null,n[a])}):a in r?r[a].push(i):(r[a]=[i],t.apply(null,o.concat([m(function(t){n[a]=t;var e=r[a];delete r[a];for(var o=0,i=e.length;i>o;o++)e[o].apply(null,t)})])))});return i.memo=n,i.unmemoized=t,i},R.unmemoize=function(t){return function(){return(t.unmemoized||t).apply(null,arguments)}},R.times=x(R.map),R.timesSeries=x(R.mapSeries),R.timesLimit=function(t,e,n,r){return R.mapLimit(d(t),e,n,r)},R.seq=function(){var t=arguments;return m(function(e){var n=this,o=e[e.length-1];"function"==typeof o?e.pop():o=r,R.reduce(t,e,function(t,e,r){e.apply(n,t.concat([m(function(t,e){r(t,e)})]))},function(t,e){o.apply(n,[t].concat(e))})})},R.compose=function(){return R.seq.apply(null,Array.prototype.reverse.call(arguments))},R.applyEach=T(R.eachOf),R.applyEachSeries=T(R.eachOfSeries),R.forever=function(t,e){function n(t){return t?o(t):void i(n)}var o=c(e||r),i=$(t);n()},R.ensureAsync=$,R.constant=m(function(t){var e=[null].concat(t);return function(t){return t.apply(this,e)}}),R.wrapSync=R.asyncify=function(t){return m(function(e){var n,r=e.pop();try{n=t.apply(this,e)}catch(o){return r(o)}V(n)&&"function"==typeof n.then?n.then(function(t){r(null,t)})["catch"](function(t){r(t.message?t:new Error(t))}):r(null,n)})},"object"==typeof e&&e.exports?e.exports=R:"function"==typeof define&&define.amd?define([],function(){return R}):M.async=R}()}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:50}],2:[function(t,e,n){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(t){"use strict";function e(t){var e=t.charCodeAt(0);return e===a||e===l?62:e===c||e===d?63:u>e?-1:u+10>e?e-u+26+26:f+26>e?e-f:s+26>e?e-s+26:void 0}function n(t){function n(t){s[l++]=t}var r,o,a,c,u,s;if(t.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var f=t.length;u="="===t.charAt(f-2)?2:"="===t.charAt(f-1)?1:0,s=new i(3*t.length/4-u),a=u>0?t.length-4:t.length;var l=0;for(r=0,o=0;a>r;r+=4,o+=3)c=e(t.charAt(r))<<18|e(t.charAt(r+1))<<12|e(t.charAt(r+2))<<6|e(t.charAt(r+3)),n((16711680&c)>>16),n((65280&c)>>8),n(255&c);return 2===u?(c=e(t.charAt(r))<<2|e(t.charAt(r+1))>>4,n(255&c)):1===u&&(c=e(t.charAt(r))<<10|e(t.charAt(r+1))<<4|e(t.charAt(r+2))>>2,n(c>>8&255),n(255&c)),s}function o(t){function e(t){return r.charAt(t)}function n(t){return e(t>>18&63)+e(t>>12&63)+e(t>>6&63)+e(63&t)}var o,i,a,c=t.length%3,u="";for(o=0,a=t.length-c;a>o;o+=3)i=(t[o]<<16)+(t[o+1]<<8)+t[o+2],u+=n(i);switch(c){case 1:i=t[t.length-1],u+=e(i>>2),u+=e(i<<4&63),u+="==";break;case 2:i=(t[t.length-2]<<8)+t[t.length-1],u+=e(i>>10),u+=e(i>>4&63),u+=e(i<<2&63),u+="="}return u}var i="undefined"!=typeof Uint8Array?Uint8Array:Array,a="+".charCodeAt(0),c="/".charCodeAt(0),u="0".charCodeAt(0),s="a".charCodeAt(0),f="A".charCodeAt(0),l="-".charCodeAt(0),d="_".charCodeAt(0);t.toByteArray=n,t.fromByteArray=o}("undefined"==typeof n?this.base64js={}:n)},{}],3:[function(t,e,n){(function(e){function r(){function t(){}try{var e=new Uint8Array(1);return e.foo=function(){return 42},e.constructor=t,42===e.foo()&&e.constructor===t&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(n){return!1}}function o(){return i.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(t){return this instanceof i?(this.length=0,this.parent=void 0,"number"==typeof t?a(this,t):"string"==typeof t?c(this,t,arguments.length>1?arguments[1]:"utf8"):u(this,t)):arguments.length>1?new i(t,arguments[1]):new i(t)}function a(t,e){if(t=g(t,0>e?0:0|y(e)),!i.TYPED_ARRAY_SUPPORT)for(var n=0;e>n;n++)t[n]=0;return t}function c(t,e,n){("string"!=typeof n||""===n)&&(n="utf8");var r=0|v(e,n);return t=g(t,r),t.write(e,n),t}function u(t,e){if(i.isBuffer(e))return s(t,e);if(J(e))return f(t,e);if(null==e)throw new TypeError("must start with number, buffer, array or string");if("undefined"!=typeof ArrayBuffer){if(e.buffer instanceof ArrayBuffer)return l(t,e);if(e instanceof ArrayBuffer)return d(t,e)}return e.length?p(t,e):h(t,e)}function s(t,e){var n=0|y(e.length);return t=g(t,n),e.copy(t,0,0,n),t}function f(t,e){var n=0|y(e.length);t=g(t,n);for(var r=0;n>r;r+=1)t[r]=255&e[r];return t}function l(t,e){var n=0|y(e.length);t=g(t,n);for(var r=0;n>r;r+=1)t[r]=255&e[r];return t}function d(t,e){return i.TYPED_ARRAY_SUPPORT?(e.byteLength,t=i._augment(new Uint8Array(e))):t=l(t,new Uint8Array(e)),t}function p(t,e){var n=0|y(e.length);t=g(t,n);for(var r=0;n>r;r+=1)t[r]=255&e[r];return t}function h(t,e){var n,r=0;"Buffer"===e.type&&J(e.data)&&(n=e.data,r=0|y(n.length)),t=g(t,r);for(var o=0;r>o;o+=1)t[o]=255&n[o];return t}function g(t,e){i.TYPED_ARRAY_SUPPORT?(t=i._augment(new Uint8Array(e)),t.__proto__=i.prototype):(t.length=e,t._isBuffer=!0);var n=0!==e&&e<=i.poolSize>>>1;return n&&(t.parent=K),t}function y(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function m(t,e){if(!(this instanceof m))return new m(t,e);var n=new i(t,e);return delete n.parent,n}function v(t,e){"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"binary":case"raw":case"raws":return n;case"utf8":case"utf-8":return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return G(t).length;default:if(r)return z(t).length;e=(""+e).toLowerCase(),r=!0}}function w(t,e,n){var r=!1;if(e=0|e,n=void 0===n||n===1/0?this.length:0|n,t||(t="utf8"),0>e&&(e=0),n>this.length&&(n=this.length),e>=n)return"";for(;;)switch(t){case"hex":return D(this,e,n);case"utf8":case"utf-8":return I(this,e,n);case"ascii":return O(this,e,n);case"binary":return S(this,e,n);case"base64":return P(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function b(t,e,n,r){n=Number(n)||0;var o=t.length-n;r?(r=Number(r),r>o&&(r=o)):r=o;var i=e.length;if(i%2!==0)throw new Error("Invalid hex string");r>i/2&&(r=i/2);for(var a=0;r>a;a++){var c=parseInt(e.substr(2*a,2),16);if(isNaN(c))throw new Error("Invalid hex string");t[n+a]=c}return a}function E(t,e,n,r){return H(z(e,t.length-n),t,n,r)}function k(t,e,n,r){return H(F(e),t,n,r)}function A(t,e,n,r){return k(t,e,n,r)}function _(t,e,n,r){return H(G(e),t,n,r)}function j(t,e,n,r){return H(Y(e,t.length-n),t,n,r)}function P(t,e,n){return 0===e&&n===t.length?W.fromByteArray(t):W.fromByteArray(t.slice(e,n))}function I(t,e,n){n=Math.min(t.length,n);for(var r=[],o=e;n>o;){var i=t[o],a=null,c=i>239?4:i>223?3:i>191?2:1;if(n>=o+c){var u,s,f,l;switch(c){case 1:128>i&&(a=i);break;case 2:u=t[o+1],128===(192&u)&&(l=(31&i)<<6|63&u,l>127&&(a=l));break;case 3:u=t[o+1],s=t[o+2],128===(192&u)&&128===(192&s)&&(l=(15&i)<<12|(63&u)<<6|63&s,l>2047&&(55296>l||l>57343)&&(a=l));break;case 4:u=t[o+1],s=t[o+2],f=t[o+3],128===(192&u)&&128===(192&s)&&128===(192&f)&&(l=(15&i)<<18|(63&u)<<12|(63&s)<<6|63&f,l>65535&&1114112>l&&(a=l))}}null===a?(a=65533,c=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),o+=c}return C(r)}function C(t){var e=t.length;if(X>=e)return String.fromCharCode.apply(String,t);for(var n="",r=0;e>r;)n+=String.fromCharCode.apply(String,t.slice(r,r+=X));return n}function O(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;n>o;o++)r+=String.fromCharCode(127&t[o]);return r}function S(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;n>o;o++)r+=String.fromCharCode(t[o]);return r}function D(t,e,n){var r=t.length;(!e||0>e)&&(e=0),(!n||0>n||n>r)&&(n=r);for(var o="",i=e;n>i;i++)o+=q(t[i]);return o}function x(t,e,n){for(var r=t.slice(e,n),o="",i=0;it)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function $(t,e,n,r,o,a){if(!i.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");if(e>o||a>e)throw new RangeError("value is out of bounds");if(n+r>t.length)throw new RangeError("index out of range")}function L(t,e,n,r){0>e&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-n,2);i>o;o++)t[n+o]=(e&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function R(t,e,n,r){0>e&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-n,4);i>o;o++)t[n+o]=e>>>8*(r?o:3-o)&255}function M(t,e,n,r,o,i){if(e>o||i>e)throw new RangeError("value is out of bounds");if(n+r>t.length)throw new RangeError("index out of range");if(0>n)throw new RangeError("index out of range")}function B(t,e,n,r,o){return o||M(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(t,e,n,r,23,4),n+4}function U(t,e,n,r,o){return o||M(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(t,e,n,r,52,8),n+8}function V(t){if(t=N(t).replace(tt,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function N(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function q(t){return 16>t?"0"+t.toString(16):t.toString(16)}function z(t,e){e=e||1/0;for(var n,r=t.length,o=null,i=[],a=0;r>a;a++){if(n=t.charCodeAt(a),n>55295&&57344>n){if(!o){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(56320>n){(e-=3)>-1&&i.push(239,191,189),o=n;continue}n=(o-55296<<10|n-56320)+65536}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,128>n){if((e-=1)<0)break;i.push(n)}else if(2048>n){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(65536>n){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(1114112>n))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function F(t){for(var e=[],n=0;n>8,o=n%256,i.push(o),i.push(r);return i}function G(t){return W.toByteArray(V(t))}function H(t,e,n,r){for(var o=0;r>o&&!(o+n>=e.length||o>=t.length);o++)e[o+n]=t[o];return o}var W=t("base64-js"),Q=t("ieee754"),J=t("is-array");n.Buffer=i,n.SlowBuffer=m,n.INSPECT_MAX_BYTES=50,i.poolSize=8192;var K={};i.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:r(),i.TYPED_ARRAY_SUPPORT&&(i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array),i.isBuffer=function(t){return!(null==t||!t._isBuffer)},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,o=0,a=Math.min(n,r);a>o&&t[o]===e[o];)++o;return o!==a&&(n=t[o],r=e[o]),r>n?-1:n>r?1:0},i.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(t,e){if(!J(t))throw new TypeError("list argument must be an Array of Buffers.");if(0===t.length)return new i(0);var n;if(void 0===e)for(e=0,n=0;n0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},i.prototype.compare=function(t){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?0:i.compare(this,t)},i.prototype.indexOf=function(t,e){function n(t,e,n){for(var r=-1,o=0;n+o2147483647?e=2147483647:-2147483648>e&&(e=-2147483648),e>>=0,0===this.length)return-1;if(e>=this.length)return-1;if(0>e&&(e=Math.max(this.length+e,0)),"string"==typeof t)return 0===t.length?-1:String.prototype.indexOf.call(this,t,e);if(i.isBuffer(t))return n(this,t,e);if("number"==typeof t)return i.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,t,e):n(this,[t],e);throw new TypeError("val must be string, number or Buffer")},i.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},i.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},i.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else if(isFinite(e))e=0|e,isFinite(n)?(n=0|n,void 0===r&&(r="utf8")):(r=n,n=void 0);else{var o=r;r=e,e=0|n,n=o}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(0>n||0>e)||e>this.length)throw new RangeError("attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return b(this,t,e,n);case"utf8":case"utf-8":return E(this,t,e,n);case"ascii":return k(this,t,e,n);case"binary":return A(this,t,e,n);case"base64":return _(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,e,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var X=4096;i.prototype.slice=function(t,e){var n=this.length;t=~~t,e=void 0===e?n:~~e,0>t?(t+=n,0>t&&(t=0)):t>n&&(t=n),0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),t>e&&(e=t);var r;if(i.TYPED_ARRAY_SUPPORT)r=i._augment(this.subarray(t,e));else{var o=e-t;r=new i(o,void 0);for(var a=0;o>a;a++)r[a]=this[a+t]}return r.length&&(r.parent=this.parent||this),r},i.prototype.readUIntLE=function(t,e,n){t=0|t,e=0|e,n||T(t,e,this.length);for(var r=this[t],o=1,i=0;++i0&&(o*=256);)r+=this[t+--e]*o;return r},i.prototype.readUInt8=function(t,e){return e||T(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return e||T(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return e||T(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return e||T(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return e||T(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,n){t=0|t,e=0|e,n||T(t,e,this.length);for(var r=this[t],o=1,i=0;++i=o&&(r-=Math.pow(2,8*e)),r},i.prototype.readIntBE=function(t,e,n){t=0|t,e=0|e,n||T(t,e,this.length);for(var r=e,o=1,i=this[t+--r];r>0&&(o*=256);)i+=this[t+--r]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},i.prototype.readInt8=function(t,e){return e||T(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){e||T(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(t,e){e||T(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(t,e){return e||T(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return e||T(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return e||T(t,4,this.length),Q.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return e||T(t,4,this.length),Q.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return e||T(t,8,this.length),Q.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return e||T(t,8,this.length),Q.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,n,r){t=+t,e=0|e,n=0|n,r||$(this,t,e,n,Math.pow(2,8*n),0);var o=1,i=0;for(this[e]=255&t;++i=0&&(i*=256);)this[e+o]=t/i&255;return e+n},i.prototype.writeUInt8=function(t,e,n){return t=+t,e=0|e,n||$(this,t,e,1,255,0),i.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,n){return t=+t,e=0|e,n||$(this,t,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):L(this,t,e,!0),e+2},i.prototype.writeUInt16BE=function(t,e,n){return t=+t,e=0|e,n||$(this,t,e,2,65535,0),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):L(this,t,e,!1),e+2},i.prototype.writeUInt32LE=function(t,e,n){return t=+t,e=0|e,n||$(this,t,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):R(this,t,e,!0),e+4},i.prototype.writeUInt32BE=function(t,e,n){return t=+t,e=0|e,n||$(this,t,e,4,4294967295,0),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},i.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e=0|e,!r){var o=Math.pow(2,8*n-1);$(this,t,e,n,o-1,-o)}var i=0,a=1,c=0>t?1:0;for(this[e]=255&t;++i>0)-c&255;return e+n},i.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e=0|e,!r){var o=Math.pow(2,8*n-1);$(this,t,e,n,o-1,-o)}var i=n-1,a=1,c=0>t?1:0;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=(t/a>>0)-c&255;return e+n},i.prototype.writeInt8=function(t,e,n){return t=+t,e=0|e,n||$(this,t,e,1,127,-128),i.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,n){return t=+t,e=0|e,n||$(this,t,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):L(this,t,e,!0),e+2},i.prototype.writeInt16BE=function(t,e,n){return t=+t,e=0|e,n||$(this,t,e,2,32767,-32768),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):L(this,t,e,!1),e+2},i.prototype.writeInt32LE=function(t,e,n){return t=+t,e=0|e,n||$(this,t,e,4,2147483647,-2147483648),i.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):R(this,t,e,!0),e+4},i.prototype.writeInt32BE=function(t,e,n){return t=+t,e=0|e,n||$(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),i.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},i.prototype.writeFloatLE=function(t,e,n){return B(this,t,e,!0,n)},i.prototype.writeFloatBE=function(t,e,n){return B(this,t,e,!1,n)},i.prototype.writeDoubleLE=function(t,e,n){return U(this,t,e,!0,n)},i.prototype.writeDoubleBE=function(t,e,n){return U(this,t,e,!1,n)},i.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&n>r&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(0>e)throw new RangeError("targetStart out of bounds");if(0>n||n>=this.length)throw new RangeError("sourceStart out of bounds");if(0>r)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-en&&r>e)for(o=a-1;o>=0;o--)t[o+e]=this[o+n];else if(1e3>a||!i.TYPED_ARRAY_SUPPORT)for(o=0;a>o;o++)t[o+e]=this[o+n];else t._set(this.subarray(n,n+a),e);return a},i.prototype.fill=function(t,e,n){if(t||(t=0),e||(e=0),n||(n=this.length),e>n)throw new RangeError("end < start");if(n!==e&&0!==this.length){if(0>e||e>=this.length)throw new RangeError("start out of bounds");if(0>n||n>this.length)throw new RangeError("end out of bounds");var r;if("number"==typeof t)for(r=e;n>r;r++)this[r]=t;else{var o=z(t.toString()),i=o.length;for(r=e;n>r;r++)this[r]=o[r%i]}return this}},i.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(i.TYPED_ARRAY_SUPPORT)return new i(this).buffer;for(var t=new Uint8Array(this.length),e=0,n=t.length;n>e;e+=1)t[e]=this[e];return t.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var Z=i.prototype;i._augment=function(t){return t.constructor=i,t._isBuffer=!0,t._set=t.set,t.get=Z.get,t.set=Z.set,t.write=Z.write,t.toString=Z.toString,t.toLocaleString=Z.toString,t.toJSON=Z.toJSON,t.equals=Z.equals,t.compare=Z.compare,t.indexOf=Z.indexOf,t.copy=Z.copy,t.slice=Z.slice,t.readUIntLE=Z.readUIntLE,t.readUIntBE=Z.readUIntBE,t.readUInt8=Z.readUInt8,t.readUInt16LE=Z.readUInt16LE,t.readUInt16BE=Z.readUInt16BE,t.readUInt32LE=Z.readUInt32LE,t.readUInt32BE=Z.readUInt32BE,t.readIntLE=Z.readIntLE,t.readIntBE=Z.readIntBE, -t.readInt8=Z.readInt8,t.readInt16LE=Z.readInt16LE,t.readInt16BE=Z.readInt16BE,t.readInt32LE=Z.readInt32LE,t.readInt32BE=Z.readInt32BE,t.readFloatLE=Z.readFloatLE,t.readFloatBE=Z.readFloatBE,t.readDoubleLE=Z.readDoubleLE,t.readDoubleBE=Z.readDoubleBE,t.writeUInt8=Z.writeUInt8,t.writeUIntLE=Z.writeUIntLE,t.writeUIntBE=Z.writeUIntBE,t.writeUInt16LE=Z.writeUInt16LE,t.writeUInt16BE=Z.writeUInt16BE,t.writeUInt32LE=Z.writeUInt32LE,t.writeUInt32BE=Z.writeUInt32BE,t.writeIntLE=Z.writeIntLE,t.writeIntBE=Z.writeIntBE,t.writeInt8=Z.writeInt8,t.writeInt16LE=Z.writeInt16LE,t.writeInt16BE=Z.writeInt16BE,t.writeInt32LE=Z.writeInt32LE,t.writeInt32BE=Z.writeInt32BE,t.writeFloatLE=Z.writeFloatLE,t.writeFloatBE=Z.writeFloatBE,t.writeDoubleLE=Z.writeDoubleLE,t.writeDoubleBE=Z.writeDoubleBE,t.fill=Z.fill,t.inspect=Z.inspect,t.toArrayBuffer=Z.toArrayBuffer,t};var tt=/[^+\/0-9A-Za-z-_]/g}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"base64-js":2,ieee754:46,"is-array":47}],4:[function(t,e,n){function r(t){switch(o(t)){case"object":var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=r(t[n]));return e;case"array":for(var e=new Array(t.length),i=0,a=t.length;a>i;i++)e[i]=r(t[i]);return e;case"regexp":var c="";return c+=t.multiline?"m":"",c+=t.global?"g":"",c+=t.ignoreCase?"i":"",new RegExp(t.source,c);case"date":return new Date(t.getTime());default:return t}}var o;try{o=t("component-type")}catch(i){o=t("type")}e.exports=r},{"component-type":6,type:6}],5:[function(t,e,n){function r(t){return t?o(t):void 0}function o(t){for(var e in r.prototype)t[e]=r.prototype[e];return t}e.exports=r,r.prototype.on=r.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks[t]=this._callbacks[t]||[]).push(e),this},r.prototype.once=function(t,e){function n(){r.off(t,n),e.apply(this,arguments)}var r=this;return this._callbacks=this._callbacks||{},n.fn=e,this.on(t,n),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=r.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks[t];if(!n)return this;if(1==arguments.length)return delete this._callbacks[t],this;for(var r,o=0;or;++r)n[r].apply(this,e)}return this},r.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks[t]||[]},r.prototype.hasListeners=function(t){return!!this.listeners(t).length}},{}],6:[function(t,e,n){(function(t){var n=Object.prototype.toString;e.exports=function(e){switch(n.call(e)){case"[object Date]":return"date";case"[object RegExp]":return"regexp";case"[object Arguments]":return"arguments";case"[object Array]":return"array";case"[object Error]":return"error"}return null===e?"null":void 0===e?"undefined":e!==e?"nan":e&&1===e.nodeType?"element":"undefined"!=typeof t&&t.isBuffer(e)?"buffer":(e=e.valueOf?e.valueOf():Object.prototype.valueOf.apply(e),typeof e)}}).call(this,t("buffer").Buffer)},{buffer:3}],7:[function(t,e,n){e.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},{}],8:[function(t,e,n){var r=t("./$.is-object");e.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},{"./$.is-object":27}],9:[function(t,e,n){var r=t("./$.to-iobject"),o=t("./$.to-length"),i=t("./$.to-index");e.exports=function(t){return function(e,n,a){var c,u=r(e),s=o(u.length),f=i(a,s);if(t&&n!=n){for(;s>f;)if(c=u[f++],c!=c)return!0}else for(;s>f;f++)if((t||f in u)&&u[f]===n)return t||f;return!t&&-1}}},{"./$.to-index":34,"./$.to-iobject":36,"./$.to-length":37}],10:[function(t,e,n){var r=t("./$.ctx"),o=t("./$.iobject"),i=t("./$.to-object"),a=t("./$.to-length"),c=t("./$.array-species-create");e.exports=function(t){var e=1==t,n=2==t,u=3==t,s=4==t,f=6==t,l=5==t||f;return function(d,p,h){for(var g,y,m=i(d),v=o(m),w=r(p,h,3),b=a(v.length),E=0,k=e?c(d,b):n?c(d,0):void 0;b>E;E++)if((l||E in v)&&(g=v[E],y=w(g,E,m),t))if(e)k[E]=y;else if(y)switch(t){case 3:return!0;case 5:return g;case 6:return E;case 2:k.push(g)}else if(s)return!1;return f?-1:u||s?s:k}}},{"./$.array-species-create":11,"./$.ctx":14,"./$.iobject":25,"./$.to-length":37,"./$.to-object":38}],11:[function(t,e,n){var r=t("./$.is-object"),o=t("./$.is-array"),i=t("./$.wks")("species");e.exports=function(t,e){var n;return o(t)&&(n=t.constructor,"function"!=typeof n||n!==Array&&!o(n.prototype)||(n=void 0),r(n)&&(n=n[i],null===n&&(n=void 0))),new(void 0===n?Array:n)(e)}},{"./$.is-array":26,"./$.is-object":27,"./$.wks":40}],12:[function(t,e,n){var r={}.toString;e.exports=function(t){return r.call(t).slice(8,-1)}},{}],13:[function(t,e,n){var r=e.exports={version:"1.2.6"};"number"==typeof __e&&(__e=r)},{}],14:[function(t,e,n){var r=t("./$.a-function");e.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},{"./$.a-function":7}],15:[function(t,e,n){e.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},{}],16:[function(t,e,n){e.exports=!t("./$.fails")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{"./$.fails":19}],17:[function(t,e,n){var r=t("./$.is-object"),o=t("./$.global").document,i=r(o)&&r(o.createElement);e.exports=function(t){return i?o.createElement(t):{}}},{"./$.global":20,"./$.is-object":27}],18:[function(t,e,n){var r=t("./$.global"),o=t("./$.core"),i=t("./$.hide"),a=t("./$.redefine"),c=t("./$.ctx"),u="prototype",s=function(t,e,n){var f,l,d,p,h=t&s.F,g=t&s.G,y=t&s.S,m=t&s.P,v=t&s.B,w=g?r:y?r[e]||(r[e]={}):(r[e]||{})[u],b=g?o:o[e]||(o[e]={}),E=b[u]||(b[u]={});g&&(n=e);for(f in n)l=!h&&w&&f in w,d=(l?w:n)[f],p=v&&l?c(d,r):m&&"function"==typeof d?c(Function.call,d):d,w&&!l&&a(w,f,d),b[f]!=d&&i(b,f,p),m&&E[f]!=d&&(E[f]=d)};r.core=o,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,e.exports=s},{"./$.core":13,"./$.ctx":14,"./$.global":20,"./$.hide":22,"./$.redefine":31}],19:[function(t,e,n){e.exports=function(t){try{return!!t()}catch(e){return!0}}},{}],20:[function(t,e,n){var r=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},{}],21:[function(t,e,n){var r={}.hasOwnProperty;e.exports=function(t,e){return r.call(t,e)}},{}],22:[function(t,e,n){var r=t("./$"),o=t("./$.property-desc");e.exports=t("./$.descriptors")?function(t,e,n){return r.setDesc(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},{"./$":28,"./$.descriptors":16,"./$.property-desc":30}],23:[function(t,e,n){e.exports=t("./$.global").document&&document.documentElement},{"./$.global":20}],24:[function(t,e,n){e.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},{}],25:[function(t,e,n){var r=t("./$.cof");e.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},{"./$.cof":12}],26:[function(t,e,n){var r=t("./$.cof");e.exports=Array.isArray||function(t){return"Array"==r(t)}},{"./$.cof":12}],27:[function(t,e,n){e.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},{}],28:[function(t,e,n){var r=Object;e.exports={create:r.create,getProto:r.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:r.getOwnPropertyDescriptor,setDesc:r.defineProperty,setDescs:r.defineProperties,getKeys:r.keys,getNames:r.getOwnPropertyNames,getSymbols:r.getOwnPropertySymbols,each:[].forEach}},{}],29:[function(t,e,n){var r=t("./$"),o=t("./$.to-object"),i=t("./$.iobject");e.exports=t("./$.fails")(function(){var t=Object.assign,e={},n={},r=Symbol(),o="abcdefghijklmnopqrst";return e[r]=7,o.split("").forEach(function(t){n[t]=t}),7!=t({},e)[r]||Object.keys(t({},n)).join("")!=o})?function(t,e){for(var n=o(t),a=arguments,c=a.length,u=1,s=r.getKeys,f=r.getSymbols,l=r.isEnum;c>u;)for(var d,p=i(a[u++]),h=f?s(p).concat(f(p)):s(p),g=h.length,y=0;g>y;)l.call(p,d=h[y++])&&(n[d]=p[d]);return n}:Object.assign},{"./$":28,"./$.fails":19,"./$.iobject":25,"./$.to-object":38}],30:[function(t,e,n){e.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},{}],31:[function(t,e,n){var r=t("./$.global"),o=t("./$.hide"),i=t("./$.uid")("src"),a="toString",c=Function[a],u=(""+c).split(a);t("./$.core").inspectSource=function(t){return c.call(t)},(e.exports=function(t,e,n,a){"function"==typeof n&&(n.hasOwnProperty(i)||o(n,i,t[e]?""+t[e]:u.join(String(e))),n.hasOwnProperty("name")||o(n,"name",e)),t===r?t[e]=n:(a||delete t[e],o(t,e,n))})(Function.prototype,a,function(){return"function"==typeof this&&this[i]||c.call(this)})},{"./$.core":13,"./$.global":20,"./$.hide":22,"./$.uid":39}],32:[function(t,e,n){var r=t("./$.global"),o="__core-js_shared__",i=r[o]||(r[o]={});e.exports=function(t){return i[t]||(i[t]={})}},{"./$.global":20}],33:[function(t,e,n){var r=t("./$.export"),o=t("./$.defined"),i=t("./$.fails"),a=" \n\x0B\f\r   ᠎              \u2028\u2029\ufeff",c="["+a+"]",u="​…",s=RegExp("^"+c+c+"*"),f=RegExp(c+c+"*$"),l=function(t,e){var n={};n[t]=e(d),r(r.P+r.F*i(function(){return!!a[t]()||u[t]()!=u}),"String",n)},d=l.trim=function(t,e){return t=String(o(t)),1&e&&(t=t.replace(s,"")),2&e&&(t=t.replace(f,"")),t};e.exports=l},{"./$.defined":15,"./$.export":18,"./$.fails":19}],34:[function(t,e,n){var r=t("./$.to-integer"),o=Math.max,i=Math.min;e.exports=function(t,e){return t=r(t),0>t?o(t+e,0):i(t,e)}},{"./$.to-integer":35}],35:[function(t,e,n){var r=Math.ceil,o=Math.floor;e.exports=function(t){return isNaN(t=+t)?0:(t>0?o:r)(t)}},{}],36:[function(t,e,n){var r=t("./$.iobject"),o=t("./$.defined");e.exports=function(t){return r(o(t))}},{"./$.defined":15,"./$.iobject":25}],37:[function(t,e,n){var r=t("./$.to-integer"),o=Math.min;e.exports=function(t){return t>0?o(r(t),9007199254740991):0}},{"./$.to-integer":35}],38:[function(t,e,n){var r=t("./$.defined");e.exports=function(t){return Object(r(t))}},{"./$.defined":15}],39:[function(t,e,n){var r=0,o=Math.random();e.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+o).toString(36))}},{}],40:[function(t,e,n){var r=t("./$.shared")("wks"),o=t("./$.uid"),i=t("./$.global").Symbol;e.exports=function(t){return r[t]||(r[t]=i&&i[t]||(i||o)("Symbol."+t))}},{"./$.global":20,"./$.shared":32,"./$.uid":39}],41:[function(t,e,n){"use strict";var r,o=t("./$"),i=t("./$.export"),a=t("./$.descriptors"),c=t("./$.property-desc"),u=t("./$.html"),s=t("./$.dom-create"),f=t("./$.has"),l=t("./$.cof"),d=t("./$.invoke"),p=t("./$.fails"),h=t("./$.an-object"),g=t("./$.a-function"),y=t("./$.is-object"),m=t("./$.to-object"),v=t("./$.to-iobject"),w=t("./$.to-integer"),b=t("./$.to-index"),E=t("./$.to-length"),k=t("./$.iobject"),A=t("./$.uid")("__proto__"),_=t("./$.array-methods"),j=t("./$.array-includes")(!1),P=Object.prototype,I=Array.prototype,C=I.slice,O=I.join,S=o.setDesc,D=o.getDesc,x=o.setDescs,T={};a||(r=!p(function(){return 7!=S(s("div"),"a",{get:function(){return 7}}).a}),o.setDesc=function(t,e,n){if(r)try{return S(t,e,n)}catch(o){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(h(t)[e]=n.value),t},o.getDesc=function(t,e){if(r)try{return D(t,e)}catch(n){}return f(t,e)?c(!P.propertyIsEnumerable.call(t,e),t[e]):void 0},o.setDescs=x=function(t,e){h(t);for(var n,r=o.getKeys(e),i=r.length,a=0;i>a;)o.setDesc(t,n=r[a++],e[n]);return t}),i(i.S+i.F*!a,"Object",{getOwnPropertyDescriptor:o.getDesc,defineProperty:o.setDesc,defineProperties:x});var $="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),L=$.concat("length","prototype"),R=$.length,M=function(){var t,e=s("iframe"),n=R,r=">";for(e.style.display="none",u.appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("