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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -3216,7 +3216,7 @@ var validation$1 = {
3216
3216
  enterEmail: "Un courriel est requis.",
3217
3217
  enterPassword: "Mot de passe requis."
3218
3218
  };
3219
- var buttons$7 = {
3219
+ var buttons$9 = {
3220
3220
  account: "Accès abonné(e)s",
3221
3221
  login: "Se connecter"
3222
3222
  };
@@ -3293,7 +3293,7 @@ var confirm$5 = {
3293
3293
  };
3294
3294
  var common_fr = {
3295
3295
  validation: validation$1,
3296
- buttons: buttons$7,
3296
+ buttons: buttons$9,
3297
3297
  dashboard: dashboard$1,
3298
3298
  select: select$3,
3299
3299
  confirm: confirm$5
@@ -3304,7 +3304,7 @@ var validation = {
3304
3304
  enterEmail: "Email address is required.",
3305
3305
  enterPassword: "Password is required."
3306
3306
  };
3307
- var buttons$6 = {
3307
+ var buttons$8 = {
3308
3308
  account: "My account",
3309
3309
  login: "Login"
3310
3310
  };
@@ -3381,7 +3381,7 @@ var confirm$4 = {
3381
3381
  };
3382
3382
  var common_en = {
3383
3383
  validation: validation,
3384
- buttons: buttons$6,
3384
+ buttons: buttons$8,
3385
3385
  dashboard: dashboard,
3386
3386
  select: select$2,
3387
3387
  confirm: confirm$4
@@ -3431,10 +3431,10 @@ var paymentMethod_fr = {
3431
3431
  select: select
3432
3432
  };
3433
3433
 
3434
- var title$d = "Enter your email to subscribe to our newsletter";
3434
+ var title$h = "Enter your email to subscribe to our newsletter";
3435
3435
  var updateTitle$1 = "Update newsletter selections";
3436
- var subtitle$7 = "We may use your email for other marketing communication";
3437
- var labels$n = {
3436
+ var subtitle$9 = "We may use your email for other marketing communication";
3437
+ var labels$p = {
3438
3438
  submit: "Submit",
3439
3439
  firstName: "First name",
3440
3440
  lastName: "Last name",
@@ -3450,17 +3450,17 @@ var messages$r = {
3450
3450
  here: "here"
3451
3451
  };
3452
3452
  var newsletter_en = {
3453
- title: title$d,
3453
+ title: title$h,
3454
3454
  updateTitle: updateTitle$1,
3455
- subtitle: subtitle$7,
3456
- labels: labels$n,
3455
+ subtitle: subtitle$9,
3456
+ labels: labels$p,
3457
3457
  messages: messages$r
3458
3458
  };
3459
3459
 
3460
- var title$c = "Entrez votre adresse courriel pour vous abonner à notre infolettre";
3460
+ var title$g = "Entrez votre adresse courriel pour vous abonner à notre infolettre";
3461
3461
  var updateTitle = "Mettre à jour son choix d'infolettres";
3462
- var subtitle$6 = "Nous pouvons utiliser votre adresse courriel pour d’autres communications marketing";
3463
- var labels$m = {
3462
+ var subtitle$8 = "Nous pouvons utiliser votre adresse courriel pour d’autres communications marketing";
3463
+ var labels$o = {
3464
3464
  submit: "Lire l’article !",
3465
3465
  firstName: "Prénom",
3466
3466
  lastName: "Nom de famille",
@@ -3476,14 +3476,14 @@ var messages$q = {
3476
3476
  here: "ici"
3477
3477
  };
3478
3478
  var newsletter_fr = {
3479
- title: title$c,
3479
+ title: title$g,
3480
3480
  updateTitle: updateTitle,
3481
- subtitle: subtitle$6,
3482
- labels: labels$m,
3481
+ subtitle: subtitle$8,
3482
+ labels: labels$o,
3483
3483
  messages: messages$q
3484
3484
  };
3485
3485
 
3486
- var labels$l = {
3486
+ var labels$n = {
3487
3487
  "continue": "Continue to content"
3488
3488
  };
3489
3489
  var messages$p = {
@@ -3502,18 +3502,22 @@ var messages$p = {
3502
3502
  giftRedeem: {
3503
3503
  title: "Congratulations",
3504
3504
  content: "You have successfully redeemed your gift subscription. Enjoy!"
3505
+ },
3506
+ invoicePayment: {
3507
+ title: "Invoice paid successfully",
3508
+ content: "Please contact us if you have any questions or concerns."
3505
3509
  }
3506
3510
  };
3507
3511
  var errors$9 = {
3508
3512
  "": ""
3509
3513
  };
3510
3514
  var success_en = {
3511
- labels: labels$l,
3515
+ labels: labels$n,
3512
3516
  messages: messages$p,
3513
3517
  errors: errors$9
3514
3518
  };
3515
3519
 
3516
- var labels$k = {
3520
+ var labels$m = {
3517
3521
  "continue": "Abonnement réussi !"
3518
3522
  };
3519
3523
  var messages$o = {
@@ -3532,13 +3536,17 @@ var messages$o = {
3532
3536
  giftRedeem: {
3533
3537
  title: "Félicitations",
3534
3538
  content: "Vous avez validé votre abonnement cadeau. Profitez-en!"
3539
+ },
3540
+ invoicePayment: {
3541
+ title: "Invoice paid successfully",
3542
+ content: "Please contact us if you have any questions or concerns."
3535
3543
  }
3536
3544
  };
3537
3545
  var errors$8 = {
3538
3546
  "": ""
3539
3547
  };
3540
3548
  var success_fr = {
3541
- labels: labels$k,
3549
+ labels: labels$m,
3542
3550
  messages: messages$o,
3543
3551
  errors: errors$8
3544
3552
  };
@@ -3575,7 +3583,7 @@ var messages$l = {
3575
3583
  youAreSafe: "You're safe - PCI compliant 128 SSL by",
3576
3584
  bankRedirection: "Please hold, redirecting you to your bank."
3577
3585
  };
3578
- var labels$j = {
3586
+ var labels$l = {
3579
3587
  card: "Enter card number",
3580
3588
  date: "Expiration date",
3581
3589
  CVC: "CVC",
@@ -3595,14 +3603,14 @@ var labels$j = {
3595
3603
  };
3596
3604
  var checkoutForm_en = {
3597
3605
  messages: messages$l,
3598
- labels: labels$j
3606
+ labels: labels$l
3599
3607
  };
3600
3608
 
3601
3609
  var messages$k = {
3602
3610
  youAreSafe: "Vous êtes en sécurité - PCI conforme 128 SSL par",
3603
3611
  bankRedirection: "Veuillez patienter, nous vous redirigeons vers votre banque."
3604
3612
  };
3605
- var labels$i = {
3613
+ var labels$k = {
3606
3614
  card: "Entrez le numéro de carte",
3607
3615
  date: "Date d’expiration",
3608
3616
  CVC: "CVC",
@@ -3622,7 +3630,7 @@ var labels$i = {
3622
3630
  };
3623
3631
  var checkoutForm_fr = {
3624
3632
  messages: messages$k,
3625
- labels: labels$i
3633
+ labels: labels$k
3626
3634
  };
3627
3635
 
3628
3636
  var youAreSafe$1 = "You're safe - PCI compliant 128 SSL by";
@@ -3631,13 +3639,17 @@ var giftSent$1 = "Subscription gift has been sent to";
3631
3639
  var successfully$1 = "successfully";
3632
3640
  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.";
3633
3641
  var recaptcha$1 = "This site is protected by reCAPTCHA and the Google <1>Privacy Policy</1> and <3>Terms of Service</3> apply.";
3642
+ var invalidInvoice$1 = "Invalid invoice ID, please contact support";
3643
+ var zeroTotalInvoice$1 = "You can't view an invoice of 0$";
3634
3644
  var messages_en = {
3635
3645
  youAreSafe: youAreSafe$1,
3636
3646
  cancel: cancel$1,
3637
3647
  giftSent: giftSent$1,
3638
3648
  successfully: successfully$1,
3639
3649
  entitlement: entitlement$1,
3640
- recaptcha: recaptcha$1
3650
+ recaptcha: recaptcha$1,
3651
+ invalidInvoice: invalidInvoice$1,
3652
+ zeroTotalInvoice: zeroTotalInvoice$1
3641
3653
  };
3642
3654
 
3643
3655
  var youAreSafe = "Vous êtes en sécurité - PCI conforme 128 SSL par";
@@ -3646,16 +3658,20 @@ var giftSent = "Le cadeau d’abonnement a été envoyé à";
3646
3658
  var successfully = "avec succès.";
3647
3659
  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";
3648
3660
  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.";
3661
+ var invalidInvoice = "Invalid invoice ID, please contact support";
3662
+ var zeroTotalInvoice = "You can't view an invoice of 0$";
3649
3663
  var messages_fr = {
3650
3664
  youAreSafe: youAreSafe,
3651
3665
  cancel: cancel,
3652
3666
  giftSent: giftSent,
3653
3667
  successfully: successfully,
3654
3668
  entitlement: entitlement,
3655
- recaptcha: recaptcha
3669
+ recaptcha: recaptcha,
3670
+ invalidInvoice: invalidInvoice,
3671
+ zeroTotalInvoice: zeroTotalInvoice
3656
3672
  };
3657
3673
 
3658
- var labels$h = {
3674
+ var labels$j = {
3659
3675
  email: "Enter email",
3660
3676
  password: "Enter password",
3661
3677
  required: "required",
@@ -3682,12 +3698,12 @@ var errors$5 = {
3682
3698
  "": ""
3683
3699
  };
3684
3700
  var login_en = {
3685
- labels: labels$h,
3701
+ labels: labels$j,
3686
3702
  messages: messages$j,
3687
3703
  errors: errors$5
3688
3704
  };
3689
3705
 
3690
- var labels$g = {
3706
+ var labels$i = {
3691
3707
  email: "Entrez votre adresse courriel",
3692
3708
  password: "Entrez votre mot de passe",
3693
3709
  required: "Champs obligatoires",
@@ -3714,14 +3730,14 @@ var errors$4 = {
3714
3730
  "": ""
3715
3731
  };
3716
3732
  var login_fr = {
3717
- labels: labels$g,
3733
+ labels: labels$i,
3718
3734
  messages: messages$i,
3719
3735
  errors: errors$4
3720
3736
  };
3721
3737
 
3722
- var title$b = "Create an account";
3723
- var subtitle$5 = "Enter your email and password below";
3724
- var labels$f = {
3738
+ var title$f = "Create an account";
3739
+ var subtitle$7 = "Enter your email and password below";
3740
+ var labels$h = {
3725
3741
  signUpFacebook: "Sign up with Facebook",
3726
3742
  signUpGoogle: "Sign up with Google",
3727
3743
  signUpEmail: "Sign up with Email",
@@ -3766,7 +3782,7 @@ var gift$1 = {
3766
3782
  lastName: "Last name",
3767
3783
  email: "Email",
3768
3784
  startDate: "Gift date",
3769
- giftMessage: "Gift message (200 characters max)",
3785
+ giftMessage: "Gift message ({{count}} characters remaining)",
3770
3786
  required: "required",
3771
3787
  firstNamePlaceholder: "First name",
3772
3788
  lastNamePlaceholder: "Last name",
@@ -3805,18 +3821,18 @@ var redeem$1 = {
3805
3821
  }
3806
3822
  };
3807
3823
  var register_en = {
3808
- title: title$b,
3809
- subtitle: subtitle$5,
3810
- labels: labels$f,
3824
+ title: title$f,
3825
+ subtitle: subtitle$7,
3826
+ labels: labels$h,
3811
3827
  messages: messages$h,
3812
3828
  errors: errors$3,
3813
3829
  gift: gift$1,
3814
3830
  redeem: redeem$1
3815
3831
  };
3816
3832
 
3817
- var title$a = "Créer un compte";
3818
- var subtitle$4 = "Entrez votre courriel et votre mot de passe ci-dessous";
3819
- var labels$e = {
3833
+ var title$e = "Créer un compte";
3834
+ var subtitle$6 = "Entrez votre courriel et votre mot de passe ci-dessous";
3835
+ var labels$g = {
3820
3836
  signUpFacebook: "Inscrivez-vous avec Facebook",
3821
3837
  signUpGoogle: "Inscrivez-vous avec Google",
3822
3838
  signUpEmail: "Inscrivez-vous avec votre courriel",
@@ -3862,7 +3878,7 @@ var gift = {
3862
3878
  lastName: "Nom de famille",
3863
3879
  email: "Adresse courriel",
3864
3880
  startDate: "Date de début",
3865
- giftMessage: "Message du cadeau (200 caractères max)",
3881
+ giftMessage: "Message du cadeau ({{count}} caractères restants)",
3866
3882
  required: "Champs obligatoires",
3867
3883
  firstNamePlaceholder: "Prénom",
3868
3884
  lastNamePlaceholder: "Nom de famille",
@@ -3901,16 +3917,16 @@ var redeem = {
3901
3917
  }
3902
3918
  };
3903
3919
  var register_fr = {
3904
- title: title$a,
3905
- subtitle: subtitle$4,
3906
- labels: labels$e,
3920
+ title: title$e,
3921
+ subtitle: subtitle$6,
3922
+ labels: labels$g,
3907
3923
  messages: messages$g,
3908
3924
  errors: errors$2,
3909
3925
  gift: gift,
3910
3926
  redeem: redeem
3911
3927
  };
3912
3928
 
3913
- var labels$d = {
3929
+ var labels$f = {
3914
3930
  title: "Want to update your profile?",
3915
3931
  subtitle: "Enter your information below to update your profile",
3916
3932
  email: "Email",
@@ -3932,11 +3948,11 @@ var messages$f = {
3932
3948
  pictureUpdated: "Your profile picture was updated successfully."
3933
3949
  };
3934
3950
  var userEdit_en = {
3935
- labels: labels$d,
3951
+ labels: labels$f,
3936
3952
  messages: messages$f
3937
3953
  };
3938
3954
 
3939
- var labels$c = {
3955
+ var labels$e = {
3940
3956
  title: "Voulez-vous mettre à jour votre profil ?",
3941
3957
  subtitle: "Entrez vos informations ci-dessous pour mettre à jour votre profil",
3942
3958
  email: "Address courriel",
@@ -3958,14 +3974,14 @@ var messages$e = {
3958
3974
  pictureUpdated: "Votre photo de profil a été mise à jour avec succès."
3959
3975
  };
3960
3976
  var userEdit_fr = {
3961
- labels: labels$c,
3977
+ labels: labels$e,
3962
3978
  messages: messages$e
3963
3979
  };
3964
3980
 
3965
- var title$9 = "Enter your shipping address";
3981
+ var title$d = "Enter your shipping address";
3966
3982
  var selectAddressTitle$1 = "Please select an address";
3967
3983
  var selectAddressSubtitle$1 = "Select one of your saved addresses, or add a new one";
3968
- var labels$b = {
3984
+ var labels$d = {
3969
3985
  address: "Address",
3970
3986
  code: "Postal Code/Zip",
3971
3987
  city: "City",
@@ -3975,7 +3991,7 @@ var labels$b = {
3975
3991
  lastName: "Last name",
3976
3992
  required: "required"
3977
3993
  };
3978
- var buttons$5 = {
3994
+ var buttons$7 = {
3979
3995
  submit: "Submit",
3980
3996
  selectAddress: "Select address",
3981
3997
  addAddress: "Add new address"
@@ -3985,18 +4001,18 @@ var messages$d = {
3985
4001
  subRedeemed: "Your subscription has been redeemed."
3986
4002
  };
3987
4003
  var address_en = {
3988
- title: title$9,
4004
+ title: title$d,
3989
4005
  selectAddressTitle: selectAddressTitle$1,
3990
4006
  selectAddressSubtitle: selectAddressSubtitle$1,
3991
- labels: labels$b,
3992
- buttons: buttons$5,
4007
+ labels: labels$d,
4008
+ buttons: buttons$7,
3993
4009
  messages: messages$d
3994
4010
  };
3995
4011
 
3996
- var title$8 = "Entrez votre adresse de livraison";
4012
+ var title$c = "Entrez votre adresse de livraison";
3997
4013
  var selectAddressTitle = "Veuillez sélectionner une adresse";
3998
4014
  var selectAddressSubtitle = "Choisissez l'une de vos adresses ou créez-en une nouvelle";
3999
- var labels$a = {
4015
+ var labels$c = {
4000
4016
  address: "Adresse",
4001
4017
  code: "Code postal / Zip",
4002
4018
  city: "Ville",
@@ -4006,7 +4022,7 @@ var labels$a = {
4006
4022
  lastName: "Nom de famille",
4007
4023
  required: "Champs obligatoires"
4008
4024
  };
4009
- var buttons$4 = {
4025
+ var buttons$6 = {
4010
4026
  submit: "Valider",
4011
4027
  selectAddress: "Choisir cette adresse",
4012
4028
  addAddress: "Ajouter une nouvelle adresse"
@@ -4016,16 +4032,16 @@ var messages$c = {
4016
4032
  subRedeemed: "Votre abonnement a bien été activé."
4017
4033
  };
4018
4034
  var address_fr = {
4019
- title: title$8,
4035
+ title: title$c,
4020
4036
  selectAddressTitle: selectAddressTitle,
4021
4037
  selectAddressSubtitle: selectAddressSubtitle,
4022
- labels: labels$a,
4023
- buttons: buttons$4,
4038
+ labels: labels$c,
4039
+ buttons: buttons$6,
4024
4040
  messages: messages$c
4025
4041
  };
4026
4042
 
4027
- var title$7 = "Reset your password";
4028
- var subtitle$3 = "Enter a new password below";
4043
+ var title$b = "Reset your password";
4044
+ var subtitle$5 = "Enter a new password below";
4029
4045
  var email$3 = "Email";
4030
4046
  var password$3 = "Password";
4031
4047
  var confirmPassword$1 = "Confirm password";
@@ -4033,8 +4049,8 @@ var submit$5 = "Submit";
4033
4049
  var required$5 = "Required";
4034
4050
  var passwordUpdated$1 = "Password has been updated, please login with the new password";
4035
4051
  var passwordReset_en = {
4036
- title: title$7,
4037
- subtitle: subtitle$3,
4052
+ title: title$b,
4053
+ subtitle: subtitle$5,
4038
4054
  email: email$3,
4039
4055
  password: password$3,
4040
4056
  confirmPassword: confirmPassword$1,
@@ -4043,8 +4059,8 @@ var passwordReset_en = {
4043
4059
  passwordUpdated: passwordUpdated$1
4044
4060
  };
4045
4061
 
4046
- var title$6 = "Réinitialiser votre mot de passe";
4047
- var subtitle$2 = "Entrez un nouveau mot de passe ci-dessous";
4062
+ var title$a = "Réinitialiser votre mot de passe";
4063
+ var subtitle$4 = "Entrez un nouveau mot de passe ci-dessous";
4048
4064
  var email$2 = "Adresse courriel";
4049
4065
  var password$2 = "Mot de passe";
4050
4066
  var confirmPassword = "Confirmer le mot de passe";
@@ -4052,8 +4068,8 @@ var submit$4 = "Soumettre";
4052
4068
  var required$4 = "Champs obligatoires";
4053
4069
  var passwordUpdated = "Votre mot de passe a été mis à jour, veuillez vous connecter avec celui-ci";
4054
4070
  var passwordReset_fr = {
4055
- title: title$6,
4056
- subtitle: subtitle$2,
4071
+ title: title$a,
4072
+ subtitle: subtitle$4,
4057
4073
  email: email$2,
4058
4074
  password: password$2,
4059
4075
  confirmPassword: confirmPassword,
@@ -4062,7 +4078,7 @@ var passwordReset_fr = {
4062
4078
  passwordUpdated: passwordUpdated
4063
4079
  };
4064
4080
 
4065
- var title$5 = "Forgot your password?";
4081
+ var title$9 = "Forgot your password?";
4066
4082
  var email$1 = "Email";
4067
4083
  var password$1 = "Password";
4068
4084
  var submit$3 = "Submit";
@@ -4073,7 +4089,7 @@ var messages$b = {
4073
4089
  loginHere: "login here."
4074
4090
  };
4075
4091
  var passwordForgot_en = {
4076
- title: title$5,
4092
+ title: title$9,
4077
4093
  email: email$1,
4078
4094
  password: password$1,
4079
4095
  submit: submit$3,
@@ -4082,7 +4098,7 @@ var passwordForgot_en = {
4082
4098
  messages: messages$b
4083
4099
  };
4084
4100
 
4085
- var title$4 = "Mot de passe oublié ?";
4101
+ var title$8 = "Mot de passe oublié ?";
4086
4102
  var email = "Courriel";
4087
4103
  var password = "Mot de passe";
4088
4104
  var submit$2 = "Soumettre";
@@ -4093,7 +4109,7 @@ var messages$a = {
4093
4109
  loginHere: "Connectez-vous ici"
4094
4110
  };
4095
4111
  var passwordForgot_fr = {
4096
- title: title$4,
4112
+ title: title$8,
4097
4113
  email: email,
4098
4114
  password: password,
4099
4115
  submit: submit$2,
@@ -4102,7 +4118,7 @@ var passwordForgot_fr = {
4102
4118
  messages: messages$a
4103
4119
  };
4104
4120
 
4105
- var title$3 = "Change your password";
4121
+ var title$7 = "Change your password";
4106
4122
  var currentPassword$1 = "Current password";
4107
4123
  var newPassword$1 = "New password";
4108
4124
  var confirmNewPassword$1 = "Confirm new password";
@@ -4112,7 +4128,7 @@ var passwordChanged$1 = "Password has been changed, please login with the new pa
4112
4128
  var passwordsNotMatching$1 = "Passwords don't match";
4113
4129
  var weakPassword$1 = "Your password must contain at least 6 characters";
4114
4130
  var passwordChange_en = {
4115
- title: title$3,
4131
+ title: title$7,
4116
4132
  currentPassword: currentPassword$1,
4117
4133
  newPassword: newPassword$1,
4118
4134
  confirmNewPassword: confirmNewPassword$1,
@@ -4123,7 +4139,7 @@ var passwordChange_en = {
4123
4139
  weakPassword: weakPassword$1
4124
4140
  };
4125
4141
 
4126
- var title$2 = "Changez votre mot de passe";
4142
+ var title$6 = "Changez votre mot de passe";
4127
4143
  var currentPassword = "Mot de passe actuel";
4128
4144
  var newPassword = "Nouveau mot de passe";
4129
4145
  var confirmNewPassword = "Confirmer le nouveau mot de passe";
@@ -4133,7 +4149,7 @@ var passwordChanged = "Le mot de passe a été modifié, veuillez vous connecter
4133
4149
  var passwordsNotMatching = "Les mots de passe ne correspondent pas";
4134
4150
  var weakPassword = "Votre mot de passe doit contenir au moins 6";
4135
4151
  var passwordChange_fr = {
4136
- title: title$2,
4152
+ title: title$6,
4137
4153
  currentPassword: currentPassword,
4138
4154
  newPassword: newPassword,
4139
4155
  confirmNewPassword: confirmNewPassword,
@@ -4144,8 +4160,8 @@ var passwordChange_fr = {
4144
4160
  weakPassword: weakPassword
4145
4161
  };
4146
4162
 
4147
- var title$1 = "Votre panier";
4148
- var subtitle$1 = "Terminez votre achat ci-dessous";
4163
+ var title$5 = "Votre panier";
4164
+ var subtitle$3 = "Terminez votre achat ci-dessous";
4149
4165
  var name$1 = "Produit";
4150
4166
  var quantity$1 = "Quantité";
4151
4167
  var price$1 = "Prix";
@@ -4156,8 +4172,8 @@ var confirm$3 = "Passer à la caisse";
4156
4172
  var empty$1 = "Votre panier est vide.";
4157
4173
  var removeAll$1 = "Vider";
4158
4174
  var cart_fr = {
4159
- title: title$1,
4160
- subtitle: subtitle$1,
4175
+ title: title$5,
4176
+ subtitle: subtitle$3,
4161
4177
  name: name$1,
4162
4178
  quantity: quantity$1,
4163
4179
  price: price$1,
@@ -4169,8 +4185,8 @@ var cart_fr = {
4169
4185
  removeAll: removeAll$1
4170
4186
  };
4171
4187
 
4172
- var title = "Your shopping cart";
4173
- var subtitle = "Comple your purchase below";
4188
+ var title$4 = "Your shopping cart";
4189
+ var subtitle$2 = "Comple your purchase below";
4174
4190
  var name = "Name";
4175
4191
  var quantity = "Quantity";
4176
4192
  var price = "Price";
@@ -4181,8 +4197,8 @@ var confirm$2 = "Checkout";
4181
4197
  var empty = "Your cart is empty.";
4182
4198
  var removeAll = "Remove all";
4183
4199
  var cart_en = {
4184
- title: title,
4185
- subtitle: subtitle,
4200
+ title: title$4,
4201
+ subtitle: subtitle$2,
4186
4202
  name: name,
4187
4203
  quantity: quantity,
4188
4204
  price: price,
@@ -4194,7 +4210,7 @@ var cart_en = {
4194
4210
  removeAll: removeAll
4195
4211
  };
4196
4212
 
4197
- var buttons$3 = {
4213
+ var buttons$5 = {
4198
4214
  select: "Select",
4199
4215
  added: "Added to cart",
4200
4216
  purchase: "Purchase",
@@ -4209,17 +4225,17 @@ var messages$9 = {
4209
4225
  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.",
4210
4226
  currencyMismatch: "The selected item(s) do not match your current default currency ({{currency}}). Please choose item(s) only matching this currency."
4211
4227
  };
4212
- var labels$9 = {
4228
+ var labels$b = {
4213
4229
  summary: "Order summary",
4214
4230
  total: "total"
4215
4231
  };
4216
4232
  var shop_en = {
4217
- buttons: buttons$3,
4233
+ buttons: buttons$5,
4218
4234
  messages: messages$9,
4219
- labels: labels$9
4235
+ labels: labels$b
4220
4236
  };
4221
4237
 
4222
- var buttons$2 = {
4238
+ var buttons$4 = {
4223
4239
  select: "Choisir",
4224
4240
  added: "Ajouté au panier",
4225
4241
  purchase: "Acheter",
@@ -4234,17 +4250,17 @@ var messages$8 = {
4234
4250
  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.",
4235
4251
  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."
4236
4252
  };
4237
- var labels$8 = {
4253
+ var labels$a = {
4238
4254
  summary: "récapitulatif de commande",
4239
4255
  total: "total"
4240
4256
  };
4241
4257
  var shop_fr = {
4242
- buttons: buttons$2,
4258
+ buttons: buttons$4,
4243
4259
  messages: messages$8,
4244
- labels: labels$8
4260
+ labels: labels$a
4245
4261
  };
4246
4262
 
4247
- var labels$7 = {
4263
+ var labels$9 = {
4248
4264
  cardNumber: "Numéro de carte",
4249
4265
  securityCode: "Code de sécurité",
4250
4266
  submit: "Soumettre",
@@ -4279,12 +4295,12 @@ var errors$1 = {
4279
4295
  "": ""
4280
4296
  };
4281
4297
  var payment_fr = {
4282
- labels: labels$7,
4298
+ labels: labels$9,
4283
4299
  messages: messages$7,
4284
4300
  errors: errors$1
4285
4301
  };
4286
4302
 
4287
- var labels$6 = {
4303
+ var labels$8 = {
4288
4304
  cardNumber: "Card number",
4289
4305
  securityCode: "Security Code",
4290
4306
  submit: "Submit",
@@ -4319,12 +4335,12 @@ var errors = {
4319
4335
  "": ""
4320
4336
  };
4321
4337
  var payment_en = {
4322
- labels: labels$6,
4338
+ labels: labels$8,
4323
4339
  messages: messages$6,
4324
4340
  errors: errors
4325
4341
  };
4326
4342
 
4327
- var labels$5 = {
4343
+ var labels$7 = {
4328
4344
  menu: "Pelcro Menu",
4329
4345
  name: "Name",
4330
4346
  email: "Email",
@@ -4349,6 +4365,16 @@ var labels$5 = {
4349
4365
  purchases: "Purchases",
4350
4366
  subscriptions: "Subscriptions",
4351
4367
  donations: "Donations",
4368
+ invoices: "Invoices",
4369
+ details: "Details",
4370
+ view: "View",
4371
+ paid: "Paid",
4372
+ open: "Open",
4373
+ draft: "Draft",
4374
+ scheduled: "Scheduled",
4375
+ uncollectible: "Uncollectible",
4376
+ "void": "Void",
4377
+ pastDue: "Past due",
4352
4378
  updatePaymentSource: "Update",
4353
4379
  profile: "Profile",
4354
4380
  updateProfile: "Edit profile",
@@ -4401,11 +4427,11 @@ var messages$5 = {
4401
4427
  }
4402
4428
  };
4403
4429
  var dashboard_en = {
4404
- labels: labels$5,
4430
+ labels: labels$7,
4405
4431
  messages: messages$5
4406
4432
  };
4407
4433
 
4408
- var labels$4 = {
4434
+ var labels$6 = {
4409
4435
  menu: "Menu Pelcro",
4410
4436
  name: "Nom",
4411
4437
  email: "Courriel",
@@ -4430,6 +4456,16 @@ var labels$4 = {
4430
4456
  purchases: "Achats",
4431
4457
  subscriptions: "Abonnements",
4432
4458
  donations: "Des dons",
4459
+ invoices: "Invoices",
4460
+ details: "Details",
4461
+ view: "View",
4462
+ paid: "Paid",
4463
+ open: "open",
4464
+ draft: "Draft",
4465
+ scheduled: "Scheduled",
4466
+ uncollectible: "Uncollectible",
4467
+ "void": "Void",
4468
+ pastDue: "Past due",
4433
4469
  updatePaymentSource: "Mettre à jour la source de paiement",
4434
4470
  profile: "Profil",
4435
4471
  updateProfile: "Mettre à jour le profil",
@@ -4482,7 +4518,7 @@ var messages$4 = {
4482
4518
  }
4483
4519
  };
4484
4520
  var dashboard_fr = {
4485
- labels: labels$4,
4521
+ labels: labels$6,
4486
4522
  messages: messages$4
4487
4523
  };
4488
4524
 
@@ -4491,7 +4527,7 @@ var messages$3 = {
4491
4527
  loginHere: "Login here",
4492
4528
  checkbox: "Check this box to gift this subscription"
4493
4529
  };
4494
- var labels$3 = {
4530
+ var labels$5 = {
4495
4531
  plan: {
4496
4532
  title: "Subscribe to a plan",
4497
4533
  subtitle: "Select one of the plans below and click on next."
@@ -4508,15 +4544,15 @@ var labels$3 = {
4508
4544
  or: "Or take a look at some of our other options below"
4509
4545
  }
4510
4546
  };
4511
- var buttons$1 = {
4547
+ var buttons$3 = {
4512
4548
  next: "Next",
4513
4549
  select: "Select",
4514
4550
  back: "Back"
4515
4551
  };
4516
4552
  var select_en = {
4517
4553
  messages: messages$3,
4518
- labels: labels$3,
4519
- buttons: buttons$1
4554
+ labels: labels$5,
4555
+ buttons: buttons$3
4520
4556
  };
4521
4557
 
4522
4558
  var messages$2 = {
@@ -4524,7 +4560,7 @@ var messages$2 = {
4524
4560
  loginHere: "Connectez-vous ici",
4525
4561
  checkbox: "Cochez cette case pour offrir cet abonnement"
4526
4562
  };
4527
- var labels$2 = {
4563
+ var labels$4 = {
4528
4564
  plan: {
4529
4565
  title: "Abonnez-vous à un plan",
4530
4566
  subtitle: "Sélectionnez l’un des plans ci-dessous et cliquez sur suivant."
@@ -4541,15 +4577,15 @@ var labels$2 = {
4541
4577
  or: "Sinon, jetez un coup d'oeil à d'autres offres ci-dessous"
4542
4578
  }
4543
4579
  };
4544
- var buttons = {
4580
+ var buttons$2 = {
4545
4581
  next: "Prochain",
4546
4582
  select: "Choisir",
4547
4583
  back: "Retour"
4548
4584
  };
4549
4585
  var select_fr = {
4550
4586
  messages: messages$2,
4551
- labels: labels$2,
4552
- buttons: buttons
4587
+ labels: labels$4,
4588
+ buttons: buttons$2
4553
4589
  };
4554
4590
 
4555
4591
  var confirm$1 = {
@@ -4572,7 +4608,7 @@ var notification_fr = {
4572
4608
  confirm: confirm
4573
4609
  };
4574
4610
 
4575
- var labels$1 = {
4611
+ var labels$3 = {
4576
4612
  title: "Verify your email",
4577
4613
  instructions: "You're on your way!\nLet's confirm your email address.\nClick on the verification link we've sent to your email:",
4578
4614
  resend: "Resend email"
@@ -4582,24 +4618,86 @@ var messages$1 = {
4582
4618
  success: "Email verified successfully!"
4583
4619
  };
4584
4620
  var verifyEmail_en = {
4585
- labels: labels$1,
4621
+ labels: labels$3,
4586
4622
  messages: messages$1
4587
4623
  };
4588
4624
 
4589
- var labels = {
4590
- title: "Vérifiez votre e-mail",
4591
- 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:",
4592
- resend: "Ré-envoyer l'email"
4625
+ var labels$2 = {
4626
+ title: "Confirmez votre courriel",
4627
+ instructions: "Confirmez votre courriel.\nVeuillez cliquer sur le lien de vérification, qui vous a été envoyé à:",
4628
+ resend: "Renvoyer le courriel"
4593
4629
  };
4594
4630
  var messages = {
4595
4631
  resent: "Renvoyé avec succès",
4596
- success: "Email vérifié avec succès!"
4632
+ success: "Adresse courriel vérifiée avec succès"
4597
4633
  };
4598
4634
  var verifyEmail_fr = {
4599
- labels: labels,
4635
+ labels: labels$2,
4600
4636
  messages: messages
4601
4637
  };
4602
4638
 
4639
+ var title$3 = "Invoice details";
4640
+ var labels$1 = {
4641
+ summary: "Summary",
4642
+ total: "Total",
4643
+ amountPaid: "Amount paid",
4644
+ amountDue: "Amount due",
4645
+ creationDate: "Created on:"
4646
+ };
4647
+ var buttons$1 = {
4648
+ download: "Download",
4649
+ pay: "Pay now"
4650
+ };
4651
+ var invoiceDetails_en = {
4652
+ title: title$3,
4653
+ labels: labels$1,
4654
+ buttons: buttons$1
4655
+ };
4656
+
4657
+ var title$2 = "Invoice details";
4658
+ var labels = {
4659
+ summary: "Summary",
4660
+ total: "Total",
4661
+ amountPaid: "Amount paid",
4662
+ amountDue: "Amount due",
4663
+ creationDate: "Created on:"
4664
+ };
4665
+ var buttons = {
4666
+ download: "Download",
4667
+ pay: "Pay now"
4668
+ };
4669
+ var invoiceDetails_fr = {
4670
+ title: title$2,
4671
+ labels: labels,
4672
+ buttons: buttons
4673
+ };
4674
+
4675
+ var title$1 = "Renewal options";
4676
+ var subtitle$1 = "Select one of the options below to continue";
4677
+ var next$1 = "Next";
4678
+ var addNew$1 = "Add Another Subscription";
4679
+ var renew$1 = "Renew Existing Subscription";
4680
+ var subscriptionOptions_en = {
4681
+ title: title$1,
4682
+ subtitle: subtitle$1,
4683
+ next: next$1,
4684
+ addNew: addNew$1,
4685
+ renew: renew$1
4686
+ };
4687
+
4688
+ var title = "Renewal options";
4689
+ var subtitle = "Select one of the options below to continue";
4690
+ var next = "Next";
4691
+ var addNew = "Add Another Subscription";
4692
+ var renew = "Renew Existing Subscription";
4693
+ var subscriptionOptions_fr = {
4694
+ title: title,
4695
+ subtitle: subtitle,
4696
+ next: next,
4697
+ addNew: addNew,
4698
+ renew: renew
4699
+ };
4700
+
4603
4701
  function create$1(createState) {
4604
4702
  let state;
4605
4703
  const listeners = new Set();
@@ -5949,7 +6047,7 @@ class PelcroActions {
5949
6047
  view,
5950
6048
  cartItems,
5951
6049
  ...otherStateFields
5952
- } = initialState$h;
6050
+ } = initialState$j;
5953
6051
  this.set(otherStateFields);
5954
6052
  });
5955
6053
 
@@ -5973,6 +6071,16 @@ class PelcroActions {
5973
6071
  });
5974
6072
  }
5975
6073
 
6074
+ if (view === "subscription-options") {
6075
+ const noRenewableProducts = getRenewableProducts().length === 0;
6076
+
6077
+ if (noRenewableProducts) {
6078
+ return this.set({
6079
+ view: "plan-select"
6080
+ });
6081
+ }
6082
+ }
6083
+
5976
6084
  this.set({
5977
6085
  view
5978
6086
  });
@@ -5993,10 +6101,11 @@ class PelcroActions {
5993
6101
  resetView,
5994
6102
  switchToCheckoutForm,
5995
6103
  product,
5996
- order
6104
+ order,
6105
+ invoice
5997
6106
  } = this.get();
5998
6107
 
5999
- if (product || order) {
6108
+ if (product || order || invoice) {
6000
6109
  // direct user to stripe checkout form when there are no existing cards
6001
6110
  if (!userHasPaymentMethod()) {
6002
6111
  return switchToCheckoutForm();
@@ -6013,7 +6122,8 @@ class PelcroActions {
6013
6122
  switchView,
6014
6123
  product,
6015
6124
  subscriptionIdToRenew,
6016
- order
6125
+ order,
6126
+ invoice
6017
6127
  } = this.get();
6018
6128
 
6019
6129
  if (product && subscriptionIdToRenew) {
@@ -6027,6 +6137,10 @@ class PelcroActions {
6027
6137
  if (order) {
6028
6138
  return switchView("order-create");
6029
6139
  }
6140
+
6141
+ if (invoice) {
6142
+ return switchView("invoice-payment");
6143
+ }
6030
6144
  });
6031
6145
 
6032
6146
  _defineProperty$3(this, "switchToAddressView", () => {
@@ -6041,6 +6155,26 @@ class PelcroActions {
6041
6155
  }
6042
6156
  });
6043
6157
 
6158
+ _defineProperty$3(this, "setProductsList", products => {
6159
+ if (!Array.isArray(products)) {
6160
+ return console.error(`setProductsList expects an array of products as an argument, got an argument of type ${typeof products} instead`);
6161
+ }
6162
+
6163
+ const allowedProducts = window.Pelcro.product.list();
6164
+ const validProducts = products.filter(product => {
6165
+ const isValidProduct = allowedProducts.some(allowedProduct => allowedProduct.id === (product === null || product === void 0 ? void 0 : product.id) && allowedProduct.name === (product === null || product === void 0 ? void 0 : product.name));
6166
+
6167
+ if (!isValidProduct) {
6168
+ console.warn(`setProductsList expects an array of products that exist in the list of valid products (window.Pelcro.product.list()), but it recieved a product which doesn't exist in that list:`, product);
6169
+ }
6170
+
6171
+ return isValidProduct;
6172
+ });
6173
+ this.set({
6174
+ productsList: validProducts
6175
+ });
6176
+ });
6177
+
6044
6178
  _defineProperty$3(this, "setProduct", id => {
6045
6179
  const product = window.Pelcro.product.getById(id);
6046
6180
  if (!product) return console.error("invalid product id");
@@ -6057,6 +6191,23 @@ class PelcroActions {
6057
6191
  });
6058
6192
  });
6059
6193
 
6194
+ _defineProperty$3(this, "setInvoice", id => {
6195
+ var _window$Pelcro$invoic;
6196
+
6197
+ const invoices = (_window$Pelcro$invoic = window.Pelcro.invoice.list()) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
6198
+ const invoice = invoices.find(inv => String(inv.id) === String(id));
6199
+
6200
+ if (!invoice) {
6201
+ console.error("invalid invoice id");
6202
+ return false;
6203
+ }
6204
+
6205
+ this.set({
6206
+ invoice
6207
+ });
6208
+ return true;
6209
+ });
6210
+
6060
6211
  _defineProperty$3(this, "logout", () => {
6061
6212
  var _ReactGA$event;
6062
6213
 
@@ -6245,10 +6396,12 @@ class PelcroCallbacks {
6245
6396
 
6246
6397
  }
6247
6398
 
6248
- const initialState$h = {
6399
+ var _window$Pelcro$produc, _window$Pelcro;
6400
+ const initialState$j = {
6249
6401
  // View
6250
6402
  view: null,
6251
6403
  // Plans
6404
+ productsList: (_window$Pelcro$produc = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : _window$Pelcro.product.list()) !== null && _window$Pelcro$produc !== void 0 ? _window$Pelcro$produc : [],
6252
6405
  product: null,
6253
6406
  plan: null,
6254
6407
  isGift: false,
@@ -6260,6 +6413,8 @@ const initialState$h = {
6260
6413
  cartItems: [],
6261
6414
  order: null,
6262
6415
  // null | SKU[] | SKU,
6416
+ // invoices
6417
+ invoice: null,
6263
6418
  // User
6264
6419
  isAuthenticated: () => window.Pelcro.user.isAuthenticated(),
6265
6420
  selectedPaymentMethodId: null,
@@ -6273,7 +6428,7 @@ const createPelcroStore = () => createStore(middleware_3((set, get) => {
6273
6428
  return {
6274
6429
  // Store setter
6275
6430
  set,
6276
- ...initialState$h,
6431
+ ...initialState$j,
6277
6432
  // State actions
6278
6433
  ...actions,
6279
6434
  // Callbacks
@@ -6424,7 +6579,7 @@ const calcAndFormatItemsTotal = (items, currency) => {
6424
6579
  */
6425
6580
 
6426
6581
  const isValidViewFromURL = viewID => {
6427
- 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()) {
6582
+ 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()) {
6428
6583
  return true;
6429
6584
  }
6430
6585
 
@@ -6628,6 +6783,28 @@ function userMustVerifyEmail() {
6628
6783
  const isUserEmailVerified = (_window$Pelcro$user$r9 = (_window$Pelcro$user$r10 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r10 === void 0 ? void 0 : _window$Pelcro$user$r10.email_confirm) !== null && _window$Pelcro$user$r9 !== void 0 ? _window$Pelcro$user$r9 : false;
6629
6784
  return window.Pelcro.user.isAuthenticated() && isEmailVerificationEnabled && !isUserEmailVerified;
6630
6785
  }
6786
+ function getRenewableProducts() {
6787
+ const renewableSubs = window.Pelcro.subscription.list().filter(sub => sub.status === "active" && sub.cancel_at_period_end === 1);
6788
+ const renewableProductsIds = [...new Set(renewableSubs.map(sub => sub.plan.product.id))];
6789
+ const renewablePlansIds = [...new Set(renewableSubs.map(sub => sub.plan.id))];
6790
+ const {
6791
+ productsList
6792
+ } = usePelcro.getStore();
6793
+ return productsList.map(product => {
6794
+ if (renewableProductsIds.includes(product.id)) {
6795
+ const renewablePlans = getRenewablePlansOnly(product);
6796
+ return { ...product,
6797
+ plans: renewablePlans
6798
+ };
6799
+ }
6800
+ }).filter(product => product);
6801
+
6802
+ function getRenewablePlansOnly(product) {
6803
+ var _product$plans$filter, _product$plans;
6804
+
6805
+ return (_product$plans$filter = product === null || product === void 0 ? void 0 : (_product$plans = product.plans) === null || _product$plans === void 0 ? void 0 : _product$plans.filter(plan => renewablePlansIds.includes(plan.id))) !== null && _product$plans$filter !== void 0 ? _product$plans$filter : [];
6806
+ }
6807
+ }
6631
6808
 
6632
6809
  const resources = {
6633
6810
  en: {
@@ -6651,7 +6828,9 @@ const resources = {
6651
6828
  payment: payment_en,
6652
6829
  dashboard: dashboard_en,
6653
6830
  select: select_en,
6654
- notification: notification_en
6831
+ notification: notification_en,
6832
+ invoiceDetails: invoiceDetails_en,
6833
+ subscriptionOptions: subscriptionOptions_en
6655
6834
  },
6656
6835
  fr: {
6657
6836
  common: common_fr,
@@ -6674,7 +6853,9 @@ const resources = {
6674
6853
  payment: payment_fr,
6675
6854
  dashboard: dashboard_fr,
6676
6855
  select: select_fr,
6677
- notification: notification_fr
6856
+ notification: notification_fr,
6857
+ invoiceDetails: invoiceDetails_fr,
6858
+ subscriptionOptions: subscriptionOptions_fr
6678
6859
  }
6679
6860
  }; // set UI language to the page language or default to the language in site settings
6680
6861
 
@@ -6965,8 +7146,8 @@ const saveToMetadataButton = new SaveToMetadataButtonClass();
6965
7146
 
6966
7147
  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}}
6967
7148
 
6968
- function _extends$y() {
6969
- _extends$y = Object.assign || function (target) {
7149
+ function _extends$A() {
7150
+ _extends$A = Object.assign || function (target) {
6970
7151
  for (var i = 1; i < arguments.length; i++) {
6971
7152
  var source = arguments[i];
6972
7153
 
@@ -6980,7 +7161,7 @@ function _extends$y() {
6980
7161
  return target;
6981
7162
  };
6982
7163
 
6983
- return _extends$y.apply(this, arguments);
7164
+ return _extends$A.apply(this, arguments);
6984
7165
  }
6985
7166
 
6986
7167
  function _taggedTemplateLiteralLoose(strings, raw) {
@@ -7070,7 +7251,7 @@ var clearFromRemoveQueue = function clearFromRemoveQueue(toastId) {
7070
7251
  var reducer = function reducer(state, action) {
7071
7252
  switch (action.type) {
7072
7253
  case ActionType.ADD_TOAST:
7073
- return _extends$y({}, state, {
7254
+ return _extends$A({}, state, {
7074
7255
  toasts: [action.toast].concat(state.toasts).slice(0, TOAST_LIMIT)
7075
7256
  });
7076
7257
 
@@ -7080,9 +7261,9 @@ var reducer = function reducer(state, action) {
7080
7261
  clearFromRemoveQueue(action.toast.id);
7081
7262
  }
7082
7263
 
7083
- return _extends$y({}, state, {
7264
+ return _extends$A({}, state, {
7084
7265
  toasts: state.toasts.map(function (t) {
7085
- return t.id === action.toast.id ? _extends$y({}, t, action.toast) : t;
7266
+ return t.id === action.toast.id ? _extends$A({}, t, action.toast) : t;
7086
7267
  })
7087
7268
  });
7088
7269
 
@@ -7109,9 +7290,9 @@ var reducer = function reducer(state, action) {
7109
7290
  });
7110
7291
  }
7111
7292
 
7112
- return _extends$y({}, state, {
7293
+ return _extends$A({}, state, {
7113
7294
  toasts: state.toasts.map(function (t) {
7114
- return t.id === toastId || toastId === undefined ? _extends$y({}, t, {
7295
+ return t.id === toastId || toastId === undefined ? _extends$A({}, t, {
7115
7296
  visible: false
7116
7297
  }) : t;
7117
7298
  })
@@ -7119,28 +7300,28 @@ var reducer = function reducer(state, action) {
7119
7300
 
7120
7301
  case ActionType.REMOVE_TOAST:
7121
7302
  if (action.toastId === undefined) {
7122
- return _extends$y({}, state, {
7303
+ return _extends$A({}, state, {
7123
7304
  toasts: []
7124
7305
  });
7125
7306
  }
7126
7307
 
7127
- return _extends$y({}, state, {
7308
+ return _extends$A({}, state, {
7128
7309
  toasts: state.toasts.filter(function (t) {
7129
7310
  return t.id !== action.toastId;
7130
7311
  })
7131
7312
  });
7132
7313
 
7133
7314
  case ActionType.START_PAUSE:
7134
- return _extends$y({}, state, {
7315
+ return _extends$A({}, state, {
7135
7316
  pausedAt: action.time
7136
7317
  });
7137
7318
 
7138
7319
  case ActionType.END_PAUSE:
7139
7320
  var diff = action.time - (state.pausedAt || 0);
7140
- return _extends$y({}, state, {
7321
+ return _extends$A({}, state, {
7141
7322
  pausedAt: undefined,
7142
7323
  toasts: state.toasts.map(function (t) {
7143
- return _extends$y({}, t, {
7324
+ return _extends$A({}, t, {
7144
7325
  pauseDuration: t.pauseDuration + diff
7145
7326
  });
7146
7327
  })
@@ -7187,12 +7368,12 @@ var useStore = function useStore(toastOptions) {
7187
7368
  var mergedToasts = state.toasts.map(function (t) {
7188
7369
  var _toastOptions$t$type, _toastOptions, _toastOptions$t$type2;
7189
7370
 
7190
- return _extends$y({}, toastOptions, toastOptions[t.type], t, {
7371
+ return _extends$A({}, toastOptions, toastOptions[t.type], t, {
7191
7372
  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],
7192
- style: _extends$y({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7373
+ style: _extends$A({}, toastOptions.style, (_toastOptions$t$type2 = toastOptions[t.type]) == null ? void 0 : _toastOptions$t$type2.style, t.style)
7193
7374
  });
7194
7375
  });
7195
- return _extends$y({}, state, {
7376
+ return _extends$A({}, state, {
7196
7377
  toasts: mergedToasts
7197
7378
  });
7198
7379
  };
@@ -7202,7 +7383,7 @@ var createToast = function createToast(message, type, opts) {
7202
7383
  type = 'blank';
7203
7384
  }
7204
7385
 
7205
- return _extends$y({
7386
+ return _extends$A({
7206
7387
  createdAt: Date.now(),
7207
7388
  visible: true,
7208
7389
  type: type,
@@ -7252,14 +7433,14 @@ toast.remove = function (toastId) {
7252
7433
  };
7253
7434
 
7254
7435
  toast.promise = function (promise, msgs, opts) {
7255
- var id = toast.loading(msgs.loading, _extends$y({}, opts, opts == null ? void 0 : opts.loading));
7436
+ var id = toast.loading(msgs.loading, _extends$A({}, opts, opts == null ? void 0 : opts.loading));
7256
7437
  promise.then(function (p) {
7257
- toast.success(resolveValue(msgs.success, p), _extends$y({
7438
+ toast.success(resolveValue(msgs.success, p), _extends$A({
7258
7439
  id: id
7259
7440
  }, opts, opts == null ? void 0 : opts.success));
7260
7441
  return p;
7261
7442
  })["catch"](function (e) {
7262
- toast.error(resolveValue(msgs.error, e), _extends$y({
7443
+ toast.error(resolveValue(msgs.error, e), _extends$A({
7263
7444
  id: id
7264
7445
  }, opts, opts == null ? void 0 : opts.error));
7265
7446
  });
@@ -7598,7 +7779,7 @@ var ToastBar = /*#__PURE__*/memo(function (_ref2) {
7598
7779
  var message = createElement(Message, Object.assign({}, toast.ariaProps), resolveValue(toast.message, toast));
7599
7780
  return createElement(ToastBarBase, {
7600
7781
  className: toast.className,
7601
- style: _extends$y({}, animationStyle, style, toast.style)
7782
+ style: _extends$A({}, animationStyle, style, toast.style)
7602
7783
  }, typeof children === 'function' ? children({
7603
7784
  icon: icon,
7604
7785
  message: message
@@ -7628,7 +7809,7 @@ var getPositionStyle = function getPositionStyle(position, offset) {
7628
7809
  } : position.includes('right') ? {
7629
7810
  justifyContent: 'flex-end'
7630
7811
  } : {};
7631
- return _extends$y({
7812
+ return _extends$A({
7632
7813
  left: 0,
7633
7814
  right: 0,
7634
7815
  display: 'flex',
@@ -7655,7 +7836,7 @@ var Toaster = function Toaster(_ref) {
7655
7836
  handlers = _useToaster.handlers;
7656
7837
 
7657
7838
  return createElement("div", {
7658
- style: _extends$y({
7839
+ style: _extends$A({
7659
7840
  position: 'fixed',
7660
7841
  zIndex: 9999,
7661
7842
  top: DEFAULT_OFFSET,
@@ -7690,82 +7871,82 @@ var Toaster = function Toaster(_ref) {
7690
7871
  }));
7691
7872
  };
7692
7873
 
7693
- var _path$v;
7874
+ var _path$x;
7694
7875
 
7695
- 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); }
7876
+ function _extends$z() { _extends$z = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$z.apply(this, arguments); }
7696
7877
 
7697
7878
  function SvgCheckSolid(props) {
7698
- return /*#__PURE__*/React.createElement("svg", _extends$x({
7879
+ return /*#__PURE__*/React.createElement("svg", _extends$z({
7699
7880
  xmlns: "http://www.w3.org/2000/svg",
7700
7881
  className: "h-5 w-5",
7701
7882
  viewBox: "0 0 20 20",
7702
7883
  fill: "currentColor"
7703
- }, props), _path$v || (_path$v = /*#__PURE__*/React.createElement("path", {
7884
+ }, props), _path$x || (_path$x = /*#__PURE__*/React.createElement("path", {
7704
7885
  fillRule: "evenodd",
7705
7886
  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",
7706
7887
  clipRule: "evenodd"
7707
7888
  })));
7708
7889
  }
7709
7890
 
7710
- var _path$u;
7891
+ var _path$w;
7711
7892
 
7712
- 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); }
7893
+ 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); }
7713
7894
 
7714
7895
  function SvgXIcon(props) {
7715
- return /*#__PURE__*/React.createElement("svg", _extends$w({
7896
+ return /*#__PURE__*/React.createElement("svg", _extends$y({
7716
7897
  xmlns: "http://www.w3.org/2000/svg",
7717
7898
  viewBox: "0 0 20 20",
7718
7899
  fill: "currentColor"
7719
- }, props), _path$u || (_path$u = /*#__PURE__*/React.createElement("path", {
7900
+ }, props), _path$w || (_path$w = /*#__PURE__*/React.createElement("path", {
7720
7901
  fill: "evenodd",
7721
7902
  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",
7722
7903
  clipRule: "evenodd"
7723
7904
  })));
7724
7905
  }
7725
7906
 
7726
- var _path$t;
7907
+ var _path$v;
7727
7908
 
7728
- 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); }
7909
+ 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); }
7729
7910
 
7730
7911
  function SvgXIconSolid(props) {
7731
- return /*#__PURE__*/React.createElement("svg", _extends$v({
7912
+ return /*#__PURE__*/React.createElement("svg", _extends$x({
7732
7913
  className: "plc-w-4 plc-h-4",
7733
7914
  fill: "currentColor",
7734
7915
  xmlns: "http://www.w3.org/2000/svg",
7735
7916
  viewBox: "0 0 100 100"
7736
- }, props), _path$t || (_path$t = /*#__PURE__*/React.createElement("path", {
7917
+ }, props), _path$v || (_path$v = /*#__PURE__*/React.createElement("path", {
7737
7918
  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"
7738
7919
  })));
7739
7920
  }
7740
7921
 
7741
- var _path$s;
7922
+ var _path$u;
7742
7923
 
7743
- 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); }
7924
+ 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); }
7744
7925
 
7745
7926
  function SvgExclamation(props) {
7746
- return /*#__PURE__*/React.createElement("svg", _extends$u({
7927
+ return /*#__PURE__*/React.createElement("svg", _extends$w({
7747
7928
  className: "plc-w-4 plc-h-4 plc-mr-1",
7748
7929
  xmlns: "http://www.w3.org/2000/svg",
7749
7930
  viewBox: "0 0 20 20",
7750
7931
  fill: "currentColor"
7751
- }, props), _path$s || (_path$s = /*#__PURE__*/React.createElement("path", {
7932
+ }, props), _path$u || (_path$u = /*#__PURE__*/React.createElement("path", {
7752
7933
  fillRule: "evenodd",
7753
7934
  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",
7754
7935
  clipRule: "evenodd"
7755
7936
  })));
7756
7937
  }
7757
7938
 
7758
- var _path$r, _path2$4;
7939
+ var _path$t, _path2$4;
7759
7940
 
7760
- 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); }
7941
+ 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); }
7761
7942
 
7762
7943
  function SvgSpinner(props) {
7763
- return /*#__PURE__*/React.createElement("svg", _extends$t({
7944
+ return /*#__PURE__*/React.createElement("svg", _extends$v({
7764
7945
  className: "plc-animate-spin",
7765
7946
  viewBox: "0 0 24 24",
7766
7947
  fill: "currentColor",
7767
7948
  xmlns: "http://www.w3.org/2000/svg"
7768
- }, props), _path$r || (_path$r = /*#__PURE__*/React.createElement("path", {
7949
+ }, props), _path$t || (_path$t = /*#__PURE__*/React.createElement("path", {
7769
7950
  opacity: 0.2,
7770
7951
  fill: "evenodd",
7771
7952
  clipRule: "evenodd",
@@ -8055,7 +8236,9 @@ const init$1 = () => {
8055
8236
  return switchToAddressView();
8056
8237
  });
8057
8238
  } else {
8058
- pelcroSubscribeButtonsByClass[j].addEventListener("click", () => switchView("plan-select"));
8239
+ pelcroSubscribeButtonsByClass[j].addEventListener("click", () => {
8240
+ return switchView("subscription-options");
8241
+ });
8059
8242
  }
8060
8243
  }
8061
8244
  }
@@ -8217,7 +8400,8 @@ function Link({
8217
8400
  const init = () => {
8218
8401
  const {
8219
8402
  switchView,
8220
- set
8403
+ set,
8404
+ setProductsList
8221
8405
  } = usePelcro.getStore();
8222
8406
  const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
8223
8407
 
@@ -8268,7 +8452,8 @@ const init = () => {
8268
8452
  }
8269
8453
 
8270
8454
  notify.dismiss(NOTIFICATION_ID);
8271
- switchView("_plan-select-entitlements");
8455
+ setProductsList(window.Pelcro.product.getByEntitlements(entitlements));
8456
+ switchView("plan-select");
8272
8457
  }
8273
8458
  }, "Subscribe"), "now to get full page access.")), {
8274
8459
  className: "pelcro-notification-entitlement",
@@ -8799,6 +8984,10 @@ const initViewFromURL = () => {
8799
8984
  return verifyEmailTokenFromUrl();
8800
8985
  }
8801
8986
 
8987
+ if (view === "invoice-details") {
8988
+ return showInvoiceDetailsFromUrl();
8989
+ }
8990
+
8802
8991
  switchView(view);
8803
8992
  });
8804
8993
  }
@@ -8975,27 +9164,64 @@ const verifyEmailTokenFromUrl = () => {
8975
9164
  });
8976
9165
  };
8977
9166
 
8978
- const defaultOptions = {
8979
- loadPaymentSDKs: true,
8980
- loadAuth0SDK: true,
8981
- enableURLTriggers: true,
8982
- enableTheme: true,
8983
- enablePaywalls: true,
8984
- loadSecuritySDK: true,
8985
- enableGoogleAnalytics: false
8986
- };
8987
- const PelcroModalController = ({
8988
- rootId = "pelcro-app",
8989
- options = defaultOptions,
8990
- children
8991
- }) => {
9167
+ const showInvoiceDetailsFromUrl = () => {
8992
9168
  const {
8993
- view,
8994
9169
  isAuthenticated,
8995
- whenSiteReady
8996
- } = usePelcro();
8997
- React__default.useEffect(() => {
8998
- init$1();
9170
+ setInvoice,
9171
+ whenSiteReady,
9172
+ switchView
9173
+ } = usePelcro.getStore();
9174
+ whenSiteReady(() => {
9175
+ if (!isAuthenticated()) {
9176
+ return switchView("login");
9177
+ }
9178
+
9179
+ const invoiceId = window.Pelcro.helpers.getURLParameter("id");
9180
+ const wasSetSuccessfully = setInvoice(invoiceId);
9181
+
9182
+ if (!wasSetSuccessfully) {
9183
+ const errorMessage = i18next.t("messages:invalidInvoice", {
9184
+ returnObjects: true
9185
+ });
9186
+ return notify.error(errorMessage);
9187
+ }
9188
+
9189
+ const {
9190
+ invoice
9191
+ } = usePelcro.getStore();
9192
+
9193
+ if (invoice.total === 0) {
9194
+ const errorMessage = i18next.t("messages:zeroTotalInvoice", {
9195
+ returnObjects: true
9196
+ });
9197
+ return notify.error(errorMessage);
9198
+ }
9199
+
9200
+ return switchView("invoice-details");
9201
+ });
9202
+ };
9203
+
9204
+ const defaultOptions = {
9205
+ loadPaymentSDKs: true,
9206
+ loadAuth0SDK: true,
9207
+ enableURLTriggers: true,
9208
+ enableTheme: true,
9209
+ enablePaywalls: true,
9210
+ loadSecuritySDK: true,
9211
+ enableGoogleAnalytics: false
9212
+ };
9213
+ const PelcroModalController = ({
9214
+ rootId = "pelcro-app",
9215
+ options = defaultOptions,
9216
+ children
9217
+ }) => {
9218
+ const {
9219
+ view,
9220
+ isAuthenticated,
9221
+ whenSiteReady
9222
+ } = usePelcro();
9223
+ React__default.useEffect(() => {
9224
+ init$1();
8999
9225
  renderShopView(React__default.Children.map(children, child => child).find(({
9000
9226
  type
9001
9227
  }) => (type === null || type === void 0 ? void 0 : type.viewId) === "shop"));
@@ -9032,7 +9258,7 @@ const PelcroModalController = ({
9032
9258
  type
9033
9259
  }) => (type === null || type === void 0 ? void 0 : type.viewId) === "dashboard-open"), React__default.Children.map(children, child => child).find(({
9034
9260
  type
9035
- }) => (type === null || type === void 0 ? void 0 : type.viewId) === "notification"), view === "_plan-select-entitlements" && React__default.Children.map(children, child => child).find(({
9261
+ }) => (type === null || type === void 0 ? void 0 : type.viewId) === "notification"), view === "_plan-select-renew" && React__default.Children.map(children, child => child).find(({
9036
9262
  type
9037
9263
  }) => (type === null || type === void 0 ? void 0 : type.viewId) === "plan-select"), React__default.Children.map(children, child => child).find(({
9038
9264
  type
@@ -9313,8 +9539,10 @@ const LOAD_PAYMENT_METHODS = "LOAD_PAYMENT_METHODS";
9313
9539
  const GET_NEWSLETTERS_FETCH = "GET_NEWSLETTERS_FETCH";
9314
9540
  const GET_NEWSLETTERS_SUCCESS = "GET_NEWSLETTERS_SUCCESS";
9315
9541
  const SWITCH_TO_UPDATE = "SWITCH_TO_UPDATE";
9542
+ const SWITCH_TO_RENEW = "SWITCH_TO_RENEW";
9543
+ const SWITCH_TO_NEW = "SWITCH_TO_NEW";
9316
9544
 
9317
- const initialState$g = {
9545
+ const initialState$i = {
9318
9546
  email: "",
9319
9547
  password: "",
9320
9548
  emailError: null,
@@ -9325,10 +9553,10 @@ const initialState$g = {
9325
9553
  content: ""
9326
9554
  }
9327
9555
  };
9328
- const store$g = /*#__PURE__*/createContext(initialState$g);
9556
+ const store$i = /*#__PURE__*/createContext(initialState$i);
9329
9557
  const {
9330
- Provider: Provider$g
9331
- } = store$g;
9558
+ Provider: Provider$i
9559
+ } = store$i;
9332
9560
 
9333
9561
  const LoginContainer = ({
9334
9562
  style,
@@ -9435,7 +9663,7 @@ const LoginContainer = ({
9435
9663
  });
9436
9664
 
9437
9665
  case RESET_LOGIN_FORM:
9438
- return initialState$g;
9666
+ return initialState$i;
9439
9667
 
9440
9668
  case DISABLE_LOGIN_BUTTON:
9441
9669
  return lib_7({ ...state,
@@ -9453,12 +9681,12 @@ const LoginContainer = ({
9453
9681
  default:
9454
9682
  return state;
9455
9683
  }
9456
- }, initialState$g);
9684
+ }, initialState$i);
9457
9685
  return /*#__PURE__*/React__default.createElement("div", {
9458
9686
  style: { ...style
9459
9687
  },
9460
9688
  className: `pelcro-container pelcro-login-container ${className}`
9461
- }, /*#__PURE__*/React__default.createElement(Provider$g, {
9689
+ }, /*#__PURE__*/React__default.createElement(Provider$i, {
9462
9690
  value: {
9463
9691
  state,
9464
9692
  dispatch
@@ -9466,12 +9694,12 @@ const LoginContainer = ({
9466
9694
  }, children.length ? children.map((child, i) => {
9467
9695
  if (child) {
9468
9696
  return /*#__PURE__*/React__default.cloneElement(child, {
9469
- store: store$g,
9697
+ store: store$i,
9470
9698
  key: i
9471
9699
  });
9472
9700
  }
9473
9701
  }) : /*#__PURE__*/React__default.cloneElement(children, {
9474
- store: store$g
9702
+ store: store$i
9475
9703
  })));
9476
9704
  };
9477
9705
 
@@ -9716,7 +9944,7 @@ const LoginButton = ({
9716
9944
  buttonDisabled
9717
9945
  },
9718
9946
  dispatch
9719
- } = useContext(store$g);
9947
+ } = useContext(store$i);
9720
9948
  const {
9721
9949
  t
9722
9950
  } = useTranslation("login");
@@ -9737,23 +9965,23 @@ const LoginButton = ({
9737
9965
  };
9738
9966
 
9739
9967
  const LoginEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
9740
- store: store$g
9968
+ store: store$i
9741
9969
  }, props));
9742
9970
 
9743
9971
  const LoginPassword = props => /*#__PURE__*/React__default.createElement(Password, Object.assign({
9744
- store: store$g
9972
+ store: store$i
9745
9973
  }, props));
9746
9974
 
9747
- var _path$q;
9975
+ var _path$s;
9748
9976
 
9749
- 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); }
9977
+ 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); }
9750
9978
 
9751
9979
  function SvgCheck(props) {
9752
- return /*#__PURE__*/React.createElement("svg", _extends$s({
9980
+ return /*#__PURE__*/React.createElement("svg", _extends$u({
9753
9981
  xmlns: "http://www.w3.org/2000/svg",
9754
9982
  fill: "currentColor",
9755
9983
  viewBox: "0 0 20 20"
9756
- }, props), _path$q || (_path$q = /*#__PURE__*/React.createElement("path", {
9984
+ }, props), _path$s || (_path$s = /*#__PURE__*/React.createElement("path", {
9757
9985
  fillRule: "evenodd",
9758
9986
  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",
9759
9987
  clipRule: "evenodd"
@@ -9818,7 +10046,7 @@ var facebookLoginRenderProps = createCommonjsModule(function (module, exports) {
9818
10046
  var FacebookLogin = unwrapExports(facebookLoginRenderProps);
9819
10047
  facebookLoginRenderProps.FacebookLogin;
9820
10048
 
9821
- const initialState$f = {
10049
+ const initialState$h = {
9822
10050
  email: "",
9823
10051
  password: "",
9824
10052
  emailError: null,
@@ -9835,10 +10063,10 @@ const initialState$f = {
9835
10063
  content: ""
9836
10064
  }
9837
10065
  };
9838
- const store$f = /*#__PURE__*/createContext(initialState$f);
10066
+ const store$h = /*#__PURE__*/createContext(initialState$h);
9839
10067
  const {
9840
- Provider: Provider$f
9841
- } = store$f;
10068
+ Provider: Provider$h
10069
+ } = store$h;
9842
10070
 
9843
10071
  const RegisterContainer = ({
9844
10072
  style,
@@ -10021,7 +10249,7 @@ const RegisterContainer = ({
10021
10249
  });
10022
10250
 
10023
10251
  case RESET_LOGIN_FORM:
10024
- return initialState$f;
10252
+ return initialState$h;
10025
10253
 
10026
10254
  case DISABLE_REGISTRATION_BUTTON:
10027
10255
  return lib_7({ ...state,
@@ -10039,12 +10267,12 @@ const RegisterContainer = ({
10039
10267
  default:
10040
10268
  return state;
10041
10269
  }
10042
- }, initialState$f);
10270
+ }, initialState$h);
10043
10271
  return /*#__PURE__*/React__default.createElement("div", {
10044
10272
  style: { ...style
10045
10273
  },
10046
10274
  className: `pelcro-container pelcro-register-container ${className}`
10047
- }, /*#__PURE__*/React__default.createElement(Provider$f, {
10275
+ }, /*#__PURE__*/React__default.createElement(Provider$h, {
10048
10276
  value: {
10049
10277
  state,
10050
10278
  dispatch
@@ -10052,12 +10280,12 @@ const RegisterContainer = ({
10052
10280
  }, children.length ? children.map((child, i) => {
10053
10281
  if (child) {
10054
10282
  return /*#__PURE__*/React__default.cloneElement(child, {
10055
- store: store$f,
10283
+ store: store$h,
10056
10284
  key: i
10057
10285
  });
10058
10286
  }
10059
10287
  }) : /*#__PURE__*/React__default.cloneElement(children, {
10060
- store: store$f
10288
+ store: store$h
10061
10289
  })));
10062
10290
  };
10063
10291
  /**
@@ -10072,15 +10300,15 @@ function hasSecurityTokenEnabled$1() {
10072
10300
  return hasSecuritySdkLoaded;
10073
10301
  }
10074
10302
 
10075
- var _path$p;
10303
+ var _path$r;
10076
10304
 
10077
- 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); }
10305
+ 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); }
10078
10306
 
10079
10307
  function SvgFacebookLogo(props) {
10080
- return /*#__PURE__*/React.createElement("svg", _extends$r({
10308
+ return /*#__PURE__*/React.createElement("svg", _extends$t({
10081
10309
  xmlns: "http://www.w3.org/2000/svg",
10082
10310
  viewBox: "88.428 12.828 107.543 207.085"
10083
- }, props), _path$p || (_path$p = /*#__PURE__*/React.createElement("path", {
10311
+ }, props), _path$r || (_path$r = /*#__PURE__*/React.createElement("path", {
10084
10312
  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",
10085
10313
  fill: "#3c5a9a"
10086
10314
  })));
@@ -10097,10 +10325,10 @@ const FacebookLoginButton = ({
10097
10325
  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;
10098
10326
  const {
10099
10327
  dispatch: loginDispatch
10100
- } = useContext(store$g);
10328
+ } = useContext(store$i);
10101
10329
  const {
10102
10330
  dispatch: registerDispatch
10103
- } = useContext(store$f);
10331
+ } = useContext(store$h);
10104
10332
 
10105
10333
  const onSuccess = facebookUser => {
10106
10334
  loginDispatch === null || loginDispatch === void 0 ? void 0 : loginDispatch({
@@ -10153,15 +10381,15 @@ var googleLogin = createCommonjsModule(function (module, exports) {
10153
10381
  unwrapExports(googleLogin);
10154
10382
  var googleLogin_1 = googleLogin.GoogleLogin;
10155
10383
 
10156
- var _path$o, _path2$3, _path3$1, _path4;
10384
+ var _path$q, _path2$3, _path3$1, _path4;
10157
10385
 
10158
- 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); }
10386
+ 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); }
10159
10387
 
10160
10388
  function SvgGoogleLogo(props) {
10161
- return /*#__PURE__*/React.createElement("svg", _extends$q({
10389
+ return /*#__PURE__*/React.createElement("svg", _extends$s({
10162
10390
  viewBox: "0 0 24 24",
10163
10391
  xmlns: "http://www.w3.org/2000/svg"
10164
- }, props), _path$o || (_path$o = /*#__PURE__*/React.createElement("path", {
10392
+ }, props), _path$q || (_path$q = /*#__PURE__*/React.createElement("path", {
10165
10393
  fill: "#4285F4",
10166
10394
  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"
10167
10395
  })), _path2$3 || (_path2$3 = /*#__PURE__*/React.createElement("path", {
@@ -10187,10 +10415,10 @@ const GoogleLoginButton = ({
10187
10415
  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;
10188
10416
  const {
10189
10417
  dispatch: loginDispatch
10190
- } = useContext(store$g);
10418
+ } = useContext(store$i);
10191
10419
  const {
10192
10420
  dispatch: registerDispatch
10193
- } = useContext(store$f);
10421
+ } = useContext(store$h);
10194
10422
 
10195
10423
  const onSuccess = response => {
10196
10424
  var _response$getAuthResp, _profile$getEmail, _profile$getGivenName, _profile$getFamilyNam, _profile$getEmail2, _profile$getGivenName2, _profile$getFamilyNam2;
@@ -10238,15 +10466,15 @@ const GoogleLoginButton = ({
10238
10466
  }) : null;
10239
10467
  };
10240
10468
 
10241
- var _path$n;
10469
+ var _path$p;
10242
10470
 
10243
- 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); }
10471
+ 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); }
10244
10472
 
10245
10473
  function SvgAuth0Logo(props) {
10246
- return /*#__PURE__*/React.createElement("svg", _extends$p({
10474
+ return /*#__PURE__*/React.createElement("svg", _extends$r({
10247
10475
  viewBox: "0 0 256 285",
10248
10476
  xmlns: "http://www.w3.org/2000/svg"
10249
- }, props), _path$n || (_path$n = /*#__PURE__*/React.createElement("path", {
10477
+ }, props), _path$p || (_path$p = /*#__PURE__*/React.createElement("path", {
10250
10478
  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"
10251
10479
  })));
10252
10480
  }
@@ -10286,10 +10514,10 @@ const Auth0LoginButton = ({
10286
10514
  }, [auth0Enabled, auth0Loaded]);
10287
10515
  const {
10288
10516
  dispatch: loginDispatch
10289
- } = useContext(store$g);
10517
+ } = useContext(store$i);
10290
10518
  const {
10291
10519
  dispatch: registerDispatch
10292
- } = useContext(store$f);
10520
+ } = useContext(store$h);
10293
10521
 
10294
10522
  function handleClick() {
10295
10523
  var _auth0InstanceRef$cur, _auth0InstanceRef$cur2, _auth0InstanceRef$cur3;
@@ -10422,15 +10650,15 @@ function LoginView(props) {
10422
10650
  }, /*#__PURE__*/React__default.createElement(GoogleLoginButton, null), /*#__PURE__*/React__default.createElement(FacebookLoginButton, null), /*#__PURE__*/React__default.createElement(Auth0LoginButton, null))))));
10423
10651
  }
10424
10652
 
10425
- var _path$m, _path2$2, _path3;
10653
+ var _path$o, _path2$2, _path3;
10426
10654
 
10427
- 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); }
10655
+ 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); }
10428
10656
 
10429
10657
  function SvgPelcroAuthorship(props) {
10430
- return /*#__PURE__*/React.createElement("svg", _extends$o({
10658
+ return /*#__PURE__*/React.createElement("svg", _extends$q({
10431
10659
  xmlns: "http://www.w3.org/2000/svg",
10432
10660
  viewBox: "0 -80.652 497.072 179.991"
10433
- }, props), _path$m || (_path$m = /*#__PURE__*/React.createElement("path", {
10661
+ }, props), _path$o || (_path$o = /*#__PURE__*/React.createElement("path", {
10434
10662
  fill: "none",
10435
10663
  stroke: "#4a4a4a",
10436
10664
  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"
@@ -10577,11 +10805,11 @@ function LoginModal({
10577
10805
  LoginModal.viewId = "login";
10578
10806
 
10579
10807
  const RegisterEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
10580
- store: store$f
10808
+ store: store$h
10581
10809
  }, props));
10582
10810
 
10583
10811
  const RegisterPassword = props => /*#__PURE__*/React__default.createElement(Password, Object.assign({
10584
- store: store$f
10812
+ store: store$h
10585
10813
  }, props));
10586
10814
 
10587
10815
  const RegisterButton = ({
@@ -10601,7 +10829,7 @@ const RegisterButton = ({
10601
10829
  buttonDisabled
10602
10830
  },
10603
10831
  dispatch
10604
- } = useContext(store$f);
10832
+ } = useContext(store$h);
10605
10833
  const {
10606
10834
  t
10607
10835
  } = useTranslation("register");
@@ -10739,7 +10967,7 @@ function FirstName({
10739
10967
  }
10740
10968
 
10741
10969
  const RegisterFirstName = props => /*#__PURE__*/React__default.createElement(FirstName, Object.assign({
10742
- store: store$f
10970
+ store: store$h
10743
10971
  }, props));
10744
10972
 
10745
10973
  function LastName({
@@ -10770,7 +10998,7 @@ function LastName({
10770
10998
  }
10771
10999
 
10772
11000
  const RegisterLastName = props => /*#__PURE__*/React__default.createElement(LastName, Object.assign({
10773
- store: store$f
11001
+ store: store$h
10774
11002
  }, props));
10775
11003
 
10776
11004
  /**
@@ -10894,7 +11122,7 @@ function TextInput({
10894
11122
 
10895
11123
  const RegisterTextInput = props => {
10896
11124
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({}, props, {
10897
- store: store$f
11125
+ store: store$h
10898
11126
  }));
10899
11127
  };
10900
11128
 
@@ -11041,6 +11269,7 @@ function SelectModalWithHook(props) {
11041
11269
  (_props$onDisplay = props.onDisplay) === null || _props$onDisplay === void 0 ? void 0 : _props$onDisplay.call(props);
11042
11270
  }, []);
11043
11271
  const {
11272
+ productsList,
11044
11273
  isGift,
11045
11274
  plan,
11046
11275
  product,
@@ -11050,11 +11279,12 @@ function SelectModalWithHook(props) {
11050
11279
  view,
11051
11280
  set
11052
11281
  } = usePelcro();
11053
- const entitlementsProtectedElements = document.querySelectorAll("[data-pelcro-entitlements]");
11054
- const entitlements = entitlementsProtectedElements.length > 0 ? getEntitlementsFromElem(entitlementsProtectedElements[0]) : null;
11282
+ const isRenewingSub = view === "_plan-select-renew";
11055
11283
  return /*#__PURE__*/React__default.createElement(SelectModalWithTrans, {
11284
+ productsList: productsList,
11056
11285
  isGift: isGift,
11057
- disableGifting: isRenewingGift,
11286
+ disableGifting: isRenewingGift || isRenewingSub,
11287
+ isRenewingSub: isRenewingSub,
11058
11288
  plan: plan,
11059
11289
  product: product,
11060
11290
  onClose: () => {
@@ -11068,8 +11298,10 @@ function SelectModalWithHook(props) {
11068
11298
  plan,
11069
11299
  isGift
11070
11300
  }),
11071
- setView: switchView,
11072
- matchingEntitlements: view === "_plan-select-entitlements" ? entitlements : null
11301
+ setSubscriptionIdToRenew: subscriptionIdToRenew => set({
11302
+ subscriptionIdToRenew
11303
+ }),
11304
+ setView: switchView
11073
11305
  });
11074
11306
  }
11075
11307
  SelectModalWithHook.viewId = "plan-select";
@@ -11101,10 +11333,10 @@ class SelectModal extends Component {
11101
11333
  });
11102
11334
  }
11103
11335
 
11104
- if (this.state.productList.length === 1) {
11336
+ if (this.props.productsList.length === 1) {
11105
11337
  this.setState({
11106
- product: this.state.productList[0],
11107
- planList: this.state.productList[0].plans,
11338
+ product: this.props.productsList[0],
11339
+ planList: this.props.productsList[0].plans,
11108
11340
  mode: "plan"
11109
11341
  });
11110
11342
  }
@@ -11121,7 +11353,7 @@ class SelectModal extends Component {
11121
11353
  });
11122
11354
 
11123
11355
  _defineProperty$3(this, "onProductChange", e => {
11124
- const product = window.Pelcro.product.list()[e.target.selectedIndex];
11356
+ const product = productsList[e.target.selectedIndex];
11125
11357
  this.setState({
11126
11358
  product: product,
11127
11359
  plan: product.plans[0]
@@ -11187,7 +11419,7 @@ class SelectModal extends Component {
11187
11419
 
11188
11420
  _defineProperty$3(this, "renderProducts", () => {
11189
11421
  const userDidSelectProduct = Boolean(this.state.mode === "plan");
11190
- const productsToShow = userDidSelectProduct ? [this.state.product] : this.state.productList;
11422
+ const productsToShow = userDidSelectProduct ? [this.state.product] : this.props.productsList;
11191
11423
  return productsToShow.map((product, index) => {
11192
11424
  return this.renderOneProduct(product, index);
11193
11425
  });
@@ -11200,7 +11432,7 @@ class SelectModal extends Component {
11200
11432
  return this.renderOneProduct(this.state.product);
11201
11433
  }
11202
11434
 
11203
- const [productsThatMatchArticleTag, allProductsMinusMatched] = productsWithMatchedTaggedFirst(); // Render normal products if there are no available matching products
11435
+ const [productsThatMatchArticleTag, allProductsMinusMatched] = productsWithMatchedTaggedFirst(this.props.productsList); // Render normal products if there are no available matching products
11204
11436
 
11205
11437
  if (!(productsThatMatchArticleTag !== null && productsThatMatchArticleTag !== void 0 && productsThatMatchArticleTag.length)) {
11206
11438
  return this.renderProducts();
@@ -11216,10 +11448,7 @@ class SelectModal extends Component {
11216
11448
  className: "plc-text-sm plc-font-semibold"
11217
11449
  }, this.locale("labels.restrictiveArticles.or")), allProductsMinusMatched.map((product, index) => this.renderOneProduct(product, index))));
11218
11450
 
11219
- function productsWithMatchedTaggedFirst() {
11220
- var _window$Pelcro$produc;
11221
-
11222
- const allProducts = (_window$Pelcro$produc = window.Pelcro.product.list()) !== null && _window$Pelcro$produc !== void 0 ? _window$Pelcro$produc : [];
11451
+ function productsWithMatchedTaggedFirst(allProducts) {
11223
11452
  const productsThatMatchArticleTag = window.Pelcro.product.getByMatchingPageTags();
11224
11453
  const allProductsMinusMatched = allProducts.filter(product => !productsThatMatchArticleTag.some(matchedProduct => matchedProduct.id === product.id));
11225
11454
  return [productsThatMatchArticleTag, allProductsMinusMatched];
@@ -11253,7 +11482,7 @@ class SelectModal extends Component {
11253
11482
  _defineProperty$3(this, "selectProduct", e => {
11254
11483
  const id = e.target.dataset.key;
11255
11484
 
11256
- for (const product of this.state.productList) {
11485
+ for (const product of this.props.productsList) {
11257
11486
  if (+product.id === +id) {
11258
11487
  var _this$state$plan;
11259
11488
 
@@ -11306,6 +11535,14 @@ class SelectModal extends Component {
11306
11535
 
11307
11536
  _defineProperty$3(this, "submitOption", () => {
11308
11537
  this.props.setProductAndPlan(this.state.product, this.state.plan, this.state.isGift);
11538
+
11539
+ if (this.props.isRenewingSub) {
11540
+ var _matchingSub$id;
11541
+
11542
+ const matchingSub = window.Pelcro.subscription.list().find(sub => sub.plan.id === this.state.plan.id && sub.status === "active" && sub.cancel_at_period_end === 1);
11543
+ this.props.setSubscriptionIdToRenew((_matchingSub$id = matchingSub === null || matchingSub === void 0 ? void 0 : matchingSub.id) !== null && _matchingSub$id !== void 0 ? _matchingSub$id : null);
11544
+ }
11545
+
11309
11546
  const {
11310
11547
  product,
11311
11548
  isGift
@@ -11343,8 +11580,7 @@ class SelectModal extends Component {
11343
11580
  plan: {},
11344
11581
  isGift: props.isGift,
11345
11582
  disabled: true,
11346
- mode: "product",
11347
- productList: props.matchingEntitlements ? window.Pelcro.product.getByEntitlements(props.matchingEntitlements) : window.Pelcro.product.list()
11583
+ mode: "product"
11348
11584
  };
11349
11585
  this.product = this.props.product || window.Pelcro.paywall.getProduct();
11350
11586
  this.locale = this.props.t;
@@ -11352,7 +11588,7 @@ class SelectModal extends Component {
11352
11588
  }
11353
11589
 
11354
11590
  render() {
11355
- var _window$Pelcro$produc2, _window$Pelcro$produc3, _window$Pelcro$site$r;
11591
+ var _this$props$productsL, _this$props$productsL2, _window$Pelcro$site$r;
11356
11592
 
11357
11593
  const {
11358
11594
  disableGifting
@@ -11386,7 +11622,7 @@ class SelectModal extends Component {
11386
11622
  className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
11387
11623
  }, /*#__PURE__*/React__default.createElement("h4", {
11388
11624
  className: "plc-text-2xl plc-font-semibold"
11389
- }, this.product && this.product.paywall.select_title || ((_window$Pelcro$produc2 = window.Pelcro.product.list()[0]) === null || _window$Pelcro$produc2 === void 0 ? void 0 : _window$Pelcro$produc2.paywall.select_title)), /*#__PURE__*/React__default.createElement("p", null, this.product && this.product.paywall.select_subtitle || ((_window$Pelcro$produc3 = window.Pelcro.product.list()[0]) === null || _window$Pelcro$produc3 === void 0 ? void 0 : _window$Pelcro$produc3.paywall.select_subtitle))), /*#__PURE__*/React__default.createElement("div", {
11625
+ }, this.product && this.product.paywall.select_title || ((_this$props$productsL = this.props.productsList[0]) === null || _this$props$productsL === void 0 ? void 0 : _this$props$productsL.paywall.select_title)), /*#__PURE__*/React__default.createElement("p", null, this.product && this.product.paywall.select_subtitle || ((_this$props$productsL2 = this.props.productsList[0]) === null || _this$props$productsL2 === void 0 ? void 0 : _this$props$productsL2.paywall.select_subtitle))), /*#__PURE__*/React__default.createElement("div", {
11390
11626
  className: "pelcro-select-products-wrapper"
11391
11627
  }, (_window$Pelcro$site$r = window.Pelcro.site.read()) !== null && _window$Pelcro$site$r !== void 0 && _window$Pelcro$site$r.restrictive_paywall_metatags_enabled ? this.renderMatchingProductsFirst() : this.renderProducts()), this.state.mode === "plan" && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
11392
11628
  className: "plc-overflow-y-scroll plc-max-h-72 pelcro-select-plans-wrapper"
@@ -12563,7 +12799,8 @@ const SUBSCRIPTION_TYPES = {
12563
12799
  CREATE_SUBSCRIPTION: "CREATE_SUBSCRIPTION",
12564
12800
  CREATE_GIFTED_SUBSCRIPTION: "CREATE_GIFTED_SUBSCRIPTION",
12565
12801
  RENEW_SUBSCRIPTION: "RENEW_SUBSCRIPTION",
12566
- RENEW_GIFTED_SUBSCRIPTION: "RENEW_GIFTED_SUBSCRIPTION"
12802
+ RENEW_GIFTED_SUBSCRIPTION: "RENEW_GIFTED_SUBSCRIPTION",
12803
+ PAY_INVOICE: "PAY_INVOICE"
12567
12804
  };
12568
12805
 
12569
12806
  var _isPaymentGatewayInvalid = /*#__PURE__*/new WeakMap();
@@ -12625,6 +12862,8 @@ class Subscription {
12625
12862
  * @property {number} [subscriptionIdToRenew]
12626
12863
  * @property {number} [quantity]
12627
12864
  * @property {string} addressId
12865
+ * @property {number} invoiceId
12866
+ * @property {boolean} isExistingSource
12628
12867
  */
12629
12868
 
12630
12869
  /**
@@ -12665,6 +12904,8 @@ var _renewSubscription = /*#__PURE__*/new WeakMap();
12665
12904
 
12666
12905
  var _renewGiftedSubscription = /*#__PURE__*/new WeakMap();
12667
12906
 
12907
+ var _payInvoice = /*#__PURE__*/new WeakMap();
12908
+
12668
12909
  class StripeGateway {
12669
12910
  constructor() {
12670
12911
  _paymentGateway.set(this, {
@@ -12688,6 +12929,9 @@ class StripeGateway {
12688
12929
  case types.RENEW_GIFTED_SUBSCRIPTION:
12689
12930
  return _classPrivateFieldGet(this, _renewGiftedSubscription).call(this, options, callback);
12690
12931
 
12932
+ case types.PAY_INVOICE:
12933
+ return _classPrivateFieldGet(this, _payInvoice).call(this, options, callback);
12934
+
12691
12935
  default:
12692
12936
  console.error("Unsupported subscriptiion method: Stripe Gateway");
12693
12937
  }
@@ -12796,6 +13040,27 @@ class StripeGateway {
12796
13040
  });
12797
13041
  }
12798
13042
  });
13043
+
13044
+ _payInvoice.set(this, {
13045
+ writable: true,
13046
+ value: (options, callback) => {
13047
+ const {
13048
+ token,
13049
+ invoiceId
13050
+ } = options;
13051
+ const params = options.isExistingSource ? {
13052
+ source_id: token,
13053
+ invoice_id: invoiceId
13054
+ } : {
13055
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway),
13056
+ gateway_token: token,
13057
+ invoice_id: invoiceId
13058
+ };
13059
+ window.Pelcro.invoice.pay(params, (err, res) => {
13060
+ callback(err, res);
13061
+ });
13062
+ }
13063
+ });
12799
13064
  }
12800
13065
 
12801
13066
  }
@@ -12809,6 +13074,8 @@ var _createSubscription2 = /*#__PURE__*/new WeakMap();
12809
13074
 
12810
13075
  var _createGiftedSubscription2 = /*#__PURE__*/new WeakMap();
12811
13076
 
13077
+ var _payInvoice2 = /*#__PURE__*/new WeakMap();
13078
+
12812
13079
  class PaypalGateWay {
12813
13080
  constructor() {
12814
13081
  _paymentGateway2.set(this, {
@@ -12826,6 +13093,9 @@ class PaypalGateWay {
12826
13093
  case types.CREATE_GIFTED_SUBSCRIPTION:
12827
13094
  return _classPrivateFieldGet(this, _createGiftedSubscription2).call(this, options, callback);
12828
13095
 
13096
+ case types.PAY_INVOICE:
13097
+ return _classPrivateFieldGet(this, _payInvoice2).call(this, options, callback);
13098
+
12829
13099
  default:
12830
13100
  console.error("Unsupported subscriptiion method: PayPal Gateway");
12831
13101
  }
@@ -12886,6 +13156,23 @@ class PaypalGateWay {
12886
13156
  });
12887
13157
  }
12888
13158
  });
13159
+
13160
+ _payInvoice2.set(this, {
13161
+ writable: true,
13162
+ value: (options, callback) => {
13163
+ const {
13164
+ token,
13165
+ invoiceId
13166
+ } = options;
13167
+ window.Pelcro.invoice.pay({
13168
+ payment_gateway: _classPrivateFieldGet(this, _paymentGateway2),
13169
+ gateway_token: token,
13170
+ invoice_id: invoiceId
13171
+ }, (err, res) => {
13172
+ callback(err, res);
13173
+ });
13174
+ }
13175
+ });
12889
13176
  }
12890
13177
 
12891
13178
  }
@@ -12910,7 +13197,7 @@ class PaypalGateWay {
12910
13197
 
12911
13198
  /** @type {PaymentStateType} */
12912
13199
 
12913
- const initialState$e = {
13200
+ const initialState$g = {
12914
13201
  disableSubmit: false,
12915
13202
  isLoading: false,
12916
13203
  disableCouponButton: false,
@@ -12929,10 +13216,10 @@ const initialState$e = {
12929
13216
  content: ""
12930
13217
  }
12931
13218
  };
12932
- const store$e = /*#__PURE__*/createContext(initialState$e);
13219
+ const store$g = /*#__PURE__*/createContext(initialState$g);
12933
13220
  const {
12934
- Provider: Provider$e
12935
- } = store$e;
13221
+ Provider: Provider$g
13222
+ } = store$g;
12936
13223
 
12937
13224
  const PaymentMethodContainerWithoutStripe = ({
12938
13225
  style,
@@ -12945,7 +13232,7 @@ const PaymentMethodContainerWithoutStripe = ({
12945
13232
  onFailure = () => {},
12946
13233
  ...props
12947
13234
  }) => {
12948
- var _props$product, _props$plan, _props$subscriptionId, _props$selectedAddres, _props$giftRecipient, _props$isRenewingGift;
13235
+ var _props$product, _props$plan, _props$subscriptionId, _props$selectedAddres, _props$giftRecipient, _props$isRenewingGift, _props$invoice;
12949
13236
 
12950
13237
  const {
12951
13238
  t
@@ -12962,6 +13249,7 @@ const PaymentMethodContainerWithoutStripe = ({
12962
13249
  const selectedAddressId = (_props$selectedAddres = props.selectedAddressId) !== null && _props$selectedAddres !== void 0 ? _props$selectedAddres : pelcroStore.selectedAddressId;
12963
13250
  const giftRecipient = (_props$giftRecipient = props.giftRecipient) !== null && _props$giftRecipient !== void 0 ? _props$giftRecipient : pelcroStore.giftRecipient;
12964
13251
  const isRenewingGift = (_props$isRenewingGift = props.isRenewingGift) !== null && _props$isRenewingGift !== void 0 ? _props$isRenewingGift : pelcroStore.isRenewingGift;
13252
+ const invoice = (_props$invoice = props.invoice) !== null && _props$invoice !== void 0 ? _props$invoice : pelcroStore.invoice;
12965
13253
  useEffect(() => {
12966
13254
  if (window.Pelcro.coupon.getFromUrl()) {
12967
13255
  dispatch({
@@ -13530,6 +13818,38 @@ const PaymentMethodContainerWithoutStripe = ({
13530
13818
  });
13531
13819
  };
13532
13820
 
13821
+ const payInvoice = (gatewayService, gatewayToken, dispatch) => {
13822
+ const subscription = new Subscription(gatewayService);
13823
+ return subscription.execute({
13824
+ type: SUBSCRIPTION_TYPES.PAY_INVOICE,
13825
+ token: gatewayToken,
13826
+ isExistingSource: Boolean(selectedPaymentMethodId),
13827
+ invoiceId: invoice.id
13828
+ }, (err, res) => {
13829
+ dispatch({
13830
+ type: DISABLE_SUBMIT,
13831
+ payload: false
13832
+ });
13833
+ dispatch({
13834
+ type: LOADING,
13835
+ payload: false
13836
+ });
13837
+
13838
+ if (err) {
13839
+ onFailure(err);
13840
+ return dispatch({
13841
+ type: SHOW_ALERT,
13842
+ payload: {
13843
+ type: "error",
13844
+ content: getErrorMessages(err)
13845
+ }
13846
+ });
13847
+ }
13848
+
13849
+ onSuccess(res);
13850
+ });
13851
+ };
13852
+
13533
13853
  const updatePaymentSource = (state, dispatch) => {
13534
13854
  return stripe.createSource({
13535
13855
  type: "card"
@@ -13604,13 +13924,17 @@ const PaymentMethodContainerWithoutStripe = ({
13604
13924
  source,
13605
13925
  error
13606
13926
  }) => {
13607
- var _ref, _state$updatedPrice, _source$card3;
13927
+ var _ref, _ref2, _state$updatedPrice, _source$card3;
13608
13928
 
13609
13929
  if (error) {
13610
13930
  return handlePaymentError(error);
13611
13931
  }
13612
13932
 
13613
13933
  const getOrderItemsTotal = () => {
13934
+ if (!order) {
13935
+ return null;
13936
+ }
13937
+
13614
13938
  const isQuickPurchase = !Array.isArray(order);
13615
13939
 
13616
13940
  if (isQuickPurchase) {
@@ -13626,7 +13950,7 @@ const PaymentMethodContainerWithoutStripe = ({
13626
13950
  }, 0);
13627
13951
  };
13628
13952
 
13629
- 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();
13953
+ 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();
13630
13954
 
13631
13955
  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) {
13632
13956
  return resolveTaxCalculation().then(res => {
@@ -13659,6 +13983,10 @@ const PaymentMethodContainerWithoutStripe = ({
13659
13983
  const resolveTaxCalculation = () => {
13660
13984
  var _window$Pelcro$site$r2;
13661
13985
 
13986
+ if (type === "invoicePayment") {
13987
+ return new Promise(resolve => resolve());
13988
+ }
13989
+
13662
13990
  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;
13663
13991
  return new Promise((resolve, reject) => {
13664
13992
  // resolve early if taxes isn't enabled
@@ -13732,6 +14060,8 @@ const PaymentMethodContainerWithoutStripe = ({
13732
14060
  subscribe(stripeSource, state, dispatch);
13733
14061
  } else if (stripeSource && type === "orderCreate") {
13734
14062
  purchase(stripeSource, state, dispatch);
14063
+ } else if (stripeSource && type === "invoicePayment") {
14064
+ payInvoice(new StripeGateway(), stripeSource.id, dispatch);
13735
14065
  }
13736
14066
  };
13737
14067
 
@@ -13865,7 +14195,13 @@ const PaymentMethodContainerWithoutStripe = ({
13865
14195
  });
13866
14196
 
13867
14197
  case HANDLE_PAYPAL_SUBSCRIPTION:
13868
- return lib_5(state, () => handlePaypalSubscription(state, action.payload));
14198
+ return lib_5(state, (state, dispatch) => {
14199
+ if (type === "invoicePayment") {
14200
+ payInvoice(new PaypalGateway(), action.payload, dispatch);
14201
+ } else {
14202
+ handlePaypalSubscription(state, action.payload);
14203
+ }
14204
+ });
13869
14205
 
13870
14206
  case SET_UPDATED_PRICE:
13871
14207
  return lib_7({ ...state,
@@ -13923,21 +14259,21 @@ const PaymentMethodContainerWithoutStripe = ({
13923
14259
  default:
13924
14260
  return state;
13925
14261
  }
13926
- }, initialState$e);
14262
+ }, initialState$g);
13927
14263
  return /*#__PURE__*/React__default.createElement("div", {
13928
14264
  style: { ...style
13929
14265
  },
13930
14266
  className: `pelcro-container pelcro-payment-container ${className}`
13931
- }, /*#__PURE__*/React__default.createElement(Provider$e, {
14267
+ }, /*#__PURE__*/React__default.createElement(Provider$g, {
13932
14268
  value: {
13933
14269
  state,
13934
14270
  dispatch
13935
14271
  }
13936
14272
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
13937
- store: store$e,
14273
+ store: store$g,
13938
14274
  key: i
13939
14275
  })) : /*#__PURE__*/React__default.cloneElement(children, {
13940
- store: store$e
14276
+ store: store$g
13941
14277
  })));
13942
14278
  };
13943
14279
 
@@ -13959,7 +14295,7 @@ const PaymentMethodContainer = props => {
13959
14295
  stripeAccount: window.Pelcro.site.read().account_id,
13960
14296
  locale: getPageOrDefaultLanguage()
13961
14297
  }, /*#__PURE__*/React__default.createElement(es_11, null, /*#__PURE__*/React__default.createElement(UnwrappedForm, Object.assign({
13962
- store: store$e
14298
+ store: store$g
13963
14299
  }, props))));
13964
14300
  }
13965
14301
 
@@ -14012,7 +14348,7 @@ const PelcroPaymentRequestButton = props => {
14012
14348
  currentPlan,
14013
14349
  updatedPrice
14014
14350
  }
14015
- } = useContext(store$e);
14351
+ } = useContext(store$g);
14016
14352
 
14017
14353
  const updatePaymentRequest = () => {
14018
14354
  // Make sure payment request is up to date, eg. user added a coupon code.
@@ -14072,7 +14408,7 @@ const DiscountedPrice = props => {
14072
14408
  taxAmount,
14073
14409
  percentOff
14074
14410
  }
14075
- } = useContext(store$e);
14411
+ } = useContext(store$g);
14076
14412
  const {
14077
14413
  order,
14078
14414
  plan
@@ -14122,7 +14458,7 @@ const SubmitPaymentMethod = ({
14122
14458
  isLoading,
14123
14459
  updatedPrice
14124
14460
  }
14125
- } = useContext(store$e);
14461
+ } = useContext(store$g);
14126
14462
  const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
14127
14463
  const price = updatedPrice !== null && updatedPrice !== void 0 ? updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount;
14128
14464
  const priceFormatted = getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
@@ -14143,17 +14479,17 @@ const SubmitPaymentMethod = ({
14143
14479
  }, t("labels.pay"), " ", priceFormatted && priceFormatted) : t("labels.submit"));
14144
14480
  };
14145
14481
 
14146
- var _path$l;
14482
+ var _path$n;
14147
14483
 
14148
- 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); }
14484
+ 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); }
14149
14485
 
14150
14486
  function SvgArrowLeft(props) {
14151
- return /*#__PURE__*/React.createElement("svg", _extends$n({
14487
+ return /*#__PURE__*/React.createElement("svg", _extends$p({
14152
14488
  xmlns: "http://www.w3.org/2000/svg",
14153
14489
  fill: "none",
14154
14490
  viewBox: "0 0 24 24",
14155
14491
  stroke: "currentColor"
14156
- }, props), _path$l || (_path$l = /*#__PURE__*/React.createElement("path", {
14492
+ }, props), _path$n || (_path$n = /*#__PURE__*/React.createElement("path", {
14157
14493
  strokeLinecap: "round",
14158
14494
  strokeLinejoin: "round",
14159
14495
  strokeWidth: 2,
@@ -14172,7 +14508,7 @@ const ApplyCouponButton = ({
14172
14508
  disableCouponButton
14173
14509
  },
14174
14510
  dispatch
14175
- } = useContext(store$e);
14511
+ } = useContext(store$g);
14176
14512
  const {
14177
14513
  t
14178
14514
  } = useTranslation("checkoutForm");
@@ -14206,7 +14542,7 @@ const CouponCodeField = props => {
14206
14542
  couponCode,
14207
14543
  couponError
14208
14544
  }
14209
- } = useContext(store$e);
14545
+ } = useContext(store$g);
14210
14546
 
14211
14547
  const onCouponCodeChange = e => {
14212
14548
  dispatch({
@@ -14235,17 +14571,17 @@ const CouponCodeField = props => {
14235
14571
  }, props));
14236
14572
  };
14237
14573
 
14238
- var _path$k;
14574
+ var _path$m;
14239
14575
 
14240
- 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); }
14576
+ 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); }
14241
14577
 
14242
14578
  function SvgTicket(props) {
14243
- return /*#__PURE__*/React.createElement("svg", _extends$m({
14579
+ return /*#__PURE__*/React.createElement("svg", _extends$o({
14244
14580
  xmlns: "http://www.w3.org/2000/svg",
14245
14581
  fill: "none",
14246
14582
  viewBox: "0 0 24 24",
14247
14583
  stroke: "currentColor"
14248
- }, props), _path$k || (_path$k = /*#__PURE__*/React.createElement("path", {
14584
+ }, props), _path$m || (_path$m = /*#__PURE__*/React.createElement("path", {
14249
14585
  strokeLinecap: "round",
14250
14586
  strokeLinejoin: "round",
14251
14587
  strokeWidth: 2,
@@ -14262,7 +14598,7 @@ const CouponCode = ({
14262
14598
  state: {
14263
14599
  enableCouponField
14264
14600
  }
14265
- } = useContext(store$e);
14601
+ } = useContext(store$g);
14266
14602
  const {
14267
14603
  t
14268
14604
  } = useTranslation("checkoutForm");
@@ -14519,17 +14855,18 @@ const PaypalSubscribeButton = props => {
14519
14855
  const {
14520
14856
  dispatch,
14521
14857
  state
14522
- } = useContext(store$e);
14858
+ } = useContext(store$g);
14523
14859
  const {
14524
14860
  product,
14525
14861
  plan,
14862
+ invoice,
14526
14863
  selectedAddressId
14527
14864
  } = usePelcro();
14528
14865
  useEffect(() => {
14529
- var _ref, _state$updatedPrice, _props$plan, _props$selectedAddres;
14866
+ var _ref, _ref2, _state$updatedPrice, _props$plan, _props$selectedAddres;
14530
14867
 
14531
14868
  // sometimes, price is updated. eg. Coupon codes.
14532
- 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;
14869
+ 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;
14533
14870
  const selectedAddress = getAddressById((_props$selectedAddres = props.selectedAddressId) !== null && _props$selectedAddres !== void 0 ? _props$selectedAddres : selectedAddressId); // initialize paypal client, then render paypal button.
14534
14871
 
14535
14872
  const initializePaypal = async () => {
@@ -14538,7 +14875,7 @@ const PaypalSubscribeButton = props => {
14538
14875
  const paypalCheckoutInstance = new PaypalClient({
14539
14876
  buttonElementID: (_props$buttonElementI = props.buttonElementID) !== null && _props$buttonElementI !== void 0 ? _props$buttonElementI : "pelcro-paypal-button",
14540
14877
  style: props.buttonStyle,
14541
- 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,
14878
+ 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,
14542
14879
  shippingAddressEditable: props.makeAddressEditable,
14543
14880
  displayName: props.merchantDisplayName,
14544
14881
  locale: props.locale,
@@ -14548,9 +14885,9 @@ const PaypalSubscribeButton = props => {
14548
14885
  await paypalCheckoutInstance.build(); // Create paypal payment
14549
14886
 
14550
14887
  paypalCheckoutInstance.createPayment({
14551
- product: (_props$plan2 = props.plan) !== null && _props$plan2 !== void 0 ? _props$plan2 : plan,
14888
+ product: invoice ? invoice.plan : (_props$plan2 = props.plan) !== null && _props$plan2 !== void 0 ? _props$plan2 : plan,
14552
14889
  amount: updatedPrice,
14553
- address: selectedAddress,
14890
+ address: invoice ? null : selectedAddress,
14554
14891
  onButtonClick: () => {
14555
14892
  dispatch({
14556
14893
  type: DISABLE_SUBMIT,
@@ -14604,16 +14941,16 @@ const BankRedirection = () => {
14604
14941
  }));
14605
14942
  };
14606
14943
 
14607
- var _path$j;
14944
+ var _path$l;
14608
14945
 
14609
- 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); }
14946
+ 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); }
14610
14947
 
14611
14948
  function SvgLock(props) {
14612
- return /*#__PURE__*/React.createElement("svg", _extends$l({
14949
+ return /*#__PURE__*/React.createElement("svg", _extends$n({
14613
14950
  xmlns: "http://www.w3.org/2000/svg",
14614
14951
  viewBox: "0 0 20 20",
14615
14952
  fill: "currentColor"
14616
- }, props), _path$j || (_path$j = /*#__PURE__*/React.createElement("path", {
14953
+ }, props), _path$l || (_path$l = /*#__PURE__*/React.createElement("path", {
14617
14954
  fillRule: "evenodd",
14618
14955
  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",
14619
14956
  clipRule: "evenodd"
@@ -14630,7 +14967,7 @@ const SelectedPaymentMethod = () => {
14630
14967
  state: {
14631
14968
  isLoading
14632
14969
  }
14633
- } = useContext(store$e);
14970
+ } = useContext(store$g);
14634
14971
  const {
14635
14972
  switchView,
14636
14973
  selectedPaymentMethodId
@@ -14672,7 +15009,7 @@ const TaxAmount = () => {
14672
15009
  state: {
14673
15010
  taxAmount
14674
15011
  }
14675
- } = useContext(store$e);
15012
+ } = useContext(store$g);
14676
15013
  const {
14677
15014
  plan
14678
15015
  } = usePelcro();
@@ -14835,12 +15172,12 @@ function SubscriptionRenewModal({
14835
15172
  }
14836
15173
  SubscriptionRenewModal.viewId = "subscription-renew";
14837
15174
 
14838
- var _path$i;
15175
+ var _path$k;
14839
15176
 
14840
- 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); }
15177
+ 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); }
14841
15178
 
14842
15179
  function SvgGift(props) {
14843
- return /*#__PURE__*/React.createElement("svg", _extends$k({
15180
+ return /*#__PURE__*/React.createElement("svg", _extends$m({
14844
15181
  className: "plc-w-6 plc-h-6 plc-mr-2",
14845
15182
  fill: "none",
14846
15183
  stroke: "currentColor",
@@ -14849,7 +15186,7 @@ function SvgGift(props) {
14849
15186
  strokeWidth: 2,
14850
15187
  viewBox: "0 0 24 24",
14851
15188
  xmlns: "http://www.w3.org/2000/svg"
14852
- }, props), _path$i || (_path$i = /*#__PURE__*/React.createElement("path", {
15189
+ }, props), _path$k || (_path$k = /*#__PURE__*/React.createElement("path", {
14853
15190
  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"
14854
15191
  })));
14855
15192
  }
@@ -14887,10 +15224,13 @@ const getCurrentFlow = () => {
14887
15224
  const {
14888
15225
  product,
14889
15226
  giftRecipient,
14890
- giftCode
15227
+ giftCode,
15228
+ invoice
14891
15229
  } = usePelcro.getStore();
14892
15230
 
14893
- if (giftRecipient) {
15231
+ if (invoice) {
15232
+ return "invoicePayment";
15233
+ } else if (giftRecipient) {
14894
15234
  return "giftCreate";
14895
15235
  } else if (giftCode) {
14896
15236
  return "giftRedeem";
@@ -14927,6 +15267,13 @@ const getSuccessContent = i18n => {
14927
15267
  }),
14928
15268
  successTitle: i18n("messages.giftRedeem.title"),
14929
15269
  successContent: i18n("messages.giftRedeem.content")
15270
+ },
15271
+ invoicePayment: {
15272
+ successIcon: /*#__PURE__*/React__default.createElement(SvgCheckSolid, {
15273
+ className: "plc-w-32 plc-my-4 plc-text-green-500"
15274
+ }),
15275
+ successTitle: i18n("messages.invoicePayment.title"),
15276
+ successContent: i18n("messages.invoicePayment.content")
14930
15277
  }
14931
15278
  };
14932
15279
  return wordingDictionary[flow];
@@ -15180,7 +15527,7 @@ class DefaultNewsLetter extends Component {
15180
15527
 
15181
15528
  const NewsLetter = withTranslation("newsletter")(DefaultNewsLetter);
15182
15529
 
15183
- const initialState$d = {
15530
+ const initialState$f = {
15184
15531
  didSubToNewslettersBefore: false,
15185
15532
  newsletters: [],
15186
15533
  isListLoading: true,
@@ -15190,10 +15537,10 @@ const initialState$d = {
15190
15537
  content: ""
15191
15538
  }
15192
15539
  };
15193
- const store$d = /*#__PURE__*/createContext(initialState$d);
15540
+ const store$f = /*#__PURE__*/createContext(initialState$f);
15194
15541
  const {
15195
- Provider: Provider$d
15196
- } = store$d;
15542
+ Provider: Provider$f
15543
+ } = store$f;
15197
15544
 
15198
15545
  const NewsletterUpdateContainer = ({
15199
15546
  style,
@@ -15306,7 +15653,7 @@ const NewsletterUpdateContainer = ({
15306
15653
  default:
15307
15654
  return state;
15308
15655
  }
15309
- }, initialState$d);
15656
+ }, initialState$f);
15310
15657
  useEffect(() => {
15311
15658
  const getUserNewsletters = () => {
15312
15659
  var _window$Pelcro$user$r3, _window$Pelcro$user$r4;
@@ -15350,7 +15697,7 @@ const NewsletterUpdateContainer = ({
15350
15697
  style: { ...style
15351
15698
  },
15352
15699
  className: `pelcro-container pelcro-newsletter-update-container ${className}`
15353
- }, /*#__PURE__*/React__default.createElement(Provider$d, {
15700
+ }, /*#__PURE__*/React__default.createElement(Provider$f, {
15354
15701
  value: {
15355
15702
  state,
15356
15703
  dispatch
@@ -15358,12 +15705,12 @@ const NewsletterUpdateContainer = ({
15358
15705
  }, children.length ? children.map((child, i) => {
15359
15706
  if (child) {
15360
15707
  return /*#__PURE__*/React__default.cloneElement(child, {
15361
- store: store$d,
15708
+ store: store$f,
15362
15709
  key: i
15363
15710
  });
15364
15711
  }
15365
15712
  }) : /*#__PURE__*/React__default.cloneElement(children, {
15366
- store: store$d
15713
+ store: store$f
15367
15714
  })));
15368
15715
  };
15369
15716
 
@@ -15378,7 +15725,7 @@ const NewsletterUpdateButton = ({
15378
15725
  isSubmitting,
15379
15726
  isListLoading
15380
15727
  }
15381
- } = useContext(store$d);
15728
+ } = useContext(store$f);
15382
15729
  const {
15383
15730
  t
15384
15731
  } = useTranslation("newsletter");
@@ -15408,7 +15755,7 @@ const NewsletterUpdateList = () => {
15408
15755
  newsletters,
15409
15756
  isListLoading
15410
15757
  }
15411
- } = useContext(store$d);
15758
+ } = useContext(store$f);
15412
15759
 
15413
15760
  if (isListLoading) {
15414
15761
  return /*#__PURE__*/React__default.createElement(Loader, {
@@ -15612,7 +15959,7 @@ function SubscriptionCreateModal({
15612
15959
  SubscriptionCreateModal.viewId = "subscription-create";
15613
15960
 
15614
15961
  var _window$Pelcro$user$r, _window$Pelcro$user$r2, _window$Pelcro$user$r3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
15615
- const initialState$c = {
15962
+ const initialState$e = {
15616
15963
  email: (_window$Pelcro$user$r = window.Pelcro.user.read()) === null || _window$Pelcro$user$r === void 0 ? void 0 : _window$Pelcro$user$r.email,
15617
15964
  firstName: (_window$Pelcro$user$r2 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.first_name,
15618
15965
  lastName: (_window$Pelcro$user$r3 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r3 === void 0 ? void 0 : _window$Pelcro$user$r3.last_name,
@@ -15625,10 +15972,10 @@ const initialState$c = {
15625
15972
  content: ""
15626
15973
  }
15627
15974
  };
15628
- const store$c = /*#__PURE__*/createContext(initialState$c);
15975
+ const store$e = /*#__PURE__*/createContext(initialState$e);
15629
15976
  const {
15630
- Provider: Provider$c
15631
- } = store$c;
15977
+ Provider: Provider$e
15978
+ } = store$e;
15632
15979
 
15633
15980
  const UserUpdateContainer = ({
15634
15981
  style,
@@ -15760,27 +16107,27 @@ const UserUpdateContainer = ({
15760
16107
  default:
15761
16108
  return state;
15762
16109
  }
15763
- }, initialState$c);
16110
+ }, initialState$e);
15764
16111
  return /*#__PURE__*/React__default.createElement("div", {
15765
16112
  style: { ...style
15766
16113
  },
15767
16114
  className: `pelcro-container pelcro-user-update-container ${className}`
15768
- }, /*#__PURE__*/React__default.createElement(Provider$c, {
16115
+ }, /*#__PURE__*/React__default.createElement(Provider$e, {
15769
16116
  value: {
15770
16117
  state,
15771
16118
  dispatch
15772
16119
  }
15773
16120
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
15774
- store: store$c,
16121
+ store: store$e,
15775
16122
  key: i
15776
16123
  })) : /*#__PURE__*/React__default.cloneElement(children, {
15777
- store: store$c
16124
+ store: store$e
15778
16125
  })));
15779
16126
  };
15780
16127
 
15781
16128
  const UserUpdateEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
15782
16129
  disabled: true,
15783
- store: store$c
16130
+ store: store$e
15784
16131
  }, props));
15785
16132
 
15786
16133
  const UserUpdateButton = ({
@@ -15793,7 +16140,7 @@ const UserUpdateButton = ({
15793
16140
  buttonDisabled
15794
16141
  },
15795
16142
  dispatch
15796
- } = useContext(store$c);
16143
+ } = useContext(store$e);
15797
16144
  const {
15798
16145
  t
15799
16146
  } = useTranslation("userEdit");
@@ -15810,11 +16157,11 @@ const UserUpdateButton = ({
15810
16157
  };
15811
16158
 
15812
16159
  const UserUpdateFirstName = props => /*#__PURE__*/React__default.createElement(FirstName, Object.assign({
15813
- store: store$c
16160
+ store: store$e
15814
16161
  }, props));
15815
16162
 
15816
16163
  const UserUpdateLastName = props => /*#__PURE__*/React__default.createElement(LastName, Object.assign({
15817
- store: store$c
16164
+ store: store$e
15818
16165
  }, props));
15819
16166
 
15820
16167
  function Phone({
@@ -15843,22 +16190,22 @@ function Phone({
15843
16190
  }
15844
16191
 
15845
16192
  const UserUpdatePhone = props => /*#__PURE__*/React__default.createElement(Phone, Object.assign({
15846
- store: store$c
16193
+ store: store$e
15847
16194
  }, props));
15848
16195
 
15849
16196
  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";
15850
16197
 
15851
- var _path$h;
16198
+ var _path$j;
15852
16199
 
15853
- 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); }
16200
+ 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); }
15854
16201
 
15855
16202
  function SvgEdit(props) {
15856
- return /*#__PURE__*/React.createElement("svg", _extends$j({
16203
+ return /*#__PURE__*/React.createElement("svg", _extends$l({
15857
16204
  className: "plc-w-6 plc-h-6",
15858
16205
  xmlns: "http://www.w3.org/2000/svg",
15859
16206
  viewBox: "0 0 20 20",
15860
16207
  fill: "currentColor"
15861
- }, props), _path$h || (_path$h = /*#__PURE__*/React.createElement("path", {
16208
+ }, props), _path$j || (_path$j = /*#__PURE__*/React.createElement("path", {
15862
16209
  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"
15863
16210
  })));
15864
16211
  }
@@ -15990,16 +16337,16 @@ function DisplayName({
15990
16337
  }
15991
16338
 
15992
16339
  const UserUpdateDisplayName = props => /*#__PURE__*/React__default.createElement(DisplayName, Object.assign({
15993
- store: store$c
16340
+ store: store$e
15994
16341
  }, props));
15995
16342
 
15996
16343
  const UserUpdateTextInput = props => {
15997
16344
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({}, props, {
15998
- store: store$c
16345
+ store: store$e
15999
16346
  }));
16000
16347
  };
16001
16348
 
16002
- const initialState$b = {
16349
+ const initialState$d = {
16003
16350
  isSubmitting: false,
16004
16351
  firstName: "",
16005
16352
  firstNameError: "",
@@ -16024,10 +16371,10 @@ const initialState$b = {
16024
16371
  content: ""
16025
16372
  }
16026
16373
  };
16027
- const store$b = /*#__PURE__*/createContext(initialState$b);
16374
+ const store$d = /*#__PURE__*/createContext(initialState$d);
16028
16375
  const {
16029
- Provider: Provider$b
16030
- } = store$b;
16376
+ Provider: Provider$d
16377
+ } = store$d;
16031
16378
 
16032
16379
  const getNewlyCreatedAddress = addresses => addresses[addresses.length - 1];
16033
16380
 
@@ -16234,7 +16581,7 @@ const AddressCreateContainer = ({
16234
16581
  default:
16235
16582
  return state;
16236
16583
  }
16237
- }, initialState$b);
16584
+ }, initialState$d);
16238
16585
  useEffect(() => {
16239
16586
  const getStates = () => {
16240
16587
  dispatch({
@@ -16266,16 +16613,16 @@ const AddressCreateContainer = ({
16266
16613
  style: { ...style
16267
16614
  },
16268
16615
  className: `pelcro-container pelcro-address-create-container ${className}`
16269
- }, /*#__PURE__*/React__default.createElement(Provider$b, {
16616
+ }, /*#__PURE__*/React__default.createElement(Provider$d, {
16270
16617
  value: {
16271
16618
  state,
16272
16619
  dispatch
16273
16620
  }
16274
16621
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
16275
- store: store$b,
16622
+ store: store$d,
16276
16623
  key: i
16277
16624
  })) : /*#__PURE__*/React__default.cloneElement(children, {
16278
- store: store$b
16625
+ store: store$d
16279
16626
  })));
16280
16627
  };
16281
16628
 
@@ -16286,7 +16633,7 @@ function AddressCreateFirstName(props) {
16286
16633
  firstName,
16287
16634
  firstNameError
16288
16635
  }
16289
- } = useContext(store$b);
16636
+ } = useContext(store$d);
16290
16637
 
16291
16638
  const handleBlur = () => {
16292
16639
  return dispatch({
@@ -16329,7 +16676,7 @@ function AddressCreateLastName(props) {
16329
16676
  lastName,
16330
16677
  lastNameError
16331
16678
  }
16332
- } = useContext(store$b);
16679
+ } = useContext(store$d);
16333
16680
 
16334
16681
  const handleBlur = () => {
16335
16682
  return dispatch({
@@ -16372,7 +16719,7 @@ function AddressCreateLine1(props) {
16372
16719
  line1,
16373
16720
  line1Error
16374
16721
  }
16375
- } = useContext(store$b);
16722
+ } = useContext(store$d);
16376
16723
 
16377
16724
  const handleBlur = () => {
16378
16725
  return dispatch({
@@ -16415,7 +16762,7 @@ function AddressCreateCity(props) {
16415
16762
  city,
16416
16763
  cityError
16417
16764
  }
16418
- } = useContext(store$b);
16765
+ } = useContext(store$d);
16419
16766
 
16420
16767
  const handleBlur = () => {
16421
16768
  return dispatch({
@@ -16458,7 +16805,7 @@ function AddressCreatePostalCode(props) {
16458
16805
  postalCode,
16459
16806
  postalCodeError
16460
16807
  }
16461
- } = useContext(store$b);
16808
+ } = useContext(store$d);
16462
16809
 
16463
16810
  const handleBlur = () => {
16464
16811
  return dispatch({
@@ -16504,7 +16851,7 @@ const AddressCreateSubmit = ({
16504
16851
  state: {
16505
16852
  isSubmitting
16506
16853
  }
16507
- } = useContext(store$b);
16854
+ } = useContext(store$d);
16508
16855
  const {
16509
16856
  t
16510
16857
  } = useTranslation("address");
@@ -16615,7 +16962,7 @@ function CountrySelect({
16615
16962
  }
16616
16963
 
16617
16964
  const AddressCreateCountrySelect = props => /*#__PURE__*/React__default.createElement(CountrySelect, Object.assign({
16618
- store: store$b
16965
+ store: store$d
16619
16966
  }, props));
16620
16967
 
16621
16968
  function StateSelect({
@@ -16703,7 +17050,7 @@ function StateSelect({
16703
17050
  }
16704
17051
 
16705
17052
  const AddressCreateStateSelect = props => /*#__PURE__*/React__default.createElement(StateSelect, Object.assign({
16706
- store: store$b
17053
+ store: store$d
16707
17054
  }, props));
16708
17055
 
16709
17056
  const AddressCreateView = props => {
@@ -16808,18 +17155,18 @@ AddressCreateModal.viewId = "address-create";
16808
17155
 
16809
17156
  const AddressCreateTextInput = props => {
16810
17157
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({}, props, {
16811
- store: store$b
17158
+ store: store$d
16812
17159
  }));
16813
17160
  };
16814
17161
 
16815
17162
  const AddressCreateLine2 = props => {
16816
17163
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({
16817
17164
  fieldName: "line2",
16818
- store: store$b
17165
+ store: store$d
16819
17166
  }, props));
16820
17167
  };
16821
17168
 
16822
- const initialState$a = {
17169
+ const initialState$c = {
16823
17170
  isSubmitting: false,
16824
17171
  firstName: "",
16825
17172
  firstNameError: "",
@@ -16844,10 +17191,10 @@ const initialState$a = {
16844
17191
  content: ""
16845
17192
  }
16846
17193
  };
16847
- const store$a = /*#__PURE__*/createContext(initialState$a);
17194
+ const store$c = /*#__PURE__*/createContext(initialState$c);
16848
17195
  const {
16849
- Provider: Provider$a
16850
- } = store$a;
17196
+ Provider: Provider$c
17197
+ } = store$c;
16851
17198
 
16852
17199
  const AddressUpdateContainer = ({
16853
17200
  style,
@@ -16899,7 +17246,7 @@ const AddressUpdateContainer = ({
16899
17246
  const thisAddress = addresses[address];
16900
17247
 
16901
17248
  if (+thisAddress.id === +addressId) {
16902
- const newState = { ...initialState$a,
17249
+ const newState = { ...initialState$c,
16903
17250
  firstName: thisAddress.first_name,
16904
17251
  lastName: thisAddress.last_name,
16905
17252
  line1: thisAddress.line1,
@@ -17032,7 +17379,7 @@ const AddressUpdateContainer = ({
17032
17379
  default:
17033
17380
  return state;
17034
17381
  }
17035
- }, initialState$a);
17382
+ }, initialState$c);
17036
17383
  useEffect(() => {
17037
17384
  const getStates = () => {
17038
17385
  dispatch({
@@ -17064,21 +17411,21 @@ const AddressUpdateContainer = ({
17064
17411
  style: { ...style
17065
17412
  },
17066
17413
  className: `pelcro-container pelcro-address-update-container ${className}`
17067
- }, /*#__PURE__*/React__default.createElement(Provider$a, {
17414
+ }, /*#__PURE__*/React__default.createElement(Provider$c, {
17068
17415
  value: {
17069
17416
  state,
17070
17417
  dispatch
17071
17418
  }
17072
17419
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
17073
- store: store$a,
17420
+ store: store$c,
17074
17421
  key: i
17075
17422
  })) : /*#__PURE__*/React__default.cloneElement(children, {
17076
- store: store$a
17423
+ store: store$c
17077
17424
  })));
17078
17425
  };
17079
17426
 
17080
17427
  const AddressUpdateCountrySelect = props => /*#__PURE__*/React__default.createElement(CountrySelect, Object.assign({
17081
- store: store$a
17428
+ store: store$c
17082
17429
  }, props));
17083
17430
 
17084
17431
  function AddressUpdateFirstName(props) {
@@ -17088,7 +17435,7 @@ function AddressUpdateFirstName(props) {
17088
17435
  firstName,
17089
17436
  firstNameError
17090
17437
  }
17091
- } = useContext(store$a);
17438
+ } = useContext(store$c);
17092
17439
 
17093
17440
  const handleBlur = () => {
17094
17441
  return dispatch({
@@ -17131,7 +17478,7 @@ function AddressUpdateLastName(props) {
17131
17478
  lastName,
17132
17479
  lastNameError
17133
17480
  }
17134
- } = useContext(store$a);
17481
+ } = useContext(store$c);
17135
17482
 
17136
17483
  const handleBlur = () => {
17137
17484
  return dispatch({
@@ -17174,7 +17521,7 @@ function AddressUpdateLine1(props) {
17174
17521
  line1,
17175
17522
  line1Error
17176
17523
  }
17177
- } = useContext(store$a);
17524
+ } = useContext(store$c);
17178
17525
 
17179
17526
  const handleBlur = () => {
17180
17527
  return dispatch({
@@ -17214,7 +17561,7 @@ const AddressUpdateLine2 = props => {
17214
17561
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({
17215
17562
  fieldName: "line2"
17216
17563
  }, props, {
17217
- store: store$a
17564
+ store: store$c
17218
17565
  }));
17219
17566
  };
17220
17567
 
@@ -17225,7 +17572,7 @@ function AddressUpdateCity(props) {
17225
17572
  city,
17226
17573
  cityError
17227
17574
  }
17228
- } = useContext(store$a);
17575
+ } = useContext(store$c);
17229
17576
 
17230
17577
  const handleBlur = () => {
17231
17578
  return dispatch({
@@ -17268,7 +17615,7 @@ function AddressUpdatePostalCode(props) {
17268
17615
  postalCode,
17269
17616
  postalCodeError
17270
17617
  }
17271
- } = useContext(store$a);
17618
+ } = useContext(store$c);
17272
17619
 
17273
17620
  const handleBlur = () => {
17274
17621
  return dispatch({
@@ -17314,7 +17661,7 @@ const AddressUpdateSubmit = ({
17314
17661
  state: {
17315
17662
  isSubmitting
17316
17663
  }
17317
- } = useContext(store$a);
17664
+ } = useContext(store$c);
17318
17665
  const {
17319
17666
  t
17320
17667
  } = useTranslation("address");
@@ -17330,7 +17677,7 @@ const AddressUpdateSubmit = ({
17330
17677
  };
17331
17678
 
17332
17679
  const AddressUpdateStateSelect = props => /*#__PURE__*/React__default.createElement(StateSelect, Object.assign({
17333
- store: store$a
17680
+ store: store$c
17334
17681
  }, props));
17335
17682
 
17336
17683
  const AddressUpdateView = props => {
@@ -17413,7 +17760,7 @@ AddressUpdateModal.viewId = "address-edit";
17413
17760
 
17414
17761
  const AddressUpdateTextInput = props => {
17415
17762
  return /*#__PURE__*/React__default.createElement(TextInput, Object.assign({}, props, {
17416
- store: store$a
17763
+ store: store$c
17417
17764
  }));
17418
17765
  };
17419
17766
 
@@ -17496,7 +17843,7 @@ const PaymentMethodUpdateModal = props => {
17496
17843
  };
17497
17844
  PaymentMethodUpdateModal.viewId = "payment-method-update";
17498
17845
 
17499
- const initialState$9 = {
17846
+ const initialState$b = {
17500
17847
  email: "",
17501
17848
  password: "",
17502
17849
  passwordError: null,
@@ -17509,10 +17856,10 @@ const initialState$9 = {
17509
17856
  content: ""
17510
17857
  }
17511
17858
  };
17512
- const store$9 = /*#__PURE__*/createContext(initialState$9);
17859
+ const store$b = /*#__PURE__*/createContext(initialState$b);
17513
17860
  const {
17514
- Provider: Provider$9
17515
- } = store$9;
17861
+ Provider: Provider$b
17862
+ } = store$b;
17516
17863
 
17517
17864
  const PasswordResetContainer = ({
17518
17865
  style,
@@ -17569,7 +17916,7 @@ const PasswordResetContainer = ({
17569
17916
  type: SET_EMAIL,
17570
17917
  payload: window.Pelcro.helpers.getURLParameter("email")
17571
17918
  });
17572
- initialState$9.email = window.Pelcro.helpers.getURLParameter("email");
17919
+ initialState$b.email = window.Pelcro.helpers.getURLParameter("email");
17573
17920
  dispatch({
17574
17921
  type: SET_TOKEN,
17575
17922
  payload: window.Pelcro.helpers.getURLParameter("token")
@@ -17629,26 +17976,26 @@ const PasswordResetContainer = ({
17629
17976
  default:
17630
17977
  return state;
17631
17978
  }
17632
- }, initialState$9);
17979
+ }, initialState$b);
17633
17980
  return /*#__PURE__*/React__default.createElement("div", {
17634
17981
  style: { ...style
17635
17982
  },
17636
17983
  className: `pelcro-container pelcro-password-reset-container ${className}`
17637
- }, /*#__PURE__*/React__default.createElement(Provider$9, {
17984
+ }, /*#__PURE__*/React__default.createElement(Provider$b, {
17638
17985
  value: {
17639
17986
  state,
17640
17987
  dispatch
17641
17988
  }
17642
17989
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
17643
- store: store$9,
17990
+ store: store$b,
17644
17991
  key: i
17645
17992
  })) : /*#__PURE__*/React__default.cloneElement(children, {
17646
- store: store$9
17993
+ store: store$b
17647
17994
  })));
17648
17995
  };
17649
17996
 
17650
17997
  const PasswordResetPassword = props => /*#__PURE__*/React__default.createElement(Password, Object.assign({
17651
- store: store$9
17998
+ store: store$b
17652
17999
  }, props));
17653
18000
 
17654
18001
  const PasswordResetButton = ({
@@ -17661,7 +18008,7 @@ const PasswordResetButton = ({
17661
18008
  buttonDisabled
17662
18009
  },
17663
18010
  dispatch
17664
- } = useContext(store$9);
18011
+ } = useContext(store$b);
17665
18012
  const {
17666
18013
  t
17667
18014
  } = useTranslation("passwordReset");
@@ -17678,14 +18025,14 @@ const PasswordResetButton = ({
17678
18025
  };
17679
18026
 
17680
18027
  const PasswordResetEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
17681
- store: store$9
18028
+ store: store$b
17682
18029
  }, props, {
17683
18030
  value: window.Pelcro.helpers.getURLParameter("email"),
17684
18031
  disabled: true
17685
18032
  }));
17686
18033
 
17687
18034
  const PasswordResetConfirmPassword = props => /*#__PURE__*/React__default.createElement(ConfirmPassword, Object.assign({
17688
- store: store$9
18035
+ store: store$b
17689
18036
  }, props));
17690
18037
 
17691
18038
  const PasswordResetView = props => {
@@ -17737,7 +18084,7 @@ const PasswordResetModal = ({
17737
18084
  };
17738
18085
  PasswordResetModal.viewId = "password-reset";
17739
18086
 
17740
- const initialState$8 = {
18087
+ const initialState$a = {
17741
18088
  email: "",
17742
18089
  emailError: null,
17743
18090
  buttonDisabled: false,
@@ -17746,10 +18093,10 @@ const initialState$8 = {
17746
18093
  content: ""
17747
18094
  }
17748
18095
  };
17749
- const store$8 = /*#__PURE__*/createContext(initialState$8);
18096
+ const store$a = /*#__PURE__*/createContext(initialState$a);
17750
18097
  const {
17751
- Provider: Provider$8
17752
- } = store$8;
18098
+ Provider: Provider$a
18099
+ } = store$a;
17753
18100
 
17754
18101
  const PasswordForgotContainer = ({
17755
18102
  style,
@@ -17827,21 +18174,21 @@ const PasswordForgotContainer = ({
17827
18174
  default:
17828
18175
  return state;
17829
18176
  }
17830
- }, initialState$8);
18177
+ }, initialState$a);
17831
18178
  return /*#__PURE__*/React__default.createElement("div", {
17832
18179
  style: { ...style
17833
18180
  },
17834
18181
  className: `pelcro-container pelcro-password-forgot-container ${className}`
17835
- }, /*#__PURE__*/React__default.createElement(Provider$8, {
18182
+ }, /*#__PURE__*/React__default.createElement(Provider$a, {
17836
18183
  value: {
17837
18184
  state,
17838
18185
  dispatch
17839
18186
  }
17840
18187
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
17841
- store: store$8,
18188
+ store: store$a,
17842
18189
  key: i
17843
18190
  })) : /*#__PURE__*/React__default.cloneElement(children, {
17844
- store: store$8
18191
+ store: store$a
17845
18192
  })));
17846
18193
  };
17847
18194
 
@@ -17857,7 +18204,7 @@ const PasswordForgotButton = ({
17857
18204
  emailError
17858
18205
  },
17859
18206
  dispatch
17860
- } = useContext(store$8);
18207
+ } = useContext(store$a);
17861
18208
  const {
17862
18209
  t
17863
18210
  } = useTranslation("passwordForgot");
@@ -17878,7 +18225,7 @@ const PasswordForgotButton = ({
17878
18225
  };
17879
18226
 
17880
18227
  const PasswordForgotEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
17881
- store: store$8
18228
+ store: store$a
17882
18229
  }, props));
17883
18230
 
17884
18231
  const PasswordForgotView = props => {
@@ -17928,7 +18275,7 @@ const PasswordForgotModal = ({
17928
18275
  };
17929
18276
  PasswordForgotModal.viewId = "password-forgot";
17930
18277
 
17931
- const initialState$7 = {
18278
+ const initialState$9 = {
17932
18279
  currentPassword: "",
17933
18280
  newPassword: "",
17934
18281
  confirmNewPassword: "",
@@ -17942,10 +18289,10 @@ const initialState$7 = {
17942
18289
  content: ""
17943
18290
  }
17944
18291
  };
17945
- const store$7 = /*#__PURE__*/createContext(initialState$7);
18292
+ const store$9 = /*#__PURE__*/createContext(initialState$9);
17946
18293
  const {
17947
- Provider: Provider$7
17948
- } = store$7;
18294
+ Provider: Provider$9
18295
+ } = store$9;
17949
18296
  const PasswordChangeContainer = ({
17950
18297
  style,
17951
18298
  className = "",
@@ -18097,21 +18444,21 @@ const PasswordChangeContainer = ({
18097
18444
  default:
18098
18445
  return state;
18099
18446
  }
18100
- }, initialState$7);
18447
+ }, initialState$9);
18101
18448
  return /*#__PURE__*/React__default.createElement("div", {
18102
18449
  style: { ...style
18103
18450
  },
18104
18451
  className: `pelcro-container pelcro-password-change-container ${className}`
18105
- }, /*#__PURE__*/React__default.createElement(Provider$7, {
18452
+ }, /*#__PURE__*/React__default.createElement(Provider$9, {
18106
18453
  value: {
18107
18454
  state,
18108
18455
  dispatch
18109
18456
  }
18110
18457
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
18111
- store: store$7,
18458
+ store: store$9,
18112
18459
  key: i
18113
18460
  })) : /*#__PURE__*/React__default.cloneElement(children, {
18114
- store: store$7
18461
+ store: store$9
18115
18462
  })));
18116
18463
  };
18117
18464
 
@@ -18122,7 +18469,7 @@ function PasswordChangeCurrentPassword(props) {
18122
18469
  currentPassword,
18123
18470
  currentPasswordError
18124
18471
  }
18125
- } = useContext(store$7);
18472
+ } = useContext(store$9);
18126
18473
  const handleBlur = useCallback(() => {
18127
18474
  return dispatch({
18128
18475
  type: VALIDATE_PASSWORD
@@ -18156,7 +18503,7 @@ function PasswordChangeNewPassword(props) {
18156
18503
  newPassword,
18157
18504
  newPasswordError
18158
18505
  }
18159
- } = useContext(store$7);
18506
+ } = useContext(store$9);
18160
18507
  const handleBlur = useCallback(() => {
18161
18508
  return dispatch({
18162
18509
  type: VALIDATE_NEW_PASSWORD
@@ -18190,7 +18537,7 @@ function PasswordChangeConfirmNewPassword(props) {
18190
18537
  confirmNewPassword,
18191
18538
  confirmNewPasswordError
18192
18539
  }
18193
- } = useContext(store$7);
18540
+ } = useContext(store$9);
18194
18541
  const handleBlur = useCallback(() => {
18195
18542
  return dispatch({
18196
18543
  type: VALIDATE_CONFIRM_NEW_PASSWORD
@@ -18231,7 +18578,7 @@ const PasswordChangeButton = ({
18231
18578
  confirmNewPasswordError
18232
18579
  },
18233
18580
  dispatch
18234
- } = useContext(store$7);
18581
+ } = useContext(store$9);
18235
18582
  const {
18236
18583
  t
18237
18584
  } = useTranslation("passwordChange");
@@ -18297,17 +18644,17 @@ const PasswordChangeModal = ({
18297
18644
  };
18298
18645
  PasswordChangeModal.viewId = "password-change";
18299
18646
 
18300
- const initialState$6 = {
18647
+ const initialState$8 = {
18301
18648
  buttonDisabled: false,
18302
18649
  alert: {
18303
18650
  type: "error",
18304
18651
  content: ""
18305
18652
  }
18306
18653
  };
18307
- const store$6 = /*#__PURE__*/createContext(initialState$6);
18654
+ const store$8 = /*#__PURE__*/createContext(initialState$8);
18308
18655
  const {
18309
- Provider: Provider$6
18310
- } = store$6;
18656
+ Provider: Provider$8
18657
+ } = store$8;
18311
18658
 
18312
18659
  const CartContainer = ({
18313
18660
  style,
@@ -18398,21 +18745,21 @@ const CartContainer = ({
18398
18745
  default:
18399
18746
  return state;
18400
18747
  }
18401
- }, initialState$6);
18748
+ }, initialState$8);
18402
18749
  return /*#__PURE__*/React__default.createElement("div", {
18403
18750
  style: { ...style
18404
18751
  },
18405
18752
  className: `pelcro-container pelcro-cart-container ${className}`
18406
- }, /*#__PURE__*/React__default.createElement(Provider$6, {
18753
+ }, /*#__PURE__*/React__default.createElement(Provider$8, {
18407
18754
  value: {
18408
18755
  state,
18409
18756
  dispatch
18410
18757
  }
18411
18758
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
18412
- store: store$6,
18759
+ store: store$8,
18413
18760
  key: i
18414
18761
  })) : /*#__PURE__*/React__default.cloneElement(children, {
18415
- store: store$6
18762
+ store: store$8
18416
18763
  })));
18417
18764
  };
18418
18765
 
@@ -18449,7 +18796,7 @@ const CartSubmit = ({
18449
18796
  buttonDisabled
18450
18797
  },
18451
18798
  dispatch
18452
- } = useContext(store$6);
18799
+ } = useContext(store$8);
18453
18800
  const {
18454
18801
  t
18455
18802
  } = useTranslation("cart");
@@ -18480,7 +18827,7 @@ const CartTotalPrice = () => {
18480
18827
  state: {
18481
18828
  alert
18482
18829
  }
18483
- } = useContext(store$6);
18830
+ } = useContext(store$8);
18484
18831
  const {
18485
18832
  cartItems
18486
18833
  } = usePelcro();
@@ -18793,7 +19140,7 @@ const OrderConfirmModal = props => {
18793
19140
  };
18794
19141
  OrderConfirmModal.viewId = "order-confirm";
18795
19142
 
18796
- const initialState$5 = {
19143
+ const initialState$7 = {
18797
19144
  email: "",
18798
19145
  firstName: "",
18799
19146
  lastName: "",
@@ -18805,10 +19152,10 @@ const initialState$5 = {
18805
19152
  content: ""
18806
19153
  }
18807
19154
  };
18808
- const store$5 = /*#__PURE__*/createContext(initialState$5);
19155
+ const store$7 = /*#__PURE__*/createContext(initialState$7);
18809
19156
  const {
18810
- Provider: Provider$5
18811
- } = store$5;
19157
+ Provider: Provider$7
19158
+ } = store$7;
18812
19159
 
18813
19160
  const GiftCreateContainer = ({
18814
19161
  style,
@@ -18912,21 +19259,21 @@ const GiftCreateContainer = ({
18912
19259
  default:
18913
19260
  return state;
18914
19261
  }
18915
- }, initialState$5);
19262
+ }, initialState$7);
18916
19263
  return /*#__PURE__*/React__default.createElement("div", {
18917
19264
  style: { ...style
18918
19265
  },
18919
19266
  className: `pelcro-container pelcro-gift-create-container ${className}`
18920
- }, /*#__PURE__*/React__default.createElement(Provider$5, {
19267
+ }, /*#__PURE__*/React__default.createElement(Provider$7, {
18921
19268
  value: {
18922
19269
  state,
18923
19270
  dispatch
18924
19271
  }
18925
19272
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
18926
- store: store$5,
19273
+ store: store$7,
18927
19274
  key: i
18928
19275
  })) : /*#__PURE__*/React__default.cloneElement(children, {
18929
- store: store$5
19276
+ store: store$7
18930
19277
  })));
18931
19278
  };
18932
19279
 
@@ -18940,7 +19287,7 @@ const GiftCreateSubmitButton = ({
18940
19287
  state: {
18941
19288
  disableSubmit
18942
19289
  }
18943
- } = useContext(store$5);
19290
+ } = useContext(store$7);
18944
19291
  const {
18945
19292
  t
18946
19293
  } = useTranslation("register");
@@ -18957,29 +19304,29 @@ const GiftCreateSubmitButton = ({
18957
19304
 
18958
19305
  const GiftCreateEmail = props => /*#__PURE__*/React__default.createElement(Email, Object.assign({
18959
19306
  initWithUserEmail: false,
18960
- store: store$5
19307
+ store: store$7
18961
19308
  }, props));
18962
19309
 
18963
19310
  const GiftCreateFirstName = props => /*#__PURE__*/React__default.createElement(FirstName, Object.assign({
18964
- store: store$5
19311
+ store: store$7
18965
19312
  }, props));
18966
19313
 
18967
19314
  const GiftCreateLastName = props => /*#__PURE__*/React__default.createElement(LastName, Object.assign({
18968
- store: store$5
19315
+ store: store$7
18969
19316
  }, props));
18970
19317
 
18971
- var _path$g;
19318
+ var _path$i;
18972
19319
 
18973
- 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); }
19320
+ 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); }
18974
19321
 
18975
19322
  function SvgInfoCircle(props) {
18976
- return /*#__PURE__*/React.createElement("svg", _extends$i({
19323
+ return /*#__PURE__*/React.createElement("svg", _extends$k({
18977
19324
  xmlns: "http://www.w3.org/2000/svg",
18978
19325
  className: "plc-w-5 plc-h-5",
18979
19326
  fill: "none",
18980
19327
  viewBox: "0 0 24 24",
18981
19328
  stroke: "currentColor"
18982
- }, props), _path$g || (_path$g = /*#__PURE__*/React.createElement("path", {
19329
+ }, props), _path$i || (_path$i = /*#__PURE__*/React.createElement("path", {
18983
19330
  strokeLinecap: "round",
18984
19331
  strokeLinejoin: "round",
18985
19332
  strokeWidth: 2,
@@ -19050,7 +19397,7 @@ const GiftCreateStartDate = props => {
19050
19397
  const {
19051
19398
  dispatch,
19052
19399
  state
19053
- } = useContext(store$5);
19400
+ } = useContext(store$7);
19054
19401
 
19055
19402
  const handleInputChange = value => {
19056
19403
  dispatch({
@@ -19115,13 +19462,17 @@ function TextArea({
19115
19462
  */
19116
19463
 
19117
19464
  function GiftCreateMessage(props) {
19465
+ var _ref, _state$giftMessage;
19466
+
19118
19467
  const {
19119
19468
  t
19120
19469
  } = useTranslation("register");
19121
19470
  const {
19122
19471
  dispatch,
19123
19472
  state
19124
- } = useContext(store$5);
19473
+ } = useContext(store$7);
19474
+ const MAX_CHARS_COUNT = 200;
19475
+ 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;
19125
19476
 
19126
19477
  const handleInputChange = value => {
19127
19478
  dispatch({
@@ -19139,6 +19490,9 @@ function GiftCreateMessage(props) {
19139
19490
  value: state.giftMessage,
19140
19491
  maxLength: "200",
19141
19492
  rows: 3,
19493
+ label: t("gift.labels.giftMessage", {
19494
+ count: remainingCharsCount
19495
+ }),
19142
19496
  tooltipText: t("gift.messages.giftMessageInfo")
19143
19497
  }, props));
19144
19498
  }
@@ -19188,8 +19542,7 @@ const GiftCreateView = props => {
19188
19542
  }, /*#__PURE__*/React__default.createElement(GiftCreateMessage, {
19189
19543
  autoComplete: "gift-message",
19190
19544
  id: "pelcro-input-gift-message",
19191
- errorId: "pelcro-input-gift-message-error",
19192
- label: t("gift.labels.giftMessage")
19545
+ errorId: "pelcro-input-gift-message-error"
19193
19546
  })), /*#__PURE__*/React__default.createElement("p", {
19194
19547
  className: "plc-text-gray-900 pelcro-footnote"
19195
19548
  }, "* ", t("gift.labels.required")), /*#__PURE__*/React__default.createElement(GiftCreateSubmitButton, {
@@ -19241,7 +19594,7 @@ const GiftCreateModal = ({
19241
19594
  };
19242
19595
  GiftCreateModal.viewId = "gift-create";
19243
19596
 
19244
- const initialState$4 = {
19597
+ const initialState$6 = {
19245
19598
  giftCode: "",
19246
19599
  buttonDisabled: true,
19247
19600
  alert: {
@@ -19249,10 +19602,10 @@ const initialState$4 = {
19249
19602
  content: ""
19250
19603
  }
19251
19604
  };
19252
- const store$4 = /*#__PURE__*/createContext(initialState$4);
19605
+ const store$6 = /*#__PURE__*/createContext(initialState$6);
19253
19606
  const {
19254
- Provider: Provider$4
19255
- } = store$4;
19607
+ Provider: Provider$6
19608
+ } = store$6;
19256
19609
 
19257
19610
  const GiftRedeemContainer = ({
19258
19611
  style,
@@ -19317,21 +19670,21 @@ const GiftRedeemContainer = ({
19317
19670
  default:
19318
19671
  return state;
19319
19672
  }
19320
- }, initialState$4);
19673
+ }, initialState$6);
19321
19674
  return /*#__PURE__*/React__default.createElement("div", {
19322
19675
  style: { ...style
19323
19676
  },
19324
19677
  className: `pelcro-container pelcro-gift-redeem-container ${className}`
19325
- }, /*#__PURE__*/React__default.createElement(Provider$4, {
19678
+ }, /*#__PURE__*/React__default.createElement(Provider$6, {
19326
19679
  value: {
19327
19680
  state,
19328
19681
  dispatch
19329
19682
  }
19330
19683
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
19331
- store: store$4,
19684
+ store: store$6,
19332
19685
  key: i
19333
19686
  })) : /*#__PURE__*/React__default.cloneElement(children, {
19334
- store: store$4
19687
+ store: store$6
19335
19688
  })));
19336
19689
  };
19337
19690
 
@@ -19368,7 +19721,7 @@ function GiftCode({
19368
19721
  }
19369
19722
 
19370
19723
  const GiftRedeemCode = props => /*#__PURE__*/React__default.createElement(GiftCode, Object.assign({
19371
- store: store$4
19724
+ store: store$6
19372
19725
  }, props));
19373
19726
 
19374
19727
  const GiftRedeemSubmitButton = ({
@@ -19381,7 +19734,7 @@ const GiftRedeemSubmitButton = ({
19381
19734
  state: {
19382
19735
  disableSubmit
19383
19736
  }
19384
- } = useContext(store$4);
19737
+ } = useContext(store$6);
19385
19738
  const {
19386
19739
  t
19387
19740
  } = useTranslation("register");
@@ -19474,7 +19827,7 @@ const moveDefaultAddressToStart = addresses => {
19474
19827
  return [defaultAddress, ...addressesWithoutDefault];
19475
19828
  };
19476
19829
 
19477
- const initialState$3 = {
19830
+ const initialState$5 = {
19478
19831
  addresses: [],
19479
19832
  selectedAddressId: null,
19480
19833
  isSubmitting: false,
@@ -19483,10 +19836,10 @@ const initialState$3 = {
19483
19836
  content: ""
19484
19837
  }
19485
19838
  };
19486
- const store$3 = /*#__PURE__*/createContext(initialState$3);
19839
+ const store$5 = /*#__PURE__*/createContext(initialState$5);
19487
19840
  const {
19488
- Provider: Provider$3
19489
- } = store$3;
19841
+ Provider: Provider$5
19842
+ } = store$5;
19490
19843
 
19491
19844
  const AddressSelectContainer = ({
19492
19845
  style,
@@ -19581,7 +19934,7 @@ const AddressSelectContainer = ({
19581
19934
  default:
19582
19935
  return state;
19583
19936
  }
19584
- }, initialState$3);
19937
+ }, initialState$5);
19585
19938
  useEffect(() => {
19586
19939
  var _window$Pelcro$user$r;
19587
19940
 
@@ -19594,16 +19947,16 @@ const AddressSelectContainer = ({
19594
19947
  style: { ...style
19595
19948
  },
19596
19949
  className: `pelcro-container pelcro-address-select-container ${className}`
19597
- }, /*#__PURE__*/React__default.createElement(Provider$3, {
19950
+ }, /*#__PURE__*/React__default.createElement(Provider$5, {
19598
19951
  value: {
19599
19952
  state,
19600
19953
  dispatch
19601
19954
  }
19602
19955
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
19603
- store: store$3,
19956
+ store: store$5,
19604
19957
  key: i
19605
19958
  })) : /*#__PURE__*/React__default.cloneElement(children, {
19606
- store: store$3
19959
+ store: store$5
19607
19960
  })));
19608
19961
  };
19609
19962
 
@@ -19614,7 +19967,7 @@ const AddressSelectList = () => {
19614
19967
  addresses,
19615
19968
  selectedAddressId
19616
19969
  }
19617
- } = useContext(store$3);
19970
+ } = useContext(store$5);
19618
19971
 
19619
19972
  const handleAddressSelect = event => {
19620
19973
  dispatch({
@@ -19658,7 +20011,7 @@ const AddressSelectSubmit = ({
19658
20011
  selectedAddressId,
19659
20012
  isSubmitting
19660
20013
  }
19661
- } = useContext(store$3);
20014
+ } = useContext(store$5);
19662
20015
  const {
19663
20016
  t
19664
20017
  } = useTranslation("address");
@@ -19754,7 +20107,7 @@ const moveDefaultPaymentMethodToStart = paymentMethods => {
19754
20107
  return [defaultPaymentMethod, ...paymentMethodsWithoutDefault];
19755
20108
  };
19756
20109
 
19757
- const initialState$2 = {
20110
+ const initialState$4 = {
19758
20111
  paymentMethods: [],
19759
20112
  selectedPaymentMethodId: null,
19760
20113
  isSubmitting: false,
@@ -19763,10 +20116,10 @@ const initialState$2 = {
19763
20116
  content: ""
19764
20117
  }
19765
20118
  };
19766
- const store$2 = /*#__PURE__*/createContext(initialState$2);
20119
+ const store$4 = /*#__PURE__*/createContext(initialState$4);
19767
20120
  const {
19768
- Provider: Provider$2
19769
- } = store$2;
20121
+ Provider: Provider$4
20122
+ } = store$4;
19770
20123
 
19771
20124
  const PaymentMethodSelectContainer = ({
19772
20125
  style,
@@ -19788,9 +20141,23 @@ const PaymentMethodSelectContainer = ({
19788
20141
  return onSuccess(selectedPaymentMethodId);
19789
20142
  };
19790
20143
 
19791
- const [state, dispatch] = useReducerWithSideEffects((state, action) => {
19792
- var _window$Pelcro$user$r2, _window$Pelcro$user$r3;
20144
+ const getInitialSelectedMethodId = () => {
20145
+ var _window$Pelcro$user$r2;
20146
+
20147
+ if (selectedPaymentMethodIdFromStore) {
20148
+ return selectedPaymentMethodIdFromStore;
20149
+ }
19793
20150
 
20151
+ const defaultMethod = (_window$Pelcro$user$r2 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.source;
20152
+
20153
+ if (defaultMethod && defaultMethod.status === "chargeable") {
20154
+ return String(defaultMethod.id);
20155
+ }
20156
+
20157
+ return null;
20158
+ };
20159
+
20160
+ const [state, dispatch] = useReducerWithSideEffects((state, action) => {
19794
20161
  switch (action.type) {
19795
20162
  case SELECT_PAYMENT_METHOD:
19796
20163
  return lib_7({ ...state,
@@ -19800,7 +20167,7 @@ const PaymentMethodSelectContainer = ({
19800
20167
  case LOAD_PAYMENT_METHODS:
19801
20168
  return lib_7({ ...state,
19802
20169
  paymentMethods: moveDefaultPaymentMethodToStart(action.payload),
19803
- selectedPaymentMethodId: selectedPaymentMethodIdFromStore !== null && selectedPaymentMethodIdFromStore !== void 0 ? selectedPaymentMethodIdFromStore : String((_window$Pelcro$user$r2 = window.Pelcro.user.read()) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : (_window$Pelcro$user$r3 = _window$Pelcro$user$r2.source) === null || _window$Pelcro$user$r3 === void 0 ? void 0 : _window$Pelcro$user$r3.id)
20170
+ selectedPaymentMethodId: getInitialSelectedMethodId()
19804
20171
  });
19805
20172
 
19806
20173
  case HANDLE_SUBMIT:
@@ -19811,29 +20178,29 @@ const PaymentMethodSelectContainer = ({
19811
20178
  default:
19812
20179
  return state;
19813
20180
  }
19814
- }, initialState$2);
20181
+ }, initialState$4);
19815
20182
  useEffect(() => {
19816
- var _window$Pelcro$user$r4;
20183
+ var _window$Pelcro$user$r3;
19817
20184
 
19818
20185
  dispatch({
19819
20186
  type: LOAD_PAYMENT_METHODS,
19820
- payload: (_window$Pelcro$user$r4 = window.Pelcro.user.read().sources) !== null && _window$Pelcro$user$r4 !== void 0 ? _window$Pelcro$user$r4 : []
20187
+ payload: (_window$Pelcro$user$r3 = window.Pelcro.user.read().sources) !== null && _window$Pelcro$user$r3 !== void 0 ? _window$Pelcro$user$r3 : []
19821
20188
  });
19822
20189
  }, []);
19823
20190
  return /*#__PURE__*/React__default.createElement("div", {
19824
20191
  style: { ...style
19825
20192
  },
19826
20193
  className: `pelcro-container pelcro-payment-select-container ${className}`
19827
- }, /*#__PURE__*/React__default.createElement(Provider$2, {
20194
+ }, /*#__PURE__*/React__default.createElement(Provider$4, {
19828
20195
  value: {
19829
20196
  state,
19830
20197
  dispatch
19831
20198
  }
19832
20199
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
19833
- store: store$2,
20200
+ store: store$4,
19834
20201
  key: i
19835
20202
  })) : /*#__PURE__*/React__default.cloneElement(children, {
19836
- store: store$2
20203
+ store: store$4
19837
20204
  })));
19838
20205
  };
19839
20206
 
@@ -19847,7 +20214,7 @@ const PaymentMethodSelectList = () => {
19847
20214
  paymentMethods,
19848
20215
  selectedPaymentMethodId
19849
20216
  }
19850
- } = useContext(store$2);
20217
+ } = useContext(store$4);
19851
20218
 
19852
20219
  const handlePaymentMethodSelect = event => {
19853
20220
  dispatch({
@@ -19897,7 +20264,7 @@ const PaymentMethodSelectSubmit = ({
19897
20264
  selectedPaymentMethodId,
19898
20265
  isSubmitting
19899
20266
  }
19900
- } = useContext(store$2);
20267
+ } = useContext(store$4);
19901
20268
  return /*#__PURE__*/React__default.createElement(Button, Object.assign({
19902
20269
  onClick: () => {
19903
20270
  dispatch({
@@ -19971,8 +20338,8 @@ const PaymentMethodSelectModal = ({
19971
20338
  };
19972
20339
  PaymentMethodSelectModal.viewId = "payment-method-select";
19973
20340
 
19974
- function _extends$h() {
19975
- _extends$h = Object.assign || function (target) {
20341
+ function _extends$j() {
20342
+ _extends$j = Object.assign || function (target) {
19976
20343
  for (var i = 1; i < arguments.length; i++) {
19977
20344
  var source = arguments[i];
19978
20345
 
@@ -19986,7 +20353,7 @@ function _extends$h() {
19986
20353
  return target;
19987
20354
  };
19988
20355
 
19989
- return _extends$h.apply(this, arguments);
20356
+ return _extends$j.apply(this, arguments);
19990
20357
  }
19991
20358
 
19992
20359
  function _objectWithoutPropertiesLoose(source, excluded) {
@@ -20170,7 +20537,7 @@ function render(props, propsBag, defaultTag, features, visible) {
20170
20537
  return match(strategy, (_match = {}, _match[RenderStrategy.Unmount] = function () {
20171
20538
  return null;
20172
20539
  }, _match[RenderStrategy.Hidden] = function () {
20173
- return _render(_extends$h({}, _rest, {
20540
+ return _render(_extends$j({}, _rest, {
20174
20541
  hidden: true,
20175
20542
  style: {
20176
20543
  display: 'none'
@@ -20698,7 +21065,7 @@ function TransitionChild(props) {
20698
21065
  var passthroughProps = rest;
20699
21066
  return React__default.createElement(NestingContext.Provider, {
20700
21067
  value: nesting
20701
- }, render(_extends$h({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
21068
+ }, render(_extends$j({}, passthroughProps, propsWeControl), propsBag, DEFAULT_TRANSITION_CHILD_TAG, TransitionChildRenderFeatures, state === TreeStates.Visible));
20702
21069
  }
20703
21070
 
20704
21071
  function Transition(props) {
@@ -20742,7 +21109,7 @@ function Transition(props) {
20742
21109
  value: nestingBag
20743
21110
  }, React__default.createElement(TransitionContext.Provider, {
20744
21111
  value: transitionBag
20745
- }, render(_extends$h({}, sharedProps, {
21112
+ }, render(_extends$j({}, sharedProps, {
20746
21113
  as: Fragment,
20747
21114
  children: React__default.createElement(TransitionChild, Object.assign({}, sharedProps, passthroughProps))
20748
21115
  }), propsBag, Fragment, TransitionChildRenderFeatures, state === TreeStates.Visible)));
@@ -20869,12 +21236,12 @@ var ActionTypes;
20869
21236
  })(ActionTypes || (ActionTypes = {}));
20870
21237
 
20871
21238
  (_reducers = {}, _reducers[ActionTypes.CloseMenu] = function (state) {
20872
- return _extends$h({}, state, {
21239
+ return _extends$j({}, state, {
20873
21240
  activeItemIndex: null,
20874
21241
  menuState: MenuStates.Closed
20875
21242
  });
20876
21243
  }, _reducers[ActionTypes.OpenMenu] = function (state) {
20877
- return _extends$h({}, state, {
21244
+ return _extends$j({}, state, {
20878
21245
  menuState: MenuStates.Open
20879
21246
  });
20880
21247
  }, _reducers[ActionTypes.GoToItem] = function (state, action) {
@@ -20893,7 +21260,7 @@ var ActionTypes;
20893
21260
  }
20894
21261
  });
20895
21262
  if (state.searchQuery === '' && state.activeItemIndex === activeItemIndex) return state;
20896
- return _extends$h({}, state, {
21263
+ return _extends$j({}, state, {
20897
21264
  searchQuery: '',
20898
21265
  activeItemIndex: activeItemIndex
20899
21266
  });
@@ -20904,19 +21271,19 @@ var ActionTypes;
20904
21271
 
20905
21272
  return ((_item$dataRef$current = item.dataRef.current.textValue) == null ? void 0 : _item$dataRef$current.startsWith(searchQuery)) && !item.dataRef.current.disabled;
20906
21273
  });
20907
- if (match === -1 || match === state.activeItemIndex) return _extends$h({}, state, {
21274
+ if (match === -1 || match === state.activeItemIndex) return _extends$j({}, state, {
20908
21275
  searchQuery: searchQuery
20909
21276
  });
20910
- return _extends$h({}, state, {
21277
+ return _extends$j({}, state, {
20911
21278
  searchQuery: searchQuery,
20912
21279
  activeItemIndex: match
20913
21280
  });
20914
21281
  }, _reducers[ActionTypes.ClearSearch] = function (state) {
20915
- return _extends$h({}, state, {
21282
+ return _extends$j({}, state, {
20916
21283
  searchQuery: ''
20917
21284
  });
20918
21285
  }, _reducers[ActionTypes.RegisterItem] = function (state, action) {
20919
- return _extends$h({}, state, {
21286
+ return _extends$j({}, state, {
20920
21287
  items: [].concat(state.items, [{
20921
21288
  id: action.id,
20922
21289
  dataRef: action.dataRef
@@ -20929,7 +21296,7 @@ var ActionTypes;
20929
21296
  return a.id === action.id;
20930
21297
  });
20931
21298
  if (idx !== -1) nextItems.splice(idx, 1);
20932
- return _extends$h({}, state, {
21299
+ return _extends$j({}, state, {
20933
21300
  items: nextItems,
20934
21301
  activeItemIndex: function () {
20935
21302
  if (idx === state.activeItemIndex) return null;
@@ -20968,19 +21335,19 @@ var ActionTypes$1;
20968
21335
  (_reducers$1 = {}, _reducers$1[ActionTypes$1.CloseListbox] = function (state) {
20969
21336
  if (state.disabled) return state;
20970
21337
  if (state.listboxState === ListboxStates.Closed) return state;
20971
- return _extends$h({}, state, {
21338
+ return _extends$j({}, state, {
20972
21339
  activeOptionIndex: null,
20973
21340
  listboxState: ListboxStates.Closed
20974
21341
  });
20975
21342
  }, _reducers$1[ActionTypes$1.OpenListbox] = function (state) {
20976
21343
  if (state.disabled) return state;
20977
21344
  if (state.listboxState === ListboxStates.Open) return state;
20978
- return _extends$h({}, state, {
21345
+ return _extends$j({}, state, {
20979
21346
  listboxState: ListboxStates.Open
20980
21347
  });
20981
21348
  }, _reducers$1[ActionTypes$1.SetDisabled] = function (state, action) {
20982
21349
  if (state.disabled === action.disabled) return state;
20983
- return _extends$h({}, state, {
21350
+ return _extends$j({}, state, {
20984
21351
  disabled: action.disabled
20985
21352
  });
20986
21353
  }, _reducers$1[ActionTypes$1.GoToOption] = function (state, action) {
@@ -21001,7 +21368,7 @@ var ActionTypes$1;
21001
21368
  }
21002
21369
  });
21003
21370
  if (state.searchQuery === '' && state.activeOptionIndex === activeOptionIndex) return state;
21004
- return _extends$h({}, state, {
21371
+ return _extends$j({}, state, {
21005
21372
  searchQuery: '',
21006
21373
  activeOptionIndex: activeOptionIndex
21007
21374
  });
@@ -21014,10 +21381,10 @@ var ActionTypes$1;
21014
21381
 
21015
21382
  return !option.dataRef.current.disabled && ((_option$dataRef$curre = option.dataRef.current.textValue) == null ? void 0 : _option$dataRef$curre.startsWith(searchQuery));
21016
21383
  });
21017
- if (match === -1 || match === state.activeOptionIndex) return _extends$h({}, state, {
21384
+ if (match === -1 || match === state.activeOptionIndex) return _extends$j({}, state, {
21018
21385
  searchQuery: searchQuery
21019
21386
  });
21020
- return _extends$h({}, state, {
21387
+ return _extends$j({}, state, {
21021
21388
  searchQuery: searchQuery,
21022
21389
  activeOptionIndex: match
21023
21390
  });
@@ -21025,11 +21392,11 @@ var ActionTypes$1;
21025
21392
  if (state.disabled) return state;
21026
21393
  if (state.listboxState === ListboxStates.Closed) return state;
21027
21394
  if (state.searchQuery === '') return state;
21028
- return _extends$h({}, state, {
21395
+ return _extends$j({}, state, {
21029
21396
  searchQuery: ''
21030
21397
  });
21031
21398
  }, _reducers$1[ActionTypes$1.RegisterOption] = function (state, action) {
21032
- return _extends$h({}, state, {
21399
+ return _extends$j({}, state, {
21033
21400
  options: [].concat(state.options, [{
21034
21401
  id: action.id,
21035
21402
  dataRef: action.dataRef
@@ -21042,7 +21409,7 @@ var ActionTypes$1;
21042
21409
  return a.id === action.id;
21043
21410
  });
21044
21411
  if (idx !== -1) nextOptions.splice(idx, 1);
21045
- return _extends$h({}, state, {
21412
+ return _extends$j({}, state, {
21046
21413
  options: nextOptions,
21047
21414
  activeOptionIndex: function () {
21048
21415
  if (idx === state.activeOptionIndex) return null;
@@ -21103,18 +21470,18 @@ const getPaymentCardIcon = name => {
21103
21470
  }));
21104
21471
  };
21105
21472
 
21106
- var _path$f;
21473
+ var _path$h;
21107
21474
 
21108
- 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); }
21475
+ 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); }
21109
21476
 
21110
21477
  function SvgChevronRight(props) {
21111
- return /*#__PURE__*/React.createElement("svg", _extends$g({
21478
+ return /*#__PURE__*/React.createElement("svg", _extends$i({
21112
21479
  className: "plc-w-6 plc-h-6",
21113
21480
  xmlns: "http://www.w3.org/2000/svg",
21114
21481
  fill: "none",
21115
21482
  viewBox: "0 0 24 24",
21116
21483
  stroke: "currentColor"
21117
- }, props), _path$f || (_path$f = /*#__PURE__*/React.createElement("path", {
21484
+ }, props), _path$h || (_path$h = /*#__PURE__*/React.createElement("path", {
21118
21485
  strokeLinecap: "round",
21119
21486
  strokeLinejoin: "round",
21120
21487
  strokeWidth: 2,
@@ -21330,18 +21697,18 @@ const SavedItems = ({
21330
21697
  });
21331
21698
  };
21332
21699
 
21333
- var _path$e;
21700
+ var _path$g;
21334
21701
 
21335
- 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); }
21702
+ 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); }
21336
21703
 
21337
21704
  function SvgRefresh(props) {
21338
- return /*#__PURE__*/React.createElement("svg", _extends$f({
21705
+ return /*#__PURE__*/React.createElement("svg", _extends$h({
21339
21706
  className: "plc-w-4 plc-h-4 plc-mr-1",
21340
21707
  xmlns: "http://www.w3.org/2000/svg",
21341
21708
  fill: "none",
21342
21709
  viewBox: "0 0 24 24",
21343
21710
  stroke: "currentColor"
21344
- }, props), _path$e || (_path$e = /*#__PURE__*/React.createElement("path", {
21711
+ }, props), _path$g || (_path$g = /*#__PURE__*/React.createElement("path", {
21345
21712
  strokeLinecap: "round",
21346
21713
  strokeLinejoin: "round",
21347
21714
  strokeWidth: 2,
@@ -21349,35 +21716,35 @@ function SvgRefresh(props) {
21349
21716
  })));
21350
21717
  }
21351
21718
 
21352
- var _path$d;
21719
+ var _path$f;
21353
21720
 
21354
- 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); }
21721
+ 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); }
21355
21722
 
21356
21723
  function SvgCalendar(props) {
21357
- return /*#__PURE__*/React.createElement("svg", _extends$e({
21724
+ return /*#__PURE__*/React.createElement("svg", _extends$g({
21358
21725
  xmlns: "http://www.w3.org/2000/svg",
21359
21726
  className: "plc-h-4 plc-w-4 plc-mr-1",
21360
21727
  viewBox: "0 0 20 20",
21361
21728
  fill: "currentColor"
21362
- }, props), _path$d || (_path$d = /*#__PURE__*/React.createElement("path", {
21729
+ }, props), _path$f || (_path$f = /*#__PURE__*/React.createElement("path", {
21363
21730
  fillRule: "evenodd",
21364
21731
  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",
21365
21732
  clipRule: "evenodd"
21366
21733
  })));
21367
21734
  }
21368
21735
 
21369
- var _path$c;
21736
+ var _path$e;
21370
21737
 
21371
- 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); }
21738
+ 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); }
21372
21739
 
21373
21740
  function SvgPlus(props) {
21374
- return /*#__PURE__*/React.createElement("svg", _extends$d({
21741
+ return /*#__PURE__*/React.createElement("svg", _extends$f({
21375
21742
  className: "plc-w-5 plc-h-5",
21376
21743
  xmlns: "http://www.w3.org/2000/svg",
21377
21744
  fill: "none",
21378
21745
  viewBox: "0 0 24 24",
21379
21746
  stroke: "currentColor"
21380
- }, props), _path$c || (_path$c = /*#__PURE__*/React.createElement("path", {
21747
+ }, props), _path$e || (_path$e = /*#__PURE__*/React.createElement("path", {
21381
21748
  strokeLinecap: "round",
21382
21749
  strokeLinejoin: "round",
21383
21750
  strokeWidth: 2,
@@ -21385,17 +21752,17 @@ function SvgPlus(props) {
21385
21752
  })));
21386
21753
  }
21387
21754
 
21388
- var _path$b;
21755
+ var _path$d;
21389
21756
 
21390
- 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); }
21757
+ 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); }
21391
21758
 
21392
21759
  function SvgCheckMark(props) {
21393
- return /*#__PURE__*/React.createElement("svg", _extends$c({
21760
+ return /*#__PURE__*/React.createElement("svg", _extends$e({
21394
21761
  className: "plc-w-4 plc-h-4 plc-mr-1",
21395
21762
  xmlns: "http://www.w3.org/2000/svg",
21396
21763
  viewBox: "0 0 20 20",
21397
21764
  fill: "currentColor"
21398
- }, props), _path$b || (_path$b = /*#__PURE__*/React.createElement("path", {
21765
+ }, props), _path$d || (_path$d = /*#__PURE__*/React.createElement("path", {
21399
21766
  fillRule: "evenodd",
21400
21767
  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",
21401
21768
  clipRule: "evenodd"
@@ -21459,7 +21826,8 @@ const SubscriptionsItems = ({
21459
21826
  } = useTranslation("dashboard");
21460
21827
  const {
21461
21828
  switchView,
21462
- isAuthenticated
21829
+ switchToAddressView,
21830
+ switchToPaymentView
21463
21831
  } = usePelcro();
21464
21832
  const subs = getNonDonationSubs();
21465
21833
  if (subs.length === 0) return null;
@@ -21501,7 +21869,12 @@ const SubscriptionsItems = ({
21501
21869
  const plan = window.Pelcro.plan.getById(plan_id);
21502
21870
  setProductAndPlan(product, plan);
21503
21871
  setSubscriptionIdToRenew(sub.id);
21504
- setView("plan-select");
21872
+
21873
+ if (product.address_required) {
21874
+ return switchToAddressView();
21875
+ }
21876
+
21877
+ return switchToPaymentView();
21505
21878
  };
21506
21879
 
21507
21880
  const getPhases = () => {
@@ -21690,18 +22063,18 @@ Accordion.item = function AccordionItem({
21690
22063
  }, content)) : null;
21691
22064
  };
21692
22065
 
21693
- var _path$a;
22066
+ var _path$c;
21694
22067
 
21695
- 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); }
22068
+ 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); }
21696
22069
 
21697
22070
  function SvgExit(props) {
21698
- return /*#__PURE__*/React.createElement("svg", _extends$b({
22071
+ return /*#__PURE__*/React.createElement("svg", _extends$d({
21699
22072
  className: "plc-w-6 plc-h-6",
21700
22073
  xmlns: "http://www.w3.org/2000/svg",
21701
22074
  fill: "none",
21702
22075
  viewBox: "0 0 24 24",
21703
22076
  stroke: "currentColor"
21704
- }, props), _path$a || (_path$a = /*#__PURE__*/React.createElement("path", {
22077
+ }, props), _path$c || (_path$c = /*#__PURE__*/React.createElement("path", {
21705
22078
  strokeLinecap: "round",
21706
22079
  strokeLinejoin: "round",
21707
22080
  strokeWidth: 2,
@@ -21709,17 +22082,17 @@ function SvgExit(props) {
21709
22082
  })));
21710
22083
  }
21711
22084
 
21712
- var _path$9;
22085
+ var _path$b;
21713
22086
 
21714
- 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); }
22087
+ 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); }
21715
22088
 
21716
22089
  function SvgUser(props) {
21717
- return /*#__PURE__*/React.createElement("svg", _extends$a({
22090
+ return /*#__PURE__*/React.createElement("svg", _extends$c({
21718
22091
  xmlns: "http://www.w3.org/2000/svg",
21719
22092
  fill: "none",
21720
22093
  viewBox: "0 0 24 24",
21721
22094
  stroke: "currentColor"
21722
- }, props), _path$9 || (_path$9 = /*#__PURE__*/React.createElement("path", {
22095
+ }, props), _path$b || (_path$b = /*#__PURE__*/React.createElement("path", {
21723
22096
  strokeLinecap: "round",
21724
22097
  strokeLinejoin: "round",
21725
22098
  strokeWidth: 2,
@@ -21727,18 +22100,18 @@ function SvgUser(props) {
21727
22100
  })));
21728
22101
  }
21729
22102
 
21730
- var _path$8;
22103
+ var _path$a;
21731
22104
 
21732
- 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); }
22105
+ 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); }
21733
22106
 
21734
22107
  function SvgNewsletter(props) {
21735
- return /*#__PURE__*/React.createElement("svg", _extends$9({
22108
+ return /*#__PURE__*/React.createElement("svg", _extends$b({
21736
22109
  xmlns: "http://www.w3.org/2000/svg",
21737
22110
  className: "plc-h-5 plc-w-5",
21738
22111
  fill: "none",
21739
22112
  viewBox: "0 0 24 24",
21740
22113
  stroke: "currentColor"
21741
- }, props), _path$8 || (_path$8 = /*#__PURE__*/React.createElement("path", {
22114
+ }, props), _path$a || (_path$a = /*#__PURE__*/React.createElement("path", {
21742
22115
  strokeLinecap: "round",
21743
22116
  strokeLinejoin: "round",
21744
22117
  strokeWidth: 2,
@@ -21746,18 +22119,37 @@ function SvgNewsletter(props) {
21746
22119
  })));
21747
22120
  }
21748
22121
 
21749
- var _path$7;
22122
+ var _path$9;
21750
22123
 
21751
- function _extends$8() { _extends$8 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$8.apply(this, arguments); }
22124
+ 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); }
22125
+
22126
+ function SvgDocument(props) {
22127
+ return /*#__PURE__*/React.createElement("svg", _extends$a({
22128
+ xmlns: "http://www.w3.org/2000/svg",
22129
+ className: "plc-h-6 plc-w-6 plc-mr-2",
22130
+ fill: "none",
22131
+ viewBox: "0 0 24 24",
22132
+ stroke: "currentColor"
22133
+ }, props), _path$9 || (_path$9 = /*#__PURE__*/React.createElement("path", {
22134
+ strokeLinecap: "round",
22135
+ strokeLinejoin: "round",
22136
+ strokeWidth: 2,
22137
+ 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"
22138
+ })));
22139
+ }
22140
+
22141
+ var _path$8;
22142
+
22143
+ 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); }
21752
22144
 
21753
22145
  function SvgPaymentCard(props) {
21754
- return /*#__PURE__*/React.createElement("svg", _extends$8({
22146
+ return /*#__PURE__*/React.createElement("svg", _extends$9({
21755
22147
  className: "plc-w-6 plc-h-6 plc-mr-2",
21756
22148
  xmlns: "http://www.w3.org/2000/svg",
21757
22149
  fill: "none",
21758
22150
  viewBox: "0 0 24 24",
21759
22151
  stroke: "currentColor"
21760
- }, props), _path$7 || (_path$7 = /*#__PURE__*/React.createElement("path", {
22152
+ }, props), _path$8 || (_path$8 = /*#__PURE__*/React.createElement("path", {
21761
22153
  strokeLinecap: "round",
21762
22154
  strokeLinejoin: "round",
21763
22155
  strokeWidth: 2,
@@ -21765,18 +22157,18 @@ function SvgPaymentCard(props) {
21765
22157
  })));
21766
22158
  }
21767
22159
 
21768
- var _path$6, _path2$1;
22160
+ var _path$7, _path2$1;
21769
22161
 
21770
- function _extends$7() { _extends$7 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$7.apply(this, arguments); }
22162
+ function _extends$8() { _extends$8 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$8.apply(this, arguments); }
21771
22163
 
21772
22164
  function SvgLocationPin(props) {
21773
- return /*#__PURE__*/React.createElement("svg", _extends$7({
22165
+ return /*#__PURE__*/React.createElement("svg", _extends$8({
21774
22166
  className: "plc-w-6 plc-h-6 plc-mr-2",
21775
22167
  xmlns: "http://www.w3.org/2000/svg",
21776
22168
  fill: "none",
21777
22169
  viewBox: "0 0 24 24",
21778
22170
  stroke: "currentColor"
21779
- }, props), _path$6 || (_path$6 = /*#__PURE__*/React.createElement("path", {
22171
+ }, props), _path$7 || (_path$7 = /*#__PURE__*/React.createElement("path", {
21780
22172
  strokeLinecap: "round",
21781
22173
  strokeLinejoin: "round",
21782
22174
  strokeWidth: 2,
@@ -21791,10 +22183,10 @@ function SvgLocationPin(props) {
21791
22183
 
21792
22184
  var _switch;
21793
22185
 
21794
- function _extends$6() { _extends$6 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$6.apply(this, arguments); }
22186
+ function _extends$7() { _extends$7 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$7.apply(this, arguments); }
21795
22187
 
21796
22188
  function SvgSubscription(props) {
21797
- return /*#__PURE__*/React.createElement("svg", _extends$6({
22189
+ return /*#__PURE__*/React.createElement("svg", _extends$7({
21798
22190
  xmlns: "http://www.w3.org/2000/svg",
21799
22191
  viewBox: "0 0 100 125",
21800
22192
  fill: "currentColor"
@@ -21809,18 +22201,18 @@ function SvgSubscription(props) {
21809
22201
  }))))));
21810
22202
  }
21811
22203
 
21812
- var _path$5;
22204
+ var _path$6;
21813
22205
 
21814
- function _extends$5() { _extends$5 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$5.apply(this, arguments); }
22206
+ function _extends$6() { _extends$6 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$6.apply(this, arguments); }
21815
22207
 
21816
22208
  function SvgShopping(props) {
21817
- return /*#__PURE__*/React.createElement("svg", _extends$5({
22209
+ return /*#__PURE__*/React.createElement("svg", _extends$6({
21818
22210
  className: "plc-w-6 plc-h-6 plc-mr-2",
21819
22211
  xmlns: "http://www.w3.org/2000/svg",
21820
22212
  fill: "none",
21821
22213
  viewBox: "0 0 24 24",
21822
22214
  stroke: "currentColor"
21823
- }, props), _path$5 || (_path$5 = /*#__PURE__*/React.createElement("path", {
22215
+ }, props), _path$6 || (_path$6 = /*#__PURE__*/React.createElement("path", {
21824
22216
  strokeLinecap: "round",
21825
22217
  strokeLinejoin: "round",
21826
22218
  strokeWidth: 2,
@@ -21828,18 +22220,18 @@ function SvgShopping(props) {
21828
22220
  })));
21829
22221
  }
21830
22222
 
21831
- var _path$4;
22223
+ var _path$5;
21832
22224
 
21833
- function _extends$4() { _extends$4 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$4.apply(this, arguments); }
22225
+ function _extends$5() { _extends$5 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$5.apply(this, arguments); }
21834
22226
 
21835
22227
  function SvgBookmark(props) {
21836
- return /*#__PURE__*/React.createElement("svg", _extends$4({
22228
+ return /*#__PURE__*/React.createElement("svg", _extends$5({
21837
22229
  className: "plc-w-6 plc-h-6 plc-mr-2",
21838
22230
  xmlns: "http://www.w3.org/2000/svg",
21839
22231
  fill: "none",
21840
22232
  viewBox: "0 0 24 24",
21841
22233
  stroke: "currentColor"
21842
- }, props), _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
22234
+ }, props), _path$5 || (_path$5 = /*#__PURE__*/React.createElement("path", {
21843
22235
  strokeLinecap: "round",
21844
22236
  strokeLinejoin: "round",
21845
22237
  strokeWidth: 2,
@@ -21847,33 +22239,33 @@ function SvgBookmark(props) {
21847
22239
  })));
21848
22240
  }
21849
22241
 
21850
- var _path$3;
22242
+ var _path$4;
21851
22243
 
21852
- function _extends$3() { _extends$3 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3.apply(this, arguments); }
22244
+ function _extends$4() { _extends$4 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$4.apply(this, arguments); }
21853
22245
 
21854
22246
  function SvgKey(props) {
21855
- return /*#__PURE__*/React.createElement("svg", _extends$3({
22247
+ return /*#__PURE__*/React.createElement("svg", _extends$4({
21856
22248
  xmlns: "http://www.w3.org/2000/svg",
21857
22249
  viewBox: "0 0 20 20",
21858
22250
  fill: "currentColor"
21859
- }, props), _path$3 || (_path$3 = /*#__PURE__*/React.createElement("path", {
22251
+ }, props), _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
21860
22252
  fillRule: "evenodd",
21861
22253
  d: "M18 8a6 6 0 01-7.743 5.743L10 14l-1 1-1 1H6v2H2v-4l4.257-4.257A6 6 0 1118 8zm-6-4a1 1 0 100 2 2 2 0 012 2 1 1 0 102 0 4 4 0 00-4-4z",
21862
22254
  clipRule: "evenodd"
21863
22255
  })));
21864
22256
  }
21865
22257
 
21866
- var _path$2;
22258
+ var _path$3;
21867
22259
 
21868
- function _extends$2() { _extends$2 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
22260
+ function _extends$3() { _extends$3 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3.apply(this, arguments); }
21869
22261
 
21870
22262
  function SvgDonate(props) {
21871
- return /*#__PURE__*/React.createElement("svg", _extends$2({
22263
+ return /*#__PURE__*/React.createElement("svg", _extends$3({
21872
22264
  width: 24,
21873
22265
  height: 24,
21874
22266
  fill: "currentColor",
21875
22267
  xmlns: "http://www.w3.org/2000/svg"
21876
- }, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
22268
+ }, props), _path$3 || (_path$3 = /*#__PURE__*/React.createElement("path", {
21877
22269
  d: "M4 21h9.62a3.995 3.995 0 003.037-1.397l5.102-5.952a1 1 0 00-.442-1.6l-1.968-.656a3.043 3.043 0 00-2.823.503l-3.185 2.547-.617-1.235A3.98 3.98 0 009.146 11H4c-1.103 0-2 .897-2 2v6c0 1.103.897 2 2 2zm0-8h5.146c.763 0 1.448.423 1.789 1.105l.447.895H7v2h6.014a.996.996 0 00.442-.11l.003-.001.004-.002h.003l.002-.001h.004l.001-.001c.009.003.003-.001.003-.001.01 0 .002-.001.002-.001h.001l.002-.001.003-.001.002-.001.002-.001.003-.001.002-.001c.003 0 .001-.001.002-.001l.003-.002.002-.001.002-.001.003-.001.002-.001h.001l.002-.001h.001l.002-.001.002-.001c.009-.001.003-.001.003-.001l.002-.001a.915.915 0 00.11-.078l4.146-3.317c.262-.208.623-.273.94-.167l.557.186-4.133 4.823a2.029 2.029 0 01-1.52.688H4v-6zM16 2h-.017c-.163.002-1.006.039-1.983.705-.951-.648-1.774-.7-1.968-.704L12.002 2h-.004c-.801 0-1.555.313-2.119.878C9.313 3.445 9 4.198 9 5s.313 1.555.861 2.104l3.414 3.586a1.006 1.006 0 001.45-.001l3.396-3.568C18.688 6.555 19 5.802 19 5s-.313-1.555-.878-2.121A2.978 2.978 0 0016.002 2H16zm1 3c0 .267-.104.518-.311.725L14 8.55l-2.707-2.843C11.104 5.518 11 5.267 11 5s.104-.518.294-.708A.977.977 0 0111.979 4c.025.001.502.032 1.067.485.081.065.163.139.247.222l.707.707.707-.707c.084-.083.166-.157.247-.222.529-.425.976-.478 1.052-.484a.987.987 0 01.701.292c.189.189.293.44.293.707z"
21878
22270
  })));
21879
22271
  }
@@ -21910,9 +22302,11 @@ const DonationsMenu = () => {
21910
22302
  };
21911
22303
 
21912
22304
  function getDonationSubs() {
21913
- var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3;
22305
+ var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3, _window$Pelcro$user$r, _window$Pelcro$user$r2;
21914
22306
 
21915
- 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 : [];
22307
+ 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 : [];
22308
+ 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 : [];
22309
+ return [...donations, ...canceledDonations];
21916
22310
  }
21917
22311
 
21918
22312
  function formatStartDate(date) {
@@ -21920,6 +22314,138 @@ function formatStartDate(date) {
21920
22314
  return new Intl.DateTimeFormat("en-CA").format(startDate);
21921
22315
  }
21922
22316
 
22317
+ const InvoicesMenu = props => {
22318
+ const {
22319
+ t
22320
+ } = useTranslation("dashboard");
22321
+ return /*#__PURE__*/React__default.createElement("table", {
22322
+ className: "plc-w-full plc-table-fixed"
22323
+ }, /*#__PURE__*/React__default.createElement("thead", {
22324
+ className: "plc-text-xs plc-font-semibold plc-tracking-wider plc-text-gray-400 plc-uppercase "
22325
+ }, /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("th", {
22326
+ className: "plc-w-4/12 "
22327
+ }, t("labels.details")), /*#__PURE__*/React__default.createElement("th", {
22328
+ className: "plc-w-4/12 "
22329
+ }, t("labels.status.title")), /*#__PURE__*/React__default.createElement("th", {
22330
+ className: "plc-w-3/12 "
22331
+ }, t("labels.actions")))), /*#__PURE__*/React__default.createElement("tbody", null, /*#__PURE__*/React__default.createElement("tr", {
22332
+ className: "plc-h-4"
22333
+ }), /*#__PURE__*/React__default.createElement(InvoicesItems, props)));
22334
+ };
22335
+
22336
+ const InvoicesItems = () => {
22337
+ var _window$Pelcro$invoic, _window$Pelcro$invoic2;
22338
+
22339
+ const {
22340
+ t
22341
+ } = useTranslation("dashboard");
22342
+ const {
22343
+ setInvoice,
22344
+ switchView
22345
+ } = usePelcro();
22346
+ 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 : [];
22347
+
22348
+ const showInvoiceDetails = event => {
22349
+ if (setInvoice(event.target.dataset.id)) {
22350
+ switchView("invoice-details");
22351
+ }
22352
+ };
22353
+
22354
+ if (invoices.length === 0) return null;
22355
+ return invoices.sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime()).map(invoice => {
22356
+ const invoiceStatus = getInvoiceStatus(invoice);
22357
+ const formattedCreationDate = new Intl.DateTimeFormat("en-CA").format(new Date(invoice.created_at));
22358
+ return /*#__PURE__*/React__default.createElement("tr", {
22359
+ key: invoice.id,
22360
+ className: `plc-w-full plc-align-middle plc-cursor-pointer accordion-header hover:plc-bg-gray-50`
22361
+ }, /*#__PURE__*/React__default.createElement("td", {
22362
+ className: "plc-truncate"
22363
+ }, /*#__PURE__*/React__default.createElement("span", {
22364
+ className: "plc-font-semibold plc-text-gray-500"
22365
+ }, `#${invoice.id}`), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("span", {
22366
+ className: "plc-text-sm plc-text-gray-500"
22367
+ }, getFormattedPriceByLocal(invoice.total, invoice.currency, getPageOrDefaultLanguage())), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("span", {
22368
+ className: "plc-text-sm plc-text-gray-500"
22369
+ }, formattedCreationDate)), /*#__PURE__*/React__default.createElement("td", {
22370
+ className: "plc-py-2"
22371
+ }, /*#__PURE__*/React__default.createElement("span", {
22372
+ className: `plc-inline-flex plc-p-1 plc-text-xs plc-font-semibold ${invoiceStatus.bgColor} plc-uppercase ${invoiceStatus.textColor} plc-rounded-lg`
22373
+ }, invoiceStatus.icon, invoiceStatus.title)), /*#__PURE__*/React__default.createElement("td", null, /*#__PURE__*/React__default.createElement(Button, {
22374
+ variant: "ghost",
22375
+ className: "plc-text-blue-400 focus:plc-ring-blue-400 pelcro-dashboard-view-invoice-button",
22376
+ icon: /*#__PURE__*/React__default.createElement(SvgDocument, {
22377
+ className: "plc-w-4 plc-h-4"
22378
+ }),
22379
+ onClick: showInvoiceDetails,
22380
+ "data-id": invoice.id
22381
+ }, t("labels.view"))));
22382
+ });
22383
+ };
22384
+
22385
+ function getInvoiceStatus(invoice) {
22386
+ const translations = i18next.t("dashboard:labels", {
22387
+ returnObjects: true
22388
+ });
22389
+
22390
+ switch (invoice.status) {
22391
+ case "paid":
22392
+ return {
22393
+ textColor: "plc-text-green-700",
22394
+ bgColor: "plc-bg-green-100",
22395
+ icon: /*#__PURE__*/React__default.createElement(SvgCheckMark, null),
22396
+ title: translations.paid
22397
+ };
22398
+
22399
+ case "past_due":
22400
+ return {
22401
+ textColor: "plc-text-orange-700",
22402
+ bgColor: "plc-bg-orange-100",
22403
+ icon: /*#__PURE__*/React__default.createElement(SvgExclamation, null),
22404
+ title: translations.pastDue
22405
+ };
22406
+
22407
+ case "open":
22408
+ return {
22409
+ textColor: "plc-text-yellow-700",
22410
+ bgColor: "plc-bg-yellow-100",
22411
+ icon: /*#__PURE__*/React__default.createElement(SvgExclamation, null),
22412
+ title: translations.open
22413
+ };
22414
+
22415
+ case "draft":
22416
+ return {
22417
+ textColor: "plc-text-blue-700",
22418
+ bgColor: "plc-bg-blue-100",
22419
+ icon: /*#__PURE__*/React__default.createElement(SvgEdit, null),
22420
+ title: translations.draft
22421
+ };
22422
+
22423
+ case "scheduled":
22424
+ return {
22425
+ textColor: "plc-text-blue-700",
22426
+ bgColor: "plc-bg-blue-100",
22427
+ icon: /*#__PURE__*/React__default.createElement(SvgCalendar, null),
22428
+ title: translations.scheduled
22429
+ };
22430
+
22431
+ case "uncollectible":
22432
+ return {
22433
+ textColor: "plc-text-red-700",
22434
+ bgColor: "plc-bg-red-100",
22435
+ icon: /*#__PURE__*/React__default.createElement(SvgXIconSolid, null),
22436
+ title: translations.uncollectible
22437
+ };
22438
+
22439
+ case "void":
22440
+ return {
22441
+ textColor: "plc-text-gray-700",
22442
+ bgColor: "plc-bg-gray-100",
22443
+ icon: /*#__PURE__*/React__default.createElement(SvgXIconSolid, null),
22444
+ title: translations.void
22445
+ };
22446
+ }
22447
+ }
22448
+
21923
22449
  const SUB_MENUS = {
21924
22450
  PROFILE: "profile",
21925
22451
  SUBSCRIPTIONS: "subscriptions",
@@ -21928,6 +22454,7 @@ const SUB_MENUS = {
21928
22454
  ADDRESSES: "addresses",
21929
22455
  GIFTS: "gifts",
21930
22456
  ORDERS: "orders",
22457
+ INVOICES: "invoices",
21931
22458
  SAVED_ITEMS: "saved-items"
21932
22459
  };
21933
22460
  /**
@@ -22065,9 +22592,10 @@ class Dashboard extends Component {
22065
22592
  }) => {
22066
22593
  if (isGift) {
22067
22594
  this.props.setProductAndPlan(null, null, true);
22595
+ return this.props.setView("plan-select");
22068
22596
  }
22069
22597
 
22070
- return this.props.setView("plan-select");
22598
+ return this.props.setView("subscription-options");
22071
22599
  });
22072
22600
 
22073
22601
  _defineProperty$3(this, "displayAddressCreate", () => {
@@ -22470,6 +22998,12 @@ class Dashboard extends Component {
22470
22998
  icon: /*#__PURE__*/React__default.createElement(SvgShopping, null),
22471
22999
  title: this.locale("labels.orders.label"),
22472
23000
  content: /*#__PURE__*/React__default.createElement(OrdersMenu, null)
23001
+ }), /*#__PURE__*/React__default.createElement(Accordion.item, {
23002
+ show: hasInvoices(),
23003
+ name: SUB_MENUS.INVOICES,
23004
+ icon: /*#__PURE__*/React__default.createElement(SvgDocument, null),
23005
+ title: this.locale("labels.invoices"),
23006
+ content: /*#__PURE__*/React__default.createElement(InvoicesMenu, null)
22473
23007
  }), /*#__PURE__*/React__default.createElement(Accordion.item, {
22474
23008
  name: SUB_MENUS.SAVED_ITEMS,
22475
23009
  icon: /*#__PURE__*/React__default.createElement(SvgBookmark, null),
@@ -22485,11 +23019,19 @@ class Dashboard extends Component {
22485
23019
 
22486
23020
  }
22487
23021
 
23022
+ function hasInvoices() {
23023
+ var _window$Pelcro$invoic, _window$Pelcro$invoic2;
23024
+
23025
+ 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 : [];
23026
+ return invoices.length > 0;
23027
+ }
23028
+
22488
23029
  function hasDonationSubs() {
22489
- var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3;
23030
+ var _window$Pelcro$subscr, _window$Pelcro$subscr2, _window$Pelcro$subscr3, _window$Pelcro$user$r4, _window$Pelcro$user$r5;
22490
23031
 
22491
- 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 : [];
22492
- return donations.length > 0;
23032
+ 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 : [];
23033
+ 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 : [];
23034
+ return donations.length > 0 || canceledDonations.length > 0;
22493
23035
  }
22494
23036
 
22495
23037
  const DashboardWithTrans = withTranslation("dashboard")(Dashboard);
@@ -22519,7 +23061,7 @@ const DashboardOpenButton = () => {
22519
23061
  };
22520
23062
  DashboardOpenButton.viewId = "dashboard-open";
22521
23063
 
22522
- const initialState$1 = {
23064
+ const initialState$3 = {
22523
23065
  imageSrc: null,
22524
23066
  crop: {
22525
23067
  x: 0,
@@ -22533,10 +23075,10 @@ const initialState$1 = {
22533
23075
  content: ""
22534
23076
  }
22535
23077
  };
22536
- const store$1 = /*#__PURE__*/createContext(initialState$1);
23078
+ const store$3 = /*#__PURE__*/createContext(initialState$3);
22537
23079
  const {
22538
- Provider: Provider$1
22539
- } = store$1;
23080
+ Provider: Provider$3
23081
+ } = store$3;
22540
23082
 
22541
23083
  const ProfilePicChangeContainer = ({
22542
23084
  style,
@@ -22670,21 +23212,21 @@ const ProfilePicChangeContainer = ({
22670
23212
  default:
22671
23213
  return state;
22672
23214
  }
22673
- }, initialState$1);
23215
+ }, initialState$3);
22674
23216
  return /*#__PURE__*/React__default.createElement("div", {
22675
23217
  style: { ...style
22676
23218
  },
22677
23219
  className: `pelcro-container pelcro-profile-picture-container ${className}`
22678
- }, /*#__PURE__*/React__default.createElement(Provider$1, {
23220
+ }, /*#__PURE__*/React__default.createElement(Provider$3, {
22679
23221
  value: {
22680
23222
  state,
22681
23223
  dispatch
22682
23224
  }
22683
23225
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
22684
- store: store$1,
23226
+ store: store$3,
22685
23227
  key: i
22686
23228
  })) : /*#__PURE__*/React__default.cloneElement(children, {
22687
- store: store$1
23229
+ store: store$3
22688
23230
  })));
22689
23231
  };
22690
23232
  /**
@@ -22746,7 +23288,7 @@ const ProfilePicChangeButton = ({
22746
23288
  isSubmitting
22747
23289
  },
22748
23290
  dispatch
22749
- } = useContext(store$1);
23291
+ } = useContext(store$3);
22750
23292
  const {
22751
23293
  t
22752
23294
  } = useTranslation("userEdit");
@@ -24114,7 +24656,7 @@ const ProfilePicChangeCropper = ({
24114
24656
  zoom
24115
24657
  },
24116
24658
  dispatch
24117
- } = useContext(store$1);
24659
+ } = useContext(store$3);
24118
24660
  return /*#__PURE__*/React__default.createElement("div", {
24119
24661
  className: `plc-relative plc-w-full plc-h-52 sm:plc-h-96 ${className}`
24120
24662
  }, /*#__PURE__*/React__default.createElement(Cropper, Object.assign({
@@ -24156,7 +24698,7 @@ const ProfilePicChangeZoom = ({
24156
24698
  zoom
24157
24699
  },
24158
24700
  dispatch
24159
- } = useContext(store$1);
24701
+ } = useContext(store$3);
24160
24702
  const {
24161
24703
  t
24162
24704
  } = useTranslation("userEdit");
@@ -24179,18 +24721,18 @@ const ProfilePicChangeZoom = ({
24179
24721
  }, otherProps)));
24180
24722
  };
24181
24723
 
24182
- var _path$1;
24724
+ var _path$2;
24183
24725
 
24184
- function _extends$1() { _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
24726
+ function _extends$2() { _extends$2 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
24185
24727
 
24186
24728
  function SvgPhotograph(props) {
24187
- return /*#__PURE__*/React.createElement("svg", _extends$1({
24729
+ return /*#__PURE__*/React.createElement("svg", _extends$2({
24188
24730
  xmlns: "http://www.w3.org/2000/svg",
24189
24731
  className: "plc-h-6 plc-w-6",
24190
24732
  fill: "none",
24191
24733
  viewBox: "0 0 24 24",
24192
24734
  stroke: "currentColor"
24193
- }, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
24735
+ }, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
24194
24736
  strokeLinecap: "round",
24195
24737
  strokeLinejoin: "round",
24196
24738
  strokeWidth: 2,
@@ -24208,7 +24750,7 @@ const ProfilePicChangeSelectButton = ({
24208
24750
  state: {
24209
24751
  isSubmitting
24210
24752
  }
24211
- } = useContext(store$1);
24753
+ } = useContext(store$3);
24212
24754
  const {
24213
24755
  t
24214
24756
  } = useTranslation("userEdit");
@@ -24250,7 +24792,7 @@ const ProfilePicChangeRemoveButton = ({
24250
24792
  state: {
24251
24793
  isSubmitting
24252
24794
  }
24253
- } = useContext(store$1);
24795
+ } = useContext(store$3);
24254
24796
  const {
24255
24797
  t
24256
24798
  } = useTranslation("userEdit");
@@ -24273,7 +24815,7 @@ const ProfilePicChangeWrapper = () => {
24273
24815
  state: {
24274
24816
  imageSrc
24275
24817
  }
24276
- } = useContext(store$1);
24818
+ } = useContext(store$3);
24277
24819
  const {
24278
24820
  t
24279
24821
  } = useTranslation("userEdit");
@@ -24335,17 +24877,17 @@ function ProfilePicChangeModal({
24335
24877
  }
24336
24878
  ProfilePicChangeModal.viewId = "profile-picture";
24337
24879
 
24338
- const initialState = {
24880
+ const initialState$2 = {
24339
24881
  isSubmitting: false,
24340
24882
  alert: {
24341
24883
  type: "error",
24342
24884
  content: ""
24343
24885
  }
24344
24886
  };
24345
- const store = /*#__PURE__*/createContext(initialState);
24887
+ const store$2 = /*#__PURE__*/createContext(initialState$2);
24346
24888
  const {
24347
- Provider
24348
- } = store;
24889
+ Provider: Provider$2
24890
+ } = store$2;
24349
24891
 
24350
24892
  const EmailVerifyContainer = ({
24351
24893
  style,
@@ -24408,21 +24950,21 @@ const EmailVerifyContainer = ({
24408
24950
  default:
24409
24951
  return state;
24410
24952
  }
24411
- }, initialState);
24953
+ }, initialState$2);
24412
24954
  return /*#__PURE__*/React__default.createElement("div", {
24413
24955
  style: { ...style
24414
24956
  },
24415
24957
  className: `pelcro-container pelcro-email-verify-container ${className}`
24416
- }, /*#__PURE__*/React__default.createElement(Provider, {
24958
+ }, /*#__PURE__*/React__default.createElement(Provider$2, {
24417
24959
  value: {
24418
24960
  state,
24419
24961
  dispatch
24420
24962
  }
24421
24963
  }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
24422
- store,
24964
+ store: store$2,
24423
24965
  key: i
24424
24966
  })) : /*#__PURE__*/React__default.cloneElement(children, {
24425
- store
24967
+ store: store$2
24426
24968
  })));
24427
24969
  };
24428
24970
 
@@ -24436,7 +24978,7 @@ const EmailVerifyResendButton = ({
24436
24978
  state: {
24437
24979
  isSubmitting
24438
24980
  }
24439
- } = useContext(store);
24981
+ } = useContext(store$2);
24440
24982
  const {
24441
24983
  t
24442
24984
  } = useTranslation("verifyEmail");
@@ -24451,16 +24993,16 @@ const EmailVerifyResendButton = ({
24451
24993
  }, otherProps), name !== null && name !== void 0 ? name : t("labels.resend"));
24452
24994
  };
24453
24995
 
24454
- var _path, _path2;
24996
+ var _path$1, _path2;
24455
24997
 
24456
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
24998
+ function _extends$1() { _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
24457
24999
 
24458
25000
  function SvgEmailVerify(props) {
24459
- return /*#__PURE__*/React.createElement("svg", _extends({
25001
+ return /*#__PURE__*/React.createElement("svg", _extends$1({
24460
25002
  className: "plc-w-6 plc-h-6",
24461
25003
  viewBox: "0 0 700 700",
24462
25004
  xmlns: "http://www.w3.org/2000/svg"
24463
- }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
25005
+ }, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
24464
25006
  d: "M583.01 231.93a15.008 15.008 0 00-.887-3.875c-.562-1.254-1.129-2.508-1.695-3.762a14.686 14.686 0 00-1.898-1.789c-.438-.437-.653-1.027-1.153-1.414l-56.266-44.164v-52.484a15.555 15.555 0 00-15.554-15.555H434.56l-74.945-58.895a15.547 15.547 0 00-19.227 0l-74.945 58.895h-70.996a15.555 15.555 0 00-15.555 15.555v52.484l-56.266 44.16c-.496.39-.715.996-1.152 1.43v.004a13.37 13.37 0 00-1.898 1.773c-.22.426-.414.86-.59 1.305a14.158 14.158 0 00-1.106 2.457 15.009 15.009 0 00-.886 3.875c0 .48-.329.918-.329 1.398l.004 264.45a15.555 15.555 0 0015.555 15.555h435.55a15.555 15.555 0 0015.555-15.555v-264.45c0-.48-.278-.918-.325-1.398zm-41.176.809l-20.723 14.809v-31.11zm-191.83-150.73l34.223 26.883h-68.445zm-140 57.992h280v124.45c.07 1.593.383 3.168.934 4.664l-140.93 100.66-140.46-100.33c.214-.77.37-1.555.464-2.348zm-31.109 107.55l-20.719-14.81 20.719-16.27zm-31.113 234.67V263.56l193.18 137.99a15.562 15.562 0 0018.078 0l193.18-137.99v218.66z"
24465
25007
  })), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
24466
25008
  d: "M324.33 291.81a15.56 15.56 0 0020.582-.297l85.555-77.777a15.56 15.56 0 00-20.938-23.023l-75.398 68.539-44.023-37.723a15.54 15.54 0 00-11.46-4.106 15.553 15.553 0 00-8.758 27.718z"
@@ -24511,4 +25053,459 @@ const EmailVerifyModal = ({
24511
25053
  };
24512
25054
  EmailVerifyModal.viewId = "email-verify";
24513
25055
 
24514
- export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplyCouponButton, Auth0LoginButton, Badge, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, Email, EmailVerifyContainer, EmailVerifyModal, EmailVerifyResendButton, EmailVerifyView, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, Input, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCreateContainer, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, TaxAmount, TextArea, Tooltip, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, notify, unauthenticatedButtons, usePelcro };
25056
+ const InvoicePaymentContainer = props => /*#__PURE__*/React__default.createElement(PaymentMethodContainer, Object.assign({
25057
+ type: "invoicePayment",
25058
+ className: "pelcro-invoice-payment-container"
25059
+ }, props));
25060
+
25061
+ const InvoicePaymentView = props => {
25062
+ const {
25063
+ t
25064
+ } = useTranslation("payment");
25065
+ return /*#__PURE__*/React__default.createElement("div", {
25066
+ id: "pelcro-invoice-payment-view"
25067
+ }, /*#__PURE__*/React__default.createElement("div", {
25068
+ className: "plc-mb-6 plc-text-2xl plc-font-semibold plc-text-center plc-text-gray-900 pelcro-title-wrapper"
25069
+ }, /*#__PURE__*/React__default.createElement("h4", null, t("labels.checkout.title"))), /*#__PURE__*/React__default.createElement("form", {
25070
+ action: "javascript:void(0);",
25071
+ className: "plc-mt-2 pelcro-form"
25072
+ }, /*#__PURE__*/React__default.createElement(PaymentMethodView, Object.assign({
25073
+ type: "invoicePayment",
25074
+ showCoupon: false,
25075
+ showExternalPaymentMethods: true
25076
+ }, props))));
25077
+ };
25078
+
25079
+ const InvoicePaymentModal = ({
25080
+ onDisplay,
25081
+ onClose,
25082
+ ...otherProps
25083
+ }) => {
25084
+ const {
25085
+ switchView
25086
+ } = usePelcro();
25087
+
25088
+ const onSuccess = () => {
25089
+ var _otherProps$onSuccess;
25090
+
25091
+ (_otherProps$onSuccess = otherProps.onSuccess) === null || _otherProps$onSuccess === void 0 ? void 0 : _otherProps$onSuccess.call(otherProps);
25092
+ return switchView("subscription-success");
25093
+ };
25094
+
25095
+ return /*#__PURE__*/React__default.createElement(Modal, {
25096
+ id: "pelcro-invoice-payment-modal",
25097
+ onDisplay: onDisplay,
25098
+ onClose: onClose
25099
+ }, /*#__PURE__*/React__default.createElement(ModalBody, null, /*#__PURE__*/React__default.createElement(InvoicePaymentView, Object.assign({}, otherProps, {
25100
+ onSuccess: onSuccess
25101
+ }))), /*#__PURE__*/React__default.createElement(ModalFooter, null, /*#__PURE__*/React__default.createElement(Authorship, null)));
25102
+ };
25103
+ InvoicePaymentModal.viewId = "invoice-payment";
25104
+
25105
+ const invoicePaymentSubmitButton = props => {
25106
+ return /*#__PURE__*/React__default.createElement(SubmitPaymentMethod, props);
25107
+ };
25108
+
25109
+ const initialState$1 = {};
25110
+ const store$1 = /*#__PURE__*/createContext(initialState$1);
25111
+ const {
25112
+ Provider: Provider$1
25113
+ } = store$1;
25114
+
25115
+ const InvoiceDetailsContainer = ({
25116
+ style,
25117
+ className = "",
25118
+ onSuccess = () => {},
25119
+ children,
25120
+ ...props
25121
+ }) => {
25122
+ const onPayButtonClick = () => {
25123
+ return onSuccess();
25124
+ };
25125
+
25126
+ const [state, dispatch] = useReducerWithSideEffects((state, action) => {
25127
+ switch (action.type) {
25128
+ case HANDLE_SUBMIT:
25129
+ return lib_4((state, dispatch) => onPayButtonClick());
25130
+
25131
+ default:
25132
+ return state;
25133
+ }
25134
+ }, initialState$1);
25135
+ return /*#__PURE__*/React__default.createElement("div", {
25136
+ style: { ...style
25137
+ },
25138
+ className: `pelcro-container pelcro-invoice-details-container ${className}`
25139
+ }, /*#__PURE__*/React__default.createElement(Provider$1, {
25140
+ value: {
25141
+ state,
25142
+ dispatch
25143
+ }
25144
+ }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
25145
+ store: store$1,
25146
+ key: i
25147
+ })) : /*#__PURE__*/React__default.cloneElement(children, {
25148
+ store: store$1
25149
+ })));
25150
+ };
25151
+
25152
+ const InvoiceDetailsDownloadButton = ({
25153
+ name,
25154
+ url,
25155
+ className,
25156
+ ...otherProps
25157
+ }) => {
25158
+ const {
25159
+ t
25160
+ } = useTranslation("invoiceDetails");
25161
+ const {
25162
+ invoice
25163
+ } = usePelcro();
25164
+ return /*#__PURE__*/React__default.createElement(Link, Object.assign({
25165
+ 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}`,
25166
+ id: "pelcro-download-invoice-link",
25167
+ href: url !== null && url !== void 0 ? url : invoice === null || invoice === void 0 ? void 0 : invoice.invoice_pdf,
25168
+ target: "_blank",
25169
+ rel: "noopener noreferrer"
25170
+ }, otherProps), name !== null && name !== void 0 ? name : t("buttons.download"));
25171
+ };
25172
+
25173
+ const InvoiceDetailsPayButton = ({
25174
+ name,
25175
+ onClick,
25176
+ ...otherProps
25177
+ }) => {
25178
+ const {
25179
+ dispatch
25180
+ } = useContext(store$1);
25181
+ const {
25182
+ t
25183
+ } = useTranslation("invoiceDetails");
25184
+ return /*#__PURE__*/React__default.createElement(Button, Object.assign({
25185
+ onClick: () => {
25186
+ dispatch({
25187
+ type: HANDLE_SUBMIT
25188
+ });
25189
+ onClick === null || onClick === void 0 ? void 0 : onClick();
25190
+ }
25191
+ }, otherProps), name !== null && name !== void 0 ? name : t("buttons.pay"));
25192
+ };
25193
+
25194
+ const InvoiceDetailsView = props => {
25195
+ const {
25196
+ t
25197
+ } = useTranslation("invoiceDetails");
25198
+ const {
25199
+ invoice
25200
+ } = usePelcro();
25201
+ const showPayButton = canPayInvoice(invoice);
25202
+ const creationDate = new Date(invoice === null || invoice === void 0 ? void 0 : invoice.created_at);
25203
+ const formattedCreationDate = new Intl.DateTimeFormat("en-CA").format(creationDate);
25204
+ return /*#__PURE__*/React__default.createElement("div", {
25205
+ id: "pelcro-invoice-details-view"
25206
+ }, /*#__PURE__*/React__default.createElement("div", {
25207
+ className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
25208
+ }, /*#__PURE__*/React__default.createElement("h4", {
25209
+ className: "plc-text-2xl plc-font-semibold"
25210
+ }, t("title"))), /*#__PURE__*/React__default.createElement("form", {
25211
+ action: "javascript:void(0);",
25212
+ className: "plc-mt-2 pelcro-form"
25213
+ }, /*#__PURE__*/React__default.createElement(InvoiceDetailsContainer, props, /*#__PURE__*/React__default.createElement("div", {
25214
+ className: "plc-mt-5 pelcro-invoice-summary-wrapper"
25215
+ }, /*#__PURE__*/React__default.createElement("p", {
25216
+ className: "plc-font-bold pelcro-invoice-summary-title"
25217
+ }, t("labels.summary")), invoice && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("p", {
25218
+ className: "plc-mr-2 pelcro-invoice-creation-date"
25219
+ }, `${t("labels.creationDate")} ${formattedCreationDate}`), /*#__PURE__*/React__default.createElement("div", {
25220
+ 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"
25221
+ }, /*#__PURE__*/React__default.createElement("div", {
25222
+ className: "plc-break-words pelcro-invoice-plan-name"
25223
+ }, invoice.plan.nickname), /*#__PURE__*/React__default.createElement("div", {
25224
+ className: "plc-text-center pelcro-invoice-summary-price"
25225
+ }, calcAndFormatItemsTotal([invoice.plan], invoice.currency))), /*#__PURE__*/React__default.createElement("div", {
25226
+ 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"
25227
+ }, /*#__PURE__*/React__default.createElement("div", {
25228
+ className: "plc-mr-2 plc-flex plc-flex-col"
25229
+ }, /*#__PURE__*/React__default.createElement("p", {
25230
+ className: "pelcro-invoice-total-text"
25231
+ }, t("labels.total")), /*#__PURE__*/React__default.createElement("p", {
25232
+ className: "pelcro-invoice-total-text"
25233
+ }, t("labels.amountPaid")), /*#__PURE__*/React__default.createElement("p", {
25234
+ className: "plc-font-semibold pelcro-invoice-total-text"
25235
+ }, t("labels.amountDue"))), /*#__PURE__*/React__default.createElement("div", {
25236
+ className: "plc-flex plc-flex-col plc-items-end"
25237
+ }, /*#__PURE__*/React__default.createElement("p", {
25238
+ className: "pelcro-invoice-total"
25239
+ }, getFormattedPriceByLocal(invoice.total, invoice.currency, getPageOrDefaultLanguage())), /*#__PURE__*/React__default.createElement("p", {
25240
+ className: "pelcro-invoice-total"
25241
+ }, getFormattedPriceByLocal(invoice.amount_paid, invoice.currency, getPageOrDefaultLanguage())), /*#__PURE__*/React__default.createElement("p", {
25242
+ className: "plc-font-semibold pelcro-invoice-total"
25243
+ }, getFormattedPriceByLocal(invoice.amount_remaining, invoice.currency, getPageOrDefaultLanguage())))))), /*#__PURE__*/React__default.createElement("div", {
25244
+ className: "plc-flex plc-items-center plc-justify-center plc-mt-4"
25245
+ }, /*#__PURE__*/React__default.createElement(InvoiceDetailsDownloadButton, {
25246
+ url: invoice === null || invoice === void 0 ? void 0 : invoice.invoice_pdf,
25247
+ className: "plc-w-full plc-text-center"
25248
+ }), showPayButton && /*#__PURE__*/React__default.createElement(InvoiceDetailsPayButton, {
25249
+ role: "submit",
25250
+ className: "plc-ml-4 plc-w-full",
25251
+ id: "pelcro-submit"
25252
+ })))));
25253
+ };
25254
+
25255
+ function canPayInvoice(invoice) {
25256
+ return (invoice === null || invoice === void 0 ? void 0 : invoice.status) === "open" || (invoice === null || invoice === void 0 ? void 0 : invoice.status) === "past_due";
25257
+ }
25258
+
25259
+ const InvoiceDetailsModal = ({
25260
+ onDisplay,
25261
+ onClose,
25262
+ ...otherProps
25263
+ }) => {
25264
+ const {
25265
+ switchToPaymentView
25266
+ } = usePelcro();
25267
+
25268
+ const onSuccess = () => {
25269
+ var _otherProps$onSuccess;
25270
+
25271
+ (_otherProps$onSuccess = otherProps.onSuccess) === null || _otherProps$onSuccess === void 0 ? void 0 : _otherProps$onSuccess.call(otherProps);
25272
+ switchToPaymentView();
25273
+ };
25274
+
25275
+ return /*#__PURE__*/React__default.createElement(Modal, {
25276
+ onDisplay: onDisplay,
25277
+ onClose: onClose,
25278
+ id: "pelcro-invoice-details-modal"
25279
+ }, /*#__PURE__*/React__default.createElement(ModalBody, null, /*#__PURE__*/React__default.createElement(InvoiceDetailsView, Object.assign({}, otherProps, {
25280
+ onSuccess: onSuccess
25281
+ }))), /*#__PURE__*/React__default.createElement(ModalFooter, null, /*#__PURE__*/React__default.createElement(Authorship, null)));
25282
+ };
25283
+ InvoiceDetailsModal.viewId = "invoice-details";
25284
+
25285
+ const initialState = {
25286
+ selectedOption: ""
25287
+ };
25288
+ const store = /*#__PURE__*/createContext(initialState);
25289
+ const {
25290
+ Provider
25291
+ } = store;
25292
+
25293
+ const SubscriptionOptionsContainer = ({
25294
+ style,
25295
+ className = "",
25296
+ onRenewSubSuccess = () => {},
25297
+ onNewSubSuccess = () => {},
25298
+ children,
25299
+ ...props
25300
+ }) => {
25301
+ const submit = ({
25302
+ selectedOption
25303
+ }, dispatch) => {
25304
+ if (selectedOption === "renew") return onRenewSubSuccess();
25305
+ if (selectedOption === "new") return onNewSubSuccess();
25306
+ };
25307
+
25308
+ const [state, dispatch] = useReducerWithSideEffects((state, action) => {
25309
+ switch (action.type) {
25310
+ case SWITCH_TO_NEW:
25311
+ return lib_7({ ...state,
25312
+ selectedOption: "new"
25313
+ });
25314
+
25315
+ case SWITCH_TO_RENEW:
25316
+ return lib_7({ ...state,
25317
+ selectedOption: "renew"
25318
+ });
25319
+
25320
+ case HANDLE_SUBMIT:
25321
+ return lib_4((state, dispatch) => submit(state));
25322
+
25323
+ default:
25324
+ return state;
25325
+ }
25326
+ }, initialState);
25327
+ return /*#__PURE__*/React__default.createElement("div", {
25328
+ style: { ...style
25329
+ },
25330
+ className: `pelcro-container pelcro-subscription-options-container ${className}`
25331
+ }, /*#__PURE__*/React__default.createElement(Provider, {
25332
+ value: {
25333
+ state,
25334
+ dispatch
25335
+ }
25336
+ }, children.length ? children.map((child, i) => /*#__PURE__*/React__default.cloneElement(child, {
25337
+ store,
25338
+ key: i
25339
+ })) : /*#__PURE__*/React__default.cloneElement(children, {
25340
+ store
25341
+ })));
25342
+ };
25343
+
25344
+ var _path;
25345
+
25346
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
25347
+
25348
+ function SvgPlusCircle(props) {
25349
+ return /*#__PURE__*/React.createElement("svg", _extends({
25350
+ xmlns: "http://www.w3.org/2000/svg",
25351
+ className: "plc-h-6 plc-w-6",
25352
+ fill: "none",
25353
+ viewBox: "0 0 24 24",
25354
+ stroke: "currentColor",
25355
+ strokeWidth: 2
25356
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
25357
+ strokeLinecap: "round",
25358
+ strokeLinejoin: "round",
25359
+ d: "M12 9v3m0 0v3m0-3h3m-3 0H9m12 0a9 9 0 11-18 0 9 9 0 0118 0z"
25360
+ })));
25361
+ }
25362
+
25363
+ const SubscriptionOptionsNewButton = ({
25364
+ name,
25365
+ onClick,
25366
+ ...otherProps
25367
+ }) => {
25368
+ const {
25369
+ dispatch,
25370
+ state: {
25371
+ selectedOption
25372
+ }
25373
+ } = useContext(store);
25374
+ const {
25375
+ t
25376
+ } = useTranslation("subscriptionOptions");
25377
+ const isChecked = selectedOption === "new";
25378
+ return /*#__PURE__*/React__default.createElement(Radio, Object.assign({
25379
+ className: "plc-hidden pelcro-new-sub-option",
25380
+ labelClassName: `plc-flex plc-flex-col plc-items-center plc-justify-center plc-text-lg plc-font-semibold plc-ml-0 plc-w-52 plc-h-52 plc-text-black plc-p-2 hover:plc-bg-gray-200 pelcro-new-sub-option-label plc-border-2 plc-text-center ${isChecked ? "plc-border-black" : "plc-border-gray-300"}`,
25381
+ id: "pelcro-new-sub-option",
25382
+ name: "option",
25383
+ onChange: () => {
25384
+ dispatch({
25385
+ type: SWITCH_TO_NEW
25386
+ });
25387
+ onClick === null || onClick === void 0 ? void 0 : onClick();
25388
+ },
25389
+ checked: isChecked
25390
+ }, otherProps), name !== null && name !== void 0 ? name : t("addNew"), /*#__PURE__*/React__default.createElement(SvgPlusCircle, {
25391
+ className: "plc-w-full plc-h-full plc-mr-0"
25392
+ }));
25393
+ };
25394
+
25395
+ const SubscriptionOptionsRenewButton = ({
25396
+ name,
25397
+ onClick,
25398
+ ...otherProps
25399
+ }) => {
25400
+ const {
25401
+ dispatch,
25402
+ state: {
25403
+ selectedOption
25404
+ }
25405
+ } = useContext(store);
25406
+ const {
25407
+ t
25408
+ } = useTranslation("subscriptionOptions");
25409
+ const isChecked = selectedOption === "renew";
25410
+ return /*#__PURE__*/React__default.createElement(Radio, Object.assign({
25411
+ className: "plc-hidden pelcro-renew-sub-option",
25412
+ labelClassName: `plc-flex plc-flex-col plc-items-center plc-justify-center plc-text-lg plc-font-semibold plc-ml-0 plc-w-52 plc-h-52 plc-text-black plc-p-2 hover:plc-bg-gray-200 pelcro-renew-sub-option-label plc-border-2 plc-text-center ${isChecked ? "plc-border-black" : "plc-border-gray-300"}`,
25413
+ id: "pelcro-renew-sub-option",
25414
+ name: "option",
25415
+ onChange: () => {
25416
+ dispatch({
25417
+ type: SWITCH_TO_RENEW
25418
+ });
25419
+ onClick === null || onClick === void 0 ? void 0 : onClick();
25420
+ },
25421
+ checked: isChecked
25422
+ }, otherProps), name !== null && name !== void 0 ? name : t("renew"), /*#__PURE__*/React__default.createElement(SvgRefresh, {
25423
+ className: "plc-w-full plc-h-full plc-mr-0"
25424
+ }));
25425
+ };
25426
+
25427
+ const SubscriptionOptionsSubmit = ({
25428
+ name,
25429
+ onClick,
25430
+ ...otherProps
25431
+ }) => {
25432
+ const {
25433
+ dispatch,
25434
+ state: {
25435
+ selectedOption
25436
+ }
25437
+ } = useContext(store);
25438
+ const {
25439
+ t
25440
+ } = useTranslation("subscriptionOptions");
25441
+ return /*#__PURE__*/React__default.createElement(Button, Object.assign({
25442
+ onClick: () => {
25443
+ dispatch({
25444
+ type: HANDLE_SUBMIT
25445
+ });
25446
+ onClick === null || onClick === void 0 ? void 0 : onClick();
25447
+ },
25448
+ disabled: !selectedOption
25449
+ }, otherProps), name !== null && name !== void 0 ? name : t("next"));
25450
+ };
25451
+
25452
+ const SubscriptionOptionsView = props => {
25453
+ const {
25454
+ t
25455
+ } = useTranslation("subscriptionOptions");
25456
+ return /*#__PURE__*/React__default.createElement("div", {
25457
+ id: "pelcro-subscription-options-view"
25458
+ }, /*#__PURE__*/React__default.createElement("div", {
25459
+ className: "plc-mb-6 plc-text-center plc-text-gray-900 pelcro-title-wrapper"
25460
+ }, /*#__PURE__*/React__default.createElement("h4", {
25461
+ className: "plc-text-2xl plc-font-semibold"
25462
+ }, t("title")), /*#__PURE__*/React__default.createElement("p", null, t("subtitle"))), /*#__PURE__*/React__default.createElement("form", {
25463
+ action: "javascript:void(0);",
25464
+ className: "plc-mt-2 pelcro-form"
25465
+ }, /*#__PURE__*/React__default.createElement(SubscriptionOptionsContainer, props, /*#__PURE__*/React__default.createElement("div", {
25466
+ className: "plc-flex plc-justify-between plc-items-center"
25467
+ }, /*#__PURE__*/React__default.createElement(SubscriptionOptionsRenewButton, null), /*#__PURE__*/React__default.createElement(SubscriptionOptionsNewButton, null)), /*#__PURE__*/React__default.createElement(SubscriptionOptionsSubmit, {
25468
+ role: "submit",
25469
+ className: "plc-mt-4 plc-w-full",
25470
+ name: t("next"),
25471
+ id: "pelcro-submit"
25472
+ }))));
25473
+ };
25474
+
25475
+ const SubscriptionOptionsModal = ({
25476
+ onDisplay,
25477
+ onClose,
25478
+ ...otherProps
25479
+ }) => {
25480
+ const {
25481
+ switchView,
25482
+ setProductsList
25483
+ } = usePelcro();
25484
+
25485
+ const onRenewSubSuccess = () => {
25486
+ var _otherProps$onRenewSu;
25487
+
25488
+ (_otherProps$onRenewSu = otherProps.onRenewSubSuccess) === null || _otherProps$onRenewSu === void 0 ? void 0 : _otherProps$onRenewSu.call(otherProps);
25489
+ setProductsList(getRenewableProducts());
25490
+ switchView("_plan-select-renew");
25491
+ };
25492
+
25493
+ const onNewSubSuccess = () => {
25494
+ var _otherProps$onNewSubS;
25495
+
25496
+ (_otherProps$onNewSubS = otherProps.onNewSubSuccess) === null || _otherProps$onNewSubS === void 0 ? void 0 : _otherProps$onNewSubS.call(otherProps);
25497
+ switchView("plan-select");
25498
+ };
25499
+
25500
+ return /*#__PURE__*/React__default.createElement(Modal, {
25501
+ onDisplay: onDisplay,
25502
+ onClose: onClose,
25503
+ id: "pelcro-subscription-options-modal"
25504
+ }, /*#__PURE__*/React__default.createElement(ModalBody, null, /*#__PURE__*/React__default.createElement(SubscriptionOptionsView, Object.assign({}, otherProps, {
25505
+ onNewSubSuccess: onNewSubSuccess,
25506
+ onRenewSubSuccess: onRenewSubSuccess
25507
+ }))), /*#__PURE__*/React__default.createElement(ModalFooter, null, /*#__PURE__*/React__default.createElement(Authorship, null)));
25508
+ };
25509
+ SubscriptionOptionsModal.viewId = "subscription-options";
25510
+
25511
+ export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplyCouponButton, Auth0LoginButton, Badge, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, Email, EmailVerifyContainer, EmailVerifyModal, EmailVerifyResendButton, EmailVerifyView, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, Input, InvoiceDetailsContainer, InvoiceDetailsDownloadButton, InvoiceDetailsModal, InvoiceDetailsPayButton, InvoiceDetailsView, InvoicePaymentContainer, InvoicePaymentModal, InvoicePaymentView, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCreateContainer, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionOptionsContainer, SubscriptionOptionsModal, SubscriptionOptionsNewButton, SubscriptionOptionsRenewButton, SubscriptionOptionsSubmit, SubscriptionOptionsView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, TaxAmount, TextArea, Tooltip, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, invoicePaymentSubmitButton, notify, unauthenticatedButtons, usePelcro };