@pelcro/react-pelcro-js 4.0.0-alpha.42 → 4.0.0-alpha.44

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.esm.js CHANGED
@@ -7341,6 +7341,53 @@ function _defineProperty$3(obj, key, value) {
7341
7341
  return obj;
7342
7342
  }
7343
7343
 
7344
+ // Polyfill
7345
+ (() => {
7346
+ if (typeof window.CustomEvent === "function") return false;
7347
+
7348
+ function CustomEvent(event, params = {
7349
+ bubbles: false,
7350
+ cancelable: false,
7351
+ detail: undefined
7352
+ }) {
7353
+ const evt = document.createEvent("CustomEvent");
7354
+ evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
7355
+ return evt;
7356
+ }
7357
+
7358
+ CustomEvent.prototype = window.Event.prototype;
7359
+ window.CustomEvent = CustomEvent;
7360
+ })();
7361
+ /**
7362
+ * Should fire when the cart is opened and expects the cartItems inside the card to be sent
7363
+ */
7364
+
7365
+
7366
+ const cartOpened = detail => createCustomEvent("PelcroElementsCartOpened", detail);
7367
+ /**
7368
+ * Should fire when an item added to the cart and expects the added item to be sent
7369
+ */
7370
+
7371
+ const cartItemAdded = detail => createCustomEvent("PelcroElementsCartItemAdded", detail);
7372
+ /**
7373
+ * Should fire when an item removed from the cart and expects the removed item to be sent
7374
+ */
7375
+
7376
+ const cartItemRemoved = detail => createCustomEvent("PelcroElementsCartItemRemoved", detail);
7377
+ /**
7378
+ * Check if the browser support custom events
7379
+ */
7380
+
7381
+ function createCustomEvent(name, detail) {
7382
+ try {
7383
+ return new CustomEvent(name, {
7384
+ detail
7385
+ });
7386
+ } catch (e) {
7387
+ console.warn("Pelcro - Events are not supported in the browser");
7388
+ }
7389
+ }
7390
+
7344
7391
  function warn(s) {
7345
7392
  console.warn('[react-ga]', s);
7346
7393
  }
@@ -8192,57 +8239,789 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
8192
8239
  OutboundLink$1.origTrackLink = OutboundLink$1.trackLink;
8193
8240
  OutboundLink$1.trackLink = outboundLink;
8194
8241
  var OutboundLink = OutboundLink$1;
8195
- var ReactGA = _objectSpread({}, Defaults, {
8242
+ var ReactGA1 = _objectSpread({}, Defaults, {
8196
8243
  OutboundLink: OutboundLink
8197
8244
  });
8198
8245
 
8199
- // Polyfill
8200
- (() => {
8201
- if (typeof window.CustomEvent === "function") return false;
8246
+ var gtag_1 = createCommonjsModule(function (module, exports) {
8202
8247
 
8203
- function CustomEvent(event, params = {
8204
- bubbles: false,
8205
- cancelable: false,
8206
- detail: undefined
8207
- }) {
8208
- const evt = document.createEvent("CustomEvent");
8209
- evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
8210
- return evt;
8248
+ Object.defineProperty(exports, "__esModule", {
8249
+ value: true
8250
+ });
8251
+ exports["default"] = void 0;
8252
+
8253
+ var gtag = function gtag() {
8254
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
8255
+ args[_key] = arguments[_key];
8211
8256
  }
8212
8257
 
8213
- CustomEvent.prototype = window.Event.prototype;
8214
- window.CustomEvent = CustomEvent;
8215
- })();
8216
- /**
8217
- * Should fire when the cart is opened and expects the cartItems inside the card to be sent
8218
- */
8258
+ if (typeof window !== "undefined") {
8259
+ var _window;
8219
8260
 
8261
+ if (typeof window.gtag === "undefined") {
8262
+ window.dataLayer = window.dataLayer || [];
8263
+
8264
+ window.gtag = function gtag() {
8265
+ window.dataLayer.push(arguments);
8266
+ };
8267
+ }
8268
+
8269
+ (_window = window).gtag.apply(_window, args);
8270
+ }
8271
+ };
8272
+
8273
+ var _default = gtag;
8274
+ exports["default"] = _default;
8275
+ });
8276
+
8277
+ unwrapExports(gtag_1);
8278
+
8279
+ var format_1 = createCommonjsModule(function (module, exports) {
8280
+
8281
+ Object.defineProperty(exports, "__esModule", {
8282
+ value: true
8283
+ });
8284
+ exports["default"] = format;
8285
+ var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;
8286
+
8287
+ function toTitleCase(string) {
8288
+ return string.toString().trim().replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, function (match, index, title) {
8289
+ 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) {
8290
+ return match.toLowerCase();
8291
+ }
8292
+
8293
+ if (match.substr(1).search(/[A-Z]|\../) > -1) {
8294
+ return match;
8295
+ }
8296
+
8297
+ return match.charAt(0).toUpperCase() + match.substr(1);
8298
+ });
8299
+ } // See if s could be an email address. We don't want to send personal data like email.
8300
+ // https://support.google.com/analytics/answer/2795983?hl=en
8301
+
8302
+
8303
+ function mightBeEmail(s) {
8304
+ // There's no point trying to validate rfc822 fully, just look for ...@...
8305
+ return typeof s === "string" && s.indexOf("@") !== -1;
8306
+ }
8307
+
8308
+ var redacted = "REDACTED (Potential Email Address)";
8309
+
8310
+ function redactEmail(string) {
8311
+ if (mightBeEmail(string)) {
8312
+ console.warn("This arg looks like an email address, redacting.");
8313
+ return redacted;
8314
+ }
8315
+
8316
+ return string;
8317
+ }
8318
+
8319
+ function format() {
8320
+ var s = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
8321
+ var titleCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
8322
+ var redactingEmail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
8323
+
8324
+ var _str = s || "";
8325
+
8326
+ if (titleCase) {
8327
+ _str = toTitleCase(s);
8328
+ }
8329
+
8330
+ if (redactingEmail) {
8331
+ _str = redactEmail(_str);
8332
+ }
8333
+
8334
+ return _str;
8335
+ }
8336
+ });
8337
+
8338
+ unwrapExports(format_1);
8339
+
8340
+ var ga4 = createCommonjsModule(function (module, exports) {
8341
+
8342
+ Object.defineProperty(exports, "__esModule", {
8343
+ value: true
8344
+ });
8345
+ exports["default"] = exports.GA4 = void 0;
8346
+
8347
+ var _gtag = _interopRequireDefault(gtag_1);
8348
+
8349
+ var _format = _interopRequireDefault(format_1);
8350
+
8351
+ var _excluded = ["eventCategory", "eventAction", "eventLabel", "eventValue", "hitType"],
8352
+ _excluded2 = ["title", "location"],
8353
+ _excluded3 = ["page", "hitType"],
8354
+ _excluded4 = ["action", "category", "label", "value", "nonInteraction", "transport"];
8355
+
8356
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
8357
+
8358
+ 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; }
8359
+
8360
+ 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; }
8361
+
8362
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
8363
+
8364
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
8365
+
8366
+ 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."); }
8367
+
8368
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
8369
+
8370
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
8371
+
8372
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
8373
+
8374
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
8375
+
8376
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8377
+
8378
+ 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."); }
8379
+
8380
+ 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); }
8381
+
8382
+ 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; }
8383
+
8384
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
8385
+
8386
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8387
+
8388
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8389
+
8390
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
8391
+
8392
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
8393
+
8394
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8395
+
8396
+ /*
8397
+ Links
8398
+ https://developers.google.com/gtagjs/reference/api
8399
+ https://developers.google.com/tag-platform/gtagjs/reference
8400
+ */
8220
8401
 
8221
- const cartOpened = detail => createCustomEvent("PelcroElementsCartOpened", detail);
8222
8402
  /**
8223
- * Should fire when an item added to the cart and expects the added item to be sent
8403
+ * @typedef GaOptions
8404
+ * @type {Object}
8405
+ * @property {boolean} [cookieUpdate=true]
8406
+ * @property {number} [cookieExpires=63072000] Default two years
8407
+ * @property {string} [cookieDomain="auto"]
8408
+ * @property {string} [cookieFlags]
8409
+ * @property {string} [userId]
8410
+ * @property {string} [clientId]
8411
+ * @property {boolean} [anonymizeIp]
8412
+ * @property {string} [contentGroup1]
8413
+ * @property {string} [contentGroup2]
8414
+ * @property {string} [contentGroup3]
8415
+ * @property {string} [contentGroup4]
8416
+ * @property {string} [contentGroup5]
8417
+ * @property {boolean} [allowAdFeatures=true]
8418
+ * @property {boolean} [allowAdPersonalizationSignals]
8419
+ * @property {boolean} [nonInteraction]
8420
+ * @property {string} [page]
8224
8421
  */
8225
8422
 
8226
- const cartItemAdded = detail => createCustomEvent("PelcroElementsCartItemAdded", detail);
8227
8423
  /**
8228
- * Should fire when an item removed from the cart and expects the removed item to be sent
8424
+ * @typedef UaEventOptions
8425
+ * @type {Object}
8426
+ * @property {string} action
8427
+ * @property {string} category
8428
+ * @property {string} [label]
8429
+ * @property {number} [value]
8430
+ * @property {boolean} [nonInteraction]
8431
+ * @property {('beacon'|'xhr'|'image')} [transport]
8229
8432
  */
8230
8433
 
8231
- const cartItemRemoved = detail => createCustomEvent("PelcroElementsCartItemRemoved", detail);
8232
8434
  /**
8233
- * Check if the browser support custom events
8435
+ * @typedef InitOptions
8436
+ * @type {Object}
8437
+ * @property {string} trackingId
8438
+ * @property {GaOptions|any} [gaOptions]
8439
+ * @property {Object} [gtagOptions] New parameter
8234
8440
  */
8441
+ var GA4 = /*#__PURE__*/function () {
8442
+ function GA4() {
8443
+ var _this = this;
8235
8444
 
8236
- function createCustomEvent(name, detail) {
8237
- try {
8238
- return new CustomEvent(name, {
8239
- detail
8445
+ _classCallCheck(this, GA4);
8446
+
8447
+ _defineProperty(this, "reset", function () {
8448
+ _this.isInitialized = false;
8449
+ _this._testMode = false;
8450
+ _this._currentMeasurementId;
8451
+ _this._hasLoadedGA = false;
8452
+ _this._isQueuing = false;
8453
+ _this._queueGtag = [];
8240
8454
  });
8241
- } catch (e) {
8242
- console.warn("Pelcro - Events are not supported in the browser");
8455
+
8456
+ _defineProperty(this, "_gtag", function () {
8457
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
8458
+ args[_key] = arguments[_key];
8459
+ }
8460
+
8461
+ if (!_this._testMode) {
8462
+ if (_this._isQueuing) {
8463
+ _this._queueGtag.push(args);
8464
+ } else {
8465
+ _gtag["default"].apply(void 0, args);
8466
+ }
8467
+ } else {
8468
+ _this._queueGtag.push(args);
8469
+ }
8470
+ });
8471
+
8472
+ _defineProperty(this, "_loadGA", function (GA_MEASUREMENT_ID, nonce) {
8473
+ if (typeof window === "undefined" || typeof document === "undefined") {
8474
+ return;
8475
+ }
8476
+
8477
+ if (!_this._hasLoadedGA) {
8478
+ // Global Site Tag (gtag.js) - Google Analytics
8479
+ var script = document.createElement("script");
8480
+ script.async = true;
8481
+ script.src = "https://www.googletagmanager.com/gtag/js?id=".concat(GA_MEASUREMENT_ID);
8482
+
8483
+ if (nonce) {
8484
+ script.setAttribute("nonce", nonce);
8485
+ }
8486
+
8487
+ document.body.appendChild(script);
8488
+ window.dataLayer = window.dataLayer || [];
8489
+
8490
+ window.gtag = function gtag() {
8491
+ window.dataLayer.push(arguments);
8492
+ };
8493
+
8494
+ _this._hasLoadedGA = true;
8495
+ }
8496
+ });
8497
+
8498
+ _defineProperty(this, "_toGtagOptions", function (gaOptions) {
8499
+ if (!gaOptions) {
8500
+ return;
8501
+ }
8502
+
8503
+ var mapFields = {
8504
+ // Old https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#cookieUpdate
8505
+ // New https://developers.google.com/analytics/devguides/collection/gtagjs/cookies-user-id#cookie_update
8506
+ cookieUpdate: "cookie_update",
8507
+ cookieExpires: "cookie_expires",
8508
+ cookieDomain: "cookie_domain",
8509
+ cookieFlags: "cookie_flags",
8510
+ // must be in set method?
8511
+ userId: "user_id",
8512
+ clientId: "client_id",
8513
+ anonymizeIp: "anonymize_ip",
8514
+ // https://support.google.com/analytics/answer/2853546?hl=en#zippy=%2Cin-this-article
8515
+ contentGroup1: "content_group1",
8516
+ contentGroup2: "content_group2",
8517
+ contentGroup3: "content_group3",
8518
+ contentGroup4: "content_group4",
8519
+ contentGroup5: "content_group5",
8520
+ // https://support.google.com/analytics/answer/9050852?hl=en
8521
+ allowAdFeatures: "allow_google_signals",
8522
+ allowAdPersonalizationSignals: "allow_ad_personalization_signals",
8523
+ nonInteraction: "non_interaction",
8524
+ page: "page_path",
8525
+ hitCallback: "event_callback"
8526
+ };
8527
+ var gtagOptions = Object.entries(gaOptions).reduce(function (prev, _ref) {
8528
+ var _ref2 = _slicedToArray(_ref, 2),
8529
+ key = _ref2[0],
8530
+ value = _ref2[1];
8531
+
8532
+ if (mapFields[key]) {
8533
+ prev[mapFields[key]] = value;
8534
+ } else {
8535
+ prev[key] = value;
8536
+ }
8537
+
8538
+ return prev;
8539
+ }, {});
8540
+ return gtagOptions;
8541
+ });
8542
+
8543
+ _defineProperty(this, "initialize", function (GA_MEASUREMENT_ID) {
8544
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
8545
+
8546
+ if (!GA_MEASUREMENT_ID) {
8547
+ throw new Error("Require GA_MEASUREMENT_ID");
8548
+ }
8549
+
8550
+ var initConfigs = typeof GA_MEASUREMENT_ID === "string" ? [{
8551
+ trackingId: GA_MEASUREMENT_ID
8552
+ }] : GA_MEASUREMENT_ID;
8553
+ _this._currentMeasurementId = initConfigs[0].trackingId;
8554
+ var gaOptions = options.gaOptions,
8555
+ gtagOptions = options.gtagOptions,
8556
+ _options$legacyDimens = options.legacyDimensionMetric,
8557
+ legacyDimensionMetric = _options$legacyDimens === void 0 ? true : _options$legacyDimens,
8558
+ nonce = options.nonce,
8559
+ _options$testMode = options.testMode,
8560
+ testMode = _options$testMode === void 0 ? false : _options$testMode;
8561
+ _this._testMode = testMode;
8562
+
8563
+ if (!testMode) {
8564
+ _this._loadGA(_this._currentMeasurementId, nonce);
8565
+ }
8566
+
8567
+ if (!_this.isInitialized) {
8568
+ _this._gtag("js", new Date());
8569
+
8570
+ initConfigs.forEach(function (config) {
8571
+ var mergedGtagOptions = _this._appendCustomMap(_objectSpread(_objectSpread(_objectSpread({
8572
+ // https://developers.google.com/analytics/devguides/collection/gtagjs/pages#disable_pageview_measurement
8573
+ send_page_view: false
8574
+ }, _this._toGtagOptions(_objectSpread(_objectSpread({}, gaOptions), config.gaOptions))), gtagOptions), config.gtagOptions), legacyDimensionMetric);
8575
+
8576
+ _this._gtag("config", config.trackingId, mergedGtagOptions);
8577
+ });
8578
+ }
8579
+
8580
+ _this.isInitialized = true;
8581
+
8582
+ if (!testMode) {
8583
+ var queues = _toConsumableArray(_this._queueGtag);
8584
+
8585
+ _this._queueGtag = [];
8586
+ _this._isQueuing = false;
8587
+
8588
+ while (queues.length) {
8589
+ var queue = queues.shift();
8590
+
8591
+ _this._gtag.apply(_this, _toConsumableArray(queue));
8592
+
8593
+ if (queue[0] === "get") {
8594
+ _this._isQueuing = true;
8595
+ }
8596
+ }
8597
+ }
8598
+ });
8599
+
8600
+ _defineProperty(this, "set", function (fieldsObject) {
8601
+ if (!fieldsObject) {
8602
+ console.warn("`fieldsObject` is required in .set()");
8603
+ return;
8604
+ }
8605
+
8606
+ if (_typeof(fieldsObject) !== "object") {
8607
+ console.warn("Expected `fieldsObject` arg to be an Object");
8608
+ return;
8609
+ }
8610
+
8611
+ if (Object.keys(fieldsObject).length === 0) {
8612
+ console.warn("empty `fieldsObject` given to .set()");
8613
+ }
8614
+
8615
+ _this._gaCommand("set", fieldsObject);
8616
+ });
8617
+
8618
+ _defineProperty(this, "_gaCommandSendEvent", function (eventCategory, eventAction, eventLabel, eventValue, fieldsObject) {
8619
+ _this._gtag("event", eventAction, _objectSpread(_objectSpread({
8620
+ event_category: eventCategory,
8621
+ event_label: eventLabel,
8622
+ value: eventValue
8623
+ }, fieldsObject && {
8624
+ non_interaction: fieldsObject.nonInteraction
8625
+ }), _this._toGtagOptions(fieldsObject)));
8626
+ });
8627
+
8628
+ _defineProperty(this, "_gaCommandSendEventParameters", function () {
8629
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
8630
+ args[_key2] = arguments[_key2];
8631
+ }
8632
+
8633
+ if (typeof args[0] === "string") {
8634
+ _this._gaCommandSendEvent.apply(_this, _toConsumableArray(args.slice(1)));
8635
+ } else {
8636
+ var _args$ = args[0],
8637
+ eventCategory = _args$.eventCategory,
8638
+ eventAction = _args$.eventAction,
8639
+ eventLabel = _args$.eventLabel,
8640
+ eventValue = _args$.eventValue;
8641
+ _args$.hitType;
8642
+ var rest = _objectWithoutProperties(_args$, _excluded);
8643
+
8644
+ _this._gaCommandSendEvent(eventCategory, eventAction, eventLabel, eventValue, rest);
8645
+ }
8646
+ });
8647
+
8648
+ _defineProperty(this, "_gaCommandSendTiming", function (timingCategory, timingVar, timingValue, timingLabel) {
8649
+ _this._gtag("event", "timing_complete", {
8650
+ name: timingVar,
8651
+ value: timingValue,
8652
+ event_category: timingCategory,
8653
+ event_label: timingLabel
8654
+ });
8655
+ });
8656
+
8657
+ _defineProperty(this, "_gaCommandSendPageview", function (page, fieldsObject) {
8658
+ if (fieldsObject && Object.keys(fieldsObject).length) {
8659
+ var _this$_toGtagOptions = _this._toGtagOptions(fieldsObject),
8660
+ title = _this$_toGtagOptions.title,
8661
+ location = _this$_toGtagOptions.location,
8662
+ rest = _objectWithoutProperties(_this$_toGtagOptions, _excluded2);
8663
+
8664
+ _this._gtag("event", "page_view", _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, page && {
8665
+ page_path: page
8666
+ }), title && {
8667
+ page_title: title
8668
+ }), location && {
8669
+ page_location: location
8670
+ }), rest));
8671
+ } else if (page) {
8672
+ _this._gtag("event", "page_view", {
8673
+ page_path: page
8674
+ });
8675
+ } else {
8676
+ _this._gtag("event", "page_view");
8677
+ }
8678
+ });
8679
+
8680
+ _defineProperty(this, "_gaCommandSendPageviewParameters", function () {
8681
+ for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
8682
+ args[_key3] = arguments[_key3];
8683
+ }
8684
+
8685
+ if (typeof args[0] === "string") {
8686
+ _this._gaCommandSendPageview.apply(_this, _toConsumableArray(args.slice(1)));
8687
+ } else {
8688
+ var _args$2 = args[0],
8689
+ page = _args$2.page;
8690
+ _args$2.hitType;
8691
+ var rest = _objectWithoutProperties(_args$2, _excluded3);
8692
+
8693
+ _this._gaCommandSendPageview(page, rest);
8694
+ }
8695
+ });
8696
+
8697
+ _defineProperty(this, "_gaCommandSend", function () {
8698
+ for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
8699
+ args[_key4] = arguments[_key4];
8700
+ }
8701
+
8702
+ var hitType = typeof args[0] === "string" ? args[0] : args[0].hitType;
8703
+
8704
+ switch (hitType) {
8705
+ case "event":
8706
+ _this._gaCommandSendEventParameters.apply(_this, args);
8707
+
8708
+ break;
8709
+
8710
+ case "pageview":
8711
+ _this._gaCommandSendPageviewParameters.apply(_this, args);
8712
+
8713
+ break;
8714
+
8715
+ case "timing":
8716
+ _this._gaCommandSendTiming.apply(_this, _toConsumableArray(args.slice(1)));
8717
+
8718
+ break;
8719
+
8720
+ case "screenview":
8721
+ case "transaction":
8722
+ case "item":
8723
+ case "social":
8724
+ case "exception":
8725
+ console.warn("Unsupported send command: ".concat(hitType));
8726
+ break;
8727
+
8728
+ default:
8729
+ console.warn("Send command doesn't exist: ".concat(hitType));
8730
+ }
8731
+ });
8732
+
8733
+ _defineProperty(this, "_gaCommandSet", function () {
8734
+ for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
8735
+ args[_key5] = arguments[_key5];
8736
+ }
8737
+
8738
+ if (typeof args[0] === "string") {
8739
+ args[0] = _defineProperty({}, args[0], args[1]);
8740
+ }
8741
+
8742
+ _this._gtag("set", _this._toGtagOptions(args[0]));
8743
+ });
8744
+
8745
+ _defineProperty(this, "_gaCommand", function (command) {
8746
+ for (var _len6 = arguments.length, args = new Array(_len6 > 1 ? _len6 - 1 : 0), _key6 = 1; _key6 < _len6; _key6++) {
8747
+ args[_key6 - 1] = arguments[_key6];
8748
+ }
8749
+
8750
+ switch (command) {
8751
+ case "send":
8752
+ _this._gaCommandSend.apply(_this, args);
8753
+
8754
+ break;
8755
+
8756
+ case "set":
8757
+ _this._gaCommandSet.apply(_this, args);
8758
+
8759
+ break;
8760
+
8761
+ default:
8762
+ console.warn("Command doesn't exist: ".concat(command));
8763
+ }
8764
+ });
8765
+
8766
+ _defineProperty(this, "ga", function () {
8767
+ for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
8768
+ args[_key7] = arguments[_key7];
8769
+ }
8770
+
8771
+ if (typeof args[0] === "string") {
8772
+ _this._gaCommand.apply(_this, args);
8773
+ } else {
8774
+ var readyCallback = args[0];
8775
+
8776
+ _this._gtag("get", _this._currentMeasurementId, "client_id", function (clientId) {
8777
+ _this._isQueuing = false;
8778
+ var queues = _this._queueGtag;
8779
+ readyCallback({
8780
+ get: function get(property) {
8781
+ return property === "clientId" ? clientId : property === "trackingId" ? _this._currentMeasurementId : property === "apiVersion" ? "1" : undefined;
8782
+ }
8783
+ });
8784
+
8785
+ while (queues.length) {
8786
+ var queue = queues.shift();
8787
+
8788
+ _this._gtag.apply(_this, _toConsumableArray(queue));
8789
+ }
8790
+ });
8791
+
8792
+ _this._isQueuing = true;
8793
+ }
8794
+
8795
+ return _this.ga;
8796
+ });
8797
+
8798
+ _defineProperty(this, "event", function (optionsOrName, params) {
8799
+ if (typeof optionsOrName === "string") {
8800
+ _this._gtag("event", optionsOrName, _this._toGtagOptions(params));
8801
+ } else {
8802
+ var action = optionsOrName.action,
8803
+ category = optionsOrName.category,
8804
+ label = optionsOrName.label,
8805
+ value = optionsOrName.value,
8806
+ nonInteraction = optionsOrName.nonInteraction,
8807
+ transport = optionsOrName.transport,
8808
+ rest = _objectWithoutProperties(optionsOrName, _excluded4);
8809
+
8810
+ if (!category || !action) {
8811
+ console.warn("args.category AND args.action are required in event()");
8812
+ return;
8813
+ } // Required Fields
8814
+
8815
+
8816
+ var fieldObject = {
8817
+ hitType: "event",
8818
+ eventCategory: (0, _format["default"])(category),
8819
+ eventAction: (0, _format["default"])(action)
8820
+ }; // Optional Fields
8821
+
8822
+ if (label) {
8823
+ fieldObject.eventLabel = (0, _format["default"])(label);
8824
+ }
8825
+
8826
+ if (typeof value !== "undefined") {
8827
+ if (typeof value !== "number") {
8828
+ console.warn("Expected `args.value` arg to be a Number.");
8829
+ } else {
8830
+ fieldObject.eventValue = value;
8831
+ }
8832
+ }
8833
+
8834
+ if (typeof nonInteraction !== "undefined") {
8835
+ if (typeof nonInteraction !== "boolean") {
8836
+ console.warn("`args.nonInteraction` must be a boolean.");
8837
+ } else {
8838
+ fieldObject.nonInteraction = nonInteraction;
8839
+ }
8840
+ }
8841
+
8842
+ if (typeof transport !== "undefined") {
8843
+ if (typeof transport !== "string") {
8844
+ console.warn("`args.transport` must be a string.");
8845
+ } else {
8846
+ if (["beacon", "xhr", "image"].indexOf(transport) === -1) {
8847
+ console.warn("`args.transport` must be either one of these values: `beacon`, `xhr` or `image`");
8848
+ }
8849
+
8850
+ fieldObject.transport = transport;
8851
+ }
8852
+ }
8853
+
8854
+ Object.keys(rest).filter(function (key) {
8855
+ return key.substr(0, "dimension".length) === "dimension";
8856
+ }).forEach(function (key) {
8857
+ fieldObject[key] = rest[key];
8858
+ });
8859
+ Object.keys(rest).filter(function (key) {
8860
+ return key.substr(0, "metric".length) === "metric";
8861
+ }).forEach(function (key) {
8862
+ fieldObject[key] = rest[key];
8863
+ });
8864
+
8865
+ _this._gaCommand("send", fieldObject);
8866
+ }
8867
+ });
8868
+
8869
+ _defineProperty(this, "send", function (fieldObject) {
8870
+ _this._gaCommand("send", fieldObject);
8871
+ });
8872
+
8873
+ _defineProperty(this, "pageview", function (path, _, title) {
8874
+ var pathTrim = path === null || path === void 0 ? void 0 : path.trim();
8875
+
8876
+ if (pathTrim === "") {
8877
+ console.warn("path cannot be an empty string in .pageview()");
8878
+ return;
8879
+ }
8880
+
8881
+ _this._gaCommand("send", "pageview", pathTrim, {
8882
+ title: title
8883
+ });
8884
+ });
8885
+
8886
+ this.reset();
8243
8887
  }
8244
- }
8245
8888
 
8889
+ _createClass(GA4, [{
8890
+ key: "gtag",
8891
+ value: function gtag() {
8892
+ this._gtag.apply(this, arguments);
8893
+ }
8894
+ }, {
8895
+ key: "_appendCustomMap",
8896
+ value: function _appendCustomMap(options) {
8897
+ var legacyDimensionMetric = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
8898
+
8899
+ if (!legacyDimensionMetric) {
8900
+ return options;
8901
+ }
8902
+
8903
+ if (!options.custom_map) {
8904
+ options.custom_map = {};
8905
+ }
8906
+
8907
+ for (var i = 1; i <= 200; i++) {
8908
+ if (!options.custom_map["dimension".concat(i)]) {
8909
+ options.custom_map["dimension".concat(i)] = "dimension".concat(i);
8910
+ }
8911
+
8912
+ if (!options.custom_map["metric".concat(i)]) {
8913
+ options.custom_map["metric".concat(i)] = "metric".concat(i);
8914
+ }
8915
+ }
8916
+
8917
+ return options;
8918
+ }
8919
+ /**
8920
+ * @since v1.0.2
8921
+ * @param {string} [path="location.href"]
8922
+ * @param {string[]} [_] unsupported
8923
+ * @param {string} [title="location.pathname"]
8924
+ * @deprecated Use `.send("pageview")` instead
8925
+ */
8926
+
8927
+ }, {
8928
+ key: "outboundLink",
8929
+ value:
8930
+ /**
8931
+ * @since v1.0.6
8932
+ * @param {Object} options
8933
+ * @param {string} options.label
8934
+ * @param {function} hitCallback
8935
+ * @deprecated Use `enhanced measurement` feature in Google Analytics.
8936
+ */
8937
+ function outboundLink(_ref3, hitCallback) {
8938
+ var label = _ref3.label;
8939
+
8940
+ if (typeof hitCallback !== "function") {
8941
+ console.warn("hitCallback function is required");
8942
+ return;
8943
+ }
8944
+
8945
+ if (!label) {
8946
+ console.warn("args.label is required in outboundLink()");
8947
+ return;
8948
+ } // Required Fields
8949
+
8950
+
8951
+ var fieldObject = {
8952
+ hitType: "event",
8953
+ eventCategory: "Outbound",
8954
+ eventAction: "Click",
8955
+ eventLabel: (0, _format["default"])(label)
8956
+ };
8957
+ var safetyCallbackCalled = false;
8958
+
8959
+ var safetyCallback = function safetyCallback() {
8960
+ // This prevents a delayed response from GA
8961
+ // causing hitCallback from being fired twice
8962
+ safetyCallbackCalled = true;
8963
+ hitCallback();
8964
+ }; // Using a timeout to ensure the execution of critical application code
8965
+ // in the case when the GA server might be down
8966
+ // or an ad blocker prevents sending the data
8967
+ // register safety net timeout:
8968
+
8969
+
8970
+ var t = setTimeout(safetyCallback, 250);
8971
+
8972
+ var clearableCallbackForGA = function clearableCallbackForGA() {
8973
+ clearTimeout(t);
8974
+
8975
+ if (!safetyCallbackCalled) {
8976
+ hitCallback();
8977
+ }
8978
+ };
8979
+
8980
+ fieldObject.hitCallback = clearableCallbackForGA;
8981
+
8982
+ this._gaCommand("send", fieldObject);
8983
+ }
8984
+ }]);
8985
+
8986
+ return GA4;
8987
+ }();
8988
+
8989
+ exports.GA4 = GA4;
8990
+
8991
+ var _default = new GA4();
8992
+
8993
+ exports["default"] = _default;
8994
+ });
8995
+
8996
+ unwrapExports(ga4);
8997
+ ga4.GA4;
8998
+
8999
+ var dist = createCommonjsModule(function (module, exports) {
9000
+
9001
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
9002
+
9003
+ Object.defineProperty(exports, "__esModule", {
9004
+ value: true
9005
+ });
9006
+ exports["default"] = exports.ReactGAImplementation = void 0;
9007
+
9008
+ var _ga = _interopRequireWildcard(ga4);
9009
+
9010
+ 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); }
9011
+
9012
+ 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; }
9013
+
9014
+ var ReactGAImplementation = _ga.GA4;
9015
+ exports.ReactGAImplementation = ReactGAImplementation;
9016
+ var _default = _ga["default"];
9017
+ exports["default"] = _default;
9018
+ });
9019
+
9020
+ var ReactGA4 = unwrapExports(dist);
9021
+ dist.ReactGAImplementation;
9022
+
9023
+ var _window$f, _window$Pelcro$f, _window$Pelcro$uiSett$f;
9024
+ const ReactGA$f = (_window$f = window) !== null && _window$f !== void 0 && (_window$Pelcro$f = _window$f.Pelcro) !== null && _window$Pelcro$f !== void 0 && (_window$Pelcro$uiSett$f = _window$Pelcro$f.uiSettings) !== null && _window$Pelcro$uiSett$f !== void 0 && _window$Pelcro$uiSett$f.enableReactGA4 ? ReactGA4 : ReactGA1;
8246
9025
  class PelcroActions {
8247
9026
  constructor(storeSetter, storeGetter) {
8248
9027
  _defineProperty$3(this, "resetState", () => {
@@ -8477,7 +9256,7 @@ class PelcroActions {
8477
9256
  }
8478
9257
 
8479
9258
  window.Pelcro.user.logout();
8480
- ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
9259
+ ReactGA$f === null || ReactGA$f === void 0 ? void 0 : (_ReactGA$event = ReactGA$f.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$f, {
8481
9260
  category: "ACTIONS",
8482
9261
  action: "Logged out",
8483
9262
  nonInteraction: true
@@ -8727,6 +9506,8 @@ if (process.env.NODE_ENV === "development") {
8727
9506
  c$1("Pelcro Store", usePelcro);
8728
9507
  }
8729
9508
 
9509
+ var _window$e, _window$Pelcro$e, _window$Pelcro$uiSett$e;
9510
+ const ReactGA$e = (_window$e = window) !== null && _window$e !== void 0 && (_window$Pelcro$e = _window$e.Pelcro) !== null && _window$Pelcro$e !== void 0 && (_window$Pelcro$uiSett$e = _window$Pelcro$e.uiSettings) !== null && _window$Pelcro$uiSett$e !== void 0 && _window$Pelcro$uiSett$e.enableReactGA4 ? ReactGA4 : ReactGA1;
8730
9511
  /**
8731
9512
  * List of zero-decimal currencies.
8732
9513
  * @see https://stripe.com/docs/currencies#zero-decimal
@@ -8808,9 +9589,9 @@ const getLanguageWithoutRegion = localeName => {
8808
9589
  */
8809
9590
 
8810
9591
  const getPageOrDefaultLanguage = () => {
8811
- var _window$Pelcro$helper, _window$Pelcro, _window$Pelcro$site, _window$Pelcro$site$r, _window$Pelcro$site$r2;
9592
+ var _window$Pelcro$helper, _window$Pelcro2, _window$Pelcro2$site, _window$Pelcro2$site$, _window$Pelcro2$site$2;
8812
9593
 
8813
- return (_window$Pelcro$helper = window.Pelcro.helpers.getHtmlLanguageAttribute()) !== null && _window$Pelcro$helper !== void 0 ? _window$Pelcro$helper : getLanguageWithoutRegion((_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$site = _window$Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : (_window$Pelcro$site$r = _window$Pelcro$site.read) === null || _window$Pelcro$site$r === void 0 ? void 0 : (_window$Pelcro$site$r2 = _window$Pelcro$site$r.call(_window$Pelcro$site)) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.default_locale);
9594
+ 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);
8814
9595
  };
8815
9596
  /**
8816
9597
  * Returns a formatted price string depending on locale
@@ -8865,10 +9646,10 @@ const isValidViewFromURL = viewID => {
8865
9646
  */
8866
9647
 
8867
9648
  function hasValidNewsletterUpdateUrl() {
8868
- var _window$Pelcro2, _window$Pelcro2$uiSet;
9649
+ var _window$Pelcro3, _window$Pelcro3$uiSet;
8869
9650
 
8870
9651
  if (viewID !== "newsletter-update") return false;
8871
- 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;
9652
+ 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;
8872
9653
  const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
8873
9654
 
8874
9655
  if (!siteHasNewslettersDefined) {
@@ -8945,16 +9726,16 @@ const trackSubscriptionOnGA = () => {
8945
9726
  }
8946
9727
 
8947
9728
  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;
8948
- ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$set = ReactGA.set) === null || _ReactGA$set === void 0 ? void 0 : _ReactGA$set.call(ReactGA, {
9729
+ ReactGA$e === null || ReactGA$e === void 0 ? void 0 : (_ReactGA$set = ReactGA$e.set) === null || _ReactGA$set === void 0 ? void 0 : _ReactGA$set.call(ReactGA$e, {
8949
9730
  currencyCode: currencyCode
8950
9731
  });
8951
- 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", {
9732
+ ReactGA$e === null || ReactGA$e === void 0 ? void 0 : (_ReactGA$plugin = ReactGA$e.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", {
8952
9733
  id: lastSubscriptionId,
8953
9734
  affiliation: "Pelcro",
8954
9735
  revenue: plan !== null && plan !== void 0 && plan.amount ? isCurrencyZeroDecimal(currencyCode) ? plan.amount : plan.amount / 100 : 0,
8955
9736
  coupon: couponCode
8956
9737
  });
8957
- 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", {
9738
+ ReactGA$e === null || ReactGA$e === void 0 ? void 0 : (_ReactGA$plugin2 = ReactGA$e.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", {
8958
9739
  id: lastSubscriptionId,
8959
9740
  name: product.name,
8960
9741
  category: product.description,
@@ -8962,8 +9743,8 @@ const trackSubscriptionOnGA = () => {
8962
9743
  price: plan !== null && plan !== void 0 && plan.amount ? isCurrencyZeroDecimal(currencyCode) ? plan.amount : plan.amount / 100 : 0,
8963
9744
  quantity: 1
8964
9745
  });
8965
- 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");
8966
- ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
9746
+ ReactGA$e === null || ReactGA$e === void 0 ? void 0 : (_ReactGA$plugin3 = ReactGA$e.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");
9747
+ ReactGA$e === null || ReactGA$e === void 0 ? void 0 : (_ReactGA$event = ReactGA$e.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA$e, {
8967
9748
  category: "ACTIONS",
8968
9749
  action: "Subscribed",
8969
9750
  nonInteraction: true
@@ -9054,9 +9835,9 @@ function getDateWithoutTime(dateObject) {
9054
9835
  return date;
9055
9836
  }
9056
9837
  function userMustVerifyEmail() {
9057
- var _window$Pelcro$site$r3, _window$Pelcro$site$r4, _window$Pelcro$user$r9, _window$Pelcro$user$r10;
9838
+ var _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$user$r9, _window$Pelcro$user$r10;
9058
9839
 
9059
- const isEmailVerificationEnabled = (_window$Pelcro$site$r3 = (_window$Pelcro$site$r4 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r4 === void 0 ? void 0 : _window$Pelcro$site$r4.email_verify_enabled) !== null && _window$Pelcro$site$r3 !== void 0 ? _window$Pelcro$site$r3 : false;
9840
+ 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;
9060
9841
  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;
9061
9842
  return window.Pelcro.user.isAuthenticated() && isEmailVerificationEnabled && !isUserEmailVerified;
9062
9843
  }
@@ -9065,12 +9846,12 @@ function notifyBugsnag(callback, startOptions) {
9065
9846
  //load bugsnag CDN
9066
9847
  window.Pelcro.helpers.loadSDK("https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js", "bugsnag-cdn");
9067
9848
  document.querySelector('script[src="https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js"]').addEventListener("load", () => {
9068
- var _window$Pelcro$enviro, _window$Pelcro3, _window$Pelcro3$envir, _window$Pelcro4, _window$Pelcro4$envir;
9849
+ var _window$Pelcro$enviro, _window$Pelcro4, _window$Pelcro4$envir, _window$Pelcro5, _window$Pelcro5$envir;
9069
9850
 
9070
9851
  Bugsnag.start({
9071
- apiKey: (_window$Pelcro$enviro = (_window$Pelcro3 = window.Pelcro) === null || _window$Pelcro3 === void 0 ? void 0 : (_window$Pelcro3$envir = _window$Pelcro3.environment) === null || _window$Pelcro3$envir === void 0 ? void 0 : _window$Pelcro3$envir.bugsnagKey) !== null && _window$Pelcro$enviro !== void 0 ? _window$Pelcro$enviro : "e8f6852b322540e8c25386048b99ab01",
9852
+ 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",
9072
9853
  autoDetectErrors: false,
9073
- releaseStage: (_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.bugsnagReleaseStage,
9854
+ 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,
9074
9855
  redactedKeys: ["security_key", "password", "password_confirmation", "auth_token", "token"],
9075
9856
  ...startOptions
9076
9857
  });
@@ -9244,6 +10025,9 @@ function _classPrivateFieldGet(receiver, privateMap) {
9244
10025
  return descriptor.value;
9245
10026
  }
9246
10027
 
10028
+ var _window$d, _window$Pelcro$d, _window$Pelcro$uiSett$d;
10029
+ 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;
10030
+
9247
10031
  var _isAlreadySaved = /*#__PURE__*/new WeakMap();
9248
10032
 
9249
10033
  var _markButtonAsLoading = /*#__PURE__*/new WeakMap();
@@ -9402,7 +10186,7 @@ class SaveToMetadataButtonClass {
9402
10186
 
9403
10187
  _classPrivateFieldGet(this, _markButtonAsSaved).call(this, button);
9404
10188
 
9405
- ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
10189
+ 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, {
9406
10190
  category: "ACTIONS",
9407
10191
  action: "Save/Follow",
9408
10192
  label: buttonMetadata === null || buttonMetadata === void 0 ? void 0 : buttonMetadata.title
@@ -9440,7 +10224,7 @@ class SaveToMetadataButtonClass {
9440
10224
 
9441
10225
  _classPrivateFieldGet(this, _unmarkSavedButton).call(this, button);
9442
10226
 
9443
- ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event2 = ReactGA.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA, {
10227
+ ReactGA$d === null || ReactGA$d === void 0 ? void 0 : (_ReactGA$event2 = ReactGA$d.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA$d, {
9444
10228
  category: "ACTIONS",
9445
10229
  action: "Unsave/Unfollow",
9446
10230
  label: title
@@ -11174,6 +11958,8 @@ function getSiteCardProcessor() {
11174
11958
  return "stripe";
11175
11959
  }
11176
11960
 
11961
+ var _window$c, _window$Pelcro$c, _window$Pelcro$uiSett$c;
11962
+ 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;
11177
11963
  /**
11178
11964
  * @typedef {Object} OptionsType
11179
11965
  * @property {boolean} loadPaymentSDKs
@@ -11306,13 +12092,13 @@ const initSecuritySdk = () => {
11306
12092
  const initGATracking = () => {
11307
12093
  var _ReactGA$initialize, _ReactGA$plugin, _ReactGA$plugin$requi;
11308
12094
 
11309
- 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);
11310
- 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");
12095
+ ReactGA$c === null || ReactGA$c === void 0 ? void 0 : (_ReactGA$initialize = ReactGA$c.initialize) === null || _ReactGA$initialize === void 0 ? void 0 : _ReactGA$initialize.call(ReactGA$c, window.Pelcro.site.read().google_analytics_id);
12096
+ ReactGA$c === null || ReactGA$c === void 0 ? void 0 : (_ReactGA$plugin = ReactGA$c.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");
11311
12097
  };
11312
12098
  const dispatchModalDisplayEvents = modalName => {
11313
12099
  var _ReactGA$event, _modalName$replace, _modalName$replace2;
11314
12100
 
11315
- ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
12101
+ 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, {
11316
12102
  category: "VIEWS",
11317
12103
  action: `${modalName === null || modalName === void 0 ? void 0 : (_modalName$replace = modalName.replace("pelcro-", "")) === null || _modalName$replace === void 0 ? void 0 : _modalName$replace.replaceAll("-", " ")} viewed`,
11318
12104
  nonInteraction: true
@@ -12168,6 +12954,8 @@ const CANCEL_SUBSCRIPTION = "CANCEL_SUBSCRIPTION";
12168
12954
  const UNSUSPEND_SUBSCRIPTION = "UNSUSPEND_SUBSCRIPTION";
12169
12955
  const REACTIVATE_SUBSCRIPTION = "REACTIVATE_SUBSCRIPTION"; //========
12170
12956
 
12957
+ var _window$b, _window$Pelcro$b, _window$Pelcro$uiSett$b;
12958
+ 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;
12171
12959
  const initialState$n = {
12172
12960
  email: "",
12173
12961
  username: "",
@@ -12224,7 +13012,7 @@ const LoginContainer = ({
12224
13012
  var _ReactGA$event;
12225
13013
 
12226
13014
  onSuccess(res);
12227
- ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
13015
+ 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, {
12228
13016
  category: "ACTIONS",
12229
13017
  action: "Logged in",
12230
13018
  nonInteraction: true
@@ -12623,12 +13411,14 @@ function ConfirmPassword({
12623
13411
  }, otherProps));
12624
13412
  }
12625
13413
 
13414
+ var _window$a, _window$Pelcro$a, _window$Pelcro$uiSett$a;
13415
+ 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;
12626
13416
  const Logout = props => {
12627
13417
  const handleLogout = () => {
12628
13418
  var _ReactGA$event;
12629
13419
 
12630
13420
  window.Pelcro.user.logout();
12631
- ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
13421
+ 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, {
12632
13422
  category: "ACTIONS",
12633
13423
  action: "Logged out",
12634
13424
  nonInteraction: true
@@ -13576,6 +14366,10 @@ function Modal({
13576
14366
  children,
13577
14367
  ...props
13578
14368
  }) {
14369
+ useEffect(() => {
14370
+ onDisplay === null || onDisplay === void 0 ? void 0 : onDisplay();
14371
+ dispatchModalDisplayEvents(id);
14372
+ }, []);
13579
14373
  return /*#__PURE__*/React__default.createElement("div", {
13580
14374
  className: "pelcro-modal-overlay"
13581
14375
  }, /*#__PURE__*/React__default.createElement("div", Object.assign({
@@ -13607,10 +14401,6 @@ const ModalHeader = ({
13607
14401
  var _window$Pelcro, _window$Pelcro$site$r;
13608
14402
 
13609
14403
  const resetView = usePelcro(state => state.resetView);
13610
- useEffect(() => {
13611
- onDisplay === null || onDisplay === void 0 ? void 0 : onDisplay();
13612
- dispatchModalDisplayEvents(id);
13613
- }, []);
13614
14404
 
13615
14405
  const onClose = () => {
13616
14406
  var _props$onClose;
@@ -14076,6 +14866,8 @@ const RegisterCompany = props => {
14076
14866
  }, props));
14077
14867
  };
14078
14868
 
14869
+ var _window$9, _window$Pelcro$9, _window$Pelcro$uiSett$9;
14870
+ 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;
14079
14871
  /**
14080
14872
  *
14081
14873
  */
@@ -14108,7 +14900,7 @@ function RegisterModal(props) {
14108
14900
  const handleAfterRegistrationLogic = () => {
14109
14901
  var _ReactGA$event, _window$Pelcro$site$r, _window$Pelcro$site$r2;
14110
14902
 
14111
- ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
14903
+ 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, {
14112
14904
  category: "ACTIONS",
14113
14905
  action: "Registered",
14114
14906
  nonInteraction: true
@@ -18992,6 +19784,8 @@ function SvgArrowLeft(props) {
18992
19784
  })));
18993
19785
  }
18994
19786
 
19787
+ var _window$8, _window$Pelcro$8, _window$Pelcro$uiSett$8;
19788
+ 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;
18995
19789
  /**
18996
19790
  *
18997
19791
  */
@@ -19101,12 +19895,12 @@ class SelectModal extends Component {
19101
19895
  document.addEventListener("keydown", this.handleSubmit);
19102
19896
 
19103
19897
  if (!document.querySelector("#pelcro-selection-view") || !document.querySelector(".pelcro-select-product-wrapper")) {
19104
- var _window$Pelcro, _window$Pelcro$user, _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro3, _window$Pelcro3$user, _window$Pelcro4, _window$Pelcro4$site;
19898
+ var _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro3, _window$Pelcro3$user, _window$Pelcro4, _window$Pelcro4$user, _window$Pelcro5, _window$Pelcro5$site;
19105
19899
 
19106
- const userCurrency = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$user = _window$Pelcro.user) === null || _window$Pelcro$user === void 0 ? void 0 : _window$Pelcro$user.read().currency;
19107
- const userCountry = (_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.location.countryCode;
19108
- const userLanguage = (_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.read().language;
19109
- const productsMatchingUserCurrency = (_window$Pelcro4 = window.Pelcro) === null || _window$Pelcro4 === void 0 ? void 0 : (_window$Pelcro4$site = _window$Pelcro4.site) === null || _window$Pelcro4$site === void 0 ? void 0 : _window$Pelcro4$site.read().products.filter(product => {
19900
+ 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;
19901
+ 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;
19902
+ 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;
19903
+ 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 => {
19110
19904
  const filteredPlans = product.plans.filter(plan => plan.currency === userCurrency || !userCurrency);
19111
19905
  if (filteredPlans.length) return filteredPlans;
19112
19906
  });
@@ -19120,13 +19914,13 @@ class SelectModal extends Component {
19120
19914
  });
19121
19915
  notifyBugsnag(() => {
19122
19916
  Bugsnag.notify("SelectModal - No data viewed", event => {
19123
- var _window$Pelcro5, _window$Pelcro5$site, _window$Pelcro6, _window$Pelcro6$user, _window$Pelcro7, _window$Pelcro7$uiSet, _window$Pelcro8, _this$props, _window$Pelcro9, _window$Pelcro9$helpe, _window$Pelcro10, _window$Pelcro10$site;
19917
+ 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;
19124
19918
 
19125
19919
  event.addMetadata("MetaData", {
19126
- site: (_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(),
19127
- user: (_window$Pelcro6 = window.Pelcro) === null || _window$Pelcro6 === void 0 ? void 0 : (_window$Pelcro6$user = _window$Pelcro6.user) === null || _window$Pelcro6$user === void 0 ? void 0 : _window$Pelcro6$user.read(),
19128
- uiVersion: (_window$Pelcro7 = window.Pelcro) === null || _window$Pelcro7 === void 0 ? void 0 : (_window$Pelcro7$uiSet = _window$Pelcro7.uiSettings) === null || _window$Pelcro7$uiSet === void 0 ? void 0 : _window$Pelcro7$uiSet.uiVersion,
19129
- environment: (_window$Pelcro8 = window.Pelcro) === null || _window$Pelcro8 === void 0 ? void 0 : _window$Pelcro8.environment,
19920
+ 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(),
19921
+ 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(),
19922
+ 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,
19923
+ environment: (_window$Pelcro9 = window.Pelcro) === null || _window$Pelcro9 === void 0 ? void 0 : _window$Pelcro9.environment,
19130
19924
  matchingEntitlementsProps: (_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.matchingEntitlements,
19131
19925
  productListState: this.state.productList,
19132
19926
  methods: {
@@ -19137,8 +19931,8 @@ class SelectModal extends Component {
19137
19931
  userCurrency: userCurrency,
19138
19932
  userCountry: userCountry,
19139
19933
  userLanguage: userLanguage,
19140
- siteLanguage: (_window$Pelcro9 = window.Pelcro) === null || _window$Pelcro9 === void 0 ? void 0 : (_window$Pelcro9$helpe = _window$Pelcro9.helpers) === null || _window$Pelcro9$helpe === void 0 ? void 0 : _window$Pelcro9$helpe.getHtmlLanguageAttribute(),
19141
- products: (_window$Pelcro10 = window.Pelcro) === null || _window$Pelcro10 === void 0 ? void 0 : (_window$Pelcro10$site = _window$Pelcro10.site) === null || _window$Pelcro10$site === void 0 ? void 0 : _window$Pelcro10$site.read().products.length,
19934
+ 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(),
19935
+ 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,
19142
19936
  currency_matching_filter: `${productsMatchingUserCurrency.length} Products Passed`,
19143
19937
  country_matching_filter: `${productsMatchingUserCountry.length} Products Passed`,
19144
19938
  language_matching_filter: `${productsMatchingUserCountry.filter(productMatchPageLanguage).length} Products Passed`
@@ -19497,7 +20291,7 @@ class SelectModal extends Component {
19497
20291
  if (this.state.mode === "product") {
19498
20292
  var _ReactGA$event;
19499
20293
 
19500
- ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
20294
+ 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, {
19501
20295
  category: "VIEWS",
19502
20296
  action: "Product Modal Viewed",
19503
20297
  nonInteraction: true
@@ -19505,7 +20299,7 @@ class SelectModal extends Component {
19505
20299
  } else if (this.state.mode === "plan") {
19506
20300
  var _ReactGA$event2;
19507
20301
 
19508
- ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event2 = ReactGA.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA, {
20302
+ ReactGA$8 === null || ReactGA$8 === void 0 ? void 0 : (_ReactGA$event2 = ReactGA$8.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA$8, {
19509
20303
  category: "VIEWS",
19510
20304
  action: "Plan Modal Viewed",
19511
20305
  nonInteraction: true
@@ -24423,6 +25217,8 @@ const SubscriptionRenewView = ({
24423
25217
  }));
24424
25218
  };
24425
25219
 
25220
+ var _window$7, _window$Pelcro$7, _window$Pelcro$uiSett$7;
25221
+ 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;
24426
25222
  /**
24427
25223
  *
24428
25224
  */
@@ -24443,7 +25239,7 @@ function SubscriptionRenewModal({
24443
25239
  var _otherProps$onSuccess, _ReactGA$event;
24444
25240
 
24445
25241
  (_otherProps$onSuccess = otherProps.onSuccess) === null || _otherProps$onSuccess === void 0 ? void 0 : _otherProps$onSuccess.call(otherProps, res);
24446
- ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
25242
+ 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, {
24447
25243
  category: "ACTIONS",
24448
25244
  action: "Renewed",
24449
25245
  nonInteraction: true
@@ -24455,7 +25251,7 @@ function SubscriptionRenewModal({
24455
25251
  var _otherProps$onGiftRen, _ReactGA$event2;
24456
25252
 
24457
25253
  (_otherProps$onGiftRen = otherProps.onGiftRenewalSuccess) === null || _otherProps$onGiftRen === void 0 ? void 0 : _otherProps$onGiftRen.call(otherProps);
24458
- ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event2 = ReactGA.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA, {
25254
+ 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, {
24459
25255
  category: "ACTIONS",
24460
25256
  action: "Renewed Gift",
24461
25257
  nonInteraction: true
@@ -24639,6 +25435,8 @@ function SvgSubscription(props) {
24639
25435
  }))))));
24640
25436
  }
24641
25437
 
25438
+ var _window$6, _window$Pelcro$6, _window$Pelcro$uiSett$6;
25439
+ 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;
24642
25440
  const SubscriptionCancelNowButton = ({
24643
25441
  subscription,
24644
25442
  onClick,
@@ -24672,7 +25470,7 @@ const SubscriptionCancelNowButton = ({
24672
25470
  return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
24673
25471
  }
24674
25472
 
24675
- ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
25473
+ 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, {
24676
25474
  category: "ACTIONS",
24677
25475
  action: "Canceled",
24678
25476
  nonInteraction: true
@@ -24711,6 +25509,8 @@ const SubscriptionCancelNowButton = ({
24711
25509
  }, t("messages.cancelNow"));
24712
25510
  };
24713
25511
 
25512
+ var _window$5, _window$Pelcro$5, _window$Pelcro$uiSett$5;
25513
+ 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;
24714
25514
  const SubscriptionCancelLaterButton = ({
24715
25515
  subscription,
24716
25516
  onClick,
@@ -24744,7 +25544,7 @@ const SubscriptionCancelLaterButton = ({
24744
25544
  return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
24745
25545
  }
24746
25546
 
24747
- ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
25547
+ 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, {
24748
25548
  category: "ACTIONS",
24749
25549
  action: "Canceled",
24750
25550
  nonInteraction: true
@@ -24959,6 +25759,8 @@ const SubscriptionSuspendDate = props => {
24959
25759
  }, props));
24960
25760
  };
24961
25761
 
25762
+ var _window$4, _window$Pelcro$4, _window$Pelcro$uiSett$4;
25763
+ 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;
24962
25764
  const SubscriptionSuspendButton = ({
24963
25765
  subscription,
24964
25766
  onClick,
@@ -24991,7 +25793,7 @@ const SubscriptionSuspendButton = ({
24991
25793
  return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
24992
25794
  }
24993
25795
 
24994
- ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
25796
+ 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, {
24995
25797
  category: "ACTIONS",
24996
25798
  action: "Suspended",
24997
25799
  nonInteraction: true
@@ -27848,6 +28650,8 @@ const AddressCreateLine2 = props => {
27848
28650
  }, props));
27849
28651
  };
27850
28652
 
28653
+ var _window$3, _window$Pelcro$3, _window$Pelcro$uiSett$3;
28654
+ 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;
27851
28655
  const initialState$e = {
27852
28656
  isSubmitting: false,
27853
28657
  firstName: "",
@@ -27997,7 +28801,7 @@ const AddressUpdateContainer = ({
27997
28801
  }
27998
28802
  });
27999
28803
  onSuccess(res);
28000
- ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
28804
+ 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, {
28001
28805
  category: "ACTIONS",
28002
28806
  action: "Updated address",
28003
28807
  nonInteraction: true
@@ -28544,6 +29348,8 @@ function PaymentMethodUpdateView(props) {
28544
29348
  }));
28545
29349
  }
28546
29350
 
29351
+ var _window$2, _window$Pelcro$2, _window$Pelcro$uiSett$2;
29352
+ 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;
28547
29353
  const PaymentMethodUpdateModal = props => {
28548
29354
  const {
28549
29355
  t
@@ -28553,7 +29359,7 @@ const PaymentMethodUpdateModal = props => {
28553
29359
  var _props$onSuccess, _ReactGA$event;
28554
29360
 
28555
29361
  (_props$onSuccess = props.onSuccess) === null || _props$onSuccess === void 0 ? void 0 : _props$onSuccess.call(props, res);
28556
- ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
29362
+ 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, {
28557
29363
  category: "ACTIONS",
28558
29364
  action: "Updated payment card",
28559
29365
  nonInteraction: true
@@ -31310,7 +32116,8 @@ const PaymentMethodSelectModal = ({
31310
32116
  };
31311
32117
  PaymentMethodSelectModal.viewId = "payment-method-select";
31312
32118
 
31313
- var _window$Pelcro$user$r, _window$Pelcro$user$r2;
32119
+ var _window$1, _window$Pelcro$1, _window$Pelcro$uiSett$1, _window$Pelcro$user$r, _window$Pelcro$user$r2;
32120
+ 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;
31314
32121
  const initialState$4 = {
31315
32122
  isOpen: false,
31316
32123
  activeDashboardLink: null,
@@ -31344,7 +32151,7 @@ const DashboardContainer = ({
31344
32151
  window.Pelcro.insight.track("Modal Displayed", {
31345
32152
  name: "dashboard"
31346
32153
  });
31347
- ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event = ReactGA.event) === null || _ReactGA$event === void 0 ? void 0 : _ReactGA$event.call(ReactGA, {
32154
+ 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, {
31348
32155
  category: "VIEWS",
31349
32156
  action: "Dashboard Modal Viewed",
31350
32157
  nonInteraction: true
@@ -31359,9 +32166,9 @@ const DashboardContainer = ({
31359
32166
  return () => {};
31360
32167
  }, []);
31361
32168
  /**
31362
- *
31363
- * @param {*} payload
31364
- * @param {*} dispatch
32169
+ *
32170
+ * @param {*} payload
32171
+ * @param {*} dispatch
31365
32172
  */
31366
32173
 
31367
32174
  const cancelSubscription = ({
@@ -31384,7 +32191,7 @@ const DashboardContainer = ({
31384
32191
  return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
31385
32192
  }
31386
32193
 
31387
- ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event2 = ReactGA.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA, {
32194
+ ReactGA$1 === null || ReactGA$1 === void 0 ? void 0 : (_ReactGA$event2 = ReactGA$1.event) === null || _ReactGA$event2 === void 0 ? void 0 : _ReactGA$event2.call(ReactGA$1, {
31388
32195
  category: "ACTIONS",
31389
32196
  action: "Canceled",
31390
32197
  nonInteraction: true
@@ -31393,9 +32200,9 @@ const DashboardContainer = ({
31393
32200
  });
31394
32201
  };
31395
32202
  /**
31396
- *
31397
- * @param {*} payload
31398
- * @param {*} dispatch
32203
+ *
32204
+ * @param {*} payload
32205
+ * @param {*} dispatch
31399
32206
  */
31400
32207
 
31401
32208
 
@@ -31420,7 +32227,7 @@ const DashboardContainer = ({
31420
32227
  return onFailure === null || onFailure === void 0 ? void 0 : onFailure(err);
31421
32228
  }
31422
32229
 
31423
- ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$event3 = ReactGA.event) === null || _ReactGA$event3 === void 0 ? void 0 : _ReactGA$event3.call(ReactGA, {
32230
+ ReactGA$1 === null || ReactGA$1 === void 0 ? void 0 : (_ReactGA$event3 = ReactGA$1.event) === null || _ReactGA$event3 === void 0 ? void 0 : _ReactGA$event3.call(ReactGA$1, {
31424
32231
  category: "ACTIONS",
31425
32232
  action: "UnSuspended",
31426
32233
  nonInteraction: true
@@ -31429,9 +32236,9 @@ const DashboardContainer = ({
31429
32236
  });
31430
32237
  };
31431
32238
  /**
31432
- *
31433
- * @param {*} payload
31434
- * @param {*} dispatch
32239
+ *
32240
+ * @param {*} payload
32241
+ * @param {*} dispatch
31435
32242
  */
31436
32243
 
31437
32244
 
@@ -32674,6 +33481,8 @@ const Card = ({
32674
33481
  })), children);
32675
33482
  };
32676
33483
 
33484
+ var _window, _window$Pelcro, _window$Pelcro$uiSett;
33485
+ 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;
32677
33486
  const SavedItemsMenu = () => {
32678
33487
  const {
32679
33488
  t