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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.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,17 @@ 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";
3673
+ var zeroTotalInvoice$1 = "You can't view an invoice of 0$";
3664
3674
  var messages_en = {
3665
3675
  youAreSafe: youAreSafe$1,
3666
3676
  cancel: cancel$1,
3667
3677
  giftSent: giftSent$1,
3668
3678
  successfully: successfully$1,
3669
3679
  entitlement: entitlement$1,
3670
- recaptcha: recaptcha$1
3680
+ recaptcha: recaptcha$1,
3681
+ invalidInvoice: invalidInvoice$1,
3682
+ zeroTotalInvoice: zeroTotalInvoice$1
3671
3683
  };
3672
3684
 
3673
3685
  var youAreSafe = "Vous êtes en sécurité - PCI conforme 128 SSL par";
@@ -3676,16 +3688,20 @@ var giftSent = "Le cadeau d’abonnement a été envoyé à";
3676
3688
  var successfully = "avec succès.";
3677
3689
  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
3690
  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.";
3691
+ var invalidInvoice = "Invalid invoice ID, please contact support";
3692
+ var zeroTotalInvoice = "You can't view an invoice of 0$";
3679
3693
  var messages_fr = {
3680
3694
  youAreSafe: youAreSafe,
3681
3695
  cancel: cancel,
3682
3696
  giftSent: giftSent,
3683
3697
  successfully: successfully,
3684
3698
  entitlement: entitlement,
3685
- recaptcha: recaptcha
3699
+ recaptcha: recaptcha,
3700
+ invalidInvoice: invalidInvoice,
3701
+ zeroTotalInvoice: zeroTotalInvoice
3686
3702
  };
3687
3703
 
3688
- var labels$h = {
3704
+ var labels$j = {
3689
3705
  email: "Enter email",
3690
3706
  password: "Enter password",
3691
3707
  required: "required",
@@ -3712,12 +3728,12 @@ var errors$5 = {
3712
3728
  "": ""
3713
3729
  };
3714
3730
  var login_en = {
3715
- labels: labels$h,
3731
+ labels: labels$j,
3716
3732
  messages: messages$j,
3717
3733
  errors: errors$5
3718
3734
  };
3719
3735
 
3720
- var labels$g = {
3736
+ var labels$i = {
3721
3737
  email: "Entrez votre adresse courriel",
3722
3738
  password: "Entrez votre mot de passe",
3723
3739
  required: "Champs obligatoires",
@@ -3744,14 +3760,14 @@ var errors$4 = {
3744
3760
  "": ""
3745
3761
  };
3746
3762
  var login_fr = {
3747
- labels: labels$g,
3763
+ labels: labels$i,
3748
3764
  messages: messages$i,
3749
3765
  errors: errors$4
3750
3766
  };
3751
3767
 
3752
- var title$b = "Create an account";
3768
+ var title$d = "Create an account";
3753
3769
  var subtitle$5 = "Enter your email and password below";
3754
- var labels$f = {
3770
+ var labels$h = {
3755
3771
  signUpFacebook: "Sign up with Facebook",
3756
3772
  signUpGoogle: "Sign up with Google",
3757
3773
  signUpEmail: "Sign up with Email",
@@ -3796,7 +3812,7 @@ var gift$1 = {
3796
3812
  lastName: "Last name",
3797
3813
  email: "Email",
3798
3814
  startDate: "Gift date",
3799
- giftMessage: "Gift message (200 characters max)",
3815
+ giftMessage: "Gift message ({{count}} characters remaining)",
3800
3816
  required: "required",
3801
3817
  firstNamePlaceholder: "First name",
3802
3818
  lastNamePlaceholder: "Last name",
@@ -3835,18 +3851,18 @@ var redeem$1 = {
3835
3851
  }
3836
3852
  };
3837
3853
  var register_en = {
3838
- title: title$b,
3854
+ title: title$d,
3839
3855
  subtitle: subtitle$5,
3840
- labels: labels$f,
3856
+ labels: labels$h,
3841
3857
  messages: messages$h,
3842
3858
  errors: errors$3,
3843
3859
  gift: gift$1,
3844
3860
  redeem: redeem$1
3845
3861
  };
3846
3862
 
3847
- var title$a = "Créer un compte";
3863
+ var title$c = "Créer un compte";
3848
3864
  var subtitle$4 = "Entrez votre courriel et votre mot de passe ci-dessous";
3849
- var labels$e = {
3865
+ var labels$g = {
3850
3866
  signUpFacebook: "Inscrivez-vous avec Facebook",
3851
3867
  signUpGoogle: "Inscrivez-vous avec Google",
3852
3868
  signUpEmail: "Inscrivez-vous avec votre courriel",
@@ -3892,7 +3908,7 @@ var gift = {
3892
3908
  lastName: "Nom de famille",
3893
3909
  email: "Adresse courriel",
3894
3910
  startDate: "Date de début",
3895
- giftMessage: "Message du cadeau (200 caractères max)",
3911
+ giftMessage: "Message du cadeau ({{count}} caractères restants)",
3896
3912
  required: "Champs obligatoires",
3897
3913
  firstNamePlaceholder: "Prénom",
3898
3914
  lastNamePlaceholder: "Nom de famille",
@@ -3931,16 +3947,16 @@ var redeem = {
3931
3947
  }
3932
3948
  };
3933
3949
  var register_fr = {
3934
- title: title$a,
3950
+ title: title$c,
3935
3951
  subtitle: subtitle$4,
3936
- labels: labels$e,
3952
+ labels: labels$g,
3937
3953
  messages: messages$g,
3938
3954
  errors: errors$2,
3939
3955
  gift: gift,
3940
3956
  redeem: redeem
3941
3957
  };
3942
3958
 
3943
- var labels$d = {
3959
+ var labels$f = {
3944
3960
  title: "Want to update your profile?",
3945
3961
  subtitle: "Enter your information below to update your profile",
3946
3962
  email: "Email",
@@ -3962,11 +3978,11 @@ var messages$f = {
3962
3978
  pictureUpdated: "Your profile picture was updated successfully."
3963
3979
  };
3964
3980
  var userEdit_en = {
3965
- labels: labels$d,
3981
+ labels: labels$f,
3966
3982
  messages: messages$f
3967
3983
  };
3968
3984
 
3969
- var labels$c = {
3985
+ var labels$e = {
3970
3986
  title: "Voulez-vous mettre à jour votre profil ?",
3971
3987
  subtitle: "Entrez vos informations ci-dessous pour mettre à jour votre profil",
3972
3988
  email: "Address courriel",
@@ -3988,14 +4004,14 @@ var messages$e = {
3988
4004
  pictureUpdated: "Votre photo de profil a été mise à jour avec succès."
3989
4005
  };
3990
4006
  var userEdit_fr = {
3991
- labels: labels$c,
4007
+ labels: labels$e,
3992
4008
  messages: messages$e
3993
4009
  };
3994
4010
 
3995
- var title$9 = "Enter your shipping address";
4011
+ var title$b = "Enter your shipping address";
3996
4012
  var selectAddressTitle$1 = "Please select an address";
3997
4013
  var selectAddressSubtitle$1 = "Select one of your saved addresses, or add a new one";
3998
- var labels$b = {
4014
+ var labels$d = {
3999
4015
  address: "Address",
4000
4016
  code: "Postal Code/Zip",
4001
4017
  city: "City",
@@ -4005,7 +4021,7 @@ var labels$b = {
4005
4021
  lastName: "Last name",
4006
4022
  required: "required"
4007
4023
  };
4008
- var buttons$5 = {
4024
+ var buttons$7 = {
4009
4025
  submit: "Submit",
4010
4026
  selectAddress: "Select address",
4011
4027
  addAddress: "Add new address"
@@ -4015,18 +4031,18 @@ var messages$d = {
4015
4031
  subRedeemed: "Your subscription has been redeemed."
4016
4032
  };
4017
4033
  var address_en = {
4018
- title: title$9,
4034
+ title: title$b,
4019
4035
  selectAddressTitle: selectAddressTitle$1,
4020
4036
  selectAddressSubtitle: selectAddressSubtitle$1,
4021
- labels: labels$b,
4022
- buttons: buttons$5,
4037
+ labels: labels$d,
4038
+ buttons: buttons$7,
4023
4039
  messages: messages$d
4024
4040
  };
4025
4041
 
4026
- var title$8 = "Entrez votre adresse de livraison";
4042
+ var title$a = "Entrez votre adresse de livraison";
4027
4043
  var selectAddressTitle = "Veuillez sélectionner une adresse";
4028
4044
  var selectAddressSubtitle = "Choisissez l'une de vos adresses ou créez-en une nouvelle";
4029
- var labels$a = {
4045
+ var labels$c = {
4030
4046
  address: "Adresse",
4031
4047
  code: "Code postal / Zip",
4032
4048
  city: "Ville",
@@ -4036,7 +4052,7 @@ var labels$a = {
4036
4052
  lastName: "Nom de famille",
4037
4053
  required: "Champs obligatoires"
4038
4054
  };
4039
- var buttons$4 = {
4055
+ var buttons$6 = {
4040
4056
  submit: "Valider",
4041
4057
  selectAddress: "Choisir cette adresse",
4042
4058
  addAddress: "Ajouter une nouvelle adresse"
@@ -4046,15 +4062,15 @@ var messages$c = {
4046
4062
  subRedeemed: "Votre abonnement a bien été activé."
4047
4063
  };
4048
4064
  var address_fr = {
4049
- title: title$8,
4065
+ title: title$a,
4050
4066
  selectAddressTitle: selectAddressTitle,
4051
4067
  selectAddressSubtitle: selectAddressSubtitle,
4052
- labels: labels$a,
4053
- buttons: buttons$4,
4068
+ labels: labels$c,
4069
+ buttons: buttons$6,
4054
4070
  messages: messages$c
4055
4071
  };
4056
4072
 
4057
- var title$7 = "Reset your password";
4073
+ var title$9 = "Reset your password";
4058
4074
  var subtitle$3 = "Enter a new password below";
4059
4075
  var email$3 = "Email";
4060
4076
  var password$3 = "Password";
@@ -4063,7 +4079,7 @@ var submit$5 = "Submit";
4063
4079
  var required$5 = "Required";
4064
4080
  var passwordUpdated$1 = "Password has been updated, please login with the new password";
4065
4081
  var passwordReset_en = {
4066
- title: title$7,
4082
+ title: title$9,
4067
4083
  subtitle: subtitle$3,
4068
4084
  email: email$3,
4069
4085
  password: password$3,
@@ -4073,7 +4089,7 @@ var passwordReset_en = {
4073
4089
  passwordUpdated: passwordUpdated$1
4074
4090
  };
4075
4091
 
4076
- var title$6 = "Réinitialiser votre mot de passe";
4092
+ var title$8 = "Réinitialiser votre mot de passe";
4077
4093
  var subtitle$2 = "Entrez un nouveau mot de passe ci-dessous";
4078
4094
  var email$2 = "Adresse courriel";
4079
4095
  var password$2 = "Mot de passe";
@@ -4082,7 +4098,7 @@ var submit$4 = "Soumettre";
4082
4098
  var required$4 = "Champs obligatoires";
4083
4099
  var passwordUpdated = "Votre mot de passe a été mis à jour, veuillez vous connecter avec celui-ci";
4084
4100
  var passwordReset_fr = {
4085
- title: title$6,
4101
+ title: title$8,
4086
4102
  subtitle: subtitle$2,
4087
4103
  email: email$2,
4088
4104
  password: password$2,
@@ -4092,7 +4108,7 @@ var passwordReset_fr = {
4092
4108
  passwordUpdated: passwordUpdated
4093
4109
  };
4094
4110
 
4095
- var title$5 = "Forgot your password?";
4111
+ var title$7 = "Forgot your password?";
4096
4112
  var email$1 = "Email";
4097
4113
  var password$1 = "Password";
4098
4114
  var submit$3 = "Submit";
@@ -4103,7 +4119,7 @@ var messages$b = {
4103
4119
  loginHere: "login here."
4104
4120
  };
4105
4121
  var passwordForgot_en = {
4106
- title: title$5,
4122
+ title: title$7,
4107
4123
  email: email$1,
4108
4124
  password: password$1,
4109
4125
  submit: submit$3,
@@ -4112,7 +4128,7 @@ var passwordForgot_en = {
4112
4128
  messages: messages$b
4113
4129
  };
4114
4130
 
4115
- var title$4 = "Mot de passe oublié ?";
4131
+ var title$6 = "Mot de passe oublié ?";
4116
4132
  var email = "Courriel";
4117
4133
  var password = "Mot de passe";
4118
4134
  var submit$2 = "Soumettre";
@@ -4123,7 +4139,7 @@ var messages$a = {
4123
4139
  loginHere: "Connectez-vous ici"
4124
4140
  };
4125
4141
  var passwordForgot_fr = {
4126
- title: title$4,
4142
+ title: title$6,
4127
4143
  email: email,
4128
4144
  password: password,
4129
4145
  submit: submit$2,
@@ -4132,7 +4148,7 @@ var passwordForgot_fr = {
4132
4148
  messages: messages$a
4133
4149
  };
4134
4150
 
4135
- var title$3 = "Change your password";
4151
+ var title$5 = "Change your password";
4136
4152
  var currentPassword$1 = "Current password";
4137
4153
  var newPassword$1 = "New password";
4138
4154
  var confirmNewPassword$1 = "Confirm new password";
@@ -4142,7 +4158,7 @@ var passwordChanged$1 = "Password has been changed, please login with the new pa
4142
4158
  var passwordsNotMatching$1 = "Passwords don't match";
4143
4159
  var weakPassword$1 = "Your password must contain at least 6 characters";
4144
4160
  var passwordChange_en = {
4145
- title: title$3,
4161
+ title: title$5,
4146
4162
  currentPassword: currentPassword$1,
4147
4163
  newPassword: newPassword$1,
4148
4164
  confirmNewPassword: confirmNewPassword$1,
@@ -4153,7 +4169,7 @@ var passwordChange_en = {
4153
4169
  weakPassword: weakPassword$1
4154
4170
  };
4155
4171
 
4156
- var title$2 = "Changez votre mot de passe";
4172
+ var title$4 = "Changez votre mot de passe";
4157
4173
  var currentPassword = "Mot de passe actuel";
4158
4174
  var newPassword = "Nouveau mot de passe";
4159
4175
  var confirmNewPassword = "Confirmer le nouveau mot de passe";
@@ -4163,7 +4179,7 @@ var passwordChanged = "Le mot de passe a été modifié, veuillez vous connecter
4163
4179
  var passwordsNotMatching = "Les mots de passe ne correspondent pas";
4164
4180
  var weakPassword = "Votre mot de passe doit contenir au moins 6";
4165
4181
  var passwordChange_fr = {
4166
- title: title$2,
4182
+ title: title$4,
4167
4183
  currentPassword: currentPassword,
4168
4184
  newPassword: newPassword,
4169
4185
  confirmNewPassword: confirmNewPassword,
@@ -4174,7 +4190,7 @@ var passwordChange_fr = {
4174
4190
  weakPassword: weakPassword
4175
4191
  };
4176
4192
 
4177
- var title$1 = "Votre panier";
4193
+ var title$3 = "Votre panier";
4178
4194
  var subtitle$1 = "Terminez votre achat ci-dessous";
4179
4195
  var name$1 = "Produit";
4180
4196
  var quantity$1 = "Quantité";
@@ -4186,7 +4202,7 @@ var confirm$3 = "Passer à la caisse";
4186
4202
  var empty$1 = "Votre panier est vide.";
4187
4203
  var removeAll$1 = "Vider";
4188
4204
  var cart_fr = {
4189
- title: title$1,
4205
+ title: title$3,
4190
4206
  subtitle: subtitle$1,
4191
4207
  name: name$1,
4192
4208
  quantity: quantity$1,
@@ -4199,7 +4215,7 @@ var cart_fr = {
4199
4215
  removeAll: removeAll$1
4200
4216
  };
4201
4217
 
4202
- var title = "Your shopping cart";
4218
+ var title$2 = "Your shopping cart";
4203
4219
  var subtitle = "Comple your purchase below";
4204
4220
  var name = "Name";
4205
4221
  var quantity = "Quantity";
@@ -4211,7 +4227,7 @@ var confirm$2 = "Checkout";
4211
4227
  var empty = "Your cart is empty.";
4212
4228
  var removeAll = "Remove all";
4213
4229
  var cart_en = {
4214
- title: title,
4230
+ title: title$2,
4215
4231
  subtitle: subtitle,
4216
4232
  name: name,
4217
4233
  quantity: quantity,
@@ -4224,7 +4240,7 @@ var cart_en = {
4224
4240
  removeAll: removeAll
4225
4241
  };
4226
4242
 
4227
- var buttons$3 = {
4243
+ var buttons$5 = {
4228
4244
  select: "Select",
4229
4245
  added: "Added to cart",
4230
4246
  purchase: "Purchase",
@@ -4239,17 +4255,17 @@ var messages$9 = {
4239
4255
  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
4256
  currencyMismatch: "The selected item(s) do not match your current default currency ({{currency}}). Please choose item(s) only matching this currency."
4241
4257
  };
4242
- var labels$9 = {
4258
+ var labels$b = {
4243
4259
  summary: "Order summary",
4244
4260
  total: "total"
4245
4261
  };
4246
4262
  var shop_en = {
4247
- buttons: buttons$3,
4263
+ buttons: buttons$5,
4248
4264
  messages: messages$9,
4249
- labels: labels$9
4265
+ labels: labels$b
4250
4266
  };
4251
4267
 
4252
- var buttons$2 = {
4268
+ var buttons$4 = {
4253
4269
  select: "Choisir",
4254
4270
  added: "Ajouté au panier",
4255
4271
  purchase: "Acheter",
@@ -4264,17 +4280,17 @@ var messages$8 = {
4264
4280
  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
4281
  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
4282
  };
4267
- var labels$8 = {
4283
+ var labels$a = {
4268
4284
  summary: "récapitulatif de commande",
4269
4285
  total: "total"
4270
4286
  };
4271
4287
  var shop_fr = {
4272
- buttons: buttons$2,
4288
+ buttons: buttons$4,
4273
4289
  messages: messages$8,
4274
- labels: labels$8
4290
+ labels: labels$a
4275
4291
  };
4276
4292
 
4277
- var labels$7 = {
4293
+ var labels$9 = {
4278
4294
  cardNumber: "Numéro de carte",
4279
4295
  securityCode: "Code de sécurité",
4280
4296
  submit: "Soumettre",
@@ -4309,12 +4325,12 @@ var errors$1 = {
4309
4325
  "": ""
4310
4326
  };
4311
4327
  var payment_fr = {
4312
- labels: labels$7,
4328
+ labels: labels$9,
4313
4329
  messages: messages$7,
4314
4330
  errors: errors$1
4315
4331
  };
4316
4332
 
4317
- var labels$6 = {
4333
+ var labels$8 = {
4318
4334
  cardNumber: "Card number",
4319
4335
  securityCode: "Security Code",
4320
4336
  submit: "Submit",
@@ -4349,12 +4365,12 @@ var errors = {
4349
4365
  "": ""
4350
4366
  };
4351
4367
  var payment_en = {
4352
- labels: labels$6,
4368
+ labels: labels$8,
4353
4369
  messages: messages$6,
4354
4370
  errors: errors
4355
4371
  };
4356
4372
 
4357
- var labels$5 = {
4373
+ var labels$7 = {
4358
4374
  menu: "Pelcro Menu",
4359
4375
  name: "Name",
4360
4376
  email: "Email",
@@ -4379,6 +4395,16 @@ var labels$5 = {
4379
4395
  purchases: "Purchases",
4380
4396
  subscriptions: "Subscriptions",
4381
4397
  donations: "Donations",
4398
+ invoices: "Invoices",
4399
+ details: "Details",
4400
+ view: "View",
4401
+ paid: "Paid",
4402
+ open: "Open",
4403
+ draft: "Draft",
4404
+ scheduled: "Scheduled",
4405
+ uncollectible: "Uncollectible",
4406
+ "void": "Void",
4407
+ pastDue: "Past due",
4382
4408
  updatePaymentSource: "Update",
4383
4409
  profile: "Profile",
4384
4410
  updateProfile: "Edit profile",
@@ -4431,11 +4457,11 @@ var messages$5 = {
4431
4457
  }
4432
4458
  };
4433
4459
  var dashboard_en = {
4434
- labels: labels$5,
4460
+ labels: labels$7,
4435
4461
  messages: messages$5
4436
4462
  };
4437
4463
 
4438
- var labels$4 = {
4464
+ var labels$6 = {
4439
4465
  menu: "Menu Pelcro",
4440
4466
  name: "Nom",
4441
4467
  email: "Courriel",
@@ -4460,6 +4486,16 @@ var labels$4 = {
4460
4486
  purchases: "Achats",
4461
4487
  subscriptions: "Abonnements",
4462
4488
  donations: "Des dons",
4489
+ invoices: "Invoices",
4490
+ details: "Details",
4491
+ view: "View",
4492
+ paid: "Paid",
4493
+ open: "open",
4494
+ draft: "Draft",
4495
+ scheduled: "Scheduled",
4496
+ uncollectible: "Uncollectible",
4497
+ "void": "Void",
4498
+ pastDue: "Past due",
4463
4499
  updatePaymentSource: "Mettre à jour la source de paiement",
4464
4500
  profile: "Profil",
4465
4501
  updateProfile: "Mettre à jour le profil",
@@ -4512,7 +4548,7 @@ var messages$4 = {
4512
4548
  }
4513
4549
  };
4514
4550
  var dashboard_fr = {
4515
- labels: labels$4,
4551
+ labels: labels$6,
4516
4552
  messages: messages$4
4517
4553
  };
4518
4554
 
@@ -4521,7 +4557,7 @@ var messages$3 = {
4521
4557
  loginHere: "Login here",
4522
4558
  checkbox: "Check this box to gift this subscription"
4523
4559
  };
4524
- var labels$3 = {
4560
+ var labels$5 = {
4525
4561
  plan: {
4526
4562
  title: "Subscribe to a plan",
4527
4563
  subtitle: "Select one of the plans below and click on next."
@@ -4538,15 +4574,15 @@ var labels$3 = {
4538
4574
  or: "Or take a look at some of our other options below"
4539
4575
  }
4540
4576
  };
4541
- var buttons$1 = {
4577
+ var buttons$3 = {
4542
4578
  next: "Next",
4543
4579
  select: "Select",
4544
4580
  back: "Back"
4545
4581
  };
4546
4582
  var select_en = {
4547
4583
  messages: messages$3,
4548
- labels: labels$3,
4549
- buttons: buttons$1
4584
+ labels: labels$5,
4585
+ buttons: buttons$3
4550
4586
  };
4551
4587
 
4552
4588
  var messages$2 = {
@@ -4554,7 +4590,7 @@ var messages$2 = {
4554
4590
  loginHere: "Connectez-vous ici",
4555
4591
  checkbox: "Cochez cette case pour offrir cet abonnement"
4556
4592
  };
4557
- var labels$2 = {
4593
+ var labels$4 = {
4558
4594
  plan: {
4559
4595
  title: "Abonnez-vous à un plan",
4560
4596
  subtitle: "Sélectionnez l’un des plans ci-dessous et cliquez sur suivant."
@@ -4571,15 +4607,15 @@ var labels$2 = {
4571
4607
  or: "Sinon, jetez un coup d'oeil à d'autres offres ci-dessous"
4572
4608
  }
4573
4609
  };
4574
- var buttons = {
4610
+ var buttons$2 = {
4575
4611
  next: "Prochain",
4576
4612
  select: "Choisir",
4577
4613
  back: "Retour"
4578
4614
  };
4579
4615
  var select_fr = {
4580
4616
  messages: messages$2,
4581
- labels: labels$2,
4582
- buttons: buttons
4617
+ labels: labels$4,
4618
+ buttons: buttons$2
4583
4619
  };
4584
4620
 
4585
4621
  var confirm$1 = {
@@ -4602,7 +4638,7 @@ var notification_fr = {
4602
4638
  confirm: confirm
4603
4639
  };
4604
4640
 
4605
- var labels$1 = {
4641
+ var labels$3 = {
4606
4642
  title: "Verify your email",
4607
4643
  instructions: "You're on your way!\nLet's confirm your email address.\nClick on the verification link we've sent to your email:",
4608
4644
  resend: "Resend email"
@@ -4612,24 +4648,60 @@ var messages$1 = {
4612
4648
  success: "Email verified successfully!"
4613
4649
  };
4614
4650
  var verifyEmail_en = {
4615
- labels: labels$1,
4651
+ labels: labels$3,
4616
4652
  messages: messages$1
4617
4653
  };
4618
4654
 
4619
- var labels = {
4620
- title: "Vérifiez votre e-mail",
4621
- 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
- resend: "Ré-envoyer l'email"
4655
+ var labels$2 = {
4656
+ title: "Confirmez votre courriel",
4657
+ instructions: "Confirmez votre courriel.\nVeuillez cliquer sur le lien de vérification, qui vous a été envoyé à:",
4658
+ resend: "Renvoyer le courriel"
4623
4659
  };
4624
4660
  var messages = {
4625
4661
  resent: "Renvoyé avec succès",
4626
- success: "Email vérifié avec succès!"
4662
+ success: "Adresse courriel vérifiée avec succès"
4627
4663
  };
4628
4664
  var verifyEmail_fr = {
4629
- labels: labels,
4665
+ labels: labels$2,
4630
4666
  messages: messages
4631
4667
  };
4632
4668
 
4669
+ var title$1 = "Invoice details";
4670
+ var labels$1 = {
4671
+ summary: "Summary",
4672
+ total: "Total",
4673
+ amountPaid: "Amount paid",
4674
+ amountDue: "Amount due",
4675
+ creationDate: "Created on:"
4676
+ };
4677
+ var buttons$1 = {
4678
+ download: "Download",
4679
+ pay: "Pay now"
4680
+ };
4681
+ var invoiceDetails_en = {
4682
+ title: title$1,
4683
+ labels: labels$1,
4684
+ buttons: buttons$1
4685
+ };
4686
+
4687
+ var title = "Invoice details";
4688
+ var labels = {
4689
+ summary: "Summary",
4690
+ total: "Total",
4691
+ amountPaid: "Amount paid",
4692
+ amountDue: "Amount due",
4693
+ creationDate: "Created on:"
4694
+ };
4695
+ var buttons = {
4696
+ download: "Download",
4697
+ pay: "Pay now"
4698
+ };
4699
+ var invoiceDetails_fr = {
4700
+ title: title,
4701
+ labels: labels,
4702
+ buttons: buttons
4703
+ };
4704
+
4633
4705
  function create$1(createState) {
4634
4706
  let state;
4635
4707
  const listeners = new Set();
@@ -5979,7 +6051,7 @@ class PelcroActions {
5979
6051
  view,
5980
6052
  cartItems,
5981
6053
  ...otherStateFields
5982
- } = initialState$h;
6054
+ } = initialState$i;
5983
6055
  this.set(otherStateFields);
5984
6056
  });
5985
6057
 
@@ -6023,10 +6095,11 @@ class PelcroActions {
6023
6095
  resetView,
6024
6096
  switchToCheckoutForm,
6025
6097
  product,
6026
- order
6098
+ order,
6099
+ invoice
6027
6100
  } = this.get();
6028
6101
 
6029
- if (product || order) {
6102
+ if (product || order || invoice) {
6030
6103
  // direct user to stripe checkout form when there are no existing cards
6031
6104
  if (!userHasPaymentMethod()) {
6032
6105
  return switchToCheckoutForm();
@@ -6043,7 +6116,8 @@ class PelcroActions {
6043
6116
  switchView,
6044
6117
  product,
6045
6118
  subscriptionIdToRenew,
6046
- order
6119
+ order,
6120
+ invoice
6047
6121
  } = this.get();
6048
6122
 
6049
6123
  if (product && subscriptionIdToRenew) {
@@ -6057,6 +6131,10 @@ class PelcroActions {
6057
6131
  if (order) {
6058
6132
  return switchView("order-create");
6059
6133
  }
6134
+
6135
+ if (invoice) {
6136
+ return switchView("invoice-payment");
6137
+ }
6060
6138
  });
6061
6139
 
6062
6140
  _defineProperty$3(this, "switchToAddressView", () => {
@@ -6087,6 +6165,23 @@ class PelcroActions {
6087
6165
  });
6088
6166
  });
6089
6167
 
6168
+ _defineProperty$3(this, "setInvoice", id => {
6169
+ var _window$Pelcro$invoic;
6170
+
6171
+ const invoices = (_window$Pelcro$invoic = window.Pelcro.invoice.list()) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
6172
+ const invoice = invoices.find(inv => String(inv.id) === String(id));
6173
+
6174
+ if (!invoice) {
6175
+ console.error("invalid invoice id");
6176
+ return false;
6177
+ }
6178
+
6179
+ this.set({
6180
+ invoice
6181
+ });
6182
+ return true;
6183
+ });
6184
+
6090
6185
  _defineProperty$3(this, "logout", () => {
6091
6186
  var _ReactGA$event;
6092
6187
 
@@ -6275,7 +6370,7 @@ class PelcroCallbacks {
6275
6370
 
6276
6371
  }
6277
6372
 
6278
- const initialState$h = {
6373
+ const initialState$i = {
6279
6374
  // View
6280
6375
  view: null,
6281
6376
  // Plans
@@ -6290,6 +6385,8 @@ const initialState$h = {
6290
6385
  cartItems: [],
6291
6386
  order: null,
6292
6387
  // null | SKU[] | SKU,
6388
+ // invoices
6389
+ invoice: null,
6293
6390
  // User
6294
6391
  isAuthenticated: () => window.Pelcro.user.isAuthenticated(),
6295
6392
  selectedPaymentMethodId: null,
@@ -6303,7 +6400,7 @@ const createPelcroStore = () => createStore(middleware_3((set, get) => {
6303
6400
  return {
6304
6401
  // Store setter
6305
6402
  set,
6306
- ...initialState$h,
6403
+ ...initialState$i,
6307
6404
  // State actions
6308
6405
  ...actions,
6309
6406
  // Callbacks
@@ -6454,7 +6551,7 @@ const calcAndFormatItemsTotal = (items, currency) => {
6454
6551
  */
6455
6552
 
6456
6553
  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()) {
6554
+ 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
6555
  return true;
6459
6556
  }
6460
6557
 
@@ -6681,7 +6778,8 @@ const resources = {
6681
6778
  payment: payment_en,
6682
6779
  dashboard: dashboard_en,
6683
6780
  select: select_en,
6684
- notification: notification_en
6781
+ notification: notification_en,
6782
+ invoiceDetails: invoiceDetails_en
6685
6783
  },
6686
6784
  fr: {
6687
6785
  common: common_fr,
@@ -6704,7 +6802,8 @@ const resources = {
6704
6802
  payment: payment_fr,
6705
6803
  dashboard: dashboard_fr,
6706
6804
  select: select_fr,
6707
- notification: notification_fr
6805
+ notification: notification_fr,
6806
+ invoiceDetails: invoiceDetails_fr
6708
6807
  }
6709
6808
  }; // set UI language to the page language or default to the language in site settings
6710
6809
 
@@ -6995,8 +7094,8 @@ const saveToMetadataButton = new SaveToMetadataButtonClass();
6995
7094
 
6996
7095
  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
7096
 
6998
- function _extends$y() {
6999
- _extends$y = Object.assign || function (target) {
7097
+ function _extends$z() {
7098
+ _extends$z = Object.assign || function (target) {
7000
7099
  for (var i = 1; i < arguments.length; i++) {
7001
7100
  var source = arguments[i];
7002
7101
 
@@ -7010,7 +7109,7 @@ function _extends$y() {
7010
7109
  return target;
7011
7110
  };
7012
7111
 
7013
- return _extends$y.apply(this, arguments);
7112
+ return _extends$z.apply(this, arguments);
7014
7113
  }
7015
7114
 
7016
7115
  function _taggedTemplateLiteralLoose(strings, raw) {
@@ -7100,7 +7199,7 @@ var clearFromRemoveQueue = function clearFromRemoveQueue(toastId) {
7100
7199
  var reducer = function reducer(state, action) {
7101
7200
  switch (action.type) {
7102
7201
  case ActionType.ADD_TOAST:
7103
- return _extends$y({}, state, {
7202
+ return _extends$z({}, state, {
7104
7203
  toasts: [action.toast].concat(state.toasts).slice(0, TOAST_LIMIT)
7105
7204
  });
7106
7205
 
@@ -7110,9 +7209,9 @@ var reducer = function reducer(state, action) {
7110
7209
  clearFromRemoveQueue(action.toast.id);
7111
7210
  }
7112
7211
 
7113
- return _extends$y({}, state, {
7212
+ return _extends$z({}, state, {
7114
7213
  toasts: state.toasts.map(function (t) {
7115
- return t.id === action.toast.id ? _extends$y({}, t, action.toast) : t;
7214
+ return t.id === action.toast.id ? _extends$z({}, t, action.toast) : t;
7116
7215
  })
7117
7216
  });
7118
7217
 
@@ -7139,9 +7238,9 @@ var reducer = function reducer(state, action) {
7139
7238
  });
7140
7239
  }
7141
7240
 
7142
- return _extends$y({}, state, {
7241
+ return _extends$z({}, state, {
7143
7242
  toasts: state.toasts.map(function (t) {
7144
- return t.id === toastId || toastId === undefined ? _extends$y({}, t, {
7243
+ return t.id === toastId || toastId === undefined ? _extends$z({}, t, {
7145
7244
  visible: false
7146
7245
  }) : t;
7147
7246
  })
@@ -7149,28 +7248,28 @@ var reducer = function reducer(state, action) {
7149
7248
 
7150
7249
  case ActionType.REMOVE_TOAST:
7151
7250
  if (action.toastId === undefined) {
7152
- return _extends$y({}, state, {
7251
+ return _extends$z({}, state, {
7153
7252
  toasts: []
7154
7253
  });
7155
7254
  }
7156
7255
 
7157
- return _extends$y({}, state, {
7256
+ return _extends$z({}, state, {
7158
7257
  toasts: state.toasts.filter(function (t) {
7159
7258
  return t.id !== action.toastId;
7160
7259
  })
7161
7260
  });
7162
7261
 
7163
7262
  case ActionType.START_PAUSE:
7164
- return _extends$y({}, state, {
7263
+ return _extends$z({}, state, {
7165
7264
  pausedAt: action.time
7166
7265
  });
7167
7266
 
7168
7267
  case ActionType.END_PAUSE:
7169
7268
  var diff = action.time - (state.pausedAt || 0);
7170
- return _extends$y({}, state, {
7269
+ return _extends$z({}, state, {
7171
7270
  pausedAt: undefined,
7172
7271
  toasts: state.toasts.map(function (t) {
7173
- return _extends$y({}, t, {
7272
+ return _extends$z({}, t, {
7174
7273
  pauseDuration: t.pauseDuration + diff
7175
7274
  });
7176
7275
  })
@@ -7217,12 +7316,12 @@ var useStore = function useStore(toastOptions) {
7217
7316
  var mergedToasts = state.toasts.map(function (t) {
7218
7317
  var _toastOptions$t$type, _toastOptions, _toastOptions$t$type2;
7219
7318
 
7220
- return _extends$y({}, toastOptions, toastOptions[t.type], t, {
7319
+ return _extends$z({}, toastOptions, toastOptions[t.type], t, {
7221
7320
  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)
7321
+ style: _extends$z({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7223
7322
  });
7224
7323
  });
7225
- return _extends$y({}, state, {
7324
+ return _extends$z({}, state, {
7226
7325
  toasts: mergedToasts
7227
7326
  });
7228
7327
  };
@@ -7232,7 +7331,7 @@ var createToast = function createToast(message, type, opts) {
7232
7331
  type = 'blank';
7233
7332
  }
7234
7333
 
7235
- return _extends$y({
7334
+ return _extends$z({
7236
7335
  createdAt: Date.now(),
7237
7336
  visible: true,
7238
7337
  type: type,
@@ -7282,14 +7381,14 @@ toast.remove = function (toastId) {
7282
7381
  };
7283
7382
 
7284
7383
  toast.promise = function (promise, msgs, opts) {
7285
- var id = toast.loading(msgs.loading, _extends$y({}, opts, opts == null ? void 0 : opts.loading));
7384
+ var id = toast.loading(msgs.loading, _extends$z({}, opts, opts == null ? void 0 : opts.loading));
7286
7385
  promise.then(function (p) {
7287
- toast.success(resolveValue(msgs.success, p), _extends$y({
7386
+ toast.success(resolveValue(msgs.success, p), _extends$z({
7288
7387
  id: id
7289
7388
  }, opts, opts == null ? void 0 : opts.success));
7290
7389
  return p;
7291
7390
  })["catch"](function (e) {
7292
- toast.error(resolveValue(msgs.error, e), _extends$y({
7391
+ toast.error(resolveValue(msgs.error, e), _extends$z({
7293
7392
  id: id
7294
7393
  }, opts, opts == null ? void 0 : opts.error));
7295
7394
  });
@@ -7628,7 +7727,7 @@ var ToastBar = /*#__PURE__*/React.memo(function (_ref2) {
7628
7727
  var message = React.createElement(Message, Object.assign({}, toast.ariaProps), resolveValue(toast.message, toast));
7629
7728
  return React.createElement(ToastBarBase, {
7630
7729
  className: toast.className,
7631
- style: _extends$y({}, animationStyle, style, toast.style)
7730
+ style: _extends$z({}, animationStyle, style, toast.style)
7632
7731
  }, typeof children === 'function' ? children({
7633
7732
  icon: icon,
7634
7733
  message: message
@@ -7658,7 +7757,7 @@ var getPositionStyle = function getPositionStyle(position, offset) {
7658
7757
  } : position.includes('right') ? {
7659
7758
  justifyContent: 'flex-end'
7660
7759
  } : {};
7661
- return _extends$y({
7760
+ return _extends$z({
7662
7761
  left: 0,
7663
7762
  right: 0,
7664
7763
  display: 'flex',
@@ -7685,7 +7784,7 @@ var Toaster = function Toaster(_ref) {
7685
7784
  handlers = _useToaster.handlers;
7686
7785
 
7687
7786
  return React.createElement("div", {
7688
- style: _extends$y({
7787
+ style: _extends$z({
7689
7788
  position: 'fixed',
7690
7789
  zIndex: 9999,
7691
7790
  top: DEFAULT_OFFSET,
@@ -7720,82 +7819,82 @@ var Toaster = function Toaster(_ref) {
7720
7819
  }));
7721
7820
  };
7722
7821
 
7723
- var _path$v;
7822
+ var _path$w;
7724
7823
 
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); }
7824
+ 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
7825
 
7727
7826
  function SvgCheckSolid(props) {
7728
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
7827
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$y({
7729
7828
  xmlns: "http://www.w3.org/2000/svg",
7730
7829
  className: "h-5 w-5",
7731
7830
  viewBox: "0 0 20 20",
7732
7831
  fill: "currentColor"
7733
- }, props), _path$v || (_path$v = /*#__PURE__*/React__namespace.createElement("path", {
7832
+ }, props), _path$w || (_path$w = /*#__PURE__*/React__namespace.createElement("path", {
7734
7833
  fillRule: "evenodd",
7735
7834
  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
7835
  clipRule: "evenodd"
7737
7836
  })));
7738
7837
  }
7739
7838
 
7740
- var _path$u;
7839
+ var _path$v;
7741
7840
 
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); }
7841
+ 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
7842
 
7744
7843
  function SvgXIcon(props) {
7745
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
7844
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$x({
7746
7845
  xmlns: "http://www.w3.org/2000/svg",
7747
7846
  viewBox: "0 0 20 20",
7748
7847
  fill: "currentColor"
7749
- }, props), _path$u || (_path$u = /*#__PURE__*/React__namespace.createElement("path", {
7848
+ }, props), _path$v || (_path$v = /*#__PURE__*/React__namespace.createElement("path", {
7750
7849
  fill: "evenodd",
7751
7850
  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
7851
  clipRule: "evenodd"
7753
7852
  })));
7754
7853
  }
7755
7854
 
7756
- var _path$t;
7855
+ var _path$u;
7757
7856
 
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); }
7857
+ 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
7858
 
7760
7859
  function SvgXIconSolid(props) {
7761
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
7860
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$w({
7762
7861
  className: "plc-w-4 plc-h-4",
7763
7862
  fill: "currentColor",
7764
7863
  xmlns: "http://www.w3.org/2000/svg",
7765
7864
  viewBox: "0 0 100 100"
7766
- }, props), _path$t || (_path$t = /*#__PURE__*/React__namespace.createElement("path", {
7865
+ }, props), _path$u || (_path$u = /*#__PURE__*/React__namespace.createElement("path", {
7767
7866
  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
7867
  })));
7769
7868
  }
7770
7869
 
7771
- var _path$s;
7870
+ var _path$t;
7772
7871
 
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); }
7872
+ 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
7873
 
7775
7874
  function SvgExclamation(props) {
7776
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
7875
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$v({
7777
7876
  className: "plc-w-4 plc-h-4 plc-mr-1",
7778
7877
  xmlns: "http://www.w3.org/2000/svg",
7779
7878
  viewBox: "0 0 20 20",
7780
7879
  fill: "currentColor"
7781
- }, props), _path$s || (_path$s = /*#__PURE__*/React__namespace.createElement("path", {
7880
+ }, props), _path$t || (_path$t = /*#__PURE__*/React__namespace.createElement("path", {
7782
7881
  fillRule: "evenodd",
7783
7882
  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
7883
  clipRule: "evenodd"
7785
7884
  })));
7786
7885
  }
7787
7886
 
7788
- var _path$r, _path2$4;
7887
+ var _path$s, _path2$4;
7789
7888
 
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); }
7889
+ 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
7890
 
7792
7891
  function SvgSpinner(props) {
7793
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
7892
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$u({
7794
7893
  className: "plc-animate-spin",
7795
7894
  viewBox: "0 0 24 24",
7796
7895
  fill: "currentColor",
7797
7896
  xmlns: "http://www.w3.org/2000/svg"
7798
- }, props), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
7897
+ }, props), _path$s || (_path$s = /*#__PURE__*/React__namespace.createElement("path", {
7799
7898
  opacity: 0.2,
7800
7899
  fill: "evenodd",
7801
7900
  clipRule: "evenodd",
@@ -8829,6 +8928,10 @@ const initViewFromURL = () => {
8829
8928
  return verifyEmailTokenFromUrl();
8830
8929
  }
8831
8930
 
8931
+ if (view === "invoice-details") {
8932
+ return showInvoiceDetailsFromUrl();
8933
+ }
8934
+
8832
8935
  switchView(view);
8833
8936
  });
8834
8937
  }
@@ -9005,6 +9108,43 @@ const verifyEmailTokenFromUrl = () => {
9005
9108
  });
9006
9109
  };
9007
9110
 
9111
+ const showInvoiceDetailsFromUrl = () => {
9112
+ const {
9113
+ isAuthenticated,
9114
+ setInvoice,
9115
+ whenSiteReady,
9116
+ switchView
9117
+ } = usePelcro.getStore();
9118
+ whenSiteReady(() => {
9119
+ if (!isAuthenticated()) {
9120
+ return switchView("login");
9121
+ }
9122
+
9123
+ const invoiceId = window.Pelcro.helpers.getURLParameter("id");
9124
+ const wasSetSuccessfully = setInvoice(invoiceId);
9125
+
9126
+ if (!wasSetSuccessfully) {
9127
+ const errorMessage = i18next.t("messages:invalidInvoice", {
9128
+ returnObjects: true
9129
+ });
9130
+ return notify.error(errorMessage);
9131
+ }
9132
+
9133
+ const {
9134
+ invoice
9135
+ } = usePelcro.getStore();
9136
+
9137
+ if (invoice.total === 0) {
9138
+ const errorMessage = i18next.t("messages:zeroTotalInvoice", {
9139
+ returnObjects: true
9140
+ });
9141
+ return notify.error(errorMessage);
9142
+ }
9143
+
9144
+ return switchView("invoice-details");
9145
+ });
9146
+ };
9147
+
9008
9148
  const defaultOptions = {
9009
9149
  loadPaymentSDKs: true,
9010
9150
  loadAuth0SDK: true,
@@ -9344,7 +9484,7 @@ const GET_NEWSLETTERS_FETCH = "GET_NEWSLETTERS_FETCH";
9344
9484
  const GET_NEWSLETTERS_SUCCESS = "GET_NEWSLETTERS_SUCCESS";
9345
9485
  const SWITCH_TO_UPDATE = "SWITCH_TO_UPDATE";
9346
9486
 
9347
- const initialState$g = {
9487
+ const initialState$h = {
9348
9488
  email: "",
9349
9489
  password: "",
9350
9490
  emailError: null,
@@ -9355,10 +9495,10 @@ const initialState$g = {
9355
9495
  content: ""
9356
9496
  }
9357
9497
  };
9358
- const store$g = /*#__PURE__*/React.createContext(initialState$g);
9498
+ const store$h = /*#__PURE__*/React.createContext(initialState$h);
9359
9499
  const {
9360
- Provider: Provider$g
9361
- } = store$g;
9500
+ Provider: Provider$h
9501
+ } = store$h;
9362
9502
 
9363
9503
  const LoginContainer = ({
9364
9504
  style,
@@ -9465,7 +9605,7 @@ const LoginContainer = ({
9465
9605
  });
9466
9606
 
9467
9607
  case RESET_LOGIN_FORM:
9468
- return initialState$g;
9608
+ return initialState$h;
9469
9609
 
9470
9610
  case DISABLE_LOGIN_BUTTON:
9471
9611
  return lib_7({ ...state,
@@ -9483,12 +9623,12 @@ const LoginContainer = ({
9483
9623
  default:
9484
9624
  return state;
9485
9625
  }
9486
- }, initialState$g);
9626
+ }, initialState$h);
9487
9627
  return /*#__PURE__*/React__default['default'].createElement("div", {
9488
9628
  style: { ...style
9489
9629
  },
9490
9630
  className: `pelcro-container pelcro-login-container ${className}`
9491
- }, /*#__PURE__*/React__default['default'].createElement(Provider$g, {
9631
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$h, {
9492
9632
  value: {
9493
9633
  state,
9494
9634
  dispatch
@@ -9496,12 +9636,12 @@ const LoginContainer = ({
9496
9636
  }, children.length ? children.map((child, i) => {
9497
9637
  if (child) {
9498
9638
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
9499
- store: store$g,
9639
+ store: store$h,
9500
9640
  key: i
9501
9641
  });
9502
9642
  }
9503
9643
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
9504
- store: store$g
9644
+ store: store$h
9505
9645
  })));
9506
9646
  };
9507
9647
 
@@ -9746,7 +9886,7 @@ const LoginButton = ({
9746
9886
  buttonDisabled
9747
9887
  },
9748
9888
  dispatch
9749
- } = React.useContext(store$g);
9889
+ } = React.useContext(store$h);
9750
9890
  const {
9751
9891
  t
9752
9892
  } = useTranslation("login");
@@ -9767,23 +9907,23 @@ const LoginButton = ({
9767
9907
  };
9768
9908
 
9769
9909
  const LoginEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
9770
- store: store$g
9910
+ store: store$h
9771
9911
  }, props));
9772
9912
 
9773
9913
  const LoginPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
9774
- store: store$g
9914
+ store: store$h
9775
9915
  }, props));
9776
9916
 
9777
- var _path$q;
9917
+ var _path$r;
9778
9918
 
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); }
9919
+ 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
9920
 
9781
9921
  function SvgCheck(props) {
9782
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
9922
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$t({
9783
9923
  xmlns: "http://www.w3.org/2000/svg",
9784
9924
  fill: "currentColor",
9785
9925
  viewBox: "0 0 20 20"
9786
- }, props), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
9926
+ }, props), _path$r || (_path$r = /*#__PURE__*/React__namespace.createElement("path", {
9787
9927
  fillRule: "evenodd",
9788
9928
  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
9929
  clipRule: "evenodd"
@@ -9848,7 +9988,7 @@ var facebookLoginRenderProps = createCommonjsModule(function (module, exports) {
9848
9988
  var FacebookLogin = unwrapExports(facebookLoginRenderProps);
9849
9989
  facebookLoginRenderProps.FacebookLogin;
9850
9990
 
9851
- const initialState$f = {
9991
+ const initialState$g = {
9852
9992
  email: "",
9853
9993
  password: "",
9854
9994
  emailError: null,
@@ -9865,10 +10005,10 @@ const initialState$f = {
9865
10005
  content: ""
9866
10006
  }
9867
10007
  };
9868
- const store$f = /*#__PURE__*/React.createContext(initialState$f);
10008
+ const store$g = /*#__PURE__*/React.createContext(initialState$g);
9869
10009
  const {
9870
- Provider: Provider$f
9871
- } = store$f;
10010
+ Provider: Provider$g
10011
+ } = store$g;
9872
10012
 
9873
10013
  const RegisterContainer = ({
9874
10014
  style,
@@ -10051,7 +10191,7 @@ const RegisterContainer = ({
10051
10191
  });
10052
10192
 
10053
10193
  case RESET_LOGIN_FORM:
10054
- return initialState$f;
10194
+ return initialState$g;
10055
10195
 
10056
10196
  case DISABLE_REGISTRATION_BUTTON:
10057
10197
  return lib_7({ ...state,
@@ -10069,12 +10209,12 @@ const RegisterContainer = ({
10069
10209
  default:
10070
10210
  return state;
10071
10211
  }
10072
- }, initialState$f);
10212
+ }, initialState$g);
10073
10213
  return /*#__PURE__*/React__default['default'].createElement("div", {
10074
10214
  style: { ...style
10075
10215
  },
10076
10216
  className: `pelcro-container pelcro-register-container ${className}`
10077
- }, /*#__PURE__*/React__default['default'].createElement(Provider$f, {
10217
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$g, {
10078
10218
  value: {
10079
10219
  state,
10080
10220
  dispatch
@@ -10082,12 +10222,12 @@ const RegisterContainer = ({
10082
10222
  }, children.length ? children.map((child, i) => {
10083
10223
  if (child) {
10084
10224
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
10085
- store: store$f,
10225
+ store: store$g,
10086
10226
  key: i
10087
10227
  });
10088
10228
  }
10089
10229
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
10090
- store: store$f
10230
+ store: store$g
10091
10231
  })));
10092
10232
  };
10093
10233
  /**
@@ -10102,15 +10242,15 @@ function hasSecurityTokenEnabled$1() {
10102
10242
  return hasSecuritySdkLoaded;
10103
10243
  }
10104
10244
 
10105
- var _path$p;
10245
+ var _path$q;
10106
10246
 
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); }
10247
+ 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
10248
 
10109
10249
  function SvgFacebookLogo(props) {
10110
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
10250
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$s({
10111
10251
  xmlns: "http://www.w3.org/2000/svg",
10112
10252
  viewBox: "88.428 12.828 107.543 207.085"
10113
- }, props), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
10253
+ }, props), _path$q || (_path$q = /*#__PURE__*/React__namespace.createElement("path", {
10114
10254
  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
10255
  fill: "#3c5a9a"
10116
10256
  })));
@@ -10127,10 +10267,10 @@ const FacebookLoginButton = ({
10127
10267
  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
10268
  const {
10129
10269
  dispatch: loginDispatch
10130
- } = React.useContext(store$g);
10270
+ } = React.useContext(store$h);
10131
10271
  const {
10132
10272
  dispatch: registerDispatch
10133
- } = React.useContext(store$f);
10273
+ } = React.useContext(store$g);
10134
10274
 
10135
10275
  const onSuccess = facebookUser => {
10136
10276
  loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
@@ -10183,15 +10323,15 @@ var googleLogin = createCommonjsModule(function (module, exports) {
10183
10323
  unwrapExports(googleLogin);
10184
10324
  var googleLogin_1 = googleLogin.GoogleLogin;
10185
10325
 
10186
- var _path$o, _path2$3, _path3$1, _path4;
10326
+ var _path$p, _path2$3, _path3$1, _path4;
10187
10327
 
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); }
10328
+ 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
10329
 
10190
10330
  function SvgGoogleLogo(props) {
10191
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
10331
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$r({
10192
10332
  viewBox: "0 0 24 24",
10193
10333
  xmlns: "http://www.w3.org/2000/svg"
10194
- }, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
10334
+ }, props), _path$p || (_path$p = /*#__PURE__*/React__namespace.createElement("path", {
10195
10335
  fill: "#4285F4",
10196
10336
  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
10337
  })), _path2$3 || (_path2$3 = /*#__PURE__*/React__namespace.createElement("path", {
@@ -10217,10 +10357,10 @@ const GoogleLoginButton = ({
10217
10357
  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
10358
  const {
10219
10359
  dispatch: loginDispatch
10220
- } = React.useContext(store$g);
10360
+ } = React.useContext(store$h);
10221
10361
  const {
10222
10362
  dispatch: registerDispatch
10223
- } = React.useContext(store$f);
10363
+ } = React.useContext(store$g);
10224
10364
 
10225
10365
  const onSuccess = response => {
10226
10366
  var _response$getAuthResp, _profile$getEmail, _profile$getGivenName, _profile$getFamilyNam, _profile$getEmail2, _profile$getGivenName2, _profile$getFamilyNam2;
@@ -10268,15 +10408,15 @@ const GoogleLoginButton = ({
10268
10408
  }) : null;
10269
10409
  };
10270
10410
 
10271
- var _path$n;
10411
+ var _path$o;
10272
10412
 
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); }
10413
+ 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
10414
 
10275
10415
  function SvgAuth0Logo(props) {
10276
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
10416
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$q({
10277
10417
  viewBox: "0 0 256 285",
10278
10418
  xmlns: "http://www.w3.org/2000/svg"
10279
- }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
10419
+ }, props), _path$o || (_path$o = /*#__PURE__*/React__namespace.createElement("path", {
10280
10420
  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
10421
  })));
10282
10422
  }
@@ -10316,10 +10456,10 @@ const Auth0LoginButton = ({
10316
10456
  }, [auth0Enabled, auth0Loaded]);
10317
10457
  const {
10318
10458
  dispatch: loginDispatch
10319
- } = React.useContext(store$g);
10459
+ } = React.useContext(store$h);
10320
10460
  const {
10321
10461
  dispatch: registerDispatch
10322
- } = React.useContext(store$f);
10462
+ } = React.useContext(store$g);
10323
10463
 
10324
10464
  function handleClick() {
10325
10465
  var _auth0InstanceRef$cur, _auth0InstanceRef$cur2, _auth0InstanceRef$cur3;
@@ -10452,15 +10592,15 @@ function LoginView(props) {
10452
10592
  }, /*#__PURE__*/React__default['default'].createElement(GoogleLoginButton, null), /*#__PURE__*/React__default['default'].createElement(FacebookLoginButton, null), /*#__PURE__*/React__default['default'].createElement(Auth0LoginButton, null))))));
10453
10593
  }
10454
10594
 
10455
- var _path$m, _path2$2, _path3;
10595
+ var _path$n, _path2$2, _path3;
10456
10596
 
10457
- 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); }
10597
+ 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); }
10458
10598
 
10459
10599
  function SvgPelcroAuthorship(props) {
10460
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
10600
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$p({
10461
10601
  xmlns: "http://www.w3.org/2000/svg",
10462
10602
  viewBox: "0 -80.652 497.072 179.991"
10463
- }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
10603
+ }, props), _path$n || (_path$n = /*#__PURE__*/React__namespace.createElement("path", {
10464
10604
  fill: "none",
10465
10605
  stroke: "#4a4a4a",
10466
10606
  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"
@@ -10607,11 +10747,11 @@ function LoginModal({
10607
10747
  LoginModal.viewId = "login";
10608
10748
 
10609
10749
  const RegisterEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
10610
- store: store$f
10750
+ store: store$g
10611
10751
  }, props));
10612
10752
 
10613
10753
  const RegisterPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
10614
- store: store$f
10754
+ store: store$g
10615
10755
  }, props));
10616
10756
 
10617
10757
  const RegisterButton = ({
@@ -10631,7 +10771,7 @@ const RegisterButton = ({
10631
10771
  buttonDisabled
10632
10772
  },
10633
10773
  dispatch
10634
- } = React.useContext(store$f);
10774
+ } = React.useContext(store$g);
10635
10775
  const {
10636
10776
  t
10637
10777
  } = useTranslation("register");
@@ -10769,7 +10909,7 @@ function FirstName({
10769
10909
  }
10770
10910
 
10771
10911
  const RegisterFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
10772
- store: store$f
10912
+ store: store$g
10773
10913
  }, props));
10774
10914
 
10775
10915
  function LastName({
@@ -10800,7 +10940,7 @@ function LastName({
10800
10940
  }
10801
10941
 
10802
10942
  const RegisterLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
10803
- store: store$f
10943
+ store: store$g
10804
10944
  }, props));
10805
10945
 
10806
10946
  /**
@@ -10924,7 +11064,7 @@ function TextInput({
10924
11064
 
10925
11065
  const RegisterTextInput = props => {
10926
11066
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
10927
- store: store$f
11067
+ store: store$g
10928
11068
  }));
10929
11069
  };
10930
11070
 
@@ -12593,7 +12733,8 @@ const SUBSCRIPTION_TYPES = {
12593
12733
  CREATE_SUBSCRIPTION: "CREATE_SUBSCRIPTION",
12594
12734
  CREATE_GIFTED_SUBSCRIPTION: "CREATE_GIFTED_SUBSCRIPTION",
12595
12735
  RENEW_SUBSCRIPTION: "RENEW_SUBSCRIPTION",
12596
- RENEW_GIFTED_SUBSCRIPTION: "RENEW_GIFTED_SUBSCRIPTION"
12736
+ RENEW_GIFTED_SUBSCRIPTION: "RENEW_GIFTED_SUBSCRIPTION",
12737
+ PAY_INVOICE: "PAY_INVOICE"
12597
12738
  };
12598
12739
 
12599
12740
  var _isPaymentGatewayInvalid = /*#__PURE__*/new WeakMap();
@@ -12655,6 +12796,8 @@ class Subscription {
12655
12796
  * @property {number} [subscriptionIdToRenew]
12656
12797
  * @property {number} [quantity]
12657
12798
  * @property {string} addressId
12799
+ * @property {number} invoiceId
12800
+ * @property {boolean} isExistingSource
12658
12801
  */
12659
12802
 
12660
12803
  /**
@@ -12695,6 +12838,8 @@ var _renewSubscription = /*#__PURE__*/new WeakMap();
12695
12838
 
12696
12839
  var _renewGiftedSubscription = /*#__PURE__*/new WeakMap();
12697
12840
 
12841
+ var _payInvoice = /*#__PURE__*/new WeakMap();
12842
+
12698
12843
  class StripeGateway {
12699
12844
  constructor() {
12700
12845
  _paymentGateway.set(this, {
@@ -12718,6 +12863,9 @@ class StripeGateway {
12718
12863
  case types.RENEW_GIFTED_SUBSCRIPTION:
12719
12864
  return _classPrivateFieldGet(this, _renewGiftedSubscription).call(this, options, callback);
12720
12865
 
12866
+ case types.PAY_INVOICE:
12867
+ return _classPrivateFieldGet(this, _payInvoice).call(this, options, callback);
12868
+
12721
12869
  default:
12722
12870
  console.error("Unsupported subscriptiion method: Stripe Gateway");
12723
12871
  }
@@ -12826,6 +12974,27 @@ class StripeGateway {
12826
12974
  });
12827
12975
  }
12828
12976
  });
12977
+
12978
+ _payInvoice.set(this, {
12979
+ writable: true,
12980
+ value: (options, callback) => {
12981
+ const {
12982
+ token,
12983
+ invoiceId
12984
+ } = options;
12985
+ const params = options.isExistingSource ? {
12986
+ source_id: token,
12987
+ invoice_id: invoiceId
12988
+ } : {
12989
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway),
12990
+ gateway_token: token,
12991
+ invoice_id: invoiceId
12992
+ };
12993
+ window.Pelcro.invoice.pay(params, (err, res) => {
12994
+ callback(err, res);
12995
+ });
12996
+ }
12997
+ });
12829
12998
  }
12830
12999
 
12831
13000
  }
@@ -12839,6 +13008,8 @@ var _createSubscription2 = /*#__PURE__*/new WeakMap();
12839
13008
 
12840
13009
  var _createGiftedSubscription2 = /*#__PURE__*/new WeakMap();
12841
13010
 
13011
+ var _payInvoice2 = /*#__PURE__*/new WeakMap();
13012
+
12842
13013
  class PaypalGateWay {
12843
13014
  constructor() {
12844
13015
  _paymentGateway2.set(this, {
@@ -12856,6 +13027,9 @@ class PaypalGateWay {
12856
13027
  case types.CREATE_GIFTED_SUBSCRIPTION:
12857
13028
  return _classPrivateFieldGet(this, _createGiftedSubscription2).call(this, options, callback);
12858
13029
 
13030
+ case types.PAY_INVOICE:
13031
+ return _classPrivateFieldGet(this, _payInvoice2).call(this, options, callback);
13032
+
12859
13033
  default:
12860
13034
  console.error("Unsupported subscriptiion method: PayPal Gateway");
12861
13035
  }
@@ -12916,6 +13090,23 @@ class PaypalGateWay {
12916
13090
  });
12917
13091
  }
12918
13092
  });
13093
+
13094
+ _payInvoice2.set(this, {
13095
+ writable: true,
13096
+ value: (options, callback) => {
13097
+ const {
13098
+ token,
13099
+ invoiceId
13100
+ } = options;
13101
+ window.Pelcro.invoice.pay({
13102
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway2),
13103
+ gateway_token: token,
13104
+ invoice_id: invoiceId
13105
+ }, (err, res) => {
13106
+ callback(err, res);
13107
+ });
13108
+ }
13109
+ });
12919
13110
  }
12920
13111
 
12921
13112
  }
@@ -12940,7 +13131,7 @@ class PaypalGateWay {
12940
13131
 
12941
13132
  /** @type {PaymentStateType} */
12942
13133
 
12943
- const initialState$e = {
13134
+ const initialState$f = {
12944
13135
  disableSubmit: false,
12945
13136
  isLoading: false,
12946
13137
  disableCouponButton: false,
@@ -12959,10 +13150,10 @@ const initialState$e = {
12959
13150
  content: ""
12960
13151
  }
12961
13152
  };
12962
- const store$e = /*#__PURE__*/React.createContext(initialState$e);
13153
+ const store$f = /*#__PURE__*/React.createContext(initialState$f);
12963
13154
  const {
12964
- Provider: Provider$e
12965
- } = store$e;
13155
+ Provider: Provider$f
13156
+ } = store$f;
12966
13157
 
12967
13158
  const PaymentMethodContainerWithoutStripe = ({
12968
13159
  style,
@@ -12975,7 +13166,7 @@ const PaymentMethodContainerWithoutStripe = ({
12975
13166
  onFailure = () => {},
12976
13167
  ...props
12977
13168
  }) => {
12978
- var _props$product, _props$plan, _props$subscriptionId, _props$selectedAddres, _props$giftRecipient, _props$isRenewingGift;
13169
+ var _props$product, _props$plan, _props$subscriptionId, _props$selectedAddres, _props$giftRecipient, _props$isRenewingGift, _props$invoice;
12979
13170
 
12980
13171
  const {
12981
13172
  t
@@ -12992,6 +13183,7 @@ const PaymentMethodContainerWithoutStripe = ({
12992
13183
  const selectedAddressId = (_props$selectedAddres = props.selectedAddressId) !== null && _props$selectedAddres !== void 0 ? _props$selectedAddres : pelcroStore.selectedAddressId;
12993
13184
  const giftRecipient = (_props$giftRecipient = props.giftRecipient) !== null && _props$giftRecipient !== void 0 ? _props$giftRecipient : pelcroStore.giftRecipient;
12994
13185
  const isRenewingGift = (_props$isRenewingGift = props.isRenewingGift) !== null && _props$isRenewingGift !== void 0 ? _props$isRenewingGift : pelcroStore.isRenewingGift;
13186
+ const invoice = (_props$invoice = props.invoice) !== null && _props$invoice !== void 0 ? _props$invoice : pelcroStore.invoice;
12995
13187
  React.useEffect(() => {
12996
13188
  if (window.Pelcro.coupon.getFromUrl()) {
12997
13189
  dispatch({
@@ -13560,6 +13752,38 @@ const PaymentMethodContainerWithoutStripe = ({
13560
13752
  });
13561
13753
  };
13562
13754
 
13755
+ const payInvoice = (gatewayService, gatewayToken, dispatch) => {
13756
+ const subscription = new Subscription(gatewayService);
13757
+ return subscription.execute({
13758
+ type: SUBSCRIPTION_TYPES.PAY_INVOICE,
13759
+ token: gatewayToken,
13760
+ isExistingSource: Boolean(selectedPaymentMethodId),
13761
+ invoiceId: invoice.id
13762
+ }, (err, res) => {
13763
+ dispatch({
13764
+ type: DISABLE_SUBMIT,
13765
+ payload: false
13766
+ });
13767
+ dispatch({
13768
+ type: LOADING,
13769
+ payload: false
13770
+ });
13771
+
13772
+ if (err) {
13773
+ onFailure(err);
13774
+ return dispatch({
13775
+ type: SHOW_ALERT,
13776
+ payload: {
13777
+ type: "error",
13778
+ content: getErrorMessages(err)
13779
+ }
13780
+ });
13781
+ }
13782
+
13783
+ onSuccess(res);
13784
+ });
13785
+ };
13786
+
13563
13787
  const updatePaymentSource = (state, dispatch) => {
13564
13788
  return stripe.createSource({
13565
13789
  type: "card"
@@ -13634,13 +13858,17 @@ const PaymentMethodContainerWithoutStripe = ({
13634
13858
  source,
13635
13859
  error
13636
13860
  }) => {
13637
- var _ref, _state$updatedPrice, _source$card3;
13861
+ var _ref, _ref2, _state$updatedPrice, _source$card3;
13638
13862
 
13639
13863
  if (error) {
13640
13864
  return handlePaymentError(error);
13641
13865
  }
13642
13866
 
13643
13867
  const getOrderItemsTotal = () => {
13868
+ if (!order) {
13869
+ return null;
13870
+ }
13871
+
13644
13872
  const isQuickPurchase = !Array.isArray(order);
13645
13873
 
13646
13874
  if (isQuickPurchase) {
@@ -13656,7 +13884,7 @@ const PaymentMethodContainerWithoutStripe = ({
13656
13884
  }, 0);
13657
13885
  };
13658
13886
 
13659
- 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();
13887
+ 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 === null || invoice === void 0 ? void 0 : invoice.amount_remaining) !== null && _ref !== void 0 ? _ref : getOrderItemsTotal();
13660
13888
 
13661
13889
  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) {
13662
13890
  return resolveTaxCalculation().then(res => {
@@ -13689,6 +13917,10 @@ const PaymentMethodContainerWithoutStripe = ({
13689
13917
  const resolveTaxCalculation = () => {
13690
13918
  var _window$Pelcro$site$r2;
13691
13919
 
13920
+ if (type === "invoicePayment") {
13921
+ return new Promise(resolve => resolve());
13922
+ }
13923
+
13692
13924
  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;
13693
13925
  return new Promise((resolve, reject) => {
13694
13926
  // resolve early if taxes isn't enabled
@@ -13762,6 +13994,8 @@ const PaymentMethodContainerWithoutStripe = ({
13762
13994
  subscribe(stripeSource, state, dispatch);
13763
13995
  } else if (stripeSource && type === "orderCreate") {
13764
13996
  purchase(stripeSource, state, dispatch);
13997
+ } else if (stripeSource && type === "invoicePayment") {
13998
+ payInvoice(new StripeGateway(), stripeSource.id, dispatch);
13765
13999
  }
13766
14000
  };
13767
14001
 
@@ -13895,7 +14129,13 @@ const PaymentMethodContainerWithoutStripe = ({
13895
14129
  });
13896
14130
 
13897
14131
  case HANDLE_PAYPAL_SUBSCRIPTION:
13898
- return lib_5(state, () => handlePaypalSubscription(state, action.payload));
14132
+ return lib_5(state, (state, dispatch) => {
14133
+ if (type === "invoicePayment") {
14134
+ payInvoice(new PaypalGateway(), action.payload, dispatch);
14135
+ } else {
14136
+ handlePaypalSubscription(state, action.payload);
14137
+ }
14138
+ });
13899
14139
 
13900
14140
  case SET_UPDATED_PRICE:
13901
14141
  return lib_7({ ...state,
@@ -13953,21 +14193,21 @@ const PaymentMethodContainerWithoutStripe = ({
13953
14193
  default:
13954
14194
  return state;
13955
14195
  }
13956
- }, initialState$e);
14196
+ }, initialState$f);
13957
14197
  return /*#__PURE__*/React__default['default'].createElement("div", {
13958
14198
  style: { ...style
13959
14199
  },
13960
14200
  className: `pelcro-container pelcro-payment-container ${className}`
13961
- }, /*#__PURE__*/React__default['default'].createElement(Provider$e, {
14201
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$f, {
13962
14202
  value: {
13963
14203
  state,
13964
14204
  dispatch
13965
14205
  }
13966
14206
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
13967
- store: store$e,
14207
+ store: store$f,
13968
14208
  key: i
13969
14209
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
13970
- store: store$e
14210
+ store: store$f
13971
14211
  })));
13972
14212
  };
13973
14213
 
@@ -13989,7 +14229,7 @@ const PaymentMethodContainer = props => {
13989
14229
  stripeAccount: window.Pelcro.site.read().account_id,
13990
14230
  locale: getPageOrDefaultLanguage()
13991
14231
  }, /*#__PURE__*/React__default['default'].createElement(es_11, null, /*#__PURE__*/React__default['default'].createElement(UnwrappedForm, Object.assign({
13992
- store: store$e
14232
+ store: store$f
13993
14233
  }, props))));
13994
14234
  }
13995
14235
 
@@ -14042,7 +14282,7 @@ const PelcroPaymentRequestButton = props => {
14042
14282
  currentPlan,
14043
14283
  updatedPrice
14044
14284
  }
14045
- } = React.useContext(store$e);
14285
+ } = React.useContext(store$f);
14046
14286
 
14047
14287
  const updatePaymentRequest = () => {
14048
14288
  // Make sure payment request is up to date, eg. user added a coupon code.
@@ -14102,7 +14342,7 @@ const DiscountedPrice = props => {
14102
14342
  taxAmount,
14103
14343
  percentOff
14104
14344
  }
14105
- } = React.useContext(store$e);
14345
+ } = React.useContext(store$f);
14106
14346
  const {
14107
14347
  order,
14108
14348
  plan
@@ -14152,7 +14392,7 @@ const SubmitPaymentMethod = ({
14152
14392
  isLoading,
14153
14393
  updatedPrice
14154
14394
  }
14155
- } = React.useContext(store$e);
14395
+ } = React.useContext(store$f);
14156
14396
  const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
14157
14397
  const price = updatedPrice !== null && updatedPrice !== void 0 ? updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount;
14158
14398
  const priceFormatted = getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
@@ -14173,17 +14413,17 @@ const SubmitPaymentMethod = ({
14173
14413
  }, t("labels.pay"), " ", priceFormatted && priceFormatted) : t("labels.submit"));
14174
14414
  };
14175
14415
 
14176
- var _path$l;
14416
+ var _path$m;
14177
14417
 
14178
- 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); }
14418
+ 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); }
14179
14419
 
14180
14420
  function SvgArrowLeft(props) {
14181
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
14421
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$o({
14182
14422
  xmlns: "http://www.w3.org/2000/svg",
14183
14423
  fill: "none",
14184
14424
  viewBox: "0 0 24 24",
14185
14425
  stroke: "currentColor"
14186
- }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
14426
+ }, props), _path$m || (_path$m = /*#__PURE__*/React__namespace.createElement("path", {
14187
14427
  strokeLinecap: "round",
14188
14428
  strokeLinejoin: "round",
14189
14429
  strokeWidth: 2,
@@ -14202,7 +14442,7 @@ const ApplyCouponButton = ({
14202
14442
  disableCouponButton
14203
14443
  },
14204
14444
  dispatch
14205
- } = React.useContext(store$e);
14445
+ } = React.useContext(store$f);
14206
14446
  const {
14207
14447
  t
14208
14448
  } = useTranslation("checkoutForm");
@@ -14236,7 +14476,7 @@ const CouponCodeField = props => {
14236
14476
  couponCode,
14237
14477
  couponError
14238
14478
  }
14239
- } = React.useContext(store$e);
14479
+ } = React.useContext(store$f);
14240
14480
 
14241
14481
  const onCouponCodeChange = e => {
14242
14482
  dispatch({
@@ -14265,17 +14505,17 @@ const CouponCodeField = props => {
14265
14505
  }, props));
14266
14506
  };
14267
14507
 
14268
- var _path$k;
14508
+ var _path$l;
14269
14509
 
14270
- 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); }
14510
+ 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); }
14271
14511
 
14272
14512
  function SvgTicket(props) {
14273
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
14513
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$n({
14274
14514
  xmlns: "http://www.w3.org/2000/svg",
14275
14515
  fill: "none",
14276
14516
  viewBox: "0 0 24 24",
14277
14517
  stroke: "currentColor"
14278
- }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
14518
+ }, props), _path$l || (_path$l = /*#__PURE__*/React__namespace.createElement("path", {
14279
14519
  strokeLinecap: "round",
14280
14520
  strokeLinejoin: "round",
14281
14521
  strokeWidth: 2,
@@ -14292,7 +14532,7 @@ const CouponCode = ({
14292
14532
  state: {
14293
14533
  enableCouponField
14294
14534
  }
14295
- } = React.useContext(store$e);
14535
+ } = React.useContext(store$f);
14296
14536
  const {
14297
14537
  t
14298
14538
  } = useTranslation("checkoutForm");
@@ -14549,17 +14789,18 @@ const PaypalSubscribeButton = props => {
14549
14789
  const {
14550
14790
  dispatch,
14551
14791
  state
14552
- } = React.useContext(store$e);
14792
+ } = React.useContext(store$f);
14553
14793
  const {
14554
14794
  product,
14555
14795
  plan,
14796
+ invoice,
14556
14797
  selectedAddressId
14557
14798
  } = usePelcro();
14558
14799
  React.useEffect(() => {
14559
- var _ref, _state$updatedPrice, _props$plan, _props$selectedAddres;
14800
+ var _ref, _ref2, _state$updatedPrice, _props$plan, _props$selectedAddres;
14560
14801
 
14561
14802
  // sometimes, price is updated. eg. Coupon codes.
14562
- 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;
14803
+ 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;
14563
14804
  const selectedAddress = getAddressById((_props$selectedAddres = props.selectedAddressId) !== null && _props$selectedAddres !== void 0 ? _props$selectedAddres : selectedAddressId); // initialize paypal client, then render paypal button.
14564
14805
 
14565
14806
  const initializePaypal = async () => {
@@ -14568,7 +14809,7 @@ const PaypalSubscribeButton = props => {
14568
14809
  const paypalCheckoutInstance = new PaypalClient({
14569
14810
  buttonElementID: (_props$buttonElementI = props.buttonElementID) !== null && _props$buttonElementI !== void 0 ? _props$buttonElementI : "pelcro-paypal-button",
14570
14811
  style: props.buttonStyle,
14571
- 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,
14812
+ 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,
14572
14813
  shippingAddressEditable: props.makeAddressEditable,
14573
14814
  displayName: props.merchantDisplayName,
14574
14815
  locale: props.locale,
@@ -14578,9 +14819,9 @@ const PaypalSubscribeButton = props => {
14578
14819
  await paypalCheckoutInstance.build(); // Create paypal payment
14579
14820
 
14580
14821
  paypalCheckoutInstance.createPayment({
14581
- product: (_props$plan2 = props.plan) !== null && _props$plan2 !== void 0 ? _props$plan2 : plan,
14822
+ product: invoice ? invoice.plan : (_props$plan2 = props.plan) !== null && _props$plan2 !== void 0 ? _props$plan2 : plan,
14582
14823
  amount: updatedPrice,
14583
- address: selectedAddress,
14824
+ address: invoice ? null : selectedAddress,
14584
14825
  onButtonClick: () => {
14585
14826
  dispatch({
14586
14827
  type: DISABLE_SUBMIT,
@@ -14634,16 +14875,16 @@ const BankRedirection = () => {
14634
14875
  }));
14635
14876
  };
14636
14877
 
14637
- var _path$j;
14878
+ var _path$k;
14638
14879
 
14639
- 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); }
14880
+ 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); }
14640
14881
 
14641
14882
  function SvgLock(props) {
14642
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
14883
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$m({
14643
14884
  xmlns: "http://www.w3.org/2000/svg",
14644
14885
  viewBox: "0 0 20 20",
14645
14886
  fill: "currentColor"
14646
- }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
14887
+ }, props), _path$k || (_path$k = /*#__PURE__*/React__namespace.createElement("path", {
14647
14888
  fillRule: "evenodd",
14648
14889
  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",
14649
14890
  clipRule: "evenodd"
@@ -14660,7 +14901,7 @@ const SelectedPaymentMethod = () => {
14660
14901
  state: {
14661
14902
  isLoading
14662
14903
  }
14663
- } = React.useContext(store$e);
14904
+ } = React.useContext(store$f);
14664
14905
  const {
14665
14906
  switchView,
14666
14907
  selectedPaymentMethodId
@@ -14702,7 +14943,7 @@ const TaxAmount = () => {
14702
14943
  state: {
14703
14944
  taxAmount
14704
14945
  }
14705
- } = React.useContext(store$e);
14946
+ } = React.useContext(store$f);
14706
14947
  const {
14707
14948
  plan
14708
14949
  } = usePelcro();
@@ -14865,12 +15106,12 @@ function SubscriptionRenewModal({
14865
15106
  }
14866
15107
  SubscriptionRenewModal.viewId = "subscription-renew";
14867
15108
 
14868
- var _path$i;
15109
+ var _path$j;
14869
15110
 
14870
- 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); }
15111
+ 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); }
14871
15112
 
14872
15113
  function SvgGift(props) {
14873
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
15114
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$l({
14874
15115
  className: "plc-w-6 plc-h-6 plc-mr-2",
14875
15116
  fill: "none",
14876
15117
  stroke: "currentColor",
@@ -14879,7 +15120,7 @@ function SvgGift(props) {
14879
15120
  strokeWidth: 2,
14880
15121
  viewBox: "0 0 24 24",
14881
15122
  xmlns: "http://www.w3.org/2000/svg"
14882
- }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
15123
+ }, props), _path$j || (_path$j = /*#__PURE__*/React__namespace.createElement("path", {
14883
15124
  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"
14884
15125
  })));
14885
15126
  }
@@ -14917,10 +15158,13 @@ const getCurrentFlow = () => {
14917
15158
  const {
14918
15159
  product,
14919
15160
  giftRecipient,
14920
- giftCode
15161
+ giftCode,
15162
+ invoice
14921
15163
  } = usePelcro.getStore();
14922
15164
 
14923
- if (giftRecipient) {
15165
+ if (invoice) {
15166
+ return "invoicePayment";
15167
+ } else if (giftRecipient) {
14924
15168
  return "giftCreate";
14925
15169
  } else if (giftCode) {
14926
15170
  return "giftRedeem";
@@ -14957,6 +15201,13 @@ const getSuccessContent = i18n => {
14957
15201
  }),
14958
15202
  successTitle: i18n("messages.giftRedeem.title"),
14959
15203
  successContent: i18n("messages.giftRedeem.content")
15204
+ },
15205
+ invoicePayment: {
15206
+ successIcon: /*#__PURE__*/React__default['default'].createElement(SvgCheckSolid, {
15207
+ className: "plc-w-32 plc-my-4 plc-text-green-500"
15208
+ }),
15209
+ successTitle: i18n("messages.invoicePayment.title"),
15210
+ successContent: i18n("messages.invoicePayment.title")
14960
15211
  }
14961
15212
  };
14962
15213
  return wordingDictionary[flow];
@@ -15210,7 +15461,7 @@ class DefaultNewsLetter extends React.Component {
15210
15461
 
15211
15462
  const NewsLetter = withTranslation("newsletter")(DefaultNewsLetter);
15212
15463
 
15213
- const initialState$d = {
15464
+ const initialState$e = {
15214
15465
  didSubToNewslettersBefore: false,
15215
15466
  newsletters: [],
15216
15467
  isListLoading: true,
@@ -15220,10 +15471,10 @@ const initialState$d = {
15220
15471
  content: ""
15221
15472
  }
15222
15473
  };
15223
- const store$d = /*#__PURE__*/React.createContext(initialState$d);
15474
+ const store$e = /*#__PURE__*/React.createContext(initialState$e);
15224
15475
  const {
15225
- Provider: Provider$d
15226
- } = store$d;
15476
+ Provider: Provider$e
15477
+ } = store$e;
15227
15478
 
15228
15479
  const NewsletterUpdateContainer = ({
15229
15480
  style,
@@ -15336,7 +15587,7 @@ const NewsletterUpdateContainer = ({
15336
15587
  default:
15337
15588
  return state;
15338
15589
  }
15339
- }, initialState$d);
15590
+ }, initialState$e);
15340
15591
  React.useEffect(() => {
15341
15592
  const getUserNewsletters = () => {
15342
15593
  var _window$Pelcro$user$r3, _window$Pelcro$user$r4;
@@ -15380,7 +15631,7 @@ const NewsletterUpdateContainer = ({
15380
15631
  style: { ...style
15381
15632
  },
15382
15633
  className: `pelcro-container pelcro-newsletter-update-container ${className}`
15383
- }, /*#__PURE__*/React__default['default'].createElement(Provider$d, {
15634
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$e, {
15384
15635
  value: {
15385
15636
  state,
15386
15637
  dispatch
@@ -15388,12 +15639,12 @@ const NewsletterUpdateContainer = ({
15388
15639
  }, children.length ? children.map((child, i) => {
15389
15640
  if (child) {
15390
15641
  return /*#__PURE__*/React__default['default'].cloneElement(child, {
15391
- store: store$d,
15642
+ store: store$e,
15392
15643
  key: i
15393
15644
  });
15394
15645
  }
15395
15646
  }) : /*#__PURE__*/React__default['default'].cloneElement(children, {
15396
- store: store$d
15647
+ store: store$e
15397
15648
  })));
15398
15649
  };
15399
15650
 
@@ -15408,7 +15659,7 @@ const NewsletterUpdateButton = ({
15408
15659
  isSubmitting,
15409
15660
  isListLoading
15410
15661
  }
15411
- } = React.useContext(store$d);
15662
+ } = React.useContext(store$e);
15412
15663
  const {
15413
15664
  t
15414
15665
  } = useTranslation("newsletter");
@@ -15438,7 +15689,7 @@ const NewsletterUpdateList = () => {
15438
15689
  newsletters,
15439
15690
  isListLoading
15440
15691
  }
15441
- } = React.useContext(store$d);
15692
+ } = React.useContext(store$e);
15442
15693
 
15443
15694
  if (isListLoading) {
15444
15695
  return /*#__PURE__*/React__default['default'].createElement(Loader, {
@@ -15642,7 +15893,7 @@ function SubscriptionCreateModal({
15642
15893
  SubscriptionCreateModal.viewId = "subscription-create";
15643
15894
 
15644
15895
  var _window$Pelcro$user$r, _window$Pelcro$user$r2, _window$Pelcro$user$r3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
15645
- const initialState$c = {
15896
+ const initialState$d = {
15646
15897
  email: (_window$Pelcro$user$r = window.Pelcro.user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.email,
15647
15898
  firstName: (_window$Pelcro$user$r2 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.first_name,
15648
15899
  lastName: (_window$Pelcro$user$r3 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r3 === void 0 ? void 0 : _window$Pelcro$user$r3.last_name,
@@ -15655,10 +15906,10 @@ const initialState$c = {
15655
15906
  content: ""
15656
15907
  }
15657
15908
  };
15658
- const store$c = /*#__PURE__*/React.createContext(initialState$c);
15909
+ const store$d = /*#__PURE__*/React.createContext(initialState$d);
15659
15910
  const {
15660
- Provider: Provider$c
15661
- } = store$c;
15911
+ Provider: Provider$d
15912
+ } = store$d;
15662
15913
 
15663
15914
  const UserUpdateContainer = ({
15664
15915
  style,
@@ -15790,27 +16041,27 @@ const UserUpdateContainer = ({
15790
16041
  default:
15791
16042
  return state;
15792
16043
  }
15793
- }, initialState$c);
16044
+ }, initialState$d);
15794
16045
  return /*#__PURE__*/React__default['default'].createElement("div", {
15795
16046
  style: { ...style
15796
16047
  },
15797
16048
  className: `pelcro-container pelcro-user-update-container ${className}`
15798
- }, /*#__PURE__*/React__default['default'].createElement(Provider$c, {
16049
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$d, {
15799
16050
  value: {
15800
16051
  state,
15801
16052
  dispatch
15802
16053
  }
15803
16054
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
15804
- store: store$c,
16055
+ store: store$d,
15805
16056
  key: i
15806
16057
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
15807
- store: store$c
16058
+ store: store$d
15808
16059
  })));
15809
16060
  };
15810
16061
 
15811
16062
  const UserUpdateEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
15812
16063
  disabled: true,
15813
- store: store$c
16064
+ store: store$d
15814
16065
  }, props));
15815
16066
 
15816
16067
  const UserUpdateButton = ({
@@ -15823,7 +16074,7 @@ const UserUpdateButton = ({
15823
16074
  buttonDisabled
15824
16075
  },
15825
16076
  dispatch
15826
- } = React.useContext(store$c);
16077
+ } = React.useContext(store$d);
15827
16078
  const {
15828
16079
  t
15829
16080
  } = useTranslation("userEdit");
@@ -15840,11 +16091,11 @@ const UserUpdateButton = ({
15840
16091
  };
15841
16092
 
15842
16093
  const UserUpdateFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
15843
- store: store$c
16094
+ store: store$d
15844
16095
  }, props));
15845
16096
 
15846
16097
  const UserUpdateLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
15847
- store: store$c
16098
+ store: store$d
15848
16099
  }, props));
15849
16100
 
15850
16101
  function Phone({
@@ -15873,22 +16124,22 @@ function Phone({
15873
16124
  }
15874
16125
 
15875
16126
  const UserUpdatePhone = props => /*#__PURE__*/React__default['default'].createElement(Phone, Object.assign({
15876
- store: store$c
16127
+ store: store$d
15877
16128
  }, props));
15878
16129
 
15879
16130
  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";
15880
16131
 
15881
- var _path$h;
16132
+ var _path$i;
15882
16133
 
15883
- 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); }
16134
+ 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); }
15884
16135
 
15885
16136
  function SvgEdit(props) {
15886
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$j({
16137
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$k({
15887
16138
  className: "plc-w-6 plc-h-6",
15888
16139
  xmlns: "http://www.w3.org/2000/svg",
15889
16140
  viewBox: "0 0 20 20",
15890
16141
  fill: "currentColor"
15891
- }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
16142
+ }, props), _path$i || (_path$i = /*#__PURE__*/React__namespace.createElement("path", {
15892
16143
  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"
15893
16144
  })));
15894
16145
  }
@@ -16020,16 +16271,16 @@ function DisplayName({
16020
16271
  }
16021
16272
 
16022
16273
  const UserUpdateDisplayName = props => /*#__PURE__*/React__default['default'].createElement(DisplayName, Object.assign({
16023
- store: store$c
16274
+ store: store$d
16024
16275
  }, props));
16025
16276
 
16026
16277
  const UserUpdateTextInput = props => {
16027
16278
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
16028
- store: store$c
16279
+ store: store$d
16029
16280
  }));
16030
16281
  };
16031
16282
 
16032
- const initialState$b = {
16283
+ const initialState$c = {
16033
16284
  isSubmitting: false,
16034
16285
  firstName: "",
16035
16286
  firstNameError: "",
@@ -16054,10 +16305,10 @@ const initialState$b = {
16054
16305
  content: ""
16055
16306
  }
16056
16307
  };
16057
- const store$b = /*#__PURE__*/React.createContext(initialState$b);
16308
+ const store$c = /*#__PURE__*/React.createContext(initialState$c);
16058
16309
  const {
16059
- Provider: Provider$b
16060
- } = store$b;
16310
+ Provider: Provider$c
16311
+ } = store$c;
16061
16312
 
16062
16313
  const getNewlyCreatedAddress = addresses => addresses[addresses.length - 1];
16063
16314
 
@@ -16264,7 +16515,7 @@ const AddressCreateContainer = ({
16264
16515
  default:
16265
16516
  return state;
16266
16517
  }
16267
- }, initialState$b);
16518
+ }, initialState$c);
16268
16519
  React.useEffect(() => {
16269
16520
  const getStates = () => {
16270
16521
  dispatch({
@@ -16296,16 +16547,16 @@ const AddressCreateContainer = ({
16296
16547
  style: { ...style
16297
16548
  },
16298
16549
  className: `pelcro-container pelcro-address-create-container ${className}`
16299
- }, /*#__PURE__*/React__default['default'].createElement(Provider$b, {
16550
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$c, {
16300
16551
  value: {
16301
16552
  state,
16302
16553
  dispatch
16303
16554
  }
16304
16555
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
16305
- store: store$b,
16556
+ store: store$c,
16306
16557
  key: i
16307
16558
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
16308
- store: store$b
16559
+ store: store$c
16309
16560
  })));
16310
16561
  };
16311
16562
 
@@ -16316,7 +16567,7 @@ function AddressCreateFirstName(props) {
16316
16567
  firstName,
16317
16568
  firstNameError
16318
16569
  }
16319
- } = React.useContext(store$b);
16570
+ } = React.useContext(store$c);
16320
16571
 
16321
16572
  const handleBlur = () => {
16322
16573
  return dispatch({
@@ -16359,7 +16610,7 @@ function AddressCreateLastName(props) {
16359
16610
  lastName,
16360
16611
  lastNameError
16361
16612
  }
16362
- } = React.useContext(store$b);
16613
+ } = React.useContext(store$c);
16363
16614
 
16364
16615
  const handleBlur = () => {
16365
16616
  return dispatch({
@@ -16402,7 +16653,7 @@ function AddressCreateLine1(props) {
16402
16653
  line1,
16403
16654
  line1Error
16404
16655
  }
16405
- } = React.useContext(store$b);
16656
+ } = React.useContext(store$c);
16406
16657
 
16407
16658
  const handleBlur = () => {
16408
16659
  return dispatch({
@@ -16445,7 +16696,7 @@ function AddressCreateCity(props) {
16445
16696
  city,
16446
16697
  cityError
16447
16698
  }
16448
- } = React.useContext(store$b);
16699
+ } = React.useContext(store$c);
16449
16700
 
16450
16701
  const handleBlur = () => {
16451
16702
  return dispatch({
@@ -16488,7 +16739,7 @@ function AddressCreatePostalCode(props) {
16488
16739
  postalCode,
16489
16740
  postalCodeError
16490
16741
  }
16491
- } = React.useContext(store$b);
16742
+ } = React.useContext(store$c);
16492
16743
 
16493
16744
  const handleBlur = () => {
16494
16745
  return dispatch({
@@ -16534,7 +16785,7 @@ const AddressCreateSubmit = ({
16534
16785
  state: {
16535
16786
  isSubmitting
16536
16787
  }
16537
- } = React.useContext(store$b);
16788
+ } = React.useContext(store$c);
16538
16789
  const {
16539
16790
  t
16540
16791
  } = useTranslation("address");
@@ -16645,7 +16896,7 @@ function CountrySelect({
16645
16896
  }
16646
16897
 
16647
16898
  const AddressCreateCountrySelect = props => /*#__PURE__*/React__default['default'].createElement(CountrySelect, Object.assign({
16648
- store: store$b
16899
+ store: store$c
16649
16900
  }, props));
16650
16901
 
16651
16902
  function StateSelect({
@@ -16733,7 +16984,7 @@ function StateSelect({
16733
16984
  }
16734
16985
 
16735
16986
  const AddressCreateStateSelect = props => /*#__PURE__*/React__default['default'].createElement(StateSelect, Object.assign({
16736
- store: store$b
16987
+ store: store$c
16737
16988
  }, props));
16738
16989
 
16739
16990
  const AddressCreateView = props => {
@@ -16838,18 +17089,18 @@ AddressCreateModal.viewId = "address-create";
16838
17089
 
16839
17090
  const AddressCreateTextInput = props => {
16840
17091
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
16841
- store: store$b
17092
+ store: store$c
16842
17093
  }));
16843
17094
  };
16844
17095
 
16845
17096
  const AddressCreateLine2 = props => {
16846
17097
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({
16847
17098
  fieldName: "line2",
16848
- store: store$b
17099
+ store: store$c
16849
17100
  }, props));
16850
17101
  };
16851
17102
 
16852
- const initialState$a = {
17103
+ const initialState$b = {
16853
17104
  isSubmitting: false,
16854
17105
  firstName: "",
16855
17106
  firstNameError: "",
@@ -16874,10 +17125,10 @@ const initialState$a = {
16874
17125
  content: ""
16875
17126
  }
16876
17127
  };
16877
- const store$a = /*#__PURE__*/React.createContext(initialState$a);
17128
+ const store$b = /*#__PURE__*/React.createContext(initialState$b);
16878
17129
  const {
16879
- Provider: Provider$a
16880
- } = store$a;
17130
+ Provider: Provider$b
17131
+ } = store$b;
16881
17132
 
16882
17133
  const AddressUpdateContainer = ({
16883
17134
  style,
@@ -16929,7 +17180,7 @@ const AddressUpdateContainer = ({
16929
17180
  const thisAddress = addresses[address];
16930
17181
 
16931
17182
  if (+thisAddress.id === +addressId) {
16932
- const newState = { ...initialState$a,
17183
+ const newState = { ...initialState$b,
16933
17184
  firstName: thisAddress.first_name,
16934
17185
  lastName: thisAddress.last_name,
16935
17186
  line1: thisAddress.line1,
@@ -17062,7 +17313,7 @@ const AddressUpdateContainer = ({
17062
17313
  default:
17063
17314
  return state;
17064
17315
  }
17065
- }, initialState$a);
17316
+ }, initialState$b);
17066
17317
  React.useEffect(() => {
17067
17318
  const getStates = () => {
17068
17319
  dispatch({
@@ -17094,21 +17345,21 @@ const AddressUpdateContainer = ({
17094
17345
  style: { ...style
17095
17346
  },
17096
17347
  className: `pelcro-container pelcro-address-update-container ${className}`
17097
- }, /*#__PURE__*/React__default['default'].createElement(Provider$a, {
17348
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$b, {
17098
17349
  value: {
17099
17350
  state,
17100
17351
  dispatch
17101
17352
  }
17102
17353
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
17103
- store: store$a,
17354
+ store: store$b,
17104
17355
  key: i
17105
17356
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
17106
- store: store$a
17357
+ store: store$b
17107
17358
  })));
17108
17359
  };
17109
17360
 
17110
17361
  const AddressUpdateCountrySelect = props => /*#__PURE__*/React__default['default'].createElement(CountrySelect, Object.assign({
17111
- store: store$a
17362
+ store: store$b
17112
17363
  }, props));
17113
17364
 
17114
17365
  function AddressUpdateFirstName(props) {
@@ -17118,7 +17369,7 @@ function AddressUpdateFirstName(props) {
17118
17369
  firstName,
17119
17370
  firstNameError
17120
17371
  }
17121
- } = React.useContext(store$a);
17372
+ } = React.useContext(store$b);
17122
17373
 
17123
17374
  const handleBlur = () => {
17124
17375
  return dispatch({
@@ -17161,7 +17412,7 @@ function AddressUpdateLastName(props) {
17161
17412
  lastName,
17162
17413
  lastNameError
17163
17414
  }
17164
- } = React.useContext(store$a);
17415
+ } = React.useContext(store$b);
17165
17416
 
17166
17417
  const handleBlur = () => {
17167
17418
  return dispatch({
@@ -17204,7 +17455,7 @@ function AddressUpdateLine1(props) {
17204
17455
  line1,
17205
17456
  line1Error
17206
17457
  }
17207
- } = React.useContext(store$a);
17458
+ } = React.useContext(store$b);
17208
17459
 
17209
17460
  const handleBlur = () => {
17210
17461
  return dispatch({
@@ -17244,7 +17495,7 @@ const AddressUpdateLine2 = props => {
17244
17495
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({
17245
17496
  fieldName: "line2"
17246
17497
  }, props, {
17247
- store: store$a
17498
+ store: store$b
17248
17499
  }));
17249
17500
  };
17250
17501
 
@@ -17255,7 +17506,7 @@ function AddressUpdateCity(props) {
17255
17506
  city,
17256
17507
  cityError
17257
17508
  }
17258
- } = React.useContext(store$a);
17509
+ } = React.useContext(store$b);
17259
17510
 
17260
17511
  const handleBlur = () => {
17261
17512
  return dispatch({
@@ -17298,7 +17549,7 @@ function AddressUpdatePostalCode(props) {
17298
17549
  postalCode,
17299
17550
  postalCodeError
17300
17551
  }
17301
- } = React.useContext(store$a);
17552
+ } = React.useContext(store$b);
17302
17553
 
17303
17554
  const handleBlur = () => {
17304
17555
  return dispatch({
@@ -17344,7 +17595,7 @@ const AddressUpdateSubmit = ({
17344
17595
  state: {
17345
17596
  isSubmitting
17346
17597
  }
17347
- } = React.useContext(store$a);
17598
+ } = React.useContext(store$b);
17348
17599
  const {
17349
17600
  t
17350
17601
  } = useTranslation("address");
@@ -17360,7 +17611,7 @@ const AddressUpdateSubmit = ({
17360
17611
  };
17361
17612
 
17362
17613
  const AddressUpdateStateSelect = props => /*#__PURE__*/React__default['default'].createElement(StateSelect, Object.assign({
17363
- store: store$a
17614
+ store: store$b
17364
17615
  }, props));
17365
17616
 
17366
17617
  const AddressUpdateView = props => {
@@ -17443,7 +17694,7 @@ AddressUpdateModal.viewId = "address-edit";
17443
17694
 
17444
17695
  const AddressUpdateTextInput = props => {
17445
17696
  return /*#__PURE__*/React__default['default'].createElement(TextInput, Object.assign({}, props, {
17446
- store: store$a
17697
+ store: store$b
17447
17698
  }));
17448
17699
  };
17449
17700
 
@@ -17526,7 +17777,7 @@ const PaymentMethodUpdateModal = props => {
17526
17777
  };
17527
17778
  PaymentMethodUpdateModal.viewId = "payment-method-update";
17528
17779
 
17529
- const initialState$9 = {
17780
+ const initialState$a = {
17530
17781
  email: "",
17531
17782
  password: "",
17532
17783
  passwordError: null,
@@ -17539,10 +17790,10 @@ const initialState$9 = {
17539
17790
  content: ""
17540
17791
  }
17541
17792
  };
17542
- const store$9 = /*#__PURE__*/React.createContext(initialState$9);
17793
+ const store$a = /*#__PURE__*/React.createContext(initialState$a);
17543
17794
  const {
17544
- Provider: Provider$9
17545
- } = store$9;
17795
+ Provider: Provider$a
17796
+ } = store$a;
17546
17797
 
17547
17798
  const PasswordResetContainer = ({
17548
17799
  style,
@@ -17599,7 +17850,7 @@ const PasswordResetContainer = ({
17599
17850
  type: SET_EMAIL,
17600
17851
  payload: window.Pelcro.helpers.getURLParameter("email")
17601
17852
  });
17602
- initialState$9.email = window.Pelcro.helpers.getURLParameter("email");
17853
+ initialState$a.email = window.Pelcro.helpers.getURLParameter("email");
17603
17854
  dispatch({
17604
17855
  type: SET_TOKEN,
17605
17856
  payload: window.Pelcro.helpers.getURLParameter("token")
@@ -17659,26 +17910,26 @@ const PasswordResetContainer = ({
17659
17910
  default:
17660
17911
  return state;
17661
17912
  }
17662
- }, initialState$9);
17913
+ }, initialState$a);
17663
17914
  return /*#__PURE__*/React__default['default'].createElement("div", {
17664
17915
  style: { ...style
17665
17916
  },
17666
17917
  className: `pelcro-container pelcro-password-reset-container ${className}`
17667
- }, /*#__PURE__*/React__default['default'].createElement(Provider$9, {
17918
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$a, {
17668
17919
  value: {
17669
17920
  state,
17670
17921
  dispatch
17671
17922
  }
17672
17923
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
17673
- store: store$9,
17924
+ store: store$a,
17674
17925
  key: i
17675
17926
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
17676
- store: store$9
17927
+ store: store$a
17677
17928
  })));
17678
17929
  };
17679
17930
 
17680
17931
  const PasswordResetPassword = props => /*#__PURE__*/React__default['default'].createElement(Password, Object.assign({
17681
- store: store$9
17932
+ store: store$a
17682
17933
  }, props));
17683
17934
 
17684
17935
  const PasswordResetButton = ({
@@ -17691,7 +17942,7 @@ const PasswordResetButton = ({
17691
17942
  buttonDisabled
17692
17943
  },
17693
17944
  dispatch
17694
- } = React.useContext(store$9);
17945
+ } = React.useContext(store$a);
17695
17946
  const {
17696
17947
  t
17697
17948
  } = useTranslation("passwordReset");
@@ -17708,14 +17959,14 @@ const PasswordResetButton = ({
17708
17959
  };
17709
17960
 
17710
17961
  const PasswordResetEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
17711
- store: store$9
17962
+ store: store$a
17712
17963
  }, props, {
17713
17964
  value: window.Pelcro.helpers.getURLParameter("email"),
17714
17965
  disabled: true
17715
17966
  }));
17716
17967
 
17717
17968
  const PasswordResetConfirmPassword = props => /*#__PURE__*/React__default['default'].createElement(ConfirmPassword, Object.assign({
17718
- store: store$9
17969
+ store: store$a
17719
17970
  }, props));
17720
17971
 
17721
17972
  const PasswordResetView = props => {
@@ -17767,7 +18018,7 @@ const PasswordResetModal = ({
17767
18018
  };
17768
18019
  PasswordResetModal.viewId = "password-reset";
17769
18020
 
17770
- const initialState$8 = {
18021
+ const initialState$9 = {
17771
18022
  email: "",
17772
18023
  emailError: null,
17773
18024
  buttonDisabled: false,
@@ -17776,10 +18027,10 @@ const initialState$8 = {
17776
18027
  content: ""
17777
18028
  }
17778
18029
  };
17779
- const store$8 = /*#__PURE__*/React.createContext(initialState$8);
18030
+ const store$9 = /*#__PURE__*/React.createContext(initialState$9);
17780
18031
  const {
17781
- Provider: Provider$8
17782
- } = store$8;
18032
+ Provider: Provider$9
18033
+ } = store$9;
17783
18034
 
17784
18035
  const PasswordForgotContainer = ({
17785
18036
  style,
@@ -17857,21 +18108,21 @@ const PasswordForgotContainer = ({
17857
18108
  default:
17858
18109
  return state;
17859
18110
  }
17860
- }, initialState$8);
18111
+ }, initialState$9);
17861
18112
  return /*#__PURE__*/React__default['default'].createElement("div", {
17862
18113
  style: { ...style
17863
18114
  },
17864
18115
  className: `pelcro-container pelcro-password-forgot-container ${className}`
17865
- }, /*#__PURE__*/React__default['default'].createElement(Provider$8, {
18116
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$9, {
17866
18117
  value: {
17867
18118
  state,
17868
18119
  dispatch
17869
18120
  }
17870
18121
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
17871
- store: store$8,
18122
+ store: store$9,
17872
18123
  key: i
17873
18124
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
17874
- store: store$8
18125
+ store: store$9
17875
18126
  })));
17876
18127
  };
17877
18128
 
@@ -17887,7 +18138,7 @@ const PasswordForgotButton = ({
17887
18138
  emailError
17888
18139
  },
17889
18140
  dispatch
17890
- } = React.useContext(store$8);
18141
+ } = React.useContext(store$9);
17891
18142
  const {
17892
18143
  t
17893
18144
  } = useTranslation("passwordForgot");
@@ -17908,7 +18159,7 @@ const PasswordForgotButton = ({
17908
18159
  };
17909
18160
 
17910
18161
  const PasswordForgotEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
17911
- store: store$8
18162
+ store: store$9
17912
18163
  }, props));
17913
18164
 
17914
18165
  const PasswordForgotView = props => {
@@ -17958,7 +18209,7 @@ const PasswordForgotModal = ({
17958
18209
  };
17959
18210
  PasswordForgotModal.viewId = "password-forgot";
17960
18211
 
17961
- const initialState$7 = {
18212
+ const initialState$8 = {
17962
18213
  currentPassword: "",
17963
18214
  newPassword: "",
17964
18215
  confirmNewPassword: "",
@@ -17972,10 +18223,10 @@ const initialState$7 = {
17972
18223
  content: ""
17973
18224
  }
17974
18225
  };
17975
- const store$7 = /*#__PURE__*/React.createContext(initialState$7);
18226
+ const store$8 = /*#__PURE__*/React.createContext(initialState$8);
17976
18227
  const {
17977
- Provider: Provider$7
17978
- } = store$7;
18228
+ Provider: Provider$8
18229
+ } = store$8;
17979
18230
  const PasswordChangeContainer = ({
17980
18231
  style,
17981
18232
  className = "",
@@ -18127,21 +18378,21 @@ const PasswordChangeContainer = ({
18127
18378
  default:
18128
18379
  return state;
18129
18380
  }
18130
- }, initialState$7);
18381
+ }, initialState$8);
18131
18382
  return /*#__PURE__*/React__default['default'].createElement("div", {
18132
18383
  style: { ...style
18133
18384
  },
18134
18385
  className: `pelcro-container pelcro-password-change-container ${className}`
18135
- }, /*#__PURE__*/React__default['default'].createElement(Provider$7, {
18386
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$8, {
18136
18387
  value: {
18137
18388
  state,
18138
18389
  dispatch
18139
18390
  }
18140
18391
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18141
- store: store$7,
18392
+ store: store$8,
18142
18393
  key: i
18143
18394
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18144
- store: store$7
18395
+ store: store$8
18145
18396
  })));
18146
18397
  };
18147
18398
 
@@ -18152,7 +18403,7 @@ function PasswordChangeCurrentPassword(props) {
18152
18403
  currentPassword,
18153
18404
  currentPasswordError
18154
18405
  }
18155
- } = React.useContext(store$7);
18406
+ } = React.useContext(store$8);
18156
18407
  const handleBlur = React.useCallback(() => {
18157
18408
  return dispatch({
18158
18409
  type: VALIDATE_PASSWORD
@@ -18186,7 +18437,7 @@ function PasswordChangeNewPassword(props) {
18186
18437
  newPassword,
18187
18438
  newPasswordError
18188
18439
  }
18189
- } = React.useContext(store$7);
18440
+ } = React.useContext(store$8);
18190
18441
  const handleBlur = React.useCallback(() => {
18191
18442
  return dispatch({
18192
18443
  type: VALIDATE_NEW_PASSWORD
@@ -18220,7 +18471,7 @@ function PasswordChangeConfirmNewPassword(props) {
18220
18471
  confirmNewPassword,
18221
18472
  confirmNewPasswordError
18222
18473
  }
18223
- } = React.useContext(store$7);
18474
+ } = React.useContext(store$8);
18224
18475
  const handleBlur = React.useCallback(() => {
18225
18476
  return dispatch({
18226
18477
  type: VALIDATE_CONFIRM_NEW_PASSWORD
@@ -18261,7 +18512,7 @@ const PasswordChangeButton = ({
18261
18512
  confirmNewPasswordError
18262
18513
  },
18263
18514
  dispatch
18264
- } = React.useContext(store$7);
18515
+ } = React.useContext(store$8);
18265
18516
  const {
18266
18517
  t
18267
18518
  } = useTranslation("passwordChange");
@@ -18327,17 +18578,17 @@ const PasswordChangeModal = ({
18327
18578
  };
18328
18579
  PasswordChangeModal.viewId = "password-change";
18329
18580
 
18330
- const initialState$6 = {
18581
+ const initialState$7 = {
18331
18582
  buttonDisabled: false,
18332
18583
  alert: {
18333
18584
  type: "error",
18334
18585
  content: ""
18335
18586
  }
18336
18587
  };
18337
- const store$6 = /*#__PURE__*/React.createContext(initialState$6);
18588
+ const store$7 = /*#__PURE__*/React.createContext(initialState$7);
18338
18589
  const {
18339
- Provider: Provider$6
18340
- } = store$6;
18590
+ Provider: Provider$7
18591
+ } = store$7;
18341
18592
 
18342
18593
  const CartContainer = ({
18343
18594
  style,
@@ -18428,21 +18679,21 @@ const CartContainer = ({
18428
18679
  default:
18429
18680
  return state;
18430
18681
  }
18431
- }, initialState$6);
18682
+ }, initialState$7);
18432
18683
  return /*#__PURE__*/React__default['default'].createElement("div", {
18433
18684
  style: { ...style
18434
18685
  },
18435
18686
  className: `pelcro-container pelcro-cart-container ${className}`
18436
- }, /*#__PURE__*/React__default['default'].createElement(Provider$6, {
18687
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$7, {
18437
18688
  value: {
18438
18689
  state,
18439
18690
  dispatch
18440
18691
  }
18441
18692
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18442
- store: store$6,
18693
+ store: store$7,
18443
18694
  key: i
18444
18695
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18445
- store: store$6
18696
+ store: store$7
18446
18697
  })));
18447
18698
  };
18448
18699
 
@@ -18479,7 +18730,7 @@ const CartSubmit = ({
18479
18730
  buttonDisabled
18480
18731
  },
18481
18732
  dispatch
18482
- } = React.useContext(store$6);
18733
+ } = React.useContext(store$7);
18483
18734
  const {
18484
18735
  t
18485
18736
  } = useTranslation("cart");
@@ -18510,7 +18761,7 @@ const CartTotalPrice = () => {
18510
18761
  state: {
18511
18762
  alert
18512
18763
  }
18513
- } = React.useContext(store$6);
18764
+ } = React.useContext(store$7);
18514
18765
  const {
18515
18766
  cartItems
18516
18767
  } = usePelcro();
@@ -18823,7 +19074,7 @@ const OrderConfirmModal = props => {
18823
19074
  };
18824
19075
  OrderConfirmModal.viewId = "order-confirm";
18825
19076
 
18826
- const initialState$5 = {
19077
+ const initialState$6 = {
18827
19078
  email: "",
18828
19079
  firstName: "",
18829
19080
  lastName: "",
@@ -18835,10 +19086,10 @@ const initialState$5 = {
18835
19086
  content: ""
18836
19087
  }
18837
19088
  };
18838
- const store$5 = /*#__PURE__*/React.createContext(initialState$5);
19089
+ const store$6 = /*#__PURE__*/React.createContext(initialState$6);
18839
19090
  const {
18840
- Provider: Provider$5
18841
- } = store$5;
19091
+ Provider: Provider$6
19092
+ } = store$6;
18842
19093
 
18843
19094
  const GiftCreateContainer = ({
18844
19095
  style,
@@ -18942,21 +19193,21 @@ const GiftCreateContainer = ({
18942
19193
  default:
18943
19194
  return state;
18944
19195
  }
18945
- }, initialState$5);
19196
+ }, initialState$6);
18946
19197
  return /*#__PURE__*/React__default['default'].createElement("div", {
18947
19198
  style: { ...style
18948
19199
  },
18949
19200
  className: `pelcro-container pelcro-gift-create-container ${className}`
18950
- }, /*#__PURE__*/React__default['default'].createElement(Provider$5, {
19201
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$6, {
18951
19202
  value: {
18952
19203
  state,
18953
19204
  dispatch
18954
19205
  }
18955
19206
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
18956
- store: store$5,
19207
+ store: store$6,
18957
19208
  key: i
18958
19209
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
18959
- store: store$5
19210
+ store: store$6
18960
19211
  })));
18961
19212
  };
18962
19213
 
@@ -18970,7 +19221,7 @@ const GiftCreateSubmitButton = ({
18970
19221
  state: {
18971
19222
  disableSubmit
18972
19223
  }
18973
- } = React.useContext(store$5);
19224
+ } = React.useContext(store$6);
18974
19225
  const {
18975
19226
  t
18976
19227
  } = useTranslation("register");
@@ -18987,29 +19238,29 @@ const GiftCreateSubmitButton = ({
18987
19238
 
18988
19239
  const GiftCreateEmail = props => /*#__PURE__*/React__default['default'].createElement(Email, Object.assign({
18989
19240
  initWithUserEmail: false,
18990
- store: store$5
19241
+ store: store$6
18991
19242
  }, props));
18992
19243
 
18993
19244
  const GiftCreateFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
18994
- store: store$5
19245
+ store: store$6
18995
19246
  }, props));
18996
19247
 
18997
19248
  const GiftCreateLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
18998
- store: store$5
19249
+ store: store$6
18999
19250
  }, props));
19000
19251
 
19001
- var _path$g;
19252
+ var _path$h;
19002
19253
 
19003
- 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); }
19254
+ 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); }
19004
19255
 
19005
19256
  function SvgInfoCircle(props) {
19006
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
19257
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$j({
19007
19258
  xmlns: "http://www.w3.org/2000/svg",
19008
19259
  className: "plc-w-5 plc-h-5",
19009
19260
  fill: "none",
19010
19261
  viewBox: "0 0 24 24",
19011
19262
  stroke: "currentColor"
19012
- }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
19263
+ }, props), _path$h || (_path$h = /*#__PURE__*/React__namespace.createElement("path", {
19013
19264
  strokeLinecap: "round",
19014
19265
  strokeLinejoin: "round",
19015
19266
  strokeWidth: 2,
@@ -19080,7 +19331,7 @@ const GiftCreateStartDate = props => {
19080
19331
  const {
19081
19332
  dispatch,
19082
19333
  state
19083
- } = React.useContext(store$5);
19334
+ } = React.useContext(store$6);
19084
19335
 
19085
19336
  const handleInputChange = value => {
19086
19337
  dispatch({
@@ -19145,13 +19396,17 @@ function TextArea({
19145
19396
  */
19146
19397
 
19147
19398
  function GiftCreateMessage(props) {
19399
+ var _ref, _state$giftMessage;
19400
+
19148
19401
  const {
19149
19402
  t
19150
19403
  } = useTranslation("register");
19151
19404
  const {
19152
19405
  dispatch,
19153
19406
  state
19154
- } = React.useContext(store$5);
19407
+ } = React.useContext(store$6);
19408
+ const MAX_CHARS_COUNT = 200;
19409
+ const remainingCharsCount = (_ref = MAX_CHARS_COUNT - ((_state$giftMessage = state.giftMessage) === null || _state$giftMessage === void 0 ? void 0 : _state$giftMessage.length)) !== null && _ref !== void 0 ? _ref : 0;
19155
19410
 
19156
19411
  const handleInputChange = value => {
19157
19412
  dispatch({
@@ -19169,6 +19424,9 @@ function GiftCreateMessage(props) {
19169
19424
  value: state.giftMessage,
19170
19425
  maxLength: "200",
19171
19426
  rows: 3,
19427
+ label: t("gift.labels.giftMessage", {
19428
+ count: remainingCharsCount
19429
+ }),
19172
19430
  tooltipText: t("gift.messages.giftMessageInfo")
19173
19431
  }, props));
19174
19432
  }
@@ -19218,8 +19476,7 @@ const GiftCreateView = props => {
19218
19476
  }, /*#__PURE__*/React__default['default'].createElement(GiftCreateMessage, {
19219
19477
  autoComplete: "gift-message",
19220
19478
  id: "pelcro-input-gift-message",
19221
- errorId: "pelcro-input-gift-message-error",
19222
- label: t("gift.labels.giftMessage")
19479
+ errorId: "pelcro-input-gift-message-error"
19223
19480
  })), /*#__PURE__*/React__default['default'].createElement("p", {
19224
19481
  className: "plc-text-gray-900 pelcro-footnote"
19225
19482
  }, "* ", t("gift.labels.required")), /*#__PURE__*/React__default['default'].createElement(GiftCreateSubmitButton, {
@@ -19271,7 +19528,7 @@ const GiftCreateModal = ({
19271
19528
  };
19272
19529
  GiftCreateModal.viewId = "gift-create";
19273
19530
 
19274
- const initialState$4 = {
19531
+ const initialState$5 = {
19275
19532
  giftCode: "",
19276
19533
  buttonDisabled: true,
19277
19534
  alert: {
@@ -19279,10 +19536,10 @@ const initialState$4 = {
19279
19536
  content: ""
19280
19537
  }
19281
19538
  };
19282
- const store$4 = /*#__PURE__*/React.createContext(initialState$4);
19539
+ const store$5 = /*#__PURE__*/React.createContext(initialState$5);
19283
19540
  const {
19284
- Provider: Provider$4
19285
- } = store$4;
19541
+ Provider: Provider$5
19542
+ } = store$5;
19286
19543
 
19287
19544
  const GiftRedeemContainer = ({
19288
19545
  style,
@@ -19347,21 +19604,21 @@ const GiftRedeemContainer = ({
19347
19604
  default:
19348
19605
  return state;
19349
19606
  }
19350
- }, initialState$4);
19607
+ }, initialState$5);
19351
19608
  return /*#__PURE__*/React__default['default'].createElement("div", {
19352
19609
  style: { ...style
19353
19610
  },
19354
19611
  className: `pelcro-container pelcro-gift-redeem-container ${className}`
19355
- }, /*#__PURE__*/React__default['default'].createElement(Provider$4, {
19612
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$5, {
19356
19613
  value: {
19357
19614
  state,
19358
19615
  dispatch
19359
19616
  }
19360
19617
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
19361
- store: store$4,
19618
+ store: store$5,
19362
19619
  key: i
19363
19620
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
19364
- store: store$4
19621
+ store: store$5
19365
19622
  })));
19366
19623
  };
19367
19624
 
@@ -19398,7 +19655,7 @@ function GiftCode({
19398
19655
  }
19399
19656
 
19400
19657
  const GiftRedeemCode = props => /*#__PURE__*/React__default['default'].createElement(GiftCode, Object.assign({
19401
- store: store$4
19658
+ store: store$5
19402
19659
  }, props));
19403
19660
 
19404
19661
  const GiftRedeemSubmitButton = ({
@@ -19411,7 +19668,7 @@ const GiftRedeemSubmitButton = ({
19411
19668
  state: {
19412
19669
  disableSubmit
19413
19670
  }
19414
- } = React.useContext(store$4);
19671
+ } = React.useContext(store$5);
19415
19672
  const {
19416
19673
  t
19417
19674
  } = useTranslation("register");
@@ -19504,7 +19761,7 @@ const moveDefaultAddressToStart = addresses => {
19504
19761
  return [defaultAddress, ...addressesWithoutDefault];
19505
19762
  };
19506
19763
 
19507
- const initialState$3 = {
19764
+ const initialState$4 = {
19508
19765
  addresses: [],
19509
19766
  selectedAddressId: null,
19510
19767
  isSubmitting: false,
@@ -19513,10 +19770,10 @@ const initialState$3 = {
19513
19770
  content: ""
19514
19771
  }
19515
19772
  };
19516
- const store$3 = /*#__PURE__*/React.createContext(initialState$3);
19773
+ const store$4 = /*#__PURE__*/React.createContext(initialState$4);
19517
19774
  const {
19518
- Provider: Provider$3
19519
- } = store$3;
19775
+ Provider: Provider$4
19776
+ } = store$4;
19520
19777
 
19521
19778
  const AddressSelectContainer = ({
19522
19779
  style,
@@ -19611,7 +19868,7 @@ const AddressSelectContainer = ({
19611
19868
  default:
19612
19869
  return state;
19613
19870
  }
19614
- }, initialState$3);
19871
+ }, initialState$4);
19615
19872
  React.useEffect(() => {
19616
19873
  var _window$Pelcro$user$r;
19617
19874
 
@@ -19624,16 +19881,16 @@ const AddressSelectContainer = ({
19624
19881
  style: { ...style
19625
19882
  },
19626
19883
  className: `pelcro-container pelcro-address-select-container ${className}`
19627
- }, /*#__PURE__*/React__default['default'].createElement(Provider$3, {
19884
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$4, {
19628
19885
  value: {
19629
19886
  state,
19630
19887
  dispatch
19631
19888
  }
19632
19889
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
19633
- store: store$3,
19890
+ store: store$4,
19634
19891
  key: i
19635
19892
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
19636
- store: store$3
19893
+ store: store$4
19637
19894
  })));
19638
19895
  };
19639
19896
 
@@ -19644,7 +19901,7 @@ const AddressSelectList = () => {
19644
19901
  addresses,
19645
19902
  selectedAddressId
19646
19903
  }
19647
- } = React.useContext(store$3);
19904
+ } = React.useContext(store$4);
19648
19905
 
19649
19906
  const handleAddressSelect = event => {
19650
19907
  dispatch({
@@ -19688,7 +19945,7 @@ const AddressSelectSubmit = ({
19688
19945
  selectedAddressId,
19689
19946
  isSubmitting
19690
19947
  }
19691
- } = React.useContext(store$3);
19948
+ } = React.useContext(store$4);
19692
19949
  const {
19693
19950
  t
19694
19951
  } = useTranslation("address");
@@ -19784,7 +20041,7 @@ const moveDefaultPaymentMethodToStart = paymentMethods => {
19784
20041
  return [defaultPaymentMethod, ...paymentMethodsWithoutDefault];
19785
20042
  };
19786
20043
 
19787
- const initialState$2 = {
20044
+ const initialState$3 = {
19788
20045
  paymentMethods: [],
19789
20046
  selectedPaymentMethodId: null,
19790
20047
  isSubmitting: false,
@@ -19793,10 +20050,10 @@ const initialState$2 = {
19793
20050
  content: ""
19794
20051
  }
19795
20052
  };
19796
- const store$2 = /*#__PURE__*/React.createContext(initialState$2);
20053
+ const store$3 = /*#__PURE__*/React.createContext(initialState$3);
19797
20054
  const {
19798
- Provider: Provider$2
19799
- } = store$2;
20055
+ Provider: Provider$3
20056
+ } = store$3;
19800
20057
 
19801
20058
  const PaymentMethodSelectContainer = ({
19802
20059
  style,
@@ -19841,7 +20098,7 @@ const PaymentMethodSelectContainer = ({
19841
20098
  default:
19842
20099
  return state;
19843
20100
  }
19844
- }, initialState$2);
20101
+ }, initialState$3);
19845
20102
  React.useEffect(() => {
19846
20103
  var _window$Pelcro$user$r4;
19847
20104
 
@@ -19854,16 +20111,16 @@ const PaymentMethodSelectContainer = ({
19854
20111
  style: { ...style
19855
20112
  },
19856
20113
  className: `pelcro-container pelcro-payment-select-container ${className}`
19857
- }, /*#__PURE__*/React__default['default'].createElement(Provider$2, {
20114
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$3, {
19858
20115
  value: {
19859
20116
  state,
19860
20117
  dispatch
19861
20118
  }
19862
20119
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
19863
- store: store$2,
20120
+ store: store$3,
19864
20121
  key: i
19865
20122
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
19866
- store: store$2
20123
+ store: store$3
19867
20124
  })));
19868
20125
  };
19869
20126
 
@@ -19877,7 +20134,7 @@ const PaymentMethodSelectList = () => {
19877
20134
  paymentMethods,
19878
20135
  selectedPaymentMethodId
19879
20136
  }
19880
- } = React.useContext(store$2);
20137
+ } = React.useContext(store$3);
19881
20138
 
19882
20139
  const handlePaymentMethodSelect = event => {
19883
20140
  dispatch({
@@ -19927,7 +20184,7 @@ const PaymentMethodSelectSubmit = ({
19927
20184
  selectedPaymentMethodId,
19928
20185
  isSubmitting
19929
20186
  }
19930
- } = React.useContext(store$2);
20187
+ } = React.useContext(store$3);
19931
20188
  return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
19932
20189
  onClick: () => {
19933
20190
  dispatch({
@@ -20001,8 +20258,8 @@ const PaymentMethodSelectModal = ({
20001
20258
  };
20002
20259
  PaymentMethodSelectModal.viewId = "payment-method-select";
20003
20260
 
20004
- function _extends$h() {
20005
- _extends$h = Object.assign || function (target) {
20261
+ function _extends$i() {
20262
+ _extends$i = Object.assign || function (target) {
20006
20263
  for (var i = 1; i < arguments.length; i++) {
20007
20264
  var source = arguments[i];
20008
20265
 
@@ -20016,7 +20273,7 @@ function _extends$h() {
20016
20273
  return target;
20017
20274
  };
20018
20275
 
20019
- return _extends$h.apply(this, arguments);
20276
+ return _extends$i.apply(this, arguments);
20020
20277
  }
20021
20278
 
20022
20279
  function _objectWithoutPropertiesLoose(source, excluded) {
@@ -20200,7 +20457,7 @@ function render(props, propsBag, defaultTag, features, visible) {
20200
20457
  return match(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function () {
20201
20458
  return null;
20202
20459
  }, _match[RenderStrategy.Hidden] = function () {
20203
- return _render(_extends$h({}, _rest, {
20460
+ return _render(_extends$i({}, _rest, {
20204
20461
  hidden: true,
20205
20462
  style: {
20206
20463
  display: 'none'
@@ -20728,7 +20985,7 @@ function TransitionChild(props) {
20728
20985
  var passthroughProps = rest;
20729
20986
  return React__default['default'].createElement(NestingContext.Provider, {
20730
20987
  value: nesting
20731
- }, render(_extends$h({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
20988
+ }, render(_extends$i({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
20732
20989
  }
20733
20990
 
20734
20991
  function Transition(props) {
@@ -20772,7 +21029,7 @@ function Transition(props) {
20772
21029
  value: nestingBag
20773
21030
  }, React__default['default'].createElement(TransitionContext.Provider, {
20774
21031
  value: transitionBag
20775
- }, render(_extends$h({}, sharedProps, {
21032
+ }, render(_extends$i({}, sharedProps, {
20776
21033
  as: React.Fragment,
20777
21034
  children: React__default['default'].createElement(TransitionChild, Object.assign({}, sharedProps, passthroughProps))
20778
21035
  }), propsBag, React.Fragment, TransitionChildRenderFeatures, state === TreeStates.Visible)));
@@ -20899,12 +21156,12 @@ var ActionTypes;
20899
21156
  })(ActionTypes || (ActionTypes = {}));
20900
21157
 
20901
21158
  (_reducers = {}, _reducers[ActionTypes.CloseMenu] = function (state) {
20902
- return _extends$h({}, state, {
21159
+ return _extends$i({}, state, {
20903
21160
  activeItemIndex: null,
20904
21161
  menuState: MenuStates.Closed
20905
21162
  });
20906
21163
  }, _reducers[ActionTypes.OpenMenu] = function (state) {
20907
- return _extends$h({}, state, {
21164
+ return _extends$i({}, state, {
20908
21165
  menuState: MenuStates.Open
20909
21166
  });
20910
21167
  }, _reducers[ActionTypes.GoToItem] = function (state, action) {
@@ -20923,7 +21180,7 @@ var ActionTypes;
20923
21180
  }
20924
21181
  });
20925
21182
  if (state.searchQuery === '' && state.activeItemIndex === activeItemIndex) return state;
20926
- return _extends$h({}, state, {
21183
+ return _extends$i({}, state, {
20927
21184
  searchQuery: '',
20928
21185
  activeItemIndex: activeItemIndex
20929
21186
  });
@@ -20934,19 +21191,19 @@ var ActionTypes;
20934
21191
 
20935
21192
  return ((_item$dataRef$current = item.dataRef.current.textValue) == null ? void 0 : _item$dataRef$current.startsWith(searchQuery)) && !item.dataRef.current.disabled;
20936
21193
  });
20937
- if (match === -1 || match === state.activeItemIndex) return _extends$h({}, state, {
21194
+ if (match === -1 || match === state.activeItemIndex) return _extends$i({}, state, {
20938
21195
  searchQuery: searchQuery
20939
21196
  });
20940
- return _extends$h({}, state, {
21197
+ return _extends$i({}, state, {
20941
21198
  searchQuery: searchQuery,
20942
21199
  activeItemIndex: match
20943
21200
  });
20944
21201
  }, _reducers[ActionTypes.ClearSearch] = function (state) {
20945
- return _extends$h({}, state, {
21202
+ return _extends$i({}, state, {
20946
21203
  searchQuery: ''
20947
21204
  });
20948
21205
  }, _reducers[ActionTypes.RegisterItem] = function (state, action) {
20949
- return _extends$h({}, state, {
21206
+ return _extends$i({}, state, {
20950
21207
  items: [].concat(state.items, [{
20951
21208
  id: action.id,
20952
21209
  dataRef: action.dataRef
@@ -20959,7 +21216,7 @@ var ActionTypes;
20959
21216
  return a.id === action.id;
20960
21217
  });
20961
21218
  if (idx !== -1) nextItems.splice(idx, 1);
20962
- return _extends$h({}, state, {
21219
+ return _extends$i({}, state, {
20963
21220
  items: nextItems,
20964
21221
  activeItemIndex: function () {
20965
21222
  if (idx === state.activeItemIndex) return null;
@@ -20998,19 +21255,19 @@ var ActionTypes$1;
20998
21255
  (_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = function (state) {
20999
21256
  if (state.disabled) return state;
21000
21257
  if (state.listboxState === ListboxStates.Closed) return state;
21001
- return _extends$h({}, state, {
21258
+ return _extends$i({}, state, {
21002
21259
  activeOptionIndex: null,
21003
21260
  listboxState: ListboxStates.Closed
21004
21261
  });
21005
21262
  }, _reducers$1[ActionTypes$1.OpenListbox] = function (state) {
21006
21263
  if (state.disabled) return state;
21007
21264
  if (state.listboxState === ListboxStates.Open) return state;
21008
- return _extends$h({}, state, {
21265
+ return _extends$i({}, state, {
21009
21266
  listboxState: ListboxStates.Open
21010
21267
  });
21011
21268
  }, _reducers$1[ActionTypes$1.SetDisabled] = function (state, action) {
21012
21269
  if (state.disabled === action.disabled) return state;
21013
- return _extends$h({}, state, {
21270
+ return _extends$i({}, state, {
21014
21271
  disabled: action.disabled
21015
21272
  });
21016
21273
  }, _reducers$1[ActionTypes$1.GoToOption] = function (state, action) {
@@ -21031,7 +21288,7 @@ var ActionTypes$1;
21031
21288
  }
21032
21289
  });
21033
21290
  if (state.searchQuery === '' && state.activeOptionIndex === activeOptionIndex) return state;
21034
- return _extends$h({}, state, {
21291
+ return _extends$i({}, state, {
21035
21292
  searchQuery: '',
21036
21293
  activeOptionIndex: activeOptionIndex
21037
21294
  });
@@ -21044,10 +21301,10 @@ var ActionTypes$1;
21044
21301
 
21045
21302
  return !option.dataRef.current.disabled && ((_option$dataRef$curre = option.dataRef.current.textValue) == null ? void 0 : _option$dataRef$curre.startsWith(searchQuery));
21046
21303
  });
21047
- if (match === -1 || match === state.activeOptionIndex) return _extends$h({}, state, {
21304
+ if (match === -1 || match === state.activeOptionIndex) return _extends$i({}, state, {
21048
21305
  searchQuery: searchQuery
21049
21306
  });
21050
- return _extends$h({}, state, {
21307
+ return _extends$i({}, state, {
21051
21308
  searchQuery: searchQuery,
21052
21309
  activeOptionIndex: match
21053
21310
  });
@@ -21055,11 +21312,11 @@ var ActionTypes$1;
21055
21312
  if (state.disabled) return state;
21056
21313
  if (state.listboxState === ListboxStates.Closed) return state;
21057
21314
  if (state.searchQuery === '') return state;
21058
- return _extends$h({}, state, {
21315
+ return _extends$i({}, state, {
21059
21316
  searchQuery: ''
21060
21317
  });
21061
21318
  }, _reducers$1[ActionTypes$1.RegisterOption] = function (state, action) {
21062
- return _extends$h({}, state, {
21319
+ return _extends$i({}, state, {
21063
21320
  options: [].concat(state.options, [{
21064
21321
  id: action.id,
21065
21322
  dataRef: action.dataRef
@@ -21072,7 +21329,7 @@ var ActionTypes$1;
21072
21329
  return a.id === action.id;
21073
21330
  });
21074
21331
  if (idx !== -1) nextOptions.splice(idx, 1);
21075
- return _extends$h({}, state, {
21332
+ return _extends$i({}, state, {
21076
21333
  options: nextOptions,
21077
21334
  activeOptionIndex: function () {
21078
21335
  if (idx === state.activeOptionIndex) return null;
@@ -21133,18 +21390,18 @@ const getPaymentCardIcon = name => {
21133
21390
  }));
21134
21391
  };
21135
21392
 
21136
- var _path$f;
21393
+ var _path$g;
21137
21394
 
21138
- 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); }
21395
+ 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); }
21139
21396
 
21140
21397
  function SvgChevronRight(props) {
21141
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
21398
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
21142
21399
  className: "plc-w-6 plc-h-6",
21143
21400
  xmlns: "http://www.w3.org/2000/svg",
21144
21401
  fill: "none",
21145
21402
  viewBox: "0 0 24 24",
21146
21403
  stroke: "currentColor"
21147
- }, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
21404
+ }, props), _path$g || (_path$g = /*#__PURE__*/React__namespace.createElement("path", {
21148
21405
  strokeLinecap: "round",
21149
21406
  strokeLinejoin: "round",
21150
21407
  strokeWidth: 2,
@@ -21360,18 +21617,18 @@ const SavedItems = ({
21360
21617
  });
21361
21618
  };
21362
21619
 
21363
- var _path$e;
21620
+ var _path$f;
21364
21621
 
21365
- 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); }
21622
+ 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); }
21366
21623
 
21367
21624
  function SvgRefresh(props) {
21368
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
21625
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
21369
21626
  className: "plc-w-4 plc-h-4 plc-mr-1",
21370
21627
  xmlns: "http://www.w3.org/2000/svg",
21371
21628
  fill: "none",
21372
21629
  viewBox: "0 0 24 24",
21373
21630
  stroke: "currentColor"
21374
- }, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
21631
+ }, props), _path$f || (_path$f = /*#__PURE__*/React__namespace.createElement("path", {
21375
21632
  strokeLinecap: "round",
21376
21633
  strokeLinejoin: "round",
21377
21634
  strokeWidth: 2,
@@ -21379,35 +21636,35 @@ function SvgRefresh(props) {
21379
21636
  })));
21380
21637
  }
21381
21638
 
21382
- var _path$d;
21639
+ var _path$e;
21383
21640
 
21384
- 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); }
21641
+ 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); }
21385
21642
 
21386
21643
  function SvgCalendar(props) {
21387
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
21644
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
21388
21645
  xmlns: "http://www.w3.org/2000/svg",
21389
21646
  className: "plc-h-4 plc-w-4 plc-mr-1",
21390
21647
  viewBox: "0 0 20 20",
21391
21648
  fill: "currentColor"
21392
- }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
21649
+ }, props), _path$e || (_path$e = /*#__PURE__*/React__namespace.createElement("path", {
21393
21650
  fillRule: "evenodd",
21394
21651
  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",
21395
21652
  clipRule: "evenodd"
21396
21653
  })));
21397
21654
  }
21398
21655
 
21399
- var _path$c;
21656
+ var _path$d;
21400
21657
 
21401
- 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); }
21658
+ 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); }
21402
21659
 
21403
21660
  function SvgPlus(props) {
21404
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
21661
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
21405
21662
  className: "plc-w-5 plc-h-5",
21406
21663
  xmlns: "http://www.w3.org/2000/svg",
21407
21664
  fill: "none",
21408
21665
  viewBox: "0 0 24 24",
21409
21666
  stroke: "currentColor"
21410
- }, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
21667
+ }, props), _path$d || (_path$d = /*#__PURE__*/React__namespace.createElement("path", {
21411
21668
  strokeLinecap: "round",
21412
21669
  strokeLinejoin: "round",
21413
21670
  strokeWidth: 2,
@@ -21415,17 +21672,17 @@ function SvgPlus(props) {
21415
21672
  })));
21416
21673
  }
21417
21674
 
21418
- var _path$b;
21675
+ var _path$c;
21419
21676
 
21420
- 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); }
21677
+ 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); }
21421
21678
 
21422
21679
  function SvgCheckMark(props) {
21423
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
21680
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
21424
21681
  className: "plc-w-4 plc-h-4 plc-mr-1",
21425
21682
  xmlns: "http://www.w3.org/2000/svg",
21426
21683
  viewBox: "0 0 20 20",
21427
21684
  fill: "currentColor"
21428
- }, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
21685
+ }, props), _path$c || (_path$c = /*#__PURE__*/React__namespace.createElement("path", {
21429
21686
  fillRule: "evenodd",
21430
21687
  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",
21431
21688
  clipRule: "evenodd"
@@ -21720,18 +21977,18 @@ Accordion.item = function AccordionItem({
21720
21977
  }, content)) : null;
21721
21978
  };
21722
21979
 
21723
- var _path$a;
21980
+ var _path$b;
21724
21981
 
21725
- 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); }
21982
+ 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); }
21726
21983
 
21727
21984
  function SvgExit(props) {
21728
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
21985
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
21729
21986
  className: "plc-w-6 plc-h-6",
21730
21987
  xmlns: "http://www.w3.org/2000/svg",
21731
21988
  fill: "none",
21732
21989
  viewBox: "0 0 24 24",
21733
21990
  stroke: "currentColor"
21734
- }, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
21991
+ }, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
21735
21992
  strokeLinecap: "round",
21736
21993
  strokeLinejoin: "round",
21737
21994
  strokeWidth: 2,
@@ -21739,13 +21996,32 @@ function SvgExit(props) {
21739
21996
  })));
21740
21997
  }
21741
21998
 
21999
+ var _path$a;
22000
+
22001
+ 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); }
22002
+
22003
+ function SvgUser(props) {
22004
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
22005
+ xmlns: "http://www.w3.org/2000/svg",
22006
+ fill: "none",
22007
+ viewBox: "0 0 24 24",
22008
+ stroke: "currentColor"
22009
+ }, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
22010
+ strokeLinecap: "round",
22011
+ strokeLinejoin: "round",
22012
+ strokeWidth: 2,
22013
+ 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"
22014
+ })));
22015
+ }
22016
+
21742
22017
  var _path$9;
21743
22018
 
21744
22019
  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); }
21745
22020
 
21746
- function SvgUser(props) {
22021
+ function SvgNewsletter(props) {
21747
22022
  return /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
21748
22023
  xmlns: "http://www.w3.org/2000/svg",
22024
+ className: "plc-h-5 plc-w-5",
21749
22025
  fill: "none",
21750
22026
  viewBox: "0 0 24 24",
21751
22027
  stroke: "currentColor"
@@ -21753,7 +22029,7 @@ function SvgUser(props) {
21753
22029
  strokeLinecap: "round",
21754
22030
  strokeLinejoin: "round",
21755
22031
  strokeWidth: 2,
21756
- 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"
22032
+ 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"
21757
22033
  })));
21758
22034
  }
21759
22035
 
@@ -21761,10 +22037,10 @@ var _path$8;
21761
22037
 
21762
22038
  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); }
21763
22039
 
21764
- function SvgNewsletter(props) {
22040
+ function SvgDocument(props) {
21765
22041
  return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
21766
22042
  xmlns: "http://www.w3.org/2000/svg",
21767
- className: "plc-h-5 plc-w-5",
22043
+ className: "plc-h-6 plc-w-6 plc-mr-2",
21768
22044
  fill: "none",
21769
22045
  viewBox: "0 0 24 24",
21770
22046
  stroke: "currentColor"
@@ -21772,7 +22048,7 @@ function SvgNewsletter(props) {
21772
22048
  strokeLinecap: "round",
21773
22049
  strokeLinejoin: "round",
21774
22050
  strokeWidth: 2,
21775
- 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"
22051
+ 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"
21776
22052
  })));
21777
22053
  }
21778
22054
 
@@ -21940,9 +22216,11 @@ const DonationsMenu = () => {
21940
22216
  };
21941
22217
 
21942
22218
  function getDonationSubs() {
21943
- var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3;
22219
+ var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3, _window$Pelcro$user$r, _window$Pelcro$user$r2;
21944
22220
 
21945
- return (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : (_window$Pelcro$subscr3 = _window$Pelcro$subscr2.list()) === null || _window$Pelcro$subscr3 === void 0 ? void 0 : _window$Pelcro$subscr3.filter(sub => sub.plan.is_donation)) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
22221
+ const donations = (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : (_window$Pelcro$subscr3 = _window$Pelcro$subscr2.list()) === null || _window$Pelcro$subscr3 === void 0 ? void 0 : _window$Pelcro$subscr3.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
22222
+ const canceledDonations = (_window$Pelcro$user$r = (_window$Pelcro$user$r2 = window.Pelcro.user.read().expired_subscriptions) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : [];
22223
+ return [...donations, ...canceledDonations];
21946
22224
  }
21947
22225
 
21948
22226
  function formatStartDate(date) {
@@ -21950,6 +22228,138 @@ function formatStartDate(date) {
21950
22228
  return new Intl.DateTimeFormat("en-CA").format(startDate);
21951
22229
  }
21952
22230
 
22231
+ const InvoicesMenu = props => {
22232
+ const {
22233
+ t
22234
+ } = useTranslation("dashboard");
22235
+ return /*#__PURE__*/React__default['default'].createElement("table", {
22236
+ className: "plc-w-full plc-table-fixed"
22237
+ }, /*#__PURE__*/React__default['default'].createElement("thead", {
22238
+ className: "plc-text-xs plc-font-semibold plc-tracking-wider plc-text-gray-400 plc-uppercase "
22239
+ }, /*#__PURE__*/React__default['default'].createElement("tr", null, /*#__PURE__*/React__default['default'].createElement("th", {
22240
+ className: "plc-w-4/12 "
22241
+ }, t("labels.details")), /*#__PURE__*/React__default['default'].createElement("th", {
22242
+ className: "plc-w-4/12 "
22243
+ }, t("labels.status.title")), /*#__PURE__*/React__default['default'].createElement("th", {
22244
+ className: "plc-w-3/12 "
22245
+ }, t("labels.actions")))), /*#__PURE__*/React__default['default'].createElement("tbody", null, /*#__PURE__*/React__default['default'].createElement("tr", {
22246
+ className: "plc-h-4"
22247
+ }), /*#__PURE__*/React__default['default'].createElement(InvoicesItems, props)));
22248
+ };
22249
+
22250
+ const InvoicesItems = () => {
22251
+ var _window$Pelcro$invoic, _window$Pelcro$invoic2;
22252
+
22253
+ const {
22254
+ t
22255
+ } = useTranslation("dashboard");
22256
+ const {
22257
+ setInvoice,
22258
+ switchView
22259
+ } = usePelcro();
22260
+ const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
22261
+
22262
+ const showInvoiceDetails = event => {
22263
+ if (setInvoice(event.target.dataset.id)) {
22264
+ switchView("invoice-details");
22265
+ }
22266
+ };
22267
+
22268
+ if (invoices.length === 0) return null;
22269
+ return invoices.sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime()).map(invoice => {
22270
+ const invoiceStatus = getInvoiceStatus(invoice);
22271
+ const formattedCreationDate = new Intl.DateTimeFormat("en-CA").format(new Date(invoice.created_at));
22272
+ return /*#__PURE__*/React__default['default'].createElement("tr", {
22273
+ key: invoice.id,
22274
+ className: `plc-w-full plc-align-middle plc-cursor-pointer accordion-header hover:plc-bg-gray-50`
22275
+ }, /*#__PURE__*/React__default['default'].createElement("td", {
22276
+ className: "plc-truncate"
22277
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
22278
+ className: "plc-font-semibold plc-text-gray-500"
22279
+ }, `#${invoice.id}`), /*#__PURE__*/React__default['default'].createElement("br", null), /*#__PURE__*/React__default['default'].createElement("span", {
22280
+ className: "plc-text-sm plc-text-gray-500"
22281
+ }, getFormattedPriceByLocal(invoice.total, invoice.currency, getPageOrDefaultLanguage())), /*#__PURE__*/React__default['default'].createElement("br", null), /*#__PURE__*/React__default['default'].createElement("span", {
22282
+ className: "plc-text-sm plc-text-gray-500"
22283
+ }, formattedCreationDate)), /*#__PURE__*/React__default['default'].createElement("td", {
22284
+ className: "plc-py-2"
22285
+ }, /*#__PURE__*/React__default['default'].createElement("span", {
22286
+ className: `plc-inline-flex plc-p-1 plc-text-xs plc-font-semibold ${invoiceStatus.bgColor} plc-uppercase ${invoiceStatus.textColor} plc-rounded-lg`
22287
+ }, invoiceStatus.icon, invoiceStatus.title)), /*#__PURE__*/React__default['default'].createElement("td", null, /*#__PURE__*/React__default['default'].createElement(Button, {
22288
+ variant: "ghost",
22289
+ className: "plc-text-blue-400 focus:plc-ring-blue-400 pelcro-dashboard-view-invoice-button",
22290
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgDocument, {
22291
+ className: "plc-w-4 plc-h-4"
22292
+ }),
22293
+ onClick: showInvoiceDetails,
22294
+ "data-id": invoice.id
22295
+ }, t("labels.view"))));
22296
+ });
22297
+ };
22298
+
22299
+ function getInvoiceStatus(invoice) {
22300
+ const translations = i18next.t("dashboard:labels", {
22301
+ returnObjects: true
22302
+ });
22303
+
22304
+ switch (invoice.status) {
22305
+ case "paid":
22306
+ return {
22307
+ textColor: "plc-text-green-700",
22308
+ bgColor: "plc-bg-green-100",
22309
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgCheckMark, null),
22310
+ title: translations.paid
22311
+ };
22312
+
22313
+ case "past_due":
22314
+ return {
22315
+ textColor: "plc-text-orange-700",
22316
+ bgColor: "plc-bg-orange-100",
22317
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgExclamation, null),
22318
+ title: translations.pastDue
22319
+ };
22320
+
22321
+ case "open":
22322
+ return {
22323
+ textColor: "plc-text-yellow-700",
22324
+ bgColor: "plc-bg-yellow-100",
22325
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgExclamation, null),
22326
+ title: translations.open
22327
+ };
22328
+
22329
+ case "draft":
22330
+ return {
22331
+ textColor: "plc-text-blue-700",
22332
+ bgColor: "plc-bg-blue-100",
22333
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgEdit, null),
22334
+ title: translations.draft
22335
+ };
22336
+
22337
+ case "scheduled":
22338
+ return {
22339
+ textColor: "plc-text-blue-700",
22340
+ bgColor: "plc-bg-blue-100",
22341
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgCalendar, null),
22342
+ title: translations.scheduled
22343
+ };
22344
+
22345
+ case "uncollectible":
22346
+ return {
22347
+ textColor: "plc-text-red-700",
22348
+ bgColor: "plc-bg-red-100",
22349
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgXIconSolid, null),
22350
+ title: translations.uncollectible
22351
+ };
22352
+
22353
+ case "void":
22354
+ return {
22355
+ textColor: "plc-text-gray-700",
22356
+ bgColor: "plc-bg-gray-100",
22357
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgXIconSolid, null),
22358
+ title: translations.void
22359
+ };
22360
+ }
22361
+ }
22362
+
21953
22363
  const SUB_MENUS = {
21954
22364
  PROFILE: "profile",
21955
22365
  SUBSCRIPTIONS: "subscriptions",
@@ -21958,6 +22368,7 @@ const SUB_MENUS = {
21958
22368
  ADDRESSES: "addresses",
21959
22369
  GIFTS: "gifts",
21960
22370
  ORDERS: "orders",
22371
+ INVOICES: "invoices",
21961
22372
  SAVED_ITEMS: "saved-items"
21962
22373
  };
21963
22374
  /**
@@ -22500,6 +22911,12 @@ class Dashboard extends React.Component {
22500
22911
  icon: /*#__PURE__*/React__default['default'].createElement(SvgShopping, null),
22501
22912
  title: this.locale("labels.orders.label"),
22502
22913
  content: /*#__PURE__*/React__default['default'].createElement(OrdersMenu, null)
22914
+ }), /*#__PURE__*/React__default['default'].createElement(Accordion.item, {
22915
+ show: hasInvoices(),
22916
+ name: SUB_MENUS.INVOICES,
22917
+ icon: /*#__PURE__*/React__default['default'].createElement(SvgDocument, null),
22918
+ title: this.locale("labels.invoices"),
22919
+ content: /*#__PURE__*/React__default['default'].createElement(InvoicesMenu, null)
22503
22920
  }), /*#__PURE__*/React__default['default'].createElement(Accordion.item, {
22504
22921
  name: SUB_MENUS.SAVED_ITEMS,
22505
22922
  icon: /*#__PURE__*/React__default['default'].createElement(SvgBookmark, null),
@@ -22515,11 +22932,19 @@ class Dashboard extends React.Component {
22515
22932
 
22516
22933
  }
22517
22934
 
22935
+ function hasInvoices() {
22936
+ var _window$Pelcro$invoic, _window$Pelcro$invoic2;
22937
+
22938
+ const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
22939
+ return invoices.length > 0;
22940
+ }
22941
+
22518
22942
  function hasDonationSubs() {
22519
- var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3;
22943
+ var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
22520
22944
 
22521
- const donations = (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : (_window$Pelcro$subscr3 = _window$Pelcro$subscr2.list()) === null || _window$Pelcro$subscr3 === void 0 ? void 0 : _window$Pelcro$subscr3.filter(sub => sub.plan.is_donation)) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
22522
- return donations.length > 0;
22945
+ const donations = (_window$Pelcro$subscr = (_window$Pelcro$subscr2 = window.Pelcro.subscription) === null || _window$Pelcro$subscr2 === void 0 ? void 0 : (_window$Pelcro$subscr3 = _window$Pelcro$subscr2.list()) === null || _window$Pelcro$subscr3 === void 0 ? void 0 : _window$Pelcro$subscr3.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$subscr !== void 0 ? _window$Pelcro$subscr : [];
22946
+ const canceledDonations = (_window$Pelcro$user$r4 = (_window$Pelcro$user$r5 = window.Pelcro.user.read().expired_subscriptions) === null || _window$Pelcro$user$r5 === void 0 ? void 0 : _window$Pelcro$user$r5.filter(sub => sub.plan.is_donation && !sub.is_gift_donor)) !== null && _window$Pelcro$user$r4 !== void 0 ? _window$Pelcro$user$r4 : [];
22947
+ return donations.length > 0 || canceledDonations.length > 0;
22523
22948
  }
22524
22949
 
22525
22950
  const DashboardWithTrans = withTranslation("dashboard")(Dashboard);
@@ -22549,7 +22974,7 @@ const DashboardOpenButton = () => {
22549
22974
  };
22550
22975
  DashboardOpenButton.viewId = "dashboard-open";
22551
22976
 
22552
- const initialState$1 = {
22977
+ const initialState$2 = {
22553
22978
  imageSrc: null,
22554
22979
  crop: {
22555
22980
  x: 0,
@@ -22563,10 +22988,10 @@ const initialState$1 = {
22563
22988
  content: ""
22564
22989
  }
22565
22990
  };
22566
- const store$1 = /*#__PURE__*/React.createContext(initialState$1);
22991
+ const store$2 = /*#__PURE__*/React.createContext(initialState$2);
22567
22992
  const {
22568
- Provider: Provider$1
22569
- } = store$1;
22993
+ Provider: Provider$2
22994
+ } = store$2;
22570
22995
 
22571
22996
  const ProfilePicChangeContainer = ({
22572
22997
  style,
@@ -22700,21 +23125,21 @@ const ProfilePicChangeContainer = ({
22700
23125
  default:
22701
23126
  return state;
22702
23127
  }
22703
- }, initialState$1);
23128
+ }, initialState$2);
22704
23129
  return /*#__PURE__*/React__default['default'].createElement("div", {
22705
23130
  style: { ...style
22706
23131
  },
22707
23132
  className: `pelcro-container pelcro-profile-picture-container ${className}`
22708
- }, /*#__PURE__*/React__default['default'].createElement(Provider$1, {
23133
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$2, {
22709
23134
  value: {
22710
23135
  state,
22711
23136
  dispatch
22712
23137
  }
22713
23138
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
22714
- store: store$1,
23139
+ store: store$2,
22715
23140
  key: i
22716
23141
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
22717
- store: store$1
23142
+ store: store$2
22718
23143
  })));
22719
23144
  };
22720
23145
  /**
@@ -22776,7 +23201,7 @@ const ProfilePicChangeButton = ({
22776
23201
  isSubmitting
22777
23202
  },
22778
23203
  dispatch
22779
- } = React.useContext(store$1);
23204
+ } = React.useContext(store$2);
22780
23205
  const {
22781
23206
  t
22782
23207
  } = useTranslation("userEdit");
@@ -24144,7 +24569,7 @@ const ProfilePicChangeCropper = ({
24144
24569
  zoom
24145
24570
  },
24146
24571
  dispatch
24147
- } = React.useContext(store$1);
24572
+ } = React.useContext(store$2);
24148
24573
  return /*#__PURE__*/React__default['default'].createElement("div", {
24149
24574
  className: `plc-relative plc-w-full plc-h-52 sm:plc-h-96 ${className}`
24150
24575
  }, /*#__PURE__*/React__default['default'].createElement(Cropper, Object.assign({
@@ -24186,7 +24611,7 @@ const ProfilePicChangeZoom = ({
24186
24611
  zoom
24187
24612
  },
24188
24613
  dispatch
24189
- } = React.useContext(store$1);
24614
+ } = React.useContext(store$2);
24190
24615
  const {
24191
24616
  t
24192
24617
  } = useTranslation("userEdit");
@@ -24238,7 +24663,7 @@ const ProfilePicChangeSelectButton = ({
24238
24663
  state: {
24239
24664
  isSubmitting
24240
24665
  }
24241
- } = React.useContext(store$1);
24666
+ } = React.useContext(store$2);
24242
24667
  const {
24243
24668
  t
24244
24669
  } = useTranslation("userEdit");
@@ -24280,7 +24705,7 @@ const ProfilePicChangeRemoveButton = ({
24280
24705
  state: {
24281
24706
  isSubmitting
24282
24707
  }
24283
- } = React.useContext(store$1);
24708
+ } = React.useContext(store$2);
24284
24709
  const {
24285
24710
  t
24286
24711
  } = useTranslation("userEdit");
@@ -24303,7 +24728,7 @@ const ProfilePicChangeWrapper = () => {
24303
24728
  state: {
24304
24729
  imageSrc
24305
24730
  }
24306
- } = React.useContext(store$1);
24731
+ } = React.useContext(store$2);
24307
24732
  const {
24308
24733
  t
24309
24734
  } = useTranslation("userEdit");
@@ -24365,17 +24790,17 @@ function ProfilePicChangeModal({
24365
24790
  }
24366
24791
  ProfilePicChangeModal.viewId = "profile-picture";
24367
24792
 
24368
- const initialState = {
24793
+ const initialState$1 = {
24369
24794
  isSubmitting: false,
24370
24795
  alert: {
24371
24796
  type: "error",
24372
24797
  content: ""
24373
24798
  }
24374
24799
  };
24375
- const store = /*#__PURE__*/React.createContext(initialState);
24800
+ const store$1 = /*#__PURE__*/React.createContext(initialState$1);
24376
24801
  const {
24377
- Provider
24378
- } = store;
24802
+ Provider: Provider$1
24803
+ } = store$1;
24379
24804
 
24380
24805
  const EmailVerifyContainer = ({
24381
24806
  style,
@@ -24438,21 +24863,21 @@ const EmailVerifyContainer = ({
24438
24863
  default:
24439
24864
  return state;
24440
24865
  }
24441
- }, initialState);
24866
+ }, initialState$1);
24442
24867
  return /*#__PURE__*/React__default['default'].createElement("div", {
24443
24868
  style: { ...style
24444
24869
  },
24445
24870
  className: `pelcro-container pelcro-email-verify-container ${className}`
24446
- }, /*#__PURE__*/React__default['default'].createElement(Provider, {
24871
+ }, /*#__PURE__*/React__default['default'].createElement(Provider$1, {
24447
24872
  value: {
24448
24873
  state,
24449
24874
  dispatch
24450
24875
  }
24451
24876
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
24452
- store,
24877
+ store: store$1,
24453
24878
  key: i
24454
24879
  })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
24455
- store
24880
+ store: store$1
24456
24881
  })));
24457
24882
  };
24458
24883
 
@@ -24466,7 +24891,7 @@ const EmailVerifyResendButton = ({
24466
24891
  state: {
24467
24892
  isSubmitting
24468
24893
  }
24469
- } = React.useContext(store);
24894
+ } = React.useContext(store$1);
24470
24895
  const {
24471
24896
  t
24472
24897
  } = useTranslation("verifyEmail");
@@ -24541,6 +24966,235 @@ const EmailVerifyModal = ({
24541
24966
  };
24542
24967
  EmailVerifyModal.viewId = "email-verify";
24543
24968
 
24969
+ const InvoicePaymentContainer = props => /*#__PURE__*/React__default['default'].createElement(PaymentMethodContainer, Object.assign({
24970
+ type: "invoicePayment",
24971
+ className: "pelcro-invoice-payment-container"
24972
+ }, props));
24973
+
24974
+ const InvoicePaymentView = props => {
24975
+ const {
24976
+ t
24977
+ } = useTranslation("payment");
24978
+ return /*#__PURE__*/React__default['default'].createElement("div", {
24979
+ id: "pelcro-invoice-payment-view"
24980
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
24981
+ className: "plc-mb-6 plc-text-2xl plc-font-semibold plc-text-center plc-text-gray-900 pelcro-title-wrapper"
24982
+ }, /*#__PURE__*/React__default['default'].createElement("h4", null, t("labels.checkout.title"))), /*#__PURE__*/React__default['default'].createElement("form", {
24983
+ action: "javascript:void(0);",
24984
+ className: "plc-mt-2 pelcro-form"
24985
+ }, /*#__PURE__*/React__default['default'].createElement(PaymentMethodView, Object.assign({
24986
+ type: "invoicePayment",
24987
+ showCoupon: false,
24988
+ showExternalPaymentMethods: true
24989
+ }, props))));
24990
+ };
24991
+
24992
+ const InvoicePaymentModal = ({
24993
+ onDisplay,
24994
+ onClose,
24995
+ ...otherProps
24996
+ }) => {
24997
+ const {
24998
+ switchView
24999
+ } = usePelcro();
25000
+
25001
+ const onSuccess = () => {
25002
+ var _otherProps$onSuccess;
25003
+
25004
+ (_otherProps$onSuccess = otherProps.onSuccess) === null || _otherProps$onSuccess === void 0 ? void 0 : _otherProps$onSuccess.call(otherProps);
25005
+ return switchView("subscription-success");
25006
+ };
25007
+
25008
+ return /*#__PURE__*/React__default['default'].createElement(Modal, {
25009
+ id: "pelcro-invoice-payment-modal",
25010
+ onDisplay: onDisplay,
25011
+ onClose: onClose
25012
+ }, /*#__PURE__*/React__default['default'].createElement(ModalBody, null, /*#__PURE__*/React__default['default'].createElement(InvoicePaymentView, Object.assign({}, otherProps, {
25013
+ onSuccess: onSuccess
25014
+ }))), /*#__PURE__*/React__default['default'].createElement(ModalFooter, null, /*#__PURE__*/React__default['default'].createElement(Authorship, null)));
25015
+ };
25016
+ InvoicePaymentModal.viewId = "invoice-payment";
25017
+
25018
+ const invoicePaymentSubmitButton = props => {
25019
+ return /*#__PURE__*/React__default['default'].createElement(SubmitPaymentMethod, props);
25020
+ };
25021
+
25022
+ const initialState = {};
25023
+ const store = /*#__PURE__*/React.createContext(initialState);
25024
+ const {
25025
+ Provider
25026
+ } = store;
25027
+
25028
+ const InvoiceDetailsContainer = ({
25029
+ style,
25030
+ className = "",
25031
+ onSuccess = () => {},
25032
+ children,
25033
+ ...props
25034
+ }) => {
25035
+ const onPayButtonClick = () => {
25036
+ return onSuccess();
25037
+ };
25038
+
25039
+ const [state, dispatch] = useReducerWithSideEffects((state, action) => {
25040
+ switch (action.type) {
25041
+ case HANDLE_SUBMIT:
25042
+ return lib_4((state, dispatch) => onPayButtonClick());
25043
+
25044
+ default:
25045
+ return state;
25046
+ }
25047
+ }, initialState);
25048
+ return /*#__PURE__*/React__default['default'].createElement("div", {
25049
+ style: { ...style
25050
+ },
25051
+ className: `pelcro-container pelcro-invoice-details-container ${className}`
25052
+ }, /*#__PURE__*/React__default['default'].createElement(Provider, {
25053
+ value: {
25054
+ state,
25055
+ dispatch
25056
+ }
25057
+ }, children.length ? children.map((child, i) => /*#__PURE__*/React__default['default'].cloneElement(child, {
25058
+ store,
25059
+ key: i
25060
+ })) : /*#__PURE__*/React__default['default'].cloneElement(children, {
25061
+ store
25062
+ })));
25063
+ };
25064
+
25065
+ const InvoiceDetailsDownloadButton = ({
25066
+ name,
25067
+ url,
25068
+ className,
25069
+ ...otherProps
25070
+ }) => {
25071
+ const {
25072
+ t
25073
+ } = useTranslation("invoiceDetails");
25074
+ const {
25075
+ invoice
25076
+ } = usePelcro();
25077
+ return /*#__PURE__*/React__default['default'].createElement(Link, Object.assign({
25078
+ 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}`,
25079
+ id: "pelcro-download-invoice-link",
25080
+ href: url !== null && url !== void 0 ? url : invoice === null || invoice === void 0 ? void 0 : invoice.invoice_pdf,
25081
+ target: "_blank",
25082
+ rel: "noopener noreferrer"
25083
+ }, otherProps), name !== null && name !== void 0 ? name : t("buttons.download"));
25084
+ };
25085
+
25086
+ const InvoiceDetailsPayButton = ({
25087
+ name,
25088
+ onClick,
25089
+ ...otherProps
25090
+ }) => {
25091
+ const {
25092
+ dispatch
25093
+ } = React.useContext(store);
25094
+ const {
25095
+ t
25096
+ } = useTranslation("invoiceDetails");
25097
+ return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
25098
+ onClick: () => {
25099
+ dispatch({
25100
+ type: HANDLE_SUBMIT
25101
+ });
25102
+ onClick === null || onClick === void 0 ? void 0 : onClick();
25103
+ }
25104
+ }, otherProps), name !== null && name !== void 0 ? name : t("buttons.pay"));
25105
+ };
25106
+
25107
+ const InvoiceDetailsView = props => {
25108
+ const {
25109
+ t
25110
+ } = useTranslation("invoiceDetails");
25111
+ const {
25112
+ invoice
25113
+ } = usePelcro();
25114
+ const showPayButton = canPayInvoice(invoice);
25115
+ const creationDate = new Date(invoice === null || invoice === void 0 ? void 0 : invoice.created_at);
25116
+ const formattedCreationDate = new Intl.DateTimeFormat("en-CA").format(creationDate);
25117
+ return /*#__PURE__*/React__default['default'].createElement("div", {
25118
+ id: "pelcro-invoice-details-view"
25119
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
25120
+ className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
25121
+ }, /*#__PURE__*/React__default['default'].createElement("h4", {
25122
+ className: "plc-text-2xl plc-font-semibold"
25123
+ }, t("title"))), /*#__PURE__*/React__default['default'].createElement("form", {
25124
+ action: "javascript:void(0);",
25125
+ className: "plc-mt-2 pelcro-form"
25126
+ }, /*#__PURE__*/React__default['default'].createElement(InvoiceDetailsContainer, props, /*#__PURE__*/React__default['default'].createElement("div", {
25127
+ className: "plc-mt-5 pelcro-invoice-summary-wrapper"
25128
+ }, /*#__PURE__*/React__default['default'].createElement("p", {
25129
+ className: "plc-font-bold pelcro-invoice-summary-title"
25130
+ }, t("labels.summary")), invoice && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("p", {
25131
+ className: "plc-mr-2 pelcro-invoice-creation-date"
25132
+ }, `${t("labels.creationDate")} ${formattedCreationDate}`), /*#__PURE__*/React__default['default'].createElement("div", {
25133
+ className: "plc-flex plc-items-center plc-pt-2 plc-mt-2 plc-border-t plc-border-gray-400 plc-min-h-12 plc-justify-between pelcro-invoice-plan-wrapper"
25134
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
25135
+ className: "plc-break-words pelcro-invoice-plan-name"
25136
+ }, invoice.plan.nickname), /*#__PURE__*/React__default['default'].createElement("div", {
25137
+ className: "plc-text-center pelcro-invoice-summary-price"
25138
+ }, calcAndFormatItemsTotal([invoice.plan], invoice.currency))), /*#__PURE__*/React__default['default'].createElement("div", {
25139
+ 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"
25140
+ }, /*#__PURE__*/React__default['default'].createElement("div", {
25141
+ className: "plc-mr-2 plc-flex plc-flex-col"
25142
+ }, /*#__PURE__*/React__default['default'].createElement("p", {
25143
+ className: "pelcro-invoice-total-text"
25144
+ }, t("labels.total")), /*#__PURE__*/React__default['default'].createElement("p", {
25145
+ className: "pelcro-invoice-total-text"
25146
+ }, t("labels.amountPaid")), /*#__PURE__*/React__default['default'].createElement("p", {
25147
+ className: "plc-font-semibold pelcro-invoice-total-text"
25148
+ }, t("labels.amountDue"))), /*#__PURE__*/React__default['default'].createElement("div", {
25149
+ className: "plc-flex plc-flex-col"
25150
+ }, /*#__PURE__*/React__default['default'].createElement("p", {
25151
+ className: "pelcro-invoice-total"
25152
+ }, getFormattedPriceByLocal(invoice.total, invoice.currency, getPageOrDefaultLanguage())), /*#__PURE__*/React__default['default'].createElement("p", {
25153
+ className: "pelcro-invoice-total"
25154
+ }, getFormattedPriceByLocal(invoice.amount_paid, invoice.currency, getPageOrDefaultLanguage())), /*#__PURE__*/React__default['default'].createElement("p", {
25155
+ className: "plc-font-semibold pelcro-invoice-total"
25156
+ }, getFormattedPriceByLocal(invoice.amount_remaining, invoice.currency, getPageOrDefaultLanguage())))))), /*#__PURE__*/React__default['default'].createElement("div", {
25157
+ className: "plc-flex plc-items-center plc-justify-center plc-mt-4"
25158
+ }, /*#__PURE__*/React__default['default'].createElement(InvoiceDetailsDownloadButton, {
25159
+ url: invoice === null || invoice === void 0 ? void 0 : invoice.invoice_pdf,
25160
+ className: "plc-w-full plc-text-center"
25161
+ }), showPayButton && /*#__PURE__*/React__default['default'].createElement(InvoiceDetailsPayButton, {
25162
+ role: "submit",
25163
+ className: "plc-ml-4 plc-w-full",
25164
+ id: "pelcro-submit"
25165
+ })))));
25166
+ };
25167
+
25168
+ function canPayInvoice(invoice) {
25169
+ return (invoice === null || invoice === void 0 ? void 0 : invoice.status) === "open" || (invoice === null || invoice === void 0 ? void 0 : invoice.status) === "past_due";
25170
+ }
25171
+
25172
+ const InvoiceDetailsModal = ({
25173
+ onDisplay,
25174
+ onClose,
25175
+ ...otherProps
25176
+ }) => {
25177
+ const {
25178
+ switchToPaymentView
25179
+ } = usePelcro();
25180
+
25181
+ const onSuccess = () => {
25182
+ var _otherProps$onSuccess;
25183
+
25184
+ (_otherProps$onSuccess = otherProps.onSuccess) === null || _otherProps$onSuccess === void 0 ? void 0 : _otherProps$onSuccess.call(otherProps);
25185
+ switchToPaymentView();
25186
+ };
25187
+
25188
+ return /*#__PURE__*/React__default['default'].createElement(Modal, {
25189
+ onDisplay: onDisplay,
25190
+ onClose: onClose,
25191
+ id: "pelcro-invoice-details-modal"
25192
+ }, /*#__PURE__*/React__default['default'].createElement(ModalBody, null, /*#__PURE__*/React__default['default'].createElement(InvoiceDetailsView, Object.assign({}, otherProps, {
25193
+ onSuccess: onSuccess
25194
+ }))), /*#__PURE__*/React__default['default'].createElement(ModalFooter, null, /*#__PURE__*/React__default['default'].createElement(Authorship, null)));
25195
+ };
25196
+ InvoiceDetailsModal.viewId = "invoice-details";
25197
+
24544
25198
  exports.AddressCreateCity = AddressCreateCity;
24545
25199
  exports.AddressCreateContainer = AddressCreateContainer;
24546
25200
  exports.AddressCreateCountrySelect = AddressCreateCountrySelect;
@@ -24616,6 +25270,14 @@ exports.GiftRedeemSubmitButton = GiftRedeemSubmitButton;
24616
25270
  exports.GiftRedeemView = GiftRedeemView;
24617
25271
  exports.GoogleLoginButton = GoogleLoginButton;
24618
25272
  exports.Input = Input;
25273
+ exports.InvoiceDetailsContainer = InvoiceDetailsContainer;
25274
+ exports.InvoiceDetailsDownloadButton = InvoiceDetailsDownloadButton;
25275
+ exports.InvoiceDetailsModal = InvoiceDetailsModal;
25276
+ exports.InvoiceDetailsPayButton = InvoiceDetailsPayButton;
25277
+ exports.InvoiceDetailsView = InvoiceDetailsView;
25278
+ exports.InvoicePaymentContainer = InvoicePaymentContainer;
25279
+ exports.InvoicePaymentModal = InvoicePaymentModal;
25280
+ exports.InvoicePaymentView = InvoicePaymentView;
24619
25281
  exports.Link = Link;
24620
25282
  exports.LoginButton = LoginButton;
24621
25283
  exports.LoginContainer = LoginContainer;
@@ -24731,6 +25393,7 @@ exports.authenticatedButtons = authenticatedButtons;
24731
25393
  exports.i18n = i18next;
24732
25394
  exports.initButtons = init$1;
24733
25395
  exports.initContentEntitlement = init;
25396
+ exports.invoicePaymentSubmitButton = invoicePaymentSubmitButton;
24734
25397
  exports.notify = notify;
24735
25398
  exports.unauthenticatedButtons = unauthenticatedButtons;
24736
25399
  exports.usePelcro = usePelcro;