@pelcro/react-pelcro-js 2.4.0-beta.8 → 2.6.0-beta.1

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
@@ -3432,6 +3432,7 @@ var paymentMethod_fr = {
3432
3432
  };
3433
3433
 
3434
3434
  var title$d = "Enter your email to subscribe to our newsletter";
3435
+ var updateTitle$1 = "Update newsletter selections";
3435
3436
  var subtitle$7 = "We may use your email for other marketing communication";
3436
3437
  var labels$l = {
3437
3438
  submit: "Submit",
@@ -3443,22 +3444,21 @@ var labels$l = {
3443
3444
  };
3444
3445
  var messages$p = {
3445
3446
  alreadyHaveAccount: "Already have an account?",
3447
+ success: "Newsletters were successfully updated",
3446
3448
  loginHere: "Login here.",
3447
3449
  createAnAccount: " Create an account by clicking ",
3448
3450
  here: "here"
3449
3451
  };
3450
- var errors$b = {
3451
- "": ""
3452
- };
3453
3452
  var newsletter_en = {
3454
3453
  title: title$d,
3454
+ updateTitle: updateTitle$1,
3455
3455
  subtitle: subtitle$7,
3456
3456
  labels: labels$l,
3457
- messages: messages$p,
3458
- errors: errors$b
3457
+ messages: messages$p
3459
3458
  };
3460
3459
 
3461
3460
  var title$c = "Entrez votre adresse courriel pour vous abonner à notre infolettre";
3461
+ var updateTitle = "Mettre à jour son choix d'infolettres";
3462
3462
  var subtitle$6 = "Nous pouvons utiliser votre adresse courriel pour d’autres communications marketing";
3463
3463
  var labels$k = {
3464
3464
  submit: "Lire l’article !",
@@ -3470,19 +3470,17 @@ var labels$k = {
3470
3470
  };
3471
3471
  var messages$o = {
3472
3472
  alreadyHaveAccount: "Vous avez déjà un compte ?",
3473
+ success: "Votre choix d'infolettres à été mis à jour",
3473
3474
  loginHere: "Connectez-vous ici",
3474
3475
  createAnAccount: " Créez un compte en cliquant ",
3475
3476
  here: "ici"
3476
3477
  };
3477
- var errors$a = {
3478
- "": ""
3479
- };
3480
3478
  var newsletter_fr = {
3481
3479
  title: title$c,
3480
+ updateTitle: updateTitle,
3482
3481
  subtitle: subtitle$6,
3483
3482
  labels: labels$k,
3484
- messages: messages$o,
3485
- errors: errors$a
3483
+ messages: messages$o
3486
3484
  };
3487
3485
 
3488
3486
  var labels$j = {
@@ -3499,7 +3497,7 @@ var messages$n = {
3499
3497
  },
3500
3498
  giftCreate: {
3501
3499
  title: "Your gift has been sent",
3502
- content: "The gift will be sent to {{email}} on the date you specified."
3500
+ content: "Your recipient will receive an email with instructions to redeem their gift soon."
3503
3501
  },
3504
3502
  giftRedeem: {
3505
3503
  title: "Congratulations",
@@ -3529,7 +3527,7 @@ var messages$m = {
3529
3527
  },
3530
3528
  giftCreate: {
3531
3529
  title: "Votre cadeau a été envoyé",
3532
- content: "Le cadeau dabonnement a été envoyé à {{email}} avec succès."
3530
+ content: "Le cadeau d'abonnement a été envoyé avec succès."
3533
3531
  },
3534
3532
  giftRedeem: {
3535
3533
  title: "Félicitations",
@@ -3591,7 +3589,8 @@ var labels$h = {
3591
3589
  code: "Coupon code",
3592
3590
  "for": "for",
3593
3591
  interval: "{{count}} {{interval}}",
3594
- interval_plural: "{{count}} {{interval}}s"
3592
+ interval_plural: "{{count}} {{interval}}s",
3593
+ tax: "+ Tax"
3595
3594
  };
3596
3595
  var checkoutForm_en = {
3597
3596
  messages: messages$j,
@@ -3616,7 +3615,8 @@ var labels$g = {
3616
3615
  code: "Code promo",
3617
3616
  "for": "pour",
3618
3617
  interval: "{{count}} {{interval}}",
3619
- interval_plural: "{{count}} {{interval}}s"
3618
+ interval_plural: "{{count}} {{interval}}s",
3619
+ tax: "+ Taxe"
3620
3620
  };
3621
3621
  var checkoutForm_fr = {
3622
3622
  messages: messages$i,
@@ -4345,6 +4345,7 @@ var labels$3 = {
4345
4345
  profile: "Profile",
4346
4346
  updateProfile: "Edit profile",
4347
4347
  changePassword: "Change password",
4348
+ editNewsletters: "Edit newsletters",
4348
4349
  edit: "Edit",
4349
4350
  gifts: "Gifts",
4350
4351
  redeemGift: "Redeem gift",
@@ -4375,6 +4376,9 @@ var labels$3 = {
4375
4376
  categories: "Categories",
4376
4377
  details: "Details",
4377
4378
  removeItem: "Remove"
4379
+ },
4380
+ subCancellation: {
4381
+ goBack: "Go back"
4378
4382
  }
4379
4383
  };
4380
4384
  var messages$3 = {
@@ -4418,6 +4422,7 @@ var labels$2 = {
4418
4422
  profile: "Profil",
4419
4423
  updateProfile: "Mettre à jour le profil",
4420
4424
  changePassword: "Changer le mot de passe",
4425
+ editNewsletters: "Modifier les newsletters",
4421
4426
  edit: "Modifier",
4422
4427
  gifts: "Cadeaux",
4423
4428
  redeemGift: "Échanger un cadeau",
@@ -4448,6 +4453,9 @@ var labels$2 = {
4448
4453
  categories: "Catégories",
4449
4454
  details: "Détails",
4450
4455
  removeItem: "Retirer"
4456
+ },
4457
+ subCancellation: {
4458
+ goBack: "Retourner"
4451
4459
  }
4452
4460
  };
4453
4461
  var messages$2 = {
@@ -5891,7 +5899,7 @@ class PelcroActions {
5891
5899
  view,
5892
5900
  cartItems,
5893
5901
  ...otherStateFields
5894
- } = initialState$f;
5902
+ } = initialState$g;
5895
5903
  this.set(otherStateFields);
5896
5904
  });
5897
5905
 
@@ -6181,7 +6189,7 @@ class PelcroCallbacks {
6181
6189
 
6182
6190
  }
6183
6191
 
6184
- const initialState$f = {
6192
+ const initialState$g = {
6185
6193
  // View
6186
6194
  view: null,
6187
6195
  // Plans
@@ -6209,7 +6217,7 @@ const createPelcroStore = () => createStore(middleware_3((set, get) => {
6209
6217
  return {
6210
6218
  // Store setter
6211
6219
  set,
6212
- ...initialState$f,
6220
+ ...initialState$g,
6213
6221
  // State actions
6214
6222
  ...actions,
6215
6223
  // Callbacks
@@ -6340,11 +6348,40 @@ const calcAndFormatItemsTotal = (items, currency) => {
6340
6348
  */
6341
6349
 
6342
6350
  const isValidViewFromURL = viewID => {
6343
- if (["login", "register", "plan-select", "gift-redeem", "password-forgot", "password-reset", "password-change", "payment-method-update", "user-edit", "newsletter", "address-create", "order-create", "cart"].includes(viewID)) {
6351
+ if (["login", "register", "plan-select", "gift-redeem", "password-forgot", "password-reset", "password-change", "payment-method-update", "user-edit", "newsletter", "address-create", "order-create", "cart"].includes(viewID) || hasValidNewsletterUpdateUrl()) {
6344
6352
  return true;
6345
6353
  }
6346
6354
 
6347
6355
  return false;
6356
+
6357
+ function hasValidNewsletterUpdateUrl() {
6358
+ var _window$Pelcro, _window$Pelcro$uiSett;
6359
+
6360
+ if (viewID !== "newsletter-update") return false;
6361
+ const newsletters = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.newsletters;
6362
+ const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
6363
+
6364
+ if (!siteHasNewslettersDefined) {
6365
+ return false;
6366
+ }
6367
+
6368
+ const queryParamEmail = window.Pelcro.helpers.getURLParameter("email");
6369
+
6370
+ if (queryParamEmail && window.Pelcro.user.isAuthenticated()) {
6371
+ var _window$Pelcro$user$r4;
6372
+
6373
+ if (queryParamEmail !== ((_window$Pelcro$user$r4 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r4 === void 0 ? void 0 : _window$Pelcro$user$r4.email)) {
6374
+ console.error("email query parameter and user account email are different, url email query parameter must match user email if user is logged in");
6375
+ return false;
6376
+ }
6377
+ }
6378
+
6379
+ if (!queryParamEmail && !window.Pelcro.user.isAuthenticated()) {
6380
+ return false;
6381
+ }
6382
+
6383
+ return true;
6384
+ }
6348
6385
  };
6349
6386
  /**
6350
6387
  * Returns the current stable viewID from all old variations
@@ -6376,7 +6413,7 @@ const disableScroll = () => {
6376
6413
  }
6377
6414
  };
6378
6415
  const trackSubscriptionOnGA = () => {
6379
- var _ReactGA$set, _window$Pelcro$user$r4, _window$Pelcro$user$r5, _ReactGA$plugin, _ReactGA$plugin$execu, _ReactGA$plugin2, _ReactGA$plugin2$exec, _ReactGA$plugin3, _ReactGA$plugin3$exec, _ReactGA$event;
6416
+ var _ReactGA$set, _window$Pelcro$user$r5, _window$Pelcro$user$r6, _ReactGA$plugin, _ReactGA$plugin$execu, _ReactGA$plugin2, _ReactGA$plugin2$exec, _ReactGA$plugin3, _ReactGA$plugin3$exec, _ReactGA$event;
6380
6417
 
6381
6418
  const {
6382
6419
  product,
@@ -6398,7 +6435,7 @@ const trackSubscriptionOnGA = () => {
6398
6435
  }
6399
6436
 
6400
6437
  ReactGA === null || ReactGA === void 0 ? void 0 : (_ReactGA$set = ReactGA.set) === null || _ReactGA$set === void 0 ? void 0 : _ReactGA$set.call(ReactGA, {
6401
- currencyCode: (_window$Pelcro$user$r4 = (_window$Pelcro$user$r5 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r5 === void 0 ? void 0 : _window$Pelcro$user$r5.currency) !== null && _window$Pelcro$user$r4 !== void 0 ? _window$Pelcro$user$r4 : plan.currency
6438
+ 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
6402
6439
  });
6403
6440
  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", {
6404
6441
  id: lastSubscriptionId,
@@ -6426,9 +6463,9 @@ const trackSubscriptionOnGA = () => {
6426
6463
  */
6427
6464
 
6428
6465
  const userHasPaymentMethod = () => {
6429
- var _window$Pelcro$user$r6, _window$Pelcro$user$r7;
6466
+ var _window$Pelcro$user$r7, _window$Pelcro$user$r8;
6430
6467
 
6431
- const sources = (_window$Pelcro$user$r6 = (_window$Pelcro$user$r7 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r7 === void 0 ? void 0 : _window$Pelcro$user$r7.sources) !== null && _window$Pelcro$user$r6 !== void 0 ? _window$Pelcro$user$r6 : [];
6468
+ const sources = (_window$Pelcro$user$r7 = (_window$Pelcro$user$r8 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r8 === void 0 ? void 0 : _window$Pelcro$user$r8.sources) !== null && _window$Pelcro$user$r7 !== void 0 ? _window$Pelcro$user$r7 : [];
6432
6469
  return sources.length > 0;
6433
6470
  };
6434
6471
  /**
@@ -6810,8 +6847,8 @@ const saveToMetadataButton = new SaveToMetadataButtonClass();
6810
6847
 
6811
6848
  let e={data:""},t=t=>"undefined"!=typeof window?((t?t.querySelector("#_goober"):window._goober)||Object.assign((t||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:t||e,l=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(})/g,a=/\/\*[^]*?\*\/|\s\s+|\n/g,n=(e,t)=>{let r,l="",a="",o="";for(let c in e){let s=e[c];"object"==typeof s?(r=t?t.replace(/([^,])+/g,e=>c.replace(/([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):c,a+="@"==c[0]?"f"==c[1]?n(s,c):c+"{"+n(s,"k"==c[1]?"":t)+"}":n(s,r)):"@"==c[0]&&"i"==c[1]?l=c+" "+s+";":(c=c.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=n.p?n.p(c,s):c+":"+s+";");}return o[0]?(r=t?t+"{"+o+"}":o,l+r+a):l+a},o={},c=e=>{let t="";for(let r in e)t+=r+("object"==typeof e[r]?c(e[r]):e[r]);return t},s=(e,t,r,s,i)=>{let p="object"==typeof e?c(e):e,u=o[p]||(o[p]=(e=>{let t=0,r=11;for(;t<e.length;)r=101*r+e.charCodeAt(t++)>>>0;return "go"+r})(p));if(!o[u]){let t="object"==typeof e?e:(e=>{let t,r=[{}];for(;t=l.exec(e.replace(a,""));)t[4]&&r.shift(),t[3]?r.unshift(r[0][t[3]]=r[0][t[3]]||{}):t[4]||(r[0][t[1]]=t[2]);return r[0]})(e);o[u]=n(i?{["@keyframes "+u]:t}:t,r?"":"."+u);}return ((e,t,r)=>{-1==t.data.indexOf(e)&&(t.data=r?e+t.data:t.data+e);})(o[u],t,s),u},i=(e,t,r)=>e.reduce((e,l,a)=>{let o=t[a];if(o&&o.call){let e=o(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;o=t?"."+t:e&&"object"==typeof e?e.props?"":n(e,""):e;}return e+l+(null==o?"":o)},"");function p(e){let r=this||{},l=e.call?e(r.p):e;return s(l.unshift?l.raw?i(l,[].slice.call(arguments,1),r.p):l.reduce((e,t)=>t?Object.assign(e,t.call?t(r.p):t):e,{}):l,t(r.target),r.g,r.o,r.k)}let u,f,d;p.bind({g:1});let b=p.bind({k:1});function h(e,t,r,l){n.p=t,u=e,f=r,d=l;}function y(e,t){let r=this||{};return function(){let l=arguments;function a(n,o){let c=Object.assign({},n),s=c.className||a.className;r.p=Object.assign({theme:f&&f()},c),r.o=/ *go\d+/.test(s),c.className=p.apply(r,l)+(s?" "+s:""),t&&(c.ref=o);let i=c.as||e;return d&&i[0]&&d(c),u(i,c)}return t?t(a):a}}
6812
6849
 
6813
- function _extends$t() {
6814
- _extends$t = Object.assign || function (target) {
6850
+ function _extends$u() {
6851
+ _extends$u = Object.assign || function (target) {
6815
6852
  for (var i = 1; i < arguments.length; i++) {
6816
6853
  var source = arguments[i];
6817
6854
 
@@ -6825,7 +6862,7 @@ function _extends$t() {
6825
6862
  return target;
6826
6863
  };
6827
6864
 
6828
- return _extends$t.apply(this, arguments);
6865
+ return _extends$u.apply(this, arguments);
6829
6866
  }
6830
6867
 
6831
6868
  function _taggedTemplateLiteralLoose(strings, raw) {
@@ -6915,7 +6952,7 @@ var clearFromRemoveQueue = function clearFromRemoveQueue(toastId) {
6915
6952
  var reducer = function reducer(state, action) {
6916
6953
  switch (action.type) {
6917
6954
  case ActionType.ADD_TOAST:
6918
- return _extends$t({}, state, {
6955
+ return _extends$u({}, state, {
6919
6956
  toasts: [action.toast].concat(state.toasts).slice(0, TOAST_LIMIT)
6920
6957
  });
6921
6958
 
@@ -6925,9 +6962,9 @@ var reducer = function reducer(state, action) {
6925
6962
  clearFromRemoveQueue(action.toast.id);
6926
6963
  }
6927
6964
 
6928
- return _extends$t({}, state, {
6965
+ return _extends$u({}, state, {
6929
6966
  toasts: state.toasts.map(function (t) {
6930
- return t.id === action.toast.id ? _extends$t({}, t, action.toast) : t;
6967
+ return t.id === action.toast.id ? _extends$u({}, t, action.toast) : t;
6931
6968
  })
6932
6969
  });
6933
6970
 
@@ -6954,9 +6991,9 @@ var reducer = function reducer(state, action) {
6954
6991
  });
6955
6992
  }
6956
6993
 
6957
- return _extends$t({}, state, {
6994
+ return _extends$u({}, state, {
6958
6995
  toasts: state.toasts.map(function (t) {
6959
- return t.id === toastId || toastId === undefined ? _extends$t({}, t, {
6996
+ return t.id === toastId || toastId === undefined ? _extends$u({}, t, {
6960
6997
  visible: false
6961
6998
  }) : t;
6962
6999
  })
@@ -6964,28 +7001,28 @@ var reducer = function reducer(state, action) {
6964
7001
 
6965
7002
  case ActionType.REMOVE_TOAST:
6966
7003
  if (action.toastId === undefined) {
6967
- return _extends$t({}, state, {
7004
+ return _extends$u({}, state, {
6968
7005
  toasts: []
6969
7006
  });
6970
7007
  }
6971
7008
 
6972
- return _extends$t({}, state, {
7009
+ return _extends$u({}, state, {
6973
7010
  toasts: state.toasts.filter(function (t) {
6974
7011
  return t.id !== action.toastId;
6975
7012
  })
6976
7013
  });
6977
7014
 
6978
7015
  case ActionType.START_PAUSE:
6979
- return _extends$t({}, state, {
7016
+ return _extends$u({}, state, {
6980
7017
  pausedAt: action.time
6981
7018
  });
6982
7019
 
6983
7020
  case ActionType.END_PAUSE:
6984
7021
  var diff = action.time - (state.pausedAt || 0);
6985
- return _extends$t({}, state, {
7022
+ return _extends$u({}, state, {
6986
7023
  pausedAt: undefined,
6987
7024
  toasts: state.toasts.map(function (t) {
6988
- return _extends$t({}, t, {
7025
+ return _extends$u({}, t, {
6989
7026
  pauseDuration: t.pauseDuration + diff
6990
7027
  });
6991
7028
  })
@@ -7032,12 +7069,12 @@ var useStore = function useStore(toastOptions) {
7032
7069
  var mergedToasts = state.toasts.map(function (t) {
7033
7070
  var _toastOptions$t$type, _toastOptions, _toastOptions$t$type2;
7034
7071
 
7035
- return _extends$t({}, toastOptions, toastOptions[t.type], t, {
7072
+ return _extends$u({}, toastOptions, toastOptions[t.type], t, {
7036
7073
  duration: t.duration || ((_toastOptions$t$type = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type.duration) || ((_toastOptions = toastOptions) == null ? void 0 : _toastOptions.duration) || defaultTimeouts[t.type],
7037
- style: _extends$t({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7074
+ style: _extends$u({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7038
7075
  });
7039
7076
  });
7040
- return _extends$t({}, state, {
7077
+ return _extends$u({}, state, {
7041
7078
  toasts: mergedToasts
7042
7079
  });
7043
7080
  };
@@ -7047,7 +7084,7 @@ var createToast = function createToast(message, type, opts) {
7047
7084
  type = 'blank';
7048
7085
  }
7049
7086
 
7050
- return _extends$t({
7087
+ return _extends$u({
7051
7088
  createdAt: Date.now(),
7052
7089
  visible: true,
7053
7090
  type: type,
@@ -7097,14 +7134,14 @@ toast.remove = function (toastId) {
7097
7134
  };
7098
7135
 
7099
7136
  toast.promise = function (promise, msgs, opts) {
7100
- var id = toast.loading(msgs.loading, _extends$t({}, opts, opts == null ? void 0 : opts.loading));
7137
+ var id = toast.loading(msgs.loading, _extends$u({}, opts, opts == null ? void 0 : opts.loading));
7101
7138
  promise.then(function (p) {
7102
- toast.success(resolveValue(msgs.success, p), _extends$t({
7139
+ toast.success(resolveValue(msgs.success, p), _extends$u({
7103
7140
  id: id
7104
7141
  }, opts, opts == null ? void 0 : opts.success));
7105
7142
  return p;
7106
7143
  })["catch"](function (e) {
7107
- toast.error(resolveValue(msgs.error, e), _extends$t({
7144
+ toast.error(resolveValue(msgs.error, e), _extends$u({
7108
7145
  id: id
7109
7146
  }, opts, opts == null ? void 0 : opts.error));
7110
7147
  });
@@ -7443,7 +7480,7 @@ var ToastBar = /*#__PURE__*/memo(function (_ref2) {
7443
7480
  var message = createElement(Message, Object.assign({}, toast.ariaProps), resolveValue(toast.message, toast));
7444
7481
  return createElement(ToastBarBase, {
7445
7482
  className: toast.className,
7446
- style: _extends$t({}, animationStyle, style, toast.style)
7483
+ style: _extends$u({}, animationStyle, style, toast.style)
7447
7484
  }, typeof children === 'function' ? children({
7448
7485
  icon: icon,
7449
7486
  message: message
@@ -7473,7 +7510,7 @@ var getPositionStyle = function getPositionStyle(position, offset) {
7473
7510
  } : position.includes('right') ? {
7474
7511
  justifyContent: 'flex-end'
7475
7512
  } : {};
7476
- return _extends$t({
7513
+ return _extends$u({
7477
7514
  left: 0,
7478
7515
  right: 0,
7479
7516
  display: 'flex',
@@ -7500,7 +7537,7 @@ var Toaster = function Toaster(_ref) {
7500
7537
  handlers = _useToaster.handlers;
7501
7538
 
7502
7539
  return createElement("div", {
7503
- style: _extends$t({
7540
+ style: _extends$u({
7504
7541
  position: 'fixed',
7505
7542
  zIndex: 9999,
7506
7543
  top: DEFAULT_OFFSET,
@@ -7535,82 +7572,82 @@ var Toaster = function Toaster(_ref) {
7535
7572
  }));
7536
7573
  };
7537
7574
 
7538
- var _path$q;
7575
+ var _path$r;
7539
7576
 
7540
- function _extends$s() { _extends$s = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$s.apply(this, arguments); }
7577
+ function _extends$t() { _extends$t = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$t.apply(this, arguments); }
7541
7578
 
7542
7579
  function SvgCheckSolid(props) {
7543
- return /*#__PURE__*/React.createElement("svg", _extends$s({
7580
+ return /*#__PURE__*/React.createElement("svg", _extends$t({
7544
7581
  xmlns: "http://www.w3.org/2000/svg",
7545
7582
  className: "h-5 w-5",
7546
7583
  viewBox: "0 0 20 20",
7547
7584
  fill: "currentColor"
7548
- }, props), _path$q || (_path$q = /*#__PURE__*/React.createElement("path", {
7585
+ }, props), _path$r || (_path$r = /*#__PURE__*/React.createElement("path", {
7549
7586
  fillRule: "evenodd",
7550
7587
  d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
7551
7588
  clipRule: "evenodd"
7552
7589
  })));
7553
7590
  }
7554
7591
 
7555
- var _path$p;
7592
+ var _path$q;
7556
7593
 
7557
- function _extends$r() { _extends$r = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$r.apply(this, arguments); }
7594
+ function _extends$s() { _extends$s = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$s.apply(this, arguments); }
7558
7595
 
7559
7596
  function SvgXIcon(props) {
7560
- return /*#__PURE__*/React.createElement("svg", _extends$r({
7597
+ return /*#__PURE__*/React.createElement("svg", _extends$s({
7561
7598
  xmlns: "http://www.w3.org/2000/svg",
7562
7599
  viewBox: "0 0 20 20",
7563
7600
  fill: "currentColor"
7564
- }, props), _path$p || (_path$p = /*#__PURE__*/React.createElement("path", {
7601
+ }, props), _path$q || (_path$q = /*#__PURE__*/React.createElement("path", {
7565
7602
  fill: "evenodd",
7566
7603
  d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
7567
7604
  clipRule: "evenodd"
7568
7605
  })));
7569
7606
  }
7570
7607
 
7571
- var _path$o;
7608
+ var _path$p;
7572
7609
 
7573
- function _extends$q() { _extends$q = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$q.apply(this, arguments); }
7610
+ function _extends$r() { _extends$r = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$r.apply(this, arguments); }
7574
7611
 
7575
7612
  function SvgXIconSolid(props) {
7576
- return /*#__PURE__*/React.createElement("svg", _extends$q({
7613
+ return /*#__PURE__*/React.createElement("svg", _extends$r({
7577
7614
  className: "plc-w-4 plc-h-4",
7578
7615
  fill: "currentColor",
7579
7616
  xmlns: "http://www.w3.org/2000/svg",
7580
7617
  viewBox: "0 0 100 100"
7581
- }, props), _path$o || (_path$o = /*#__PURE__*/React.createElement("path", {
7618
+ }, props), _path$p || (_path$p = /*#__PURE__*/React.createElement("path", {
7582
7619
  d: "M94.842 48.408c0 24.852-20.148 44.999-45.002 44.999-24.851 0-44.997-20.146-44.997-44.999 0-24.854 20.146-45 44.997-45 24.853 0 45.002 20.146 45.002 45zM71.073 64.841L54.73 48.497l16.344-16.344-4.979-4.979-16.343 16.345-16.343-16.344-4.799 4.799 16.344 16.344L28.61 64.661l4.979 4.978 16.344-16.344 16.343 16.344 4.797-4.798z"
7583
7620
  })));
7584
7621
  }
7585
7622
 
7586
- var _path$n;
7623
+ var _path$o;
7587
7624
 
7588
- function _extends$p() { _extends$p = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$p.apply(this, arguments); }
7625
+ function _extends$q() { _extends$q = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$q.apply(this, arguments); }
7589
7626
 
7590
7627
  function SvgExclamation(props) {
7591
- return /*#__PURE__*/React.createElement("svg", _extends$p({
7628
+ return /*#__PURE__*/React.createElement("svg", _extends$q({
7592
7629
  className: "plc-w-4 plc-h-4 plc-mr-1",
7593
7630
  xmlns: "http://www.w3.org/2000/svg",
7594
7631
  viewBox: "0 0 20 20",
7595
7632
  fill: "currentColor"
7596
- }, props), _path$n || (_path$n = /*#__PURE__*/React.createElement("path", {
7633
+ }, props), _path$o || (_path$o = /*#__PURE__*/React.createElement("path", {
7597
7634
  fillRule: "evenodd",
7598
7635
  d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7 4a1 1 0 11-2 0 1 1 0 012 0zm-1-9a1 1 0 00-1 1v4a1 1 0 102 0V6a1 1 0 00-1-1z",
7599
7636
  clipRule: "evenodd"
7600
7637
  })));
7601
7638
  }
7602
7639
 
7603
- var _path$m, _path2$3;
7640
+ var _path$n, _path2$3;
7604
7641
 
7605
- function _extends$o() { _extends$o = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$o.apply(this, arguments); }
7642
+ function _extends$p() { _extends$p = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$p.apply(this, arguments); }
7606
7643
 
7607
7644
  function SvgSpinner(props) {
7608
- return /*#__PURE__*/React.createElement("svg", _extends$o({
7645
+ return /*#__PURE__*/React.createElement("svg", _extends$p({
7609
7646
  className: "plc-animate-spin",
7610
7647
  viewBox: "0 0 24 24",
7611
7648
  fill: "currentColor",
7612
7649
  xmlns: "http://www.w3.org/2000/svg"
7613
- }, props), _path$m || (_path$m = /*#__PURE__*/React.createElement("path", {
7650
+ }, props), _path$n || (_path$n = /*#__PURE__*/React.createElement("path", {
7614
7651
  opacity: 0.2,
7615
7652
  fill: "evenodd",
7616
7653
  clipRule: "evenodd",
@@ -7737,7 +7774,11 @@ toast.confirm = (onConfirm, {
7737
7774
  loadingMessage,
7738
7775
  successMessage,
7739
7776
  errorMessage
7740
- }, options) => {
7777
+ }, {
7778
+ confirmButtonLabel,
7779
+ closeButtonLabel,
7780
+ ...options
7781
+ } = {}) => {
7741
7782
  const translations = i18next.t("notification:confirm", {
7742
7783
  returnObjects: true
7743
7784
  });
@@ -7751,11 +7792,11 @@ toast.confirm = (onConfirm, {
7751
7792
  variant: "solid",
7752
7793
  className: "plc-text-xs plc-bg-red-500 hover:plc-bg-red-600",
7753
7794
  onClick: onConfirmClick
7754
- }, translations.labels.confirm), /*#__PURE__*/React__default.createElement(Button, {
7795
+ }, confirmButtonLabel !== null && confirmButtonLabel !== void 0 ? confirmButtonLabel : translations.labels.confirm), /*#__PURE__*/React__default.createElement(Button, {
7755
7796
  className: "plc-text-xs",
7756
7797
  variant: "outline",
7757
7798
  onClick: () => toast.dismiss(t.id)
7758
- }, translations.labels.close))), {
7799
+ }, closeButtonLabel !== null && closeButtonLabel !== void 0 ? closeButtonLabel : translations.labels.close))), {
7759
7800
  type: "confirm",
7760
7801
  ...options
7761
7802
  });
@@ -7832,6 +7873,16 @@ const init$1 = () => {
7832
7873
  }
7833
7874
  }
7834
7875
 
7876
+ const pelcroUpdateNewslettersButtons = document.getElementsByClassName("pelcro-update-newsletters-button");
7877
+
7878
+ if (pelcroUpdateNewslettersButtons.length !== 0) {
7879
+ for (let i = 0; i < pelcroUpdateNewslettersButtons.length; i++) {
7880
+ pelcroUpdateNewslettersButtons[i].addEventListener("click", () => {
7881
+ switchView("newsletter-update");
7882
+ });
7883
+ }
7884
+ }
7885
+
7835
7886
  const pelcroCartButtonsByClass = document.getElementsByClassName("pelcro-cart-button");
7836
7887
 
7837
7888
  if (pelcroCartButtonsByClass.length !== 0) {
@@ -8047,87 +8098,71 @@ function Link({
8047
8098
 
8048
8099
  const init = () => {
8049
8100
  const {
8050
- whenSiteReady,
8051
- view,
8052
- resetView,
8053
8101
  switchView,
8054
8102
  set
8055
8103
  } = usePelcro.getStore();
8056
- whenSiteReady(() => {
8057
- const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
8104
+ const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
8058
8105
 
8059
- if (entitlementsProtectedElements.length === 0) {
8060
- return;
8061
- }
8106
+ if (entitlementsProtectedElements.length === 0) {
8107
+ return false;
8108
+ }
8062
8109
 
8063
- if (!allElemsHaveSameEntitlements(entitlementsProtectedElements)) {
8064
- console.error("not all elements protected by entitlements have the same entitlements, all elements protected by entitlements must have the exact same data-pelcro-entitlements attribute value");
8065
- return;
8066
- }
8110
+ if (!allElemsHaveSameEntitlements(entitlementsProtectedElements)) {
8111
+ console.error("not all elements protected by entitlements have the same entitlements, all elements protected by entitlements must have the exact same data-pelcro-entitlements attribute value");
8112
+ return false;
8113
+ }
8067
8114
 
8068
- entitlementsProtectedElements.forEach(elem => {
8069
- const entitlements = getEntitlementsFromElem(elem);
8115
+ for (const elem of entitlementsProtectedElements) {
8116
+ const entitlements = getEntitlementsFromElem(elem);
8070
8117
 
8071
- if (entitlements.length === 0) {
8072
- console.error("invalid data-pelcro-entitlements attribute value", elem);
8073
- return;
8074
- }
8118
+ if (entitlements.length === 0) {
8119
+ console.error("invalid data-pelcro-entitlements attribute value", elem);
8120
+ return false;
8121
+ }
8075
8122
 
8076
- if (window.Pelcro.product.getByEntitlements(entitlements).length === 0) {
8077
- console.warn("user can't subscribe to any plan that has any of the entitlement(s) needed, this is usually unintentional, make sure that the entitlements are spelled correctly, entitlements are case sensitive. make sure that your plans are configured in a way that allows users from all supported countries, using all supported currencies, to have access to your content by subscribing to certain plans that provide the needed entitlement(s)");
8078
- }
8123
+ if (window.Pelcro.product.getByEntitlements(entitlements).length === 0) {
8124
+ console.warn("user can't subscribe to any plan that has any of the entitlement(s) needed, this is usually unintentional, make sure that the entitlements are spelled correctly, entitlements are case sensitive. make sure that your plans are configured in a way that allows users from all supported countries, using all supported currencies, to have access to your content by subscribing to certain plans that provide the needed entitlement(s)");
8125
+ }
8079
8126
 
8080
- if (shouldBlurContent(entitlements)) {
8081
- // remove all event listeners from the elem by replacing it with a deep clone of itself
8082
- const elemDeepClone = elem.cloneNode(true);
8083
- elem.replaceWith(elemDeepClone);
8084
- disableKeyboardInteractions(elemDeepClone);
8085
- elemDeepClone.setAttribute("style", "filter:blur(3px) !important; pointer-events:none !important; user-select:none !important");
8086
- unblurElemWhenUserSubscribes(elemDeepClone, entitlements);
8087
- /*
8088
- showing both the meter and the entitlements notification doesn't make sense from
8089
- a product prespective + they would take half the screen on mobile devies, so we're
8090
- hiding the meter, and showing the entitlements notification only.
8091
- */
8127
+ if (shouldBlurContent(entitlements)) {
8128
+ // remove all event listeners from the elem by replacing it with a deep clone of itself
8129
+ const elemDeepClone = elem.cloneNode(true);
8130
+ elem.replaceWith(elemDeepClone);
8131
+ disableKeyboardInteractions(elemDeepClone);
8132
+ elemDeepClone.setAttribute("style", "filter:blur(3px) !important; pointer-events:none !important; user-select:none !important");
8133
+ unblurElemWhenUserSubscribes(elemDeepClone, entitlements);
8134
+ const NOTIFICATION_ID = "entitlement";
8135
+ notify( /*#__PURE__*/React__default.createElement("p", null, /*#__PURE__*/React__default.createElement(Trans, {
8136
+ i18nKey: "messages:entitlement"
8137
+ }, "Some of the content on this page is available with one or more of our plans.", /*#__PURE__*/React__default.createElement(Link, {
8138
+ onClick: () => {
8139
+ const productId = Number(elem.dataset.productId);
8140
+ const planId = Number(elem.dataset.planId);
8141
+ const selectedProduct = window.Pelcro.product.getById(productId);
8142
+ const selectedPlan = window.Pelcro.plan.getById(planId);
8143
+ const hasValidProductAndPlan = Boolean(selectedProduct && selectedPlan);
8092
8144
 
8093
- if (view === "meter") {
8094
- resetView();
8095
- }
8145
+ if (hasValidProductAndPlan) {
8146
+ set({
8147
+ product: selectedProduct,
8148
+ plan: selectedPlan
8149
+ });
8150
+ }
8096
8151
 
8097
- const NOTIFICATION_ID = "entitlement";
8098
- notify( /*#__PURE__*/React__default.createElement("p", null, /*#__PURE__*/React__default.createElement(Trans, {
8099
- i18nKey: "messages:entitlement"
8100
- }, "Some of the content on this page is available with one or more of our plans.", /*#__PURE__*/React__default.createElement(Link, {
8101
- onClick: () => {
8102
- const productId = Number(elem.dataset.productId);
8103
- const planId = Number(elem.dataset.planId);
8104
- const selectedProduct = window.Pelcro.product.getById(productId);
8105
- const selectedPlan = window.Pelcro.plan.getById(planId);
8106
- const hasValidProductAndPlan = Boolean(selectedProduct && selectedPlan);
8107
-
8108
- if (hasValidProductAndPlan) {
8109
- set({
8110
- product: selectedProduct,
8111
- plan: selectedPlan
8112
- });
8113
- }
8152
+ notify.dismiss(NOTIFICATION_ID);
8153
+ switchView("_plan-select-entitlements");
8154
+ }
8155
+ }, "Subscribe"), "now to get full page access.")), {
8156
+ className: "pelcro-notification-entitlement",
8157
+ position: "bottom-right",
8158
+ duration: Infinity,
8159
+ id: NOTIFICATION_ID
8160
+ });
8161
+ }
8162
+ }
8114
8163
 
8115
- notify.dismiss(NOTIFICATION_ID);
8116
- switchView("_plan-select-entitlements");
8117
- }
8118
- }, "Subscribe"), "now to get full page access.")), {
8119
- className: "pelcro-notification-entitlement",
8120
- position: "bottom-right",
8121
- duration: Infinity,
8122
- id: NOTIFICATION_ID
8123
- });
8124
- }
8125
- });
8126
- });
8164
+ return true;
8127
8165
  };
8128
- /**
8129
- *
8130
- */
8131
8166
 
8132
8167
  function allElemsHaveSameEntitlements(elems) {
8133
8168
  const entitlements = getEntitlementsFromElem(elems[0]);
@@ -8137,10 +8172,6 @@ function allElemsHaveSameEntitlements(elems) {
8137
8172
  return entitlements.every(ent => elemEntitlements.includes(ent));
8138
8173
  });
8139
8174
  }
8140
- /**
8141
- *
8142
- */
8143
-
8144
8175
 
8145
8176
  function disableKeyboardInteractions(elem) {
8146
8177
  elem.addEventListener("keydown", event => {
@@ -8153,10 +8184,6 @@ function disableKeyboardInteractions(elem) {
8153
8184
  }
8154
8185
  }, true);
8155
8186
  }
8156
- /**
8157
- *
8158
- */
8159
-
8160
8187
 
8161
8188
  function unblurElemWhenUserSubscribes(elem, entitlements) {
8162
8189
  document.addEventListener("PelcroSubscriptionCreate", event => {
@@ -8164,11 +8191,11 @@ function unblurElemWhenUserSubscribes(elem, entitlements) {
8164
8191
  isGift
8165
8192
  } = usePelcro.getStore();
8166
8193
  if (isGift) return;
8167
- const latestSub = event.detail.data.subscriptions[0];
8194
+ const latestSub = event.detail.data.subscriptions[event.detail.data.subscriptions.length - 1];
8168
8195
  const shouldUnblurContent = entitlements.some(ent => {
8169
- var _latestSub$plan$entit, _latestSub$plan$entit2;
8196
+ var _latestSub$plan$entit, _latestSub$plan, _latestSub$plan$entit2;
8170
8197
 
8171
- return (_latestSub$plan$entit = (_latestSub$plan$entit2 = latestSub.plan.entitlements) === null || _latestSub$plan$entit2 === void 0 ? void 0 : _latestSub$plan$entit2.includes(ent)) !== null && _latestSub$plan$entit !== void 0 ? _latestSub$plan$entit : false;
8198
+ return (_latestSub$plan$entit = latestSub === null || latestSub === void 0 ? void 0 : (_latestSub$plan = latestSub.plan) === null || _latestSub$plan === void 0 ? void 0 : (_latestSub$plan$entit2 = _latestSub$plan.entitlements) === null || _latestSub$plan$entit2 === void 0 ? void 0 : _latestSub$plan$entit2.includes(ent)) !== null && _latestSub$plan$entit !== void 0 ? _latestSub$plan$entit : false;
8172
8199
  });
8173
8200
 
8174
8201
  if (shouldUnblurContent) {
@@ -8176,10 +8203,6 @@ function unblurElemWhenUserSubscribes(elem, entitlements) {
8176
8203
  }
8177
8204
  });
8178
8205
  }
8179
- /**
8180
- *
8181
- */
8182
-
8183
8206
 
8184
8207
  function shouldBlurContent(entitlements) {
8185
8208
  return entitlements.every(entitlement => !window.Pelcro.user.isEntitledTo(entitlement));
@@ -8226,7 +8249,9 @@ const initPaywalls = () => {
8226
8249
  const viewFromURL = getStableViewID(window.Pelcro.helpers.getURLParameter("view"));
8227
8250
 
8228
8251
  if (((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.settings) === "subscription") {
8229
- // Skip if article is not restricted
8252
+ // blur entitlements based content
8253
+ const didBlurContent = init(); // Skip paywall if article is not restricted
8254
+
8230
8255
  if (isValidViewFromURL(viewFromURL) || !paywallMethods.isArticleRestricted()) {
8231
8256
  return;
8232
8257
  }
@@ -8236,9 +8261,14 @@ const initPaywalls = () => {
8236
8261
  } = usePelcro.getStore();
8237
8262
 
8238
8263
  if (paywallMethods !== null && paywallMethods !== void 0 && paywallMethods.displayMeterPaywall()) {
8239
- switchView("meter"); // initializing content entitlement here because it interacts with meter
8240
-
8241
- init();
8264
+ /*
8265
+ showing both the meter and the entitlements notification doesn't make sense from
8266
+ a product prespective + they would take half the screen on mobile devies, so we're
8267
+ not showing the meter, and only showing the entitlements notification.
8268
+ */
8269
+ if (!didBlurContent) {
8270
+ switchView("meter");
8271
+ }
8242
8272
  } else if (paywallMethods !== null && paywallMethods !== void 0 && paywallMethods.displayNewsletterPaywall()) {
8243
8273
  switchView("newsletter");
8244
8274
  } else if (paywallMethods !== null && paywallMethods !== void 0 && paywallMethods.displayPaywall()) {
@@ -8842,6 +8872,7 @@ const GET_STATES_SUCCESS = "GET_STATES_SUCCESS";
8842
8872
  const GET_STATES_FETCH = "GET_STATES_FETCH";
8843
8873
  const HANDLE_SUBMIT = "HANDLE_SUBMIT";
8844
8874
  const SET_UPDATED_PRICE = "SET_UPDATED_PRICE";
8875
+ const SET_TAX_AMOUNT = "SET_TAX_AMOUNT";
8845
8876
  const SET_CAN_MAKE_PAYMENT = "SET_CAN_MAKE_PAYMENT";
8846
8877
  const SET_PAYMENT_REQUEST = "SET_PAYMENT_REQUEST";
8847
8878
  const INIT_CONTAINER = "INIT_CONTAINER";
@@ -8870,6 +8901,9 @@ const SET_IMAGE_SRC = "SET_IMAGE_SRC";
8870
8901
  const PASSWORD_CHANGE_SUCCESS = "PASSWORD_CHANGE_SUCCESS";
8871
8902
  const SELECT_PAYMENT_METHOD = "SELECT_PAYMENT_METHOD";
8872
8903
  const LOAD_PAYMENT_METHODS = "LOAD_PAYMENT_METHODS";
8904
+ const GET_NEWSLETTERS_FETCH = "GET_NEWSLETTERS_FETCH";
8905
+ const GET_NEWSLETTERS_SUCCESS = "GET_NEWSLETTERS_SUCCESS";
8906
+ const SWITCH_TO_UPDATE = "SWITCH_TO_UPDATE";
8873
8907
 
8874
8908
  /**
8875
8909
  * Extracts error message from the response error object
@@ -8931,7 +8965,7 @@ const debounce = (func, waitTime) => {
8931
8965
  };
8932
8966
  };
8933
8967
 
8934
- const initialState$e = {
8968
+ const initialState$f = {
8935
8969
  email: "",
8936
8970
  password: "",
8937
8971
  emailError: null,
@@ -8942,10 +8976,10 @@ const initialState$e = {
8942
8976
  content: ""
8943
8977
  }
8944
8978
  };
8945
- const store$e = /*#__PURE__*/createContext(initialState$e);
8979
+ const store$f = /*#__PURE__*/createContext(initialState$f);
8946
8980
  const {
8947
- Provider: Provider$e
8948
- } = store$e;
8981
+ Provider: Provider$f
8982
+ } = store$f;
8949
8983
 
8950
8984
  const LoginContainer = ({
8951
8985
  style,
@@ -9052,7 +9086,7 @@ const LoginContainer = ({
9052
9086
  });
9053
9087
 
9054
9088
  case RESET_LOGIN_FORM:
9055
- return initialState$e;
9089
+ return initialState$f;
9056
9090
 
9057
9091
  case DISABLE_LOGIN_BUTTON:
9058
9092
  return lib_7({ ...state,
@@ -9070,12 +9104,12 @@ const LoginContainer = ({
9070
9104
  default:
9071
9105
  return state;
9072
9106
  }
9073
- }, initialState$e);
9107
+ }, initialState$f);
9074
9108
  return /*#__PURE__*/React__default.createElement("div", {
9075
9109
  style: { ...style
9076
9110
  },
9077
9111
  className: `pelcro-container pelcro-login-container ${className}`
9078
- }, /*#__PURE__*/React__default.createElement(Provider$e, {
9112
+ }, /*#__PURE__*/React__default.createElement(Provider$f, {
9079
9113
  value: {
9080
9114
  state,
9081
9115
  dispatch
@@ -9083,12 +9117,12 @@ const LoginContainer = ({
9083
9117
  }, children.length ? children.map((child, i) => {
9084
9118
  if (child) {
9085
9119
  return /*#__PURE__*/React__default.cloneElement(child, {
9086
- store: store$e,
9120
+ store: store$f,
9087
9121
  key: i
9088
9122
  });
9089
9123
  }
9090
9124
  }) : /*#__PURE__*/React__default.cloneElement(children, {
9091
- store: store$e
9125
+ store: store$f
9092
9126
  })));
9093
9127
  };
9094
9128
 
@@ -9333,7 +9367,7 @@ const LoginButton = ({
9333
9367
  buttonDisabled
9334
9368
  },
9335
9369
  dispatch
9336
- } = useContext(store$e);
9370
+ } = useContext(store$f);
9337
9371
  const {
9338
9372
  t
9339
9373
  } = useTranslation("login");
@@ -9354,23 +9388,23 @@ const LoginButton = ({
9354
9388
  };
9355
9389
 
9356
9390
  const LoginEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
9357
- store: store$e
9391
+ store: store$f
9358
9392
  }, props));
9359
9393
 
9360
9394
  const LoginPassword = props => /*#__PURE__*/React__default.createElement(Password, Object.assign({
9361
- store: store$e
9395
+ store: store$f
9362
9396
  }, props));
9363
9397
 
9364
- var _path$l;
9398
+ var _path$m;
9365
9399
 
9366
- function _extends$n() { _extends$n = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$n.apply(this, arguments); }
9400
+ function _extends$o() { _extends$o = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$o.apply(this, arguments); }
9367
9401
 
9368
9402
  function SvgCheck(props) {
9369
- return /*#__PURE__*/React.createElement("svg", _extends$n({
9403
+ return /*#__PURE__*/React.createElement("svg", _extends$o({
9370
9404
  xmlns: "http://www.w3.org/2000/svg",
9371
9405
  fill: "currentColor",
9372
9406
  viewBox: "0 0 20 20"
9373
- }, props), _path$l || (_path$l = /*#__PURE__*/React.createElement("path", {
9407
+ }, props), _path$m || (_path$m = /*#__PURE__*/React.createElement("path", {
9374
9408
  fillRule: "evenodd",
9375
9409
  d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
9376
9410
  clipRule: "evenodd"
@@ -9435,7 +9469,7 @@ var facebookLoginRenderProps = createCommonjsModule(function (module, exports) {
9435
9469
  var FacebookLogin = unwrapExports(facebookLoginRenderProps);
9436
9470
  facebookLoginRenderProps.FacebookLogin;
9437
9471
 
9438
- const initialState$d = {
9472
+ const initialState$e = {
9439
9473
  email: "",
9440
9474
  password: "",
9441
9475
  emailError: null,
@@ -9452,10 +9486,10 @@ const initialState$d = {
9452
9486
  content: ""
9453
9487
  }
9454
9488
  };
9455
- const store$d = /*#__PURE__*/createContext(initialState$d);
9489
+ const store$e = /*#__PURE__*/createContext(initialState$e);
9456
9490
  const {
9457
- Provider: Provider$d
9458
- } = store$d;
9491
+ Provider: Provider$e
9492
+ } = store$e;
9459
9493
 
9460
9494
  const RegisterContainer = ({
9461
9495
  style,
@@ -9620,7 +9654,7 @@ const RegisterContainer = ({
9620
9654
  });
9621
9655
 
9622
9656
  case RESET_LOGIN_FORM:
9623
- return initialState$d;
9657
+ return initialState$e;
9624
9658
 
9625
9659
  case DISABLE_REGISTRATION_BUTTON:
9626
9660
  return lib_7({ ...state,
@@ -9638,12 +9672,12 @@ const RegisterContainer = ({
9638
9672
  default:
9639
9673
  return state;
9640
9674
  }
9641
- }, initialState$d);
9675
+ }, initialState$e);
9642
9676
  return /*#__PURE__*/React__default.createElement("div", {
9643
9677
  style: { ...style
9644
9678
  },
9645
9679
  className: `pelcro-container pelcro-register-container ${className}`
9646
- }, /*#__PURE__*/React__default.createElement(Provider$d, {
9680
+ }, /*#__PURE__*/React__default.createElement(Provider$e, {
9647
9681
  value: {
9648
9682
  state,
9649
9683
  dispatch
@@ -9651,24 +9685,24 @@ const RegisterContainer = ({
9651
9685
  }, children.length ? children.map((child, i) => {
9652
9686
  if (child) {
9653
9687
  return /*#__PURE__*/React__default.cloneElement(child, {
9654
- store: store$d,
9688
+ store: store$e,
9655
9689
  key: i
9656
9690
  });
9657
9691
  }
9658
9692
  }) : /*#__PURE__*/React__default.cloneElement(children, {
9659
- store: store$d
9693
+ store: store$e
9660
9694
  })));
9661
9695
  };
9662
9696
 
9663
- var _path$k;
9697
+ var _path$l;
9664
9698
 
9665
- function _extends$m() { _extends$m = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$m.apply(this, arguments); }
9699
+ function _extends$n() { _extends$n = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$n.apply(this, arguments); }
9666
9700
 
9667
9701
  function SvgFacebookLogo(props) {
9668
- return /*#__PURE__*/React.createElement("svg", _extends$m({
9702
+ return /*#__PURE__*/React.createElement("svg", _extends$n({
9669
9703
  xmlns: "http://www.w3.org/2000/svg",
9670
9704
  viewBox: "88.428 12.828 107.543 207.085"
9671
- }, props), _path$k || (_path$k = /*#__PURE__*/React.createElement("path", {
9705
+ }, props), _path$l || (_path$l = /*#__PURE__*/React.createElement("path", {
9672
9706
  d: "M158.232 219.912v-94.461h31.707l4.747-36.813h-36.454V65.134c0-10.658 2.96-17.922 18.245-17.922l19.494-.009V14.278c-3.373-.447-14.944-1.449-28.406-1.449-28.106 0-47.348 17.155-47.348 48.661v27.149H88.428v36.813h31.788v94.461l38.016-.001z",
9673
9707
  fill: "#3c5a9a"
9674
9708
  })));
@@ -9685,10 +9719,10 @@ const FacebookLoginButton = ({
9685
9719
  const facebookLoginEnabled = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.facebook_app_id;
9686
9720
  const {
9687
9721
  dispatch: loginDispatch
9688
- } = useContext(store$e);
9722
+ } = useContext(store$f);
9689
9723
  const {
9690
9724
  dispatch: registerDispatch
9691
- } = useContext(store$d);
9725
+ } = useContext(store$e);
9692
9726
 
9693
9727
  const onSuccess = facebookUser => {
9694
9728
  loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
@@ -9741,15 +9775,15 @@ var googleLogin = createCommonjsModule(function (module, exports) {
9741
9775
  unwrapExports(googleLogin);
9742
9776
  var googleLogin_1 = googleLogin.GoogleLogin;
9743
9777
 
9744
- var _path$j, _path2$2, _path3$1, _path4;
9778
+ var _path$k, _path2$2, _path3$1, _path4;
9745
9779
 
9746
- function _extends$l() { _extends$l = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$l.apply(this, arguments); }
9780
+ function _extends$m() { _extends$m = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$m.apply(this, arguments); }
9747
9781
 
9748
9782
  function SvgGoogleLogo(props) {
9749
- return /*#__PURE__*/React.createElement("svg", _extends$l({
9783
+ return /*#__PURE__*/React.createElement("svg", _extends$m({
9750
9784
  viewBox: "0 0 24 24",
9751
9785
  xmlns: "http://www.w3.org/2000/svg"
9752
- }, props), _path$j || (_path$j = /*#__PURE__*/React.createElement("path", {
9786
+ }, props), _path$k || (_path$k = /*#__PURE__*/React.createElement("path", {
9753
9787
  fill: "#4285F4",
9754
9788
  d: "M23.745 12.27c0-.79-.07-1.54-.19-2.27h-11.3v4.51h6.47c-.29 1.48-1.14 2.73-2.4 3.58v3h3.86c2.26-2.09 3.56-5.17 3.56-8.82z"
9755
9789
  })), _path2$2 || (_path2$2 = /*#__PURE__*/React.createElement("path", {
@@ -9775,10 +9809,10 @@ const GoogleLoginButton = ({
9775
9809
  const googleLoginEnabled = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.google_app_id;
9776
9810
  const {
9777
9811
  dispatch: loginDispatch
9778
- } = useContext(store$e);
9812
+ } = useContext(store$f);
9779
9813
  const {
9780
9814
  dispatch: registerDispatch
9781
- } = useContext(store$d);
9815
+ } = useContext(store$e);
9782
9816
 
9783
9817
  const onSuccess = response => {
9784
9818
  var _response$getAuthResp, _profile$getEmail, _profile$getGivenName, _profile$getFamilyNam, _profile$getEmail2, _profile$getGivenName2, _profile$getFamilyNam2;
@@ -9883,15 +9917,15 @@ function LoginView(props) {
9883
9917
  }, /*#__PURE__*/React__default.createElement(GoogleLoginButton, null), /*#__PURE__*/React__default.createElement(FacebookLoginButton, null))))));
9884
9918
  }
9885
9919
 
9886
- var _path$i, _path2$1, _path3;
9920
+ var _path$j, _path2$1, _path3;
9887
9921
 
9888
- function _extends$k() { _extends$k = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$k.apply(this, arguments); }
9922
+ function _extends$l() { _extends$l = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$l.apply(this, arguments); }
9889
9923
 
9890
9924
  function SvgPelcroAuthorship(props) {
9891
- return /*#__PURE__*/React.createElement("svg", _extends$k({
9925
+ return /*#__PURE__*/React.createElement("svg", _extends$l({
9892
9926
  xmlns: "http://www.w3.org/2000/svg",
9893
9927
  viewBox: "0 -80.652 497.072 179.991"
9894
- }, props), _path$i || (_path$i = /*#__PURE__*/React.createElement("path", {
9928
+ }, props), _path$j || (_path$j = /*#__PURE__*/React.createElement("path", {
9895
9929
  fill: "none",
9896
9930
  stroke: "#4a4a4a",
9897
9931
  d: "M487.89 42.299c0 13.158-10.671 23.829-23.829 23.829H37.074c-13.162 0-23.832-10.671-23.832-23.829v-63.552c0-13.158 10.67-23.831 23.832-23.831H464.06c13.158 0 23.829 10.672 23.829 23.831l.001 63.552z"
@@ -10038,11 +10072,11 @@ function LoginModal({
10038
10072
  LoginModal.viewId = "login";
10039
10073
 
10040
10074
  const RegisterEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
10041
- store: store$d
10075
+ store: store$e
10042
10076
  }, props));
10043
10077
 
10044
10078
  const RegisterPassword = props => /*#__PURE__*/React__default.createElement(Password, Object.assign({
10045
- store: store$d
10079
+ store: store$e
10046
10080
  }, props));
10047
10081
 
10048
10082
  const RegisterButton = ({
@@ -10059,7 +10093,7 @@ const RegisterButton = ({
10059
10093
  buttonDisabled
10060
10094
  },
10061
10095
  dispatch
10062
- } = useContext(store$d);
10096
+ } = useContext(store$e);
10063
10097
  const {
10064
10098
  t
10065
10099
  } = useTranslation("register");
@@ -10194,7 +10228,7 @@ function FirstName({
10194
10228
  }
10195
10229
 
10196
10230
  const RegisterFirstName = props => /*#__PURE__*/React__default.createElement(FirstName, Object.assign({
10197
- store: store$d
10231
+ store: store$e
10198
10232
  }, props));
10199
10233
 
10200
10234
  function LastName({
@@ -10225,7 +10259,7 @@ function LastName({
10225
10259
  }
10226
10260
 
10227
10261
  const RegisterLastName = props => /*#__PURE__*/React__default.createElement(LastName, Object.assign({
10228
- store: store$d
10262
+ store: store$e
10229
10263
  }, props));
10230
10264
 
10231
10265
  /**
@@ -10329,7 +10363,7 @@ function TextInput({
10329
10363
 
10330
10364
  const RegisterTextInput = props => {
10331
10365
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({}, props, {
10332
- store: store$d
10366
+ store: store$e
10333
10367
  }));
10334
10368
  };
10335
10369
 
@@ -12294,13 +12328,14 @@ class PaypalGateWay {
12294
12328
  * @property {unknown} canMakePayment
12295
12329
  * @property {unknown} paymentRequest
12296
12330
  * @property {number} updatedPrice
12331
+ * @property {number} taxAmount
12297
12332
  * @property {object} currentPlan
12298
12333
  * @property {object} alert
12299
12334
  */
12300
12335
 
12301
12336
  /** @type {PaymentStateType} */
12302
12337
 
12303
- const initialState$c = {
12338
+ const initialState$d = {
12304
12339
  disableSubmit: false,
12305
12340
  isLoading: false,
12306
12341
  disableCouponButton: false,
@@ -12312,16 +12347,17 @@ const initialState$c = {
12312
12347
  canMakePayment: false,
12313
12348
  paymentRequest: null,
12314
12349
  updatedPrice: null,
12350
+ taxAmount: null,
12315
12351
  currentPlan: null,
12316
12352
  alert: {
12317
12353
  type: "error",
12318
12354
  content: ""
12319
12355
  }
12320
12356
  };
12321
- const store$c = /*#__PURE__*/createContext(initialState$c);
12357
+ const store$d = /*#__PURE__*/createContext(initialState$d);
12322
12358
  const {
12323
- Provider: Provider$c
12324
- } = store$c;
12359
+ Provider: Provider$d
12360
+ } = store$d;
12325
12361
 
12326
12362
  const PaymentMethodContainerWithoutStripe = ({
12327
12363
  style,
@@ -12362,6 +12398,7 @@ const PaymentMethodContainerWithoutStripe = ({
12362
12398
  dispatch({
12363
12399
  type: INIT_CONTAINER
12364
12400
  });
12401
+ updateTotalAmountWithTax();
12365
12402
  }, []);
12366
12403
 
12367
12404
  const initPaymentRequest = (state, dispatch) => {
@@ -12428,6 +12465,45 @@ const PaymentMethodContainerWithoutStripe = ({
12428
12465
  console.log("Google Pay/Apple pay isn't available in this country");
12429
12466
  }
12430
12467
  };
12468
+ /**
12469
+ * Updates the total amount after adding taxes only if site taxes are enabled
12470
+ */
12471
+
12472
+
12473
+ const updateTotalAmountWithTax = () => {
12474
+ var _window$Pelcro$site$r;
12475
+
12476
+ const taxesEnabled = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.taxes_enabled;
12477
+
12478
+ if (taxesEnabled && type === "createPayment") {
12479
+ dispatch({
12480
+ type: DISABLE_SUBMIT,
12481
+ payload: true
12482
+ });
12483
+ resolveTaxCalculation().then(res => {
12484
+ if (res) {
12485
+ dispatch({
12486
+ type: SET_TAX_AMOUNT,
12487
+ payload: res.taxAmount
12488
+ });
12489
+ dispatch({
12490
+ type: SET_UPDATED_PRICE,
12491
+ payload: res.totalAmountWithTax
12492
+ });
12493
+ dispatch({
12494
+ type: UPDATE_PAYMENT_REQUEST
12495
+ });
12496
+ }
12497
+ }).catch(error => {
12498
+ handlePaymentError(error);
12499
+ }).finally(() => {
12500
+ dispatch({
12501
+ type: DISABLE_SUBMIT,
12502
+ payload: false
12503
+ });
12504
+ });
12505
+ }
12506
+ };
12431
12507
 
12432
12508
  const onApplyCouponCode = (state, dispatch) => {
12433
12509
  const {
@@ -12454,6 +12530,10 @@ const PaymentMethodContainerWithoutStripe = ({
12454
12530
  });
12455
12531
  }
12456
12532
 
12533
+ dispatch({
12534
+ type: SET_COUPON_ERROR,
12535
+ payload: ""
12536
+ });
12457
12537
  dispatch({
12458
12538
  type: SHOW_ALERT,
12459
12539
  payload: {
@@ -12469,6 +12549,10 @@ const PaymentMethodContainerWithoutStripe = ({
12469
12549
  type: SET_PERCENT_OFF,
12470
12550
  payload: `${(_res$data$coupon = res.data.coupon) === null || _res$data$coupon === void 0 ? void 0 : _res$data$coupon.percent_off}%`
12471
12551
  });
12552
+ dispatch({
12553
+ type: SET_TAX_AMOUNT,
12554
+ payload: res.data.taxes
12555
+ });
12472
12556
  dispatch({
12473
12557
  type: SET_UPDATED_PRICE,
12474
12558
  payload: res.data.total
@@ -12478,6 +12562,29 @@ const PaymentMethodContainerWithoutStripe = ({
12478
12562
  });
12479
12563
  };
12480
12564
 
12565
+ if ((couponCode === null || couponCode === void 0 ? void 0 : couponCode.trim()) === "") {
12566
+ dispatch({
12567
+ type: SET_COUPON,
12568
+ payload: null
12569
+ });
12570
+ dispatch({
12571
+ type: SET_PERCENT_OFF,
12572
+ payload: ""
12573
+ });
12574
+ dispatch({
12575
+ type: SET_UPDATED_PRICE,
12576
+ payload: null
12577
+ });
12578
+ dispatch({
12579
+ type: SET_TAX_AMOUNT,
12580
+ payload: null
12581
+ });
12582
+ dispatch({
12583
+ type: UPDATE_PAYMENT_REQUEST
12584
+ });
12585
+ updateTotalAmountWithTax();
12586
+ }
12587
+
12481
12588
  if (couponCode !== null && couponCode !== void 0 && couponCode.trim()) {
12482
12589
  dispatch({
12483
12590
  type: DISABLE_COUPON_BUTTON,
@@ -12864,16 +12971,20 @@ const PaymentMethodContainerWithoutStripe = ({
12864
12971
  const totalAmount = (_ref = (_state$updatedPrice = state === null || state === void 0 ? void 0 : state.updatedPrice) !== null && _state$updatedPrice !== void 0 ? _state$updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount) !== null && _ref !== void 0 ? _ref : getOrderItemsTotal();
12865
12972
 
12866
12973
  if ((source === null || source === void 0 ? void 0 : (_source$card3 = source.card) === null || _source$card3 === void 0 ? void 0 : _source$card3.three_d_secure) === "required" && totalAmount > 0) {
12867
- return resolveTaxCalculation().then(totalAmountWithTax => generate3DSecureSource(source, totalAmountWithTax !== null && totalAmountWithTax !== void 0 ? totalAmountWithTax : totalAmount).then(({
12868
- source,
12869
- error
12870
- }) => {
12871
- if (error) {
12872
- return handlePaymentError(error);
12873
- }
12974
+ return resolveTaxCalculation().then(res => {
12975
+ var _res$totalAmountWithT;
12874
12976
 
12875
- toggleAuthenticationPendingView(true, source);
12876
- }));
12977
+ return generate3DSecureSource(source, (_res$totalAmountWithT = res === null || res === void 0 ? void 0 : res.totalAmountWithTax) !== null && _res$totalAmountWithT !== void 0 ? _res$totalAmountWithT : totalAmount).then(({
12978
+ source,
12979
+ error
12980
+ }) => {
12981
+ if (error) {
12982
+ return handlePaymentError(error);
12983
+ }
12984
+
12985
+ toggleAuthenticationPendingView(true, source);
12986
+ });
12987
+ });
12877
12988
  }
12878
12989
 
12879
12990
  return handlePayment(source);
@@ -12882,15 +12993,15 @@ const PaymentMethodContainerWithoutStripe = ({
12882
12993
  });
12883
12994
  };
12884
12995
  /**
12885
- * Resolves with the total including taxes incase taxes enabled by site
12996
+ * Resolves with the total & tax amount incase taxes enabled by site
12886
12997
  * @return {Promise}
12887
12998
  */
12888
12999
 
12889
13000
 
12890
13001
  const resolveTaxCalculation = () => {
12891
- var _window$Pelcro$site$r;
13002
+ var _window$Pelcro$site$r2;
12892
13003
 
12893
- const taxesEnabled = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.taxes_enabled;
13004
+ const taxesEnabled = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.taxes_enabled;
12894
13005
  return new Promise((resolve, reject) => {
12895
13006
  // resolve early if taxes isn't enabled
12896
13007
  if (!taxesEnabled) {
@@ -12903,14 +13014,18 @@ const PaymentMethodContainerWithoutStripe = ({
12903
13014
  coupon_code: state === null || state === void 0 ? void 0 : state.couponCode,
12904
13015
  address_id: selectedAddressId
12905
13016
  }, (error, res) => {
12906
- var _res$data;
13017
+ var _res$data, _res$data2;
12907
13018
 
12908
13019
  if (error) {
12909
13020
  return reject(error);
12910
13021
  }
12911
13022
 
12912
- const totalAmountWithTax = (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.total;
12913
- resolve(totalAmountWithTax);
13023
+ const taxAmount = (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.taxes;
13024
+ const totalAmountWithTax = (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.total;
13025
+ resolve({
13026
+ totalAmountWithTax,
13027
+ taxAmount
13028
+ });
12914
13029
  });
12915
13030
  });
12916
13031
  };
@@ -12965,13 +13080,13 @@ const PaymentMethodContainerWithoutStripe = ({
12965
13080
  const handlePaymentError = error => {
12966
13081
  if (error.type === "validation_error" && // Subscription creation & renewal
12967
13082
  type === "createPayment") {
12968
- var _state$coupon;
13083
+ var _state$couponObject;
12969
13084
 
12970
13085
  const {
12971
13086
  updatedPrice
12972
13087
  } = state; // When price is 0, we allow submitting without card info
12973
13088
 
12974
- if (updatedPrice === 0 && ((_state$coupon = state.coupon) === null || _state$coupon === void 0 ? void 0 : _state$coupon.duration) === "forever") {
13089
+ if (updatedPrice === 0 && ((_state$couponObject = state.couponObject) === null || _state$couponObject === void 0 ? void 0 : _state$couponObject.duration) === "forever") {
12975
13090
  return subscribe({}, state, dispatch);
12976
13091
  }
12977
13092
  }
@@ -13099,6 +13214,11 @@ const PaymentMethodContainerWithoutStripe = ({
13099
13214
  updatedPrice: action.payload
13100
13215
  });
13101
13216
 
13217
+ case SET_TAX_AMOUNT:
13218
+ return lib_7({ ...state,
13219
+ taxAmount: action.payload
13220
+ });
13221
+
13102
13222
  case SET_CAN_MAKE_PAYMENT:
13103
13223
  return lib_7({ ...state,
13104
13224
  canMakePayment: action.payload
@@ -13116,7 +13236,7 @@ const PaymentMethodContainerWithoutStripe = ({
13116
13236
 
13117
13237
  case SET_COUPON:
13118
13238
  return lib_7({ ...state,
13119
- coupon: action.payload
13239
+ couponObject: action.payload
13120
13240
  });
13121
13241
 
13122
13242
  case SET_COUPON_ERROR:
@@ -13142,21 +13262,21 @@ const PaymentMethodContainerWithoutStripe = ({
13142
13262
  default:
13143
13263
  return state;
13144
13264
  }
13145
- }, initialState$c);
13265
+ }, initialState$d);
13146
13266
  return /*#__PURE__*/React__default.createElement("div", {
13147
13267
  style: { ...style
13148
13268
  },
13149
13269
  className: `pelcro-container pelcro-payment-container ${className}`
13150
- }, /*#__PURE__*/React__default.createElement(Provider$c, {
13270
+ }, /*#__PURE__*/React__default.createElement(Provider$d, {
13151
13271
  value: {
13152
13272
  state,
13153
13273
  dispatch
13154
13274
  }
13155
13275
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
13156
- store: store$c,
13276
+ store: store$d,
13157
13277
  key: i
13158
13278
  })) : /*#__PURE__*/React__default.cloneElement(children, {
13159
- store: store$c
13279
+ store: store$d
13160
13280
  })));
13161
13281
  };
13162
13282
 
@@ -13169,7 +13289,7 @@ const PaymentMethodContainer = props => {
13169
13289
  stripeAccount: window.Pelcro.site.read().account_id,
13170
13290
  locale: getCanonicalLocaleFormat(window.Pelcro.site.read().default_locale)
13171
13291
  }, /*#__PURE__*/React__default.createElement(es_11, null, /*#__PURE__*/React__default.createElement(UnwrappedForm, Object.assign({
13172
- store: store$c
13292
+ store: store$d
13173
13293
  }, props))));
13174
13294
  }
13175
13295
 
@@ -13222,7 +13342,7 @@ const PelcroPaymentRequestButton = props => {
13222
13342
  currentPlan,
13223
13343
  updatedPrice
13224
13344
  }
13225
- } = useContext(store$c);
13345
+ } = useContext(store$d);
13226
13346
 
13227
13347
  const updatePaymentRequest = () => {
13228
13348
  // Make sure payment request is up to date, eg. user added a coupon code.
@@ -13275,9 +13395,10 @@ const DiscountedPrice = props => {
13275
13395
  const {
13276
13396
  state: {
13277
13397
  updatedPrice,
13398
+ taxAmount,
13278
13399
  percentOff
13279
13400
  }
13280
- } = useContext(store$c);
13401
+ } = useContext(store$d);
13281
13402
  const {
13282
13403
  default_locale
13283
13404
  } = Pelcro.site.read();
@@ -13287,12 +13408,15 @@ const DiscountedPrice = props => {
13287
13408
  } = usePelcro();
13288
13409
  const ecommOrderCurrency = (_order$currency = order === null || order === void 0 ? void 0 : order.currency) !== null && _order$currency !== void 0 ? _order$currency : order === null || order === void 0 ? void 0 : (_order$ = order[0]) === null || _order$ === void 0 ? void 0 : _order$.currency;
13289
13410
  const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
13290
- const priceFormatted = getFormattedPriceByLocal(order ? updatedPrice : updatedPrice * planQuantity, ecommOrderCurrency !== null && ecommOrderCurrency !== void 0 ? ecommOrderCurrency : plan === null || plan === void 0 ? void 0 : plan.currency, default_locale);
13411
+ const discountedPriceWithoutTax = updatedPrice - taxAmount;
13412
+ const priceFormatted = getFormattedPriceByLocal(order ? updatedPrice : discountedPriceWithoutTax * planQuantity, ecommOrderCurrency !== null && ecommOrderCurrency !== void 0 ? ecommOrderCurrency : plan === null || plan === void 0 ? void 0 : plan.currency, default_locale);
13291
13413
 
13292
13414
  if (percentOff) {
13293
13415
  return /*#__PURE__*/React__default.createElement("div", Object.assign({
13294
- className: "plc-my-2"
13295
- }, props), "(-", percentOff, ") ", priceFormatted);
13416
+ className: "plc-flex plc-justify-center plc-mt-2 pelcro-discount"
13417
+ }, props), "(-", percentOff, ")", " ", /*#__PURE__*/React__default.createElement("span", {
13418
+ className: "plc-font-bold pelcro-discounted-price"
13419
+ }, priceFormatted));
13296
13420
  }
13297
13421
 
13298
13422
  return "";
@@ -13317,7 +13441,7 @@ const SubmitPaymentMethod = ({
13317
13441
  isLoading,
13318
13442
  updatedPrice
13319
13443
  }
13320
- } = useContext(store$c);
13444
+ } = useContext(store$d);
13321
13445
  const {
13322
13446
  default_locale
13323
13447
  } = Pelcro.site.read();
@@ -13341,17 +13465,17 @@ const SubmitPaymentMethod = ({
13341
13465
  }, t("labels.pay"), " ", priceFormatted && priceFormatted) : t("labels.submit"));
13342
13466
  };
13343
13467
 
13344
- var _path$h;
13468
+ var _path$i;
13345
13469
 
13346
- function _extends$j() { _extends$j = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$j.apply(this, arguments); }
13470
+ function _extends$k() { _extends$k = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$k.apply(this, arguments); }
13347
13471
 
13348
13472
  function SvgArrowLeft(props) {
13349
- return /*#__PURE__*/React.createElement("svg", _extends$j({
13473
+ return /*#__PURE__*/React.createElement("svg", _extends$k({
13350
13474
  xmlns: "http://www.w3.org/2000/svg",
13351
13475
  fill: "none",
13352
13476
  viewBox: "0 0 24 24",
13353
13477
  stroke: "currentColor"
13354
- }, props), _path$h || (_path$h = /*#__PURE__*/React.createElement("path", {
13478
+ }, props), _path$i || (_path$i = /*#__PURE__*/React.createElement("path", {
13355
13479
  strokeLinecap: "round",
13356
13480
  strokeLinejoin: "round",
13357
13481
  strokeWidth: 2,
@@ -13370,7 +13494,7 @@ const ApplyCouponButton = ({
13370
13494
  disableCouponButton
13371
13495
  },
13372
13496
  dispatch
13373
- } = useContext(store$c);
13497
+ } = useContext(store$d);
13374
13498
  const {
13375
13499
  t
13376
13500
  } = useTranslation("checkoutForm");
@@ -13404,7 +13528,7 @@ const CouponCodeField = props => {
13404
13528
  couponCode,
13405
13529
  couponError
13406
13530
  }
13407
- } = useContext(store$c);
13531
+ } = useContext(store$d);
13408
13532
 
13409
13533
  const onCouponCodeChange = e => {
13410
13534
  dispatch({
@@ -13422,6 +13546,7 @@ const CouponCodeField = props => {
13422
13546
 
13423
13547
  return /*#__PURE__*/React__default.createElement(Input, Object.assign({
13424
13548
  className: "plc-h-12",
13549
+ wrapperClassName: "plc-mb-1",
13425
13550
  errorClassName: "plc-h-12 sm:plc-h-8",
13426
13551
  error: couponError,
13427
13552
  "aria-label": t("labels.code"),
@@ -13432,17 +13557,17 @@ const CouponCodeField = props => {
13432
13557
  }, props));
13433
13558
  };
13434
13559
 
13435
- var _path$g;
13560
+ var _path$h;
13436
13561
 
13437
- function _extends$i() { _extends$i = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$i.apply(this, arguments); }
13562
+ function _extends$j() { _extends$j = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$j.apply(this, arguments); }
13438
13563
 
13439
13564
  function SvgTicket(props) {
13440
- return /*#__PURE__*/React.createElement("svg", _extends$i({
13565
+ return /*#__PURE__*/React.createElement("svg", _extends$j({
13441
13566
  xmlns: "http://www.w3.org/2000/svg",
13442
13567
  fill: "none",
13443
13568
  viewBox: "0 0 24 24",
13444
13569
  stroke: "currentColor"
13445
- }, props), _path$g || (_path$g = /*#__PURE__*/React.createElement("path", {
13570
+ }, props), _path$h || (_path$h = /*#__PURE__*/React.createElement("path", {
13446
13571
  strokeLinecap: "round",
13447
13572
  strokeLinejoin: "round",
13448
13573
  strokeWidth: 2,
@@ -13459,7 +13584,7 @@ const CouponCode = ({
13459
13584
  state: {
13460
13585
  enableCouponField
13461
13586
  }
13462
- } = useContext(store$c);
13587
+ } = useContext(store$d);
13463
13588
  const {
13464
13589
  t
13465
13590
  } = useTranslation("checkoutForm");
@@ -13473,16 +13598,16 @@ const CouponCode = ({
13473
13598
  };
13474
13599
 
13475
13600
  return /*#__PURE__*/React__default.createElement("div", {
13476
- className: "plc-my-4"
13601
+ className: "plc-mt-4"
13477
13602
  }, /*#__PURE__*/React__default.createElement(Button, Object.assign({
13478
- className: "plc-text-base plc-text-gray-500",
13603
+ className: "plc-mb-2 plc-text-base plc-text-gray-500",
13479
13604
  variant: "ghost",
13480
13605
  icon: /*#__PURE__*/React__default.createElement(SvgTicket, {
13481
13606
  className: "plc-w-5 plc-h-5 plc-mr-2"
13482
13607
  }),
13483
13608
  onClick: showCouponField
13484
13609
  }, otherProps), !enableCouponField ? t("labels.addCode") : t("labels.hideCode")), enableCouponField && /*#__PURE__*/React__default.createElement("div", {
13485
- className: "plc-flex plc-w-full plc-my-4 pelcro-apply-coupon-wrapper"
13610
+ className: "plc-flex plc-w-full plc-mt-2 pelcro-apply-coupon-wrapper"
13486
13611
  }, /*#__PURE__*/React__default.createElement(CouponCodeField, null), /*#__PURE__*/React__default.createElement(ApplyCouponButton, null)));
13487
13612
  };
13488
13613
 
@@ -13716,7 +13841,7 @@ const PaypalSubscribeButton = props => {
13716
13841
  const {
13717
13842
  dispatch,
13718
13843
  state
13719
- } = useContext(store$c);
13844
+ } = useContext(store$d);
13720
13845
  const {
13721
13846
  product,
13722
13847
  plan,
@@ -13801,16 +13926,16 @@ const BankRedirection = () => {
13801
13926
  }));
13802
13927
  };
13803
13928
 
13804
- var _path$f;
13929
+ var _path$g;
13805
13930
 
13806
- function _extends$h() { _extends$h = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$h.apply(this, arguments); }
13931
+ function _extends$i() { _extends$i = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$i.apply(this, arguments); }
13807
13932
 
13808
13933
  function SvgLock(props) {
13809
- return /*#__PURE__*/React.createElement("svg", _extends$h({
13934
+ return /*#__PURE__*/React.createElement("svg", _extends$i({
13810
13935
  xmlns: "http://www.w3.org/2000/svg",
13811
13936
  viewBox: "0 0 20 20",
13812
13937
  fill: "currentColor"
13813
- }, props), _path$f || (_path$f = /*#__PURE__*/React.createElement("path", {
13938
+ }, props), _path$g || (_path$g = /*#__PURE__*/React.createElement("path", {
13814
13939
  fillRule: "evenodd",
13815
13940
  d: "M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z",
13816
13941
  clipRule: "evenodd"
@@ -13827,7 +13952,7 @@ const SelectedPaymentMethod = () => {
13827
13952
  state: {
13828
13953
  isLoading
13829
13954
  }
13830
- } = useContext(store$c);
13955
+ } = useContext(store$d);
13831
13956
  const {
13832
13957
  switchView,
13833
13958
  selectedPaymentMethodId
@@ -13859,6 +13984,37 @@ const SelectedPaymentMethod = () => {
13859
13984
  }, t("select.buttons.changePaymentMethod")))));
13860
13985
  };
13861
13986
 
13987
+ const TaxAmount = () => {
13988
+ var _plan$quantity;
13989
+
13990
+ const {
13991
+ t
13992
+ } = useTranslation("checkoutForm");
13993
+ const {
13994
+ state: {
13995
+ taxAmount
13996
+ }
13997
+ } = useContext(store$d);
13998
+ const {
13999
+ default_locale
14000
+ } = Pelcro.site.read();
14001
+ const {
14002
+ plan
14003
+ } = usePelcro();
14004
+ const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
14005
+ const priceFormatted = getFormattedPriceByLocal(taxAmount * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, default_locale);
14006
+
14007
+ if (taxAmount) {
14008
+ return /*#__PURE__*/React__default.createElement("div", {
14009
+ className: "plc-text-center pelcro-tax-amount"
14010
+ }, t("labels.tax"), " ", /*#__PURE__*/React__default.createElement("span", {
14011
+ className: "plc-font-bold"
14012
+ }, priceFormatted));
14013
+ }
14014
+
14015
+ return null;
14016
+ };
14017
+
13862
14018
  /**
13863
14019
  *
13864
14020
  */
@@ -13895,7 +14051,9 @@ function PaymentMethodView({
13895
14051
  onFailure: onFailure
13896
14052
  }, /*#__PURE__*/React__default.createElement(BankRedirection, null), /*#__PURE__*/React__default.createElement(AlertWithContext, {
13897
14053
  className: "plc-mb-2"
13898
- }), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(SelectedPaymentMethod, null), /*#__PURE__*/React__default.createElement(CheckoutForm, null), showCoupon && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(CouponCode, null), /*#__PURE__*/React__default.createElement(DiscountedPrice, null)), /*#__PURE__*/React__default.createElement("div", {
14054
+ }), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(SelectedPaymentMethod, null), /*#__PURE__*/React__default.createElement(CheckoutForm, null), showCoupon && /*#__PURE__*/React__default.createElement("div", {
14055
+ className: "plc-mb-2"
14056
+ }, /*#__PURE__*/React__default.createElement(CouponCode, null), /*#__PURE__*/React__default.createElement(DiscountedPrice, null)), /*#__PURE__*/React__default.createElement(TaxAmount, null), /*#__PURE__*/React__default.createElement("div", {
13899
14057
  className: "plc-grid plc-mt-4 plc-gap-y-2"
13900
14058
  }, /*#__PURE__*/React__default.createElement(SubmitPaymentMethod, null), showExternalPaymentMethods && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(PelcroPaymentRequestButton, null), /*#__PURE__*/React__default.createElement(PaypalSubscribeButton, null)))))));
13901
14059
  }
@@ -14002,22 +14160,22 @@ function SubscriptionRenewModal({
14002
14160
  }
14003
14161
  SubscriptionRenewModal.viewId = "subscription-renew";
14004
14162
 
14005
- var _path$e;
14163
+ var _path$f;
14006
14164
 
14007
- function _extends$g() { _extends$g = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$g.apply(this, arguments); }
14165
+ function _extends$h() { _extends$h = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$h.apply(this, arguments); }
14008
14166
 
14009
14167
  function SvgGift(props) {
14010
- return /*#__PURE__*/React.createElement("svg", _extends$g({
14168
+ return /*#__PURE__*/React.createElement("svg", _extends$h({
14011
14169
  className: "plc-w-6 plc-h-6 plc-mr-2",
14012
- xmlns: "http://www.w3.org/2000/svg",
14013
14170
  fill: "none",
14014
- viewBox: "0 0 24 24",
14015
- stroke: "currentColor"
14016
- }, props), _path$e || (_path$e = /*#__PURE__*/React.createElement("path", {
14171
+ stroke: "currentColor",
14017
14172
  strokeLinecap: "round",
14018
14173
  strokeLinejoin: "round",
14019
14174
  strokeWidth: 2,
14020
- d: "M12 8v13m0-13V6a2 2 0 112 2h-2zm0 0V5.5A2.5 2.5 0 109.5 8H12zm-7 4h14M5 12a2 2 0 110-4h14a2 2 0 110 4M5 12v7a2 2 0 002 2h10a2 2 0 002-2v-7"
14175
+ viewBox: "0 0 24 24",
14176
+ xmlns: "http://www.w3.org/2000/svg"
14177
+ }, props), _path$f || (_path$f = /*#__PURE__*/React.createElement("path", {
14178
+ d: "M20 12v10H4V12M2 7h20v5H2zM12 22V7M12 7H7.5a2.5 2.5 0 010-5C11 2 12 7 12 7zM12 7h4.5a2.5 2.5 0 000-5C13 2 12 7 12 7z"
14021
14179
  })));
14022
14180
  }
14023
14181
 
@@ -14071,8 +14229,7 @@ const getSuccessContent = i18n => {
14071
14229
 
14072
14230
  const flow = getCurrentFlow();
14073
14231
  const {
14074
- product,
14075
- giftRecipient
14232
+ product
14076
14233
  } = usePelcro.getStore();
14077
14234
  const wordingDictionary = {
14078
14235
  subscriptionSuccess: {
@@ -14084,12 +14241,10 @@ const getSuccessContent = i18n => {
14084
14241
  },
14085
14242
  giftCreate: {
14086
14243
  successIcon: /*#__PURE__*/React__default.createElement(SvgGift, {
14087
- className: "plc-w-32 plc-my-4 plc-text-gray-400"
14244
+ className: "plc-w-32 plc-my-4 plc-text-gray-500"
14088
14245
  }),
14089
14246
  successTitle: i18n("messages.giftCreate.title"),
14090
- successContent: i18n("messages.giftCreate.content", {
14091
- email: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.email
14092
- })
14247
+ successContent: i18n("messages.giftCreate.content")
14093
14248
  },
14094
14249
  giftRedeem: {
14095
14250
  successIcon: /*#__PURE__*/React__default.createElement(SvgCheckSolid, {
@@ -14350,6 +14505,292 @@ class DefaultNewsLetter extends Component {
14350
14505
 
14351
14506
  const NewsLetter = withTranslation("newsletter")(DefaultNewsLetter);
14352
14507
 
14508
+ const initialState$c = {
14509
+ didSubToNewslettersBefore: false,
14510
+ newsletters: [],
14511
+ isListLoading: true,
14512
+ isSubmitting: false,
14513
+ alert: {
14514
+ type: "error",
14515
+ content: ""
14516
+ }
14517
+ };
14518
+ const store$c = /*#__PURE__*/createContext(initialState$c);
14519
+ const {
14520
+ Provider: Provider$c
14521
+ } = store$c;
14522
+
14523
+ const NewsletterUpdateContainer = ({
14524
+ style,
14525
+ className = "",
14526
+ onSuccess = () => {},
14527
+ onFailure = () => {},
14528
+ children
14529
+ }) => {
14530
+ const [t] = useTranslation("newsletter");
14531
+
14532
+ const handleSubmit = ({
14533
+ newsletters,
14534
+ didSubToNewslettersBefore
14535
+ }, dispatch) => {
14536
+ var _window$Pelcro$user$r, _window$Pelcro$user$r2;
14537
+
14538
+ const callback = (err, res) => {
14539
+ dispatch({
14540
+ type: LOADING,
14541
+ payload: false
14542
+ });
14543
+
14544
+ if (err) {
14545
+ dispatch({
14546
+ type: SHOW_ALERT,
14547
+ payload: {
14548
+ type: "error",
14549
+ content: getErrorMessages(err)
14550
+ }
14551
+ });
14552
+ onFailure(err);
14553
+ } else {
14554
+ if (!didSubToNewslettersBefore) {
14555
+ dispatch({
14556
+ type: SWITCH_TO_UPDATE
14557
+ });
14558
+ }
14559
+
14560
+ dispatch({
14561
+ type: SHOW_ALERT,
14562
+ payload: {
14563
+ type: "success",
14564
+ content: t("messages.success")
14565
+ }
14566
+ });
14567
+ onSuccess(res);
14568
+ }
14569
+ };
14570
+
14571
+ const requestData = {
14572
+ email: (_window$Pelcro$user$r = (_window$Pelcro$user$r2 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.email) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : window.Pelcro.helpers.getURLParameter("email"),
14573
+ source: "web",
14574
+ lists: newsletters.filter(newsletter => newsletter.selected).map(newsletter => newsletter.id).join(",")
14575
+ };
14576
+
14577
+ if (didSubToNewslettersBefore) {
14578
+ window.Pelcro.newsletter.update(requestData, callback);
14579
+ } else {
14580
+ window.Pelcro.newsletter.create(requestData, callback);
14581
+ }
14582
+ };
14583
+
14584
+ const [state, dispatch] = useReducerWithSideEffects((state, action) => {
14585
+ switch (action.type) {
14586
+ case GET_NEWSLETTERS_FETCH:
14587
+ return lib_7({ ...state,
14588
+ isListLoading: true
14589
+ });
14590
+
14591
+ case GET_NEWSLETTERS_SUCCESS:
14592
+ return lib_7({ ...state,
14593
+ newsletters: action.payload.newsletters,
14594
+ didSubToNewslettersBefore: action.payload.didSubToNewslettersBefore,
14595
+ isListLoading: false
14596
+ });
14597
+
14598
+ case SET_SELECT:
14599
+ return lib_7({ ...state,
14600
+ newsletters: state.newsletters.map(newsletter => {
14601
+ if (newsletter.id === action.payload) {
14602
+ return { ...newsletter,
14603
+ selected: !newsletter.selected
14604
+ };
14605
+ }
14606
+
14607
+ return newsletter;
14608
+ })
14609
+ });
14610
+
14611
+ case SWITCH_TO_UPDATE:
14612
+ return lib_7({ ...state,
14613
+ didSubToNewslettersBefore: true
14614
+ });
14615
+
14616
+ case SHOW_ALERT:
14617
+ return lib_7({ ...state,
14618
+ alert: action.payload
14619
+ });
14620
+
14621
+ case LOADING:
14622
+ return lib_7({ ...state,
14623
+ isSubmitting: action.payload
14624
+ });
14625
+
14626
+ case HANDLE_SUBMIT:
14627
+ return lib_5({ ...state,
14628
+ isSubmitting: true
14629
+ }, (state, dispatch) => handleSubmit(state, dispatch));
14630
+
14631
+ default:
14632
+ return state;
14633
+ }
14634
+ }, initialState$c);
14635
+ useEffect(() => {
14636
+ const getUserNewsletters = () => {
14637
+ var _window$Pelcro$user$r3, _window$Pelcro$user$r4;
14638
+
14639
+ dispatch({
14640
+ type: GET_NEWSLETTERS_FETCH
14641
+ });
14642
+ const email = (_window$Pelcro$user$r3 = (_window$Pelcro$user$r4 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r4 === void 0 ? void 0 : _window$Pelcro$user$r4.email) !== null && _window$Pelcro$user$r3 !== void 0 ? _window$Pelcro$user$r3 : window.Pelcro.helpers.getURLParameter("email");
14643
+ window.Pelcro.newsletter.getByEmail(email, (err, res) => {
14644
+ var _window$Pelcro$uiSett, _window$Pelcro, _window$Pelcro$uiSett2, _res$data$lists$split, _res$data$lists;
14645
+
14646
+ if (err) {
14647
+ return dispatch({
14648
+ type: SHOW_ALERT,
14649
+ payload: {
14650
+ type: "error",
14651
+ content: getErrorMessages(err)
14652
+ }
14653
+ });
14654
+ }
14655
+
14656
+ const newsletters = (_window$Pelcro$uiSett = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett2 = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett2 === void 0 ? void 0 : _window$Pelcro$uiSett2.newsletters) !== null && _window$Pelcro$uiSett !== void 0 ? _window$Pelcro$uiSett : [];
14657
+ const selectedNewsletters = (_res$data$lists$split = (_res$data$lists = res.data.lists) === null || _res$data$lists === void 0 ? void 0 : _res$data$lists.split(",")) !== null && _res$data$lists$split !== void 0 ? _res$data$lists$split : [];
14658
+ const allNewslettersWithSelectedField = newsletters.map(newsletter => ({ ...newsletter,
14659
+ id: String(newsletter.id),
14660
+ selected: selectedNewsletters.includes(String(newsletter.id))
14661
+ }));
14662
+ dispatch({
14663
+ type: GET_NEWSLETTERS_SUCCESS,
14664
+ payload: {
14665
+ newsletters: allNewslettersWithSelectedField,
14666
+ didSubToNewslettersBefore: Boolean(res.data.email)
14667
+ }
14668
+ });
14669
+ });
14670
+ };
14671
+
14672
+ getUserNewsletters();
14673
+ }, []);
14674
+ return /*#__PURE__*/React__default.createElement("div", {
14675
+ style: { ...style
14676
+ },
14677
+ className: `pelcro-container pelcro-newsletter-update-container ${className}`
14678
+ }, /*#__PURE__*/React__default.createElement(Provider$c, {
14679
+ value: {
14680
+ state,
14681
+ dispatch
14682
+ }
14683
+ }, children.length ? children.map((child, i) => {
14684
+ if (child) {
14685
+ return /*#__PURE__*/React__default.cloneElement(child, {
14686
+ store: store$c,
14687
+ key: i
14688
+ });
14689
+ }
14690
+ }) : /*#__PURE__*/React__default.cloneElement(children, {
14691
+ store: store$c
14692
+ })));
14693
+ };
14694
+
14695
+ const NewsletterUpdateButton = ({
14696
+ name,
14697
+ onClick,
14698
+ ...otherProps
14699
+ }) => {
14700
+ const {
14701
+ dispatch,
14702
+ state: {
14703
+ isSubmitting,
14704
+ isListLoading
14705
+ }
14706
+ } = useContext(store$c);
14707
+ const {
14708
+ t
14709
+ } = useTranslation("newsletter");
14710
+ return /*#__PURE__*/React__default.createElement(Button, Object.assign({
14711
+ onClick: () => {
14712
+ dispatch({
14713
+ type: HANDLE_SUBMIT
14714
+ });
14715
+ onClick === null || onClick === void 0 ? void 0 : onClick();
14716
+ },
14717
+ disabled: isListLoading,
14718
+ isLoading: isSubmitting
14719
+ }, otherProps), name !== null && name !== void 0 ? name : t("labels.submit"));
14720
+ };
14721
+
14722
+ const NewsletterUpdateList = () => {
14723
+ const handleSelectNewsletter = event => {
14724
+ dispatch({
14725
+ type: SET_SELECT,
14726
+ payload: event.target.value
14727
+ });
14728
+ };
14729
+
14730
+ const {
14731
+ dispatch,
14732
+ state: {
14733
+ newsletters,
14734
+ isListLoading
14735
+ }
14736
+ } = useContext(store$c);
14737
+
14738
+ if (isListLoading) {
14739
+ return /*#__PURE__*/React__default.createElement(Loader, {
14740
+ width: 60,
14741
+ height: 100
14742
+ });
14743
+ }
14744
+
14745
+ return /*#__PURE__*/React__default.createElement("div", {
14746
+ className: "plc-max-h-80 plc-overflow-y-auto pelcro-newsletters-wrapper"
14747
+ }, newsletters.map(newsletter => /*#__PURE__*/React__default.createElement("div", {
14748
+ key: newsletter.id,
14749
+ className: "plc-p-2 plc-mx-3 plc-mt-2 plc-border plc-border-gray-400 plc-border-solid plc-rounded plc-text-gray-900 pelcro-newsletter-wrapper"
14750
+ }, /*#__PURE__*/React__default.createElement(Checkbox, {
14751
+ className: "pelcro-select-newsletter-checkbox",
14752
+ labelClassName: "plc-cursor-pointer plc-w-full",
14753
+ id: `pelcro-newsletter-update-${newsletter.id}`,
14754
+ checked: newsletter.selected,
14755
+ value: newsletter.id,
14756
+ onChange: handleSelectNewsletter
14757
+ }, newsletter.label))));
14758
+ };
14759
+
14760
+ const NewsletterUpdateView = props => {
14761
+ const {
14762
+ t
14763
+ } = useTranslation("newsletter");
14764
+ return /*#__PURE__*/React__default.createElement("div", {
14765
+ id: "pelcro-newsletter-update-view"
14766
+ }, /*#__PURE__*/React__default.createElement("div", {
14767
+ className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
14768
+ }, /*#__PURE__*/React__default.createElement("h4", {
14769
+ className: "plc-text-2xl plc-font-semibold"
14770
+ }, t("updateTitle"))), /*#__PURE__*/React__default.createElement("form", {
14771
+ action: "javascript:void(0);",
14772
+ className: "plc-mt-2 pelcro-form"
14773
+ }, /*#__PURE__*/React__default.createElement(NewsletterUpdateContainer, props, /*#__PURE__*/React__default.createElement(AlertWithContext, null), /*#__PURE__*/React__default.createElement(NewsletterUpdateList, null), /*#__PURE__*/React__default.createElement(NewsletterUpdateButton, {
14774
+ role: "submit",
14775
+ className: "plc-mt-4 plc-w-full",
14776
+ name: t("labels.submit"),
14777
+ id: "pelcro-submit"
14778
+ }))));
14779
+ };
14780
+
14781
+ const NewsletterUpdateModal = ({
14782
+ onDisplay,
14783
+ onClose,
14784
+ ...otherProps
14785
+ }) => {
14786
+ return /*#__PURE__*/React__default.createElement(Modal, {
14787
+ id: "pelcro-newsletter-update-modal",
14788
+ onDisplay: onDisplay,
14789
+ onClose: onClose
14790
+ }, /*#__PURE__*/React__default.createElement(ModalBody, null, /*#__PURE__*/React__default.createElement(NewsletterUpdateView, otherProps)), /*#__PURE__*/React__default.createElement(ModalFooter, null, /*#__PURE__*/React__default.createElement(Authorship, null)));
14791
+ };
14792
+ NewsletterUpdateModal.viewId = "newsletter-update";
14793
+
14353
14794
  const MeterView = () => {
14354
14795
  var _paywallProduct$paywa, _paywallProduct$paywa2;
14355
14796
 
@@ -14401,7 +14842,7 @@ const MeterModal = props => {
14401
14842
  className: "plc-fixed plc-bottom-0 plc-right-0 plc-w-full plc-p-4 plc-bg-white plc-border-t-4 plc-rounded plc-shadow-md motion-safe:plc-animate-slideInBottom sm:plc-m-4 sm:plc-max-w-md plc-z-max plc-border-primary-500"
14402
14843
  }, /*#__PURE__*/React__default.createElement("button", {
14403
14844
  type: "button",
14404
- className: "plc-absolute plc-top-0 plc-text-2xl plc-text-gray-500 plc-right-1 pelcro-close-btn",
14845
+ className: "plc-absolute plc-top-0 plc-text-2xl plc-text-gray-500 hover:plc-text-black focus:plc-text-black plc-right-1 plc-border-0 plc-bg-transparent hover:plc-bg-transparent focus:plc-bg-transparent pelcro-close-btn",
14405
14846
  "aria-label": "Close",
14406
14847
  onClick: onClose
14407
14848
  }, /*#__PURE__*/React__default.createElement("span", null, "\xD7")), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(MeterView, props)));
@@ -14737,17 +15178,17 @@ const UserUpdatePhone = props => /*#__PURE__*/React__default.createElement(Phone
14737
15178
 
14738
15179
  var userSolidIcon = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20class%3D%22plc-h-5%20plc-w-5%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22white%22%3E%20%20%3Cpath%20transform%3D%22translate%280%2C2%29%22%20fill-rule%3D%22evenodd%22%20d%3D%22M10%209a3%203%200%20100-6%203%203%200%20000%206zm-7%209a7%207%200%201114%200H3z%22%20clip-rule%3D%22evenodd%22%20%2F%3E%3C%2Fsvg%3E";
14739
15180
 
14740
- var _path$d;
15181
+ var _path$e;
14741
15182
 
14742
- function _extends$f() { _extends$f = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$f.apply(this, arguments); }
15183
+ function _extends$g() { _extends$g = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$g.apply(this, arguments); }
14743
15184
 
14744
15185
  function SvgEdit(props) {
14745
- return /*#__PURE__*/React.createElement("svg", _extends$f({
15186
+ return /*#__PURE__*/React.createElement("svg", _extends$g({
14746
15187
  className: "plc-w-6 plc-h-6",
14747
15188
  xmlns: "http://www.w3.org/2000/svg",
14748
15189
  viewBox: "0 0 20 20",
14749
15190
  fill: "currentColor"
14750
- }, props), _path$d || (_path$d = /*#__PURE__*/React.createElement("path", {
15191
+ }, props), _path$e || (_path$e = /*#__PURE__*/React.createElement("path", {
14751
15192
  d: "M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zm-2.207 2.207L3 14.172V17h2.828l8.38-8.379-2.83-2.828z"
14752
15193
  })));
14753
15194
  }
@@ -17858,18 +18299,18 @@ const GiftCreateLastName = props => /*#__PURE__*/React__default.createElement(La
17858
18299
  store: store$4
17859
18300
  }, props));
17860
18301
 
17861
- var _path$c;
18302
+ var _path$d;
17862
18303
 
17863
- function _extends$e() { _extends$e = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$e.apply(this, arguments); }
18304
+ function _extends$f() { _extends$f = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$f.apply(this, arguments); }
17864
18305
 
17865
18306
  function SvgInfoCircle(props) {
17866
- return /*#__PURE__*/React.createElement("svg", _extends$e({
18307
+ return /*#__PURE__*/React.createElement("svg", _extends$f({
17867
18308
  xmlns: "http://www.w3.org/2000/svg",
17868
18309
  className: "plc-w-5 plc-h-5",
17869
18310
  fill: "none",
17870
18311
  viewBox: "0 0 24 24",
17871
18312
  stroke: "currentColor"
17872
- }, props), _path$c || (_path$c = /*#__PURE__*/React.createElement("path", {
18313
+ }, props), _path$d || (_path$d = /*#__PURE__*/React.createElement("path", {
17873
18314
  strokeLinecap: "round",
17874
18315
  strokeLinejoin: "round",
17875
18316
  strokeWidth: 2,
@@ -18856,8 +19297,8 @@ const PaymentMethodSelectModal = ({
18856
19297
  };
18857
19298
  PaymentMethodSelectModal.viewId = "payment-method-select";
18858
19299
 
18859
- function _extends$d() {
18860
- _extends$d = Object.assign || function (target) {
19300
+ function _extends$e() {
19301
+ _extends$e = Object.assign || function (target) {
18861
19302
  for (var i = 1; i < arguments.length; i++) {
18862
19303
  var source = arguments[i];
18863
19304
 
@@ -18871,7 +19312,7 @@ function _extends$d() {
18871
19312
  return target;
18872
19313
  };
18873
19314
 
18874
- return _extends$d.apply(this, arguments);
19315
+ return _extends$e.apply(this, arguments);
18875
19316
  }
18876
19317
 
18877
19318
  function _objectWithoutPropertiesLoose(source, excluded) {
@@ -19055,7 +19496,7 @@ function render(props, propsBag, defaultTag, features, visible) {
19055
19496
  return match(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function () {
19056
19497
  return null;
19057
19498
  }, _match[RenderStrategy.Hidden] = function () {
19058
- return _render(_extends$d({}, _rest, {
19499
+ return _render(_extends$e({}, _rest, {
19059
19500
  hidden: true,
19060
19501
  style: {
19061
19502
  display: 'none'
@@ -19583,7 +20024,7 @@ function TransitionChild(props) {
19583
20024
  var passthroughProps = rest;
19584
20025
  return React__default.createElement(NestingContext.Provider, {
19585
20026
  value: nesting
19586
- }, render(_extends$d({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
20027
+ }, render(_extends$e({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
19587
20028
  }
19588
20029
 
19589
20030
  function Transition(props) {
@@ -19627,7 +20068,7 @@ function Transition(props) {
19627
20068
  value: nestingBag
19628
20069
  }, React__default.createElement(TransitionContext.Provider, {
19629
20070
  value: transitionBag
19630
- }, render(_extends$d({}, sharedProps, {
20071
+ }, render(_extends$e({}, sharedProps, {
19631
20072
  as: Fragment,
19632
20073
  children: React__default.createElement(TransitionChild, Object.assign({}, sharedProps, passthroughProps))
19633
20074
  }), propsBag, Fragment, TransitionChildRenderFeatures, state === TreeStates.Visible)));
@@ -19754,12 +20195,12 @@ var ActionTypes;
19754
20195
  })(ActionTypes || (ActionTypes = {}));
19755
20196
 
19756
20197
  (_reducers = {}, _reducers[ActionTypes.CloseMenu] = function (state) {
19757
- return _extends$d({}, state, {
20198
+ return _extends$e({}, state, {
19758
20199
  activeItemIndex: null,
19759
20200
  menuState: MenuStates.Closed
19760
20201
  });
19761
20202
  }, _reducers[ActionTypes.OpenMenu] = function (state) {
19762
- return _extends$d({}, state, {
20203
+ return _extends$e({}, state, {
19763
20204
  menuState: MenuStates.Open
19764
20205
  });
19765
20206
  }, _reducers[ActionTypes.GoToItem] = function (state, action) {
@@ -19778,7 +20219,7 @@ var ActionTypes;
19778
20219
  }
19779
20220
  });
19780
20221
  if (state.searchQuery === '' && state.activeItemIndex === activeItemIndex) return state;
19781
- return _extends$d({}, state, {
20222
+ return _extends$e({}, state, {
19782
20223
  searchQuery: '',
19783
20224
  activeItemIndex: activeItemIndex
19784
20225
  });
@@ -19789,19 +20230,19 @@ var ActionTypes;
19789
20230
 
19790
20231
  return ((_item$dataRef$current = item.dataRef.current.textValue) == null ? void 0 : _item$dataRef$current.startsWith(searchQuery)) && !item.dataRef.current.disabled;
19791
20232
  });
19792
- if (match === -1 || match === state.activeItemIndex) return _extends$d({}, state, {
20233
+ if (match === -1 || match === state.activeItemIndex) return _extends$e({}, state, {
19793
20234
  searchQuery: searchQuery
19794
20235
  });
19795
- return _extends$d({}, state, {
20236
+ return _extends$e({}, state, {
19796
20237
  searchQuery: searchQuery,
19797
20238
  activeItemIndex: match
19798
20239
  });
19799
20240
  }, _reducers[ActionTypes.ClearSearch] = function (state) {
19800
- return _extends$d({}, state, {
20241
+ return _extends$e({}, state, {
19801
20242
  searchQuery: ''
19802
20243
  });
19803
20244
  }, _reducers[ActionTypes.RegisterItem] = function (state, action) {
19804
- return _extends$d({}, state, {
20245
+ return _extends$e({}, state, {
19805
20246
  items: [].concat(state.items, [{
19806
20247
  id: action.id,
19807
20248
  dataRef: action.dataRef
@@ -19814,7 +20255,7 @@ var ActionTypes;
19814
20255
  return a.id === action.id;
19815
20256
  });
19816
20257
  if (idx !== -1) nextItems.splice(idx, 1);
19817
- return _extends$d({}, state, {
20258
+ return _extends$e({}, state, {
19818
20259
  items: nextItems,
19819
20260
  activeItemIndex: function () {
19820
20261
  if (idx === state.activeItemIndex) return null;
@@ -19853,19 +20294,19 @@ var ActionTypes$1;
19853
20294
  (_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = function (state) {
19854
20295
  if (state.disabled) return state;
19855
20296
  if (state.listboxState === ListboxStates.Closed) return state;
19856
- return _extends$d({}, state, {
20297
+ return _extends$e({}, state, {
19857
20298
  activeOptionIndex: null,
19858
20299
  listboxState: ListboxStates.Closed
19859
20300
  });
19860
20301
  }, _reducers$1[ActionTypes$1.OpenListbox] = function (state) {
19861
20302
  if (state.disabled) return state;
19862
20303
  if (state.listboxState === ListboxStates.Open) return state;
19863
- return _extends$d({}, state, {
20304
+ return _extends$e({}, state, {
19864
20305
  listboxState: ListboxStates.Open
19865
20306
  });
19866
20307
  }, _reducers$1[ActionTypes$1.SetDisabled] = function (state, action) {
19867
20308
  if (state.disabled === action.disabled) return state;
19868
- return _extends$d({}, state, {
20309
+ return _extends$e({}, state, {
19869
20310
  disabled: action.disabled
19870
20311
  });
19871
20312
  }, _reducers$1[ActionTypes$1.GoToOption] = function (state, action) {
@@ -19886,7 +20327,7 @@ var ActionTypes$1;
19886
20327
  }
19887
20328
  });
19888
20329
  if (state.searchQuery === '' && state.activeOptionIndex === activeOptionIndex) return state;
19889
- return _extends$d({}, state, {
20330
+ return _extends$e({}, state, {
19890
20331
  searchQuery: '',
19891
20332
  activeOptionIndex: activeOptionIndex
19892
20333
  });
@@ -19899,10 +20340,10 @@ var ActionTypes$1;
19899
20340
 
19900
20341
  return !option.dataRef.current.disabled && ((_option$dataRef$curre = option.dataRef.current.textValue) == null ? void 0 : _option$dataRef$curre.startsWith(searchQuery));
19901
20342
  });
19902
- if (match === -1 || match === state.activeOptionIndex) return _extends$d({}, state, {
20343
+ if (match === -1 || match === state.activeOptionIndex) return _extends$e({}, state, {
19903
20344
  searchQuery: searchQuery
19904
20345
  });
19905
- return _extends$d({}, state, {
20346
+ return _extends$e({}, state, {
19906
20347
  searchQuery: searchQuery,
19907
20348
  activeOptionIndex: match
19908
20349
  });
@@ -19910,11 +20351,11 @@ var ActionTypes$1;
19910
20351
  if (state.disabled) return state;
19911
20352
  if (state.listboxState === ListboxStates.Closed) return state;
19912
20353
  if (state.searchQuery === '') return state;
19913
- return _extends$d({}, state, {
20354
+ return _extends$e({}, state, {
19914
20355
  searchQuery: ''
19915
20356
  });
19916
20357
  }, _reducers$1[ActionTypes$1.RegisterOption] = function (state, action) {
19917
- return _extends$d({}, state, {
20358
+ return _extends$e({}, state, {
19918
20359
  options: [].concat(state.options, [{
19919
20360
  id: action.id,
19920
20361
  dataRef: action.dataRef
@@ -19927,7 +20368,7 @@ var ActionTypes$1;
19927
20368
  return a.id === action.id;
19928
20369
  });
19929
20370
  if (idx !== -1) nextOptions.splice(idx, 1);
19930
- return _extends$d({}, state, {
20371
+ return _extends$e({}, state, {
19931
20372
  options: nextOptions,
19932
20373
  activeOptionIndex: function () {
19933
20374
  if (idx === state.activeOptionIndex) return null;
@@ -19988,18 +20429,18 @@ const getPaymentCardIcon = name => {
19988
20429
  }));
19989
20430
  };
19990
20431
 
19991
- var _path$b;
20432
+ var _path$c;
19992
20433
 
19993
- function _extends$c() { _extends$c = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$c.apply(this, arguments); }
20434
+ function _extends$d() { _extends$d = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$d.apply(this, arguments); }
19994
20435
 
19995
20436
  function SvgChevronRight(props) {
19996
- return /*#__PURE__*/React.createElement("svg", _extends$c({
20437
+ return /*#__PURE__*/React.createElement("svg", _extends$d({
19997
20438
  className: "plc-w-6 plc-h-6",
19998
20439
  xmlns: "http://www.w3.org/2000/svg",
19999
20440
  fill: "none",
20000
20441
  viewBox: "0 0 24 24",
20001
20442
  stroke: "currentColor"
20002
- }, props), _path$b || (_path$b = /*#__PURE__*/React.createElement("path", {
20443
+ }, props), _path$c || (_path$c = /*#__PURE__*/React.createElement("path", {
20003
20444
  strokeLinecap: "round",
20004
20445
  strokeLinejoin: "round",
20005
20446
  strokeWidth: 2,
@@ -20298,18 +20739,18 @@ Accordion.item = function AccordionItem({
20298
20739
  }, content)) : null;
20299
20740
  };
20300
20741
 
20301
- var _path$a;
20742
+ var _path$b;
20302
20743
 
20303
- function _extends$b() { _extends$b = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$b.apply(this, arguments); }
20744
+ function _extends$c() { _extends$c = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$c.apply(this, arguments); }
20304
20745
 
20305
20746
  function SvgExit(props) {
20306
- return /*#__PURE__*/React.createElement("svg", _extends$b({
20747
+ return /*#__PURE__*/React.createElement("svg", _extends$c({
20307
20748
  className: "plc-w-6 plc-h-6",
20308
20749
  xmlns: "http://www.w3.org/2000/svg",
20309
20750
  fill: "none",
20310
20751
  viewBox: "0 0 24 24",
20311
20752
  stroke: "currentColor"
20312
- }, props), _path$a || (_path$a = /*#__PURE__*/React.createElement("path", {
20753
+ }, props), _path$b || (_path$b = /*#__PURE__*/React.createElement("path", {
20313
20754
  strokeLinecap: "round",
20314
20755
  strokeLinejoin: "round",
20315
20756
  strokeWidth: 2,
@@ -20317,30 +20758,49 @@ function SvgExit(props) {
20317
20758
  })));
20318
20759
  }
20319
20760
 
20320
- var _path$9;
20761
+ var _path$a;
20321
20762
 
20322
- function _extends$a() { _extends$a = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$a.apply(this, arguments); }
20763
+ function _extends$b() { _extends$b = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$b.apply(this, arguments); }
20323
20764
 
20324
20765
  function SvgCheckMark(props) {
20325
- return /*#__PURE__*/React.createElement("svg", _extends$a({
20766
+ return /*#__PURE__*/React.createElement("svg", _extends$b({
20326
20767
  className: "plc-w-4 plc-h-4 plc-mr-1",
20327
20768
  xmlns: "http://www.w3.org/2000/svg",
20328
20769
  viewBox: "0 0 20 20",
20329
20770
  fill: "currentColor"
20330
- }, props), _path$9 || (_path$9 = /*#__PURE__*/React.createElement("path", {
20771
+ }, props), _path$a || (_path$a = /*#__PURE__*/React.createElement("path", {
20331
20772
  fillRule: "evenodd",
20332
20773
  d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",
20333
20774
  clipRule: "evenodd"
20334
20775
  })));
20335
20776
  }
20336
20777
 
20778
+ var _path$9;
20779
+
20780
+ function _extends$a() { _extends$a = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$a.apply(this, arguments); }
20781
+
20782
+ function SvgUser(props) {
20783
+ return /*#__PURE__*/React.createElement("svg", _extends$a({
20784
+ xmlns: "http://www.w3.org/2000/svg",
20785
+ fill: "none",
20786
+ viewBox: "0 0 24 24",
20787
+ stroke: "currentColor"
20788
+ }, props), _path$9 || (_path$9 = /*#__PURE__*/React.createElement("path", {
20789
+ strokeLinecap: "round",
20790
+ strokeLinejoin: "round",
20791
+ strokeWidth: 2,
20792
+ d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zm-4 7a7 7 0 00-7 7h14a7 7 0 00-7-7z"
20793
+ })));
20794
+ }
20795
+
20337
20796
  var _path$8;
20338
20797
 
20339
20798
  function _extends$9() { _extends$9 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$9.apply(this, arguments); }
20340
20799
 
20341
- function SvgUser(props) {
20800
+ function SvgNewsletter(props) {
20342
20801
  return /*#__PURE__*/React.createElement("svg", _extends$9({
20343
20802
  xmlns: "http://www.w3.org/2000/svg",
20803
+ className: "plc-h-5 plc-w-5",
20344
20804
  fill: "none",
20345
20805
  viewBox: "0 0 24 24",
20346
20806
  stroke: "currentColor"
@@ -20348,7 +20808,7 @@ function SvgUser(props) {
20348
20808
  strokeLinecap: "round",
20349
20809
  strokeLinejoin: "round",
20350
20810
  strokeWidth: 2,
20351
- d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zm-4 7a7 7 0 00-7 7h14a7 7 0 00-7-7z"
20811
+ d: "M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"
20352
20812
  })));
20353
20813
  }
20354
20814
 
@@ -20587,6 +21047,24 @@ class Dashboard extends Component {
20587
21047
  });
20588
21048
  });
20589
21049
 
21050
+ _defineProperty$3(this, "componentWillUnmount", () => {
21051
+ document.removeEventListener("click", this.hideMenuIfClickedOutside);
21052
+ });
21053
+
21054
+ _defineProperty$3(this, "initializeHideMenuHandler", () => {
21055
+ document.addEventListener("click", this.hideMenuIfClickedOutside);
21056
+ });
21057
+
21058
+ _defineProperty$3(this, "hideMenuIfClickedOutside", event => {
21059
+ const didClickOutsideMenu = this.state.isOpen && this.menuRef.current && !this.menuRef.current.contains(event.target);
21060
+
21061
+ if (didClickOutsideMenu) {
21062
+ this.setState({
21063
+ isOpen: false
21064
+ });
21065
+ }
21066
+ });
21067
+
20590
21068
  _defineProperty$3(this, "cancelSubscription", (subscription_id, onSuccess, onFailure) => {
20591
21069
  // disable the Login button to prevent repeated clicks
20592
21070
  window.Pelcro.subscription.cancel({
@@ -20624,6 +21102,10 @@ class Dashboard extends Component {
20624
21102
  return this.props.setView("password-change");
20625
21103
  });
20626
21104
 
21105
+ _defineProperty$3(this, "displayNewsletterUpdate", () => {
21106
+ return this.props.setView("newsletter-update");
21107
+ });
21108
+
20627
21109
  _defineProperty$3(this, "displayProductSelect", ({
20628
21110
  isGift
20629
21111
  }) => {
@@ -20743,6 +21225,8 @@ class Dashboard extends Component {
20743
21225
  loadingMessage: this.locale("messages.subCancellation.loading"),
20744
21226
  successMessage: this.locale("messages.subCancellation.success"),
20745
21227
  errorMessage: this.locale("messages.subCancellation.error")
21228
+ }, {
21229
+ closeButtonLabel: this.locale("labels.subCancellation.goBack")
20746
21230
  });
20747
21231
  }; // Reactivate button click handlers
20748
21232
 
@@ -20781,21 +21265,21 @@ class Dashboard extends Component {
20781
21265
  className: "plc-inline-block plc-mt-1"
20782
21266
  }, sub.shipments_remaining, " ", this.locale("labels.shipments")) : null)), /*#__PURE__*/React__default.createElement("td", null, sub.cancel_at_period_end === 0 && /*#__PURE__*/React__default.createElement(Button, {
20783
21267
  variant: "ghost",
20784
- className: "plc-text-red-500 focus:plc-ring-red-500",
21268
+ className: "plc-text-red-500 focus:plc-ring-red-500 pelcro-dashoard-sub-cancel-button",
20785
21269
  icon: /*#__PURE__*/React__default.createElement(SvgXIconSolid, null),
20786
21270
  onClick: onCancelClick,
20787
21271
  disabled: this.state.disableSubmit,
20788
21272
  "data-key": sub.id
20789
21273
  }, this.locale("labels.unsubscribe")), sub.cancel_at_period_end === 1 && sub.plan.auto_renew && !sub.is_gift_recipient && /*#__PURE__*/React__default.createElement(Button, {
20790
21274
  variant: "ghost",
20791
- className: "plc-text-green-400 focus:plc-ring-green-300",
21275
+ className: "plc-text-green-400 focus:plc-ring-green-300 pelcro-dashoard-sub-reactivate-button",
20792
21276
  icon: /*#__PURE__*/React__default.createElement(SvgRefresh, null),
20793
21277
  onClick: onReactivateClick,
20794
21278
  disabled: this.state.disableSubmit,
20795
21279
  "data-key": sub.id
20796
21280
  }, this.locale("labels.reactivate")), sub.cancel_at_period_end === 1 && /*#__PURE__*/React__default.createElement(Button, {
20797
21281
  variant: "ghost",
20798
- className: "plc-text-blue-400",
21282
+ className: "plc-text-blue-400 pelcro-dashoard-sub-renew-button",
20799
21283
  icon: /*#__PURE__*/React__default.createElement(SvgRefresh, null),
20800
21284
  onClick: onRenewClick,
20801
21285
  disabled: this.state.disableSubmit,
@@ -20976,28 +21460,33 @@ class Dashboard extends Component {
20976
21460
  this.site = window.Pelcro.site.read();
20977
21461
  this.locale = this.props.t;
20978
21462
  this.user = window.Pelcro.user.read();
21463
+ this.menuRef = /*#__PURE__*/React__default.createRef();
20979
21464
  }
20980
21465
 
20981
21466
  render() {
20982
- var _window$Pelcro$user$r3, _this$user$source, _this$user$source$pro, _this$user$source2, _this$user$source2$pr;
21467
+ var _window$Pelcro$user$r3, _window$Pelcro, _window$Pelcro$uiSett, _this$user$source, _this$user$source$pro, _this$user$source2, _this$user$source2$pr;
20983
21468
 
20984
21469
  const {
20985
21470
  isOpen
20986
21471
  } = this.state;
20987
21472
  const userHasName = this.user.first_name || this.user.last_name;
20988
21473
  const profilePicture = (_window$Pelcro$user$r3 = window.Pelcro.user.read().profile_photo) !== null && _window$Pelcro$user$r3 !== void 0 ? _window$Pelcro$user$r3 : userSolidIcon;
21474
+ const newsletters = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.newsletters;
21475
+ const siteHasNewslettersDefined = Array.isArray(newsletters) && newsletters.length > 0;
20989
21476
  return /*#__PURE__*/React__default.createElement(Transition, {
20990
21477
  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",
20991
21478
  show: isOpen,
20992
21479
  enter: "plc-transform plc-transition plc-duration-500",
20993
21480
  enterFrom: "plc-translate-x-full",
20994
21481
  enterTo: "plc-translate-x-0",
21482
+ afterEnter: this.initializeHideMenuHandler,
20995
21483
  leave: "plc-transform plc-transition plc-duration-500",
20996
21484
  leaveFrom: "plc-translate-x-0",
20997
21485
  leaveTo: "plc-translate-x-full",
20998
21486
  afterLeave: this.props.onClose
20999
21487
  }, /*#__PURE__*/React__default.createElement("div", {
21000
- id: "pelcro-view-dashboard"
21488
+ id: "pelcro-view-dashboard",
21489
+ ref: this.menuRef
21001
21490
  }, /*#__PURE__*/React__default.createElement("header", {
21002
21491
  className: "plc-flex plc-flex-col plc-p-4 plc-pl-2 plc-min-h-40 sm:plc-pr-8 plc-bg-primary-500"
21003
21492
  }, /*#__PURE__*/React__default.createElement("div", {
@@ -21060,7 +21549,14 @@ class Dashboard extends Component {
21060
21549
  }),
21061
21550
  className: "plc-text-sm plc-text-gray-500 hover:plc-text-primary-700",
21062
21551
  onClick: this.displayChangePassword
21063
- }, this.locale("labels.changePassword")))
21552
+ }, this.locale("labels.changePassword")), siteHasNewslettersDefined && /*#__PURE__*/React__default.createElement(Button, {
21553
+ variant: "ghost",
21554
+ icon: /*#__PURE__*/React__default.createElement(SvgNewsletter, {
21555
+ className: "plc-w-5 plc-h-5 plc-mr-1"
21556
+ }),
21557
+ className: "plc-text-sm plc-text-gray-500 hover:plc-text-primary-700",
21558
+ onClick: this.displayNewsletterUpdate
21559
+ }, this.locale("labels.editNewsletters")))
21064
21560
  }), /*#__PURE__*/React__default.createElement(Accordion.item, {
21065
21561
  name: SUB_MENUS.PAYMENT_CARDS,
21066
21562
  icon: /*#__PURE__*/React__default.createElement(SvgPaymentCard, null),
@@ -21136,7 +21632,7 @@ const DashboardOpenButton = () => {
21136
21632
  return /*#__PURE__*/React__default.createElement("div", {
21137
21633
  className: "plc-fixed plc-right-4 plc-bottom-4 pelcro-open-dashboard-btn"
21138
21634
  }, /*#__PURE__*/React__default.createElement("button", {
21139
- className: "plc-bg-white plc-border-2 plc-rounded-full focus:plc-outline-none plc-border-primary-300",
21635
+ className: "plc-bg-white plc-border-2 plc-rounded-full focus:plc-outline-none plc-border-primary-300 hover:plc-bg-white",
21140
21636
  name: "menu",
21141
21637
  id: "pelcro-view-menu",
21142
21638
  onClick: () => switchView("dashboard")
@@ -22969,4 +23465,4 @@ function ProfilePicChangeModal({
22969
23465
  }
22970
23466
  ProfilePicChangeModal.viewId = "profile-picture";
22971
23467
 
22972
- export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, ApplyCouponButton, Badge, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, Email, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, Input, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCreateContainer, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, TextArea, Tooltip, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, notify, unauthenticatedButtons, usePelcro };
23468
+ export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplyCouponButton, Badge, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, Email, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, Input, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCreateContainer, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, TaxAmount, TextArea, Tooltip, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, notify, unauthenticatedButtons, usePelcro };