@pelcro/react-pelcro-js 3.19.0 → 3.20.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +50 -17
- package/dist/index.esm.js +50 -17
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3468,7 +3468,7 @@ var youAreSafe$3 = "You're safe - PCI compliant 128 SSL by";
|
|
|
3468
3468
|
var cancel$3 = "Cancel your subscription online at anytime.";
|
|
3469
3469
|
var giftSent$3 = "Subscription gift has been sent to";
|
|
3470
3470
|
var successfully$3 = "successfully";
|
|
3471
|
-
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.";
|
|
3471
|
+
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.";
|
|
3472
3472
|
var recaptcha$3 = "This site is protected by reCAPTCHA and the Google <1>Privacy Policy</1> and <3>Terms of Service</3> apply.";
|
|
3473
3473
|
var invalidInvoice$3 = "Invalid invoice ID, please contact support";
|
|
3474
3474
|
var invalidSubscription$2 = "Invalid subscription ID, please contact support";
|
|
@@ -4409,7 +4409,7 @@ var youAreSafe$2 = "Vous êtes en sécurité - PCI conforme 128 SSL par";
|
|
|
4409
4409
|
var cancel$2 = "Annuler votre abonnement en ligne à tout moment.";
|
|
4410
4410
|
var giftSent$2 = "Le cadeau d’abonnement a été envoyé à";
|
|
4411
4411
|
var successfully$2 = "avec succès.";
|
|
4412
|
-
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";
|
|
4412
|
+
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";
|
|
4413
4413
|
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.";
|
|
4414
4414
|
var invalidInvoice$2 = "Identifiant de facture non valide, veuillez contacter l'assistance";
|
|
4415
4415
|
var invalidSubscription$1 = "ID d'abonnement invalide, veuillez contacter l'assistance";
|
|
@@ -5236,7 +5236,7 @@ var youAreSafe$1 = "PCI 준수 128비트 SSL 인증서로 보호됩니다. 제
|
|
|
5236
5236
|
var cancel$1 = "유료 멤버십은 언제든 온라인으로 취소가 가능합니다.";
|
|
5237
5237
|
var giftSent$1 = "유료 멤버십 선물이 ";
|
|
5238
5238
|
var successfully$1 = "님께 성공적으로 전송되었습니다.";
|
|
5239
|
-
var entitlement$1 = "이 페이지의 일부 콘텐츠는 하나 이상의 요금제 가입 시 이용이 가능합니다. 전체 페이지에 액세스하려면 지금 <1
|
|
5239
|
+
var entitlement$1 = "이 페이지의 일부 콘텐츠는 하나 이상의 요금제 가입 시 이용이 가능합니다. 전체 페이지에 액세스하려면 지금 <1> 멤버십에 가입 </1>하세요.";
|
|
5240
5240
|
var recaptcha$1 = "이 사이트는 reCAPTCHA로 보호되며, Google <1>개인정보 보호정책</1> 및 <3>서비스 약관</3>이 적용됩니다.";
|
|
5241
5241
|
var invalidInvoice$1 = "유효하지 않은 인보이스 ID입니다. 지원팀에 문의하십시오.";
|
|
5242
5242
|
var invalidSubscription = "잘못된 구독 ID입니다. 지원팀에 문의하세요.";
|
|
@@ -6167,7 +6167,7 @@ var youAreSafe = "Estás seguro - PCI compliance 128 SSL por";
|
|
|
6167
6167
|
var cancel = "Cancela tu suscripción en línea en cualquier momento.";
|
|
6168
6168
|
var giftSent = "La suscripción de regalo se ha enviado a";
|
|
6169
6169
|
var successfully = "exitosamente";
|
|
6170
|
-
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.";
|
|
6170
|
+
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.";
|
|
6171
6171
|
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.";
|
|
6172
6172
|
var invalidInvoice = "Número de comprobante de pago inválido, por favor contacta a soporte.";
|
|
6173
6173
|
var zeroTotalInvoice = "No puedes ver un comprobante de pago de $0";
|
|
@@ -10957,8 +10957,10 @@ const loadPaymentSDKs = () => {
|
|
|
10957
10957
|
const {
|
|
10958
10958
|
whenUserReady
|
|
10959
10959
|
} = usePelcro.getStore();
|
|
10960
|
+
const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_gateway_settings);
|
|
10961
|
+
const supportsTap = Boolean(window.Pelcro.site.read().tap_gateway_settings);
|
|
10960
10962
|
whenUserReady(() => {
|
|
10961
|
-
if (!window.Stripe) {
|
|
10963
|
+
if (!window.Stripe && !supportsVantiv && !supportsTap) {
|
|
10962
10964
|
pure_1(window.Pelcro.environment.stripe);
|
|
10963
10965
|
}
|
|
10964
10966
|
});
|
|
@@ -10971,7 +10973,6 @@ const loadPaymentSDKs = () => {
|
|
|
10971
10973
|
}
|
|
10972
10974
|
|
|
10973
10975
|
// Load Vantiv SDKs
|
|
10974
|
-
const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_gateway_settings);
|
|
10975
10976
|
if (supportsVantiv) {
|
|
10976
10977
|
if (!window.jQuery) {
|
|
10977
10978
|
window.Pelcro.helpers.loadSDK("https://code.jquery.com/jquery-3.6.0.slim.min.js", "vantiv-jquery-sdk");
|
|
@@ -10985,7 +10986,6 @@ const loadPaymentSDKs = () => {
|
|
|
10985
10986
|
}
|
|
10986
10987
|
|
|
10987
10988
|
// Load Tap SDKs
|
|
10988
|
-
const supportsTap = Boolean(window.Pelcro.site.read().tap_gateway_settings);
|
|
10989
10989
|
if (supportsTap) {
|
|
10990
10990
|
window.Pelcro.helpers.loadSDK("https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js", "tap-bluebird");
|
|
10991
10991
|
window.Pelcro.helpers.loadSDK("https://secure.gosell.io/js/sdk/tap.min.js", "tap-sdk");
|
|
@@ -11159,7 +11159,9 @@ const initSubscriptionFromURL = () => {
|
|
|
11159
11159
|
whenSiteReady(() => {
|
|
11160
11160
|
var _selectedProduct$plan;
|
|
11161
11161
|
const productsList = window.Pelcro.product.list();
|
|
11162
|
-
if (!(productsList !== null && productsList !== void 0 && productsList.length))
|
|
11162
|
+
if (!(productsList !== null && productsList !== void 0 && productsList.length)) {
|
|
11163
|
+
return;
|
|
11164
|
+
}
|
|
11163
11165
|
const [productId, planId, isGiftParam] = [window.Pelcro.helpers.getURLParameter("product_id"), window.Pelcro.helpers.getURLParameter("plan_id"), window.Pelcro.helpers.getURLParameter("is_gift")];
|
|
11164
11166
|
const isGift = (isGiftParam === null || isGiftParam === void 0 ? void 0 : isGiftParam.toLowerCase()) === "true";
|
|
11165
11167
|
const selectedProduct = productsList.find(product => product.id === Number(productId));
|
|
@@ -12067,7 +12069,7 @@ function Email(_ref) {
|
|
|
12067
12069
|
}
|
|
12068
12070
|
}, []);
|
|
12069
12071
|
const isEmailValid = email => {
|
|
12070
|
-
const re = /[
|
|
12072
|
+
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])?/;
|
|
12071
12073
|
return re.test(email);
|
|
12072
12074
|
};
|
|
12073
12075
|
return /*#__PURE__*/React__default['default'].createElement(Input, Object.assign({
|
|
@@ -13975,18 +13977,45 @@ class SelectModal extends React.Component {
|
|
|
13975
13977
|
});
|
|
13976
13978
|
}
|
|
13977
13979
|
if (this.state.productList.length === 0 && !window.Pelcro.user.isAuthenticated()) {
|
|
13978
|
-
this.props.setView(
|
|
13980
|
+
this.props.setView("register");
|
|
13979
13981
|
}
|
|
13980
13982
|
document.addEventListener("keydown", this.handleSubmit);
|
|
13981
13983
|
if (!document.querySelector("#pelcro-selection-view") || !document.querySelector(".pelcro-select-product-wrapper")) {
|
|
13984
|
+
var _window$Pelcro, _window$Pelcro$user, _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro3, _window$Pelcro3$user, _window$Pelcro4, _window$Pelcro4$site;
|
|
13985
|
+
const userCurrency = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$user = _window$Pelcro.user) === null || _window$Pelcro$user === void 0 ? void 0 : _window$Pelcro$user.read().currency;
|
|
13986
|
+
const userCountry = (_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.location.countryCode;
|
|
13987
|
+
const userLanguage = (_window$Pelcro3 = window.Pelcro) === null || _window$Pelcro3 === void 0 ? void 0 : (_window$Pelcro3$user = _window$Pelcro3.user) === null || _window$Pelcro3$user === void 0 ? void 0 : _window$Pelcro3$user.read().language;
|
|
13988
|
+
const productsWithPlansCountries = (_window$Pelcro4 = window.Pelcro) === null || _window$Pelcro4 === void 0 ? void 0 : (_window$Pelcro4$site = _window$Pelcro4.site) === null || _window$Pelcro4$site === void 0 ? void 0 : _window$Pelcro4$site.read().products.filter(product => {
|
|
13989
|
+
const filteredPlans = product.plans.filter(plan => plan.countries && plan.countries.length > 0);
|
|
13990
|
+
if (filteredPlans.length) {
|
|
13991
|
+
return product;
|
|
13992
|
+
}
|
|
13993
|
+
});
|
|
13994
|
+
const currencyMismatch = productsWithPlansCountries.length ? productsWithPlansCountries.filter(product => {
|
|
13995
|
+
const filteredPlans = product.plans.filter(plan => {
|
|
13996
|
+
var _plan$countries;
|
|
13997
|
+
return (_plan$countries = plan.countries) === null || _plan$countries === void 0 ? void 0 : _plan$countries.includes(userCountry);
|
|
13998
|
+
});
|
|
13999
|
+
if (filteredPlans.length) return filteredPlans;
|
|
14000
|
+
}).length === 0 : false;
|
|
13982
14001
|
notifyBugsnag(() => {
|
|
13983
14002
|
Bugsnag.notify("SelectModal - No data viewed", event => {
|
|
13984
|
-
var _window$
|
|
14003
|
+
var _window$Pelcro5, _window$Pelcro5$site, _window$Pelcro6, _window$Pelcro6$user, _window$Pelcro7, _window$Pelcro7$uiSet, _window$Pelcro8, _window$Pelcro9, _window$Pelcro9$helpe, _window$Pelcro10, _window$Pelcro10$site, _window$Pelcro11, _window$Pelcro11$site;
|
|
13985
14004
|
event.addMetadata("MetaData", {
|
|
13986
|
-
site: (_window$
|
|
13987
|
-
user: (_window$
|
|
13988
|
-
uiVersion: (_window$
|
|
13989
|
-
environment: (_window$
|
|
14005
|
+
site: (_window$Pelcro5 = window.Pelcro) === null || _window$Pelcro5 === void 0 ? void 0 : (_window$Pelcro5$site = _window$Pelcro5.site) === null || _window$Pelcro5$site === void 0 ? void 0 : _window$Pelcro5$site.read(),
|
|
14006
|
+
user: (_window$Pelcro6 = window.Pelcro) === null || _window$Pelcro6 === void 0 ? void 0 : (_window$Pelcro6$user = _window$Pelcro6.user) === null || _window$Pelcro6$user === void 0 ? void 0 : _window$Pelcro6$user.read(),
|
|
14007
|
+
uiVersion: (_window$Pelcro7 = window.Pelcro) === null || _window$Pelcro7 === void 0 ? void 0 : (_window$Pelcro7$uiSet = _window$Pelcro7.uiSettings) === null || _window$Pelcro7$uiSet === void 0 ? void 0 : _window$Pelcro7$uiSet.uiVersion,
|
|
14008
|
+
environment: (_window$Pelcro8 = window.Pelcro) === null || _window$Pelcro8 === void 0 ? void 0 : _window$Pelcro8.environment,
|
|
14009
|
+
userCurrency: userCurrency,
|
|
14010
|
+
userCountry: userCountry,
|
|
14011
|
+
userLanguage: userLanguage,
|
|
14012
|
+
siteLanguage: (_window$Pelcro9 = window.Pelcro) === null || _window$Pelcro9 === void 0 ? void 0 : (_window$Pelcro9$helpe = _window$Pelcro9.helpers) === null || _window$Pelcro9$helpe === void 0 ? void 0 : _window$Pelcro9$helpe.getHtmlLanguageAttribute(),
|
|
14013
|
+
currency_mismatch: ((_window$Pelcro10 = window.Pelcro) === null || _window$Pelcro10 === void 0 ? void 0 : (_window$Pelcro10$site = _window$Pelcro10.site) === null || _window$Pelcro10$site === void 0 ? void 0 : _window$Pelcro10$site.read().products.filter(product => {
|
|
14014
|
+
const filteredPlans = product.plans.find(plan => plan.currency === userCurrency);
|
|
14015
|
+
if (filteredPlans) return filteredPlans;
|
|
14016
|
+
}).length) === 0,
|
|
14017
|
+
country_restrictions: currencyMismatch,
|
|
14018
|
+
language_mismatch: ((_window$Pelcro11 = window.Pelcro) === null || _window$Pelcro11 === void 0 ? void 0 : (_window$Pelcro11$site = _window$Pelcro11.site) === null || _window$Pelcro11$site === void 0 ? void 0 : _window$Pelcro11$site.read().products.filter(product => product.language === userLanguage).length) === 0
|
|
13990
14019
|
});
|
|
13991
14020
|
});
|
|
13992
14021
|
});
|
|
@@ -17836,9 +17865,10 @@ const PaymentMethodContainer = props => {
|
|
|
17836
17865
|
const {
|
|
17837
17866
|
whenUserReady
|
|
17838
17867
|
} = usePelcro.getStore();
|
|
17868
|
+
const cardProcessor = getSiteCardProcessor();
|
|
17839
17869
|
React.useEffect(() => {
|
|
17840
17870
|
whenUserReady(() => {
|
|
17841
|
-
if (!window.Stripe) {
|
|
17871
|
+
if (!window.Stripe && cardProcessor === "stripe") {
|
|
17842
17872
|
document.querySelector('script[src="https://js.stripe.com/v3"]').addEventListener("load", () => {
|
|
17843
17873
|
setIsStripeLoaded(true);
|
|
17844
17874
|
});
|
|
@@ -17853,8 +17883,11 @@ const PaymentMethodContainer = props => {
|
|
|
17853
17883
|
}, /*#__PURE__*/React__default['default'].createElement(es_11, null, /*#__PURE__*/React__default['default'].createElement(UnwrappedForm, Object.assign({
|
|
17854
17884
|
store: store$k
|
|
17855
17885
|
}, props))));
|
|
17886
|
+
} else {
|
|
17887
|
+
return /*#__PURE__*/React__default['default'].createElement(PaymentMethodContainerWithoutStripe, Object.assign({
|
|
17888
|
+
store: store$k
|
|
17889
|
+
}, props));
|
|
17856
17890
|
}
|
|
17857
|
-
return null;
|
|
17858
17891
|
};
|
|
17859
17892
|
|
|
17860
17893
|
const StripeInputStyle = {
|
package/dist/index.esm.js
CHANGED
|
@@ -3438,7 +3438,7 @@ var youAreSafe$3 = "You're safe - PCI compliant 128 SSL by";
|
|
|
3438
3438
|
var cancel$3 = "Cancel your subscription online at anytime.";
|
|
3439
3439
|
var giftSent$3 = "Subscription gift has been sent to";
|
|
3440
3440
|
var successfully$3 = "successfully";
|
|
3441
|
-
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.";
|
|
3441
|
+
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.";
|
|
3442
3442
|
var recaptcha$3 = "This site is protected by reCAPTCHA and the Google <1>Privacy Policy</1> and <3>Terms of Service</3> apply.";
|
|
3443
3443
|
var invalidInvoice$3 = "Invalid invoice ID, please contact support";
|
|
3444
3444
|
var invalidSubscription$2 = "Invalid subscription ID, please contact support";
|
|
@@ -4379,7 +4379,7 @@ var youAreSafe$2 = "Vous êtes en sécurité - PCI conforme 128 SSL par";
|
|
|
4379
4379
|
var cancel$2 = "Annuler votre abonnement en ligne à tout moment.";
|
|
4380
4380
|
var giftSent$2 = "Le cadeau d’abonnement a été envoyé à";
|
|
4381
4381
|
var successfully$2 = "avec succès.";
|
|
4382
|
-
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";
|
|
4382
|
+
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";
|
|
4383
4383
|
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.";
|
|
4384
4384
|
var invalidInvoice$2 = "Identifiant de facture non valide, veuillez contacter l'assistance";
|
|
4385
4385
|
var invalidSubscription$1 = "ID d'abonnement invalide, veuillez contacter l'assistance";
|
|
@@ -5206,7 +5206,7 @@ var youAreSafe$1 = "PCI 준수 128비트 SSL 인증서로 보호됩니다. 제
|
|
|
5206
5206
|
var cancel$1 = "유료 멤버십은 언제든 온라인으로 취소가 가능합니다.";
|
|
5207
5207
|
var giftSent$1 = "유료 멤버십 선물이 ";
|
|
5208
5208
|
var successfully$1 = "님께 성공적으로 전송되었습니다.";
|
|
5209
|
-
var entitlement$1 = "이 페이지의 일부 콘텐츠는 하나 이상의 요금제 가입 시 이용이 가능합니다. 전체 페이지에 액세스하려면 지금 <1
|
|
5209
|
+
var entitlement$1 = "이 페이지의 일부 콘텐츠는 하나 이상의 요금제 가입 시 이용이 가능합니다. 전체 페이지에 액세스하려면 지금 <1> 멤버십에 가입 </1>하세요.";
|
|
5210
5210
|
var recaptcha$1 = "이 사이트는 reCAPTCHA로 보호되며, Google <1>개인정보 보호정책</1> 및 <3>서비스 약관</3>이 적용됩니다.";
|
|
5211
5211
|
var invalidInvoice$1 = "유효하지 않은 인보이스 ID입니다. 지원팀에 문의하십시오.";
|
|
5212
5212
|
var invalidSubscription = "잘못된 구독 ID입니다. 지원팀에 문의하세요.";
|
|
@@ -6137,7 +6137,7 @@ var youAreSafe = "Estás seguro - PCI compliance 128 SSL por";
|
|
|
6137
6137
|
var cancel = "Cancela tu suscripción en línea en cualquier momento.";
|
|
6138
6138
|
var giftSent = "La suscripción de regalo se ha enviado a";
|
|
6139
6139
|
var successfully = "exitosamente";
|
|
6140
|
-
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.";
|
|
6140
|
+
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.";
|
|
6141
6141
|
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.";
|
|
6142
6142
|
var invalidInvoice = "Número de comprobante de pago inválido, por favor contacta a soporte.";
|
|
6143
6143
|
var zeroTotalInvoice = "No puedes ver un comprobante de pago de $0";
|
|
@@ -10927,8 +10927,10 @@ const loadPaymentSDKs = () => {
|
|
|
10927
10927
|
const {
|
|
10928
10928
|
whenUserReady
|
|
10929
10929
|
} = usePelcro.getStore();
|
|
10930
|
+
const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_gateway_settings);
|
|
10931
|
+
const supportsTap = Boolean(window.Pelcro.site.read().tap_gateway_settings);
|
|
10930
10932
|
whenUserReady(() => {
|
|
10931
|
-
if (!window.Stripe) {
|
|
10933
|
+
if (!window.Stripe && !supportsVantiv && !supportsTap) {
|
|
10932
10934
|
pure_1(window.Pelcro.environment.stripe);
|
|
10933
10935
|
}
|
|
10934
10936
|
});
|
|
@@ -10941,7 +10943,6 @@ const loadPaymentSDKs = () => {
|
|
|
10941
10943
|
}
|
|
10942
10944
|
|
|
10943
10945
|
// Load Vantiv SDKs
|
|
10944
|
-
const supportsVantiv = Boolean(window.Pelcro.site.read().vantiv_gateway_settings);
|
|
10945
10946
|
if (supportsVantiv) {
|
|
10946
10947
|
if (!window.jQuery) {
|
|
10947
10948
|
window.Pelcro.helpers.loadSDK("https://code.jquery.com/jquery-3.6.0.slim.min.js", "vantiv-jquery-sdk");
|
|
@@ -10955,7 +10956,6 @@ const loadPaymentSDKs = () => {
|
|
|
10955
10956
|
}
|
|
10956
10957
|
|
|
10957
10958
|
// Load Tap SDKs
|
|
10958
|
-
const supportsTap = Boolean(window.Pelcro.site.read().tap_gateway_settings);
|
|
10959
10959
|
if (supportsTap) {
|
|
10960
10960
|
window.Pelcro.helpers.loadSDK("https://cdnjs.cloudflare.com/ajax/libs/bluebird/3.3.4/bluebird.min.js", "tap-bluebird");
|
|
10961
10961
|
window.Pelcro.helpers.loadSDK("https://secure.gosell.io/js/sdk/tap.min.js", "tap-sdk");
|
|
@@ -11129,7 +11129,9 @@ const initSubscriptionFromURL = () => {
|
|
|
11129
11129
|
whenSiteReady(() => {
|
|
11130
11130
|
var _selectedProduct$plan;
|
|
11131
11131
|
const productsList = window.Pelcro.product.list();
|
|
11132
|
-
if (!(productsList !== null && productsList !== void 0 && productsList.length))
|
|
11132
|
+
if (!(productsList !== null && productsList !== void 0 && productsList.length)) {
|
|
11133
|
+
return;
|
|
11134
|
+
}
|
|
11133
11135
|
const [productId, planId, isGiftParam] = [window.Pelcro.helpers.getURLParameter("product_id"), window.Pelcro.helpers.getURLParameter("plan_id"), window.Pelcro.helpers.getURLParameter("is_gift")];
|
|
11134
11136
|
const isGift = (isGiftParam === null || isGiftParam === void 0 ? void 0 : isGiftParam.toLowerCase()) === "true";
|
|
11135
11137
|
const selectedProduct = productsList.find(product => product.id === Number(productId));
|
|
@@ -12037,7 +12039,7 @@ function Email(_ref) {
|
|
|
12037
12039
|
}
|
|
12038
12040
|
}, []);
|
|
12039
12041
|
const isEmailValid = email => {
|
|
12040
|
-
const re = /[
|
|
12042
|
+
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])?/;
|
|
12041
12043
|
return re.test(email);
|
|
12042
12044
|
};
|
|
12043
12045
|
return /*#__PURE__*/React__default.createElement(Input, Object.assign({
|
|
@@ -13945,18 +13947,45 @@ class SelectModal extends Component {
|
|
|
13945
13947
|
});
|
|
13946
13948
|
}
|
|
13947
13949
|
if (this.state.productList.length === 0 && !window.Pelcro.user.isAuthenticated()) {
|
|
13948
|
-
this.props.setView(
|
|
13950
|
+
this.props.setView("register");
|
|
13949
13951
|
}
|
|
13950
13952
|
document.addEventListener("keydown", this.handleSubmit);
|
|
13951
13953
|
if (!document.querySelector("#pelcro-selection-view") || !document.querySelector(".pelcro-select-product-wrapper")) {
|
|
13954
|
+
var _window$Pelcro, _window$Pelcro$user, _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro3, _window$Pelcro3$user, _window$Pelcro4, _window$Pelcro4$site;
|
|
13955
|
+
const userCurrency = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$user = _window$Pelcro.user) === null || _window$Pelcro$user === void 0 ? void 0 : _window$Pelcro$user.read().currency;
|
|
13956
|
+
const userCountry = (_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.location.countryCode;
|
|
13957
|
+
const userLanguage = (_window$Pelcro3 = window.Pelcro) === null || _window$Pelcro3 === void 0 ? void 0 : (_window$Pelcro3$user = _window$Pelcro3.user) === null || _window$Pelcro3$user === void 0 ? void 0 : _window$Pelcro3$user.read().language;
|
|
13958
|
+
const productsWithPlansCountries = (_window$Pelcro4 = window.Pelcro) === null || _window$Pelcro4 === void 0 ? void 0 : (_window$Pelcro4$site = _window$Pelcro4.site) === null || _window$Pelcro4$site === void 0 ? void 0 : _window$Pelcro4$site.read().products.filter(product => {
|
|
13959
|
+
const filteredPlans = product.plans.filter(plan => plan.countries && plan.countries.length > 0);
|
|
13960
|
+
if (filteredPlans.length) {
|
|
13961
|
+
return product;
|
|
13962
|
+
}
|
|
13963
|
+
});
|
|
13964
|
+
const currencyMismatch = productsWithPlansCountries.length ? productsWithPlansCountries.filter(product => {
|
|
13965
|
+
const filteredPlans = product.plans.filter(plan => {
|
|
13966
|
+
var _plan$countries;
|
|
13967
|
+
return (_plan$countries = plan.countries) === null || _plan$countries === void 0 ? void 0 : _plan$countries.includes(userCountry);
|
|
13968
|
+
});
|
|
13969
|
+
if (filteredPlans.length) return filteredPlans;
|
|
13970
|
+
}).length === 0 : false;
|
|
13952
13971
|
notifyBugsnag(() => {
|
|
13953
13972
|
Bugsnag.notify("SelectModal - No data viewed", event => {
|
|
13954
|
-
var _window$
|
|
13973
|
+
var _window$Pelcro5, _window$Pelcro5$site, _window$Pelcro6, _window$Pelcro6$user, _window$Pelcro7, _window$Pelcro7$uiSet, _window$Pelcro8, _window$Pelcro9, _window$Pelcro9$helpe, _window$Pelcro10, _window$Pelcro10$site, _window$Pelcro11, _window$Pelcro11$site;
|
|
13955
13974
|
event.addMetadata("MetaData", {
|
|
13956
|
-
site: (_window$
|
|
13957
|
-
user: (_window$
|
|
13958
|
-
uiVersion: (_window$
|
|
13959
|
-
environment: (_window$
|
|
13975
|
+
site: (_window$Pelcro5 = window.Pelcro) === null || _window$Pelcro5 === void 0 ? void 0 : (_window$Pelcro5$site = _window$Pelcro5.site) === null || _window$Pelcro5$site === void 0 ? void 0 : _window$Pelcro5$site.read(),
|
|
13976
|
+
user: (_window$Pelcro6 = window.Pelcro) === null || _window$Pelcro6 === void 0 ? void 0 : (_window$Pelcro6$user = _window$Pelcro6.user) === null || _window$Pelcro6$user === void 0 ? void 0 : _window$Pelcro6$user.read(),
|
|
13977
|
+
uiVersion: (_window$Pelcro7 = window.Pelcro) === null || _window$Pelcro7 === void 0 ? void 0 : (_window$Pelcro7$uiSet = _window$Pelcro7.uiSettings) === null || _window$Pelcro7$uiSet === void 0 ? void 0 : _window$Pelcro7$uiSet.uiVersion,
|
|
13978
|
+
environment: (_window$Pelcro8 = window.Pelcro) === null || _window$Pelcro8 === void 0 ? void 0 : _window$Pelcro8.environment,
|
|
13979
|
+
userCurrency: userCurrency,
|
|
13980
|
+
userCountry: userCountry,
|
|
13981
|
+
userLanguage: userLanguage,
|
|
13982
|
+
siteLanguage: (_window$Pelcro9 = window.Pelcro) === null || _window$Pelcro9 === void 0 ? void 0 : (_window$Pelcro9$helpe = _window$Pelcro9.helpers) === null || _window$Pelcro9$helpe === void 0 ? void 0 : _window$Pelcro9$helpe.getHtmlLanguageAttribute(),
|
|
13983
|
+
currency_mismatch: ((_window$Pelcro10 = window.Pelcro) === null || _window$Pelcro10 === void 0 ? void 0 : (_window$Pelcro10$site = _window$Pelcro10.site) === null || _window$Pelcro10$site === void 0 ? void 0 : _window$Pelcro10$site.read().products.filter(product => {
|
|
13984
|
+
const filteredPlans = product.plans.find(plan => plan.currency === userCurrency);
|
|
13985
|
+
if (filteredPlans) return filteredPlans;
|
|
13986
|
+
}).length) === 0,
|
|
13987
|
+
country_restrictions: currencyMismatch,
|
|
13988
|
+
language_mismatch: ((_window$Pelcro11 = window.Pelcro) === null || _window$Pelcro11 === void 0 ? void 0 : (_window$Pelcro11$site = _window$Pelcro11.site) === null || _window$Pelcro11$site === void 0 ? void 0 : _window$Pelcro11$site.read().products.filter(product => product.language === userLanguage).length) === 0
|
|
13960
13989
|
});
|
|
13961
13990
|
});
|
|
13962
13991
|
});
|
|
@@ -17806,9 +17835,10 @@ const PaymentMethodContainer = props => {
|
|
|
17806
17835
|
const {
|
|
17807
17836
|
whenUserReady
|
|
17808
17837
|
} = usePelcro.getStore();
|
|
17838
|
+
const cardProcessor = getSiteCardProcessor();
|
|
17809
17839
|
useEffect(() => {
|
|
17810
17840
|
whenUserReady(() => {
|
|
17811
|
-
if (!window.Stripe) {
|
|
17841
|
+
if (!window.Stripe && cardProcessor === "stripe") {
|
|
17812
17842
|
document.querySelector('script[src="https://js.stripe.com/v3"]').addEventListener("load", () => {
|
|
17813
17843
|
setIsStripeLoaded(true);
|
|
17814
17844
|
});
|
|
@@ -17823,8 +17853,11 @@ const PaymentMethodContainer = props => {
|
|
|
17823
17853
|
}, /*#__PURE__*/React__default.createElement(es_11, null, /*#__PURE__*/React__default.createElement(UnwrappedForm, Object.assign({
|
|
17824
17854
|
store: store$k
|
|
17825
17855
|
}, props))));
|
|
17856
|
+
} else {
|
|
17857
|
+
return /*#__PURE__*/React__default.createElement(PaymentMethodContainerWithoutStripe, Object.assign({
|
|
17858
|
+
store: store$k
|
|
17859
|
+
}, props));
|
|
17826
17860
|
}
|
|
17827
|
-
return null;
|
|
17828
17861
|
};
|
|
17829
17862
|
|
|
17830
17863
|
const StripeInputStyle = {
|