!function(e) { var t = {}; function r(n) { if (t[n]) return t[n].exports; var i = t[n] = { i: n, l: !1, exports: {} }; return e[n].call(i.exports, i, i.exports, r), i.l = !0, i.exports } r.m = e, r.c = t, r.d = function(e, t, n) { r.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: n }) } , r.r = function(e) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }) } , r.t = function(e, t) { if (1 & t && (e = r(e)), 8 & t) return e; if (4 & t && "object" == typeof e && e && e.__esModule) return e; var n = Object.create(null); if (r.r(n), Object.defineProperty(n, "default", { enumerable: !0, value: e }), 2 & t && "string" != typeof e) for (var i in e) r.d(n, i, function(t) { return e[t] } .bind(null, i)); return n } , r.n = function(e) { var t = e && e.__esModule ? function() { return e.default } : function() { return e } ; return r.d(t, "a", t), t } , r.o = function(e, t) { return Object.prototype.hasOwnProperty.call(e, t) } , r.p = "", r(r.s = 0) }([function(e, t, r) { "use strict"; var n = this && this.__assign || function() { return (n = Object.assign || function(e) { for (var t, r = 1, n = arguments.length; r < n; r++) for (var i in t = arguments[r]) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]); return e } ).apply(this, arguments) } ; Object.defineProperty(t, "__esModule", { value: !0 }), r(1); var i = r(2) , o = r(2) , s = r(3) , a = r(12) , u = r(17) , c = r(18) , l = r(19) , d = r(22) , f = r(23) , p = r(8) , h = r(27); r(26); var v = r(16) , m = function() { function e(e) { var t = this; this._previousRequestPromise = null, this.process = function() { for (var e = [], r = 0; r < arguments.length; r++) e[r] = arguments[r]; var n = Array.prototype.slice.call(e); t.invoke(n.shift(), n) } , this.isPrerenderOrPreview = function() { var e = t._window.document.visibilityState || t._window.document.webkitVisibilityState || "visible"; return "preview" == e || "prerender" == e } , this.invoke = function(e, r) { try { if (!e) throw new Error("methodName required"); if ("create" !== e && !t._settings) throw new Error('You should call "create" first'); if ("create" !== e && (!t._cookieManager.isCookieEnabled() || t.isPrerenderOrPreview())) return; if ("create" === e) return void t.tryCreate(r[0]); var n = t.moduleManager.tryGetModuleCommand(e); if (null != n) return void t.moduleManager.invokeModule(n, r); var i = e.replace(".", "_"); if (void 0 === t[i]) throw new Error("Unknown method: " + i); r instanceof Array ? t.then(function() { return t[i].apply(t, r) }) : t.then(function() { return t[i].call(t, r) }) } catch (e) { t.logErrorWithDataFromTracker(e) } } , this.then = function(e) { t._sessionStorage.deviceUUIDIsSet() ? e().then(void 0, function(e) { return t.logErrorWithDataFromTracker(e) }) : null == t._previousRequestPromise ? t._previousRequestPromise = e().then(void 0, function(e) { return t.logErrorWithDataFromTracker(e) }) : t._previousRequestPromise = t._previousRequestPromise.then(function() { return e() }).then(void 0, function(e) { return t.logErrorWithDataFromTracker(e) }) } , this.getTrackerAdditionalData = function() { var e = null; try { e = t._sessionStorage.tryGetDeviceUUID() } catch (e) {} return { Version: i.version, "Point of contact": t._settings.pointOfContactSystemName, Endpoint: t._settings.endpointId, Origin: location.origin, DeviceUUID: e } } , this.logErrorWithDataFromTracker = function(e, r) { var i = t.getTrackerAdditionalData() , o = e; o.requestId && (i.RequestId = o.requestId), t._logger.logError(e, n({}, i, r)) } , this.trackEventWithDataFromTracker = function(e, r) { var i = t.getTrackerAdditionalData(); t._logger.trackEvent(e, n({}, i, r)) } , this.tryCreate = function(e) { if (t._previousRequestPromise) { var r = d.compareSettings(t._settings, e); null != r && t.logErrorWithDataFromTracker(new v.MultipleCallsToCreateError(r)) } else t.create(e) } , this.create = function(e) { t._settings = e || {}, null == t._settings.serviceDomain || "tracker.directcrm.ru" === t._settings.serviceDomain ? t._settings.serviceDomain = o.getDefaultServiceDomain() : "tracker.staging.directcrm.ru" === t._settings.serviceDomain && (t._settings.serviceDomain = "api.staging.directcrm.ru"), t._window = t._settings.windowOverride ? t._settings.windowOverride : window, t._cookieManager = new u.Manager(t._window), t._cookieManager.setBaseDomain(), t._sessionStorage = new c.CustomerSessionStorage(t._cookieManager,t._window), t._sender = new s.RequestSender(t._sessionStorage,t._settings.serviceDomain,t._settings.projectDomain,t._settings.useHttp,t._settings.crossDomainRequestFactoryOverride), t._logger = null == t._settings.loggerOverride ? new l.TrackerLogger : t._settings.loggerOverride, t.timeZoneProvider = null == t._settings.timeZoneProviderOverride ? new h.IanaTimeZoneProvider : t._settings.timeZoneProviderOverride; var r = { logError: t.logErrorWithDataFromTracker, trackEvent: t.trackEventWithDataFromTracker }; if (t.moduleManager = new f.ModuleManager(t._settings,t._sessionStorage,function() { return t._previousRequestPromise } ,r), t._cookieManager.isCookieEnabled() && !t.isPrerenderOrPreview()) { var n = null != t._window.location.search && -1 !== t._window.location.search.indexOf("s="); if (t._previousRequestPromise = (n ? t.attemptRedirect() : t.trackVisit()).then(void 0, function(e) { return t.logErrorWithDataFromTracker(e) }), t._settings.keepAlive) var i = setInterval(function() { t._previousRequestPromise = t._previousRequestPromise.then(function() { return t.keepAlive() }).then(void 0, function(e) { e && e instanceof a.Timeout || clearInterval(i), t.logErrorWithDataFromTracker(e) }) }, 3e5) } } , this.attemptRedirect = function() { var e = { options: { pointOfContactSystemName: t._settings.pointOfContactSystemName }, originDomain: t._window.document.location.host, requestUrl: t._window.document.location.href }; return null != t._settings.endpointId && (e.endpointId = t._settings.endpointId), t._sender.sendToTrackerWithoutSessionAndGetResult("/v1.1/redirect", e).then(function(e) { null != e.redirectUrl ? t._window.location.replace(e.redirectUrl) : t.trackVisit() }) } , this.validateOperationParameters = function(e) { if (!e) throw new Error("parameters required"); if (!e.operation) throw new Error("operation required") } , this.createV3Request = function(e) { var r = { originDomain: t._window.location.host, deviceUUID: t._sessionStorage.tryGetDeviceUUID(), operation: e.operation, ianaTimeZone: t.timeZoneProvider.tryGetTimeZone() }; return null != t._settings.endpointId && (r.endpointId = t._settings.endpointId), e.data && (r.data = JSON.stringify(e.data)), { request: r, additionalParameters: Object.keys(e).filter(function(e) { return "operation" != e && "data" != e && "onSuccess" != e && "onValidationError" != e && "onError" != e }).map(function(t) { return { name: t, value: e[t] } }) } } , this.fillMessageData = function(e) { var r = t._sessionStorage.tryGetDeviceUUID(); if (null != r && "" != r) if ("undefined" != r) e.session = { deviceGuid: r }; else { t.logErrorWithDataFromTracker(new Error("deviceUUID = " + r)), t._cookieManager.remove("mindboxDeviceUUID"), t._cookieManager.remove("directCrm-session"); try { t._window.localStorage.removeItem("directCrm-session") } catch (e) {} } e.options = { pointOfContactSystemName: t._settings.pointOfContactSystemName }, null != t._settings.endpointId && (e.endpointId = t._settings.endpointId), e.originDomain = t._window.document.location.host; var n = t._settings.customer; n && (e.customerId = n.id, e.sessionKey = n.sessionKey); try { e.screenResolution = window.screen.width + "x" + window.screen.height } catch (e) {} } ; try { this._previousRequestPromise = void 0; for (var r = 0; r < e.length; ++r) { "create" == (p = Array.prototype.slice.call(e[r]))[0] && (this.invoke(p.shift(), p), e.splice(r, 1)) } for (r = 0; r < e.length; ++r) { var p = Array.prototype.slice.call(e[r]); this.invoke(p.shift(), p) } } catch (e) { this.logErrorWithDataFromTracker(e) } } return e.initialize = function() { if (window.mindboxInitialized) throw new Error("Multiple attepmts to initialize tracker. Look for duplicate mindbox script-blocks."); var t = new e(null != window.mindbox && null != window.mindbox.queue ? window.mindbox.queue : null != window.directCrm && null != window.directCrm.Queue ? window.directCrm.Queue : new Array); window.mindbox = t.process, window.mindboxInitialized = !0, window.directCrm = t.process } , e.dispose = function() { delete window.mindbox, delete window.mindboxInitialized, delete window.directCrm } , e.prototype.trackVisit = function() { var e = { requestUrl: this._window.document.location.href, referrerUrl: this._window.document.referrer, ianaTimeZone: this.timeZoneProvider.tryGetTimeZone() }; return this._settings.redirectedFrom && (this._settings.redirectedFrom.requestUrl || this._settings.redirectedFrom.referrerUrl) && (e.redirectedFrom = { requestUrl: this._settings.redirectedFrom.requestUrl, referrerUrl: this._settings.redirectedFrom.referrerUrl }), this.fillMessageData(e), this._sender.sendToTrackerAndForget("/v1.1/customer/track-visit", e) } , e.prototype.keepAlive = function() { var e = {}; return this.fillMessageData(e), this._sender.sendToTrackerAndForget("/v1.1/customer/keep-alive", e) } , e.prototype.sync = function(e) { var t = this; if (this.validateOperationParameters(e), e.onSuccess && "function" != typeof e.onSuccess) throw new Error("onSuccess should be a function"); if (e.onValidationError && "function" != typeof e.onValidationError) throw new Error("onValidationError should be a function"); if (e.onError && "function" != typeof e.onError) throw new Error("onError should be a function"); var r = this.createV3Request(e) , i = r.request , o = r.additionalParameters , s = function(r) { e.onError && e.onError(r), t.logErrorWithDataFromTracker(r) }; return this._sender.sendToTrackerAndGetResult("/v3/js/operations/sync", i, o).then(function(t) { if (p.ServiceResponses.isSuccess(t)) { if (e.onSuccess) { var r = n({}, t); delete r.deviceUUID, delete r.requestId, delete r.status, e.onSuccess(r) } } else if (p.ServiceResponses.isValidationError(t)) if (e.onValidationError) e.onValidationError(t.validationMessages); else { var i = { name: "Unhandled validation error", message: JSON.stringify(t.validationMessages), requestId: t.requestId }; s(i) } else s({ name: "Malformed server response", message: JSON.stringify(t) }) }, s) } , e.prototype.async = function(e) { var t = this; if (this.validateOperationParameters(e), e.onSuccess && "function" != typeof e.onSuccess) throw new Error("onSuccess should be a function"); if (e.onError && "function" != typeof e.onError) throw new Error("onError should be a function"); var r = this.createV3Request(e) , n = r.request , i = r.additionalParameters; return this._sender.sendToTrackerAndForget("/v3/js/operations/async", n, i).then(function() { e.onSuccess && e.onSuccess() }, function(r) { e.onError && e.onError(r), t.logErrorWithDataFromTracker(r) }) } , e.prototype.authenticate = function(e) { var t = { ticket: e }; return this.fillMessageData(t), this._sender.sendToTrackerAndForget("/v1.1/customer/authenticate/by-ticket", t) } , e.prototype.identify = function(e) { var t = this; if (!e) throw new Error("parameters required"); if (!e.operation) throw new Error("operation required"); if (!e.identificator) throw new Error("identificator required"); if (!e.identificator.provider) throw new Error("provider required"); if (!e.identificator.identity) throw new Error("identity required"); var r = { operation: e.operation, identity: e.identificator.identity, provider: e.identificator.provider, ianaTimeZone: this.timeZoneProvider.tryGetTimeZone() }; e.data && (r.data = JSON.stringify(e.data)), this.fillMessageData(r); var n = e.success && "function" == typeof e.success ? e.success : function() {} , i = e.error && "function" == typeof e.error ? e.error : function(e) {} ; return this._sender.sendToTrackerAndForget("/v1.1/customer/identify", r).then(n, function(e) { i(e), t.logErrorWithDataFromTracker(e) }) } , e.prototype.performOperation = function(e) { var t = this; if (!e) throw new Error("parameters required"); var r = e.success && "function" == typeof e.success ? e.success : function() {} , n = e.error && "function" == typeof e.error ? e.error : function(e) {} , i = { operationSystemName: "string" == typeof e ? e : e.operation }; return this.fillMessageData(i), e.data && (i.data = JSON.stringify(e.data)), this._sender.sendToTrackerAndForget("/v1.1/customer/track-event", i).then(r, function(e) { n(e), t.logErrorWithDataFromTracker(e) }) } , e.prototype.closeSession = function() { var e = {}; return this.fillMessageData(e), this._sender.sendToTrackerAndForget("/v1.1/customer/close-session", e) } , e.prototype.order_create = function(e) { var t = { order: e }; return this.fillMessageData(t), this._sender.sendToTrackerAndForget("/v1.1/order/create", t) } , e.prototype.cart_addProduct = function(e) { var t = { item: e }; return this.fillMessageData(t), this._sender.sendToTrackerAndForget("/v1.1/cart/add-product", t) } , e.prototype.cart_removeProduct = function(e) { var t = { item: e }; return this.fillMessageData(t), this._sender.sendToTrackerAndForget("/v1.1/cart/remove-product", t) } , e.prototype.cart_setProductQuantity = function(e) { var t = { item: e }; return this.fillMessageData(t), this._sender.sendToTrackerAndForget("/v1.1/cart/set-product-quantity", t) } , e.prototype.cart_clear = function() { var e = {}; return this.fillMessageData(e), this._sender.sendToTrackerAndForget("/v1.1/cart/clear", e) } , e.prototype.getSegments = function(e, t) { if (!e) throw new Error("OperationName required"); if (!t) throw new Error("Callback required"); var r = this._settings.customer , n = { operation: e, DirectCrmBrand: this._settings.brandSystemName, DirectCrmPointOfContactSystemName: this._settings.pointOfContactSystemName }; return r && (n.DirectCrmAuthorizationCustomerId = r.id, n.DirectCrmAuthorizationSessionKey = r.sessionKey), this._sender.sendToDirectCrm("/v3/customers/current/segments", n).then(function(e) { try { t(e) } catch (e) { console.error(e) } }) } , e }(); t.Tracker = m, m.initialize() } , function(e, t) { !function(e) { "use strict"; e.console = e.console || {}; for (var t, r, n = e.console, i = {}, o = function() {}, s = "memory".split(","), a = "assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(","); t = s.pop(); ) n[t] || (n[t] = i); for (; r = a.pop(); ) n[r] || (n[r] = o) }("undefined" == typeof window ? this : window) } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.version = "1.10.0.16"; t.getDefaultServiceDomain = function() { return -1 != "api.mindbox.ru".indexOf("serviceDomainDefinedByDeployment") ? "api.mindbox.ru" : "api.mindbox.ru" } } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = r(4) , i = r(2) , o = r(10) , s = function() { function e(e, t, r, i, o) { this._sessionStorage = e, this._serviceDomain = t, this._projectDomain = r, this._useHttp = i || !1, this._crossDomainRequestFactory = o || n.CrossDomainRequestFactory } return e.prototype.getProtocol = function() { return this._useHttp ? "http://" : "https://" } , e.prototype.sendToTrackerAndForget = function(e, t, r) { var n = this , i = this.createCrossDomainRequest(o.HttpMethods.POST, this._serviceDomain + e, t, r); return this._sessionStorage.deviceUUIDIsSet() && this._sessionStorage.isUsingDeviceUUIDInLocalStorage() ? i.sendAndForget() : i.sendAndGetResult().then(function(e) { return n.processResponse(e) }) } , e.prototype.sendToTrackerAndGetResult = function(e, t, r) { var n = this; return this.createCrossDomainRequest(o.HttpMethods.POST, this._serviceDomain + e, t, r).sendAndGetResult().then(function(e) { return n.processResponse(e), e }) } , e.prototype.sendToTrackerWithoutSessionAndGetResult = function(e, t) { return this.createCrossDomainRequest(o.HttpMethods.POST, this._serviceDomain + e, t).sendAndGetResult() } , e.prototype.createCrossDomainRequest = function(e, t, r, n) { return t = this.getProtocol() + t + (t.match(/\?/) ? "&" : "?") + "version=" + i.version, n && n.length > 0 && (t += "&" + n.map(function(e) { return e.name + "=" + e.value }).join("&")), this._crossDomainRequestFactory(e, t, r) } , e.prototype.sendToDirectCrm = function(e, t) { if (!this._projectDomain) throw new Error("You should initialize tracker with projectDomain property."); var r = { deviceGuid: this._sessionStorage.tryGetDeviceUUID() }; return t.customerSession = encodeURIComponent(JSON.stringify(r)), t.deviceUUID = this._sessionStorage.tryGetDeviceUUID(), this.createCrossDomainRequest(o.HttpMethods.GET, this._projectDomain + e, t).sendAndGetResult() } , e.prototype.processResponse = function(e) { if (!e.deviceUUID) throw new Error("Uncorrect server response: " + JSON.stringify(e)); this._sessionStorage.setDeviceUUID(e.deviceUUID) } , e }(); t.RequestSender = s } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = r(5) , i = r(8) , o = r(10) , s = r(11) , a = r(12); t.CrossDomainRequestFactory = function(e, t, r) { return new u(e,t,r) } ; var u = function() { function e(e, t, r) { this.timeout = 6e4, this._httpMethod = e, this._url = t, this._payload = s.PayloadSerializer.serialize(r) } return e.prototype.sendAndGetResult = function() { var e = this.sendViaXmlHttpRequest() || this.sendViaJsonp(); if (null == e) throw new Error("Browser doesn't support big cross domain requests."); return e } , e.prototype.sendAndForget = function() { var e = this.sendViaBeacon() || this.sendViaImage() || this.sendViaXmlHttpRequest(); if (null == e) throw new Error("Browser doesn't support big cross domain requests."); return e } , e.prototype.sendViaBeacon = function() { var t = e.appendQueryString(this._url, "transport=beacon"); try { return void 0 !== navigator.sendBeacon && navigator.sendBeacon(t, this._payload) ? n.Promise.resolve() : null } catch (e) { return null } } , e.prototype.sendViaImage = function() { var t = this , r = e.appendQueryString(this._url, "transport=image&" + this._payload); if (r.length > e.maxUrlLength) return null; var i = document.createElement("img"); i.width = 1, i.height = 1, i.src = r; var o = new n.Promise(function(e, t) { i.onload = i.onerror = function(t) { i.onload = null, i.onerror = null, e() } } ) , s = new n.Promise(function(e, r) { setTimeout(function() { return r(new a.Timeout("Timeout in sendViaImage.")) }, t.timeout) } ); return n.Promise.race([o, s]) } , e.prototype.sendViaJsonp = function() { var t = this , r = "Mindbox_jsonp_" + e.jsonpRequestNumber++ , o = r + "resolve" , s = e.appendQueryString(this._url, "transport=jsonp&" + this._payload + '&jsonpCallback=window["' + r + '"]'); if (s.length > e.maxUrlLength) return null; var u = document.createElement("script"); u.type = "text/javascript", u.src = s; var c = new n.Promise(function(e) { window[o] = e, window[r] = function(e) { try { window[o](e) } finally { document.getElementsByTagName("head")[0].removeChild(u), u = null; try { delete window[r], delete window[o] } catch (e) { window[r] = void 0, window[o] = void 0 } } } } ); document.getElementsByTagName("head")[0].appendChild(u); var l = new n.Promise(function(e, r) { setTimeout(function() { r(new a.Timeout("Timeout in sendViaJsonp.")) }, t.timeout) } ); return c = c.then(function(e) { if (i.ServiceResponses.isError(e)) throw new a.HttpError(e.httpStatusCode,e.errorMessage); return e }), n.Promise.race([c, l]) } , e.prototype.sendViaXmlHttpRequest = function() { if ("undefined" == typeof XMLHttpRequest) return null; var t = new XMLHttpRequest; if (!("withCredentials"in t)) return null; var r = e.appendQueryString(this._url, "transport=XmlHttpRequest"); this._httpMethod == o.HttpMethods.GET && (r = e.appendQueryString(r, this._payload)), t.open(this._httpMethod, r, !0), t.withCredentials = !0, t.timeout = this.timeout, t.setRequestHeader("Accept", "application/json"), t.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); var s = new n.Promise(function(e, r) { t.onreadystatechange = function() { if (4 == t.readyState) if (t.status >= 200 && t.status < 300) e(JSON.parse(t.responseText)); else if (0 == t.status) r(new a.Timeout("Timeout in sendViaXmlHttpRequest.")); else { var n = void 0 , o = void 0; try { var s = JSON.parse(t.responseText); i.ServiceResponses.isError(s) && (n = s.errorMessage); var u = s; u.requestId && (o = u.requestId) } catch (e) {} r(new a.HttpError(t.status,n || t.responseText,o)) } } } ); return this._httpMethod == o.HttpMethods.GET ? t.send() : t.send(this._payload), s } , e.appendQueryString = function(e, t) { return e + (e.match(/\?/) ? "&" : "?") + t } , e.maxUrlLength = 2036, e.jsonpRequestNumber = 0, e }() } , function(e, t, r) { (function(t, r) { /*! * @overview es6-promise - a tiny implementation of Promises/A+. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald) * @license Licensed under MIT license * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE * @version 4.0.5 */ var n; n = function() { "use strict"; function e(e) { return "function" == typeof e } var n = Array.isArray ? Array.isArray : function(e) { return "[object Array]" === Object.prototype.toString.call(e) } , i = 0 , o = void 0 , s = function(e, t) { d[i] = e, d[i + 1] = t, 2 === (i += 2) && (o ? o(f) : y()) }; var a = ("undefined" != typeof window ? window : void 0) || {} , u = a.MutationObserver || a.WebKitMutationObserver , c = "undefined" == typeof self && void 0 !== t && "[object process]" === {}.toString.call(t) , l = "undefined" != typeof Uint8ClampedArray && "undefined" != typeof importScripts && "undefined" != typeof MessageChannel; var d = new Array(1e3); function f() { for (var e = 0; e < i; e += 2) { (0, d[e])(d[e + 1]), d[e] = void 0, d[e + 1] = void 0 } i = 0 } var p, h, v, m, g, y = void 0; function _(e, t) { var r = arguments , n = this , i = new this.constructor(b); void 0 === i[S] && q(i); var o, a = n._state; return a ? (o = r[a - 1], s(function() { return N(a, i, o, n._result) })) : R(n, i, e, t), i } function w(e) { if (e && "object" == typeof e && e.constructor === this) return e; var t = new this(b); return x(t, e), t } c ? y = function() { return t.nextTick(f) } : u ? (v = 0, m = new u(f), g = document.createTextNode(""), m.observe(g, { characterData: !0 }), y = function() { g.data = v = ++v % 2 } ) : l ? ((h = new MessageChannel).port1.onmessage = f, y = function() { return h.port2.postMessage(0) } ) : (p = setTimeout, y = function() { return p(f, 1) } ); var S = Math.random().toString(36).substring(16); function b() {} var E = void 0 , D = 1 , T = 2 , I = new P; function k(e) { try { return e.then } catch (e) { return I.error = e, I } } function M(t, r, n) { r.constructor === t.constructor && n === _ && r.constructor.resolve === w ? function(e, t) { t._state === D ? A(e, t._result) : t._state === T ? O(e, t._result) : R(t, void 0, function(t) { return x(e, t) }, function(t) { return O(e, t) }) }(t, r) : n === I ? O(t, I.error) : void 0 === n ? A(t, r) : e(n) ? function(e, t, r) { s(function(e) { var n = !1 , i = function(e, t, r, n) { try { e.call(t, r, n) } catch (e) { return e } }(r, t, function(r) { n || (n = !0, t !== r ? x(e, r) : A(e, r)) }, function(t) { n || (n = !0, O(e, t)) }, e._label); !n && i && (n = !0, O(e, i)) }, e) }(t, r, n) : A(t, r) } function x(e, t) { var r; e === t ? O(e, new TypeError("You cannot resolve a promise with itself")) : "function" == typeof (r = t) || "object" == typeof r && null !== r ? M(e, t, k(t)) : A(e, t) } function U(e) { e._onerror && e._onerror(e._result), C(e) } function A(e, t) { e._state === E && (e._result = t, e._state = D, 0 !== e._subscribers.length && s(C, e)) } function O(e, t) { e._state === E && (e._state = T, e._result = t, s(U, e)) } function R(e, t, r, n) { var i = e._subscribers , o = i.length; e._onerror = null, i[o] = t, i[o + D] = r, i[o + T] = n, 0 === o && e._state && s(C, e) } function C(e) { var t = e._subscribers , r = e._state; if (0 !== t.length) { for (var n = void 0, i = void 0, o = e._result, s = 0; s < t.length; s += 3) n = t[s], i = t[s + r], n ? N(r, n, i, o) : i(o); e._subscribers.length = 0 } } function P() { this.error = null } var F = new P; function N(t, r, n, i) { var o = e(n) , s = void 0 , a = void 0 , u = void 0 , c = void 0; if (o) { if ((s = function(e, t) { try { return e(t) } catch (e) { return F.error = e, F } }(n, i)) === F ? (c = !0, a = s.error, s = null) : u = !0, r === s) return void O(r, new TypeError("A promises callback cannot return that same promise.")) } else s = i, u = !0; r._state !== E || (o && u ? x(r, s) : c ? O(r, a) : t === D ? A(r, s) : t === T && O(r, s)) } var j = 0; function q(e) { e[S] = j++, e._state = void 0, e._result = void 0, e._subscribers = [] } function B(e, t) { this._instanceConstructor = e, this.promise = new e(b), this.promise[S] || q(this.promise), n(t) ? (this._input = t, this.length = t.length, this._remaining = t.length, this._result = new Array(this.length), 0 === this.length ? A(this.promise, this._result) : (this.length = this.length || 0, this._enumerate(), 0 === this._remaining && A(this.promise, this._result))) : O(this.promise, new Error("Array Methods must be provided an Array")) } function z(e) { this[S] = j++, this._result = this._state = void 0, this._subscribers = [], b !== e && ("function" != typeof e && function() { throw new TypeError("You must pass a resolver function as the first argument to the promise constructor") }(), this instanceof z ? function(e, t) { try { t(function(t) { x(e, t) }, function(t) { O(e, t) }) } catch (t) { O(e, t) } }(this, e) : function() { throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.") }()) } return B.prototype._enumerate = function() { for (var e = this.length, t = this._input, r = 0; this._state === E && r < e; r++) this._eachEntry(t[r], r) } , B.prototype._eachEntry = function(e, t) { var r = this._instanceConstructor , n = r.resolve; if (n === w) { var i = k(e); if (i === _ && e._state !== E) this._settledAt(e._state, t, e._result); else if ("function" != typeof i) this._remaining--, this._result[t] = e; else if (r === z) { var o = new r(b); M(o, e, i), this._willSettleAt(o, t) } else this._willSettleAt(new r(function(t) { return t(e) } ), t) } else this._willSettleAt(n(e), t) } , B.prototype._settledAt = function(e, t, r) { var n = this.promise; n._state === E && (this._remaining--, e === T ? O(n, r) : this._result[t] = r), 0 === this._remaining && A(n, this._result) } , B.prototype._willSettleAt = function(e, t) { var r = this; R(e, void 0, function(e) { return r._settledAt(D, t, e) }, function(e) { return r._settledAt(T, t, e) }) } , z.all = function(e) { return new B(this,e).promise } , z.race = function(e) { var t = this; return n(e) ? new t(function(r, n) { for (var i = e.length, o = 0; o < i; o++) t.resolve(e[o]).then(r, n) } ) : new t(function(e, t) { return t(new TypeError("You must pass an array to race.")) } ) } , z.resolve = w, z.reject = function(e) { var t = new this(b); return O(t, e), t } , z._setScheduler = function(e) { o = e } , z._setAsap = function(e) { s = e } , z._asap = s, z.prototype = { constructor: z, then: _ }, z.polyfill = function() { var e = void 0; if (void 0 !== r) e = r; else if ("undefined" != typeof self) e = self; else try { e = Function("return this")() } catch (e) { throw new Error("polyfill failed because global object is unavailable in this environment") } var t = e.Promise; if (t) { var n = null; try { n = Object.prototype.toString.call(t.resolve()) } catch (e) {} if ("[object Promise]" === n && !t.cast) return } e.Promise = z } , z.Promise = z, z } , e.exports = n() } ).call(this, r(6), r(7)) } , function(e, t) { var r, n, i = e.exports = {}; function o() { throw new Error("setTimeout has not been defined") } function s() { throw new Error("clearTimeout has not been defined") } function a(e) { if (r === setTimeout) return setTimeout(e, 0); if ((r === o || !r) && setTimeout) return r = setTimeout, setTimeout(e, 0); try { return r(e, 0) } catch (t) { try { return r.call(null, e, 0) } catch (t) { return r.call(this, e, 0) } } } !function() { try { r = "function" == typeof setTimeout ? setTimeout : o } catch (e) { r = o } try { n = "function" == typeof clearTimeout ? clearTimeout : s } catch (e) { n = s } }(); var u, c = [], l = !1, d = -1; function f() { l && u && (l = !1, u.length ? c = u.concat(c) : d = -1, c.length && p()) } function p() { if (!l) { var e = a(f); l = !0; for (var t = c.length; t; ) { for (u = c, c = []; ++d < t; ) u && u[d].run(); d = -1, t = c.length } u = null, l = !1, function(e) { if (n === clearTimeout) return clearTimeout(e); if ((n === s || !n) && clearTimeout) return n = clearTimeout, clearTimeout(e); try { n(e) } catch (t) { try { return n.call(null, e) } catch (t) { return n.call(this, e) } } }(e) } } function h(e, t) { this.fun = e, this.array = t } function v() {} i.nextTick = function(e) { var t = new Array(arguments.length - 1); if (arguments.length > 1) for (var r = 1; r < arguments.length; r++) t[r - 1] = arguments[r]; c.push(new h(e,t)), 1 !== c.length || l || a(p) } , h.prototype.run = function() { this.fun.apply(null, this.array) } , i.title = "browser", i.browser = !0, i.env = {}, i.argv = [], i.version = "", i.versions = {}, i.on = v, i.addListener = v, i.once = v, i.off = v, i.removeListener = v, i.removeAllListeners = v, i.emit = v, i.prependListener = v, i.prependOnceListener = v, i.listeners = function(e) { return [] } , i.binding = function(e) { throw new Error("process.binding is not supported") } , i.cwd = function() { return "/" } , i.chdir = function(e) { throw new Error("process.chdir is not supported") } , i.umask = function() { return 0 } } , function(e, t) { var r; r = function() { return this }(); try { r = r || new Function("return this")() } catch (e) { "object" == typeof window && (r = window) } e.exports = r } , function(e, t, r) { e.exports = r(9) } , function(e, t, r) { "use strict"; var n = function() { function e() {} return e.isError = function(e) { return "ProtocolError" === e.status || "InternalServerError" === e.status } , e.isValidationError = function(e) { return "ValidationError" === e.status } , e.isSuccess = function(e) { return "Success" === e.status } , e }(); t.ServiceResponses = n } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = function() { function e() {} return e.GET = "GET", e.POST = "POST", e.PUT = "PUT", e.DELETE = "DELETE", e }(); t.HttpMethods = n } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = function() { function e() {} return e.prototype.serialize = function(e, t) { var r = [] , n = !1; if ("string" != typeof e) for (var i in e) if (e.hasOwnProperty(i)) { n = !0; var o = t ? t + "." + i : i , s = e[i]; if (Array.isArray(s)) for (var a = 0; a < s.length; a++) r.push(this.serialize(s[a], o + "[" + a + "]")); else "object" == typeof s ? r.push(this.serialize(s, o)) : void 0 !== s && r.push(encodeURIComponent(o) + "=" + encodeURIComponent(s)) } return n || void 0 === e || null === e || r.push(encodeURIComponent(t ? t + "=" : "") + encodeURIComponent(e)), r.filter(function(e) { return e }).join("&") } , e }(); t.PayloadSerializer = new n } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = r(13); t.RequestError = n.RequestError; var i = r(14); t.HttpError = i.HttpError; var o = r(15); t.Timeout = o.Timeout; var s = r(16); t.MultipleCallsToCreateError = s.MultipleCallsToCreateError } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }) } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = function() { return function(e, t, r) { this.statusCode = e, this.name = "HttpError", this.message = t, this.requestId = r; try { throw new Error } catch (e) { this.stack = e.stack } } }(); t.HttpError = n } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = function() { return function(e) { this.name = "Timeout", this.message = e; try { throw new Error } catch (e) { this.stack = e.stack } } }(); t.Timeout = n } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = function() { return function(e) { if (this.stack = null, null == e) throw new Error("'settingsDiff' cannot be null"); this.name = "MultipleCallsToCreateError"; var t = e.map(function(e) { return e.key + ": " + e.message }).join("; "); this.message = "Multiple call for create. These settings are different from current: " + t } }(); t.MultipleCallsToCreateError = n } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n, i = function() { function e(e, t, r, n) { this._pluses = /\+/g, this.MaxCookieExpirationDate = new Date(2038,1,19), this._navigator = e ? e.navigator : navigator, this._document = e ? e.document : document, this._domain = t, this._path = r, this._secure = n } return e.prototype.remove = function(e, t) { return null != this.tryGet(e, n.Raw) && (this.set(e, "", -1, n.Raw, t), !this.tryGet(e, n.Raw)) } , e.prototype.tryGetJson = function(e) { return this.tryGet(e, n.Json) } , e.prototype.tryGet = function(e, t) { var r = null; void 0 === t && (t = n.String); for (var i = this._document.cookie, o = i ? i.split("; ") : [], s = 0, a = o.length; s < a; s++) { var u = o[s].split("=") , c = this.decode(u.shift(), t) , l = u.join("="); if (e === c) { r = this.read(l, t); break } } return r } , e.prototype.setJson = function(e, t, r) { return this.set(e, t, r, n.Json) } , e.prototype.set = function(e, t, r, i, o) { void 0 === i && (i = n.String), -1 !== r && this.remove(e); var s = null; null != r && "number" == typeof r ? (s = new Date).setTime(+s + 864e5 * r) : null != r && r instanceof Date && (s = r); var a = null == o ? this._domain : o; return a === this._document.domain && (a = null), this._document.cookie = [this.encode(e, i), "=", this.stringifyCookieValue(t, i), null != s ? "; expires=" + s.toUTCString() : "", "; path=" + (null != this._path ? this._path : "/"), a ? "; domain=" + a : "", null != this._secure && this._secure ? "; secure" : ""].join("") } , e.prototype.removeAcrossBaseDomain = function(e) { var t = this.getBaseDomain(); if (t) for (var r = this._document.domain.split("."), n = t.substring(1).split("."), i = r.length - n.length + 1 - 1; i >= 0; i--) { var o = "." + r.slice(i).join("."); this.remove(e, o) } this.remove(e, this._document.domain) } , e.prototype.isCookieEnabled = function() { try { if (this.isInternetExplorer()) { this._document.cookie = "testcookie=testcookie"; var e = -1 !== this._document.cookie.indexOf("testcookie=testcookie"); return this.remove("testcookie"), e } e = !!this._navigator.cookieEnabled; return void 0 !== this._navigator.cookieEnabled || e || (this._document.cookie = "testcookie=testcookie", e = -1 !== this._document.cookie.indexOf("testcookie=testcookie"), this.remove("testcookie")), e } catch (e) { return !1 } } , e.prototype.isInternetExplorer = function() { var e = this._navigator.userAgent; if (void 0 === e) return !1; var t = e.indexOf("MSIE ") , r = e.indexOf("Trident/") , n = e.indexOf("Edge/"); return t > 0 || r > 0 || n > 0 } , e.prototype.read = function(e, t) { t != n.Raw && t != n.String || 0 !== e.indexOf('"') || (e = e.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, "\\")); try { switch (e = t == n.Raw ? e : decodeURIComponent(e.replace(this._pluses, " ")), t) { case n.Raw: case n.String: return e; case n.Json: return JSON.parse(e); default: throw new Error("Unknown format") } } catch (e) {} } , e.prototype.encode = function(e, t) { switch (t) { case n.Raw: return e; case n.Json: case n.String: return encodeURIComponent(e); default: throw new Error("Unknown format") } } , e.prototype.decode = function(e, t) { switch (t) { case n.Raw: return e; case n.Json: case n.String: return decodeURIComponent(e); default: throw new Error("Unknown format") } } , e.prototype.stringifyCookieValue = function(e, t) { switch (t) { case n.Raw: case n.String: return this.encode(String(e), t); case n.Json: return this.encode(JSON.stringify(e), t); default: throw new Error("Unknown format") } } , e.prototype.setBaseDomain = function() { this._domain = this.getBaseDomain() } , e.prototype.getBaseDomain = function() { return this._baseDomain || (this._baseDomain = this.computeBaseDomain()), this._baseDomain } , e.prototype.computeBaseDomain = function() { if (!this.isCookieEnabled()) return null; for (var e = this._document.domain ? "." + this._document.domain : "", t = e.length - 1; ; ) { if (t <= 0) return null; for (; t >= 0 && "." !== e[t]; ) t--; var r = e.substr(t); if (this._document.cookie = "domaintest=value; path=/; domain=" + r, -1 !== this._document.cookie.indexOf("domaintest=value")) return this._document.cookie = "domaintest=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; domain=" + r, r; t-- } } , e }(); t.Manager = i, function(e) { e[e.Json = 0] = "Json", e[e.String = 1] = "String", e[e.Raw = 2] = "Raw" }(n = t.Format || (t.Format = {})) } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = "directCrm-session" , i = function() { function e(e, t) { this.MindboxDeviceUUIDName = "mindboxDeviceUUID", this._window = t || window, this._cookieManager = e } return e.prototype.setSession = function(e) { var t = new Date , r = new Date(t.getFullYear() + 2,t.getMonth(),t.getDate()); this._cookieManager.removeAcrossBaseDomain(n), this._cookieManager.setJson(n, e, r); try { this._window.localStorage[n] = JSON.stringify(e) } catch (e) {} } , e.prototype.getDeviceUUID = function() { var e = this.tryGetDeviceUUID(); if (null == e) throw new Error("DeviceUUID not set"); return e } , e.prototype.tryGetDeviceUUID = function() { var e = this.tryGetDeviceUUIDFromLocalStorage(); return e || (e = this._cookieManager.tryGet(this.MindboxDeviceUUIDName)), e } , e.prototype.tryGetDeviceUUIDFromLocalStorage = function() { try { return this._window.localStorage[this.MindboxDeviceUUIDName] } catch (e) { return null } } , e.prototype.setDeviceUUID = function(e) { this._cookieManager.removeAcrossBaseDomain(this.MindboxDeviceUUIDName), this._cookieManager.set(this.MindboxDeviceUUIDName, e, this._cookieManager.MaxCookieExpirationDate), this.setSession({ deviceGuid: e }), this.setDeviceUUIDToLocalStorage(e), this.removeOldLocalStorage() } , e.prototype.setDeviceUUIDToLocalStorage = function(e) { try { this._window.localStorage[this.MindboxDeviceUUIDName] = e } catch (e) {} } , e.prototype.removeOldLocalStorage = function() { try { this._window.localStorage.removeItem(n) } catch (e) {} } , e.prototype.isUsingDeviceUUIDInLocalStorage = function() { try { return !!this._window.localStorage[this.MindboxDeviceUUIDName] } catch (e) { return !1 } } , e.prototype.deviceUUIDIsSet = function() { return !!this._cookieManager.tryGet(this.MindboxDeviceUUIDName) } , e }(); t.CustomerSessionStorage = i } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = r(12) , i = r(20) , o = r(21) , s = function() { function e() { this.appInsights = i.getAppInsights(o.appInsightsConfig) } return e.prototype.logError = function(e, t) { if (console.error(e), e instanceof n.Timeout) this.appInsights.trackEvent("Timeout", t); else if (e instanceof n.HttpError) { 400 !== e.statusCode && 401 !== e.statusCode && 403 !== e.statusCode && this.appInsights.trackException(e, null, t) } else { if (e instanceof n.MultipleCallsToCreateError) return; this.appInsights.trackException(e, null, t) } } , e.prototype.trackEvent = function(e, t) { this.appInsights.trackEvent(e, t) } , e }(); t.TrackerLogger = s } , function(e, t, r) { self, e.exports = function(e) { var t = {}; function r(n) { if (t[n]) return t[n].exports; var i = t[n] = { i: n, l: !1, exports: {} }; return e[n].call(i.exports, i, i.exports, r), i.l = !0, i.exports } return r.m = e, r.c = t, r.d = function(e, t, n) { r.o(e, t) || Object.defineProperty(e, t, { enumerable: !0, get: n }) } , r.r = function(e) { "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 }) } , r.t = function(e, t) { if (1 & t && (e = r(e)), 8 & t) return e; if (4 & t && "object" == typeof e && e && e.__esModule) return e; var n = Object.create(null); if (r.r(n), Object.defineProperty(n, "default", { enumerable: !0, value: e }), 2 & t && "string" != typeof e) for (var i in e) r.d(n, i, function(t) { return e[t] } .bind(null, i)); return n } , r.n = function(e) { var t = e && e.__esModule ? function() { return e.default } : function() { return e } ; return r.d(t, "a", t), t } , r.o = function(e, t) { return Object.prototype.hasOwnProperty.call(e, t) } , r.p = "", r(r.s = 25) }([function(e, t, r) { "use strict"; var n; Object.defineProperty(t, "__esModule", { value: !0 }), function(e) { e[e.LocalStorage = 0] = "LocalStorage", e[e.SessionStorage = 1] = "SessionStorage" }(n || (n = {})); var i = void 0; t.NotSpecified = "not_specified"; var o = function() { return s(n.LocalStorage) } , s = function(e) { var t, r, i = null; try { r = new Date, (i = e === n.LocalStorage ? window.localStorage : window.sessionStorage).setItem(r, r), t = i.getItem(r) != r, i.removeItem(r), t && (i = null) } catch (e) { i = null } return i }; t.getStorage = function(e) { var t = o(); if (null !== t) try { return t.getItem(e) } catch (e) {} return null } , t.removeStorage = function(e) { var t = o(); if (null !== t) try { return t.removeItem(e), !0 } catch (e) {} return !1 } ; var a = function() { return s(n.SessionStorage) }; t.canUseSessionStorage = function() { return !!a() } , t.getSessionStorage = function(e) { var t = a(); if (null !== t) try { return t.getItem(e) } catch (e) {} return null } , t.setSessionStorage = function(e, t) { var r = a(); if (null !== r) try { return r.setItem(e, t), !0 } catch (e) {} return !1 } , t.canUseCookies = function() { if (void 0 === i) { i = !1; try { i = void 0 !== document.cookie } catch (e) {} } return i } , t.setCookie = function(e, r, n) { var i = ""; n && (i = ";domain=" + n), t.canUseCookies() && (document.cookie = e + "=" + r + i + ";path=/") } , t.stringToBoolOrDefault = function(e) { return !!e && "true" === e.toString().toLowerCase() } , t.getCookie = function(e) { if (!t.canUseCookies()) return null; var r = ""; if (e && e.length) for (var n = e + "=", i = document.cookie.split(";"), o = 0; o < i.length; o++) { var s = i[o]; if ((s = t.trim(s)) && 0 === s.indexOf(n)) { r = s.substring(n.length, i[o].length); break } } return r } , t.deleteCookie = function(e) { t.canUseCookies() && (document.cookie = e + "=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;") } , t.trim = function(e) { return "string" != typeof e ? e : e.replace(/^\s+|\s+$/g, "") } , t.newId = function() { for (var e = "", t = 1073741824 * Math.random(); t > 0; ) e += "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t % 64), t = Math.floor(t / 64); return e } , t.isArray = function(e) { return "[object Array]" === Object.prototype.toString.call(e) } , t.isError = function(e) { return "[object Error]" === Object.prototype.toString.call(e) || !!e.stack } , t.isDate = function(e) { return "[object Date]" === Object.prototype.toString.call(e) } , t.toISOStringForIE8 = function(e) { if (!t.isDate(e)) return null; if (Date.prototype.toISOString) return e.toISOString(); var r = function(e) { var t = String(e); return 1 === t.length && (t = "0" + t), t }; return e.getUTCFullYear() + "-" + r(e.getUTCMonth() + 1) + "-" + r(e.getUTCDate()) + "T" + r(e.getUTCHours()) + ":" + r(e.getUTCMinutes()) + ":" + r(e.getUTCSeconds()) + "." + String((e.getUTCMilliseconds() / 1e3).toFixed(3)).slice(2, 5) + "Z" } , t.getIEVersion = function(e) { void 0 === e && (e = null); var t = e ? e.toLowerCase() : navigator.userAgent.toLowerCase(); return -1 != t.indexOf("msie") ? parseInt(t.split("msie")[1]) : null } , t.msToTimeSpan = function(e) { (isNaN(e) || e < 0) && (e = 0); var t = "" + e % 1e3 , r = "" + Math.floor(e / 1e3) % 60 , n = "" + Math.floor(e / 6e4) % 60 , i = "" + Math.floor(e / 36e5) % 24; return t = 1 === t.length ? "00" + t : 2 === t.length ? "0" + t : t, r = r.length < 2 ? "0" + r : r, n = n.length < 2 ? "0" + n : n, (i = i.length < 2 ? "0" + i : i) + ":" + n + ":" + r + "." + t } , t.isCrossOriginError = function(e, t, r, n, i) { return ("Script error." === e || "Script error" === e) && null === i } } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n, i = r(0); !function(e) { e[e.Default = 0] = "Default", e[e.Required = 1] = "Required", e[e.Array = 2] = "Array", e[e.Hidden = 4] = "Hidden" }(n = t.FieldType || (t.FieldType = {})); var o = function() { function e() {} return e.serialize = function(t) { var r = e._serializeObject(t, "root"); return JSON.stringify(r) } , e._serializeObject = function(t, r) { var o = {}; if (!t) return o; if (t.__aiCircularRefCheck) return o; if (!t.aiDataContract) { if ("measurements" === r) o = e._serializeStringMap(t, "number", r); else if ("properties" === r) o = e._serializeStringMap(t, "string", r); else if ("tags" === r) o = e._serializeStringMap(t, "string", r); else if (i.isArray(t)) o = e._serializeArray(t, r); else try { JSON.stringify(t), o = t } catch (e) {} return o } for (var s in t.__aiCircularRefCheck = !0, t.aiDataContract) { var a, u = t.aiDataContract[s], c = "function" == typeof u ? u() & n.Required : u & n.Required, l = "function" == typeof u ? u() & n.Hidden : u & n.Hidden, d = u & n.Array, f = void 0 !== t[s], p = "object" == typeof t[s] && null !== t[s]; (!c || f || d) && (l || void 0 !== (a = p ? d ? e._serializeArray(t[s], s) : e._serializeObject(t[s], s) : t[s]) && (o[s] = a)) } return delete t.__aiCircularRefCheck, o } , e._serializeArray = function(t, r) { var n = void 0; if (t && i.isArray(t)) { n = []; for (var o = 0; o < t.length; o++) { var s = t[o] , a = e._serializeObject(s, r + "[" + o + "]"); n.push(a) } } return n } , e._serializeStringMap = function(e, t, r) { var n = void 0; if (e) for (var i in n = {}, e) { var o = e[i]; if ("string" === t) void 0 === o ? n[i] = "undefined" : null === o ? n[i] = "null" : o.toString ? n[i] = o.toString() : n[i] = "invalid field: toString() is not defined."; else if ("number" === t) if (void 0 === o) n[i] = "undefined"; else if (null === o) n[i] = "null"; else { var s = parseFloat(o); isNaN(s) ? n[i] = "NaN" : n[i] = s } else n[i] = "invalid field: " + r + " is of unknown type." } return n } , e }(); t.Serializer = o } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = r(0) , i = function() { function e() {} return e.sanitizeKeyAndAddUniqueness = function(t, r) { var n = t.length , i = e.sanitizeKey(t); if (i.length !== n) { for (var o = 0, s = i; void 0 !== r[s]; ) o++, s = i.substring(0, e.MAX_NAME_LENGTH - 3) + e.padNumber(o); i = s } return i } , e.sanitizeKey = function(t) { return t && (t = n.trim(t.toString())).length > e.MAX_NAME_LENGTH && (t = t.substring(0, e.MAX_NAME_LENGTH)), t } , e.sanitizeString = function(t) { return t && (t = n.trim(t)).toString().length > e.MAX_STRING_LENGTH && (t = t.toString().substring(0, e.MAX_STRING_LENGTH)), t } , e.sanitizeMessage = function(t) { return t && t.length > e.MAX_MESSAGE_LENGTH && (t = t.substring(0, e.MAX_MESSAGE_LENGTH)), t } , e.sanitizeException = function(t) { return t && t.length > e.MAX_EXCEPTION_LENGTH && (t = t.substring(0, e.MAX_EXCEPTION_LENGTH)), t } , e.sanitizeProperties = function(t) { if (t) { var r = {}; for (var n in t) { var i = e.sanitizeString(t[n]); r[n = e.sanitizeKeyAndAddUniqueness(n, r)] = i } t = r } return t } , e.sanitizeMeasurements = function(t) { if (t) { var r = {}; for (var n in t) { var i = t[n]; r[n = e.sanitizeKeyAndAddUniqueness(n, r)] = i } t = r } return t } , e.padNumber = function(e) { var t = "00" + e; return t.substr(t.length - 3) } , e.MAX_NAME_LENGTH = 150, e.MAX_STRING_LENGTH = 1024, e.MAX_MESSAGE_LENGTH = 32768, e.MAX_EXCEPTION_LENGTH = 32768, e }(); t.DataSanitizer = i } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = r(0) , i = r(1) , o = r(2) , s = function() {}; t.Base = s; var a = function(e, t) { var r = this; this.ver = 1, this.sampleRate = 100, this.tags = {}, this.name = o.DataSanitizer.sanitizeString(t) || n.NotSpecified, this.data = e, this.time = n.toISOStringForIE8(new Date), this.aiDataContract = { time: i.FieldType.Required, iKey: i.FieldType.Required, name: i.FieldType.Required, sampleRate: function() { return 100 == r.sampleRate ? i.FieldType.Hidden : i.FieldType.Required }, tags: i.FieldType.Required, data: i.FieldType.Required } }; t.Envelope = a } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = function() {}; t.Domain = n } , function(e, t, r) { "use strict"; var n, i = this && this.__extends || (n = Object.setPrototypeOf || { __proto__: [] }instanceof Array && function(e, t) { e.__proto__ = t } || function(e, t) { for (var r in t) t.hasOwnProperty(r) && (e[r] = t[r]) } , function(e, t) { function r() { this.constructor = e } n(e, t), e.prototype = null === t ? Object.create(t) : (r.prototype = t.prototype, new r) } ); Object.defineProperty(t, "__esModule", { value: !0 }); var o = r(1) , s = function(e) { function t(t, r) { var n = e.call(this) || this; return n.aiDataContract = { baseType: o.FieldType.Required, baseData: o.FieldType.Required }, n.baseType = t, n.baseData = r, n } return i(t, e), t }(r(3).Base); t.Data = s } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = function() {}; t.StackFrame = n } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = function() { this.hasFullStack = !0, this.parsedStack = [] }; t.ExceptionDetails = n } , function(e, t, r) { "use strict"; var n, i = this && this.__extends || (n = Object.setPrototypeOf || { __proto__: [] }instanceof Array && function(e, t) { e.__proto__ = t } || function(e, t) { for (var r in t) t.hasOwnProperty(r) && (e[r] = t[r]) } , function(e, t) { function r() { this.constructor = e } n(e, t), e.prototype = null === t ? Object.create(t) : (r.prototype = t.prototype, new r) } ); Object.defineProperty(t, "__esModule", { value: !0 }); var o = function(e) { function t() { var t = e.call(this) || this; return t.ver = 2, t.exceptions = [], t.properties = {}, t.measurements = {}, t = e.call(this) || this } return i(t, e), t }(r(4).Domain); t.ExceptionData = o } , function(e, t, r) { "use strict"; var n, i = this && this.__extends || (n = Object.setPrototypeOf || { __proto__: [] }instanceof Array && function(e, t) { e.__proto__ = t } || function(e, t) { for (var r in t) t.hasOwnProperty(r) && (e[r] = t[r]) } , function(e, t) { function r() { this.constructor = e } n(e, t), e.prototype = null === t ? Object.create(t) : (r.prototype = t.prototype, new r) } ); Object.defineProperty(t, "__esModule", { value: !0 }); var o = r(0) , s = r(1) , a = r(2) , u = r(8) , c = r(7) , l = r(6) , d = function(e) { function t(t, r, n, i) { var o = e.call(this) || this; return o.aiDataContract = { ver: s.FieldType.Required, handledAt: s.FieldType.Required, exceptions: s.FieldType.Required, properties: s.FieldType.Default, measurements: s.FieldType.Default }, o.properties = a.DataSanitizer.sanitizeProperties(n), o.measurements = a.DataSanitizer.sanitizeMeasurements(i), o.handledAt = r || "unhandled", o.exceptions = [new f(t)], o } return i(t, e), t.CreateSimpleException = function(e, t, r, n, i, o, s) { return { handledAt: s || "unhandled", exceptions: [{ hasFullStack: !0, message: e, stack: i, typeName: t, parsedStack: [{ level: 0, assembly: r, fileName: n, line: o, method: "unknown" }] }] } } , t.envelopeType = "ApplicationInsights.{0}.Exception", t.dataType = "ExceptionData", t }(u.ExceptionData); t.TelemetryException = d; var f = function(e) { function t(t) { var r = e.call(this) || this; r.aiDataContract = { id: s.FieldType.Default, outerId: s.FieldType.Default, typeName: s.FieldType.Required, message: s.FieldType.Required, hasFullStack: s.FieldType.Default, stack: s.FieldType.Default, parsedStack: s.FieldType.Array }, r.typeName = a.DataSanitizer.sanitizeString(t.name) || o.NotSpecified, r.message = a.DataSanitizer.sanitizeMessage(t.message) || o.NotSpecified; var n = t.stack; return r.parsedStack = r.parseStack(n), r.stack = a.DataSanitizer.sanitizeException(n), r.hasFullStack = o.isArray(r.parsedStack) && r.parsedStack.length > 0, r } return i(t, e), t.prototype.parseStack = function(e) { var t = void 0; if ("string" == typeof e) { var r = e.split("\n"); t = []; for (var n = 0, i = 0, o = 0; o <= r.length; o++) { var s = r[o]; if (p.regex.test(s)) { var a = new p(r[o],n++); i += a.sizeInBytes, t.push(a) } } if (i > 32768) for (var u = 0, c = t.length - 1, l = 0, d = u, f = c; u < c; ) { if ((l += t[u].sizeInBytes + t[c].sizeInBytes) > 32768) { var h = f - d + 1; t.splice(d, h); break } d = u, f = c, u++, c-- } } return t } , t }(c.ExceptionDetails) , p = function(e) { function t(r, n) { var i = e.call(this) || this; i.sizeInBytes = 0, i.aiDataContract = { level: s.FieldType.Required, method: s.FieldType.Required, assembly: s.FieldType.Default, fileName: s.FieldType.Default, line: s.FieldType.Default }, i.level = n, i.method = "", i.assembly = o.trim(r); var a = r.match(t.regex); return a && a.length >= 5 && (i.method = o.trim(a[2]) || i.method, i.fileName = o.trim(a[4]), i.line = parseInt(a[5]) || 0), i.sizeInBytes += i.method.length, i.sizeInBytes += i.fileName.length, i.sizeInBytes += i.assembly.length, i.sizeInBytes += t.baseSize, i.sizeInBytes += i.level.toString().length, i.sizeInBytes += i.line.toString().length, i } return i(t, e), t.regex = /^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/, t.baseSize = 58, t }(l.StackFrame) } , function(e, t, r) { "use strict"; var n, i = this && this.__extends || (n = Object.setPrototypeOf || { __proto__: [] }instanceof Array && function(e, t) { e.__proto__ = t } || function(e, t) { for (var r in t) t.hasOwnProperty(r) && (e[r] = t[r]) } , function(e, t) { function r() { this.constructor = e } n(e, t), e.prototype = null === t ? Object.create(t) : (r.prototype = t.prototype, new r) } ); Object.defineProperty(t, "__esModule", { value: !0 }); var o = function(e) { function t() { var t = e.call(this) || this; return t.ver = 2, t.properties = {}, t.measurements = {}, t = e.call(this) || this } return i(t, e), t }(r(4).Domain); t.EventData = o } , function(e, t, r) { "use strict"; var n, i = this && this.__extends || (n = Object.setPrototypeOf || { __proto__: [] }instanceof Array && function(e, t) { e.__proto__ = t } || function(e, t) { for (var r in t) t.hasOwnProperty(r) && (e[r] = t[r]) } , function(e, t) { function r() { this.constructor = e } n(e, t), e.prototype = null === t ? Object.create(t) : (r.prototype = t.prototype, new r) } ); Object.defineProperty(t, "__esModule", { value: !0 }); var o = r(0) , s = r(1) , a = r(2) , u = function(e) { function t(t, r, n) { var i = e.call(this) || this; return i.aiDataContract = { ver: s.FieldType.Required, name: s.FieldType.Required, properties: s.FieldType.Default, measurements: s.FieldType.Default }, i.name = a.DataSanitizer.sanitizeString(t) || o.NotSpecified, i.properties = a.DataSanitizer.sanitizeProperties(r), i.measurements = a.DataSanitizer.sanitizeMeasurements(n), i } return i(t, e), t.envelopeType = "Microsoft.ApplicationInsights.{0}.Event", t.dataType = "EventData", t }(r(10).EventData); t.TelemetryEvent = u } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = function() { this.applicationVersion = "ai.application.ver", this.applicationBuild = "ai.application.build", this.applicationTypeId = "ai.application.typeId", this.applicationId = "ai.application.applicationId", this.deviceId = "ai.device.id", this.deviceIp = "ai.device.ip", this.deviceLanguage = "ai.device.language", this.deviceLocale = "ai.device.locale", this.deviceModel = "ai.device.model", this.deviceNetwork = "ai.device.network", this.deviceNetworkName = "ai.device.networkName", this.deviceOEMName = "ai.device.oemName", this.deviceOS = "ai.device.os", this.deviceOSVersion = "ai.device.osVersion", this.deviceRoleInstance = "ai.device.roleInstance", this.deviceRoleName = "ai.device.roleName", this.deviceScreenResolution = "ai.device.screenResolution", this.deviceType = "ai.device.type", this.deviceMachineName = "ai.device.machineName", this.deviceVMName = "ai.device.vmName", this.locationIp = "ai.location.ip", this.operationId = "ai.operation.id", this.operationName = "ai.operation.name", this.operationParentId = "ai.operation.parentId", this.operationRootId = "ai.operation.rootId", this.operationSyntheticSource = "ai.operation.syntheticSource", this.operationIsSynthetic = "ai.operation.isSynthetic", this.operationCorrelationVector = "ai.operation.correlationVector", this.sessionId = "ai.session.id", this.sessionIsFirst = "ai.session.isFirst", this.sessionIsNew = "ai.session.isNew", this.userAccountAcquisitionDate = "ai.user.accountAcquisitionDate", this.userAccountId = "ai.user.accountId", this.userAgent = "ai.user.userAgent", this.userId = "ai.user.id", this.userStoreRegion = "ai.user.storeRegion", this.userAuthUserId = "ai.user.authUserId", this.userAnonymousUserAcquisitionDate = "ai.user.anonUserAcquisitionDate", this.userAuthenticatedUserAcquisitionDate = "ai.user.authUserAcquisitionDate", this.sampleRate = "ai.sample.sampleRate", this.cloudName = "ai.cloud.name", this.cloudRoleVer = "ai.cloud.roleVer", this.cloudEnvironment = "ai.cloud.environment", this.cloudLocation = "ai.cloud.location", this.cloudDeploymentUnit = "ai.cloud.deploymentUnit", this.serverDeviceOS = "ai.serverDevice.os", this.serverDeviceOSVer = "ai.serverDevice.osVer", this.internalSdkVersion = "ai.internal.sdkVersion", this.internalAgentVersion = "ai.internal.agentVersion", this.internalDataCollectorReceivedTime = "ai.internal.dataCollectorReceivedTime", this.internalProfileId = "ai.internal.profileId", this.internalProfileClassId = "ai.internal.profileClassId", this.internalAccountId = "ai.internal.accountId", this.internalApplicationName = "ai.internal.applicationName", this.internalInstrumentationKey = "ai.internal.instrumentationKey", this.internalTelemetryItemId = "ai.internal.telemetryItemId", this.internalApplicationType = "ai.internal.applicationType", this.internalRequestSource = "ai.internal.requestSource", this.internalFlowType = "ai.internal.flowType", this.internalIsAudit = "ai.internal.isAudit", this.internalTrackingSourceId = "ai.internal.trackingSourceId", this.internalTrackingType = "ai.internal.trackingType", this.internalIsDiagnosticExample = "ai.internal.isDiagnosticExample" }; t.ContextTagKeys = n } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = r(0) , i = function() {}; t.Session = i; var o = function() { function e(t) { t || (t = {}), "function" != typeof t.sessionExpirationMs && (t.sessionExpirationMs = function() { return e.acquisitionSpan } ), "function" != typeof t.sessionRenewalMs && (t.sessionRenewalMs = function() { return e.renewalSpan } ), this.config = t, this.automaticSession = new i } return e.prototype.update = function() { this.automaticSession.id || this.initializeAutomaticSession(); var t = +new Date , r = t - this.automaticSession.acquisitionDate > this.config.sessionExpirationMs() , n = t - this.automaticSession.renewalDate > this.config.sessionRenewalMs(); r || n ? (this.automaticSession.isFirst = void 0, this.renew()) : (!this.cookieUpdatedTimestamp || t - this.cookieUpdatedTimestamp > e.cookieUpdateInterval) && (this.automaticSession.renewalDate = +new Date, this.setCookie(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate)) } , e.prototype.initializeAutomaticSession = function() { var t = n.getCookie(e.storageName); if (t && "function" == typeof t.split) this.initializeAutomaticSessionWithData(t); else { var r = n.getStorage(e.storageName); r && this.initializeAutomaticSessionWithData(r) } this.automaticSession.id || (this.automaticSession.isFirst = !0, this.renew()) } , e.prototype.initializeAutomaticSessionWithData = function(e) { var t = e.split("|"); t.length > 0 && (this.automaticSession.id = t[0]); try { if (t.length > 1) { var r = +t[1]; this.automaticSession.acquisitionDate = +new Date(r), this.automaticSession.acquisitionDate = this.automaticSession.acquisitionDate > 0 ? this.automaticSession.acquisitionDate : 0 } if (t.length > 2) { var n = +t[2]; this.automaticSession.renewalDate = +new Date(n), this.automaticSession.renewalDate = this.automaticSession.renewalDate > 0 ? this.automaticSession.renewalDate : 0 } } catch (e) {} } , e.prototype.renew = function() { var e = +new Date; this.automaticSession.id = n.newId(), this.automaticSession.acquisitionDate = e, this.automaticSession.renewalDate = e, this.setCookie(this.automaticSession.id, this.automaticSession.acquisitionDate, this.automaticSession.renewalDate) } , e.prototype.setCookie = function(t, r, i) { var o = r + this.config.sessionExpirationMs() , s = i + this.config.sessionRenewalMs() , a = new Date , u = [t, r, i]; o < s ? a.setTime(o) : a.setTime(s); var c = this.config.cookieDomain ? this.config.cookieDomain() : null; n.setCookie(e.storageName, u.join("|") + ";expires=" + a.toUTCString(), c), this.cookieUpdatedTimestamp = +new Date } , e.storageName = "tracker_ai_session", e.acquisitionSpan = 864e5, e.renewalSpan = 18e5, e.cookieUpdateInterval = 6e4, e }(); t.SessionManager = o } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = r(0) , i = function() { function e(t) { var r = n.getCookie(e.userCookieName); if (r) { var i = r.split(e.cookieSeparator); i.length > 0 && (this.id = i[0]) } if (this.config = t, !this.id) { this.id = n.newId(); var o = new Date , s = n.toISOStringForIE8(o); this.accountAcquisitionDate = s, o.setTime(o.getTime() + 31536e6); var a = [this.id, s] , u = this.config.cookieDomain ? this.config.cookieDomain() : void 0; n.setCookie(e.userCookieName, a.join(e.cookieSeparator) + ";expires=" + o.toUTCString(), u), n.removeStorage("ai_session") } var c = n.getCookie(e.authUserCookieName); if (c) { var l = (c = decodeURI(c)).split(e.cookieSeparator); l[0] && (this.authenticatedId = l[0]), l.length > 1 && l[1] && (this.accountId = l[1]) } } return e.prototype.setAuthenticatedUserContext = function(t, r) { if (this.validateUserInput(t) && (!r || this.validateUserInput(r))) { this.authenticatedId = t; var i = this.authenticatedId; r && (this.accountId = r, i = [this.authenticatedId, this.accountId].join(e.cookieSeparator)), n.setCookie(e.authUserCookieName, encodeURI(i), this.config.cookieDomain()) } } , e.prototype.clearAuthenticatedUserContext = function() { this.authenticatedId = null, this.accountId = null, n.deleteCookie(e.authUserCookieName) } , e.prototype.validateUserInput = function(e) { return !("string" != typeof e || !e || e.match(/,|;|=| |\|/)) } , e.cookieSeparator = "|", e.userCookieName = "tracker_ai_user", e.authUserCookieName = "tracker_ai_authUser", e }(); t.User = i } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = r(0) , i = function() { this.id = n.newId(), null != self && null != self.location && null != self.location.pathname && (this.name = self.location.pathname) }; t.Operation = i } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = function() {}; t.AppInsightsLocation = n } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }), t.Version = "1.0.3"; var n = function() { this.sdkVersion = "javascript:" + t.Version, this.agentVersion = "Mindbox.1.0" }; t.Internal = n } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = function() { this.id = "browser", this.type = "Browser" }; t.Device = n } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = function() {}; t.Application = n } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = r(0) , i = function() { function e() { this._buffer = [] } return e.prototype.enqueue = function(e) { this._buffer.push(e) } , e.prototype.count = function() { return this._buffer.length } , e.prototype.clear = function() { this._buffer.length = 0 } , e.prototype.getItems = function() { return this._buffer.slice(0) } , e.prototype.batchPayloads = function(e) { return e && e.length > 0 ? "[" + e.join(",") + "]" : null } , e.prototype.markAsSent = function(e) { this.clear() } , e.prototype.clearSent = function(e) {} , e }(); t.ArraySendBuffer = i; var o = function() { function e() { this._bufferFullMessageSent = !1; var t = this.getBuffer(e.BUFFER_KEY) , r = this.getBuffer(e.SENT_BUFFER_KEY); this._buffer = t.concat(r), this._buffer.length > e.MAX_BUFFER_SIZE && (this._buffer.length = e.MAX_BUFFER_SIZE), this.setBuffer(e.SENT_BUFFER_KEY, []), this.setBuffer(e.BUFFER_KEY, this._buffer) } return e.prototype.enqueue = function(t) { this._buffer.length >= e.MAX_BUFFER_SIZE ? this._bufferFullMessageSent || (this._bufferFullMessageSent = !0) : (this._buffer.push(t), this.setBuffer(e.BUFFER_KEY, this._buffer)) } , e.prototype.count = function() { return this._buffer.length } , e.prototype.clear = function() { this._buffer.length = 0, this.setBuffer(e.BUFFER_KEY, []), this.setBuffer(e.SENT_BUFFER_KEY, []), this._bufferFullMessageSent = !1 } , e.prototype.getItems = function() { return this._buffer.slice(0) } , e.prototype.batchPayloads = function(e) { return e && e.length > 0 ? "[" + e.join(",") + "]" : null } , e.prototype.markAsSent = function(t) { var r = this.getBuffer(e.SENT_BUFFER_KEY); (r = r.concat(t)).length > e.MAX_BUFFER_SIZE && (r.length = e.MAX_BUFFER_SIZE), this._buffer = this.removePayloadsFromBuffer(t, this._buffer), this.setBuffer(e.BUFFER_KEY, this._buffer), this.setBuffer(e.SENT_BUFFER_KEY, r) } , e.prototype.clearSent = function(t) { var r = this.getBuffer(e.SENT_BUFFER_KEY); r = this.removePayloadsFromBuffer(t, r), this.setBuffer(e.SENT_BUFFER_KEY, r) } , e.prototype.removePayloadsFromBuffer = function(e, t) { var r = []; for (var n in t) { var i = !1; for (var o in e) if (e[o] === t[n]) { i = !0; break } i || r.push(t[n]) } return r } , e.prototype.getBuffer = function(e) { try { var t = n.getSessionStorage(e); if (t) { var r = JSON.parse(t); if (r) return r } } catch (e) {} return [] } , e.prototype.setBuffer = function(e, t) { try { var r = JSON.stringify(t); n.setSessionStorage(e, r) } catch (t) { n.setSessionStorage(e, JSON.stringify([])) } } , e.BUFFER_KEY = "AI_buffer", e.SENT_BUFFER_KEY = "AI_sentBuffer", e.MAX_BUFFER_SIZE = 2e3, e }(); t.SessionStorageSendBuffer = o } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = r(0) , i = r(1) , o = r(20) , s = function() { function e(e) { var t = this; this._XMLHttpRequestSupported = !1, this.isInServiceWorker = function() { return "ServiceWorkerGlobalScope"in self } , this._xdrOnLoad = function(e, r) { if (!e || e.responseText + "" != "200" && "" !== e.responseText) { var n = t._parseResponse(e.responseText); n && n.itemsReceived && n.itemsReceived > n.itemsAccepted && !t._config.isRetryDisabled() ? t._onPartialSuccess(r, n) : t._onError(r, e && e.responseText || "") } else t._consecutiveErrors = 0, t._onSuccess(r, 0) } , this._onPartialSuccess = function(e, r) { for (var n = [], i = [], o = 0, s = r.errors.reverse(); o < s.length; o++) { var a = s[o] , u = e.splice(a.index, 1)[0]; t._isRetriable(a.statusCode) ? i.push(u) : n.push(u) } e.length > 0 && t._onSuccess(e, r.itemsAccepted), n.length > 0 && t._onError(n, ["partial success", r.itemsAccepted, "of", r.itemsReceived].join(" ")), i.length > 0 && t._resendPayload(i) } , this._consecutiveErrors = 0, this._retryAt = null, this._config = e, this._sender = null, this._buffer = n.canUseSessionStorage() && this._config.enableSessionStorageBuffer() ? new o.SessionStorageSendBuffer : new o.ArraySendBuffer, this.isInServiceWorker() && "fetch"in self ? this._sender = this._fetchSender : "undefined" != typeof XMLHttpRequest && ("withCredentials"in new XMLHttpRequest ? (this._sender = this._xhrSender, this._XMLHttpRequestSupported = !0) : "undefined" != typeof XDomainRequest && (this._sender = this._xdrSender)) } return e.prototype.send = function(e) { try { if (!e) return; if (!this._sender) return; var t = i.Serializer.serialize(e) , r = this._buffer.getItems() , n = this._buffer.batchPayloads(r); n && n.length + t.length > this._config.maxBatchSizeInBytes() && this.triggerSend(), this._buffer.enqueue(t), this.isInServiceWorker() ? this.triggerSend() : this._setupTimer() } catch (e) {} } , e.prototype._setupTimer = function() { var e = this; if (!this._timeoutHandle) { var t = this._retryAt ? Math.max(0, this._retryAt - Date.now()) : 0 , r = Math.max(this._config.maxBatchInterval(), t); this._timeoutHandle = setTimeout(function() { e.triggerSend() }, r) } } , e.prototype.triggerSend = function(e) { var t = !0; "boolean" == typeof e && (t = e); try { if (this._buffer.count() > 0) { var r = this._buffer.getItems(); this._sender(r, t) } clearTimeout(this._timeoutHandle), this._timeoutHandle = null, this._retryAt = null } catch (e) { !n.getIEVersion() || n.getIEVersion() } } , e.prototype._setRetryTime = function() { var e; if (this._consecutiveErrors <= 1) e = 10; else { var t = (Math.pow(2, this._consecutiveErrors) - 1) / 2 , r = Math.floor(Math.random() * t * 10) + 1; e = Math.max(Math.min(r, 3600), 10) } var n = Date.now() + 1e3 * e; this._retryAt = n } , e.prototype._parseResponse = function(e) { try { var t = JSON.parse(e); if (t && t.itemsReceived && t.itemsReceived >= t.itemsAccepted && t.itemsReceived - t.itemsAccepted == t.errors.length) return t } catch (e) {} return null } , e.prototype._isRetriable = function(e) { return 408 == e || 429 == e || 500 == e || 503 == e } , e.prototype._resendPayload = function(e) { if (e && 0 !== e.length) { this._buffer.clearSent(e), this._consecutiveErrors++; for (var t = 0, r = e; t < r.length; t++) { var n = r[t]; this._buffer.enqueue(n) } this._setRetryTime(), this._setupTimer() } } , e.prototype._xhrSender = function(t, r) { var n = this , i = new XMLHttpRequest; i[e.DisabledPropertyName] = !0, i.open("POST", this._config.endpointUrl(), r), i.setRequestHeader("Content-type", "application/json"), i.onreadystatechange = function() { return n._xhrReadyStateChange(i, t, t.length) } , i.onerror = function(e) { return n._onError(t, i.responseText || i.response || "", e) } ; var o = this._buffer.batchPayloads(t); i.send(o), this._buffer.markAsSent(t) } , e.prototype._fetchSender = function(e, t) { var r = this , n = new Headers; n.append("Content-Type", "application/json"); var i = { method: "POST", body: this._buffer.batchPayloads(e), headers: n } , o = new Request(this._config.endpointUrl(),i); fetch(o).then(function(t) { if (!t.ok) throw new Error("Request failed with <" + t.status + "> " + t.statusText); r._consecutiveErrors = 0, r._onSuccess(e, e.length), r._buffer.markAsSent(e) }).catch(function(t) { r._onError(e, t.message) }) } , e.prototype._xdrSender = function(e, t) { var r = this , n = new XDomainRequest; n.onload = function() { return r._xdrOnLoad(n, e) } , n.onerror = function(t) { return r._onError(e, n.responseText || "", t) } ; var i = window.location.protocol; if (0 === this._config.endpointUrl().lastIndexOf(i, 0)) { var o = this._config.endpointUrl().replace(/^(https?:)/, ""); n.open("POST", o); var s = this._buffer.batchPayloads(e); n.send(s), this._buffer.markAsSent(e) } else this._buffer.clear() } , e.prototype._xhrReadyStateChange = function(e, t, r) { if (4 === e.readyState) if ((e.status < 200 || e.status >= 300) && 0 !== e.status) !this._config.isRetryDisabled() && this._isRetriable(e.status) ? this._resendPayload(t) : this._onError(t, e.responseText || e.response || ""); else if (206 === e.status) { var n = this._parseResponse(e.responseText || e.response); n && !this._config.isRetryDisabled() ? this._onPartialSuccess(t, n) : this._onError(t, e.responseText || e.response || "") } else this._consecutiveErrors = 0, this._onSuccess(t, r) } , e.prototype._onError = function(e, t, r) { this._buffer.clearSent(e) } , e.prototype._onSuccess = function(e, t) { this._buffer.clearSent(e) } , e.DisabledPropertyName = "Microsoft_ApplicationInsights_BypassAjaxInstrumentation", e }(); t.Sender = s } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = r(21) , i = r(19) , o = r(18) , s = r(17) , a = r(16) , u = r(15) , c = r(14) , l = r(13) , d = r(12) , f = function() { function e(e) { this._config = e, this._sender = new n.Sender(e), "undefined" != typeof window && (this._sessionManager = new l.SessionManager(e), this.application = new i.Application, this.device = new o.Device, this.internal = new s.Internal, this.location = new a.AppInsightsLocation, this.user = new c.User(e), this.session = new l.Session), this.operation = new u.Operation } return e.prototype.track = function(e) { return this.session && "string" != typeof this.session.id && this._sessionManager.update(), this._track(e), e } , e.prototype._track = function(e) { this.session && ("string" == typeof this.session.id ? this._applySessionContext(e, this.session) : this._applySessionContext(e, this._sessionManager.automaticSession)), this._applyApplicationContext(e, this.application), this._applyDeviceContext(e, this.device), this._applyInternalContext(e, this.internal), this._applyAppInsightsLocationContext(e, this.location), this._applyUserContext(e, this.user), this._applyOperationContext(e, this.operation), e.iKey = this._config.instrumentationKey(); var t = this._config.instrumentationKey().replace(/-/g, ""); return e.name = e.name.replace("{0}", t), this._sender.send(e), e } , e.prototype._applyApplicationContext = function(e, t) { if (t) { var r = new d.ContextTagKeys; "string" == typeof t.ver && (e.tags[r.applicationVersion] = t.ver), "string" == typeof t.build && (e.tags[r.applicationBuild] = t.build) } } , e.prototype._applyDeviceContext = function(e, t) { var r = new d.ContextTagKeys; t && ("string" == typeof t.id && (e.tags[r.deviceId] = t.id), "string" == typeof t.ip && (e.tags[r.deviceIp] = t.ip), "string" == typeof t.language && (e.tags[r.deviceLanguage] = t.language), "string" == typeof t.locale && (e.tags[r.deviceLocale] = t.locale), "string" == typeof t.model && (e.tags[r.deviceModel] = t.model), void 0 !== t.network && (e.tags[r.deviceNetwork] = t.network), "string" == typeof t.oemName && (e.tags[r.deviceOEMName] = t.oemName), "string" == typeof t.os && (e.tags[r.deviceOS] = t.os), "string" == typeof t.osversion && (e.tags[r.deviceOSVersion] = t.osversion), "string" == typeof t.resolution && (e.tags[r.deviceScreenResolution] = t.resolution), "string" == typeof t.type && (e.tags[r.deviceType] = t.type)) } , e.prototype._applyInternalContext = function(e, t) { if (t) { var r = new d.ContextTagKeys; "string" == typeof t.agentVersion && (e.tags[r.internalAgentVersion] = t.agentVersion), "string" == typeof t.sdkVersion && (e.tags[r.internalSdkVersion] = t.sdkVersion) } } , e.prototype._applyAppInsightsLocationContext = function(e, t) { if (t) { var r = new d.ContextTagKeys; "string" == typeof t.ip && (e.tags[r.locationIp] = t.ip) } } , e.prototype._applyOperationContext = function(e, t) { if (t) { var r = new d.ContextTagKeys; "string" == typeof t.id && (e.tags[r.operationId] = t.id), "string" == typeof t.name && (e.tags[r.operationName] = t.name), "string" == typeof t.parentId && (e.tags[r.operationParentId] = t.parentId), "string" == typeof t.rootId && (e.tags[r.operationRootId] = t.rootId), "string" == typeof t.syntheticSource && (e.tags[r.operationSyntheticSource] = t.syntheticSource) } } , e.prototype._applySessionContext = function(e, t) { if (t) { var r = new d.ContextTagKeys; "string" == typeof t.id && (e.tags[r.sessionId] = t.id), void 0 !== t.isFirst && (e.tags[r.sessionIsFirst] = t.isFirst) } } , e.prototype._applyUserContext = function(e, t) { if (t) { var r = new d.ContextTagKeys; "string" == typeof t.accountId && (e.tags[r.userAccountId] = t.accountId), "string" == typeof t.agent && (e.tags[r.userAgent] = t.agent), "string" == typeof t.id && (e.tags[r.userId] = t.id), "string" == typeof t.authenticatedId && (e.tags[r.userAuthUserId] = t.authenticatedId), "string" == typeof t.storeRegion && (e.tags[r.userStoreRegion] = t.storeRegion) } } , e }(); t.TelemetryContext = f } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = r(0) , i = r(22) , o = r(11) , s = r(9) , a = r(3) , u = r(5) , c = function() { function e(t) { var r = this; this.config = t || {}; var n = e.defaultConfig; if (void 0 !== n) for (var o in n) void 0 === this.config[o] && (this.config[o] = n[o]); var s = { instrumentationKey: function() { return r.config.instrumentationKey }, sessionRenewalMs: function() { return r.config.sessionRenewalMs }, sessionExpirationMs: function() { return r.config.sessionExpirationMs }, endpointUrl: function() { return r.config.endpointUrl }, maxBatchSizeInBytes: function() { return r.config.maxBatchSizeInBytes }, maxBatchInterval: function() { return r.config.maxBatchInterval }, cookieDomain: function() { return r.config.cookieDomain }, enableSessionStorageBuffer: function() { return r.config.enableSessionStorageBuffer }, isRetryDisabled: function() { return r.config.isRetryDisabled } }; this.context = new i.TelemetryContext(s), "undefined" != typeof window && window.addEventListener && window.addEventListener("beforeunload", function() { return r.flush() }) } return e.prototype.trackEvent = function(e, t, r) { try { var n = new o.TelemetryEvent(e,t,r) , i = new u.Data(o.TelemetryEvent.dataType,n) , c = new a.Envelope(i,s.TelemetryException.envelopeType); this.context.track(c) } catch (e) {} } , e.prototype.trackException = function(e, t, r, i) { try { if (!n.isError(e)) try { throw new Error(e) } catch (t) { e = t } var o = new s.TelemetryException(e,t,r,i) , c = new u.Data(s.TelemetryException.dataType,o) , l = new a.Envelope(c,s.TelemetryException.envelopeType); this.context.track(l) } catch (e) {} } , e.prototype.flush = function() { try { this.context._sender.triggerSend() } catch (e) {} } , e.prototype.setAuthenticatedUserContext = function(e, t) { try { this.context.user.setAuthenticatedUserContext(e, t) } catch (e) {} } , e.prototype.clearAuthenticatedUserContext = function() { try { this.context.user.clearAuthenticatedUserContext() } catch (e) {} } , e.prototype.SendCORSException = function(e) { var t = s.TelemetryException.CreateSimpleException("Script error.", "Error", "unknown", "unknown", "The browser's same-origin policy prevents us from getting the details of this exception. The exception occurred in a script loaded from an origin different than the web page. For cross-domain error reporting you can use crossorigin attribute together with appropriate CORS HTTP headers. For more information please see http://www.w3.org/TR/cors/.", 0, null); t.properties = e; var r = new u.Data(s.TelemetryException.dataType,t) , n = new a.Envelope(r,s.TelemetryException.envelopeType); this.context.track(n) } , e.prototype._onerror = function(e, t, r, i, o) { try { var s = { url: t || document.URL }; if (n.isCrossOriginError(e, t, r, i, o)) this.SendCORSException(s); else { if (!n.isError(o)) { var a = "window.onerror@" + s.url + ":" + r + ":" + (i || 0); (o = new Error(e)).stack = a } this.trackException(o, null, s) } } catch (e) {} } , e }(); t.AppInsights = c } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = r(23) , i = r(0) , o = function() { function e(t) { t.queue = t.queue || []; var r = t.config || {}; if (!r.instrumentationKey) throw new Error("Cannot load Application Insights SDK, no instrumentationKey was provided."); r = e.getDefaultConfig(r), this.snippet = t, this.config = r } return e.prototype.loadAppInsights = function() { return new n.AppInsights(this.config) } , e.getDefaultConfig = function(e) { return e || (e = {}), e.endpointUrl = e.endpointUrl || "https://dc.services.visualstudio.com/v2/track", e.sessionRenewalMs = 18e5, e.sessionExpirationMs = 864e5, e.maxBatchSizeInBytes = e.maxBatchSizeInBytes > 0 ? e.maxBatchSizeInBytes : 1e6, e.maxBatchInterval = isNaN(e.maxBatchInterval) ? 15e3 : e.maxBatchInterval, e.enableSessionStorageBuffer = void 0 === e.enableSessionStorageBuffer || null === e.enableSessionStorageBuffer || i.stringToBoolOrDefault(e.enableSessionStorageBuffer), e.isRetryDisabled = void 0 !== e.isRetryDisabled && null !== e.isRetryDisabled && i.stringToBoolOrDefault(e.isRetryDisabled), e } , e }(); t.getAppInsights = function(e) { return new o({ config: e }).loadAppInsights() } } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = r(24); t.getAppInsights = n.getAppInsights } ]) } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); t.appInsightsConfig = { instrumentationKey: "bce5a361-657b-4482-ace0-901718fb2a96" } } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); t.compareSettings = function(e, t) { for (var r = new Array, i = 0, o = Object.keys(e); i < o.length; i++) { var s = o[i] , a = n(s, e, t); null != a && r.push(a) } return 0 === r.length ? null : r } ; var n = function(e, t, r) { var n; switch (e) { case "serviceDomain": n = null; break; case "customer": n = i(t[e], r[e]) ? null : "customer cookies are different"; break; case "redirectedFrom": n = o(t[e], r[e]) ? null : "redirectedFrom objects are different"; break; default: n = t[e] === r[e] ? null : t[e] + " !== " + r[e] } return null == n ? null : { key: e, message: n } } , i = function(e, t) { return e.id === t.id && e.sessionKey === t.sessionKey } , o = function(e, t) { return e.requestUrl === t.requestUrl && e.referrerUrl === t.referrerUrl }; t.getEffectiveApiUri = function(e) { if (null == e) throw new Error("'settings' cannot be null"); return (e.useHttp ? "http" : "https") + "://" + (null != e.serviceDomain ? e.serviceDomain : "api.mindbox.ru") } } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = r(5) , i = r(24) , o = r(2) , s = function() { function e(e, t, r, n) { if (this.previousModulePromise = null, this.isSupportedByBrowserCommand = function(e, t) { return "isSupportedByBrowser" === e } , null == e) throw new Error("'trackerSettings' cannot be null"); if (null == t) throw new Error("'sessionStorage' cannot be null"); if (null == r) throw new Error("'deviceUUIDObtainingPromiseProvider' cannot be null"); if (null == n) throw new Error("'logger' cannot be null"); this.trackerSettings = e, this.sessionStorage = t, this.deviceUUIDObtainingPromiseProvider = r, this.logger = n } return e.prototype.tryGetModuleCommand = function(e) { var t = e.indexOf("."); if (t <= 0) return null; var r = e.substr(0, t); return i.moduleExists(r) ? { moduleName: r, command: e.substr(t + 1) } : null } , e.prototype.invokeModule = function(e, t) { var r = this , n = e.moduleName , o = e.command; if (t instanceof Array && t.length > 1) throw new Error("[Mindbox.SDK] <" + n + "> Too many arguments for command."); var s = t instanceof Array ? t[0] : t , a = i.getModuleInfo(n).isSupportedByBrowser(); if (this.isSupportedByBrowserCommand(o, s)) { if (null == s || "function" != typeof s.callback) throw new Error("[Mindbox.SDK] <" + n + '> Callback for command "isSupportedByBrowser" not set.'); s.callback(a) } else a && this.moduleThen(n, function(e) { if (void 0 === e[o]) throw new Error("[Mindbox.SDK] <" + n + '> Unknown command "' + o + '".'); return e[o](r.trackerSettings, r.sessionStorage.getDeviceUUID(), s) }) } , e.prototype.moduleThen = function(e, t) { var r = this , s = this.deviceUUIDObtainingPromiseProvider(); if (null == s) throw new Error("Previous request promise is expected to be set. 'mindbox(\"create\")' is expected to be called ahead of every other command"); if (null == this.previousModulePromise) { var a = new n.Promise(function(t, n) { i.loadModule(r.trackerSettings, e, o.version, r.logger).then(function(e) { return t(e) }, function(e) { return n(e) }) } ); this.previousModulePromise = n.Promise.all([a, s]).then(function(e) { return e[0] }, function(e) { return n.Promise.reject(e) }) } this.previousModulePromise = this.previousModulePromise.then(function(e) { return new n.Promise(function(r, n) { t(e).then(function() { return r(e) }, function(e) { return n(e) }) } ) }, function(e) { return n.Promise.reject(e) }).then(void 0, function(e) { return r.logger.logError(e), n.Promise.reject(e) }) } , e }(); t.ModuleManager = s } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n, i = r(25), o = r(22); r(26), function(e) { e.NotLoaded = "NotLoaded", e.Loading = "Loading", e.Loaded = "Loaded", e.Failed = "Failed" }(n || (n = {})); var s, a = { webpush: (s = i.webpushModuleInfo, { moduleInfo: s, loadingState: n.NotLoaded, loadingPromise: null, loadingError: null }) }, u = function(e) { var t = a[e]; if (null == t) throw new Error("[Mindbox.SDK] Module " + e + " is not registered."); return t }; t.getModuleInfo = function(e) { return u(e).moduleInfo } , t.moduleExists = function(e) { return e in a } , t.loadModule = function(e, t, r, i) { var s = u(t); switch (s.loadingState) { case n.Loaded: return Promise.resolve(l(s.moduleInfo)); case n.Loading: return s.loadingPromise; case n.NotLoaded: return s.loadingState = n.Loading, s.loadingPromise = new Promise(function(a, u) { var d = document.createElement("script"); d.src = o.getEffectiveApiUri(e) + "/scripts/modules/" + s.moduleInfo.src + "?version=" + r, d.async = !0; var f = function() { return null == c(s.moduleInfo) } , p = function() { try { s.loadingState = n.Loaded, a(l(s.moduleInfo)) } catch (e) { s.loadingState = n.Failed, s.loadingError = e, u(e) } } , h = { "Module name": s.moduleInfo.name }; d.onload = function() { f() ? (i.trackEvent("Loading module in another loop", h), setTimeout(function() { f() ? i.trackEvent("Couldn't load module in another loop", h) : i.trackEvent("Have loaded module in another loop", h), p() }, 5e3)) : p() } , d.onerror = function() { u(new Error("[Mindbox.SDK] There was an error during loading of '" + t + "' module")) } ; try { document.head.insertAdjacentElement("beforeend", d) } catch (e) { u(e) } } ), s.loadingPromise; case n.Failed: return s.loadingPromise; default: throw new Error("[Mindbox.SDK] Unknown module loading state " + s.loadingState + ".") } } ; var c = function(e) { return window.mindbox[e.name] } , l = function(e) { var t = c(e); if (null == t) throw new Error("[Mindbox.SDK] Expected module not found in mindbox[" + e.name + "]"); return t } } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); t.webpushModuleInfo = { name: "webpush", src: "webpush.js", version: "1.10.0", isSupportedByBrowser: function() { return navigator.cookieEnabled && "serviceWorker"in navigator && "PushManager"in window && "Notification"in window && "fetch"in window && ServiceWorkerRegistration.prototype.hasOwnProperty("showNotification") && PushSubscription.prototype.hasOwnProperty("getKey") && ("https:" == window.location.protocol || ["localhost", "127.0.0.1", ""].some(function(e) { return e === window.location.hostname })) } } } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }) } , function(e, t, r) { "use strict"; Object.defineProperty(t, "__esModule", { value: !0 }); var n = function() { function e() {} return e.prototype.tryGetTimeZone = function() { try { return Intl.DateTimeFormat().resolvedOptions().timeZone } catch (e) { return null } } , e }(); t.IanaTimeZoneProvider = n } ]); //# sourceMappingURL=tracker.js.map