@pelcro/react-pelcro-js 3.23.0 → 3.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +649 -81
- package/dist/index.esm.js +649 -81
- package/package.json +2 -1
package/dist/index.esm.js
CHANGED
|
@@ -7248,6 +7248,51 @@ function _defineProperty$3(obj, key, value) {
|
|
|
7248
7248
|
return obj;
|
|
7249
7249
|
}
|
|
7250
7250
|
|
|
7251
|
+
// Polyfill
|
|
7252
|
+
(() => {
|
|
7253
|
+
if (typeof window.CustomEvent === "function") return false;
|
|
7254
|
+
function CustomEvent(event) {
|
|
7255
|
+
let params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
7256
|
+
bubbles: false,
|
|
7257
|
+
cancelable: false,
|
|
7258
|
+
detail: undefined
|
|
7259
|
+
};
|
|
7260
|
+
const evt = document.createEvent("CustomEvent");
|
|
7261
|
+
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
|
7262
|
+
return evt;
|
|
7263
|
+
}
|
|
7264
|
+
CustomEvent.prototype = window.Event.prototype;
|
|
7265
|
+
window.CustomEvent = CustomEvent;
|
|
7266
|
+
})();
|
|
7267
|
+
|
|
7268
|
+
/**
|
|
7269
|
+
* Should fire when the cart is opened and expects the cartItems inside the card to be sent
|
|
7270
|
+
*/
|
|
7271
|
+
const cartOpened = detail => createCustomEvent("PelcroElementsCartOpened", detail);
|
|
7272
|
+
|
|
7273
|
+
/**
|
|
7274
|
+
* Should fire when an item added to the cart and expects the added item to be sent
|
|
7275
|
+
*/
|
|
7276
|
+
const cartItemAdded = detail => createCustomEvent("PelcroElementsCartItemAdded", detail);
|
|
7277
|
+
|
|
7278
|
+
/**
|
|
7279
|
+
* Should fire when an item removed from the cart and expects the removed item to be sent
|
|
7280
|
+
*/
|
|
7281
|
+
const cartItemRemoved = detail => createCustomEvent("PelcroElementsCartItemRemoved", detail);
|
|
7282
|
+
|
|
7283
|
+
/**
|
|
7284
|
+
* Check if the browser support custom events
|
|
7285
|
+
*/
|
|
7286
|
+
function createCustomEvent(name, detail) {
|
|
7287
|
+
try {
|
|
7288
|
+
return new CustomEvent(name, {
|
|
7289
|
+
detail
|
|
7290
|
+
});
|
|
7291
|
+
} catch (e) {
|
|
7292
|
+
console.warn("Pelcro - Events are not supported in the browser");
|
|
7293
|
+
}
|
|
7294
|
+
}
|
|
7295
|
+
|
|
7251
7296
|
function warn(s) {
|
|
7252
7297
|
console.warn('[react-ga]', s);
|
|
7253
7298
|
}
|
|
@@ -8099,55 +8144,547 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
8099
8144
|
OutboundLink$1.origTrackLink = OutboundLink$1.trackLink;
|
|
8100
8145
|
OutboundLink$1.trackLink = outboundLink;
|
|
8101
8146
|
var OutboundLink = OutboundLink$1;
|
|
8102
|
-
var
|
|
8147
|
+
var ReactGA1 = _objectSpread({}, Defaults, {
|
|
8103
8148
|
OutboundLink: OutboundLink
|
|
8104
8149
|
});
|
|
8105
8150
|
|
|
8106
|
-
|
|
8107
|
-
|
|
8108
|
-
|
|
8109
|
-
|
|
8110
|
-
|
|
8111
|
-
|
|
8112
|
-
|
|
8113
|
-
|
|
8114
|
-
|
|
8115
|
-
const evt = document.createEvent("CustomEvent");
|
|
8116
|
-
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
|
8117
|
-
return evt;
|
|
8151
|
+
var gtag_1 = createCommonjsModule(function (module, exports) {
|
|
8152
|
+
|
|
8153
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8154
|
+
value: true
|
|
8155
|
+
});
|
|
8156
|
+
exports["default"] = void 0;
|
|
8157
|
+
var gtag = function gtag() {
|
|
8158
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
8159
|
+
args[_key] = arguments[_key];
|
|
8118
8160
|
}
|
|
8119
|
-
|
|
8120
|
-
|
|
8121
|
-
|
|
8161
|
+
if (typeof window !== "undefined") {
|
|
8162
|
+
var _window;
|
|
8163
|
+
if (typeof window.gtag === "undefined") {
|
|
8164
|
+
window.dataLayer = window.dataLayer || [];
|
|
8165
|
+
window.gtag = function gtag() {
|
|
8166
|
+
window.dataLayer.push(arguments);
|
|
8167
|
+
};
|
|
8168
|
+
}
|
|
8169
|
+
(_window = window).gtag.apply(_window, args);
|
|
8170
|
+
}
|
|
8171
|
+
};
|
|
8172
|
+
var _default = gtag;
|
|
8173
|
+
exports["default"] = _default;
|
|
8174
|
+
});
|
|
8122
8175
|
|
|
8123
|
-
|
|
8124
|
-
|
|
8125
|
-
|
|
8126
|
-
|
|
8176
|
+
unwrapExports(gtag_1);
|
|
8177
|
+
|
|
8178
|
+
var format_1 = createCommonjsModule(function (module, exports) {
|
|
8179
|
+
|
|
8180
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8181
|
+
value: true
|
|
8182
|
+
});
|
|
8183
|
+
exports["default"] = format;
|
|
8184
|
+
var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;
|
|
8185
|
+
function toTitleCase(string) {
|
|
8186
|
+
return string.toString().trim().replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function (match, index, title) {
|
|
8187
|
+
if (index > 0 && index + match.length !== title.length && match.search(smallWords) > -1 && title.charAt(index - 2) !== ":" && (title.charAt(index + match.length) !== "-" || title.charAt(index - 1) === "-") && title.charAt(index - 1).search(/[^\s-]/) < 0) {
|
|
8188
|
+
return match.toLowerCase();
|
|
8189
|
+
}
|
|
8190
|
+
if (match.substr(1).search(/[A-Z]|\../) > -1) {
|
|
8191
|
+
return match;
|
|
8192
|
+
}
|
|
8193
|
+
return match.charAt(0).toUpperCase() + match.substr(1);
|
|
8194
|
+
});
|
|
8195
|
+
}
|
|
8127
8196
|
|
|
8197
|
+
// See if s could be an email address. We don't want to send personal data like email.
|
|
8198
|
+
// https://support.google.com/analytics/answer/2795983?hl=en
|
|
8199
|
+
function mightBeEmail(s) {
|
|
8200
|
+
// There's no point trying to validate rfc822 fully, just look for ...@...
|
|
8201
|
+
return typeof s === "string" && s.indexOf("@") !== -1;
|
|
8202
|
+
}
|
|
8203
|
+
var redacted = "REDACTED (Potential Email Address)";
|
|
8204
|
+
function redactEmail(string) {
|
|
8205
|
+
if (mightBeEmail(string)) {
|
|
8206
|
+
console.warn("This arg looks like an email address, redacting.");
|
|
8207
|
+
return redacted;
|
|
8208
|
+
}
|
|
8209
|
+
return string;
|
|
8210
|
+
}
|
|
8211
|
+
function format() {
|
|
8212
|
+
var s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
8213
|
+
var titleCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
8214
|
+
var redactingEmail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
8215
|
+
var _str = s || "";
|
|
8216
|
+
if (titleCase) {
|
|
8217
|
+
_str = toTitleCase(s);
|
|
8218
|
+
}
|
|
8219
|
+
if (redactingEmail) {
|
|
8220
|
+
_str = redactEmail(_str);
|
|
8221
|
+
}
|
|
8222
|
+
return _str;
|
|
8223
|
+
}
|
|
8224
|
+
});
|
|
8225
|
+
|
|
8226
|
+
unwrapExports(format_1);
|
|
8227
|
+
|
|
8228
|
+
var ga4 = createCommonjsModule(function (module, exports) {
|
|
8229
|
+
|
|
8230
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8231
|
+
value: true
|
|
8232
|
+
});
|
|
8233
|
+
exports["default"] = exports.GA4 = void 0;
|
|
8234
|
+
var _gtag = _interopRequireDefault(gtag_1);
|
|
8235
|
+
var _format = _interopRequireDefault(format_1);
|
|
8236
|
+
var _excluded = ["eventCategory", "eventAction", "eventLabel", "eventValue", "hitType"],
|
|
8237
|
+
_excluded2 = ["title", "location"],
|
|
8238
|
+
_excluded3 = ["page", "hitType"];
|
|
8239
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
8240
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
8241
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
8242
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
8243
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8244
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8245
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8246
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
8247
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
8248
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8249
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8250
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8251
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8252
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
8253
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
8254
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8255
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8256
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
8257
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8258
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
8259
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8260
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8261
|
+
/*
|
|
8262
|
+
Links
|
|
8263
|
+
https://developers.google.com/gtagjs/reference/api
|
|
8264
|
+
https://developers.google.com/tag-platform/gtagjs/reference
|
|
8265
|
+
*/
|
|
8128
8266
|
/**
|
|
8129
|
-
*
|
|
8267
|
+
* @typedef GaOptions
|
|
8268
|
+
* @type {Object}
|
|
8269
|
+
* @property {boolean} [cookieUpdate=true]
|
|
8270
|
+
* @property {number} [cookieExpires=63072000] Default two years
|
|
8271
|
+
* @property {string} [cookieDomain="auto"]
|
|
8272
|
+
* @property {string} [cookieFlags]
|
|
8273
|
+
* @property {string} [userId]
|
|
8274
|
+
* @property {string} [clientId]
|
|
8275
|
+
* @property {boolean} [anonymizeIp]
|
|
8276
|
+
* @property {string} [contentGroup1]
|
|
8277
|
+
* @property {string} [contentGroup2]
|
|
8278
|
+
* @property {string} [contentGroup3]
|
|
8279
|
+
* @property {string} [contentGroup4]
|
|
8280
|
+
* @property {string} [contentGroup5]
|
|
8281
|
+
* @property {boolean} [allowAdFeatures=true]
|
|
8282
|
+
* @property {boolean} [allowAdPersonalizationSignals]
|
|
8283
|
+
* @property {boolean} [nonInteraction]
|
|
8284
|
+
* @property {string} [page]
|
|
8130
8285
|
*/
|
|
8131
|
-
const cartItemAdded = detail => createCustomEvent("PelcroElementsCartItemAdded", detail);
|
|
8132
|
-
|
|
8133
8286
|
/**
|
|
8134
|
-
*
|
|
8287
|
+
* @typedef UaEventOptions
|
|
8288
|
+
* @type {Object}
|
|
8289
|
+
* @property {string} action
|
|
8290
|
+
* @property {string} category
|
|
8291
|
+
* @property {string} [label]
|
|
8292
|
+
* @property {number} [value]
|
|
8293
|
+
* @property {boolean} [nonInteraction]
|
|
8294
|
+
* @property {('beacon'|'xhr'|'image')} [transport]
|
|
8135
8295
|
*/
|
|
8136
|
-
const cartItemRemoved = detail => createCustomEvent("PelcroElementsCartItemRemoved", detail);
|
|
8137
|
-
|
|
8138
8296
|
/**
|
|
8139
|
-
*
|
|
8297
|
+
* @typedef InitOptions
|
|
8298
|
+
* @type {Object}
|
|
8299
|
+
* @property {string} trackingId
|
|
8300
|
+
* @property {GaOptions|any} [gaOptions]
|
|
8301
|
+
* @property {Object} [gtagOptions] New parameter
|
|
8140
8302
|
*/
|
|
8141
|
-
function
|
|
8142
|
-
|
|
8143
|
-
|
|
8144
|
-
|
|
8303
|
+
var GA4 = /*#__PURE__*/function () {
|
|
8304
|
+
function GA4() {
|
|
8305
|
+
var _this = this;
|
|
8306
|
+
_classCallCheck(this, GA4);
|
|
8307
|
+
_defineProperty(this, "reset", function () {
|
|
8308
|
+
_this.isInitialized = false;
|
|
8309
|
+
_this._testMode = false;
|
|
8310
|
+
_this._currentMeasurementId;
|
|
8311
|
+
_this._hasLoadedGA = false;
|
|
8312
|
+
_this._isQueuing = false;
|
|
8313
|
+
_this._queueGtag = [];
|
|
8314
|
+
});
|
|
8315
|
+
_defineProperty(this, "_gtag", function () {
|
|
8316
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
8317
|
+
args[_key] = arguments[_key];
|
|
8318
|
+
}
|
|
8319
|
+
if (!_this._testMode) {
|
|
8320
|
+
if (_this._isQueuing) {
|
|
8321
|
+
_this._queueGtag.push(args);
|
|
8322
|
+
} else {
|
|
8323
|
+
_gtag["default"].apply(void 0, args);
|
|
8324
|
+
}
|
|
8325
|
+
} else {
|
|
8326
|
+
_this._queueGtag.push(args);
|
|
8327
|
+
}
|
|
8145
8328
|
});
|
|
8146
|
-
|
|
8147
|
-
|
|
8329
|
+
_defineProperty(this, "_loadGA", function (GA_MEASUREMENT_ID, nonce) {
|
|
8330
|
+
var gtagUrl = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "https://www.googletagmanager.com/gtag/js";
|
|
8331
|
+
if (typeof window === "undefined" || typeof document === "undefined") {
|
|
8332
|
+
return;
|
|
8333
|
+
}
|
|
8334
|
+
if (!_this._hasLoadedGA) {
|
|
8335
|
+
// Global Site Tag (gtag.js) - Google Analytics
|
|
8336
|
+
var script = document.createElement("script");
|
|
8337
|
+
script.async = true;
|
|
8338
|
+
script.src = "".concat(gtagUrl, "?id=").concat(GA_MEASUREMENT_ID);
|
|
8339
|
+
if (nonce) {
|
|
8340
|
+
script.setAttribute("nonce", nonce);
|
|
8341
|
+
}
|
|
8342
|
+
document.body.appendChild(script);
|
|
8343
|
+
window.dataLayer = window.dataLayer || [];
|
|
8344
|
+
window.gtag = function gtag() {
|
|
8345
|
+
window.dataLayer.push(arguments);
|
|
8346
|
+
};
|
|
8347
|
+
_this._hasLoadedGA = true;
|
|
8348
|
+
}
|
|
8349
|
+
});
|
|
8350
|
+
_defineProperty(this, "_toGtagOptions", function (gaOptions) {
|
|
8351
|
+
if (!gaOptions) {
|
|
8352
|
+
return;
|
|
8353
|
+
}
|
|
8354
|
+
var mapFields = {
|
|
8355
|
+
// Old https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#cookieUpdate
|
|
8356
|
+
// New https://developers.google.com/analytics/devguides/collection/gtagjs/cookies-user-id#cookie_update
|
|
8357
|
+
cookieUpdate: "cookie_update",
|
|
8358
|
+
cookieExpires: "cookie_expires",
|
|
8359
|
+
cookieDomain: "cookie_domain",
|
|
8360
|
+
cookieFlags: "cookie_flags",
|
|
8361
|
+
// must be in set method?
|
|
8362
|
+
userId: "user_id",
|
|
8363
|
+
clientId: "client_id",
|
|
8364
|
+
anonymizeIp: "anonymize_ip",
|
|
8365
|
+
// https://support.google.com/analytics/answer/2853546?hl=en#zippy=%2Cin-this-article
|
|
8366
|
+
contentGroup1: "content_group1",
|
|
8367
|
+
contentGroup2: "content_group2",
|
|
8368
|
+
contentGroup3: "content_group3",
|
|
8369
|
+
contentGroup4: "content_group4",
|
|
8370
|
+
contentGroup5: "content_group5",
|
|
8371
|
+
// https://support.google.com/analytics/answer/9050852?hl=en
|
|
8372
|
+
allowAdFeatures: "allow_google_signals",
|
|
8373
|
+
allowAdPersonalizationSignals: "allow_ad_personalization_signals",
|
|
8374
|
+
nonInteraction: "non_interaction",
|
|
8375
|
+
page: "page_path",
|
|
8376
|
+
hitCallback: "event_callback"
|
|
8377
|
+
};
|
|
8378
|
+
var gtagOptions = Object.entries(gaOptions).reduce(function (prev, _ref) {
|
|
8379
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
8380
|
+
key = _ref2[0],
|
|
8381
|
+
value = _ref2[1];
|
|
8382
|
+
if (mapFields[key]) {
|
|
8383
|
+
prev[mapFields[key]] = value;
|
|
8384
|
+
} else {
|
|
8385
|
+
prev[key] = value;
|
|
8386
|
+
}
|
|
8387
|
+
return prev;
|
|
8388
|
+
}, {});
|
|
8389
|
+
return gtagOptions;
|
|
8390
|
+
});
|
|
8391
|
+
_defineProperty(this, "initialize", function (GA_MEASUREMENT_ID) {
|
|
8392
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
8393
|
+
if (!GA_MEASUREMENT_ID) {
|
|
8394
|
+
throw new Error("Require GA_MEASUREMENT_ID");
|
|
8395
|
+
}
|
|
8396
|
+
var initConfigs = typeof GA_MEASUREMENT_ID === "string" ? [{
|
|
8397
|
+
trackingId: GA_MEASUREMENT_ID
|
|
8398
|
+
}] : GA_MEASUREMENT_ID;
|
|
8399
|
+
_this._currentMeasurementId = initConfigs[0].trackingId;
|
|
8400
|
+
var gaOptions = options.gaOptions,
|
|
8401
|
+
gtagOptions = options.gtagOptions,
|
|
8402
|
+
nonce = options.nonce,
|
|
8403
|
+
_options$testMode = options.testMode,
|
|
8404
|
+
testMode = _options$testMode === void 0 ? false : _options$testMode,
|
|
8405
|
+
gtagUrl = options.gtagUrl;
|
|
8406
|
+
_this._testMode = testMode;
|
|
8407
|
+
if (!testMode) {
|
|
8408
|
+
_this._loadGA(_this._currentMeasurementId, nonce, gtagUrl);
|
|
8409
|
+
}
|
|
8410
|
+
if (!_this.isInitialized) {
|
|
8411
|
+
_this._gtag("js", new Date());
|
|
8412
|
+
initConfigs.forEach(function (config) {
|
|
8413
|
+
var mergedGtagOptions = _objectSpread(_objectSpread(_objectSpread({}, _this._toGtagOptions(_objectSpread(_objectSpread({}, gaOptions), config.gaOptions))), gtagOptions), config.gtagOptions);
|
|
8414
|
+
if (Object.keys(mergedGtagOptions).length) {
|
|
8415
|
+
_this._gtag("config", config.trackingId, mergedGtagOptions);
|
|
8416
|
+
} else {
|
|
8417
|
+
_this._gtag("config", config.trackingId);
|
|
8418
|
+
}
|
|
8419
|
+
});
|
|
8420
|
+
}
|
|
8421
|
+
_this.isInitialized = true;
|
|
8422
|
+
if (!testMode) {
|
|
8423
|
+
var queues = _toConsumableArray(_this._queueGtag);
|
|
8424
|
+
_this._queueGtag = [];
|
|
8425
|
+
_this._isQueuing = false;
|
|
8426
|
+
while (queues.length) {
|
|
8427
|
+
var queue = queues.shift();
|
|
8428
|
+
_this._gtag.apply(_this, _toConsumableArray(queue));
|
|
8429
|
+
if (queue[0] === "get") {
|
|
8430
|
+
_this._isQueuing = true;
|
|
8431
|
+
}
|
|
8432
|
+
}
|
|
8433
|
+
}
|
|
8434
|
+
});
|
|
8435
|
+
_defineProperty(this, "set", function (fieldsObject) {
|
|
8436
|
+
if (!fieldsObject) {
|
|
8437
|
+
console.warn("`fieldsObject` is required in .set()");
|
|
8438
|
+
return;
|
|
8439
|
+
}
|
|
8440
|
+
if (_typeof(fieldsObject) !== "object") {
|
|
8441
|
+
console.warn("Expected `fieldsObject` arg to be an Object");
|
|
8442
|
+
return;
|
|
8443
|
+
}
|
|
8444
|
+
if (Object.keys(fieldsObject).length === 0) {
|
|
8445
|
+
console.warn("empty `fieldsObject` given to .set()");
|
|
8446
|
+
}
|
|
8447
|
+
_this._gaCommand("set", fieldsObject);
|
|
8448
|
+
});
|
|
8449
|
+
_defineProperty(this, "_gaCommandSendEvent", function (eventCategory, eventAction, eventLabel, eventValue, fieldsObject) {
|
|
8450
|
+
_this._gtag("event", eventAction, _objectSpread(_objectSpread({
|
|
8451
|
+
event_category: eventCategory,
|
|
8452
|
+
event_label: eventLabel,
|
|
8453
|
+
value: eventValue
|
|
8454
|
+
}, fieldsObject && {
|
|
8455
|
+
non_interaction: fieldsObject.nonInteraction
|
|
8456
|
+
}), _this._toGtagOptions(fieldsObject)));
|
|
8457
|
+
});
|
|
8458
|
+
_defineProperty(this, "_gaCommandSendEventParameters", function () {
|
|
8459
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
8460
|
+
args[_key2] = arguments[_key2];
|
|
8461
|
+
}
|
|
8462
|
+
if (typeof args[0] === "string") {
|
|
8463
|
+
_this._gaCommandSendEvent.apply(_this, _toConsumableArray(args.slice(1)));
|
|
8464
|
+
} else {
|
|
8465
|
+
var _args$ = args[0],
|
|
8466
|
+
eventCategory = _args$.eventCategory,
|
|
8467
|
+
eventAction = _args$.eventAction,
|
|
8468
|
+
eventLabel = _args$.eventLabel,
|
|
8469
|
+
eventValue = _args$.eventValue;
|
|
8470
|
+
_args$.hitType;
|
|
8471
|
+
var rest = _objectWithoutProperties(_args$, _excluded);
|
|
8472
|
+
_this._gaCommandSendEvent(eventCategory, eventAction, eventLabel, eventValue, rest);
|
|
8473
|
+
}
|
|
8474
|
+
});
|
|
8475
|
+
_defineProperty(this, "_gaCommandSendTiming", function (timingCategory, timingVar, timingValue, timingLabel) {
|
|
8476
|
+
_this._gtag("event", "timing_complete", {
|
|
8477
|
+
name: timingVar,
|
|
8478
|
+
value: timingValue,
|
|
8479
|
+
event_category: timingCategory,
|
|
8480
|
+
event_label: timingLabel
|
|
8481
|
+
});
|
|
8482
|
+
});
|
|
8483
|
+
_defineProperty(this, "_gaCommandSendPageview", function (page, fieldsObject) {
|
|
8484
|
+
if (fieldsObject && Object.keys(fieldsObject).length) {
|
|
8485
|
+
var _this$_toGtagOptions = _this._toGtagOptions(fieldsObject),
|
|
8486
|
+
title = _this$_toGtagOptions.title,
|
|
8487
|
+
location = _this$_toGtagOptions.location,
|
|
8488
|
+
rest = _objectWithoutProperties(_this$_toGtagOptions, _excluded2);
|
|
8489
|
+
_this._gtag("event", "page_view", _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, page && {
|
|
8490
|
+
page_path: page
|
|
8491
|
+
}), title && {
|
|
8492
|
+
page_title: title
|
|
8493
|
+
}), location && {
|
|
8494
|
+
page_location: location
|
|
8495
|
+
}), rest));
|
|
8496
|
+
} else if (page) {
|
|
8497
|
+
_this._gtag("event", "page_view", {
|
|
8498
|
+
page_path: page
|
|
8499
|
+
});
|
|
8500
|
+
} else {
|
|
8501
|
+
_this._gtag("event", "page_view");
|
|
8502
|
+
}
|
|
8503
|
+
});
|
|
8504
|
+
_defineProperty(this, "_gaCommandSendPageviewParameters", function () {
|
|
8505
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
8506
|
+
args[_key3] = arguments[_key3];
|
|
8507
|
+
}
|
|
8508
|
+
if (typeof args[0] === "string") {
|
|
8509
|
+
_this._gaCommandSendPageview.apply(_this, _toConsumableArray(args.slice(1)));
|
|
8510
|
+
} else {
|
|
8511
|
+
var _args$2 = args[0],
|
|
8512
|
+
page = _args$2.page;
|
|
8513
|
+
_args$2.hitType;
|
|
8514
|
+
var rest = _objectWithoutProperties(_args$2, _excluded3);
|
|
8515
|
+
_this._gaCommandSendPageview(page, rest);
|
|
8516
|
+
}
|
|
8517
|
+
});
|
|
8518
|
+
_defineProperty(this, "_gaCommandSend", function () {
|
|
8519
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
8520
|
+
args[_key4] = arguments[_key4];
|
|
8521
|
+
}
|
|
8522
|
+
var hitType = typeof args[0] === "string" ? args[0] : args[0].hitType;
|
|
8523
|
+
switch (hitType) {
|
|
8524
|
+
case "event":
|
|
8525
|
+
_this._gaCommandSendEventParameters.apply(_this, args);
|
|
8526
|
+
break;
|
|
8527
|
+
case "pageview":
|
|
8528
|
+
_this._gaCommandSendPageviewParameters.apply(_this, args);
|
|
8529
|
+
break;
|
|
8530
|
+
case "timing":
|
|
8531
|
+
_this._gaCommandSendTiming.apply(_this, _toConsumableArray(args.slice(1)));
|
|
8532
|
+
break;
|
|
8533
|
+
case "screenview":
|
|
8534
|
+
case "transaction":
|
|
8535
|
+
case "item":
|
|
8536
|
+
case "social":
|
|
8537
|
+
case "exception":
|
|
8538
|
+
console.warn("Unsupported send command: ".concat(hitType));
|
|
8539
|
+
break;
|
|
8540
|
+
default:
|
|
8541
|
+
console.warn("Send command doesn't exist: ".concat(hitType));
|
|
8542
|
+
}
|
|
8543
|
+
});
|
|
8544
|
+
_defineProperty(this, "_gaCommandSet", function () {
|
|
8545
|
+
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
8546
|
+
args[_key5] = arguments[_key5];
|
|
8547
|
+
}
|
|
8548
|
+
if (typeof args[0] === "string") {
|
|
8549
|
+
args[0] = _defineProperty({}, args[0], args[1]);
|
|
8550
|
+
}
|
|
8551
|
+
_this._gtag("set", _this._toGtagOptions(args[0]));
|
|
8552
|
+
});
|
|
8553
|
+
_defineProperty(this, "_gaCommand", function (command) {
|
|
8554
|
+
for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
|
|
8555
|
+
args[_key6 - 1] = arguments[_key6];
|
|
8556
|
+
}
|
|
8557
|
+
switch (command) {
|
|
8558
|
+
case "send":
|
|
8559
|
+
_this._gaCommandSend.apply(_this, args);
|
|
8560
|
+
break;
|
|
8561
|
+
case "set":
|
|
8562
|
+
_this._gaCommandSet.apply(_this, args);
|
|
8563
|
+
break;
|
|
8564
|
+
default:
|
|
8565
|
+
console.warn("Command doesn't exist: ".concat(command));
|
|
8566
|
+
}
|
|
8567
|
+
});
|
|
8568
|
+
_defineProperty(this, "ga", function () {
|
|
8569
|
+
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
|
8570
|
+
args[_key7] = arguments[_key7];
|
|
8571
|
+
}
|
|
8572
|
+
if (typeof args[0] === "string") {
|
|
8573
|
+
_this._gaCommand.apply(_this, args);
|
|
8574
|
+
} else {
|
|
8575
|
+
var readyCallback = args[0];
|
|
8576
|
+
_this._gtag("get", _this._currentMeasurementId, "client_id", function (clientId) {
|
|
8577
|
+
_this._isQueuing = false;
|
|
8578
|
+
var queues = _this._queueGtag;
|
|
8579
|
+
readyCallback({
|
|
8580
|
+
get: function get(property) {
|
|
8581
|
+
return property === "clientId" ? clientId : property === "trackingId" ? _this._currentMeasurementId : property === "apiVersion" ? "1" : undefined;
|
|
8582
|
+
}
|
|
8583
|
+
});
|
|
8584
|
+
while (queues.length) {
|
|
8585
|
+
var queue = queues.shift();
|
|
8586
|
+
_this._gtag.apply(_this, _toConsumableArray(queue));
|
|
8587
|
+
}
|
|
8588
|
+
});
|
|
8589
|
+
_this._isQueuing = true;
|
|
8590
|
+
}
|
|
8591
|
+
return _this.ga;
|
|
8592
|
+
});
|
|
8593
|
+
_defineProperty(this, "event", function (optionsOrName, params) {
|
|
8594
|
+
if (typeof optionsOrName === "string") {
|
|
8595
|
+
_this._gtag("event", optionsOrName, _this._toGtagOptions(params));
|
|
8596
|
+
} else {
|
|
8597
|
+
var action = optionsOrName.action,
|
|
8598
|
+
category = optionsOrName.category,
|
|
8599
|
+
label = optionsOrName.label,
|
|
8600
|
+
value = optionsOrName.value,
|
|
8601
|
+
nonInteraction = optionsOrName.nonInteraction,
|
|
8602
|
+
transport = optionsOrName.transport;
|
|
8603
|
+
if (!category || !action) {
|
|
8604
|
+
console.warn("args.category AND args.action are required in event()");
|
|
8605
|
+
return;
|
|
8606
|
+
}
|
|
8607
|
+
|
|
8608
|
+
// Required Fields
|
|
8609
|
+
var fieldObject = {
|
|
8610
|
+
hitType: "event",
|
|
8611
|
+
eventCategory: (0, _format["default"])(category),
|
|
8612
|
+
eventAction: (0, _format["default"])(action)
|
|
8613
|
+
};
|
|
8614
|
+
|
|
8615
|
+
// Optional Fields
|
|
8616
|
+
if (label) {
|
|
8617
|
+
fieldObject.eventLabel = (0, _format["default"])(label);
|
|
8618
|
+
}
|
|
8619
|
+
if (typeof value !== "undefined") {
|
|
8620
|
+
if (typeof value !== "number") {
|
|
8621
|
+
console.warn("Expected `args.value` arg to be a Number.");
|
|
8622
|
+
} else {
|
|
8623
|
+
fieldObject.eventValue = value;
|
|
8624
|
+
}
|
|
8625
|
+
}
|
|
8626
|
+
if (typeof nonInteraction !== "undefined") {
|
|
8627
|
+
if (typeof nonInteraction !== "boolean") {
|
|
8628
|
+
console.warn("`args.nonInteraction` must be a boolean.");
|
|
8629
|
+
} else {
|
|
8630
|
+
fieldObject.nonInteraction = nonInteraction;
|
|
8631
|
+
}
|
|
8632
|
+
}
|
|
8633
|
+
if (typeof transport !== "undefined") {
|
|
8634
|
+
if (typeof transport !== "string") {
|
|
8635
|
+
console.warn("`args.transport` must be a string.");
|
|
8636
|
+
} else {
|
|
8637
|
+
if (["beacon", "xhr", "image"].indexOf(transport) === -1) {
|
|
8638
|
+
console.warn("`args.transport` must be either one of these values: `beacon`, `xhr` or `image`");
|
|
8639
|
+
}
|
|
8640
|
+
fieldObject.transport = transport;
|
|
8641
|
+
}
|
|
8642
|
+
}
|
|
8643
|
+
_this._gaCommand("send", fieldObject);
|
|
8644
|
+
}
|
|
8645
|
+
});
|
|
8646
|
+
_defineProperty(this, "send", function (fieldObject) {
|
|
8647
|
+
_this._gaCommand("send", fieldObject);
|
|
8648
|
+
});
|
|
8649
|
+
this.reset();
|
|
8148
8650
|
}
|
|
8149
|
-
|
|
8651
|
+
_createClass(GA4, [{
|
|
8652
|
+
key: "gtag",
|
|
8653
|
+
value: function gtag() {
|
|
8654
|
+
this._gtag.apply(this, arguments);
|
|
8655
|
+
}
|
|
8656
|
+
}]);
|
|
8657
|
+
return GA4;
|
|
8658
|
+
}();
|
|
8659
|
+
exports.GA4 = GA4;
|
|
8660
|
+
var _default = new GA4();
|
|
8661
|
+
exports["default"] = _default;
|
|
8662
|
+
});
|
|
8663
|
+
|
|
8664
|
+
unwrapExports(ga4);
|
|
8665
|
+
ga4.GA4;
|
|
8666
|
+
|
|
8667
|
+
var dist = createCommonjsModule(function (module, exports) {
|
|
8668
|
+
|
|
8669
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
8670
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8671
|
+
value: true
|
|
8672
|
+
});
|
|
8673
|
+
exports["default"] = exports.ReactGAImplementation = void 0;
|
|
8674
|
+
var _ga = _interopRequireWildcard(ga4);
|
|
8675
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
8676
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
8677
|
+
var ReactGAImplementation = _ga.GA4;
|
|
8678
|
+
exports.ReactGAImplementation = ReactGAImplementation;
|
|
8679
|
+
var _default = _ga["default"];
|
|
8680
|
+
exports["default"] = _default;
|
|
8681
|
+
});
|
|
8150
8682
|
|
|
8683
|
+
var ReactGA4 = unwrapExports(dist);
|
|
8684
|
+
dist.ReactGAImplementation;
|
|
8685
|
+
|
|
8686
|
+
var _window$d, _window$Pelcro$d, _window$Pelcro$uiSett$d;
|
|
8687
|
+
const ReactGA$d = (_window$d = window) !== null && _window$d !== void 0 && (_window$Pelcro$d = _window$d.Pelcro) !== null && _window$Pelcro$d !== void 0 && (_window$Pelcro$uiSett$d = _window$Pelcro$d.uiSettings) !== null && _window$Pelcro$uiSett$d !== void 0 && _window$Pelcro$uiSett$d.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
8151
8688
|
class PelcroActions {
|
|
8152
8689
|
constructor(storeSetter, storeGetter) {
|
|
8153
8690
|
var _this = this;
|
|
@@ -8339,7 +8876,7 @@ class PelcroActions {
|
|
|
8339
8876
|
return console.warn("You are already logged out.");
|
|
8340
8877
|
}
|
|
8341
8878
|
window.Pelcro.user.logout();
|
|
8342
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
8879
|
+
ReactGA$d === null || ReactGA$d === void 0 ? void 0 : (_ReactGA$event = ReactGA$d.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$d, {
|
|
8343
8880
|
category: "ACTIONS",
|
|
8344
8881
|
action: "Logged out",
|
|
8345
8882
|
nonInteraction: true
|
|
@@ -8565,6 +9102,9 @@ if (process.env.NODE_ENV === "development") {
|
|
|
8565
9102
|
c$1("Pelcro Store", usePelcro);
|
|
8566
9103
|
}
|
|
8567
9104
|
|
|
9105
|
+
var _window$c, _window$Pelcro$c, _window$Pelcro$uiSett$c;
|
|
9106
|
+
const ReactGA$c = (_window$c = window) !== null && _window$c !== void 0 && (_window$Pelcro$c = _window$c.Pelcro) !== null && _window$Pelcro$c !== void 0 && (_window$Pelcro$uiSett$c = _window$Pelcro$c.uiSettings) !== null && _window$Pelcro$uiSett$c !== void 0 && _window$Pelcro$uiSett$c.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
9107
|
+
|
|
8568
9108
|
/**
|
|
8569
9109
|
* List of zero-decimal currencies.
|
|
8570
9110
|
* @see https://stripe.com/docs/currencies#zero-decimal
|
|
@@ -8647,8 +9187,8 @@ const getLanguageWithoutRegion = localeName => {
|
|
|
8647
9187
|
* @return {string | undefined}
|
|
8648
9188
|
*/
|
|
8649
9189
|
const getPageOrDefaultLanguage = () => {
|
|
8650
|
-
var _window$Pelcro$helper, _window$
|
|
8651
|
-
return (_window$Pelcro$helper = window.Pelcro.helpers.getHtmlLanguageAttribute()) !== null && _window$Pelcro$helper !== void 0 ? _window$Pelcro$helper : getLanguageWithoutRegion((_window$
|
|
9190
|
+
var _window$Pelcro$helper, _window$Pelcro2, _window$Pelcro2$site, _window$Pelcro2$site$, _window$Pelcro2$site$2;
|
|
9191
|
+
return (_window$Pelcro$helper = window.Pelcro.helpers.getHtmlLanguageAttribute()) !== null && _window$Pelcro$helper !== void 0 ? _window$Pelcro$helper : getLanguageWithoutRegion((_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$site = _window$Pelcro2.site) === null || _window$Pelcro2$site === void 0 ? void 0 : (_window$Pelcro2$site$ = _window$Pelcro2$site.read) === null || _window$Pelcro2$site$ === void 0 ? void 0 : (_window$Pelcro2$site$2 = _window$Pelcro2$site$.call(_window$Pelcro2$site)) === null || _window$Pelcro2$site$2 === void 0 ? void 0 : _window$Pelcro2$site$2.default_locale);
|
|
8652
9192
|
};
|
|
8653
9193
|
|
|
8654
9194
|
/**
|
|
@@ -8701,9 +9241,9 @@ const isValidViewFromURL = viewID => {
|
|
|
8701
9241
|
*
|
|
8702
9242
|
*/
|
|
8703
9243
|
function hasValidNewsletterUpdateUrl() {
|
|
8704
|
-
var _window$
|
|
9244
|
+
var _window$Pelcro3, _window$Pelcro3$uiSet;
|
|
8705
9245
|
if (viewID !== "newsletter-update") return false;
|
|
8706
|
-
const newsletters = (_window$
|
|
9246
|
+
const newsletters = (_window$Pelcro3 = window.Pelcro) === null || _window$Pelcro3 === void 0 ? void 0 : (_window$Pelcro3$uiSet = _window$Pelcro3.uiSettings) === null || _window$Pelcro3$uiSet === void 0 ? void 0 : _window$Pelcro3$uiSet.newsletters;
|
|
8707
9247
|
const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
|
|
8708
9248
|
if (!siteHasNewslettersDefined) {
|
|
8709
9249
|
return false;
|
|
@@ -8768,16 +9308,16 @@ const trackSubscriptionOnGA = () => {
|
|
|
8768
9308
|
return;
|
|
8769
9309
|
}
|
|
8770
9310
|
const currencyCode = (_window$Pelcro$user$r5 = (_window$Pelcro$user$r6 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r6 === void 0 ? void 0 : _window$Pelcro$user$r6.currency) !== null && _window$Pelcro$user$r5 !== void 0 ? _window$Pelcro$user$r5 : plan.currency;
|
|
8771
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$set = ReactGA.set) === null || _ReactGA$set === void 0 ? void 0 : _ReactGA$set.call(ReactGA, {
|
|
9311
|
+
ReactGA$c === null || ReactGA$c === void 0 ? void 0 : (_ReactGA$set = ReactGA$c.set) === null || _ReactGA$set === void 0 ? void 0 : _ReactGA$set.call(ReactGA$c, {
|
|
8772
9312
|
currencyCode: currencyCode
|
|
8773
9313
|
});
|
|
8774
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$plugin = ReactGA.plugin) === null || _ReactGA$plugin === void 0 ? void 0 : (_ReactGA$plugin$execu = _ReactGA$plugin.execute) === null || _ReactGA$plugin$execu === void 0 ? void 0 : _ReactGA$plugin$execu.call(_ReactGA$plugin, "ecommerce", "addTransaction", {
|
|
9314
|
+
ReactGA$c === null || ReactGA$c === void 0 ? void 0 : (_ReactGA$plugin = ReactGA$c.plugin) === null || _ReactGA$plugin === void 0 ? void 0 : (_ReactGA$plugin$execu = _ReactGA$plugin.execute) === null || _ReactGA$plugin$execu === void 0 ? void 0 : _ReactGA$plugin$execu.call(_ReactGA$plugin, "ecommerce", "addTransaction", {
|
|
8775
9315
|
id: lastSubscriptionId,
|
|
8776
9316
|
affiliation: "Pelcro",
|
|
8777
9317
|
revenue: plan !== null && plan !== void 0 && plan.amount ? isCurrencyZeroDecimal(currencyCode) ? plan.amount : plan.amount / 100 : 0,
|
|
8778
9318
|
coupon: couponCode
|
|
8779
9319
|
});
|
|
8780
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$plugin2 = ReactGA.plugin) === null || _ReactGA$plugin2 === void 0 ? void 0 : (_ReactGA$plugin2$exec = _ReactGA$plugin2.execute) === null || _ReactGA$plugin2$exec === void 0 ? void 0 : _ReactGA$plugin2$exec.call(_ReactGA$plugin2, "ecommerce", "addItem", {
|
|
9320
|
+
ReactGA$c === null || ReactGA$c === void 0 ? void 0 : (_ReactGA$plugin2 = ReactGA$c.plugin) === null || _ReactGA$plugin2 === void 0 ? void 0 : (_ReactGA$plugin2$exec = _ReactGA$plugin2.execute) === null || _ReactGA$plugin2$exec === void 0 ? void 0 : _ReactGA$plugin2$exec.call(_ReactGA$plugin2, "ecommerce", "addItem", {
|
|
8781
9321
|
id: lastSubscriptionId,
|
|
8782
9322
|
name: product.name,
|
|
8783
9323
|
category: product.description,
|
|
@@ -8785,8 +9325,8 @@ const trackSubscriptionOnGA = () => {
|
|
|
8785
9325
|
price: plan !== null && plan !== void 0 && plan.amount ? isCurrencyZeroDecimal(currencyCode) ? plan.amount : plan.amount / 100 : 0,
|
|
8786
9326
|
quantity: 1
|
|
8787
9327
|
});
|
|
8788
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$plugin3 = ReactGA.plugin) === null || _ReactGA$plugin3 === void 0 ? void 0 : (_ReactGA$plugin3$exec = _ReactGA$plugin3.execute) === null || _ReactGA$plugin3$exec === void 0 ? void 0 : _ReactGA$plugin3$exec.call(_ReactGA$plugin3, "ecommerce", "send");
|
|
8789
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
9328
|
+
ReactGA$c === null || ReactGA$c === void 0 ? void 0 : (_ReactGA$plugin3 = ReactGA$c.plugin) === null || _ReactGA$plugin3 === void 0 ? void 0 : (_ReactGA$plugin3$exec = _ReactGA$plugin3.execute) === null || _ReactGA$plugin3$exec === void 0 ? void 0 : _ReactGA$plugin3$exec.call(_ReactGA$plugin3, "ecommerce", "send");
|
|
9329
|
+
ReactGA$c === null || ReactGA$c === void 0 ? void 0 : (_ReactGA$event = ReactGA$c.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$c, {
|
|
8790
9330
|
category: "ACTIONS",
|
|
8791
9331
|
action: "Subscribed",
|
|
8792
9332
|
nonInteraction: true
|
|
@@ -8874,8 +9414,8 @@ function getDateWithoutTime(dateObject) {
|
|
|
8874
9414
|
return date;
|
|
8875
9415
|
}
|
|
8876
9416
|
function userMustVerifyEmail() {
|
|
8877
|
-
var _window$Pelcro$site$
|
|
8878
|
-
const isEmailVerificationEnabled = (_window$Pelcro$site$
|
|
9417
|
+
var _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$user$r9, _window$Pelcro$user$r10;
|
|
9418
|
+
const isEmailVerificationEnabled = (_window$Pelcro$site$r = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.email_verify_enabled) !== null && _window$Pelcro$site$r !== void 0 ? _window$Pelcro$site$r : false;
|
|
8879
9419
|
const isUserEmailVerified = (_window$Pelcro$user$r9 = (_window$Pelcro$user$r10 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r10 === void 0 ? void 0 : _window$Pelcro$user$r10.email_confirm) !== null && _window$Pelcro$user$r9 !== void 0 ? _window$Pelcro$user$r9 : false;
|
|
8880
9420
|
return window.Pelcro.user.isAuthenticated() && isEmailVerificationEnabled && !isUserEmailVerified;
|
|
8881
9421
|
}
|
|
@@ -8884,11 +9424,11 @@ function notifyBugsnag(callback, startOptions) {
|
|
|
8884
9424
|
//load bugsnag CDN
|
|
8885
9425
|
window.Pelcro.helpers.loadSDK("https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js", "bugsnag-cdn");
|
|
8886
9426
|
document.querySelector('script[src="https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js"]').addEventListener("load", () => {
|
|
8887
|
-
var _window$Pelcro$enviro, _window$
|
|
9427
|
+
var _window$Pelcro$enviro, _window$Pelcro4, _window$Pelcro4$envir, _window$Pelcro5, _window$Pelcro5$envir;
|
|
8888
9428
|
Bugsnag.start({
|
|
8889
|
-
apiKey: (_window$Pelcro$enviro = (_window$
|
|
9429
|
+
apiKey: (_window$Pelcro$enviro = (_window$Pelcro4 = window.Pelcro) === null || _window$Pelcro4 === void 0 ? void 0 : (_window$Pelcro4$envir = _window$Pelcro4.environment) === null || _window$Pelcro4$envir === void 0 ? void 0 : _window$Pelcro4$envir.bugsnagKey) !== null && _window$Pelcro$enviro !== void 0 ? _window$Pelcro$enviro : "e8f6852b322540e8c25386048b99ab01",
|
|
8890
9430
|
autoDetectErrors: false,
|
|
8891
|
-
releaseStage: (_window$
|
|
9431
|
+
releaseStage: (_window$Pelcro5 = window.Pelcro) === null || _window$Pelcro5 === void 0 ? void 0 : (_window$Pelcro5$envir = _window$Pelcro5.environment) === null || _window$Pelcro5$envir === void 0 ? void 0 : _window$Pelcro5$envir.bugsnagReleaseStage,
|
|
8892
9432
|
redactedKeys: ["security_key", "password", "password_confirmation", "auth_token", "token"],
|
|
8893
9433
|
...startOptions
|
|
8894
9434
|
});
|
|
@@ -9059,8 +9599,10 @@ function _classPrivateFieldGet(receiver, privateMap) {
|
|
|
9059
9599
|
return descriptor.value;
|
|
9060
9600
|
}
|
|
9061
9601
|
|
|
9602
|
+
var _window$b, _window$Pelcro$b, _window$Pelcro$uiSett$b;
|
|
9062
9603
|
function _classPrivateFieldInitSpec$2(obj, privateMap, value) { _checkPrivateRedeclaration$2(obj, privateMap); privateMap.set(obj, value); }
|
|
9063
9604
|
function _checkPrivateRedeclaration$2(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
|
|
9605
|
+
const ReactGA$b = (_window$b = window) !== null && _window$b !== void 0 && (_window$Pelcro$b = _window$b.Pelcro) !== null && _window$Pelcro$b !== void 0 && (_window$Pelcro$uiSett$b = _window$Pelcro$b.uiSettings) !== null && _window$Pelcro$uiSett$b !== void 0 && _window$Pelcro$uiSett$b.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
9064
9606
|
var _isAlreadySaved = /*#__PURE__*/new WeakMap();
|
|
9065
9607
|
var _markButtonAsLoading = /*#__PURE__*/new WeakMap();
|
|
9066
9608
|
var _removeLoadingState = /*#__PURE__*/new WeakMap();
|
|
@@ -9183,7 +9725,7 @@ class SaveToMetadataButtonClass {
|
|
|
9183
9725
|
return _classPrivateFieldGet(this, _removeLoadingState).call(this, button);
|
|
9184
9726
|
}
|
|
9185
9727
|
_classPrivateFieldGet(this, _markButtonAsSaved).call(this, button);
|
|
9186
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
9728
|
+
ReactGA$b === null || ReactGA$b === void 0 ? void 0 : (_ReactGA$event = ReactGA$b.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$b, {
|
|
9187
9729
|
category: "ACTIONS",
|
|
9188
9730
|
action: "Save/Follow",
|
|
9189
9731
|
label: buttonMetadata === null || buttonMetadata === void 0 ? void 0 : buttonMetadata.title
|
|
@@ -9215,7 +9757,7 @@ class SaveToMetadataButtonClass {
|
|
|
9215
9757
|
return _classPrivateFieldGet(this, _removeLoadingState).call(this, button);
|
|
9216
9758
|
}
|
|
9217
9759
|
_classPrivateFieldGet(this, _unmarkSavedButton).call(this, button);
|
|
9218
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event2 = ReactGA.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA, {
|
|
9760
|
+
ReactGA$b === null || ReactGA$b === void 0 ? void 0 : (_ReactGA$event2 = ReactGA$b.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA$b, {
|
|
9219
9761
|
category: "ACTIONS",
|
|
9220
9762
|
action: "Unsave/Unfollow",
|
|
9221
9763
|
label: title
|
|
@@ -10860,6 +11402,9 @@ function getSiteCardProcessor() {
|
|
|
10860
11402
|
return "stripe";
|
|
10861
11403
|
}
|
|
10862
11404
|
|
|
11405
|
+
var _window$a, _window$Pelcro$a, _window$Pelcro$uiSett$a;
|
|
11406
|
+
const ReactGA$a = (_window$a = window) !== null && _window$a !== void 0 && (_window$Pelcro$a = _window$a.Pelcro) !== null && _window$Pelcro$a !== void 0 && (_window$Pelcro$uiSett$a = _window$Pelcro$a.uiSettings) !== null && _window$Pelcro$uiSett$a !== void 0 && _window$Pelcro$uiSett$a.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
11407
|
+
|
|
10863
11408
|
/**
|
|
10864
11409
|
* @typedef {Object} OptionsType
|
|
10865
11410
|
* @property {boolean} loadPaymentSDKs
|
|
@@ -10987,12 +11532,12 @@ const initSecuritySdk = () => {
|
|
|
10987
11532
|
};
|
|
10988
11533
|
const initGATracking = () => {
|
|
10989
11534
|
var _ReactGA$initialize, _ReactGA$plugin, _ReactGA$plugin$requi;
|
|
10990
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$initialize = ReactGA.initialize) === null || _ReactGA$initialize === void 0 ? void 0 : _ReactGA$initialize.call(ReactGA, window.Pelcro.site.read().google_analytics_id);
|
|
10991
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$plugin = ReactGA.plugin) === null || _ReactGA$plugin === void 0 ? void 0 : (_ReactGA$plugin$requi = _ReactGA$plugin.require) === null || _ReactGA$plugin$requi === void 0 ? void 0 : _ReactGA$plugin$requi.call(_ReactGA$plugin, "ecommerce");
|
|
11535
|
+
ReactGA$a === null || ReactGA$a === void 0 ? void 0 : (_ReactGA$initialize = ReactGA$a.initialize) === null || _ReactGA$initialize === void 0 ? void 0 : _ReactGA$initialize.call(ReactGA$a, window.Pelcro.site.read().google_analytics_id);
|
|
11536
|
+
ReactGA$a === null || ReactGA$a === void 0 ? void 0 : (_ReactGA$plugin = ReactGA$a.plugin) === null || _ReactGA$plugin === void 0 ? void 0 : (_ReactGA$plugin$requi = _ReactGA$plugin.require) === null || _ReactGA$plugin$requi === void 0 ? void 0 : _ReactGA$plugin$requi.call(_ReactGA$plugin, "ecommerce");
|
|
10992
11537
|
};
|
|
10993
11538
|
const dispatchModalDisplayEvents = modalName => {
|
|
10994
11539
|
var _ReactGA$event, _modalName$replace, _modalName$replace2;
|
|
10995
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
11540
|
+
ReactGA$a === null || ReactGA$a === void 0 ? void 0 : (_ReactGA$event = ReactGA$a.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$a, {
|
|
10996
11541
|
category: "VIEWS",
|
|
10997
11542
|
action: `${modalName === null || modalName === void 0 ? void 0 : (_modalName$replace = modalName.replace("pelcro-", "")) === null || _modalName$replace === void 0 ? void 0 : _modalName$replace.replaceAll("-", " ")} viewed`,
|
|
10998
11543
|
nonInteraction: true
|
|
@@ -11858,7 +12403,7 @@ const LoginContainer = _ref => {
|
|
|
11858
12403
|
} else {
|
|
11859
12404
|
var _ReactGA$event;
|
|
11860
12405
|
onSuccess(res);
|
|
11861
|
-
|
|
12406
|
+
ReactGA1 === null || ReactGA1 === void 0 ? void 0 : (_ReactGA$event = ReactGA1.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA1, {
|
|
11862
12407
|
category: "ACTIONS",
|
|
11863
12408
|
action: "Logged in",
|
|
11864
12409
|
nonInteraction: true
|
|
@@ -12248,11 +12793,13 @@ function ConfirmPassword(_ref) {
|
|
|
12248
12793
|
}, otherProps));
|
|
12249
12794
|
}
|
|
12250
12795
|
|
|
12796
|
+
var _window$9, _window$Pelcro$9, _window$Pelcro$uiSett$9;
|
|
12797
|
+
const ReactGA$9 = (_window$9 = window) !== null && _window$9 !== void 0 && (_window$Pelcro$9 = _window$9.Pelcro) !== null && _window$Pelcro$9 !== void 0 && (_window$Pelcro$uiSett$9 = _window$Pelcro$9.uiSettings) !== null && _window$Pelcro$uiSett$9 !== void 0 && _window$Pelcro$uiSett$9.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
12251
12798
|
const Logout = props => {
|
|
12252
12799
|
const handleLogout = () => {
|
|
12253
12800
|
var _ReactGA$event;
|
|
12254
12801
|
window.Pelcro.user.logout();
|
|
12255
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
12802
|
+
ReactGA$9 === null || ReactGA$9 === void 0 ? void 0 : (_ReactGA$event = ReactGA$9.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$9, {
|
|
12256
12803
|
category: "ACTIONS",
|
|
12257
12804
|
action: "Logged out",
|
|
12258
12805
|
nonInteraction: true
|
|
@@ -13814,6 +14361,9 @@ const RegisterCompany = props => {
|
|
|
13814
14361
|
}, props));
|
|
13815
14362
|
};
|
|
13816
14363
|
|
|
14364
|
+
var _window$8, _window$Pelcro$8, _window$Pelcro$uiSett$8;
|
|
14365
|
+
const ReactGA$8 = (_window$8 = window) !== null && _window$8 !== void 0 && (_window$Pelcro$8 = _window$8.Pelcro) !== null && _window$Pelcro$8 !== void 0 && (_window$Pelcro$uiSett$8 = _window$Pelcro$8.uiSettings) !== null && _window$Pelcro$uiSett$8 !== void 0 && _window$Pelcro$uiSett$8.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
14366
|
+
|
|
13817
14367
|
/**
|
|
13818
14368
|
*
|
|
13819
14369
|
*/
|
|
@@ -13839,7 +14389,7 @@ function RegisterModal(props) {
|
|
|
13839
14389
|
};
|
|
13840
14390
|
const handleAfterRegistrationLogic = () => {
|
|
13841
14391
|
var _ReactGA$event, _window$Pelcro$site$r, _window$Pelcro$site$r2;
|
|
13842
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
14392
|
+
ReactGA$8 === null || ReactGA$8 === void 0 ? void 0 : (_ReactGA$event = ReactGA$8.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$8, {
|
|
13843
14393
|
category: "ACTIONS",
|
|
13844
14394
|
action: "Registered",
|
|
13845
14395
|
nonInteraction: true
|
|
@@ -13930,6 +14480,9 @@ function Radio(_ref) {
|
|
|
13930
14480
|
}, children));
|
|
13931
14481
|
}
|
|
13932
14482
|
|
|
14483
|
+
var _window$7, _window$Pelcro$7, _window$Pelcro$uiSett$7;
|
|
14484
|
+
const ReactGA$7 = (_window$7 = window) !== null && _window$7 !== void 0 && (_window$Pelcro$7 = _window$7.Pelcro) !== null && _window$Pelcro$7 !== void 0 && (_window$Pelcro$uiSett$7 = _window$Pelcro$7.uiSettings) !== null && _window$Pelcro$uiSett$7 !== void 0 && _window$Pelcro$uiSett$7.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
14485
|
+
|
|
13933
14486
|
/**
|
|
13934
14487
|
*
|
|
13935
14488
|
*/
|
|
@@ -14023,11 +14576,11 @@ class SelectModal extends Component {
|
|
|
14023
14576
|
}
|
|
14024
14577
|
document.addEventListener("keydown", this.handleSubmit);
|
|
14025
14578
|
if (!document.querySelector("#pelcro-selection-view") || !document.querySelector(".pelcro-select-product-wrapper")) {
|
|
14026
|
-
var _window$
|
|
14027
|
-
const userCurrency = (_window$
|
|
14028
|
-
const userCountry = (_window$
|
|
14029
|
-
const userLanguage = (_window$
|
|
14030
|
-
const productsMatchingUserCurrency = (_window$
|
|
14579
|
+
var _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro3, _window$Pelcro3$user, _window$Pelcro4, _window$Pelcro4$user, _window$Pelcro5, _window$Pelcro5$site;
|
|
14580
|
+
const userCurrency = (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$user = _window$Pelcro2.user) === null || _window$Pelcro2$user === void 0 ? void 0 : _window$Pelcro2$user.read().currency;
|
|
14581
|
+
const userCountry = (_window$Pelcro3 = window.Pelcro) === null || _window$Pelcro3 === void 0 ? void 0 : (_window$Pelcro3$user = _window$Pelcro3.user) === null || _window$Pelcro3$user === void 0 ? void 0 : _window$Pelcro3$user.location.countryCode;
|
|
14582
|
+
const userLanguage = (_window$Pelcro4 = window.Pelcro) === null || _window$Pelcro4 === void 0 ? void 0 : (_window$Pelcro4$user = _window$Pelcro4.user) === null || _window$Pelcro4$user === void 0 ? void 0 : _window$Pelcro4$user.read().language;
|
|
14583
|
+
const productsMatchingUserCurrency = (_window$Pelcro5 = window.Pelcro) === null || _window$Pelcro5 === void 0 ? void 0 : (_window$Pelcro5$site = _window$Pelcro5.site) === null || _window$Pelcro5$site === void 0 ? void 0 : _window$Pelcro5$site.read().products.filter(product => {
|
|
14031
14584
|
const filteredPlans = product.plans.filter(plan => plan.currency === userCurrency || !userCurrency);
|
|
14032
14585
|
if (filteredPlans.length) return filteredPlans;
|
|
14033
14586
|
});
|
|
@@ -14040,12 +14593,12 @@ class SelectModal extends Component {
|
|
|
14040
14593
|
});
|
|
14041
14594
|
notifyBugsnag(() => {
|
|
14042
14595
|
Bugsnag.notify("SelectModal - No data viewed", event => {
|
|
14043
|
-
var _window$
|
|
14596
|
+
var _window$Pelcro6, _window$Pelcro6$site, _window$Pelcro7, _window$Pelcro7$user, _window$Pelcro8, _window$Pelcro8$uiSet, _window$Pelcro9, _this$props, _window$Pelcro10, _window$Pelcro10$help, _window$Pelcro11, _window$Pelcro11$site;
|
|
14044
14597
|
event.addMetadata("MetaData", {
|
|
14045
|
-
site: (_window$
|
|
14046
|
-
user: (_window$
|
|
14047
|
-
uiVersion: (_window$
|
|
14048
|
-
environment: (_window$
|
|
14598
|
+
site: (_window$Pelcro6 = window.Pelcro) === null || _window$Pelcro6 === void 0 ? void 0 : (_window$Pelcro6$site = _window$Pelcro6.site) === null || _window$Pelcro6$site === void 0 ? void 0 : _window$Pelcro6$site.read(),
|
|
14599
|
+
user: (_window$Pelcro7 = window.Pelcro) === null || _window$Pelcro7 === void 0 ? void 0 : (_window$Pelcro7$user = _window$Pelcro7.user) === null || _window$Pelcro7$user === void 0 ? void 0 : _window$Pelcro7$user.read(),
|
|
14600
|
+
uiVersion: (_window$Pelcro8 = window.Pelcro) === null || _window$Pelcro8 === void 0 ? void 0 : (_window$Pelcro8$uiSet = _window$Pelcro8.uiSettings) === null || _window$Pelcro8$uiSet === void 0 ? void 0 : _window$Pelcro8$uiSet.uiVersion,
|
|
14601
|
+
environment: (_window$Pelcro9 = window.Pelcro) === null || _window$Pelcro9 === void 0 ? void 0 : _window$Pelcro9.environment,
|
|
14049
14602
|
matchingEntitlementsProps: (_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.matchingEntitlements,
|
|
14050
14603
|
productListState: this.state.productList,
|
|
14051
14604
|
methods: {
|
|
@@ -14056,8 +14609,8 @@ class SelectModal extends Component {
|
|
|
14056
14609
|
userCurrency: userCurrency,
|
|
14057
14610
|
userCountry: userCountry,
|
|
14058
14611
|
userLanguage: userLanguage,
|
|
14059
|
-
siteLanguage: (_window$
|
|
14060
|
-
products: (_window$
|
|
14612
|
+
siteLanguage: (_window$Pelcro10 = window.Pelcro) === null || _window$Pelcro10 === void 0 ? void 0 : (_window$Pelcro10$help = _window$Pelcro10.helpers) === null || _window$Pelcro10$help === void 0 ? void 0 : _window$Pelcro10$help.getHtmlLanguageAttribute(),
|
|
14613
|
+
products: (_window$Pelcro11 = window.Pelcro) === null || _window$Pelcro11 === void 0 ? void 0 : (_window$Pelcro11$site = _window$Pelcro11.site) === null || _window$Pelcro11$site === void 0 ? void 0 : _window$Pelcro11$site.read().products.length,
|
|
14061
14614
|
currency_matching_filter: `${productsMatchingUserCurrency.length} Products Passed`,
|
|
14062
14615
|
country_matching_filter: `${productsMatchingUserCountry.length} Products Passed`,
|
|
14063
14616
|
language_matching_filter: `${productsMatchingUserCountry.filter(productMatchPageLanguage).length} Products Passed`
|
|
@@ -14276,14 +14829,14 @@ class SelectModal extends Component {
|
|
|
14276
14829
|
} = this.props;
|
|
14277
14830
|
if (this.state.mode === "product") {
|
|
14278
14831
|
var _ReactGA$event;
|
|
14279
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
14832
|
+
ReactGA$7 === null || ReactGA$7 === void 0 ? void 0 : (_ReactGA$event = ReactGA$7.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$7, {
|
|
14280
14833
|
category: "VIEWS",
|
|
14281
14834
|
action: "Product Modal Viewed",
|
|
14282
14835
|
nonInteraction: true
|
|
14283
14836
|
});
|
|
14284
14837
|
} else if (this.state.mode === "plan") {
|
|
14285
14838
|
var _ReactGA$event2;
|
|
14286
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event2 = ReactGA.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA, {
|
|
14839
|
+
ReactGA$7 === null || ReactGA$7 === void 0 ? void 0 : (_ReactGA$event2 = ReactGA$7.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA$7, {
|
|
14287
14840
|
category: "VIEWS",
|
|
14288
14841
|
action: "Plan Modal Viewed",
|
|
14289
14842
|
nonInteraction: true
|
|
@@ -19586,6 +20139,9 @@ const SubscriptionRenewView = _ref => {
|
|
|
19586
20139
|
}));
|
|
19587
20140
|
};
|
|
19588
20141
|
|
|
20142
|
+
var _window$6, _window$Pelcro$6, _window$Pelcro$uiSett$6;
|
|
20143
|
+
const ReactGA$6 = (_window$6 = window) !== null && _window$6 !== void 0 && (_window$Pelcro$6 = _window$6.Pelcro) !== null && _window$Pelcro$6 !== void 0 && (_window$Pelcro$uiSett$6 = _window$Pelcro$6.uiSettings) !== null && _window$Pelcro$uiSett$6 !== void 0 && _window$Pelcro$uiSett$6.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
20144
|
+
|
|
19589
20145
|
/**
|
|
19590
20146
|
*
|
|
19591
20147
|
*/
|
|
@@ -19601,7 +20157,7 @@ function SubscriptionRenewModal(_ref) {
|
|
|
19601
20157
|
const onSuccess = res => {
|
|
19602
20158
|
var _otherProps$onSuccess, _ReactGA$event;
|
|
19603
20159
|
(_otherProps$onSuccess = otherProps.onSuccess) === null || _otherProps$onSuccess === void 0 ? void 0 : _otherProps$onSuccess.call(otherProps, res);
|
|
19604
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
20160
|
+
ReactGA$6 === null || ReactGA$6 === void 0 ? void 0 : (_ReactGA$event = ReactGA$6.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$6, {
|
|
19605
20161
|
category: "ACTIONS",
|
|
19606
20162
|
action: "Renewed",
|
|
19607
20163
|
nonInteraction: true
|
|
@@ -19611,7 +20167,7 @@ function SubscriptionRenewModal(_ref) {
|
|
|
19611
20167
|
const onGiftRenewalSuccess = () => {
|
|
19612
20168
|
var _otherProps$onGiftRen, _ReactGA$event2;
|
|
19613
20169
|
(_otherProps$onGiftRen = otherProps.onGiftRenewalSuccess) === null || _otherProps$onGiftRen === void 0 ? void 0 : _otherProps$onGiftRen.call(otherProps);
|
|
19614
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event2 = ReactGA.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA, {
|
|
20170
|
+
ReactGA$6 === null || ReactGA$6 === void 0 ? void 0 : (_ReactGA$event2 = ReactGA$6.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA$6, {
|
|
19615
20171
|
category: "ACTIONS",
|
|
19616
20172
|
action: "Renewed Gift",
|
|
19617
20173
|
nonInteraction: true
|
|
@@ -19785,6 +20341,8 @@ function SvgSubscription(props) {
|
|
|
19785
20341
|
}))))));
|
|
19786
20342
|
}
|
|
19787
20343
|
|
|
20344
|
+
var _window$5, _window$Pelcro$5, _window$Pelcro$uiSett$5;
|
|
20345
|
+
const ReactGA$5 = (_window$5 = window) !== null && _window$5 !== void 0 && (_window$Pelcro$5 = _window$5.Pelcro) !== null && _window$Pelcro$5 !== void 0 && (_window$Pelcro$uiSett$5 = _window$Pelcro$5.uiSettings) !== null && _window$Pelcro$uiSett$5 !== void 0 && _window$Pelcro$uiSett$5.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
19788
20346
|
const SubscriptionCancelNowButton = _ref => {
|
|
19789
20347
|
let {
|
|
19790
20348
|
subscription,
|
|
@@ -19816,7 +20374,7 @@ const SubscriptionCancelNowButton = _ref => {
|
|
|
19816
20374
|
if (err) {
|
|
19817
20375
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
19818
20376
|
}
|
|
19819
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
20377
|
+
ReactGA$5 === null || ReactGA$5 === void 0 ? void 0 : (_ReactGA$event = ReactGA$5.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$5, {
|
|
19820
20378
|
category: "ACTIONS",
|
|
19821
20379
|
action: "Canceled",
|
|
19822
20380
|
nonInteraction: true
|
|
@@ -19855,6 +20413,8 @@ const SubscriptionCancelNowButton = _ref => {
|
|
|
19855
20413
|
}, t("messages.cancelNow"));
|
|
19856
20414
|
};
|
|
19857
20415
|
|
|
20416
|
+
var _window$4, _window$Pelcro$4, _window$Pelcro$uiSett$4;
|
|
20417
|
+
const ReactGA$4 = (_window$4 = window) !== null && _window$4 !== void 0 && (_window$Pelcro$4 = _window$4.Pelcro) !== null && _window$Pelcro$4 !== void 0 && (_window$Pelcro$uiSett$4 = _window$Pelcro$4.uiSettings) !== null && _window$Pelcro$uiSett$4 !== void 0 && _window$Pelcro$uiSett$4.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
19858
20418
|
const SubscriptionCancelLaterButton = _ref => {
|
|
19859
20419
|
let {
|
|
19860
20420
|
subscription,
|
|
@@ -19886,7 +20446,7 @@ const SubscriptionCancelLaterButton = _ref => {
|
|
|
19886
20446
|
if (err) {
|
|
19887
20447
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
19888
20448
|
}
|
|
19889
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
20449
|
+
ReactGA$4 === null || ReactGA$4 === void 0 ? void 0 : (_ReactGA$event = ReactGA$4.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$4, {
|
|
19890
20450
|
category: "ACTIONS",
|
|
19891
20451
|
action: "Canceled",
|
|
19892
20452
|
nonInteraction: true
|
|
@@ -20095,6 +20655,8 @@ const SubscriptionSuspendDate = props => {
|
|
|
20095
20655
|
}, props));
|
|
20096
20656
|
};
|
|
20097
20657
|
|
|
20658
|
+
var _window$3, _window$Pelcro$3, _window$Pelcro$uiSett$3;
|
|
20659
|
+
const ReactGA$3 = (_window$3 = window) !== null && _window$3 !== void 0 && (_window$Pelcro$3 = _window$3.Pelcro) !== null && _window$Pelcro$3 !== void 0 && (_window$Pelcro$uiSett$3 = _window$Pelcro$3.uiSettings) !== null && _window$Pelcro$uiSett$3 !== void 0 && _window$Pelcro$uiSett$3.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
20098
20660
|
const SubscriptionSuspendButton = _ref => {
|
|
20099
20661
|
let {
|
|
20100
20662
|
subscription,
|
|
@@ -20125,7 +20687,7 @@ const SubscriptionSuspendButton = _ref => {
|
|
|
20125
20687
|
if (err) {
|
|
20126
20688
|
return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
|
|
20127
20689
|
}
|
|
20128
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
20690
|
+
ReactGA$3 === null || ReactGA$3 === void 0 ? void 0 : (_ReactGA$event = ReactGA$3.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$3, {
|
|
20129
20691
|
category: "ACTIONS",
|
|
20130
20692
|
action: "Suspended",
|
|
20131
20693
|
nonInteraction: true
|
|
@@ -22982,7 +23544,7 @@ const AddressUpdateContainer = _ref => {
|
|
|
22982
23544
|
}
|
|
22983
23545
|
});
|
|
22984
23546
|
onSuccess(res);
|
|
22985
|
-
|
|
23547
|
+
ReactGA1 === null || ReactGA1 === void 0 ? void 0 : (_ReactGA$event = ReactGA1.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA1, {
|
|
22986
23548
|
category: "ACTIONS",
|
|
22987
23549
|
action: "Updated address",
|
|
22988
23550
|
nonInteraction: true
|
|
@@ -23510,11 +24072,13 @@ function PaymentMethodUpdateView(props) {
|
|
|
23510
24072
|
}));
|
|
23511
24073
|
}
|
|
23512
24074
|
|
|
24075
|
+
var _window$2, _window$Pelcro$2, _window$Pelcro$uiSett$2;
|
|
24076
|
+
const ReactGA$2 = (_window$2 = window) !== null && _window$2 !== void 0 && (_window$Pelcro$2 = _window$2.Pelcro) !== null && _window$Pelcro$2 !== void 0 && (_window$Pelcro$uiSett$2 = _window$Pelcro$2.uiSettings) !== null && _window$Pelcro$uiSett$2 !== void 0 && _window$Pelcro$uiSett$2.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
23513
24077
|
const PaymentMethodUpdateModal = props => {
|
|
23514
24078
|
const onSuccess = res => {
|
|
23515
24079
|
var _props$onSuccess, _ReactGA$event;
|
|
23516
24080
|
(_props$onSuccess = props.onSuccess) === null || _props$onSuccess === void 0 ? void 0 : _props$onSuccess.call(props, res);
|
|
23517
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
24081
|
+
ReactGA$2 === null || ReactGA$2 === void 0 ? void 0 : (_ReactGA$event = ReactGA$2.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$2, {
|
|
23518
24082
|
category: "ACTIONS",
|
|
23519
24083
|
action: "Updated payment card",
|
|
23520
24084
|
nonInteraction: true
|
|
@@ -27394,6 +27958,8 @@ const OrderItems = _ref => {
|
|
|
27394
27958
|
});
|
|
27395
27959
|
};
|
|
27396
27960
|
|
|
27961
|
+
var _window$1, _window$Pelcro$1, _window$Pelcro$uiSett$1;
|
|
27962
|
+
const ReactGA$1 = (_window$1 = window) !== null && _window$1 !== void 0 && (_window$Pelcro$1 = _window$1.Pelcro) !== null && _window$Pelcro$1 !== void 0 && (_window$Pelcro$uiSett$1 = _window$Pelcro$1.uiSettings) !== null && _window$Pelcro$uiSett$1 !== void 0 && _window$Pelcro$uiSett$1.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
27397
27963
|
const SavedItemsMenu = () => {
|
|
27398
27964
|
const {
|
|
27399
27965
|
t
|
|
@@ -27458,7 +28024,7 @@ const SavedItems = _ref3 => {
|
|
|
27458
28024
|
return;
|
|
27459
28025
|
}
|
|
27460
28026
|
setItems(response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.metadata);
|
|
27461
|
-
ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
|
|
28027
|
+
ReactGA$1 === null || ReactGA$1 === void 0 ? void 0 : (_ReactGA$event = ReactGA$1.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$1, {
|
|
27462
28028
|
category: "ACTIONS",
|
|
27463
28029
|
action: "Unsave/Unfollow",
|
|
27464
28030
|
label: title
|
|
@@ -28405,6 +28971,8 @@ function getMemberShipStatus(status) {
|
|
|
28405
28971
|
};
|
|
28406
28972
|
}
|
|
28407
28973
|
|
|
28974
|
+
var _window, _window$Pelcro, _window$Pelcro$uiSett;
|
|
28975
|
+
const ReactGA = (_window = window) !== null && _window !== void 0 && (_window$Pelcro = _window.Pelcro) !== null && _window$Pelcro !== void 0 && (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) !== null && _window$Pelcro$uiSett !== void 0 && _window$Pelcro$uiSett.enableReactGA4 ? ReactGA4 : ReactGA1;
|
|
28408
28976
|
const SUB_MENUS = {
|
|
28409
28977
|
PROFILE: "profile",
|
|
28410
28978
|
SUBSCRIPTIONS: "subscriptions",
|
|
@@ -28806,13 +29374,13 @@ class Dashboard extends Component {
|
|
|
28806
29374
|
this.menuRef = /*#__PURE__*/React__default.createRef();
|
|
28807
29375
|
}
|
|
28808
29376
|
render() {
|
|
28809
|
-
var _window$Pelcro$user$r3, _window$
|
|
29377
|
+
var _window$Pelcro$user$r3, _window$Pelcro2, _window$Pelcro2$uiSet, _this$user$source, _this$user$source$pro, _this$user$source2, _this$user$source2$pr;
|
|
28810
29378
|
const {
|
|
28811
29379
|
isOpen
|
|
28812
29380
|
} = this.state;
|
|
28813
29381
|
const userHasName = this.user.first_name || this.user.last_name;
|
|
28814
29382
|
const profilePicture = (_window$Pelcro$user$r3 = window.Pelcro.user.read().profile_photo) !== null && _window$Pelcro$user$r3 !== void 0 ? _window$Pelcro$user$r3 : userSolidIcon;
|
|
28815
|
-
const newsletters = (_window$
|
|
29383
|
+
const newsletters = (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$uiSet = _window$Pelcro2.uiSettings) === null || _window$Pelcro2$uiSet === void 0 ? void 0 : _window$Pelcro2$uiSet.newsletters;
|
|
28816
29384
|
const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
|
|
28817
29385
|
return /*#__PURE__*/React__default.createElement(Transition, {
|
|
28818
29386
|
className: "plc-fixed plc-inset-y-0 plc-right-0 plc-h-full plc-max-w-xl plc-overflow-y-auto plc-text-left plc-bg-white plc-shadow-xl plc-z-max",
|