@pelcro/react-pelcro-js 3.4.1-beta.5 → 3.5.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 +57 -23
- package/dist/index.esm.js +55 -23
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -7278,6 +7278,13 @@ class PelcroActions {
|
|
|
7278
7278
|
return true;
|
|
7279
7279
|
});
|
|
7280
7280
|
|
|
7281
|
+
_defineProperty$3(this, "setCouponCode", couponCode => {
|
|
7282
|
+
if (!couponCode) return console.error("invalid coupon code");
|
|
7283
|
+
this.set({
|
|
7284
|
+
couponCode
|
|
7285
|
+
});
|
|
7286
|
+
});
|
|
7287
|
+
|
|
7281
7288
|
_defineProperty$3(this, "logout", () => {
|
|
7282
7289
|
var _ReactGA$event;
|
|
7283
7290
|
|
|
@@ -7485,6 +7492,8 @@ const initialState$l = {
|
|
|
7485
7492
|
// null | SKU[] | SKU,
|
|
7486
7493
|
// invoices
|
|
7487
7494
|
invoice: null,
|
|
7495
|
+
// couponCode
|
|
7496
|
+
couponCode: null,
|
|
7488
7497
|
// memberships
|
|
7489
7498
|
selectedMembership: null,
|
|
7490
7499
|
// User
|
|
@@ -9222,7 +9231,7 @@ toast.confirm = (onConfirm, {
|
|
|
9222
9231
|
};
|
|
9223
9232
|
};
|
|
9224
9233
|
|
|
9225
|
-
const notify
|
|
9234
|
+
const notify = toast;
|
|
9226
9235
|
|
|
9227
9236
|
const translations = i18next.t("common:buttons", {
|
|
9228
9237
|
returnObjects: true
|
|
@@ -9432,7 +9441,7 @@ const init$1 = () => {
|
|
|
9432
9441
|
const errorMsg = i18next.t("shop:messages.currencyMismatch", {
|
|
9433
9442
|
currency: userCurrency
|
|
9434
9443
|
});
|
|
9435
|
-
notify
|
|
9444
|
+
notify.error(errorMsg);
|
|
9436
9445
|
}
|
|
9437
9446
|
});
|
|
9438
9447
|
}
|
|
@@ -9526,7 +9535,7 @@ const init = () => {
|
|
|
9526
9535
|
elemDeepClone.setAttribute("style", "filter:blur(3px) !important; pointer-events:none !important; user-select:none !important");
|
|
9527
9536
|
unblurElemWhenUserSubscribes(elemDeepClone, entitlements);
|
|
9528
9537
|
const NOTIFICATION_ID = "entitlement";
|
|
9529
|
-
notify
|
|
9538
|
+
notify( /*#__PURE__*/React__default['default'].createElement("p", null, /*#__PURE__*/React__default['default'].createElement(Trans, {
|
|
9530
9539
|
i18nKey: "messages:entitlement"
|
|
9531
9540
|
}, "Some of the content on this page is available with one or more of our plans.", /*#__PURE__*/React__default['default'].createElement(Link, {
|
|
9532
9541
|
onClick: () => {
|
|
@@ -9543,7 +9552,7 @@ const init = () => {
|
|
|
9543
9552
|
});
|
|
9544
9553
|
}
|
|
9545
9554
|
|
|
9546
|
-
notify
|
|
9555
|
+
notify.dismiss(NOTIFICATION_ID);
|
|
9547
9556
|
switchView("_plan-select-entitlements");
|
|
9548
9557
|
}
|
|
9549
9558
|
}, "Subscribe"), "now to get full page access.")), {
|
|
@@ -10287,10 +10296,10 @@ const verifyEmailTokenFromUrl = () => {
|
|
|
10287
10296
|
token: emailToken
|
|
10288
10297
|
}, (err, res) => {
|
|
10289
10298
|
if (err) {
|
|
10290
|
-
return notify
|
|
10299
|
+
return notify.error(getErrorMessages(err));
|
|
10291
10300
|
}
|
|
10292
10301
|
|
|
10293
|
-
return notify
|
|
10302
|
+
return notify.success(translations.success);
|
|
10294
10303
|
});
|
|
10295
10304
|
}, {
|
|
10296
10305
|
once: true
|
|
@@ -10316,7 +10325,7 @@ const verifyLinkTokenFromUrl = () => {
|
|
|
10316
10325
|
token: loginToken
|
|
10317
10326
|
}, (err, res) => {
|
|
10318
10327
|
if (err) {
|
|
10319
|
-
return notify
|
|
10328
|
+
return notify.error(getErrorMessages(err));
|
|
10320
10329
|
}
|
|
10321
10330
|
|
|
10322
10331
|
const {
|
|
@@ -10326,11 +10335,11 @@ const verifyLinkTokenFromUrl = () => {
|
|
|
10326
10335
|
auth_token
|
|
10327
10336
|
}, (err, res) => {
|
|
10328
10337
|
if (err) {
|
|
10329
|
-
return notify
|
|
10338
|
+
return notify.error(getErrorMessages(err));
|
|
10330
10339
|
}
|
|
10331
10340
|
|
|
10332
10341
|
resetView();
|
|
10333
|
-
return notify
|
|
10342
|
+
return notify.success(translations.success);
|
|
10334
10343
|
});
|
|
10335
10344
|
});
|
|
10336
10345
|
}, {
|
|
@@ -10371,7 +10380,7 @@ const showInvoiceDetailsFromUrl = () => {
|
|
|
10371
10380
|
const errorMessage = i18next.t("messages:invalidInvoice", {
|
|
10372
10381
|
returnObjects: true
|
|
10373
10382
|
});
|
|
10374
|
-
return notify
|
|
10383
|
+
return notify.error(errorMessage);
|
|
10375
10384
|
}
|
|
10376
10385
|
|
|
10377
10386
|
const {
|
|
@@ -10382,7 +10391,7 @@ const showInvoiceDetailsFromUrl = () => {
|
|
|
10382
10391
|
const errorMessage = i18next.t("messages:zeroTotalInvoice", {
|
|
10383
10392
|
returnObjects: true
|
|
10384
10393
|
});
|
|
10385
|
-
return notify
|
|
10394
|
+
return notify.error(errorMessage);
|
|
10386
10395
|
}
|
|
10387
10396
|
|
|
10388
10397
|
return switchView("invoice-details");
|
|
@@ -14770,7 +14779,8 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
14770
14779
|
const {
|
|
14771
14780
|
set,
|
|
14772
14781
|
order,
|
|
14773
|
-
selectedPaymentMethodId
|
|
14782
|
+
selectedPaymentMethodId,
|
|
14783
|
+
couponCode
|
|
14774
14784
|
} = usePelcro();
|
|
14775
14785
|
const product = (_props$product = props.product) !== null && _props$product !== void 0 ? _props$product : pelcroStore.product;
|
|
14776
14786
|
const plan = (_props$plan = props.plan) !== null && _props$plan !== void 0 ? _props$plan : pelcroStore.plan;
|
|
@@ -14786,6 +14796,11 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
14786
14796
|
type: UPDATE_COUPON_CODE,
|
|
14787
14797
|
payload: window.Pelcro.coupon.getFromUrl()
|
|
14788
14798
|
});
|
|
14799
|
+
} else if (couponCode) {
|
|
14800
|
+
dispatch({
|
|
14801
|
+
type: UPDATE_COUPON_CODE,
|
|
14802
|
+
payload: couponCode
|
|
14803
|
+
});
|
|
14789
14804
|
}
|
|
14790
14805
|
|
|
14791
14806
|
dispatch({
|
|
@@ -17166,7 +17181,7 @@ const SubscriptionCancelNowButton = ({
|
|
|
17166
17181
|
|
|
17167
17182
|
switchView(null); //Show confirmation alert after closing the modal
|
|
17168
17183
|
|
|
17169
|
-
notify
|
|
17184
|
+
notify.confirm((onSuccess, onFailure) => {
|
|
17170
17185
|
cancelSubscription(payload, onSuccess, onFailure);
|
|
17171
17186
|
}, {
|
|
17172
17187
|
confirmMessage: t("messages.subCancellation.isSureToCancelNow"),
|
|
@@ -17238,7 +17253,7 @@ const SubscriptionCancelLaterButton = ({
|
|
|
17238
17253
|
|
|
17239
17254
|
switchView(null); //Show confirmation alert after closing the modal
|
|
17240
17255
|
|
|
17241
|
-
notify
|
|
17256
|
+
notify.confirm((onSuccess, onFailure) => {
|
|
17242
17257
|
cancelSubscription(payload, onSuccess, onFailure);
|
|
17243
17258
|
}, {
|
|
17244
17259
|
confirmMessage: t("messages.subCancellation.isSureToCancel"),
|
|
@@ -19378,7 +19393,8 @@ const AddressCreateModal = ({
|
|
|
19378
19393
|
}) => {
|
|
19379
19394
|
const {
|
|
19380
19395
|
switchView,
|
|
19381
|
-
switchToPaymentView
|
|
19396
|
+
switchToPaymentView,
|
|
19397
|
+
resetView
|
|
19382
19398
|
} = usePelcro();
|
|
19383
19399
|
|
|
19384
19400
|
const onSuccess = newAddressId => {
|
|
@@ -19400,6 +19416,7 @@ const AddressCreateModal = ({
|
|
|
19400
19416
|
var _otherProps$onMembers;
|
|
19401
19417
|
|
|
19402
19418
|
(_otherProps$onMembers = otherProps.onMembershipAdressUpdateSuccess) === null || _otherProps$onMembers === void 0 ? void 0 : _otherProps$onMembers.call(otherProps);
|
|
19419
|
+
resetView();
|
|
19403
19420
|
};
|
|
19404
19421
|
|
|
19405
19422
|
return /*#__PURE__*/React__default['default'].createElement(Modal, {
|
|
@@ -22313,7 +22330,7 @@ const AddressSelectContainer = ({
|
|
|
22313
22330
|
return onFailure(err);
|
|
22314
22331
|
}
|
|
22315
22332
|
|
|
22316
|
-
notify
|
|
22333
|
+
notify.success(t("messages.addressUpdated"));
|
|
22317
22334
|
return onMembershipAdressUpdateSuccess(res);
|
|
22318
22335
|
});
|
|
22319
22336
|
}
|
|
@@ -22354,6 +22371,8 @@ const AddressSelectContainer = ({
|
|
|
22354
22371
|
};
|
|
22355
22372
|
|
|
22356
22373
|
const [state, dispatch] = useReducerWithSideEffects((state, action) => {
|
|
22374
|
+
var _selectedMembership$a;
|
|
22375
|
+
|
|
22357
22376
|
switch (action.type) {
|
|
22358
22377
|
case SELECT_ADDRESS:
|
|
22359
22378
|
return lib_7({ ...state,
|
|
@@ -22363,7 +22382,7 @@ const AddressSelectContainer = ({
|
|
|
22363
22382
|
case LOAD_ADDRESSES:
|
|
22364
22383
|
return lib_7({ ...state,
|
|
22365
22384
|
addresses: moveDefaultAddressToStart(action.payload),
|
|
22366
|
-
selectedAddressId: String(getDefaultAddress(action.payload).id)
|
|
22385
|
+
selectedAddressId: String((_selectedMembership$a = selectedMembership === null || selectedMembership === void 0 ? void 0 : selectedMembership.address_id) !== null && _selectedMembership$a !== void 0 ? _selectedMembership$a : getDefaultAddress(action.payload).id)
|
|
22367
22386
|
});
|
|
22368
22387
|
|
|
22369
22388
|
case SHOW_ALERT:
|
|
@@ -22510,7 +22529,8 @@ const AddressSelectModal = ({
|
|
|
22510
22529
|
}) => {
|
|
22511
22530
|
const {
|
|
22512
22531
|
switchView,
|
|
22513
|
-
switchToPaymentView
|
|
22532
|
+
switchToPaymentView,
|
|
22533
|
+
resetView
|
|
22514
22534
|
} = usePelcro();
|
|
22515
22535
|
|
|
22516
22536
|
const onSuccess = selectedAddressId => {
|
|
@@ -22536,6 +22556,7 @@ const AddressSelectModal = ({
|
|
|
22536
22556
|
var _otherProps$onMembers;
|
|
22537
22557
|
|
|
22538
22558
|
(_otherProps$onMembers = otherProps.onMembershipAdressUpdateSuccess) === null || _otherProps$onMembers === void 0 ? void 0 : _otherProps$onMembers.call(otherProps);
|
|
22559
|
+
resetView();
|
|
22539
22560
|
};
|
|
22540
22561
|
|
|
22541
22562
|
return /*#__PURE__*/React__default['default'].createElement(Modal, {
|
|
@@ -24305,7 +24326,7 @@ const SubscriptionsItems = ({
|
|
|
24305
24326
|
}
|
|
24306
24327
|
|
|
24307
24328
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
24308
|
-
notify
|
|
24329
|
+
notify.confirm((onSuccess, onFailure) => {
|
|
24309
24330
|
cancelSubscription(sub.id, onSuccess, onFailure);
|
|
24310
24331
|
}, {
|
|
24311
24332
|
confirmMessage: t("messages.subCancellation.isSureToCancel"),
|
|
@@ -24938,14 +24959,16 @@ const MembershipsItems = () => {
|
|
|
24938
24959
|
className: "plc-truncate"
|
|
24939
24960
|
}, membership.subscription.plan.nickname && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
24940
24961
|
className: "plc-font-semibold plc-text-gray-500 pelcro-membership-plan"
|
|
24941
|
-
}, membership.subscription.plan.nickname))), /*#__PURE__*/React__default['default'].createElement("td", null, /*#__PURE__*/React__default['default'].createElement("span",
|
|
24962
|
+
}, membership.subscription.plan.nickname))), /*#__PURE__*/React__default['default'].createElement("td", null, /*#__PURE__*/React__default['default'].createElement("span", {
|
|
24963
|
+
className: `plc-inline-flex plc-p-1 plc-text-xs plc-font-semibold ${getMemberShipStatus(membership.status).bgColor} plc-uppercase ${getMemberShipStatus(membership.status).textColor} plc-rounded-lg`
|
|
24964
|
+
}, getMemberShipStatus(membership.status).icon, getMemberShipStatus(membership.status).title)), /*#__PURE__*/React__default['default'].createElement("td", null, /*#__PURE__*/React__default['default'].createElement(Button, {
|
|
24942
24965
|
variant: "ghost",
|
|
24943
24966
|
icon: /*#__PURE__*/React__default['default'].createElement(SvgEdit, {
|
|
24944
24967
|
className: "plc-w-4 plc-h-4"
|
|
24945
24968
|
}),
|
|
24946
24969
|
className: "plc-text-blue-400 focus:plc-ring-blue-500 pelcro-dashboard-membership-address-button",
|
|
24947
24970
|
onClick: () => onChangeAddressClick(membership.id)
|
|
24948
|
-
}, t("labels.edit"))));
|
|
24971
|
+
}, `${t("labels.edit")} ${t("labels.address")}`)));
|
|
24949
24972
|
});
|
|
24950
24973
|
};
|
|
24951
24974
|
|
|
@@ -24955,6 +24978,15 @@ function getActiveMemberships() {
|
|
|
24955
24978
|
return (_window$Pelcro$user$r = (_window$Pelcro$user$r2 = window.Pelcro.user.read().memberships) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.filter(membership => membership.status === "active")) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : [];
|
|
24956
24979
|
}
|
|
24957
24980
|
|
|
24981
|
+
function getMemberShipStatus(status) {
|
|
24982
|
+
return {
|
|
24983
|
+
title: status,
|
|
24984
|
+
textColor: "plc-text-green-700",
|
|
24985
|
+
bgColor: "plc-bg-green-100",
|
|
24986
|
+
icon: /*#__PURE__*/React__default['default'].createElement(SvgCheckMark, null)
|
|
24987
|
+
};
|
|
24988
|
+
}
|
|
24989
|
+
|
|
24958
24990
|
const SUB_MENUS = {
|
|
24959
24991
|
PROFILE: "profile",
|
|
24960
24992
|
SUBSCRIPTIONS: "subscriptions",
|
|
@@ -27719,7 +27751,7 @@ function VerifyLinkTokenModal({
|
|
|
27719
27751
|
|
|
27720
27752
|
(_props$onSuccess = props.onSuccess) === null || _props$onSuccess === void 0 ? void 0 : _props$onSuccess.call(props, res);
|
|
27721
27753
|
resetView();
|
|
27722
|
-
notify
|
|
27754
|
+
notify.success(t("messages.success"));
|
|
27723
27755
|
};
|
|
27724
27756
|
|
|
27725
27757
|
return /*#__PURE__*/React__default['default'].createElement(Modal, {
|
|
@@ -27972,6 +28004,7 @@ exports.AddressCreateLine1 = AddressCreateLine1;
|
|
|
27972
28004
|
exports.AddressCreateLine2 = AddressCreateLine2;
|
|
27973
28005
|
exports.AddressCreateModal = AddressCreateModal;
|
|
27974
28006
|
exports.AddressCreatePostalCode = AddressCreatePostalCode;
|
|
28007
|
+
exports.AddressCreateSetDefault = AddressCreateSetDefault;
|
|
27975
28008
|
exports.AddressCreateStateSelect = AddressCreateStateSelect;
|
|
27976
28009
|
exports.AddressCreateSubmit = AddressCreateSubmit;
|
|
27977
28010
|
exports.AddressCreateTextInput = AddressCreateTextInput;
|
|
@@ -27990,6 +28023,7 @@ exports.AddressUpdateLine1 = AddressUpdateLine1;
|
|
|
27990
28023
|
exports.AddressUpdateLine2 = AddressUpdateLine2;
|
|
27991
28024
|
exports.AddressUpdateModal = AddressUpdateModal;
|
|
27992
28025
|
exports.AddressUpdatePostalCode = AddressUpdatePostalCode;
|
|
28026
|
+
exports.AddressUpdateSetDefault = AddressUpdateSetDefault;
|
|
27993
28027
|
exports.AddressUpdateStateSelect = AddressUpdateStateSelect;
|
|
27994
28028
|
exports.AddressUpdateSubmit = AddressUpdateSubmit;
|
|
27995
28029
|
exports.AddressUpdateTextInput = AddressUpdateTextInput;
|
|
@@ -28173,6 +28207,6 @@ exports.i18n = i18next;
|
|
|
28173
28207
|
exports.initButtons = init$1;
|
|
28174
28208
|
exports.initContentEntitlement = init;
|
|
28175
28209
|
exports.invoicePaymentSubmitButton = invoicePaymentSubmitButton;
|
|
28176
|
-
exports.notify = notify
|
|
28210
|
+
exports.notify = notify;
|
|
28177
28211
|
exports.unauthenticatedButtons = unauthenticatedButtons;
|
|
28178
28212
|
exports.usePelcro = usePelcro;
|
package/dist/index.esm.js
CHANGED
|
@@ -7248,6 +7248,13 @@ class PelcroActions {
|
|
|
7248
7248
|
return true;
|
|
7249
7249
|
});
|
|
7250
7250
|
|
|
7251
|
+
_defineProperty$3(this, "setCouponCode", couponCode => {
|
|
7252
|
+
if (!couponCode) return console.error("invalid coupon code");
|
|
7253
|
+
this.set({
|
|
7254
|
+
couponCode
|
|
7255
|
+
});
|
|
7256
|
+
});
|
|
7257
|
+
|
|
7251
7258
|
_defineProperty$3(this, "logout", () => {
|
|
7252
7259
|
var _ReactGA$event;
|
|
7253
7260
|
|
|
@@ -7455,6 +7462,8 @@ const initialState$l = {
|
|
|
7455
7462
|
// null | SKU[] | SKU,
|
|
7456
7463
|
// invoices
|
|
7457
7464
|
invoice: null,
|
|
7465
|
+
// couponCode
|
|
7466
|
+
couponCode: null,
|
|
7458
7467
|
// memberships
|
|
7459
7468
|
selectedMembership: null,
|
|
7460
7469
|
// User
|
|
@@ -9192,7 +9201,7 @@ toast.confirm = (onConfirm, {
|
|
|
9192
9201
|
};
|
|
9193
9202
|
};
|
|
9194
9203
|
|
|
9195
|
-
const notify
|
|
9204
|
+
const notify = toast;
|
|
9196
9205
|
|
|
9197
9206
|
const translations = i18next.t("common:buttons", {
|
|
9198
9207
|
returnObjects: true
|
|
@@ -9402,7 +9411,7 @@ const init$1 = () => {
|
|
|
9402
9411
|
const errorMsg = i18next.t("shop:messages.currencyMismatch", {
|
|
9403
9412
|
currency: userCurrency
|
|
9404
9413
|
});
|
|
9405
|
-
notify
|
|
9414
|
+
notify.error(errorMsg);
|
|
9406
9415
|
}
|
|
9407
9416
|
});
|
|
9408
9417
|
}
|
|
@@ -9496,7 +9505,7 @@ const init = () => {
|
|
|
9496
9505
|
elemDeepClone.setAttribute("style", "filter:blur(3px) !important; pointer-events:none !important; user-select:none !important");
|
|
9497
9506
|
unblurElemWhenUserSubscribes(elemDeepClone, entitlements);
|
|
9498
9507
|
const NOTIFICATION_ID = "entitlement";
|
|
9499
|
-
notify
|
|
9508
|
+
notify( /*#__PURE__*/React__default.createElement("p", null, /*#__PURE__*/React__default.createElement(Trans, {
|
|
9500
9509
|
i18nKey: "messages:entitlement"
|
|
9501
9510
|
}, "Some of the content on this page is available with one or more of our plans.", /*#__PURE__*/React__default.createElement(Link, {
|
|
9502
9511
|
onClick: () => {
|
|
@@ -9513,7 +9522,7 @@ const init = () => {
|
|
|
9513
9522
|
});
|
|
9514
9523
|
}
|
|
9515
9524
|
|
|
9516
|
-
notify
|
|
9525
|
+
notify.dismiss(NOTIFICATION_ID);
|
|
9517
9526
|
switchView("_plan-select-entitlements");
|
|
9518
9527
|
}
|
|
9519
9528
|
}, "Subscribe"), "now to get full page access.")), {
|
|
@@ -10257,10 +10266,10 @@ const verifyEmailTokenFromUrl = () => {
|
|
|
10257
10266
|
token: emailToken
|
|
10258
10267
|
}, (err, res) => {
|
|
10259
10268
|
if (err) {
|
|
10260
|
-
return notify
|
|
10269
|
+
return notify.error(getErrorMessages(err));
|
|
10261
10270
|
}
|
|
10262
10271
|
|
|
10263
|
-
return notify
|
|
10272
|
+
return notify.success(translations.success);
|
|
10264
10273
|
});
|
|
10265
10274
|
}, {
|
|
10266
10275
|
once: true
|
|
@@ -10286,7 +10295,7 @@ const verifyLinkTokenFromUrl = () => {
|
|
|
10286
10295
|
token: loginToken
|
|
10287
10296
|
}, (err, res) => {
|
|
10288
10297
|
if (err) {
|
|
10289
|
-
return notify
|
|
10298
|
+
return notify.error(getErrorMessages(err));
|
|
10290
10299
|
}
|
|
10291
10300
|
|
|
10292
10301
|
const {
|
|
@@ -10296,11 +10305,11 @@ const verifyLinkTokenFromUrl = () => {
|
|
|
10296
10305
|
auth_token
|
|
10297
10306
|
}, (err, res) => {
|
|
10298
10307
|
if (err) {
|
|
10299
|
-
return notify
|
|
10308
|
+
return notify.error(getErrorMessages(err));
|
|
10300
10309
|
}
|
|
10301
10310
|
|
|
10302
10311
|
resetView();
|
|
10303
|
-
return notify
|
|
10312
|
+
return notify.success(translations.success);
|
|
10304
10313
|
});
|
|
10305
10314
|
});
|
|
10306
10315
|
}, {
|
|
@@ -10341,7 +10350,7 @@ const showInvoiceDetailsFromUrl = () => {
|
|
|
10341
10350
|
const errorMessage = i18next.t("messages:invalidInvoice", {
|
|
10342
10351
|
returnObjects: true
|
|
10343
10352
|
});
|
|
10344
|
-
return notify
|
|
10353
|
+
return notify.error(errorMessage);
|
|
10345
10354
|
}
|
|
10346
10355
|
|
|
10347
10356
|
const {
|
|
@@ -10352,7 +10361,7 @@ const showInvoiceDetailsFromUrl = () => {
|
|
|
10352
10361
|
const errorMessage = i18next.t("messages:zeroTotalInvoice", {
|
|
10353
10362
|
returnObjects: true
|
|
10354
10363
|
});
|
|
10355
|
-
return notify
|
|
10364
|
+
return notify.error(errorMessage);
|
|
10356
10365
|
}
|
|
10357
10366
|
|
|
10358
10367
|
return switchView("invoice-details");
|
|
@@ -14740,7 +14749,8 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
14740
14749
|
const {
|
|
14741
14750
|
set,
|
|
14742
14751
|
order,
|
|
14743
|
-
selectedPaymentMethodId
|
|
14752
|
+
selectedPaymentMethodId,
|
|
14753
|
+
couponCode
|
|
14744
14754
|
} = usePelcro();
|
|
14745
14755
|
const product = (_props$product = props.product) !== null && _props$product !== void 0 ? _props$product : pelcroStore.product;
|
|
14746
14756
|
const plan = (_props$plan = props.plan) !== null && _props$plan !== void 0 ? _props$plan : pelcroStore.plan;
|
|
@@ -14756,6 +14766,11 @@ const PaymentMethodContainerWithoutStripe = ({
|
|
|
14756
14766
|
type: UPDATE_COUPON_CODE,
|
|
14757
14767
|
payload: window.Pelcro.coupon.getFromUrl()
|
|
14758
14768
|
});
|
|
14769
|
+
} else if (couponCode) {
|
|
14770
|
+
dispatch({
|
|
14771
|
+
type: UPDATE_COUPON_CODE,
|
|
14772
|
+
payload: couponCode
|
|
14773
|
+
});
|
|
14759
14774
|
}
|
|
14760
14775
|
|
|
14761
14776
|
dispatch({
|
|
@@ -17136,7 +17151,7 @@ const SubscriptionCancelNowButton = ({
|
|
|
17136
17151
|
|
|
17137
17152
|
switchView(null); //Show confirmation alert after closing the modal
|
|
17138
17153
|
|
|
17139
|
-
notify
|
|
17154
|
+
notify.confirm((onSuccess, onFailure) => {
|
|
17140
17155
|
cancelSubscription(payload, onSuccess, onFailure);
|
|
17141
17156
|
}, {
|
|
17142
17157
|
confirmMessage: t("messages.subCancellation.isSureToCancelNow"),
|
|
@@ -17208,7 +17223,7 @@ const SubscriptionCancelLaterButton = ({
|
|
|
17208
17223
|
|
|
17209
17224
|
switchView(null); //Show confirmation alert after closing the modal
|
|
17210
17225
|
|
|
17211
|
-
notify
|
|
17226
|
+
notify.confirm((onSuccess, onFailure) => {
|
|
17212
17227
|
cancelSubscription(payload, onSuccess, onFailure);
|
|
17213
17228
|
}, {
|
|
17214
17229
|
confirmMessage: t("messages.subCancellation.isSureToCancel"),
|
|
@@ -19348,7 +19363,8 @@ const AddressCreateModal = ({
|
|
|
19348
19363
|
}) => {
|
|
19349
19364
|
const {
|
|
19350
19365
|
switchView,
|
|
19351
|
-
switchToPaymentView
|
|
19366
|
+
switchToPaymentView,
|
|
19367
|
+
resetView
|
|
19352
19368
|
} = usePelcro();
|
|
19353
19369
|
|
|
19354
19370
|
const onSuccess = newAddressId => {
|
|
@@ -19370,6 +19386,7 @@ const AddressCreateModal = ({
|
|
|
19370
19386
|
var _otherProps$onMembers;
|
|
19371
19387
|
|
|
19372
19388
|
(_otherProps$onMembers = otherProps.onMembershipAdressUpdateSuccess) === null || _otherProps$onMembers === void 0 ? void 0 : _otherProps$onMembers.call(otherProps);
|
|
19389
|
+
resetView();
|
|
19373
19390
|
};
|
|
19374
19391
|
|
|
19375
19392
|
return /*#__PURE__*/React__default.createElement(Modal, {
|
|
@@ -22283,7 +22300,7 @@ const AddressSelectContainer = ({
|
|
|
22283
22300
|
return onFailure(err);
|
|
22284
22301
|
}
|
|
22285
22302
|
|
|
22286
|
-
notify
|
|
22303
|
+
notify.success(t("messages.addressUpdated"));
|
|
22287
22304
|
return onMembershipAdressUpdateSuccess(res);
|
|
22288
22305
|
});
|
|
22289
22306
|
}
|
|
@@ -22324,6 +22341,8 @@ const AddressSelectContainer = ({
|
|
|
22324
22341
|
};
|
|
22325
22342
|
|
|
22326
22343
|
const [state, dispatch] = useReducerWithSideEffects((state, action) => {
|
|
22344
|
+
var _selectedMembership$a;
|
|
22345
|
+
|
|
22327
22346
|
switch (action.type) {
|
|
22328
22347
|
case SELECT_ADDRESS:
|
|
22329
22348
|
return lib_7({ ...state,
|
|
@@ -22333,7 +22352,7 @@ const AddressSelectContainer = ({
|
|
|
22333
22352
|
case LOAD_ADDRESSES:
|
|
22334
22353
|
return lib_7({ ...state,
|
|
22335
22354
|
addresses: moveDefaultAddressToStart(action.payload),
|
|
22336
|
-
selectedAddressId: String(getDefaultAddress(action.payload).id)
|
|
22355
|
+
selectedAddressId: String((_selectedMembership$a = selectedMembership === null || selectedMembership === void 0 ? void 0 : selectedMembership.address_id) !== null && _selectedMembership$a !== void 0 ? _selectedMembership$a : getDefaultAddress(action.payload).id)
|
|
22337
22356
|
});
|
|
22338
22357
|
|
|
22339
22358
|
case SHOW_ALERT:
|
|
@@ -22480,7 +22499,8 @@ const AddressSelectModal = ({
|
|
|
22480
22499
|
}) => {
|
|
22481
22500
|
const {
|
|
22482
22501
|
switchView,
|
|
22483
|
-
switchToPaymentView
|
|
22502
|
+
switchToPaymentView,
|
|
22503
|
+
resetView
|
|
22484
22504
|
} = usePelcro();
|
|
22485
22505
|
|
|
22486
22506
|
const onSuccess = selectedAddressId => {
|
|
@@ -22506,6 +22526,7 @@ const AddressSelectModal = ({
|
|
|
22506
22526
|
var _otherProps$onMembers;
|
|
22507
22527
|
|
|
22508
22528
|
(_otherProps$onMembers = otherProps.onMembershipAdressUpdateSuccess) === null || _otherProps$onMembers === void 0 ? void 0 : _otherProps$onMembers.call(otherProps);
|
|
22529
|
+
resetView();
|
|
22509
22530
|
};
|
|
22510
22531
|
|
|
22511
22532
|
return /*#__PURE__*/React__default.createElement(Modal, {
|
|
@@ -24275,7 +24296,7 @@ const SubscriptionsItems = ({
|
|
|
24275
24296
|
}
|
|
24276
24297
|
|
|
24277
24298
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
24278
|
-
notify
|
|
24299
|
+
notify.confirm((onSuccess, onFailure) => {
|
|
24279
24300
|
cancelSubscription(sub.id, onSuccess, onFailure);
|
|
24280
24301
|
}, {
|
|
24281
24302
|
confirmMessage: t("messages.subCancellation.isSureToCancel"),
|
|
@@ -24908,14 +24929,16 @@ const MembershipsItems = () => {
|
|
|
24908
24929
|
className: "plc-truncate"
|
|
24909
24930
|
}, membership.subscription.plan.nickname && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("span", {
|
|
24910
24931
|
className: "plc-font-semibold plc-text-gray-500 pelcro-membership-plan"
|
|
24911
|
-
}, membership.subscription.plan.nickname))), /*#__PURE__*/React__default.createElement("td", null, /*#__PURE__*/React__default.createElement("span",
|
|
24932
|
+
}, membership.subscription.plan.nickname))), /*#__PURE__*/React__default.createElement("td", null, /*#__PURE__*/React__default.createElement("span", {
|
|
24933
|
+
className: `plc-inline-flex plc-p-1 plc-text-xs plc-font-semibold ${getMemberShipStatus(membership.status).bgColor} plc-uppercase ${getMemberShipStatus(membership.status).textColor} plc-rounded-lg`
|
|
24934
|
+
}, getMemberShipStatus(membership.status).icon, getMemberShipStatus(membership.status).title)), /*#__PURE__*/React__default.createElement("td", null, /*#__PURE__*/React__default.createElement(Button, {
|
|
24912
24935
|
variant: "ghost",
|
|
24913
24936
|
icon: /*#__PURE__*/React__default.createElement(SvgEdit, {
|
|
24914
24937
|
className: "plc-w-4 plc-h-4"
|
|
24915
24938
|
}),
|
|
24916
24939
|
className: "plc-text-blue-400 focus:plc-ring-blue-500 pelcro-dashboard-membership-address-button",
|
|
24917
24940
|
onClick: () => onChangeAddressClick(membership.id)
|
|
24918
|
-
}, t("labels.edit"))));
|
|
24941
|
+
}, `${t("labels.edit")} ${t("labels.address")}`)));
|
|
24919
24942
|
});
|
|
24920
24943
|
};
|
|
24921
24944
|
|
|
@@ -24925,6 +24948,15 @@ function getActiveMemberships() {
|
|
|
24925
24948
|
return (_window$Pelcro$user$r = (_window$Pelcro$user$r2 = window.Pelcro.user.read().memberships) === null || _window$Pelcro$user$r2 === void 0 ? void 0 : _window$Pelcro$user$r2.filter(membership => membership.status === "active")) !== null && _window$Pelcro$user$r !== void 0 ? _window$Pelcro$user$r : [];
|
|
24926
24949
|
}
|
|
24927
24950
|
|
|
24951
|
+
function getMemberShipStatus(status) {
|
|
24952
|
+
return {
|
|
24953
|
+
title: status,
|
|
24954
|
+
textColor: "plc-text-green-700",
|
|
24955
|
+
bgColor: "plc-bg-green-100",
|
|
24956
|
+
icon: /*#__PURE__*/React__default.createElement(SvgCheckMark, null)
|
|
24957
|
+
};
|
|
24958
|
+
}
|
|
24959
|
+
|
|
24928
24960
|
const SUB_MENUS = {
|
|
24929
24961
|
PROFILE: "profile",
|
|
24930
24962
|
SUBSCRIPTIONS: "subscriptions",
|
|
@@ -27689,7 +27721,7 @@ function VerifyLinkTokenModal({
|
|
|
27689
27721
|
|
|
27690
27722
|
(_props$onSuccess = props.onSuccess) === null || _props$onSuccess === void 0 ? void 0 : _props$onSuccess.call(props, res);
|
|
27691
27723
|
resetView();
|
|
27692
|
-
notify
|
|
27724
|
+
notify.success(t("messages.success"));
|
|
27693
27725
|
};
|
|
27694
27726
|
|
|
27695
27727
|
return /*#__PURE__*/React__default.createElement(Modal, {
|
|
@@ -27933,4 +27965,4 @@ const InvoiceDetailsModal = ({
|
|
|
27933
27965
|
};
|
|
27934
27966
|
InvoiceDetailsModal.viewId = "invoice-details";
|
|
27935
27967
|
|
|
27936
|
-
export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplyCouponButton, Auth0LoginButton, Badge, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, Email, EmailVerifyContainer, EmailVerifyModal, EmailVerifyResendButton, EmailVerifyView, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, Input, InvoiceDetailsContainer, InvoiceDetailsDownloadButton, InvoiceDetailsModal, InvoiceDetailsPayButton, InvoiceDetailsView, InvoicePaymentContainer, InvoicePaymentModal, InvoicePaymentView, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginRequestLoginToken, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PasswordlessRequestContainer, PasswordlessRequestEmail, PasswordlessRequestModal, PasswordlessRequestView, PasswordlessRequestViewButton, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCancelModal, SubscriptionCreateContainer, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, TaxAmount, TextArea, Tooltip, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateView, VerifyLinkTokenContainer, VerifyLinkTokenLoader, VerifyLinkTokenModal, VerifyLinkTokenView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, invoicePaymentSubmitButton, notify
|
|
27968
|
+
export { AddressCreateCity, AddressCreateContainer, AddressCreateCountrySelect, AddressCreateFirstName, AddressCreateLastName, AddressCreateLine1, AddressCreateLine2, AddressCreateModal, AddressCreatePostalCode, AddressCreateSetDefault, AddressCreateStateSelect, AddressCreateSubmit, AddressCreateTextInput, AddressCreateView, AddressSelectContainer, AddressSelectList, AddressSelectModal, AddressSelectSubmit, AddressSelectView, AddressUpdateCity, AddressUpdateContainer, AddressUpdateCountrySelect, AddressUpdateFirstName, AddressUpdateLastName, AddressUpdateLine1, AddressUpdateLine2, AddressUpdateModal, AddressUpdatePostalCode, AddressUpdateSetDefault, AddressUpdateStateSelect, AddressUpdateSubmit, AddressUpdateTextInput, AddressUpdateView, AlertWithContext as Alert, Alert as AlertElement, ApplyCouponButton, Auth0LoginButton, Badge, BankRedirection, Button, CartContainer, CartModal, CartRemoveItemButton, CartSubmit, CartTotalPrice, CartView, Checkbox, CheckoutForm, ConfirmPassword, CouponCode, CouponCodeField, DashboardWithHook as Dashboard, DashboardOpenButton, DatePicker, DiscountedPrice, Email, EmailVerifyContainer, EmailVerifyModal, EmailVerifyResendButton, EmailVerifyView, FacebookLoginButton, GiftCreateContainer, GiftCreateEmail, GiftCreateFirstName, GiftCreateLastName, GiftCreateMessage, GiftCreateModal, GiftCreateStartDate, GiftCreateSubmitButton, GiftCreateView, GiftRedeemCode, GiftRedeemContainer, GiftRedeemModal, GiftRedeemSubmitButton, GiftRedeemView, GoogleLoginButton, Input, InvoiceDetailsContainer, InvoiceDetailsDownloadButton, InvoiceDetailsModal, InvoiceDetailsPayButton, InvoiceDetailsView, InvoicePaymentContainer, InvoicePaymentModal, InvoicePaymentView, Link, LoginButton, LoginContainer, LoginEmail, LoginModal, LoginPassword, LoginRequestLoginToken, LoginView, Logout, MeterModal, MeterView, Modal, ModalBody, ModalFooter, NewsletterWithHook as NewsLetter, NewsletterUpdateButton, NewsletterUpdateContainer, NewsletterUpdateList, NewsletterUpdateModal, NewsletterUpdateView, Notification, OrderConfirmModal, OrderCreateContainer, OrderCreateModal, OrderCreateSubmitButton, OrderCreateView, Password, PasswordChangeButton, PasswordChangeConfirmNewPassword, PasswordChangeContainer, PasswordChangeCurrentPassword, PasswordChangeModal, PasswordChangeNewPassword, PasswordChangeView, PasswordForgotButton, PasswordForgotContainer, PasswordForgotEmail, PasswordForgotModal, PasswordForgotView, PasswordResetButton, PasswordResetConfirmPassword, PasswordResetContainer, PasswordResetEmail, PasswordResetModal, PasswordResetPassword, PasswordResetView, PasswordlessRequestContainer, PasswordlessRequestEmail, PasswordlessRequestModal, PasswordlessRequestView, PasswordlessRequestViewButton, PaymentCreateContainer, PaymentCreateView, PaymentMethodContainer, PaymentMethodSelectContainer, PaymentMethodSelectList, PaymentMethodSelectModal, PaymentMethodSelectSubmit, PaymentMethodSelectView, PaymentMethodUpdateContainer, PaymentMethodUpdateModal, PaymentMethodUpdateView, PaymentMethodView, PaymentSuccessModal, PaymentSuccessView, PaypalSubscribeButton, PelcroCardCVC, PelcroCardExpiry, PelcroCardNumber, PelcroModalController, PelcroPaymentRequestButton, ProfilePicChangeButton, ProfilePicChangeContainer, ProfilePicChangeCropper, ProfilePicChangeModal, ProfilePicChangeRemoveButton, ProfilePicChangeSelectButton, ProfilePicChangeView, ProfilePicChangeZoom, Radio, RegisterButton, RegisterCompany, RegisterContainer, RegisterEmail, RegisterFirstName, RegisterJobTitle, RegisterLastName, RegisterModal, RegisterPassword, RegisterView, Select, SelectModalWithHook as SelectModal, SelectedPaymentMethod, ShopPurchaseButton, ShopSelectProductButton, ShopView, SubmitPaymentMethod, SubscriptionCancelModal, SubscriptionCreateContainer, SubscriptionCreateModal, SubscriptionCreateView, SubscriptionRenewContainer, SubscriptionRenewModal, SubscriptionRenewView, TaxAmount, TextArea, Tooltip, UserUpdateButton, UserUpdateContainer, UserUpdateDisplayName, UserUpdateEmail, UserUpdateFirstName, UserUpdateLastName, UserUpdateModal, UserUpdatePhone, UserUpdateProfilePic, UserUpdateTextInput, UserUpdateView, VerifyLinkTokenContainer, VerifyLinkTokenLoader, VerifyLinkTokenModal, VerifyLinkTokenView, authenticatedButtons, i18next as i18n, init$1 as initButtons, init as initContentEntitlement, invoicePaymentSubmitButton, notify, unauthenticatedButtons, usePelcro };
|