@pelcro/react-pelcro-js 4.0.0-alpha.27 → 4.0.0-alpha.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +162 -27
- package/dist/index.esm.js +162 -27
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3464,7 +3464,7 @@ var youAreSafe$3 = "You're safe - PCI compliant 128 SSL by";
|
|
|
3464
3464
|
var cancel$3 = "Cancel your subscription online at anytime.";
|
|
3465
3465
|
var giftSent$3 = "Subscription gift has been sent to";
|
|
3466
3466
|
var successfully$3 = "successfully";
|
|
3467
|
-
var entitlement$3 = "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.";
|
|
3467
|
+
var entitlement$3 = "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.";
|
|
3468
3468
|
var recaptcha$3 = "This site is protected by reCAPTCHA and the Google <1>Privacy Policy</1> and <3>Terms of Service</3> apply.";
|
|
3469
3469
|
var invalidInvoice$3 = "Invalid invoice ID, please contact support";
|
|
3470
3470
|
var invalidSubscription$2 = "Invalid subscription ID, please contact support";
|
|
@@ -3866,7 +3866,8 @@ var labels$U = {
|
|
|
3866
3866
|
inTrial: "In trial",
|
|
3867
3867
|
endingSoon: "Ending soon",
|
|
3868
3868
|
scheduled: "Scheduled",
|
|
3869
|
-
incomplete: "Incomplete"
|
|
3869
|
+
incomplete: "Incomplete",
|
|
3870
|
+
canceled: "Canceled"
|
|
3870
3871
|
},
|
|
3871
3872
|
manageMembers: "Manage Members",
|
|
3872
3873
|
shipments: "Shipments remaining",
|
|
@@ -3915,6 +3916,7 @@ var labels$U = {
|
|
|
3915
3916
|
addCard: "Add Card",
|
|
3916
3917
|
actions: "Actions",
|
|
3917
3918
|
expiresOn: "Ends",
|
|
3919
|
+
until: "Until",
|
|
3918
3920
|
startsOn: "Starts",
|
|
3919
3921
|
startDate: "Start date",
|
|
3920
3922
|
renewsOn: "Renews",
|
|
@@ -4405,7 +4407,7 @@ var youAreSafe$2 = "Vous êtes en sécurité - PCI conforme 128 SSL par";
|
|
|
4405
4407
|
var cancel$2 = "Annuler votre abonnement en ligne à tout moment.";
|
|
4406
4408
|
var giftSent$2 = "Le cadeau d’abonnement a été envoyé à";
|
|
4407
4409
|
var successfully$2 = "avec succès.";
|
|
4408
|
-
var entitlement$2 = "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";
|
|
4410
|
+
var entitlement$2 = "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";
|
|
4409
4411
|
var recaptcha$2 = "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.";
|
|
4410
4412
|
var invalidInvoice$2 = "Identifiant de facture non valide, veuillez contacter l'assistance";
|
|
4411
4413
|
var invalidSubscription$1 = "ID d'abonnement invalide, veuillez contacter l'assistance";
|
|
@@ -4808,7 +4810,8 @@ var labels$z = {
|
|
|
4808
4810
|
inTrial: "En essai",
|
|
4809
4811
|
endingSoon: "Expire bientôt",
|
|
4810
4812
|
scheduled: "Programmé",
|
|
4811
|
-
incomplete: "Incomplet"
|
|
4813
|
+
incomplete: "Incomplet",
|
|
4814
|
+
canceled: "Annulé"
|
|
4812
4815
|
},
|
|
4813
4816
|
manageMembers: "Gérer les membres",
|
|
4814
4817
|
shipments: "Expéditions restantes",
|
|
@@ -4857,6 +4860,7 @@ var labels$z = {
|
|
|
4857
4860
|
addCard: "Ajouter une carte",
|
|
4858
4861
|
actions: "Actes",
|
|
4859
4862
|
expiresOn: "Expire le",
|
|
4863
|
+
until: "Jusqu'à ce que",
|
|
4860
4864
|
startsOn: "Débute le",
|
|
4861
4865
|
startDate: "Date de début",
|
|
4862
4866
|
renewsOn: "Renouvelle le",
|
|
@@ -5293,7 +5297,7 @@ var youAreSafe$1 = "PCI 준수 128비트 SSL 인증서로 보호됩니다. 제
|
|
|
5293
5297
|
var cancel$1 = "유료 멤버십은 언제든 온라인으로 취소가 가능합니다.";
|
|
5294
5298
|
var giftSent$1 = "유료 멤버십 선물이 ";
|
|
5295
5299
|
var successfully$1 = "님께 성공적으로 전송되었습니다.";
|
|
5296
|
-
var entitlement$1 = "이 페이지의 일부 콘텐츠는 하나 이상의 요금제 가입 시 이용이 가능합니다. 전체 페이지에 액세스하려면 지금 <1
|
|
5300
|
+
var entitlement$1 = "이 페이지의 일부 콘텐츠는 하나 이상의 요금제 가입 시 이용이 가능합니다. 전체 페이지에 액세스하려면 지금 <1> 멤버십에 가입 </1>하세요.";
|
|
5297
5301
|
var recaptcha$1 = "이 사이트는 reCAPTCHA로 보호되며, Google <1>개인정보 보호정책</1> 및 <3>서비스 약관</3>이 적용됩니다.";
|
|
5298
5302
|
var invalidInvoice$1 = "유효하지 않은 인보이스 ID입니다. 지원팀에 문의하십시오.";
|
|
5299
5303
|
var invalidSubscription = "잘못된 구독 ID입니다. 지원팀에 문의하세요.";
|
|
@@ -5696,7 +5700,8 @@ var labels$k = {
|
|
|
5696
5700
|
inTrial: "체험판 사용",
|
|
5697
5701
|
endingSoon: "만료 예정",
|
|
5698
5702
|
scheduled: "예약",
|
|
5699
|
-
incomplete: "불완전한"
|
|
5703
|
+
incomplete: "불완전한",
|
|
5704
|
+
canceled: "취소 된"
|
|
5700
5705
|
},
|
|
5701
5706
|
manageMembers: "회원 관리",
|
|
5702
5707
|
shipments: "남은 배송 일정",
|
|
@@ -5744,6 +5749,7 @@ var labels$k = {
|
|
|
5744
5749
|
addCard: "카드 추가",
|
|
5745
5750
|
actions: "조치",
|
|
5746
5751
|
expiresOn: "종료",
|
|
5752
|
+
until: "까지",
|
|
5747
5753
|
startsOn: "시작",
|
|
5748
5754
|
startDate: "시작일",
|
|
5749
5755
|
renewsOn: "갱신",
|
|
@@ -6230,7 +6236,7 @@ var youAreSafe = "Estás seguro - PCI compliance 128 SSL por";
|
|
|
6230
6236
|
var cancel = "Cancela tu suscripción en línea en cualquier momento.";
|
|
6231
6237
|
var giftSent = "La suscripción de regalo se ha enviado a";
|
|
6232
6238
|
var successfully = "exitosamente";
|
|
6233
|
-
var entitlement = "Algunos de los contenidos de está página están disponibles con uno o más de nuestros planes. <1>Suscríbete</1> ahora para obtener acceso completo.";
|
|
6239
|
+
var entitlement = "Algunos de los contenidos de está página están disponibles con uno o más de nuestros planes. <1> Suscríbete </1> ahora para obtener acceso completo.";
|
|
6234
6240
|
var recaptcha = "Este sitio está protegido por reCAPTCHA, aplica la <1>Política de Privacidad</1> y los <3>Términos de Servicio</3> de Google.";
|
|
6235
6241
|
var invalidInvoice = "Número de comprobante de pago inválido, por favor contacta a soporte.";
|
|
6236
6242
|
var zeroTotalInvoice = "No puedes ver un comprobante de pago de $0";
|
|
@@ -6629,7 +6635,8 @@ var labels$5 = {
|
|
|
6629
6635
|
inTrial: "Prueba",
|
|
6630
6636
|
endingSoon: "Termina pronto",
|
|
6631
6637
|
scheduled: "Programada",
|
|
6632
|
-
incomplete: "Incompleta"
|
|
6638
|
+
incomplete: "Incompleta",
|
|
6639
|
+
canceled: "Cancelado"
|
|
6633
6640
|
},
|
|
6634
6641
|
shipments: "Envíos restantes",
|
|
6635
6642
|
logout: "Cerrar sesión",
|
|
@@ -6672,6 +6679,7 @@ var labels$5 = {
|
|
|
6672
6679
|
paymentSource: "Datos de pago",
|
|
6673
6680
|
actions: "Acciones",
|
|
6674
6681
|
expiresOn: "Finaliza",
|
|
6682
|
+
until: "Hasta que",
|
|
6675
6683
|
startsOn: "Inicia",
|
|
6676
6684
|
startDate: "Fecha de inicio",
|
|
6677
6685
|
renewsOn: "Renovación",
|
|
@@ -9070,6 +9078,27 @@ function userMustVerifyEmail() {
|
|
|
9070
9078
|
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;
|
|
9071
9079
|
return window.Pelcro.user.isAuthenticated() && isEmailVerificationEnabled && !isUserEmailVerified;
|
|
9072
9080
|
}
|
|
9081
|
+
function notifyBugsnag(callback, startOptions) {
|
|
9082
|
+
if (!window.Bugsnag && !document.querySelector('script[src="https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js"]')) {
|
|
9083
|
+
//load bugsnag CDN
|
|
9084
|
+
window.Pelcro.helpers.loadSDK("https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js", "bugsnag-cdn");
|
|
9085
|
+
document.querySelector('script[src="https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js"]').addEventListener("load", () => {
|
|
9086
|
+
var _window$Pelcro$enviro, _window$Pelcro3, _window$Pelcro3$envir, _window$Pelcro4, _window$Pelcro4$envir;
|
|
9087
|
+
|
|
9088
|
+
Bugsnag.start({
|
|
9089
|
+
apiKey: (_window$Pelcro$enviro = (_window$Pelcro3 = window.Pelcro) === null || _window$Pelcro3 === void 0 ? void 0 : (_window$Pelcro3$envir = _window$Pelcro3.environment) === null || _window$Pelcro3$envir === void 0 ? void 0 : _window$Pelcro3$envir.bugsnagKey) !== null && _window$Pelcro$enviro !== void 0 ? _window$Pelcro$enviro : "e8f6852b322540e8c25386048b99ab01",
|
|
9090
|
+
autoDetectErrors: false,
|
|
9091
|
+
releaseStage: (_window$Pelcro4 = window.Pelcro) === null || _window$Pelcro4 === void 0 ? void 0 : (_window$Pelcro4$envir = _window$Pelcro4.environment) === null || _window$Pelcro4$envir === void 0 ? void 0 : _window$Pelcro4$envir.bugsnagReleaseStage,
|
|
9092
|
+
redactedKeys: ["security_key", "password", "password_confirmation", "auth_token", "token"],
|
|
9093
|
+
...startOptions
|
|
9094
|
+
});
|
|
9095
|
+
callback();
|
|
9096
|
+
});
|
|
9097
|
+
return;
|
|
9098
|
+
}
|
|
9099
|
+
|
|
9100
|
+
callback();
|
|
9101
|
+
}
|
|
9073
9102
|
|
|
9074
9103
|
const resources = {
|
|
9075
9104
|
en: {
|
|
@@ -11238,8 +11267,10 @@ const loadPaymentSDKs = () => {
|
|
|
11238
11267
|
const {
|
|
11239
11268
|
whenUserReady
|
|
11240
11269
|
} = usePelcro.getStore();
|
|
11270
|
+
const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_gateway_settings);
|
|
11271
|
+
const supportsTap = Boolean(window.Pelcro.site.read().tap_gateway_settings);
|
|
11241
11272
|
whenUserReady(() => {
|
|
11242
|
-
if (!window.Stripe) {
|
|
11273
|
+
if (!window.Stripe && !supportsVantiv && !supportsTap) {
|
|
11243
11274
|
pure_1(window.Pelcro.environment.stripe);
|
|
11244
11275
|
}
|
|
11245
11276
|
}); // Load PayPal SDKs
|
|
@@ -11252,8 +11283,6 @@ const loadPaymentSDKs = () => {
|
|
|
11252
11283
|
} // Load Vantiv SDKs
|
|
11253
11284
|
|
|
11254
11285
|
|
|
11255
|
-
const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_gateway_settings);
|
|
11256
|
-
|
|
11257
11286
|
if (supportsVantiv) {
|
|
11258
11287
|
if (!window.jQuery) {
|
|
11259
11288
|
window.Pelcro.helpers.loadSDK("https://code.jquery.com/jquery-3.6.0.slim.min.js", "vantiv-jquery-sdk");
|
|
@@ -11261,15 +11290,13 @@ const loadPaymentSDKs = () => {
|
|
|
11261
11290
|
|
|
11262
11291
|
if (!window.EprotectIframeClient) {
|
|
11263
11292
|
const PRELIVE_URL = "https://request.eprotect.vantivprelive.com/eProtect/js/eProtect-iframe-client.min.js";
|
|
11264
|
-
const PRODUCTION_URL = "https://request.eprotect.vantivcnp.com/eProtect/js/eProtect-iframe-
|
|
11293
|
+
const PRODUCTION_URL = "https://request.eprotect.vantivcnp.com/eProtect/js/eProtect-iframe-client3.min.js";
|
|
11265
11294
|
const scriptUrlToUse = window.Pelcro.site.read().vantiv_gateway_settings.environment === "production" ? PRODUCTION_URL : PRELIVE_URL;
|
|
11266
11295
|
window.Pelcro.helpers.loadSDK(scriptUrlToUse, "vantiv-eprotect-sdk");
|
|
11267
11296
|
}
|
|
11268
11297
|
} // Load Tap SDKs
|
|
11269
11298
|
|
|
11270
11299
|
|
|
11271
|
-
const supportsTap = Boolean(window.Pelcro.site.read().tap_gateway_settings);
|
|
11272
|
-
|
|
11273
11300
|
if (supportsTap) {
|
|
11274
11301
|
window.Pelcro.helpers.loadSDK("https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js", "tap-bluebird");
|
|
11275
11302
|
window.Pelcro.helpers.loadSDK("https://secure.gosell.io/js/sdk/tap.min.js", "tap-sdk");
|
|
@@ -11466,7 +11493,11 @@ const initSubscriptionFromURL = () => {
|
|
|
11466
11493
|
var _selectedProduct$plan;
|
|
11467
11494
|
|
|
11468
11495
|
const productsList = window.Pelcro.product.list();
|
|
11469
|
-
|
|
11496
|
+
|
|
11497
|
+
if (!(productsList !== null && productsList !== void 0 && productsList.length)) {
|
|
11498
|
+
return;
|
|
11499
|
+
}
|
|
11500
|
+
|
|
11470
11501
|
const [productId, planId, isGiftParam] = [window.Pelcro.helpers.getURLParameter("product_id"), window.Pelcro.helpers.getURLParameter("plan_id"), window.Pelcro.helpers.getURLParameter("is_gift")];
|
|
11471
11502
|
const isGift = (isGiftParam === null || isGiftParam === void 0 ? void 0 : isGiftParam.toLowerCase()) === "true";
|
|
11472
11503
|
const selectedProduct = productsList.find(product => product.id === Number(productId));
|
|
@@ -12393,7 +12424,7 @@ function Email({
|
|
|
12393
12424
|
}, []);
|
|
12394
12425
|
|
|
12395
12426
|
const isEmailValid = email => {
|
|
12396
|
-
const re = /[
|
|
12427
|
+
const re = /[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?/;
|
|
12397
12428
|
return re.test(email);
|
|
12398
12429
|
};
|
|
12399
12430
|
|
|
@@ -19000,6 +19031,22 @@ class SelectModal extends React.Component {
|
|
|
19000
19031
|
}
|
|
19001
19032
|
|
|
19002
19033
|
document.addEventListener("keydown", this.handleSubmit);
|
|
19034
|
+
|
|
19035
|
+
if (!document.querySelector("#pelcro-selection-view") || !document.querySelector(".pelcro-select-product-wrapper")) {
|
|
19036
|
+
notifyBugsnag(() => {
|
|
19037
|
+
Bugsnag.notify("SelectModal - No data viewed", event => {
|
|
19038
|
+
var _window$Pelcro, _window$Pelcro$site, _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro3, _window$Pelcro3$uiSet, _window$Pelcro4;
|
|
19039
|
+
|
|
19040
|
+
event.addMetadata("MetaData", {
|
|
19041
|
+
site: (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$site = _window$Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : _window$Pelcro$site.read(),
|
|
19042
|
+
user: (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$user = _window$Pelcro2.user) === null || _window$Pelcro2$user === void 0 ? void 0 : _window$Pelcro2$user.read(),
|
|
19043
|
+
uiVersion: (_window$Pelcro3 = window.Pelcro) === null || _window$Pelcro3 === void 0 ? void 0 : (_window$Pelcro3$uiSet = _window$Pelcro3.uiSettings) === null || _window$Pelcro3$uiSet === void 0 ? void 0 : _window$Pelcro3$uiSet.uiVersion,
|
|
19044
|
+
environment: (_window$Pelcro4 = window.Pelcro) === null || _window$Pelcro4 === void 0 ? void 0 : _window$Pelcro4.environment
|
|
19045
|
+
});
|
|
19046
|
+
});
|
|
19047
|
+
});
|
|
19048
|
+
console.log("bugsnag Triggered");
|
|
19049
|
+
}
|
|
19003
19050
|
});
|
|
19004
19051
|
|
|
19005
19052
|
_defineProperty$3(this, "componentWillUnmount", () => {
|
|
@@ -22024,7 +22071,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
22024
22071
|
vantivInstanceRef.current = new window.EprotectIframeClient({
|
|
22025
22072
|
paypageId: payPageId,
|
|
22026
22073
|
reportGroup: reportGroup,
|
|
22027
|
-
style: "
|
|
22074
|
+
style: "enhancedStyle5",
|
|
22028
22075
|
height: "245",
|
|
22029
22076
|
timeout: 50000,
|
|
22030
22077
|
div: "eProtectiframe",
|
|
@@ -23185,9 +23232,10 @@ const PaymentMethodContainer = props => {
|
|
|
23185
23232
|
const {
|
|
23186
23233
|
whenUserReady
|
|
23187
23234
|
} = usePelcro.getStore();
|
|
23235
|
+
const cardProcessor = getSiteCardProcessor();
|
|
23188
23236
|
React.useEffect(() => {
|
|
23189
23237
|
whenUserReady(() => {
|
|
23190
|
-
if (!window.Stripe) {
|
|
23238
|
+
if (!window.Stripe && cardProcessor === "stripe") {
|
|
23191
23239
|
document.querySelector('script[src="https://js.stripe.com/v3"]').addEventListener("load", () => {
|
|
23192
23240
|
setIsStripeLoaded(true);
|
|
23193
23241
|
});
|
|
@@ -23203,9 +23251,11 @@ const PaymentMethodContainer = props => {
|
|
|
23203
23251
|
}, /*#__PURE__*/React__default['default'].createElement(es_11, null, /*#__PURE__*/React__default['default'].createElement(UnwrappedForm, Object.assign({
|
|
23204
23252
|
store: store$k
|
|
23205
23253
|
}, props))));
|
|
23254
|
+
} else {
|
|
23255
|
+
return /*#__PURE__*/React__default['default'].createElement(PaymentMethodContainerWithoutStripe, Object.assign({
|
|
23256
|
+
store: store$k
|
|
23257
|
+
}, props));
|
|
23206
23258
|
}
|
|
23207
|
-
|
|
23208
|
-
return null;
|
|
23209
23259
|
};
|
|
23210
23260
|
|
|
23211
23261
|
const StripeInputStyle = {
|
|
@@ -33025,13 +33075,53 @@ const OrderItems = ({
|
|
|
33025
33075
|
const DonationsMenu = ({
|
|
33026
33076
|
reactivateSubscription,
|
|
33027
33077
|
disableSubmit,
|
|
33028
|
-
cancelSubscription
|
|
33078
|
+
cancelSubscription,
|
|
33079
|
+
getSubscriptionStatus,
|
|
33080
|
+
onClose
|
|
33029
33081
|
}) => {
|
|
33030
33082
|
const {
|
|
33031
33083
|
t
|
|
33032
33084
|
} = useTranslation("dashboard");
|
|
33033
|
-
|
|
33085
|
+
const {
|
|
33086
|
+
switchView,
|
|
33087
|
+
setSubscriptionToCancel
|
|
33088
|
+
} = usePelcro();
|
|
33034
33089
|
const subscriptions = getDonationSubs().sort((a, b) => a.expires_at - b.expires_at).sort((a, b) => a.renews_at - b.renews_at).map(sub => {
|
|
33090
|
+
// Cancel button click handlers
|
|
33091
|
+
const onCancelClick = () => {
|
|
33092
|
+
const isImmediateCancelationEnabled = window.Pelcro.site.read().cancel_settings.status;
|
|
33093
|
+
|
|
33094
|
+
if (isImmediateCancelationEnabled) {
|
|
33095
|
+
setSubscriptionToCancel(sub.id);
|
|
33096
|
+
return switchView("subscription-cancel");
|
|
33097
|
+
}
|
|
33098
|
+
|
|
33099
|
+
if (userMustVerifyEmail()) {
|
|
33100
|
+
return switchView("email-verify");
|
|
33101
|
+
}
|
|
33102
|
+
|
|
33103
|
+
switchView(null);
|
|
33104
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
33105
|
+
notify.confirm((onSuccess, onFailure) => {
|
|
33106
|
+
cancelSubscription(sub.id, onSuccess, onFailure);
|
|
33107
|
+
}, {
|
|
33108
|
+
confirmMessage: t("messages.subCancellation.isSureToCancel"),
|
|
33109
|
+
loadingMessage: t("messages.subCancellation.loading"),
|
|
33110
|
+
successMessage: t("messages.subCancellation.success"),
|
|
33111
|
+
errorMessage: t("messages.subCancellation.error")
|
|
33112
|
+
}, {
|
|
33113
|
+
closeButtonLabel: t("labels.subCancellation.goBack")
|
|
33114
|
+
});
|
|
33115
|
+
}; // Reactivate button click handlers
|
|
33116
|
+
|
|
33117
|
+
|
|
33118
|
+
const onReactivateClick = () => {
|
|
33119
|
+
if (userMustVerifyEmail()) {
|
|
33120
|
+
return switchView("email-verify");
|
|
33121
|
+
}
|
|
33122
|
+
|
|
33123
|
+
reactivateSubscription(sub.id);
|
|
33124
|
+
};
|
|
33035
33125
|
|
|
33036
33126
|
return /*#__PURE__*/React__default['default'].createElement("tr", {
|
|
33037
33127
|
key: sub.id,
|
|
@@ -33044,7 +33134,29 @@ const DonationsMenu = ({
|
|
|
33044
33134
|
className: "plc-text-xs plc-text-gray-400 pelcro-donation-price"
|
|
33045
33135
|
}, getFormattedPriceByLocal(sub.plan.amount * sub.quantity, sub.plan.currency, getPageOrDefaultLanguage())))), /*#__PURE__*/React__default['default'].createElement("td", null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
33046
33136
|
className: "plc-mb-4 plc-text-gray-500 pelcro-donation-date"
|
|
33047
|
-
}, sub.status && /*#__PURE__*/React__default['default'].createElement("span", null, formatStartDate(sub.start))))
|
|
33137
|
+
}, sub.status && /*#__PURE__*/React__default['default'].createElement("span", null, formatStartDate(sub.start)))), /*#__PURE__*/React__default['default'].createElement("td", {
|
|
33138
|
+
className: "plc-py-2 truncate"
|
|
33139
|
+
}, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
33140
|
+
className: `plc-inline-flex plc-p-1 plc-text-xs plc-font-semibold ${getSubscriptionStatus(sub).bgColor} plc-uppercase ${getSubscriptionStatus(sub).textColor} plc-rounded-lg`
|
|
33141
|
+
}, getSubscriptionStatus(sub).icon, getSubscriptionStatus(sub).title), /*#__PURE__*/React__default['default'].createElement("br", null), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
33142
|
+
className: "plc-text-xs plc-text-gray-500"
|
|
33143
|
+
}, sub.status && /*#__PURE__*/React__default['default'].createElement("span", {
|
|
33144
|
+
className: "plc-inline-block plc-mt-1 plc-underline"
|
|
33145
|
+
}, getSubscriptionStatus(sub).content))), /*#__PURE__*/React__default['default'].createElement("td", null, sub.cancel_at_period_end === 1 && sub.plan.auto_renew && !sub.is_gift_recipient && /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
33146
|
+
variant: "ghost",
|
|
33147
|
+
className: "plc-text-green-400 focus:plc-ring-green-300 pelcro-dashboard-sub-reactivate-button",
|
|
33148
|
+
icon: /*#__PURE__*/React__default['default'].createElement(SvgRefresh, null),
|
|
33149
|
+
onClick: onReactivateClick,
|
|
33150
|
+
disabled: disableSubmit,
|
|
33151
|
+
"data-key": sub.id
|
|
33152
|
+
}, t("labels.reactivate")), (!sub.plan.auto_renew || sub.plan.auto_renew && sub.cancel_at_period_end === 0) && sub.status != "canceled" ? /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
33153
|
+
variant: "ghost",
|
|
33154
|
+
className: "plc-text-red-500 focus:plc-ring-red-500 pelcro-dashboard-sub-cancel-button",
|
|
33155
|
+
icon: /*#__PURE__*/React__default['default'].createElement(SvgXIconSolid, null),
|
|
33156
|
+
onClick: onCancelClick,
|
|
33157
|
+
disabled: disableSubmit,
|
|
33158
|
+
"data-key": sub.id
|
|
33159
|
+
}, t("labels.unsubscribe")) : ""));
|
|
33048
33160
|
});
|
|
33049
33161
|
return /*#__PURE__*/React__default['default'].createElement(Card, {
|
|
33050
33162
|
id: "pelcro-dashboard-donation-menu",
|
|
@@ -33055,10 +33167,14 @@ const DonationsMenu = ({
|
|
|
33055
33167
|
}, /*#__PURE__*/React__default['default'].createElement("thead", {
|
|
33056
33168
|
className: "plc-text-xs plc-font-semibold plc-tracking-wider plc-text-gray-400 plc-uppercase "
|
|
33057
33169
|
}, /*#__PURE__*/React__default['default'].createElement("tr", null, /*#__PURE__*/React__default['default'].createElement("th", {
|
|
33058
|
-
className: "plc-w-
|
|
33170
|
+
className: "plc-hidden md:plc-table-cell plc-w-3/12"
|
|
33059
33171
|
}, t("labels.plan")), /*#__PURE__*/React__default['default'].createElement("th", {
|
|
33060
|
-
className: "plc-w-1/
|
|
33061
|
-
}, t("labels.startDate"))
|
|
33172
|
+
className: "plc-w-1/3 md:plc-w-3/12"
|
|
33173
|
+
}, t("labels.startDate")), /*#__PURE__*/React__default['default'].createElement("th", {
|
|
33174
|
+
className: "plc-w-1/3 md:plc-w-3/12"
|
|
33175
|
+
}, t("labels.status.title")), /*#__PURE__*/React__default['default'].createElement("th", {
|
|
33176
|
+
className: "plc-w-1/3 md:plc-w-3/12"
|
|
33177
|
+
}, t("labels.actions")))), /*#__PURE__*/React__default['default'].createElement("tbody", null, subscriptions)));
|
|
33062
33178
|
};
|
|
33063
33179
|
|
|
33064
33180
|
function getDonationSubs() {
|
|
@@ -35425,6 +35541,13 @@ class Dashboard extends React.Component {
|
|
|
35425
35541
|
return `${this.locale("labels.status.incomplete")}`;
|
|
35426
35542
|
}
|
|
35427
35543
|
|
|
35544
|
+
if (subscription.status === "extended") {
|
|
35545
|
+
// DateTime from BE is missing 3 zeros so we add them before instancing a date
|
|
35546
|
+
const expiryDate = new Date(Number(`${subscription.end_date}000`));
|
|
35547
|
+
const formattedExpiryDate = new Intl.DateTimeFormat("en-CA").format(expiryDate);
|
|
35548
|
+
return `${this.locale("labels.until")} ${formattedExpiryDate}`;
|
|
35549
|
+
}
|
|
35550
|
+
|
|
35428
35551
|
if (subscription.cancel_at_period_end) {
|
|
35429
35552
|
// DateTime from BE is missing 3 zeros so we add them before instancing a date
|
|
35430
35553
|
const expiryDate = new Date(Number(`${subscription.expires_at}000`));
|
|
@@ -35506,6 +35629,16 @@ class Dashboard extends React.Component {
|
|
|
35506
35629
|
};
|
|
35507
35630
|
}
|
|
35508
35631
|
|
|
35632
|
+
if (sub.status === "canceled") {
|
|
35633
|
+
return {
|
|
35634
|
+
title: this.locale("labels.status.canceled"),
|
|
35635
|
+
content: this.getSubscriptionStatusText(sub),
|
|
35636
|
+
textColor: "plc-text-red-700",
|
|
35637
|
+
bgColor: "plc-bg-red-100",
|
|
35638
|
+
icon: /*#__PURE__*/React__default['default'].createElement(SvgExclamation, null)
|
|
35639
|
+
};
|
|
35640
|
+
}
|
|
35641
|
+
|
|
35509
35642
|
return {
|
|
35510
35643
|
title: this.locale("labels.status.active"),
|
|
35511
35644
|
content: this.getSubscriptionStatusText(sub),
|
|
@@ -35776,6 +35909,9 @@ class Dashboard extends React.Component {
|
|
|
35776
35909
|
}), this.state.activeDashboardLink === SUB_MENUS.MEMBERSHIPS && /*#__PURE__*/React__default['default'].createElement(MembershipsMenu, {
|
|
35777
35910
|
getSubscriptionStatus: this.getSubscriptionStatus
|
|
35778
35911
|
}), this.state.activeDashboardLink === SUB_MENUS.NEWSLETTERS && /*#__PURE__*/React__default['default'].createElement(NewslettersMenu, null), this.state.activeDashboardLink === SUB_MENUS.DONATIONS && /*#__PURE__*/React__default['default'].createElement(DonationsMenu, {
|
|
35912
|
+
cancelSubscription: this.cancelSubscription,
|
|
35913
|
+
reactivateSubscription: this.reactivateSubscription,
|
|
35914
|
+
disableSubmit: this.state.disableSubmit,
|
|
35779
35915
|
getSubscriptionStatus: this.getSubscriptionStatus
|
|
35780
35916
|
}), this.state.activeDashboardLink === SUB_MENUS.GIFTS && /*#__PURE__*/React__default['default'].createElement(GiftsMenu, {
|
|
35781
35917
|
getSubscriptionStatus: this.getSubscriptionStatus,
|
|
@@ -37822,7 +37958,6 @@ const EmailVerifyModal = ({
|
|
|
37822
37958
|
switchToAddressView,
|
|
37823
37959
|
switchToPaymentView
|
|
37824
37960
|
} = usePelcro();
|
|
37825
|
-
console.log("verify email");
|
|
37826
37961
|
|
|
37827
37962
|
const onSuccess = res => {
|
|
37828
37963
|
var _otherProps$onSuccess;
|
package/dist/index.esm.js
CHANGED
|
@@ -3434,7 +3434,7 @@ var youAreSafe$3 = "You're safe - PCI compliant 128 SSL by";
|
|
|
3434
3434
|
var cancel$3 = "Cancel your subscription online at anytime.";
|
|
3435
3435
|
var giftSent$3 = "Subscription gift has been sent to";
|
|
3436
3436
|
var successfully$3 = "successfully";
|
|
3437
|
-
var entitlement$3 = "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.";
|
|
3437
|
+
var entitlement$3 = "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.";
|
|
3438
3438
|
var recaptcha$3 = "This site is protected by reCAPTCHA and the Google <1>Privacy Policy</1> and <3>Terms of Service</3> apply.";
|
|
3439
3439
|
var invalidInvoice$3 = "Invalid invoice ID, please contact support";
|
|
3440
3440
|
var invalidSubscription$2 = "Invalid subscription ID, please contact support";
|
|
@@ -3836,7 +3836,8 @@ var labels$U = {
|
|
|
3836
3836
|
inTrial: "In trial",
|
|
3837
3837
|
endingSoon: "Ending soon",
|
|
3838
3838
|
scheduled: "Scheduled",
|
|
3839
|
-
incomplete: "Incomplete"
|
|
3839
|
+
incomplete: "Incomplete",
|
|
3840
|
+
canceled: "Canceled"
|
|
3840
3841
|
},
|
|
3841
3842
|
manageMembers: "Manage Members",
|
|
3842
3843
|
shipments: "Shipments remaining",
|
|
@@ -3885,6 +3886,7 @@ var labels$U = {
|
|
|
3885
3886
|
addCard: "Add Card",
|
|
3886
3887
|
actions: "Actions",
|
|
3887
3888
|
expiresOn: "Ends",
|
|
3889
|
+
until: "Until",
|
|
3888
3890
|
startsOn: "Starts",
|
|
3889
3891
|
startDate: "Start date",
|
|
3890
3892
|
renewsOn: "Renews",
|
|
@@ -4375,7 +4377,7 @@ var youAreSafe$2 = "Vous êtes en sécurité - PCI conforme 128 SSL par";
|
|
|
4375
4377
|
var cancel$2 = "Annuler votre abonnement en ligne à tout moment.";
|
|
4376
4378
|
var giftSent$2 = "Le cadeau d’abonnement a été envoyé à";
|
|
4377
4379
|
var successfully$2 = "avec succès.";
|
|
4378
|
-
var entitlement$2 = "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";
|
|
4380
|
+
var entitlement$2 = "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";
|
|
4379
4381
|
var recaptcha$2 = "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.";
|
|
4380
4382
|
var invalidInvoice$2 = "Identifiant de facture non valide, veuillez contacter l'assistance";
|
|
4381
4383
|
var invalidSubscription$1 = "ID d'abonnement invalide, veuillez contacter l'assistance";
|
|
@@ -4778,7 +4780,8 @@ var labels$z = {
|
|
|
4778
4780
|
inTrial: "En essai",
|
|
4779
4781
|
endingSoon: "Expire bientôt",
|
|
4780
4782
|
scheduled: "Programmé",
|
|
4781
|
-
incomplete: "Incomplet"
|
|
4783
|
+
incomplete: "Incomplet",
|
|
4784
|
+
canceled: "Annulé"
|
|
4782
4785
|
},
|
|
4783
4786
|
manageMembers: "Gérer les membres",
|
|
4784
4787
|
shipments: "Expéditions restantes",
|
|
@@ -4827,6 +4830,7 @@ var labels$z = {
|
|
|
4827
4830
|
addCard: "Ajouter une carte",
|
|
4828
4831
|
actions: "Actes",
|
|
4829
4832
|
expiresOn: "Expire le",
|
|
4833
|
+
until: "Jusqu'à ce que",
|
|
4830
4834
|
startsOn: "Débute le",
|
|
4831
4835
|
startDate: "Date de début",
|
|
4832
4836
|
renewsOn: "Renouvelle le",
|
|
@@ -5263,7 +5267,7 @@ var youAreSafe$1 = "PCI 준수 128비트 SSL 인증서로 보호됩니다. 제
|
|
|
5263
5267
|
var cancel$1 = "유료 멤버십은 언제든 온라인으로 취소가 가능합니다.";
|
|
5264
5268
|
var giftSent$1 = "유료 멤버십 선물이 ";
|
|
5265
5269
|
var successfully$1 = "님께 성공적으로 전송되었습니다.";
|
|
5266
|
-
var entitlement$1 = "이 페이지의 일부 콘텐츠는 하나 이상의 요금제 가입 시 이용이 가능합니다. 전체 페이지에 액세스하려면 지금 <1
|
|
5270
|
+
var entitlement$1 = "이 페이지의 일부 콘텐츠는 하나 이상의 요금제 가입 시 이용이 가능합니다. 전체 페이지에 액세스하려면 지금 <1> 멤버십에 가입 </1>하세요.";
|
|
5267
5271
|
var recaptcha$1 = "이 사이트는 reCAPTCHA로 보호되며, Google <1>개인정보 보호정책</1> 및 <3>서비스 약관</3>이 적용됩니다.";
|
|
5268
5272
|
var invalidInvoice$1 = "유효하지 않은 인보이스 ID입니다. 지원팀에 문의하십시오.";
|
|
5269
5273
|
var invalidSubscription = "잘못된 구독 ID입니다. 지원팀에 문의하세요.";
|
|
@@ -5666,7 +5670,8 @@ var labels$k = {
|
|
|
5666
5670
|
inTrial: "체험판 사용",
|
|
5667
5671
|
endingSoon: "만료 예정",
|
|
5668
5672
|
scheduled: "예약",
|
|
5669
|
-
incomplete: "불완전한"
|
|
5673
|
+
incomplete: "불완전한",
|
|
5674
|
+
canceled: "취소 된"
|
|
5670
5675
|
},
|
|
5671
5676
|
manageMembers: "회원 관리",
|
|
5672
5677
|
shipments: "남은 배송 일정",
|
|
@@ -5714,6 +5719,7 @@ var labels$k = {
|
|
|
5714
5719
|
addCard: "카드 추가",
|
|
5715
5720
|
actions: "조치",
|
|
5716
5721
|
expiresOn: "종료",
|
|
5722
|
+
until: "까지",
|
|
5717
5723
|
startsOn: "시작",
|
|
5718
5724
|
startDate: "시작일",
|
|
5719
5725
|
renewsOn: "갱신",
|
|
@@ -6200,7 +6206,7 @@ var youAreSafe = "Estás seguro - PCI compliance 128 SSL por";
|
|
|
6200
6206
|
var cancel = "Cancela tu suscripción en línea en cualquier momento.";
|
|
6201
6207
|
var giftSent = "La suscripción de regalo se ha enviado a";
|
|
6202
6208
|
var successfully = "exitosamente";
|
|
6203
|
-
var entitlement = "Algunos de los contenidos de está página están disponibles con uno o más de nuestros planes. <1>Suscríbete</1> ahora para obtener acceso completo.";
|
|
6209
|
+
var entitlement = "Algunos de los contenidos de está página están disponibles con uno o más de nuestros planes. <1> Suscríbete </1> ahora para obtener acceso completo.";
|
|
6204
6210
|
var recaptcha = "Este sitio está protegido por reCAPTCHA, aplica la <1>Política de Privacidad</1> y los <3>Términos de Servicio</3> de Google.";
|
|
6205
6211
|
var invalidInvoice = "Número de comprobante de pago inválido, por favor contacta a soporte.";
|
|
6206
6212
|
var zeroTotalInvoice = "No puedes ver un comprobante de pago de $0";
|
|
@@ -6599,7 +6605,8 @@ var labels$5 = {
|
|
|
6599
6605
|
inTrial: "Prueba",
|
|
6600
6606
|
endingSoon: "Termina pronto",
|
|
6601
6607
|
scheduled: "Programada",
|
|
6602
|
-
incomplete: "Incompleta"
|
|
6608
|
+
incomplete: "Incompleta",
|
|
6609
|
+
canceled: "Cancelado"
|
|
6603
6610
|
},
|
|
6604
6611
|
shipments: "Envíos restantes",
|
|
6605
6612
|
logout: "Cerrar sesión",
|
|
@@ -6642,6 +6649,7 @@ var labels$5 = {
|
|
|
6642
6649
|
paymentSource: "Datos de pago",
|
|
6643
6650
|
actions: "Acciones",
|
|
6644
6651
|
expiresOn: "Finaliza",
|
|
6652
|
+
until: "Hasta que",
|
|
6645
6653
|
startsOn: "Inicia",
|
|
6646
6654
|
startDate: "Fecha de inicio",
|
|
6647
6655
|
renewsOn: "Renovación",
|
|
@@ -9040,6 +9048,27 @@ function userMustVerifyEmail() {
|
|
|
9040
9048
|
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;
|
|
9041
9049
|
return window.Pelcro.user.isAuthenticated() && isEmailVerificationEnabled && !isUserEmailVerified;
|
|
9042
9050
|
}
|
|
9051
|
+
function notifyBugsnag(callback, startOptions) {
|
|
9052
|
+
if (!window.Bugsnag && !document.querySelector('script[src="https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js"]')) {
|
|
9053
|
+
//load bugsnag CDN
|
|
9054
|
+
window.Pelcro.helpers.loadSDK("https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js", "bugsnag-cdn");
|
|
9055
|
+
document.querySelector('script[src="https://d2wy8f7a9ursnm.cloudfront.net/v7/bugsnag.min.js"]').addEventListener("load", () => {
|
|
9056
|
+
var _window$Pelcro$enviro, _window$Pelcro3, _window$Pelcro3$envir, _window$Pelcro4, _window$Pelcro4$envir;
|
|
9057
|
+
|
|
9058
|
+
Bugsnag.start({
|
|
9059
|
+
apiKey: (_window$Pelcro$enviro = (_window$Pelcro3 = window.Pelcro) === null || _window$Pelcro3 === void 0 ? void 0 : (_window$Pelcro3$envir = _window$Pelcro3.environment) === null || _window$Pelcro3$envir === void 0 ? void 0 : _window$Pelcro3$envir.bugsnagKey) !== null && _window$Pelcro$enviro !== void 0 ? _window$Pelcro$enviro : "e8f6852b322540e8c25386048b99ab01",
|
|
9060
|
+
autoDetectErrors: false,
|
|
9061
|
+
releaseStage: (_window$Pelcro4 = window.Pelcro) === null || _window$Pelcro4 === void 0 ? void 0 : (_window$Pelcro4$envir = _window$Pelcro4.environment) === null || _window$Pelcro4$envir === void 0 ? void 0 : _window$Pelcro4$envir.bugsnagReleaseStage,
|
|
9062
|
+
redactedKeys: ["security_key", "password", "password_confirmation", "auth_token", "token"],
|
|
9063
|
+
...startOptions
|
|
9064
|
+
});
|
|
9065
|
+
callback();
|
|
9066
|
+
});
|
|
9067
|
+
return;
|
|
9068
|
+
}
|
|
9069
|
+
|
|
9070
|
+
callback();
|
|
9071
|
+
}
|
|
9043
9072
|
|
|
9044
9073
|
const resources = {
|
|
9045
9074
|
en: {
|
|
@@ -11208,8 +11237,10 @@ const loadPaymentSDKs = () => {
|
|
|
11208
11237
|
const {
|
|
11209
11238
|
whenUserReady
|
|
11210
11239
|
} = usePelcro.getStore();
|
|
11240
|
+
const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_gateway_settings);
|
|
11241
|
+
const supportsTap = Boolean(window.Pelcro.site.read().tap_gateway_settings);
|
|
11211
11242
|
whenUserReady(() => {
|
|
11212
|
-
if (!window.Stripe) {
|
|
11243
|
+
if (!window.Stripe && !supportsVantiv && !supportsTap) {
|
|
11213
11244
|
pure_1(window.Pelcro.environment.stripe);
|
|
11214
11245
|
}
|
|
11215
11246
|
}); // Load PayPal SDKs
|
|
@@ -11222,8 +11253,6 @@ const loadPaymentSDKs = () => {
|
|
|
11222
11253
|
} // Load Vantiv SDKs
|
|
11223
11254
|
|
|
11224
11255
|
|
|
11225
|
-
const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_gateway_settings);
|
|
11226
|
-
|
|
11227
11256
|
if (supportsVantiv) {
|
|
11228
11257
|
if (!window.jQuery) {
|
|
11229
11258
|
window.Pelcro.helpers.loadSDK("https://code.jquery.com/jquery-3.6.0.slim.min.js", "vantiv-jquery-sdk");
|
|
@@ -11231,15 +11260,13 @@ const loadPaymentSDKs = () => {
|
|
|
11231
11260
|
|
|
11232
11261
|
if (!window.EprotectIframeClient) {
|
|
11233
11262
|
const PRELIVE_URL = "https://request.eprotect.vantivprelive.com/eProtect/js/eProtect-iframe-client.min.js";
|
|
11234
|
-
const PRODUCTION_URL = "https://request.eprotect.vantivcnp.com/eProtect/js/eProtect-iframe-
|
|
11263
|
+
const PRODUCTION_URL = "https://request.eprotect.vantivcnp.com/eProtect/js/eProtect-iframe-client3.min.js";
|
|
11235
11264
|
const scriptUrlToUse = window.Pelcro.site.read().vantiv_gateway_settings.environment === "production" ? PRODUCTION_URL : PRELIVE_URL;
|
|
11236
11265
|
window.Pelcro.helpers.loadSDK(scriptUrlToUse, "vantiv-eprotect-sdk");
|
|
11237
11266
|
}
|
|
11238
11267
|
} // Load Tap SDKs
|
|
11239
11268
|
|
|
11240
11269
|
|
|
11241
|
-
const supportsTap = Boolean(window.Pelcro.site.read().tap_gateway_settings);
|
|
11242
|
-
|
|
11243
11270
|
if (supportsTap) {
|
|
11244
11271
|
window.Pelcro.helpers.loadSDK("https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js", "tap-bluebird");
|
|
11245
11272
|
window.Pelcro.helpers.loadSDK("https://secure.gosell.io/js/sdk/tap.min.js", "tap-sdk");
|
|
@@ -11436,7 +11463,11 @@ const initSubscriptionFromURL = () => {
|
|
|
11436
11463
|
var _selectedProduct$plan;
|
|
11437
11464
|
|
|
11438
11465
|
const productsList = window.Pelcro.product.list();
|
|
11439
|
-
|
|
11466
|
+
|
|
11467
|
+
if (!(productsList !== null && productsList !== void 0 && productsList.length)) {
|
|
11468
|
+
return;
|
|
11469
|
+
}
|
|
11470
|
+
|
|
11440
11471
|
const [productId, planId, isGiftParam] = [window.Pelcro.helpers.getURLParameter("product_id"), window.Pelcro.helpers.getURLParameter("plan_id"), window.Pelcro.helpers.getURLParameter("is_gift")];
|
|
11441
11472
|
const isGift = (isGiftParam === null || isGiftParam === void 0 ? void 0 : isGiftParam.toLowerCase()) === "true";
|
|
11442
11473
|
const selectedProduct = productsList.find(product => product.id === Number(productId));
|
|
@@ -12363,7 +12394,7 @@ function Email({
|
|
|
12363
12394
|
}, []);
|
|
12364
12395
|
|
|
12365
12396
|
const isEmailValid = email => {
|
|
12366
|
-
const re = /[
|
|
12397
|
+
const re = /[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?\.)+[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?/;
|
|
12367
12398
|
return re.test(email);
|
|
12368
12399
|
};
|
|
12369
12400
|
|
|
@@ -18970,6 +19001,22 @@ class SelectModal extends Component {
|
|
|
18970
19001
|
}
|
|
18971
19002
|
|
|
18972
19003
|
document.addEventListener("keydown", this.handleSubmit);
|
|
19004
|
+
|
|
19005
|
+
if (!document.querySelector("#pelcro-selection-view") || !document.querySelector(".pelcro-select-product-wrapper")) {
|
|
19006
|
+
notifyBugsnag(() => {
|
|
19007
|
+
Bugsnag.notify("SelectModal - No data viewed", event => {
|
|
19008
|
+
var _window$Pelcro, _window$Pelcro$site, _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro3, _window$Pelcro3$uiSet, _window$Pelcro4;
|
|
19009
|
+
|
|
19010
|
+
event.addMetadata("MetaData", {
|
|
19011
|
+
site: (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$site = _window$Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : _window$Pelcro$site.read(),
|
|
19012
|
+
user: (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$user = _window$Pelcro2.user) === null || _window$Pelcro2$user === void 0 ? void 0 : _window$Pelcro2$user.read(),
|
|
19013
|
+
uiVersion: (_window$Pelcro3 = window.Pelcro) === null || _window$Pelcro3 === void 0 ? void 0 : (_window$Pelcro3$uiSet = _window$Pelcro3.uiSettings) === null || _window$Pelcro3$uiSet === void 0 ? void 0 : _window$Pelcro3$uiSet.uiVersion,
|
|
19014
|
+
environment: (_window$Pelcro4 = window.Pelcro) === null || _window$Pelcro4 === void 0 ? void 0 : _window$Pelcro4.environment
|
|
19015
|
+
});
|
|
19016
|
+
});
|
|
19017
|
+
});
|
|
19018
|
+
console.log("bugsnag Triggered");
|
|
19019
|
+
}
|
|
18973
19020
|
});
|
|
18974
19021
|
|
|
18975
19022
|
_defineProperty$3(this, "componentWillUnmount", () => {
|
|
@@ -21994,7 +22041,7 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
21994
22041
|
vantivInstanceRef.current = new window.EprotectIframeClient({
|
|
21995
22042
|
paypageId: payPageId,
|
|
21996
22043
|
reportGroup: reportGroup,
|
|
21997
|
-
style: "
|
|
22044
|
+
style: "enhancedStyle5",
|
|
21998
22045
|
height: "245",
|
|
21999
22046
|
timeout: 50000,
|
|
22000
22047
|
div: "eProtectiframe",
|
|
@@ -23155,9 +23202,10 @@ const PaymentMethodContainer = props => {
|
|
|
23155
23202
|
const {
|
|
23156
23203
|
whenUserReady
|
|
23157
23204
|
} = usePelcro.getStore();
|
|
23205
|
+
const cardProcessor = getSiteCardProcessor();
|
|
23158
23206
|
useEffect(() => {
|
|
23159
23207
|
whenUserReady(() => {
|
|
23160
|
-
if (!window.Stripe) {
|
|
23208
|
+
if (!window.Stripe && cardProcessor === "stripe") {
|
|
23161
23209
|
document.querySelector('script[src="https://js.stripe.com/v3"]').addEventListener("load", () => {
|
|
23162
23210
|
setIsStripeLoaded(true);
|
|
23163
23211
|
});
|
|
@@ -23173,9 +23221,11 @@ const PaymentMethodContainer = props => {
|
|
|
23173
23221
|
}, /*#__PURE__*/React__default.createElement(es_11, null, /*#__PURE__*/React__default.createElement(UnwrappedForm, Object.assign({
|
|
23174
23222
|
store: store$k
|
|
23175
23223
|
}, props))));
|
|
23224
|
+
} else {
|
|
23225
|
+
return /*#__PURE__*/React__default.createElement(PaymentMethodContainerWithoutStripe, Object.assign({
|
|
23226
|
+
store: store$k
|
|
23227
|
+
}, props));
|
|
23176
23228
|
}
|
|
23177
|
-
|
|
23178
|
-
return null;
|
|
23179
23229
|
};
|
|
23180
23230
|
|
|
23181
23231
|
const StripeInputStyle = {
|
|
@@ -32995,13 +33045,53 @@ const OrderItems = ({
|
|
|
32995
33045
|
const DonationsMenu = ({
|
|
32996
33046
|
reactivateSubscription,
|
|
32997
33047
|
disableSubmit,
|
|
32998
|
-
cancelSubscription
|
|
33048
|
+
cancelSubscription,
|
|
33049
|
+
getSubscriptionStatus,
|
|
33050
|
+
onClose
|
|
32999
33051
|
}) => {
|
|
33000
33052
|
const {
|
|
33001
33053
|
t
|
|
33002
33054
|
} = useTranslation("dashboard");
|
|
33003
|
-
|
|
33055
|
+
const {
|
|
33056
|
+
switchView,
|
|
33057
|
+
setSubscriptionToCancel
|
|
33058
|
+
} = usePelcro();
|
|
33004
33059
|
const subscriptions = getDonationSubs().sort((a, b) => a.expires_at - b.expires_at).sort((a, b) => a.renews_at - b.renews_at).map(sub => {
|
|
33060
|
+
// Cancel button click handlers
|
|
33061
|
+
const onCancelClick = () => {
|
|
33062
|
+
const isImmediateCancelationEnabled = window.Pelcro.site.read().cancel_settings.status;
|
|
33063
|
+
|
|
33064
|
+
if (isImmediateCancelationEnabled) {
|
|
33065
|
+
setSubscriptionToCancel(sub.id);
|
|
33066
|
+
return switchView("subscription-cancel");
|
|
33067
|
+
}
|
|
33068
|
+
|
|
33069
|
+
if (userMustVerifyEmail()) {
|
|
33070
|
+
return switchView("email-verify");
|
|
33071
|
+
}
|
|
33072
|
+
|
|
33073
|
+
switchView(null);
|
|
33074
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
33075
|
+
notify.confirm((onSuccess, onFailure) => {
|
|
33076
|
+
cancelSubscription(sub.id, onSuccess, onFailure);
|
|
33077
|
+
}, {
|
|
33078
|
+
confirmMessage: t("messages.subCancellation.isSureToCancel"),
|
|
33079
|
+
loadingMessage: t("messages.subCancellation.loading"),
|
|
33080
|
+
successMessage: t("messages.subCancellation.success"),
|
|
33081
|
+
errorMessage: t("messages.subCancellation.error")
|
|
33082
|
+
}, {
|
|
33083
|
+
closeButtonLabel: t("labels.subCancellation.goBack")
|
|
33084
|
+
});
|
|
33085
|
+
}; // Reactivate button click handlers
|
|
33086
|
+
|
|
33087
|
+
|
|
33088
|
+
const onReactivateClick = () => {
|
|
33089
|
+
if (userMustVerifyEmail()) {
|
|
33090
|
+
return switchView("email-verify");
|
|
33091
|
+
}
|
|
33092
|
+
|
|
33093
|
+
reactivateSubscription(sub.id);
|
|
33094
|
+
};
|
|
33005
33095
|
|
|
33006
33096
|
return /*#__PURE__*/React__default.createElement("tr", {
|
|
33007
33097
|
key: sub.id,
|
|
@@ -33014,7 +33104,29 @@ const DonationsMenu = ({
|
|
|
33014
33104
|
className: "plc-text-xs plc-text-gray-400 pelcro-donation-price"
|
|
33015
33105
|
}, getFormattedPriceByLocal(sub.plan.amount * sub.quantity, sub.plan.currency, getPageOrDefaultLanguage())))), /*#__PURE__*/React__default.createElement("td", null, /*#__PURE__*/React__default.createElement("div", {
|
|
33016
33106
|
className: "plc-mb-4 plc-text-gray-500 pelcro-donation-date"
|
|
33017
|
-
}, sub.status && /*#__PURE__*/React__default.createElement("span", null, formatStartDate(sub.start))))
|
|
33107
|
+
}, sub.status && /*#__PURE__*/React__default.createElement("span", null, formatStartDate(sub.start)))), /*#__PURE__*/React__default.createElement("td", {
|
|
33108
|
+
className: "plc-py-2 truncate"
|
|
33109
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
33110
|
+
className: `plc-inline-flex plc-p-1 plc-text-xs plc-font-semibold ${getSubscriptionStatus(sub).bgColor} plc-uppercase ${getSubscriptionStatus(sub).textColor} plc-rounded-lg`
|
|
33111
|
+
}, getSubscriptionStatus(sub).icon, getSubscriptionStatus(sub).title), /*#__PURE__*/React__default.createElement("br", null), /*#__PURE__*/React__default.createElement("div", {
|
|
33112
|
+
className: "plc-text-xs plc-text-gray-500"
|
|
33113
|
+
}, sub.status && /*#__PURE__*/React__default.createElement("span", {
|
|
33114
|
+
className: "plc-inline-block plc-mt-1 plc-underline"
|
|
33115
|
+
}, getSubscriptionStatus(sub).content))), /*#__PURE__*/React__default.createElement("td", null, sub.cancel_at_period_end === 1 && sub.plan.auto_renew && !sub.is_gift_recipient && /*#__PURE__*/React__default.createElement(Button, {
|
|
33116
|
+
variant: "ghost",
|
|
33117
|
+
className: "plc-text-green-400 focus:plc-ring-green-300 pelcro-dashboard-sub-reactivate-button",
|
|
33118
|
+
icon: /*#__PURE__*/React__default.createElement(SvgRefresh, null),
|
|
33119
|
+
onClick: onReactivateClick,
|
|
33120
|
+
disabled: disableSubmit,
|
|
33121
|
+
"data-key": sub.id
|
|
33122
|
+
}, t("labels.reactivate")), (!sub.plan.auto_renew || sub.plan.auto_renew && sub.cancel_at_period_end === 0) && sub.status != "canceled" ? /*#__PURE__*/React__default.createElement(Button, {
|
|
33123
|
+
variant: "ghost",
|
|
33124
|
+
className: "plc-text-red-500 focus:plc-ring-red-500 pelcro-dashboard-sub-cancel-button",
|
|
33125
|
+
icon: /*#__PURE__*/React__default.createElement(SvgXIconSolid, null),
|
|
33126
|
+
onClick: onCancelClick,
|
|
33127
|
+
disabled: disableSubmit,
|
|
33128
|
+
"data-key": sub.id
|
|
33129
|
+
}, t("labels.unsubscribe")) : ""));
|
|
33018
33130
|
});
|
|
33019
33131
|
return /*#__PURE__*/React__default.createElement(Card, {
|
|
33020
33132
|
id: "pelcro-dashboard-donation-menu",
|
|
@@ -33025,10 +33137,14 @@ const DonationsMenu = ({
|
|
|
33025
33137
|
}, /*#__PURE__*/React__default.createElement("thead", {
|
|
33026
33138
|
className: "plc-text-xs plc-font-semibold plc-tracking-wider plc-text-gray-400 plc-uppercase "
|
|
33027
33139
|
}, /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("th", {
|
|
33028
|
-
className: "plc-w-
|
|
33140
|
+
className: "plc-hidden md:plc-table-cell plc-w-3/12"
|
|
33029
33141
|
}, t("labels.plan")), /*#__PURE__*/React__default.createElement("th", {
|
|
33030
|
-
className: "plc-w-1/
|
|
33031
|
-
}, t("labels.startDate"))
|
|
33142
|
+
className: "plc-w-1/3 md:plc-w-3/12"
|
|
33143
|
+
}, t("labels.startDate")), /*#__PURE__*/React__default.createElement("th", {
|
|
33144
|
+
className: "plc-w-1/3 md:plc-w-3/12"
|
|
33145
|
+
}, t("labels.status.title")), /*#__PURE__*/React__default.createElement("th", {
|
|
33146
|
+
className: "plc-w-1/3 md:plc-w-3/12"
|
|
33147
|
+
}, t("labels.actions")))), /*#__PURE__*/React__default.createElement("tbody", null, subscriptions)));
|
|
33032
33148
|
};
|
|
33033
33149
|
|
|
33034
33150
|
function getDonationSubs() {
|
|
@@ -35395,6 +35511,13 @@ class Dashboard extends Component {
|
|
|
35395
35511
|
return `${this.locale("labels.status.incomplete")}`;
|
|
35396
35512
|
}
|
|
35397
35513
|
|
|
35514
|
+
if (subscription.status === "extended") {
|
|
35515
|
+
// DateTime from BE is missing 3 zeros so we add them before instancing a date
|
|
35516
|
+
const expiryDate = new Date(Number(`${subscription.end_date}000`));
|
|
35517
|
+
const formattedExpiryDate = new Intl.DateTimeFormat("en-CA").format(expiryDate);
|
|
35518
|
+
return `${this.locale("labels.until")} ${formattedExpiryDate}`;
|
|
35519
|
+
}
|
|
35520
|
+
|
|
35398
35521
|
if (subscription.cancel_at_period_end) {
|
|
35399
35522
|
// DateTime from BE is missing 3 zeros so we add them before instancing a date
|
|
35400
35523
|
const expiryDate = new Date(Number(`${subscription.expires_at}000`));
|
|
@@ -35476,6 +35599,16 @@ class Dashboard extends Component {
|
|
|
35476
35599
|
};
|
|
35477
35600
|
}
|
|
35478
35601
|
|
|
35602
|
+
if (sub.status === "canceled") {
|
|
35603
|
+
return {
|
|
35604
|
+
title: this.locale("labels.status.canceled"),
|
|
35605
|
+
content: this.getSubscriptionStatusText(sub),
|
|
35606
|
+
textColor: "plc-text-red-700",
|
|
35607
|
+
bgColor: "plc-bg-red-100",
|
|
35608
|
+
icon: /*#__PURE__*/React__default.createElement(SvgExclamation, null)
|
|
35609
|
+
};
|
|
35610
|
+
}
|
|
35611
|
+
|
|
35479
35612
|
return {
|
|
35480
35613
|
title: this.locale("labels.status.active"),
|
|
35481
35614
|
content: this.getSubscriptionStatusText(sub),
|
|
@@ -35746,6 +35879,9 @@ class Dashboard extends Component {
|
|
|
35746
35879
|
}), this.state.activeDashboardLink === SUB_MENUS.MEMBERSHIPS && /*#__PURE__*/React__default.createElement(MembershipsMenu, {
|
|
35747
35880
|
getSubscriptionStatus: this.getSubscriptionStatus
|
|
35748
35881
|
}), this.state.activeDashboardLink === SUB_MENUS.NEWSLETTERS && /*#__PURE__*/React__default.createElement(NewslettersMenu, null), this.state.activeDashboardLink === SUB_MENUS.DONATIONS && /*#__PURE__*/React__default.createElement(DonationsMenu, {
|
|
35882
|
+
cancelSubscription: this.cancelSubscription,
|
|
35883
|
+
reactivateSubscription: this.reactivateSubscription,
|
|
35884
|
+
disableSubmit: this.state.disableSubmit,
|
|
35749
35885
|
getSubscriptionStatus: this.getSubscriptionStatus
|
|
35750
35886
|
}), this.state.activeDashboardLink === SUB_MENUS.GIFTS && /*#__PURE__*/React__default.createElement(GiftsMenu, {
|
|
35751
35887
|
getSubscriptionStatus: this.getSubscriptionStatus,
|
|
@@ -37792,7 +37928,6 @@ const EmailVerifyModal = ({
|
|
|
37792
37928
|
switchToAddressView,
|
|
37793
37929
|
switchToPaymentView
|
|
37794
37930
|
} = usePelcro();
|
|
37795
|
-
console.log("verify email");
|
|
37796
37931
|
|
|
37797
37932
|
const onSuccess = res => {
|
|
37798
37933
|
var _otherProps$onSuccess;
|