@pelcro/react-pelcro-js 3.0.0-beta.1 → 3.0.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -3246,7 +3246,7 @@ var validation$1 = {
3246
3246
  enterEmail: "Un courriel est requis.",
3247
3247
  enterPassword: "Mot de passe requis."
3248
3248
  };
3249
- var buttons$7 = {
3249
+ var buttons$9 = {
3250
3250
  account: "Accès abonné(e)s",
3251
3251
  login: "Se connecter"
3252
3252
  };
@@ -3323,7 +3323,7 @@ var confirm$5 = {
3323
3323
  };
3324
3324
  var common_fr = {
3325
3325
  validation: validation$1,
3326
- buttons: buttons$7,
3326
+ buttons: buttons$9,
3327
3327
  dashboard: dashboard$1,
3328
3328
  select: select$3,
3329
3329
  confirm: confirm$5
@@ -3334,7 +3334,7 @@ var validation = {
3334
3334
  enterEmail: "Email address is required.",
3335
3335
  enterPassword: "Password is required."
3336
3336
  };
3337
- var buttons$6 = {
3337
+ var buttons$8 = {
3338
3338
  account: "My account",
3339
3339
  login: "Login"
3340
3340
  };
@@ -3411,7 +3411,7 @@ var confirm$4 = {
3411
3411
  };
3412
3412
  var common_en = {
3413
3413
  validation: validation,
3414
- buttons: buttons$6,
3414
+ buttons: buttons$8,
3415
3415
  dashboard: dashboard,
3416
3416
  select: select$2,
3417
3417
  confirm: confirm$4
@@ -3461,10 +3461,10 @@ var paymentMethod_fr = {
3461
3461
  select: select
3462
3462
  };
3463
3463
 
3464
- var title$d = "Enter your email to subscribe to our newsletter";
3464
+ var title$f = "Enter your email to subscribe to our newsletter";
3465
3465
  var updateTitle$1 = "Update newsletter selections";
3466
3466
  var subtitle$7 = "We may use your email for other marketing communication";
3467
- var labels$n = {
3467
+ var labels$p = {
3468
3468
  submit: "Submit",
3469
3469
  firstName: "First name",
3470
3470
  lastName: "Last name",
@@ -3480,17 +3480,17 @@ var messages$r = {
3480
3480
  here: "here"
3481
3481
  };
3482
3482
  var newsletter_en = {
3483
- title: title$d,
3483
+ title: title$f,
3484
3484
  updateTitle: updateTitle$1,
3485
3485
  subtitle: subtitle$7,
3486
- labels: labels$n,
3486
+ labels: labels$p,
3487
3487
  messages: messages$r
3488
3488
  };
3489
3489
 
3490
- var title$c = "Entrez votre adresse courriel pour vous abonner à notre infolettre";
3490
+ var title$e = "Entrez votre adresse courriel pour vous abonner à notre infolettre";
3491
3491
  var updateTitle = "Mettre à jour son choix d'infolettres";
3492
3492
  var subtitle$6 = "Nous pouvons utiliser votre adresse courriel pour d’autres communications marketing";
3493
- var labels$m = {
3493
+ var labels$o = {
3494
3494
  submit: "Lire l’article !",
3495
3495
  firstName: "Prénom",
3496
3496
  lastName: "Nom de famille",
@@ -3506,14 +3506,14 @@ var messages$q = {
3506
3506
  here: "ici"
3507
3507
  };
3508
3508
  var newsletter_fr = {
3509
- title: title$c,
3509
+ title: title$e,
3510
3510
  updateTitle: updateTitle,
3511
3511
  subtitle: subtitle$6,
3512
- labels: labels$m,
3512
+ labels: labels$o,
3513
3513
  messages: messages$q
3514
3514
  };
3515
3515
 
3516
- var labels$l = {
3516
+ var labels$n = {
3517
3517
  "continue": "Continue to content"
3518
3518
  };
3519
3519
  var messages$p = {
@@ -3532,18 +3532,22 @@ var messages$p = {
3532
3532
  giftRedeem: {
3533
3533
  title: "Congratulations",
3534
3534
  content: "You have successfully redeemed your gift subscription. Enjoy!"
3535
+ },
3536
+ invoicePayment: {
3537
+ title: "Invoice paid successfully",
3538
+ content: "Please contact us if you have any questions or concerns."
3535
3539
  }
3536
3540
  };
3537
3541
  var errors$9 = {
3538
3542
  "": ""
3539
3543
  };
3540
3544
  var success_en = {
3541
- labels: labels$l,
3545
+ labels: labels$n,
3542
3546
  messages: messages$p,
3543
3547
  errors: errors$9
3544
3548
  };
3545
3549
 
3546
- var labels$k = {
3550
+ var labels$m = {
3547
3551
  "continue": "Abonnement réussi !"
3548
3552
  };
3549
3553
  var messages$o = {
@@ -3562,13 +3566,17 @@ var messages$o = {
3562
3566
  giftRedeem: {
3563
3567
  title: "Félicitations",
3564
3568
  content: "Vous avez validé votre abonnement cadeau. Profitez-en!"
3569
+ },
3570
+ invoicePayment: {
3571
+ title: "Invoice paid successfully",
3572
+ content: "Please contact us if you have any questions or concerns."
3565
3573
  }
3566
3574
  };
3567
3575
  var errors$8 = {
3568
3576
  "": ""
3569
3577
  };
3570
3578
  var success_fr = {
3571
- labels: labels$k,
3579
+ labels: labels$m,
3572
3580
  messages: messages$o,
3573
3581
  errors: errors$8
3574
3582
  };
@@ -3605,7 +3613,7 @@ var messages$l = {
3605
3613
  youAreSafe: "You're safe - PCI compliant 128 SSL by",
3606
3614
  bankRedirection: "Please hold, redirecting you to your bank."
3607
3615
  };
3608
- var labels$j = {
3616
+ var labels$l = {
3609
3617
  card: "Enter card number",
3610
3618
  date: "Expiration date",
3611
3619
  CVC: "CVC",
@@ -3625,14 +3633,14 @@ var labels$j = {
3625
3633
  };
3626
3634
  var checkoutForm_en = {
3627
3635
  messages: messages$l,
3628
- labels: labels$j
3636
+ labels: labels$l
3629
3637
  };
3630
3638
 
3631
3639
  var messages$k = {
3632
3640
  youAreSafe: "Vous êtes en sécurité - PCI conforme 128 SSL par",
3633
3641
  bankRedirection: "Veuillez patienter, nous vous redirigeons vers votre banque."
3634
3642
  };
3635
- var labels$i = {
3643
+ var labels$k = {
3636
3644
  card: "Entrez le numéro de carte",
3637
3645
  date: "Date d’expiration",
3638
3646
  CVC: "CVC",
@@ -3652,7 +3660,7 @@ var labels$i = {
3652
3660
  };
3653
3661
  var checkoutForm_fr = {
3654
3662
  messages: messages$k,
3655
- labels: labels$i
3663
+ labels: labels$k
3656
3664
  };
3657
3665
 
3658
3666
  var youAreSafe$1 = "You're safe - PCI compliant 128 SSL by";
@@ -3661,13 +3669,15 @@ var giftSent$1 = "Subscription gift has been sent to";
3661
3669
  var successfully$1 = "successfully";
3662
3670
  var entitlement$1 = "Some of the content on this page is available with one or more of our plans. <1>Subscribe</1> now to get full page access.";
3663
3671
  var recaptcha$1 = "This site is protected by reCAPTCHA and the Google <1>Privacy Policy</1> and <3>Terms of Service</3> apply.";
3672
+ var invalidInvoice$1 = "Invalid invoice ID, please contact support";
3664
3673
  var messages_en = {
3665
3674
  youAreSafe: youAreSafe$1,
3666
3675
  cancel: cancel$1,
3667
3676
  giftSent: giftSent$1,
3668
3677
  successfully: successfully$1,
3669
3678
  entitlement: entitlement$1,
3670
- recaptcha: recaptcha$1
3679
+ recaptcha: recaptcha$1,
3680
+ invalidInvoice: invalidInvoice$1
3671
3681
  };
3672
3682
 
3673
3683
  var youAreSafe = "Vous êtes en sécurité - PCI conforme 128 SSL par";
@@ -3676,16 +3686,18 @@ var giftSent = "Le cadeau d’abonnement a été envoyé à";
3676
3686
  var successfully = "avec succès.";
3677
3687
  var entitlement = "Une partie du contenu de cette page est disponible sous un ou plusieurs de nos plans. <1>Abonnez-vous</1> à l'un de nos plans disponibles pour accéder à plus de contenu";
3678
3688
  var recaptcha = "Ce site est protégé par reCAPTCHA - les <1>règles de confidentialité</1> Google ainsi que les <3>conditions d'utilisation</3> s'appliquent.";
3689
+ var invalidInvoice = "Invalid invoice ID, please contact support";
3679
3690
  var messages_fr = {
3680
3691
  youAreSafe: youAreSafe,
3681
3692
  cancel: cancel,
3682
3693
  giftSent: giftSent,
3683
3694
  successfully: successfully,
3684
3695
  entitlement: entitlement,
3685
- recaptcha: recaptcha
3696
+ recaptcha: recaptcha,
3697
+ invalidInvoice: invalidInvoice
3686
3698
  };
3687
3699
 
3688
- var labels$h = {
3700
+ var labels$j = {
3689
3701
  email: "Enter email",
3690
3702
  password: "Enter password",
3691
3703
  required: "required",
@@ -3712,12 +3724,12 @@ var errors$5 = {
3712
3724
  "": ""
3713
3725
  };
3714
3726
  var login_en = {
3715
- labels: labels$h,
3727
+ labels: labels$j,
3716
3728
  messages: messages$j,
3717
3729
  errors: errors$5
3718
3730
  };
3719
3731
 
3720
- var labels$g = {
3732
+ var labels$i = {
3721
3733
  email: "Entrez votre adresse courriel",
3722
3734
  password: "Entrez votre mot de passe",
3723
3735
  required: "Champs obligatoires",
@@ -3744,14 +3756,14 @@ var errors$4 = {
3744
3756
  "": ""
3745
3757
  };
3746
3758
  var login_fr = {
3747
- labels: labels$g,
3759
+ labels: labels$i,
3748
3760
  messages: messages$i,
3749
3761
  errors: errors$4
3750
3762
  };
3751
3763
 
3752
- var title$b = "Create an account";
3764
+ var title$d = "Create an account";
3753
3765
  var subtitle$5 = "Enter your email and password below";
3754
- var labels$f = {
3766
+ var labels$h = {
3755
3767
  signUpFacebook: "Sign up with Facebook",
3756
3768
  signUpGoogle: "Sign up with Google",
3757
3769
  signUpEmail: "Sign up with Email",
@@ -3835,18 +3847,18 @@ var redeem$1 = {
3835
3847
  }
3836
3848
  };
3837
3849
  var register_en = {
3838
- title: title$b,
3850
+ title: title$d,
3839
3851
  subtitle: subtitle$5,
3840
- labels: labels$f,
3852
+ labels: labels$h,
3841
3853
  messages: messages$h,
3842
3854
  errors: errors$3,
3843
3855
  gift: gift$1,
3844
3856
  redeem: redeem$1
3845
3857
  };
3846
3858
 
3847
- var title$a = "Créer un compte";
3859
+ var title$c = "Créer un compte";
3848
3860
  var subtitle$4 = "Entrez votre courriel et votre mot de passe ci-dessous";
3849
- var labels$e = {
3861
+ var labels$g = {
3850
3862
  signUpFacebook: "Inscrivez-vous avec Facebook",
3851
3863
  signUpGoogle: "Inscrivez-vous avec Google",
3852
3864
  signUpEmail: "Inscrivez-vous avec votre courriel",
@@ -3931,16 +3943,16 @@ var redeem = {
3931
3943
  }
3932
3944
  };
3933
3945
  var register_fr = {
3934
- title: title$a,
3946
+ title: title$c,
3935
3947
  subtitle: subtitle$4,
3936
- labels: labels$e,
3948
+ labels: labels$g,
3937
3949
  messages: messages$g,
3938
3950
  errors: errors$2,
3939
3951
  gift: gift,
3940
3952
  redeem: redeem
3941
3953
  };
3942
3954
 
3943
- var labels$d = {
3955
+ var labels$f = {
3944
3956
  title: "Want to update your profile?",
3945
3957
  subtitle: "Enter your information below to update your profile",
3946
3958
  email: "Email",
@@ -3962,11 +3974,11 @@ var messages$f = {
3962
3974
  pictureUpdated: "Your profile picture was updated successfully."
3963
3975
  };
3964
3976
  var userEdit_en = {
3965
- labels: labels$d,
3977
+ labels: labels$f,
3966
3978
  messages: messages$f
3967
3979
  };
3968
3980
 
3969
- var labels$c = {
3981
+ var labels$e = {
3970
3982
  title: "Voulez-vous mettre à jour votre profil ?",
3971
3983
  subtitle: "Entrez vos informations ci-dessous pour mettre à jour votre profil",
3972
3984
  email: "Address courriel",
@@ -3988,14 +4000,14 @@ var messages$e = {
3988
4000
  pictureUpdated: "Votre photo de profil a été mise à jour avec succès."
3989
4001
  };
3990
4002
  var userEdit_fr = {
3991
- labels: labels$c,
4003
+ labels: labels$e,
3992
4004
  messages: messages$e
3993
4005
  };
3994
4006
 
3995
- var title$9 = "Enter your shipping address";
4007
+ var title$b = "Enter your shipping address";
3996
4008
  var selectAddressTitle$1 = "Please select an address";
3997
4009
  var selectAddressSubtitle$1 = "Select one of your saved addresses, or add a new one";
3998
- var labels$b = {
4010
+ var labels$d = {
3999
4011
  address: "Address",
4000
4012
  code: "Postal Code/Zip",
4001
4013
  city: "City",
@@ -4005,7 +4017,7 @@ var labels$b = {
4005
4017
  lastName: "Last name",
4006
4018
  required: "required"
4007
4019
  };
4008
- var buttons$5 = {
4020
+ var buttons$7 = {
4009
4021
  submit: "Submit",
4010
4022
  selectAddress: "Select address",
4011
4023
  addAddress: "Add new address"
@@ -4015,18 +4027,18 @@ var messages$d = {
4015
4027
  subRedeemed: "Your subscription has been redeemed."
4016
4028
  };
4017
4029
  var address_en = {
4018
- title: title$9,
4030
+ title: title$b,
4019
4031
  selectAddressTitle: selectAddressTitle$1,
4020
4032
  selectAddressSubtitle: selectAddressSubtitle$1,
4021
- labels: labels$b,
4022
- buttons: buttons$5,
4033
+ labels: labels$d,
4034
+ buttons: buttons$7,
4023
4035
  messages: messages$d
4024
4036
  };
4025
4037
 
4026
- var title$8 = "Entrez votre adresse de livraison";
4038
+ var title$a = "Entrez votre adresse de livraison";
4027
4039
  var selectAddressTitle = "Veuillez sélectionner une adresse";
4028
4040
  var selectAddressSubtitle = "Choisissez l'une de vos adresses ou créez-en une nouvelle";
4029
- var labels$a = {
4041
+ var labels$c = {
4030
4042
  address: "Adresse",
4031
4043
  code: "Code postal / Zip",
4032
4044
  city: "Ville",
@@ -4036,7 +4048,7 @@ var labels$a = {
4036
4048
  lastName: "Nom de famille",
4037
4049
  required: "Champs obligatoires"
4038
4050
  };
4039
- var buttons$4 = {
4051
+ var buttons$6 = {
4040
4052
  submit: "Valider",
4041
4053
  selectAddress: "Choisir cette adresse",
4042
4054
  addAddress: "Ajouter une nouvelle adresse"
@@ -4046,15 +4058,15 @@ var messages$c = {
4046
4058
  subRedeemed: "Votre abonnement a bien été activé."
4047
4059
  };
4048
4060
  var address_fr = {
4049
- title: title$8,
4061
+ title: title$a,
4050
4062
  selectAddressTitle: selectAddressTitle,
4051
4063
  selectAddressSubtitle: selectAddressSubtitle,
4052
- labels: labels$a,
4053
- buttons: buttons$4,
4064
+ labels: labels$c,
4065
+ buttons: buttons$6,
4054
4066
  messages: messages$c
4055
4067
  };
4056
4068
 
4057
- var title$7 = "Reset your password";
4069
+ var title$9 = "Reset your password";
4058
4070
  var subtitle$3 = "Enter a new password below";
4059
4071
  var email$3 = "Email";
4060
4072
  var password$3 = "Password";
@@ -4063,7 +4075,7 @@ var submit$5 = "Submit";
4063
4075
  var required$5 = "Required";
4064
4076
  var passwordUpdated$1 = "Password has been updated, please login with the new password";
4065
4077
  var passwordReset_en = {
4066
- title: title$7,
4078
+ title: title$9,
4067
4079
  subtitle: subtitle$3,
4068
4080
  email: email$3,
4069
4081
  password: password$3,
@@ -4073,7 +4085,7 @@ var passwordReset_en = {
4073
4085
  passwordUpdated: passwordUpdated$1
4074
4086
  };
4075
4087
 
4076
- var title$6 = "Réinitialiser votre mot de passe";
4088
+ var title$8 = "Réinitialiser votre mot de passe";
4077
4089
  var subtitle$2 = "Entrez un nouveau mot de passe ci-dessous";
4078
4090
  var email$2 = "Adresse courriel";
4079
4091
  var password$2 = "Mot de passe";
@@ -4082,7 +4094,7 @@ var submit$4 = "Soumettre";
4082
4094
  var required$4 = "Champs obligatoires";
4083
4095
  var passwordUpdated = "Votre mot de passe a été mis à jour, veuillez vous connecter avec celui-ci";
4084
4096
  var passwordReset_fr = {
4085
- title: title$6,
4097
+ title: title$8,
4086
4098
  subtitle: subtitle$2,
4087
4099
  email: email$2,
4088
4100
  password: password$2,
@@ -4092,7 +4104,7 @@ var passwordReset_fr = {
4092
4104
  passwordUpdated: passwordUpdated
4093
4105
  };
4094
4106
 
4095
- var title$5 = "Forgot your password?";
4107
+ var title$7 = "Forgot your password?";
4096
4108
  var email$1 = "Email";
4097
4109
  var password$1 = "Password";
4098
4110
  var submit$3 = "Submit";
@@ -4103,7 +4115,7 @@ var messages$b = {
4103
4115
  loginHere: "login here."
4104
4116
  };
4105
4117
  var passwordForgot_en = {
4106
- title: title$5,
4118
+ title: title$7,
4107
4119
  email: email$1,
4108
4120
  password: password$1,
4109
4121
  submit: submit$3,
@@ -4112,7 +4124,7 @@ var passwordForgot_en = {
4112
4124
  messages: messages$b
4113
4125
  };
4114
4126
 
4115
- var title$4 = "Mot de passe oublié ?";
4127
+ var title$6 = "Mot de passe oublié ?";
4116
4128
  var email = "Courriel";
4117
4129
  var password = "Mot de passe";
4118
4130
  var submit$2 = "Soumettre";
@@ -4123,7 +4135,7 @@ var messages$a = {
4123
4135
  loginHere: "Connectez-vous ici"
4124
4136
  };
4125
4137
  var passwordForgot_fr = {
4126
- title: title$4,
4138
+ title: title$6,
4127
4139
  email: email,
4128
4140
  password: password,
4129
4141
  submit: submit$2,
@@ -4132,7 +4144,7 @@ var passwordForgot_fr = {
4132
4144
  messages: messages$a
4133
4145
  };
4134
4146
 
4135
- var title$3 = "Change your password";
4147
+ var title$5 = "Change your password";
4136
4148
  var currentPassword$1 = "Current password";
4137
4149
  var newPassword$1 = "New password";
4138
4150
  var confirmNewPassword$1 = "Confirm new password";
@@ -4142,7 +4154,7 @@ var passwordChanged$1 = "Password has been changed, please login with the new pa
4142
4154
  var passwordsNotMatching$1 = "Passwords don't match";
4143
4155
  var weakPassword$1 = "Your password must contain at least 6 characters";
4144
4156
  var passwordChange_en = {
4145
- title: title$3,
4157
+ title: title$5,
4146
4158
  currentPassword: currentPassword$1,
4147
4159
  newPassword: newPassword$1,
4148
4160
  confirmNewPassword: confirmNewPassword$1,
@@ -4153,7 +4165,7 @@ var passwordChange_en = {
4153
4165
  weakPassword: weakPassword$1
4154
4166
  };
4155
4167
 
4156
- var title$2 = "Changez votre mot de passe";
4168
+ var title$4 = "Changez votre mot de passe";
4157
4169
  var currentPassword = "Mot de passe actuel";
4158
4170
  var newPassword = "Nouveau mot de passe";
4159
4171
  var confirmNewPassword = "Confirmer le nouveau mot de passe";
@@ -4163,7 +4175,7 @@ var passwordChanged = "Le mot de passe a été modifié, veuillez vous connecter
4163
4175
  var passwordsNotMatching = "Les mots de passe ne correspondent pas";
4164
4176
  var weakPassword = "Votre mot de passe doit contenir au moins 6";
4165
4177
  var passwordChange_fr = {
4166
- title: title$2,
4178
+ title: title$4,
4167
4179
  currentPassword: currentPassword,
4168
4180
  newPassword: newPassword,
4169
4181
  confirmNewPassword: confirmNewPassword,
@@ -4174,7 +4186,7 @@ var passwordChange_fr = {
4174
4186
  weakPassword: weakPassword
4175
4187
  };
4176
4188
 
4177
- var title$1 = "Votre panier";
4189
+ var title$3 = "Votre panier";
4178
4190
  var subtitle$1 = "Terminez votre achat ci-dessous";
4179
4191
  var name$1 = "Produit";
4180
4192
  var quantity$1 = "Quantité";
@@ -4186,7 +4198,7 @@ var confirm$3 = "Passer à la caisse";
4186
4198
  var empty$1 = "Votre panier est vide.";
4187
4199
  var removeAll$1 = "Vider";
4188
4200
  var cart_fr = {
4189
- title: title$1,
4201
+ title: title$3,
4190
4202
  subtitle: subtitle$1,
4191
4203
  name: name$1,
4192
4204
  quantity: quantity$1,
@@ -4199,7 +4211,7 @@ var cart_fr = {
4199
4211
  removeAll: removeAll$1
4200
4212
  };
4201
4213
 
4202
- var title = "Your shopping cart";
4214
+ var title$2 = "Your shopping cart";
4203
4215
  var subtitle = "Comple your purchase below";
4204
4216
  var name = "Name";
4205
4217
  var quantity = "Quantity";
@@ -4211,7 +4223,7 @@ var confirm$2 = "Checkout";
4211
4223
  var empty = "Your cart is empty.";
4212
4224
  var removeAll = "Remove all";
4213
4225
  var cart_en = {
4214
- title: title,
4226
+ title: title$2,
4215
4227
  subtitle: subtitle,
4216
4228
  name: name,
4217
4229
  quantity: quantity,
@@ -4224,7 +4236,7 @@ var cart_en = {
4224
4236
  removeAll: removeAll
4225
4237
  };
4226
4238
 
4227
- var buttons$3 = {
4239
+ var buttons$5 = {
4228
4240
  select: "Select",
4229
4241
  added: "Added to cart",
4230
4242
  purchase: "Purchase",
@@ -4239,17 +4251,17 @@ var messages$9 = {
4239
4251
  multipleCurrencies: "Your cart currently contains items which are available in different currencies. In order to proceed with the checkout, please make sure that all items have the same currency.",
4240
4252
  currencyMismatch: "The selected item(s) do not match your current default currency ({{currency}}). Please choose item(s) only matching this currency."
4241
4253
  };
4242
- var labels$9 = {
4254
+ var labels$b = {
4243
4255
  summary: "Order summary",
4244
4256
  total: "total"
4245
4257
  };
4246
4258
  var shop_en = {
4247
- buttons: buttons$3,
4259
+ buttons: buttons$5,
4248
4260
  messages: messages$9,
4249
- labels: labels$9
4261
+ labels: labels$b
4250
4262
  };
4251
4263
 
4252
- var buttons$2 = {
4264
+ var buttons$4 = {
4253
4265
  select: "Choisir",
4254
4266
  added: "Ajouté au panier",
4255
4267
  purchase: "Acheter",
@@ -4264,17 +4276,17 @@ var messages$8 = {
4264
4276
  multipleCurrencies: "Votre panier contient des articles disponibles dans différentes devises. Avant de passer à la caisse, veuillez vous assurer que tous les articles ont la même devise.",
4265
4277
  currencyMismatch: "Les articles sélectionnés ne sont pas compatibles avec la devise associée à votre compte ({{currency}}). Veuillez choisir des articles uniquement offerts dans cette devise."
4266
4278
  };
4267
- var labels$8 = {
4279
+ var labels$a = {
4268
4280
  summary: "récapitulatif de commande",
4269
4281
  total: "total"
4270
4282
  };
4271
4283
  var shop_fr = {
4272
- buttons: buttons$2,
4284
+ buttons: buttons$4,
4273
4285
  messages: messages$8,
4274
- labels: labels$8
4286
+ labels: labels$a
4275
4287
  };
4276
4288
 
4277
- var labels$7 = {
4289
+ var labels$9 = {
4278
4290
  cardNumber: "Numéro de carte",
4279
4291
  securityCode: "Code de sécurité",
4280
4292
  submit: "Soumettre",
@@ -4309,12 +4321,12 @@ var errors$1 = {
4309
4321
  "": ""
4310
4322
  };
4311
4323
  var payment_fr = {
4312
- labels: labels$7,
4324
+ labels: labels$9,
4313
4325
  messages: messages$7,
4314
4326
  errors: errors$1
4315
4327
  };
4316
4328
 
4317
- var labels$6 = {
4329
+ var labels$8 = {
4318
4330
  cardNumber: "Card number",
4319
4331
  securityCode: "Security Code",
4320
4332
  submit: "Submit",
@@ -4349,12 +4361,12 @@ var errors = {
4349
4361
  "": ""
4350
4362
  };
4351
4363
  var payment_en = {
4352
- labels: labels$6,
4364
+ labels: labels$8,
4353
4365
  messages: messages$6,
4354
4366
  errors: errors
4355
4367
  };
4356
4368
 
4357
- var labels$5 = {
4369
+ var labels$7 = {
4358
4370
  menu: "Pelcro Menu",
4359
4371
  name: "Name",
4360
4372
  email: "Email",
@@ -4379,6 +4391,15 @@ var labels$5 = {
4379
4391
  purchases: "Purchases",
4380
4392
  subscriptions: "Subscriptions",
4381
4393
  donations: "Donations",
4394
+ invoices: "Invoices",
4395
+ details: "Details",
4396
+ view: "View",
4397
+ paid: "Paid",
4398
+ open: "Open",
4399
+ draft: "Draft",
4400
+ uncollectible: "Uncollectible",
4401
+ "void": "Void",
4402
+ pastDue: "Past due",
4382
4403
  updatePaymentSource: "Update",
4383
4404
  profile: "Profile",
4384
4405
  updateProfile: "Edit profile",
@@ -4431,11 +4452,11 @@ var messages$5 = {
4431
4452
  }
4432
4453
  };
4433
4454
  var dashboard_en = {
4434
- labels: labels$5,
4455
+ labels: labels$7,
4435
4456
  messages: messages$5
4436
4457
  };
4437
4458
 
4438
- var labels$4 = {
4459
+ var labels$6 = {
4439
4460
  menu: "Menu Pelcro",
4440
4461
  name: "Nom",
4441
4462
  email: "Courriel",
@@ -4460,6 +4481,15 @@ var labels$4 = {
4460
4481
  purchases: "Achats",
4461
4482
  subscriptions: "Abonnements",
4462
4483
  donations: "Des dons",
4484
+ invoices: "Invoices",
4485
+ details: "Details",
4486
+ view: "View",
4487
+ paid: "Paid",
4488
+ open: "open",
4489
+ draft: "Draft",
4490
+ uncollectible: "Uncollectible",
4491
+ "void": "Void",
4492
+ pastDue: "Past due",
4463
4493
  updatePaymentSource: "Mettre à jour la source de paiement",
4464
4494
  profile: "Profil",
4465
4495
  updateProfile: "Mettre à jour le profil",
@@ -4512,7 +4542,7 @@ var messages$4 = {
4512
4542
  }
4513
4543
  };
4514
4544
  var dashboard_fr = {
4515
- labels: labels$4,
4545
+ labels: labels$6,
4516
4546
  messages: messages$4
4517
4547
  };
4518
4548
 
@@ -4521,7 +4551,7 @@ var messages$3 = {
4521
4551
  loginHere: "Login here",
4522
4552
  checkbox: "Check this box to gift this subscription"
4523
4553
  };
4524
- var labels$3 = {
4554
+ var labels$5 = {
4525
4555
  plan: {
4526
4556
  title: "Subscribe to a plan",
4527
4557
  subtitle: "Select one of the plans below and click on next."
@@ -4538,15 +4568,15 @@ var labels$3 = {
4538
4568
  or: "Or take a look at some of our other options below"
4539
4569
  }
4540
4570
  };
4541
- var buttons$1 = {
4571
+ var buttons$3 = {
4542
4572
  next: "Next",
4543
4573
  select: "Select",
4544
4574
  back: "Back"
4545
4575
  };
4546
4576
  var select_en = {
4547
4577
  messages: messages$3,
4548
- labels: labels$3,
4549
- buttons: buttons$1
4578
+ labels: labels$5,
4579
+ buttons: buttons$3
4550
4580
  };
4551
4581
 
4552
4582
  var messages$2 = {
@@ -4554,7 +4584,7 @@ var messages$2 = {
4554
4584
  loginHere: "Connectez-vous ici",
4555
4585
  checkbox: "Cochez cette case pour offrir cet abonnement"
4556
4586
  };
4557
- var labels$2 = {
4587
+ var labels$4 = {
4558
4588
  plan: {
4559
4589
  title: "Abonnez-vous à un plan",
4560
4590
  subtitle: "Sélectionnez l’un des plans ci-dessous et cliquez sur suivant."
@@ -4571,15 +4601,15 @@ var labels$2 = {
4571
4601
  or: "Sinon, jetez un coup d'oeil à d'autres offres ci-dessous"
4572
4602
  }
4573
4603
  };
4574
- var buttons = {
4604
+ var buttons$2 = {
4575
4605
  next: "Prochain",
4576
4606
  select: "Choisir",
4577
4607
  back: "Retour"
4578
4608
  };
4579
4609
  var select_fr = {
4580
4610
  messages: messages$2,
4581
- labels: labels$2,
4582
- buttons: buttons
4611
+ labels: labels$4,
4612
+ buttons: buttons$2
4583
4613
  };
4584
4614
 
4585
4615
  var confirm$1 = {
@@ -4602,7 +4632,7 @@ var notification_fr = {
4602
4632
  confirm: confirm
4603
4633
  };
4604
4634
 
4605
- var labels$1 = {
4635
+ var labels$3 = {
4606
4636
  title: "Verify your email",
4607
4637
  instructions: "You're on your way!\nLet's confirm your email address.\nClick on the verification link we've sent to your email:",
4608
4638
  resend: "Resend email"
@@ -4612,11 +4642,11 @@ var messages$1 = {
4612
4642
  success: "Email verified successfully!"
4613
4643
  };
4614
4644
  var verifyEmail_en = {
4615
- labels: labels$1,
4645
+ labels: labels$3,
4616
4646
  messages: messages$1
4617
4647
  };
4618
4648
 
4619
- var labels = {
4649
+ var labels$2 = {
4620
4650
  title: "Vérifiez votre e-mail",
4621
4651
  instructions: "Vous êtes en route!\nConfirmons votre adresse e-mail.\nCliquez sur le lien de vérification que nous vous avons envoyé par e-mail:",
4622
4652
  resend: "Ré-envoyer l'email"
@@ -4626,10 +4656,46 @@ var messages = {
4626
4656
  success: "Email vérifié avec succès!"
4627
4657
  };
4628
4658
  var verifyEmail_fr = {
4629
- labels: labels,
4659
+ labels: labels$2,
4630
4660
  messages: messages
4631
4661
  };
4632
4662
 
4663
+ var title$1 = "Invoice details";
4664
+ var labels$1 = {
4665
+ summary: "Summary",
4666
+ total: "Total",
4667
+ amountPaid: "Amount paid",
4668
+ amountDue: "Amount due",
4669
+ creationDate: "Created on:"
4670
+ };
4671
+ var buttons$1 = {
4672
+ download: "Download",
4673
+ pay: "Pay now"
4674
+ };
4675
+ var invoiceDetails_en = {
4676
+ title: title$1,
4677
+ labels: labels$1,
4678
+ buttons: buttons$1
4679
+ };
4680
+
4681
+ var title = "Invoice details";
4682
+ var labels = {
4683
+ summary: "Summary",
4684
+ total: "Total",
4685
+ amountPaid: "Amount paid",
4686
+ amountDue: "Amount due",
4687
+ creationDate: "Created on:"
4688
+ };
4689
+ var buttons = {
4690
+ download: "Download",
4691
+ pay: "Pay now"
4692
+ };
4693
+ var invoiceDetails_fr = {
4694
+ title: title,
4695
+ labels: labels,
4696
+ buttons: buttons
4697
+ };
4698
+
4633
4699
  function create$1(createState) {
4634
4700
  let state;
4635
4701
  const listeners = new Set();
@@ -5979,7 +6045,7 @@ class PelcroActions {
5979
6045
  view,
5980
6046
  cartItems,
5981
6047
  ...otherStateFields
5982
- } = initialState$h;
6048
+ } = initialState$i;
5983
6049
  this.set(otherStateFields);
5984
6050
  });
5985
6051
 
@@ -6023,10 +6089,11 @@ class PelcroActions {
6023
6089
  resetView,
6024
6090
  switchToCheckoutForm,
6025
6091
  product,
6026
- order
6092
+ order,
6093
+ invoice
6027
6094
  } = this.get();
6028
6095
 
6029
- if (product || order) {
6096
+ if (product || order || invoice) {
6030
6097
  // direct user to stripe checkout form when there are no existing cards
6031
6098
  if (!userHasPaymentMethod()) {
6032
6099
  return switchToCheckoutForm();
@@ -6043,7 +6110,8 @@ class PelcroActions {
6043
6110
  switchView,
6044
6111
  product,
6045
6112
  subscriptionIdToRenew,
6046
- order
6113
+ order,
6114
+ invoice
6047
6115
  } = this.get();
6048
6116
 
6049
6117
  if (product && subscriptionIdToRenew) {
@@ -6057,6 +6125,10 @@ class PelcroActions {
6057
6125
  if (order) {
6058
6126
  return switchView("order-create");
6059
6127
  }
6128
+
6129
+ if (invoice) {
6130
+ return switchView("invoice-payment");
6131
+ }
6060
6132
  });
6061
6133
 
6062
6134
  _defineProperty$3(this, "switchToAddressView", () => {
@@ -6087,6 +6159,23 @@ class PelcroActions {
6087
6159
  });
6088
6160
  });
6089
6161
 
6162
+ _defineProperty$3(this, "setInvoice", id => {
6163
+ var _window$Pelcro$invoic;
6164
+
6165
+ const invoices = (_window$Pelcro$invoic = window.Pelcro.invoice.list()) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
6166
+ const invoice = invoices.find(inv => String(inv.id) === String(id));
6167
+
6168
+ if (!invoice) {
6169
+ console.error("invalid invoice id");
6170
+ return false;
6171
+ }
6172
+
6173
+ this.set({
6174
+ invoice
6175
+ });
6176
+ return true;
6177
+ });
6178
+
6090
6179
  _defineProperty$3(this, "logout", () => {
6091
6180
  var _ReactGA$event;
6092
6181
 
@@ -6275,7 +6364,7 @@ class PelcroCallbacks {
6275
6364
 
6276
6365
  }
6277
6366
 
6278
- const initialState$h = {
6367
+ const initialState$i = {
6279
6368
  // View
6280
6369
  view: null,
6281
6370
  // Plans
@@ -6290,6 +6379,8 @@ const initialState$h = {
6290
6379
  cartItems: [],
6291
6380
  order: null,
6292
6381
  // null | SKU[] | SKU,
6382
+ // invoices
6383
+ invoice: null,
6293
6384
  // User
6294
6385
  isAuthenticated: () => window.Pelcro.user.isAuthenticated(),
6295
6386
  selectedPaymentMethodId: null,
@@ -6303,7 +6394,7 @@ const createPelcroStore = () => createStore(middleware_3((set, get) => {
6303
6394
  return {
6304
6395
  // Store setter
6305
6396
  set,
6306
- ...initialState$h,
6397
+ ...initialState$i,
6307
6398
  // State actions
6308
6399
  ...actions,
6309
6400
  // Callbacks
@@ -6454,7 +6545,7 @@ const calcAndFormatItemsTotal = (items, currency) => {
6454
6545
  */
6455
6546
 
6456
6547
  const isValidViewFromURL = viewID => {
6457
- if (["login", "register", "plan-select", "gift-redeem", "password-forgot", "password-reset", "password-change", "payment-method-update", "user-edit", "newsletter", "address-create", "order-create", "cart", "email-verify"].includes(viewID) || hasValidNewsletterUpdateUrl()) {
6548
+ if (["login", "register", "plan-select", "gift-redeem", "password-forgot", "password-reset", "password-change", "payment-method-update", "user-edit", "newsletter", "address-create", "order-create", "cart", "email-verify", "invoice-details"].includes(viewID) || hasValidNewsletterUpdateUrl()) {
6458
6549
  return true;
6459
6550
  }
6460
6551
 
@@ -6681,7 +6772,8 @@ const resources = {
6681
6772
  payment: payment_en,
6682
6773
  dashboard: dashboard_en,
6683
6774
  select: select_en,
6684
- notification: notification_en
6775
+ notification: notification_en,
6776
+ invoiceDetails: invoiceDetails_en
6685
6777
  },
6686
6778
  fr: {
6687
6779
  common: common_fr,
@@ -6704,7 +6796,8 @@ const resources = {
6704
6796
  payment: payment_fr,
6705
6797
  dashboard: dashboard_fr,
6706
6798
  select: select_fr,
6707
- notification: notification_fr
6799
+ notification: notification_fr,
6800
+ invoiceDetails: invoiceDetails_fr
6708
6801
  }
6709
6802
  }; // set UI language to the page language or default to the language in site settings
6710
6803
 
@@ -6995,8 +7088,8 @@ const saveToMetadataButton = new SaveToMetadataButtonClass();
6995
7088
 
6996
7089
  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}}
6997
7090
 
6998
- function _extends$y() {
6999
- _extends$y = Object.assign || function (target) {
7091
+ function _extends$z() {
7092
+ _extends$z = Object.assign || function (target) {
7000
7093
  for (var i = 1; i < arguments.length; i++) {
7001
7094
  var source = arguments[i];
7002
7095
 
@@ -7010,7 +7103,7 @@ function _extends$y() {
7010
7103
  return target;
7011
7104
  };
7012
7105
 
7013
- return _extends$y.apply(this, arguments);
7106
+ return _extends$z.apply(this, arguments);
7014
7107
  }
7015
7108
 
7016
7109
  function _taggedTemplateLiteralLoose(strings, raw) {
@@ -7100,7 +7193,7 @@ var clearFromRemoveQueue = function clearFromRemoveQueue(toastId) {
7100
7193
  var reducer = function reducer(state, action) {
7101
7194
  switch (action.type) {
7102
7195
  case ActionType.ADD_TOAST:
7103
- return _extends$y({}, state, {
7196
+ return _extends$z({}, state, {
7104
7197
  toasts: [action.toast].concat(state.toasts).slice(0, TOAST_LIMIT)
7105
7198
  });
7106
7199
 
@@ -7110,9 +7203,9 @@ var reducer = function reducer(state, action) {
7110
7203
  clearFromRemoveQueue(action.toast.id);
7111
7204
  }
7112
7205
 
7113
- return _extends$y({}, state, {
7206
+ return _extends$z({}, state, {
7114
7207
  toasts: state.toasts.map(function (t) {
7115
- return t.id === action.toast.id ? _extends$y({}, t, action.toast) : t;
7208
+ return t.id === action.toast.id ? _extends$z({}, t, action.toast) : t;
7116
7209
  })
7117
7210
  });
7118
7211
 
@@ -7139,9 +7232,9 @@ var reducer = function reducer(state, action) {
7139
7232
  });
7140
7233
  }
7141
7234
 
7142
- return _extends$y({}, state, {
7235
+ return _extends$z({}, state, {
7143
7236
  toasts: state.toasts.map(function (t) {
7144
- return t.id === toastId || toastId === undefined ? _extends$y({}, t, {
7237
+ return t.id === toastId || toastId === undefined ? _extends$z({}, t, {
7145
7238
  visible: false
7146
7239
  }) : t;
7147
7240
  })
@@ -7149,28 +7242,28 @@ var reducer = function reducer(state, action) {
7149
7242
 
7150
7243
  case ActionType.REMOVE_TOAST:
7151
7244
  if (action.toastId === undefined) {
7152
- return _extends$y({}, state, {
7245
+ return _extends$z({}, state, {
7153
7246
  toasts: []
7154
7247
  });
7155
7248
  }
7156
7249
 
7157
- return _extends$y({}, state, {
7250
+ return _extends$z({}, state, {
7158
7251
  toasts: state.toasts.filter(function (t) {
7159
7252
  return t.id !== action.toastId;
7160
7253
  })
7161
7254
  });
7162
7255
 
7163
7256
  case ActionType.START_PAUSE:
7164
- return _extends$y({}, state, {
7257
+ return _extends$z({}, state, {
7165
7258
  pausedAt: action.time
7166
7259
  });
7167
7260
 
7168
7261
  case ActionType.END_PAUSE:
7169
7262
  var diff = action.time - (state.pausedAt || 0);
7170
- return _extends$y({}, state, {
7263
+ return _extends$z({}, state, {
7171
7264
  pausedAt: undefined,
7172
7265
  toasts: state.toasts.map(function (t) {
7173
- return _extends$y({}, t, {
7266
+ return _extends$z({}, t, {
7174
7267
  pauseDuration: t.pauseDuration + diff
7175
7268
  });
7176
7269
  })
@@ -7217,12 +7310,12 @@ var useStore = function useStore(toastOptions) {
7217
7310
  var mergedToasts = state.toasts.map(function (t) {
7218
7311
  var _toastOptions$t$type, _toastOptions, _toastOptions$t$type2;
7219
7312
 
7220
- return _extends$y({}, toastOptions, toastOptions[t.type], t, {
7313
+ return _extends$z({}, toastOptions, toastOptions[t.type], t, {
7221
7314
  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],
7222
- style: _extends$y({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7315
+ style: _extends$z({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7223
7316
  });
7224
7317
  });
7225
- return _extends$y({}, state, {
7318
+ return _extends$z({}, state, {
7226
7319
  toasts: mergedToasts
7227
7320
  });
7228
7321
  };
@@ -7232,7 +7325,7 @@ var createToast = function createToast(message, type, opts) {
7232
7325
  type = 'blank';
7233
7326
  }
7234
7327
 
7235
- return _extends$y({
7328
+ return _extends$z({
7236
7329
  createdAt: Date.now(),
7237
7330
  visible: true,
7238
7331
  type: type,
@@ -7282,14 +7375,14 @@ toast.remove = function (toastId) {
7282
7375
  };
7283
7376
 
7284
7377
  toast.promise = function (promise, msgs, opts) {
7285
- var id = toast.loading(msgs.loading, _extends$y({}, opts, opts == null ? void 0 : opts.loading));
7378
+ var id = toast.loading(msgs.loading, _extends$z({}, opts, opts == null ? void 0 : opts.loading));
7286
7379
  promise.then(function (p) {
7287
- toast.success(resolveValue(msgs.success, p), _extends$y({
7380
+ toast.success(resolveValue(msgs.success, p), _extends$z({
7288
7381
  id: id
7289
7382
  }, opts, opts == null ? void 0 : opts.success));
7290
7383
  return p;
7291
7384
  })["catch"](function (e) {
7292
- toast.error(resolveValue(msgs.error, e), _extends$y({
7385
+ toast.error(resolveValue(msgs.error, e), _extends$z({
7293
7386
  id: id
7294
7387
  }, opts, opts == null ? void 0 : opts.error));
7295
7388
  });
@@ -7628,7 +7721,7 @@ var ToastBar = /*#__PURE__*/React.memo(function (_ref2) {
7628
7721
  var message = React.createElement(Message, Object.assign({}, toast.ariaProps), resolveValue(toast.message, toast));
7629
7722
  return React.createElement(ToastBarBase, {
7630
7723
  className: toast.className,
7631
- style: _extends$y({}, animationStyle, style, toast.style)
7724
+ style: _extends$z({}, animationStyle, style, toast.style)
7632
7725
  }, typeof children === 'function' ? children({
7633
7726
  icon: icon,
7634
7727
  message: message
@@ -7658,7 +7751,7 @@ var getPositionStyle = function getPositionStyle(position, offset) {
7658
7751
  } : position.includes('right') ? {
7659
7752
  justifyContent: 'flex-end'
7660
7753
  } : {};
7661
- return _extends$y({
7754
+ return _extends$z({
7662
7755
  left: 0,
7663
7756
  right: 0,
7664
7757
  display: 'flex',
@@ -7685,7 +7778,7 @@ var Toaster = function Toaster(_ref) {
7685
7778
  handlers = _useToaster.handlers;
7686
7779
 
7687
7780
  return React.createElement("div", {
7688
- style: _extends$y({
7781
+ style: _extends$z({
7689
7782
  position: 'fixed',
7690
7783
  zIndex: 9999,
7691
7784
  top: DEFAULT_OFFSET,
@@ -7720,82 +7813,82 @@ var Toaster = function Toaster(_ref) {
7720
7813
  }));
7721
7814
  };
7722
7815
 
7723
- var _path$v;
7816
+ var _path$w;
7724
7817
 
7725
- 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); }
7818
+ 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); }
7726
7819
 
7727
7820
  function SvgCheckSolid(props) {
7728
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
7821
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$y({
7729
7822
  xmlns: "http://www.w3.org/2000/svg",
7730
7823
  className: "h-5 w-5",
7731
7824
  viewBox: "0 0 20 20",
7732
7825
  fill: "currentColor"
7733
- }, props), _path$v || (_path$v = /*#__PURE__*/React__namespace.createElement("path", {
7826
+ }, props), _path$w || (_path$w = /*#__PURE__*/React__namespace.createElement("path", {
7734
7827
  fillRule: "evenodd",
7735
7828
  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",
7736
7829
  clipRule: "evenodd"
7737
7830
  })));
7738
7831
  }
7739
7832
 
7740
- var _path$u;
7833
+ var _path$v;
7741
7834
 
7742
- 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); }
7835
+ 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); }
7743
7836
 
7744
7837
  function SvgXIcon(props) {
7745
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
7838
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
7746
7839
  xmlns: "http://www.w3.org/2000/svg",
7747
7840
  viewBox: "0 0 20 20",
7748
7841
  fill: "currentColor"
7749
- }, props), _path$u || (_path$u = /*#__PURE__*/React__namespace.createElement("path", {
7842
+ }, props), _path$v || (_path$v = /*#__PURE__*/React__namespace.createElement("path", {
7750
7843
  fill: "evenodd",
7751
7844
  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",
7752
7845
  clipRule: "evenodd"
7753
7846
  })));
7754
7847
  }
7755
7848
 
7756
- var _path$t;
7849
+ var _path$u;
7757
7850
 
7758
- 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); }
7851
+ 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); }
7759
7852
 
7760
7853
  function SvgXIconSolid(props) {
7761
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
7854
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
7762
7855
  className: "plc-w-4 plc-h-4",
7763
7856
  fill: "currentColor",
7764
7857
  xmlns: "http://www.w3.org/2000/svg",
7765
7858
  viewBox: "0 0 100 100"
7766
- }, props), _path$t || (_path$t = /*#__PURE__*/React__namespace.createElement("path", {
7859
+ }, props), _path$u || (_path$u = /*#__PURE__*/React__namespace.createElement("path", {
7767
7860
  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"
7768
7861
  })));
7769
7862
  }
7770
7863
 
7771
- var _path$s;
7864
+ var _path$t;
7772
7865
 
7773
- 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); }
7866
+ 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); }
7774
7867
 
7775
7868
  function SvgExclamation(props) {
7776
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
7869
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
7777
7870
  className: "plc-w-4 plc-h-4 plc-mr-1",
7778
7871
  xmlns: "http://www.w3.org/2000/svg",
7779
7872
  viewBox: "0 0 20 20",
7780
7873
  fill: "currentColor"
7781
- }, props), _path$s || (_path$s = /*#__PURE__*/React__namespace.createElement("path", {
7874
+ }, props), _path$t || (_path$t = /*#__PURE__*/React__namespace.createElement("path", {
7782
7875
  fillRule: "evenodd",
7783
7876
  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",
7784
7877
  clipRule: "evenodd"
7785
7878
  })));
7786
7879
  }
7787
7880
 
7788
- var _path$r, _path2$4;
7881
+ var _path$s, _path2$4;
7789
7882
 
7790
- 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); }
7883
+ 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); }
7791
7884
 
7792
7885
  function SvgSpinner(props) {
7793
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
7886
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
7794
7887
  className: "plc-animate-spin",
7795
7888
  viewBox: "0 0 24 24",
7796
7889
  fill: "currentColor",
7797
7890
  xmlns: "http://www.w3.org/2000/svg"
7798
- }, props), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
7891
+ }, props), _path$s || (_path$s = /*#__PURE__*/React__namespace.createElement("path", {
7799
7892
  opacity: 0.2,
7800
7893
  fill: "evenodd",
7801
7894
  clipRule: "evenodd",
@@ -8829,6 +8922,10 @@ const initViewFromURL = () => {
8829
8922
  return verifyEmailTokenFromUrl();
8830
8923
  }
8831
8924
 
8925
+ if (view === "invoice-details") {
8926
+ return showInvoiceDetailsFromUrl();
8927
+ }
8928
+
8832
8929
  switchView(view);
8833
8930
  });
8834
8931
  }
@@ -9005,6 +9102,28 @@ const verifyEmailTokenFromUrl = () => {
9005
9102
  });
9006
9103
  };
9007
9104
 
9105
+ const showInvoiceDetailsFromUrl = () => {
9106
+ const {
9107
+ isAuthenticated,
9108
+ setInvoice,
9109
+ switchView
9110
+ } = usePelcro.getStore();
9111
+
9112
+ if (!isAuthenticated()) {
9113
+ return switchView("login");
9114
+ }
9115
+
9116
+ const invoiceId = window.Pelcro.helpers.getURLParameter("id");
9117
+ const wasSetSuccessfully = setInvoice(invoiceId);
9118
+
9119
+ if (!wasSetSuccessfully) {
9120
+ const translations = i18next.t("messages", {
9121
+ returnObjects: true
9122
+ });
9123
+ notify.error(translations.invalidInvoice);
9124
+ }
9125
+ };
9126
+
9008
9127
  const defaultOptions = {
9009
9128
  loadPaymentSDKs: true,
9010
9129
  loadAuth0SDK: true,
@@ -9344,7 +9463,7 @@ const GET_NEWSLETTERS_FETCH = "GET_NEWSLETTERS_FETCH";
9344
9463
  const GET_NEWSLETTERS_SUCCESS = "GET_NEWSLETTERS_SUCCESS";
9345
9464
  const SWITCH_TO_UPDATE = "SWITCH_TO_UPDATE";
9346
9465
 
9347
- const initialState$g = {
9466
+ const initialState$h = {
9348
9467
  email: "",
9349
9468
  password: "",
9350
9469
  emailError: null,
@@ -9355,10 +9474,10 @@ const initialState$g = {
9355
9474
  content: ""
9356
9475
  }
9357
9476
  };
9358
- const store$g = /*#__PURE__*/React.createContext(initialState$g);
9477
+ const store$h = /*#__PURE__*/React.createContext(initialState$h);
9359
9478
  const {
9360
- Provider: Provider$g
9361
- } = store$g;
9479
+ Provider: Provider$h
9480
+ } = store$h;
9362
9481
 
9363
9482
  const LoginContainer = ({
9364
9483
  style,
@@ -9465,7 +9584,7 @@ const LoginContainer = ({
9465
9584
  });
9466
9585
 
9467
9586
  case RESET_LOGIN_FORM:
9468
- return initialState$g;
9587
+ return initialState$h;
9469
9588
 
9470
9589
  case DISABLE_LOGIN_BUTTON:
9471
9590
  return lib_7({ ...state,
@@ -9483,12 +9602,12 @@ const LoginContainer = ({
9483
9602
  default:
9484
9603
  return state;
9485
9604
  }
9486
- }, initialState$g);
9605
+ }, initialState$h);
9487
9606
  return /*#__PURE__*/React__default['default'].createElement("div", {
9488
9607
  style: { ...style
9489
9608
  },
9490
9609
  className: `pelcro-container pelcro-login-container ${className}`
9491
- }, /*#__PURE__*/React__default['default'].createElement(Provider$g, {
9610
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$h, {
9492
9611
  value: {
9493
9612
  state,
9494
9613
  dispatch
@@ -9496,12 +9615,12 @@ const LoginContainer = ({
9496
9615
  }, children.length ? children.map((child, i) => {
9497
9616
  if (child) {
9498
9617
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
9499
- store: store$g,
9618
+ store: store$h,
9500
9619
  key: i
9501
9620
  });
9502
9621
  }
9503
9622
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
9504
- store: store$g
9623
+ store: store$h
9505
9624
  })));
9506
9625
  };
9507
9626
 
@@ -9746,7 +9865,7 @@ const LoginButton = ({
9746
9865
  buttonDisabled
9747
9866
  },
9748
9867
  dispatch
9749
- } = React.useContext(store$g);
9868
+ } = React.useContext(store$h);
9750
9869
  const {
9751
9870
  t
9752
9871
  } = useTranslation("login");
@@ -9767,23 +9886,23 @@ const LoginButton = ({
9767
9886
  };
9768
9887
 
9769
9888
  const LoginEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
9770
- store: store$g
9889
+ store: store$h
9771
9890
  }, props));
9772
9891
 
9773
9892
  const LoginPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
9774
- store: store$g
9893
+ store: store$h
9775
9894
  }, props));
9776
9895
 
9777
- var _path$q;
9896
+ var _path$r;
9778
9897
 
9779
- 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); }
9898
+ 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); }
9780
9899
 
9781
9900
  function SvgCheck(props) {
9782
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
9901
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
9783
9902
  xmlns: "http://www.w3.org/2000/svg",
9784
9903
  fill: "currentColor",
9785
9904
  viewBox: "0 0 20 20"
9786
- }, props), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
9905
+ }, props), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
9787
9906
  fillRule: "evenodd",
9788
9907
  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",
9789
9908
  clipRule: "evenodd"
@@ -9848,7 +9967,7 @@ var facebookLoginRenderProps = createCommonjsModule(function (module, exports) {
9848
9967
  var FacebookLogin = unwrapExports(facebookLoginRenderProps);
9849
9968
  facebookLoginRenderProps.FacebookLogin;
9850
9969
 
9851
- const initialState$f = {
9970
+ const initialState$g = {
9852
9971
  email: "",
9853
9972
  password: "",
9854
9973
  emailError: null,
@@ -9865,10 +9984,10 @@ const initialState$f = {
9865
9984
  content: ""
9866
9985
  }
9867
9986
  };
9868
- const store$f = /*#__PURE__*/React.createContext(initialState$f);
9987
+ const store$g = /*#__PURE__*/React.createContext(initialState$g);
9869
9988
  const {
9870
- Provider: Provider$f
9871
- } = store$f;
9989
+ Provider: Provider$g
9990
+ } = store$g;
9872
9991
 
9873
9992
  const RegisterContainer = ({
9874
9993
  style,
@@ -10051,7 +10170,7 @@ const RegisterContainer = ({
10051
10170
  });
10052
10171
 
10053
10172
  case RESET_LOGIN_FORM:
10054
- return initialState$f;
10173
+ return initialState$g;
10055
10174
 
10056
10175
  case DISABLE_REGISTRATION_BUTTON:
10057
10176
  return lib_7({ ...state,
@@ -10069,12 +10188,12 @@ const RegisterContainer = ({
10069
10188
  default:
10070
10189
  return state;
10071
10190
  }
10072
- }, initialState$f);
10191
+ }, initialState$g);
10073
10192
  return /*#__PURE__*/React__default['default'].createElement("div", {
10074
10193
  style: { ...style
10075
10194
  },
10076
10195
  className: `pelcro-container pelcro-register-container ${className}`
10077
- }, /*#__PURE__*/React__default['default'].createElement(Provider$f, {
10196
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$g, {
10078
10197
  value: {
10079
10198
  state,
10080
10199
  dispatch
@@ -10082,12 +10201,12 @@ const RegisterContainer = ({
10082
10201
  }, children.length ? children.map((child, i) => {
10083
10202
  if (child) {
10084
10203
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
10085
- store: store$f,
10204
+ store: store$g,
10086
10205
  key: i
10087
10206
  });
10088
10207
  }
10089
10208
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
10090
- store: store$f
10209
+ store: store$g
10091
10210
  })));
10092
10211
  };
10093
10212
  /**
@@ -10102,15 +10221,15 @@ function hasSecurityTokenEnabled$1() {
10102
10221
  return hasSecuritySdkLoaded;
10103
10222
  }
10104
10223
 
10105
- var _path$p;
10224
+ var _path$q;
10106
10225
 
10107
- 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); }
10226
+ 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); }
10108
10227
 
10109
10228
  function SvgFacebookLogo(props) {
10110
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
10229
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
10111
10230
  xmlns: "http://www.w3.org/2000/svg",
10112
10231
  viewBox: "88.428 12.828 107.543 207.085"
10113
- }, props), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
10232
+ }, props), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
10114
10233
  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",
10115
10234
  fill: "#3c5a9a"
10116
10235
  })));
@@ -10127,10 +10246,10 @@ const FacebookLoginButton = ({
10127
10246
  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;
10128
10247
  const {
10129
10248
  dispatch: loginDispatch
10130
- } = React.useContext(store$g);
10249
+ } = React.useContext(store$h);
10131
10250
  const {
10132
10251
  dispatch: registerDispatch
10133
- } = React.useContext(store$f);
10252
+ } = React.useContext(store$g);
10134
10253
 
10135
10254
  const onSuccess = facebookUser => {
10136
10255
  loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
@@ -10183,15 +10302,15 @@ var googleLogin = createCommonjsModule(function (module, exports) {
10183
10302
  unwrapExports(googleLogin);
10184
10303
  var googleLogin_1 = googleLogin.GoogleLogin;
10185
10304
 
10186
- var _path$o, _path2$3, _path3$1, _path4;
10305
+ var _path$p, _path2$3, _path3$1, _path4;
10187
10306
 
10188
- 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); }
10307
+ 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); }
10189
10308
 
10190
10309
  function SvgGoogleLogo(props) {
10191
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
10310
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
10192
10311
  viewBox: "0 0 24 24",
10193
10312
  xmlns: "http://www.w3.org/2000/svg"
10194
- }, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
10313
+ }, props), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
10195
10314
  fill: "#4285F4",
10196
10315
  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"
10197
10316
  })), _path2$3 || (_path2$3 = /*#__PURE__*/React__namespace.createElement("path", {
@@ -10217,10 +10336,10 @@ const GoogleLoginButton = ({
10217
10336
  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;
10218
10337
  const {
10219
10338
  dispatch: loginDispatch
10220
- } = React.useContext(store$g);
10339
+ } = React.useContext(store$h);
10221
10340
  const {
10222
10341
  dispatch: registerDispatch
10223
- } = React.useContext(store$f);
10342
+ } = React.useContext(store$g);
10224
10343
 
10225
10344
  const onSuccess = response => {
10226
10345
  var _response$getAuthResp, _profile$getEmail, _profile$getGivenName, _profile$getFamilyNam, _profile$getEmail2, _profile$getGivenName2, _profile$getFamilyNam2;
@@ -10268,15 +10387,15 @@ const GoogleLoginButton = ({
10268
10387
  }) : null;
10269
10388
  };
10270
10389
 
10271
- var _path$n;
10390
+ var _path$o;
10272
10391
 
10273
- 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); }
10392
+ 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); }
10274
10393
 
10275
10394
  function SvgAuth0Logo(props) {
10276
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
10395
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
10277
10396
  viewBox: "0 0 256 285",
10278
10397
  xmlns: "http://www.w3.org/2000/svg"
10279
- }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
10398
+ }, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
10280
10399
  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"
10281
10400
  })));
10282
10401
  }
@@ -10288,26 +10407,43 @@ const Auth0LoginButton = ({
10288
10407
  iconClassName = ""
10289
10408
  }) => {
10290
10409
  const auth0Enabled = Boolean(window.Pelcro.site.read().auth0_client_id && window.Pelcro.site.read().auth0_base_url);
10410
+ const auth0Script = document.querySelector("#auth0-sdk");
10411
+ const [auth0Loaded, setAuth0Loaded] = React.useState(Boolean(window.auth0));
10412
+ React__default['default'].useEffect(() => {
10413
+ function handleScriptLoaded() {
10414
+ setAuth0Loaded(true);
10415
+ }
10416
+
10417
+ if (auth0Enabled && !auth0Loaded) {
10418
+ auth0Script.addEventListener("load", handleScriptLoaded);
10419
+ }
10420
+
10421
+ return () => {
10422
+ var _auth0Script$removeEv;
10423
+
10424
+ auth0Script === null || auth0Script === void 0 ? void 0 : (_auth0Script$removeEv = auth0Script.removeEventListener) === null || _auth0Script$removeEv === void 0 ? void 0 : _auth0Script$removeEv.call(auth0Script, "load", handleScriptLoaded);
10425
+ };
10426
+ }, [auth0Script, auth0Enabled, auth0Loaded]);
10291
10427
  const auth0InstanceRef = React__default['default'].useRef(null);
10292
10428
  React__default['default'].useEffect(() => {
10293
- if (auth0Enabled && window.auth0 && auth0InstanceRef.current === null) {
10429
+ if (auth0Enabled && auth0Loaded && auth0InstanceRef.current === null) {
10294
10430
  auth0InstanceRef.current = new window.auth0.WebAuth({
10295
10431
  domain: window.Pelcro.site.read().auth0_base_url,
10296
10432
  clientID: window.Pelcro.site.read().auth0_client_id
10297
10433
  });
10298
10434
  }
10299
- }, [auth0Enabled, window.auth0]);
10435
+ }, [auth0Enabled, auth0Loaded]);
10300
10436
  const {
10301
10437
  dispatch: loginDispatch
10302
- } = React.useContext(store$g);
10438
+ } = React.useContext(store$h);
10303
10439
  const {
10304
10440
  dispatch: registerDispatch
10305
- } = React.useContext(store$f);
10441
+ } = React.useContext(store$g);
10306
10442
 
10307
10443
  function handleClick() {
10308
10444
  var _auth0InstanceRef$cur, _auth0InstanceRef$cur2, _auth0InstanceRef$cur3;
10309
10445
 
10310
- if (!window.auth0) {
10446
+ if (!auth0Loaded) {
10311
10447
  return console.error("Auth0 sdk script wasn't loaded, you need to load auth0 sdk before rendering the Auth0LoginButton");
10312
10448
  }
10313
10449
 
@@ -10435,15 +10571,15 @@ function LoginView(props) {
10435
10571
  }, /*#__PURE__*/React__default['default'].createElement(GoogleLoginButton, null), /*#__PURE__*/React__default['default'].createElement(FacebookLoginButton, null), /*#__PURE__*/React__default['default'].createElement(Auth0LoginButton, null))))));
10436
10572
  }
10437
10573
 
10438
- var _path$m, _path2$2, _path3;
10574
+ var _path$n, _path2$2, _path3;
10439
10575
 
10440
- 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); }
10576
+ 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); }
10441
10577
 
10442
10578
  function SvgPelcroAuthorship(props) {
10443
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
10579
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
10444
10580
  xmlns: "http://www.w3.org/2000/svg",
10445
10581
  viewBox: "0 -80.652 497.072 179.991"
10446
- }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
10582
+ }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
10447
10583
  fill: "none",
10448
10584
  stroke: "#4a4a4a",
10449
10585
  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"
@@ -10590,11 +10726,11 @@ function LoginModal({
10590
10726
  LoginModal.viewId = "login";
10591
10727
 
10592
10728
  const RegisterEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
10593
- store: store$f
10729
+ store: store$g
10594
10730
  }, props));
10595
10731
 
10596
10732
  const RegisterPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
10597
- store: store$f
10733
+ store: store$g
10598
10734
  }, props));
10599
10735
 
10600
10736
  const RegisterButton = ({
@@ -10614,7 +10750,7 @@ const RegisterButton = ({
10614
10750
  buttonDisabled
10615
10751
  },
10616
10752
  dispatch
10617
- } = React.useContext(store$f);
10753
+ } = React.useContext(store$g);
10618
10754
  const {
10619
10755
  t
10620
10756
  } = useTranslation("register");
@@ -10752,7 +10888,7 @@ function FirstName({
10752
10888
  }
10753
10889
 
10754
10890
  const RegisterFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
10755
- store: store$f
10891
+ store: store$g
10756
10892
  }, props));
10757
10893
 
10758
10894
  function LastName({
@@ -10783,7 +10919,7 @@ function LastName({
10783
10919
  }
10784
10920
 
10785
10921
  const RegisterLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
10786
- store: store$f
10922
+ store: store$g
10787
10923
  }, props));
10788
10924
 
10789
10925
  /**
@@ -10907,7 +11043,7 @@ function TextInput({
10907
11043
 
10908
11044
  const RegisterTextInput = props => {
10909
11045
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
10910
- store: store$f
11046
+ store: store$g
10911
11047
  }));
10912
11048
  };
10913
11049
 
@@ -12576,7 +12712,8 @@ const SUBSCRIPTION_TYPES = {
12576
12712
  CREATE_SUBSCRIPTION: "CREATE_SUBSCRIPTION",
12577
12713
  CREATE_GIFTED_SUBSCRIPTION: "CREATE_GIFTED_SUBSCRIPTION",
12578
12714
  RENEW_SUBSCRIPTION: "RENEW_SUBSCRIPTION",
12579
- RENEW_GIFTED_SUBSCRIPTION: "RENEW_GIFTED_SUBSCRIPTION"
12715
+ RENEW_GIFTED_SUBSCRIPTION: "RENEW_GIFTED_SUBSCRIPTION",
12716
+ PAY_INVOICE: "PAY_INVOICE"
12580
12717
  };
12581
12718
 
12582
12719
  var _isPaymentGatewayInvalid = /*#__PURE__*/new WeakMap();
@@ -12638,6 +12775,7 @@ class Subscription {
12638
12775
  * @property {number} [subscriptionIdToRenew]
12639
12776
  * @property {number} [quantity]
12640
12777
  * @property {string} addressId
12778
+ * @property {number} invoiceId
12641
12779
  */
12642
12780
 
12643
12781
  /**
@@ -12678,6 +12816,8 @@ var _renewSubscription = /*#__PURE__*/new WeakMap();
12678
12816
 
12679
12817
  var _renewGiftedSubscription = /*#__PURE__*/new WeakMap();
12680
12818
 
12819
+ var _payInvoice = /*#__PURE__*/new WeakMap();
12820
+
12681
12821
  class StripeGateway {
12682
12822
  constructor() {
12683
12823
  _paymentGateway.set(this, {
@@ -12701,6 +12841,9 @@ class StripeGateway {
12701
12841
  case types.RENEW_GIFTED_SUBSCRIPTION:
12702
12842
  return _classPrivateFieldGet(this, _renewGiftedSubscription).call(this, options, callback);
12703
12843
 
12844
+ case types.PAY_INVOICE:
12845
+ return _classPrivateFieldGet(this, _payInvoice).call(this, options, callback);
12846
+
12704
12847
  default:
12705
12848
  console.error("Unsupported subscriptiion method: Stripe Gateway");
12706
12849
  }
@@ -12809,6 +12952,23 @@ class StripeGateway {
12809
12952
  });
12810
12953
  }
12811
12954
  });
12955
+
12956
+ _payInvoice.set(this, {
12957
+ writable: true,
12958
+ value: (options, callback) => {
12959
+ const {
12960
+ token,
12961
+ invoiceId
12962
+ } = options;
12963
+ window.Pelcro.invoice.pay({
12964
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway),
12965
+ gateway_token: token,
12966
+ invoice_id: invoiceId
12967
+ }, (err, res) => {
12968
+ callback(err, res);
12969
+ });
12970
+ }
12971
+ });
12812
12972
  }
12813
12973
 
12814
12974
  }
@@ -12822,6 +12982,8 @@ var _createSubscription2 = /*#__PURE__*/new WeakMap();
12822
12982
 
12823
12983
  var _createGiftedSubscription2 = /*#__PURE__*/new WeakMap();
12824
12984
 
12985
+ var _payInvoice2 = /*#__PURE__*/new WeakMap();
12986
+
12825
12987
  class PaypalGateWay {
12826
12988
  constructor() {
12827
12989
  _paymentGateway2.set(this, {
@@ -12839,6 +13001,9 @@ class PaypalGateWay {
12839
13001
  case types.CREATE_GIFTED_SUBSCRIPTION:
12840
13002
  return _classPrivateFieldGet(this, _createGiftedSubscription2).call(this, options, callback);
12841
13003
 
13004
+ case types.PAY_INVOICE:
13005
+ return _classPrivateFieldGet(this, _payInvoice2).call(this, options, callback);
13006
+
12842
13007
  default:
12843
13008
  console.error("Unsupported subscriptiion method: PayPal Gateway");
12844
13009
  }
@@ -12899,6 +13064,23 @@ class PaypalGateWay {
12899
13064
  });
12900
13065
  }
12901
13066
  });
13067
+
13068
+ _payInvoice2.set(this, {
13069
+ writable: true,
13070
+ value: (options, callback) => {
13071
+ const {
13072
+ token,
13073
+ invoiceId
13074
+ } = options;
13075
+ window.Pelcro.invoice.pay({
13076
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway2),
13077
+ gateway_token: token,
13078
+ invoice_id: invoiceId
13079
+ }, (err, res) => {
13080
+ callback(err, res);
13081
+ });
13082
+ }
13083
+ });
12902
13084
  }
12903
13085
 
12904
13086
  }
@@ -12923,7 +13105,7 @@ class PaypalGateWay {
12923
13105
 
12924
13106
  /** @type {PaymentStateType} */
12925
13107
 
12926
- const initialState$e = {
13108
+ const initialState$f = {
12927
13109
  disableSubmit: false,
12928
13110
  isLoading: false,
12929
13111
  disableCouponButton: false,
@@ -12942,10 +13124,10 @@ const initialState$e = {
12942
13124
  content: ""
12943
13125
  }
12944
13126
  };
12945
- const store$e = /*#__PURE__*/React.createContext(initialState$e);
13127
+ const store$f = /*#__PURE__*/React.createContext(initialState$f);
12946
13128
  const {
12947
- Provider: Provider$e
12948
- } = store$e;
13129
+ Provider: Provider$f
13130
+ } = store$f;
12949
13131
 
12950
13132
  const PaymentMethodContainerWithoutStripe = ({
12951
13133
  style,
@@ -12958,7 +13140,7 @@ const PaymentMethodContainerWithoutStripe = ({
12958
13140
  onFailure = () => {},
12959
13141
  ...props
12960
13142
  }) => {
12961
- var _props$product, _props$plan, _props$subscriptionId, _props$selectedAddres, _props$giftRecipient, _props$isRenewingGift;
13143
+ var _props$product, _props$plan, _props$subscriptionId, _props$selectedAddres, _props$giftRecipient, _props$isRenewingGift, _props$invoice;
12962
13144
 
12963
13145
  const {
12964
13146
  t
@@ -12975,6 +13157,7 @@ const PaymentMethodContainerWithoutStripe = ({
12975
13157
  const selectedAddressId = (_props$selectedAddres = props.selectedAddressId) !== null && _props$selectedAddres !== void 0 ? _props$selectedAddres : pelcroStore.selectedAddressId;
12976
13158
  const giftRecipient = (_props$giftRecipient = props.giftRecipient) !== null && _props$giftRecipient !== void 0 ? _props$giftRecipient : pelcroStore.giftRecipient;
12977
13159
  const isRenewingGift = (_props$isRenewingGift = props.isRenewingGift) !== null && _props$isRenewingGift !== void 0 ? _props$isRenewingGift : pelcroStore.isRenewingGift;
13160
+ const invoice = (_props$invoice = props.invoice) !== null && _props$invoice !== void 0 ? _props$invoice : pelcroStore.invoice;
12978
13161
  React.useEffect(() => {
12979
13162
  if (window.Pelcro.coupon.getFromUrl()) {
12980
13163
  dispatch({
@@ -13543,6 +13726,40 @@ const PaymentMethodContainerWithoutStripe = ({
13543
13726
  });
13544
13727
  };
13545
13728
 
13729
+ const payInvoice = (gatewayService, gatewayToken, dispatch) => {
13730
+ const subscription = new Subscription(gatewayService);
13731
+ return subscription.execute({
13732
+ type: SUBSCRIPTION_TYPES.PAY_INVOICE,
13733
+ token: gatewayToken,
13734
+ invoiceId: invoice.id
13735
+ }, (err, res) => {
13736
+ dispatch({
13737
+ type: DISABLE_SUBMIT,
13738
+ payload: false
13739
+ });
13740
+ dispatch({
13741
+ type: LOADING,
13742
+ payload: false
13743
+ });
13744
+
13745
+ if (err) {
13746
+ onFailure(err);
13747
+ return dispatch({
13748
+ type: SHOW_ALERT,
13749
+ payload: {
13750
+ type: "error",
13751
+ content: getErrorMessages(err)
13752
+ }
13753
+ });
13754
+ }
13755
+
13756
+ set({
13757
+ invoice: null
13758
+ });
13759
+ onSuccess(res);
13760
+ });
13761
+ };
13762
+
13546
13763
  const updatePaymentSource = (state, dispatch) => {
13547
13764
  return stripe.createSource({
13548
13765
  type: "card"
@@ -13617,13 +13834,17 @@ const PaymentMethodContainerWithoutStripe = ({
13617
13834
  source,
13618
13835
  error
13619
13836
  }) => {
13620
- var _ref, _state$updatedPrice, _source$card3;
13837
+ var _ref, _ref2, _state$updatedPrice, _source$card3;
13621
13838
 
13622
13839
  if (error) {
13623
13840
  return handlePaymentError(error);
13624
13841
  }
13625
13842
 
13626
13843
  const getOrderItemsTotal = () => {
13844
+ if (!order) {
13845
+ return null;
13846
+ }
13847
+
13627
13848
  const isQuickPurchase = !Array.isArray(order);
13628
13849
 
13629
13850
  if (isQuickPurchase) {
@@ -13639,7 +13860,7 @@ const PaymentMethodContainerWithoutStripe = ({
13639
13860
  }, 0);
13640
13861
  };
13641
13862
 
13642
- const totalAmount = (_ref = (_state$updatedPrice = state === null || state === void 0 ? void 0 : state.updatedPrice) !== null && _state$updatedPrice !== void 0 ? _state$updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount) !== null && _ref !== void 0 ? _ref : getOrderItemsTotal();
13863
+ const totalAmount = (_ref = (_ref2 = (_state$updatedPrice = state === null || state === void 0 ? void 0 : state.updatedPrice) !== null && _state$updatedPrice !== void 0 ? _state$updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount) !== null && _ref2 !== void 0 ? _ref2 : invoice.amount_remaining) !== null && _ref !== void 0 ? _ref : getOrderItemsTotal();
13643
13864
 
13644
13865
  if ((source === null || source === void 0 ? void 0 : (_source$card3 = source.card) === null || _source$card3 === void 0 ? void 0 : _source$card3.three_d_secure) === "required" && totalAmount > 0) {
13645
13866
  return resolveTaxCalculation().then(res => {
@@ -13672,6 +13893,10 @@ const PaymentMethodContainerWithoutStripe = ({
13672
13893
  const resolveTaxCalculation = () => {
13673
13894
  var _window$Pelcro$site$r2;
13674
13895
 
13896
+ if (type === "invoicePayment") {
13897
+ return new Promise(resolve => resolve());
13898
+ }
13899
+
13675
13900
  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;
13676
13901
  return new Promise((resolve, reject) => {
13677
13902
  // resolve early if taxes isn't enabled
@@ -13745,6 +13970,8 @@ const PaymentMethodContainerWithoutStripe = ({
13745
13970
  subscribe(stripeSource, state, dispatch);
13746
13971
  } else if (stripeSource && type === "orderCreate") {
13747
13972
  purchase(stripeSource, state, dispatch);
13973
+ } else if (stripeSource && type === "invoicePayment") {
13974
+ payInvoice(new StripeGateway(), stripeSource.id, dispatch);
13748
13975
  }
13749
13976
  };
13750
13977
 
@@ -13878,7 +14105,13 @@ const PaymentMethodContainerWithoutStripe = ({
13878
14105
  });
13879
14106
 
13880
14107
  case HANDLE_PAYPAL_SUBSCRIPTION:
13881
- return lib_5(state, () => handlePaypalSubscription(state, action.payload));
14108
+ return lib_5(state, (state, dispatch) => {
14109
+ if (type === "invoicePayment") {
14110
+ payInvoice(new PaypalGateWay(), action.payload, dispatch);
14111
+ } else {
14112
+ handlePaypalSubscription(state, action.payload);
14113
+ }
14114
+ });
13882
14115
 
13883
14116
  case SET_UPDATED_PRICE:
13884
14117
  return lib_7({ ...state,
@@ -13936,21 +14169,21 @@ const PaymentMethodContainerWithoutStripe = ({
13936
14169
  default:
13937
14170
  return state;
13938
14171
  }
13939
- }, initialState$e);
14172
+ }, initialState$f);
13940
14173
  return /*#__PURE__*/React__default['default'].createElement("div", {
13941
14174
  style: { ...style
13942
14175
  },
13943
14176
  className: `pelcro-container pelcro-payment-container ${className}`
13944
- }, /*#__PURE__*/React__default['default'].createElement(Provider$e, {
14177
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$f, {
13945
14178
  value: {
13946
14179
  state,
13947
14180
  dispatch
13948
14181
  }
13949
14182
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
13950
- store: store$e,
14183
+ store: store$f,
13951
14184
  key: i
13952
14185
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
13953
- store: store$e
14186
+ store: store$f
13954
14187
  })));
13955
14188
  };
13956
14189
 
@@ -13972,7 +14205,7 @@ const PaymentMethodContainer = props => {
13972
14205
  stripeAccount: window.Pelcro.site.read().account_id,
13973
14206
  locale: getPageOrDefaultLanguage()
13974
14207
  }, /*#__PURE__*/React__default['default'].createElement(es_11, null, /*#__PURE__*/React__default['default'].createElement(UnwrappedForm, Object.assign({
13975
- store: store$e
14208
+ store: store$f
13976
14209
  }, props))));
13977
14210
  }
13978
14211
 
@@ -14025,7 +14258,7 @@ const PelcroPaymentRequestButton = props => {
14025
14258
  currentPlan,
14026
14259
  updatedPrice
14027
14260
  }
14028
- } = React.useContext(store$e);
14261
+ } = React.useContext(store$f);
14029
14262
 
14030
14263
  const updatePaymentRequest = () => {
14031
14264
  // Make sure payment request is up to date, eg. user added a coupon code.
@@ -14085,7 +14318,7 @@ const DiscountedPrice = props => {
14085
14318
  taxAmount,
14086
14319
  percentOff
14087
14320
  }
14088
- } = React.useContext(store$e);
14321
+ } = React.useContext(store$f);
14089
14322
  const {
14090
14323
  order,
14091
14324
  plan
@@ -14135,7 +14368,7 @@ const SubmitPaymentMethod = ({
14135
14368
  isLoading,
14136
14369
  updatedPrice
14137
14370
  }
14138
- } = React.useContext(store$e);
14371
+ } = React.useContext(store$f);
14139
14372
  const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
14140
14373
  const price = updatedPrice !== null && updatedPrice !== void 0 ? updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount;
14141
14374
  const priceFormatted = getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
@@ -14156,17 +14389,17 @@ const SubmitPaymentMethod = ({
14156
14389
  }, t("labels.pay"), " ", priceFormatted && priceFormatted) : t("labels.submit"));
14157
14390
  };
14158
14391
 
14159
- var _path$l;
14392
+ var _path$m;
14160
14393
 
14161
- 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); }
14394
+ 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); }
14162
14395
 
14163
14396
  function SvgArrowLeft(props) {
14164
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
14397
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
14165
14398
  xmlns: "http://www.w3.org/2000/svg",
14166
14399
  fill: "none",
14167
14400
  viewBox: "0 0 24 24",
14168
14401
  stroke: "currentColor"
14169
- }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
14402
+ }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
14170
14403
  strokeLinecap: "round",
14171
14404
  strokeLinejoin: "round",
14172
14405
  strokeWidth: 2,
@@ -14185,7 +14418,7 @@ const ApplyCouponButton = ({
14185
14418
  disableCouponButton
14186
14419
  },
14187
14420
  dispatch
14188
- } = React.useContext(store$e);
14421
+ } = React.useContext(store$f);
14189
14422
  const {
14190
14423
  t
14191
14424
  } = useTranslation("checkoutForm");
@@ -14219,7 +14452,7 @@ const CouponCodeField = props => {
14219
14452
  couponCode,
14220
14453
  couponError
14221
14454
  }
14222
- } = React.useContext(store$e);
14455
+ } = React.useContext(store$f);
14223
14456
 
14224
14457
  const onCouponCodeChange = e => {
14225
14458
  dispatch({
@@ -14248,17 +14481,17 @@ const CouponCodeField = props => {
14248
14481
  }, props));
14249
14482
  };
14250
14483
 
14251
- var _path$k;
14484
+ var _path$l;
14252
14485
 
14253
- 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); }
14486
+ 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); }
14254
14487
 
14255
14488
  function SvgTicket(props) {
14256
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
14489
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
14257
14490
  xmlns: "http://www.w3.org/2000/svg",
14258
14491
  fill: "none",
14259
14492
  viewBox: "0 0 24 24",
14260
14493
  stroke: "currentColor"
14261
- }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
14494
+ }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
14262
14495
  strokeLinecap: "round",
14263
14496
  strokeLinejoin: "round",
14264
14497
  strokeWidth: 2,
@@ -14275,7 +14508,7 @@ const CouponCode = ({
14275
14508
  state: {
14276
14509
  enableCouponField
14277
14510
  }
14278
- } = React.useContext(store$e);
14511
+ } = React.useContext(store$f);
14279
14512
  const {
14280
14513
  t
14281
14514
  } = useTranslation("checkoutForm");
@@ -14532,17 +14765,18 @@ const PaypalSubscribeButton = props => {
14532
14765
  const {
14533
14766
  dispatch,
14534
14767
  state
14535
- } = React.useContext(store$e);
14768
+ } = React.useContext(store$f);
14536
14769
  const {
14537
14770
  product,
14538
14771
  plan,
14772
+ invoice,
14539
14773
  selectedAddressId
14540
14774
  } = usePelcro();
14541
14775
  React.useEffect(() => {
14542
- var _ref, _state$updatedPrice, _props$plan, _props$selectedAddres;
14776
+ var _ref, _ref2, _state$updatedPrice, _props$plan, _props$selectedAddres;
14543
14777
 
14544
14778
  // sometimes, price is updated. eg. Coupon codes.
14545
- const updatedPrice = (_ref = (_state$updatedPrice = state.updatedPrice) !== null && _state$updatedPrice !== void 0 ? _state$updatedPrice : (_props$plan = props.plan) === null || _props$plan === void 0 ? void 0 : _props$plan.amount) !== null && _ref !== void 0 ? _ref : plan.amount;
14779
+ const updatedPrice = (_ref = (_ref2 = (_state$updatedPrice = state.updatedPrice) !== null && _state$updatedPrice !== void 0 ? _state$updatedPrice : (_props$plan = props.plan) === null || _props$plan === void 0 ? void 0 : _props$plan.amount) !== null && _ref2 !== void 0 ? _ref2 : plan === null || plan === void 0 ? void 0 : plan.amount) !== null && _ref !== void 0 ? _ref : invoice.amount_remaining;
14546
14780
  const selectedAddress = getAddressById((_props$selectedAddres = props.selectedAddressId) !== null && _props$selectedAddres !== void 0 ? _props$selectedAddres : selectedAddressId); // initialize paypal client, then render paypal button.
14547
14781
 
14548
14782
  const initializePaypal = async () => {
@@ -14551,7 +14785,7 @@ const PaypalSubscribeButton = props => {
14551
14785
  const paypalCheckoutInstance = new PaypalClient({
14552
14786
  buttonElementID: (_props$buttonElementI = props.buttonElementID) !== null && _props$buttonElementI !== void 0 ? _props$buttonElementI : "pelcro-paypal-button",
14553
14787
  style: props.buttonStyle,
14554
- enableShippingAddress: (_props$product$addres = (_props$product = props.product) === null || _props$product === void 0 ? void 0 : _props$product.address_required) !== null && _props$product$addres !== void 0 ? _props$product$addres : product.address_required,
14788
+ enableShippingAddress: (_props$product$addres = (_props$product = props.product) === null || _props$product === void 0 ? void 0 : _props$product.address_required) !== null && _props$product$addres !== void 0 ? _props$product$addres : product === null || product === void 0 ? void 0 : product.address_required,
14555
14789
  shippingAddressEditable: props.makeAddressEditable,
14556
14790
  displayName: props.merchantDisplayName,
14557
14791
  locale: props.locale,
@@ -14561,9 +14795,9 @@ const PaypalSubscribeButton = props => {
14561
14795
  await paypalCheckoutInstance.build(); // Create paypal payment
14562
14796
 
14563
14797
  paypalCheckoutInstance.createPayment({
14564
- product: (_props$plan2 = props.plan) !== null && _props$plan2 !== void 0 ? _props$plan2 : plan,
14798
+ product: invoice ? invoice.plan : (_props$plan2 = props.plan) !== null && _props$plan2 !== void 0 ? _props$plan2 : plan,
14565
14799
  amount: updatedPrice,
14566
- address: selectedAddress,
14800
+ address: invoice ? null : selectedAddress,
14567
14801
  onButtonClick: () => {
14568
14802
  dispatch({
14569
14803
  type: DISABLE_SUBMIT,
@@ -14617,16 +14851,16 @@ const BankRedirection = () => {
14617
14851
  }));
14618
14852
  };
14619
14853
 
14620
- var _path$j;
14854
+ var _path$k;
14621
14855
 
14622
- 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); }
14856
+ 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); }
14623
14857
 
14624
14858
  function SvgLock(props) {
14625
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
14859
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
14626
14860
  xmlns: "http://www.w3.org/2000/svg",
14627
14861
  viewBox: "0 0 20 20",
14628
14862
  fill: "currentColor"
14629
- }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
14863
+ }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
14630
14864
  fillRule: "evenodd",
14631
14865
  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",
14632
14866
  clipRule: "evenodd"
@@ -14643,7 +14877,7 @@ const SelectedPaymentMethod = () => {
14643
14877
  state: {
14644
14878
  isLoading
14645
14879
  }
14646
- } = React.useContext(store$e);
14880
+ } = React.useContext(store$f);
14647
14881
  const {
14648
14882
  switchView,
14649
14883
  selectedPaymentMethodId
@@ -14685,7 +14919,7 @@ const TaxAmount = () => {
14685
14919
  state: {
14686
14920
  taxAmount
14687
14921
  }
14688
- } = React.useContext(store$e);
14922
+ } = React.useContext(store$f);
14689
14923
  const {
14690
14924
  plan
14691
14925
  } = usePelcro();
@@ -14848,12 +15082,12 @@ function SubscriptionRenewModal({
14848
15082
  }
14849
15083
  SubscriptionRenewModal.viewId = "subscription-renew";
14850
15084
 
14851
- var _path$i;
15085
+ var _path$j;
14852
15086
 
14853
- 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); }
15087
+ 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); }
14854
15088
 
14855
15089
  function SvgGift(props) {
14856
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
15090
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
14857
15091
  className: "plc-w-6 plc-h-6 plc-mr-2",
14858
15092
  fill: "none",
14859
15093
  stroke: "currentColor",
@@ -14862,7 +15096,7 @@ function SvgGift(props) {
14862
15096
  strokeWidth: 2,
14863
15097
  viewBox: "0 0 24 24",
14864
15098
  xmlns: "http://www.w3.org/2000/svg"
14865
- }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
15099
+ }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
14866
15100
  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"
14867
15101
  })));
14868
15102
  }
@@ -14900,10 +15134,13 @@ const getCurrentFlow = () => {
14900
15134
  const {
14901
15135
  product,
14902
15136
  giftRecipient,
14903
- giftCode
15137
+ giftCode,
15138
+ invoice
14904
15139
  } = usePelcro.getStore();
14905
15140
 
14906
- if (giftRecipient) {
15141
+ if (invoice) {
15142
+ return "invoicePayment";
15143
+ } else if (giftRecipient) {
14907
15144
  return "giftCreate";
14908
15145
  } else if (giftCode) {
14909
15146
  return "giftRedeem";
@@ -14940,6 +15177,13 @@ const getSuccessContent = i18n => {
14940
15177
  }),
14941
15178
  successTitle: i18n("messages.giftRedeem.title"),
14942
15179
  successContent: i18n("messages.giftRedeem.content")
15180
+ },
15181
+ invoicePayment: {
15182
+ successIcon: /*#__PURE__*/React__default['default'].createElement(SvgCheckSolid, {
15183
+ className: "plc-w-32 plc-my-4 plc-text-green-500"
15184
+ }),
15185
+ successTitle: i18n("messages.invoicePayment.title"),
15186
+ successContent: i18n("messages.invoicePayment.title")
14943
15187
  }
14944
15188
  };
14945
15189
  return wordingDictionary[flow];
@@ -15193,7 +15437,7 @@ class DefaultNewsLetter extends React.Component {
15193
15437
 
15194
15438
  const NewsLetter = withTranslation("newsletter")(DefaultNewsLetter);
15195
15439
 
15196
- const initialState$d = {
15440
+ const initialState$e = {
15197
15441
  didSubToNewslettersBefore: false,
15198
15442
  newsletters: [],
15199
15443
  isListLoading: true,
@@ -15203,10 +15447,10 @@ const initialState$d = {
15203
15447
  content: ""
15204
15448
  }
15205
15449
  };
15206
- const store$d = /*#__PURE__*/React.createContext(initialState$d);
15450
+ const store$e = /*#__PURE__*/React.createContext(initialState$e);
15207
15451
  const {
15208
- Provider: Provider$d
15209
- } = store$d;
15452
+ Provider: Provider$e
15453
+ } = store$e;
15210
15454
 
15211
15455
  const NewsletterUpdateContainer = ({
15212
15456
  style,
@@ -15319,7 +15563,7 @@ const NewsletterUpdateContainer = ({
15319
15563
  default:
15320
15564
  return state;
15321
15565
  }
15322
- }, initialState$d);
15566
+ }, initialState$e);
15323
15567
  React.useEffect(() => {
15324
15568
  const getUserNewsletters = () => {
15325
15569
  var _window$Pelcro$user$r3, _window$Pelcro$user$r4;
@@ -15363,7 +15607,7 @@ const NewsletterUpdateContainer = ({
15363
15607
  style: { ...style
15364
15608
  },
15365
15609
  className: `pelcro-container pelcro-newsletter-update-container ${className}`
15366
- }, /*#__PURE__*/React__default['default'].createElement(Provider$d, {
15610
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$e, {
15367
15611
  value: {
15368
15612
  state,
15369
15613
  dispatch
@@ -15371,12 +15615,12 @@ const NewsletterUpdateContainer = ({
15371
15615
  }, children.length ? children.map((child, i) => {
15372
15616
  if (child) {
15373
15617
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
15374
- store: store$d,
15618
+ store: store$e,
15375
15619
  key: i
15376
15620
  });
15377
15621
  }
15378
15622
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
15379
- store: store$d
15623
+ store: store$e
15380
15624
  })));
15381
15625
  };
15382
15626
 
@@ -15391,7 +15635,7 @@ const NewsletterUpdateButton = ({
15391
15635
  isSubmitting,
15392
15636
  isListLoading
15393
15637
  }
15394
- } = React.useContext(store$d);
15638
+ } = React.useContext(store$e);
15395
15639
  const {
15396
15640
  t
15397
15641
  } = useTranslation("newsletter");
@@ -15421,7 +15665,7 @@ const NewsletterUpdateList = () => {
15421
15665
  newsletters,
15422
15666
  isListLoading
15423
15667
  }
15424
- } = React.useContext(store$d);
15668
+ } = React.useContext(store$e);
15425
15669
 
15426
15670
  if (isListLoading) {
15427
15671
  return /*#__PURE__*/React__default['default'].createElement(Loader, {
@@ -15625,7 +15869,7 @@ function SubscriptionCreateModal({
15625
15869
  SubscriptionCreateModal.viewId = "subscription-create";
15626
15870
 
15627
15871
  var _window$Pelcro$user$r, _window$Pelcro$user$r2, _window$Pelcro$user$r3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
15628
- const initialState$c = {
15872
+ const initialState$d = {
15629
15873
  email: (_window$Pelcro$user$r = window.Pelcro.user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.email,
15630
15874
  firstName: (_window$Pelcro$user$r2 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.first_name,
15631
15875
  lastName: (_window$Pelcro$user$r3 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r3 === void 0 ? void 0 : _window$Pelcro$user$r3.last_name,
@@ -15638,10 +15882,10 @@ const initialState$c = {
15638
15882
  content: ""
15639
15883
  }
15640
15884
  };
15641
- const store$c = /*#__PURE__*/React.createContext(initialState$c);
15885
+ const store$d = /*#__PURE__*/React.createContext(initialState$d);
15642
15886
  const {
15643
- Provider: Provider$c
15644
- } = store$c;
15887
+ Provider: Provider$d
15888
+ } = store$d;
15645
15889
 
15646
15890
  const UserUpdateContainer = ({
15647
15891
  style,
@@ -15773,27 +16017,27 @@ const UserUpdateContainer = ({
15773
16017
  default:
15774
16018
  return state;
15775
16019
  }
15776
- }, initialState$c);
16020
+ }, initialState$d);
15777
16021
  return /*#__PURE__*/React__default['default'].createElement("div", {
15778
16022
  style: { ...style
15779
16023
  },
15780
16024
  className: `pelcro-container pelcro-user-update-container ${className}`
15781
- }, /*#__PURE__*/React__default['default'].createElement(Provider$c, {
16025
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$d, {
15782
16026
  value: {
15783
16027
  state,
15784
16028
  dispatch
15785
16029
  }
15786
16030
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
15787
- store: store$c,
16031
+ store: store$d,
15788
16032
  key: i
15789
16033
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
15790
- store: store$c
16034
+ store: store$d
15791
16035
  })));
15792
16036
  };
15793
16037
 
15794
16038
  const UserUpdateEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
15795
16039
  disabled: true,
15796
- store: store$c
16040
+ store: store$d
15797
16041
  }, props));
15798
16042
 
15799
16043
  const UserUpdateButton = ({
@@ -15806,7 +16050,7 @@ const UserUpdateButton = ({
15806
16050
  buttonDisabled
15807
16051
  },
15808
16052
  dispatch
15809
- } = React.useContext(store$c);
16053
+ } = React.useContext(store$d);
15810
16054
  const {
15811
16055
  t
15812
16056
  } = useTranslation("userEdit");
@@ -15823,11 +16067,11 @@ const UserUpdateButton = ({
15823
16067
  };
15824
16068
 
15825
16069
  const UserUpdateFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
15826
- store: store$c
16070
+ store: store$d
15827
16071
  }, props));
15828
16072
 
15829
16073
  const UserUpdateLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
15830
- store: store$c
16074
+ store: store$d
15831
16075
  }, props));
15832
16076
 
15833
16077
  function Phone({
@@ -15856,22 +16100,22 @@ function Phone({
15856
16100
  }
15857
16101
 
15858
16102
  const UserUpdatePhone = props => /*#__PURE__*/React__default['default'].createElement(Phone, Object.assign({
15859
- store: store$c
16103
+ store: store$d
15860
16104
  }, props));
15861
16105
 
15862
16106
  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";
15863
16107
 
15864
- var _path$h;
16108
+ var _path$i;
15865
16109
 
15866
- 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); }
16110
+ 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); }
15867
16111
 
15868
16112
  function SvgEdit(props) {
15869
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$j({
16113
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
15870
16114
  className: "plc-w-6 plc-h-6",
15871
16115
  xmlns: "http://www.w3.org/2000/svg",
15872
16116
  viewBox: "0 0 20 20",
15873
16117
  fill: "currentColor"
15874
- }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
16118
+ }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
15875
16119
  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"
15876
16120
  })));
15877
16121
  }
@@ -16003,16 +16247,16 @@ function DisplayName({
16003
16247
  }
16004
16248
 
16005
16249
  const UserUpdateDisplayName = props => /*#__PURE__*/React__default['default'].createElement(DisplayName, Object.assign({
16006
- store: store$c
16250
+ store: store$d
16007
16251
  }, props));
16008
16252
 
16009
16253
  const UserUpdateTextInput = props => {
16010
16254
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
16011
- store: store$c
16255
+ store: store$d
16012
16256
  }));
16013
16257
  };
16014
16258
 
16015
- const initialState$b = {
16259
+ const initialState$c = {
16016
16260
  isSubmitting: false,
16017
16261
  firstName: "",
16018
16262
  firstNameError: "",
@@ -16037,10 +16281,10 @@ const initialState$b = {
16037
16281
  content: ""
16038
16282
  }
16039
16283
  };
16040
- const store$b = /*#__PURE__*/React.createContext(initialState$b);
16284
+ const store$c = /*#__PURE__*/React.createContext(initialState$c);
16041
16285
  const {
16042
- Provider: Provider$b
16043
- } = store$b;
16286
+ Provider: Provider$c
16287
+ } = store$c;
16044
16288
 
16045
16289
  const getNewlyCreatedAddress = addresses => addresses[addresses.length - 1];
16046
16290
 
@@ -16247,7 +16491,7 @@ const AddressCreateContainer = ({
16247
16491
  default:
16248
16492
  return state;
16249
16493
  }
16250
- }, initialState$b);
16494
+ }, initialState$c);
16251
16495
  React.useEffect(() => {
16252
16496
  const getStates = () => {
16253
16497
  dispatch({
@@ -16279,16 +16523,16 @@ const AddressCreateContainer = ({
16279
16523
  style: { ...style
16280
16524
  },
16281
16525
  className: `pelcro-container pelcro-address-create-container ${className}`
16282
- }, /*#__PURE__*/React__default['default'].createElement(Provider$b, {
16526
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$c, {
16283
16527
  value: {
16284
16528
  state,
16285
16529
  dispatch
16286
16530
  }
16287
16531
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
16288
- store: store$b,
16532
+ store: store$c,
16289
16533
  key: i
16290
16534
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
16291
- store: store$b
16535
+ store: store$c
16292
16536
  })));
16293
16537
  };
16294
16538
 
@@ -16299,7 +16543,7 @@ function AddressCreateFirstName(props) {
16299
16543
  firstName,
16300
16544
  firstNameError
16301
16545
  }
16302
- } = React.useContext(store$b);
16546
+ } = React.useContext(store$c);
16303
16547
 
16304
16548
  const handleBlur = () => {
16305
16549
  return dispatch({
@@ -16342,7 +16586,7 @@ function AddressCreateLastName(props) {
16342
16586
  lastName,
16343
16587
  lastNameError
16344
16588
  }
16345
- } = React.useContext(store$b);
16589
+ } = React.useContext(store$c);
16346
16590
 
16347
16591
  const handleBlur = () => {
16348
16592
  return dispatch({
@@ -16385,7 +16629,7 @@ function AddressCreateLine1(props) {
16385
16629
  line1,
16386
16630
  line1Error
16387
16631
  }
16388
- } = React.useContext(store$b);
16632
+ } = React.useContext(store$c);
16389
16633
 
16390
16634
  const handleBlur = () => {
16391
16635
  return dispatch({
@@ -16428,7 +16672,7 @@ function AddressCreateCity(props) {
16428
16672
  city,
16429
16673
  cityError
16430
16674
  }
16431
- } = React.useContext(store$b);
16675
+ } = React.useContext(store$c);
16432
16676
 
16433
16677
  const handleBlur = () => {
16434
16678
  return dispatch({
@@ -16471,7 +16715,7 @@ function AddressCreatePostalCode(props) {
16471
16715
  postalCode,
16472
16716
  postalCodeError
16473
16717
  }
16474
- } = React.useContext(store$b);
16718
+ } = React.useContext(store$c);
16475
16719
 
16476
16720
  const handleBlur = () => {
16477
16721
  return dispatch({
@@ -16517,7 +16761,7 @@ const AddressCreateSubmit = ({
16517
16761
  state: {
16518
16762
  isSubmitting
16519
16763
  }
16520
- } = React.useContext(store$b);
16764
+ } = React.useContext(store$c);
16521
16765
  const {
16522
16766
  t
16523
16767
  } = useTranslation("address");
@@ -16628,7 +16872,7 @@ function CountrySelect({
16628
16872
  }
16629
16873
 
16630
16874
  const AddressCreateCountrySelect = props => /*#__PURE__*/React__default['default'].createElement(CountrySelect, Object.assign({
16631
- store: store$b
16875
+ store: store$c
16632
16876
  }, props));
16633
16877
 
16634
16878
  function StateSelect({
@@ -16716,7 +16960,7 @@ function StateSelect({
16716
16960
  }
16717
16961
 
16718
16962
  const AddressCreateStateSelect = props => /*#__PURE__*/React__default['default'].createElement(StateSelect, Object.assign({
16719
- store: store$b
16963
+ store: store$c
16720
16964
  }, props));
16721
16965
 
16722
16966
  const AddressCreateView = props => {
@@ -16821,18 +17065,18 @@ AddressCreateModal.viewId = "address-create";
16821
17065
 
16822
17066
  const AddressCreateTextInput = props => {
16823
17067
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
16824
- store: store$b
17068
+ store: store$c
16825
17069
  }));
16826
17070
  };
16827
17071
 
16828
17072
  const AddressCreateLine2 = props => {
16829
17073
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({
16830
17074
  fieldName: "line2",
16831
- store: store$b
17075
+ store: store$c
16832
17076
  }, props));
16833
17077
  };
16834
17078
 
16835
- const initialState$a = {
17079
+ const initialState$b = {
16836
17080
  isSubmitting: false,
16837
17081
  firstName: "",
16838
17082
  firstNameError: "",
@@ -16857,10 +17101,10 @@ const initialState$a = {
16857
17101
  content: ""
16858
17102
  }
16859
17103
  };
16860
- const store$a = /*#__PURE__*/React.createContext(initialState$a);
17104
+ const store$b = /*#__PURE__*/React.createContext(initialState$b);
16861
17105
  const {
16862
- Provider: Provider$a
16863
- } = store$a;
17106
+ Provider: Provider$b
17107
+ } = store$b;
16864
17108
 
16865
17109
  const AddressUpdateContainer = ({
16866
17110
  style,
@@ -16912,7 +17156,7 @@ const AddressUpdateContainer = ({
16912
17156
  const thisAddress = addresses[address];
16913
17157
 
16914
17158
  if (+thisAddress.id === +addressId) {
16915
- const newState = { ...initialState$a,
17159
+ const newState = { ...initialState$b,
16916
17160
  firstName: thisAddress.first_name,
16917
17161
  lastName: thisAddress.last_name,
16918
17162
  line1: thisAddress.line1,
@@ -17045,7 +17289,7 @@ const AddressUpdateContainer = ({
17045
17289
  default:
17046
17290
  return state;
17047
17291
  }
17048
- }, initialState$a);
17292
+ }, initialState$b);
17049
17293
  React.useEffect(() => {
17050
17294
  const getStates = () => {
17051
17295
  dispatch({
@@ -17077,21 +17321,21 @@ const AddressUpdateContainer = ({
17077
17321
  style: { ...style
17078
17322
  },
17079
17323
  className: `pelcro-container pelcro-address-update-container ${className}`
17080
- }, /*#__PURE__*/React__default['default'].createElement(Provider$a, {
17324
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$b, {
17081
17325
  value: {
17082
17326
  state,
17083
17327
  dispatch
17084
17328
  }
17085
17329
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
17086
- store: store$a,
17330
+ store: store$b,
17087
17331
  key: i
17088
17332
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
17089
- store: store$a
17333
+ store: store$b
17090
17334
  })));
17091
17335
  };
17092
17336
 
17093
17337
  const AddressUpdateCountrySelect = props => /*#__PURE__*/React__default['default'].createElement(CountrySelect, Object.assign({
17094
- store: store$a
17338
+ store: store$b
17095
17339
  }, props));
17096
17340
 
17097
17341
  function AddressUpdateFirstName(props) {
@@ -17101,7 +17345,7 @@ function AddressUpdateFirstName(props) {
17101
17345
  firstName,
17102
17346
  firstNameError
17103
17347
  }
17104
- } = React.useContext(store$a);
17348
+ } = React.useContext(store$b);
17105
17349
 
17106
17350
  const handleBlur = () => {
17107
17351
  return dispatch({
@@ -17144,7 +17388,7 @@ function AddressUpdateLastName(props) {
17144
17388
  lastName,
17145
17389
  lastNameError
17146
17390
  }
17147
- } = React.useContext(store$a);
17391
+ } = React.useContext(store$b);
17148
17392
 
17149
17393
  const handleBlur = () => {
17150
17394
  return dispatch({
@@ -17187,7 +17431,7 @@ function AddressUpdateLine1(props) {
17187
17431
  line1,
17188
17432
  line1Error
17189
17433
  }
17190
- } = React.useContext(store$a);
17434
+ } = React.useContext(store$b);
17191
17435
 
17192
17436
  const handleBlur = () => {
17193
17437
  return dispatch({
@@ -17227,7 +17471,7 @@ const AddressUpdateLine2 = props => {
17227
17471
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({
17228
17472
  fieldName: "line2"
17229
17473
  }, props, {
17230
- store: store$a
17474
+ store: store$b
17231
17475
  }));
17232
17476
  };
17233
17477
 
@@ -17238,7 +17482,7 @@ function AddressUpdateCity(props) {
17238
17482
  city,
17239
17483
  cityError
17240
17484
  }
17241
- } = React.useContext(store$a);
17485
+ } = React.useContext(store$b);
17242
17486
 
17243
17487
  const handleBlur = () => {
17244
17488
  return dispatch({
@@ -17281,7 +17525,7 @@ function AddressUpdatePostalCode(props) {
17281
17525
  postalCode,
17282
17526
  postalCodeError
17283
17527
  }
17284
- } = React.useContext(store$a);
17528
+ } = React.useContext(store$b);
17285
17529
 
17286
17530
  const handleBlur = () => {
17287
17531
  return dispatch({
@@ -17327,7 +17571,7 @@ const AddressUpdateSubmit = ({
17327
17571
  state: {
17328
17572
  isSubmitting
17329
17573
  }
17330
- } = React.useContext(store$a);
17574
+ } = React.useContext(store$b);
17331
17575
  const {
17332
17576
  t
17333
17577
  } = useTranslation("address");
@@ -17343,7 +17587,7 @@ const AddressUpdateSubmit = ({
17343
17587
  };
17344
17588
 
17345
17589
  const AddressUpdateStateSelect = props => /*#__PURE__*/React__default['default'].createElement(StateSelect, Object.assign({
17346
- store: store$a
17590
+ store: store$b
17347
17591
  }, props));
17348
17592
 
17349
17593
  const AddressUpdateView = props => {
@@ -17426,7 +17670,7 @@ AddressUpdateModal.viewId = "address-edit";
17426
17670
 
17427
17671
  const AddressUpdateTextInput = props => {
17428
17672
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
17429
- store: store$a
17673
+ store: store$b
17430
17674
  }));
17431
17675
  };
17432
17676
 
@@ -17509,7 +17753,7 @@ const PaymentMethodUpdateModal = props => {
17509
17753
  };
17510
17754
  PaymentMethodUpdateModal.viewId = "payment-method-update";
17511
17755
 
17512
- const initialState$9 = {
17756
+ const initialState$a = {
17513
17757
  email: "",
17514
17758
  password: "",
17515
17759
  passwordError: null,
@@ -17522,10 +17766,10 @@ const initialState$9 = {
17522
17766
  content: ""
17523
17767
  }
17524
17768
  };
17525
- const store$9 = /*#__PURE__*/React.createContext(initialState$9);
17769
+ const store$a = /*#__PURE__*/React.createContext(initialState$a);
17526
17770
  const {
17527
- Provider: Provider$9
17528
- } = store$9;
17771
+ Provider: Provider$a
17772
+ } = store$a;
17529
17773
 
17530
17774
  const PasswordResetContainer = ({
17531
17775
  style,
@@ -17582,7 +17826,7 @@ const PasswordResetContainer = ({
17582
17826
  type: SET_EMAIL,
17583
17827
  payload: window.Pelcro.helpers.getURLParameter("email")
17584
17828
  });
17585
- initialState$9.email = window.Pelcro.helpers.getURLParameter("email");
17829
+ initialState$a.email = window.Pelcro.helpers.getURLParameter("email");
17586
17830
  dispatch({
17587
17831
  type: SET_TOKEN,
17588
17832
  payload: window.Pelcro.helpers.getURLParameter("token")
@@ -17642,26 +17886,26 @@ const PasswordResetContainer = ({
17642
17886
  default:
17643
17887
  return state;
17644
17888
  }
17645
- }, initialState$9);
17889
+ }, initialState$a);
17646
17890
  return /*#__PURE__*/React__default['default'].createElement("div", {
17647
17891
  style: { ...style
17648
17892
  },
17649
17893
  className: `pelcro-container pelcro-password-reset-container ${className}`
17650
- }, /*#__PURE__*/React__default['default'].createElement(Provider$9, {
17894
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$a, {
17651
17895
  value: {
17652
17896
  state,
17653
17897
  dispatch
17654
17898
  }
17655
17899
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
17656
- store: store$9,
17900
+ store: store$a,
17657
17901
  key: i
17658
17902
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
17659
- store: store$9
17903
+ store: store$a
17660
17904
  })));
17661
17905
  };
17662
17906
 
17663
17907
  const PasswordResetPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
17664
- store: store$9
17908
+ store: store$a
17665
17909
  }, props));
17666
17910
 
17667
17911
  const PasswordResetButton = ({
@@ -17674,7 +17918,7 @@ const PasswordResetButton = ({
17674
17918
  buttonDisabled
17675
17919
  },
17676
17920
  dispatch
17677
- } = React.useContext(store$9);
17921
+ } = React.useContext(store$a);
17678
17922
  const {
17679
17923
  t
17680
17924
  } = useTranslation("passwordReset");
@@ -17691,14 +17935,14 @@ const PasswordResetButton = ({
17691
17935
  };
17692
17936
 
17693
17937
  const PasswordResetEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
17694
- store: store$9
17938
+ store: store$a
17695
17939
  }, props, {
17696
17940
  value: window.Pelcro.helpers.getURLParameter("email"),
17697
17941
  disabled: true
17698
17942
  }));
17699
17943
 
17700
17944
  const PasswordResetConfirmPassword = props => /*#__PURE__*/React__default['default'].createElement(ConfirmPassword, Object.assign({
17701
- store: store$9
17945
+ store: store$a
17702
17946
  }, props));
17703
17947
 
17704
17948
  const PasswordResetView = props => {
@@ -17750,7 +17994,7 @@ const PasswordResetModal = ({
17750
17994
  };
17751
17995
  PasswordResetModal.viewId = "password-reset";
17752
17996
 
17753
- const initialState$8 = {
17997
+ const initialState$9 = {
17754
17998
  email: "",
17755
17999
  emailError: null,
17756
18000
  buttonDisabled: false,
@@ -17759,10 +18003,10 @@ const initialState$8 = {
17759
18003
  content: ""
17760
18004
  }
17761
18005
  };
17762
- const store$8 = /*#__PURE__*/React.createContext(initialState$8);
18006
+ const store$9 = /*#__PURE__*/React.createContext(initialState$9);
17763
18007
  const {
17764
- Provider: Provider$8
17765
- } = store$8;
18008
+ Provider: Provider$9
18009
+ } = store$9;
17766
18010
 
17767
18011
  const PasswordForgotContainer = ({
17768
18012
  style,
@@ -17840,21 +18084,21 @@ const PasswordForgotContainer = ({
17840
18084
  default:
17841
18085
  return state;
17842
18086
  }
17843
- }, initialState$8);
18087
+ }, initialState$9);
17844
18088
  return /*#__PURE__*/React__default['default'].createElement("div", {
17845
18089
  style: { ...style
17846
18090
  },
17847
18091
  className: `pelcro-container pelcro-password-forgot-container ${className}`
17848
- }, /*#__PURE__*/React__default['default'].createElement(Provider$8, {
18092
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$9, {
17849
18093
  value: {
17850
18094
  state,
17851
18095
  dispatch
17852
18096
  }
17853
18097
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
17854
- store: store$8,
18098
+ store: store$9,
17855
18099
  key: i
17856
18100
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
17857
- store: store$8
18101
+ store: store$9
17858
18102
  })));
17859
18103
  };
17860
18104
 
@@ -17870,7 +18114,7 @@ const PasswordForgotButton = ({
17870
18114
  emailError
17871
18115
  },
17872
18116
  dispatch
17873
- } = React.useContext(store$8);
18117
+ } = React.useContext(store$9);
17874
18118
  const {
17875
18119
  t
17876
18120
  } = useTranslation("passwordForgot");
@@ -17891,7 +18135,7 @@ const PasswordForgotButton = ({
17891
18135
  };
17892
18136
 
17893
18137
  const PasswordForgotEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
17894
- store: store$8
18138
+ store: store$9
17895
18139
  }, props));
17896
18140
 
17897
18141
  const PasswordForgotView = props => {
@@ -17941,7 +18185,7 @@ const PasswordForgotModal = ({
17941
18185
  };
17942
18186
  PasswordForgotModal.viewId = "password-forgot";
17943
18187
 
17944
- const initialState$7 = {
18188
+ const initialState$8 = {
17945
18189
  currentPassword: "",
17946
18190
  newPassword: "",
17947
18191
  confirmNewPassword: "",
@@ -17955,10 +18199,10 @@ const initialState$7 = {
17955
18199
  content: ""
17956
18200
  }
17957
18201
  };
17958
- const store$7 = /*#__PURE__*/React.createContext(initialState$7);
18202
+ const store$8 = /*#__PURE__*/React.createContext(initialState$8);
17959
18203
  const {
17960
- Provider: Provider$7
17961
- } = store$7;
18204
+ Provider: Provider$8
18205
+ } = store$8;
17962
18206
  const PasswordChangeContainer = ({
17963
18207
  style,
17964
18208
  className = "",
@@ -18110,21 +18354,21 @@ const PasswordChangeContainer = ({
18110
18354
  default:
18111
18355
  return state;
18112
18356
  }
18113
- }, initialState$7);
18357
+ }, initialState$8);
18114
18358
  return /*#__PURE__*/React__default['default'].createElement("div", {
18115
18359
  style: { ...style
18116
18360
  },
18117
18361
  className: `pelcro-container pelcro-password-change-container ${className}`
18118
- }, /*#__PURE__*/React__default['default'].createElement(Provider$7, {
18362
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$8, {
18119
18363
  value: {
18120
18364
  state,
18121
18365
  dispatch
18122
18366
  }
18123
18367
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18124
- store: store$7,
18368
+ store: store$8,
18125
18369
  key: i
18126
18370
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18127
- store: store$7
18371
+ store: store$8
18128
18372
  })));
18129
18373
  };
18130
18374
 
@@ -18135,7 +18379,7 @@ function PasswordChangeCurrentPassword(props) {
18135
18379
  currentPassword,
18136
18380
  currentPasswordError
18137
18381
  }
18138
- } = React.useContext(store$7);
18382
+ } = React.useContext(store$8);
18139
18383
  const handleBlur = React.useCallback(() => {
18140
18384
  return dispatch({
18141
18385
  type: VALIDATE_PASSWORD
@@ -18169,7 +18413,7 @@ function PasswordChangeNewPassword(props) {
18169
18413
  newPassword,
18170
18414
  newPasswordError
18171
18415
  }
18172
- } = React.useContext(store$7);
18416
+ } = React.useContext(store$8);
18173
18417
  const handleBlur = React.useCallback(() => {
18174
18418
  return dispatch({
18175
18419
  type: VALIDATE_NEW_PASSWORD
@@ -18203,7 +18447,7 @@ function PasswordChangeConfirmNewPassword(props) {
18203
18447
  confirmNewPassword,
18204
18448
  confirmNewPasswordError
18205
18449
  }
18206
- } = React.useContext(store$7);
18450
+ } = React.useContext(store$8);
18207
18451
  const handleBlur = React.useCallback(() => {
18208
18452
  return dispatch({
18209
18453
  type: VALIDATE_CONFIRM_NEW_PASSWORD
@@ -18244,7 +18488,7 @@ const PasswordChangeButton = ({
18244
18488
  confirmNewPasswordError
18245
18489
  },
18246
18490
  dispatch
18247
- } = React.useContext(store$7);
18491
+ } = React.useContext(store$8);
18248
18492
  const {
18249
18493
  t
18250
18494
  } = useTranslation("passwordChange");
@@ -18310,17 +18554,17 @@ const PasswordChangeModal = ({
18310
18554
  };
18311
18555
  PasswordChangeModal.viewId = "password-change";
18312
18556
 
18313
- const initialState$6 = {
18557
+ const initialState$7 = {
18314
18558
  buttonDisabled: false,
18315
18559
  alert: {
18316
18560
  type: "error",
18317
18561
  content: ""
18318
18562
  }
18319
18563
  };
18320
- const store$6 = /*#__PURE__*/React.createContext(initialState$6);
18564
+ const store$7 = /*#__PURE__*/React.createContext(initialState$7);
18321
18565
  const {
18322
- Provider: Provider$6
18323
- } = store$6;
18566
+ Provider: Provider$7
18567
+ } = store$7;
18324
18568
 
18325
18569
  const CartContainer = ({
18326
18570
  style,
@@ -18411,21 +18655,21 @@ const CartContainer = ({
18411
18655
  default:
18412
18656
  return state;
18413
18657
  }
18414
- }, initialState$6);
18658
+ }, initialState$7);
18415
18659
  return /*#__PURE__*/React__default['default'].createElement("div", {
18416
18660
  style: { ...style
18417
18661
  },
18418
18662
  className: `pelcro-container pelcro-cart-container ${className}`
18419
- }, /*#__PURE__*/React__default['default'].createElement(Provider$6, {
18663
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$7, {
18420
18664
  value: {
18421
18665
  state,
18422
18666
  dispatch
18423
18667
  }
18424
18668
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18425
- store: store$6,
18669
+ store: store$7,
18426
18670
  key: i
18427
18671
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18428
- store: store$6
18672
+ store: store$7
18429
18673
  })));
18430
18674
  };
18431
18675
 
@@ -18462,7 +18706,7 @@ const CartSubmit = ({
18462
18706
  buttonDisabled
18463
18707
  },
18464
18708
  dispatch
18465
- } = React.useContext(store$6);
18709
+ } = React.useContext(store$7);
18466
18710
  const {
18467
18711
  t
18468
18712
  } = useTranslation("cart");
@@ -18493,7 +18737,7 @@ const CartTotalPrice = () => {
18493
18737
  state: {
18494
18738
  alert
18495
18739
  }
18496
- } = React.useContext(store$6);
18740
+ } = React.useContext(store$7);
18497
18741
  const {
18498
18742
  cartItems
18499
18743
  } = usePelcro();
@@ -18806,7 +19050,7 @@ const OrderConfirmModal = props => {
18806
19050
  };
18807
19051
  OrderConfirmModal.viewId = "order-confirm";
18808
19052
 
18809
- const initialState$5 = {
19053
+ const initialState$6 = {
18810
19054
  email: "",
18811
19055
  firstName: "",
18812
19056
  lastName: "",
@@ -18818,10 +19062,10 @@ const initialState$5 = {
18818
19062
  content: ""
18819
19063
  }
18820
19064
  };
18821
- const store$5 = /*#__PURE__*/React.createContext(initialState$5);
19065
+ const store$6 = /*#__PURE__*/React.createContext(initialState$6);
18822
19066
  const {
18823
- Provider: Provider$5
18824
- } = store$5;
19067
+ Provider: Provider$6
19068
+ } = store$6;
18825
19069
 
18826
19070
  const GiftCreateContainer = ({
18827
19071
  style,
@@ -18925,21 +19169,21 @@ const GiftCreateContainer = ({
18925
19169
  default:
18926
19170
  return state;
18927
19171
  }
18928
- }, initialState$5);
19172
+ }, initialState$6);
18929
19173
  return /*#__PURE__*/React__default['default'].createElement("div", {
18930
19174
  style: { ...style
18931
19175
  },
18932
19176
  className: `pelcro-container pelcro-gift-create-container ${className}`
18933
- }, /*#__PURE__*/React__default['default'].createElement(Provider$5, {
19177
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$6, {
18934
19178
  value: {
18935
19179
  state,
18936
19180
  dispatch
18937
19181
  }
18938
19182
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18939
- store: store$5,
19183
+ store: store$6,
18940
19184
  key: i
18941
19185
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18942
- store: store$5
19186
+ store: store$6
18943
19187
  })));
18944
19188
  };
18945
19189
 
@@ -18953,7 +19197,7 @@ const GiftCreateSubmitButton = ({
18953
19197
  state: {
18954
19198
  disableSubmit
18955
19199
  }
18956
- } = React.useContext(store$5);
19200
+ } = React.useContext(store$6);
18957
19201
  const {
18958
19202
  t
18959
19203
  } = useTranslation("register");
@@ -18970,29 +19214,29 @@ const GiftCreateSubmitButton = ({
18970
19214
 
18971
19215
  const GiftCreateEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
18972
19216
  initWithUserEmail: false,
18973
- store: store$5
19217
+ store: store$6
18974
19218
  }, props));
18975
19219
 
18976
19220
  const GiftCreateFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
18977
- store: store$5
19221
+ store: store$6
18978
19222
  }, props));
18979
19223
 
18980
19224
  const GiftCreateLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
18981
- store: store$5
19225
+ store: store$6
18982
19226
  }, props));
18983
19227
 
18984
- var _path$g;
19228
+ var _path$h;
18985
19229
 
18986
- 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); }
19230
+ 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); }
18987
19231
 
18988
19232
  function SvgInfoCircle(props) {
18989
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
19233
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$j({
18990
19234
  xmlns: "http://www.w3.org/2000/svg",
18991
19235
  className: "plc-w-5 plc-h-5",
18992
19236
  fill: "none",
18993
19237
  viewBox: "0 0 24 24",
18994
19238
  stroke: "currentColor"
18995
- }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
19239
+ }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
18996
19240
  strokeLinecap: "round",
18997
19241
  strokeLinejoin: "round",
18998
19242
  strokeWidth: 2,
@@ -19063,7 +19307,7 @@ const GiftCreateStartDate = props => {
19063
19307
  const {
19064
19308
  dispatch,
19065
19309
  state
19066
- } = React.useContext(store$5);
19310
+ } = React.useContext(store$6);
19067
19311
 
19068
19312
  const handleInputChange = value => {
19069
19313
  dispatch({
@@ -19134,7 +19378,7 @@ function GiftCreateMessage(props) {
19134
19378
  const {
19135
19379
  dispatch,
19136
19380
  state
19137
- } = React.useContext(store$5);
19381
+ } = React.useContext(store$6);
19138
19382
 
19139
19383
  const handleInputChange = value => {
19140
19384
  dispatch({
@@ -19254,7 +19498,7 @@ const GiftCreateModal = ({
19254
19498
  };
19255
19499
  GiftCreateModal.viewId = "gift-create";
19256
19500
 
19257
- const initialState$4 = {
19501
+ const initialState$5 = {
19258
19502
  giftCode: "",
19259
19503
  buttonDisabled: true,
19260
19504
  alert: {
@@ -19262,10 +19506,10 @@ const initialState$4 = {
19262
19506
  content: ""
19263
19507
  }
19264
19508
  };
19265
- const store$4 = /*#__PURE__*/React.createContext(initialState$4);
19509
+ const store$5 = /*#__PURE__*/React.createContext(initialState$5);
19266
19510
  const {
19267
- Provider: Provider$4
19268
- } = store$4;
19511
+ Provider: Provider$5
19512
+ } = store$5;
19269
19513
 
19270
19514
  const GiftRedeemContainer = ({
19271
19515
  style,
@@ -19330,21 +19574,21 @@ const GiftRedeemContainer = ({
19330
19574
  default:
19331
19575
  return state;
19332
19576
  }
19333
- }, initialState$4);
19577
+ }, initialState$5);
19334
19578
  return /*#__PURE__*/React__default['default'].createElement("div", {
19335
19579
  style: { ...style
19336
19580
  },
19337
19581
  className: `pelcro-container pelcro-gift-redeem-container ${className}`
19338
- }, /*#__PURE__*/React__default['default'].createElement(Provider$4, {
19582
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$5, {
19339
19583
  value: {
19340
19584
  state,
19341
19585
  dispatch
19342
19586
  }
19343
19587
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
19344
- store: store$4,
19588
+ store: store$5,
19345
19589
  key: i
19346
19590
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
19347
- store: store$4
19591
+ store: store$5
19348
19592
  })));
19349
19593
  };
19350
19594
 
@@ -19381,7 +19625,7 @@ function GiftCode({
19381
19625
  }
19382
19626
 
19383
19627
  const GiftRedeemCode = props => /*#__PURE__*/React__default['default'].createElement(GiftCode, Object.assign({
19384
- store: store$4
19628
+ store: store$5
19385
19629
  }, props));
19386
19630
 
19387
19631
  const GiftRedeemSubmitButton = ({
@@ -19394,7 +19638,7 @@ const GiftRedeemSubmitButton = ({
19394
19638
  state: {
19395
19639
  disableSubmit
19396
19640
  }
19397
- } = React.useContext(store$4);
19641
+ } = React.useContext(store$5);
19398
19642
  const {
19399
19643
  t
19400
19644
  } = useTranslation("register");
@@ -19487,7 +19731,7 @@ const moveDefaultAddressToStart = addresses => {
19487
19731
  return [defaultAddress, ...addressesWithoutDefault];
19488
19732
  };
19489
19733
 
19490
- const initialState$3 = {
19734
+ const initialState$4 = {
19491
19735
  addresses: [],
19492
19736
  selectedAddressId: null,
19493
19737
  isSubmitting: false,
@@ -19496,10 +19740,10 @@ const initialState$3 = {
19496
19740
  content: ""
19497
19741
  }
19498
19742
  };
19499
- const store$3 = /*#__PURE__*/React.createContext(initialState$3);
19743
+ const store$4 = /*#__PURE__*/React.createContext(initialState$4);
19500
19744
  const {
19501
- Provider: Provider$3
19502
- } = store$3;
19745
+ Provider: Provider$4
19746
+ } = store$4;
19503
19747
 
19504
19748
  const AddressSelectContainer = ({
19505
19749
  style,
@@ -19594,7 +19838,7 @@ const AddressSelectContainer = ({
19594
19838
  default:
19595
19839
  return state;
19596
19840
  }
19597
- }, initialState$3);
19841
+ }, initialState$4);
19598
19842
  React.useEffect(() => {
19599
19843
  var _window$Pelcro$user$r;
19600
19844
 
@@ -19607,16 +19851,16 @@ const AddressSelectContainer = ({
19607
19851
  style: { ...style
19608
19852
  },
19609
19853
  className: `pelcro-container pelcro-address-select-container ${className}`
19610
- }, /*#__PURE__*/React__default['default'].createElement(Provider$3, {
19854
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$4, {
19611
19855
  value: {
19612
19856
  state,
19613
19857
  dispatch
19614
19858
  }
19615
19859
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
19616
- store: store$3,
19860
+ store: store$4,
19617
19861
  key: i
19618
19862
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
19619
- store: store$3
19863
+ store: store$4
19620
19864
  })));
19621
19865
  };
19622
19866
 
@@ -19627,7 +19871,7 @@ const AddressSelectList = () => {
19627
19871
  addresses,
19628
19872
  selectedAddressId
19629
19873
  }
19630
- } = React.useContext(store$3);
19874
+ } = React.useContext(store$4);
19631
19875
 
19632
19876
  const handleAddressSelect = event => {
19633
19877
  dispatch({
@@ -19671,7 +19915,7 @@ const AddressSelectSubmit = ({
19671
19915
  selectedAddressId,
19672
19916
  isSubmitting
19673
19917
  }
19674
- } = React.useContext(store$3);
19918
+ } = React.useContext(store$4);
19675
19919
  const {
19676
19920
  t
19677
19921
  } = useTranslation("address");
@@ -19759,10 +20003,15 @@ const moveDefaultPaymentMethodToStart = paymentMethods => {
19759
20003
 
19760
20004
  const defaultPaymentMethod = (_window$Pelcro$user$r = window.Pelcro.user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.source;
19761
20005
  const paymentMethodsWithoutDefault = paymentMethods.filter(paymentMethod => paymentMethod.id !== defaultPaymentMethod.id);
20006
+
20007
+ if (defaultPaymentMethod.status !== "chargeable") {
20008
+ return paymentMethodsWithoutDefault;
20009
+ }
20010
+
19762
20011
  return [defaultPaymentMethod, ...paymentMethodsWithoutDefault];
19763
20012
  };
19764
20013
 
19765
- const initialState$2 = {
20014
+ const initialState$3 = {
19766
20015
  paymentMethods: [],
19767
20016
  selectedPaymentMethodId: null,
19768
20017
  isSubmitting: false,
@@ -19771,10 +20020,10 @@ const initialState$2 = {
19771
20020
  content: ""
19772
20021
  }
19773
20022
  };
19774
- const store$2 = /*#__PURE__*/React.createContext(initialState$2);
20023
+ const store$3 = /*#__PURE__*/React.createContext(initialState$3);
19775
20024
  const {
19776
- Provider: Provider$2
19777
- } = store$2;
20025
+ Provider: Provider$3
20026
+ } = store$3;
19778
20027
 
19779
20028
  const PaymentMethodSelectContainer = ({
19780
20029
  style,
@@ -19819,7 +20068,7 @@ const PaymentMethodSelectContainer = ({
19819
20068
  default:
19820
20069
  return state;
19821
20070
  }
19822
- }, initialState$2);
20071
+ }, initialState$3);
19823
20072
  React.useEffect(() => {
19824
20073
  var _window$Pelcro$user$r4;
19825
20074
 
@@ -19832,16 +20081,16 @@ const PaymentMethodSelectContainer = ({
19832
20081
  style: { ...style
19833
20082
  },
19834
20083
  className: `pelcro-container pelcro-payment-select-container ${className}`
19835
- }, /*#__PURE__*/React__default['default'].createElement(Provider$2, {
20084
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$3, {
19836
20085
  value: {
19837
20086
  state,
19838
20087
  dispatch
19839
20088
  }
19840
20089
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
19841
- store: store$2,
20090
+ store: store$3,
19842
20091
  key: i
19843
20092
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
19844
- store: store$2
20093
+ store: store$3
19845
20094
  })));
19846
20095
  };
19847
20096
 
@@ -19855,7 +20104,7 @@ const PaymentMethodSelectList = () => {
19855
20104
  paymentMethods,
19856
20105
  selectedPaymentMethodId
19857
20106
  }
19858
- } = React.useContext(store$2);
20107
+ } = React.useContext(store$3);
19859
20108
 
19860
20109
  const handlePaymentMethodSelect = event => {
19861
20110
  dispatch({
@@ -19905,7 +20154,7 @@ const PaymentMethodSelectSubmit = ({
19905
20154
  selectedPaymentMethodId,
19906
20155
  isSubmitting
19907
20156
  }
19908
- } = React.useContext(store$2);
20157
+ } = React.useContext(store$3);
19909
20158
  return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
19910
20159
  onClick: () => {
19911
20160
  dispatch({
@@ -19979,8 +20228,8 @@ const PaymentMethodSelectModal = ({
19979
20228
  };
19980
20229
  PaymentMethodSelectModal.viewId = "payment-method-select";
19981
20230
 
19982
- function _extends$h() {
19983
- _extends$h = Object.assign || function (target) {
20231
+ function _extends$i() {
20232
+ _extends$i = Object.assign || function (target) {
19984
20233
  for (var i = 1; i < arguments.length; i++) {
19985
20234
  var source = arguments[i];
19986
20235
 
@@ -19994,7 +20243,7 @@ function _extends$h() {
19994
20243
  return target;
19995
20244
  };
19996
20245
 
19997
- return _extends$h.apply(this, arguments);
20246
+ return _extends$i.apply(this, arguments);
19998
20247
  }
19999
20248
 
20000
20249
  function _objectWithoutPropertiesLoose(source, excluded) {
@@ -20178,7 +20427,7 @@ function render(props, propsBag, defaultTag, features, visible) {
20178
20427
  return match(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function () {
20179
20428
  return null;
20180
20429
  }, _match[RenderStrategy.Hidden] = function () {
20181
- return _render(_extends$h({}, _rest, {
20430
+ return _render(_extends$i({}, _rest, {
20182
20431
  hidden: true,
20183
20432
  style: {
20184
20433
  display: 'none'
@@ -20706,7 +20955,7 @@ function TransitionChild(props) {
20706
20955
  var passthroughProps = rest;
20707
20956
  return React__default['default'].createElement(NestingContext.Provider, {
20708
20957
  value: nesting
20709
- }, render(_extends$h({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
20958
+ }, render(_extends$i({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
20710
20959
  }
20711
20960
 
20712
20961
  function Transition(props) {
@@ -20750,7 +20999,7 @@ function Transition(props) {
20750
20999
  value: nestingBag
20751
21000
  }, React__default['default'].createElement(TransitionContext.Provider, {
20752
21001
  value: transitionBag
20753
- }, render(_extends$h({}, sharedProps, {
21002
+ }, render(_extends$i({}, sharedProps, {
20754
21003
  as: React.Fragment,
20755
21004
  children: React__default['default'].createElement(TransitionChild, Object.assign({}, sharedProps, passthroughProps))
20756
21005
  }), propsBag, React.Fragment, TransitionChildRenderFeatures, state === TreeStates.Visible)));
@@ -20877,12 +21126,12 @@ var ActionTypes;
20877
21126
  })(ActionTypes || (ActionTypes = {}));
20878
21127
 
20879
21128
  (_reducers = {}, _reducers[ActionTypes.CloseMenu] = function (state) {
20880
- return _extends$h({}, state, {
21129
+ return _extends$i({}, state, {
20881
21130
  activeItemIndex: null,
20882
21131
  menuState: MenuStates.Closed
20883
21132
  });
20884
21133
  }, _reducers[ActionTypes.OpenMenu] = function (state) {
20885
- return _extends$h({}, state, {
21134
+ return _extends$i({}, state, {
20886
21135
  menuState: MenuStates.Open
20887
21136
  });
20888
21137
  }, _reducers[ActionTypes.GoToItem] = function (state, action) {
@@ -20901,7 +21150,7 @@ var ActionTypes;
20901
21150
  }
20902
21151
  });
20903
21152
  if (state.searchQuery === '' && state.activeItemIndex === activeItemIndex) return state;
20904
- return _extends$h({}, state, {
21153
+ return _extends$i({}, state, {
20905
21154
  searchQuery: '',
20906
21155
  activeItemIndex: activeItemIndex
20907
21156
  });
@@ -20912,19 +21161,19 @@ var ActionTypes;
20912
21161
 
20913
21162
  return ((_item$dataRef$current = item.dataRef.current.textValue) == null ? void 0 : _item$dataRef$current.startsWith(searchQuery)) && !item.dataRef.current.disabled;
20914
21163
  });
20915
- if (match === -1 || match === state.activeItemIndex) return _extends$h({}, state, {
21164
+ if (match === -1 || match === state.activeItemIndex) return _extends$i({}, state, {
20916
21165
  searchQuery: searchQuery
20917
21166
  });
20918
- return _extends$h({}, state, {
21167
+ return _extends$i({}, state, {
20919
21168
  searchQuery: searchQuery,
20920
21169
  activeItemIndex: match
20921
21170
  });
20922
21171
  }, _reducers[ActionTypes.ClearSearch] = function (state) {
20923
- return _extends$h({}, state, {
21172
+ return _extends$i({}, state, {
20924
21173
  searchQuery: ''
20925
21174
  });
20926
21175
  }, _reducers[ActionTypes.RegisterItem] = function (state, action) {
20927
- return _extends$h({}, state, {
21176
+ return _extends$i({}, state, {
20928
21177
  items: [].concat(state.items, [{
20929
21178
  id: action.id,
20930
21179
  dataRef: action.dataRef
@@ -20937,7 +21186,7 @@ var ActionTypes;
20937
21186
  return a.id === action.id;
20938
21187
  });
20939
21188
  if (idx !== -1) nextItems.splice(idx, 1);
20940
- return _extends$h({}, state, {
21189
+ return _extends$i({}, state, {
20941
21190
  items: nextItems,
20942
21191
  activeItemIndex: function () {
20943
21192
  if (idx === state.activeItemIndex) return null;
@@ -20976,19 +21225,19 @@ var ActionTypes$1;
20976
21225
  (_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = function (state) {
20977
21226
  if (state.disabled) return state;
20978
21227
  if (state.listboxState === ListboxStates.Closed) return state;
20979
- return _extends$h({}, state, {
21228
+ return _extends$i({}, state, {
20980
21229
  activeOptionIndex: null,
20981
21230
  listboxState: ListboxStates.Closed
20982
21231
  });
20983
21232
  }, _reducers$1[ActionTypes$1.OpenListbox] = function (state) {
20984
21233
  if (state.disabled) return state;
20985
21234
  if (state.listboxState === ListboxStates.Open) return state;
20986
- return _extends$h({}, state, {
21235
+ return _extends$i({}, state, {
20987
21236
  listboxState: ListboxStates.Open
20988
21237
  });
20989
21238
  }, _reducers$1[ActionTypes$1.SetDisabled] = function (state, action) {
20990
21239
  if (state.disabled === action.disabled) return state;
20991
- return _extends$h({}, state, {
21240
+ return _extends$i({}, state, {
20992
21241
  disabled: action.disabled
20993
21242
  });
20994
21243
  }, _reducers$1[ActionTypes$1.GoToOption] = function (state, action) {
@@ -21009,7 +21258,7 @@ var ActionTypes$1;
21009
21258
  }
21010
21259
  });
21011
21260
  if (state.searchQuery === '' && state.activeOptionIndex === activeOptionIndex) return state;
21012
- return _extends$h({}, state, {
21261
+ return _extends$i({}, state, {
21013
21262
  searchQuery: '',
21014
21263
  activeOptionIndex: activeOptionIndex
21015
21264
  });
@@ -21022,10 +21271,10 @@ var ActionTypes$1;
21022
21271
 
21023
21272
  return !option.dataRef.current.disabled && ((_option$dataRef$curre = option.dataRef.current.textValue) == null ? void 0 : _option$dataRef$curre.startsWith(searchQuery));
21024
21273
  });
21025
- if (match === -1 || match === state.activeOptionIndex) return _extends$h({}, state, {
21274
+ if (match === -1 || match === state.activeOptionIndex) return _extends$i({}, state, {
21026
21275
  searchQuery: searchQuery
21027
21276
  });
21028
- return _extends$h({}, state, {
21277
+ return _extends$i({}, state, {
21029
21278
  searchQuery: searchQuery,
21030
21279
  activeOptionIndex: match
21031
21280
  });
@@ -21033,11 +21282,11 @@ var ActionTypes$1;
21033
21282
  if (state.disabled) return state;
21034
21283
  if (state.listboxState === ListboxStates.Closed) return state;
21035
21284
  if (state.searchQuery === '') return state;
21036
- return _extends$h({}, state, {
21285
+ return _extends$i({}, state, {
21037
21286
  searchQuery: ''
21038
21287
  });
21039
21288
  }, _reducers$1[ActionTypes$1.RegisterOption] = function (state, action) {
21040
- return _extends$h({}, state, {
21289
+ return _extends$i({}, state, {
21041
21290
  options: [].concat(state.options, [{
21042
21291
  id: action.id,
21043
21292
  dataRef: action.dataRef
@@ -21050,7 +21299,7 @@ var ActionTypes$1;
21050
21299
  return a.id === action.id;
21051
21300
  });
21052
21301
  if (idx !== -1) nextOptions.splice(idx, 1);
21053
- return _extends$h({}, state, {
21302
+ return _extends$i({}, state, {
21054
21303
  options: nextOptions,
21055
21304
  activeOptionIndex: function () {
21056
21305
  if (idx === state.activeOptionIndex) return null;
@@ -21111,18 +21360,18 @@ const getPaymentCardIcon = name => {
21111
21360
  }));
21112
21361
  };
21113
21362
 
21114
- var _path$f;
21363
+ var _path$g;
21115
21364
 
21116
- 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); }
21365
+ 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); }
21117
21366
 
21118
21367
  function SvgChevronRight(props) {
21119
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
21368
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
21120
21369
  className: "plc-w-6 plc-h-6",
21121
21370
  xmlns: "http://www.w3.org/2000/svg",
21122
21371
  fill: "none",
21123
21372
  viewBox: "0 0 24 24",
21124
21373
  stroke: "currentColor"
21125
- }, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
21374
+ }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
21126
21375
  strokeLinecap: "round",
21127
21376
  strokeLinejoin: "round",
21128
21377
  strokeWidth: 2,
@@ -21338,18 +21587,18 @@ const SavedItems = ({
21338
21587
  });
21339
21588
  };
21340
21589
 
21341
- var _path$e;
21590
+ var _path$f;
21342
21591
 
21343
- 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); }
21592
+ 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); }
21344
21593
 
21345
21594
  function SvgRefresh(props) {
21346
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
21595
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
21347
21596
  className: "plc-w-4 plc-h-4 plc-mr-1",
21348
21597
  xmlns: "http://www.w3.org/2000/svg",
21349
21598
  fill: "none",
21350
21599
  viewBox: "0 0 24 24",
21351
21600
  stroke: "currentColor"
21352
- }, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
21601
+ }, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
21353
21602
  strokeLinecap: "round",
21354
21603
  strokeLinejoin: "round",
21355
21604
  strokeWidth: 2,
@@ -21357,35 +21606,35 @@ function SvgRefresh(props) {
21357
21606
  })));
21358
21607
  }
21359
21608
 
21360
- var _path$d;
21609
+ var _path$e;
21361
21610
 
21362
- 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); }
21611
+ 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); }
21363
21612
 
21364
21613
  function SvgCalendar(props) {
21365
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
21614
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
21366
21615
  xmlns: "http://www.w3.org/2000/svg",
21367
21616
  className: "plc-h-4 plc-w-4 plc-mr-1",
21368
21617
  viewBox: "0 0 20 20",
21369
21618
  fill: "currentColor"
21370
- }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
21619
+ }, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
21371
21620
  fillRule: "evenodd",
21372
21621
  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",
21373
21622
  clipRule: "evenodd"
21374
21623
  })));
21375
21624
  }
21376
21625
 
21377
- var _path$c;
21626
+ var _path$d;
21378
21627
 
21379
- 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); }
21628
+ 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); }
21380
21629
 
21381
21630
  function SvgPlus(props) {
21382
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
21631
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
21383
21632
  className: "plc-w-5 plc-h-5",
21384
21633
  xmlns: "http://www.w3.org/2000/svg",
21385
21634
  fill: "none",
21386
21635
  viewBox: "0 0 24 24",
21387
21636
  stroke: "currentColor"
21388
- }, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
21637
+ }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
21389
21638
  strokeLinecap: "round",
21390
21639
  strokeLinejoin: "round",
21391
21640
  strokeWidth: 2,
@@ -21393,17 +21642,17 @@ function SvgPlus(props) {
21393
21642
  })));
21394
21643
  }
21395
21644
 
21396
- var _path$b;
21645
+ var _path$c;
21397
21646
 
21398
- 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); }
21647
+ 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); }
21399
21648
 
21400
21649
  function SvgCheckMark(props) {
21401
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
21650
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
21402
21651
  className: "plc-w-4 plc-h-4 plc-mr-1",
21403
21652
  xmlns: "http://www.w3.org/2000/svg",
21404
21653
  viewBox: "0 0 20 20",
21405
21654
  fill: "currentColor"
21406
- }, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
21655
+ }, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
21407
21656
  fillRule: "evenodd",
21408
21657
  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",
21409
21658
  clipRule: "evenodd"
@@ -21698,18 +21947,18 @@ Accordion.item = function AccordionItem({
21698
21947
  }, content)) : null;
21699
21948
  };
21700
21949
 
21701
- var _path$a;
21950
+ var _path$b;
21702
21951
 
21703
- 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); }
21952
+ 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); }
21704
21953
 
21705
21954
  function SvgExit(props) {
21706
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
21955
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
21707
21956
  className: "plc-w-6 plc-h-6",
21708
21957
  xmlns: "http://www.w3.org/2000/svg",
21709
21958
  fill: "none",
21710
21959
  viewBox: "0 0 24 24",
21711
21960
  stroke: "currentColor"
21712
- }, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
21961
+ }, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
21713
21962
  strokeLinecap: "round",
21714
21963
  strokeLinejoin: "round",
21715
21964
  strokeWidth: 2,
@@ -21717,13 +21966,32 @@ function SvgExit(props) {
21717
21966
  })));
21718
21967
  }
21719
21968
 
21969
+ var _path$a;
21970
+
21971
+ 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); }
21972
+
21973
+ function SvgUser(props) {
21974
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
21975
+ xmlns: "http://www.w3.org/2000/svg",
21976
+ fill: "none",
21977
+ viewBox: "0 0 24 24",
21978
+ stroke: "currentColor"
21979
+ }, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
21980
+ strokeLinecap: "round",
21981
+ strokeLinejoin: "round",
21982
+ strokeWidth: 2,
21983
+ d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zm-4 7a7 7 0 00-7 7h14a7 7 0 00-7-7z"
21984
+ })));
21985
+ }
21986
+
21720
21987
  var _path$9;
21721
21988
 
21722
21989
  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); }
21723
21990
 
21724
- function SvgUser(props) {
21991
+ function SvgNewsletter(props) {
21725
21992
  return /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
21726
21993
  xmlns: "http://www.w3.org/2000/svg",
21994
+ className: "plc-h-5 plc-w-5",
21727
21995
  fill: "none",
21728
21996
  viewBox: "0 0 24 24",
21729
21997
  stroke: "currentColor"
@@ -21731,7 +21999,7 @@ function SvgUser(props) {
21731
21999
  strokeLinecap: "round",
21732
22000
  strokeLinejoin: "round",
21733
22001
  strokeWidth: 2,
21734
- d: "M16 7a4 4 0 11-8 0 4 4 0 018 0zm-4 7a7 7 0 00-7 7h14a7 7 0 00-7-7z"
22002
+ d: "M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"
21735
22003
  })));
21736
22004
  }
21737
22005
 
@@ -21739,10 +22007,10 @@ var _path$8;
21739
22007
 
21740
22008
  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); }
21741
22009
 
21742
- function SvgNewsletter(props) {
22010
+ function SvgDocument(props) {
21743
22011
  return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
21744
22012
  xmlns: "http://www.w3.org/2000/svg",
21745
- className: "plc-h-5 plc-w-5",
22013
+ className: "plc-h-6 plc-w-6 plc-mr-2",
21746
22014
  fill: "none",
21747
22015
  viewBox: "0 0 24 24",
21748
22016
  stroke: "currentColor"
@@ -21750,7 +22018,7 @@ function SvgNewsletter(props) {
21750
22018
  strokeLinecap: "round",
21751
22019
  strokeLinejoin: "round",
21752
22020
  strokeWidth: 2,
21753
- d: "M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z"
22021
+ 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"
21754
22022
  })));
21755
22023
  }
21756
22024
 
@@ -21928,6 +22196,130 @@ function formatStartDate(date) {
21928
22196
  return new Intl.DateTimeFormat("en-CA").format(startDate);
21929
22197
  }
21930
22198
 
22199
+ const InvoicesMenu = props => {
22200
+ const {
22201
+ t
22202
+ } = useTranslation("dashboard");
22203
+ return /*#__PURE__*/React__default['default'].createElement("table", {
22204
+ className: "plc-w-full plc-table-fixed"
22205
+ }, /*#__PURE__*/React__default['default'].createElement("thead", {
22206
+ className: "plc-text-xs plc-font-semibold plc-tracking-wider plc-text-gray-400 plc-uppercase "
22207
+ }, /*#__PURE__*/React__default['default'].createElement("tr", null, /*#__PURE__*/React__default['default'].createElement("th", {
22208
+ className: "plc-w-4/12 "
22209
+ }, t("labels.details")), /*#__PURE__*/React__default['default'].createElement("th", {
22210
+ className: "plc-w-4/12 "
22211
+ }, t("labels.status.title")), /*#__PURE__*/React__default['default'].createElement("th", {
22212
+ className: "plc-w-3/12 "
22213
+ }, t("labels.actions")))), /*#__PURE__*/React__default['default'].createElement("tbody", null, /*#__PURE__*/React__default['default'].createElement("tr", {
22214
+ className: "plc-h-4"
22215
+ }), /*#__PURE__*/React__default['default'].createElement(InvoicesItems, props)));
22216
+ };
22217
+
22218
+ const InvoicesItems = () => {
22219
+ var _window$Pelcro$invoic;
22220
+
22221
+ const {
22222
+ t
22223
+ } = useTranslation("dashboard");
22224
+ const {
22225
+ setInvoice,
22226
+ switchView
22227
+ } = usePelcro();
22228
+ const invoices = (_window$Pelcro$invoic = window.Pelcro.invoice.list()) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
22229
+
22230
+ const showInvoiceDetails = event => {
22231
+ if (setInvoice(event.target.dataset.id)) {
22232
+ switchView("invoice-details");
22233
+ }
22234
+ };
22235
+
22236
+ if (invoices.length === 0) return null;
22237
+ return invoices.sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime()).map(invoice => {
22238
+ const invoiceStatus = getInvoiceStatus(invoice);
22239
+ const formattedCreationDate = new Intl.DateTimeFormat("en-CA").format(new Date(invoice.created_at));
22240
+ return /*#__PURE__*/React__default['default'].createElement("tr", {
22241
+ key: invoice.id,
22242
+ className: `plc-w-full plc-align-middle plc-cursor-pointer accordion-header hover:plc-bg-gray-50`
22243
+ }, /*#__PURE__*/React__default['default'].createElement("td", {
22244
+ className: "plc-truncate"
22245
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
22246
+ className: "plc-font-semibold plc-text-gray-500"
22247
+ }, `#${invoice.id}`), /*#__PURE__*/React__default['default'].createElement("br", null), /*#__PURE__*/React__default['default'].createElement("span", {
22248
+ className: "plc-text-sm plc-text-gray-500"
22249
+ }, getFormattedPriceByLocal(invoice.total, invoice.currency, getPageOrDefaultLanguage())), /*#__PURE__*/React__default['default'].createElement("br", null), /*#__PURE__*/React__default['default'].createElement("span", {
22250
+ className: "plc-text-sm plc-text-gray-500"
22251
+ }, formattedCreationDate)), /*#__PURE__*/React__default['default'].createElement("td", {
22252
+ className: "plc-py-2"
22253
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
22254
+ className: `plc-inline-flex plc-p-1 plc-text-xs plc-font-semibold ${invoiceStatus.bgColor} plc-uppercase ${invoiceStatus.textColor} plc-rounded-lg`
22255
+ }, invoiceStatus.icon, invoiceStatus.title)), /*#__PURE__*/React__default['default'].createElement("td", null, /*#__PURE__*/React__default['default'].createElement(Button, {
22256
+ variant: "ghost",
22257
+ className: "plc-text-blue-400 focus:plc-ring-blue-400 pelcro-dashboard-view-invoice-button",
22258
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgDocument, {
22259
+ className: "plc-w-4 plc-h-4"
22260
+ }),
22261
+ onClick: showInvoiceDetails,
22262
+ "data-id": invoice.id
22263
+ }, t("labels.view"))));
22264
+ });
22265
+ };
22266
+
22267
+ function getInvoiceStatus(invoice) {
22268
+ const translations = i18next.t("dashboard:labels", {
22269
+ returnObjects: true
22270
+ });
22271
+
22272
+ switch (invoice.status) {
22273
+ case "paid":
22274
+ return {
22275
+ textColor: "plc-text-green-700",
22276
+ bgColor: "plc-bg-green-100",
22277
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgCheckMark, null),
22278
+ title: translations.paid
22279
+ };
22280
+
22281
+ case "past_due":
22282
+ return {
22283
+ textColor: "plc-text-orange-700",
22284
+ bgColor: "plc-bg-orange-100",
22285
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgExclamation, null),
22286
+ title: translations.pastDue
22287
+ };
22288
+
22289
+ case "open":
22290
+ return {
22291
+ textColor: "plc-text-yellow-700",
22292
+ bgColor: "plc-bg-yellow-100",
22293
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgExclamation, null),
22294
+ title: translations.open
22295
+ };
22296
+
22297
+ case "draft":
22298
+ return {
22299
+ textColor: "plc-text-blue-700",
22300
+ bgColor: "plc-bg-blue-100",
22301
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgEdit, null),
22302
+ title: translations.draft
22303
+ };
22304
+
22305
+ case "uncollectible":
22306
+ return {
22307
+ textColor: "plc-text-red-700",
22308
+ bgColor: "plc-bg-red-100",
22309
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgXIconSolid, null),
22310
+ title: translations.uncollectible
22311
+ };
22312
+
22313
+ case "void":
22314
+ return {
22315
+ textColor: "plc-text-gray-700",
22316
+ bgColor: "plc-bg-gray-100",
22317
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgXIconSolid, null),
22318
+ title: translations.void
22319
+ };
22320
+ }
22321
+ }
22322
+
21931
22323
  const SUB_MENUS = {
21932
22324
  PROFILE: "profile",
21933
22325
  SUBSCRIPTIONS: "subscriptions",
@@ -21936,6 +22328,7 @@ const SUB_MENUS = {
21936
22328
  ADDRESSES: "addresses",
21937
22329
  GIFTS: "gifts",
21938
22330
  ORDERS: "orders",
22331
+ INVOICES: "invoices",
21939
22332
  SAVED_ITEMS: "saved-items"
21940
22333
  };
21941
22334
  /**
@@ -22478,6 +22871,12 @@ class Dashboard extends React.Component {
22478
22871
  icon: /*#__PURE__*/React__default['default'].createElement(SvgShopping, null),
22479
22872
  title: this.locale("labels.orders.label"),
22480
22873
  content: /*#__PURE__*/React__default['default'].createElement(OrdersMenu, null)
22874
+ }), /*#__PURE__*/React__default['default'].createElement(Accordion.item, {
22875
+ show: hasInvoices(),
22876
+ name: SUB_MENUS.INVOICES,
22877
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgDocument, null),
22878
+ title: this.locale("labels.invoices"),
22879
+ content: /*#__PURE__*/React__default['default'].createElement(InvoicesMenu, null)
22481
22880
  }), /*#__PURE__*/React__default['default'].createElement(Accordion.item, {
22482
22881
  name: SUB_MENUS.SAVED_ITEMS,
22483
22882
  icon: /*#__PURE__*/React__default['default'].createElement(SvgBookmark, null),
@@ -22493,6 +22892,13 @@ class Dashboard extends React.Component {
22493
22892
 
22494
22893
  }
22495
22894
 
22895
+ function hasInvoices() {
22896
+ var _window$Pelcro$invoic;
22897
+
22898
+ const invoices = (_window$Pelcro$invoic = window.Pelcro.invoice.list()) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
22899
+ return invoices.length > 0;
22900
+ }
22901
+
22496
22902
  function hasDonationSubs() {
22497
22903
  var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3;
22498
22904
 
@@ -22527,7 +22933,7 @@ const DashboardOpenButton = () => {
22527
22933
  };
22528
22934
  DashboardOpenButton.viewId = "dashboard-open";
22529
22935
 
22530
- const initialState$1 = {
22936
+ const initialState$2 = {
22531
22937
  imageSrc: null,
22532
22938
  crop: {
22533
22939
  x: 0,
@@ -22541,10 +22947,10 @@ const initialState$1 = {
22541
22947
  content: ""
22542
22948
  }
22543
22949
  };
22544
- const store$1 = /*#__PURE__*/React.createContext(initialState$1);
22950
+ const store$2 = /*#__PURE__*/React.createContext(initialState$2);
22545
22951
  const {
22546
- Provider: Provider$1
22547
- } = store$1;
22952
+ Provider: Provider$2
22953
+ } = store$2;
22548
22954
 
22549
22955
  const ProfilePicChangeContainer = ({
22550
22956
  style,
@@ -22678,21 +23084,21 @@ const ProfilePicChangeContainer = ({
22678
23084
  default:
22679
23085
  return state;
22680
23086
  }
22681
- }, initialState$1);
23087
+ }, initialState$2);
22682
23088
  return /*#__PURE__*/React__default['default'].createElement("div", {
22683
23089
  style: { ...style
22684
23090
  },
22685
23091
  className: `pelcro-container pelcro-profile-picture-container ${className}`
22686
- }, /*#__PURE__*/React__default['default'].createElement(Provider$1, {
23092
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$2, {
22687
23093
  value: {
22688
23094
  state,
22689
23095
  dispatch
22690
23096
  }
22691
23097
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
22692
- store: store$1,
23098
+ store: store$2,
22693
23099
  key: i
22694
23100
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
22695
- store: store$1
23101
+ store: store$2
22696
23102
  })));
22697
23103
  };
22698
23104
  /**
@@ -22754,7 +23160,7 @@ const ProfilePicChangeButton = ({
22754
23160
  isSubmitting
22755
23161
  },
22756
23162
  dispatch
22757
- } = React.useContext(store$1);
23163
+ } = React.useContext(store$2);
22758
23164
  const {
22759
23165
  t
22760
23166
  } = useTranslation("userEdit");
@@ -24122,7 +24528,7 @@ const ProfilePicChangeCropper = ({
24122
24528
  zoom
24123
24529
  },
24124
24530
  dispatch
24125
- } = React.useContext(store$1);
24531
+ } = React.useContext(store$2);
24126
24532
  return /*#__PURE__*/React__default['default'].createElement("div", {
24127
24533
  className: `plc-relative plc-w-full plc-h-52 sm:plc-h-96 ${className}`
24128
24534
  }, /*#__PURE__*/React__default['default'].createElement(Cropper, Object.assign({
@@ -24164,7 +24570,7 @@ const ProfilePicChangeZoom = ({
24164
24570
  zoom
24165
24571
  },
24166
24572
  dispatch
24167
- } = React.useContext(store$1);
24573
+ } = React.useContext(store$2);
24168
24574
  const {
24169
24575
  t
24170
24576
  } = useTranslation("userEdit");
@@ -24216,7 +24622,7 @@ const ProfilePicChangeSelectButton = ({
24216
24622
  state: {
24217
24623
  isSubmitting
24218
24624
  }
24219
- } = React.useContext(store$1);
24625
+ } = React.useContext(store$2);
24220
24626
  const {
24221
24627
  t
24222
24628
  } = useTranslation("userEdit");
@@ -24258,7 +24664,7 @@ const ProfilePicChangeRemoveButton = ({
24258
24664
  state: {
24259
24665
  isSubmitting
24260
24666
  }
24261
- } = React.useContext(store$1);
24667
+ } = React.useContext(store$2);
24262
24668
  const {
24263
24669
  t
24264
24670
  } = useTranslation("userEdit");
@@ -24281,7 +24687,7 @@ const ProfilePicChangeWrapper = () => {
24281
24687
  state: {
24282
24688
  imageSrc
24283
24689
  }
24284
- } = React.useContext(store$1);
24690
+ } = React.useContext(store$2);
24285
24691
  const {
24286
24692
  t
24287
24693
  } = useTranslation("userEdit");
@@ -24343,17 +24749,17 @@ function ProfilePicChangeModal({
24343
24749
  }
24344
24750
  ProfilePicChangeModal.viewId = "profile-picture";
24345
24751
 
24346
- const initialState = {
24752
+ const initialState$1 = {
24347
24753
  isSubmitting: false,
24348
24754
  alert: {
24349
24755
  type: "error",
24350
24756
  content: ""
24351
24757
  }
24352
24758
  };
24353
- const store = /*#__PURE__*/React.createContext(initialState);
24759
+ const store$1 = /*#__PURE__*/React.createContext(initialState$1);
24354
24760
  const {
24355
- Provider
24356
- } = store;
24761
+ Provider: Provider$1
24762
+ } = store$1;
24357
24763
 
24358
24764
  const EmailVerifyContainer = ({
24359
24765
  style,
@@ -24416,21 +24822,21 @@ const EmailVerifyContainer = ({
24416
24822
  default:
24417
24823
  return state;
24418
24824
  }
24419
- }, initialState);
24825
+ }, initialState$1);
24420
24826
  return /*#__PURE__*/React__default['default'].createElement("div", {
24421
24827
  style: { ...style
24422
24828
  },
24423
24829
  className: `pelcro-container pelcro-email-verify-container ${className}`
24424
- }, /*#__PURE__*/React__default['default'].createElement(Provider, {
24830
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$1, {
24425
24831
  value: {
24426
24832
  state,
24427
24833
  dispatch
24428
24834
  }
24429
24835
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
24430
- store,
24836
+ store: store$1,
24431
24837
  key: i
24432
24838
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
24433
- store
24839
+ store: store$1
24434
24840
  })));
24435
24841
  };
24436
24842
 
@@ -24444,7 +24850,7 @@ const EmailVerifyResendButton = ({
24444
24850
  state: {
24445
24851
  isSubmitting
24446
24852
  }
24447
- } = React.useContext(store);
24853
+ } = React.useContext(store$1);
24448
24854
  const {
24449
24855
  t
24450
24856
  } = useTranslation("verifyEmail");
@@ -24519,6 +24925,235 @@ const EmailVerifyModal = ({
24519
24925
  };
24520
24926
  EmailVerifyModal.viewId = "email-verify";
24521
24927
 
24928
+ const InvoicePaymentContainer = props => /*#__PURE__*/React__default['default'].createElement(PaymentMethodContainer, Object.assign({
24929
+ type: "invoicePayment",
24930
+ className: "pelcro-invoice-payment-container"
24931
+ }, props));
24932
+
24933
+ const InvoicePaymentView = props => {
24934
+ const {
24935
+ t
24936
+ } = useTranslation("payment");
24937
+ return /*#__PURE__*/React__default['default'].createElement("div", {
24938
+ id: "pelcro-invoice-payment-view"
24939
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
24940
+ className: "plc-mb-6 plc-text-2xl plc-font-semibold plc-text-center plc-text-gray-900 pelcro-title-wrapper"
24941
+ }, /*#__PURE__*/React__default['default'].createElement("h4", null, t("labels.checkout.title"))), /*#__PURE__*/React__default['default'].createElement("form", {
24942
+ action: "javascript:void(0);",
24943
+ className: "plc-mt-2 pelcro-form"
24944
+ }, /*#__PURE__*/React__default['default'].createElement(PaymentMethodView, Object.assign({
24945
+ type: "invoicePayment",
24946
+ showCoupon: false,
24947
+ showExternalPaymentMethods: true
24948
+ }, props))));
24949
+ };
24950
+
24951
+ const InvoicePaymentModal = ({
24952
+ onDisplay,
24953
+ onClose,
24954
+ ...otherProps
24955
+ }) => {
24956
+ const {
24957
+ switchView
24958
+ } = usePelcro();
24959
+
24960
+ const onSuccess = () => {
24961
+ var _otherProps$onSuccess;
24962
+
24963
+ (_otherProps$onSuccess = otherProps.onSuccess) === null || _otherProps$onSuccess === void 0 ? void 0 : _otherProps$onSuccess.call(otherProps);
24964
+ return switchView("subscription-success");
24965
+ };
24966
+
24967
+ return /*#__PURE__*/React__default['default'].createElement(Modal, {
24968
+ id: "pelcro-invoice-payment-modal",
24969
+ onDisplay: onDisplay,
24970
+ onClose: onClose
24971
+ }, /*#__PURE__*/React__default['default'].createElement(ModalBody, null, /*#__PURE__*/React__default['default'].createElement(InvoicePaymentView, Object.assign({}, otherProps, {
24972
+ onSuccess: onSuccess
24973
+ }))), /*#__PURE__*/React__default['default'].createElement(ModalFooter, null, /*#__PURE__*/React__default['default'].createElement(Authorship, null)));
24974
+ };
24975
+ InvoicePaymentModal.viewId = "invoice-payment";
24976
+
24977
+ const invoicePaymentSubmitButton = props => {
24978
+ return /*#__PURE__*/React__default['default'].createElement(SubmitPaymentMethod, props);
24979
+ };
24980
+
24981
+ const initialState = {};
24982
+ const store = /*#__PURE__*/React.createContext(initialState);
24983
+ const {
24984
+ Provider
24985
+ } = store;
24986
+
24987
+ const InvoiceDetailsContainer = ({
24988
+ style,
24989
+ className = "",
24990
+ onSuccess = () => {},
24991
+ children,
24992
+ ...props
24993
+ }) => {
24994
+ const onPayButtonClick = () => {
24995
+ return onSuccess();
24996
+ };
24997
+
24998
+ const [state, dispatch] = useReducerWithSideEffects((state, action) => {
24999
+ switch (action.type) {
25000
+ case HANDLE_SUBMIT:
25001
+ return lib_4((state, dispatch) => onPayButtonClick());
25002
+
25003
+ default:
25004
+ return state;
25005
+ }
25006
+ }, initialState);
25007
+ return /*#__PURE__*/React__default['default'].createElement("div", {
25008
+ style: { ...style
25009
+ },
25010
+ className: `pelcro-container pelcro-invoice-details-container ${className}`
25011
+ }, /*#__PURE__*/React__default['default'].createElement(Provider, {
25012
+ value: {
25013
+ state,
25014
+ dispatch
25015
+ }
25016
+ }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
25017
+ store,
25018
+ key: i
25019
+ })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
25020
+ store
25021
+ })));
25022
+ };
25023
+
25024
+ const InvoiceDetailsDownloadButton = ({
25025
+ name,
25026
+ url,
25027
+ className,
25028
+ ...otherProps
25029
+ }) => {
25030
+ const {
25031
+ t
25032
+ } = useTranslation("invoiceDetails");
25033
+ const {
25034
+ invoice
25035
+ } = usePelcro();
25036
+ return /*#__PURE__*/React__default['default'].createElement(Link, Object.assign({
25037
+ className: `plc-px-6 plc-py-2 plc-uppercase plc-bg-transparent plc-text-primary-500 plc-border plc-border-primary-500 plc-rounded focus:plc-outline-none focus:plc-ring-2 focus:plc-ring-primary-300 plc-tracking-wider hover:plc-bg-primary-600 focus:plc-bg-primary-600 hover:plc-text-white focus:plc-text-white hover:plc-shadow-none plc-no-underline ${className}`,
25038
+ id: "pelcro-download-invoice-link",
25039
+ href: url !== null && url !== void 0 ? url : invoice === null || invoice === void 0 ? void 0 : invoice.invoice_pdf,
25040
+ target: "_blank",
25041
+ rel: "noopener noreferrer"
25042
+ }, otherProps), name !== null && name !== void 0 ? name : t("buttons.download"));
25043
+ };
25044
+
25045
+ const InvoiceDetailsPayButton = ({
25046
+ name,
25047
+ onClick,
25048
+ ...otherProps
25049
+ }) => {
25050
+ const {
25051
+ dispatch
25052
+ } = React.useContext(store);
25053
+ const {
25054
+ t
25055
+ } = useTranslation("invoiceDetails");
25056
+ return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
25057
+ onClick: () => {
25058
+ dispatch({
25059
+ type: HANDLE_SUBMIT
25060
+ });
25061
+ onClick === null || onClick === void 0 ? void 0 : onClick();
25062
+ }
25063
+ }, otherProps), name !== null && name !== void 0 ? name : t("buttons.pay"));
25064
+ };
25065
+
25066
+ const InvoiceDetailsView = props => {
25067
+ const {
25068
+ t
25069
+ } = useTranslation("invoiceDetails");
25070
+ const {
25071
+ invoice
25072
+ } = usePelcro();
25073
+ const showPayButton = canPayInvoice(invoice);
25074
+ const creationDate = new Date(invoice === null || invoice === void 0 ? void 0 : invoice.created_at);
25075
+ const formattedCreationDate = new Intl.DateTimeFormat("en-CA").format(creationDate);
25076
+ return /*#__PURE__*/React__default['default'].createElement("div", {
25077
+ id: "pelcro-invoice-details-view"
25078
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
25079
+ className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
25080
+ }, /*#__PURE__*/React__default['default'].createElement("h4", {
25081
+ className: "plc-text-2xl plc-font-semibold"
25082
+ }, t("title"))), /*#__PURE__*/React__default['default'].createElement("form", {
25083
+ action: "javascript:void(0);",
25084
+ className: "plc-mt-2 pelcro-form"
25085
+ }, /*#__PURE__*/React__default['default'].createElement(InvoiceDetailsContainer, props, /*#__PURE__*/React__default['default'].createElement("div", {
25086
+ className: "plc-mt-5 pelcro-invoice-summary-wrapper"
25087
+ }, /*#__PURE__*/React__default['default'].createElement("p", {
25088
+ className: "plc-font-bold pelcro-invoice-summary-title"
25089
+ }, t("labels.summary")), invoice && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("p", {
25090
+ className: "plc-mr-2 pelcro-invoice-creation-date"
25091
+ }, `${t("labels.creationDate")} ${formattedCreationDate}`), /*#__PURE__*/React__default['default'].createElement("div", {
25092
+ 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-evenly pelcro-invoice-plan-wrapper"
25093
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
25094
+ className: "plc-w-1/2 plc-break-words pelcro-invoice-plan-name"
25095
+ }, invoice.plan.nickname), /*#__PURE__*/React__default['default'].createElement("div", {
25096
+ className: "plc-w-1/5 plc-text-center pelcro-invoice-summary-price"
25097
+ }, calcAndFormatItemsTotal([invoice.plan], invoice.currency))), /*#__PURE__*/React__default['default'].createElement("div", {
25098
+ className: "plc-flex plc-justify-end plc-pt-2 plc-mt-2 plc-font-bold plc-border-t plc-border-gray-400 pelcro-invoice-total-wrapper"
25099
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
25100
+ className: "plc-mr-2 plc-flex plc-flex-col"
25101
+ }, /*#__PURE__*/React__default['default'].createElement("p", {
25102
+ className: "pelcro-invoice-total-text"
25103
+ }, t("labels.total")), /*#__PURE__*/React__default['default'].createElement("p", {
25104
+ className: "pelcro-invoice-total-text"
25105
+ }, t("labels.amountPaid")), /*#__PURE__*/React__default['default'].createElement("p", {
25106
+ className: "plc-font-semibold pelcro-invoice-total-text"
25107
+ }, t("labels.amountDue"))), /*#__PURE__*/React__default['default'].createElement("div", {
25108
+ className: "plc-flex plc-flex-col"
25109
+ }, /*#__PURE__*/React__default['default'].createElement("p", {
25110
+ className: "pelcro-invoice-total"
25111
+ }, getFormattedPriceByLocal(invoice.total, invoice.currency, getPageOrDefaultLanguage())), /*#__PURE__*/React__default['default'].createElement("p", {
25112
+ className: "pelcro-invoice-total"
25113
+ }, getFormattedPriceByLocal(invoice.amount_paid, invoice.currency, getPageOrDefaultLanguage())), /*#__PURE__*/React__default['default'].createElement("p", {
25114
+ className: "plc-font-semibold pelcro-invoice-total"
25115
+ }, getFormattedPriceByLocal(invoice.amount_remaining, invoice.currency, getPageOrDefaultLanguage())))))), /*#__PURE__*/React__default['default'].createElement("div", {
25116
+ className: "plc-flex plc-items-center plc-justify-center plc-mt-4"
25117
+ }, /*#__PURE__*/React__default['default'].createElement(InvoiceDetailsDownloadButton, {
25118
+ url: invoice === null || invoice === void 0 ? void 0 : invoice.invoice_pdf,
25119
+ className: "plc-w-full plc-text-center"
25120
+ }), showPayButton && /*#__PURE__*/React__default['default'].createElement(InvoiceDetailsPayButton, {
25121
+ role: "submit",
25122
+ className: "plc-ml-4 plc-w-full",
25123
+ id: "pelcro-submit"
25124
+ })))));
25125
+ };
25126
+
25127
+ function canPayInvoice(invoice) {
25128
+ return (invoice === null || invoice === void 0 ? void 0 : invoice.status) === "open" || (invoice === null || invoice === void 0 ? void 0 : invoice.status) === "past_due";
25129
+ }
25130
+
25131
+ const InvoiceDetailsModal = ({
25132
+ onDisplay,
25133
+ onClose,
25134
+ ...otherProps
25135
+ }) => {
25136
+ const {
25137
+ switchToPaymentView
25138
+ } = usePelcro();
25139
+
25140
+ const onSuccess = () => {
25141
+ var _otherProps$onSuccess;
25142
+
25143
+ (_otherProps$onSuccess = otherProps.onSuccess) === null || _otherProps$onSuccess === void 0 ? void 0 : _otherProps$onSuccess.call(otherProps);
25144
+ switchToPaymentView();
25145
+ };
25146
+
25147
+ return /*#__PURE__*/React__default['default'].createElement(Modal, {
25148
+ onDisplay: onDisplay,
25149
+ onClose: onClose,
25150
+ id: "pelcro-invoice-details-modal"
25151
+ }, /*#__PURE__*/React__default['default'].createElement(ModalBody, null, /*#__PURE__*/React__default['default'].createElement(InvoiceDetailsView, Object.assign({}, otherProps, {
25152
+ onSuccess: onSuccess
25153
+ }))), /*#__PURE__*/React__default['default'].createElement(ModalFooter, null, /*#__PURE__*/React__default['default'].createElement(Authorship, null)));
25154
+ };
25155
+ InvoiceDetailsModal.viewId = "invoice-details";
25156
+
24522
25157
  exports.AddressCreateCity = AddressCreateCity;
24523
25158
  exports.AddressCreateContainer = AddressCreateContainer;
24524
25159
  exports.AddressCreateCountrySelect = AddressCreateCountrySelect;
@@ -24594,6 +25229,14 @@ exports.GiftRedeemSubmitButton = GiftRedeemSubmitButton;
24594
25229
  exports.GiftRedeemView = GiftRedeemView;
24595
25230
  exports.GoogleLoginButton = GoogleLoginButton;
24596
25231
  exports.Input = Input;
25232
+ exports.InvoiceDetailsContainer = InvoiceDetailsContainer;
25233
+ exports.InvoiceDetailsDownloadButton = InvoiceDetailsDownloadButton;
25234
+ exports.InvoiceDetailsModal = InvoiceDetailsModal;
25235
+ exports.InvoiceDetailsPayButton = InvoiceDetailsPayButton;
25236
+ exports.InvoiceDetailsView = InvoiceDetailsView;
25237
+ exports.InvoicePaymentContainer = InvoicePaymentContainer;
25238
+ exports.InvoicePaymentModal = InvoicePaymentModal;
25239
+ exports.InvoicePaymentView = InvoicePaymentView;
24597
25240
  exports.Link = Link;
24598
25241
  exports.LoginButton = LoginButton;
24599
25242
  exports.LoginContainer = LoginContainer;
@@ -24709,6 +25352,7 @@ exports.authenticatedButtons = authenticatedButtons;
24709
25352
  exports.i18n = i18next;
24710
25353
  exports.initButtons = init$1;
24711
25354
  exports.initContentEntitlement = init;
25355
+ exports.invoicePaymentSubmitButton = invoicePaymentSubmitButton;
24712
25356
  exports.notify = notify;
24713
25357
  exports.unauthenticatedButtons = unauthenticatedButtons;
24714
25358
  exports.usePelcro = usePelcro;