@pelcro/react-pelcro-js 3.9.0-beta.2 → 3.9.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.cjs.js +133 -62
- package/dist/index.esm.js +133 -62
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -3824,7 +3824,10 @@ var labels$F = {
|
|
|
3824
3824
|
interval: "{{count}} {{interval}}",
|
|
3825
3825
|
interval_plural: "{{count}} {{interval}}s",
|
|
3826
3826
|
tax: "+ Tax",
|
|
3827
|
-
removeCoupon: "REMOVE"
|
|
3827
|
+
removeCoupon: "REMOVE",
|
|
3828
|
+
firstName: "First name",
|
|
3829
|
+
lastName: "Last name",
|
|
3830
|
+
phone: "Phone"
|
|
3828
3831
|
};
|
|
3829
3832
|
var checkoutForm_en = {
|
|
3830
3833
|
messages: messages$I,
|
|
@@ -3851,7 +3854,10 @@ var labels$E = {
|
|
|
3851
3854
|
interval: "{{count}} {{interval}}",
|
|
3852
3855
|
interval_plural: "{{count}} {{interval}}s",
|
|
3853
3856
|
tax: "+ Taxe",
|
|
3854
|
-
removeCoupon: "RETIRER"
|
|
3857
|
+
removeCoupon: "RETIRER",
|
|
3858
|
+
firstName: "Prénom",
|
|
3859
|
+
lastName: "Nom de famille",
|
|
3860
|
+
phone: "Téléphoner"
|
|
3855
3861
|
};
|
|
3856
3862
|
var checkoutForm_fr = {
|
|
3857
3863
|
messages: messages$H,
|
|
@@ -3878,7 +3884,10 @@ var labels$D = {
|
|
|
3878
3884
|
interval: "{{count}} {{interval}}",
|
|
3879
3885
|
interval_plural: "{{count}} {{interval}}",
|
|
3880
3886
|
tax: "+ 세금",
|
|
3881
|
-
removeCoupon: "제거"
|
|
3887
|
+
removeCoupon: "제거",
|
|
3888
|
+
firstName: "이름",
|
|
3889
|
+
lastName: "성",
|
|
3890
|
+
phone: "핸드폰"
|
|
3882
3891
|
};
|
|
3883
3892
|
var checkoutForm_ko = {
|
|
3884
3893
|
messages: messages$G,
|
|
@@ -12277,32 +12286,25 @@ const RegisterButton = ({
|
|
|
12277
12286
|
className,
|
|
12278
12287
|
...otherProps
|
|
12279
12288
|
}) => {
|
|
12280
|
-
var _window$Pelcro$site$r
|
|
12289
|
+
var _window$Pelcro$site$r;
|
|
12281
12290
|
|
|
12282
12291
|
const {
|
|
12283
12292
|
state: {
|
|
12284
12293
|
emailError,
|
|
12285
12294
|
passwordError,
|
|
12286
|
-
firstNameError,
|
|
12287
|
-
lastNameError,
|
|
12288
|
-
phoneError,
|
|
12289
12295
|
email,
|
|
12290
12296
|
password,
|
|
12291
|
-
firstName,
|
|
12292
|
-
lastName,
|
|
12293
|
-
phone,
|
|
12294
12297
|
buttonDisabled
|
|
12295
12298
|
},
|
|
12296
12299
|
dispatch
|
|
12297
12300
|
} = React.useContext(store$k);
|
|
12298
|
-
const supportsTap = Boolean((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tap_gateway_settings);
|
|
12299
12301
|
const {
|
|
12300
12302
|
t
|
|
12301
12303
|
} = useTranslation("register");
|
|
12302
12304
|
const [isDisabled, setDisabled] = React.useState(true);
|
|
12303
12305
|
React.useEffect(() => {
|
|
12304
|
-
setDisabled(buttonDisabled || emailError || passwordError ||
|
|
12305
|
-
}, [buttonDisabled, emailError, passwordError,
|
|
12306
|
+
setDisabled(buttonDisabled || emailError || passwordError || !email.length || !password.length);
|
|
12307
|
+
}, [buttonDisabled, emailError, passwordError, email, password]);
|
|
12306
12308
|
return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
|
|
12307
12309
|
onClick: () => {
|
|
12308
12310
|
dispatch({
|
|
@@ -12314,7 +12316,7 @@ const RegisterButton = ({
|
|
|
12314
12316
|
isLoading: buttonDisabled,
|
|
12315
12317
|
className: `${className} g-recaptcha`,
|
|
12316
12318
|
"data-action": "register",
|
|
12317
|
-
"data-sitekey": (_window$Pelcro$site$
|
|
12319
|
+
"data-sitekey": (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.security_key
|
|
12318
12320
|
}, otherProps), name !== null && name !== void 0 ? name : t("messages.createAccount"));
|
|
12319
12321
|
};
|
|
12320
12322
|
|
|
@@ -12509,16 +12511,12 @@ function Phone({
|
|
|
12509
12511
|
}, otherProps));
|
|
12510
12512
|
}
|
|
12511
12513
|
|
|
12512
|
-
const RegisterPhone = props => /*#__PURE__*/React__default['default'].createElement(Phone, Object.assign({
|
|
12513
|
-
store: store$k
|
|
12514
|
-
}, props));
|
|
12515
|
-
|
|
12516
12514
|
/**
|
|
12517
12515
|
*
|
|
12518
12516
|
*/
|
|
12519
12517
|
|
|
12520
12518
|
function RegisterView(props) {
|
|
12521
|
-
var _product$paywall$regi, _product$paywall, _product$paywall$regi2, _product$paywall2, _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$site$r3, _window$Pelcro, _window$Pelcro$uiSett
|
|
12519
|
+
var _product$paywall$regi, _product$paywall, _product$paywall$regi2, _product$paywall2, _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$site$r3, _window$Pelcro, _window$Pelcro$uiSett;
|
|
12522
12520
|
|
|
12523
12521
|
const {
|
|
12524
12522
|
t
|
|
@@ -12530,7 +12528,6 @@ function RegisterView(props) {
|
|
|
12530
12528
|
const subtitle = (_product$paywall$regi2 = product === null || product === void 0 ? void 0 : (_product$paywall2 = product.paywall) === null || _product$paywall2 === void 0 ? void 0 : _product$paywall2.register_subtitle) !== null && _product$paywall$regi2 !== void 0 ? _product$paywall$regi2 : t("subtitle");
|
|
12531
12529
|
const socialLoginEnabled = ((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.facebook_app_id) || ((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.google_app_id) || ((_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.auth0_client_id);
|
|
12532
12530
|
const showNameFields = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.enableNameFieldsInRegister;
|
|
12533
|
-
const supportsTap = Boolean((_window$Pelcro$site$r4 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r4 === void 0 ? void 0 : _window$Pelcro$site$r4.tap_gateway_settings);
|
|
12534
12531
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
12535
12532
|
id: "pelcro-register-view"
|
|
12536
12533
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -12540,25 +12537,18 @@ function RegisterView(props) {
|
|
|
12540
12537
|
}, title), /*#__PURE__*/React__default['default'].createElement("p", null, subtitle)), /*#__PURE__*/React__default['default'].createElement("form", {
|
|
12541
12538
|
action: "javascript:void(0);",
|
|
12542
12539
|
className: "plc-mt-2 pelcro-form"
|
|
12543
|
-
}, /*#__PURE__*/React__default['default'].createElement(RegisterContainer, props, /*#__PURE__*/React__default['default'].createElement(AlertWithContext, null),
|
|
12540
|
+
}, /*#__PURE__*/React__default['default'].createElement(RegisterContainer, props, /*#__PURE__*/React__default['default'].createElement(AlertWithContext, null), showNameFields && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
12544
12541
|
className: "plc-flex plc-items-start"
|
|
12545
12542
|
}, /*#__PURE__*/React__default['default'].createElement(RegisterFirstName, {
|
|
12546
12543
|
id: "pelcro-input-first-name",
|
|
12547
12544
|
label: t("labels.firstName"),
|
|
12548
|
-
errorId: "pelcro-input-firstName-error"
|
|
12549
|
-
required: supportsTap ? true : false
|
|
12545
|
+
errorId: "pelcro-input-firstName-error"
|
|
12550
12546
|
}), /*#__PURE__*/React__default['default'].createElement(RegisterLastName, {
|
|
12551
12547
|
wrapperClassName: "plc-ml-3",
|
|
12552
12548
|
id: "pelcro-input-last-name",
|
|
12553
12549
|
label: t("labels.lastName"),
|
|
12554
|
-
errorId: "pelcro-input-lastName-error"
|
|
12555
|
-
|
|
12556
|
-
})), supportsTap && /*#__PURE__*/React__default['default'].createElement(RegisterPhone, {
|
|
12557
|
-
id: "pelcro-input-phone",
|
|
12558
|
-
errorId: "pelcro-input-phone-error",
|
|
12559
|
-
label: t("labels.phone"),
|
|
12560
|
-
required: supportsTap ? true : false
|
|
12561
|
-
}), /*#__PURE__*/React__default['default'].createElement(RegisterEmail, {
|
|
12550
|
+
errorId: "pelcro-input-lastName-error"
|
|
12551
|
+
})), /*#__PURE__*/React__default['default'].createElement(RegisterEmail, {
|
|
12562
12552
|
id: "pelcro-input-email",
|
|
12563
12553
|
errorId: "pelcro-input-email-error",
|
|
12564
12554
|
label: t("labels.email"),
|
|
@@ -12604,9 +12594,9 @@ function RegisterView(props) {
|
|
|
12604
12594
|
*/
|
|
12605
12595
|
|
|
12606
12596
|
function hasSecurityTokenEnabled() {
|
|
12607
|
-
var _window$Pelcro$site, _window$Pelcro$site$
|
|
12597
|
+
var _window$Pelcro$site, _window$Pelcro$site$r4;
|
|
12608
12598
|
|
|
12609
|
-
return Boolean((_window$Pelcro$site = window.Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : (_window$Pelcro$site$
|
|
12599
|
+
return Boolean((_window$Pelcro$site = window.Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : (_window$Pelcro$site$r4 = _window$Pelcro$site.read()) === null || _window$Pelcro$site$r4 === void 0 ? void 0 : _window$Pelcro$site$r4.security_key);
|
|
12610
12600
|
}
|
|
12611
12601
|
|
|
12612
12602
|
const Loader = props => /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -15325,6 +15315,12 @@ const initialState$j = {
|
|
|
15325
15315
|
updatedPrice: null,
|
|
15326
15316
|
taxAmount: null,
|
|
15327
15317
|
currentPlan: null,
|
|
15318
|
+
firstName: "",
|
|
15319
|
+
lastName: "",
|
|
15320
|
+
phone: "",
|
|
15321
|
+
firstNameError: null,
|
|
15322
|
+
lastNameError: null,
|
|
15323
|
+
phoneError: null,
|
|
15328
15324
|
alert: {
|
|
15329
15325
|
type: "error",
|
|
15330
15326
|
content: ""
|
|
@@ -15441,8 +15437,14 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15441
15437
|
}
|
|
15442
15438
|
});
|
|
15443
15439
|
} else {
|
|
15440
|
+
console.log("First Name", state.firstName);
|
|
15441
|
+
console.log("Last Name", state.lastName);
|
|
15442
|
+
console.log("Phone", state.phone);
|
|
15444
15443
|
window.Pelcro.payment.authorize({
|
|
15445
15444
|
auth_token: window.Pelcro.user.read().auth_token,
|
|
15445
|
+
first_name: window.Pelcro.user.read().first_name || state.firstName,
|
|
15446
|
+
last_name: window.Pelcro.user.read().last_name || state.lastName,
|
|
15447
|
+
phone: window.Pelcro.user.read().phone || state.phone,
|
|
15446
15448
|
site_id: window.Pelcro.siteid,
|
|
15447
15449
|
amount: totalAmount,
|
|
15448
15450
|
currency: (plan === null || plan === void 0 ? void 0 : plan.currency) || (invoice === null || invoice === void 0 ? void 0 : invoice.currency) || window.Pelcro.site.read().default_currency,
|
|
@@ -16968,6 +16970,42 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
16968
16970
|
percentOff: action.payload
|
|
16969
16971
|
});
|
|
16970
16972
|
|
|
16973
|
+
case SET_FIRST_NAME:
|
|
16974
|
+
return lib_7({ ...state,
|
|
16975
|
+
firstName: action.payload,
|
|
16976
|
+
firstNameError: null
|
|
16977
|
+
});
|
|
16978
|
+
|
|
16979
|
+
case SET_LAST_NAME:
|
|
16980
|
+
return lib_7({ ...state,
|
|
16981
|
+
lastName: action.payload,
|
|
16982
|
+
lastNameError: null
|
|
16983
|
+
});
|
|
16984
|
+
|
|
16985
|
+
case SET_PHONE:
|
|
16986
|
+
return lib_7({ ...state,
|
|
16987
|
+
phone: action.payload,
|
|
16988
|
+
phoneError: null
|
|
16989
|
+
});
|
|
16990
|
+
|
|
16991
|
+
case SET_FIRST_NAME_ERROR:
|
|
16992
|
+
return lib_7({ ...state,
|
|
16993
|
+
firstNameError: action.payload,
|
|
16994
|
+
firstName: ""
|
|
16995
|
+
});
|
|
16996
|
+
|
|
16997
|
+
case SET_LAST_NAME_ERROR:
|
|
16998
|
+
return lib_7({ ...state,
|
|
16999
|
+
lastNameError: action.payload,
|
|
17000
|
+
lastName: ""
|
|
17001
|
+
});
|
|
17002
|
+
|
|
17003
|
+
case SET_PHONE_ERROR:
|
|
17004
|
+
return lib_7({ ...state,
|
|
17005
|
+
phoneError: action.payload,
|
|
17006
|
+
phone: null
|
|
17007
|
+
});
|
|
17008
|
+
|
|
16971
17009
|
case SHOW_ALERT:
|
|
16972
17010
|
return lib_7({ ...state,
|
|
16973
17011
|
alert: action.payload
|
|
@@ -17182,7 +17220,7 @@ const SubmitPaymentMethod = ({
|
|
|
17182
17220
|
onClick,
|
|
17183
17221
|
...otherProps
|
|
17184
17222
|
}) => {
|
|
17185
|
-
var _plan$quantity;
|
|
17223
|
+
var _plan$quantity, _window$Pelcro$site$r;
|
|
17186
17224
|
|
|
17187
17225
|
const {
|
|
17188
17226
|
plan
|
|
@@ -17193,6 +17231,12 @@ const SubmitPaymentMethod = ({
|
|
|
17193
17231
|
const {
|
|
17194
17232
|
dispatch,
|
|
17195
17233
|
state: {
|
|
17234
|
+
firstNameError,
|
|
17235
|
+
lastNameError,
|
|
17236
|
+
phoneError,
|
|
17237
|
+
firstName,
|
|
17238
|
+
lastName,
|
|
17239
|
+
phone,
|
|
17196
17240
|
disableSubmit,
|
|
17197
17241
|
isLoading,
|
|
17198
17242
|
updatedPrice
|
|
@@ -17201,6 +17245,18 @@ const SubmitPaymentMethod = ({
|
|
|
17201
17245
|
const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
|
|
17202
17246
|
const price = updatedPrice !== null && updatedPrice !== void 0 ? updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount;
|
|
17203
17247
|
const priceFormatted = getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
|
|
17248
|
+
const supportsTap = Boolean((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tap_gateway_settings);
|
|
17249
|
+
const isUserFirstName = Boolean(window.Pelcro.user.read().first_name);
|
|
17250
|
+
const isUserLastName = Boolean(window.Pelcro.user.read().last_name);
|
|
17251
|
+
const isUserPhone = Boolean(window.Pelcro.user.read().phone);
|
|
17252
|
+
const [isDisabled, setDisabled] = React.useState(true);
|
|
17253
|
+
React.useEffect(() => {
|
|
17254
|
+
if (supportsTap && isUserFirstName && isUserLastName && isUserPhone) {
|
|
17255
|
+
setDisabled(disableSubmit);
|
|
17256
|
+
} else {
|
|
17257
|
+
setDisabled(disableSubmit || supportsTap && firstNameError || supportsTap && lastNameError || supportsTap && phoneError || supportsTap && !firstName.length || supportsTap && !lastName.length || supportsTap && !phone.length);
|
|
17258
|
+
}
|
|
17259
|
+
}, [disableSubmit, firstNameError, lastNameError, phoneError, firstName, lastName, phone]);
|
|
17204
17260
|
return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
|
|
17205
17261
|
role: "submit",
|
|
17206
17262
|
className: "plc-w-full plc-py-3",
|
|
@@ -17212,7 +17268,7 @@ const SubmitPaymentMethod = ({
|
|
|
17212
17268
|
});
|
|
17213
17269
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
17214
17270
|
},
|
|
17215
|
-
disabled:
|
|
17271
|
+
disabled: isDisabled
|
|
17216
17272
|
}, otherProps), plan ? /*#__PURE__*/React__default['default'].createElement("span", {
|
|
17217
17273
|
className: "plc-capitalize "
|
|
17218
17274
|
}, t("labels.pay"), " ", priceFormatted && priceFormatted) : t("labels.submit"));
|
|
@@ -17787,6 +17843,18 @@ const TaxAmount = () => {
|
|
|
17787
17843
|
return null;
|
|
17788
17844
|
};
|
|
17789
17845
|
|
|
17846
|
+
const IncludeFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
|
|
17847
|
+
store: store$j
|
|
17848
|
+
}, props));
|
|
17849
|
+
|
|
17850
|
+
const IncludeLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
|
|
17851
|
+
store: store$j
|
|
17852
|
+
}, props));
|
|
17853
|
+
|
|
17854
|
+
const IncludePhone = props => /*#__PURE__*/React__default['default'].createElement(Phone, Object.assign({
|
|
17855
|
+
store: store$j
|
|
17856
|
+
}, props));
|
|
17857
|
+
|
|
17790
17858
|
/**
|
|
17791
17859
|
*
|
|
17792
17860
|
*/
|
|
@@ -17806,7 +17874,10 @@ function PaymentMethodView({
|
|
|
17806
17874
|
} = useTranslation("checkoutForm");
|
|
17807
17875
|
const cardProcessor = getSiteCardProcessor();
|
|
17808
17876
|
const supportsVantiv = Boolean((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.vantiv_gateway_settings);
|
|
17809
|
-
Boolean((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.tap_gateway_settings);
|
|
17877
|
+
const supportsTap = Boolean((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.tap_gateway_settings);
|
|
17878
|
+
const isUserFirstName = Boolean(window.Pelcro.user.read().first_name);
|
|
17879
|
+
const isUserLastName = Boolean(window.Pelcro.user.read().last_name);
|
|
17880
|
+
const isUserPhone = Boolean(window.Pelcro.user.read().phone);
|
|
17810
17881
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
17811
17882
|
className: "plc-flex plc-flex-col plc-items-center plc-mt-4 sm:plc-px-8 pelcro-payment-block"
|
|
17812
17883
|
}, cardProcessor === "stripe" && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -17828,7 +17899,25 @@ function PaymentMethodView({
|
|
|
17828
17899
|
onFailure: onFailure
|
|
17829
17900
|
}, /*#__PURE__*/React__default['default'].createElement(BankRedirection, null), /*#__PURE__*/React__default['default'].createElement(AlertWithContext, {
|
|
17830
17901
|
className: "plc-mb-2"
|
|
17831
|
-
}), /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(SelectedPaymentMethod, null), /*#__PURE__*/React__default['default'].createElement(
|
|
17902
|
+
}), /*#__PURE__*/React__default['default'].createElement("div", null, /*#__PURE__*/React__default['default'].createElement(SelectedPaymentMethod, null), supportsTap && (!isUserFirstName || !isUserLastName || !isUserPhone) && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
17903
|
+
className: "plc-flex plc-items-start"
|
|
17904
|
+
}, /*#__PURE__*/React__default['default'].createElement(IncludeFirstName, {
|
|
17905
|
+
id: "pelcro-input-first-name",
|
|
17906
|
+
label: t("labels.firstName"),
|
|
17907
|
+
errorId: "pelcro-input-firstName-error",
|
|
17908
|
+
required: true
|
|
17909
|
+
}), /*#__PURE__*/React__default['default'].createElement(IncludeLastName, {
|
|
17910
|
+
wrapperClassName: "plc-ml-3",
|
|
17911
|
+
id: "pelcro-input-last-name",
|
|
17912
|
+
label: t("labels.lastName"),
|
|
17913
|
+
errorId: "pelcro-input-lastName-error",
|
|
17914
|
+
required: true
|
|
17915
|
+
})), /*#__PURE__*/React__default['default'].createElement(IncludePhone, {
|
|
17916
|
+
id: "pelcro-input-phone",
|
|
17917
|
+
errorId: "pelcro-input-phone-error",
|
|
17918
|
+
label: t("labels.phone"),
|
|
17919
|
+
required: true
|
|
17920
|
+
})), /*#__PURE__*/React__default['default'].createElement(CheckoutForm, null), showCoupon && /*#__PURE__*/React__default['default'].createElement("div", {
|
|
17832
17921
|
className: "plc-mb-2"
|
|
17833
17922
|
}, /*#__PURE__*/React__default['default'].createElement(CouponCode, null), /*#__PURE__*/React__default['default'].createElement(DiscountedPrice, null)), /*#__PURE__*/React__default['default'].createElement(TaxAmount, null), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
17834
17923
|
className: "plc-grid plc-mt-4 plc-gap-y-2"
|
|
@@ -19582,30 +19671,16 @@ const UserUpdateButton = ({
|
|
|
19582
19671
|
onClick,
|
|
19583
19672
|
...otherProps
|
|
19584
19673
|
}) => {
|
|
19585
|
-
var _window$Pelcro$site$r;
|
|
19586
|
-
|
|
19587
19674
|
const {
|
|
19588
19675
|
state: {
|
|
19589
19676
|
buttonDisabled,
|
|
19590
|
-
|
|
19591
|
-
firstName,
|
|
19592
|
-
lastName,
|
|
19593
|
-
phone,
|
|
19594
|
-
emailError,
|
|
19595
|
-
firstNameError,
|
|
19596
|
-
lastNameError,
|
|
19597
|
-
phoneError
|
|
19677
|
+
emailError
|
|
19598
19678
|
},
|
|
19599
19679
|
dispatch
|
|
19600
19680
|
} = React.useContext(store$f);
|
|
19601
|
-
const supportsTap = Boolean((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tap_gateway_settings);
|
|
19602
19681
|
const {
|
|
19603
19682
|
t
|
|
19604
19683
|
} = useTranslation("userEdit");
|
|
19605
|
-
const [isDisabled, setDisabled] = React.useState(true);
|
|
19606
|
-
React.useEffect(() => {
|
|
19607
|
-
setDisabled(buttonDisabled || emailError || firstNameError || lastNameError || phoneError || !(email !== null && email !== void 0 && email.length) || supportsTap && !(firstName !== null && firstName !== void 0 && firstName.length) || supportsTap && !(lastName !== null && lastName !== void 0 && lastName.length) || supportsTap && !(phone !== null && phone !== void 0 && phone.length));
|
|
19608
|
-
}, [email, firstName, lastName, phone, buttonDisabled, emailError, firstNameError, lastNameError, phoneError]);
|
|
19609
19684
|
return /*#__PURE__*/React__default['default'].createElement(Button, Object.assign({
|
|
19610
19685
|
onClick: () => {
|
|
19611
19686
|
dispatch({
|
|
@@ -19613,7 +19688,7 @@ const UserUpdateButton = ({
|
|
|
19613
19688
|
});
|
|
19614
19689
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
19615
19690
|
},
|
|
19616
|
-
disabled:
|
|
19691
|
+
disabled: buttonDisabled || emailError,
|
|
19617
19692
|
isLoading: buttonDisabled && !emailError
|
|
19618
19693
|
}, otherProps), name !== null && name !== void 0 ? name : t("labels.submit"));
|
|
19619
19694
|
};
|
|
@@ -19658,12 +19733,9 @@ const UserUpdateProfilePic = ({
|
|
|
19658
19733
|
};
|
|
19659
19734
|
|
|
19660
19735
|
const UserUpdateView = props => {
|
|
19661
|
-
var _window$Pelcro$site$r;
|
|
19662
|
-
|
|
19663
19736
|
const {
|
|
19664
19737
|
t
|
|
19665
19738
|
} = useTranslation("userEdit");
|
|
19666
|
-
const supportsTap = Boolean((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tap_gateway_settings);
|
|
19667
19739
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
|
19668
19740
|
id: "pelcro-user-update-view"
|
|
19669
19741
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
|
@@ -19682,22 +19754,19 @@ const UserUpdateView = props => {
|
|
|
19682
19754
|
id: "pelcro-input-first-name",
|
|
19683
19755
|
errorId: "pelcro-input-first-name-error",
|
|
19684
19756
|
label: t("labels.firstName"),
|
|
19685
|
-
autoFocus: true
|
|
19686
|
-
required: supportsTap ? true : false
|
|
19757
|
+
autoFocus: true
|
|
19687
19758
|
}), /*#__PURE__*/React__default['default'].createElement(UserUpdateLastName, {
|
|
19688
19759
|
wrapperClassName: "plc-ml-3",
|
|
19689
19760
|
autoComplete: "last-name",
|
|
19690
19761
|
id: "pelcro-input-last-name",
|
|
19691
19762
|
errorId: "pelcro-input-last-name-error",
|
|
19692
|
-
label: t("labels.lastName")
|
|
19693
|
-
required: supportsTap ? true : false
|
|
19763
|
+
label: t("labels.lastName")
|
|
19694
19764
|
})), /*#__PURE__*/React__default['default'].createElement("div", {
|
|
19695
19765
|
className: "plc-flex plc-items-start"
|
|
19696
19766
|
}, /*#__PURE__*/React__default['default'].createElement(UserUpdatePhone, {
|
|
19697
19767
|
id: "pelcro-input-phone",
|
|
19698
19768
|
errorId: "pelcro-input-phone-error",
|
|
19699
|
-
label: t("labels.phone")
|
|
19700
|
-
required: supportsTap ? true : false
|
|
19769
|
+
label: t("labels.phone")
|
|
19701
19770
|
})), /*#__PURE__*/React__default['default'].createElement(UserUpdateButton, {
|
|
19702
19771
|
role: "submit",
|
|
19703
19772
|
className: "plc-w-full plc-mt-2",
|
|
@@ -23002,10 +23071,12 @@ const GiftCreateEmail = props => /*#__PURE__*/React__default['default'].createEl
|
|
|
23002
23071
|
}, props));
|
|
23003
23072
|
|
|
23004
23073
|
const GiftCreateFirstName = props => /*#__PURE__*/React__default['default'].createElement(FirstName, Object.assign({
|
|
23074
|
+
initWithUserFirstName: false,
|
|
23005
23075
|
store: store$7
|
|
23006
23076
|
}, props));
|
|
23007
23077
|
|
|
23008
23078
|
const GiftCreateLastName = props => /*#__PURE__*/React__default['default'].createElement(LastName, Object.assign({
|
|
23079
|
+
initWithUserLastName: false,
|
|
23009
23080
|
store: store$7
|
|
23010
23081
|
}, props));
|
|
23011
23082
|
|
package/dist/index.esm.js
CHANGED
|
@@ -3794,7 +3794,10 @@ var labels$F = {
|
|
|
3794
3794
|
interval: "{{count}} {{interval}}",
|
|
3795
3795
|
interval_plural: "{{count}} {{interval}}s",
|
|
3796
3796
|
tax: "+ Tax",
|
|
3797
|
-
removeCoupon: "REMOVE"
|
|
3797
|
+
removeCoupon: "REMOVE",
|
|
3798
|
+
firstName: "First name",
|
|
3799
|
+
lastName: "Last name",
|
|
3800
|
+
phone: "Phone"
|
|
3798
3801
|
};
|
|
3799
3802
|
var checkoutForm_en = {
|
|
3800
3803
|
messages: messages$I,
|
|
@@ -3821,7 +3824,10 @@ var labels$E = {
|
|
|
3821
3824
|
interval: "{{count}} {{interval}}",
|
|
3822
3825
|
interval_plural: "{{count}} {{interval}}s",
|
|
3823
3826
|
tax: "+ Taxe",
|
|
3824
|
-
removeCoupon: "RETIRER"
|
|
3827
|
+
removeCoupon: "RETIRER",
|
|
3828
|
+
firstName: "Prénom",
|
|
3829
|
+
lastName: "Nom de famille",
|
|
3830
|
+
phone: "Téléphoner"
|
|
3825
3831
|
};
|
|
3826
3832
|
var checkoutForm_fr = {
|
|
3827
3833
|
messages: messages$H,
|
|
@@ -3848,7 +3854,10 @@ var labels$D = {
|
|
|
3848
3854
|
interval: "{{count}} {{interval}}",
|
|
3849
3855
|
interval_plural: "{{count}} {{interval}}",
|
|
3850
3856
|
tax: "+ 세금",
|
|
3851
|
-
removeCoupon: "제거"
|
|
3857
|
+
removeCoupon: "제거",
|
|
3858
|
+
firstName: "이름",
|
|
3859
|
+
lastName: "성",
|
|
3860
|
+
phone: "핸드폰"
|
|
3852
3861
|
};
|
|
3853
3862
|
var checkoutForm_ko = {
|
|
3854
3863
|
messages: messages$G,
|
|
@@ -12247,32 +12256,25 @@ const RegisterButton = ({
|
|
|
12247
12256
|
className,
|
|
12248
12257
|
...otherProps
|
|
12249
12258
|
}) => {
|
|
12250
|
-
var _window$Pelcro$site$r
|
|
12259
|
+
var _window$Pelcro$site$r;
|
|
12251
12260
|
|
|
12252
12261
|
const {
|
|
12253
12262
|
state: {
|
|
12254
12263
|
emailError,
|
|
12255
12264
|
passwordError,
|
|
12256
|
-
firstNameError,
|
|
12257
|
-
lastNameError,
|
|
12258
|
-
phoneError,
|
|
12259
12265
|
email,
|
|
12260
12266
|
password,
|
|
12261
|
-
firstName,
|
|
12262
|
-
lastName,
|
|
12263
|
-
phone,
|
|
12264
12267
|
buttonDisabled
|
|
12265
12268
|
},
|
|
12266
12269
|
dispatch
|
|
12267
12270
|
} = useContext(store$k);
|
|
12268
|
-
const supportsTap = Boolean((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tap_gateway_settings);
|
|
12269
12271
|
const {
|
|
12270
12272
|
t
|
|
12271
12273
|
} = useTranslation("register");
|
|
12272
12274
|
const [isDisabled, setDisabled] = useState(true);
|
|
12273
12275
|
useEffect(() => {
|
|
12274
|
-
setDisabled(buttonDisabled || emailError || passwordError ||
|
|
12275
|
-
}, [buttonDisabled, emailError, passwordError,
|
|
12276
|
+
setDisabled(buttonDisabled || emailError || passwordError || !email.length || !password.length);
|
|
12277
|
+
}, [buttonDisabled, emailError, passwordError, email, password]);
|
|
12276
12278
|
return /*#__PURE__*/React__default.createElement(Button, Object.assign({
|
|
12277
12279
|
onClick: () => {
|
|
12278
12280
|
dispatch({
|
|
@@ -12284,7 +12286,7 @@ const RegisterButton = ({
|
|
|
12284
12286
|
isLoading: buttonDisabled,
|
|
12285
12287
|
className: `${className} g-recaptcha`,
|
|
12286
12288
|
"data-action": "register",
|
|
12287
|
-
"data-sitekey": (_window$Pelcro$site$
|
|
12289
|
+
"data-sitekey": (_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.security_key
|
|
12288
12290
|
}, otherProps), name !== null && name !== void 0 ? name : t("messages.createAccount"));
|
|
12289
12291
|
};
|
|
12290
12292
|
|
|
@@ -12479,16 +12481,12 @@ function Phone({
|
|
|
12479
12481
|
}, otherProps));
|
|
12480
12482
|
}
|
|
12481
12483
|
|
|
12482
|
-
const RegisterPhone = props => /*#__PURE__*/React__default.createElement(Phone, Object.assign({
|
|
12483
|
-
store: store$k
|
|
12484
|
-
}, props));
|
|
12485
|
-
|
|
12486
12484
|
/**
|
|
12487
12485
|
*
|
|
12488
12486
|
*/
|
|
12489
12487
|
|
|
12490
12488
|
function RegisterView(props) {
|
|
12491
|
-
var _product$paywall$regi, _product$paywall, _product$paywall$regi2, _product$paywall2, _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$site$r3, _window$Pelcro, _window$Pelcro$uiSett
|
|
12489
|
+
var _product$paywall$regi, _product$paywall, _product$paywall$regi2, _product$paywall2, _window$Pelcro$site$r, _window$Pelcro$site$r2, _window$Pelcro$site$r3, _window$Pelcro, _window$Pelcro$uiSett;
|
|
12492
12490
|
|
|
12493
12491
|
const {
|
|
12494
12492
|
t
|
|
@@ -12500,7 +12498,6 @@ function RegisterView(props) {
|
|
|
12500
12498
|
const subtitle = (_product$paywall$regi2 = product === null || product === void 0 ? void 0 : (_product$paywall2 = product.paywall) === null || _product$paywall2 === void 0 ? void 0 : _product$paywall2.register_subtitle) !== null && _product$paywall$regi2 !== void 0 ? _product$paywall$regi2 : t("subtitle");
|
|
12501
12499
|
const socialLoginEnabled = ((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.facebook_app_id) || ((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.google_app_id) || ((_window$Pelcro$site$r3 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r3 === void 0 ? void 0 : _window$Pelcro$site$r3.auth0_client_id);
|
|
12502
12500
|
const showNameFields = (_window$Pelcro = window.Pelcro) === null || _window$Pelcro === void 0 ? void 0 : (_window$Pelcro$uiSett = _window$Pelcro.uiSettings) === null || _window$Pelcro$uiSett === void 0 ? void 0 : _window$Pelcro$uiSett.enableNameFieldsInRegister;
|
|
12503
|
-
const supportsTap = Boolean((_window$Pelcro$site$r4 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r4 === void 0 ? void 0 : _window$Pelcro$site$r4.tap_gateway_settings);
|
|
12504
12501
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
12505
12502
|
id: "pelcro-register-view"
|
|
12506
12503
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -12510,25 +12507,18 @@ function RegisterView(props) {
|
|
|
12510
12507
|
}, title), /*#__PURE__*/React__default.createElement("p", null, subtitle)), /*#__PURE__*/React__default.createElement("form", {
|
|
12511
12508
|
action: "javascript:void(0);",
|
|
12512
12509
|
className: "plc-mt-2 pelcro-form"
|
|
12513
|
-
}, /*#__PURE__*/React__default.createElement(RegisterContainer, props, /*#__PURE__*/React__default.createElement(AlertWithContext, null),
|
|
12510
|
+
}, /*#__PURE__*/React__default.createElement(RegisterContainer, props, /*#__PURE__*/React__default.createElement(AlertWithContext, null), showNameFields && /*#__PURE__*/React__default.createElement("div", {
|
|
12514
12511
|
className: "plc-flex plc-items-start"
|
|
12515
12512
|
}, /*#__PURE__*/React__default.createElement(RegisterFirstName, {
|
|
12516
12513
|
id: "pelcro-input-first-name",
|
|
12517
12514
|
label: t("labels.firstName"),
|
|
12518
|
-
errorId: "pelcro-input-firstName-error"
|
|
12519
|
-
required: supportsTap ? true : false
|
|
12515
|
+
errorId: "pelcro-input-firstName-error"
|
|
12520
12516
|
}), /*#__PURE__*/React__default.createElement(RegisterLastName, {
|
|
12521
12517
|
wrapperClassName: "plc-ml-3",
|
|
12522
12518
|
id: "pelcro-input-last-name",
|
|
12523
12519
|
label: t("labels.lastName"),
|
|
12524
|
-
errorId: "pelcro-input-lastName-error"
|
|
12525
|
-
|
|
12526
|
-
})), supportsTap && /*#__PURE__*/React__default.createElement(RegisterPhone, {
|
|
12527
|
-
id: "pelcro-input-phone",
|
|
12528
|
-
errorId: "pelcro-input-phone-error",
|
|
12529
|
-
label: t("labels.phone"),
|
|
12530
|
-
required: supportsTap ? true : false
|
|
12531
|
-
}), /*#__PURE__*/React__default.createElement(RegisterEmail, {
|
|
12520
|
+
errorId: "pelcro-input-lastName-error"
|
|
12521
|
+
})), /*#__PURE__*/React__default.createElement(RegisterEmail, {
|
|
12532
12522
|
id: "pelcro-input-email",
|
|
12533
12523
|
errorId: "pelcro-input-email-error",
|
|
12534
12524
|
label: t("labels.email"),
|
|
@@ -12574,9 +12564,9 @@ function RegisterView(props) {
|
|
|
12574
12564
|
*/
|
|
12575
12565
|
|
|
12576
12566
|
function hasSecurityTokenEnabled() {
|
|
12577
|
-
var _window$Pelcro$site, _window$Pelcro$site$
|
|
12567
|
+
var _window$Pelcro$site, _window$Pelcro$site$r4;
|
|
12578
12568
|
|
|
12579
|
-
return Boolean((_window$Pelcro$site = window.Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : (_window$Pelcro$site$
|
|
12569
|
+
return Boolean((_window$Pelcro$site = window.Pelcro.site) === null || _window$Pelcro$site === void 0 ? void 0 : (_window$Pelcro$site$r4 = _window$Pelcro$site.read()) === null || _window$Pelcro$site$r4 === void 0 ? void 0 : _window$Pelcro$site$r4.security_key);
|
|
12580
12570
|
}
|
|
12581
12571
|
|
|
12582
12572
|
const Loader = props => /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -15295,6 +15285,12 @@ const initialState$j = {
|
|
|
15295
15285
|
updatedPrice: null,
|
|
15296
15286
|
taxAmount: null,
|
|
15297
15287
|
currentPlan: null,
|
|
15288
|
+
firstName: "",
|
|
15289
|
+
lastName: "",
|
|
15290
|
+
phone: "",
|
|
15291
|
+
firstNameError: null,
|
|
15292
|
+
lastNameError: null,
|
|
15293
|
+
phoneError: null,
|
|
15298
15294
|
alert: {
|
|
15299
15295
|
type: "error",
|
|
15300
15296
|
content: ""
|
|
@@ -15411,8 +15407,14 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
15411
15407
|
}
|
|
15412
15408
|
});
|
|
15413
15409
|
} else {
|
|
15410
|
+
console.log("First Name", state.firstName);
|
|
15411
|
+
console.log("Last Name", state.lastName);
|
|
15412
|
+
console.log("Phone", state.phone);
|
|
15414
15413
|
window.Pelcro.payment.authorize({
|
|
15415
15414
|
auth_token: window.Pelcro.user.read().auth_token,
|
|
15415
|
+
first_name: window.Pelcro.user.read().first_name || state.firstName,
|
|
15416
|
+
last_name: window.Pelcro.user.read().last_name || state.lastName,
|
|
15417
|
+
phone: window.Pelcro.user.read().phone || state.phone,
|
|
15416
15418
|
site_id: window.Pelcro.siteid,
|
|
15417
15419
|
amount: totalAmount,
|
|
15418
15420
|
currency: (plan === null || plan === void 0 ? void 0 : plan.currency) || (invoice === null || invoice === void 0 ? void 0 : invoice.currency) || window.Pelcro.site.read().default_currency,
|
|
@@ -16938,6 +16940,42 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
16938
16940
|
percentOff: action.payload
|
|
16939
16941
|
});
|
|
16940
16942
|
|
|
16943
|
+
case SET_FIRST_NAME:
|
|
16944
|
+
return lib_7({ ...state,
|
|
16945
|
+
firstName: action.payload,
|
|
16946
|
+
firstNameError: null
|
|
16947
|
+
});
|
|
16948
|
+
|
|
16949
|
+
case SET_LAST_NAME:
|
|
16950
|
+
return lib_7({ ...state,
|
|
16951
|
+
lastName: action.payload,
|
|
16952
|
+
lastNameError: null
|
|
16953
|
+
});
|
|
16954
|
+
|
|
16955
|
+
case SET_PHONE:
|
|
16956
|
+
return lib_7({ ...state,
|
|
16957
|
+
phone: action.payload,
|
|
16958
|
+
phoneError: null
|
|
16959
|
+
});
|
|
16960
|
+
|
|
16961
|
+
case SET_FIRST_NAME_ERROR:
|
|
16962
|
+
return lib_7({ ...state,
|
|
16963
|
+
firstNameError: action.payload,
|
|
16964
|
+
firstName: ""
|
|
16965
|
+
});
|
|
16966
|
+
|
|
16967
|
+
case SET_LAST_NAME_ERROR:
|
|
16968
|
+
return lib_7({ ...state,
|
|
16969
|
+
lastNameError: action.payload,
|
|
16970
|
+
lastName: ""
|
|
16971
|
+
});
|
|
16972
|
+
|
|
16973
|
+
case SET_PHONE_ERROR:
|
|
16974
|
+
return lib_7({ ...state,
|
|
16975
|
+
phoneError: action.payload,
|
|
16976
|
+
phone: null
|
|
16977
|
+
});
|
|
16978
|
+
|
|
16941
16979
|
case SHOW_ALERT:
|
|
16942
16980
|
return lib_7({ ...state,
|
|
16943
16981
|
alert: action.payload
|
|
@@ -17152,7 +17190,7 @@ const SubmitPaymentMethod = ({
|
|
|
17152
17190
|
onClick,
|
|
17153
17191
|
...otherProps
|
|
17154
17192
|
}) => {
|
|
17155
|
-
var _plan$quantity;
|
|
17193
|
+
var _plan$quantity, _window$Pelcro$site$r;
|
|
17156
17194
|
|
|
17157
17195
|
const {
|
|
17158
17196
|
plan
|
|
@@ -17163,6 +17201,12 @@ const SubmitPaymentMethod = ({
|
|
|
17163
17201
|
const {
|
|
17164
17202
|
dispatch,
|
|
17165
17203
|
state: {
|
|
17204
|
+
firstNameError,
|
|
17205
|
+
lastNameError,
|
|
17206
|
+
phoneError,
|
|
17207
|
+
firstName,
|
|
17208
|
+
lastName,
|
|
17209
|
+
phone,
|
|
17166
17210
|
disableSubmit,
|
|
17167
17211
|
isLoading,
|
|
17168
17212
|
updatedPrice
|
|
@@ -17171,6 +17215,18 @@ const SubmitPaymentMethod = ({
|
|
|
17171
17215
|
const planQuantity = (_plan$quantity = plan === null || plan === void 0 ? void 0 : plan.quantity) !== null && _plan$quantity !== void 0 ? _plan$quantity : 1;
|
|
17172
17216
|
const price = updatedPrice !== null && updatedPrice !== void 0 ? updatedPrice : plan === null || plan === void 0 ? void 0 : plan.amount;
|
|
17173
17217
|
const priceFormatted = getFormattedPriceByLocal(price * planQuantity, plan === null || plan === void 0 ? void 0 : plan.currency, getPageOrDefaultLanguage());
|
|
17218
|
+
const supportsTap = Boolean((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tap_gateway_settings);
|
|
17219
|
+
const isUserFirstName = Boolean(window.Pelcro.user.read().first_name);
|
|
17220
|
+
const isUserLastName = Boolean(window.Pelcro.user.read().last_name);
|
|
17221
|
+
const isUserPhone = Boolean(window.Pelcro.user.read().phone);
|
|
17222
|
+
const [isDisabled, setDisabled] = useState(true);
|
|
17223
|
+
useEffect(() => {
|
|
17224
|
+
if (supportsTap && isUserFirstName && isUserLastName && isUserPhone) {
|
|
17225
|
+
setDisabled(disableSubmit);
|
|
17226
|
+
} else {
|
|
17227
|
+
setDisabled(disableSubmit || supportsTap && firstNameError || supportsTap && lastNameError || supportsTap && phoneError || supportsTap && !firstName.length || supportsTap && !lastName.length || supportsTap && !phone.length);
|
|
17228
|
+
}
|
|
17229
|
+
}, [disableSubmit, firstNameError, lastNameError, phoneError, firstName, lastName, phone]);
|
|
17174
17230
|
return /*#__PURE__*/React__default.createElement(Button, Object.assign({
|
|
17175
17231
|
role: "submit",
|
|
17176
17232
|
className: "plc-w-full plc-py-3",
|
|
@@ -17182,7 +17238,7 @@ const SubmitPaymentMethod = ({
|
|
|
17182
17238
|
});
|
|
17183
17239
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
17184
17240
|
},
|
|
17185
|
-
disabled:
|
|
17241
|
+
disabled: isDisabled
|
|
17186
17242
|
}, otherProps), plan ? /*#__PURE__*/React__default.createElement("span", {
|
|
17187
17243
|
className: "plc-capitalize "
|
|
17188
17244
|
}, t("labels.pay"), " ", priceFormatted && priceFormatted) : t("labels.submit"));
|
|
@@ -17757,6 +17813,18 @@ const TaxAmount = () => {
|
|
|
17757
17813
|
return null;
|
|
17758
17814
|
};
|
|
17759
17815
|
|
|
17816
|
+
const IncludeFirstName = props => /*#__PURE__*/React__default.createElement(FirstName, Object.assign({
|
|
17817
|
+
store: store$j
|
|
17818
|
+
}, props));
|
|
17819
|
+
|
|
17820
|
+
const IncludeLastName = props => /*#__PURE__*/React__default.createElement(LastName, Object.assign({
|
|
17821
|
+
store: store$j
|
|
17822
|
+
}, props));
|
|
17823
|
+
|
|
17824
|
+
const IncludePhone = props => /*#__PURE__*/React__default.createElement(Phone, Object.assign({
|
|
17825
|
+
store: store$j
|
|
17826
|
+
}, props));
|
|
17827
|
+
|
|
17760
17828
|
/**
|
|
17761
17829
|
*
|
|
17762
17830
|
*/
|
|
@@ -17776,7 +17844,10 @@ function PaymentMethodView({
|
|
|
17776
17844
|
} = useTranslation("checkoutForm");
|
|
17777
17845
|
const cardProcessor = getSiteCardProcessor();
|
|
17778
17846
|
const supportsVantiv = Boolean((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.vantiv_gateway_settings);
|
|
17779
|
-
Boolean((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.tap_gateway_settings);
|
|
17847
|
+
const supportsTap = Boolean((_window$Pelcro$site$r2 = window.Pelcro.site.read()) === null || _window$Pelcro$site$r2 === void 0 ? void 0 : _window$Pelcro$site$r2.tap_gateway_settings);
|
|
17848
|
+
const isUserFirstName = Boolean(window.Pelcro.user.read().first_name);
|
|
17849
|
+
const isUserLastName = Boolean(window.Pelcro.user.read().last_name);
|
|
17850
|
+
const isUserPhone = Boolean(window.Pelcro.user.read().phone);
|
|
17780
17851
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
17781
17852
|
className: "plc-flex plc-flex-col plc-items-center plc-mt-4 sm:plc-px-8 pelcro-payment-block"
|
|
17782
17853
|
}, cardProcessor === "stripe" && /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -17798,7 +17869,25 @@ function PaymentMethodView({
|
|
|
17798
17869
|
onFailure: onFailure
|
|
17799
17870
|
}, /*#__PURE__*/React__default.createElement(BankRedirection, null), /*#__PURE__*/React__default.createElement(AlertWithContext, {
|
|
17800
17871
|
className: "plc-mb-2"
|
|
17801
|
-
}), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(SelectedPaymentMethod, null), /*#__PURE__*/React__default.createElement(
|
|
17872
|
+
}), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(SelectedPaymentMethod, null), supportsTap && (!isUserFirstName || !isUserLastName || !isUserPhone) && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
17873
|
+
className: "plc-flex plc-items-start"
|
|
17874
|
+
}, /*#__PURE__*/React__default.createElement(IncludeFirstName, {
|
|
17875
|
+
id: "pelcro-input-first-name",
|
|
17876
|
+
label: t("labels.firstName"),
|
|
17877
|
+
errorId: "pelcro-input-firstName-error",
|
|
17878
|
+
required: true
|
|
17879
|
+
}), /*#__PURE__*/React__default.createElement(IncludeLastName, {
|
|
17880
|
+
wrapperClassName: "plc-ml-3",
|
|
17881
|
+
id: "pelcro-input-last-name",
|
|
17882
|
+
label: t("labels.lastName"),
|
|
17883
|
+
errorId: "pelcro-input-lastName-error",
|
|
17884
|
+
required: true
|
|
17885
|
+
})), /*#__PURE__*/React__default.createElement(IncludePhone, {
|
|
17886
|
+
id: "pelcro-input-phone",
|
|
17887
|
+
errorId: "pelcro-input-phone-error",
|
|
17888
|
+
label: t("labels.phone"),
|
|
17889
|
+
required: true
|
|
17890
|
+
})), /*#__PURE__*/React__default.createElement(CheckoutForm, null), showCoupon && /*#__PURE__*/React__default.createElement("div", {
|
|
17802
17891
|
className: "plc-mb-2"
|
|
17803
17892
|
}, /*#__PURE__*/React__default.createElement(CouponCode, null), /*#__PURE__*/React__default.createElement(DiscountedPrice, null)), /*#__PURE__*/React__default.createElement(TaxAmount, null), /*#__PURE__*/React__default.createElement("div", {
|
|
17804
17893
|
className: "plc-grid plc-mt-4 plc-gap-y-2"
|
|
@@ -19552,30 +19641,16 @@ const UserUpdateButton = ({
|
|
|
19552
19641
|
onClick,
|
|
19553
19642
|
...otherProps
|
|
19554
19643
|
}) => {
|
|
19555
|
-
var _window$Pelcro$site$r;
|
|
19556
|
-
|
|
19557
19644
|
const {
|
|
19558
19645
|
state: {
|
|
19559
19646
|
buttonDisabled,
|
|
19560
|
-
|
|
19561
|
-
firstName,
|
|
19562
|
-
lastName,
|
|
19563
|
-
phone,
|
|
19564
|
-
emailError,
|
|
19565
|
-
firstNameError,
|
|
19566
|
-
lastNameError,
|
|
19567
|
-
phoneError
|
|
19647
|
+
emailError
|
|
19568
19648
|
},
|
|
19569
19649
|
dispatch
|
|
19570
19650
|
} = useContext(store$f);
|
|
19571
|
-
const supportsTap = Boolean((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tap_gateway_settings);
|
|
19572
19651
|
const {
|
|
19573
19652
|
t
|
|
19574
19653
|
} = useTranslation("userEdit");
|
|
19575
|
-
const [isDisabled, setDisabled] = useState(true);
|
|
19576
|
-
useEffect(() => {
|
|
19577
|
-
setDisabled(buttonDisabled || emailError || firstNameError || lastNameError || phoneError || !(email !== null && email !== void 0 && email.length) || supportsTap && !(firstName !== null && firstName !== void 0 && firstName.length) || supportsTap && !(lastName !== null && lastName !== void 0 && lastName.length) || supportsTap && !(phone !== null && phone !== void 0 && phone.length));
|
|
19578
|
-
}, [email, firstName, lastName, phone, buttonDisabled, emailError, firstNameError, lastNameError, phoneError]);
|
|
19579
19654
|
return /*#__PURE__*/React__default.createElement(Button, Object.assign({
|
|
19580
19655
|
onClick: () => {
|
|
19581
19656
|
dispatch({
|
|
@@ -19583,7 +19658,7 @@ const UserUpdateButton = ({
|
|
|
19583
19658
|
});
|
|
19584
19659
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
19585
19660
|
},
|
|
19586
|
-
disabled:
|
|
19661
|
+
disabled: buttonDisabled || emailError,
|
|
19587
19662
|
isLoading: buttonDisabled && !emailError
|
|
19588
19663
|
}, otherProps), name !== null && name !== void 0 ? name : t("labels.submit"));
|
|
19589
19664
|
};
|
|
@@ -19628,12 +19703,9 @@ const UserUpdateProfilePic = ({
|
|
|
19628
19703
|
};
|
|
19629
19704
|
|
|
19630
19705
|
const UserUpdateView = props => {
|
|
19631
|
-
var _window$Pelcro$site$r;
|
|
19632
|
-
|
|
19633
19706
|
const {
|
|
19634
19707
|
t
|
|
19635
19708
|
} = useTranslation("userEdit");
|
|
19636
|
-
const supportsTap = Boolean((_window$Pelcro$site$r = window.Pelcro.site.read()) === null || _window$Pelcro$site$r === void 0 ? void 0 : _window$Pelcro$site$r.tap_gateway_settings);
|
|
19637
19709
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
19638
19710
|
id: "pelcro-user-update-view"
|
|
19639
19711
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -19652,22 +19724,19 @@ const UserUpdateView = props => {
|
|
|
19652
19724
|
id: "pelcro-input-first-name",
|
|
19653
19725
|
errorId: "pelcro-input-first-name-error",
|
|
19654
19726
|
label: t("labels.firstName"),
|
|
19655
|
-
autoFocus: true
|
|
19656
|
-
required: supportsTap ? true : false
|
|
19727
|
+
autoFocus: true
|
|
19657
19728
|
}), /*#__PURE__*/React__default.createElement(UserUpdateLastName, {
|
|
19658
19729
|
wrapperClassName: "plc-ml-3",
|
|
19659
19730
|
autoComplete: "last-name",
|
|
19660
19731
|
id: "pelcro-input-last-name",
|
|
19661
19732
|
errorId: "pelcro-input-last-name-error",
|
|
19662
|
-
label: t("labels.lastName")
|
|
19663
|
-
required: supportsTap ? true : false
|
|
19733
|
+
label: t("labels.lastName")
|
|
19664
19734
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
19665
19735
|
className: "plc-flex plc-items-start"
|
|
19666
19736
|
}, /*#__PURE__*/React__default.createElement(UserUpdatePhone, {
|
|
19667
19737
|
id: "pelcro-input-phone",
|
|
19668
19738
|
errorId: "pelcro-input-phone-error",
|
|
19669
|
-
label: t("labels.phone")
|
|
19670
|
-
required: supportsTap ? true : false
|
|
19739
|
+
label: t("labels.phone")
|
|
19671
19740
|
})), /*#__PURE__*/React__default.createElement(UserUpdateButton, {
|
|
19672
19741
|
role: "submit",
|
|
19673
19742
|
className: "plc-w-full plc-mt-2",
|
|
@@ -22972,10 +23041,12 @@ const GiftCreateEmail = props => /*#__PURE__*/React__default.createElement(Email
|
|
|
22972
23041
|
}, props));
|
|
22973
23042
|
|
|
22974
23043
|
const GiftCreateFirstName = props => /*#__PURE__*/React__default.createElement(FirstName, Object.assign({
|
|
23044
|
+
initWithUserFirstName: false,
|
|
22975
23045
|
store: store$7
|
|
22976
23046
|
}, props));
|
|
22977
23047
|
|
|
22978
23048
|
const GiftCreateLastName = props => /*#__PURE__*/React__default.createElement(LastName, Object.assign({
|
|
23049
|
+
initWithUserLastName: false,
|
|
22979
23050
|
store: store$7
|
|
22980
23051
|
}, props));
|
|
22981
23052
|
|