@pelcro/react-pelcro-js 3.1.0 → 3.2.0-beta.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -3431,9 +3431,9 @@ var paymentMethod_fr = {
3431
3431
  select: select
3432
3432
  };
3433
3433
 
3434
- var title$f = "Enter your email to subscribe to our newsletter";
3434
+ var title$h = "Enter your email to subscribe to our newsletter";
3435
3435
  var updateTitle$1 = "Update newsletter selections";
3436
- var subtitle$7 = "We may use your email for other marketing communication";
3436
+ var subtitle$9 = "We may use your email for other marketing communication";
3437
3437
  var labels$p = {
3438
3438
  submit: "Submit",
3439
3439
  firstName: "First name",
@@ -3450,16 +3450,16 @@ var messages$r = {
3450
3450
  here: "here"
3451
3451
  };
3452
3452
  var newsletter_en = {
3453
- title: title$f,
3453
+ title: title$h,
3454
3454
  updateTitle: updateTitle$1,
3455
- subtitle: subtitle$7,
3455
+ subtitle: subtitle$9,
3456
3456
  labels: labels$p,
3457
3457
  messages: messages$r
3458
3458
  };
3459
3459
 
3460
- var title$e = "Entrez votre adresse courriel pour vous abonner à notre infolettre";
3460
+ var title$g = "Entrez votre adresse courriel pour vous abonner à notre infolettre";
3461
3461
  var updateTitle = "Mettre à jour son choix d'infolettres";
3462
- var subtitle$6 = "Nous pouvons utiliser votre adresse courriel pour d’autres communications marketing";
3462
+ var subtitle$8 = "Nous pouvons utiliser votre adresse courriel pour d’autres communications marketing";
3463
3463
  var labels$o = {
3464
3464
  submit: "Lire l’article !",
3465
3465
  firstName: "Prénom",
@@ -3476,9 +3476,9 @@ var messages$q = {
3476
3476
  here: "ici"
3477
3477
  };
3478
3478
  var newsletter_fr = {
3479
- title: title$e,
3479
+ title: title$g,
3480
3480
  updateTitle: updateTitle,
3481
- subtitle: subtitle$6,
3481
+ subtitle: subtitle$8,
3482
3482
  labels: labels$o,
3483
3483
  messages: messages$q
3484
3484
  };
@@ -3735,8 +3735,8 @@ var login_fr = {
3735
3735
  errors: errors$4
3736
3736
  };
3737
3737
 
3738
- var title$d = "Create an account";
3739
- var subtitle$5 = "Enter your email and password below";
3738
+ var title$f = "Create an account";
3739
+ var subtitle$7 = "Enter your email and password below";
3740
3740
  var labels$h = {
3741
3741
  signUpFacebook: "Sign up with Facebook",
3742
3742
  signUpGoogle: "Sign up with Google",
@@ -3821,8 +3821,8 @@ var redeem$1 = {
3821
3821
  }
3822
3822
  };
3823
3823
  var register_en = {
3824
- title: title$d,
3825
- subtitle: subtitle$5,
3824
+ title: title$f,
3825
+ subtitle: subtitle$7,
3826
3826
  labels: labels$h,
3827
3827
  messages: messages$h,
3828
3828
  errors: errors$3,
@@ -3830,8 +3830,8 @@ var register_en = {
3830
3830
  redeem: redeem$1
3831
3831
  };
3832
3832
 
3833
- var title$c = "Créer un compte";
3834
- var subtitle$4 = "Entrez votre courriel et votre mot de passe ci-dessous";
3833
+ var title$e = "Créer un compte";
3834
+ var subtitle$6 = "Entrez votre courriel et votre mot de passe ci-dessous";
3835
3835
  var labels$g = {
3836
3836
  signUpFacebook: "Inscrivez-vous avec Facebook",
3837
3837
  signUpGoogle: "Inscrivez-vous avec Google",
@@ -3917,8 +3917,8 @@ var redeem = {
3917
3917
  }
3918
3918
  };
3919
3919
  var register_fr = {
3920
- title: title$c,
3921
- subtitle: subtitle$4,
3920
+ title: title$e,
3921
+ subtitle: subtitle$6,
3922
3922
  labels: labels$g,
3923
3923
  messages: messages$g,
3924
3924
  errors: errors$2,
@@ -3978,7 +3978,7 @@ var userEdit_fr = {
3978
3978
  messages: messages$e
3979
3979
  };
3980
3980
 
3981
- var title$b = "Enter your shipping address";
3981
+ var title$d = "Enter your shipping address";
3982
3982
  var selectAddressTitle$1 = "Please select an address";
3983
3983
  var selectAddressSubtitle$1 = "Select one of your saved addresses, or add a new one";
3984
3984
  var labels$d = {
@@ -4001,7 +4001,7 @@ var messages$d = {
4001
4001
  subRedeemed: "Your subscription has been redeemed."
4002
4002
  };
4003
4003
  var address_en = {
4004
- title: title$b,
4004
+ title: title$d,
4005
4005
  selectAddressTitle: selectAddressTitle$1,
4006
4006
  selectAddressSubtitle: selectAddressSubtitle$1,
4007
4007
  labels: labels$d,
@@ -4009,7 +4009,7 @@ var address_en = {
4009
4009
  messages: messages$d
4010
4010
  };
4011
4011
 
4012
- var title$a = "Entrez votre adresse de livraison";
4012
+ var title$c = "Entrez votre adresse de livraison";
4013
4013
  var selectAddressTitle = "Veuillez sélectionner une adresse";
4014
4014
  var selectAddressSubtitle = "Choisissez l'une de vos adresses ou créez-en une nouvelle";
4015
4015
  var labels$c = {
@@ -4032,7 +4032,7 @@ var messages$c = {
4032
4032
  subRedeemed: "Votre abonnement a bien été activé."
4033
4033
  };
4034
4034
  var address_fr = {
4035
- title: title$a,
4035
+ title: title$c,
4036
4036
  selectAddressTitle: selectAddressTitle,
4037
4037
  selectAddressSubtitle: selectAddressSubtitle,
4038
4038
  labels: labels$c,
@@ -4040,8 +4040,8 @@ var address_fr = {
4040
4040
  messages: messages$c
4041
4041
  };
4042
4042
 
4043
- var title$9 = "Reset your password";
4044
- var subtitle$3 = "Enter a new password below";
4043
+ var title$b = "Reset your password";
4044
+ var subtitle$5 = "Enter a new password below";
4045
4045
  var email$3 = "Email";
4046
4046
  var password$3 = "Password";
4047
4047
  var confirmPassword$1 = "Confirm password";
@@ -4049,8 +4049,8 @@ var submit$5 = "Submit";
4049
4049
  var required$5 = "Required";
4050
4050
  var passwordUpdated$1 = "Password has been updated, please login with the new password";
4051
4051
  var passwordReset_en = {
4052
- title: title$9,
4053
- subtitle: subtitle$3,
4052
+ title: title$b,
4053
+ subtitle: subtitle$5,
4054
4054
  email: email$3,
4055
4055
  password: password$3,
4056
4056
  confirmPassword: confirmPassword$1,
@@ -4059,8 +4059,8 @@ var passwordReset_en = {
4059
4059
  passwordUpdated: passwordUpdated$1
4060
4060
  };
4061
4061
 
4062
- var title$8 = "Réinitialiser votre mot de passe";
4063
- var subtitle$2 = "Entrez un nouveau mot de passe ci-dessous";
4062
+ var title$a = "Réinitialiser votre mot de passe";
4063
+ var subtitle$4 = "Entrez un nouveau mot de passe ci-dessous";
4064
4064
  var email$2 = "Adresse courriel";
4065
4065
  var password$2 = "Mot de passe";
4066
4066
  var confirmPassword = "Confirmer le mot de passe";
@@ -4068,8 +4068,8 @@ var submit$4 = "Soumettre";
4068
4068
  var required$4 = "Champs obligatoires";
4069
4069
  var passwordUpdated = "Votre mot de passe a été mis à jour, veuillez vous connecter avec celui-ci";
4070
4070
  var passwordReset_fr = {
4071
- title: title$8,
4072
- subtitle: subtitle$2,
4071
+ title: title$a,
4072
+ subtitle: subtitle$4,
4073
4073
  email: email$2,
4074
4074
  password: password$2,
4075
4075
  confirmPassword: confirmPassword,
@@ -4078,7 +4078,7 @@ var passwordReset_fr = {
4078
4078
  passwordUpdated: passwordUpdated
4079
4079
  };
4080
4080
 
4081
- var title$7 = "Forgot your password?";
4081
+ var title$9 = "Forgot your password?";
4082
4082
  var email$1 = "Email";
4083
4083
  var password$1 = "Password";
4084
4084
  var submit$3 = "Submit";
@@ -4089,7 +4089,7 @@ var messages$b = {
4089
4089
  loginHere: "login here."
4090
4090
  };
4091
4091
  var passwordForgot_en = {
4092
- title: title$7,
4092
+ title: title$9,
4093
4093
  email: email$1,
4094
4094
  password: password$1,
4095
4095
  submit: submit$3,
@@ -4098,7 +4098,7 @@ var passwordForgot_en = {
4098
4098
  messages: messages$b
4099
4099
  };
4100
4100
 
4101
- var title$6 = "Mot de passe oublié ?";
4101
+ var title$8 = "Mot de passe oublié ?";
4102
4102
  var email = "Courriel";
4103
4103
  var password = "Mot de passe";
4104
4104
  var submit$2 = "Soumettre";
@@ -4109,7 +4109,7 @@ var messages$a = {
4109
4109
  loginHere: "Connectez-vous ici"
4110
4110
  };
4111
4111
  var passwordForgot_fr = {
4112
- title: title$6,
4112
+ title: title$8,
4113
4113
  email: email,
4114
4114
  password: password,
4115
4115
  submit: submit$2,
@@ -4118,7 +4118,7 @@ var passwordForgot_fr = {
4118
4118
  messages: messages$a
4119
4119
  };
4120
4120
 
4121
- var title$5 = "Change your password";
4121
+ var title$7 = "Change your password";
4122
4122
  var currentPassword$1 = "Current password";
4123
4123
  var newPassword$1 = "New password";
4124
4124
  var confirmNewPassword$1 = "Confirm new password";
@@ -4128,7 +4128,7 @@ var passwordChanged$1 = "Password has been changed, please login with the new pa
4128
4128
  var passwordsNotMatching$1 = "Passwords don't match";
4129
4129
  var weakPassword$1 = "Your password must contain at least 6 characters";
4130
4130
  var passwordChange_en = {
4131
- title: title$5,
4131
+ title: title$7,
4132
4132
  currentPassword: currentPassword$1,
4133
4133
  newPassword: newPassword$1,
4134
4134
  confirmNewPassword: confirmNewPassword$1,
@@ -4139,7 +4139,7 @@ var passwordChange_en = {
4139
4139
  weakPassword: weakPassword$1
4140
4140
  };
4141
4141
 
4142
- var title$4 = "Changez votre mot de passe";
4142
+ var title$6 = "Changez votre mot de passe";
4143
4143
  var currentPassword = "Mot de passe actuel";
4144
4144
  var newPassword = "Nouveau mot de passe";
4145
4145
  var confirmNewPassword = "Confirmer le nouveau mot de passe";
@@ -4149,7 +4149,7 @@ var passwordChanged = "Le mot de passe a été modifié, veuillez vous connecter
4149
4149
  var passwordsNotMatching = "Les mots de passe ne correspondent pas";
4150
4150
  var weakPassword = "Votre mot de passe doit contenir au moins 6";
4151
4151
  var passwordChange_fr = {
4152
- title: title$4,
4152
+ title: title$6,
4153
4153
  currentPassword: currentPassword,
4154
4154
  newPassword: newPassword,
4155
4155
  confirmNewPassword: confirmNewPassword,
@@ -4160,8 +4160,8 @@ var passwordChange_fr = {
4160
4160
  weakPassword: weakPassword
4161
4161
  };
4162
4162
 
4163
- var title$3 = "Votre panier";
4164
- var subtitle$1 = "Terminez votre achat ci-dessous";
4163
+ var title$5 = "Votre panier";
4164
+ var subtitle$3 = "Terminez votre achat ci-dessous";
4165
4165
  var name$1 = "Produit";
4166
4166
  var quantity$1 = "Quantité";
4167
4167
  var price$1 = "Prix";
@@ -4172,8 +4172,8 @@ var confirm$3 = "Passer à la caisse";
4172
4172
  var empty$1 = "Votre panier est vide.";
4173
4173
  var removeAll$1 = "Vider";
4174
4174
  var cart_fr = {
4175
- title: title$3,
4176
- subtitle: subtitle$1,
4175
+ title: title$5,
4176
+ subtitle: subtitle$3,
4177
4177
  name: name$1,
4178
4178
  quantity: quantity$1,
4179
4179
  price: price$1,
@@ -4185,8 +4185,8 @@ var cart_fr = {
4185
4185
  removeAll: removeAll$1
4186
4186
  };
4187
4187
 
4188
- var title$2 = "Your shopping cart";
4189
- var subtitle = "Comple your purchase below";
4188
+ var title$4 = "Your shopping cart";
4189
+ var subtitle$2 = "Comple your purchase below";
4190
4190
  var name = "Name";
4191
4191
  var quantity = "Quantity";
4192
4192
  var price = "Price";
@@ -4197,8 +4197,8 @@ var confirm$2 = "Checkout";
4197
4197
  var empty = "Your cart is empty.";
4198
4198
  var removeAll = "Remove all";
4199
4199
  var cart_en = {
4200
- title: title$2,
4201
- subtitle: subtitle,
4200
+ title: title$4,
4201
+ subtitle: subtitle$2,
4202
4202
  name: name,
4203
4203
  quantity: quantity,
4204
4204
  price: price,
@@ -4636,7 +4636,7 @@ var verifyEmail_fr = {
4636
4636
  messages: messages
4637
4637
  };
4638
4638
 
4639
- var title$1 = "Invoice details";
4639
+ var title$3 = "Invoice details";
4640
4640
  var labels$1 = {
4641
4641
  summary: "Summary",
4642
4642
  total: "Total",
@@ -4649,29 +4649,55 @@ var buttons$1 = {
4649
4649
  pay: "Pay now"
4650
4650
  };
4651
4651
  var invoiceDetails_en = {
4652
- title: title$1,
4652
+ title: title$3,
4653
4653
  labels: labels$1,
4654
4654
  buttons: buttons$1
4655
4655
  };
4656
4656
 
4657
- var title = "Invoice details";
4657
+ var title$2 = "Détails de la facture";
4658
4658
  var labels = {
4659
- summary: "Summary",
4659
+ summary: "Résumé",
4660
4660
  total: "Total",
4661
- amountPaid: "Amount paid",
4662
- amountDue: "Amount due",
4663
- creationDate: "Created on:"
4661
+ amountPaid: "Montant payé",
4662
+ amountDue: "Montant ",
4663
+ creationDate: "Créé le:"
4664
4664
  };
4665
4665
  var buttons = {
4666
- download: "Download",
4667
- pay: "Pay now"
4666
+ download: "Télécharger",
4667
+ pay: "Payer"
4668
4668
  };
4669
4669
  var invoiceDetails_fr = {
4670
- title: title,
4670
+ title: title$2,
4671
4671
  labels: labels,
4672
4672
  buttons: buttons
4673
4673
  };
4674
4674
 
4675
+ var title$1 = "Renewal options";
4676
+ var subtitle$1 = "Select one of the options below to continue";
4677
+ var next$1 = "Next";
4678
+ var addNew$1 = "Add Another Subscription";
4679
+ var renew$1 = "Renew Existing Subscription";
4680
+ var subscriptionOptions_en = {
4681
+ title: title$1,
4682
+ subtitle: subtitle$1,
4683
+ next: next$1,
4684
+ addNew: addNew$1,
4685
+ renew: renew$1
4686
+ };
4687
+
4688
+ var title = "Choix de renouvellement";
4689
+ var subtitle = "Veuillez choisir un des choix ci-dessous";
4690
+ var next = "Prochain";
4691
+ var addNew = "S'abonner à un autre forfait maintenant";
4692
+ var renew = "Renouveler l'abonnement actuel ";
4693
+ var subscriptionOptions_fr = {
4694
+ title: title,
4695
+ subtitle: subtitle,
4696
+ next: next,
4697
+ addNew: addNew,
4698
+ renew: renew
4699
+ };
4700
+
4675
4701
  function create$1(createState) {
4676
4702
  let state;
4677
4703
  const listeners = new Set();
@@ -6021,7 +6047,7 @@ class PelcroActions {
6021
6047
  view,
6022
6048
  cartItems,
6023
6049
  ...otherStateFields
6024
- } = initialState$i;
6050
+ } = initialState$j;
6025
6051
  this.set(otherStateFields);
6026
6052
  });
6027
6053
 
@@ -6045,6 +6071,16 @@ class PelcroActions {
6045
6071
  });
6046
6072
  }
6047
6073
 
6074
+ if (view === "subscription-options") {
6075
+ const noRenewableProducts = getRenewableProducts().length === 0;
6076
+
6077
+ if (noRenewableProducts) {
6078
+ return this.set({
6079
+ view: "plan-select"
6080
+ });
6081
+ }
6082
+ }
6083
+
6048
6084
  this.set({
6049
6085
  view
6050
6086
  });
@@ -6119,6 +6155,26 @@ class PelcroActions {
6119
6155
  }
6120
6156
  });
6121
6157
 
6158
+ _defineProperty$3(this, "setProductsList", products => {
6159
+ if (!Array.isArray(products)) {
6160
+ return console.error(`setProductsList expects an array of products as an argument, got an argument of type ${typeof products} instead`);
6161
+ }
6162
+
6163
+ const allowedProducts = window.Pelcro.product.list();
6164
+ const validProducts = products.filter(product => {
6165
+ 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));
6166
+
6167
+ if (!isValidProduct) {
6168
+ 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);
6169
+ }
6170
+
6171
+ return isValidProduct;
6172
+ });
6173
+ this.set({
6174
+ productsList: validProducts
6175
+ });
6176
+ });
6177
+
6122
6178
  _defineProperty$3(this, "setProduct", id => {
6123
6179
  const product = window.Pelcro.product.getById(id);
6124
6180
  if (!product) return console.error("invalid product id");
@@ -6340,10 +6396,12 @@ class PelcroCallbacks {
6340
6396
 
6341
6397
  }
6342
6398
 
6343
- const initialState$i = {
6399
+ var _window$Pelcro$produc, _window$Pelcro;
6400
+ const initialState$j = {
6344
6401
  // View
6345
6402
  view: null,
6346
6403
  // Plans
6404
+ 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 : [],
6347
6405
  product: null,
6348
6406
  plan: null,
6349
6407
  isGift: false,
@@ -6370,7 +6428,7 @@ const createPelcroStore = () => createStore(middleware_3((set, get) => {
6370
6428
  return {
6371
6429
  // Store setter
6372
6430
  set,
6373
- ...initialState$i,
6431
+ ...initialState$j,
6374
6432
  // State actions
6375
6433
  ...actions,
6376
6434
  // Callbacks
@@ -6725,6 +6783,30 @@ function userMustVerifyEmail() {
6725
6783
  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;
6726
6784
  return window.Pelcro.user.isAuthenticated() && isEmailVerificationEnabled && !isUserEmailVerified;
6727
6785
  }
6786
+ function getRenewableProducts() {
6787
+ var _window$Pelcro$subscr, _window$Pelcro$subscr2;
6788
+
6789
+ 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 : [];
6790
+ const renewableProductsIds = [...new Set(renewableSubs.map(sub => sub.plan.product.id))];
6791
+ const renewablePlansIds = [...new Set(renewableSubs.map(sub => sub.plan.id))];
6792
+ const {
6793
+ productsList
6794
+ } = usePelcro.getStore();
6795
+ return productsList.map(product => {
6796
+ if (renewableProductsIds.includes(product.id)) {
6797
+ const renewablePlans = getRenewablePlansOnly(product);
6798
+ return { ...product,
6799
+ plans: renewablePlans
6800
+ };
6801
+ }
6802
+ }).filter(product => product);
6803
+
6804
+ function getRenewablePlansOnly(product) {
6805
+ var _product$plans$filter, _product$plans;
6806
+
6807
+ 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 : [];
6808
+ }
6809
+ }
6728
6810
 
6729
6811
  const resources = {
6730
6812
  en: {
@@ -6749,7 +6831,8 @@ const resources = {
6749
6831
  dashboard: dashboard_en,
6750
6832
  select: select_en,
6751
6833
  notification: notification_en,
6752
- invoiceDetails: invoiceDetails_en
6834
+ invoiceDetails: invoiceDetails_en,
6835
+ subscriptionOptions: subscriptionOptions_en
6753
6836
  },
6754
6837
  fr: {
6755
6838
  common: common_fr,
@@ -6773,7 +6856,8 @@ const resources = {
6773
6856
  dashboard: dashboard_fr,
6774
6857
  select: select_fr,
6775
6858
  notification: notification_fr,
6776
- invoiceDetails: invoiceDetails_fr
6859
+ invoiceDetails: invoiceDetails_fr,
6860
+ subscriptionOptions: subscriptionOptions_fr
6777
6861
  }
6778
6862
  }; // set UI language to the page language or default to the language in site settings
6779
6863
 
@@ -7064,8 +7148,8 @@ const saveToMetadataButton = new SaveToMetadataButtonClass();
7064
7148
 
7065
7149
  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}}
7066
7150
 
7067
- function _extends$y() {
7068
- _extends$y = Object.assign || function (target) {
7151
+ function _extends$A() {
7152
+ _extends$A = Object.assign || function (target) {
7069
7153
  for (var i = 1; i < arguments.length; i++) {
7070
7154
  var source = arguments[i];
7071
7155
 
@@ -7079,7 +7163,7 @@ function _extends$y() {
7079
7163
  return target;
7080
7164
  };
7081
7165
 
7082
- return _extends$y.apply(this, arguments);
7166
+ return _extends$A.apply(this, arguments);
7083
7167
  }
7084
7168
 
7085
7169
  function _taggedTemplateLiteralLoose(strings, raw) {
@@ -7169,7 +7253,7 @@ var clearFromRemoveQueue = function clearFromRemoveQueue(toastId) {
7169
7253
  var reducer = function reducer(state, action) {
7170
7254
  switch (action.type) {
7171
7255
  case ActionType.ADD_TOAST:
7172
- return _extends$y({}, state, {
7256
+ return _extends$A({}, state, {
7173
7257
  toasts: [action.toast].concat(state.toasts).slice(0, TOAST_LIMIT)
7174
7258
  });
7175
7259
 
@@ -7179,9 +7263,9 @@ var reducer = function reducer(state, action) {
7179
7263
  clearFromRemoveQueue(action.toast.id);
7180
7264
  }
7181
7265
 
7182
- return _extends$y({}, state, {
7266
+ return _extends$A({}, state, {
7183
7267
  toasts: state.toasts.map(function (t) {
7184
- return t.id === action.toast.id ? _extends$y({}, t, action.toast) : t;
7268
+ return t.id === action.toast.id ? _extends$A({}, t, action.toast) : t;
7185
7269
  })
7186
7270
  });
7187
7271
 
@@ -7208,9 +7292,9 @@ var reducer = function reducer(state, action) {
7208
7292
  });
7209
7293
  }
7210
7294
 
7211
- return _extends$y({}, state, {
7295
+ return _extends$A({}, state, {
7212
7296
  toasts: state.toasts.map(function (t) {
7213
- return t.id === toastId || toastId === undefined ? _extends$y({}, t, {
7297
+ return t.id === toastId || toastId === undefined ? _extends$A({}, t, {
7214
7298
  visible: false
7215
7299
  }) : t;
7216
7300
  })
@@ -7218,28 +7302,28 @@ var reducer = function reducer(state, action) {
7218
7302
 
7219
7303
  case ActionType.REMOVE_TOAST:
7220
7304
  if (action.toastId === undefined) {
7221
- return _extends$y({}, state, {
7305
+ return _extends$A({}, state, {
7222
7306
  toasts: []
7223
7307
  });
7224
7308
  }
7225
7309
 
7226
- return _extends$y({}, state, {
7310
+ return _extends$A({}, state, {
7227
7311
  toasts: state.toasts.filter(function (t) {
7228
7312
  return t.id !== action.toastId;
7229
7313
  })
7230
7314
  });
7231
7315
 
7232
7316
  case ActionType.START_PAUSE:
7233
- return _extends$y({}, state, {
7317
+ return _extends$A({}, state, {
7234
7318
  pausedAt: action.time
7235
7319
  });
7236
7320
 
7237
7321
  case ActionType.END_PAUSE:
7238
7322
  var diff = action.time - (state.pausedAt || 0);
7239
- return _extends$y({}, state, {
7323
+ return _extends$A({}, state, {
7240
7324
  pausedAt: undefined,
7241
7325
  toasts: state.toasts.map(function (t) {
7242
- return _extends$y({}, t, {
7326
+ return _extends$A({}, t, {
7243
7327
  pauseDuration: t.pauseDuration + diff
7244
7328
  });
7245
7329
  })
@@ -7286,12 +7370,12 @@ var useStore = function useStore(toastOptions) {
7286
7370
  var mergedToasts = state.toasts.map(function (t) {
7287
7371
  var _toastOptions$t$type, _toastOptions, _toastOptions$t$type2;
7288
7372
 
7289
- return _extends$y({}, toastOptions, toastOptions[t.type], t, {
7373
+ return _extends$A({}, toastOptions, toastOptions[t.type], t, {
7290
7374
  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],
7291
- style: _extends$y({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7375
+ style: _extends$A({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7292
7376
  });
7293
7377
  });
7294
- return _extends$y({}, state, {
7378
+ return _extends$A({}, state, {
7295
7379
  toasts: mergedToasts
7296
7380
  });
7297
7381
  };
@@ -7301,7 +7385,7 @@ var createToast = function createToast(message, type, opts) {
7301
7385
  type = 'blank';
7302
7386
  }
7303
7387
 
7304
- return _extends$y({
7388
+ return _extends$A({
7305
7389
  createdAt: Date.now(),
7306
7390
  visible: true,
7307
7391
  type: type,
@@ -7351,14 +7435,14 @@ toast.remove = function (toastId) {
7351
7435
  };
7352
7436
 
7353
7437
  toast.promise = function (promise, msgs, opts) {
7354
- var id = toast.loading(msgs.loading, _extends$y({}, opts, opts == null ? void 0 : opts.loading));
7438
+ var id = toast.loading(msgs.loading, _extends$A({}, opts, opts == null ? void 0 : opts.loading));
7355
7439
  promise.then(function (p) {
7356
- toast.success(resolveValue(msgs.success, p), _extends$y({
7440
+ toast.success(resolveValue(msgs.success, p), _extends$A({
7357
7441
  id: id
7358
7442
  }, opts, opts == null ? void 0 : opts.success));
7359
7443
  return p;
7360
7444
  })["catch"](function (e) {
7361
- toast.error(resolveValue(msgs.error, e), _extends$y({
7445
+ toast.error(resolveValue(msgs.error, e), _extends$A({
7362
7446
  id: id
7363
7447
  }, opts, opts == null ? void 0 : opts.error));
7364
7448
  });
@@ -7697,7 +7781,7 @@ var ToastBar = /*#__PURE__*/memo(function (_ref2) {
7697
7781
  var message = createElement(Message, Object.assign({}, toast.ariaProps), resolveValue(toast.message, toast));
7698
7782
  return createElement(ToastBarBase, {
7699
7783
  className: toast.className,
7700
- style: _extends$y({}, animationStyle, style, toast.style)
7784
+ style: _extends$A({}, animationStyle, style, toast.style)
7701
7785
  }, typeof children === 'function' ? children({
7702
7786
  icon: icon,
7703
7787
  message: message
@@ -7727,7 +7811,7 @@ var getPositionStyle = function getPositionStyle(position, offset) {
7727
7811
  } : position.includes('right') ? {
7728
7812
  justifyContent: 'flex-end'
7729
7813
  } : {};
7730
- return _extends$y({
7814
+ return _extends$A({
7731
7815
  left: 0,
7732
7816
  right: 0,
7733
7817
  display: 'flex',
@@ -7754,7 +7838,7 @@ var Toaster = function Toaster(_ref) {
7754
7838
  handlers = _useToaster.handlers;
7755
7839
 
7756
7840
  return createElement("div", {
7757
- style: _extends$y({
7841
+ style: _extends$A({
7758
7842
  position: 'fixed',
7759
7843
  zIndex: 9999,
7760
7844
  top: DEFAULT_OFFSET,
@@ -7789,82 +7873,82 @@ var Toaster = function Toaster(_ref) {
7789
7873
  }));
7790
7874
  };
7791
7875
 
7792
- var _path$v;
7876
+ var _path$x;
7793
7877
 
7794
- 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); }
7878
+ 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); }
7795
7879
 
7796
7880
  function SvgCheckSolid(props) {
7797
- return /*#__PURE__*/React.createElement("svg", _extends$x({
7881
+ return /*#__PURE__*/React.createElement("svg", _extends$z({
7798
7882
  xmlns: "http://www.w3.org/2000/svg",
7799
7883
  className: "h-5 w-5",
7800
7884
  viewBox: "0 0 20 20",
7801
7885
  fill: "currentColor"
7802
- }, props), _path$v || (_path$v = /*#__PURE__*/React.createElement("path", {
7886
+ }, props), _path$x || (_path$x = /*#__PURE__*/React.createElement("path", {
7803
7887
  fillRule: "evenodd",
7804
7888
  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",
7805
7889
  clipRule: "evenodd"
7806
7890
  })));
7807
7891
  }
7808
7892
 
7809
- var _path$u;
7893
+ var _path$w;
7810
7894
 
7811
- 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); }
7895
+ 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); }
7812
7896
 
7813
7897
  function SvgXIcon(props) {
7814
- return /*#__PURE__*/React.createElement("svg", _extends$w({
7898
+ return /*#__PURE__*/React.createElement("svg", _extends$y({
7815
7899
  xmlns: "http://www.w3.org/2000/svg",
7816
7900
  viewBox: "0 0 20 20",
7817
7901
  fill: "currentColor"
7818
- }, props), _path$u || (_path$u = /*#__PURE__*/React.createElement("path", {
7902
+ }, props), _path$w || (_path$w = /*#__PURE__*/React.createElement("path", {
7819
7903
  fill: "evenodd",
7820
7904
  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",
7821
7905
  clipRule: "evenodd"
7822
7906
  })));
7823
7907
  }
7824
7908
 
7825
- var _path$t;
7909
+ var _path$v;
7826
7910
 
7827
- 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); }
7911
+ 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); }
7828
7912
 
7829
7913
  function SvgXIconSolid(props) {
7830
- return /*#__PURE__*/React.createElement("svg", _extends$v({
7914
+ return /*#__PURE__*/React.createElement("svg", _extends$x({
7831
7915
  className: "plc-w-4 plc-h-4",
7832
7916
  fill: "currentColor",
7833
7917
  xmlns: "http://www.w3.org/2000/svg",
7834
7918
  viewBox: "0 0 100 100"
7835
- }, props), _path$t || (_path$t = /*#__PURE__*/React.createElement("path", {
7919
+ }, props), _path$v || (_path$v = /*#__PURE__*/React.createElement("path", {
7836
7920
  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"
7837
7921
  })));
7838
7922
  }
7839
7923
 
7840
- var _path$s;
7924
+ var _path$u;
7841
7925
 
7842
- 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); }
7926
+ 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); }
7843
7927
 
7844
7928
  function SvgExclamation(props) {
7845
- return /*#__PURE__*/React.createElement("svg", _extends$u({
7929
+ return /*#__PURE__*/React.createElement("svg", _extends$w({
7846
7930
  className: "plc-w-4 plc-h-4 plc-mr-1",
7847
7931
  xmlns: "http://www.w3.org/2000/svg",
7848
7932
  viewBox: "0 0 20 20",
7849
7933
  fill: "currentColor"
7850
- }, props), _path$s || (_path$s = /*#__PURE__*/React.createElement("path", {
7934
+ }, props), _path$u || (_path$u = /*#__PURE__*/React.createElement("path", {
7851
7935
  fillRule: "evenodd",
7852
7936
  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",
7853
7937
  clipRule: "evenodd"
7854
7938
  })));
7855
7939
  }
7856
7940
 
7857
- var _path$r, _path2$4;
7941
+ var _path$t, _path2$4;
7858
7942
 
7859
- 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); }
7943
+ 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); }
7860
7944
 
7861
7945
  function SvgSpinner(props) {
7862
- return /*#__PURE__*/React.createElement("svg", _extends$t({
7946
+ return /*#__PURE__*/React.createElement("svg", _extends$v({
7863
7947
  className: "plc-animate-spin",
7864
7948
  viewBox: "0 0 24 24",
7865
7949
  fill: "currentColor",
7866
7950
  xmlns: "http://www.w3.org/2000/svg"
7867
- }, props), _path$r || (_path$r = /*#__PURE__*/React.createElement("path", {
7951
+ }, props), _path$t || (_path$t = /*#__PURE__*/React.createElement("path", {
7868
7952
  opacity: 0.2,
7869
7953
  fill: "evenodd",
7870
7954
  clipRule: "evenodd",
@@ -8154,7 +8238,9 @@ const init$1 = () => {
8154
8238
  return switchToAddressView();
8155
8239
  });
8156
8240
  } else {
8157
- pelcroSubscribeButtonsByClass[j].addEventListener("click", () => switchView("plan-select"));
8241
+ pelcroSubscribeButtonsByClass[j].addEventListener("click", () => {
8242
+ return switchView("subscription-options");
8243
+ });
8158
8244
  }
8159
8245
  }
8160
8246
  }
@@ -8316,7 +8402,8 @@ function Link({
8316
8402
  const init = () => {
8317
8403
  const {
8318
8404
  switchView,
8319
- set
8405
+ set,
8406
+ setProductsList
8320
8407
  } = usePelcro.getStore();
8321
8408
  const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
8322
8409
 
@@ -8367,7 +8454,8 @@ const init = () => {
8367
8454
  }
8368
8455
 
8369
8456
  notify.dismiss(NOTIFICATION_ID);
8370
- switchView("_plan-select-entitlements");
8457
+ setProductsList(window.Pelcro.product.getByEntitlements(entitlements));
8458
+ switchView("plan-select");
8371
8459
  }
8372
8460
  }, "Subscribe"), "now to get full page access.")), {
8373
8461
  className: "pelcro-notification-entitlement",
@@ -8599,6 +8687,7 @@ var pure_1 = pure.loadStripe;
8599
8687
  * @param {Object} error Error object
8600
8688
  * @return {string}
8601
8689
  */
8690
+
8602
8691
  const getErrorMessages = error => {
8603
8692
  var _error$error, _error$response, _error$response$data, _error$response3, _error$response3$data, _error$response3$data2, _error$response5, _error$response5$data;
8604
8693
 
@@ -8618,6 +8707,10 @@ const getErrorMessages = error => {
8618
8707
  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;
8619
8708
  }
8620
8709
 
8710
+ if (error !== null && error !== void 0 && error.message) {
8711
+ return error.message;
8712
+ }
8713
+
8621
8714
  const errorMessages = []; // enumerable error (ex: validation errors)
8622
8715
 
8623
8716
  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]) => {
@@ -8653,6 +8746,15 @@ const debounce = (func, waitTime) => {
8653
8746
  timeout = setTimeout(later, waitTime);
8654
8747
  };
8655
8748
  };
8749
+ function getSiteCardProcessor() {
8750
+ var _window$Pelcro$site$r;
8751
+
8752
+ if ((_window$Pelcro$site$r = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r !== void 0 && _window$Pelcro$site$r.vantiv_gateway_settings) {
8753
+ return "vantiv";
8754
+ }
8755
+
8756
+ return "stripe";
8757
+ }
8656
8758
 
8657
8759
  /**
8658
8760
  * @typedef {Object} OptionsType
@@ -8733,13 +8835,29 @@ const loadPaymentSDKs = () => {
8733
8835
  if (!window.Stripe) {
8734
8836
  pure_1(window.Pelcro.environment.stripe);
8735
8837
  }
8736
- }); // Load PayPal SDK's
8838
+ }); // Load PayPal SDKs
8737
8839
 
8738
8840
  const supportsPaypal = Boolean(window.Pelcro.site.read().braintree_tokenization);
8739
8841
 
8740
8842
  if (supportsPaypal) {
8741
8843
  window.Pelcro.helpers.loadSDK("https://js.braintreegateway.com/web/3.69.0/js/client.min.js", "braintree-sdk");
8742
8844
  window.Pelcro.helpers.loadSDK("https://js.braintreegateway.com/web/3.69.0/js/paypal-checkout.min.js", "braintree-paypal-sdk");
8845
+ } // Load Vantiv SDKs
8846
+
8847
+
8848
+ const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_gateway_settings);
8849
+
8850
+ if (supportsVantiv) {
8851
+ if (!window.jQuery) {
8852
+ window.Pelcro.helpers.loadSDK("https://code.jquery.com/jquery-3.6.0.slim.min.js", "vantiv-jquery-sdk");
8853
+ }
8854
+
8855
+ if (!window.EprotectIframeClient) {
8856
+ const PRELIVE_URL = "https://request.eprotect.vantivprelive.com/eProtect/js/eProtect-iframe-client.min.js";
8857
+ const PRODUCTION_URL = "https://request.eprotect.vantivcnp.com/eProtect/js/eProtect-iframe-client4.min.js";
8858
+ const scriptUrlToUse = window.Pelcro.site.read().vantiv_gateway_settings.environment === "production" ? PRODUCTION_URL : PRELIVE_URL;
8859
+ window.Pelcro.helpers.loadSDK(scriptUrlToUse, "vantiv-eprotect-sdk");
8860
+ }
8743
8861
  }
8744
8862
  };
8745
8863
  const loadAuth0SDK = () => {
@@ -8899,8 +9017,7 @@ const initViewFromURL = () => {
8899
9017
  }
8900
9018
 
8901
9019
  if (view === "invoice-details") {
8902
- // FIXME: commented out to remove from the release
8903
- return false; // return showInvoiceDetailsFromUrl();
9020
+ return showInvoiceDetailsFromUrl();
8904
9021
  }
8905
9022
 
8906
9023
  switchView(view);
@@ -9079,6 +9196,43 @@ const verifyEmailTokenFromUrl = () => {
9079
9196
  });
9080
9197
  };
9081
9198
 
9199
+ const showInvoiceDetailsFromUrl = () => {
9200
+ const {
9201
+ isAuthenticated,
9202
+ setInvoice,
9203
+ whenSiteReady,
9204
+ switchView
9205
+ } = usePelcro.getStore();
9206
+ whenSiteReady(() => {
9207
+ if (!isAuthenticated()) {
9208
+ return switchView("login");
9209
+ }
9210
+
9211
+ const invoiceId = window.Pelcro.helpers.getURLParameter("id");
9212
+ const wasSetSuccessfully = setInvoice(invoiceId);
9213
+
9214
+ if (!wasSetSuccessfully) {
9215
+ const errorMessage = i18next.t("messages:invalidInvoice", {
9216
+ returnObjects: true
9217
+ });
9218
+ return notify.error(errorMessage);
9219
+ }
9220
+
9221
+ const {
9222
+ invoice
9223
+ } = usePelcro.getStore();
9224
+
9225
+ if (invoice.total === 0) {
9226
+ const errorMessage = i18next.t("messages:zeroTotalInvoice", {
9227
+ returnObjects: true
9228
+ });
9229
+ return notify.error(errorMessage);
9230
+ }
9231
+
9232
+ return switchView("invoice-details");
9233
+ });
9234
+ };
9235
+
9082
9236
  const defaultOptions = {
9083
9237
  loadPaymentSDKs: true,
9084
9238
  loadAuth0SDK: true,
@@ -9136,7 +9290,7 @@ const PelcroModalController = ({
9136
9290
  type
9137
9291
  }) => (type === null || type === void 0 ? void 0 : type.viewId) === "dashboard-open"), React__default.Children.map(children, child => child).find(({
9138
9292
  type
9139
- }) => (type === null || type === void 0 ? void 0 : type.viewId) === "notification"), view === "_plan-select-entitlements" && React__default.Children.map(children, child => child).find(({
9293
+ }) => (type === null || type === void 0 ? void 0 : type.viewId) === "notification"), view === "_plan-select-renew" && React__default.Children.map(children, child => child).find(({
9140
9294
  type
9141
9295
  }) => (type === null || type === void 0 ? void 0 : type.viewId) === "plan-select"), React__default.Children.map(children, child => child).find(({
9142
9296
  type
@@ -9417,8 +9571,10 @@ const LOAD_PAYMENT_METHODS = "LOAD_PAYMENT_METHODS";
9417
9571
  const GET_NEWSLETTERS_FETCH = "GET_NEWSLETTERS_FETCH";
9418
9572
  const GET_NEWSLETTERS_SUCCESS = "GET_NEWSLETTERS_SUCCESS";
9419
9573
  const SWITCH_TO_UPDATE = "SWITCH_TO_UPDATE";
9574
+ const SWITCH_TO_RENEW = "SWITCH_TO_RENEW";
9575
+ const SWITCH_TO_NEW = "SWITCH_TO_NEW";
9420
9576
 
9421
- const initialState$h = {
9577
+ const initialState$i = {
9422
9578
  email: "",
9423
9579
  password: "",
9424
9580
  emailError: null,
@@ -9429,10 +9585,10 @@ const initialState$h = {
9429
9585
  content: ""
9430
9586
  }
9431
9587
  };
9432
- const store$h = /*#__PURE__*/createContext(initialState$h);
9588
+ const store$i = /*#__PURE__*/createContext(initialState$i);
9433
9589
  const {
9434
- Provider: Provider$h
9435
- } = store$h;
9590
+ Provider: Provider$i
9591
+ } = store$i;
9436
9592
 
9437
9593
  const LoginContainer = ({
9438
9594
  style,
@@ -9539,7 +9695,7 @@ const LoginContainer = ({
9539
9695
  });
9540
9696
 
9541
9697
  case RESET_LOGIN_FORM:
9542
- return initialState$h;
9698
+ return initialState$i;
9543
9699
 
9544
9700
  case DISABLE_LOGIN_BUTTON:
9545
9701
  return lib_7({ ...state,
@@ -9557,12 +9713,12 @@ const LoginContainer = ({
9557
9713
  default:
9558
9714
  return state;
9559
9715
  }
9560
- }, initialState$h);
9716
+ }, initialState$i);
9561
9717
  return /*#__PURE__*/React__default.createElement("div", {
9562
9718
  style: { ...style
9563
9719
  },
9564
9720
  className: `pelcro-container pelcro-login-container ${className}`
9565
- }, /*#__PURE__*/React__default.createElement(Provider$h, {
9721
+ }, /*#__PURE__*/React__default.createElement(Provider$i, {
9566
9722
  value: {
9567
9723
  state,
9568
9724
  dispatch
@@ -9570,12 +9726,12 @@ const LoginContainer = ({
9570
9726
  }, children.length ? children.map((child, i) => {
9571
9727
  if (child) {
9572
9728
  return /*#__PURE__*/React__default.cloneElement(child, {
9573
- store: store$h,
9729
+ store: store$i,
9574
9730
  key: i
9575
9731
  });
9576
9732
  }
9577
9733
  }) : /*#__PURE__*/React__default.cloneElement(children, {
9578
- store: store$h
9734
+ store: store$i
9579
9735
  })));
9580
9736
  };
9581
9737
 
@@ -9820,7 +9976,7 @@ const LoginButton = ({
9820
9976
  buttonDisabled
9821
9977
  },
9822
9978
  dispatch
9823
- } = useContext(store$h);
9979
+ } = useContext(store$i);
9824
9980
  const {
9825
9981
  t
9826
9982
  } = useTranslation("login");
@@ -9841,23 +9997,23 @@ const LoginButton = ({
9841
9997
  };
9842
9998
 
9843
9999
  const LoginEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
9844
- store: store$h
10000
+ store: store$i
9845
10001
  }, props));
9846
10002
 
9847
10003
  const LoginPassword = props => /*#__PURE__*/React__default.createElement(Password, Object.assign({
9848
- store: store$h
10004
+ store: store$i
9849
10005
  }, props));
9850
10006
 
9851
- var _path$q;
10007
+ var _path$s;
9852
10008
 
9853
- 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); }
10009
+ 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); }
9854
10010
 
9855
10011
  function SvgCheck(props) {
9856
- return /*#__PURE__*/React.createElement("svg", _extends$s({
10012
+ return /*#__PURE__*/React.createElement("svg", _extends$u({
9857
10013
  xmlns: "http://www.w3.org/2000/svg",
9858
10014
  fill: "currentColor",
9859
10015
  viewBox: "0 0 20 20"
9860
- }, props), _path$q || (_path$q = /*#__PURE__*/React.createElement("path", {
10016
+ }, props), _path$s || (_path$s = /*#__PURE__*/React.createElement("path", {
9861
10017
  fillRule: "evenodd",
9862
10018
  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",
9863
10019
  clipRule: "evenodd"
@@ -9922,7 +10078,7 @@ var facebookLoginRenderProps = createCommonjsModule(function (module, exports) {
9922
10078
  var FacebookLogin = unwrapExports(facebookLoginRenderProps);
9923
10079
  facebookLoginRenderProps.FacebookLogin;
9924
10080
 
9925
- const initialState$g = {
10081
+ const initialState$h = {
9926
10082
  email: "",
9927
10083
  password: "",
9928
10084
  emailError: null,
@@ -9939,10 +10095,10 @@ const initialState$g = {
9939
10095
  content: ""
9940
10096
  }
9941
10097
  };
9942
- const store$g = /*#__PURE__*/createContext(initialState$g);
10098
+ const store$h = /*#__PURE__*/createContext(initialState$h);
9943
10099
  const {
9944
- Provider: Provider$g
9945
- } = store$g;
10100
+ Provider: Provider$h
10101
+ } = store$h;
9946
10102
 
9947
10103
  const RegisterContainer = ({
9948
10104
  style,
@@ -10125,7 +10281,7 @@ const RegisterContainer = ({
10125
10281
  });
10126
10282
 
10127
10283
  case RESET_LOGIN_FORM:
10128
- return initialState$g;
10284
+ return initialState$h;
10129
10285
 
10130
10286
  case DISABLE_REGISTRATION_BUTTON:
10131
10287
  return lib_7({ ...state,
@@ -10143,12 +10299,12 @@ const RegisterContainer = ({
10143
10299
  default:
10144
10300
  return state;
10145
10301
  }
10146
- }, initialState$g);
10302
+ }, initialState$h);
10147
10303
  return /*#__PURE__*/React__default.createElement("div", {
10148
10304
  style: { ...style
10149
10305
  },
10150
10306
  className: `pelcro-container pelcro-register-container ${className}`
10151
- }, /*#__PURE__*/React__default.createElement(Provider$g, {
10307
+ }, /*#__PURE__*/React__default.createElement(Provider$h, {
10152
10308
  value: {
10153
10309
  state,
10154
10310
  dispatch
@@ -10156,12 +10312,12 @@ const RegisterContainer = ({
10156
10312
  }, children.length ? children.map((child, i) => {
10157
10313
  if (child) {
10158
10314
  return /*#__PURE__*/React__default.cloneElement(child, {
10159
- store: store$g,
10315
+ store: store$h,
10160
10316
  key: i
10161
10317
  });
10162
10318
  }
10163
10319
  }) : /*#__PURE__*/React__default.cloneElement(children, {
10164
- store: store$g
10320
+ store: store$h
10165
10321
  })));
10166
10322
  };
10167
10323
  /**
@@ -10176,15 +10332,15 @@ function hasSecurityTokenEnabled$1() {
10176
10332
  return hasSecuritySdkLoaded;
10177
10333
  }
10178
10334
 
10179
- var _path$p;
10335
+ var _path$r;
10180
10336
 
10181
- 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); }
10337
+ 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); }
10182
10338
 
10183
10339
  function SvgFacebookLogo(props) {
10184
- return /*#__PURE__*/React.createElement("svg", _extends$r({
10340
+ return /*#__PURE__*/React.createElement("svg", _extends$t({
10185
10341
  xmlns: "http://www.w3.org/2000/svg",
10186
10342
  viewBox: "88.428 12.828 107.543 207.085"
10187
- }, props), _path$p || (_path$p = /*#__PURE__*/React.createElement("path", {
10343
+ }, props), _path$r || (_path$r = /*#__PURE__*/React.createElement("path", {
10188
10344
  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",
10189
10345
  fill: "#3c5a9a"
10190
10346
  })));
@@ -10201,10 +10357,10 @@ const FacebookLoginButton = ({
10201
10357
  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;
10202
10358
  const {
10203
10359
  dispatch: loginDispatch
10204
- } = useContext(store$h);
10360
+ } = useContext(store$i);
10205
10361
  const {
10206
10362
  dispatch: registerDispatch
10207
- } = useContext(store$g);
10363
+ } = useContext(store$h);
10208
10364
 
10209
10365
  const onSuccess = facebookUser => {
10210
10366
  loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
@@ -10257,15 +10413,15 @@ var googleLogin = createCommonjsModule(function (module, exports) {
10257
10413
  unwrapExports(googleLogin);
10258
10414
  var googleLogin_1 = googleLogin.GoogleLogin;
10259
10415
 
10260
- var _path$o, _path2$3, _path3$1, _path4;
10416
+ var _path$q, _path2$3, _path3$1, _path4;
10261
10417
 
10262
- 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); }
10418
+ 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); }
10263
10419
 
10264
10420
  function SvgGoogleLogo(props) {
10265
- return /*#__PURE__*/React.createElement("svg", _extends$q({
10421
+ return /*#__PURE__*/React.createElement("svg", _extends$s({
10266
10422
  viewBox: "0 0 24 24",
10267
10423
  xmlns: "http://www.w3.org/2000/svg"
10268
- }, props), _path$o || (_path$o = /*#__PURE__*/React.createElement("path", {
10424
+ }, props), _path$q || (_path$q = /*#__PURE__*/React.createElement("path", {
10269
10425
  fill: "#4285F4",
10270
10426
  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"
10271
10427
  })), _path2$3 || (_path2$3 = /*#__PURE__*/React.createElement("path", {
@@ -10291,10 +10447,10 @@ const GoogleLoginButton = ({
10291
10447
  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;
10292
10448
  const {
10293
10449
  dispatch: loginDispatch
10294
- } = useContext(store$h);
10450
+ } = useContext(store$i);
10295
10451
  const {
10296
10452
  dispatch: registerDispatch
10297
- } = useContext(store$g);
10453
+ } = useContext(store$h);
10298
10454
 
10299
10455
  const onSuccess = response => {
10300
10456
  var _response$getAuthResp, _profile$getEmail, _profile$getGivenName, _profile$getFamilyNam, _profile$getEmail2, _profile$getGivenName2, _profile$getFamilyNam2;
@@ -10342,15 +10498,15 @@ const GoogleLoginButton = ({
10342
10498
  }) : null;
10343
10499
  };
10344
10500
 
10345
- var _path$n;
10501
+ var _path$p;
10346
10502
 
10347
- 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); }
10503
+ 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); }
10348
10504
 
10349
10505
  function SvgAuth0Logo(props) {
10350
- return /*#__PURE__*/React.createElement("svg", _extends$p({
10506
+ return /*#__PURE__*/React.createElement("svg", _extends$r({
10351
10507
  viewBox: "0 0 256 285",
10352
10508
  xmlns: "http://www.w3.org/2000/svg"
10353
- }, props), _path$n || (_path$n = /*#__PURE__*/React.createElement("path", {
10509
+ }, props), _path$p || (_path$p = /*#__PURE__*/React.createElement("path", {
10354
10510
  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"
10355
10511
  })));
10356
10512
  }
@@ -10390,10 +10546,10 @@ const Auth0LoginButton = ({
10390
10546
  }, [auth0Enabled, auth0Loaded]);
10391
10547
  const {
10392
10548
  dispatch: loginDispatch
10393
- } = useContext(store$h);
10549
+ } = useContext(store$i);
10394
10550
  const {
10395
10551
  dispatch: registerDispatch
10396
- } = useContext(store$g);
10552
+ } = useContext(store$h);
10397
10553
 
10398
10554
  function handleClick() {
10399
10555
  var _auth0InstanceRef$cur, _auth0InstanceRef$cur2, _auth0InstanceRef$cur3;
@@ -10526,15 +10682,15 @@ function LoginView(props) {
10526
10682
  }, /*#__PURE__*/React__default.createElement(GoogleLoginButton, null), /*#__PURE__*/React__default.createElement(FacebookLoginButton, null), /*#__PURE__*/React__default.createElement(Auth0LoginButton, null))))));
10527
10683
  }
10528
10684
 
10529
- var _path$m, _path2$2, _path3;
10685
+ var _path$o, _path2$2, _path3;
10530
10686
 
10531
- 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); }
10687
+ 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); }
10532
10688
 
10533
10689
  function SvgPelcroAuthorship(props) {
10534
- return /*#__PURE__*/React.createElement("svg", _extends$o({
10690
+ return /*#__PURE__*/React.createElement("svg", _extends$q({
10535
10691
  xmlns: "http://www.w3.org/2000/svg",
10536
10692
  viewBox: "0 -80.652 497.072 179.991"
10537
- }, props), _path$m || (_path$m = /*#__PURE__*/React.createElement("path", {
10693
+ }, props), _path$o || (_path$o = /*#__PURE__*/React.createElement("path", {
10538
10694
  fill: "none",
10539
10695
  stroke: "#4a4a4a",
10540
10696
  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"
@@ -10681,11 +10837,11 @@ function LoginModal({
10681
10837
  LoginModal.viewId = "login";
10682
10838
 
10683
10839
  const RegisterEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
10684
- store: store$g
10840
+ store: store$h
10685
10841
  }, props));
10686
10842
 
10687
10843
  const RegisterPassword = props => /*#__PURE__*/React__default.createElement(Password, Object.assign({
10688
- store: store$g
10844
+ store: store$h
10689
10845
  }, props));
10690
10846
 
10691
10847
  const RegisterButton = ({
@@ -10705,7 +10861,7 @@ const RegisterButton = ({
10705
10861
  buttonDisabled
10706
10862
  },
10707
10863
  dispatch
10708
- } = useContext(store$g);
10864
+ } = useContext(store$h);
10709
10865
  const {
10710
10866
  t
10711
10867
  } = useTranslation("register");
@@ -10843,7 +10999,7 @@ function FirstName({
10843
10999
  }
10844
11000
 
10845
11001
  const RegisterFirstName = props => /*#__PURE__*/React__default.createElement(FirstName, Object.assign({
10846
- store: store$g
11002
+ store: store$h
10847
11003
  }, props));
10848
11004
 
10849
11005
  function LastName({
@@ -10874,7 +11030,7 @@ function LastName({
10874
11030
  }
10875
11031
 
10876
11032
  const RegisterLastName = props => /*#__PURE__*/React__default.createElement(LastName, Object.assign({
10877
- store: store$g
11033
+ store: store$h
10878
11034
  }, props));
10879
11035
 
10880
11036
  /**
@@ -10998,7 +11154,7 @@ function TextInput({
10998
11154
 
10999
11155
  const RegisterTextInput = props => {
11000
11156
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({}, props, {
11001
- store: store$g
11157
+ store: store$h
11002
11158
  }));
11003
11159
  };
11004
11160
 
@@ -11145,6 +11301,7 @@ function SelectModalWithHook(props) {
11145
11301
  (_props$onDisplay = props.onDisplay) === null || _props$onDisplay === void 0 ? void 0 : _props$onDisplay.call(props);
11146
11302
  }, []);
11147
11303
  const {
11304
+ productsList,
11148
11305
  isGift,
11149
11306
  plan,
11150
11307
  product,
@@ -11154,11 +11311,12 @@ function SelectModalWithHook(props) {
11154
11311
  view,
11155
11312
  set
11156
11313
  } = usePelcro();
11157
- const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
11158
- const entitlements = entitlementsProtectedElements.length > 0 ? getEntitlementsFromElem(entitlementsProtectedElements[0]) : null;
11314
+ const isRenewingSub = view === "_plan-select-renew";
11159
11315
  return /*#__PURE__*/React__default.createElement(SelectModalWithTrans, {
11316
+ productsList: productsList,
11160
11317
  isGift: isGift,
11161
- disableGifting: isRenewingGift,
11318
+ disableGifting: isRenewingGift || isRenewingSub,
11319
+ isRenewingSub: isRenewingSub,
11162
11320
  plan: plan,
11163
11321
  product: product,
11164
11322
  onClose: () => {
@@ -11172,8 +11330,10 @@ function SelectModalWithHook(props) {
11172
11330
  plan,
11173
11331
  isGift
11174
11332
  }),
11175
- setView: switchView,
11176
- matchingEntitlements: view === "_plan-select-entitlements" ? entitlements : null
11333
+ setSubscriptionIdToRenew: subscriptionIdToRenew => set({
11334
+ subscriptionIdToRenew
11335
+ }),
11336
+ setView: switchView
11177
11337
  });
11178
11338
  }
11179
11339
  SelectModalWithHook.viewId = "plan-select";
@@ -11205,10 +11365,10 @@ class SelectModal extends Component {
11205
11365
  });
11206
11366
  }
11207
11367
 
11208
- if (this.state.productList.length === 1) {
11368
+ if (this.props.productsList.length === 1) {
11209
11369
  this.setState({
11210
- product: this.state.productList[0],
11211
- planList: this.state.productList[0].plans,
11370
+ product: this.props.productsList[0],
11371
+ planList: this.props.productsList[0].plans,
11212
11372
  mode: "plan"
11213
11373
  });
11214
11374
  }
@@ -11225,7 +11385,7 @@ class SelectModal extends Component {
11225
11385
  });
11226
11386
 
11227
11387
  _defineProperty$3(this, "onProductChange", e => {
11228
- const product = window.Pelcro.product.list()[e.target.selectedIndex];
11388
+ const product = productsList[e.target.selectedIndex];
11229
11389
  this.setState({
11230
11390
  product: product,
11231
11391
  plan: product.plans[0]
@@ -11291,7 +11451,7 @@ class SelectModal extends Component {
11291
11451
 
11292
11452
  _defineProperty$3(this, "renderProducts", () => {
11293
11453
  const userDidSelectProduct = Boolean(this.state.mode === "plan");
11294
- const productsToShow = userDidSelectProduct ? [this.state.product] : this.state.productList;
11454
+ const productsToShow = userDidSelectProduct ? [this.state.product] : this.props.productsList;
11295
11455
  return productsToShow.map((product, index) => {
11296
11456
  return this.renderOneProduct(product, index);
11297
11457
  });
@@ -11304,7 +11464,7 @@ class SelectModal extends Component {
11304
11464
  return this.renderOneProduct(this.state.product);
11305
11465
  }
11306
11466
 
11307
- const [productsThatMatchArticleTag, allProductsMinusMatched] = productsWithMatchedTaggedFirst(); // Render normal products if there are no available matching products
11467
+ const [productsThatMatchArticleTag, allProductsMinusMatched] = productsWithMatchedTaggedFirst(this.props.productsList); // Render normal products if there are no available matching products
11308
11468
 
11309
11469
  if (!(productsThatMatchArticleTag !== null && productsThatMatchArticleTag !== void 0 && productsThatMatchArticleTag.length)) {
11310
11470
  return this.renderProducts();
@@ -11320,10 +11480,7 @@ class SelectModal extends Component {
11320
11480
  className: "plc-text-sm plc-font-semibold"
11321
11481
  }, this.locale("labels.restrictiveArticles.or")), allProductsMinusMatched.map((product, index) => this.renderOneProduct(product, index))));
11322
11482
 
11323
- function productsWithMatchedTaggedFirst() {
11324
- var _window$Pelcro$produc;
11325
-
11326
- const allProducts = (_window$Pelcro$produc = window.Pelcro.product.list()) !== null && _window$Pelcro$produc !== void 0 ? _window$Pelcro$produc : [];
11483
+ function productsWithMatchedTaggedFirst(allProducts) {
11327
11484
  const productsThatMatchArticleTag = window.Pelcro.product.getByMatchingPageTags();
11328
11485
  const allProductsMinusMatched = allProducts.filter(product => !productsThatMatchArticleTag.some(matchedProduct => matchedProduct.id === product.id));
11329
11486
  return [productsThatMatchArticleTag, allProductsMinusMatched];
@@ -11357,7 +11514,7 @@ class SelectModal extends Component {
11357
11514
  _defineProperty$3(this, "selectProduct", e => {
11358
11515
  const id = e.target.dataset.key;
11359
11516
 
11360
- for (const product of this.state.productList) {
11517
+ for (const product of this.props.productsList) {
11361
11518
  if (+product.id === +id) {
11362
11519
  var _this$state$plan;
11363
11520
 
@@ -11410,6 +11567,14 @@ class SelectModal extends Component {
11410
11567
 
11411
11568
  _defineProperty$3(this, "submitOption", () => {
11412
11569
  this.props.setProductAndPlan(this.state.product, this.state.plan, this.state.isGift);
11570
+
11571
+ if (this.props.isRenewingSub) {
11572
+ var _matchingSub$id;
11573
+
11574
+ const matchingSub = window.Pelcro.subscription.list().find(sub => sub.plan.id === this.state.plan.id && sub.status === "active" && sub.cancel_at_period_end === 1);
11575
+ this.props.setSubscriptionIdToRenew((_matchingSub$id = matchingSub === null || matchingSub === void 0 ? void 0 : matchingSub.id) !== null && _matchingSub$id !== void 0 ? _matchingSub$id : null);
11576
+ }
11577
+
11413
11578
  const {
11414
11579
  product,
11415
11580
  isGift
@@ -11447,8 +11612,7 @@ class SelectModal extends Component {
11447
11612
  plan: {},
11448
11613
  isGift: props.isGift,
11449
11614
  disabled: true,
11450
- mode: "product",
11451
- productList: props.matchingEntitlements ? window.Pelcro.product.getByEntitlements(props.matchingEntitlements) : window.Pelcro.product.list()
11615
+ mode: "product"
11452
11616
  };
11453
11617
  this.product = this.props.product || window.Pelcro.paywall.getProduct();
11454
11618
  this.locale = this.props.t;
@@ -11456,7 +11620,7 @@ class SelectModal extends Component {
11456
11620
  }
11457
11621
 
11458
11622
  render() {
11459
- var _window$Pelcro$produc2, _window$Pelcro$produc3, _window$Pelcro$site$r;
11623
+ var _this$props$productsL, _this$props$productsL2, _window$Pelcro$site$r;
11460
11624
 
11461
11625
  const {
11462
11626
  disableGifting
@@ -11490,7 +11654,7 @@ class SelectModal extends Component {
11490
11654
  className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
11491
11655
  }, /*#__PURE__*/React__default.createElement("h4", {
11492
11656
  className: "plc-text-2xl plc-font-semibold"
11493
- }, 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.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.createElement("div", {
11657
+ }, 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.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.createElement("div", {
11494
11658
  className: "pelcro-select-products-wrapper"
11495
11659
  }, (_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.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
11496
11660
  className: "plc-overflow-y-scroll plc-max-h-72 pelcro-select-plans-wrapper"
@@ -12654,20 +12818,21 @@ var es_12 = es.injectStripe;
12654
12818
  var es_13 = es.StripeProvider;
12655
12819
 
12656
12820
  /**
12657
- * @TODO: All subscription related business logic should end up moving
12821
+ * @TODO: All payment related business logic should end up moving
12658
12822
  * to this service, and out of react components.
12659
12823
  */
12660
12824
 
12661
12825
  /**
12662
- * Enum for subscription types
12826
+ * Enum for payment types
12663
12827
  * @readonly
12664
12828
  * @enum {string}
12665
12829
  */
12666
- const SUBSCRIPTION_TYPES = {
12830
+ const PAYMENT_TYPES = {
12667
12831
  CREATE_SUBSCRIPTION: "CREATE_SUBSCRIPTION",
12668
12832
  CREATE_GIFTED_SUBSCRIPTION: "CREATE_GIFTED_SUBSCRIPTION",
12669
12833
  RENEW_SUBSCRIPTION: "RENEW_SUBSCRIPTION",
12670
12834
  RENEW_GIFTED_SUBSCRIPTION: "RENEW_GIFTED_SUBSCRIPTION",
12835
+ PURCHASE_ECOMMERCE_ORDER: "PURCHASE_ECOMMERCE_ORDER",
12671
12836
  PAY_INVOICE: "PAY_INVOICE"
12672
12837
  };
12673
12838
 
@@ -12675,10 +12840,9 @@ var _isPaymentGatewayInvalid = /*#__PURE__*/new WeakMap();
12675
12840
 
12676
12841
  var _generateUserError = /*#__PURE__*/new WeakMap();
12677
12842
 
12678
- class Subscription {
12843
+ class Payment {
12679
12844
  /**
12680
- * Subscription service constructor
12681
- * @param {(StripeGateway|PaypalGateWay)} paymentGateway
12845
+ * @param {(StripeGateway|PaypalGateway|VantivGateway)} paymentGateway
12682
12846
  */
12683
12847
  constructor(paymentGateway) {
12684
12848
  _defineProperty$3(this, "execute", (options, callback) => {
@@ -12689,7 +12853,7 @@ class Subscription {
12689
12853
 
12690
12854
  if (!options.type) {
12691
12855
  callback(_classPrivateFieldGet(this, _generateUserError).call(this), null);
12692
- return console.error("No subscription type provided");
12856
+ return console.error("No payment type provided");
12693
12857
  } // delegate execution to paymentgateway
12694
12858
 
12695
12859
 
@@ -12699,7 +12863,7 @@ class Subscription {
12699
12863
  _isPaymentGatewayInvalid.set(this, {
12700
12864
  writable: true,
12701
12865
  value: gateway => {
12702
- return gateway && !(gateway instanceof StripeGateway) && gateway && !(gateway instanceof PaypalGateWay);
12866
+ return gateway && !(gateway instanceof StripeGateway || gateway instanceof PaypalGateway || gateway instanceof VantivGateway);
12703
12867
  }
12704
12868
  });
12705
12869
 
@@ -12707,21 +12871,21 @@ class Subscription {
12707
12871
  writable: true,
12708
12872
  value: () => {
12709
12873
  return {
12710
- error: new Error("An error has occured in the subscription service, please try again later")
12874
+ error: new Error("An error has occured in the payment service, please try again later")
12711
12875
  };
12712
12876
  }
12713
12877
  });
12714
12878
 
12715
12879
  if (_classPrivateFieldGet(this, _isPaymentGatewayInvalid).call(this, paymentGateway)) {
12716
12880
  this.paymentGateway = null;
12717
- console.error("Incompatible subscription gateway");
12881
+ console.error("Incompatible payment gateway");
12718
12882
  } else {
12719
12883
  this.paymentGateway = paymentGateway;
12720
12884
  }
12721
12885
  }
12722
12886
  /**
12723
- * @typedef subscriptionOptions
12724
- * @property {SUBSCRIPTION_TYPES} type
12887
+ * @typedef paymentOptions
12888
+ * @property {PAYMENT_TYPES} type
12725
12889
  * @property {string} token
12726
12890
  * @property {object} plan
12727
12891
  * @property {object} [product]
@@ -12732,6 +12896,7 @@ class Subscription {
12732
12896
  * @property {string} addressId
12733
12897
  * @property {number} invoiceId
12734
12898
  * @property {boolean} isExistingSource
12899
+ * @property {Array} items
12735
12900
  */
12736
12901
 
12737
12902
  /**
@@ -12742,8 +12907,8 @@ class Subscription {
12742
12907
  */
12743
12908
 
12744
12909
  /**
12745
- * Subscription execution method
12746
- * @param {subscriptionOptions} options subscription options
12910
+ * Payment execution method
12911
+ * @param {paymentOptions} options payment options
12747
12912
  * @param {executeCallback} callback
12748
12913
  * @return {void}
12749
12914
  */
@@ -12752,10 +12917,11 @@ class Subscription {
12752
12917
  }
12753
12918
  const PAYMENT_GATEWAYS_ENUM = {
12754
12919
  stripe: "stripe",
12755
- paypal: "braintree"
12920
+ paypal: "braintree",
12921
+ vantiv: "vantiv"
12756
12922
  };
12757
12923
  /**
12758
- * Subscription Strategies
12924
+ * Payment Strategies
12759
12925
  */
12760
12926
 
12761
12927
  /**
@@ -12772,6 +12938,8 @@ var _renewSubscription = /*#__PURE__*/new WeakMap();
12772
12938
 
12773
12939
  var _renewGiftedSubscription = /*#__PURE__*/new WeakMap();
12774
12940
 
12941
+ var _purchaseEcommerceOrder = /*#__PURE__*/new WeakMap();
12942
+
12775
12943
  var _payInvoice = /*#__PURE__*/new WeakMap();
12776
12944
 
12777
12945
  class StripeGateway {
@@ -12782,7 +12950,7 @@ class StripeGateway {
12782
12950
  });
12783
12951
 
12784
12952
  _defineProperty$3(this, "execute", (options, callback) => {
12785
- const types = SUBSCRIPTION_TYPES;
12953
+ const types = PAYMENT_TYPES;
12786
12954
 
12787
12955
  switch (options.type) {
12788
12956
  case types.CREATE_SUBSCRIPTION:
@@ -12797,11 +12965,14 @@ class StripeGateway {
12797
12965
  case types.RENEW_GIFTED_SUBSCRIPTION:
12798
12966
  return _classPrivateFieldGet(this, _renewGiftedSubscription).call(this, options, callback);
12799
12967
 
12968
+ case types.PURCHASE_ECOMMERCE_ORDER:
12969
+ return _classPrivateFieldGet(this, _purchaseEcommerceOrder).call(this, options, callback);
12970
+
12800
12971
  case types.PAY_INVOICE:
12801
12972
  return _classPrivateFieldGet(this, _payInvoice).call(this, options, callback);
12802
12973
 
12803
12974
  default:
12804
- console.error("Unsupported subscriptiion method: Stripe Gateway");
12975
+ console.error("Unsupported payment method: Stripe Gateway");
12805
12976
  }
12806
12977
  });
12807
12978
 
@@ -12823,6 +12994,7 @@ class StripeGateway {
12823
12994
  auth_token: window.Pelcro.user.read().auth_token,
12824
12995
  plan_id: plan.id,
12825
12996
  coupon_code: couponCode,
12997
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
12826
12998
  address_id: product.address_required ? addressId : null
12827
12999
  }, (err, res) => {
12828
13000
  callback(err, res);
@@ -12849,6 +13021,7 @@ class StripeGateway {
12849
13021
  auth_token: window.Pelcro.user.read().auth_token,
12850
13022
  plan_id: plan.id,
12851
13023
  coupon_code: couponCode,
13024
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
12852
13025
  gift_recipient_email: giftRecipient.email,
12853
13026
  gift_recipient_first_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.firstName,
12854
13027
  gift_recipient_last_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.lastName,
@@ -12876,6 +13049,7 @@ class StripeGateway {
12876
13049
  stripe_token: token,
12877
13050
  auth_token: window.Pelcro.user.read().auth_token,
12878
13051
  plan_id: plan.id,
13052
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
12879
13053
  coupon_code: couponCode,
12880
13054
  subscription_id: subscriptionIdToRenew,
12881
13055
  address_id: product.address_required ? addressId : null
@@ -12909,27 +13083,57 @@ class StripeGateway {
12909
13083
  }
12910
13084
  });
12911
13085
 
12912
- _payInvoice.set(this, {
13086
+ _purchaseEcommerceOrder.set(this, {
12913
13087
  writable: true,
12914
13088
  value: (options, callback) => {
12915
13089
  const {
12916
13090
  token,
12917
- invoiceId
13091
+ items,
13092
+ couponCode,
13093
+ addressId,
13094
+ isExistingSource
12918
13095
  } = options;
12919
- const params = options.isExistingSource ? {
12920
- source_id: token,
12921
- invoice_id: invoiceId
13096
+ const params = isExistingSource ? {
13097
+ source_id: token
12922
13098
  } : {
12923
13099
  payment_gateway: _classPrivateFieldGet(this, _paymentGateway),
12924
- gateway_token: token,
12925
- invoice_id: invoiceId
13100
+ gateway_token: token
12926
13101
  };
12927
- window.Pelcro.invoice.pay(params, (err, res) => {
13102
+ window.Pelcro.ecommerce.order.create({
13103
+ items,
13104
+ coupon_code: couponCode,
13105
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13106
+ ...params,
13107
+ ...(addressId && {
13108
+ address_id: addressId
13109
+ })
13110
+ }, (err, res) => {
12928
13111
  callback(err, res);
12929
13112
  });
12930
13113
  }
12931
13114
  });
12932
- }
13115
+
13116
+ _payInvoice.set(this, {
13117
+ writable: true,
13118
+ value: (options, callback) => {
13119
+ const {
13120
+ token,
13121
+ invoiceId
13122
+ } = options;
13123
+ const params = options.isExistingSource ? {
13124
+ source_id: token,
13125
+ invoice_id: invoiceId
13126
+ } : {
13127
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway),
13128
+ gateway_token: token,
13129
+ invoice_id: invoiceId
13130
+ };
13131
+ window.Pelcro.invoice.pay(params, (err, res) => {
13132
+ callback(err, res);
13133
+ });
13134
+ }
13135
+ });
13136
+ }
12933
13137
 
12934
13138
  }
12935
13139
  /**
@@ -12944,7 +13148,7 @@ var _createGiftedSubscription2 = /*#__PURE__*/new WeakMap();
12944
13148
 
12945
13149
  var _payInvoice2 = /*#__PURE__*/new WeakMap();
12946
13150
 
12947
- class PaypalGateWay {
13151
+ class PaypalGateway {
12948
13152
  constructor() {
12949
13153
  _paymentGateway2.set(this, {
12950
13154
  writable: true,
@@ -12952,7 +13156,7 @@ class PaypalGateWay {
12952
13156
  });
12953
13157
 
12954
13158
  _defineProperty$3(this, "execute", (options, callback) => {
12955
- const types = SUBSCRIPTION_TYPES;
13159
+ const types = PAYMENT_TYPES;
12956
13160
 
12957
13161
  switch (options.type) {
12958
13162
  case types.CREATE_SUBSCRIPTION:
@@ -12986,6 +13190,7 @@ class PaypalGateWay {
12986
13190
  payment_gateway: _classPrivateFieldGet(this, _paymentGateway2),
12987
13191
  auth_token: window.Pelcro.user.read().auth_token,
12988
13192
  plan_id: plan.id,
13193
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
12989
13194
  coupon_code: couponCode,
12990
13195
  address_id: product.address_required ? addressId : null
12991
13196
  }, (err, res) => {
@@ -13013,6 +13218,7 @@ class PaypalGateWay {
13013
13218
  auth_token: window.Pelcro.user.read().auth_token,
13014
13219
  plan_id: plan.id,
13015
13220
  coupon_code: couponCode,
13221
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13016
13222
  gift_recipient_email: giftRecipient.email,
13017
13223
  gift_recipient_first_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.firstName,
13018
13224
  gift_recipient_last_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.lastName,
@@ -13045,6 +13251,241 @@ class PaypalGateWay {
13045
13251
 
13046
13252
  }
13047
13253
 
13254
+ var _paymentGateway3 = /*#__PURE__*/new WeakMap();
13255
+
13256
+ var _createSubscription3 = /*#__PURE__*/new WeakMap();
13257
+
13258
+ var _renewSubscription2 = /*#__PURE__*/new WeakMap();
13259
+
13260
+ var _createGiftedSubscription3 = /*#__PURE__*/new WeakMap();
13261
+
13262
+ var _renewGiftedSubscription2 = /*#__PURE__*/new WeakMap();
13263
+
13264
+ var _purchaseEcommerceOrder2 = /*#__PURE__*/new WeakMap();
13265
+
13266
+ var _payInvoice3 = /*#__PURE__*/new WeakMap();
13267
+
13268
+ class VantivGateway {
13269
+ constructor() {
13270
+ _paymentGateway3.set(this, {
13271
+ writable: true,
13272
+ value: PAYMENT_GATEWAYS_ENUM["vantiv"]
13273
+ });
13274
+
13275
+ _defineProperty$3(this, "execute", (options, callback) => {
13276
+ const types = PAYMENT_TYPES;
13277
+
13278
+ switch (options.type) {
13279
+ case types.CREATE_SUBSCRIPTION:
13280
+ return _classPrivateFieldGet(this, _createSubscription3).call(this, options, callback);
13281
+
13282
+ case types.RENEW_SUBSCRIPTION:
13283
+ return _classPrivateFieldGet(this, _renewSubscription2).call(this, options, callback);
13284
+
13285
+ case types.CREATE_GIFTED_SUBSCRIPTION:
13286
+ return _classPrivateFieldGet(this, _createGiftedSubscription3).call(this, options, callback);
13287
+
13288
+ case types.RENEW_GIFTED_SUBSCRIPTION:
13289
+ return _classPrivateFieldGet(this, _renewGiftedSubscription2).call(this, options, callback);
13290
+
13291
+ case types.PURCHASE_ECOMMERCE_ORDER:
13292
+ return _classPrivateFieldGet(this, _purchaseEcommerceOrder2).call(this, options, callback);
13293
+
13294
+ case types.PAY_INVOICE:
13295
+ return _classPrivateFieldGet(this, _payInvoice3).call(this, options, callback);
13296
+
13297
+ default:
13298
+ console.error("Unsupported payment method: vantiv Gateway");
13299
+ }
13300
+ });
13301
+
13302
+ _createSubscription3.set(this, {
13303
+ writable: true,
13304
+ value: (options, callback) => {
13305
+ const {
13306
+ token,
13307
+ plan,
13308
+ couponCode,
13309
+ product,
13310
+ quantity = 1,
13311
+ addressId,
13312
+ isExistingSource
13313
+ } = options;
13314
+ const params = isExistingSource ? {
13315
+ source_id: token
13316
+ } : {
13317
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13318
+ gateway_token: token
13319
+ };
13320
+ window.Pelcro.subscription.create({
13321
+ quantity,
13322
+ auth_token: window.Pelcro.user.read().auth_token,
13323
+ plan_id: plan.id,
13324
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13325
+ coupon_code: couponCode,
13326
+ address_id: product.address_required ? addressId : null,
13327
+ ...params
13328
+ }, (err, res) => {
13329
+ callback(err, res);
13330
+ });
13331
+ }
13332
+ });
13333
+
13334
+ _renewSubscription2.set(this, {
13335
+ writable: true,
13336
+ value: (options, callback) => {
13337
+ const {
13338
+ subscriptionIdToRenew,
13339
+ token,
13340
+ plan,
13341
+ couponCode,
13342
+ product,
13343
+ addressId,
13344
+ isExistingSource
13345
+ } = options;
13346
+ const params = isExistingSource ? {
13347
+ source_id: token
13348
+ } : {
13349
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13350
+ gateway_token: token
13351
+ };
13352
+ window.Pelcro.subscription.renew({
13353
+ auth_token: window.Pelcro.user.read().auth_token,
13354
+ plan_id: plan.id,
13355
+ coupon_code: couponCode,
13356
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13357
+ subscription_id: subscriptionIdToRenew,
13358
+ address_id: product.address_required ? addressId : null,
13359
+ ...params
13360
+ }, (err, res) => {
13361
+ callback(err, res);
13362
+ });
13363
+ }
13364
+ });
13365
+
13366
+ _createGiftedSubscription3.set(this, {
13367
+ writable: true,
13368
+ value: (options, callback) => {
13369
+ const {
13370
+ token,
13371
+ plan,
13372
+ couponCode,
13373
+ product,
13374
+ giftRecipient,
13375
+ quantity = 1,
13376
+ addressId,
13377
+ isExistingSource
13378
+ } = options;
13379
+ const params = isExistingSource ? {
13380
+ source_id: token
13381
+ } : {
13382
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13383
+ gateway_token: token
13384
+ };
13385
+ window.Pelcro.subscription.create({
13386
+ quantity,
13387
+ auth_token: window.Pelcro.user.read().auth_token,
13388
+ plan_id: plan.id,
13389
+ coupon_code: couponCode,
13390
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13391
+ gift_recipient_email: giftRecipient.email,
13392
+ gift_recipient_first_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.firstName,
13393
+ gift_recipient_last_name: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.lastName,
13394
+ gift_start_date: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.startDate,
13395
+ gift_message: giftRecipient === null || giftRecipient === void 0 ? void 0 : giftRecipient.giftMessage,
13396
+ address_id: product.address_required ? addressId : null,
13397
+ ...params
13398
+ }, (err, res) => {
13399
+ callback(err, res);
13400
+ });
13401
+ }
13402
+ });
13403
+
13404
+ _renewGiftedSubscription2.set(this, {
13405
+ writable: true,
13406
+ value: (options, callback) => {
13407
+ const {
13408
+ subscriptionIdToRenew,
13409
+ token,
13410
+ product,
13411
+ plan,
13412
+ couponCode,
13413
+ addressId,
13414
+ isExistingSource
13415
+ } = options;
13416
+ const params = isExistingSource ? {
13417
+ source_id: token
13418
+ } : {
13419
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13420
+ gateway_token: token
13421
+ };
13422
+ window.Pelcro.subscription.renewGift({
13423
+ auth_token: window.Pelcro.user.read().auth_token,
13424
+ plan_id: plan.id,
13425
+ coupon_code: couponCode,
13426
+ subscription_id: subscriptionIdToRenew,
13427
+ address_id: product.address_required ? addressId : null,
13428
+ ...params
13429
+ }, (err, res) => {
13430
+ callback(err, res);
13431
+ });
13432
+ }
13433
+ });
13434
+
13435
+ _purchaseEcommerceOrder2.set(this, {
13436
+ writable: true,
13437
+ value: (options, callback) => {
13438
+ const {
13439
+ token,
13440
+ items,
13441
+ couponCode,
13442
+ addressId,
13443
+ isExistingSource
13444
+ } = options;
13445
+ const params = isExistingSource ? {
13446
+ source_id: token
13447
+ } : {
13448
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13449
+ gateway_token: token
13450
+ };
13451
+ window.Pelcro.ecommerce.order.create({
13452
+ items,
13453
+ coupon_code: couponCode,
13454
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13455
+ ...params,
13456
+ ...(addressId && {
13457
+ address_id: addressId
13458
+ })
13459
+ }, (err, res) => {
13460
+ callback(err, res);
13461
+ });
13462
+ }
13463
+ });
13464
+
13465
+ _payInvoice3.set(this, {
13466
+ writable: true,
13467
+ value: (options, callback) => {
13468
+ const {
13469
+ token,
13470
+ invoiceId
13471
+ } = options;
13472
+ const params = options.isExistingSource ? {
13473
+ source_id: token,
13474
+ invoice_id: invoiceId
13475
+ } : {
13476
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway3),
13477
+ gateway_token: token,
13478
+ invoice_id: invoiceId
13479
+ };
13480
+ window.Pelcro.invoice.pay(params, (err, res) => {
13481
+ callback(err, res);
13482
+ });
13483
+ }
13484
+ });
13485
+ }
13486
+
13487
+ }
13488
+
13048
13489
  /**
13049
13490
  * @typedef {Object} PaymentStateType
13050
13491
  * @property {boolean} disableSubmit
@@ -13065,7 +13506,7 @@ class PaypalGateWay {
13065
13506
 
13066
13507
  /** @type {PaymentStateType} */
13067
13508
 
13068
- const initialState$f = {
13509
+ const initialState$g = {
13069
13510
  disableSubmit: false,
13070
13511
  isLoading: false,
13071
13512
  disableCouponButton: false,
@@ -13084,10 +13525,10 @@ const initialState$f = {
13084
13525
  content: ""
13085
13526
  }
13086
13527
  };
13087
- const store$f = /*#__PURE__*/createContext(initialState$f);
13528
+ const store$g = /*#__PURE__*/createContext(initialState$g);
13088
13529
  const {
13089
- Provider: Provider$f
13090
- } = store$f;
13530
+ Provider: Provider$g
13531
+ } = store$g;
13091
13532
 
13092
13533
  const PaymentMethodContainerWithoutStripe = ({
13093
13534
  style,
@@ -13100,7 +13541,7 @@ const PaymentMethodContainerWithoutStripe = ({
13100
13541
  onFailure = () => {},
13101
13542
  ...props
13102
13543
  }) => {
13103
- var _props$product, _props$plan, _props$subscriptionId, _props$selectedAddres, _props$giftRecipient, _props$isRenewingGift, _props$invoice;
13544
+ var _props$product, _props$plan, _props$subscriptionId, _props$selectedAddres, _props$giftRecipient, _props$isGift, _props$isRenewingGift, _props$invoice;
13104
13545
 
13105
13546
  const {
13106
13547
  t
@@ -13116,6 +13557,7 @@ const PaymentMethodContainerWithoutStripe = ({
13116
13557
  const subscriptionIdToRenew = (_props$subscriptionId = props.subscriptionIdToRenew) !== null && _props$subscriptionId !== void 0 ? _props$subscriptionId : pelcroStore.subscriptionIdToRenew;
13117
13558
  const selectedAddressId = (_props$selectedAddres = props.selectedAddressId) !== null && _props$selectedAddres !== void 0 ? _props$selectedAddres : pelcroStore.selectedAddressId;
13118
13559
  const giftRecipient = (_props$giftRecipient = props.giftRecipient) !== null && _props$giftRecipient !== void 0 ? _props$giftRecipient : pelcroStore.giftRecipient;
13560
+ const isGift = (_props$isGift = props.isGift) !== null && _props$isGift !== void 0 ? _props$isGift : pelcroStore.isGift;
13119
13561
  const isRenewingGift = (_props$isRenewingGift = props.isRenewingGift) !== null && _props$isRenewingGift !== void 0 ? _props$isRenewingGift : pelcroStore.isRenewingGift;
13120
13562
  const invoice = (_props$invoice = props.invoice) !== null && _props$invoice !== void 0 ? _props$invoice : pelcroStore.invoice;
13121
13563
  useEffect(() => {
@@ -13132,6 +13574,203 @@ const PaymentMethodContainerWithoutStripe = ({
13132
13574
  updateTotalAmountWithTax();
13133
13575
  }, []);
13134
13576
 
13577
+ const submitUsingVantiv = () => {
13578
+ const isUsingExistingPaymentMethod = Boolean(selectedPaymentMethodId);
13579
+
13580
+ if (isUsingExistingPaymentMethod) {
13581
+ // no need to create a new source using vantiv
13582
+ return handleVantivPayment(null);
13583
+ }
13584
+
13585
+ if (!vantivInstanceRef.current) {
13586
+ return console.error("Vantiv sdk script wasn't loaded, you need to load vantiv sdk before rendering the vantiv payment flow");
13587
+ }
13588
+
13589
+ const orderId = `pelcro-${new Date().getTime()}`;
13590
+ /*
13591
+ calls handleVantivPayment to either handle a payment or update a source by simply creating a new source
13592
+ */
13593
+
13594
+ vantivInstanceRef.current.getPaypageRegistrationId({
13595
+ id: orderId,
13596
+ orderId: orderId
13597
+ });
13598
+ };
13599
+
13600
+ function handleVantivPayment(paymentRequest) {
13601
+ if (paymentRequest) {
13602
+ const SUCCESS_STATUS = "870";
13603
+
13604
+ if (paymentRequest.response !== SUCCESS_STATUS) {
13605
+ return handlePaymentError({
13606
+ error: new Error(paymentRequest.message)
13607
+ });
13608
+ }
13609
+ }
13610
+
13611
+ const isUsingExistingPaymentMethod = Boolean(selectedPaymentMethodId);
13612
+
13613
+ if (type === "createPayment") {
13614
+ handleVantivSubscription();
13615
+ } else if (type === "orderCreate") {
13616
+ purchase(new VantivGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest, state, dispatch);
13617
+ } else if (type === "invoicePayment") {
13618
+ payInvoice(new VantivGateway(), isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest, dispatch);
13619
+ } else if (type === "updatePaymentSource") {
13620
+ createNewVantivCard();
13621
+ }
13622
+
13623
+ function createNewVantivCard() {
13624
+ window.Pelcro.source.create({
13625
+ auth_token: window.Pelcro.user.read().auth_token,
13626
+ token: paymentRequest,
13627
+ gateway: "vantiv"
13628
+ }, (err, res) => {
13629
+ dispatch({
13630
+ type: DISABLE_SUBMIT,
13631
+ payload: false
13632
+ });
13633
+ dispatch({
13634
+ type: LOADING,
13635
+ payload: false
13636
+ });
13637
+
13638
+ if (err) {
13639
+ onFailure(err);
13640
+ return dispatch({
13641
+ type: SHOW_ALERT,
13642
+ payload: {
13643
+ type: "error",
13644
+ content: getErrorMessages(err)
13645
+ }
13646
+ });
13647
+ }
13648
+
13649
+ dispatch({
13650
+ type: SHOW_ALERT,
13651
+ payload: {
13652
+ type: "success",
13653
+ content: t("messages.sourceUpdated")
13654
+ }
13655
+ });
13656
+ onSuccess(res);
13657
+ });
13658
+ }
13659
+
13660
+ function handleVantivSubscription() {
13661
+ const payment = new Payment(new VantivGateway());
13662
+ const createSubscription = !isGift && !subscriptionIdToRenew;
13663
+ const renewSubscription = !isGift && subscriptionIdToRenew;
13664
+ const giftSubscriprition = isGift && !subscriptionIdToRenew;
13665
+ const renewGift = isRenewingGift;
13666
+ const {
13667
+ couponCode
13668
+ } = state;
13669
+
13670
+ if (renewGift) {
13671
+ return payment.execute({
13672
+ type: PAYMENT_TYPES.RENEW_GIFTED_SUBSCRIPTION,
13673
+ token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
13674
+ plan,
13675
+ couponCode,
13676
+ product,
13677
+ isExistingSource: isUsingExistingPaymentMethod,
13678
+ subscriptionIdToRenew,
13679
+ addressId: selectedAddressId
13680
+ }, (err, res) => {
13681
+ if (err) {
13682
+ return handlePaymentError(err);
13683
+ }
13684
+
13685
+ onSuccess(res);
13686
+ });
13687
+ } else if (giftSubscriprition) {
13688
+ return payment.execute({
13689
+ type: PAYMENT_TYPES.CREATE_GIFTED_SUBSCRIPTION,
13690
+ token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
13691
+ quantity: plan.quantity,
13692
+ plan,
13693
+ couponCode,
13694
+ product,
13695
+ isExistingSource: isUsingExistingPaymentMethod,
13696
+ giftRecipient,
13697
+ addressId: selectedAddressId
13698
+ }, (err, res) => {
13699
+ if (err) {
13700
+ return handlePaymentError(err);
13701
+ }
13702
+
13703
+ onSuccess(res);
13704
+ });
13705
+ } else if (renewSubscription) {
13706
+ return payment.execute({
13707
+ type: PAYMENT_TYPES.RENEW_SUBSCRIPTION,
13708
+ token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
13709
+ quantity: plan.quantity,
13710
+ plan,
13711
+ couponCode,
13712
+ product,
13713
+ isExistingSource: isUsingExistingPaymentMethod,
13714
+ subscriptionIdToRenew,
13715
+ addressId: selectedAddressId
13716
+ }, (err, res) => {
13717
+ if (err) {
13718
+ return handlePaymentError(err);
13719
+ }
13720
+
13721
+ onSuccess(res);
13722
+ });
13723
+ } else if (createSubscription) {
13724
+ return payment.execute({
13725
+ type: PAYMENT_TYPES.CREATE_SUBSCRIPTION,
13726
+ token: isUsingExistingPaymentMethod ? selectedPaymentMethodId : paymentRequest,
13727
+ quantity: plan.quantity,
13728
+ plan,
13729
+ couponCode,
13730
+ product,
13731
+ isExistingSource: isUsingExistingPaymentMethod,
13732
+ addressId: selectedAddressId
13733
+ }, (err, res) => {
13734
+ if (err) {
13735
+ return handlePaymentError(err);
13736
+ }
13737
+
13738
+ onSuccess(res);
13739
+ });
13740
+ }
13741
+ }
13742
+ }
13743
+
13744
+ const vantivInstanceRef = React__default.useRef(null);
13745
+ useEffect(() => {
13746
+ const cardProcessor = getSiteCardProcessor();
13747
+
13748
+ if (cardProcessor === "vantiv" && !selectedPaymentMethodId) {
13749
+ var _window$Pelcro$site$r, _window$Pelcro$site$r2;
13750
+
13751
+ 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;
13752
+ 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;
13753
+ vantivInstanceRef.current = new window.EprotectIframeClient({
13754
+ paypageId: payPageId,
13755
+ reportGroup: reportGroup,
13756
+ style: "pelcro",
13757
+ height: "245",
13758
+ timeout: 50000,
13759
+ div: "eProtectiframe",
13760
+ callback: handleVantivPayment,
13761
+ showCvv: true,
13762
+ numYears: 8,
13763
+ placeholderText: {
13764
+ cvv: "CVV",
13765
+ accountNumber: "1234 1234 1234 1234"
13766
+ },
13767
+ enhancedUxFeatures: {
13768
+ inlineFieldValidations: true
13769
+ }
13770
+ });
13771
+ }
13772
+ }, [selectedPaymentMethodId]);
13773
+
13135
13774
  const initPaymentRequest = (state, dispatch) => {
13136
13775
  try {
13137
13776
  const paymentRequest = stripe.paymentRequest({
@@ -13202,9 +13841,9 @@ const PaymentMethodContainerWithoutStripe = ({
13202
13841
 
13203
13842
 
13204
13843
  const updateTotalAmountWithTax = () => {
13205
- var _window$Pelcro$site$r;
13844
+ var _window$Pelcro$site$r3;
13206
13845
 
13207
- const taxesEnabled = (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.taxes_enabled;
13846
+ 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;
13208
13847
 
13209
13848
  if (taxesEnabled && type === "createPayment") {
13210
13849
  dispatch({
@@ -13361,6 +14000,7 @@ const PaymentMethodContainerWithoutStripe = ({
13361
14000
  window.Pelcro.order.create({
13362
14001
  auth_token: window.Pelcro.user.read().auth_token,
13363
14002
  plan_id: plan.id,
14003
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13364
14004
  coupon_code: couponCode,
13365
14005
  address_id: selectedAddressId
13366
14006
  }, handleCouponResponse);
@@ -13442,6 +14082,7 @@ const PaymentMethodContainerWithoutStripe = ({
13442
14082
  stripe_token: !stripeSource.isExistingSource ? stripeSource.id : undefined,
13443
14083
  auth_token: window.Pelcro.user.read().auth_token,
13444
14084
  plan_id: plan.id,
14085
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13445
14086
  quantity: plan.quantity,
13446
14087
  coupon_code: couponCode,
13447
14088
  gift_recipient_email: giftRecipient ? giftRecipient.email : null,
@@ -13513,6 +14154,7 @@ const PaymentMethodContainerWithoutStripe = ({
13513
14154
  stripe_token: !stripeSource.isExistingSource ? stripeSource.id : undefined,
13514
14155
  auth_token: window.Pelcro.user.read().auth_token,
13515
14156
  plan_id: plan.id,
14157
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13516
14158
  coupon_code: couponCode,
13517
14159
  subscription_id: subscriptionIdToRenew,
13518
14160
  address_id: product.address_required ? selectedAddressId : null
@@ -13554,7 +14196,7 @@ const PaymentMethodContainerWithoutStripe = ({
13554
14196
 
13555
14197
 
13556
14198
  const handlePaypalSubscription = (state, paypalNonce) => {
13557
- const subscription = new Subscription(new PaypalGateWay());
14199
+ const payment = new Payment(new PaypalGateway());
13558
14200
  const {
13559
14201
  couponCode
13560
14202
  } = state;
@@ -13563,8 +14205,8 @@ const PaymentMethodContainerWithoutStripe = ({
13563
14205
  */
13564
14206
 
13565
14207
  if (giftRecipient) {
13566
- return subscription.execute({
13567
- type: SUBSCRIPTION_TYPES.CREATE_GIFTED_SUBSCRIPTION,
14208
+ return payment.execute({
14209
+ type: PAYMENT_TYPES.CREATE_GIFTED_SUBSCRIPTION,
13568
14210
  token: paypalNonce,
13569
14211
  quantity: plan.quantity,
13570
14212
  plan,
@@ -13597,8 +14239,8 @@ const PaymentMethodContainerWithoutStripe = ({
13597
14239
  });
13598
14240
  }
13599
14241
 
13600
- return subscription.execute({
13601
- type: SUBSCRIPTION_TYPES.CREATE_SUBSCRIPTION,
14242
+ return payment.execute({
14243
+ type: PAYMENT_TYPES.CREATE_SUBSCRIPTION,
13602
14244
  token: paypalNonce,
13603
14245
  quantity: plan.quantity,
13604
14246
  plan,
@@ -13630,7 +14272,7 @@ const PaymentMethodContainerWithoutStripe = ({
13630
14272
  });
13631
14273
  };
13632
14274
 
13633
- const purchase = (stripeSource, state, dispatch) => {
14275
+ const purchase = (gatewayService, gatewayToken, state, dispatch) => {
13634
14276
  const isQuickPurchase = !Array.isArray(order);
13635
14277
  const mappedOrderItems = isQuickPurchase ? [{
13636
14278
  sku_id: order.id,
@@ -13642,14 +14284,14 @@ const PaymentMethodContainerWithoutStripe = ({
13642
14284
  const {
13643
14285
  couponCode
13644
14286
  } = state;
13645
- window.Pelcro.ecommerce.order.create({
13646
- source_id: stripeSource.isExistingSource ? stripeSource.id : undefined,
13647
- stripe_token: !stripeSource.isExistingSource ? stripeSource.id : undefined,
14287
+ const payment = new Payment(gatewayService);
14288
+ payment.execute({
14289
+ type: PAYMENT_TYPES.PURCHASE_ECOMMERCE_ORDER,
14290
+ token: gatewayToken,
14291
+ isExistingSource: Boolean(selectedPaymentMethodId),
13648
14292
  items: mappedOrderItems,
13649
- coupon_code: couponCode,
13650
- ...(selectedAddressId && {
13651
- address_id: selectedAddressId
13652
- })
14293
+ addressId: selectedAddressId,
14294
+ couponCode
13653
14295
  }, (err, res) => {
13654
14296
  dispatch({
13655
14297
  type: DISABLE_SUBMIT,
@@ -13687,9 +14329,9 @@ const PaymentMethodContainerWithoutStripe = ({
13687
14329
  };
13688
14330
 
13689
14331
  const payInvoice = (gatewayService, gatewayToken, dispatch) => {
13690
- const subscription = new Subscription(gatewayService);
13691
- return subscription.execute({
13692
- type: SUBSCRIPTION_TYPES.PAY_INVOICE,
14332
+ const payment = new Payment(gatewayService);
14333
+ return payment.execute({
14334
+ type: PAYMENT_TYPES.PAY_INVOICE,
13693
14335
  token: gatewayToken,
13694
14336
  isExistingSource: Boolean(selectedPaymentMethodId),
13695
14337
  invoiceId: invoice.id
@@ -13734,7 +14376,9 @@ const PaymentMethodContainerWithoutStripe = ({
13734
14376
 
13735
14377
  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") {
13736
14378
  return handlePaymentError({
13737
- message: t("messages.cardAuthNotSupported")
14379
+ error: {
14380
+ message: t("messages.cardAuthNotSupported")
14381
+ }
13738
14382
  });
13739
14383
  }
13740
14384
 
@@ -13849,13 +14493,13 @@ const PaymentMethodContainerWithoutStripe = ({
13849
14493
 
13850
14494
 
13851
14495
  const resolveTaxCalculation = () => {
13852
- var _window$Pelcro$site$r2;
14496
+ var _window$Pelcro$site$r4;
13853
14497
 
13854
14498
  if (type === "invoicePayment") {
13855
14499
  return new Promise(resolve => resolve());
13856
14500
  }
13857
14501
 
13858
- 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;
14502
+ 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;
13859
14503
  return new Promise((resolve, reject) => {
13860
14504
  // resolve early if taxes isn't enabled
13861
14505
  if (!taxesEnabled) {
@@ -13865,6 +14509,7 @@ const PaymentMethodContainerWithoutStripe = ({
13865
14509
  window.Pelcro.order.create({
13866
14510
  auth_token: window.Pelcro.user.read().auth_token,
13867
14511
  plan_id: plan.id,
14512
+ campaign_key: window.Pelcro.helpers.getURLParameter("campaign_key"),
13868
14513
  coupon_code: state === null || state === void 0 ? void 0 : state.couponCode,
13869
14514
  address_id: selectedAddressId
13870
14515
  }, (error, res) => {
@@ -13927,13 +14572,15 @@ const PaymentMethodContainerWithoutStripe = ({
13927
14572
  if (stripeSource && type === "createPayment") {
13928
14573
  subscribe(stripeSource, state, dispatch);
13929
14574
  } else if (stripeSource && type === "orderCreate") {
13930
- purchase(stripeSource, state, dispatch);
14575
+ purchase(new StripeGateway(), stripeSource.id, state, dispatch);
13931
14576
  } else if (stripeSource && type === "invoicePayment") {
13932
14577
  payInvoice(new StripeGateway(), stripeSource.id, dispatch);
13933
14578
  }
13934
14579
  };
13935
14580
 
13936
14581
  const handlePaymentError = error => {
14582
+ var _getErrorMessages;
14583
+
13937
14584
  if (error.type === "validation_error" && // Subscription creation & renewal
13938
14585
  type === "createPayment") {
13939
14586
  var _state$couponObject;
@@ -13952,7 +14599,7 @@ const PaymentMethodContainerWithoutStripe = ({
13952
14599
  type: SHOW_ALERT,
13953
14600
  payload: {
13954
14601
  type: "error",
13955
- content: error === null || error === void 0 ? void 0 : error.message
14602
+ content: (_getErrorMessages = getErrorMessages(error)) !== null && _getErrorMessages !== void 0 ? _getErrorMessages : error === null || error === void 0 ? void 0 : error.message
13956
14603
  }
13957
14604
  });
13958
14605
  dispatch({
@@ -13976,7 +14623,9 @@ const PaymentMethodContainerWithoutStripe = ({
13976
14623
 
13977
14624
  if ((source === null || source === void 0 ? void 0 : source.status) === "failed") {
13978
14625
  return handlePaymentError({
13979
- message: t("messages.cardAuthFailed")
14626
+ error: {
14627
+ message: t("messages.cardAuthFailed")
14628
+ }
13980
14629
  });
13981
14630
  }
13982
14631
 
@@ -14047,6 +14696,10 @@ const PaymentMethodContainerWithoutStripe = ({
14047
14696
  disableSubmit: true,
14048
14697
  isLoading: true
14049
14698
  }, (state, dispatch) => {
14699
+ if (getSiteCardProcessor() === "vantiv") {
14700
+ return submitUsingVantiv();
14701
+ }
14702
+
14050
14703
  if (selectedPaymentMethodId) {
14051
14704
  // pay with selected method (source) if exists already
14052
14705
  return handlePayment({
@@ -14056,16 +14709,16 @@ const PaymentMethodContainerWithoutStripe = ({
14056
14709
  }
14057
14710
 
14058
14711
  if (type === "updatePaymentSource") {
14059
- updatePaymentSource(state, dispatch);
14060
- } else {
14061
- submitPayment(state);
14712
+ return updatePaymentSource(state, dispatch);
14062
14713
  }
14714
+
14715
+ submitPayment(state);
14063
14716
  });
14064
14717
 
14065
14718
  case HANDLE_PAYPAL_SUBSCRIPTION:
14066
14719
  return lib_5(state, (state, dispatch) => {
14067
14720
  if (type === "invoicePayment") {
14068
- payInvoice(new PaypalGateWay(), action.payload, dispatch);
14721
+ payInvoice(new PaypalGateway(), action.payload, dispatch);
14069
14722
  } else {
14070
14723
  handlePaypalSubscription(state, action.payload);
14071
14724
  }
@@ -14127,21 +14780,21 @@ const PaymentMethodContainerWithoutStripe = ({
14127
14780
  default:
14128
14781
  return state;
14129
14782
  }
14130
- }, initialState$f);
14783
+ }, initialState$g);
14131
14784
  return /*#__PURE__*/React__default.createElement("div", {
14132
14785
  style: { ...style
14133
14786
  },
14134
14787
  className: `pelcro-container pelcro-payment-container ${className}`
14135
- }, /*#__PURE__*/React__default.createElement(Provider$f, {
14788
+ }, /*#__PURE__*/React__default.createElement(Provider$g, {
14136
14789
  value: {
14137
14790
  state,
14138
14791
  dispatch
14139
14792
  }
14140
14793
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
14141
- store: store$f,
14794
+ store: store$g,
14142
14795
  key: i
14143
14796
  })) : /*#__PURE__*/React__default.cloneElement(children, {
14144
- store: store$f
14797
+ store: store$g
14145
14798
  })));
14146
14799
  };
14147
14800
 
@@ -14163,7 +14816,7 @@ const PaymentMethodContainer = props => {
14163
14816
  stripeAccount: window.Pelcro.site.read().account_id,
14164
14817
  locale: getPageOrDefaultLanguage()
14165
14818
  }, /*#__PURE__*/React__default.createElement(es_11, null, /*#__PURE__*/React__default.createElement(UnwrappedForm, Object.assign({
14166
- store: store$f
14819
+ store: store$g
14167
14820
  }, props))));
14168
14821
  }
14169
14822
 
@@ -14216,7 +14869,7 @@ const PelcroPaymentRequestButton = props => {
14216
14869
  currentPlan,
14217
14870
  updatedPrice
14218
14871
  }
14219
- } = useContext(store$f);
14872
+ } = useContext(store$g);
14220
14873
 
14221
14874
  const updatePaymentRequest = () => {
14222
14875
  // Make sure payment request is up to date, eg. user added a coupon code.
@@ -14248,19 +14901,35 @@ const CheckoutForm = () => {
14248
14901
  const {
14249
14902
  selectedPaymentMethodId
14250
14903
  } = usePelcro();
14251
- return !selectedPaymentMethodId && /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(PelcroCardNumber, {
14252
- autoFocus: true
14253
- }), /*#__PURE__*/React__default.createElement("img", {
14254
- alt: "credit_cards",
14255
- className: "plc-h-4 plc-w-auto plc-mt-2",
14256
- src: "https://js.pelcro.com/ui/plugin/main/images/credit_cards.png"
14257
- }), /*#__PURE__*/React__default.createElement("div", {
14258
- className: "plc-flex plc-justify-between plc-my-2 plc-items-end"
14259
- }, /*#__PURE__*/React__default.createElement("div", {
14260
- className: "plc-w-6/12 plc-pr-4"
14261
- }, /*#__PURE__*/React__default.createElement(PelcroCardExpiry, null)), /*#__PURE__*/React__default.createElement("div", {
14262
- className: "plc-w-6/12 plc-pl-4"
14263
- }, /*#__PURE__*/React__default.createElement(PelcroCardCVC, null))));
14904
+ const cardProcessor = getSiteCardProcessor();
14905
+
14906
+ if (selectedPaymentMethodId) {
14907
+ return null;
14908
+ }
14909
+
14910
+ if (cardProcessor === "vantiv") {
14911
+ return /*#__PURE__*/React__default.createElement("div", {
14912
+ id: "eProtectiframe"
14913
+ });
14914
+ }
14915
+
14916
+ if (cardProcessor === "stripe") {
14917
+ return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(PelcroCardNumber, {
14918
+ autoFocus: true
14919
+ }), /*#__PURE__*/React__default.createElement("img", {
14920
+ alt: "credit_cards",
14921
+ className: "plc-w-auto plc-h-4 plc-mt-2",
14922
+ src: "https://js.pelcro.com/ui/plugin/main/images/credit_cards.png"
14923
+ }), /*#__PURE__*/React__default.createElement("div", {
14924
+ className: "plc-flex plc-items-end plc-justify-between plc-my-2"
14925
+ }, /*#__PURE__*/React__default.createElement("div", {
14926
+ className: "plc-w-6/12 plc-pr-4"
14927
+ }, /*#__PURE__*/React__default.createElement(PelcroCardExpiry, null)), /*#__PURE__*/React__default.createElement("div", {
14928
+ className: "plc-w-6/12 plc-pl-4"
14929
+ }, /*#__PURE__*/React__default.createElement(PelcroCardCVC, null))));
14930
+ }
14931
+
14932
+ return null;
14264
14933
  };
14265
14934
 
14266
14935
  const DiscountedPrice = props => {
@@ -14276,7 +14945,7 @@ const DiscountedPrice = props => {
14276
14945
  taxAmount,
14277
14946
  percentOff
14278
14947
  }
14279
- } = useContext(store$f);
14948
+ } = useContext(store$g);
14280
14949
  const {
14281
14950
  order,
14282
14951
  plan
@@ -14326,7 +14995,7 @@ const SubmitPaymentMethod = ({
14326
14995
  isLoading,
14327
14996
  updatedPrice
14328
14997
  }
14329
- } = useContext(store$f);
14998
+ } = useContext(store$g);
14330
14999
  const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
14331
15000
  const price = updatedPrice !== null && updatedPrice !== void 0 ? updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount;
14332
15001
  const priceFormatted = getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
@@ -14347,17 +15016,17 @@ const SubmitPaymentMethod = ({
14347
15016
  }, t("labels.pay"), " ", priceFormatted && priceFormatted) : t("labels.submit"));
14348
15017
  };
14349
15018
 
14350
- var _path$l;
15019
+ var _path$n;
14351
15020
 
14352
- 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); }
15021
+ 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); }
14353
15022
 
14354
15023
  function SvgArrowLeft(props) {
14355
- return /*#__PURE__*/React.createElement("svg", _extends$n({
15024
+ return /*#__PURE__*/React.createElement("svg", _extends$p({
14356
15025
  xmlns: "http://www.w3.org/2000/svg",
14357
15026
  fill: "none",
14358
15027
  viewBox: "0 0 24 24",
14359
15028
  stroke: "currentColor"
14360
- }, props), _path$l || (_path$l = /*#__PURE__*/React.createElement("path", {
15029
+ }, props), _path$n || (_path$n = /*#__PURE__*/React.createElement("path", {
14361
15030
  strokeLinecap: "round",
14362
15031
  strokeLinejoin: "round",
14363
15032
  strokeWidth: 2,
@@ -14376,7 +15045,7 @@ const ApplyCouponButton = ({
14376
15045
  disableCouponButton
14377
15046
  },
14378
15047
  dispatch
14379
- } = useContext(store$f);
15048
+ } = useContext(store$g);
14380
15049
  const {
14381
15050
  t
14382
15051
  } = useTranslation("checkoutForm");
@@ -14410,7 +15079,7 @@ const CouponCodeField = props => {
14410
15079
  couponCode,
14411
15080
  couponError
14412
15081
  }
14413
- } = useContext(store$f);
15082
+ } = useContext(store$g);
14414
15083
 
14415
15084
  const onCouponCodeChange = e => {
14416
15085
  dispatch({
@@ -14439,17 +15108,17 @@ const CouponCodeField = props => {
14439
15108
  }, props));
14440
15109
  };
14441
15110
 
14442
- var _path$k;
15111
+ var _path$m;
14443
15112
 
14444
- 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); }
15113
+ 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); }
14445
15114
 
14446
15115
  function SvgTicket(props) {
14447
- return /*#__PURE__*/React.createElement("svg", _extends$m({
15116
+ return /*#__PURE__*/React.createElement("svg", _extends$o({
14448
15117
  xmlns: "http://www.w3.org/2000/svg",
14449
15118
  fill: "none",
14450
15119
  viewBox: "0 0 24 24",
14451
15120
  stroke: "currentColor"
14452
- }, props), _path$k || (_path$k = /*#__PURE__*/React.createElement("path", {
15121
+ }, props), _path$m || (_path$m = /*#__PURE__*/React.createElement("path", {
14453
15122
  strokeLinecap: "round",
14454
15123
  strokeLinejoin: "round",
14455
15124
  strokeWidth: 2,
@@ -14466,7 +15135,7 @@ const CouponCode = ({
14466
15135
  state: {
14467
15136
  enableCouponField
14468
15137
  }
14469
- } = useContext(store$f);
15138
+ } = useContext(store$g);
14470
15139
  const {
14471
15140
  t
14472
15141
  } = useTranslation("checkoutForm");
@@ -14723,7 +15392,7 @@ const PaypalSubscribeButton = props => {
14723
15392
  const {
14724
15393
  dispatch,
14725
15394
  state
14726
- } = useContext(store$f);
15395
+ } = useContext(store$g);
14727
15396
  const {
14728
15397
  product,
14729
15398
  plan,
@@ -14738,7 +15407,7 @@ const PaypalSubscribeButton = props => {
14738
15407
  const selectedAddress = getAddressById((_props$selectedAddres = props.selectedAddressId) !== null && _props$selectedAddres !== void 0 ? _props$selectedAddres : selectedAddressId); // initialize paypal client, then render paypal button.
14739
15408
 
14740
15409
  const initializePaypal = async () => {
14741
- var _props$buttonElementI, _props$product$addres, _props$product, _props$plan2;
15410
+ var _props$buttonElementI, _props$product$addres, _props$product;
14742
15411
 
14743
15412
  const paypalCheckoutInstance = new PaypalClient({
14744
15413
  buttonElementID: (_props$buttonElementI = props.buttonElementID) !== null && _props$buttonElementI !== void 0 ? _props$buttonElementI : "pelcro-paypal-button",
@@ -14748,12 +15417,33 @@ const PaypalSubscribeButton = props => {
14748
15417
  displayName: props.merchantDisplayName,
14749
15418
  locale: props.locale,
14750
15419
  billingAgreementDescription: props.billingDescription
14751
- }); // Await building paypal instance
15420
+ });
15421
+
15422
+ const getProduct = () => {
15423
+ if (invoice) {
15424
+ invoice.plan = null;
15425
+
15426
+ if (invoice.plan) {
15427
+ return invoice.plan;
15428
+ } else {
15429
+ // standalone invoices dont have a plan
15430
+ return {
15431
+ currency: invoice.currency,
15432
+ nickname: `invoice #${invoice.id}`
15433
+ };
15434
+ }
15435
+ } else if (props.plan) {
15436
+ return props.plan;
15437
+ } else {
15438
+ return plan;
15439
+ }
15440
+ }; // Await building paypal instance
15441
+
14752
15442
 
14753
15443
  await paypalCheckoutInstance.build(); // Create paypal payment
14754
15444
 
14755
15445
  paypalCheckoutInstance.createPayment({
14756
- product: invoice ? invoice.plan : (_props$plan2 = props.plan) !== null && _props$plan2 !== void 0 ? _props$plan2 : plan,
15446
+ product: getProduct(),
14757
15447
  amount: updatedPrice,
14758
15448
  address: invoice ? null : selectedAddress,
14759
15449
  onButtonClick: () => {
@@ -14809,16 +15499,16 @@ const BankRedirection = () => {
14809
15499
  }));
14810
15500
  };
14811
15501
 
14812
- var _path$j;
15502
+ var _path$l;
14813
15503
 
14814
- 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); }
15504
+ 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); }
14815
15505
 
14816
15506
  function SvgLock(props) {
14817
- return /*#__PURE__*/React.createElement("svg", _extends$l({
15507
+ return /*#__PURE__*/React.createElement("svg", _extends$n({
14818
15508
  xmlns: "http://www.w3.org/2000/svg",
14819
15509
  viewBox: "0 0 20 20",
14820
15510
  fill: "currentColor"
14821
- }, props), _path$j || (_path$j = /*#__PURE__*/React.createElement("path", {
15511
+ }, props), _path$l || (_path$l = /*#__PURE__*/React.createElement("path", {
14822
15512
  fillRule: "evenodd",
14823
15513
  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",
14824
15514
  clipRule: "evenodd"
@@ -14835,7 +15525,7 @@ const SelectedPaymentMethod = () => {
14835
15525
  state: {
14836
15526
  isLoading
14837
15527
  }
14838
- } = useContext(store$f);
15528
+ } = useContext(store$g);
14839
15529
  const {
14840
15530
  switchView,
14841
15531
  selectedPaymentMethodId
@@ -14877,7 +15567,7 @@ const TaxAmount = () => {
14877
15567
  state: {
14878
15568
  taxAmount
14879
15569
  }
14880
- } = useContext(store$f);
15570
+ } = useContext(store$g);
14881
15571
  const {
14882
15572
  plan
14883
15573
  } = usePelcro();
@@ -14910,9 +15600,10 @@ function PaymentMethodView({
14910
15600
  const {
14911
15601
  t
14912
15602
  } = useTranslation("checkoutForm");
15603
+ const cardProcessor = getSiteCardProcessor();
14913
15604
  return /*#__PURE__*/React__default.createElement("div", {
14914
15605
  className: "plc-flex plc-flex-col plc-items-center plc-mt-4 sm:plc-px-8 pelcro-payment-block"
14915
- }, /*#__PURE__*/React__default.createElement("div", {
15606
+ }, cardProcessor === "stripe" && /*#__PURE__*/React__default.createElement("div", {
14916
15607
  className: "plc-flex plc-items-center plc-w-full plc-px-4 plc-py-2 plc-text-center plc-text-green-600 plc-border plc-border-green-400 plc-rounded plc-bg-green-50"
14917
15608
  }, /*#__PURE__*/React__default.createElement(SvgLock, {
14918
15609
  className: "plc-w-5 plc-h-5 plc-mr-1"
@@ -15040,12 +15731,12 @@ function SubscriptionRenewModal({
15040
15731
  }
15041
15732
  SubscriptionRenewModal.viewId = "subscription-renew";
15042
15733
 
15043
- var _path$i;
15734
+ var _path$k;
15044
15735
 
15045
- 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); }
15736
+ 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); }
15046
15737
 
15047
15738
  function SvgGift(props) {
15048
- return /*#__PURE__*/React.createElement("svg", _extends$k({
15739
+ return /*#__PURE__*/React.createElement("svg", _extends$m({
15049
15740
  className: "plc-w-6 plc-h-6 plc-mr-2",
15050
15741
  fill: "none",
15051
15742
  stroke: "currentColor",
@@ -15054,7 +15745,7 @@ function SvgGift(props) {
15054
15745
  strokeWidth: 2,
15055
15746
  viewBox: "0 0 24 24",
15056
15747
  xmlns: "http://www.w3.org/2000/svg"
15057
- }, props), _path$i || (_path$i = /*#__PURE__*/React.createElement("path", {
15748
+ }, props), _path$k || (_path$k = /*#__PURE__*/React.createElement("path", {
15058
15749
  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"
15059
15750
  })));
15060
15751
  }
@@ -15395,7 +16086,7 @@ class DefaultNewsLetter extends Component {
15395
16086
 
15396
16087
  const NewsLetter = withTranslation("newsletter")(DefaultNewsLetter);
15397
16088
 
15398
- const initialState$e = {
16089
+ const initialState$f = {
15399
16090
  didSubToNewslettersBefore: false,
15400
16091
  newsletters: [],
15401
16092
  isListLoading: true,
@@ -15405,10 +16096,10 @@ const initialState$e = {
15405
16096
  content: ""
15406
16097
  }
15407
16098
  };
15408
- const store$e = /*#__PURE__*/createContext(initialState$e);
16099
+ const store$f = /*#__PURE__*/createContext(initialState$f);
15409
16100
  const {
15410
- Provider: Provider$e
15411
- } = store$e;
16101
+ Provider: Provider$f
16102
+ } = store$f;
15412
16103
 
15413
16104
  const NewsletterUpdateContainer = ({
15414
16105
  style,
@@ -15521,7 +16212,7 @@ const NewsletterUpdateContainer = ({
15521
16212
  default:
15522
16213
  return state;
15523
16214
  }
15524
- }, initialState$e);
16215
+ }, initialState$f);
15525
16216
  useEffect(() => {
15526
16217
  const getUserNewsletters = () => {
15527
16218
  var _window$Pelcro$user$r3, _window$Pelcro$user$r4;
@@ -15565,7 +16256,7 @@ const NewsletterUpdateContainer = ({
15565
16256
  style: { ...style
15566
16257
  },
15567
16258
  className: `pelcro-container pelcro-newsletter-update-container ${className}`
15568
- }, /*#__PURE__*/React__default.createElement(Provider$e, {
16259
+ }, /*#__PURE__*/React__default.createElement(Provider$f, {
15569
16260
  value: {
15570
16261
  state,
15571
16262
  dispatch
@@ -15573,12 +16264,12 @@ const NewsletterUpdateContainer = ({
15573
16264
  }, children.length ? children.map((child, i) => {
15574
16265
  if (child) {
15575
16266
  return /*#__PURE__*/React__default.cloneElement(child, {
15576
- store: store$e,
16267
+ store: store$f,
15577
16268
  key: i
15578
16269
  });
15579
16270
  }
15580
16271
  }) : /*#__PURE__*/React__default.cloneElement(children, {
15581
- store: store$e
16272
+ store: store$f
15582
16273
  })));
15583
16274
  };
15584
16275
 
@@ -15593,7 +16284,7 @@ const NewsletterUpdateButton = ({
15593
16284
  isSubmitting,
15594
16285
  isListLoading
15595
16286
  }
15596
- } = useContext(store$e);
16287
+ } = useContext(store$f);
15597
16288
  const {
15598
16289
  t
15599
16290
  } = useTranslation("newsletter");
@@ -15623,7 +16314,7 @@ const NewsletterUpdateList = () => {
15623
16314
  newsletters,
15624
16315
  isListLoading
15625
16316
  }
15626
- } = useContext(store$e);
16317
+ } = useContext(store$f);
15627
16318
 
15628
16319
  if (isListLoading) {
15629
16320
  return /*#__PURE__*/React__default.createElement(Loader, {
@@ -15827,7 +16518,7 @@ function SubscriptionCreateModal({
15827
16518
  SubscriptionCreateModal.viewId = "subscription-create";
15828
16519
 
15829
16520
  var _window$Pelcro$user$r, _window$Pelcro$user$r2, _window$Pelcro$user$r3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
15830
- const initialState$d = {
16521
+ const initialState$e = {
15831
16522
  email: (_window$Pelcro$user$r = window.Pelcro.user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.email,
15832
16523
  firstName: (_window$Pelcro$user$r2 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.first_name,
15833
16524
  lastName: (_window$Pelcro$user$r3 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r3 === void 0 ? void 0 : _window$Pelcro$user$r3.last_name,
@@ -15840,10 +16531,10 @@ const initialState$d = {
15840
16531
  content: ""
15841
16532
  }
15842
16533
  };
15843
- const store$d = /*#__PURE__*/createContext(initialState$d);
16534
+ const store$e = /*#__PURE__*/createContext(initialState$e);
15844
16535
  const {
15845
- Provider: Provider$d
15846
- } = store$d;
16536
+ Provider: Provider$e
16537
+ } = store$e;
15847
16538
 
15848
16539
  const UserUpdateContainer = ({
15849
16540
  style,
@@ -15975,27 +16666,27 @@ const UserUpdateContainer = ({
15975
16666
  default:
15976
16667
  return state;
15977
16668
  }
15978
- }, initialState$d);
16669
+ }, initialState$e);
15979
16670
  return /*#__PURE__*/React__default.createElement("div", {
15980
16671
  style: { ...style
15981
16672
  },
15982
16673
  className: `pelcro-container pelcro-user-update-container ${className}`
15983
- }, /*#__PURE__*/React__default.createElement(Provider$d, {
16674
+ }, /*#__PURE__*/React__default.createElement(Provider$e, {
15984
16675
  value: {
15985
16676
  state,
15986
16677
  dispatch
15987
16678
  }
15988
16679
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
15989
- store: store$d,
16680
+ store: store$e,
15990
16681
  key: i
15991
16682
  })) : /*#__PURE__*/React__default.cloneElement(children, {
15992
- store: store$d
16683
+ store: store$e
15993
16684
  })));
15994
16685
  };
15995
16686
 
15996
16687
  const UserUpdateEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
15997
16688
  disabled: true,
15998
- store: store$d
16689
+ store: store$e
15999
16690
  }, props));
16000
16691
 
16001
16692
  const UserUpdateButton = ({
@@ -16008,7 +16699,7 @@ const UserUpdateButton = ({
16008
16699
  buttonDisabled
16009
16700
  },
16010
16701
  dispatch
16011
- } = useContext(store$d);
16702
+ } = useContext(store$e);
16012
16703
  const {
16013
16704
  t
16014
16705
  } = useTranslation("userEdit");
@@ -16025,11 +16716,11 @@ const UserUpdateButton = ({
16025
16716
  };
16026
16717
 
16027
16718
  const UserUpdateFirstName = props => /*#__PURE__*/React__default.createElement(FirstName, Object.assign({
16028
- store: store$d
16719
+ store: store$e
16029
16720
  }, props));
16030
16721
 
16031
16722
  const UserUpdateLastName = props => /*#__PURE__*/React__default.createElement(LastName, Object.assign({
16032
- store: store$d
16723
+ store: store$e
16033
16724
  }, props));
16034
16725
 
16035
16726
  function Phone({
@@ -16058,22 +16749,22 @@ function Phone({
16058
16749
  }
16059
16750
 
16060
16751
  const UserUpdatePhone = props => /*#__PURE__*/React__default.createElement(Phone, Object.assign({
16061
- store: store$d
16752
+ store: store$e
16062
16753
  }, props));
16063
16754
 
16064
16755
  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";
16065
16756
 
16066
- var _path$h;
16757
+ var _path$j;
16067
16758
 
16068
- 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); }
16759
+ 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); }
16069
16760
 
16070
16761
  function SvgEdit(props) {
16071
- return /*#__PURE__*/React.createElement("svg", _extends$j({
16762
+ return /*#__PURE__*/React.createElement("svg", _extends$l({
16072
16763
  className: "plc-w-6 plc-h-6",
16073
16764
  xmlns: "http://www.w3.org/2000/svg",
16074
16765
  viewBox: "0 0 20 20",
16075
16766
  fill: "currentColor"
16076
- }, props), _path$h || (_path$h = /*#__PURE__*/React.createElement("path", {
16767
+ }, props), _path$j || (_path$j = /*#__PURE__*/React.createElement("path", {
16077
16768
  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"
16078
16769
  })));
16079
16770
  }
@@ -16205,16 +16896,16 @@ function DisplayName({
16205
16896
  }
16206
16897
 
16207
16898
  const UserUpdateDisplayName = props => /*#__PURE__*/React__default.createElement(DisplayName, Object.assign({
16208
- store: store$d
16899
+ store: store$e
16209
16900
  }, props));
16210
16901
 
16211
16902
  const UserUpdateTextInput = props => {
16212
16903
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({}, props, {
16213
- store: store$d
16904
+ store: store$e
16214
16905
  }));
16215
16906
  };
16216
16907
 
16217
- const initialState$c = {
16908
+ const initialState$d = {
16218
16909
  isSubmitting: false,
16219
16910
  firstName: "",
16220
16911
  firstNameError: "",
@@ -16239,10 +16930,10 @@ const initialState$c = {
16239
16930
  content: ""
16240
16931
  }
16241
16932
  };
16242
- const store$c = /*#__PURE__*/createContext(initialState$c);
16933
+ const store$d = /*#__PURE__*/createContext(initialState$d);
16243
16934
  const {
16244
- Provider: Provider$c
16245
- } = store$c;
16935
+ Provider: Provider$d
16936
+ } = store$d;
16246
16937
 
16247
16938
  const getNewlyCreatedAddress = addresses => addresses[addresses.length - 1];
16248
16939
 
@@ -16449,7 +17140,7 @@ const AddressCreateContainer = ({
16449
17140
  default:
16450
17141
  return state;
16451
17142
  }
16452
- }, initialState$c);
17143
+ }, initialState$d);
16453
17144
  useEffect(() => {
16454
17145
  const getStates = () => {
16455
17146
  dispatch({
@@ -16481,16 +17172,16 @@ const AddressCreateContainer = ({
16481
17172
  style: { ...style
16482
17173
  },
16483
17174
  className: `pelcro-container pelcro-address-create-container ${className}`
16484
- }, /*#__PURE__*/React__default.createElement(Provider$c, {
17175
+ }, /*#__PURE__*/React__default.createElement(Provider$d, {
16485
17176
  value: {
16486
17177
  state,
16487
17178
  dispatch
16488
17179
  }
16489
17180
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
16490
- store: store$c,
17181
+ store: store$d,
16491
17182
  key: i
16492
17183
  })) : /*#__PURE__*/React__default.cloneElement(children, {
16493
- store: store$c
17184
+ store: store$d
16494
17185
  })));
16495
17186
  };
16496
17187
 
@@ -16501,7 +17192,7 @@ function AddressCreateFirstName(props) {
16501
17192
  firstName,
16502
17193
  firstNameError
16503
17194
  }
16504
- } = useContext(store$c);
17195
+ } = useContext(store$d);
16505
17196
 
16506
17197
  const handleBlur = () => {
16507
17198
  return dispatch({
@@ -16544,7 +17235,7 @@ function AddressCreateLastName(props) {
16544
17235
  lastName,
16545
17236
  lastNameError
16546
17237
  }
16547
- } = useContext(store$c);
17238
+ } = useContext(store$d);
16548
17239
 
16549
17240
  const handleBlur = () => {
16550
17241
  return dispatch({
@@ -16587,7 +17278,7 @@ function AddressCreateLine1(props) {
16587
17278
  line1,
16588
17279
  line1Error
16589
17280
  }
16590
- } = useContext(store$c);
17281
+ } = useContext(store$d);
16591
17282
 
16592
17283
  const handleBlur = () => {
16593
17284
  return dispatch({
@@ -16630,7 +17321,7 @@ function AddressCreateCity(props) {
16630
17321
  city,
16631
17322
  cityError
16632
17323
  }
16633
- } = useContext(store$c);
17324
+ } = useContext(store$d);
16634
17325
 
16635
17326
  const handleBlur = () => {
16636
17327
  return dispatch({
@@ -16673,7 +17364,7 @@ function AddressCreatePostalCode(props) {
16673
17364
  postalCode,
16674
17365
  postalCodeError
16675
17366
  }
16676
- } = useContext(store$c);
17367
+ } = useContext(store$d);
16677
17368
 
16678
17369
  const handleBlur = () => {
16679
17370
  return dispatch({
@@ -16719,7 +17410,7 @@ const AddressCreateSubmit = ({
16719
17410
  state: {
16720
17411
  isSubmitting
16721
17412
  }
16722
- } = useContext(store$c);
17413
+ } = useContext(store$d);
16723
17414
  const {
16724
17415
  t
16725
17416
  } = useTranslation("address");
@@ -16830,7 +17521,7 @@ function CountrySelect({
16830
17521
  }
16831
17522
 
16832
17523
  const AddressCreateCountrySelect = props => /*#__PURE__*/React__default.createElement(CountrySelect, Object.assign({
16833
- store: store$c
17524
+ store: store$d
16834
17525
  }, props));
16835
17526
 
16836
17527
  function StateSelect({
@@ -16918,7 +17609,7 @@ function StateSelect({
16918
17609
  }
16919
17610
 
16920
17611
  const AddressCreateStateSelect = props => /*#__PURE__*/React__default.createElement(StateSelect, Object.assign({
16921
- store: store$c
17612
+ store: store$d
16922
17613
  }, props));
16923
17614
 
16924
17615
  const AddressCreateView = props => {
@@ -17023,18 +17714,18 @@ AddressCreateModal.viewId = "address-create";
17023
17714
 
17024
17715
  const AddressCreateTextInput = props => {
17025
17716
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({}, props, {
17026
- store: store$c
17717
+ store: store$d
17027
17718
  }));
17028
17719
  };
17029
17720
 
17030
17721
  const AddressCreateLine2 = props => {
17031
17722
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({
17032
17723
  fieldName: "line2",
17033
- store: store$c
17724
+ store: store$d
17034
17725
  }, props));
17035
17726
  };
17036
17727
 
17037
- const initialState$b = {
17728
+ const initialState$c = {
17038
17729
  isSubmitting: false,
17039
17730
  firstName: "",
17040
17731
  firstNameError: "",
@@ -17059,10 +17750,10 @@ const initialState$b = {
17059
17750
  content: ""
17060
17751
  }
17061
17752
  };
17062
- const store$b = /*#__PURE__*/createContext(initialState$b);
17753
+ const store$c = /*#__PURE__*/createContext(initialState$c);
17063
17754
  const {
17064
- Provider: Provider$b
17065
- } = store$b;
17755
+ Provider: Provider$c
17756
+ } = store$c;
17066
17757
 
17067
17758
  const AddressUpdateContainer = ({
17068
17759
  style,
@@ -17114,7 +17805,7 @@ const AddressUpdateContainer = ({
17114
17805
  const thisAddress = addresses[address];
17115
17806
 
17116
17807
  if (+thisAddress.id === +addressId) {
17117
- const newState = { ...initialState$b,
17808
+ const newState = { ...initialState$c,
17118
17809
  firstName: thisAddress.first_name,
17119
17810
  lastName: thisAddress.last_name,
17120
17811
  line1: thisAddress.line1,
@@ -17247,7 +17938,7 @@ const AddressUpdateContainer = ({
17247
17938
  default:
17248
17939
  return state;
17249
17940
  }
17250
- }, initialState$b);
17941
+ }, initialState$c);
17251
17942
  useEffect(() => {
17252
17943
  const getStates = () => {
17253
17944
  dispatch({
@@ -17279,21 +17970,21 @@ const AddressUpdateContainer = ({
17279
17970
  style: { ...style
17280
17971
  },
17281
17972
  className: `pelcro-container pelcro-address-update-container ${className}`
17282
- }, /*#__PURE__*/React__default.createElement(Provider$b, {
17973
+ }, /*#__PURE__*/React__default.createElement(Provider$c, {
17283
17974
  value: {
17284
17975
  state,
17285
17976
  dispatch
17286
17977
  }
17287
17978
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
17288
- store: store$b,
17979
+ store: store$c,
17289
17980
  key: i
17290
17981
  })) : /*#__PURE__*/React__default.cloneElement(children, {
17291
- store: store$b
17982
+ store: store$c
17292
17983
  })));
17293
17984
  };
17294
17985
 
17295
17986
  const AddressUpdateCountrySelect = props => /*#__PURE__*/React__default.createElement(CountrySelect, Object.assign({
17296
- store: store$b
17987
+ store: store$c
17297
17988
  }, props));
17298
17989
 
17299
17990
  function AddressUpdateFirstName(props) {
@@ -17303,7 +17994,7 @@ function AddressUpdateFirstName(props) {
17303
17994
  firstName,
17304
17995
  firstNameError
17305
17996
  }
17306
- } = useContext(store$b);
17997
+ } = useContext(store$c);
17307
17998
 
17308
17999
  const handleBlur = () => {
17309
18000
  return dispatch({
@@ -17346,7 +18037,7 @@ function AddressUpdateLastName(props) {
17346
18037
  lastName,
17347
18038
  lastNameError
17348
18039
  }
17349
- } = useContext(store$b);
18040
+ } = useContext(store$c);
17350
18041
 
17351
18042
  const handleBlur = () => {
17352
18043
  return dispatch({
@@ -17389,7 +18080,7 @@ function AddressUpdateLine1(props) {
17389
18080
  line1,
17390
18081
  line1Error
17391
18082
  }
17392
- } = useContext(store$b);
18083
+ } = useContext(store$c);
17393
18084
 
17394
18085
  const handleBlur = () => {
17395
18086
  return dispatch({
@@ -17429,7 +18120,7 @@ const AddressUpdateLine2 = props => {
17429
18120
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({
17430
18121
  fieldName: "line2"
17431
18122
  }, props, {
17432
- store: store$b
18123
+ store: store$c
17433
18124
  }));
17434
18125
  };
17435
18126
 
@@ -17440,7 +18131,7 @@ function AddressUpdateCity(props) {
17440
18131
  city,
17441
18132
  cityError
17442
18133
  }
17443
- } = useContext(store$b);
18134
+ } = useContext(store$c);
17444
18135
 
17445
18136
  const handleBlur = () => {
17446
18137
  return dispatch({
@@ -17483,7 +18174,7 @@ function AddressUpdatePostalCode(props) {
17483
18174
  postalCode,
17484
18175
  postalCodeError
17485
18176
  }
17486
- } = useContext(store$b);
18177
+ } = useContext(store$c);
17487
18178
 
17488
18179
  const handleBlur = () => {
17489
18180
  return dispatch({
@@ -17529,7 +18220,7 @@ const AddressUpdateSubmit = ({
17529
18220
  state: {
17530
18221
  isSubmitting
17531
18222
  }
17532
- } = useContext(store$b);
18223
+ } = useContext(store$c);
17533
18224
  const {
17534
18225
  t
17535
18226
  } = useTranslation("address");
@@ -17545,7 +18236,7 @@ const AddressUpdateSubmit = ({
17545
18236
  };
17546
18237
 
17547
18238
  const AddressUpdateStateSelect = props => /*#__PURE__*/React__default.createElement(StateSelect, Object.assign({
17548
- store: store$b
18239
+ store: store$c
17549
18240
  }, props));
17550
18241
 
17551
18242
  const AddressUpdateView = props => {
@@ -17628,7 +18319,7 @@ AddressUpdateModal.viewId = "address-edit";
17628
18319
 
17629
18320
  const AddressUpdateTextInput = props => {
17630
18321
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({}, props, {
17631
- store: store$b
18322
+ store: store$c
17632
18323
  }));
17633
18324
  };
17634
18325
 
@@ -17711,7 +18402,7 @@ const PaymentMethodUpdateModal = props => {
17711
18402
  };
17712
18403
  PaymentMethodUpdateModal.viewId = "payment-method-update";
17713
18404
 
17714
- const initialState$a = {
18405
+ const initialState$b = {
17715
18406
  email: "",
17716
18407
  password: "",
17717
18408
  passwordError: null,
@@ -17724,10 +18415,10 @@ const initialState$a = {
17724
18415
  content: ""
17725
18416
  }
17726
18417
  };
17727
- const store$a = /*#__PURE__*/createContext(initialState$a);
18418
+ const store$b = /*#__PURE__*/createContext(initialState$b);
17728
18419
  const {
17729
- Provider: Provider$a
17730
- } = store$a;
18420
+ Provider: Provider$b
18421
+ } = store$b;
17731
18422
 
17732
18423
  const PasswordResetContainer = ({
17733
18424
  style,
@@ -17784,7 +18475,7 @@ const PasswordResetContainer = ({
17784
18475
  type: SET_EMAIL,
17785
18476
  payload: window.Pelcro.helpers.getURLParameter("email")
17786
18477
  });
17787
- initialState$a.email = window.Pelcro.helpers.getURLParameter("email");
18478
+ initialState$b.email = window.Pelcro.helpers.getURLParameter("email");
17788
18479
  dispatch({
17789
18480
  type: SET_TOKEN,
17790
18481
  payload: window.Pelcro.helpers.getURLParameter("token")
@@ -17844,26 +18535,26 @@ const PasswordResetContainer = ({
17844
18535
  default:
17845
18536
  return state;
17846
18537
  }
17847
- }, initialState$a);
18538
+ }, initialState$b);
17848
18539
  return /*#__PURE__*/React__default.createElement("div", {
17849
18540
  style: { ...style
17850
18541
  },
17851
18542
  className: `pelcro-container pelcro-password-reset-container ${className}`
17852
- }, /*#__PURE__*/React__default.createElement(Provider$a, {
18543
+ }, /*#__PURE__*/React__default.createElement(Provider$b, {
17853
18544
  value: {
17854
18545
  state,
17855
18546
  dispatch
17856
18547
  }
17857
18548
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
17858
- store: store$a,
18549
+ store: store$b,
17859
18550
  key: i
17860
18551
  })) : /*#__PURE__*/React__default.cloneElement(children, {
17861
- store: store$a
18552
+ store: store$b
17862
18553
  })));
17863
18554
  };
17864
18555
 
17865
18556
  const PasswordResetPassword = props => /*#__PURE__*/React__default.createElement(Password, Object.assign({
17866
- store: store$a
18557
+ store: store$b
17867
18558
  }, props));
17868
18559
 
17869
18560
  const PasswordResetButton = ({
@@ -17876,7 +18567,7 @@ const PasswordResetButton = ({
17876
18567
  buttonDisabled
17877
18568
  },
17878
18569
  dispatch
17879
- } = useContext(store$a);
18570
+ } = useContext(store$b);
17880
18571
  const {
17881
18572
  t
17882
18573
  } = useTranslation("passwordReset");
@@ -17893,14 +18584,14 @@ const PasswordResetButton = ({
17893
18584
  };
17894
18585
 
17895
18586
  const PasswordResetEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
17896
- store: store$a
18587
+ store: store$b
17897
18588
  }, props, {
17898
18589
  value: window.Pelcro.helpers.getURLParameter("email"),
17899
18590
  disabled: true
17900
18591
  }));
17901
18592
 
17902
18593
  const PasswordResetConfirmPassword = props => /*#__PURE__*/React__default.createElement(ConfirmPassword, Object.assign({
17903
- store: store$a
18594
+ store: store$b
17904
18595
  }, props));
17905
18596
 
17906
18597
  const PasswordResetView = props => {
@@ -17952,7 +18643,7 @@ const PasswordResetModal = ({
17952
18643
  };
17953
18644
  PasswordResetModal.viewId = "password-reset";
17954
18645
 
17955
- const initialState$9 = {
18646
+ const initialState$a = {
17956
18647
  email: "",
17957
18648
  emailError: null,
17958
18649
  buttonDisabled: false,
@@ -17961,10 +18652,10 @@ const initialState$9 = {
17961
18652
  content: ""
17962
18653
  }
17963
18654
  };
17964
- const store$9 = /*#__PURE__*/createContext(initialState$9);
18655
+ const store$a = /*#__PURE__*/createContext(initialState$a);
17965
18656
  const {
17966
- Provider: Provider$9
17967
- } = store$9;
18657
+ Provider: Provider$a
18658
+ } = store$a;
17968
18659
 
17969
18660
  const PasswordForgotContainer = ({
17970
18661
  style,
@@ -18042,21 +18733,21 @@ const PasswordForgotContainer = ({
18042
18733
  default:
18043
18734
  return state;
18044
18735
  }
18045
- }, initialState$9);
18736
+ }, initialState$a);
18046
18737
  return /*#__PURE__*/React__default.createElement("div", {
18047
18738
  style: { ...style
18048
18739
  },
18049
18740
  className: `pelcro-container pelcro-password-forgot-container ${className}`
18050
- }, /*#__PURE__*/React__default.createElement(Provider$9, {
18741
+ }, /*#__PURE__*/React__default.createElement(Provider$a, {
18051
18742
  value: {
18052
18743
  state,
18053
18744
  dispatch
18054
18745
  }
18055
18746
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
18056
- store: store$9,
18747
+ store: store$a,
18057
18748
  key: i
18058
18749
  })) : /*#__PURE__*/React__default.cloneElement(children, {
18059
- store: store$9
18750
+ store: store$a
18060
18751
  })));
18061
18752
  };
18062
18753
 
@@ -18072,7 +18763,7 @@ const PasswordForgotButton = ({
18072
18763
  emailError
18073
18764
  },
18074
18765
  dispatch
18075
- } = useContext(store$9);
18766
+ } = useContext(store$a);
18076
18767
  const {
18077
18768
  t
18078
18769
  } = useTranslation("passwordForgot");
@@ -18093,7 +18784,7 @@ const PasswordForgotButton = ({
18093
18784
  };
18094
18785
 
18095
18786
  const PasswordForgotEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
18096
- store: store$9
18787
+ store: store$a
18097
18788
  }, props));
18098
18789
 
18099
18790
  const PasswordForgotView = props => {
@@ -18143,7 +18834,7 @@ const PasswordForgotModal = ({
18143
18834
  };
18144
18835
  PasswordForgotModal.viewId = "password-forgot";
18145
18836
 
18146
- const initialState$8 = {
18837
+ const initialState$9 = {
18147
18838
  currentPassword: "",
18148
18839
  newPassword: "",
18149
18840
  confirmNewPassword: "",
@@ -18157,10 +18848,10 @@ const initialState$8 = {
18157
18848
  content: ""
18158
18849
  }
18159
18850
  };
18160
- const store$8 = /*#__PURE__*/createContext(initialState$8);
18851
+ const store$9 = /*#__PURE__*/createContext(initialState$9);
18161
18852
  const {
18162
- Provider: Provider$8
18163
- } = store$8;
18853
+ Provider: Provider$9
18854
+ } = store$9;
18164
18855
  const PasswordChangeContainer = ({
18165
18856
  style,
18166
18857
  className = "",
@@ -18312,21 +19003,21 @@ const PasswordChangeContainer = ({
18312
19003
  default:
18313
19004
  return state;
18314
19005
  }
18315
- }, initialState$8);
19006
+ }, initialState$9);
18316
19007
  return /*#__PURE__*/React__default.createElement("div", {
18317
19008
  style: { ...style
18318
19009
  },
18319
19010
  className: `pelcro-container pelcro-password-change-container ${className}`
18320
- }, /*#__PURE__*/React__default.createElement(Provider$8, {
19011
+ }, /*#__PURE__*/React__default.createElement(Provider$9, {
18321
19012
  value: {
18322
19013
  state,
18323
19014
  dispatch
18324
19015
  }
18325
19016
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
18326
- store: store$8,
19017
+ store: store$9,
18327
19018
  key: i
18328
19019
  })) : /*#__PURE__*/React__default.cloneElement(children, {
18329
- store: store$8
19020
+ store: store$9
18330
19021
  })));
18331
19022
  };
18332
19023
 
@@ -18337,7 +19028,7 @@ function PasswordChangeCurrentPassword(props) {
18337
19028
  currentPassword,
18338
19029
  currentPasswordError
18339
19030
  }
18340
- } = useContext(store$8);
19031
+ } = useContext(store$9);
18341
19032
  const handleBlur = useCallback(() => {
18342
19033
  return dispatch({
18343
19034
  type: VALIDATE_PASSWORD
@@ -18371,7 +19062,7 @@ function PasswordChangeNewPassword(props) {
18371
19062
  newPassword,
18372
19063
  newPasswordError
18373
19064
  }
18374
- } = useContext(store$8);
19065
+ } = useContext(store$9);
18375
19066
  const handleBlur = useCallback(() => {
18376
19067
  return dispatch({
18377
19068
  type: VALIDATE_NEW_PASSWORD
@@ -18405,7 +19096,7 @@ function PasswordChangeConfirmNewPassword(props) {
18405
19096
  confirmNewPassword,
18406
19097
  confirmNewPasswordError
18407
19098
  }
18408
- } = useContext(store$8);
19099
+ } = useContext(store$9);
18409
19100
  const handleBlur = useCallback(() => {
18410
19101
  return dispatch({
18411
19102
  type: VALIDATE_CONFIRM_NEW_PASSWORD
@@ -18446,7 +19137,7 @@ const PasswordChangeButton = ({
18446
19137
  confirmNewPasswordError
18447
19138
  },
18448
19139
  dispatch
18449
- } = useContext(store$8);
19140
+ } = useContext(store$9);
18450
19141
  const {
18451
19142
  t
18452
19143
  } = useTranslation("passwordChange");
@@ -18512,17 +19203,17 @@ const PasswordChangeModal = ({
18512
19203
  };
18513
19204
  PasswordChangeModal.viewId = "password-change";
18514
19205
 
18515
- const initialState$7 = {
19206
+ const initialState$8 = {
18516
19207
  buttonDisabled: false,
18517
19208
  alert: {
18518
19209
  type: "error",
18519
19210
  content: ""
18520
19211
  }
18521
19212
  };
18522
- const store$7 = /*#__PURE__*/createContext(initialState$7);
19213
+ const store$8 = /*#__PURE__*/createContext(initialState$8);
18523
19214
  const {
18524
- Provider: Provider$7
18525
- } = store$7;
19215
+ Provider: Provider$8
19216
+ } = store$8;
18526
19217
 
18527
19218
  const CartContainer = ({
18528
19219
  style,
@@ -18613,21 +19304,21 @@ const CartContainer = ({
18613
19304
  default:
18614
19305
  return state;
18615
19306
  }
18616
- }, initialState$7);
19307
+ }, initialState$8);
18617
19308
  return /*#__PURE__*/React__default.createElement("div", {
18618
19309
  style: { ...style
18619
19310
  },
18620
19311
  className: `pelcro-container pelcro-cart-container ${className}`
18621
- }, /*#__PURE__*/React__default.createElement(Provider$7, {
19312
+ }, /*#__PURE__*/React__default.createElement(Provider$8, {
18622
19313
  value: {
18623
19314
  state,
18624
19315
  dispatch
18625
19316
  }
18626
19317
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
18627
- store: store$7,
19318
+ store: store$8,
18628
19319
  key: i
18629
19320
  })) : /*#__PURE__*/React__default.cloneElement(children, {
18630
- store: store$7
19321
+ store: store$8
18631
19322
  })));
18632
19323
  };
18633
19324
 
@@ -18664,7 +19355,7 @@ const CartSubmit = ({
18664
19355
  buttonDisabled
18665
19356
  },
18666
19357
  dispatch
18667
- } = useContext(store$7);
19358
+ } = useContext(store$8);
18668
19359
  const {
18669
19360
  t
18670
19361
  } = useTranslation("cart");
@@ -18695,7 +19386,7 @@ const CartTotalPrice = () => {
18695
19386
  state: {
18696
19387
  alert
18697
19388
  }
18698
- } = useContext(store$7);
19389
+ } = useContext(store$8);
18699
19390
  const {
18700
19391
  cartItems
18701
19392
  } = usePelcro();
@@ -19008,7 +19699,7 @@ const OrderConfirmModal = props => {
19008
19699
  };
19009
19700
  OrderConfirmModal.viewId = "order-confirm";
19010
19701
 
19011
- const initialState$6 = {
19702
+ const initialState$7 = {
19012
19703
  email: "",
19013
19704
  firstName: "",
19014
19705
  lastName: "",
@@ -19020,10 +19711,10 @@ const initialState$6 = {
19020
19711
  content: ""
19021
19712
  }
19022
19713
  };
19023
- const store$6 = /*#__PURE__*/createContext(initialState$6);
19714
+ const store$7 = /*#__PURE__*/createContext(initialState$7);
19024
19715
  const {
19025
- Provider: Provider$6
19026
- } = store$6;
19716
+ Provider: Provider$7
19717
+ } = store$7;
19027
19718
 
19028
19719
  const GiftCreateContainer = ({
19029
19720
  style,
@@ -19127,21 +19818,21 @@ const GiftCreateContainer = ({
19127
19818
  default:
19128
19819
  return state;
19129
19820
  }
19130
- }, initialState$6);
19821
+ }, initialState$7);
19131
19822
  return /*#__PURE__*/React__default.createElement("div", {
19132
19823
  style: { ...style
19133
19824
  },
19134
19825
  className: `pelcro-container pelcro-gift-create-container ${className}`
19135
- }, /*#__PURE__*/React__default.createElement(Provider$6, {
19826
+ }, /*#__PURE__*/React__default.createElement(Provider$7, {
19136
19827
  value: {
19137
19828
  state,
19138
19829
  dispatch
19139
19830
  }
19140
19831
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
19141
- store: store$6,
19832
+ store: store$7,
19142
19833
  key: i
19143
19834
  })) : /*#__PURE__*/React__default.cloneElement(children, {
19144
- store: store$6
19835
+ store: store$7
19145
19836
  })));
19146
19837
  };
19147
19838
 
@@ -19155,7 +19846,7 @@ const GiftCreateSubmitButton = ({
19155
19846
  state: {
19156
19847
  disableSubmit
19157
19848
  }
19158
- } = useContext(store$6);
19849
+ } = useContext(store$7);
19159
19850
  const {
19160
19851
  t
19161
19852
  } = useTranslation("register");
@@ -19172,29 +19863,29 @@ const GiftCreateSubmitButton = ({
19172
19863
 
19173
19864
  const GiftCreateEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
19174
19865
  initWithUserEmail: false,
19175
- store: store$6
19866
+ store: store$7
19176
19867
  }, props));
19177
19868
 
19178
19869
  const GiftCreateFirstName = props => /*#__PURE__*/React__default.createElement(FirstName, Object.assign({
19179
- store: store$6
19870
+ store: store$7
19180
19871
  }, props));
19181
19872
 
19182
19873
  const GiftCreateLastName = props => /*#__PURE__*/React__default.createElement(LastName, Object.assign({
19183
- store: store$6
19874
+ store: store$7
19184
19875
  }, props));
19185
19876
 
19186
- var _path$g;
19877
+ var _path$i;
19187
19878
 
19188
- 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); }
19879
+ 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); }
19189
19880
 
19190
19881
  function SvgInfoCircle(props) {
19191
- return /*#__PURE__*/React.createElement("svg", _extends$i({
19882
+ return /*#__PURE__*/React.createElement("svg", _extends$k({
19192
19883
  xmlns: "http://www.w3.org/2000/svg",
19193
19884
  className: "plc-w-5 plc-h-5",
19194
19885
  fill: "none",
19195
19886
  viewBox: "0 0 24 24",
19196
19887
  stroke: "currentColor"
19197
- }, props), _path$g || (_path$g = /*#__PURE__*/React.createElement("path", {
19888
+ }, props), _path$i || (_path$i = /*#__PURE__*/React.createElement("path", {
19198
19889
  strokeLinecap: "round",
19199
19890
  strokeLinejoin: "round",
19200
19891
  strokeWidth: 2,
@@ -19265,7 +19956,7 @@ const GiftCreateStartDate = props => {
19265
19956
  const {
19266
19957
  dispatch,
19267
19958
  state
19268
- } = useContext(store$6);
19959
+ } = useContext(store$7);
19269
19960
 
19270
19961
  const handleInputChange = value => {
19271
19962
  dispatch({
@@ -19338,7 +20029,7 @@ function GiftCreateMessage(props) {
19338
20029
  const {
19339
20030
  dispatch,
19340
20031
  state
19341
- } = useContext(store$6);
20032
+ } = useContext(store$7);
19342
20033
  const MAX_CHARS_COUNT = 200;
19343
20034
  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;
19344
20035
 
@@ -19462,7 +20153,7 @@ const GiftCreateModal = ({
19462
20153
  };
19463
20154
  GiftCreateModal.viewId = "gift-create";
19464
20155
 
19465
- const initialState$5 = {
20156
+ const initialState$6 = {
19466
20157
  giftCode: "",
19467
20158
  buttonDisabled: true,
19468
20159
  alert: {
@@ -19470,10 +20161,10 @@ const initialState$5 = {
19470
20161
  content: ""
19471
20162
  }
19472
20163
  };
19473
- const store$5 = /*#__PURE__*/createContext(initialState$5);
20164
+ const store$6 = /*#__PURE__*/createContext(initialState$6);
19474
20165
  const {
19475
- Provider: Provider$5
19476
- } = store$5;
20166
+ Provider: Provider$6
20167
+ } = store$6;
19477
20168
 
19478
20169
  const GiftRedeemContainer = ({
19479
20170
  style,
@@ -19538,21 +20229,21 @@ const GiftRedeemContainer = ({
19538
20229
  default:
19539
20230
  return state;
19540
20231
  }
19541
- }, initialState$5);
20232
+ }, initialState$6);
19542
20233
  return /*#__PURE__*/React__default.createElement("div", {
19543
20234
  style: { ...style
19544
20235
  },
19545
20236
  className: `pelcro-container pelcro-gift-redeem-container ${className}`
19546
- }, /*#__PURE__*/React__default.createElement(Provider$5, {
20237
+ }, /*#__PURE__*/React__default.createElement(Provider$6, {
19547
20238
  value: {
19548
20239
  state,
19549
20240
  dispatch
19550
20241
  }
19551
20242
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
19552
- store: store$5,
20243
+ store: store$6,
19553
20244
  key: i
19554
20245
  })) : /*#__PURE__*/React__default.cloneElement(children, {
19555
- store: store$5
20246
+ store: store$6
19556
20247
  })));
19557
20248
  };
19558
20249
 
@@ -19589,7 +20280,7 @@ function GiftCode({
19589
20280
  }
19590
20281
 
19591
20282
  const GiftRedeemCode = props => /*#__PURE__*/React__default.createElement(GiftCode, Object.assign({
19592
- store: store$5
20283
+ store: store$6
19593
20284
  }, props));
19594
20285
 
19595
20286
  const GiftRedeemSubmitButton = ({
@@ -19602,7 +20293,7 @@ const GiftRedeemSubmitButton = ({
19602
20293
  state: {
19603
20294
  disableSubmit
19604
20295
  }
19605
- } = useContext(store$5);
20296
+ } = useContext(store$6);
19606
20297
  const {
19607
20298
  t
19608
20299
  } = useTranslation("register");
@@ -19695,7 +20386,7 @@ const moveDefaultAddressToStart = addresses => {
19695
20386
  return [defaultAddress, ...addressesWithoutDefault];
19696
20387
  };
19697
20388
 
19698
- const initialState$4 = {
20389
+ const initialState$5 = {
19699
20390
  addresses: [],
19700
20391
  selectedAddressId: null,
19701
20392
  isSubmitting: false,
@@ -19704,10 +20395,10 @@ const initialState$4 = {
19704
20395
  content: ""
19705
20396
  }
19706
20397
  };
19707
- const store$4 = /*#__PURE__*/createContext(initialState$4);
20398
+ const store$5 = /*#__PURE__*/createContext(initialState$5);
19708
20399
  const {
19709
- Provider: Provider$4
19710
- } = store$4;
20400
+ Provider: Provider$5
20401
+ } = store$5;
19711
20402
 
19712
20403
  const AddressSelectContainer = ({
19713
20404
  style,
@@ -19802,7 +20493,7 @@ const AddressSelectContainer = ({
19802
20493
  default:
19803
20494
  return state;
19804
20495
  }
19805
- }, initialState$4);
20496
+ }, initialState$5);
19806
20497
  useEffect(() => {
19807
20498
  var _window$Pelcro$user$r;
19808
20499
 
@@ -19815,16 +20506,16 @@ const AddressSelectContainer = ({
19815
20506
  style: { ...style
19816
20507
  },
19817
20508
  className: `pelcro-container pelcro-address-select-container ${className}`
19818
- }, /*#__PURE__*/React__default.createElement(Provider$4, {
20509
+ }, /*#__PURE__*/React__default.createElement(Provider$5, {
19819
20510
  value: {
19820
20511
  state,
19821
20512
  dispatch
19822
20513
  }
19823
20514
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
19824
- store: store$4,
20515
+ store: store$5,
19825
20516
  key: i
19826
20517
  })) : /*#__PURE__*/React__default.cloneElement(children, {
19827
- store: store$4
20518
+ store: store$5
19828
20519
  })));
19829
20520
  };
19830
20521
 
@@ -19835,7 +20526,7 @@ const AddressSelectList = () => {
19835
20526
  addresses,
19836
20527
  selectedAddressId
19837
20528
  }
19838
- } = useContext(store$4);
20529
+ } = useContext(store$5);
19839
20530
 
19840
20531
  const handleAddressSelect = event => {
19841
20532
  dispatch({
@@ -19879,7 +20570,7 @@ const AddressSelectSubmit = ({
19879
20570
  selectedAddressId,
19880
20571
  isSubmitting
19881
20572
  }
19882
- } = useContext(store$4);
20573
+ } = useContext(store$5);
19883
20574
  const {
19884
20575
  t
19885
20576
  } = useTranslation("address");
@@ -19975,7 +20666,7 @@ const moveDefaultPaymentMethodToStart = paymentMethods => {
19975
20666
  return [defaultPaymentMethod, ...paymentMethodsWithoutDefault];
19976
20667
  };
19977
20668
 
19978
- const initialState$3 = {
20669
+ const initialState$4 = {
19979
20670
  paymentMethods: [],
19980
20671
  selectedPaymentMethodId: null,
19981
20672
  isSubmitting: false,
@@ -19984,10 +20675,10 @@ const initialState$3 = {
19984
20675
  content: ""
19985
20676
  }
19986
20677
  };
19987
- const store$3 = /*#__PURE__*/createContext(initialState$3);
20678
+ const store$4 = /*#__PURE__*/createContext(initialState$4);
19988
20679
  const {
19989
- Provider: Provider$3
19990
- } = store$3;
20680
+ Provider: Provider$4
20681
+ } = store$4;
19991
20682
 
19992
20683
  const PaymentMethodSelectContainer = ({
19993
20684
  style,
@@ -20046,7 +20737,7 @@ const PaymentMethodSelectContainer = ({
20046
20737
  default:
20047
20738
  return state;
20048
20739
  }
20049
- }, initialState$3);
20740
+ }, initialState$4);
20050
20741
  useEffect(() => {
20051
20742
  var _window$Pelcro$user$r3;
20052
20743
 
@@ -20059,16 +20750,16 @@ const PaymentMethodSelectContainer = ({
20059
20750
  style: { ...style
20060
20751
  },
20061
20752
  className: `pelcro-container pelcro-payment-select-container ${className}`
20062
- }, /*#__PURE__*/React__default.createElement(Provider$3, {
20753
+ }, /*#__PURE__*/React__default.createElement(Provider$4, {
20063
20754
  value: {
20064
20755
  state,
20065
20756
  dispatch
20066
20757
  }
20067
20758
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
20068
- store: store$3,
20759
+ store: store$4,
20069
20760
  key: i
20070
20761
  })) : /*#__PURE__*/React__default.cloneElement(children, {
20071
- store: store$3
20762
+ store: store$4
20072
20763
  })));
20073
20764
  };
20074
20765
 
@@ -20082,7 +20773,7 @@ const PaymentMethodSelectList = () => {
20082
20773
  paymentMethods,
20083
20774
  selectedPaymentMethodId
20084
20775
  }
20085
- } = useContext(store$3);
20776
+ } = useContext(store$4);
20086
20777
 
20087
20778
  const handlePaymentMethodSelect = event => {
20088
20779
  dispatch({
@@ -20132,7 +20823,7 @@ const PaymentMethodSelectSubmit = ({
20132
20823
  selectedPaymentMethodId,
20133
20824
  isSubmitting
20134
20825
  }
20135
- } = useContext(store$3);
20826
+ } = useContext(store$4);
20136
20827
  return /*#__PURE__*/React__default.createElement(Button, Object.assign({
20137
20828
  onClick: () => {
20138
20829
  dispatch({
@@ -20206,8 +20897,8 @@ const PaymentMethodSelectModal = ({
20206
20897
  };
20207
20898
  PaymentMethodSelectModal.viewId = "payment-method-select";
20208
20899
 
20209
- function _extends$h() {
20210
- _extends$h = Object.assign || function (target) {
20900
+ function _extends$j() {
20901
+ _extends$j = Object.assign || function (target) {
20211
20902
  for (var i = 1; i < arguments.length; i++) {
20212
20903
  var source = arguments[i];
20213
20904
 
@@ -20221,7 +20912,7 @@ function _extends$h() {
20221
20912
  return target;
20222
20913
  };
20223
20914
 
20224
- return _extends$h.apply(this, arguments);
20915
+ return _extends$j.apply(this, arguments);
20225
20916
  }
20226
20917
 
20227
20918
  function _objectWithoutPropertiesLoose(source, excluded) {
@@ -20405,7 +21096,7 @@ function render(props, propsBag, defaultTag, features, visible) {
20405
21096
  return match(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function () {
20406
21097
  return null;
20407
21098
  }, _match[RenderStrategy.Hidden] = function () {
20408
- return _render(_extends$h({}, _rest, {
21099
+ return _render(_extends$j({}, _rest, {
20409
21100
  hidden: true,
20410
21101
  style: {
20411
21102
  display: 'none'
@@ -20933,7 +21624,7 @@ function TransitionChild(props) {
20933
21624
  var passthroughProps = rest;
20934
21625
  return React__default.createElement(NestingContext.Provider, {
20935
21626
  value: nesting
20936
- }, render(_extends$h({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
21627
+ }, render(_extends$j({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
20937
21628
  }
20938
21629
 
20939
21630
  function Transition(props) {
@@ -20977,7 +21668,7 @@ function Transition(props) {
20977
21668
  value: nestingBag
20978
21669
  }, React__default.createElement(TransitionContext.Provider, {
20979
21670
  value: transitionBag
20980
- }, render(_extends$h({}, sharedProps, {
21671
+ }, render(_extends$j({}, sharedProps, {
20981
21672
  as: Fragment,
20982
21673
  children: React__default.createElement(TransitionChild, Object.assign({}, sharedProps, passthroughProps))
20983
21674
  }), propsBag, Fragment, TransitionChildRenderFeatures, state === TreeStates.Visible)));
@@ -21104,12 +21795,12 @@ var ActionTypes;
21104
21795
  })(ActionTypes || (ActionTypes = {}));
21105
21796
 
21106
21797
  (_reducers = {}, _reducers[ActionTypes.CloseMenu] = function (state) {
21107
- return _extends$h({}, state, {
21798
+ return _extends$j({}, state, {
21108
21799
  activeItemIndex: null,
21109
21800
  menuState: MenuStates.Closed
21110
21801
  });
21111
21802
  }, _reducers[ActionTypes.OpenMenu] = function (state) {
21112
- return _extends$h({}, state, {
21803
+ return _extends$j({}, state, {
21113
21804
  menuState: MenuStates.Open
21114
21805
  });
21115
21806
  }, _reducers[ActionTypes.GoToItem] = function (state, action) {
@@ -21128,7 +21819,7 @@ var ActionTypes;
21128
21819
  }
21129
21820
  });
21130
21821
  if (state.searchQuery === '' && state.activeItemIndex === activeItemIndex) return state;
21131
- return _extends$h({}, state, {
21822
+ return _extends$j({}, state, {
21132
21823
  searchQuery: '',
21133
21824
  activeItemIndex: activeItemIndex
21134
21825
  });
@@ -21139,19 +21830,19 @@ var ActionTypes;
21139
21830
 
21140
21831
  return ((_item$dataRef$current = item.dataRef.current.textValue) == null ? void 0 : _item$dataRef$current.startsWith(searchQuery)) && !item.dataRef.current.disabled;
21141
21832
  });
21142
- if (match === -1 || match === state.activeItemIndex) return _extends$h({}, state, {
21833
+ if (match === -1 || match === state.activeItemIndex) return _extends$j({}, state, {
21143
21834
  searchQuery: searchQuery
21144
21835
  });
21145
- return _extends$h({}, state, {
21836
+ return _extends$j({}, state, {
21146
21837
  searchQuery: searchQuery,
21147
21838
  activeItemIndex: match
21148
21839
  });
21149
21840
  }, _reducers[ActionTypes.ClearSearch] = function (state) {
21150
- return _extends$h({}, state, {
21841
+ return _extends$j({}, state, {
21151
21842
  searchQuery: ''
21152
21843
  });
21153
21844
  }, _reducers[ActionTypes.RegisterItem] = function (state, action) {
21154
- return _extends$h({}, state, {
21845
+ return _extends$j({}, state, {
21155
21846
  items: [].concat(state.items, [{
21156
21847
  id: action.id,
21157
21848
  dataRef: action.dataRef
@@ -21164,7 +21855,7 @@ var ActionTypes;
21164
21855
  return a.id === action.id;
21165
21856
  });
21166
21857
  if (idx !== -1) nextItems.splice(idx, 1);
21167
- return _extends$h({}, state, {
21858
+ return _extends$j({}, state, {
21168
21859
  items: nextItems,
21169
21860
  activeItemIndex: function () {
21170
21861
  if (idx === state.activeItemIndex) return null;
@@ -21203,19 +21894,19 @@ var ActionTypes$1;
21203
21894
  (_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = function (state) {
21204
21895
  if (state.disabled) return state;
21205
21896
  if (state.listboxState === ListboxStates.Closed) return state;
21206
- return _extends$h({}, state, {
21897
+ return _extends$j({}, state, {
21207
21898
  activeOptionIndex: null,
21208
21899
  listboxState: ListboxStates.Closed
21209
21900
  });
21210
21901
  }, _reducers$1[ActionTypes$1.OpenListbox] = function (state) {
21211
21902
  if (state.disabled) return state;
21212
21903
  if (state.listboxState === ListboxStates.Open) return state;
21213
- return _extends$h({}, state, {
21904
+ return _extends$j({}, state, {
21214
21905
  listboxState: ListboxStates.Open
21215
21906
  });
21216
21907
  }, _reducers$1[ActionTypes$1.SetDisabled] = function (state, action) {
21217
21908
  if (state.disabled === action.disabled) return state;
21218
- return _extends$h({}, state, {
21909
+ return _extends$j({}, state, {
21219
21910
  disabled: action.disabled
21220
21911
  });
21221
21912
  }, _reducers$1[ActionTypes$1.GoToOption] = function (state, action) {
@@ -21236,7 +21927,7 @@ var ActionTypes$1;
21236
21927
  }
21237
21928
  });
21238
21929
  if (state.searchQuery === '' && state.activeOptionIndex === activeOptionIndex) return state;
21239
- return _extends$h({}, state, {
21930
+ return _extends$j({}, state, {
21240
21931
  searchQuery: '',
21241
21932
  activeOptionIndex: activeOptionIndex
21242
21933
  });
@@ -21249,10 +21940,10 @@ var ActionTypes$1;
21249
21940
 
21250
21941
  return !option.dataRef.current.disabled && ((_option$dataRef$curre = option.dataRef.current.textValue) == null ? void 0 : _option$dataRef$curre.startsWith(searchQuery));
21251
21942
  });
21252
- if (match === -1 || match === state.activeOptionIndex) return _extends$h({}, state, {
21943
+ if (match === -1 || match === state.activeOptionIndex) return _extends$j({}, state, {
21253
21944
  searchQuery: searchQuery
21254
21945
  });
21255
- return _extends$h({}, state, {
21946
+ return _extends$j({}, state, {
21256
21947
  searchQuery: searchQuery,
21257
21948
  activeOptionIndex: match
21258
21949
  });
@@ -21260,11 +21951,11 @@ var ActionTypes$1;
21260
21951
  if (state.disabled) return state;
21261
21952
  if (state.listboxState === ListboxStates.Closed) return state;
21262
21953
  if (state.searchQuery === '') return state;
21263
- return _extends$h({}, state, {
21954
+ return _extends$j({}, state, {
21264
21955
  searchQuery: ''
21265
21956
  });
21266
21957
  }, _reducers$1[ActionTypes$1.RegisterOption] = function (state, action) {
21267
- return _extends$h({}, state, {
21958
+ return _extends$j({}, state, {
21268
21959
  options: [].concat(state.options, [{
21269
21960
  id: action.id,
21270
21961
  dataRef: action.dataRef
@@ -21277,7 +21968,7 @@ var ActionTypes$1;
21277
21968
  return a.id === action.id;
21278
21969
  });
21279
21970
  if (idx !== -1) nextOptions.splice(idx, 1);
21280
- return _extends$h({}, state, {
21971
+ return _extends$j({}, state, {
21281
21972
  options: nextOptions,
21282
21973
  activeOptionIndex: function () {
21283
21974
  if (idx === state.activeOptionIndex) return null;
@@ -21338,18 +22029,18 @@ const getPaymentCardIcon = name => {
21338
22029
  }));
21339
22030
  };
21340
22031
 
21341
- var _path$f;
22032
+ var _path$h;
21342
22033
 
21343
- 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); }
22034
+ 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); }
21344
22035
 
21345
22036
  function SvgChevronRight(props) {
21346
- return /*#__PURE__*/React.createElement("svg", _extends$g({
22037
+ return /*#__PURE__*/React.createElement("svg", _extends$i({
21347
22038
  className: "plc-w-6 plc-h-6",
21348
22039
  xmlns: "http://www.w3.org/2000/svg",
21349
22040
  fill: "none",
21350
22041
  viewBox: "0 0 24 24",
21351
22042
  stroke: "currentColor"
21352
- }, props), _path$f || (_path$f = /*#__PURE__*/React.createElement("path", {
22043
+ }, props), _path$h || (_path$h = /*#__PURE__*/React.createElement("path", {
21353
22044
  strokeLinecap: "round",
21354
22045
  strokeLinejoin: "round",
21355
22046
  strokeWidth: 2,
@@ -21565,18 +22256,18 @@ const SavedItems = ({
21565
22256
  });
21566
22257
  };
21567
22258
 
21568
- var _path$e;
22259
+ var _path$g;
21569
22260
 
21570
- 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); }
22261
+ 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); }
21571
22262
 
21572
22263
  function SvgRefresh(props) {
21573
- return /*#__PURE__*/React.createElement("svg", _extends$f({
22264
+ return /*#__PURE__*/React.createElement("svg", _extends$h({
21574
22265
  className: "plc-w-4 plc-h-4 plc-mr-1",
21575
22266
  xmlns: "http://www.w3.org/2000/svg",
21576
22267
  fill: "none",
21577
22268
  viewBox: "0 0 24 24",
21578
22269
  stroke: "currentColor"
21579
- }, props), _path$e || (_path$e = /*#__PURE__*/React.createElement("path", {
22270
+ }, props), _path$g || (_path$g = /*#__PURE__*/React.createElement("path", {
21580
22271
  strokeLinecap: "round",
21581
22272
  strokeLinejoin: "round",
21582
22273
  strokeWidth: 2,
@@ -21584,35 +22275,35 @@ function SvgRefresh(props) {
21584
22275
  })));
21585
22276
  }
21586
22277
 
21587
- var _path$d;
22278
+ var _path$f;
21588
22279
 
21589
- 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); }
22280
+ 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); }
21590
22281
 
21591
22282
  function SvgCalendar(props) {
21592
- return /*#__PURE__*/React.createElement("svg", _extends$e({
22283
+ return /*#__PURE__*/React.createElement("svg", _extends$g({
21593
22284
  xmlns: "http://www.w3.org/2000/svg",
21594
22285
  className: "plc-h-4 plc-w-4 plc-mr-1",
21595
22286
  viewBox: "0 0 20 20",
21596
22287
  fill: "currentColor"
21597
- }, props), _path$d || (_path$d = /*#__PURE__*/React.createElement("path", {
22288
+ }, props), _path$f || (_path$f = /*#__PURE__*/React.createElement("path", {
21598
22289
  fillRule: "evenodd",
21599
22290
  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",
21600
22291
  clipRule: "evenodd"
21601
22292
  })));
21602
22293
  }
21603
22294
 
21604
- var _path$c;
22295
+ var _path$e;
21605
22296
 
21606
- 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); }
22297
+ 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); }
21607
22298
 
21608
22299
  function SvgPlus(props) {
21609
- return /*#__PURE__*/React.createElement("svg", _extends$d({
22300
+ return /*#__PURE__*/React.createElement("svg", _extends$f({
21610
22301
  className: "plc-w-5 plc-h-5",
21611
22302
  xmlns: "http://www.w3.org/2000/svg",
21612
22303
  fill: "none",
21613
22304
  viewBox: "0 0 24 24",
21614
22305
  stroke: "currentColor"
21615
- }, props), _path$c || (_path$c = /*#__PURE__*/React.createElement("path", {
22306
+ }, props), _path$e || (_path$e = /*#__PURE__*/React.createElement("path", {
21616
22307
  strokeLinecap: "round",
21617
22308
  strokeLinejoin: "round",
21618
22309
  strokeWidth: 2,
@@ -21620,17 +22311,17 @@ function SvgPlus(props) {
21620
22311
  })));
21621
22312
  }
21622
22313
 
21623
- var _path$b;
22314
+ var _path$d;
21624
22315
 
21625
- 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); }
22316
+ 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); }
21626
22317
 
21627
22318
  function SvgCheckMark(props) {
21628
- return /*#__PURE__*/React.createElement("svg", _extends$c({
22319
+ return /*#__PURE__*/React.createElement("svg", _extends$e({
21629
22320
  className: "plc-w-4 plc-h-4 plc-mr-1",
21630
22321
  xmlns: "http://www.w3.org/2000/svg",
21631
22322
  viewBox: "0 0 20 20",
21632
22323
  fill: "currentColor"
21633
- }, props), _path$b || (_path$b = /*#__PURE__*/React.createElement("path", {
22324
+ }, props), _path$d || (_path$d = /*#__PURE__*/React.createElement("path", {
21634
22325
  fillRule: "evenodd",
21635
22326
  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",
21636
22327
  clipRule: "evenodd"
@@ -21694,7 +22385,8 @@ const SubscriptionsItems = ({
21694
22385
  } = useTranslation("dashboard");
21695
22386
  const {
21696
22387
  switchView,
21697
- isAuthenticated
22388
+ switchToAddressView,
22389
+ switchToPaymentView
21698
22390
  } = usePelcro();
21699
22391
  const subs = getNonDonationSubs();
21700
22392
  if (subs.length === 0) return null;
@@ -21736,7 +22428,12 @@ const SubscriptionsItems = ({
21736
22428
  const plan = window.Pelcro.plan.getById(plan_id);
21737
22429
  setProductAndPlan(product, plan);
21738
22430
  setSubscriptionIdToRenew(sub.id);
21739
- setView("plan-select");
22431
+
22432
+ if (product.address_required) {
22433
+ return switchToAddressView();
22434
+ }
22435
+
22436
+ return switchToPaymentView();
21740
22437
  };
21741
22438
 
21742
22439
  const getPhases = () => {
@@ -21925,18 +22622,18 @@ Accordion.item = function AccordionItem({
21925
22622
  }, content)) : null;
21926
22623
  };
21927
22624
 
21928
- var _path$a;
22625
+ var _path$c;
21929
22626
 
21930
- 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); }
22627
+ 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); }
21931
22628
 
21932
22629
  function SvgExit(props) {
21933
- return /*#__PURE__*/React.createElement("svg", _extends$b({
22630
+ return /*#__PURE__*/React.createElement("svg", _extends$d({
21934
22631
  className: "plc-w-6 plc-h-6",
21935
22632
  xmlns: "http://www.w3.org/2000/svg",
21936
22633
  fill: "none",
21937
22634
  viewBox: "0 0 24 24",
21938
22635
  stroke: "currentColor"
21939
- }, props), _path$a || (_path$a = /*#__PURE__*/React.createElement("path", {
22636
+ }, props), _path$c || (_path$c = /*#__PURE__*/React.createElement("path", {
21940
22637
  strokeLinecap: "round",
21941
22638
  strokeLinejoin: "round",
21942
22639
  strokeWidth: 2,
@@ -21944,17 +22641,17 @@ function SvgExit(props) {
21944
22641
  })));
21945
22642
  }
21946
22643
 
21947
- var _path$9;
22644
+ var _path$b;
21948
22645
 
21949
- 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); }
22646
+ 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); }
21950
22647
 
21951
22648
  function SvgUser(props) {
21952
- return /*#__PURE__*/React.createElement("svg", _extends$a({
22649
+ return /*#__PURE__*/React.createElement("svg", _extends$c({
21953
22650
  xmlns: "http://www.w3.org/2000/svg",
21954
22651
  fill: "none",
21955
22652
  viewBox: "0 0 24 24",
21956
22653
  stroke: "currentColor"
21957
- }, props), _path$9 || (_path$9 = /*#__PURE__*/React.createElement("path", {
22654
+ }, props), _path$b || (_path$b = /*#__PURE__*/React.createElement("path", {
21958
22655
  strokeLinecap: "round",
21959
22656
  strokeLinejoin: "round",
21960
22657
  strokeWidth: 2,
@@ -21962,18 +22659,18 @@ function SvgUser(props) {
21962
22659
  })));
21963
22660
  }
21964
22661
 
21965
- var _path$8;
22662
+ var _path$a;
21966
22663
 
21967
- 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); }
22664
+ 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); }
21968
22665
 
21969
22666
  function SvgNewsletter(props) {
21970
- return /*#__PURE__*/React.createElement("svg", _extends$9({
22667
+ return /*#__PURE__*/React.createElement("svg", _extends$b({
21971
22668
  xmlns: "http://www.w3.org/2000/svg",
21972
22669
  className: "plc-h-5 plc-w-5",
21973
22670
  fill: "none",
21974
22671
  viewBox: "0 0 24 24",
21975
22672
  stroke: "currentColor"
21976
- }, props), _path$8 || (_path$8 = /*#__PURE__*/React.createElement("path", {
22673
+ }, props), _path$a || (_path$a = /*#__PURE__*/React.createElement("path", {
21977
22674
  strokeLinecap: "round",
21978
22675
  strokeLinejoin: "round",
21979
22676
  strokeWidth: 2,
@@ -21981,18 +22678,37 @@ function SvgNewsletter(props) {
21981
22678
  })));
21982
22679
  }
21983
22680
 
21984
- var _path$7;
22681
+ var _path$9;
22682
+
22683
+ 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); }
21985
22684
 
21986
- 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); }
22685
+ function SvgDocument(props) {
22686
+ return /*#__PURE__*/React.createElement("svg", _extends$a({
22687
+ xmlns: "http://www.w3.org/2000/svg",
22688
+ className: "plc-h-6 plc-w-6 plc-mr-2",
22689
+ fill: "none",
22690
+ viewBox: "0 0 24 24",
22691
+ stroke: "currentColor"
22692
+ }, props), _path$9 || (_path$9 = /*#__PURE__*/React.createElement("path", {
22693
+ strokeLinecap: "round",
22694
+ strokeLinejoin: "round",
22695
+ strokeWidth: 2,
22696
+ 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"
22697
+ })));
22698
+ }
22699
+
22700
+ var _path$8;
22701
+
22702
+ 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); }
21987
22703
 
21988
22704
  function SvgPaymentCard(props) {
21989
- return /*#__PURE__*/React.createElement("svg", _extends$8({
22705
+ return /*#__PURE__*/React.createElement("svg", _extends$9({
21990
22706
  className: "plc-w-6 plc-h-6 plc-mr-2",
21991
22707
  xmlns: "http://www.w3.org/2000/svg",
21992
22708
  fill: "none",
21993
22709
  viewBox: "0 0 24 24",
21994
22710
  stroke: "currentColor"
21995
- }, props), _path$7 || (_path$7 = /*#__PURE__*/React.createElement("path", {
22711
+ }, props), _path$8 || (_path$8 = /*#__PURE__*/React.createElement("path", {
21996
22712
  strokeLinecap: "round",
21997
22713
  strokeLinejoin: "round",
21998
22714
  strokeWidth: 2,
@@ -22000,18 +22716,18 @@ function SvgPaymentCard(props) {
22000
22716
  })));
22001
22717
  }
22002
22718
 
22003
- var _path$6, _path2$1;
22719
+ var _path$7, _path2$1;
22004
22720
 
22005
- 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); }
22721
+ 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); }
22006
22722
 
22007
22723
  function SvgLocationPin(props) {
22008
- return /*#__PURE__*/React.createElement("svg", _extends$7({
22724
+ return /*#__PURE__*/React.createElement("svg", _extends$8({
22009
22725
  className: "plc-w-6 plc-h-6 plc-mr-2",
22010
22726
  xmlns: "http://www.w3.org/2000/svg",
22011
22727
  fill: "none",
22012
22728
  viewBox: "0 0 24 24",
22013
22729
  stroke: "currentColor"
22014
- }, props), _path$6 || (_path$6 = /*#__PURE__*/React.createElement("path", {
22730
+ }, props), _path$7 || (_path$7 = /*#__PURE__*/React.createElement("path", {
22015
22731
  strokeLinecap: "round",
22016
22732
  strokeLinejoin: "round",
22017
22733
  strokeWidth: 2,
@@ -22026,10 +22742,10 @@ function SvgLocationPin(props) {
22026
22742
 
22027
22743
  var _switch;
22028
22744
 
22029
- 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); }
22745
+ 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); }
22030
22746
 
22031
22747
  function SvgSubscription(props) {
22032
- return /*#__PURE__*/React.createElement("svg", _extends$6({
22748
+ return /*#__PURE__*/React.createElement("svg", _extends$7({
22033
22749
  xmlns: "http://www.w3.org/2000/svg",
22034
22750
  viewBox: "0 0 100 125",
22035
22751
  fill: "currentColor"
@@ -22044,18 +22760,18 @@ function SvgSubscription(props) {
22044
22760
  }))))));
22045
22761
  }
22046
22762
 
22047
- var _path$5;
22763
+ var _path$6;
22048
22764
 
22049
- 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); }
22765
+ 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); }
22050
22766
 
22051
22767
  function SvgShopping(props) {
22052
- return /*#__PURE__*/React.createElement("svg", _extends$5({
22768
+ return /*#__PURE__*/React.createElement("svg", _extends$6({
22053
22769
  className: "plc-w-6 plc-h-6 plc-mr-2",
22054
22770
  xmlns: "http://www.w3.org/2000/svg",
22055
22771
  fill: "none",
22056
22772
  viewBox: "0 0 24 24",
22057
22773
  stroke: "currentColor"
22058
- }, props), _path$5 || (_path$5 = /*#__PURE__*/React.createElement("path", {
22774
+ }, props), _path$6 || (_path$6 = /*#__PURE__*/React.createElement("path", {
22059
22775
  strokeLinecap: "round",
22060
22776
  strokeLinejoin: "round",
22061
22777
  strokeWidth: 2,
@@ -22063,18 +22779,18 @@ function SvgShopping(props) {
22063
22779
  })));
22064
22780
  }
22065
22781
 
22066
- var _path$4;
22782
+ var _path$5;
22067
22783
 
22068
- 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); }
22784
+ 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); }
22069
22785
 
22070
22786
  function SvgBookmark(props) {
22071
- return /*#__PURE__*/React.createElement("svg", _extends$4({
22787
+ return /*#__PURE__*/React.createElement("svg", _extends$5({
22072
22788
  className: "plc-w-6 plc-h-6 plc-mr-2",
22073
22789
  xmlns: "http://www.w3.org/2000/svg",
22074
22790
  fill: "none",
22075
22791
  viewBox: "0 0 24 24",
22076
22792
  stroke: "currentColor"
22077
- }, props), _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
22793
+ }, props), _path$5 || (_path$5 = /*#__PURE__*/React.createElement("path", {
22078
22794
  strokeLinecap: "round",
22079
22795
  strokeLinejoin: "round",
22080
22796
  strokeWidth: 2,
@@ -22082,33 +22798,33 @@ function SvgBookmark(props) {
22082
22798
  })));
22083
22799
  }
22084
22800
 
22085
- var _path$3;
22801
+ var _path$4;
22086
22802
 
22087
- 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); }
22803
+ 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); }
22088
22804
 
22089
22805
  function SvgKey(props) {
22090
- return /*#__PURE__*/React.createElement("svg", _extends$3({
22806
+ return /*#__PURE__*/React.createElement("svg", _extends$4({
22091
22807
  xmlns: "http://www.w3.org/2000/svg",
22092
22808
  viewBox: "0 0 20 20",
22093
22809
  fill: "currentColor"
22094
- }, props), _path$3 || (_path$3 = /*#__PURE__*/React.createElement("path", {
22810
+ }, props), _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
22095
22811
  fillRule: "evenodd",
22096
22812
  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",
22097
22813
  clipRule: "evenodd"
22098
22814
  })));
22099
22815
  }
22100
22816
 
22101
- var _path$2;
22817
+ var _path$3;
22102
22818
 
22103
- 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); }
22819
+ 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); }
22104
22820
 
22105
22821
  function SvgDonate(props) {
22106
- return /*#__PURE__*/React.createElement("svg", _extends$2({
22822
+ return /*#__PURE__*/React.createElement("svg", _extends$3({
22107
22823
  width: 24,
22108
22824
  height: 24,
22109
22825
  fill: "currentColor",
22110
22826
  xmlns: "http://www.w3.org/2000/svg"
22111
- }, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
22827
+ }, props), _path$3 || (_path$3 = /*#__PURE__*/React.createElement("path", {
22112
22828
  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"
22113
22829
  })));
22114
22830
  }
@@ -22144,17 +22860,149 @@ const DonationsMenu = () => {
22144
22860
  }), subscriptions));
22145
22861
  };
22146
22862
 
22147
- function getDonationSubs() {
22148
- var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3, _window$Pelcro$user$r, _window$Pelcro$user$r2;
22863
+ function getDonationSubs() {
22864
+ var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3, _window$Pelcro$user$r, _window$Pelcro$user$r2;
22865
+
22866
+ 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 : [];
22867
+ 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 : [];
22868
+ return [...donations, ...canceledDonations];
22869
+ }
22870
+
22871
+ function formatStartDate(date) {
22872
+ const startDate = new Date(date);
22873
+ return new Intl.DateTimeFormat("en-CA").format(startDate);
22874
+ }
22875
+
22876
+ const InvoicesMenu = props => {
22877
+ const {
22878
+ t
22879
+ } = useTranslation("dashboard");
22880
+ return /*#__PURE__*/React__default.createElement("table", {
22881
+ className: "plc-w-full plc-table-fixed"
22882
+ }, /*#__PURE__*/React__default.createElement("thead", {
22883
+ className: "plc-text-xs plc-font-semibold plc-tracking-wider plc-text-gray-400 plc-uppercase "
22884
+ }, /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("th", {
22885
+ className: "plc-w-4/12 "
22886
+ }, t("labels.details")), /*#__PURE__*/React__default.createElement("th", {
22887
+ className: "plc-w-4/12 "
22888
+ }, t("labels.status.title")), /*#__PURE__*/React__default.createElement("th", {
22889
+ className: "plc-w-3/12 "
22890
+ }, t("labels.actions")))), /*#__PURE__*/React__default.createElement("tbody", null, /*#__PURE__*/React__default.createElement("tr", {
22891
+ className: "plc-h-4"
22892
+ }), /*#__PURE__*/React__default.createElement(InvoicesItems, props)));
22893
+ };
22894
+
22895
+ const InvoicesItems = () => {
22896
+ var _window$Pelcro$invoic, _window$Pelcro$invoic2;
22897
+
22898
+ const {
22899
+ t
22900
+ } = useTranslation("dashboard");
22901
+ const {
22902
+ setInvoice,
22903
+ switchView
22904
+ } = usePelcro();
22905
+ 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 : [];
22906
+
22907
+ const showInvoiceDetails = event => {
22908
+ if (setInvoice(event.target.dataset.id)) {
22909
+ switchView("invoice-details");
22910
+ }
22911
+ };
22912
+
22913
+ if (invoices.length === 0) return null;
22914
+ return invoices.sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime()).map(invoice => {
22915
+ const invoiceStatus = getInvoiceStatus(invoice);
22916
+ const formattedCreationDate = new Intl.DateTimeFormat("en-CA").format(new Date(invoice.created_at));
22917
+ return /*#__PURE__*/React__default.createElement("tr", {
22918
+ key: invoice.id,
22919
+ className: `plc-w-full plc-align-middle plc-cursor-pointer accordion-header hover:plc-bg-gray-50`
22920
+ }, /*#__PURE__*/React__default.createElement("td", {
22921
+ className: "plc-truncate"
22922
+ }, /*#__PURE__*/React__default.createElement("span", {
22923
+ className: "plc-font-semibold plc-text-gray-500"
22924
+ }, `#${invoice.id}`), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("span", {
22925
+ className: "plc-text-sm plc-text-gray-500"
22926
+ }, getFormattedPriceByLocal(invoice.total, invoice.currency, getPageOrDefaultLanguage())), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("span", {
22927
+ className: "plc-text-sm plc-text-gray-500"
22928
+ }, formattedCreationDate)), /*#__PURE__*/React__default.createElement("td", {
22929
+ className: "plc-py-2"
22930
+ }, /*#__PURE__*/React__default.createElement("span", {
22931
+ className: `plc-inline-flex plc-p-1 plc-text-xs plc-font-semibold ${invoiceStatus.bgColor} plc-uppercase ${invoiceStatus.textColor} plc-rounded-lg`
22932
+ }, invoiceStatus.icon, invoiceStatus.title)), /*#__PURE__*/React__default.createElement("td", null, /*#__PURE__*/React__default.createElement(Button, {
22933
+ variant: "ghost",
22934
+ className: "plc-text-blue-400 focus:plc-ring-blue-400 pelcro-dashboard-view-invoice-button",
22935
+ icon: /*#__PURE__*/React__default.createElement(SvgDocument, {
22936
+ className: "plc-w-4 plc-h-4"
22937
+ }),
22938
+ onClick: showInvoiceDetails,
22939
+ "data-id": invoice.id
22940
+ }, t("labels.view"))));
22941
+ });
22942
+ };
22943
+
22944
+ function getInvoiceStatus(invoice) {
22945
+ const translations = i18next.t("dashboard:labels", {
22946
+ returnObjects: true
22947
+ });
22948
+
22949
+ switch (invoice.status) {
22950
+ case "paid":
22951
+ return {
22952
+ textColor: "plc-text-green-700",
22953
+ bgColor: "plc-bg-green-100",
22954
+ icon: /*#__PURE__*/React__default.createElement(SvgCheckMark, null),
22955
+ title: translations.paid
22956
+ };
22957
+
22958
+ case "past_due":
22959
+ return {
22960
+ textColor: "plc-text-orange-700",
22961
+ bgColor: "plc-bg-orange-100",
22962
+ icon: /*#__PURE__*/React__default.createElement(SvgExclamation, null),
22963
+ title: translations.pastDue
22964
+ };
22149
22965
 
22150
- 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 : [];
22151
- 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 : [];
22152
- return [...donations, ...canceledDonations];
22153
- }
22966
+ case "open":
22967
+ return {
22968
+ textColor: "plc-text-yellow-700",
22969
+ bgColor: "plc-bg-yellow-100",
22970
+ icon: /*#__PURE__*/React__default.createElement(SvgExclamation, null),
22971
+ title: translations.open
22972
+ };
22154
22973
 
22155
- function formatStartDate(date) {
22156
- const startDate = new Date(date);
22157
- return new Intl.DateTimeFormat("en-CA").format(startDate);
22974
+ case "draft":
22975
+ return {
22976
+ textColor: "plc-text-blue-700",
22977
+ bgColor: "plc-bg-blue-100",
22978
+ icon: /*#__PURE__*/React__default.createElement(SvgEdit, null),
22979
+ title: translations.draft
22980
+ };
22981
+
22982
+ case "scheduled":
22983
+ return {
22984
+ textColor: "plc-text-blue-700",
22985
+ bgColor: "plc-bg-blue-100",
22986
+ icon: /*#__PURE__*/React__default.createElement(SvgCalendar, null),
22987
+ title: translations.scheduled
22988
+ };
22989
+
22990
+ case "uncollectible":
22991
+ return {
22992
+ textColor: "plc-text-red-700",
22993
+ bgColor: "plc-bg-red-100",
22994
+ icon: /*#__PURE__*/React__default.createElement(SvgXIconSolid, null),
22995
+ title: translations.uncollectible
22996
+ };
22997
+
22998
+ case "void":
22999
+ return {
23000
+ textColor: "plc-text-gray-700",
23001
+ bgColor: "plc-bg-gray-100",
23002
+ icon: /*#__PURE__*/React__default.createElement(SvgXIconSolid, null),
23003
+ title: translations.void
23004
+ };
23005
+ }
22158
23006
  }
22159
23007
 
22160
23008
  const SUB_MENUS = {
@@ -22303,9 +23151,10 @@ class Dashboard extends Component {
22303
23151
  }) => {
22304
23152
  if (isGift) {
22305
23153
  this.props.setProductAndPlan(null, null, true);
23154
+ return this.props.setView("plan-select");
22306
23155
  }
22307
23156
 
22308
- return this.props.setView("plan-select");
23157
+ return this.props.setView("subscription-options");
22309
23158
  });
22310
23159
 
22311
23160
  _defineProperty$3(this, "displayAddressCreate", () => {
@@ -22710,6 +23559,12 @@ class Dashboard extends Component {
22710
23559
  icon: /*#__PURE__*/React__default.createElement(SvgShopping, null),
22711
23560
  title: this.locale("labels.orders.label"),
22712
23561
  content: /*#__PURE__*/React__default.createElement(OrdersMenu, null)
23562
+ }), /*#__PURE__*/React__default.createElement(Accordion.item, {
23563
+ show: hasInvoices(),
23564
+ name: SUB_MENUS.INVOICES,
23565
+ icon: /*#__PURE__*/React__default.createElement(SvgDocument, null),
23566
+ title: this.locale("labels.invoices"),
23567
+ content: /*#__PURE__*/React__default.createElement(InvoicesMenu, null)
22713
23568
  }), /*#__PURE__*/React__default.createElement(Accordion.item, {
22714
23569
  name: SUB_MENUS.SAVED_ITEMS,
22715
23570
  icon: /*#__PURE__*/React__default.createElement(SvgBookmark, null),
@@ -22725,6 +23580,13 @@ class Dashboard extends Component {
22725
23580
 
22726
23581
  }
22727
23582
 
23583
+ function hasInvoices() {
23584
+ var _window$Pelcro$invoic, _window$Pelcro$invoic2;
23585
+
23586
+ 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 : [];
23587
+ return invoices.length > 0;
23588
+ }
23589
+
22728
23590
  function hasDonationSubs() {
22729
23591
  var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
22730
23592
 
@@ -22760,7 +23622,7 @@ const DashboardOpenButton = () => {
22760
23622
  };
22761
23623
  DashboardOpenButton.viewId = "dashboard-open";
22762
23624
 
22763
- const initialState$2 = {
23625
+ const initialState$3 = {
22764
23626
  imageSrc: null,
22765
23627
  crop: {
22766
23628
  x: 0,
@@ -22774,10 +23636,10 @@ const initialState$2 = {
22774
23636
  content: ""
22775
23637
  }
22776
23638
  };
22777
- const store$2 = /*#__PURE__*/createContext(initialState$2);
23639
+ const store$3 = /*#__PURE__*/createContext(initialState$3);
22778
23640
  const {
22779
- Provider: Provider$2
22780
- } = store$2;
23641
+ Provider: Provider$3
23642
+ } = store$3;
22781
23643
 
22782
23644
  const ProfilePicChangeContainer = ({
22783
23645
  style,
@@ -22911,21 +23773,21 @@ const ProfilePicChangeContainer = ({
22911
23773
  default:
22912
23774
  return state;
22913
23775
  }
22914
- }, initialState$2);
23776
+ }, initialState$3);
22915
23777
  return /*#__PURE__*/React__default.createElement("div", {
22916
23778
  style: { ...style
22917
23779
  },
22918
23780
  className: `pelcro-container pelcro-profile-picture-container ${className}`
22919
- }, /*#__PURE__*/React__default.createElement(Provider$2, {
23781
+ }, /*#__PURE__*/React__default.createElement(Provider$3, {
22920
23782
  value: {
22921
23783
  state,
22922
23784
  dispatch
22923
23785
  }
22924
23786
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
22925
- store: store$2,
23787
+ store: store$3,
22926
23788
  key: i
22927
23789
  })) : /*#__PURE__*/React__default.cloneElement(children, {
22928
- store: store$2
23790
+ store: store$3
22929
23791
  })));
22930
23792
  };
22931
23793
  /**
@@ -22987,7 +23849,7 @@ const ProfilePicChangeButton = ({
22987
23849
  isSubmitting
22988
23850
  },
22989
23851
  dispatch
22990
- } = useContext(store$2);
23852
+ } = useContext(store$3);
22991
23853
  const {
22992
23854
  t
22993
23855
  } = useTranslation("userEdit");
@@ -24355,7 +25217,7 @@ const ProfilePicChangeCropper = ({
24355
25217
  zoom
24356
25218
  },
24357
25219
  dispatch
24358
- } = useContext(store$2);
25220
+ } = useContext(store$3);
24359
25221
  return /*#__PURE__*/React__default.createElement("div", {
24360
25222
  className: `plc-relative plc-w-full plc-h-52 sm:plc-h-96 ${className}`
24361
25223
  }, /*#__PURE__*/React__default.createElement(Cropper, Object.assign({
@@ -24397,7 +25259,7 @@ const ProfilePicChangeZoom = ({
24397
25259
  zoom
24398
25260
  },
24399
25261
  dispatch
24400
- } = useContext(store$2);
25262
+ } = useContext(store$3);
24401
25263
  const {
24402
25264
  t
24403
25265
  } = useTranslation("userEdit");
@@ -24420,18 +25282,18 @@ const ProfilePicChangeZoom = ({
24420
25282
  }, otherProps)));
24421
25283
  };
24422
25284
 
24423
- var _path$1;
25285
+ var _path$2;
24424
25286
 
24425
- 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); }
25287
+ 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); }
24426
25288
 
24427
25289
  function SvgPhotograph(props) {
24428
- return /*#__PURE__*/React.createElement("svg", _extends$1({
25290
+ return /*#__PURE__*/React.createElement("svg", _extends$2({
24429
25291
  xmlns: "http://www.w3.org/2000/svg",
24430
25292
  className: "plc-h-6 plc-w-6",
24431
25293
  fill: "none",
24432
25294
  viewBox: "0 0 24 24",
24433
25295
  stroke: "currentColor"
24434
- }, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
25296
+ }, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
24435
25297
  strokeLinecap: "round",
24436
25298
  strokeLinejoin: "round",
24437
25299
  strokeWidth: 2,
@@ -24449,7 +25311,7 @@ const ProfilePicChangeSelectButton = ({
24449
25311
  state: {
24450
25312
  isSubmitting
24451
25313
  }
24452
- } = useContext(store$2);
25314
+ } = useContext(store$3);
24453
25315
  const {
24454
25316
  t
24455
25317
  } = useTranslation("userEdit");
@@ -24491,7 +25353,7 @@ const ProfilePicChangeRemoveButton = ({
24491
25353
  state: {
24492
25354
  isSubmitting
24493
25355
  }
24494
- } = useContext(store$2);
25356
+ } = useContext(store$3);
24495
25357
  const {
24496
25358
  t
24497
25359
  } = useTranslation("userEdit");
@@ -24514,7 +25376,7 @@ const ProfilePicChangeWrapper = () => {
24514
25376
  state: {
24515
25377
  imageSrc
24516
25378
  }
24517
- } = useContext(store$2);
25379
+ } = useContext(store$3);
24518
25380
  const {
24519
25381
  t
24520
25382
  } = useTranslation("userEdit");
@@ -24576,17 +25438,17 @@ function ProfilePicChangeModal({
24576
25438
  }
24577
25439
  ProfilePicChangeModal.viewId = "profile-picture";
24578
25440
 
24579
- const initialState$1 = {
25441
+ const initialState$2 = {
24580
25442
  isSubmitting: false,
24581
25443
  alert: {
24582
25444
  type: "error",
24583
25445
  content: ""
24584
25446
  }
24585
25447
  };
24586
- const store$1 = /*#__PURE__*/createContext(initialState$1);
25448
+ const store$2 = /*#__PURE__*/createContext(initialState$2);
24587
25449
  const {
24588
- Provider: Provider$1
24589
- } = store$1;
25450
+ Provider: Provider$2
25451
+ } = store$2;
24590
25452
 
24591
25453
  const EmailVerifyContainer = ({
24592
25454
  style,
@@ -24649,21 +25511,21 @@ const EmailVerifyContainer = ({
24649
25511
  default:
24650
25512
  return state;
24651
25513
  }
24652
- }, initialState$1);
25514
+ }, initialState$2);
24653
25515
  return /*#__PURE__*/React__default.createElement("div", {
24654
25516
  style: { ...style
24655
25517
  },
24656
25518
  className: `pelcro-container pelcro-email-verify-container ${className}`
24657
- }, /*#__PURE__*/React__default.createElement(Provider$1, {
25519
+ }, /*#__PURE__*/React__default.createElement(Provider$2, {
24658
25520
  value: {
24659
25521
  state,
24660
25522
  dispatch
24661
25523
  }
24662
25524
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
24663
- store: store$1,
25525
+ store: store$2,
24664
25526
  key: i
24665
25527
  })) : /*#__PURE__*/React__default.cloneElement(children, {
24666
- store: store$1
25528
+ store: store$2
24667
25529
  })));
24668
25530
  };
24669
25531
 
@@ -24677,7 +25539,7 @@ const EmailVerifyResendButton = ({
24677
25539
  state: {
24678
25540
  isSubmitting
24679
25541
  }
24680
- } = useContext(store$1);
25542
+ } = useContext(store$2);
24681
25543
  const {
24682
25544
  t
24683
25545
  } = useTranslation("verifyEmail");
@@ -24692,16 +25554,16 @@ const EmailVerifyResendButton = ({
24692
25554
  }, otherProps), name !== null && name !== void 0 ? name : t("labels.resend"));
24693
25555
  };
24694
25556
 
24695
- var _path, _path2;
25557
+ var _path$1, _path2;
24696
25558
 
24697
- 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); }
25559
+ 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); }
24698
25560
 
24699
25561
  function SvgEmailVerify(props) {
24700
- return /*#__PURE__*/React.createElement("svg", _extends({
25562
+ return /*#__PURE__*/React.createElement("svg", _extends$1({
24701
25563
  className: "plc-w-6 plc-h-6",
24702
25564
  viewBox: "0 0 700 700",
24703
25565
  xmlns: "http://www.w3.org/2000/svg"
24704
- }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
25566
+ }, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
24705
25567
  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"
24706
25568
  })), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
24707
25569
  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"
@@ -24805,11 +25667,11 @@ const invoicePaymentSubmitButton = props => {
24805
25667
  return /*#__PURE__*/React__default.createElement(SubmitPaymentMethod, props);
24806
25668
  };
24807
25669
 
24808
- const initialState = {};
24809
- const store = /*#__PURE__*/createContext(initialState);
25670
+ const initialState$1 = {};
25671
+ const store$1 = /*#__PURE__*/createContext(initialState$1);
24810
25672
  const {
24811
- Provider
24812
- } = store;
25673
+ Provider: Provider$1
25674
+ } = store$1;
24813
25675
 
24814
25676
  const InvoiceDetailsContainer = ({
24815
25677
  style,
@@ -24830,21 +25692,21 @@ const InvoiceDetailsContainer = ({
24830
25692
  default:
24831
25693
  return state;
24832
25694
  }
24833
- }, initialState);
25695
+ }, initialState$1);
24834
25696
  return /*#__PURE__*/React__default.createElement("div", {
24835
25697
  style: { ...style
24836
25698
  },
24837
25699
  className: `pelcro-container pelcro-invoice-details-container ${className}`
24838
- }, /*#__PURE__*/React__default.createElement(Provider, {
25700
+ }, /*#__PURE__*/React__default.createElement(Provider$1, {
24839
25701
  value: {
24840
25702
  state,
24841
25703
  dispatch
24842
25704
  }
24843
25705
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
24844
- store,
25706
+ store: store$1,
24845
25707
  key: i
24846
25708
  })) : /*#__PURE__*/React__default.cloneElement(children, {
24847
- store
25709
+ store: store$1
24848
25710
  })));
24849
25711
  };
24850
25712
 
@@ -24876,7 +25738,7 @@ const InvoiceDetailsPayButton = ({
24876
25738
  }) => {
24877
25739
  const {
24878
25740
  dispatch
24879
- } = useContext(store);
25741
+ } = useContext(store$1);
24880
25742
  const {
24881
25743
  t
24882
25744
  } = useTranslation("invoiceDetails");
@@ -24898,6 +25760,8 @@ const InvoiceDetailsView = props => {
24898
25760
  invoice
24899
25761
  } = usePelcro();
24900
25762
  const showPayButton = canPayInvoice(invoice);
25763
+ const showDownloadButton = Boolean(invoice === null || invoice === void 0 ? void 0 : invoice.invoice_pdf);
25764
+ const hasPlanDetails = Boolean(invoice.plan);
24901
25765
  const creationDate = new Date(invoice === null || invoice === void 0 ? void 0 : invoice.created_at);
24902
25766
  const formattedCreationDate = new Intl.DateTimeFormat("en-CA").format(creationDate);
24903
25767
  return /*#__PURE__*/React__default.createElement("div", {
@@ -24915,7 +25779,7 @@ const InvoiceDetailsView = props => {
24915
25779
  className: "plc-font-bold pelcro-invoice-summary-title"
24916
25780
  }, t("labels.summary")), invoice && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("p", {
24917
25781
  className: "plc-mr-2 pelcro-invoice-creation-date"
24918
- }, `${t("labels.creationDate")} ${formattedCreationDate}`), /*#__PURE__*/React__default.createElement("div", {
25782
+ }, `${t("labels.creationDate")} ${formattedCreationDate}`), hasPlanDetails && /*#__PURE__*/React__default.createElement("div", {
24919
25783
  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"
24920
25784
  }, /*#__PURE__*/React__default.createElement("div", {
24921
25785
  className: "plc-break-words pelcro-invoice-plan-name"
@@ -24941,7 +25805,7 @@ const InvoiceDetailsView = props => {
24941
25805
  className: "plc-font-semibold pelcro-invoice-total"
24942
25806
  }, getFormattedPriceByLocal(invoice.amount_remaining, invoice.currency, getPageOrDefaultLanguage())))))), /*#__PURE__*/React__default.createElement("div", {
24943
25807
  className: "plc-flex plc-items-center plc-justify-center plc-mt-4"
24944
- }, /*#__PURE__*/React__default.createElement(InvoiceDetailsDownloadButton, {
25808
+ }, showDownloadButton && /*#__PURE__*/React__default.createElement(InvoiceDetailsDownloadButton, {
24945
25809
  url: invoice === null || invoice === void 0 ? void 0 : invoice.invoice_pdf,
24946
25810
  className: "plc-w-full plc-text-center"
24947
25811
  }), showPayButton && /*#__PURE__*/React__default.createElement(InvoiceDetailsPayButton, {
@@ -24981,4 +25845,230 @@ const InvoiceDetailsModal = ({
24981
25845
  };
24982
25846
  InvoiceDetailsModal.viewId = "invoice-details";
24983
25847
 
24984
- export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplyCouponButton, Auth0LoginButton, Badge, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, Email, EmailVerifyContainer, EmailVerifyModal, EmailVerifyResendButton, EmailVerifyView, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, Input, InvoiceDetailsContainer, InvoiceDetailsDownloadButton, InvoiceDetailsModal, InvoiceDetailsPayButton, InvoiceDetailsView, InvoicePaymentContainer, InvoicePaymentModal, InvoicePaymentView, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCreateContainer, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, TaxAmount, TextArea, Tooltip, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, invoicePaymentSubmitButton, notify, unauthenticatedButtons, usePelcro };
25848
+ const initialState = {
25849
+ selectedOption: ""
25850
+ };
25851
+ const store = /*#__PURE__*/createContext(initialState);
25852
+ const {
25853
+ Provider
25854
+ } = store;
25855
+
25856
+ const SubscriptionOptionsContainer = ({
25857
+ style,
25858
+ className = "",
25859
+ onRenewSubSuccess = () => {},
25860
+ onNewSubSuccess = () => {},
25861
+ children,
25862
+ ...props
25863
+ }) => {
25864
+ const submit = ({
25865
+ selectedOption
25866
+ }, dispatch) => {
25867
+ if (selectedOption === "renew") return onRenewSubSuccess();
25868
+ if (selectedOption === "new") return onNewSubSuccess();
25869
+ };
25870
+
25871
+ const [state, dispatch] = useReducerWithSideEffects((state, action) => {
25872
+ switch (action.type) {
25873
+ case SWITCH_TO_NEW:
25874
+ return lib_7({ ...state,
25875
+ selectedOption: "new"
25876
+ });
25877
+
25878
+ case SWITCH_TO_RENEW:
25879
+ return lib_7({ ...state,
25880
+ selectedOption: "renew"
25881
+ });
25882
+
25883
+ case HANDLE_SUBMIT:
25884
+ return lib_4((state, dispatch) => submit(state));
25885
+
25886
+ default:
25887
+ return state;
25888
+ }
25889
+ }, initialState);
25890
+ return /*#__PURE__*/React__default.createElement("div", {
25891
+ style: { ...style
25892
+ },
25893
+ className: `pelcro-container pelcro-subscription-options-container ${className}`
25894
+ }, /*#__PURE__*/React__default.createElement(Provider, {
25895
+ value: {
25896
+ state,
25897
+ dispatch
25898
+ }
25899
+ }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
25900
+ store,
25901
+ key: i
25902
+ })) : /*#__PURE__*/React__default.cloneElement(children, {
25903
+ store
25904
+ })));
25905
+ };
25906
+
25907
+ var _path;
25908
+
25909
+ 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); }
25910
+
25911
+ function SvgPlusCircle(props) {
25912
+ return /*#__PURE__*/React.createElement("svg", _extends({
25913
+ xmlns: "http://www.w3.org/2000/svg",
25914
+ className: "plc-h-6 plc-w-6",
25915
+ fill: "none",
25916
+ viewBox: "0 0 24 24",
25917
+ stroke: "currentColor",
25918
+ strokeWidth: 2
25919
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
25920
+ strokeLinecap: "round",
25921
+ strokeLinejoin: "round",
25922
+ d: "M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"
25923
+ })));
25924
+ }
25925
+
25926
+ const SubscriptionOptionsNewButton = ({
25927
+ name,
25928
+ onClick,
25929
+ ...otherProps
25930
+ }) => {
25931
+ const {
25932
+ dispatch,
25933
+ state: {
25934
+ selectedOption
25935
+ }
25936
+ } = useContext(store);
25937
+ const {
25938
+ t
25939
+ } = useTranslation("subscriptionOptions");
25940
+ const isChecked = selectedOption === "new";
25941
+ return /*#__PURE__*/React__default.createElement(Radio, Object.assign({
25942
+ className: "plc-hidden pelcro-new-sub-option",
25943
+ 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"}`,
25944
+ id: "pelcro-new-sub-option",
25945
+ name: "option",
25946
+ onChange: () => {
25947
+ dispatch({
25948
+ type: SWITCH_TO_NEW
25949
+ });
25950
+ onClick === null || onClick === void 0 ? void 0 : onClick();
25951
+ },
25952
+ checked: isChecked
25953
+ }, otherProps), name !== null && name !== void 0 ? name : t("addNew"), /*#__PURE__*/React__default.createElement(SvgPlusCircle, {
25954
+ className: "plc-w-full plc-h-full plc-mr-0"
25955
+ }));
25956
+ };
25957
+
25958
+ const SubscriptionOptionsRenewButton = ({
25959
+ name,
25960
+ onClick,
25961
+ ...otherProps
25962
+ }) => {
25963
+ const {
25964
+ dispatch,
25965
+ state: {
25966
+ selectedOption
25967
+ }
25968
+ } = useContext(store);
25969
+ const {
25970
+ t
25971
+ } = useTranslation("subscriptionOptions");
25972
+ const isChecked = selectedOption === "renew";
25973
+ return /*#__PURE__*/React__default.createElement(Radio, Object.assign({
25974
+ className: "plc-hidden pelcro-renew-sub-option",
25975
+ 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"}`,
25976
+ id: "pelcro-renew-sub-option",
25977
+ name: "option",
25978
+ onChange: () => {
25979
+ dispatch({
25980
+ type: SWITCH_TO_RENEW
25981
+ });
25982
+ onClick === null || onClick === void 0 ? void 0 : onClick();
25983
+ },
25984
+ checked: isChecked
25985
+ }, otherProps), name !== null && name !== void 0 ? name : t("renew"), /*#__PURE__*/React__default.createElement(SvgRefresh, {
25986
+ className: "plc-w-full plc-h-full plc-mr-0"
25987
+ }));
25988
+ };
25989
+
25990
+ const SubscriptionOptionsSubmit = ({
25991
+ name,
25992
+ onClick,
25993
+ ...otherProps
25994
+ }) => {
25995
+ const {
25996
+ dispatch,
25997
+ state: {
25998
+ selectedOption
25999
+ }
26000
+ } = useContext(store);
26001
+ const {
26002
+ t
26003
+ } = useTranslation("subscriptionOptions");
26004
+ return /*#__PURE__*/React__default.createElement(Button, Object.assign({
26005
+ onClick: () => {
26006
+ dispatch({
26007
+ type: HANDLE_SUBMIT
26008
+ });
26009
+ onClick === null || onClick === void 0 ? void 0 : onClick();
26010
+ },
26011
+ disabled: !selectedOption
26012
+ }, otherProps), name !== null && name !== void 0 ? name : t("next"));
26013
+ };
26014
+
26015
+ const SubscriptionOptionsView = props => {
26016
+ const {
26017
+ t
26018
+ } = useTranslation("subscriptionOptions");
26019
+ return /*#__PURE__*/React__default.createElement("div", {
26020
+ id: "pelcro-subscription-options-view"
26021
+ }, /*#__PURE__*/React__default.createElement("div", {
26022
+ className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
26023
+ }, /*#__PURE__*/React__default.createElement("h4", {
26024
+ className: "plc-text-2xl plc-font-semibold"
26025
+ }, t("title")), /*#__PURE__*/React__default.createElement("p", null, t("subtitle"))), /*#__PURE__*/React__default.createElement("form", {
26026
+ action: "javascript:void(0);",
26027
+ className: "plc-mt-2 pelcro-form"
26028
+ }, /*#__PURE__*/React__default.createElement(SubscriptionOptionsContainer, props, /*#__PURE__*/React__default.createElement("div", {
26029
+ className: "plc-flex plc-justify-between plc-items-center"
26030
+ }, /*#__PURE__*/React__default.createElement(SubscriptionOptionsRenewButton, null), /*#__PURE__*/React__default.createElement(SubscriptionOptionsNewButton, null)), /*#__PURE__*/React__default.createElement(SubscriptionOptionsSubmit, {
26031
+ role: "submit",
26032
+ className: "plc-mt-4 plc-w-full",
26033
+ name: t("next"),
26034
+ id: "pelcro-submit"
26035
+ }))));
26036
+ };
26037
+
26038
+ const SubscriptionOptionsModal = ({
26039
+ onDisplay,
26040
+ onClose,
26041
+ ...otherProps
26042
+ }) => {
26043
+ const {
26044
+ switchView,
26045
+ setProductsList
26046
+ } = usePelcro();
26047
+
26048
+ const onRenewSubSuccess = () => {
26049
+ var _otherProps$onRenewSu;
26050
+
26051
+ (_otherProps$onRenewSu = otherProps.onRenewSubSuccess) === null || _otherProps$onRenewSu === void 0 ? void 0 : _otherProps$onRenewSu.call(otherProps);
26052
+ setProductsList(getRenewableProducts());
26053
+ switchView("_plan-select-renew");
26054
+ };
26055
+
26056
+ const onNewSubSuccess = () => {
26057
+ var _otherProps$onNewSubS;
26058
+
26059
+ (_otherProps$onNewSubS = otherProps.onNewSubSuccess) === null || _otherProps$onNewSubS === void 0 ? void 0 : _otherProps$onNewSubS.call(otherProps);
26060
+ switchView("plan-select");
26061
+ };
26062
+
26063
+ return /*#__PURE__*/React__default.createElement(Modal, {
26064
+ onDisplay: onDisplay,
26065
+ onClose: onClose,
26066
+ id: "pelcro-subscription-options-modal"
26067
+ }, /*#__PURE__*/React__default.createElement(ModalBody, null, /*#__PURE__*/React__default.createElement(SubscriptionOptionsView, Object.assign({}, otherProps, {
26068
+ onNewSubSuccess: onNewSubSuccess,
26069
+ onRenewSubSuccess: onRenewSubSuccess
26070
+ }))), /*#__PURE__*/React__default.createElement(ModalFooter, null, /*#__PURE__*/React__default.createElement(Authorship, null)));
26071
+ };
26072
+ SubscriptionOptionsModal.viewId = "subscription-options";
26073
+
26074
+ export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplyCouponButton, Auth0LoginButton, Badge, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, Email, EmailVerifyContainer, EmailVerifyModal, EmailVerifyResendButton, EmailVerifyView, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, Input, InvoiceDetailsContainer, InvoiceDetailsDownloadButton, InvoiceDetailsModal, InvoiceDetailsPayButton, InvoiceDetailsView, InvoicePaymentContainer, InvoicePaymentModal, InvoicePaymentView, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCreateContainer, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionOptionsContainer, SubscriptionOptionsModal, SubscriptionOptionsNewButton, SubscriptionOptionsRenewButton, SubscriptionOptionsSubmit, SubscriptionOptionsView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, TaxAmount, TextArea, Tooltip, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, invoicePaymentSubmitButton, notify, unauthenticatedButtons, usePelcro };