https://www.pdpaola.com/cdn/shop/t/510/assets/globale_integration.js?v=84796294424428385411790171637
1(function(){var __webpack_modules__={
1"./resources/js/globale-integration.js":function(){eval('{function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a \'" + o + "\' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }\nfunction _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { if (r) i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n;else { var o = function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); }; o("next", 0), o("throw", 1), o("return", 2); } }, _regeneratorDefine2(e, r, n, t); }\nfunction _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }\nvar SESSION_STORAGE_KEY = \'ge_merchant_session_id\';\nfunction getOrCreateSessionId() {\n var id = sessionStorage.getItem(SESSION_STORAGE_KEY);\n if (!id) {\n id = "".concat(Date.now(), "-").concat(Math.random().toString(36).slice(2, 11));\n sessionStorage.setItem(SESSION_STORAGE_KEY, id);\n }\n return id;\n}\nfunction getCartUpdateUrl() {\n var _window$Shopify;\n if ((_window$Shopify = window.Shopify) !== null && _window$Shopify !== void 0 && (_window$Shopify = _window$Shopify.routes) !== null && _window$Shopify !== void 0 && (_window$Shopify = _window$Shopify.cart) !== null && _window$Shopify !== void 0 && _window$Shopify.update) {\n return window.Shopify.routes.cart.update.endsWith(\'.js\') ? window.Shopify.routes.cart.update : "".concat(window.Shopify.routes.cart.update, ".js");\n }\n return \'/cart/update.js\';\n}\nfunction getCartFetchUrl() {\n var _window$Shopify2;\n var root = ((_window$Shopify2 = window.Shopify) === null || _window$Shopify2 === void 0 || (_window$Shopify2 = _window$Shopify2.routes) === null || _window$Shopify2 === void 0 ? void 0 : _window$Shopify2.root) || \'/\';\n return "".concat(root, "cart.js");\n}\nfunction updateCartAttributes(_x) {\n return _updateCartAttributes.apply(this, arguments);\n}\nfunction _updateCartAttributes() {\n _updateCartAttributes = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(attributes) {\n var response, _t;\n return _regenerator().w(function (_context) {\n while (1) switch (_context.p = _context.n) {\n case 0:\n if (!(!attributes || _typeof(attributes) !== \'object\')) {\n _context.n = 1;\n break;\n }\n return _context.a(2, null);\n case 1:\n _context.p = 1;\n _context.n = 2;\n return fetch(getCartUpdateUrl(), {\n method: \'POST\',\n headers: {\n \'Content-Type\': \'application/json\'\n },\n credentials: \'same-origin\',\n body: JSON.stringify({\n attributes: attributes\n })\n });\n case 2:\n response = _context.v;\n if (response.ok) {\n _context.n = 3;\n break;\n }\n throw new Error("Cart attribute update failed (".concat(response.status, ")"));\n case 3:\n return _context.a(2, response.json());\n case 4:\n _context.p = 4;\n _t = _context.v;\n console.error(\'[Global-e] Failed to update cart attributes\', _t);\n return _context.a(2, null);\n }\n }, _callee, null, [[1, 4]]);\n }));\n return _updateCartAttributes.apply(this, arguments);\n}\nfunction dispatchGeMerchantSession(cart) {\n var platformCartId = (cart === null || cart === void 0 ? void 0 : cart.token) || \'\';\n window.geMerchantSession = {\n platformCartId: platformCartId,\n cartId: platformCartId,\n sessionId: getOrCreateSessionId()\n };\n document.dispatchEvent(new CustomEvent(\'geMerchantSession\', {\n bubbles: true,\n detail: window.geMerchantSession\n }));\n}\nfunction refreshGeMerchantSession() {\n return _refreshGeMerchantSession.apply(this, arguments);\n}\nfunction _refreshGeMerchantSession() {\n _refreshGeMerchantSession = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {\n var response, cart, _t2;\n return _regenerator().w(function (_context2) {\n while (1) switch (_context2.p = _context2.n) {\n case 0:\n _context2.p = 0;\n _context2.n = 1;\n return fetch(getCartFetchUrl(), {\n credentials: \'same-origin\',\n cache: \'no-cache\'\n });\n case 1:\n response = _context2.v;
1\n if (response.ok) {\n _context2.n = 2;\n break;\n }\n dispatchGeMerchantSession({\n token: \'\'\n });\n return _context2.a(2);\n case 2:\n _context2.n = 3;\n return response.json();\n case 3:\n cart = _context2.v;\n dispatchGeMerchantSession(cart);\n _context2.n = 5;\n break;\n case 4:\n _context2.p = 4;\n _t2 = _context2.v;\n dispatchGeMerchantSession({\n token: \'\'\n });\n case 5:\n return _context2.a(2);\n }\n }, _callee2, null, [[0, 4]]);\n }));\n return _refreshGeMerchantSession.apply(this, arguments);\n}\nfunction submitShopifyTrackingConsent(consent) {\n var _window$Shopify3;\n var config = window.PDPaolaGlobalE || {};\n if (!config.storefrontAccessToken) {\n return;\n }\n if (!((_window$Shopify3 = window.Shopify) !== null && _window$Shopify3 !== void 0 && (_window$Shopify3 = _window$Shopify3.customerPrivacy) !== null && _window$Shopify3 !== void 0 && _window$Shopify3.setTrackingConsent)) {\n return;\n }\n window.Shopify.customerPrivacy.setTrackingConsent({\n marketing: Boolean(consent.marketing),\n analytics: Boolean(consent.analytics),\n preferences: Boolean(consent.preferences),\n headlessStorefront: true,\n checkoutRootDomain: config.checkoutRootDomain,\n storefrontRootDomain: config.storefrontRootDomain,\n storefrontAccessToken: config.storefrontAccessToken\n }, function () {});\n}\nfunction mapVisitorConsent() {\n var _ref, _detail$marketingAllo, _ref2, _detail$analyticsProc, _ref3, _detail$preferencesPr;\n var detail = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return {\n marketing: (_ref = (_detail$marketingAllo = detail.marketingAllowed) !== null && _detail$marketingAllo !== void 0 ? _detail$marketingAllo : detail.marketing) !== null && _ref !== void 0 ? _ref : false,\n analytics: (_ref2 = (_detail$analyticsProc = detail.analyticsProcessingAllowed) !== null && _detail$analyticsProc !== void 0 ? _detail$analyticsProc : detail.analytics) !== null && _ref2 !== void 0 ? _ref2 : false,\n preferences: (_ref3 = (_detail$preferencesPr = detail.preferencesProcessingAllowed) !== null && _detail$preferencesPr !== void 0 ? _detail$preferencesPr : detail.preferences) !== null && _ref3 !== void 0 ? _ref3 : false\n };\n}\nfunction bindCartAjaxListener() {\n if (!window.jQuery) {\n return;\n }\n window.jQuery(document).ajaxSuccess(function (_event, _xhr, settings) {\n if (settings !== null && settings !== void 0 && settings.url && /\\/cart\\/(add|change|update|clear)/.test(settings.url)) {\n refreshGeMerchantSession();\n }\n });\n}\nfunction initGlobalEIntegration() {\n document.addEventListener(\'geCartAttributes\', function (event) {\n var _event$detail;\n var attributes = event === null || event === void 0 || (_event$detail = event.detail) === null || _event$detail === void 0 ? void 0 : _event$detail.attributes;\n if (attributes) {\n updateCartAttributes(attributes).then(function (cart) {\n if (cart) {\n dispatchGeMerchantSession(cart);\n }\n });\n }\n }, false);\n document.addEventListener(\'shopify:cart:updated\', function (event) {\n if (event !== null && event !== void 0 && event.detail) {\n dispatchGeMerchantSession(event.detail);\n }\n });\n document.addEventListener(\'visitorConsentCollected\', function (event) {\n submitShopifyTrackingConsent(mapVisitorConsent(event.detail));\n });\n document.addEventListener(\'trackingConsentAccepted\', function () {\n var _window$Shopify4;\n if ((_window$Shopify4 = window.Shopify) !== null && _window$Shopify4 !== void 0 && (_window$Shopify4 = _window$Shopify4.customerPrivacy) !== null && _window$Shopify4 !== void 0 && _window$Shopify4.currentVisitorConsent) {\n submitShopifyTrackingConsent(mapVisitorConsent(window.Shopify.customerPrivacy.currentVisitorConsent()));\n }\n });
1\n var onReady = function onReady() {\n bindCartAjaxListener();\n refreshGeMerchantSession();\n };\n if (document.readyState === \'loading\') {\n document.addEventListener(\'DOMContentLoaded\', onReady);\n } else {\n onReady();\n }\n}\ninitGlobalEIntegration();\n\n//# sourceURL=webpack:///./resources/js/globale-integration.js?\n}')}
1},__webpack_exports__={};__webpack_modules__["./resources/js/globale-integration.js"]()})(); 2//# sourceMappingURL=/cdn/shop/t/510/assets/globale_integration.js.map?v=84796294424428385411790171637
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.