@pelcro/react-pelcro-js 3.2.0-beta.1 → 3.2.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -3461,9 +3461,9 @@ var paymentMethod_fr = {
3461
3461
  select: select
3462
3462
  };
3463
3463
 
3464
- var title$f = "Enter your email to subscribe to our newsletter";
3464
+ var title$h = "Enter your email to subscribe to our newsletter";
3465
3465
  var updateTitle$1 = "Update newsletter selections";
3466
- var subtitle$7 = "We may use your email for other marketing communication";
3466
+ var subtitle$9 = "We may use your email for other marketing communication";
3467
3467
  var labels$p = {
3468
3468
  submit: "Submit",
3469
3469
  firstName: "First name",
@@ -3480,16 +3480,16 @@ var messages$r = {
3480
3480
  here: "here"
3481
3481
  };
3482
3482
  var newsletter_en = {
3483
- title: title$f,
3483
+ title: title$h,
3484
3484
  updateTitle: updateTitle$1,
3485
- subtitle: subtitle$7,
3485
+ subtitle: subtitle$9,
3486
3486
  labels: labels$p,
3487
3487
  messages: messages$r
3488
3488
  };
3489
3489
 
3490
- var title$e = "Entrez votre adresse courriel pour vous abonner à notre infolettre";
3490
+ var title$g = "Entrez votre adresse courriel pour vous abonner à notre infolettre";
3491
3491
  var updateTitle = "Mettre à jour son choix d'infolettres";
3492
- var subtitle$6 = "Nous pouvons utiliser votre adresse courriel pour d’autres communications marketing";
3492
+ var subtitle$8 = "Nous pouvons utiliser votre adresse courriel pour d’autres communications marketing";
3493
3493
  var labels$o = {
3494
3494
  submit: "Lire l’article !",
3495
3495
  firstName: "Prénom",
@@ -3506,9 +3506,9 @@ var messages$q = {
3506
3506
  here: "ici"
3507
3507
  };
3508
3508
  var newsletter_fr = {
3509
- title: title$e,
3509
+ title: title$g,
3510
3510
  updateTitle: updateTitle,
3511
- subtitle: subtitle$6,
3511
+ subtitle: subtitle$8,
3512
3512
  labels: labels$o,
3513
3513
  messages: messages$q
3514
3514
  };
@@ -3765,8 +3765,8 @@ var login_fr = {
3765
3765
  errors: errors$4
3766
3766
  };
3767
3767
 
3768
- var title$d = "Create an account";
3769
- var subtitle$5 = "Enter your email and password below";
3768
+ var title$f = "Create an account";
3769
+ var subtitle$7 = "Enter your email and password below";
3770
3770
  var labels$h = {
3771
3771
  signUpFacebook: "Sign up with Facebook",
3772
3772
  signUpGoogle: "Sign up with Google",
@@ -3851,8 +3851,8 @@ var redeem$1 = {
3851
3851
  }
3852
3852
  };
3853
3853
  var register_en = {
3854
- title: title$d,
3855
- subtitle: subtitle$5,
3854
+ title: title$f,
3855
+ subtitle: subtitle$7,
3856
3856
  labels: labels$h,
3857
3857
  messages: messages$h,
3858
3858
  errors: errors$3,
@@ -3860,8 +3860,8 @@ var register_en = {
3860
3860
  redeem: redeem$1
3861
3861
  };
3862
3862
 
3863
- var title$c = "Créer un compte";
3864
- var subtitle$4 = "Entrez votre courriel et votre mot de passe ci-dessous";
3863
+ var title$e = "Créer un compte";
3864
+ var subtitle$6 = "Entrez votre courriel et votre mot de passe ci-dessous";
3865
3865
  var labels$g = {
3866
3866
  signUpFacebook: "Inscrivez-vous avec Facebook",
3867
3867
  signUpGoogle: "Inscrivez-vous avec Google",
@@ -3947,8 +3947,8 @@ var redeem = {
3947
3947
  }
3948
3948
  };
3949
3949
  var register_fr = {
3950
- title: title$c,
3951
- subtitle: subtitle$4,
3950
+ title: title$e,
3951
+ subtitle: subtitle$6,
3952
3952
  labels: labels$g,
3953
3953
  messages: messages$g,
3954
3954
  errors: errors$2,
@@ -4008,7 +4008,7 @@ var userEdit_fr = {
4008
4008
  messages: messages$e
4009
4009
  };
4010
4010
 
4011
- var title$b = "Enter your shipping address";
4011
+ var title$d = "Enter your shipping address";
4012
4012
  var selectAddressTitle$1 = "Please select an address";
4013
4013
  var selectAddressSubtitle$1 = "Select one of your saved addresses, or add a new one";
4014
4014
  var labels$d = {
@@ -4031,7 +4031,7 @@ var messages$d = {
4031
4031
  subRedeemed: "Your subscription has been redeemed."
4032
4032
  };
4033
4033
  var address_en = {
4034
- title: title$b,
4034
+ title: title$d,
4035
4035
  selectAddressTitle: selectAddressTitle$1,
4036
4036
  selectAddressSubtitle: selectAddressSubtitle$1,
4037
4037
  labels: labels$d,
@@ -4039,7 +4039,7 @@ var address_en = {
4039
4039
  messages: messages$d
4040
4040
  };
4041
4041
 
4042
- var title$a = "Entrez votre adresse de livraison";
4042
+ var title$c = "Entrez votre adresse de livraison";
4043
4043
  var selectAddressTitle = "Veuillez sélectionner une adresse";
4044
4044
  var selectAddressSubtitle = "Choisissez l'une de vos adresses ou créez-en une nouvelle";
4045
4045
  var labels$c = {
@@ -4062,7 +4062,7 @@ var messages$c = {
4062
4062
  subRedeemed: "Votre abonnement a bien été activé."
4063
4063
  };
4064
4064
  var address_fr = {
4065
- title: title$a,
4065
+ title: title$c,
4066
4066
  selectAddressTitle: selectAddressTitle,
4067
4067
  selectAddressSubtitle: selectAddressSubtitle,
4068
4068
  labels: labels$c,
@@ -4070,8 +4070,8 @@ var address_fr = {
4070
4070
  messages: messages$c
4071
4071
  };
4072
4072
 
4073
- var title$9 = "Reset your password";
4074
- var subtitle$3 = "Enter a new password below";
4073
+ var title$b = "Reset your password";
4074
+ var subtitle$5 = "Enter a new password below";
4075
4075
  var email$3 = "Email";
4076
4076
  var password$3 = "Password";
4077
4077
  var confirmPassword$1 = "Confirm password";
@@ -4079,8 +4079,8 @@ var submit$5 = "Submit";
4079
4079
  var required$5 = "Required";
4080
4080
  var passwordUpdated$1 = "Password has been updated, please login with the new password";
4081
4081
  var passwordReset_en = {
4082
- title: title$9,
4083
- subtitle: subtitle$3,
4082
+ title: title$b,
4083
+ subtitle: subtitle$5,
4084
4084
  email: email$3,
4085
4085
  password: password$3,
4086
4086
  confirmPassword: confirmPassword$1,
@@ -4089,8 +4089,8 @@ var passwordReset_en = {
4089
4089
  passwordUpdated: passwordUpdated$1
4090
4090
  };
4091
4091
 
4092
- var title$8 = "Réinitialiser votre mot de passe";
4093
- var subtitle$2 = "Entrez un nouveau mot de passe ci-dessous";
4092
+ var title$a = "Réinitialiser votre mot de passe";
4093
+ var subtitle$4 = "Entrez un nouveau mot de passe ci-dessous";
4094
4094
  var email$2 = "Adresse courriel";
4095
4095
  var password$2 = "Mot de passe";
4096
4096
  var confirmPassword = "Confirmer le mot de passe";
@@ -4098,8 +4098,8 @@ var submit$4 = "Soumettre";
4098
4098
  var required$4 = "Champs obligatoires";
4099
4099
  var passwordUpdated = "Votre mot de passe a été mis à jour, veuillez vous connecter avec celui-ci";
4100
4100
  var passwordReset_fr = {
4101
- title: title$8,
4102
- subtitle: subtitle$2,
4101
+ title: title$a,
4102
+ subtitle: subtitle$4,
4103
4103
  email: email$2,
4104
4104
  password: password$2,
4105
4105
  confirmPassword: confirmPassword,
@@ -4108,7 +4108,7 @@ var passwordReset_fr = {
4108
4108
  passwordUpdated: passwordUpdated
4109
4109
  };
4110
4110
 
4111
- var title$7 = "Forgot your password?";
4111
+ var title$9 = "Forgot your password?";
4112
4112
  var email$1 = "Email";
4113
4113
  var password$1 = "Password";
4114
4114
  var submit$3 = "Submit";
@@ -4119,7 +4119,7 @@ var messages$b = {
4119
4119
  loginHere: "login here."
4120
4120
  };
4121
4121
  var passwordForgot_en = {
4122
- title: title$7,
4122
+ title: title$9,
4123
4123
  email: email$1,
4124
4124
  password: password$1,
4125
4125
  submit: submit$3,
@@ -4128,7 +4128,7 @@ var passwordForgot_en = {
4128
4128
  messages: messages$b
4129
4129
  };
4130
4130
 
4131
- var title$6 = "Mot de passe oublié ?";
4131
+ var title$8 = "Mot de passe oublié ?";
4132
4132
  var email = "Courriel";
4133
4133
  var password = "Mot de passe";
4134
4134
  var submit$2 = "Soumettre";
@@ -4139,7 +4139,7 @@ var messages$a = {
4139
4139
  loginHere: "Connectez-vous ici"
4140
4140
  };
4141
4141
  var passwordForgot_fr = {
4142
- title: title$6,
4142
+ title: title$8,
4143
4143
  email: email,
4144
4144
  password: password,
4145
4145
  submit: submit$2,
@@ -4148,7 +4148,7 @@ var passwordForgot_fr = {
4148
4148
  messages: messages$a
4149
4149
  };
4150
4150
 
4151
- var title$5 = "Change your password";
4151
+ var title$7 = "Change your password";
4152
4152
  var currentPassword$1 = "Current password";
4153
4153
  var newPassword$1 = "New password";
4154
4154
  var confirmNewPassword$1 = "Confirm new password";
@@ -4158,7 +4158,7 @@ var passwordChanged$1 = "Password has been changed, please login with the new pa
4158
4158
  var passwordsNotMatching$1 = "Passwords don't match";
4159
4159
  var weakPassword$1 = "Your password must contain at least 6 characters";
4160
4160
  var passwordChange_en = {
4161
- title: title$5,
4161
+ title: title$7,
4162
4162
  currentPassword: currentPassword$1,
4163
4163
  newPassword: newPassword$1,
4164
4164
  confirmNewPassword: confirmNewPassword$1,
@@ -4169,7 +4169,7 @@ var passwordChange_en = {
4169
4169
  weakPassword: weakPassword$1
4170
4170
  };
4171
4171
 
4172
- var title$4 = "Changez votre mot de passe";
4172
+ var title$6 = "Changez votre mot de passe";
4173
4173
  var currentPassword = "Mot de passe actuel";
4174
4174
  var newPassword = "Nouveau mot de passe";
4175
4175
  var confirmNewPassword = "Confirmer le nouveau mot de passe";
@@ -4179,7 +4179,7 @@ var passwordChanged = "Le mot de passe a été modifié, veuillez vous connecter
4179
4179
  var passwordsNotMatching = "Les mots de passe ne correspondent pas";
4180
4180
  var weakPassword = "Votre mot de passe doit contenir au moins 6";
4181
4181
  var passwordChange_fr = {
4182
- title: title$4,
4182
+ title: title$6,
4183
4183
  currentPassword: currentPassword,
4184
4184
  newPassword: newPassword,
4185
4185
  confirmNewPassword: confirmNewPassword,
@@ -4190,8 +4190,8 @@ var passwordChange_fr = {
4190
4190
  weakPassword: weakPassword
4191
4191
  };
4192
4192
 
4193
- var title$3 = "Votre panier";
4194
- var subtitle$1 = "Terminez votre achat ci-dessous";
4193
+ var title$5 = "Votre panier";
4194
+ var subtitle$3 = "Terminez votre achat ci-dessous";
4195
4195
  var name$1 = "Produit";
4196
4196
  var quantity$1 = "Quantité";
4197
4197
  var price$1 = "Prix";
@@ -4202,8 +4202,8 @@ var confirm$3 = "Passer à la caisse";
4202
4202
  var empty$1 = "Votre panier est vide.";
4203
4203
  var removeAll$1 = "Vider";
4204
4204
  var cart_fr = {
4205
- title: title$3,
4206
- subtitle: subtitle$1,
4205
+ title: title$5,
4206
+ subtitle: subtitle$3,
4207
4207
  name: name$1,
4208
4208
  quantity: quantity$1,
4209
4209
  price: price$1,
@@ -4215,8 +4215,8 @@ var cart_fr = {
4215
4215
  removeAll: removeAll$1
4216
4216
  };
4217
4217
 
4218
- var title$2 = "Your shopping cart";
4219
- var subtitle = "Comple your purchase below";
4218
+ var title$4 = "Your shopping cart";
4219
+ var subtitle$2 = "Comple your purchase below";
4220
4220
  var name = "Name";
4221
4221
  var quantity = "Quantity";
4222
4222
  var price = "Price";
@@ -4227,8 +4227,8 @@ var confirm$2 = "Checkout";
4227
4227
  var empty = "Your cart is empty.";
4228
4228
  var removeAll = "Remove all";
4229
4229
  var cart_en = {
4230
- title: title$2,
4231
- subtitle: subtitle,
4230
+ title: title$4,
4231
+ subtitle: subtitle$2,
4232
4232
  name: name,
4233
4233
  quantity: quantity,
4234
4234
  price: price,
@@ -4666,7 +4666,7 @@ var verifyEmail_fr = {
4666
4666
  messages: messages
4667
4667
  };
4668
4668
 
4669
- var title$1 = "Invoice details";
4669
+ var title$3 = "Invoice details";
4670
4670
  var labels$1 = {
4671
4671
  summary: "Summary",
4672
4672
  total: "Total",
@@ -4679,29 +4679,55 @@ var buttons$1 = {
4679
4679
  pay: "Pay now"
4680
4680
  };
4681
4681
  var invoiceDetails_en = {
4682
- title: title$1,
4682
+ title: title$3,
4683
4683
  labels: labels$1,
4684
4684
  buttons: buttons$1
4685
4685
  };
4686
4686
 
4687
- var title = "Invoice details";
4687
+ var title$2 = "Détails de la facture";
4688
4688
  var labels = {
4689
- summary: "Summary",
4689
+ summary: "Résumé",
4690
4690
  total: "Total",
4691
- amountPaid: "Amount paid",
4692
- amountDue: "Amount due",
4693
- creationDate: "Created on:"
4691
+ amountPaid: "Montant payé",
4692
+ amountDue: "Montant ",
4693
+ creationDate: "Créé le:"
4694
4694
  };
4695
4695
  var buttons = {
4696
- download: "Download",
4697
- pay: "Pay now"
4696
+ download: "Télécharger",
4697
+ pay: "Payer"
4698
4698
  };
4699
4699
  var invoiceDetails_fr = {
4700
- title: title,
4700
+ title: title$2,
4701
4701
  labels: labels,
4702
4702
  buttons: buttons
4703
4703
  };
4704
4704
 
4705
+ var title$1 = "Renewal options";
4706
+ var subtitle$1 = "Select one of the options below to continue";
4707
+ var next$1 = "Next";
4708
+ var addNew$1 = "Add Another Subscription";
4709
+ var renew$1 = "Renew Existing Subscription";
4710
+ var subscriptionOptions_en = {
4711
+ title: title$1,
4712
+ subtitle: subtitle$1,
4713
+ next: next$1,
4714
+ addNew: addNew$1,
4715
+ renew: renew$1
4716
+ };
4717
+
4718
+ var title = "Renewal options";
4719
+ var subtitle = "Select one of the options below to continue";
4720
+ var next = "Next";
4721
+ var addNew = "Add Another Subscription";
4722
+ var renew = "Renew Existing Subscription";
4723
+ var subscriptionOptions_fr = {
4724
+ title: title,
4725
+ subtitle: subtitle,
4726
+ next: next,
4727
+ addNew: addNew,
4728
+ renew: renew
4729
+ };
4730
+
4705
4731
  function create$1(createState) {
4706
4732
  let state;
4707
4733
  const listeners = new Set();
@@ -6051,7 +6077,7 @@ class PelcroActions {
6051
6077
  view,
6052
6078
  cartItems,
6053
6079
  ...otherStateFields
6054
- } = initialState$i;
6080
+ } = initialState$j;
6055
6081
  this.set(otherStateFields);
6056
6082
  });
6057
6083
 
@@ -6075,6 +6101,16 @@ class PelcroActions {
6075
6101
  });
6076
6102
  }
6077
6103
 
6104
+ if (view === "subscription-options") {
6105
+ const noRenewableProducts = getRenewableProducts().length === 0;
6106
+
6107
+ if (noRenewableProducts) {
6108
+ return this.set({
6109
+ view: "plan-select"
6110
+ });
6111
+ }
6112
+ }
6113
+
6078
6114
  this.set({
6079
6115
  view
6080
6116
  });
@@ -6149,6 +6185,26 @@ class PelcroActions {
6149
6185
  }
6150
6186
  });
6151
6187
 
6188
+ _defineProperty$3(this, "setProductsList", products => {
6189
+ if (!Array.isArray(products)) {
6190
+ return console.error(`setProductsList expects an array of products as an argument, got an argument of type ${typeof products} instead`);
6191
+ }
6192
+
6193
+ const allowedProducts = window.Pelcro.product.list();
6194
+ const validProducts = products.filter(product => {
6195
+ const isValidProduct = allowedProducts.some(allowedProduct => allowedProduct.id === (product === null || product === void 0 ? void 0 : product.id) && allowedProduct.name === (product === null || product === void 0 ? void 0 : product.name));
6196
+
6197
+ if (!isValidProduct) {
6198
+ console.warn(`setProductsList expects an array of products that exist in the list of valid products (window.Pelcro.product.list()), but it recieved a product which doesn't exist in that list:`, product);
6199
+ }
6200
+
6201
+ return isValidProduct;
6202
+ });
6203
+ this.set({
6204
+ productsList: validProducts
6205
+ });
6206
+ });
6207
+
6152
6208
  _defineProperty$3(this, "setProduct", id => {
6153
6209
  const product = window.Pelcro.product.getById(id);
6154
6210
  if (!product) return console.error("invalid product id");
@@ -6370,10 +6426,12 @@ class PelcroCallbacks {
6370
6426
 
6371
6427
  }
6372
6428
 
6373
- const initialState$i = {
6429
+ var _window$Pelcro$produc, _window$Pelcro;
6430
+ const initialState$j = {
6374
6431
  // View
6375
6432
  view: null,
6376
6433
  // Plans
6434
+ productsList: (_window$Pelcro$produc = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : _window$Pelcro.product.list()) !== null && _window$Pelcro$produc !== void 0 ? _window$Pelcro$produc : [],
6377
6435
  product: null,
6378
6436
  plan: null,
6379
6437
  isGift: false,
@@ -6400,7 +6458,7 @@ const createPelcroStore = () => createStore(middleware_3((set, get) => {
6400
6458
  return {
6401
6459
  // Store setter
6402
6460
  set,
6403
- ...initialState$i,
6461
+ ...initialState$j,
6404
6462
  // State actions
6405
6463
  ...actions,
6406
6464
  // Callbacks
@@ -6755,6 +6813,30 @@ function userMustVerifyEmail() {
6755
6813
  const isUserEmailVerified = (_window$Pelcro$user$r9 = (_window$Pelcro$user$r10 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r10 === void 0 ? void 0 : _window$Pelcro$user$r10.email_confirm) !== null && _window$Pelcro$user$r9 !== void 0 ? _window$Pelcro$user$r9 : false;
6756
6814
  return window.Pelcro.user.isAuthenticated() && isEmailVerificationEnabled && !isUserEmailVerified;
6757
6815
  }
6816
+ function getRenewableProducts() {
6817
+ var _window$Pelcro$subscr, _window$Pelcro$subscr2;
6818
+
6819
+ const renewableSubs = (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription.list()) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : _window$Pelcro$subscr2.filter(sub => sub.status === "active" && sub.cancel_at_period_end === 1)) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
6820
+ const renewableProductsIds = [...new Set(renewableSubs.map(sub => sub.plan.product.id))];
6821
+ const renewablePlansIds = [...new Set(renewableSubs.map(sub => sub.plan.id))];
6822
+ const {
6823
+ productsList
6824
+ } = usePelcro.getStore();
6825
+ return productsList.map(product => {
6826
+ if (renewableProductsIds.includes(product.id)) {
6827
+ const renewablePlans = getRenewablePlansOnly(product);
6828
+ return { ...product,
6829
+ plans: renewablePlans
6830
+ };
6831
+ }
6832
+ }).filter(product => product);
6833
+
6834
+ function getRenewablePlansOnly(product) {
6835
+ var _product$plans$filter, _product$plans;
6836
+
6837
+ return (_product$plans$filter = product === null || product === void 0 ? void 0 : (_product$plans = product.plans) === null || _product$plans === void 0 ? void 0 : _product$plans.filter(plan => renewablePlansIds.includes(plan.id))) !== null && _product$plans$filter !== void 0 ? _product$plans$filter : [];
6838
+ }
6839
+ }
6758
6840
 
6759
6841
  const resources = {
6760
6842
  en: {
@@ -6779,7 +6861,8 @@ const resources = {
6779
6861
  dashboard: dashboard_en,
6780
6862
  select: select_en,
6781
6863
  notification: notification_en,
6782
- invoiceDetails: invoiceDetails_en
6864
+ invoiceDetails: invoiceDetails_en,
6865
+ subscriptionOptions: subscriptionOptions_en
6783
6866
  },
6784
6867
  fr: {
6785
6868
  common: common_fr,
@@ -6803,7 +6886,8 @@ const resources = {
6803
6886
  dashboard: dashboard_fr,
6804
6887
  select: select_fr,
6805
6888
  notification: notification_fr,
6806
- invoiceDetails: invoiceDetails_fr
6889
+ invoiceDetails: invoiceDetails_fr,
6890
+ subscriptionOptions: subscriptionOptions_fr
6807
6891
  }
6808
6892
  }; // set UI language to the page language or default to the language in site settings
6809
6893
 
@@ -7094,8 +7178,8 @@ const saveToMetadataButton = new SaveToMetadataButtonClass();
7094
7178
 
7095
7179
  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}}
7096
7180
 
7097
- function _extends$y() {
7098
- _extends$y = Object.assign || function (target) {
7181
+ function _extends$A() {
7182
+ _extends$A = Object.assign || function (target) {
7099
7183
  for (var i = 1; i < arguments.length; i++) {
7100
7184
  var source = arguments[i];
7101
7185
 
@@ -7109,7 +7193,7 @@ function _extends$y() {
7109
7193
  return target;
7110
7194
  };
7111
7195
 
7112
- return _extends$y.apply(this, arguments);
7196
+ return _extends$A.apply(this, arguments);
7113
7197
  }
7114
7198
 
7115
7199
  function _taggedTemplateLiteralLoose(strings, raw) {
@@ -7199,7 +7283,7 @@ var clearFromRemoveQueue = function clearFromRemoveQueue(toastId) {
7199
7283
  var reducer = function reducer(state, action) {
7200
7284
  switch (action.type) {
7201
7285
  case ActionType.ADD_TOAST:
7202
- return _extends$y({}, state, {
7286
+ return _extends$A({}, state, {
7203
7287
  toasts: [action.toast].concat(state.toasts).slice(0, TOAST_LIMIT)
7204
7288
  });
7205
7289
 
@@ -7209,9 +7293,9 @@ var reducer = function reducer(state, action) {
7209
7293
  clearFromRemoveQueue(action.toast.id);
7210
7294
  }
7211
7295
 
7212
- return _extends$y({}, state, {
7296
+ return _extends$A({}, state, {
7213
7297
  toasts: state.toasts.map(function (t) {
7214
- return t.id === action.toast.id ? _extends$y({}, t, action.toast) : t;
7298
+ return t.id === action.toast.id ? _extends$A({}, t, action.toast) : t;
7215
7299
  })
7216
7300
  });
7217
7301
 
@@ -7238,9 +7322,9 @@ var reducer = function reducer(state, action) {
7238
7322
  });
7239
7323
  }
7240
7324
 
7241
- return _extends$y({}, state, {
7325
+ return _extends$A({}, state, {
7242
7326
  toasts: state.toasts.map(function (t) {
7243
- return t.id === toastId || toastId === undefined ? _extends$y({}, t, {
7327
+ return t.id === toastId || toastId === undefined ? _extends$A({}, t, {
7244
7328
  visible: false
7245
7329
  }) : t;
7246
7330
  })
@@ -7248,28 +7332,28 @@ var reducer = function reducer(state, action) {
7248
7332
 
7249
7333
  case ActionType.REMOVE_TOAST:
7250
7334
  if (action.toastId === undefined) {
7251
- return _extends$y({}, state, {
7335
+ return _extends$A({}, state, {
7252
7336
  toasts: []
7253
7337
  });
7254
7338
  }
7255
7339
 
7256
- return _extends$y({}, state, {
7340
+ return _extends$A({}, state, {
7257
7341
  toasts: state.toasts.filter(function (t) {
7258
7342
  return t.id !== action.toastId;
7259
7343
  })
7260
7344
  });
7261
7345
 
7262
7346
  case ActionType.START_PAUSE:
7263
- return _extends$y({}, state, {
7347
+ return _extends$A({}, state, {
7264
7348
  pausedAt: action.time
7265
7349
  });
7266
7350
 
7267
7351
  case ActionType.END_PAUSE:
7268
7352
  var diff = action.time - (state.pausedAt || 0);
7269
- return _extends$y({}, state, {
7353
+ return _extends$A({}, state, {
7270
7354
  pausedAt: undefined,
7271
7355
  toasts: state.toasts.map(function (t) {
7272
- return _extends$y({}, t, {
7356
+ return _extends$A({}, t, {
7273
7357
  pauseDuration: t.pauseDuration + diff
7274
7358
  });
7275
7359
  })
@@ -7316,12 +7400,12 @@ var useStore = function useStore(toastOptions) {
7316
7400
  var mergedToasts = state.toasts.map(function (t) {
7317
7401
  var _toastOptions$t$type, _toastOptions, _toastOptions$t$type2;
7318
7402
 
7319
- return _extends$y({}, toastOptions, toastOptions[t.type], t, {
7403
+ return _extends$A({}, toastOptions, toastOptions[t.type], t, {
7320
7404
  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],
7321
- style: _extends$y({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7405
+ style: _extends$A({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7322
7406
  });
7323
7407
  });
7324
- return _extends$y({}, state, {
7408
+ return _extends$A({}, state, {
7325
7409
  toasts: mergedToasts
7326
7410
  });
7327
7411
  };
@@ -7331,7 +7415,7 @@ var createToast = function createToast(message, type, opts) {
7331
7415
  type = 'blank';
7332
7416
  }
7333
7417
 
7334
- return _extends$y({
7418
+ return _extends$A({
7335
7419
  createdAt: Date.now(),
7336
7420
  visible: true,
7337
7421
  type: type,
@@ -7381,14 +7465,14 @@ toast.remove = function (toastId) {
7381
7465
  };
7382
7466
 
7383
7467
  toast.promise = function (promise, msgs, opts) {
7384
- var id = toast.loading(msgs.loading, _extends$y({}, opts, opts == null ? void 0 : opts.loading));
7468
+ var id = toast.loading(msgs.loading, _extends$A({}, opts, opts == null ? void 0 : opts.loading));
7385
7469
  promise.then(function (p) {
7386
- toast.success(resolveValue(msgs.success, p), _extends$y({
7470
+ toast.success(resolveValue(msgs.success, p), _extends$A({
7387
7471
  id: id
7388
7472
  }, opts, opts == null ? void 0 : opts.success));
7389
7473
  return p;
7390
7474
  })["catch"](function (e) {
7391
- toast.error(resolveValue(msgs.error, e), _extends$y({
7475
+ toast.error(resolveValue(msgs.error, e), _extends$A({
7392
7476
  id: id
7393
7477
  }, opts, opts == null ? void 0 : opts.error));
7394
7478
  });
@@ -7727,7 +7811,7 @@ var ToastBar = /*#__PURE__*/React.memo(function (_ref2) {
7727
7811
  var message = React.createElement(Message, Object.assign({}, toast.ariaProps), resolveValue(toast.message, toast));
7728
7812
  return React.createElement(ToastBarBase, {
7729
7813
  className: toast.className,
7730
- style: _extends$y({}, animationStyle, style, toast.style)
7814
+ style: _extends$A({}, animationStyle, style, toast.style)
7731
7815
  }, typeof children === 'function' ? children({
7732
7816
  icon: icon,
7733
7817
  message: message
@@ -7757,7 +7841,7 @@ var getPositionStyle = function getPositionStyle(position, offset) {
7757
7841
  } : position.includes('right') ? {
7758
7842
  justifyContent: 'flex-end'
7759
7843
  } : {};
7760
- return _extends$y({
7844
+ return _extends$A({
7761
7845
  left: 0,
7762
7846
  right: 0,
7763
7847
  display: 'flex',
@@ -7784,7 +7868,7 @@ var Toaster = function Toaster(_ref) {
7784
7868
  handlers = _useToaster.handlers;
7785
7869
 
7786
7870
  return React.createElement("div", {
7787
- style: _extends$y({
7871
+ style: _extends$A({
7788
7872
  position: 'fixed',
7789
7873
  zIndex: 9999,
7790
7874
  top: DEFAULT_OFFSET,
@@ -7819,82 +7903,82 @@ var Toaster = function Toaster(_ref) {
7819
7903
  }));
7820
7904
  };
7821
7905
 
7822
- var _path$v;
7906
+ var _path$x;
7823
7907
 
7824
- function _extends$x() { _extends$x = 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$x.apply(this, arguments); }
7908
+ function _extends$z() { _extends$z = 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$z.apply(this, arguments); }
7825
7909
 
7826
7910
  function SvgCheckSolid(props) {
7827
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
7911
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$z({
7828
7912
  xmlns: "http://www.w3.org/2000/svg",
7829
7913
  className: "h-5 w-5",
7830
7914
  viewBox: "0 0 20 20",
7831
7915
  fill: "currentColor"
7832
- }, props), _path$v || (_path$v = /*#__PURE__*/React__namespace.createElement("path", {
7916
+ }, props), _path$x || (_path$x = /*#__PURE__*/React__namespace.createElement("path", {
7833
7917
  fillRule: "evenodd",
7834
7918
  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",
7835
7919
  clipRule: "evenodd"
7836
7920
  })));
7837
7921
  }
7838
7922
 
7839
- var _path$u;
7923
+ var _path$w;
7840
7924
 
7841
- function _extends$w() { _extends$w = 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$w.apply(this, arguments); }
7925
+ function _extends$y() { _extends$y = 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$y.apply(this, arguments); }
7842
7926
 
7843
7927
  function SvgXIcon(props) {
7844
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
7928
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$y({
7845
7929
  xmlns: "http://www.w3.org/2000/svg",
7846
7930
  viewBox: "0 0 20 20",
7847
7931
  fill: "currentColor"
7848
- }, props), _path$u || (_path$u = /*#__PURE__*/React__namespace.createElement("path", {
7932
+ }, props), _path$w || (_path$w = /*#__PURE__*/React__namespace.createElement("path", {
7849
7933
  fill: "evenodd",
7850
7934
  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",
7851
7935
  clipRule: "evenodd"
7852
7936
  })));
7853
7937
  }
7854
7938
 
7855
- var _path$t;
7939
+ var _path$v;
7856
7940
 
7857
- function _extends$v() { _extends$v = 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$v.apply(this, arguments); }
7941
+ function _extends$x() { _extends$x = 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$x.apply(this, arguments); }
7858
7942
 
7859
7943
  function SvgXIconSolid(props) {
7860
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
7944
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
7861
7945
  className: "plc-w-4 plc-h-4",
7862
7946
  fill: "currentColor",
7863
7947
  xmlns: "http://www.w3.org/2000/svg",
7864
7948
  viewBox: "0 0 100 100"
7865
- }, props), _path$t || (_path$t = /*#__PURE__*/React__namespace.createElement("path", {
7949
+ }, props), _path$v || (_path$v = /*#__PURE__*/React__namespace.createElement("path", {
7866
7950
  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"
7867
7951
  })));
7868
7952
  }
7869
7953
 
7870
- var _path$s;
7954
+ var _path$u;
7871
7955
 
7872
- function _extends$u() { _extends$u = 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$u.apply(this, arguments); }
7956
+ function _extends$w() { _extends$w = 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$w.apply(this, arguments); }
7873
7957
 
7874
7958
  function SvgExclamation(props) {
7875
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
7959
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
7876
7960
  className: "plc-w-4 plc-h-4 plc-mr-1",
7877
7961
  xmlns: "http://www.w3.org/2000/svg",
7878
7962
  viewBox: "0 0 20 20",
7879
7963
  fill: "currentColor"
7880
- }, props), _path$s || (_path$s = /*#__PURE__*/React__namespace.createElement("path", {
7964
+ }, props), _path$u || (_path$u = /*#__PURE__*/React__namespace.createElement("path", {
7881
7965
  fillRule: "evenodd",
7882
7966
  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",
7883
7967
  clipRule: "evenodd"
7884
7968
  })));
7885
7969
  }
7886
7970
 
7887
- var _path$r, _path2$4;
7971
+ var _path$t, _path2$4;
7888
7972
 
7889
- 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); }
7973
+ function _extends$v() { _extends$v = 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$v.apply(this, arguments); }
7890
7974
 
7891
7975
  function SvgSpinner(props) {
7892
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
7976
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
7893
7977
  className: "plc-animate-spin",
7894
7978
  viewBox: "0 0 24 24",
7895
7979
  fill: "currentColor",
7896
7980
  xmlns: "http://www.w3.org/2000/svg"
7897
- }, props), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
7981
+ }, props), _path$t || (_path$t = /*#__PURE__*/React__namespace.createElement("path", {
7898
7982
  opacity: 0.2,
7899
7983
  fill: "evenodd",
7900
7984
  clipRule: "evenodd",
@@ -8184,7 +8268,9 @@ const init$1 = () => {
8184
8268
  return switchToAddressView();
8185
8269
  });
8186
8270
  } else {
8187
- pelcroSubscribeButtonsByClass[j].addEventListener("click", () => switchView("plan-select"));
8271
+ pelcroSubscribeButtonsByClass[j].addEventListener("click", () => {
8272
+ return switchView("subscription-options");
8273
+ });
8188
8274
  }
8189
8275
  }
8190
8276
  }
@@ -8346,7 +8432,8 @@ function Link({
8346
8432
  const init = () => {
8347
8433
  const {
8348
8434
  switchView,
8349
- set
8435
+ set,
8436
+ setProductsList
8350
8437
  } = usePelcro.getStore();
8351
8438
  const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
8352
8439
 
@@ -8397,7 +8484,8 @@ const init = () => {
8397
8484
  }
8398
8485
 
8399
8486
  notify.dismiss(NOTIFICATION_ID);
8400
- switchView("_plan-select-entitlements");
8487
+ setProductsList(window.Pelcro.product.getByEntitlements(entitlements));
8488
+ switchView("plan-select");
8401
8489
  }
8402
8490
  }, "Subscribe"), "now to get full page access.")), {
8403
8491
  className: "pelcro-notification-entitlement",
@@ -8649,6 +8737,10 @@ const getErrorMessages = error => {
8649
8737
  return error === null || error === void 0 ? void 0 : (_error$response4 = error.response) === null || _error$response4 === void 0 ? void 0 : (_error$response4$data = _error$response4.data) === null || _error$response4$data === void 0 ? void 0 : (_error$response4$data2 = _error$response4$data.error) === null || _error$response4$data2 === void 0 ? void 0 : _error$response4$data2.message;
8650
8738
  }
8651
8739
 
8740
+ if (error !== null && error !== void 0 && error.message) {
8741
+ return error.message;
8742
+ }
8743
+
8652
8744
  const errorMessages = []; // enumerable error (ex: validation errors)
8653
8745
 
8654
8746
  Object.values(error === null || error === void 0 ? void 0 : (_error$response5 = error.response) === null || _error$response5 === void 0 ? void 0 : (_error$response5$data = _error$response5.data) === null || _error$response5$data === void 0 ? void 0 : _error$response5$data.errors).forEach(([errorMessage]) => {
@@ -8687,7 +8779,7 @@ const debounce = (func, waitTime) => {
8687
8779
  function getSiteCardProcessor() {
8688
8780
  var _window$Pelcro$site$r;
8689
8781
 
8690
- if ((_window$Pelcro$site$r = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r !== void 0 && _window$Pelcro$site$r.vantiv_pay_page_id) {
8782
+ if ((_window$Pelcro$site$r = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r !== void 0 && _window$Pelcro$site$r.vantiv_gateway_settings) {
8691
8783
  return "vantiv";
8692
8784
  }
8693
8785
 
@@ -8783,7 +8875,7 @@ const loadPaymentSDKs = () => {
8783
8875
  } // Load Vantiv SDKs
8784
8876
 
8785
8877
 
8786
- const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_pay_page_id);
8878
+ const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_gateway_settings);
8787
8879
 
8788
8880
  if (supportsVantiv) {
8789
8881
  if (!window.jQuery) {
@@ -8791,7 +8883,10 @@ const loadPaymentSDKs = () => {
8791
8883
  }
8792
8884
 
8793
8885
  if (!window.EprotectIframeClient) {
8794
- window.Pelcro.helpers.loadSDK("https://request.eprotect.vantivprelive.com/eProtect/js/eProtect-iframe-client.min.js", "vantiv-eprotect-sdk");
8886
+ const PRELIVE_URL = "https://request.eprotect.vantivprelive.com/eProtect/js/eProtect-iframe-client.min.js";
8887
+ const PRODUCTION_URL = "https://request.eprotect.vantivcnp.com/eProtect/js/eProtect-iframe-client4.min.js";
8888
+ const scriptUrlToUse = window.Pelcro.site.read().vantiv_gateway_settings.environment === "production" ? PRODUCTION_URL : PRELIVE_URL;
8889
+ window.Pelcro.helpers.loadSDK(scriptUrlToUse, "vantiv-eprotect-sdk");
8795
8890
  }
8796
8891
  }
8797
8892
  };
@@ -8952,8 +9047,7 @@ const initViewFromURL = () => {
8952
9047
  }
8953
9048
 
8954
9049
  if (view === "invoice-details") {
8955
- // FIXME: commented out to remove from the release
8956
- return false; // return showInvoiceDetailsFromUrl();
9050
+ return showInvoiceDetailsFromUrl();
8957
9051
  }
8958
9052
 
8959
9053
  switchView(view);
@@ -9132,6 +9226,43 @@ const verifyEmailTokenFromUrl = () => {
9132
9226
  });
9133
9227
  };
9134
9228
 
9229
+ const showInvoiceDetailsFromUrl = () => {
9230
+ const {
9231
+ isAuthenticated,
9232
+ setInvoice,
9233
+ whenSiteReady,
9234
+ switchView
9235
+ } = usePelcro.getStore();
9236
+ whenSiteReady(() => {
9237
+ if (!isAuthenticated()) {
9238
+ return switchView("login");
9239
+ }
9240
+
9241
+ const invoiceId = window.Pelcro.helpers.getURLParameter("id");
9242
+ const wasSetSuccessfully = setInvoice(invoiceId);
9243
+
9244
+ if (!wasSetSuccessfully) {
9245
+ const errorMessage = i18next.t("messages:invalidInvoice", {
9246
+ returnObjects: true
9247
+ });
9248
+ return notify.error(errorMessage);
9249
+ }
9250
+
9251
+ const {
9252
+ invoice
9253
+ } = usePelcro.getStore();
9254
+
9255
+ if (invoice.total === 0) {
9256
+ const errorMessage = i18next.t("messages:zeroTotalInvoice", {
9257
+ returnObjects: true
9258
+ });
9259
+ return notify.error(errorMessage);
9260
+ }
9261
+
9262
+ return switchView("invoice-details");
9263
+ });
9264
+ };
9265
+
9135
9266
  const defaultOptions = {
9136
9267
  loadPaymentSDKs: true,
9137
9268
  loadAuth0SDK: true,
@@ -9189,7 +9320,7 @@ const PelcroModalController = ({
9189
9320
  type
9190
9321
  }) => (type === null || type === void 0 ? void 0 : type.viewId) === "dashboard-open"), React__default['default'].Children.map(children, child => child).find(({
9191
9322
  type
9192
- }) => (type === null || type === void 0 ? void 0 : type.viewId) === "notification"), view === "_plan-select-entitlements" && React__default['default'].Children.map(children, child => child).find(({
9323
+ }) => (type === null || type === void 0 ? void 0 : type.viewId) === "notification"), view === "_plan-select-renew" && React__default['default'].Children.map(children, child => child).find(({
9193
9324
  type
9194
9325
  }) => (type === null || type === void 0 ? void 0 : type.viewId) === "plan-select"), React__default['default'].Children.map(children, child => child).find(({
9195
9326
  type
@@ -9470,8 +9601,10 @@ const LOAD_PAYMENT_METHODS = "LOAD_PAYMENT_METHODS";
9470
9601
  const GET_NEWSLETTERS_FETCH = "GET_NEWSLETTERS_FETCH";
9471
9602
  const GET_NEWSLETTERS_SUCCESS = "GET_NEWSLETTERS_SUCCESS";
9472
9603
  const SWITCH_TO_UPDATE = "SWITCH_TO_UPDATE";
9604
+ const SWITCH_TO_RENEW = "SWITCH_TO_RENEW";
9605
+ const SWITCH_TO_NEW = "SWITCH_TO_NEW";
9473
9606
 
9474
- const initialState$h = {
9607
+ const initialState$i = {
9475
9608
  email: "",
9476
9609
  password: "",
9477
9610
  emailError: null,
@@ -9482,10 +9615,10 @@ const initialState$h = {
9482
9615
  content: ""
9483
9616
  }
9484
9617
  };
9485
- const store$h = /*#__PURE__*/React.createContext(initialState$h);
9618
+ const store$i = /*#__PURE__*/React.createContext(initialState$i);
9486
9619
  const {
9487
- Provider: Provider$h
9488
- } = store$h;
9620
+ Provider: Provider$i
9621
+ } = store$i;
9489
9622
 
9490
9623
  const LoginContainer = ({
9491
9624
  style,
@@ -9592,7 +9725,7 @@ const LoginContainer = ({
9592
9725
  });
9593
9726
 
9594
9727
  case RESET_LOGIN_FORM:
9595
- return initialState$h;
9728
+ return initialState$i;
9596
9729
 
9597
9730
  case DISABLE_LOGIN_BUTTON:
9598
9731
  return lib_7({ ...state,
@@ -9610,12 +9743,12 @@ const LoginContainer = ({
9610
9743
  default:
9611
9744
  return state;
9612
9745
  }
9613
- }, initialState$h);
9746
+ }, initialState$i);
9614
9747
  return /*#__PURE__*/React__default['default'].createElement("div", {
9615
9748
  style: { ...style
9616
9749
  },
9617
9750
  className: `pelcro-container pelcro-login-container ${className}`
9618
- }, /*#__PURE__*/React__default['default'].createElement(Provider$h, {
9751
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$i, {
9619
9752
  value: {
9620
9753
  state,
9621
9754
  dispatch
@@ -9623,12 +9756,12 @@ const LoginContainer = ({
9623
9756
  }, children.length ? children.map((child, i) => {
9624
9757
  if (child) {
9625
9758
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
9626
- store: store$h,
9759
+ store: store$i,
9627
9760
  key: i
9628
9761
  });
9629
9762
  }
9630
9763
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
9631
- store: store$h
9764
+ store: store$i
9632
9765
  })));
9633
9766
  };
9634
9767
 
@@ -9873,7 +10006,7 @@ const LoginButton = ({
9873
10006
  buttonDisabled
9874
10007
  },
9875
10008
  dispatch
9876
- } = React.useContext(store$h);
10009
+ } = React.useContext(store$i);
9877
10010
  const {
9878
10011
  t
9879
10012
  } = useTranslation("login");
@@ -9894,23 +10027,23 @@ const LoginButton = ({
9894
10027
  };
9895
10028
 
9896
10029
  const LoginEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
9897
- store: store$h
10030
+ store: store$i
9898
10031
  }, props));
9899
10032
 
9900
10033
  const LoginPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
9901
- store: store$h
10034
+ store: store$i
9902
10035
  }, props));
9903
10036
 
9904
- var _path$q;
10037
+ var _path$s;
9905
10038
 
9906
- 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); }
10039
+ function _extends$u() { _extends$u = 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$u.apply(this, arguments); }
9907
10040
 
9908
10041
  function SvgCheck(props) {
9909
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
10042
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
9910
10043
  xmlns: "http://www.w3.org/2000/svg",
9911
10044
  fill: "currentColor",
9912
10045
  viewBox: "0 0 20 20"
9913
- }, props), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
10046
+ }, props), _path$s || (_path$s = /*#__PURE__*/React__namespace.createElement("path", {
9914
10047
  fillRule: "evenodd",
9915
10048
  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",
9916
10049
  clipRule: "evenodd"
@@ -9975,7 +10108,7 @@ var facebookLoginRenderProps = createCommonjsModule(function (module, exports) {
9975
10108
  var FacebookLogin = unwrapExports(facebookLoginRenderProps);
9976
10109
  facebookLoginRenderProps.FacebookLogin;
9977
10110
 
9978
- const initialState$g = {
10111
+ const initialState$h = {
9979
10112
  email: "",
9980
10113
  password: "",
9981
10114
  emailError: null,
@@ -9992,10 +10125,10 @@ const initialState$g = {
9992
10125
  content: ""
9993
10126
  }
9994
10127
  };
9995
- const store$g = /*#__PURE__*/React.createContext(initialState$g);
10128
+ const store$h = /*#__PURE__*/React.createContext(initialState$h);
9996
10129
  const {
9997
- Provider: Provider$g
9998
- } = store$g;
10130
+ Provider: Provider$h
10131
+ } = store$h;
9999
10132
 
10000
10133
  const RegisterContainer = ({
10001
10134
  style,
@@ -10178,7 +10311,7 @@ const RegisterContainer = ({
10178
10311
  });
10179
10312
 
10180
10313
  case RESET_LOGIN_FORM:
10181
- return initialState$g;
10314
+ return initialState$h;
10182
10315
 
10183
10316
  case DISABLE_REGISTRATION_BUTTON:
10184
10317
  return lib_7({ ...state,
@@ -10196,12 +10329,12 @@ const RegisterContainer = ({
10196
10329
  default:
10197
10330
  return state;
10198
10331
  }
10199
- }, initialState$g);
10332
+ }, initialState$h);
10200
10333
  return /*#__PURE__*/React__default['default'].createElement("div", {
10201
10334
  style: { ...style
10202
10335
  },
10203
10336
  className: `pelcro-container pelcro-register-container ${className}`
10204
- }, /*#__PURE__*/React__default['default'].createElement(Provider$g, {
10337
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$h, {
10205
10338
  value: {
10206
10339
  state,
10207
10340
  dispatch
@@ -10209,12 +10342,12 @@ const RegisterContainer = ({
10209
10342
  }, children.length ? children.map((child, i) => {
10210
10343
  if (child) {
10211
10344
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
10212
- store: store$g,
10345
+ store: store$h,
10213
10346
  key: i
10214
10347
  });
10215
10348
  }
10216
10349
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
10217
- store: store$g
10350
+ store: store$h
10218
10351
  })));
10219
10352
  };
10220
10353
  /**
@@ -10229,15 +10362,15 @@ function hasSecurityTokenEnabled$1() {
10229
10362
  return hasSecuritySdkLoaded;
10230
10363
  }
10231
10364
 
10232
- var _path$p;
10365
+ var _path$r;
10233
10366
 
10234
- 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); }
10367
+ 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); }
10235
10368
 
10236
10369
  function SvgFacebookLogo(props) {
10237
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
10370
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
10238
10371
  xmlns: "http://www.w3.org/2000/svg",
10239
10372
  viewBox: "88.428 12.828 107.543 207.085"
10240
- }, props), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
10373
+ }, props), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
10241
10374
  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",
10242
10375
  fill: "#3c5a9a"
10243
10376
  })));
@@ -10254,10 +10387,10 @@ const FacebookLoginButton = ({
10254
10387
  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;
10255
10388
  const {
10256
10389
  dispatch: loginDispatch
10257
- } = React.useContext(store$h);
10390
+ } = React.useContext(store$i);
10258
10391
  const {
10259
10392
  dispatch: registerDispatch
10260
- } = React.useContext(store$g);
10393
+ } = React.useContext(store$h);
10261
10394
 
10262
10395
  const onSuccess = facebookUser => {
10263
10396
  loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
@@ -10310,15 +10443,15 @@ var googleLogin = createCommonjsModule(function (module, exports) {
10310
10443
  unwrapExports(googleLogin);
10311
10444
  var googleLogin_1 = googleLogin.GoogleLogin;
10312
10445
 
10313
- var _path$o, _path2$3, _path3$1, _path4;
10446
+ var _path$q, _path2$3, _path3$1, _path4;
10314
10447
 
10315
- 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); }
10448
+ 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); }
10316
10449
 
10317
10450
  function SvgGoogleLogo(props) {
10318
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
10451
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
10319
10452
  viewBox: "0 0 24 24",
10320
10453
  xmlns: "http://www.w3.org/2000/svg"
10321
- }, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
10454
+ }, props), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
10322
10455
  fill: "#4285F4",
10323
10456
  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"
10324
10457
  })), _path2$3 || (_path2$3 = /*#__PURE__*/React__namespace.createElement("path", {
@@ -10344,10 +10477,10 @@ const GoogleLoginButton = ({
10344
10477
  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;
10345
10478
  const {
10346
10479
  dispatch: loginDispatch
10347
- } = React.useContext(store$h);
10480
+ } = React.useContext(store$i);
10348
10481
  const {
10349
10482
  dispatch: registerDispatch
10350
- } = React.useContext(store$g);
10483
+ } = React.useContext(store$h);
10351
10484
 
10352
10485
  const onSuccess = response => {
10353
10486
  var _response$getAuthResp, _profile$getEmail, _profile$getGivenName, _profile$getFamilyNam, _profile$getEmail2, _profile$getGivenName2, _profile$getFamilyNam2;
@@ -10395,15 +10528,15 @@ const GoogleLoginButton = ({
10395
10528
  }) : null;
10396
10529
  };
10397
10530
 
10398
- var _path$n;
10531
+ var _path$p;
10399
10532
 
10400
- 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); }
10533
+ 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); }
10401
10534
 
10402
10535
  function SvgAuth0Logo(props) {
10403
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
10536
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
10404
10537
  viewBox: "0 0 256 285",
10405
10538
  xmlns: "http://www.w3.org/2000/svg"
10406
- }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
10539
+ }, props), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
10407
10540
  d: "M220.412 0h-92.415l28.562 89.006h92.416l-74.77 53.077 28.57 89.511c48.128-35.06 63.854-88.12 46.208-142.588L220.413 0zM7.018 89.006h92.416L127.997 0H35.589L7.019 89.006c-17.655 54.468-1.92 107.529 46.207 142.588l28.563-89.51-74.77-53.078zm46.208 142.588l74.77 52.97 74.77-52.97-74.77-53.847-74.77 53.847z"
10408
10541
  })));
10409
10542
  }
@@ -10443,10 +10576,10 @@ const Auth0LoginButton = ({
10443
10576
  }, [auth0Enabled, auth0Loaded]);
10444
10577
  const {
10445
10578
  dispatch: loginDispatch
10446
- } = React.useContext(store$h);
10579
+ } = React.useContext(store$i);
10447
10580
  const {
10448
10581
  dispatch: registerDispatch
10449
- } = React.useContext(store$g);
10582
+ } = React.useContext(store$h);
10450
10583
 
10451
10584
  function handleClick() {
10452
10585
  var _auth0InstanceRef$cur, _auth0InstanceRef$cur2, _auth0InstanceRef$cur3;
@@ -10579,15 +10712,15 @@ function LoginView(props) {
10579
10712
  }, /*#__PURE__*/React__default['default'].createElement(GoogleLoginButton, null), /*#__PURE__*/React__default['default'].createElement(FacebookLoginButton, null), /*#__PURE__*/React__default['default'].createElement(Auth0LoginButton, null))))));
10580
10713
  }
10581
10714
 
10582
- var _path$m, _path2$2, _path3;
10715
+ var _path$o, _path2$2, _path3;
10583
10716
 
10584
- 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); }
10717
+ 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); }
10585
10718
 
10586
10719
  function SvgPelcroAuthorship(props) {
10587
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
10720
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
10588
10721
  xmlns: "http://www.w3.org/2000/svg",
10589
10722
  viewBox: "0 -80.652 497.072 179.991"
10590
- }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
10723
+ }, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
10591
10724
  fill: "none",
10592
10725
  stroke: "#4a4a4a",
10593
10726
  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"
@@ -10734,11 +10867,11 @@ function LoginModal({
10734
10867
  LoginModal.viewId = "login";
10735
10868
 
10736
10869
  const RegisterEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
10737
- store: store$g
10870
+ store: store$h
10738
10871
  }, props));
10739
10872
 
10740
10873
  const RegisterPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
10741
- store: store$g
10874
+ store: store$h
10742
10875
  }, props));
10743
10876
 
10744
10877
  const RegisterButton = ({
@@ -10758,7 +10891,7 @@ const RegisterButton = ({
10758
10891
  buttonDisabled
10759
10892
  },
10760
10893
  dispatch
10761
- } = React.useContext(store$g);
10894
+ } = React.useContext(store$h);
10762
10895
  const {
10763
10896
  t
10764
10897
  } = useTranslation("register");
@@ -10896,7 +11029,7 @@ function FirstName({
10896
11029
  }
10897
11030
 
10898
11031
  const RegisterFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
10899
- store: store$g
11032
+ store: store$h
10900
11033
  }, props));
10901
11034
 
10902
11035
  function LastName({
@@ -10927,7 +11060,7 @@ function LastName({
10927
11060
  }
10928
11061
 
10929
11062
  const RegisterLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
10930
- store: store$g
11063
+ store: store$h
10931
11064
  }, props));
10932
11065
 
10933
11066
  /**
@@ -11051,7 +11184,7 @@ function TextInput({
11051
11184
 
11052
11185
  const RegisterTextInput = props => {
11053
11186
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
11054
- store: store$g
11187
+ store: store$h
11055
11188
  }));
11056
11189
  };
11057
11190
 
@@ -11198,6 +11331,7 @@ function SelectModalWithHook(props) {
11198
11331
  (_props$onDisplay = props.onDisplay) === null || _props$onDisplay === void 0 ? void 0 : _props$onDisplay.call(props);
11199
11332
  }, []);
11200
11333
  const {
11334
+ productsList,
11201
11335
  isGift,
11202
11336
  plan,
11203
11337
  product,
@@ -11207,11 +11341,12 @@ function SelectModalWithHook(props) {
11207
11341
  view,
11208
11342
  set
11209
11343
  } = usePelcro();
11210
- const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
11211
- const entitlements = entitlementsProtectedElements.length > 0 ? getEntitlementsFromElem(entitlementsProtectedElements[0]) : null;
11344
+ const isRenewingSub = view === "_plan-select-renew";
11212
11345
  return /*#__PURE__*/React__default['default'].createElement(SelectModalWithTrans, {
11346
+ productsList: productsList,
11213
11347
  isGift: isGift,
11214
- disableGifting: isRenewingGift,
11348
+ disableGifting: isRenewingGift || isRenewingSub,
11349
+ isRenewingSub: isRenewingSub,
11215
11350
  plan: plan,
11216
11351
  product: product,
11217
11352
  onClose: () => {
@@ -11225,8 +11360,10 @@ function SelectModalWithHook(props) {
11225
11360
  plan,
11226
11361
  isGift
11227
11362
  }),
11228
- setView: switchView,
11229
- matchingEntitlements: view === "_plan-select-entitlements" ? entitlements : null
11363
+ setSubscriptionIdToRenew: subscriptionIdToRenew => set({
11364
+ subscriptionIdToRenew
11365
+ }),
11366
+ setView: switchView
11230
11367
  });
11231
11368
  }
11232
11369
  SelectModalWithHook.viewId = "plan-select";
@@ -11258,10 +11395,10 @@ class SelectModal extends React.Component {
11258
11395
  });
11259
11396
  }
11260
11397
 
11261
- if (this.state.productList.length === 1) {
11398
+ if (this.props.productsList.length === 1) {
11262
11399
  this.setState({
11263
- product: this.state.productList[0],
11264
- planList: this.state.productList[0].plans,
11400
+ product: this.props.productsList[0],
11401
+ planList: this.props.productsList[0].plans,
11265
11402
  mode: "plan"
11266
11403
  });
11267
11404
  }
@@ -11278,7 +11415,7 @@ class SelectModal extends React.Component {
11278
11415
  });
11279
11416
 
11280
11417
  _defineProperty$3(this, "onProductChange", e => {
11281
- const product = window.Pelcro.product.list()[e.target.selectedIndex];
11418
+ const product = productsList[e.target.selectedIndex];
11282
11419
  this.setState({
11283
11420
  product: product,
11284
11421
  plan: product.plans[0]
@@ -11344,7 +11481,7 @@ class SelectModal extends React.Component {
11344
11481
 
11345
11482
  _defineProperty$3(this, "renderProducts", () => {
11346
11483
  const userDidSelectProduct = Boolean(this.state.mode === "plan");
11347
- const productsToShow = userDidSelectProduct ? [this.state.product] : this.state.productList;
11484
+ const productsToShow = userDidSelectProduct ? [this.state.product] : this.props.productsList;
11348
11485
  return productsToShow.map((product, index) => {
11349
11486
  return this.renderOneProduct(product, index);
11350
11487
  });
@@ -11357,7 +11494,7 @@ class SelectModal extends React.Component {
11357
11494
  return this.renderOneProduct(this.state.product);
11358
11495
  }
11359
11496
 
11360
- const [productsThatMatchArticleTag, allProductsMinusMatched] = productsWithMatchedTaggedFirst(); // Render normal products if there are no available matching products
11497
+ const [productsThatMatchArticleTag, allProductsMinusMatched] = productsWithMatchedTaggedFirst(this.props.productsList); // Render normal products if there are no available matching products
11361
11498
 
11362
11499
  if (!(productsThatMatchArticleTag !== null && productsThatMatchArticleTag !== void 0 && productsThatMatchArticleTag.length)) {
11363
11500
  return this.renderProducts();
@@ -11373,10 +11510,7 @@ class SelectModal extends React.Component {
11373
11510
  className: "plc-text-sm plc-font-semibold"
11374
11511
  }, this.locale("labels.restrictiveArticles.or")), allProductsMinusMatched.map((product, index) => this.renderOneProduct(product, index))));
11375
11512
 
11376
- function productsWithMatchedTaggedFirst() {
11377
- var _window$Pelcro$produc;
11378
-
11379
- const allProducts = (_window$Pelcro$produc = window.Pelcro.product.list()) !== null && _window$Pelcro$produc !== void 0 ? _window$Pelcro$produc : [];
11513
+ function productsWithMatchedTaggedFirst(allProducts) {
11380
11514
  const productsThatMatchArticleTag = window.Pelcro.product.getByMatchingPageTags();
11381
11515
  const allProductsMinusMatched = allProducts.filter(product => !productsThatMatchArticleTag.some(matchedProduct => matchedProduct.id === product.id));
11382
11516
  return [productsThatMatchArticleTag, allProductsMinusMatched];
@@ -11410,7 +11544,7 @@ class SelectModal extends React.Component {
11410
11544
  _defineProperty$3(this, "selectProduct", e => {
11411
11545
  const id = e.target.dataset.key;
11412
11546
 
11413
- for (const product of this.state.productList) {
11547
+ for (const product of this.props.productsList) {
11414
11548
  if (+product.id === +id) {
11415
11549
  var _this$state$plan;
11416
11550
 
@@ -11463,6 +11597,14 @@ class SelectModal extends React.Component {
11463
11597
 
11464
11598
  _defineProperty$3(this, "submitOption", () => {
11465
11599
  this.props.setProductAndPlan(this.state.product, this.state.plan, this.state.isGift);
11600
+
11601
+ if (this.props.isRenewingSub) {
11602
+ var _matchingSub$id;
11603
+
11604
+ const matchingSub = window.Pelcro.subscription.list().find(sub => sub.plan.id === this.state.plan.id && sub.status === "active" && sub.cancel_at_period_end === 1);
11605
+ this.props.setSubscriptionIdToRenew((_matchingSub$id = matchingSub === null || matchingSub === void 0 ? void 0 : matchingSub.id) !== null && _matchingSub$id !== void 0 ? _matchingSub$id : null);
11606
+ }
11607
+
11466
11608
  const {
11467
11609
  product,
11468
11610
  isGift
@@ -11500,8 +11642,7 @@ class SelectModal extends React.Component {
11500
11642
  plan: {},
11501
11643
  isGift: props.isGift,
11502
11644
  disabled: true,
11503
- mode: "product",
11504
- productList: props.matchingEntitlements ? window.Pelcro.product.getByEntitlements(props.matchingEntitlements) : window.Pelcro.product.list()
11645
+ mode: "product"
11505
11646
  };
11506
11647
  this.product = this.props.product || window.Pelcro.paywall.getProduct();
11507
11648
  this.locale = this.props.t;
@@ -11509,7 +11650,7 @@ class SelectModal extends React.Component {
11509
11650
  }
11510
11651
 
11511
11652
  render() {
11512
- var _window$Pelcro$produc2, _window$Pelcro$produc3, _window$Pelcro$site$r;
11653
+ var _this$props$productsL, _this$props$productsL2, _window$Pelcro$site$r;
11513
11654
 
11514
11655
  const {
11515
11656
  disableGifting
@@ -11543,7 +11684,7 @@ class SelectModal extends React.Component {
11543
11684
  className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
11544
11685
  }, /*#__PURE__*/React__default['default'].createElement("h4", {
11545
11686
  className: "plc-text-2xl plc-font-semibold"
11546
- }, this.product && this.product.paywall.select_title || ((_window$Pelcro$produc2 = window.Pelcro.product.list()[0]) === null || _window$Pelcro$produc2 === void 0 ? void 0 : _window$Pelcro$produc2.paywall.select_title)), /*#__PURE__*/React__default['default'].createElement("p", null, this.product && this.product.paywall.select_subtitle || ((_window$Pelcro$produc3 = window.Pelcro.product.list()[0]) === null || _window$Pelcro$produc3 === void 0 ? void 0 : _window$Pelcro$produc3.paywall.select_subtitle))), /*#__PURE__*/React__default['default'].createElement("div", {
11687
+ }, this.product && this.product.paywall.select_title || ((_this$props$productsL = this.props.productsList[0]) === null || _this$props$productsL === void 0 ? void 0 : _this$props$productsL.paywall.select_title)), /*#__PURE__*/React__default['default'].createElement("p", null, this.product && this.product.paywall.select_subtitle || ((_this$props$productsL2 = this.props.productsList[0]) === null || _this$props$productsL2 === void 0 ? void 0 : _this$props$productsL2.paywall.select_subtitle))), /*#__PURE__*/React__default['default'].createElement("div", {
11547
11688
  className: "pelcro-select-products-wrapper"
11548
11689
  }, (_window$Pelcro$site$r = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r !== void 0 && _window$Pelcro$site$r.restrictive_paywall_metatags_enabled ? this.renderMatchingProductsFirst() : this.renderProducts()), this.state.mode === "plan" && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
11549
11690
  className: "plc-overflow-y-scroll plc-max-h-72 pelcro-select-plans-wrapper"
@@ -12707,20 +12848,21 @@ var es_12 = es.injectStripe;
12707
12848
  var es_13 = es.StripeProvider;
12708
12849
 
12709
12850
  /**
12710
- * @TODO: All subscription related business logic should end up moving
12851
+ * @TODO: All payment related business logic should end up moving
12711
12852
  * to this service, and out of react components.
12712
12853
  */
12713
12854
 
12714
12855
  /**
12715
- * Enum for subscription types
12856
+ * Enum for payment types
12716
12857
  * @readonly
12717
12858
  * @enum {string}
12718
12859
  */
12719
- const SUBSCRIPTION_TYPES = {
12860
+ const PAYMENT_TYPES = {
12720
12861
  CREATE_SUBSCRIPTION: "CREATE_SUBSCRIPTION",
12721
12862
  CREATE_GIFTED_SUBSCRIPTION: "CREATE_GIFTED_SUBSCRIPTION",
12722
12863
  RENEW_SUBSCRIPTION: "RENEW_SUBSCRIPTION",
12723
12864
  RENEW_GIFTED_SUBSCRIPTION: "RENEW_GIFTED_SUBSCRIPTION",
12865
+ PURCHASE_ECOMMERCE_ORDER: "PURCHASE_ECOMMERCE_ORDER",
12724
12866
  PAY_INVOICE: "PAY_INVOICE"
12725
12867
  };
12726
12868
 
@@ -12728,9 +12870,8 @@ var _isPaymentGatewayInvalid = /*#__PURE__*/new WeakMap();
12728
12870
 
12729
12871
  var _generateUserError = /*#__PURE__*/new WeakMap();
12730
12872
 
12731
- class Subscription {
12873
+ class Payment {
12732
12874
  /**
12733
- * Subscription service constructor
12734
12875
  * @param {(StripeGateway|PaypalGateway|VantivGateway)} paymentGateway
12735
12876
  */
12736
12877
  constructor(paymentGateway) {
@@ -12742,7 +12883,7 @@ class Subscription {
12742
12883
 
12743
12884
  if (!options.type) {
12744
12885
  callback(_classPrivateFieldGet(this, _generateUserError).call(this), null);
12745
- return console.error("No subscription type provided");
12886
+ return console.error("No payment type provided");
12746
12887
  } // delegate execution to paymentgateway
12747
12888
 
12748
12889
 
@@ -12760,21 +12901,21 @@ class Subscription {
12760
12901
  writable: true,
12761
12902
  value: () => {
12762
12903
  return {
12763
- error: new Error("An error has occured in the subscription service, please try again later")
12904
+ error: new Error("An error has occured in the payment service, please try again later")
12764
12905
  };
12765
12906
  }
12766
12907
  });
12767
12908
 
12768
12909
  if (_classPrivateFieldGet(this, _isPaymentGatewayInvalid).call(this, paymentGateway)) {
12769
12910
  this.paymentGateway = null;
12770
- console.error("Incompatible subscription gateway");
12911
+ console.error("Incompatible payment gateway");
12771
12912
  } else {
12772
12913
  this.paymentGateway = paymentGateway;
12773
12914
  }
12774
12915
  }
12775
12916
  /**
12776
- * @typedef subscriptionOptions
12777
- * @property {SUBSCRIPTION_TYPES} type
12917
+ * @typedef paymentOptions
12918
+ * @property {PAYMENT_TYPES} type
12778
12919
  * @property {string} token
12779
12920
  * @property {object} plan
12780
12921
  * @property {object} [product]
@@ -12785,6 +12926,7 @@ class Subscription {
12785
12926
  * @property {string} addressId
12786
12927
  * @property {number} invoiceId
12787
12928
  * @property {boolean} isExistingSource
12929
+ * @property {Array} items
12788
12930
  */
12789
12931
 
12790
12932
  /**
@@ -12795,8 +12937,8 @@ class Subscription {
12795
12937
  */
12796
12938
 
12797
12939
  /**
12798
- * Subscription execution method
12799
- * @param {subscriptionOptions} options subscription options
12940
+ * Payment execution method
12941
+ * @param {paymentOptions} options payment options
12800
12942
  * @param {executeCallback} callback
12801
12943
  * @return {void}
12802
12944
  */
@@ -12809,7 +12951,7 @@ const PAYMENT_GATEWAYS_ENUM = {
12809
12951
  vantiv: "vantiv"
12810
12952
  };
12811
12953
  /**
12812
- * Subscription Strategies
12954
+ * Payment Strategies
12813
12955
  */
12814
12956
 
12815
12957
  /**
@@ -12826,6 +12968,8 @@ var _renewSubscription = /*#__PURE__*/new WeakMap();
12826
12968
 
12827
12969
  var _renewGiftedSubscription = /*#__PURE__*/new WeakMap();
12828
12970
 
12971
+ var _purchaseEcommerceOrder = /*#__PURE__*/new WeakMap();
12972
+
12829
12973
  var _payInvoice = /*#__PURE__*/new WeakMap();
12830
12974
 
12831
12975
  class StripeGateway {
@@ -12836,7 +12980,7 @@ class StripeGateway {
12836
12980
  });
12837
12981
 
12838
12982
  _defineProperty$3(this, "execute", (options, callback) => {
12839
- const types = SUBSCRIPTION_TYPES;
12983
+ const types = PAYMENT_TYPES;
12840
12984
 
12841
12985
  switch (options.type) {
12842
12986
  case types.CREATE_SUBSCRIPTION:
@@ -12851,11 +12995,14 @@ class StripeGateway {
12851
12995
  case types.RENEW_GIFTED_SUBSCRIPTION:
12852
12996
  return _classPrivateFieldGet(this, _renewGiftedSubscription).call(this, options, callback);
12853
12997
 
12998
+ case types.PURCHASE_ECOMMERCE_ORDER:
12999
+ return _classPrivateFieldGet(this, _purchaseEcommerceOrder).call(this, options, callback);
13000
+
12854
13001
  case types.PAY_INVOICE:
12855
13002
  return _classPrivateFieldGet(this, _payInvoice).call(this, options, callback);
12856
13003
 
12857
13004
  default:
12858
- console.error("Unsupported subscriptiion method: Stripe Gateway");
13005
+ console.error("Unsupported payment method: Stripe Gateway");
12859
13006
  }
12860
13007
  });
12861
13008
 
@@ -12877,6 +13024,7 @@ class StripeGateway {
12877
13024
  auth_token: window.Pelcro.user.read().auth_token,
12878
13025
  plan_id: plan.id,
12879
13026
  coupon_code: couponCode,
13027
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
12880
13028
  address_id: product.address_required ? addressId : null
12881
13029
  }, (err, res) => {
12882
13030
  callback(err, res);
@@ -12903,6 +13051,7 @@ class StripeGateway {
12903
13051
  auth_token: window.Pelcro.user.read().auth_token,
12904
13052
  plan_id: plan.id,
12905
13053
  coupon_code: couponCode,
13054
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
12906
13055
  gift_recipient_email: giftRecipient.email,
12907
13056
  gift_recipient_first_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.firstName,
12908
13057
  gift_recipient_last_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.lastName,
@@ -12930,6 +13079,7 @@ class StripeGateway {
12930
13079
  stripe_token: token,
12931
13080
  auth_token: window.Pelcro.user.read().auth_token,
12932
13081
  plan_id: plan.id,
13082
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
12933
13083
  coupon_code: couponCode,
12934
13084
  subscription_id: subscriptionIdToRenew,
12935
13085
  address_id: product.address_required ? addressId : null
@@ -12963,6 +13113,36 @@ class StripeGateway {
12963
13113
  }
12964
13114
  });
12965
13115
 
13116
+ _purchaseEcommerceOrder.set(this, {
13117
+ writable: true,
13118
+ value: (options, callback) => {
13119
+ const {
13120
+ token,
13121
+ items,
13122
+ couponCode,
13123
+ addressId,
13124
+ isExistingSource
13125
+ } = options;
13126
+ const params = isExistingSource ? {
13127
+ source_id: token
13128
+ } : {
13129
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway),
13130
+ gateway_token: token
13131
+ };
13132
+ window.Pelcro.ecommerce.order.create({
13133
+ items,
13134
+ coupon_code: couponCode,
13135
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13136
+ ...params,
13137
+ ...(addressId && {
13138
+ address_id: addressId
13139
+ })
13140
+ }, (err, res) => {
13141
+ callback(err, res);
13142
+ });
13143
+ }
13144
+ });
13145
+
12966
13146
  _payInvoice.set(this, {
12967
13147
  writable: true,
12968
13148
  value: (options, callback) => {
@@ -13006,7 +13186,7 @@ class PaypalGateway {
13006
13186
  });
13007
13187
 
13008
13188
  _defineProperty$3(this, "execute", (options, callback) => {
13009
- const types = SUBSCRIPTION_TYPES;
13189
+ const types = PAYMENT_TYPES;
13010
13190
 
13011
13191
  switch (options.type) {
13012
13192
  case types.CREATE_SUBSCRIPTION:
@@ -13040,6 +13220,7 @@ class PaypalGateway {
13040
13220
  payment_gateway: _classPrivateFieldGet(this, _paymentGateway2),
13041
13221
  auth_token: window.Pelcro.user.read().auth_token,
13042
13222
  plan_id: plan.id,
13223
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13043
13224
  coupon_code: couponCode,
13044
13225
  address_id: product.address_required ? addressId : null
13045
13226
  }, (err, res) => {
@@ -13067,6 +13248,7 @@ class PaypalGateway {
13067
13248
  auth_token: window.Pelcro.user.read().auth_token,
13068
13249
  plan_id: plan.id,
13069
13250
  coupon_code: couponCode,
13251
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13070
13252
  gift_recipient_email: giftRecipient.email,
13071
13253
  gift_recipient_first_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.firstName,
13072
13254
  gift_recipient_last_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.lastName,
@@ -13103,6 +13285,16 @@ var _paymentGateway3 = /*#__PURE__*/new WeakMap();
13103
13285
 
13104
13286
  var _createSubscription3 = /*#__PURE__*/new WeakMap();
13105
13287
 
13288
+ var _renewSubscription2 = /*#__PURE__*/new WeakMap();
13289
+
13290
+ var _createGiftedSubscription3 = /*#__PURE__*/new WeakMap();
13291
+
13292
+ var _renewGiftedSubscription2 = /*#__PURE__*/new WeakMap();
13293
+
13294
+ var _purchaseEcommerceOrder2 = /*#__PURE__*/new WeakMap();
13295
+
13296
+ var _payInvoice3 = /*#__PURE__*/new WeakMap();
13297
+
13106
13298
  class VantivGateway {
13107
13299
  constructor() {
13108
13300
  _paymentGateway3.set(this, {
@@ -13111,16 +13303,31 @@ class VantivGateway {
13111
13303
  });
13112
13304
 
13113
13305
  _defineProperty$3(this, "execute", (options, callback) => {
13114
- const types = SUBSCRIPTION_TYPES;
13306
+ const types = PAYMENT_TYPES;
13115
13307
 
13116
13308
  switch (options.type) {
13117
13309
  case types.CREATE_SUBSCRIPTION:
13118
13310
  return _classPrivateFieldGet(this, _createSubscription3).call(this, options, callback);
13119
13311
 
13120
- default:
13121
- console.error("Unsupported subscriptiion method: vantiv Gateway");
13122
- }
13123
- });
13312
+ case types.RENEW_SUBSCRIPTION:
13313
+ return _classPrivateFieldGet(this, _renewSubscription2).call(this, options, callback);
13314
+
13315
+ case types.CREATE_GIFTED_SUBSCRIPTION:
13316
+ return _classPrivateFieldGet(this, _createGiftedSubscription3).call(this, options, callback);
13317
+
13318
+ case types.RENEW_GIFTED_SUBSCRIPTION:
13319
+ return _classPrivateFieldGet(this, _renewGiftedSubscription2).call(this, options, callback);
13320
+
13321
+ case types.PURCHASE_ECOMMERCE_ORDER:
13322
+ return _classPrivateFieldGet(this, _purchaseEcommerceOrder2).call(this, options, callback);
13323
+
13324
+ case types.PAY_INVOICE:
13325
+ return _classPrivateFieldGet(this, _payInvoice3).call(this, options, callback);
13326
+
13327
+ default:
13328
+ console.error("Unsupported payment method: vantiv Gateway");
13329
+ }
13330
+ });
13124
13331
 
13125
13332
  _createSubscription3.set(this, {
13126
13333
  writable: true,
@@ -13131,21 +13338,180 @@ class VantivGateway {
13131
13338
  couponCode,
13132
13339
  product,
13133
13340
  quantity = 1,
13134
- addressId
13341
+ addressId,
13342
+ isExistingSource
13135
13343
  } = options;
13344
+ const params = isExistingSource ? {
13345
+ source_id: token
13346
+ } : {
13347
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13348
+ gateway_token: token
13349
+ };
13136
13350
  window.Pelcro.subscription.create({
13137
13351
  quantity,
13138
- gateway_token: token,
13352
+ auth_token: window.Pelcro.user.read().auth_token,
13353
+ plan_id: plan.id,
13354
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13355
+ coupon_code: couponCode,
13356
+ address_id: product.address_required ? addressId : null,
13357
+ ...params
13358
+ }, (err, res) => {
13359
+ callback(err, res);
13360
+ });
13361
+ }
13362
+ });
13363
+
13364
+ _renewSubscription2.set(this, {
13365
+ writable: true,
13366
+ value: (options, callback) => {
13367
+ const {
13368
+ subscriptionIdToRenew,
13369
+ token,
13370
+ plan,
13371
+ couponCode,
13372
+ product,
13373
+ addressId,
13374
+ isExistingSource
13375
+ } = options;
13376
+ const params = isExistingSource ? {
13377
+ source_id: token
13378
+ } : {
13139
13379
  payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13380
+ gateway_token: token
13381
+ };
13382
+ window.Pelcro.subscription.renew({
13140
13383
  auth_token: window.Pelcro.user.read().auth_token,
13141
13384
  plan_id: plan.id,
13142
13385
  coupon_code: couponCode,
13143
- address_id: product.address_required ? addressId : null
13386
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13387
+ subscription_id: subscriptionIdToRenew,
13388
+ address_id: product.address_required ? addressId : null,
13389
+ ...params
13144
13390
  }, (err, res) => {
13145
13391
  callback(err, res);
13146
13392
  });
13147
13393
  }
13148
13394
  });
13395
+
13396
+ _createGiftedSubscription3.set(this, {
13397
+ writable: true,
13398
+ value: (options, callback) => {
13399
+ const {
13400
+ token,
13401
+ plan,
13402
+ couponCode,
13403
+ product,
13404
+ giftRecipient,
13405
+ quantity = 1,
13406
+ addressId,
13407
+ isExistingSource
13408
+ } = options;
13409
+ const params = isExistingSource ? {
13410
+ source_id: token
13411
+ } : {
13412
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13413
+ gateway_token: token
13414
+ };
13415
+ window.Pelcro.subscription.create({
13416
+ quantity,
13417
+ auth_token: window.Pelcro.user.read().auth_token,
13418
+ plan_id: plan.id,
13419
+ coupon_code: couponCode,
13420
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13421
+ gift_recipient_email: giftRecipient.email,
13422
+ gift_recipient_first_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.firstName,
13423
+ gift_recipient_last_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.lastName,
13424
+ gift_start_date: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.startDate,
13425
+ gift_message: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.giftMessage,
13426
+ address_id: product.address_required ? addressId : null,
13427
+ ...params
13428
+ }, (err, res) => {
13429
+ callback(err, res);
13430
+ });
13431
+ }
13432
+ });
13433
+
13434
+ _renewGiftedSubscription2.set(this, {
13435
+ writable: true,
13436
+ value: (options, callback) => {
13437
+ const {
13438
+ subscriptionIdToRenew,
13439
+ token,
13440
+ product,
13441
+ plan,
13442
+ couponCode,
13443
+ addressId,
13444
+ isExistingSource
13445
+ } = options;
13446
+ const params = isExistingSource ? {
13447
+ source_id: token
13448
+ } : {
13449
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13450
+ gateway_token: token
13451
+ };
13452
+ window.Pelcro.subscription.renewGift({
13453
+ auth_token: window.Pelcro.user.read().auth_token,
13454
+ plan_id: plan.id,
13455
+ coupon_code: couponCode,
13456
+ subscription_id: subscriptionIdToRenew,
13457
+ address_id: product.address_required ? addressId : null,
13458
+ ...params
13459
+ }, (err, res) => {
13460
+ callback(err, res);
13461
+ });
13462
+ }
13463
+ });
13464
+
13465
+ _purchaseEcommerceOrder2.set(this, {
13466
+ writable: true,
13467
+ value: (options, callback) => {
13468
+ const {
13469
+ token,
13470
+ items,
13471
+ couponCode,
13472
+ addressId,
13473
+ isExistingSource
13474
+ } = options;
13475
+ const params = isExistingSource ? {
13476
+ source_id: token
13477
+ } : {
13478
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13479
+ gateway_token: token
13480
+ };
13481
+ window.Pelcro.ecommerce.order.create({
13482
+ items,
13483
+ coupon_code: couponCode,
13484
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13485
+ ...params,
13486
+ ...(addressId && {
13487
+ address_id: addressId
13488
+ })
13489
+ }, (err, res) => {
13490
+ callback(err, res);
13491
+ });
13492
+ }
13493
+ });
13494
+
13495
+ _payInvoice3.set(this, {
13496
+ writable: true,
13497
+ value: (options, callback) => {
13498
+ const {
13499
+ token,
13500
+ invoiceId
13501
+ } = options;
13502
+ const params = options.isExistingSource ? {
13503
+ source_id: token,
13504
+ invoice_id: invoiceId
13505
+ } : {
13506
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13507
+ gateway_token: token,
13508
+ invoice_id: invoiceId
13509
+ };
13510
+ window.Pelcro.invoice.pay(params, (err, res) => {
13511
+ callback(err, res);
13512
+ });
13513
+ }
13514
+ });
13149
13515
  }
13150
13516
 
13151
13517
  }
@@ -13170,7 +13536,7 @@ class VantivGateway {
13170
13536
 
13171
13537
  /** @type {PaymentStateType} */
13172
13538
 
13173
- const initialState$f = {
13539
+ const initialState$g = {
13174
13540
  disableSubmit: false,
13175
13541
  isLoading: false,
13176
13542
  disableCouponButton: false,
@@ -13189,10 +13555,10 @@ const initialState$f = {
13189
13555
  content: ""
13190
13556
  }
13191
13557
  };
13192
- const store$f = /*#__PURE__*/React.createContext(initialState$f);
13558
+ const store$g = /*#__PURE__*/React.createContext(initialState$g);
13193
13559
  const {
13194
- Provider: Provider$f
13195
- } = store$f;
13560
+ Provider: Provider$g
13561
+ } = store$g;
13196
13562
 
13197
13563
  const PaymentMethodContainerWithoutStripe = ({
13198
13564
  style,
@@ -13205,7 +13571,7 @@ const PaymentMethodContainerWithoutStripe = ({
13205
13571
  onFailure = () => {},
13206
13572
  ...props
13207
13573
  }) => {
13208
- var _props$product, _props$plan, _props$subscriptionId, _props$selectedAddres, _props$giftRecipient, _props$isRenewingGift, _props$invoice;
13574
+ var _props$product, _props$plan, _props$subscriptionId, _props$selectedAddres, _props$giftRecipient, _props$isGift, _props$isRenewingGift, _props$invoice;
13209
13575
 
13210
13576
  const {
13211
13577
  t
@@ -13221,6 +13587,7 @@ const PaymentMethodContainerWithoutStripe = ({
13221
13587
  const subscriptionIdToRenew = (_props$subscriptionId = props.subscriptionIdToRenew) !== null && _props$subscriptionId !== void 0 ? _props$subscriptionId : pelcroStore.subscriptionIdToRenew;
13222
13588
  const selectedAddressId = (_props$selectedAddres = props.selectedAddressId) !== null && _props$selectedAddres !== void 0 ? _props$selectedAddres : pelcroStore.selectedAddressId;
13223
13589
  const giftRecipient = (_props$giftRecipient = props.giftRecipient) !== null && _props$giftRecipient !== void 0 ? _props$giftRecipient : pelcroStore.giftRecipient;
13590
+ const isGift = (_props$isGift = props.isGift) !== null && _props$isGift !== void 0 ? _props$isGift : pelcroStore.isGift;
13224
13591
  const isRenewingGift = (_props$isRenewingGift = props.isRenewingGift) !== null && _props$isRenewingGift !== void 0 ? _props$isRenewingGift : pelcroStore.isRenewingGift;
13225
13592
  const invoice = (_props$invoice = props.invoice) !== null && _props$invoice !== void 0 ? _props$invoice : pelcroStore.invoice;
13226
13593
  React.useEffect(() => {
@@ -13237,60 +13604,185 @@ const PaymentMethodContainerWithoutStripe = ({
13237
13604
  updateTotalAmountWithTax();
13238
13605
  }, []);
13239
13606
 
13240
- function submitVantivPayment() {
13607
+ const submitUsingVantiv = () => {
13608
+ const isUsingExistingPaymentMethod = Boolean(selectedPaymentMethodId);
13609
+
13610
+ if (isUsingExistingPaymentMethod) {
13611
+ // no need to create a new source using vantiv
13612
+ return handleVantivPayment(null);
13613
+ }
13614
+
13241
13615
  if (!vantivInstanceRef.current) {
13242
13616
  return console.error("Vantiv sdk script wasn't loaded, you need to load vantiv sdk before rendering the vantiv payment flow");
13243
13617
  }
13244
13618
 
13245
- const orderId = `pelcro-${new Date().getTime()}`; // calls handleVantivPayment
13619
+ const orderId = `pelcro-${new Date().getTime()}`;
13620
+ /*
13621
+ calls handleVantivPayment to either handle a payment or update a source by simply creating a new source
13622
+ */
13246
13623
 
13247
13624
  vantivInstanceRef.current.getPaypageRegistrationId({
13248
13625
  id: orderId,
13249
13626
  orderId: orderId
13250
13627
  });
13251
- }
13628
+ };
13252
13629
 
13253
13630
  function handleVantivPayment(paymentRequest) {
13254
- const SUCCESS_STATUS = "870";
13631
+ if (paymentRequest) {
13632
+ const SUCCESS_STATUS = "870";
13255
13633
 
13256
- if (paymentRequest.response !== SUCCESS_STATUS) {
13257
- return handlePaymentError({
13258
- error: new Error(paymentRequest.message)
13634
+ if (paymentRequest.response !== SUCCESS_STATUS) {
13635
+ return handlePaymentError({
13636
+ error: new Error(paymentRequest.message)
13637
+ });
13638
+ }
13639
+ }
13640
+
13641
+ const isUsingExistingPaymentMethod = Boolean(selectedPaymentMethodId);
13642
+
13643
+ if (type === "createPayment") {
13644
+ handleVantivSubscription();
13645
+ } else if (type === "orderCreate") {
13646
+ purchase(new VantivGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest, state, dispatch);
13647
+ } else if (type === "invoicePayment") {
13648
+ payInvoice(new VantivGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest, dispatch);
13649
+ } else if (type === "updatePaymentSource") {
13650
+ createNewVantivCard();
13651
+ }
13652
+
13653
+ function createNewVantivCard() {
13654
+ window.Pelcro.source.create({
13655
+ auth_token: window.Pelcro.user.read().auth_token,
13656
+ token: paymentRequest,
13657
+ gateway: "vantiv"
13658
+ }, (err, res) => {
13659
+ dispatch({
13660
+ type: DISABLE_SUBMIT,
13661
+ payload: false
13662
+ });
13663
+ dispatch({
13664
+ type: LOADING,
13665
+ payload: false
13666
+ });
13667
+
13668
+ if (err) {
13669
+ onFailure(err);
13670
+ return dispatch({
13671
+ type: SHOW_ALERT,
13672
+ payload: {
13673
+ type: "error",
13674
+ content: getErrorMessages(err)
13675
+ }
13676
+ });
13677
+ }
13678
+
13679
+ dispatch({
13680
+ type: SHOW_ALERT,
13681
+ payload: {
13682
+ type: "success",
13683
+ content: t("messages.sourceUpdated")
13684
+ }
13685
+ });
13686
+ onSuccess(res);
13259
13687
  });
13260
13688
  }
13261
13689
 
13262
- const subscription = new Subscription(new VantivGateway());
13263
- const {
13264
- couponCode
13265
- } = state;
13266
- return subscription.execute({
13267
- type: SUBSCRIPTION_TYPES.CREATE_SUBSCRIPTION,
13268
- token: paymentRequest,
13269
- quantity: plan.quantity,
13270
- plan,
13271
- couponCode,
13272
- product,
13273
- addressId: selectedAddressId
13274
- }, (err, res) => {
13275
- if (err) {
13276
- return handlePaymentError(err);
13277
- }
13690
+ function handleVantivSubscription() {
13691
+ const payment = new Payment(new VantivGateway());
13692
+ const createSubscription = !isGift && !subscriptionIdToRenew;
13693
+ const renewSubscription = !isGift && subscriptionIdToRenew;
13694
+ const giftSubscriprition = isGift && !subscriptionIdToRenew;
13695
+ const renewGift = isRenewingGift;
13696
+ const {
13697
+ couponCode
13698
+ } = state;
13278
13699
 
13279
- onSuccess(res);
13280
- });
13700
+ if (renewGift) {
13701
+ return payment.execute({
13702
+ type: PAYMENT_TYPES.RENEW_GIFTED_SUBSCRIPTION,
13703
+ token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
13704
+ plan,
13705
+ couponCode,
13706
+ product,
13707
+ isExistingSource: isUsingExistingPaymentMethod,
13708
+ subscriptionIdToRenew,
13709
+ addressId: selectedAddressId
13710
+ }, (err, res) => {
13711
+ if (err) {
13712
+ return handlePaymentError(err);
13713
+ }
13714
+
13715
+ onSuccess(res);
13716
+ });
13717
+ } else if (giftSubscriprition) {
13718
+ return payment.execute({
13719
+ type: PAYMENT_TYPES.CREATE_GIFTED_SUBSCRIPTION,
13720
+ token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
13721
+ quantity: plan.quantity,
13722
+ plan,
13723
+ couponCode,
13724
+ product,
13725
+ isExistingSource: isUsingExistingPaymentMethod,
13726
+ giftRecipient,
13727
+ addressId: selectedAddressId
13728
+ }, (err, res) => {
13729
+ if (err) {
13730
+ return handlePaymentError(err);
13731
+ }
13732
+
13733
+ onSuccess(res);
13734
+ });
13735
+ } else if (renewSubscription) {
13736
+ return payment.execute({
13737
+ type: PAYMENT_TYPES.RENEW_SUBSCRIPTION,
13738
+ token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
13739
+ quantity: plan.quantity,
13740
+ plan,
13741
+ couponCode,
13742
+ product,
13743
+ isExistingSource: isUsingExistingPaymentMethod,
13744
+ subscriptionIdToRenew,
13745
+ addressId: selectedAddressId
13746
+ }, (err, res) => {
13747
+ if (err) {
13748
+ return handlePaymentError(err);
13749
+ }
13750
+
13751
+ onSuccess(res);
13752
+ });
13753
+ } else if (createSubscription) {
13754
+ return payment.execute({
13755
+ type: PAYMENT_TYPES.CREATE_SUBSCRIPTION,
13756
+ token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
13757
+ quantity: plan.quantity,
13758
+ plan,
13759
+ couponCode,
13760
+ product,
13761
+ isExistingSource: isUsingExistingPaymentMethod,
13762
+ addressId: selectedAddressId
13763
+ }, (err, res) => {
13764
+ if (err) {
13765
+ return handlePaymentError(err);
13766
+ }
13767
+
13768
+ onSuccess(res);
13769
+ });
13770
+ }
13771
+ }
13281
13772
  }
13282
13773
 
13283
13774
  const vantivInstanceRef = React__default['default'].useRef(null);
13284
13775
  React.useEffect(() => {
13285
13776
  const cardProcessor = getSiteCardProcessor();
13286
13777
 
13287
- if (cardProcessor === "vantiv") {
13288
- var _window$Pelcro$site$r;
13778
+ if (cardProcessor === "vantiv" && !selectedPaymentMethodId) {
13779
+ var _window$Pelcro$site$r, _window$Pelcro$site$r2;
13289
13780
 
13290
- const payPageId = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.vantiv_pay_page_id;
13781
+ const payPageId = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.vantiv_gateway_settings.pay_page_id;
13782
+ const reportGroup = (_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.vantiv_gateway_settings.report_group;
13291
13783
  vantivInstanceRef.current = new window.EprotectIframeClient({
13292
13784
  paypageId: payPageId,
13293
- reportGroup: payPageId,
13785
+ reportGroup: reportGroup,
13294
13786
  style: "pelcro",
13295
13787
  height: "245",
13296
13788
  timeout: 50000,
@@ -13307,7 +13799,7 @@ const PaymentMethodContainerWithoutStripe = ({
13307
13799
  }
13308
13800
  });
13309
13801
  }
13310
- }, []);
13802
+ }, [selectedPaymentMethodId]);
13311
13803
 
13312
13804
  const initPaymentRequest = (state, dispatch) => {
13313
13805
  try {
@@ -13379,9 +13871,9 @@ const PaymentMethodContainerWithoutStripe = ({
13379
13871
 
13380
13872
 
13381
13873
  const updateTotalAmountWithTax = () => {
13382
- var _window$Pelcro$site$r2;
13874
+ var _window$Pelcro$site$r3;
13383
13875
 
13384
- 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;
13876
+ const taxesEnabled = (_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.taxes_enabled;
13385
13877
 
13386
13878
  if (taxesEnabled && type === "createPayment") {
13387
13879
  dispatch({
@@ -13538,6 +14030,7 @@ const PaymentMethodContainerWithoutStripe = ({
13538
14030
  window.Pelcro.order.create({
13539
14031
  auth_token: window.Pelcro.user.read().auth_token,
13540
14032
  plan_id: plan.id,
14033
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13541
14034
  coupon_code: couponCode,
13542
14035
  address_id: selectedAddressId
13543
14036
  }, handleCouponResponse);
@@ -13619,6 +14112,7 @@ const PaymentMethodContainerWithoutStripe = ({
13619
14112
  stripe_token: !stripeSource.isExistingSource ? stripeSource.id : undefined,
13620
14113
  auth_token: window.Pelcro.user.read().auth_token,
13621
14114
  plan_id: plan.id,
14115
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13622
14116
  quantity: plan.quantity,
13623
14117
  coupon_code: couponCode,
13624
14118
  gift_recipient_email: giftRecipient ? giftRecipient.email : null,
@@ -13690,6 +14184,7 @@ const PaymentMethodContainerWithoutStripe = ({
13690
14184
  stripe_token: !stripeSource.isExistingSource ? stripeSource.id : undefined,
13691
14185
  auth_token: window.Pelcro.user.read().auth_token,
13692
14186
  plan_id: plan.id,
14187
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13693
14188
  coupon_code: couponCode,
13694
14189
  subscription_id: subscriptionIdToRenew,
13695
14190
  address_id: product.address_required ? selectedAddressId : null
@@ -13731,7 +14226,7 @@ const PaymentMethodContainerWithoutStripe = ({
13731
14226
 
13732
14227
 
13733
14228
  const handlePaypalSubscription = (state, paypalNonce) => {
13734
- const subscription = new Subscription(new PaypalGateway());
14229
+ const payment = new Payment(new PaypalGateway());
13735
14230
  const {
13736
14231
  couponCode
13737
14232
  } = state;
@@ -13740,8 +14235,8 @@ const PaymentMethodContainerWithoutStripe = ({
13740
14235
  */
13741
14236
 
13742
14237
  if (giftRecipient) {
13743
- return subscription.execute({
13744
- type: SUBSCRIPTION_TYPES.CREATE_GIFTED_SUBSCRIPTION,
14238
+ return payment.execute({
14239
+ type: PAYMENT_TYPES.CREATE_GIFTED_SUBSCRIPTION,
13745
14240
  token: paypalNonce,
13746
14241
  quantity: plan.quantity,
13747
14242
  plan,
@@ -13774,8 +14269,8 @@ const PaymentMethodContainerWithoutStripe = ({
13774
14269
  });
13775
14270
  }
13776
14271
 
13777
- return subscription.execute({
13778
- type: SUBSCRIPTION_TYPES.CREATE_SUBSCRIPTION,
14272
+ return payment.execute({
14273
+ type: PAYMENT_TYPES.CREATE_SUBSCRIPTION,
13779
14274
  token: paypalNonce,
13780
14275
  quantity: plan.quantity,
13781
14276
  plan,
@@ -13807,7 +14302,7 @@ const PaymentMethodContainerWithoutStripe = ({
13807
14302
  });
13808
14303
  };
13809
14304
 
13810
- const purchase = (stripeSource, state, dispatch) => {
14305
+ const purchase = (gatewayService, gatewayToken, state, dispatch) => {
13811
14306
  const isQuickPurchase = !Array.isArray(order);
13812
14307
  const mappedOrderItems = isQuickPurchase ? [{
13813
14308
  sku_id: order.id,
@@ -13819,14 +14314,14 @@ const PaymentMethodContainerWithoutStripe = ({
13819
14314
  const {
13820
14315
  couponCode
13821
14316
  } = state;
13822
- window.Pelcro.ecommerce.order.create({
13823
- source_id: stripeSource.isExistingSource ? stripeSource.id : undefined,
13824
- stripe_token: !stripeSource.isExistingSource ? stripeSource.id : undefined,
14317
+ const payment = new Payment(gatewayService);
14318
+ payment.execute({
14319
+ type: PAYMENT_TYPES.PURCHASE_ECOMMERCE_ORDER,
14320
+ token: gatewayToken,
14321
+ isExistingSource: Boolean(selectedPaymentMethodId),
13825
14322
  items: mappedOrderItems,
13826
- coupon_code: couponCode,
13827
- ...(selectedAddressId && {
13828
- address_id: selectedAddressId
13829
- })
14323
+ addressId: selectedAddressId,
14324
+ couponCode
13830
14325
  }, (err, res) => {
13831
14326
  dispatch({
13832
14327
  type: DISABLE_SUBMIT,
@@ -13864,9 +14359,9 @@ const PaymentMethodContainerWithoutStripe = ({
13864
14359
  };
13865
14360
 
13866
14361
  const payInvoice = (gatewayService, gatewayToken, dispatch) => {
13867
- const subscription = new Subscription(gatewayService);
13868
- return subscription.execute({
13869
- type: SUBSCRIPTION_TYPES.PAY_INVOICE,
14362
+ const payment = new Payment(gatewayService);
14363
+ return payment.execute({
14364
+ type: PAYMENT_TYPES.PAY_INVOICE,
13870
14365
  token: gatewayToken,
13871
14366
  isExistingSource: Boolean(selectedPaymentMethodId),
13872
14367
  invoiceId: invoice.id
@@ -13911,7 +14406,9 @@ const PaymentMethodContainerWithoutStripe = ({
13911
14406
 
13912
14407
  if ((source === null || source === void 0 ? void 0 : (_source$card2 = source.card) === null || _source$card2 === void 0 ? void 0 : _source$card2.three_d_secure) === "required") {
13913
14408
  return handlePaymentError({
13914
- message: t("messages.cardAuthNotSupported")
14409
+ error: {
14410
+ message: t("messages.cardAuthNotSupported")
14411
+ }
13915
14412
  });
13916
14413
  }
13917
14414
 
@@ -14026,13 +14523,13 @@ const PaymentMethodContainerWithoutStripe = ({
14026
14523
 
14027
14524
 
14028
14525
  const resolveTaxCalculation = () => {
14029
- var _window$Pelcro$site$r3;
14526
+ var _window$Pelcro$site$r4;
14030
14527
 
14031
14528
  if (type === "invoicePayment") {
14032
14529
  return new Promise(resolve => resolve());
14033
14530
  }
14034
14531
 
14035
- const taxesEnabled = (_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.taxes_enabled;
14532
+ const taxesEnabled = (_window$Pelcro$site$r4 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r4 === void 0 ? void 0 : _window$Pelcro$site$r4.taxes_enabled;
14036
14533
  return new Promise((resolve, reject) => {
14037
14534
  // resolve early if taxes isn't enabled
14038
14535
  if (!taxesEnabled) {
@@ -14042,6 +14539,7 @@ const PaymentMethodContainerWithoutStripe = ({
14042
14539
  window.Pelcro.order.create({
14043
14540
  auth_token: window.Pelcro.user.read().auth_token,
14044
14541
  plan_id: plan.id,
14542
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
14045
14543
  coupon_code: state === null || state === void 0 ? void 0 : state.couponCode,
14046
14544
  address_id: selectedAddressId
14047
14545
  }, (error, res) => {
@@ -14104,7 +14602,7 @@ const PaymentMethodContainerWithoutStripe = ({
14104
14602
  if (stripeSource && type === "createPayment") {
14105
14603
  subscribe(stripeSource, state, dispatch);
14106
14604
  } else if (stripeSource && type === "orderCreate") {
14107
- purchase(stripeSource, state, dispatch);
14605
+ purchase(new StripeGateway(), stripeSource.id, state, dispatch);
14108
14606
  } else if (stripeSource && type === "invoicePayment") {
14109
14607
  payInvoice(new StripeGateway(), stripeSource.id, dispatch);
14110
14608
  }
@@ -14155,7 +14653,9 @@ const PaymentMethodContainerWithoutStripe = ({
14155
14653
 
14156
14654
  if ((source === null || source === void 0 ? void 0 : source.status) === "failed") {
14157
14655
  return handlePaymentError({
14158
- message: t("messages.cardAuthFailed")
14656
+ error: {
14657
+ message: t("messages.cardAuthFailed")
14658
+ }
14159
14659
  });
14160
14660
  }
14161
14661
 
@@ -14226,6 +14726,10 @@ const PaymentMethodContainerWithoutStripe = ({
14226
14726
  disableSubmit: true,
14227
14727
  isLoading: true
14228
14728
  }, (state, dispatch) => {
14729
+ if (getSiteCardProcessor() === "vantiv") {
14730
+ return submitUsingVantiv();
14731
+ }
14732
+
14229
14733
  if (selectedPaymentMethodId) {
14230
14734
  // pay with selected method (source) if exists already
14231
14735
  return handlePayment({
@@ -14238,10 +14742,6 @@ const PaymentMethodContainerWithoutStripe = ({
14238
14742
  return updatePaymentSource(state, dispatch);
14239
14743
  }
14240
14744
 
14241
- if (getSiteCardProcessor() === "vantiv") {
14242
- return submitVantivPayment();
14243
- }
14244
-
14245
14745
  submitPayment(state);
14246
14746
  });
14247
14747
 
@@ -14310,21 +14810,21 @@ const PaymentMethodContainerWithoutStripe = ({
14310
14810
  default:
14311
14811
  return state;
14312
14812
  }
14313
- }, initialState$f);
14813
+ }, initialState$g);
14314
14814
  return /*#__PURE__*/React__default['default'].createElement("div", {
14315
14815
  style: { ...style
14316
14816
  },
14317
14817
  className: `pelcro-container pelcro-payment-container ${className}`
14318
- }, /*#__PURE__*/React__default['default'].createElement(Provider$f, {
14818
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$g, {
14319
14819
  value: {
14320
14820
  state,
14321
14821
  dispatch
14322
14822
  }
14323
14823
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
14324
- store: store$f,
14824
+ store: store$g,
14325
14825
  key: i
14326
14826
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
14327
- store: store$f
14827
+ store: store$g
14328
14828
  })));
14329
14829
  };
14330
14830
 
@@ -14346,7 +14846,7 @@ const PaymentMethodContainer = props => {
14346
14846
  stripeAccount: window.Pelcro.site.read().account_id,
14347
14847
  locale: getPageOrDefaultLanguage()
14348
14848
  }, /*#__PURE__*/React__default['default'].createElement(es_11, null, /*#__PURE__*/React__default['default'].createElement(UnwrappedForm, Object.assign({
14349
- store: store$f
14849
+ store: store$g
14350
14850
  }, props))));
14351
14851
  }
14352
14852
 
@@ -14399,7 +14899,7 @@ const PelcroPaymentRequestButton = props => {
14399
14899
  currentPlan,
14400
14900
  updatedPrice
14401
14901
  }
14402
- } = React.useContext(store$f);
14902
+ } = React.useContext(store$g);
14403
14903
 
14404
14904
  const updatePaymentRequest = () => {
14405
14905
  // Make sure payment request is up to date, eg. user added a coupon code.
@@ -14475,7 +14975,7 @@ const DiscountedPrice = props => {
14475
14975
  taxAmount,
14476
14976
  percentOff
14477
14977
  }
14478
- } = React.useContext(store$f);
14978
+ } = React.useContext(store$g);
14479
14979
  const {
14480
14980
  order,
14481
14981
  plan
@@ -14525,7 +15025,7 @@ const SubmitPaymentMethod = ({
14525
15025
  isLoading,
14526
15026
  updatedPrice
14527
15027
  }
14528
- } = React.useContext(store$f);
15028
+ } = React.useContext(store$g);
14529
15029
  const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
14530
15030
  const price = updatedPrice !== null && updatedPrice !== void 0 ? updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount;
14531
15031
  const priceFormatted = getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
@@ -14546,17 +15046,17 @@ const SubmitPaymentMethod = ({
14546
15046
  }, t("labels.pay"), " ", priceFormatted && priceFormatted) : t("labels.submit"));
14547
15047
  };
14548
15048
 
14549
- var _path$l;
15049
+ var _path$n;
14550
15050
 
14551
- 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); }
15051
+ 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); }
14552
15052
 
14553
15053
  function SvgArrowLeft(props) {
14554
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
15054
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
14555
15055
  xmlns: "http://www.w3.org/2000/svg",
14556
15056
  fill: "none",
14557
15057
  viewBox: "0 0 24 24",
14558
15058
  stroke: "currentColor"
14559
- }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
15059
+ }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
14560
15060
  strokeLinecap: "round",
14561
15061
  strokeLinejoin: "round",
14562
15062
  strokeWidth: 2,
@@ -14575,7 +15075,7 @@ const ApplyCouponButton = ({
14575
15075
  disableCouponButton
14576
15076
  },
14577
15077
  dispatch
14578
- } = React.useContext(store$f);
15078
+ } = React.useContext(store$g);
14579
15079
  const {
14580
15080
  t
14581
15081
  } = useTranslation("checkoutForm");
@@ -14609,7 +15109,7 @@ const CouponCodeField = props => {
14609
15109
  couponCode,
14610
15110
  couponError
14611
15111
  }
14612
- } = React.useContext(store$f);
15112
+ } = React.useContext(store$g);
14613
15113
 
14614
15114
  const onCouponCodeChange = e => {
14615
15115
  dispatch({
@@ -14638,17 +15138,17 @@ const CouponCodeField = props => {
14638
15138
  }, props));
14639
15139
  };
14640
15140
 
14641
- var _path$k;
15141
+ var _path$m;
14642
15142
 
14643
- 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); }
15143
+ 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); }
14644
15144
 
14645
15145
  function SvgTicket(props) {
14646
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
15146
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
14647
15147
  xmlns: "http://www.w3.org/2000/svg",
14648
15148
  fill: "none",
14649
15149
  viewBox: "0 0 24 24",
14650
15150
  stroke: "currentColor"
14651
- }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
15151
+ }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
14652
15152
  strokeLinecap: "round",
14653
15153
  strokeLinejoin: "round",
14654
15154
  strokeWidth: 2,
@@ -14665,7 +15165,7 @@ const CouponCode = ({
14665
15165
  state: {
14666
15166
  enableCouponField
14667
15167
  }
14668
- } = React.useContext(store$f);
15168
+ } = React.useContext(store$g);
14669
15169
  const {
14670
15170
  t
14671
15171
  } = useTranslation("checkoutForm");
@@ -14922,7 +15422,7 @@ const PaypalSubscribeButton = props => {
14922
15422
  const {
14923
15423
  dispatch,
14924
15424
  state
14925
- } = React.useContext(store$f);
15425
+ } = React.useContext(store$g);
14926
15426
  const {
14927
15427
  product,
14928
15428
  plan,
@@ -15008,16 +15508,16 @@ const BankRedirection = () => {
15008
15508
  }));
15009
15509
  };
15010
15510
 
15011
- var _path$j;
15511
+ var _path$l;
15012
15512
 
15013
- 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); }
15513
+ 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); }
15014
15514
 
15015
15515
  function SvgLock(props) {
15016
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
15516
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
15017
15517
  xmlns: "http://www.w3.org/2000/svg",
15018
15518
  viewBox: "0 0 20 20",
15019
15519
  fill: "currentColor"
15020
- }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
15520
+ }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
15021
15521
  fillRule: "evenodd",
15022
15522
  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",
15023
15523
  clipRule: "evenodd"
@@ -15034,7 +15534,7 @@ const SelectedPaymentMethod = () => {
15034
15534
  state: {
15035
15535
  isLoading
15036
15536
  }
15037
- } = React.useContext(store$f);
15537
+ } = React.useContext(store$g);
15038
15538
  const {
15039
15539
  switchView,
15040
15540
  selectedPaymentMethodId
@@ -15076,7 +15576,7 @@ const TaxAmount = () => {
15076
15576
  state: {
15077
15577
  taxAmount
15078
15578
  }
15079
- } = React.useContext(store$f);
15579
+ } = React.useContext(store$g);
15080
15580
  const {
15081
15581
  plan
15082
15582
  } = usePelcro();
@@ -15240,12 +15740,12 @@ function SubscriptionRenewModal({
15240
15740
  }
15241
15741
  SubscriptionRenewModal.viewId = "subscription-renew";
15242
15742
 
15243
- var _path$i;
15743
+ var _path$k;
15244
15744
 
15245
- 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); }
15745
+ 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); }
15246
15746
 
15247
15747
  function SvgGift(props) {
15248
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
15748
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
15249
15749
  className: "plc-w-6 plc-h-6 plc-mr-2",
15250
15750
  fill: "none",
15251
15751
  stroke: "currentColor",
@@ -15254,7 +15754,7 @@ function SvgGift(props) {
15254
15754
  strokeWidth: 2,
15255
15755
  viewBox: "0 0 24 24",
15256
15756
  xmlns: "http://www.w3.org/2000/svg"
15257
- }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
15757
+ }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
15258
15758
  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"
15259
15759
  })));
15260
15760
  }
@@ -15595,7 +16095,7 @@ class DefaultNewsLetter extends React.Component {
15595
16095
 
15596
16096
  const NewsLetter = withTranslation("newsletter")(DefaultNewsLetter);
15597
16097
 
15598
- const initialState$e = {
16098
+ const initialState$f = {
15599
16099
  didSubToNewslettersBefore: false,
15600
16100
  newsletters: [],
15601
16101
  isListLoading: true,
@@ -15605,10 +16105,10 @@ const initialState$e = {
15605
16105
  content: ""
15606
16106
  }
15607
16107
  };
15608
- const store$e = /*#__PURE__*/React.createContext(initialState$e);
16108
+ const store$f = /*#__PURE__*/React.createContext(initialState$f);
15609
16109
  const {
15610
- Provider: Provider$e
15611
- } = store$e;
16110
+ Provider: Provider$f
16111
+ } = store$f;
15612
16112
 
15613
16113
  const NewsletterUpdateContainer = ({
15614
16114
  style,
@@ -15721,7 +16221,7 @@ const NewsletterUpdateContainer = ({
15721
16221
  default:
15722
16222
  return state;
15723
16223
  }
15724
- }, initialState$e);
16224
+ }, initialState$f);
15725
16225
  React.useEffect(() => {
15726
16226
  const getUserNewsletters = () => {
15727
16227
  var _window$Pelcro$user$r3, _window$Pelcro$user$r4;
@@ -15765,7 +16265,7 @@ const NewsletterUpdateContainer = ({
15765
16265
  style: { ...style
15766
16266
  },
15767
16267
  className: `pelcro-container pelcro-newsletter-update-container ${className}`
15768
- }, /*#__PURE__*/React__default['default'].createElement(Provider$e, {
16268
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$f, {
15769
16269
  value: {
15770
16270
  state,
15771
16271
  dispatch
@@ -15773,12 +16273,12 @@ const NewsletterUpdateContainer = ({
15773
16273
  }, children.length ? children.map((child, i) => {
15774
16274
  if (child) {
15775
16275
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
15776
- store: store$e,
16276
+ store: store$f,
15777
16277
  key: i
15778
16278
  });
15779
16279
  }
15780
16280
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
15781
- store: store$e
16281
+ store: store$f
15782
16282
  })));
15783
16283
  };
15784
16284
 
@@ -15793,7 +16293,7 @@ const NewsletterUpdateButton = ({
15793
16293
  isSubmitting,
15794
16294
  isListLoading
15795
16295
  }
15796
- } = React.useContext(store$e);
16296
+ } = React.useContext(store$f);
15797
16297
  const {
15798
16298
  t
15799
16299
  } = useTranslation("newsletter");
@@ -15823,7 +16323,7 @@ const NewsletterUpdateList = () => {
15823
16323
  newsletters,
15824
16324
  isListLoading
15825
16325
  }
15826
- } = React.useContext(store$e);
16326
+ } = React.useContext(store$f);
15827
16327
 
15828
16328
  if (isListLoading) {
15829
16329
  return /*#__PURE__*/React__default['default'].createElement(Loader, {
@@ -16027,7 +16527,7 @@ function SubscriptionCreateModal({
16027
16527
  SubscriptionCreateModal.viewId = "subscription-create";
16028
16528
 
16029
16529
  var _window$Pelcro$user$r, _window$Pelcro$user$r2, _window$Pelcro$user$r3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
16030
- const initialState$d = {
16530
+ const initialState$e = {
16031
16531
  email: (_window$Pelcro$user$r = window.Pelcro.user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.email,
16032
16532
  firstName: (_window$Pelcro$user$r2 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.first_name,
16033
16533
  lastName: (_window$Pelcro$user$r3 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r3 === void 0 ? void 0 : _window$Pelcro$user$r3.last_name,
@@ -16040,10 +16540,10 @@ const initialState$d = {
16040
16540
  content: ""
16041
16541
  }
16042
16542
  };
16043
- const store$d = /*#__PURE__*/React.createContext(initialState$d);
16543
+ const store$e = /*#__PURE__*/React.createContext(initialState$e);
16044
16544
  const {
16045
- Provider: Provider$d
16046
- } = store$d;
16545
+ Provider: Provider$e
16546
+ } = store$e;
16047
16547
 
16048
16548
  const UserUpdateContainer = ({
16049
16549
  style,
@@ -16175,27 +16675,27 @@ const UserUpdateContainer = ({
16175
16675
  default:
16176
16676
  return state;
16177
16677
  }
16178
- }, initialState$d);
16678
+ }, initialState$e);
16179
16679
  return /*#__PURE__*/React__default['default'].createElement("div", {
16180
16680
  style: { ...style
16181
16681
  },
16182
16682
  className: `pelcro-container pelcro-user-update-container ${className}`
16183
- }, /*#__PURE__*/React__default['default'].createElement(Provider$d, {
16683
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$e, {
16184
16684
  value: {
16185
16685
  state,
16186
16686
  dispatch
16187
16687
  }
16188
16688
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
16189
- store: store$d,
16689
+ store: store$e,
16190
16690
  key: i
16191
16691
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
16192
- store: store$d
16692
+ store: store$e
16193
16693
  })));
16194
16694
  };
16195
16695
 
16196
16696
  const UserUpdateEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
16197
16697
  disabled: true,
16198
- store: store$d
16698
+ store: store$e
16199
16699
  }, props));
16200
16700
 
16201
16701
  const UserUpdateButton = ({
@@ -16208,7 +16708,7 @@ const UserUpdateButton = ({
16208
16708
  buttonDisabled
16209
16709
  },
16210
16710
  dispatch
16211
- } = React.useContext(store$d);
16711
+ } = React.useContext(store$e);
16212
16712
  const {
16213
16713
  t
16214
16714
  } = useTranslation("userEdit");
@@ -16225,11 +16725,11 @@ const UserUpdateButton = ({
16225
16725
  };
16226
16726
 
16227
16727
  const UserUpdateFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
16228
- store: store$d
16728
+ store: store$e
16229
16729
  }, props));
16230
16730
 
16231
16731
  const UserUpdateLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
16232
- store: store$d
16732
+ store: store$e
16233
16733
  }, props));
16234
16734
 
16235
16735
  function Phone({
@@ -16258,22 +16758,22 @@ function Phone({
16258
16758
  }
16259
16759
 
16260
16760
  const UserUpdatePhone = props => /*#__PURE__*/React__default['default'].createElement(Phone, Object.assign({
16261
- store: store$d
16761
+ store: store$e
16262
16762
  }, props));
16263
16763
 
16264
16764
  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";
16265
16765
 
16266
- var _path$h;
16766
+ var _path$j;
16267
16767
 
16268
- 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); }
16768
+ 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); }
16269
16769
 
16270
16770
  function SvgEdit(props) {
16271
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$j({
16771
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
16272
16772
  className: "plc-w-6 plc-h-6",
16273
16773
  xmlns: "http://www.w3.org/2000/svg",
16274
16774
  viewBox: "0 0 20 20",
16275
16775
  fill: "currentColor"
16276
- }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
16776
+ }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
16277
16777
  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"
16278
16778
  })));
16279
16779
  }
@@ -16405,16 +16905,16 @@ function DisplayName({
16405
16905
  }
16406
16906
 
16407
16907
  const UserUpdateDisplayName = props => /*#__PURE__*/React__default['default'].createElement(DisplayName, Object.assign({
16408
- store: store$d
16908
+ store: store$e
16409
16909
  }, props));
16410
16910
 
16411
16911
  const UserUpdateTextInput = props => {
16412
16912
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
16413
- store: store$d
16913
+ store: store$e
16414
16914
  }));
16415
16915
  };
16416
16916
 
16417
- const initialState$c = {
16917
+ const initialState$d = {
16418
16918
  isSubmitting: false,
16419
16919
  firstName: "",
16420
16920
  firstNameError: "",
@@ -16439,10 +16939,10 @@ const initialState$c = {
16439
16939
  content: ""
16440
16940
  }
16441
16941
  };
16442
- const store$c = /*#__PURE__*/React.createContext(initialState$c);
16942
+ const store$d = /*#__PURE__*/React.createContext(initialState$d);
16443
16943
  const {
16444
- Provider: Provider$c
16445
- } = store$c;
16944
+ Provider: Provider$d
16945
+ } = store$d;
16446
16946
 
16447
16947
  const getNewlyCreatedAddress = addresses => addresses[addresses.length - 1];
16448
16948
 
@@ -16649,7 +17149,7 @@ const AddressCreateContainer = ({
16649
17149
  default:
16650
17150
  return state;
16651
17151
  }
16652
- }, initialState$c);
17152
+ }, initialState$d);
16653
17153
  React.useEffect(() => {
16654
17154
  const getStates = () => {
16655
17155
  dispatch({
@@ -16681,16 +17181,16 @@ const AddressCreateContainer = ({
16681
17181
  style: { ...style
16682
17182
  },
16683
17183
  className: `pelcro-container pelcro-address-create-container ${className}`
16684
- }, /*#__PURE__*/React__default['default'].createElement(Provider$c, {
17184
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$d, {
16685
17185
  value: {
16686
17186
  state,
16687
17187
  dispatch
16688
17188
  }
16689
17189
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
16690
- store: store$c,
17190
+ store: store$d,
16691
17191
  key: i
16692
17192
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
16693
- store: store$c
17193
+ store: store$d
16694
17194
  })));
16695
17195
  };
16696
17196
 
@@ -16701,7 +17201,7 @@ function AddressCreateFirstName(props) {
16701
17201
  firstName,
16702
17202
  firstNameError
16703
17203
  }
16704
- } = React.useContext(store$c);
17204
+ } = React.useContext(store$d);
16705
17205
 
16706
17206
  const handleBlur = () => {
16707
17207
  return dispatch({
@@ -16744,7 +17244,7 @@ function AddressCreateLastName(props) {
16744
17244
  lastName,
16745
17245
  lastNameError
16746
17246
  }
16747
- } = React.useContext(store$c);
17247
+ } = React.useContext(store$d);
16748
17248
 
16749
17249
  const handleBlur = () => {
16750
17250
  return dispatch({
@@ -16787,7 +17287,7 @@ function AddressCreateLine1(props) {
16787
17287
  line1,
16788
17288
  line1Error
16789
17289
  }
16790
- } = React.useContext(store$c);
17290
+ } = React.useContext(store$d);
16791
17291
 
16792
17292
  const handleBlur = () => {
16793
17293
  return dispatch({
@@ -16830,7 +17330,7 @@ function AddressCreateCity(props) {
16830
17330
  city,
16831
17331
  cityError
16832
17332
  }
16833
- } = React.useContext(store$c);
17333
+ } = React.useContext(store$d);
16834
17334
 
16835
17335
  const handleBlur = () => {
16836
17336
  return dispatch({
@@ -16873,7 +17373,7 @@ function AddressCreatePostalCode(props) {
16873
17373
  postalCode,
16874
17374
  postalCodeError
16875
17375
  }
16876
- } = React.useContext(store$c);
17376
+ } = React.useContext(store$d);
16877
17377
 
16878
17378
  const handleBlur = () => {
16879
17379
  return dispatch({
@@ -16919,7 +17419,7 @@ const AddressCreateSubmit = ({
16919
17419
  state: {
16920
17420
  isSubmitting
16921
17421
  }
16922
- } = React.useContext(store$c);
17422
+ } = React.useContext(store$d);
16923
17423
  const {
16924
17424
  t
16925
17425
  } = useTranslation("address");
@@ -17030,7 +17530,7 @@ function CountrySelect({
17030
17530
  }
17031
17531
 
17032
17532
  const AddressCreateCountrySelect = props => /*#__PURE__*/React__default['default'].createElement(CountrySelect, Object.assign({
17033
- store: store$c
17533
+ store: store$d
17034
17534
  }, props));
17035
17535
 
17036
17536
  function StateSelect({
@@ -17118,7 +17618,7 @@ function StateSelect({
17118
17618
  }
17119
17619
 
17120
17620
  const AddressCreateStateSelect = props => /*#__PURE__*/React__default['default'].createElement(StateSelect, Object.assign({
17121
- store: store$c
17621
+ store: store$d
17122
17622
  }, props));
17123
17623
 
17124
17624
  const AddressCreateView = props => {
@@ -17223,18 +17723,18 @@ AddressCreateModal.viewId = "address-create";
17223
17723
 
17224
17724
  const AddressCreateTextInput = props => {
17225
17725
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
17226
- store: store$c
17726
+ store: store$d
17227
17727
  }));
17228
17728
  };
17229
17729
 
17230
17730
  const AddressCreateLine2 = props => {
17231
17731
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({
17232
17732
  fieldName: "line2",
17233
- store: store$c
17733
+ store: store$d
17234
17734
  }, props));
17235
17735
  };
17236
17736
 
17237
- const initialState$b = {
17737
+ const initialState$c = {
17238
17738
  isSubmitting: false,
17239
17739
  firstName: "",
17240
17740
  firstNameError: "",
@@ -17259,10 +17759,10 @@ const initialState$b = {
17259
17759
  content: ""
17260
17760
  }
17261
17761
  };
17262
- const store$b = /*#__PURE__*/React.createContext(initialState$b);
17762
+ const store$c = /*#__PURE__*/React.createContext(initialState$c);
17263
17763
  const {
17264
- Provider: Provider$b
17265
- } = store$b;
17764
+ Provider: Provider$c
17765
+ } = store$c;
17266
17766
 
17267
17767
  const AddressUpdateContainer = ({
17268
17768
  style,
@@ -17314,7 +17814,7 @@ const AddressUpdateContainer = ({
17314
17814
  const thisAddress = addresses[address];
17315
17815
 
17316
17816
  if (+thisAddress.id === +addressId) {
17317
- const newState = { ...initialState$b,
17817
+ const newState = { ...initialState$c,
17318
17818
  firstName: thisAddress.first_name,
17319
17819
  lastName: thisAddress.last_name,
17320
17820
  line1: thisAddress.line1,
@@ -17447,7 +17947,7 @@ const AddressUpdateContainer = ({
17447
17947
  default:
17448
17948
  return state;
17449
17949
  }
17450
- }, initialState$b);
17950
+ }, initialState$c);
17451
17951
  React.useEffect(() => {
17452
17952
  const getStates = () => {
17453
17953
  dispatch({
@@ -17479,21 +17979,21 @@ const AddressUpdateContainer = ({
17479
17979
  style: { ...style
17480
17980
  },
17481
17981
  className: `pelcro-container pelcro-address-update-container ${className}`
17482
- }, /*#__PURE__*/React__default['default'].createElement(Provider$b, {
17982
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$c, {
17483
17983
  value: {
17484
17984
  state,
17485
17985
  dispatch
17486
17986
  }
17487
17987
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
17488
- store: store$b,
17988
+ store: store$c,
17489
17989
  key: i
17490
17990
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
17491
- store: store$b
17991
+ store: store$c
17492
17992
  })));
17493
17993
  };
17494
17994
 
17495
17995
  const AddressUpdateCountrySelect = props => /*#__PURE__*/React__default['default'].createElement(CountrySelect, Object.assign({
17496
- store: store$b
17996
+ store: store$c
17497
17997
  }, props));
17498
17998
 
17499
17999
  function AddressUpdateFirstName(props) {
@@ -17503,7 +18003,7 @@ function AddressUpdateFirstName(props) {
17503
18003
  firstName,
17504
18004
  firstNameError
17505
18005
  }
17506
- } = React.useContext(store$b);
18006
+ } = React.useContext(store$c);
17507
18007
 
17508
18008
  const handleBlur = () => {
17509
18009
  return dispatch({
@@ -17546,7 +18046,7 @@ function AddressUpdateLastName(props) {
17546
18046
  lastName,
17547
18047
  lastNameError
17548
18048
  }
17549
- } = React.useContext(store$b);
18049
+ } = React.useContext(store$c);
17550
18050
 
17551
18051
  const handleBlur = () => {
17552
18052
  return dispatch({
@@ -17589,7 +18089,7 @@ function AddressUpdateLine1(props) {
17589
18089
  line1,
17590
18090
  line1Error
17591
18091
  }
17592
- } = React.useContext(store$b);
18092
+ } = React.useContext(store$c);
17593
18093
 
17594
18094
  const handleBlur = () => {
17595
18095
  return dispatch({
@@ -17629,7 +18129,7 @@ const AddressUpdateLine2 = props => {
17629
18129
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({
17630
18130
  fieldName: "line2"
17631
18131
  }, props, {
17632
- store: store$b
18132
+ store: store$c
17633
18133
  }));
17634
18134
  };
17635
18135
 
@@ -17640,7 +18140,7 @@ function AddressUpdateCity(props) {
17640
18140
  city,
17641
18141
  cityError
17642
18142
  }
17643
- } = React.useContext(store$b);
18143
+ } = React.useContext(store$c);
17644
18144
 
17645
18145
  const handleBlur = () => {
17646
18146
  return dispatch({
@@ -17683,7 +18183,7 @@ function AddressUpdatePostalCode(props) {
17683
18183
  postalCode,
17684
18184
  postalCodeError
17685
18185
  }
17686
- } = React.useContext(store$b);
18186
+ } = React.useContext(store$c);
17687
18187
 
17688
18188
  const handleBlur = () => {
17689
18189
  return dispatch({
@@ -17729,7 +18229,7 @@ const AddressUpdateSubmit = ({
17729
18229
  state: {
17730
18230
  isSubmitting
17731
18231
  }
17732
- } = React.useContext(store$b);
18232
+ } = React.useContext(store$c);
17733
18233
  const {
17734
18234
  t
17735
18235
  } = useTranslation("address");
@@ -17745,7 +18245,7 @@ const AddressUpdateSubmit = ({
17745
18245
  };
17746
18246
 
17747
18247
  const AddressUpdateStateSelect = props => /*#__PURE__*/React__default['default'].createElement(StateSelect, Object.assign({
17748
- store: store$b
18248
+ store: store$c
17749
18249
  }, props));
17750
18250
 
17751
18251
  const AddressUpdateView = props => {
@@ -17828,7 +18328,7 @@ AddressUpdateModal.viewId = "address-edit";
17828
18328
 
17829
18329
  const AddressUpdateTextInput = props => {
17830
18330
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
17831
- store: store$b
18331
+ store: store$c
17832
18332
  }));
17833
18333
  };
17834
18334
 
@@ -17911,7 +18411,7 @@ const PaymentMethodUpdateModal = props => {
17911
18411
  };
17912
18412
  PaymentMethodUpdateModal.viewId = "payment-method-update";
17913
18413
 
17914
- const initialState$a = {
18414
+ const initialState$b = {
17915
18415
  email: "",
17916
18416
  password: "",
17917
18417
  passwordError: null,
@@ -17924,10 +18424,10 @@ const initialState$a = {
17924
18424
  content: ""
17925
18425
  }
17926
18426
  };
17927
- const store$a = /*#__PURE__*/React.createContext(initialState$a);
18427
+ const store$b = /*#__PURE__*/React.createContext(initialState$b);
17928
18428
  const {
17929
- Provider: Provider$a
17930
- } = store$a;
18429
+ Provider: Provider$b
18430
+ } = store$b;
17931
18431
 
17932
18432
  const PasswordResetContainer = ({
17933
18433
  style,
@@ -17984,7 +18484,7 @@ const PasswordResetContainer = ({
17984
18484
  type: SET_EMAIL,
17985
18485
  payload: window.Pelcro.helpers.getURLParameter("email")
17986
18486
  });
17987
- initialState$a.email = window.Pelcro.helpers.getURLParameter("email");
18487
+ initialState$b.email = window.Pelcro.helpers.getURLParameter("email");
17988
18488
  dispatch({
17989
18489
  type: SET_TOKEN,
17990
18490
  payload: window.Pelcro.helpers.getURLParameter("token")
@@ -18044,26 +18544,26 @@ const PasswordResetContainer = ({
18044
18544
  default:
18045
18545
  return state;
18046
18546
  }
18047
- }, initialState$a);
18547
+ }, initialState$b);
18048
18548
  return /*#__PURE__*/React__default['default'].createElement("div", {
18049
18549
  style: { ...style
18050
18550
  },
18051
18551
  className: `pelcro-container pelcro-password-reset-container ${className}`
18052
- }, /*#__PURE__*/React__default['default'].createElement(Provider$a, {
18552
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$b, {
18053
18553
  value: {
18054
18554
  state,
18055
18555
  dispatch
18056
18556
  }
18057
18557
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18058
- store: store$a,
18558
+ store: store$b,
18059
18559
  key: i
18060
18560
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18061
- store: store$a
18561
+ store: store$b
18062
18562
  })));
18063
18563
  };
18064
18564
 
18065
18565
  const PasswordResetPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
18066
- store: store$a
18566
+ store: store$b
18067
18567
  }, props));
18068
18568
 
18069
18569
  const PasswordResetButton = ({
@@ -18076,7 +18576,7 @@ const PasswordResetButton = ({
18076
18576
  buttonDisabled
18077
18577
  },
18078
18578
  dispatch
18079
- } = React.useContext(store$a);
18579
+ } = React.useContext(store$b);
18080
18580
  const {
18081
18581
  t
18082
18582
  } = useTranslation("passwordReset");
@@ -18093,14 +18593,14 @@ const PasswordResetButton = ({
18093
18593
  };
18094
18594
 
18095
18595
  const PasswordResetEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
18096
- store: store$a
18596
+ store: store$b
18097
18597
  }, props, {
18098
18598
  value: window.Pelcro.helpers.getURLParameter("email"),
18099
18599
  disabled: true
18100
18600
  }));
18101
18601
 
18102
18602
  const PasswordResetConfirmPassword = props => /*#__PURE__*/React__default['default'].createElement(ConfirmPassword, Object.assign({
18103
- store: store$a
18603
+ store: store$b
18104
18604
  }, props));
18105
18605
 
18106
18606
  const PasswordResetView = props => {
@@ -18152,7 +18652,7 @@ const PasswordResetModal = ({
18152
18652
  };
18153
18653
  PasswordResetModal.viewId = "password-reset";
18154
18654
 
18155
- const initialState$9 = {
18655
+ const initialState$a = {
18156
18656
  email: "",
18157
18657
  emailError: null,
18158
18658
  buttonDisabled: false,
@@ -18161,10 +18661,10 @@ const initialState$9 = {
18161
18661
  content: ""
18162
18662
  }
18163
18663
  };
18164
- const store$9 = /*#__PURE__*/React.createContext(initialState$9);
18664
+ const store$a = /*#__PURE__*/React.createContext(initialState$a);
18165
18665
  const {
18166
- Provider: Provider$9
18167
- } = store$9;
18666
+ Provider: Provider$a
18667
+ } = store$a;
18168
18668
 
18169
18669
  const PasswordForgotContainer = ({
18170
18670
  style,
@@ -18242,21 +18742,21 @@ const PasswordForgotContainer = ({
18242
18742
  default:
18243
18743
  return state;
18244
18744
  }
18245
- }, initialState$9);
18745
+ }, initialState$a);
18246
18746
  return /*#__PURE__*/React__default['default'].createElement("div", {
18247
18747
  style: { ...style
18248
18748
  },
18249
18749
  className: `pelcro-container pelcro-password-forgot-container ${className}`
18250
- }, /*#__PURE__*/React__default['default'].createElement(Provider$9, {
18750
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$a, {
18251
18751
  value: {
18252
18752
  state,
18253
18753
  dispatch
18254
18754
  }
18255
18755
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18256
- store: store$9,
18756
+ store: store$a,
18257
18757
  key: i
18258
18758
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18259
- store: store$9
18759
+ store: store$a
18260
18760
  })));
18261
18761
  };
18262
18762
 
@@ -18272,7 +18772,7 @@ const PasswordForgotButton = ({
18272
18772
  emailError
18273
18773
  },
18274
18774
  dispatch
18275
- } = React.useContext(store$9);
18775
+ } = React.useContext(store$a);
18276
18776
  const {
18277
18777
  t
18278
18778
  } = useTranslation("passwordForgot");
@@ -18293,7 +18793,7 @@ const PasswordForgotButton = ({
18293
18793
  };
18294
18794
 
18295
18795
  const PasswordForgotEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
18296
- store: store$9
18796
+ store: store$a
18297
18797
  }, props));
18298
18798
 
18299
18799
  const PasswordForgotView = props => {
@@ -18343,7 +18843,7 @@ const PasswordForgotModal = ({
18343
18843
  };
18344
18844
  PasswordForgotModal.viewId = "password-forgot";
18345
18845
 
18346
- const initialState$8 = {
18846
+ const initialState$9 = {
18347
18847
  currentPassword: "",
18348
18848
  newPassword: "",
18349
18849
  confirmNewPassword: "",
@@ -18357,10 +18857,10 @@ const initialState$8 = {
18357
18857
  content: ""
18358
18858
  }
18359
18859
  };
18360
- const store$8 = /*#__PURE__*/React.createContext(initialState$8);
18860
+ const store$9 = /*#__PURE__*/React.createContext(initialState$9);
18361
18861
  const {
18362
- Provider: Provider$8
18363
- } = store$8;
18862
+ Provider: Provider$9
18863
+ } = store$9;
18364
18864
  const PasswordChangeContainer = ({
18365
18865
  style,
18366
18866
  className = "",
@@ -18512,21 +19012,21 @@ const PasswordChangeContainer = ({
18512
19012
  default:
18513
19013
  return state;
18514
19014
  }
18515
- }, initialState$8);
19015
+ }, initialState$9);
18516
19016
  return /*#__PURE__*/React__default['default'].createElement("div", {
18517
19017
  style: { ...style
18518
19018
  },
18519
19019
  className: `pelcro-container pelcro-password-change-container ${className}`
18520
- }, /*#__PURE__*/React__default['default'].createElement(Provider$8, {
19020
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$9, {
18521
19021
  value: {
18522
19022
  state,
18523
19023
  dispatch
18524
19024
  }
18525
19025
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18526
- store: store$8,
19026
+ store: store$9,
18527
19027
  key: i
18528
19028
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18529
- store: store$8
19029
+ store: store$9
18530
19030
  })));
18531
19031
  };
18532
19032
 
@@ -18537,7 +19037,7 @@ function PasswordChangeCurrentPassword(props) {
18537
19037
  currentPassword,
18538
19038
  currentPasswordError
18539
19039
  }
18540
- } = React.useContext(store$8);
19040
+ } = React.useContext(store$9);
18541
19041
  const handleBlur = React.useCallback(() => {
18542
19042
  return dispatch({
18543
19043
  type: VALIDATE_PASSWORD
@@ -18571,7 +19071,7 @@ function PasswordChangeNewPassword(props) {
18571
19071
  newPassword,
18572
19072
  newPasswordError
18573
19073
  }
18574
- } = React.useContext(store$8);
19074
+ } = React.useContext(store$9);
18575
19075
  const handleBlur = React.useCallback(() => {
18576
19076
  return dispatch({
18577
19077
  type: VALIDATE_NEW_PASSWORD
@@ -18605,7 +19105,7 @@ function PasswordChangeConfirmNewPassword(props) {
18605
19105
  confirmNewPassword,
18606
19106
  confirmNewPasswordError
18607
19107
  }
18608
- } = React.useContext(store$8);
19108
+ } = React.useContext(store$9);
18609
19109
  const handleBlur = React.useCallback(() => {
18610
19110
  return dispatch({
18611
19111
  type: VALIDATE_CONFIRM_NEW_PASSWORD
@@ -18646,7 +19146,7 @@ const PasswordChangeButton = ({
18646
19146
  confirmNewPasswordError
18647
19147
  },
18648
19148
  dispatch
18649
- } = React.useContext(store$8);
19149
+ } = React.useContext(store$9);
18650
19150
  const {
18651
19151
  t
18652
19152
  } = useTranslation("passwordChange");
@@ -18712,17 +19212,17 @@ const PasswordChangeModal = ({
18712
19212
  };
18713
19213
  PasswordChangeModal.viewId = "password-change";
18714
19214
 
18715
- const initialState$7 = {
19215
+ const initialState$8 = {
18716
19216
  buttonDisabled: false,
18717
19217
  alert: {
18718
19218
  type: "error",
18719
19219
  content: ""
18720
19220
  }
18721
19221
  };
18722
- const store$7 = /*#__PURE__*/React.createContext(initialState$7);
19222
+ const store$8 = /*#__PURE__*/React.createContext(initialState$8);
18723
19223
  const {
18724
- Provider: Provider$7
18725
- } = store$7;
19224
+ Provider: Provider$8
19225
+ } = store$8;
18726
19226
 
18727
19227
  const CartContainer = ({
18728
19228
  style,
@@ -18813,21 +19313,21 @@ const CartContainer = ({
18813
19313
  default:
18814
19314
  return state;
18815
19315
  }
18816
- }, initialState$7);
19316
+ }, initialState$8);
18817
19317
  return /*#__PURE__*/React__default['default'].createElement("div", {
18818
19318
  style: { ...style
18819
19319
  },
18820
19320
  className: `pelcro-container pelcro-cart-container ${className}`
18821
- }, /*#__PURE__*/React__default['default'].createElement(Provider$7, {
19321
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$8, {
18822
19322
  value: {
18823
19323
  state,
18824
19324
  dispatch
18825
19325
  }
18826
19326
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18827
- store: store$7,
19327
+ store: store$8,
18828
19328
  key: i
18829
19329
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18830
- store: store$7
19330
+ store: store$8
18831
19331
  })));
18832
19332
  };
18833
19333
 
@@ -18864,7 +19364,7 @@ const CartSubmit = ({
18864
19364
  buttonDisabled
18865
19365
  },
18866
19366
  dispatch
18867
- } = React.useContext(store$7);
19367
+ } = React.useContext(store$8);
18868
19368
  const {
18869
19369
  t
18870
19370
  } = useTranslation("cart");
@@ -18895,7 +19395,7 @@ const CartTotalPrice = () => {
18895
19395
  state: {
18896
19396
  alert
18897
19397
  }
18898
- } = React.useContext(store$7);
19398
+ } = React.useContext(store$8);
18899
19399
  const {
18900
19400
  cartItems
18901
19401
  } = usePelcro();
@@ -19208,7 +19708,7 @@ const OrderConfirmModal = props => {
19208
19708
  };
19209
19709
  OrderConfirmModal.viewId = "order-confirm";
19210
19710
 
19211
- const initialState$6 = {
19711
+ const initialState$7 = {
19212
19712
  email: "",
19213
19713
  firstName: "",
19214
19714
  lastName: "",
@@ -19220,10 +19720,10 @@ const initialState$6 = {
19220
19720
  content: ""
19221
19721
  }
19222
19722
  };
19223
- const store$6 = /*#__PURE__*/React.createContext(initialState$6);
19723
+ const store$7 = /*#__PURE__*/React.createContext(initialState$7);
19224
19724
  const {
19225
- Provider: Provider$6
19226
- } = store$6;
19725
+ Provider: Provider$7
19726
+ } = store$7;
19227
19727
 
19228
19728
  const GiftCreateContainer = ({
19229
19729
  style,
@@ -19327,21 +19827,21 @@ const GiftCreateContainer = ({
19327
19827
  default:
19328
19828
  return state;
19329
19829
  }
19330
- }, initialState$6);
19830
+ }, initialState$7);
19331
19831
  return /*#__PURE__*/React__default['default'].createElement("div", {
19332
19832
  style: { ...style
19333
19833
  },
19334
19834
  className: `pelcro-container pelcro-gift-create-container ${className}`
19335
- }, /*#__PURE__*/React__default['default'].createElement(Provider$6, {
19835
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$7, {
19336
19836
  value: {
19337
19837
  state,
19338
19838
  dispatch
19339
19839
  }
19340
19840
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
19341
- store: store$6,
19841
+ store: store$7,
19342
19842
  key: i
19343
19843
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
19344
- store: store$6
19844
+ store: store$7
19345
19845
  })));
19346
19846
  };
19347
19847
 
@@ -19355,7 +19855,7 @@ const GiftCreateSubmitButton = ({
19355
19855
  state: {
19356
19856
  disableSubmit
19357
19857
  }
19358
- } = React.useContext(store$6);
19858
+ } = React.useContext(store$7);
19359
19859
  const {
19360
19860
  t
19361
19861
  } = useTranslation("register");
@@ -19372,29 +19872,29 @@ const GiftCreateSubmitButton = ({
19372
19872
 
19373
19873
  const GiftCreateEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
19374
19874
  initWithUserEmail: false,
19375
- store: store$6
19875
+ store: store$7
19376
19876
  }, props));
19377
19877
 
19378
19878
  const GiftCreateFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
19379
- store: store$6
19879
+ store: store$7
19380
19880
  }, props));
19381
19881
 
19382
19882
  const GiftCreateLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
19383
- store: store$6
19883
+ store: store$7
19384
19884
  }, props));
19385
19885
 
19386
- var _path$g;
19886
+ var _path$i;
19387
19887
 
19388
- 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); }
19888
+ 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); }
19389
19889
 
19390
19890
  function SvgInfoCircle(props) {
19391
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
19891
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
19392
19892
  xmlns: "http://www.w3.org/2000/svg",
19393
19893
  className: "plc-w-5 plc-h-5",
19394
19894
  fill: "none",
19395
19895
  viewBox: "0 0 24 24",
19396
19896
  stroke: "currentColor"
19397
- }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
19897
+ }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
19398
19898
  strokeLinecap: "round",
19399
19899
  strokeLinejoin: "round",
19400
19900
  strokeWidth: 2,
@@ -19465,7 +19965,7 @@ const GiftCreateStartDate = props => {
19465
19965
  const {
19466
19966
  dispatch,
19467
19967
  state
19468
- } = React.useContext(store$6);
19968
+ } = React.useContext(store$7);
19469
19969
 
19470
19970
  const handleInputChange = value => {
19471
19971
  dispatch({
@@ -19538,7 +20038,7 @@ function GiftCreateMessage(props) {
19538
20038
  const {
19539
20039
  dispatch,
19540
20040
  state
19541
- } = React.useContext(store$6);
20041
+ } = React.useContext(store$7);
19542
20042
  const MAX_CHARS_COUNT = 200;
19543
20043
  const remainingCharsCount = (_ref = MAX_CHARS_COUNT - ((_state$giftMessage = state.giftMessage) === null || _state$giftMessage === void 0 ? void 0 : _state$giftMessage.length)) !== null && _ref !== void 0 ? _ref : 0;
19544
20044
 
@@ -19662,7 +20162,7 @@ const GiftCreateModal = ({
19662
20162
  };
19663
20163
  GiftCreateModal.viewId = "gift-create";
19664
20164
 
19665
- const initialState$5 = {
20165
+ const initialState$6 = {
19666
20166
  giftCode: "",
19667
20167
  buttonDisabled: true,
19668
20168
  alert: {
@@ -19670,10 +20170,10 @@ const initialState$5 = {
19670
20170
  content: ""
19671
20171
  }
19672
20172
  };
19673
- const store$5 = /*#__PURE__*/React.createContext(initialState$5);
20173
+ const store$6 = /*#__PURE__*/React.createContext(initialState$6);
19674
20174
  const {
19675
- Provider: Provider$5
19676
- } = store$5;
20175
+ Provider: Provider$6
20176
+ } = store$6;
19677
20177
 
19678
20178
  const GiftRedeemContainer = ({
19679
20179
  style,
@@ -19738,21 +20238,21 @@ const GiftRedeemContainer = ({
19738
20238
  default:
19739
20239
  return state;
19740
20240
  }
19741
- }, initialState$5);
20241
+ }, initialState$6);
19742
20242
  return /*#__PURE__*/React__default['default'].createElement("div", {
19743
20243
  style: { ...style
19744
20244
  },
19745
20245
  className: `pelcro-container pelcro-gift-redeem-container ${className}`
19746
- }, /*#__PURE__*/React__default['default'].createElement(Provider$5, {
20246
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$6, {
19747
20247
  value: {
19748
20248
  state,
19749
20249
  dispatch
19750
20250
  }
19751
20251
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
19752
- store: store$5,
20252
+ store: store$6,
19753
20253
  key: i
19754
20254
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
19755
- store: store$5
20255
+ store: store$6
19756
20256
  })));
19757
20257
  };
19758
20258
 
@@ -19789,7 +20289,7 @@ function GiftCode({
19789
20289
  }
19790
20290
 
19791
20291
  const GiftRedeemCode = props => /*#__PURE__*/React__default['default'].createElement(GiftCode, Object.assign({
19792
- store: store$5
20292
+ store: store$6
19793
20293
  }, props));
19794
20294
 
19795
20295
  const GiftRedeemSubmitButton = ({
@@ -19802,7 +20302,7 @@ const GiftRedeemSubmitButton = ({
19802
20302
  state: {
19803
20303
  disableSubmit
19804
20304
  }
19805
- } = React.useContext(store$5);
20305
+ } = React.useContext(store$6);
19806
20306
  const {
19807
20307
  t
19808
20308
  } = useTranslation("register");
@@ -19895,7 +20395,7 @@ const moveDefaultAddressToStart = addresses => {
19895
20395
  return [defaultAddress, ...addressesWithoutDefault];
19896
20396
  };
19897
20397
 
19898
- const initialState$4 = {
20398
+ const initialState$5 = {
19899
20399
  addresses: [],
19900
20400
  selectedAddressId: null,
19901
20401
  isSubmitting: false,
@@ -19904,10 +20404,10 @@ const initialState$4 = {
19904
20404
  content: ""
19905
20405
  }
19906
20406
  };
19907
- const store$4 = /*#__PURE__*/React.createContext(initialState$4);
20407
+ const store$5 = /*#__PURE__*/React.createContext(initialState$5);
19908
20408
  const {
19909
- Provider: Provider$4
19910
- } = store$4;
20409
+ Provider: Provider$5
20410
+ } = store$5;
19911
20411
 
19912
20412
  const AddressSelectContainer = ({
19913
20413
  style,
@@ -20002,7 +20502,7 @@ const AddressSelectContainer = ({
20002
20502
  default:
20003
20503
  return state;
20004
20504
  }
20005
- }, initialState$4);
20505
+ }, initialState$5);
20006
20506
  React.useEffect(() => {
20007
20507
  var _window$Pelcro$user$r;
20008
20508
 
@@ -20015,16 +20515,16 @@ const AddressSelectContainer = ({
20015
20515
  style: { ...style
20016
20516
  },
20017
20517
  className: `pelcro-container pelcro-address-select-container ${className}`
20018
- }, /*#__PURE__*/React__default['default'].createElement(Provider$4, {
20518
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$5, {
20019
20519
  value: {
20020
20520
  state,
20021
20521
  dispatch
20022
20522
  }
20023
20523
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
20024
- store: store$4,
20524
+ store: store$5,
20025
20525
  key: i
20026
20526
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
20027
- store: store$4
20527
+ store: store$5
20028
20528
  })));
20029
20529
  };
20030
20530
 
@@ -20035,7 +20535,7 @@ const AddressSelectList = () => {
20035
20535
  addresses,
20036
20536
  selectedAddressId
20037
20537
  }
20038
- } = React.useContext(store$4);
20538
+ } = React.useContext(store$5);
20039
20539
 
20040
20540
  const handleAddressSelect = event => {
20041
20541
  dispatch({
@@ -20079,7 +20579,7 @@ const AddressSelectSubmit = ({
20079
20579
  selectedAddressId,
20080
20580
  isSubmitting
20081
20581
  }
20082
- } = React.useContext(store$4);
20582
+ } = React.useContext(store$5);
20083
20583
  const {
20084
20584
  t
20085
20585
  } = useTranslation("address");
@@ -20175,7 +20675,7 @@ const moveDefaultPaymentMethodToStart = paymentMethods => {
20175
20675
  return [defaultPaymentMethod, ...paymentMethodsWithoutDefault];
20176
20676
  };
20177
20677
 
20178
- const initialState$3 = {
20678
+ const initialState$4 = {
20179
20679
  paymentMethods: [],
20180
20680
  selectedPaymentMethodId: null,
20181
20681
  isSubmitting: false,
@@ -20184,10 +20684,10 @@ const initialState$3 = {
20184
20684
  content: ""
20185
20685
  }
20186
20686
  };
20187
- const store$3 = /*#__PURE__*/React.createContext(initialState$3);
20687
+ const store$4 = /*#__PURE__*/React.createContext(initialState$4);
20188
20688
  const {
20189
- Provider: Provider$3
20190
- } = store$3;
20689
+ Provider: Provider$4
20690
+ } = store$4;
20191
20691
 
20192
20692
  const PaymentMethodSelectContainer = ({
20193
20693
  style,
@@ -20246,7 +20746,7 @@ const PaymentMethodSelectContainer = ({
20246
20746
  default:
20247
20747
  return state;
20248
20748
  }
20249
- }, initialState$3);
20749
+ }, initialState$4);
20250
20750
  React.useEffect(() => {
20251
20751
  var _window$Pelcro$user$r3;
20252
20752
 
@@ -20259,16 +20759,16 @@ const PaymentMethodSelectContainer = ({
20259
20759
  style: { ...style
20260
20760
  },
20261
20761
  className: `pelcro-container pelcro-payment-select-container ${className}`
20262
- }, /*#__PURE__*/React__default['default'].createElement(Provider$3, {
20762
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$4, {
20263
20763
  value: {
20264
20764
  state,
20265
20765
  dispatch
20266
20766
  }
20267
20767
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
20268
- store: store$3,
20768
+ store: store$4,
20269
20769
  key: i
20270
20770
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
20271
- store: store$3
20771
+ store: store$4
20272
20772
  })));
20273
20773
  };
20274
20774
 
@@ -20282,7 +20782,7 @@ const PaymentMethodSelectList = () => {
20282
20782
  paymentMethods,
20283
20783
  selectedPaymentMethodId
20284
20784
  }
20285
- } = React.useContext(store$3);
20785
+ } = React.useContext(store$4);
20286
20786
 
20287
20787
  const handlePaymentMethodSelect = event => {
20288
20788
  dispatch({
@@ -20332,7 +20832,7 @@ const PaymentMethodSelectSubmit = ({
20332
20832
  selectedPaymentMethodId,
20333
20833
  isSubmitting
20334
20834
  }
20335
- } = React.useContext(store$3);
20835
+ } = React.useContext(store$4);
20336
20836
  return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
20337
20837
  onClick: () => {
20338
20838
  dispatch({
@@ -20406,8 +20906,8 @@ const PaymentMethodSelectModal = ({
20406
20906
  };
20407
20907
  PaymentMethodSelectModal.viewId = "payment-method-select";
20408
20908
 
20409
- function _extends$h() {
20410
- _extends$h = Object.assign || function (target) {
20909
+ function _extends$j() {
20910
+ _extends$j = Object.assign || function (target) {
20411
20911
  for (var i = 1; i < arguments.length; i++) {
20412
20912
  var source = arguments[i];
20413
20913
 
@@ -20421,7 +20921,7 @@ function _extends$h() {
20421
20921
  return target;
20422
20922
  };
20423
20923
 
20424
- return _extends$h.apply(this, arguments);
20924
+ return _extends$j.apply(this, arguments);
20425
20925
  }
20426
20926
 
20427
20927
  function _objectWithoutPropertiesLoose(source, excluded) {
@@ -20605,7 +21105,7 @@ function render(props, propsBag, defaultTag, features, visible) {
20605
21105
  return match(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function () {
20606
21106
  return null;
20607
21107
  }, _match[RenderStrategy.Hidden] = function () {
20608
- return _render(_extends$h({}, _rest, {
21108
+ return _render(_extends$j({}, _rest, {
20609
21109
  hidden: true,
20610
21110
  style: {
20611
21111
  display: 'none'
@@ -21133,7 +21633,7 @@ function TransitionChild(props) {
21133
21633
  var passthroughProps = rest;
21134
21634
  return React__default['default'].createElement(NestingContext.Provider, {
21135
21635
  value: nesting
21136
- }, render(_extends$h({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
21636
+ }, render(_extends$j({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
21137
21637
  }
21138
21638
 
21139
21639
  function Transition(props) {
@@ -21177,7 +21677,7 @@ function Transition(props) {
21177
21677
  value: nestingBag
21178
21678
  }, React__default['default'].createElement(TransitionContext.Provider, {
21179
21679
  value: transitionBag
21180
- }, render(_extends$h({}, sharedProps, {
21680
+ }, render(_extends$j({}, sharedProps, {
21181
21681
  as: React.Fragment,
21182
21682
  children: React__default['default'].createElement(TransitionChild, Object.assign({}, sharedProps, passthroughProps))
21183
21683
  }), propsBag, React.Fragment, TransitionChildRenderFeatures, state === TreeStates.Visible)));
@@ -21304,12 +21804,12 @@ var ActionTypes;
21304
21804
  })(ActionTypes || (ActionTypes = {}));
21305
21805
 
21306
21806
  (_reducers = {}, _reducers[ActionTypes.CloseMenu] = function (state) {
21307
- return _extends$h({}, state, {
21807
+ return _extends$j({}, state, {
21308
21808
  activeItemIndex: null,
21309
21809
  menuState: MenuStates.Closed
21310
21810
  });
21311
21811
  }, _reducers[ActionTypes.OpenMenu] = function (state) {
21312
- return _extends$h({}, state, {
21812
+ return _extends$j({}, state, {
21313
21813
  menuState: MenuStates.Open
21314
21814
  });
21315
21815
  }, _reducers[ActionTypes.GoToItem] = function (state, action) {
@@ -21328,7 +21828,7 @@ var ActionTypes;
21328
21828
  }
21329
21829
  });
21330
21830
  if (state.searchQuery === '' && state.activeItemIndex === activeItemIndex) return state;
21331
- return _extends$h({}, state, {
21831
+ return _extends$j({}, state, {
21332
21832
  searchQuery: '',
21333
21833
  activeItemIndex: activeItemIndex
21334
21834
  });
@@ -21339,19 +21839,19 @@ var ActionTypes;
21339
21839
 
21340
21840
  return ((_item$dataRef$current = item.dataRef.current.textValue) == null ? void 0 : _item$dataRef$current.startsWith(searchQuery)) && !item.dataRef.current.disabled;
21341
21841
  });
21342
- if (match === -1 || match === state.activeItemIndex) return _extends$h({}, state, {
21842
+ if (match === -1 || match === state.activeItemIndex) return _extends$j({}, state, {
21343
21843
  searchQuery: searchQuery
21344
21844
  });
21345
- return _extends$h({}, state, {
21845
+ return _extends$j({}, state, {
21346
21846
  searchQuery: searchQuery,
21347
21847
  activeItemIndex: match
21348
21848
  });
21349
21849
  }, _reducers[ActionTypes.ClearSearch] = function (state) {
21350
- return _extends$h({}, state, {
21850
+ return _extends$j({}, state, {
21351
21851
  searchQuery: ''
21352
21852
  });
21353
21853
  }, _reducers[ActionTypes.RegisterItem] = function (state, action) {
21354
- return _extends$h({}, state, {
21854
+ return _extends$j({}, state, {
21355
21855
  items: [].concat(state.items, [{
21356
21856
  id: action.id,
21357
21857
  dataRef: action.dataRef
@@ -21364,7 +21864,7 @@ var ActionTypes;
21364
21864
  return a.id === action.id;
21365
21865
  });
21366
21866
  if (idx !== -1) nextItems.splice(idx, 1);
21367
- return _extends$h({}, state, {
21867
+ return _extends$j({}, state, {
21368
21868
  items: nextItems,
21369
21869
  activeItemIndex: function () {
21370
21870
  if (idx === state.activeItemIndex) return null;
@@ -21403,19 +21903,19 @@ var ActionTypes$1;
21403
21903
  (_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = function (state) {
21404
21904
  if (state.disabled) return state;
21405
21905
  if (state.listboxState === ListboxStates.Closed) return state;
21406
- return _extends$h({}, state, {
21906
+ return _extends$j({}, state, {
21407
21907
  activeOptionIndex: null,
21408
21908
  listboxState: ListboxStates.Closed
21409
21909
  });
21410
21910
  }, _reducers$1[ActionTypes$1.OpenListbox] = function (state) {
21411
21911
  if (state.disabled) return state;
21412
21912
  if (state.listboxState === ListboxStates.Open) return state;
21413
- return _extends$h({}, state, {
21913
+ return _extends$j({}, state, {
21414
21914
  listboxState: ListboxStates.Open
21415
21915
  });
21416
21916
  }, _reducers$1[ActionTypes$1.SetDisabled] = function (state, action) {
21417
21917
  if (state.disabled === action.disabled) return state;
21418
- return _extends$h({}, state, {
21918
+ return _extends$j({}, state, {
21419
21919
  disabled: action.disabled
21420
21920
  });
21421
21921
  }, _reducers$1[ActionTypes$1.GoToOption] = function (state, action) {
@@ -21436,7 +21936,7 @@ var ActionTypes$1;
21436
21936
  }
21437
21937
  });
21438
21938
  if (state.searchQuery === '' && state.activeOptionIndex === activeOptionIndex) return state;
21439
- return _extends$h({}, state, {
21939
+ return _extends$j({}, state, {
21440
21940
  searchQuery: '',
21441
21941
  activeOptionIndex: activeOptionIndex
21442
21942
  });
@@ -21449,10 +21949,10 @@ var ActionTypes$1;
21449
21949
 
21450
21950
  return !option.dataRef.current.disabled && ((_option$dataRef$curre = option.dataRef.current.textValue) == null ? void 0 : _option$dataRef$curre.startsWith(searchQuery));
21451
21951
  });
21452
- if (match === -1 || match === state.activeOptionIndex) return _extends$h({}, state, {
21952
+ if (match === -1 || match === state.activeOptionIndex) return _extends$j({}, state, {
21453
21953
  searchQuery: searchQuery
21454
21954
  });
21455
- return _extends$h({}, state, {
21955
+ return _extends$j({}, state, {
21456
21956
  searchQuery: searchQuery,
21457
21957
  activeOptionIndex: match
21458
21958
  });
@@ -21460,11 +21960,11 @@ var ActionTypes$1;
21460
21960
  if (state.disabled) return state;
21461
21961
  if (state.listboxState === ListboxStates.Closed) return state;
21462
21962
  if (state.searchQuery === '') return state;
21463
- return _extends$h({}, state, {
21963
+ return _extends$j({}, state, {
21464
21964
  searchQuery: ''
21465
21965
  });
21466
21966
  }, _reducers$1[ActionTypes$1.RegisterOption] = function (state, action) {
21467
- return _extends$h({}, state, {
21967
+ return _extends$j({}, state, {
21468
21968
  options: [].concat(state.options, [{
21469
21969
  id: action.id,
21470
21970
  dataRef: action.dataRef
@@ -21477,7 +21977,7 @@ var ActionTypes$1;
21477
21977
  return a.id === action.id;
21478
21978
  });
21479
21979
  if (idx !== -1) nextOptions.splice(idx, 1);
21480
- return _extends$h({}, state, {
21980
+ return _extends$j({}, state, {
21481
21981
  options: nextOptions,
21482
21982
  activeOptionIndex: function () {
21483
21983
  if (idx === state.activeOptionIndex) return null;
@@ -21538,18 +22038,18 @@ const getPaymentCardIcon = name => {
21538
22038
  }));
21539
22039
  };
21540
22040
 
21541
- var _path$f;
22041
+ var _path$h;
21542
22042
 
21543
- 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); }
22043
+ 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); }
21544
22044
 
21545
22045
  function SvgChevronRight(props) {
21546
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
22046
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
21547
22047
  className: "plc-w-6 plc-h-6",
21548
22048
  xmlns: "http://www.w3.org/2000/svg",
21549
22049
  fill: "none",
21550
22050
  viewBox: "0 0 24 24",
21551
22051
  stroke: "currentColor"
21552
- }, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
22052
+ }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
21553
22053
  strokeLinecap: "round",
21554
22054
  strokeLinejoin: "round",
21555
22055
  strokeWidth: 2,
@@ -21765,18 +22265,18 @@ const SavedItems = ({
21765
22265
  });
21766
22266
  };
21767
22267
 
21768
- var _path$e;
22268
+ var _path$g;
21769
22269
 
21770
- 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); }
22270
+ 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); }
21771
22271
 
21772
22272
  function SvgRefresh(props) {
21773
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
22273
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
21774
22274
  className: "plc-w-4 plc-h-4 plc-mr-1",
21775
22275
  xmlns: "http://www.w3.org/2000/svg",
21776
22276
  fill: "none",
21777
22277
  viewBox: "0 0 24 24",
21778
22278
  stroke: "currentColor"
21779
- }, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
22279
+ }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
21780
22280
  strokeLinecap: "round",
21781
22281
  strokeLinejoin: "round",
21782
22282
  strokeWidth: 2,
@@ -21784,35 +22284,35 @@ function SvgRefresh(props) {
21784
22284
  })));
21785
22285
  }
21786
22286
 
21787
- var _path$d;
22287
+ var _path$f;
21788
22288
 
21789
- 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); }
22289
+ 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); }
21790
22290
 
21791
22291
  function SvgCalendar(props) {
21792
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
22292
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
21793
22293
  xmlns: "http://www.w3.org/2000/svg",
21794
22294
  className: "plc-h-4 plc-w-4 plc-mr-1",
21795
22295
  viewBox: "0 0 20 20",
21796
22296
  fill: "currentColor"
21797
- }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
22297
+ }, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
21798
22298
  fillRule: "evenodd",
21799
22299
  d: "M6 2a1 1 0 00-1 1v1H4a2 2 0 00-2 2v10a2 2 0 002 2h12a2 2 0 002-2V6a2 2 0 00-2-2h-1V3a1 1 0 10-2 0v1H7V3a1 1 0 00-1-1zm0 5a1 1 0 000 2h8a1 1 0 100-2H6z",
21800
22300
  clipRule: "evenodd"
21801
22301
  })));
21802
22302
  }
21803
22303
 
21804
- var _path$c;
22304
+ var _path$e;
21805
22305
 
21806
- 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); }
22306
+ 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); }
21807
22307
 
21808
22308
  function SvgPlus(props) {
21809
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
22309
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
21810
22310
  className: "plc-w-5 plc-h-5",
21811
22311
  xmlns: "http://www.w3.org/2000/svg",
21812
22312
  fill: "none",
21813
22313
  viewBox: "0 0 24 24",
21814
22314
  stroke: "currentColor"
21815
- }, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
22315
+ }, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
21816
22316
  strokeLinecap: "round",
21817
22317
  strokeLinejoin: "round",
21818
22318
  strokeWidth: 2,
@@ -21820,17 +22320,17 @@ function SvgPlus(props) {
21820
22320
  })));
21821
22321
  }
21822
22322
 
21823
- var _path$b;
22323
+ var _path$d;
21824
22324
 
21825
- 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); }
22325
+ 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); }
21826
22326
 
21827
22327
  function SvgCheckMark(props) {
21828
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
22328
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
21829
22329
  className: "plc-w-4 plc-h-4 plc-mr-1",
21830
22330
  xmlns: "http://www.w3.org/2000/svg",
21831
22331
  viewBox: "0 0 20 20",
21832
22332
  fill: "currentColor"
21833
- }, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
22333
+ }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
21834
22334
  fillRule: "evenodd",
21835
22335
  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",
21836
22336
  clipRule: "evenodd"
@@ -21894,7 +22394,8 @@ const SubscriptionsItems = ({
21894
22394
  } = useTranslation("dashboard");
21895
22395
  const {
21896
22396
  switchView,
21897
- isAuthenticated
22397
+ switchToAddressView,
22398
+ switchToPaymentView
21898
22399
  } = usePelcro();
21899
22400
  const subs = getNonDonationSubs();
21900
22401
  if (subs.length === 0) return null;
@@ -21936,7 +22437,12 @@ const SubscriptionsItems = ({
21936
22437
  const plan = window.Pelcro.plan.getById(plan_id);
21937
22438
  setProductAndPlan(product, plan);
21938
22439
  setSubscriptionIdToRenew(sub.id);
21939
- setView("plan-select");
22440
+
22441
+ if (product.address_required) {
22442
+ return switchToAddressView();
22443
+ }
22444
+
22445
+ return switchToPaymentView();
21940
22446
  };
21941
22447
 
21942
22448
  const getPhases = () => {
@@ -22125,18 +22631,18 @@ Accordion.item = function AccordionItem({
22125
22631
  }, content)) : null;
22126
22632
  };
22127
22633
 
22128
- var _path$a;
22634
+ var _path$c;
22129
22635
 
22130
- 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); }
22636
+ 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); }
22131
22637
 
22132
22638
  function SvgExit(props) {
22133
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
22639
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
22134
22640
  className: "plc-w-6 plc-h-6",
22135
22641
  xmlns: "http://www.w3.org/2000/svg",
22136
22642
  fill: "none",
22137
22643
  viewBox: "0 0 24 24",
22138
22644
  stroke: "currentColor"
22139
- }, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
22645
+ }, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
22140
22646
  strokeLinecap: "round",
22141
22647
  strokeLinejoin: "round",
22142
22648
  strokeWidth: 2,
@@ -22144,17 +22650,17 @@ function SvgExit(props) {
22144
22650
  })));
22145
22651
  }
22146
22652
 
22147
- var _path$9;
22653
+ var _path$b;
22148
22654
 
22149
- 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); }
22655
+ 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); }
22150
22656
 
22151
22657
  function SvgUser(props) {
22152
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
22658
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
22153
22659
  xmlns: "http://www.w3.org/2000/svg",
22154
22660
  fill: "none",
22155
22661
  viewBox: "0 0 24 24",
22156
22662
  stroke: "currentColor"
22157
- }, props), _path$9 || (_path$9 = /*#__PURE__*/React__namespace.createElement("path", {
22663
+ }, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
22158
22664
  strokeLinecap: "round",
22159
22665
  strokeLinejoin: "round",
22160
22666
  strokeWidth: 2,
@@ -22162,18 +22668,18 @@ function SvgUser(props) {
22162
22668
  })));
22163
22669
  }
22164
22670
 
22165
- var _path$8;
22671
+ var _path$a;
22166
22672
 
22167
- 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); }
22673
+ 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); }
22168
22674
 
22169
22675
  function SvgNewsletter(props) {
22170
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
22676
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
22171
22677
  xmlns: "http://www.w3.org/2000/svg",
22172
22678
  className: "plc-h-5 plc-w-5",
22173
22679
  fill: "none",
22174
22680
  viewBox: "0 0 24 24",
22175
22681
  stroke: "currentColor"
22176
- }, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
22682
+ }, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
22177
22683
  strokeLinecap: "round",
22178
22684
  strokeLinejoin: "round",
22179
22685
  strokeWidth: 2,
@@ -22181,18 +22687,37 @@ function SvgNewsletter(props) {
22181
22687
  })));
22182
22688
  }
22183
22689
 
22184
- var _path$7;
22690
+ var _path$9;
22691
+
22692
+ 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); }
22185
22693
 
22186
- function _extends$8() { _extends$8 = 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$8.apply(this, arguments); }
22694
+ function SvgDocument(props) {
22695
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
22696
+ xmlns: "http://www.w3.org/2000/svg",
22697
+ className: "plc-h-6 plc-w-6 plc-mr-2",
22698
+ fill: "none",
22699
+ viewBox: "0 0 24 24",
22700
+ stroke: "currentColor"
22701
+ }, props), _path$9 || (_path$9 = /*#__PURE__*/React__namespace.createElement("path", {
22702
+ strokeLinecap: "round",
22703
+ strokeLinejoin: "round",
22704
+ strokeWidth: 2,
22705
+ d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
22706
+ })));
22707
+ }
22708
+
22709
+ var _path$8;
22710
+
22711
+ 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); }
22187
22712
 
22188
22713
  function SvgPaymentCard(props) {
22189
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
22714
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
22190
22715
  className: "plc-w-6 plc-h-6 plc-mr-2",
22191
22716
  xmlns: "http://www.w3.org/2000/svg",
22192
22717
  fill: "none",
22193
22718
  viewBox: "0 0 24 24",
22194
22719
  stroke: "currentColor"
22195
- }, props), _path$7 || (_path$7 = /*#__PURE__*/React__namespace.createElement("path", {
22720
+ }, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
22196
22721
  strokeLinecap: "round",
22197
22722
  strokeLinejoin: "round",
22198
22723
  strokeWidth: 2,
@@ -22200,18 +22725,18 @@ function SvgPaymentCard(props) {
22200
22725
  })));
22201
22726
  }
22202
22727
 
22203
- var _path$6, _path2$1;
22728
+ var _path$7, _path2$1;
22204
22729
 
22205
- function _extends$7() { _extends$7 = 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$7.apply(this, arguments); }
22730
+ function _extends$8() { _extends$8 = 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$8.apply(this, arguments); }
22206
22731
 
22207
22732
  function SvgLocationPin(props) {
22208
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$7({
22733
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
22209
22734
  className: "plc-w-6 plc-h-6 plc-mr-2",
22210
22735
  xmlns: "http://www.w3.org/2000/svg",
22211
22736
  fill: "none",
22212
22737
  viewBox: "0 0 24 24",
22213
22738
  stroke: "currentColor"
22214
- }, props), _path$6 || (_path$6 = /*#__PURE__*/React__namespace.createElement("path", {
22739
+ }, props), _path$7 || (_path$7 = /*#__PURE__*/React__namespace.createElement("path", {
22215
22740
  strokeLinecap: "round",
22216
22741
  strokeLinejoin: "round",
22217
22742
  strokeWidth: 2,
@@ -22226,10 +22751,10 @@ function SvgLocationPin(props) {
22226
22751
 
22227
22752
  var _switch;
22228
22753
 
22229
- function _extends$6() { _extends$6 = 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$6.apply(this, arguments); }
22754
+ function _extends$7() { _extends$7 = 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$7.apply(this, arguments); }
22230
22755
 
22231
22756
  function SvgSubscription(props) {
22232
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$6({
22757
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$7({
22233
22758
  xmlns: "http://www.w3.org/2000/svg",
22234
22759
  viewBox: "0 0 100 125",
22235
22760
  fill: "currentColor"
@@ -22244,18 +22769,18 @@ function SvgSubscription(props) {
22244
22769
  }))))));
22245
22770
  }
22246
22771
 
22247
- var _path$5;
22772
+ var _path$6;
22248
22773
 
22249
- function _extends$5() { _extends$5 = 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$5.apply(this, arguments); }
22774
+ function _extends$6() { _extends$6 = 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$6.apply(this, arguments); }
22250
22775
 
22251
22776
  function SvgShopping(props) {
22252
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
22777
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$6({
22253
22778
  className: "plc-w-6 plc-h-6 plc-mr-2",
22254
22779
  xmlns: "http://www.w3.org/2000/svg",
22255
22780
  fill: "none",
22256
22781
  viewBox: "0 0 24 24",
22257
22782
  stroke: "currentColor"
22258
- }, props), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
22783
+ }, props), _path$6 || (_path$6 = /*#__PURE__*/React__namespace.createElement("path", {
22259
22784
  strokeLinecap: "round",
22260
22785
  strokeLinejoin: "round",
22261
22786
  strokeWidth: 2,
@@ -22263,18 +22788,18 @@ function SvgShopping(props) {
22263
22788
  })));
22264
22789
  }
22265
22790
 
22266
- var _path$4;
22791
+ var _path$5;
22267
22792
 
22268
- function _extends$4() { _extends$4 = 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$4.apply(this, arguments); }
22793
+ function _extends$5() { _extends$5 = 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$5.apply(this, arguments); }
22269
22794
 
22270
22795
  function SvgBookmark(props) {
22271
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
22796
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
22272
22797
  className: "plc-w-6 plc-h-6 plc-mr-2",
22273
22798
  xmlns: "http://www.w3.org/2000/svg",
22274
22799
  fill: "none",
22275
22800
  viewBox: "0 0 24 24",
22276
22801
  stroke: "currentColor"
22277
- }, props), _path$4 || (_path$4 = /*#__PURE__*/React__namespace.createElement("path", {
22802
+ }, props), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
22278
22803
  strokeLinecap: "round",
22279
22804
  strokeLinejoin: "round",
22280
22805
  strokeWidth: 2,
@@ -22282,33 +22807,33 @@ function SvgBookmark(props) {
22282
22807
  })));
22283
22808
  }
22284
22809
 
22285
- var _path$3;
22810
+ var _path$4;
22286
22811
 
22287
- function _extends$3() { _extends$3 = 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$3.apply(this, arguments); }
22812
+ function _extends$4() { _extends$4 = 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$4.apply(this, arguments); }
22288
22813
 
22289
22814
  function SvgKey(props) {
22290
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
22815
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
22291
22816
  xmlns: "http://www.w3.org/2000/svg",
22292
22817
  viewBox: "0 0 20 20",
22293
22818
  fill: "currentColor"
22294
- }, props), _path$3 || (_path$3 = /*#__PURE__*/React__namespace.createElement("path", {
22819
+ }, props), _path$4 || (_path$4 = /*#__PURE__*/React__namespace.createElement("path", {
22295
22820
  fillRule: "evenodd",
22296
22821
  d: "M18 8a6 6 0 01-7.743 5.743L10 14l-1 1-1 1H6v2H2v-4l4.257-4.257A6 6 0 1118 8zm-6-4a1 1 0 100 2 2 2 0 012 2 1 1 0 102 0 4 4 0 00-4-4z",
22297
22822
  clipRule: "evenodd"
22298
22823
  })));
22299
22824
  }
22300
22825
 
22301
- var _path$2;
22826
+ var _path$3;
22302
22827
 
22303
- function _extends$2() { _extends$2 = 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$2.apply(this, arguments); }
22828
+ function _extends$3() { _extends$3 = 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$3.apply(this, arguments); }
22304
22829
 
22305
22830
  function SvgDonate(props) {
22306
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
22831
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
22307
22832
  width: 24,
22308
22833
  height: 24,
22309
22834
  fill: "currentColor",
22310
22835
  xmlns: "http://www.w3.org/2000/svg"
22311
- }, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
22836
+ }, props), _path$3 || (_path$3 = /*#__PURE__*/React__namespace.createElement("path", {
22312
22837
  d: "M4 21h9.62a3.995 3.995 0 003.037-1.397l5.102-5.952a1 1 0 00-.442-1.6l-1.968-.656a3.043 3.043 0 00-2.823.503l-3.185 2.547-.617-1.235A3.98 3.98 0 009.146 11H4c-1.103 0-2 .897-2 2v6c0 1.103.897 2 2 2zm0-8h5.146c.763 0 1.448.423 1.789 1.105l.447.895H7v2h6.014a.996.996 0 00.442-.11l.003-.001.004-.002h.003l.002-.001h.004l.001-.001c.009.003.003-.001.003-.001.01 0 .002-.001.002-.001h.001l.002-.001.003-.001.002-.001.002-.001.003-.001.002-.001c.003 0 .001-.001.002-.001l.003-.002.002-.001.002-.001.003-.001.002-.001h.001l.002-.001h.001l.002-.001.002-.001c.009-.001.003-.001.003-.001l.002-.001a.915.915 0 00.11-.078l4.146-3.317c.262-.208.623-.273.94-.167l.557.186-4.133 4.823a2.029 2.029 0 01-1.52.688H4v-6zM16 2h-.017c-.163.002-1.006.039-1.983.705-.951-.648-1.774-.7-1.968-.704L12.002 2h-.004c-.801 0-1.555.313-2.119.878C9.313 3.445 9 4.198 9 5s.313 1.555.861 2.104l3.414 3.586a1.006 1.006 0 001.45-.001l3.396-3.568C18.688 6.555 19 5.802 19 5s-.313-1.555-.878-2.121A2.978 2.978 0 0016.002 2H16zm1 3c0 .267-.104.518-.311.725L14 8.55l-2.707-2.843C11.104 5.518 11 5.267 11 5s.104-.518.294-.708A.977.977 0 0111.979 4c.025.001.502.032 1.067.485.081.065.163.139.247.222l.707.707.707-.707c.084-.083.166-.157.247-.222.529-.425.976-.478 1.052-.484a.987.987 0 01.701.292c.189.189.293.44.293.707z"
22313
22838
  })));
22314
22839
  }
@@ -22344,17 +22869,149 @@ const DonationsMenu = () => {
22344
22869
  }), subscriptions));
22345
22870
  };
22346
22871
 
22347
- function getDonationSubs() {
22348
- var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3, _window$Pelcro$user$r, _window$Pelcro$user$r2;
22872
+ function getDonationSubs() {
22873
+ var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3, _window$Pelcro$user$r, _window$Pelcro$user$r2;
22874
+
22875
+ const donations = (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : (_window$Pelcro$subscr3 = _window$Pelcro$subscr2.list()) === null || _window$Pelcro$subscr3 === void 0 ? void 0 : _window$Pelcro$subscr3.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
22876
+ const canceledDonations = (_window$Pelcro$user$r = (_window$Pelcro$user$r2 = window.Pelcro.user.read().expired_subscriptions) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : [];
22877
+ return [...donations, ...canceledDonations];
22878
+ }
22879
+
22880
+ function formatStartDate(date) {
22881
+ const startDate = new Date(date);
22882
+ return new Intl.DateTimeFormat("en-CA").format(startDate);
22883
+ }
22884
+
22885
+ const InvoicesMenu = props => {
22886
+ const {
22887
+ t
22888
+ } = useTranslation("dashboard");
22889
+ return /*#__PURE__*/React__default['default'].createElement("table", {
22890
+ className: "plc-w-full plc-table-fixed"
22891
+ }, /*#__PURE__*/React__default['default'].createElement("thead", {
22892
+ className: "plc-text-xs plc-font-semibold plc-tracking-wider plc-text-gray-400 plc-uppercase "
22893
+ }, /*#__PURE__*/React__default['default'].createElement("tr", null, /*#__PURE__*/React__default['default'].createElement("th", {
22894
+ className: "plc-w-4/12 "
22895
+ }, t("labels.details")), /*#__PURE__*/React__default['default'].createElement("th", {
22896
+ className: "plc-w-4/12 "
22897
+ }, t("labels.status.title")), /*#__PURE__*/React__default['default'].createElement("th", {
22898
+ className: "plc-w-3/12 "
22899
+ }, t("labels.actions")))), /*#__PURE__*/React__default['default'].createElement("tbody", null, /*#__PURE__*/React__default['default'].createElement("tr", {
22900
+ className: "plc-h-4"
22901
+ }), /*#__PURE__*/React__default['default'].createElement(InvoicesItems, props)));
22902
+ };
22903
+
22904
+ const InvoicesItems = () => {
22905
+ var _window$Pelcro$invoic, _window$Pelcro$invoic2;
22906
+
22907
+ const {
22908
+ t
22909
+ } = useTranslation("dashboard");
22910
+ const {
22911
+ setInvoice,
22912
+ switchView
22913
+ } = usePelcro();
22914
+ const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
22915
+
22916
+ const showInvoiceDetails = event => {
22917
+ if (setInvoice(event.target.dataset.id)) {
22918
+ switchView("invoice-details");
22919
+ }
22920
+ };
22921
+
22922
+ if (invoices.length === 0) return null;
22923
+ return invoices.sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime()).map(invoice => {
22924
+ const invoiceStatus = getInvoiceStatus(invoice);
22925
+ const formattedCreationDate = new Intl.DateTimeFormat("en-CA").format(new Date(invoice.created_at));
22926
+ return /*#__PURE__*/React__default['default'].createElement("tr", {
22927
+ key: invoice.id,
22928
+ className: `plc-w-full plc-align-middle plc-cursor-pointer accordion-header hover:plc-bg-gray-50`
22929
+ }, /*#__PURE__*/React__default['default'].createElement("td", {
22930
+ className: "plc-truncate"
22931
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
22932
+ className: "plc-font-semibold plc-text-gray-500"
22933
+ }, `#${invoice.id}`), /*#__PURE__*/React__default['default'].createElement("br", null), /*#__PURE__*/React__default['default'].createElement("span", {
22934
+ className: "plc-text-sm plc-text-gray-500"
22935
+ }, getFormattedPriceByLocal(invoice.total, invoice.currency, getPageOrDefaultLanguage())), /*#__PURE__*/React__default['default'].createElement("br", null), /*#__PURE__*/React__default['default'].createElement("span", {
22936
+ className: "plc-text-sm plc-text-gray-500"
22937
+ }, formattedCreationDate)), /*#__PURE__*/React__default['default'].createElement("td", {
22938
+ className: "plc-py-2"
22939
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
22940
+ className: `plc-inline-flex plc-p-1 plc-text-xs plc-font-semibold ${invoiceStatus.bgColor} plc-uppercase ${invoiceStatus.textColor} plc-rounded-lg`
22941
+ }, invoiceStatus.icon, invoiceStatus.title)), /*#__PURE__*/React__default['default'].createElement("td", null, /*#__PURE__*/React__default['default'].createElement(Button, {
22942
+ variant: "ghost",
22943
+ className: "plc-text-blue-400 focus:plc-ring-blue-400 pelcro-dashboard-view-invoice-button",
22944
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgDocument, {
22945
+ className: "plc-w-4 plc-h-4"
22946
+ }),
22947
+ onClick: showInvoiceDetails,
22948
+ "data-id": invoice.id
22949
+ }, t("labels.view"))));
22950
+ });
22951
+ };
22952
+
22953
+ function getInvoiceStatus(invoice) {
22954
+ const translations = i18next.t("dashboard:labels", {
22955
+ returnObjects: true
22956
+ });
22957
+
22958
+ switch (invoice.status) {
22959
+ case "paid":
22960
+ return {
22961
+ textColor: "plc-text-green-700",
22962
+ bgColor: "plc-bg-green-100",
22963
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgCheckMark, null),
22964
+ title: translations.paid
22965
+ };
22966
+
22967
+ case "past_due":
22968
+ return {
22969
+ textColor: "plc-text-orange-700",
22970
+ bgColor: "plc-bg-orange-100",
22971
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgExclamation, null),
22972
+ title: translations.pastDue
22973
+ };
22349
22974
 
22350
- const donations = (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : (_window$Pelcro$subscr3 = _window$Pelcro$subscr2.list()) === null || _window$Pelcro$subscr3 === void 0 ? void 0 : _window$Pelcro$subscr3.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
22351
- const canceledDonations = (_window$Pelcro$user$r = (_window$Pelcro$user$r2 = window.Pelcro.user.read().expired_subscriptions) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : [];
22352
- return [...donations, ...canceledDonations];
22353
- }
22975
+ case "open":
22976
+ return {
22977
+ textColor: "plc-text-yellow-700",
22978
+ bgColor: "plc-bg-yellow-100",
22979
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgExclamation, null),
22980
+ title: translations.open
22981
+ };
22354
22982
 
22355
- function formatStartDate(date) {
22356
- const startDate = new Date(date);
22357
- return new Intl.DateTimeFormat("en-CA").format(startDate);
22983
+ case "draft":
22984
+ return {
22985
+ textColor: "plc-text-blue-700",
22986
+ bgColor: "plc-bg-blue-100",
22987
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgEdit, null),
22988
+ title: translations.draft
22989
+ };
22990
+
22991
+ case "scheduled":
22992
+ return {
22993
+ textColor: "plc-text-blue-700",
22994
+ bgColor: "plc-bg-blue-100",
22995
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgCalendar, null),
22996
+ title: translations.scheduled
22997
+ };
22998
+
22999
+ case "uncollectible":
23000
+ return {
23001
+ textColor: "plc-text-red-700",
23002
+ bgColor: "plc-bg-red-100",
23003
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgXIconSolid, null),
23004
+ title: translations.uncollectible
23005
+ };
23006
+
23007
+ case "void":
23008
+ return {
23009
+ textColor: "plc-text-gray-700",
23010
+ bgColor: "plc-bg-gray-100",
23011
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgXIconSolid, null),
23012
+ title: translations.void
23013
+ };
23014
+ }
22358
23015
  }
22359
23016
 
22360
23017
  const SUB_MENUS = {
@@ -22503,9 +23160,10 @@ class Dashboard extends React.Component {
22503
23160
  }) => {
22504
23161
  if (isGift) {
22505
23162
  this.props.setProductAndPlan(null, null, true);
23163
+ return this.props.setView("plan-select");
22506
23164
  }
22507
23165
 
22508
- return this.props.setView("plan-select");
23166
+ return this.props.setView("subscription-options");
22509
23167
  });
22510
23168
 
22511
23169
  _defineProperty$3(this, "displayAddressCreate", () => {
@@ -22910,6 +23568,12 @@ class Dashboard extends React.Component {
22910
23568
  icon: /*#__PURE__*/React__default['default'].createElement(SvgShopping, null),
22911
23569
  title: this.locale("labels.orders.label"),
22912
23570
  content: /*#__PURE__*/React__default['default'].createElement(OrdersMenu, null)
23571
+ }), /*#__PURE__*/React__default['default'].createElement(Accordion.item, {
23572
+ show: hasInvoices(),
23573
+ name: SUB_MENUS.INVOICES,
23574
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgDocument, null),
23575
+ title: this.locale("labels.invoices"),
23576
+ content: /*#__PURE__*/React__default['default'].createElement(InvoicesMenu, null)
22913
23577
  }), /*#__PURE__*/React__default['default'].createElement(Accordion.item, {
22914
23578
  name: SUB_MENUS.SAVED_ITEMS,
22915
23579
  icon: /*#__PURE__*/React__default['default'].createElement(SvgBookmark, null),
@@ -22925,6 +23589,13 @@ class Dashboard extends React.Component {
22925
23589
 
22926
23590
  }
22927
23591
 
23592
+ function hasInvoices() {
23593
+ var _window$Pelcro$invoic, _window$Pelcro$invoic2;
23594
+
23595
+ const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
23596
+ return invoices.length > 0;
23597
+ }
23598
+
22928
23599
  function hasDonationSubs() {
22929
23600
  var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
22930
23601
 
@@ -22960,7 +23631,7 @@ const DashboardOpenButton = () => {
22960
23631
  };
22961
23632
  DashboardOpenButton.viewId = "dashboard-open";
22962
23633
 
22963
- const initialState$2 = {
23634
+ const initialState$3 = {
22964
23635
  imageSrc: null,
22965
23636
  crop: {
22966
23637
  x: 0,
@@ -22974,10 +23645,10 @@ const initialState$2 = {
22974
23645
  content: ""
22975
23646
  }
22976
23647
  };
22977
- const store$2 = /*#__PURE__*/React.createContext(initialState$2);
23648
+ const store$3 = /*#__PURE__*/React.createContext(initialState$3);
22978
23649
  const {
22979
- Provider: Provider$2
22980
- } = store$2;
23650
+ Provider: Provider$3
23651
+ } = store$3;
22981
23652
 
22982
23653
  const ProfilePicChangeContainer = ({
22983
23654
  style,
@@ -23111,21 +23782,21 @@ const ProfilePicChangeContainer = ({
23111
23782
  default:
23112
23783
  return state;
23113
23784
  }
23114
- }, initialState$2);
23785
+ }, initialState$3);
23115
23786
  return /*#__PURE__*/React__default['default'].createElement("div", {
23116
23787
  style: { ...style
23117
23788
  },
23118
23789
  className: `pelcro-container pelcro-profile-picture-container ${className}`
23119
- }, /*#__PURE__*/React__default['default'].createElement(Provider$2, {
23790
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$3, {
23120
23791
  value: {
23121
23792
  state,
23122
23793
  dispatch
23123
23794
  }
23124
23795
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
23125
- store: store$2,
23796
+ store: store$3,
23126
23797
  key: i
23127
23798
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
23128
- store: store$2
23799
+ store: store$3
23129
23800
  })));
23130
23801
  };
23131
23802
  /**
@@ -23187,7 +23858,7 @@ const ProfilePicChangeButton = ({
23187
23858
  isSubmitting
23188
23859
  },
23189
23860
  dispatch
23190
- } = React.useContext(store$2);
23861
+ } = React.useContext(store$3);
23191
23862
  const {
23192
23863
  t
23193
23864
  } = useTranslation("userEdit");
@@ -24555,7 +25226,7 @@ const ProfilePicChangeCropper = ({
24555
25226
  zoom
24556
25227
  },
24557
25228
  dispatch
24558
- } = React.useContext(store$2);
25229
+ } = React.useContext(store$3);
24559
25230
  return /*#__PURE__*/React__default['default'].createElement("div", {
24560
25231
  className: `plc-relative plc-w-full plc-h-52 sm:plc-h-96 ${className}`
24561
25232
  }, /*#__PURE__*/React__default['default'].createElement(Cropper, Object.assign({
@@ -24597,7 +25268,7 @@ const ProfilePicChangeZoom = ({
24597
25268
  zoom
24598
25269
  },
24599
25270
  dispatch
24600
- } = React.useContext(store$2);
25271
+ } = React.useContext(store$3);
24601
25272
  const {
24602
25273
  t
24603
25274
  } = useTranslation("userEdit");
@@ -24620,18 +25291,18 @@ const ProfilePicChangeZoom = ({
24620
25291
  }, otherProps)));
24621
25292
  };
24622
25293
 
24623
- var _path$1;
25294
+ var _path$2;
24624
25295
 
24625
- function _extends$1() { _extends$1 = 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$1.apply(this, arguments); }
25296
+ function _extends$2() { _extends$2 = 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$2.apply(this, arguments); }
24626
25297
 
24627
25298
  function SvgPhotograph(props) {
24628
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
25299
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
24629
25300
  xmlns: "http://www.w3.org/2000/svg",
24630
25301
  className: "plc-h-6 plc-w-6",
24631
25302
  fill: "none",
24632
25303
  viewBox: "0 0 24 24",
24633
25304
  stroke: "currentColor"
24634
- }, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
25305
+ }, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
24635
25306
  strokeLinecap: "round",
24636
25307
  strokeLinejoin: "round",
24637
25308
  strokeWidth: 2,
@@ -24649,7 +25320,7 @@ const ProfilePicChangeSelectButton = ({
24649
25320
  state: {
24650
25321
  isSubmitting
24651
25322
  }
24652
- } = React.useContext(store$2);
25323
+ } = React.useContext(store$3);
24653
25324
  const {
24654
25325
  t
24655
25326
  } = useTranslation("userEdit");
@@ -24691,7 +25362,7 @@ const ProfilePicChangeRemoveButton = ({
24691
25362
  state: {
24692
25363
  isSubmitting
24693
25364
  }
24694
- } = React.useContext(store$2);
25365
+ } = React.useContext(store$3);
24695
25366
  const {
24696
25367
  t
24697
25368
  } = useTranslation("userEdit");
@@ -24714,7 +25385,7 @@ const ProfilePicChangeWrapper = () => {
24714
25385
  state: {
24715
25386
  imageSrc
24716
25387
  }
24717
- } = React.useContext(store$2);
25388
+ } = React.useContext(store$3);
24718
25389
  const {
24719
25390
  t
24720
25391
  } = useTranslation("userEdit");
@@ -24776,17 +25447,17 @@ function ProfilePicChangeModal({
24776
25447
  }
24777
25448
  ProfilePicChangeModal.viewId = "profile-picture";
24778
25449
 
24779
- const initialState$1 = {
25450
+ const initialState$2 = {
24780
25451
  isSubmitting: false,
24781
25452
  alert: {
24782
25453
  type: "error",
24783
25454
  content: ""
24784
25455
  }
24785
25456
  };
24786
- const store$1 = /*#__PURE__*/React.createContext(initialState$1);
25457
+ const store$2 = /*#__PURE__*/React.createContext(initialState$2);
24787
25458
  const {
24788
- Provider: Provider$1
24789
- } = store$1;
25459
+ Provider: Provider$2
25460
+ } = store$2;
24790
25461
 
24791
25462
  const EmailVerifyContainer = ({
24792
25463
  style,
@@ -24849,21 +25520,21 @@ const EmailVerifyContainer = ({
24849
25520
  default:
24850
25521
  return state;
24851
25522
  }
24852
- }, initialState$1);
25523
+ }, initialState$2);
24853
25524
  return /*#__PURE__*/React__default['default'].createElement("div", {
24854
25525
  style: { ...style
24855
25526
  },
24856
25527
  className: `pelcro-container pelcro-email-verify-container ${className}`
24857
- }, /*#__PURE__*/React__default['default'].createElement(Provider$1, {
25528
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$2, {
24858
25529
  value: {
24859
25530
  state,
24860
25531
  dispatch
24861
25532
  }
24862
25533
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
24863
- store: store$1,
25534
+ store: store$2,
24864
25535
  key: i
24865
25536
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
24866
- store: store$1
25537
+ store: store$2
24867
25538
  })));
24868
25539
  };
24869
25540
 
@@ -24877,7 +25548,7 @@ const EmailVerifyResendButton = ({
24877
25548
  state: {
24878
25549
  isSubmitting
24879
25550
  }
24880
- } = React.useContext(store$1);
25551
+ } = React.useContext(store$2);
24881
25552
  const {
24882
25553
  t
24883
25554
  } = useTranslation("verifyEmail");
@@ -24892,16 +25563,16 @@ const EmailVerifyResendButton = ({
24892
25563
  }, otherProps), name !== null && name !== void 0 ? name : t("labels.resend"));
24893
25564
  };
24894
25565
 
24895
- var _path, _path2;
25566
+ var _path$1, _path2;
24896
25567
 
24897
- function _extends() { _extends = 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.apply(this, arguments); }
25568
+ function _extends$1() { _extends$1 = 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$1.apply(this, arguments); }
24898
25569
 
24899
25570
  function SvgEmailVerify(props) {
24900
- return /*#__PURE__*/React__namespace.createElement("svg", _extends({
25571
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
24901
25572
  className: "plc-w-6 plc-h-6",
24902
25573
  viewBox: "0 0 700 700",
24903
25574
  xmlns: "http://www.w3.org/2000/svg"
24904
- }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
25575
+ }, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
24905
25576
  d: "M583.01 231.93a15.008 15.008 0 00-.887-3.875c-.562-1.254-1.129-2.508-1.695-3.762a14.686 14.686 0 00-1.898-1.789c-.438-.437-.653-1.027-1.153-1.414l-56.266-44.164v-52.484a15.555 15.555 0 00-15.554-15.555H434.56l-74.945-58.895a15.547 15.547 0 00-19.227 0l-74.945 58.895h-70.996a15.555 15.555 0 00-15.555 15.555v52.484l-56.266 44.16c-.496.39-.715.996-1.152 1.43v.004a13.37 13.37 0 00-1.898 1.773c-.22.426-.414.86-.59 1.305a14.158 14.158 0 00-1.106 2.457 15.009 15.009 0 00-.886 3.875c0 .48-.329.918-.329 1.398l.004 264.45a15.555 15.555 0 0015.555 15.555h435.55a15.555 15.555 0 0015.555-15.555v-264.45c0-.48-.278-.918-.325-1.398zm-41.176.809l-20.723 14.809v-31.11zm-191.83-150.73l34.223 26.883h-68.445zm-140 57.992h280v124.45c.07 1.593.383 3.168.934 4.664l-140.93 100.66-140.46-100.33c.214-.77.37-1.555.464-2.348zm-31.109 107.55l-20.719-14.81 20.719-16.27zm-31.113 234.67V263.56l193.18 137.99a15.562 15.562 0 0018.078 0l193.18-137.99v218.66z"
24906
25577
  })), _path2 || (_path2 = /*#__PURE__*/React__namespace.createElement("path", {
24907
25578
  d: "M324.33 291.81a15.56 15.56 0 0020.582-.297l85.555-77.777a15.56 15.56 0 00-20.938-23.023l-75.398 68.539-44.023-37.723a15.54 15.54 0 00-11.46-4.106 15.553 15.553 0 00-8.758 27.718z"
@@ -25005,11 +25676,11 @@ const invoicePaymentSubmitButton = props => {
25005
25676
  return /*#__PURE__*/React__default['default'].createElement(SubmitPaymentMethod, props);
25006
25677
  };
25007
25678
 
25008
- const initialState = {};
25009
- const store = /*#__PURE__*/React.createContext(initialState);
25679
+ const initialState$1 = {};
25680
+ const store$1 = /*#__PURE__*/React.createContext(initialState$1);
25010
25681
  const {
25011
- Provider
25012
- } = store;
25682
+ Provider: Provider$1
25683
+ } = store$1;
25013
25684
 
25014
25685
  const InvoiceDetailsContainer = ({
25015
25686
  style,
@@ -25030,21 +25701,21 @@ const InvoiceDetailsContainer = ({
25030
25701
  default:
25031
25702
  return state;
25032
25703
  }
25033
- }, initialState);
25704
+ }, initialState$1);
25034
25705
  return /*#__PURE__*/React__default['default'].createElement("div", {
25035
25706
  style: { ...style
25036
25707
  },
25037
25708
  className: `pelcro-container pelcro-invoice-details-container ${className}`
25038
- }, /*#__PURE__*/React__default['default'].createElement(Provider, {
25709
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$1, {
25039
25710
  value: {
25040
25711
  state,
25041
25712
  dispatch
25042
25713
  }
25043
25714
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
25044
- store,
25715
+ store: store$1,
25045
25716
  key: i
25046
25717
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
25047
- store
25718
+ store: store$1
25048
25719
  })));
25049
25720
  };
25050
25721
 
@@ -25076,7 +25747,7 @@ const InvoiceDetailsPayButton = ({
25076
25747
  }) => {
25077
25748
  const {
25078
25749
  dispatch
25079
- } = React.useContext(store);
25750
+ } = React.useContext(store$1);
25080
25751
  const {
25081
25752
  t
25082
25753
  } = useTranslation("invoiceDetails");
@@ -25098,6 +25769,8 @@ const InvoiceDetailsView = props => {
25098
25769
  invoice
25099
25770
  } = usePelcro();
25100
25771
  const showPayButton = canPayInvoice(invoice);
25772
+ const showDownloadButton = Boolean(invoice === null || invoice === void 0 ? void 0 : invoice.invoice_pdf);
25773
+ const hasPlanDetails = Boolean(invoice.plan);
25101
25774
  const creationDate = new Date(invoice === null || invoice === void 0 ? void 0 : invoice.created_at);
25102
25775
  const formattedCreationDate = new Intl.DateTimeFormat("en-CA").format(creationDate);
25103
25776
  return /*#__PURE__*/React__default['default'].createElement("div", {
@@ -25115,7 +25788,7 @@ const InvoiceDetailsView = props => {
25115
25788
  className: "plc-font-bold pelcro-invoice-summary-title"
25116
25789
  }, t("labels.summary")), invoice && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("p", {
25117
25790
  className: "plc-mr-2 pelcro-invoice-creation-date"
25118
- }, `${t("labels.creationDate")} ${formattedCreationDate}`), /*#__PURE__*/React__default['default'].createElement("div", {
25791
+ }, `${t("labels.creationDate")} ${formattedCreationDate}`), hasPlanDetails && /*#__PURE__*/React__default['default'].createElement("div", {
25119
25792
  className: "plc-flex plc-items-center plc-pt-2 plc-mt-2 plc-border-t plc-border-gray-400 plc-min-h-12 plc-justify-between pelcro-invoice-plan-wrapper"
25120
25793
  }, /*#__PURE__*/React__default['default'].createElement("div", {
25121
25794
  className: "plc-break-words pelcro-invoice-plan-name"
@@ -25141,7 +25814,7 @@ const InvoiceDetailsView = props => {
25141
25814
  className: "plc-font-semibold pelcro-invoice-total"
25142
25815
  }, getFormattedPriceByLocal(invoice.amount_remaining, invoice.currency, getPageOrDefaultLanguage())))))), /*#__PURE__*/React__default['default'].createElement("div", {
25143
25816
  className: "plc-flex plc-items-center plc-justify-center plc-mt-4"
25144
- }, /*#__PURE__*/React__default['default'].createElement(InvoiceDetailsDownloadButton, {
25817
+ }, showDownloadButton && /*#__PURE__*/React__default['default'].createElement(InvoiceDetailsDownloadButton, {
25145
25818
  url: invoice === null || invoice === void 0 ? void 0 : invoice.invoice_pdf,
25146
25819
  className: "plc-w-full plc-text-center"
25147
25820
  }), showPayButton && /*#__PURE__*/React__default['default'].createElement(InvoiceDetailsPayButton, {
@@ -25181,6 +25854,232 @@ const InvoiceDetailsModal = ({
25181
25854
  };
25182
25855
  InvoiceDetailsModal.viewId = "invoice-details";
25183
25856
 
25857
+ const initialState = {
25858
+ selectedOption: ""
25859
+ };
25860
+ const store = /*#__PURE__*/React.createContext(initialState);
25861
+ const {
25862
+ Provider
25863
+ } = store;
25864
+
25865
+ const SubscriptionOptionsContainer = ({
25866
+ style,
25867
+ className = "",
25868
+ onRenewSubSuccess = () => {},
25869
+ onNewSubSuccess = () => {},
25870
+ children,
25871
+ ...props
25872
+ }) => {
25873
+ const submit = ({
25874
+ selectedOption
25875
+ }, dispatch) => {
25876
+ if (selectedOption === "renew") return onRenewSubSuccess();
25877
+ if (selectedOption === "new") return onNewSubSuccess();
25878
+ };
25879
+
25880
+ const [state, dispatch] = useReducerWithSideEffects((state, action) => {
25881
+ switch (action.type) {
25882
+ case SWITCH_TO_NEW:
25883
+ return lib_7({ ...state,
25884
+ selectedOption: "new"
25885
+ });
25886
+
25887
+ case SWITCH_TO_RENEW:
25888
+ return lib_7({ ...state,
25889
+ selectedOption: "renew"
25890
+ });
25891
+
25892
+ case HANDLE_SUBMIT:
25893
+ return lib_4((state, dispatch) => submit(state));
25894
+
25895
+ default:
25896
+ return state;
25897
+ }
25898
+ }, initialState);
25899
+ return /*#__PURE__*/React__default['default'].createElement("div", {
25900
+ style: { ...style
25901
+ },
25902
+ className: `pelcro-container pelcro-subscription-options-container ${className}`
25903
+ }, /*#__PURE__*/React__default['default'].createElement(Provider, {
25904
+ value: {
25905
+ state,
25906
+ dispatch
25907
+ }
25908
+ }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
25909
+ store,
25910
+ key: i
25911
+ })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
25912
+ store
25913
+ })));
25914
+ };
25915
+
25916
+ var _path;
25917
+
25918
+ function _extends() { _extends = 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.apply(this, arguments); }
25919
+
25920
+ function SvgPlusCircle(props) {
25921
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends({
25922
+ xmlns: "http://www.w3.org/2000/svg",
25923
+ className: "plc-h-6 plc-w-6",
25924
+ fill: "none",
25925
+ viewBox: "0 0 24 24",
25926
+ stroke: "currentColor",
25927
+ strokeWidth: 2
25928
+ }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
25929
+ strokeLinecap: "round",
25930
+ strokeLinejoin: "round",
25931
+ d: "M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"
25932
+ })));
25933
+ }
25934
+
25935
+ const SubscriptionOptionsNewButton = ({
25936
+ name,
25937
+ onClick,
25938
+ ...otherProps
25939
+ }) => {
25940
+ const {
25941
+ dispatch,
25942
+ state: {
25943
+ selectedOption
25944
+ }
25945
+ } = React.useContext(store);
25946
+ const {
25947
+ t
25948
+ } = useTranslation("subscriptionOptions");
25949
+ const isChecked = selectedOption === "new";
25950
+ return /*#__PURE__*/React__default['default'].createElement(Radio, Object.assign({
25951
+ className: "plc-hidden pelcro-new-sub-option",
25952
+ labelClassName: `plc-flex plc-flex-col plc-items-center plc-justify-center plc-text-lg plc-font-semibold plc-ml-0 plc-w-52 plc-h-52 plc-text-black plc-p-2 hover:plc-bg-gray-200 pelcro-new-sub-option-label plc-border-2 plc-text-center ${isChecked ? "plc-border-black" : "plc-border-gray-300"}`,
25953
+ id: "pelcro-new-sub-option",
25954
+ name: "option",
25955
+ onChange: () => {
25956
+ dispatch({
25957
+ type: SWITCH_TO_NEW
25958
+ });
25959
+ onClick === null || onClick === void 0 ? void 0 : onClick();
25960
+ },
25961
+ checked: isChecked
25962
+ }, otherProps), name !== null && name !== void 0 ? name : t("addNew"), /*#__PURE__*/React__default['default'].createElement(SvgPlusCircle, {
25963
+ className: "plc-w-full plc-h-full plc-mr-0"
25964
+ }));
25965
+ };
25966
+
25967
+ const SubscriptionOptionsRenewButton = ({
25968
+ name,
25969
+ onClick,
25970
+ ...otherProps
25971
+ }) => {
25972
+ const {
25973
+ dispatch,
25974
+ state: {
25975
+ selectedOption
25976
+ }
25977
+ } = React.useContext(store);
25978
+ const {
25979
+ t
25980
+ } = useTranslation("subscriptionOptions");
25981
+ const isChecked = selectedOption === "renew";
25982
+ return /*#__PURE__*/React__default['default'].createElement(Radio, Object.assign({
25983
+ className: "plc-hidden pelcro-renew-sub-option",
25984
+ labelClassName: `plc-flex plc-flex-col plc-items-center plc-justify-center plc-text-lg plc-font-semibold plc-ml-0 plc-w-52 plc-h-52 plc-text-black plc-p-2 hover:plc-bg-gray-200 pelcro-renew-sub-option-label plc-border-2 plc-text-center ${isChecked ? "plc-border-black" : "plc-border-gray-300"}`,
25985
+ id: "pelcro-renew-sub-option",
25986
+ name: "option",
25987
+ onChange: () => {
25988
+ dispatch({
25989
+ type: SWITCH_TO_RENEW
25990
+ });
25991
+ onClick === null || onClick === void 0 ? void 0 : onClick();
25992
+ },
25993
+ checked: isChecked
25994
+ }, otherProps), name !== null && name !== void 0 ? name : t("renew"), /*#__PURE__*/React__default['default'].createElement(SvgRefresh, {
25995
+ className: "plc-w-full plc-h-full plc-mr-0"
25996
+ }));
25997
+ };
25998
+
25999
+ const SubscriptionOptionsSubmit = ({
26000
+ name,
26001
+ onClick,
26002
+ ...otherProps
26003
+ }) => {
26004
+ const {
26005
+ dispatch,
26006
+ state: {
26007
+ selectedOption
26008
+ }
26009
+ } = React.useContext(store);
26010
+ const {
26011
+ t
26012
+ } = useTranslation("subscriptionOptions");
26013
+ return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
26014
+ onClick: () => {
26015
+ dispatch({
26016
+ type: HANDLE_SUBMIT
26017
+ });
26018
+ onClick === null || onClick === void 0 ? void 0 : onClick();
26019
+ },
26020
+ disabled: !selectedOption
26021
+ }, otherProps), name !== null && name !== void 0 ? name : t("next"));
26022
+ };
26023
+
26024
+ const SubscriptionOptionsView = props => {
26025
+ const {
26026
+ t
26027
+ } = useTranslation("subscriptionOptions");
26028
+ return /*#__PURE__*/React__default['default'].createElement("div", {
26029
+ id: "pelcro-subscription-options-view"
26030
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
26031
+ className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
26032
+ }, /*#__PURE__*/React__default['default'].createElement("h4", {
26033
+ className: "plc-text-2xl plc-font-semibold"
26034
+ }, t("title")), /*#__PURE__*/React__default['default'].createElement("p", null, t("subtitle"))), /*#__PURE__*/React__default['default'].createElement("form", {
26035
+ action: "javascript:void(0);",
26036
+ className: "plc-mt-2 pelcro-form"
26037
+ }, /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsContainer, props, /*#__PURE__*/React__default['default'].createElement("div", {
26038
+ className: "plc-flex plc-justify-between plc-items-center"
26039
+ }, /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsRenewButton, null), /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsNewButton, null)), /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsSubmit, {
26040
+ role: "submit",
26041
+ className: "plc-mt-4 plc-w-full",
26042
+ name: t("next"),
26043
+ id: "pelcro-submit"
26044
+ }))));
26045
+ };
26046
+
26047
+ const SubscriptionOptionsModal = ({
26048
+ onDisplay,
26049
+ onClose,
26050
+ ...otherProps
26051
+ }) => {
26052
+ const {
26053
+ switchView,
26054
+ setProductsList
26055
+ } = usePelcro();
26056
+
26057
+ const onRenewSubSuccess = () => {
26058
+ var _otherProps$onRenewSu;
26059
+
26060
+ (_otherProps$onRenewSu = otherProps.onRenewSubSuccess) === null || _otherProps$onRenewSu === void 0 ? void 0 : _otherProps$onRenewSu.call(otherProps);
26061
+ setProductsList(getRenewableProducts());
26062
+ switchView("_plan-select-renew");
26063
+ };
26064
+
26065
+ const onNewSubSuccess = () => {
26066
+ var _otherProps$onNewSubS;
26067
+
26068
+ (_otherProps$onNewSubS = otherProps.onNewSubSuccess) === null || _otherProps$onNewSubS === void 0 ? void 0 : _otherProps$onNewSubS.call(otherProps);
26069
+ switchView("plan-select");
26070
+ };
26071
+
26072
+ return /*#__PURE__*/React__default['default'].createElement(Modal, {
26073
+ onDisplay: onDisplay,
26074
+ onClose: onClose,
26075
+ id: "pelcro-subscription-options-modal"
26076
+ }, /*#__PURE__*/React__default['default'].createElement(ModalBody, null, /*#__PURE__*/React__default['default'].createElement(SubscriptionOptionsView, Object.assign({}, otherProps, {
26077
+ onNewSubSuccess: onNewSubSuccess,
26078
+ onRenewSubSuccess: onRenewSubSuccess
26079
+ }))), /*#__PURE__*/React__default['default'].createElement(ModalFooter, null, /*#__PURE__*/React__default['default'].createElement(Authorship, null)));
26080
+ };
26081
+ SubscriptionOptionsModal.viewId = "subscription-options";
26082
+
25184
26083
  exports.AddressCreateCity = AddressCreateCity;
25185
26084
  exports.AddressCreateContainer = AddressCreateContainer;
25186
26085
  exports.AddressCreateCountrySelect = AddressCreateCountrySelect;
@@ -25358,6 +26257,12 @@ exports.SubmitPaymentMethod = SubmitPaymentMethod;
25358
26257
  exports.SubscriptionCreateContainer = SubscriptionCreateContainer;
25359
26258
  exports.SubscriptionCreateModal = SubscriptionCreateModal;
25360
26259
  exports.SubscriptionCreateView = SubscriptionCreateView;
26260
+ exports.SubscriptionOptionsContainer = SubscriptionOptionsContainer;
26261
+ exports.SubscriptionOptionsModal = SubscriptionOptionsModal;
26262
+ exports.SubscriptionOptionsNewButton = SubscriptionOptionsNewButton;
26263
+ exports.SubscriptionOptionsRenewButton = SubscriptionOptionsRenewButton;
26264
+ exports.SubscriptionOptionsSubmit = SubscriptionOptionsSubmit;
26265
+ exports.SubscriptionOptionsView = SubscriptionOptionsView;
25361
26266
  exports.SubscriptionRenewContainer = SubscriptionRenewContainer;
25362
26267
  exports.SubscriptionRenewModal = SubscriptionRenewModal;
25363
26268
  exports.SubscriptionRenewView = SubscriptionRenewView;