@newskit-render/my-account 7.151.3-351f40919.8 → 7.153.0
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/cjs/Components/Elements/ForwardButton/ForwardButton.d.ts +1 -1
- package/dist/cjs/Components/Elements/ForwardButton/ForwardButton.js +1 -1
- package/dist/cjs/Components/Elements/ForwardButton/ForwardButton.js.map +1 -1
- package/dist/cjs/Components/Elements/TimesLoading/TimesLoading.d.ts +1 -2
- package/dist/cjs/Components/Elements/TimesLoading/TimesLoading.js +3 -28
- package/dist/cjs/Components/Elements/TimesLoading/TimesLoading.js.map +1 -1
- package/dist/cjs/Components/Sections/CancelSubscription/CancelSubscription.d.ts +1 -1
- package/dist/cjs/Components/Sections/CancelSubscription/CancelSubscription.js +11 -17
- package/dist/cjs/Components/Sections/CancelSubscription/CancelSubscription.js.map +1 -1
- package/dist/cjs/Components/Sections/CancelSubscription/types.d.ts +2 -0
- package/dist/cjs/Components/Sections/CancelSubscriptionDowngrade/CancelSubscriptionDowngrade.d.ts +2 -2
- package/dist/cjs/Components/Sections/CancellationDetails/types.d.ts +2 -2
- package/dist/cjs/Components/Sections/CancellationOffers/CancellationOffers.d.ts +1 -1
- package/dist/cjs/Components/Sections/CancellationOffers/CancellationOffers.js +13 -54
- package/dist/cjs/Components/Sections/CancellationOffers/CancellationOffers.js.map +1 -1
- package/dist/cjs/Components/Sections/CancellationOffers/types.d.ts +4 -29
- package/dist/cjs/Components/Sections/CancellationReasons/CancellationReasons.d.ts +2 -1
- package/dist/cjs/Components/Sections/CancellationReasons/CancellationReasons.js +15 -3
- package/dist/cjs/Components/Sections/CancellationReasons/CancellationReasons.js.map +1 -1
- package/dist/cjs/Components/Sections/ContactSupport/ContactSupport.d.ts +2 -0
- package/dist/cjs/Components/Sections/ContactSupport/ContactSupport.js +43 -0
- package/dist/cjs/Components/Sections/ContactSupport/ContactSupport.js.map +1 -0
- package/dist/cjs/Components/Sections/ContactSupport/index.d.ts +2 -0
- package/dist/cjs/Components/Sections/ContactSupport/index.js +19 -0
- package/dist/cjs/Components/Sections/ContactSupport/index.js.map +1 -0
- package/dist/cjs/Components/Sections/ContactSupport/types.d.ts +21 -0
- package/dist/cjs/Components/Sections/ContactSupport/types.js +3 -0
- package/dist/cjs/Components/Sections/ContactSupport/types.js.map +1 -0
- package/dist/cjs/Components/Sections/ContentContainer/ContentContainer.js +1 -6
- package/dist/cjs/Components/Sections/ContentContainer/ContentContainer.js.map +1 -1
- package/dist/cjs/Components/Sections/SectionContainer/types.d.ts +2 -2
- package/dist/cjs/Components/Sections/UserHub/SubscriptionDetailsSection.d.ts +1 -1
- package/dist/cjs/Components/Sections/UserHub/SubscriptionDetailsSection.js +7 -24
- package/dist/cjs/Components/Sections/UserHub/SubscriptionDetailsSection.js.map +1 -1
- package/dist/cjs/Components/Templates/CancellationStepperRender.d.ts +5 -4
- package/dist/cjs/Components/Templates/CancellationStepperRender.js +13 -11
- package/dist/cjs/Components/Templates/CancellationStepperRender.js.map +1 -1
- package/dist/cjs/Components/Templates/LayoutTemplate.js +29 -1
- package/dist/cjs/Components/Templates/LayoutTemplate.js.map +1 -1
- package/dist/cjs/Components/Templates/SubscriptionAndBillingRender.js +16 -2
- package/dist/cjs/Components/Templates/SubscriptionAndBillingRender.js.map +1 -1
- package/dist/cjs/Components/index.d.ts +1 -0
- package/dist/cjs/api/queryHandler.js +13 -24
- package/dist/cjs/api/queryHandler.js.map +1 -1
- package/dist/cjs/context/types.d.ts +4 -9
- package/dist/cjs/context/types.js.map +1 -1
- package/dist/cjs/helpers/cancellationUtils.d.ts +0 -19
- package/dist/cjs/helpers/cancellationUtils.js +1 -65
- package/dist/cjs/helpers/cancellationUtils.js.map +1 -1
- package/dist/cjs/helpers/dmccVariant.d.ts +2 -0
- package/dist/cjs/helpers/dmccVariant.js +81 -0
- package/dist/cjs/helpers/dmccVariant.js.map +1 -0
- package/dist/cjs/helpers/getQuery.js +3 -2
- package/dist/cjs/helpers/getQuery.js.map +1 -1
- package/dist/cjs/helpers/index.d.ts +1 -1
- package/dist/cjs/helpers/index.js +3 -1
- package/dist/cjs/helpers/index.js.map +1 -1
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/pages/CancellationStepper/CancellationStepperContext.js +63 -57
- package/dist/cjs/pages/CancellationStepper/CancellationStepperContext.js.map +1 -1
- package/dist/cjs/pages/SubscriptionAndBilling/Sections/CancelSubscriptionSectionContext.js +3 -0
- package/dist/cjs/pages/SubscriptionAndBilling/Sections/CancelSubscriptionSectionContext.js.map +1 -1
- package/dist/cjs/pages/UserHub/UserHubContext.js +1 -0
- package/dist/cjs/pages/UserHub/UserHubContext.js.map +1 -1
- package/dist/cjs/queries/index.d.ts +0 -1
- package/dist/cjs/queries/index.js +0 -1
- package/dist/cjs/queries/index.js.map +1 -1
- package/dist/esm/Components/Elements/ForwardButton/ForwardButton.d.ts +1 -1
- package/dist/esm/Components/Elements/ForwardButton/ForwardButton.js +1 -1
- package/dist/esm/Components/Elements/ForwardButton/ForwardButton.js.map +1 -1
- package/dist/esm/Components/Elements/TimesLoading/TimesLoading.d.ts +1 -2
- package/dist/esm/Components/Elements/TimesLoading/TimesLoading.js +3 -28
- package/dist/esm/Components/Elements/TimesLoading/TimesLoading.js.map +1 -1
- package/dist/esm/Components/Sections/CancelSubscription/CancelSubscription.d.ts +1 -1
- package/dist/esm/Components/Sections/CancelSubscription/CancelSubscription.js +11 -17
- package/dist/esm/Components/Sections/CancelSubscription/CancelSubscription.js.map +1 -1
- package/dist/esm/Components/Sections/CancelSubscription/types.d.ts +2 -0
- package/dist/esm/Components/Sections/CancelSubscriptionDowngrade/CancelSubscriptionDowngrade.d.ts +2 -2
- package/dist/esm/Components/Sections/CancellationDetails/types.d.ts +2 -2
- package/dist/esm/Components/Sections/CancellationOffers/CancellationOffers.d.ts +1 -1
- package/dist/esm/Components/Sections/CancellationOffers/CancellationOffers.js +13 -54
- package/dist/esm/Components/Sections/CancellationOffers/CancellationOffers.js.map +1 -1
- package/dist/esm/Components/Sections/CancellationOffers/types.d.ts +4 -29
- package/dist/esm/Components/Sections/CancellationReasons/CancellationReasons.d.ts +2 -1
- package/dist/esm/Components/Sections/CancellationReasons/CancellationReasons.js +13 -2
- package/dist/esm/Components/Sections/CancellationReasons/CancellationReasons.js.map +1 -1
- package/dist/esm/Components/Sections/ContactSupport/ContactSupport.d.ts +2 -0
- package/dist/esm/Components/Sections/ContactSupport/ContactSupport.js +36 -0
- package/dist/esm/Components/Sections/ContactSupport/ContactSupport.js.map +1 -0
- package/dist/esm/Components/Sections/ContactSupport/index.d.ts +2 -0
- package/dist/esm/Components/Sections/ContactSupport/index.js +3 -0
- package/dist/esm/Components/Sections/ContactSupport/index.js.map +1 -0
- package/dist/esm/Components/Sections/ContactSupport/types.d.ts +21 -0
- package/dist/esm/Components/Sections/ContactSupport/types.js +2 -0
- package/dist/esm/Components/Sections/ContactSupport/types.js.map +1 -0
- package/dist/esm/Components/Sections/ContentContainer/ContentContainer.js +1 -6
- package/dist/esm/Components/Sections/ContentContainer/ContentContainer.js.map +1 -1
- package/dist/esm/Components/Sections/SectionContainer/types.d.ts +2 -2
- package/dist/esm/Components/Sections/UserHub/SubscriptionDetailsSection.d.ts +1 -1
- package/dist/esm/Components/Sections/UserHub/SubscriptionDetailsSection.js +9 -26
- package/dist/esm/Components/Sections/UserHub/SubscriptionDetailsSection.js.map +1 -1
- package/dist/esm/Components/Templates/CancellationStepperRender.d.ts +5 -4
- package/dist/esm/Components/Templates/CancellationStepperRender.js +13 -11
- package/dist/esm/Components/Templates/CancellationStepperRender.js.map +1 -1
- package/dist/esm/Components/Templates/LayoutTemplate.js +6 -1
- package/dist/esm/Components/Templates/LayoutTemplate.js.map +1 -1
- package/dist/esm/Components/Templates/SubscriptionAndBillingRender.js +16 -2
- package/dist/esm/Components/Templates/SubscriptionAndBillingRender.js.map +1 -1
- package/dist/esm/Components/index.d.ts +1 -0
- package/dist/esm/api/queryHandler.js +13 -24
- package/dist/esm/api/queryHandler.js.map +1 -1
- package/dist/esm/context/types.d.ts +4 -9
- package/dist/esm/context/types.js.map +1 -1
- package/dist/esm/helpers/cancellationUtils.d.ts +0 -19
- package/dist/esm/helpers/cancellationUtils.js +0 -62
- package/dist/esm/helpers/cancellationUtils.js.map +1 -1
- package/dist/esm/helpers/dmccVariant.d.ts +2 -0
- package/dist/esm/helpers/dmccVariant.js +76 -0
- package/dist/esm/helpers/dmccVariant.js.map +1 -0
- package/dist/esm/helpers/getQuery.js +4 -3
- package/dist/esm/helpers/getQuery.js.map +1 -1
- package/dist/esm/helpers/index.d.ts +1 -1
- package/dist/esm/helpers/index.js +3 -1
- package/dist/esm/helpers/index.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/pages/CancellationStepper/CancellationStepperContext.js +64 -58
- package/dist/esm/pages/CancellationStepper/CancellationStepperContext.js.map +1 -1
- package/dist/esm/pages/SubscriptionAndBilling/Sections/CancelSubscriptionSectionContext.js +3 -0
- package/dist/esm/pages/SubscriptionAndBilling/Sections/CancelSubscriptionSectionContext.js.map +1 -1
- package/dist/esm/pages/UserHub/UserHubContext.js +1 -0
- package/dist/esm/pages/UserHub/UserHubContext.js.map +1 -1
- package/dist/esm/queries/index.d.ts +0 -1
- package/dist/esm/queries/index.js +0 -1
- package/dist/esm/queries/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/cjs/Components/Sections/OfferPreview/OfferPreview.d.ts +0 -22
- package/dist/cjs/Components/Sections/OfferPreview/OfferPreview.js +0 -163
- package/dist/cjs/Components/Sections/OfferPreview/OfferPreview.js.map +0 -1
- package/dist/cjs/Components/Sections/OfferPreview/OfferSummary.d.ts +0 -21
- package/dist/cjs/Components/Sections/OfferPreview/OfferSummary.js +0 -95
- package/dist/cjs/Components/Sections/OfferPreview/OfferSummary.js.map +0 -1
- package/dist/cjs/Components/Sections/OfferPreview/SummaryRow.d.ts +0 -9
- package/dist/cjs/Components/Sections/OfferPreview/SummaryRow.js +0 -38
- package/dist/cjs/Components/Sections/OfferPreview/SummaryRow.js.map +0 -1
- package/dist/cjs/Components/Sections/OfferPreview/index.d.ts +0 -0
- package/dist/cjs/Components/Sections/OfferPreview/index.js +0 -2
- package/dist/cjs/Components/Sections/OfferPreview/index.js.map +0 -1
- package/dist/cjs/Components/Sections/OfferPreview/types.d.ts +0 -0
- package/dist/cjs/Components/Sections/OfferPreview/types.js +0 -2
- package/dist/cjs/Components/Sections/OfferPreview/types.js.map +0 -1
- package/dist/cjs/helpers/stringUtils.d.ts +0 -1
- package/dist/cjs/helpers/stringUtils.js +0 -9
- package/dist/cjs/helpers/stringUtils.js.map +0 -1
- package/dist/cjs/queries/getIncentivePreview.d.ts +0 -2
- package/dist/cjs/queries/getIncentivePreview.js +0 -11
- package/dist/cjs/queries/getIncentivePreview.js.map +0 -1
- package/dist/esm/Components/Sections/OfferPreview/OfferPreview.d.ts +0 -22
- package/dist/esm/Components/Sections/OfferPreview/OfferPreview.js +0 -133
- package/dist/esm/Components/Sections/OfferPreview/OfferPreview.js.map +0 -1
- package/dist/esm/Components/Sections/OfferPreview/OfferSummary.d.ts +0 -21
- package/dist/esm/Components/Sections/OfferPreview/OfferSummary.js +0 -88
- package/dist/esm/Components/Sections/OfferPreview/OfferSummary.js.map +0 -1
- package/dist/esm/Components/Sections/OfferPreview/SummaryRow.d.ts +0 -9
- package/dist/esm/Components/Sections/OfferPreview/SummaryRow.js +0 -31
- package/dist/esm/Components/Sections/OfferPreview/SummaryRow.js.map +0 -1
- package/dist/esm/Components/Sections/OfferPreview/index.d.ts +0 -0
- package/dist/esm/Components/Sections/OfferPreview/index.js +0 -2
- package/dist/esm/Components/Sections/OfferPreview/index.js.map +0 -1
- package/dist/esm/Components/Sections/OfferPreview/types.d.ts +0 -0
- package/dist/esm/Components/Sections/OfferPreview/types.js +0 -2
- package/dist/esm/Components/Sections/OfferPreview/types.js.map +0 -1
- package/dist/esm/helpers/stringUtils.d.ts +0 -1
- package/dist/esm/helpers/stringUtils.js +0 -5
- package/dist/esm/helpers/stringUtils.js.map +0 -1
- package/dist/esm/queries/getIncentivePreview.d.ts +0 -2
- package/dist/esm/queries/getIncentivePreview.js +0 -8
- package/dist/esm/queries/getIncentivePreview.js.map +0 -1
|
@@ -2,7 +2,7 @@ import { InfoPanel, IntroductionProps, ModalProps, ListItemType, InvoiceAndNotic
|
|
|
2
2
|
import { StandaloneLinkPropsOverridable } from '../../Elements/StandaloneLinkComponent';
|
|
3
3
|
import { MQ, ImageProps } from 'newskit';
|
|
4
4
|
import { NewslettersGridOverrides, CancellationItem, CancellationSection } from '../../../context/types';
|
|
5
|
-
import { HandleCardClick,
|
|
5
|
+
import { HandleCardClick, StepController } from '../../Templates/CancellationStepperRender';
|
|
6
6
|
import { UserData } from '../../../pages/types';
|
|
7
7
|
export type BelowContentExtra = {
|
|
8
8
|
type: 'delivery-address' | 'cancel-subscription' | 'no-billing' | 'payment-history' | 'leave-family';
|
|
@@ -34,7 +34,7 @@ export interface BaseSectionProps extends CancellationSection, CancellationItem
|
|
|
34
34
|
}
|
|
35
35
|
export interface GridSectionProps extends CancellationSection {
|
|
36
36
|
baseUrl?: string;
|
|
37
|
-
onNextStep:
|
|
37
|
+
onNextStep: StepController;
|
|
38
38
|
handleCardClick: HandleCardClick;
|
|
39
39
|
eventContext?: EventContext;
|
|
40
40
|
user?: UserData;
|
|
@@ -3,4 +3,4 @@ import { UserData } from '../../../pages/types';
|
|
|
3
3
|
export interface SubscriptionDetailsSectionProps extends UserHubSubscriptionDetailsSection {
|
|
4
4
|
user?: UserData;
|
|
5
5
|
}
|
|
6
|
-
export declare const SubscriptionDetailsSection: ({ header, containerOverrides, benefits, cancelSubscription,
|
|
6
|
+
export declare const SubscriptionDetailsSection: ({ header, containerOverrides, benefits, cancelSubscription, user, }: SubscriptionDetailsSectionProps) => JSX.Element;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
|
|
3
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
4
|
-
return cooked;
|
|
5
|
-
};
|
|
6
2
|
var __assign = (this && this.__assign) || function () {
|
|
7
3
|
__assign = Object.assign || function(t) {
|
|
8
4
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
@@ -25,25 +21,14 @@ var shared_components_1 = require("@newskit-render/shared-components");
|
|
|
25
21
|
var SectionListItem_1 = require("../../Elements/SectionListItem");
|
|
26
22
|
var BaseSection_1 = require("./BaseSection");
|
|
27
23
|
var shared_components_2 = require("@newskit-render/shared-components");
|
|
28
|
-
var hooks_1 = require("../../../hooks");
|
|
29
|
-
var CancelSubscriptionModal_1 = require("../../Elements/CancelSubscriptionModal");
|
|
30
24
|
var constants_1 = require("../../../constants");
|
|
31
|
-
var StyledSectionListItem = (0, newskit_1.styled)(SectionListItem_1.SectionListItem)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n &:hover,\n &:focus,\n &:active {\n ", "\n cursor: pointer;\n }\n"], ["\n &:hover,\n &:focus,\n &:active {\n ", "\n cursor: pointer;\n }\n"])), (0, newskit_1.getColorCssFromTheme)('backgroundColor', 'interface020'));
|
|
32
25
|
var SubscriptionDetailsSection = function (_a) {
|
|
33
|
-
var _b, _c, _d, _e, _f, _g
|
|
34
|
-
var header = _a.header, containerOverrides = _a.containerOverrides, benefits = _a.benefits, cancelSubscription = _a.cancelSubscription,
|
|
35
|
-
var
|
|
36
|
-
var
|
|
37
|
-
var handleCancelSubscriptionClick = function () {
|
|
38
|
-
setModalOpen(true);
|
|
39
|
-
if (cancelSubscription === null || cancelSubscription === void 0 ? void 0 : cancelSubscription.eventContext) {
|
|
40
|
-
fireEvent((0, shared_components_1.createClickEvent)(__assign({ originator: 'button', text: cancelSubscription.eventContext.event_navigation_name, page_name: cancelSubscription.eventContext.page_name }, cancelSubscription.eventContext)));
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
var price = (_d = (_c = user === null || user === void 0 ? void 0 : user.subscriptions) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.price;
|
|
44
|
-
var currency = (_f = (_e = user === null || user === void 0 ? void 0 : user.subscriptions) === null || _e === void 0 ? void 0 : _e[0]) === null || _f === void 0 ? void 0 : _f.currency;
|
|
26
|
+
var _b, _c, _d, _e, _f, _g;
|
|
27
|
+
var header = _a.header, containerOverrides = _a.containerOverrides, benefits = _a.benefits, cancelSubscription = _a.cancelSubscription, user = _a.user;
|
|
28
|
+
var price = (_c = (_b = user === null || user === void 0 ? void 0 : user.subscriptions) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.price;
|
|
29
|
+
var currency = (_e = (_d = user === null || user === void 0 ? void 0 : user.subscriptions) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.currency;
|
|
45
30
|
var itemsToRender = [
|
|
46
|
-
react_1.default.createElement(SectionListItem_1.SectionListItem, { key: "type", title: "Type", subtitle: ((
|
|
31
|
+
react_1.default.createElement(SectionListItem_1.SectionListItem, { key: "type", title: "Type", subtitle: ((_g = (_f = user === null || user === void 0 ? void 0 : user.subscriptions) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.type) || '', containerOverrides: containerOverrides }),
|
|
47
32
|
react_1.default.createElement(SectionListItem_1.SectionListItem, { key: "price", title: "Price", subtitle: price && currency ? "".concat(constants_1.CURRENCY_MAP[currency]).concat(price) : '', containerOverrides: containerOverrides }),
|
|
48
33
|
];
|
|
49
34
|
if ((benefits === null || benefits === void 0 ? void 0 : benefits.showBenefits) && (benefits === null || benefits === void 0 ? void 0 : benefits.items) && benefits.items.length > 0) {
|
|
@@ -59,13 +44,11 @@ var SubscriptionDetailsSection = function (_a) {
|
|
|
59
44
|
}))));
|
|
60
45
|
}
|
|
61
46
|
if (cancelSubscription) {
|
|
62
|
-
itemsToRender.push(react_1.default.createElement(
|
|
47
|
+
itemsToRender.push(react_1.default.createElement(SectionListItem_1.SectionListItem, __assign({ key: "cancel-subscription" }, cancelSubscription, { containerOverrides: containerOverrides })));
|
|
63
48
|
}
|
|
64
49
|
return (react_1.default.createElement(newskit_1.Stack, { flow: "vertical-stretch", "data-testid": "subscription-details-section" },
|
|
65
50
|
react_1.default.createElement(shared_components_1.Header, __assign({}, header)),
|
|
66
|
-
react_1.default.createElement(BaseSection_1.StyledStructuredList, { divider: true }, itemsToRender)
|
|
67
|
-
cancelSubscriptionModal && (react_1.default.createElement(CancelSubscriptionModal_1.CancelSubscriptionModal, { isOpen: modalOpen, onDismissModal: onDismissModal, modal: cancelSubscriptionModal, cpn: user === null || user === void 0 ? void 0 : user.cpn, subscriptions: user === null || user === void 0 ? void 0 : user.subscriptions }))));
|
|
51
|
+
react_1.default.createElement(BaseSection_1.StyledStructuredList, { divider: true }, itemsToRender)));
|
|
68
52
|
};
|
|
69
53
|
exports.SubscriptionDetailsSection = SubscriptionDetailsSection;
|
|
70
|
-
var templateObject_1;
|
|
71
54
|
//# sourceMappingURL=SubscriptionDetailsSection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriptionDetailsSection.js","sourceRoot":"","sources":["../../../../../src/Components/Sections/UserHub/SubscriptionDetailsSection.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SubscriptionDetailsSection.js","sourceRoot":"","sources":["../../../../../src/Components/Sections/UserHub/SubscriptionDetailsSection.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,gDAAyB;AACzB,mCAAsC;AACtC,uEAA0D;AAC1D,kEAAgE;AAChE,6CAAoD;AACpD,uEAAoE;AAGpE,gDAAiD;AAO1C,IAAM,0BAA0B,GAAG,UAAC,EAMT;;QALhC,MAAM,YAAA,EACN,kBAAkB,wBAAA,EAClB,QAAQ,cAAA,EACR,kBAAkB,wBAAA,EAClB,IAAI,UAAA;IAEJ,IAAM,KA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CAAC,KAAK,0CAAE,MAAO,IAAG,CAAC,CAAA;gBAExD,OAAO,CACL,8BAAC,oCAAgB,aACf,GAAG,EAAE,OAAO,CAAC,IAAI,IACb,OAAO,IACX,kBAAkB,EAAE;wBAClB,eAAe,EAAE,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU;qBACtD,IACD,CACH,CAAA;YACH,CAAC,CAAC,CACI,CACQ,CACnB,CAAA;IACH,CAAC;IAED,IAAI,kBAAkB,EAAE,CAAC;QACvB,aAAa,CAAC,IAAI,CAChB,8BAAC,iCAAe,aACd,GAAG,EAAC,qBAAqB,IACrB,kBAAkB,IACtB,kBAAkB,EAAE,kBAAkB,IACtC,CACH,CAAA;IACH,CAAC;IAED,OAAO,CACL,8BAAC,eAAK,IAAC,IAAI,EAAC,kBAAkB,iBAAa,8BAA8B;QACvE,8BAAC,0BAAM,eAAK,MAAM,EAAI;QAEtB,8BAAC,kCAAoB,IAAC,OAAO,EAAE,IAAI,IAChC,aAAa,CACO,CACjB,CACT,CAAA;AACH,CAAC,CAAA;AAzEY,QAAA,0BAA0B,8BAyEtC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { EventContext } from '@newskit-render/shared-components';
|
|
3
3
|
export declare const componentMap: {
|
|
4
|
-
reason: ({ belowItemExtra, onNextStep, handleCardClick, ...props }: import("../Sections/SectionContainer").GridSectionProps) => JSX.Element;
|
|
4
|
+
reason: ({ belowItemExtra, onNextStep, handleCardClick, items, ...props }: import("../Sections/SectionContainer").GridSectionProps) => JSX.Element;
|
|
5
5
|
downgrade: React.FC<import("../Sections/CancelSubscriptionDowngrade/CancelSubscriptionDowngrade").CancelSubscriptionDowngradeProps>;
|
|
6
6
|
preCancellation: ({ header, containerOverrides, user, subscriptionName, subscriptionEnd, selectedReason, defaultCancellationReason, dividerOverrides, continueButton, genericErrorMessage, setServiceCancellationDate, handleError, onNextStep, }: import("../Sections/CancellationDetails").CancellationDetailsProps) => JSX.Element;
|
|
7
7
|
confirmCancel: ({ featureFlags, ...rest }: import("../Sections/ConfirmCancellation").ConfirmCancellationStepProps) => React.CElement<{
|
|
@@ -59,16 +59,17 @@ export declare const componentMap: {
|
|
|
59
59
|
};
|
|
60
60
|
};
|
|
61
61
|
}, any, any>>;
|
|
62
|
-
offers: ({ baseUrl, header, offersSection, benefits, continueButton, continueButtonContainerOverrides,
|
|
62
|
+
offers: ({ baseUrl, header, offersSection, benefits, continueButton, continueButtonContainerOverrides, selectedOffer, onSelectOffer, onNextStep, }: import("../Sections/CancellationOffers").CancellationOffersProps) => JSX.Element;
|
|
63
|
+
discountPreview: React.FC<import("../Sections/SectionContainer").GridSectionProps>;
|
|
63
64
|
offerConfirmation: ({ header, user, subscriptionDetails, buttonText, buttonEventContext, buttonUrl, baseUrl, buttonOverrides, }: import("../Sections/ConfirmSubscriptionOffer").ConfirmSubscriptionOfferProps) => JSX.Element | null;
|
|
64
|
-
|
|
65
|
+
contactSupport: ({ header, contactMethods, continueButton, continueButtonContainerOverrides, onNextStep, }: import("../Sections/ContactSupport").ContactSupportProps) => JSX.Element;
|
|
65
66
|
};
|
|
66
67
|
export type SelectionData = {
|
|
67
68
|
id: string;
|
|
68
69
|
label?: string;
|
|
69
70
|
eventContext?: EventContext;
|
|
70
71
|
};
|
|
71
|
-
export type
|
|
72
|
+
export type StepController = (event: React.MouseEvent, override?: string | null, eventContext?: Record<string, string>) => void;
|
|
72
73
|
export type HandleCardClick = (event: React.MouseEvent, selectionData: SelectionData) => void;
|
|
73
74
|
declare const CancellationStepperRender: React.FC;
|
|
74
75
|
export default CancellationStepperRender;
|
|
@@ -44,19 +44,21 @@ var CancellationReasons_1 = require("../Sections/CancellationReasons");
|
|
|
44
44
|
var CancellationDetails_1 = require("../Sections/CancellationDetails");
|
|
45
45
|
var helpers_1 = require("../../helpers");
|
|
46
46
|
var CancelSubscriptionDowngrade_1 = require("../Sections/CancelSubscriptionDowngrade");
|
|
47
|
+
var CancellationOffers_1 = require("../Sections/CancellationOffers");
|
|
48
|
+
var ContactSupport_1 = require("../Sections/ContactSupport");
|
|
47
49
|
var newskit_1 = require("newskit");
|
|
50
|
+
var SectionContainer_1 = require("../Sections/SectionContainer");
|
|
48
51
|
var ConfirmCancellation_1 = require("../Sections/ConfirmCancellation");
|
|
49
52
|
var ConfirmSubscriptionOffer_1 = require("../Sections/ConfirmSubscriptionOffer");
|
|
50
|
-
var CancellationOffers_1 = require("../Sections/CancellationOffers");
|
|
51
|
-
var OfferPreview_1 = require("../Sections/OfferPreview/OfferPreview");
|
|
52
53
|
exports.componentMap = {
|
|
53
54
|
reason: CancellationReasons_1.CancellationReasons,
|
|
54
55
|
downgrade: CancelSubscriptionDowngrade_1.CancelSubscriptionDowngrade,
|
|
55
56
|
preCancellation: CancellationDetails_1.CancellationDetails,
|
|
56
57
|
confirmCancel: ConfirmCancellation_1.ConfirmCancellationRender,
|
|
57
58
|
offers: CancellationOffers_1.CancellationOffers,
|
|
59
|
+
discountPreview: SectionContainer_1.GridSection,
|
|
58
60
|
offerConfirmation: ConfirmSubscriptionOffer_1.ConfirmSubscriptionOffer,
|
|
59
|
-
|
|
61
|
+
contactSupport: ContactSupport_1.ContactSupport,
|
|
60
62
|
};
|
|
61
63
|
var CancellationStepperRender = function () {
|
|
62
64
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
@@ -70,17 +72,13 @@ var CancellationStepperRender = function () {
|
|
|
70
72
|
if (!type || !componentSequence[type])
|
|
71
73
|
return null;
|
|
72
74
|
var _l = (0, react_1.useState)(null), selections = _l[0], setSelections = _l[1];
|
|
73
|
-
var pagesInOrder = [
|
|
74
|
-
'reason',
|
|
75
|
-
'downgrade',
|
|
76
|
-
'preCancellation',
|
|
77
|
-
'confirmCancel',
|
|
78
|
-
];
|
|
75
|
+
var pagesInOrder = componentSequence[type];
|
|
79
76
|
var _m = (0, react_1.useState)(null), overrideComponent = _m[0], setOverrideComponent = _m[1];
|
|
80
77
|
var _o = (0, react_1.useState)([]), filteredPages = _o[0], setFilteredPages = _o[1];
|
|
81
78
|
var _p = (0, react_1.useState)(((_e = (_d = userData === null || userData === void 0 ? void 0 : userData.subscriptions) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.serviceCancellationDate) || null), serviceCancellationDate = _p[0], setServiceCancellationDate = _p[1];
|
|
82
79
|
var _q = (0, react_1.useState)(), selectedOffer = _q[0], setSelectedOffer = _q[1];
|
|
83
80
|
var stepFromUrl = searchParams.get('step');
|
|
81
|
+
var returnUrl = searchParams.get('returnUrl');
|
|
84
82
|
var currentStepComponent = overrideComponent || stepFromUrl || pagesInOrder[0];
|
|
85
83
|
var activePages = filteredPages.length > 0 ? filteredPages : pagesInOrder;
|
|
86
84
|
var stepIndex = activePages.findIndex(function (page) { return page === currentStepComponent; });
|
|
@@ -110,6 +108,10 @@ var CancellationStepperRender = function () {
|
|
|
110
108
|
return;
|
|
111
109
|
}
|
|
112
110
|
if (stepIndex <= 0) {
|
|
111
|
+
if (returnUrl) {
|
|
112
|
+
router.push(returnUrl);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
113
115
|
router.push((0, helpers_1.replaceBaseURL)(baseUrl || '', backButtonHref));
|
|
114
116
|
return;
|
|
115
117
|
}
|
|
@@ -158,7 +160,7 @@ var CancellationStepperRender = function () {
|
|
|
158
160
|
// track page view event via Optimizely
|
|
159
161
|
(0, helpers_1.trackEvent)({
|
|
160
162
|
eventName: "cancellation_".concat(stepFromUrl.toLocaleLowerCase()),
|
|
161
|
-
cpn:
|
|
163
|
+
cpn: userData === null || userData === void 0 ? void 0 : userData.cpn,
|
|
162
164
|
subscriptions: (userData === null || userData === void 0 ? void 0 : userData.subscriptions) || [],
|
|
163
165
|
tags: __assign(__assign({}, context), { page_name: context.page_name || "online cancellation: ".concat(stepFromUrl), cancellation_type: ((_b = selections === null || selections === void 0 ? void 0 : selections.eventContext) === null || _b === void 0 ? void 0 : _b.article_parent_name) || '', step: stepFromUrl }),
|
|
164
166
|
});
|
|
@@ -169,7 +171,7 @@ var CancellationStepperRender = function () {
|
|
|
169
171
|
var shouldShowBackButton = (_f = componentProps === null || componentProps === void 0 ? void 0 : componentProps.showBackButton) !== null && _f !== void 0 ? _f : showBackButton;
|
|
170
172
|
return (react_1.default.createElement(shared_components_1.ContentContainer, __assign({ "data-testid": "section-container" }, componentProps === null || componentProps === void 0 ? void 0 : componentProps.contentContainerOverrides),
|
|
171
173
|
shouldShowBackButton && hederBackButtonProps && (react_1.default.createElement(shared_components_1.BackButton, { backButton: __assign(__assign({}, hederBackButtonProps), { href: '' }), backButtonOverrides: header.backButtonOverrides, eventContext: __assign(__assign({}, hederBackButtonProps === null || hederBackButtonProps === void 0 ? void 0 : hederBackButtonProps.eventContext), { page_name: (_g = componentProps === null || componentProps === void 0 ? void 0 : componentProps.tealiumContext) === null || _g === void 0 ? void 0 : _g.context.page_name }), onClick: handleBackBtn })),
|
|
172
|
-
react_1.default.createElement(SectionComponent, __assign({}, componentProps, { baseUrl: baseUrl, onNextStep: stepController, handleCardClick: handleCardClick, user: userData, selectedReason: selections, handleError: handleError, serviceCancellationDate: serviceCancellationDate, setServiceCancellationDate: setServiceCancellationDate, subType: ((_j = (_h = userData === null || userData === void 0 ? void 0 : userData.subscriptions) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.type) || '', selectedOffer: selectedOffer,
|
|
174
|
+
react_1.default.createElement(SectionComponent, __assign({}, componentProps, { baseUrl: baseUrl, onNextStep: stepController, handleCardClick: handleCardClick, user: userData, selectedReason: selections, handleError: handleError, serviceCancellationDate: serviceCancellationDate, setServiceCancellationDate: setServiceCancellationDate, subType: ((_j = (_h = userData === null || userData === void 0 ? void 0 : userData.subscriptions) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.type) || '', selectedOffer: selectedOffer, onSelectOffer: setSelectedOffer, featureFlags: featureFlags }))));
|
|
173
175
|
};
|
|
174
176
|
exports.default = CancellationStepperRender;
|
|
175
177
|
//# sourceMappingURL=CancellationStepperRender.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CancellationStepperRender.js","sourceRoot":"","sources":["../../../../src/Components/Templates/CancellationStepperRender.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA2D;AAC3D,uEAK0C;AAC1C,yCAAiD;AACjD,6CAG4B;AAC5B,8CAA4D;AAC5D,uEAAqE;AACrE,uEAAqE;AACrE,yCAA0D;AAC1D,uFAAqF;AACrF,mCAA0D;AAE1D,uEAA2E;AAC3E,iFAA+E;
|
|
1
|
+
{"version":3,"file":"CancellationStepperRender.js","sourceRoot":"","sources":["../../../../src/Components/Templates/CancellationStepperRender.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA2D;AAC3D,uEAK0C;AAC1C,yCAAiD;AACjD,6CAG4B;AAC5B,8CAA4D;AAC5D,uEAAqE;AACrE,uEAAqE;AACrE,yCAA0D;AAC1D,uFAAqF;AACrF,qEAAmE;AACnE,6DAA2D;AAC3D,mCAA0D;AAC1D,iEAA0D;AAE1D,uEAA2E;AAC3E,iFAA+E;AAElE,QAAA,YAAY,GAAG;IAC1B,MAAM,EAAE,yCAAmB;IAC3B,SAAS,EAAE,yDAA2B;IACtC,eAAe,EAAE,yCAAmB;IACpC,aAAa,EAAE,+CAAyB;IACxC,MAAM,EAAE,uCAAkB;IAC1B,eAAe,EAAE,8BAAW;IAC5B,iBAAiB,EAAE,mDAAwB;IAC3C,cAAc,EAAE,+BAAc;CAC/B,CAAA;AAmBD,IAAM,yBAAyB,GAAa;;IAC1C,IAAM,WAAW,GAAG,mBAAW,CAAC,mBAAmB,CAAA;IAE7C,IAAA,KASF,IAAA,2BAAiB,EAAC,WAAW,CAAsC,EARrE,MAAM,YAAA,EACN,UAAU,gBAAA,EACV,iBAAiB,uBAAA,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,CAAC,CAAC,0CAAE,IAAI,KAAI,EAAE,EACjD,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,gBAAgB,EAC/B,YAAY,EAAE,YAAY,IAC1B,CACe,CACpB,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,yBAAyB,CAAA"}
|
|
@@ -10,6 +10,29 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
13
36
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
37
|
var t = {};
|
|
15
38
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -26,10 +49,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
49
|
};
|
|
27
50
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
51
|
exports.LayoutTemplate = exports.BaseLayoutTemplate = void 0;
|
|
29
|
-
var react_1 =
|
|
52
|
+
var react_1 = __importStar(require("react"));
|
|
30
53
|
var newskit_1 = require("newskit");
|
|
31
54
|
var shared_components_1 = require("@newskit-render/shared-components");
|
|
32
55
|
var context_1 = require("../../context");
|
|
56
|
+
var helpers_1 = require("../../helpers");
|
|
33
57
|
var Head_1 = __importDefault(require("../Elements/Head"));
|
|
34
58
|
var LayoutContentContainer_1 = __importDefault(require("../Sections/LayoutContentContainer"));
|
|
35
59
|
var withMediaQueryProvider = function (Component) {
|
|
@@ -41,6 +65,10 @@ var withMediaQueryProvider = function (Component) {
|
|
|
41
65
|
};
|
|
42
66
|
var BaseLayoutTemplate = function (_a) {
|
|
43
67
|
var customTheme = _a.customTheme, context = _a.context, toastProviderProps = _a.toastProviderProps, contextName = _a.contextName, rest = __rest(_a, ["customTheme", "context", "toastProviderProps", "contextName"]);
|
|
68
|
+
(0, react_1.useEffect)(function () {
|
|
69
|
+
var cleanup = (0, helpers_1.enableDmccVariantOnSpaNavigation)();
|
|
70
|
+
return cleanup;
|
|
71
|
+
}, []);
|
|
44
72
|
return (react_1.default.createElement(context_1.AccountContextProvider, { context: context, contextName: contextName },
|
|
45
73
|
react_1.default.createElement(Head_1.default, { contextName: contextName }),
|
|
46
74
|
react_1.default.createElement(newskit_1.ThemeProvider, { theme: customTheme || shared_components_1.sharedTheme },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutTemplate.js","sourceRoot":"","sources":["../../../../src/Components/Templates/LayoutTemplate.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LayoutTemplate.js","sourceRoot":"","sources":["../../../../src/Components/Templates/LayoutTemplate.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;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65,14 +65,28 @@ var SubscriptionAndBillingRender = function (_a) {
|
|
|
65
65
|
tags: {},
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
}, []);
|
|
69
|
-
(0, react_1.useEffect)(function () {
|
|
70
68
|
if (window.location.hash === '#reminder-notices') {
|
|
71
69
|
var el = document.getElementById('reminder-notices');
|
|
72
70
|
if (el) {
|
|
73
71
|
el.scrollIntoView({ behavior: 'smooth' });
|
|
74
72
|
}
|
|
75
73
|
}
|
|
74
|
+
// Capture dmcc_email_variant query param and store as cookies (1 hour)
|
|
75
|
+
try {
|
|
76
|
+
var dmccParamToCapture = 'dmcc_email_variant';
|
|
77
|
+
var search = window.location.search;
|
|
78
|
+
if (search) {
|
|
79
|
+
var urlParams = new URLSearchParams(search);
|
|
80
|
+
var expires = new Date(Date.now() + 60 * 60 * 1000).toUTCString();
|
|
81
|
+
var val = urlParams.get(dmccParamToCapture);
|
|
82
|
+
if (val) {
|
|
83
|
+
document.cookie = "".concat(encodeURIComponent(dmccParamToCapture), "=").concat(encodeURIComponent(val), "; path=/; expires=").concat(expires, "; SameSite=Lax");
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
catch (_b) {
|
|
88
|
+
// swallow errors to avoid breaking page load
|
|
89
|
+
}
|
|
76
90
|
}, []);
|
|
77
91
|
// For backwards compatibility if multiple subscriptions are enabled by the context (i.e. componentType is cardComposable) then render all of them, otherwise just the first one
|
|
78
92
|
var subscriptions = ((_b = userData === null || userData === void 0 ? void 0 : userData.subscriptions) === null || _b === void 0 ? void 0 : _b.length) > 0
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriptionAndBillingRender.js","sourceRoot":"","sources":["../../../../src/Components/Templates/SubscriptionAndBillingRender.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAiD;AACjD,yCAAiD;AACjD,uBAAoC;AACpC,6DAGmC;AACnC,yCAA0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1
|
+
{"version":3,"file":"SubscriptionAndBillingRender.js","sourceRoot":"","sources":["../../../../src/Components/Templates/SubscriptionAndBillingRender.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAiD;AACjD,yCAAiD;AACjD,uBAAoC;AACpC,6DAGmC;AACnC,yCAA0C;AAK1C,6CAKwB;AACxB,uEAI0C;AAE1C,IAAM,kBAAkB,GAAG,UACzB,WAAmB,EACnB,IAAa,EACb,uBAAuC;IAEvC,IAAI,IAAI,IAAI,uBAAuB,EAAE,CAAC;QACpC,OAAO,WAAW;aACf,OAAO,CACN,4BAA4B,EAC5B,IAAA,+BAAW,EAAC,uBAAuB,CAAC,CACrC;aACA,OAAO,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAA;IACzC,CAAC;IACD,OAAO,WAAW,CAAC,OAAO,CACxB,+EAA+E,EAC/E,EAAE,CACH,CAAA;AACH,CAAC,CAAA;AAED,IAAM,4BAA4B,GAA+B,UAAC,EAEjE;;QADC,WAAW,iBAAA;IAEL,IAAA,KAWF,IAAA,2BAAiB,EAAC,WAAW,CAAyC,EAVhE,aAAa,YAAA,EACrB,QAAQ,cAAA,EACR,cAAc,oBAAA,EACd,iBAAiB,uBAAA,EACjB,oBAAoB,0BAAA,EACpB,mBAAmB,yBAAA,EACnB,gBAAgB,sBAAA,EAChB,cAAc,oBAAA,EACd,QAAQ,cAAA,EACR,GAAG,SACqE,CAAA;IAE1E,IAAM,OAAO,GAAG,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,SAAS,MAAK,QAAQ,CAAA;IAC3C,IAAM,OAAO,GAAG,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,SAAS,MAAK,OAAO,CAAA;IAE1C,IAAA,iBAAS,EAAC;;QACR,IAAI,OAAO,KAAI,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,aAAa,0CAAE,MAAM,CAAA,EAAE,CAAC;Y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AAC;gBAChD,OAAO,CACL;oBACE,8BAAC,kBAAe,IACd,GAAG,EAAE,YAAY,CAAC,EAAE,EACpB,EAAE,EAAE,YAAY,CAAC,EAAE,EACnB,WAAW,EAAE,WAAW,EACxB,uBAAuB,EAAE,IAAI,GAC7B,CACD,CACJ,CAAA;YACH,CAAC;YAED,OAAO,CACL;gBACE,8BAAC,kBAAe,IACd,GAAG,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,EAAE,EACrB,EAAE,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,EAAE,EACpB,WAAW,EAAE,WAAW,GACxB,CACD,CACJ,CAAA;QACH,CAAC,CAAC,CACD,CACJ,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,4BAA4B,CAAA"}
|
|
@@ -46,26 +46,14 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
46
46
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
50
|
-
var t = {};
|
|
51
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
52
|
-
t[p] = s[p];
|
|
53
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
54
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
55
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
56
|
-
t[p[i]] = s[p[i]];
|
|
57
|
-
}
|
|
58
|
-
return t;
|
|
59
|
-
};
|
|
60
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
61
50
|
exports.queryHandler = void 0;
|
|
62
51
|
var api_1 = require("@newskit-render/api");
|
|
63
52
|
var helpers_1 = require("../helpers");
|
|
64
|
-
var shared_components_1 = require("@newskit-render/shared-components");
|
|
65
53
|
var queryHandler = function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
|
|
66
|
-
var
|
|
67
|
-
return __generator(this, function (
|
|
68
|
-
switch (
|
|
54
|
+
var _a, queryFragment, pageSize, apolloClient, data, query, response, err_1;
|
|
55
|
+
return __generator(this, function (_b) {
|
|
56
|
+
switch (_b.label) {
|
|
69
57
|
case 0:
|
|
70
58
|
if (req.method !== 'POST') {
|
|
71
59
|
res.status(405);
|
|
@@ -73,25 +61,26 @@ var queryHandler = function (req, res) { return __awaiter(void 0, void 0, void 0
|
|
|
73
61
|
res.end();
|
|
74
62
|
return [2 /*return*/];
|
|
75
63
|
}
|
|
76
|
-
|
|
77
|
-
queryFragment = parsedData.queryFragment, pageSize = parsedData.pageSize, bodyProps = __rest(parsedData, ["queryFragment", "pageSize"]);
|
|
64
|
+
_a = req.body, queryFragment = _a.queryFragment, pageSize = _a.pageSize;
|
|
78
65
|
return [4 /*yield*/, (0, api_1.createApolloClient)(api_1.ClientTypes.main, req.headers.cookie)];
|
|
79
66
|
case 1:
|
|
80
|
-
apolloClient =
|
|
81
|
-
|
|
67
|
+
apolloClient = _b.sent();
|
|
68
|
+
_b.label = 2;
|
|
82
69
|
case 2:
|
|
83
|
-
|
|
70
|
+
_b.trys.push([2, 4, , 5]);
|
|
84
71
|
query = (0, helpers_1.getQuery)((0, helpers_1.getQueryByFragment)(queryFragment), queryFragment, pageSize);
|
|
85
72
|
return [4 /*yield*/, apolloClient.query({
|
|
86
73
|
query: query,
|
|
87
|
-
variables:
|
|
74
|
+
variables: {
|
|
75
|
+
pageSize: pageSize,
|
|
76
|
+
},
|
|
88
77
|
})];
|
|
89
78
|
case 3:
|
|
90
|
-
response =
|
|
91
|
-
data = __assign({}, response.data);
|
|
79
|
+
response = _b.sent();
|
|
80
|
+
data = __assign({}, response.data.user);
|
|
92
81
|
return [3 /*break*/, 5];
|
|
93
82
|
case 4:
|
|
94
|
-
err_1 =
|
|
83
|
+
err_1 = _b.sent();
|
|
95
84
|
(0, helpers_1.handleNewRelicErrorLog)({
|
|
96
85
|
requestName: queryFragment,
|
|
97
86
|
reqError: err_1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryHandler.js","sourceRoot":"","sources":["../../../src/api/queryHandler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"queryHandler.js","sourceRoot":"","sources":["../../../src/api/queryHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2CAAqE;AACrE,sCAImB;AAEZ,IAAM,YAAY,GAAG,UAC1B,GAAmB,EACnB,GAAoB;;;;;gBAEpB,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;oBAC1B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;oBACf,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,kBAAW,GAAG,CAAC,MAAM,kBAAe,EAAE,CAAC,CAAA;oBAC3D,GAAG,CAAC,GAAG,EAAE,CAAA;oBACT,sBAAM;gBACR,CAAC;gBAEK,KAA8B,GAAG,CAAC,IAAI,EAApC,aAAa,mBAAA,EAAE,QAAQ,cAAA,CAAa;gBACvB,qBAAM,IAAA,wBAAkB,EAC3C,iBAAW,CAAC,IAAI,EAChB,GAAG,CAAC,OAAO,CAAC,MAAM,CACnB,EAAA;;gBAHK,YAAY,GAAG,SAGpB;;;;gBAIO,KAAK,GAAG,IAAA,kBAAQ,EACpB,IAAA,4BAAkB,EAAC,aAAa,CAAC,EACjC,aAAa,EACb,QAAQ,CACT,CAAA;gBAEgB,qBAAM,YAAY,CAAC,KAAK,CAAC;wBACxC,KAAK,OAAA;wBACL,SAAS,EAAE;4BACT,QAAQ,UAAA;yBACT;qBACF,CAAC,EAAA;;gBALI,QAAQ,GAAG,SAKf;gBACF,IAAI,gBACC,QAAQ,CAAC,IAAI,CAAC,IAAI,CACtB,CAAA;;;;gBAED,IAAA,gCAAsB,EAAC;oBACrB,WAAW,EAAE,aAAa;oBAC1B,QAAQ,EAAE,KAAG;iBACd,CAAC,CAAA;gBACF,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;gBACf,GAAG,CAAC,GAAG,EAAE,CAAA;;;gBAGX,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;gBACf,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;;;;KAC9B,CAAA;AA7CY,QAAA,YAAY,gBA6CxB"}
|
|
@@ -20,7 +20,7 @@ import { FamilyMemberProps } from '../Components/Sections/Form/InviteFamilyMembe
|
|
|
20
20
|
import { PaymentMethodsMap } from 'Components/Templates';
|
|
21
21
|
import { UserHubItemProps } from '../Components/Elements/UserHubListItem';
|
|
22
22
|
import { CancelSubscriptionProps } from 'Components/Sections/CancelSubscription';
|
|
23
|
-
import { HandleCardClick,
|
|
23
|
+
import { HandleCardClick, StepController } from '../Components/Templates/CancellationStepperRender';
|
|
24
24
|
import { GridLayoutProps } from 'Components/SharedTypes/GridLayoutProps';
|
|
25
25
|
import { CancelSubscriptionDowngradeProps } from '../Components/Sections/CancelSubscriptionDowngrade/CancelSubscriptionDowngrade';
|
|
26
26
|
import { ConfirmCancellationStepProps } from '../Components/Sections/ConfirmCancellation';
|
|
@@ -28,7 +28,7 @@ import { CancellationDetailsContextProps } from '../Components/Sections/Cancella
|
|
|
28
28
|
import { DetailedFlags } from '@newskit-render/feature-flags';
|
|
29
29
|
import { CancellationOffersContextProps } from '../Components/Sections/CancellationOffers';
|
|
30
30
|
import { ConfirmSubscriptionOfferProps } from 'Components/Sections/ConfirmSubscriptionOffer';
|
|
31
|
-
import {
|
|
31
|
+
import { ContactSupportContextProps } from '../Components/Sections/ContactSupport';
|
|
32
32
|
interface InfoPanel extends InlineMessageProps {
|
|
33
33
|
infoPanelCells?: MQ<number>;
|
|
34
34
|
href?: boolean;
|
|
@@ -306,7 +306,7 @@ export interface BelowItemExtraProps {
|
|
|
306
306
|
};
|
|
307
307
|
baseUrl?: string;
|
|
308
308
|
eventContext?: EventContext;
|
|
309
|
-
onClick?:
|
|
309
|
+
onClick?: StepController;
|
|
310
310
|
buttonOverrides?: BaseFlagOverrides;
|
|
311
311
|
iconOverrides?: NewsKitIconProps['overrides'];
|
|
312
312
|
marginInline?: MQ<string>;
|
|
@@ -326,14 +326,9 @@ export interface ConfirmSubscriptionOfferContextProps extends ConfirmSubscriptio
|
|
|
326
326
|
showBackButton?: boolean;
|
|
327
327
|
tealiumContext?: TealiumEventContext;
|
|
328
328
|
}
|
|
329
|
-
export interface CancellationOfferPreviewContextProps extends OfferPreviewContextProps {
|
|
330
|
-
contentContainerOverrides?: Partial<SharedContentContainerProps>;
|
|
331
|
-
showBackButton?: boolean;
|
|
332
|
-
tealiumContext?: TealiumEventContext;
|
|
333
|
-
}
|
|
334
329
|
export interface CancellationStepperContextOptions extends Partial<InteractiveContextOptions>, Partial<NonInteractiveContextOptions> {
|
|
335
330
|
containerOverrides?: GridLayoutProps;
|
|
336
|
-
components: Record<string, CancellationSection | DowngradeContextProps | ConfirmCancellationContextProps | CancellationDetailsContextProps | CancellationOffersContextProps | ConfirmSubscriptionOfferContextProps |
|
|
331
|
+
components: Record<string, CancellationSection | DowngradeContextProps | ConfirmCancellationContextProps | CancellationDetailsContextProps | CancellationOffersContextProps | ConfirmSubscriptionOfferContextProps | ContactSupportContextProps>;
|
|
337
332
|
componentSequence: Record<string, string[]>;
|
|
338
333
|
showBackButton?: boolean;
|
|
339
334
|
contentContainerOverrides?: Partial<SharedContentContainerProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/context/types.ts"],"names":[],"mappings":";;;AAkNA,IAAY,WAqBX;AArBD,WAAY,WAAW;IACrB,kDAAqC,CAAA;IACrC,gEAAmD,CAAA;IACnD,0CAA6B,CAAA;IAC7B,4DAA+C,CAAA;IAC/C,kCAAqB,CAAA;IACrB,sCA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AY,gBAAgB;IAC1B,uCAAmB,CAAA;IACnB,mCAAe,CAAA;IACf,6CAAyB,CAAA;AAC3B,CAAC,EAJW,gBAAgB,gCAAhB,gBAAgB,QAI3B;AAyYD,IAAY,gBA2BX;AA3BD,WAAY,gBAAgB;IAC1B,kCAAgB,CAAA;IAChB,yCAAuB,CAAA;IACvB,mCAAiB,CAAA;IACjB,8BAAY,CAAA;IACZ,oCAAkB,CAAA;IAClB,yCAAuB,CAAA;IACvB,2CAAyB,CAAA;IACzB,oCAAkB,CAAA;IAClB,gCAAc,CAAA;IACd,iCAAe,CAAA;IACf,mCAAiB,CAAA;IACjB,oCAAkB,CAAA;IAClB,oCAAkB,CAAA;IAClB,iCAAe,CAAA;IACf,oCAAkB,CAAA;IAClB,mCAAiB,CAAA;IACjB,+BAAa,CAAA;IACb,uCAAqB,CAAA;IACrB,kCAAgB,CAAA;IAChB,kCAAgB,CAAA;IAChB,uCAAqB,CAAA;IACrB,mCAAiB,CAAA;IACjB,8BAAY,CAAA;IACZ,qCAAmB,CAAA;IACnB,qCAAmB,CAAA;IACnB,kCAAgB,CAAA;AAClB,CAAC,EA3BW,gBAAgB,gCAAhB,gBAAgB,QA2B3B;AA+CD,IAAY,uBAIX;AAJD,WAAY,uBAAuB;IACjC,8CAAqB,CAAA;IACrB,4CAAmB,CAAA;IACnB,kDAAyB,CAAA;AAC3B,CAAC,EAJW,uBAAuB,uCAAvB,uBAAuB,QAIlC;AAqDD,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,sCAAqB,CAAA;IACrB,oCAAmB,CAAA;IACnB,8BAAa,CAAA;IACb,4CAA2B,CAAA;AAC7B,CAAC,EALW,aAAa,6BAAb,aAAa,QAKxB"}
|
|
@@ -1,21 +1,4 @@
|
|
|
1
1
|
import { DateType, ReplaceDateOptions } from './dateUtils';
|
|
2
|
-
import { OfferPreviewDataProps } from '../Components/Sections/CancellationOffers';
|
|
3
|
-
import { UserData } from 'pages/types';
|
|
4
|
-
import { OfferSummaryProps } from 'Components/Sections/OfferPreview/OfferSummary';
|
|
5
|
-
export interface ResponseProps {
|
|
6
|
-
success: boolean;
|
|
7
|
-
errorCode: string | null;
|
|
8
|
-
errorMessage: string | null;
|
|
9
|
-
}
|
|
10
|
-
export interface PreviewIncentiveProps extends ResponseProps, OfferPreviewDataProps {
|
|
11
|
-
}
|
|
12
|
-
export interface OfferPreviewDataResponse {
|
|
13
|
-
previewIncentive: PreviewIncentiveProps;
|
|
14
|
-
}
|
|
15
|
-
export interface OfferPreviewBody {
|
|
16
|
-
incentiveCode: string;
|
|
17
|
-
subscriptionCode: string;
|
|
18
|
-
}
|
|
19
2
|
export type GetSubscriptionEndMessage = (messages: {
|
|
20
3
|
daysRemaining: string;
|
|
21
4
|
monthsRemaining: string;
|
|
@@ -24,5 +7,3 @@ export declare const getSubscriptionEndMessage: GetSubscriptionEndMessage;
|
|
|
24
7
|
export declare const replaceRemainingSubscriptionTime: (text: string, billCycleDate: DateType) => string;
|
|
25
8
|
export declare const replaceSubscriptionName: (text: string, subscriptionName: string) => string;
|
|
26
9
|
export declare const cancelSubscription: (subscriptionCode: string, reason: string) => Promise<Response>;
|
|
27
|
-
export declare const getOfferPreviewData: (body: OfferPreviewBody) => Promise<OfferPreviewDataResponse>;
|
|
28
|
-
export declare const populateSubscriptionSummaryData: (previewData: OfferPreviewDataProps, subscriptionSummaryContext: OfferSummaryProps, user: UserData) => OfferSummaryProps;
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -50,17 +39,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
50
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
40
|
};
|
|
52
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
-
exports.
|
|
42
|
+
exports.cancelSubscription = exports.replaceSubscriptionName = exports.replaceRemainingSubscriptionTime = exports.getSubscriptionEndMessage = void 0;
|
|
54
43
|
var cookie_1 = __importDefault(require("cookie"));
|
|
55
44
|
var api_1 = require("@newskit-render/api");
|
|
56
45
|
var dateUtils_1 = require("./dateUtils");
|
|
57
46
|
var shared_components_1 = require("@newskit-render/shared-components");
|
|
58
|
-
var stringUtils_1 = require("./stringUtils");
|
|
59
|
-
var addMonths_1 = require("date-fns/addMonths");
|
|
60
|
-
var format_1 = require("date-fns/format");
|
|
61
|
-
var constants_1 = require("./../constants");
|
|
62
|
-
var dataUtils_1 = require("./dataUtils");
|
|
63
|
-
var subscriptionsUtils_1 = require("./subscriptionsUtils");
|
|
64
47
|
var getSubscriptionEndMessage = function (messages, billCycleDate, options) {
|
|
65
48
|
if (options === void 0) { options = {}; }
|
|
66
49
|
var dateNow = new Date();
|
|
@@ -111,51 +94,4 @@ var cancelSubscription = function (subscriptionCode, reason) { return __awaiter(
|
|
|
111
94
|
});
|
|
112
95
|
}); };
|
|
113
96
|
exports.cancelSubscription = cancelSubscription;
|
|
114
|
-
var getOfferPreviewData = function (body) { return __awaiter(void 0, void 0, void 0, function () {
|
|
115
|
-
var response, result;
|
|
116
|
-
return __generator(this, function (_a) {
|
|
117
|
-
switch (_a.label) {
|
|
118
|
-
case 0: return [4 /*yield*/, fetch('/api/account/query', {
|
|
119
|
-
method: 'POST',
|
|
120
|
-
body: JSON.stringify(__assign({ queryFragment: 'IncentivePreview' }, body)),
|
|
121
|
-
})];
|
|
122
|
-
case 1:
|
|
123
|
-
response = _a.sent();
|
|
124
|
-
if (!response.ok) {
|
|
125
|
-
throw new Error('Network response was not ok');
|
|
126
|
-
}
|
|
127
|
-
return [4 /*yield*/, response.json()];
|
|
128
|
-
case 2:
|
|
129
|
-
result = _a.sent();
|
|
130
|
-
return [2 /*return*/, result];
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
}); };
|
|
134
|
-
exports.getOfferPreviewData = getOfferPreviewData;
|
|
135
|
-
var populateSubscriptionSummaryData = function (previewData, subscriptionSummaryContext, user) {
|
|
136
|
-
var _a, _b;
|
|
137
|
-
var invoiceMonthlySummaryBreakdown = previewData.invoiceSummary.invoiceMonthlySummaryBreakdown[0];
|
|
138
|
-
var userSubscription = (_a = user.subscriptions) === null || _a === void 0 ? void 0 : _a[0];
|
|
139
|
-
var discountedAmountPerTerm = (0, subscriptionsUtils_1.calculateDiscountedPrice)(userSubscription.price, previewData.discountPercentage);
|
|
140
|
-
return __assign(__assign(__assign({ sectionTitle: subscriptionSummaryContext.sectionTitle, offerTitle: previewData.currentPropositionName, discountName: (0, stringUtils_1.replacePlaceholder)(previewData.incentiveName, (0, dataUtils_1.formatPrice)(discountedAmountPerTerm, userSubscription === null || userSubscription === void 0 ? void 0 : userSubscription.currency)), discountPercentage: previewData.discountPercentage, discountStartDate: (0, stringUtils_1.replacePlaceholder)(subscriptionSummaryContext.discountStartDate, (0, format_1.format)(new Date(invoiceMonthlySummaryBreakdown.fromDate), 'dd MMM yyyy')), fullPriceSubscriptionPrice: (0, stringUtils_1.replacePlaceholder)(subscriptionSummaryContext.fullPriceSubscriptionPrice, (0, dataUtils_1.formatPrice)(userSubscription.price, userSubscription === null || userSubscription === void 0 ? void 0 : userSubscription.currency)), fullPriceSubscriptionStartDate: (0, stringUtils_1.replacePlaceholder)(subscriptionSummaryContext.fullPriceSubscriptionStartDate, (0, format_1.format)((0, addMonths_1.addMonths)(new Date(invoiceMonthlySummaryBreakdown.fromDate), previewData.term), 'dd MMM yyyy')) }, ((subscriptionSummaryContext === null || subscriptionSummaryContext === void 0 ? void 0 : subscriptionSummaryContext.paymentBreakdown) &&
|
|
141
|
-
Number(invoiceMonthlySummaryBreakdown.creditBalance
|
|
142
|
-
.beforeApplyingSubscriptionCharges)
|
|
143
|
-
? {
|
|
144
|
-
paymentBreakdown: {
|
|
145
|
-
title: (0, stringUtils_1.replacePlaceholder)((_b = subscriptionSummaryContext === null || subscriptionSummaryContext === void 0 ? void 0 : subscriptionSummaryContext.paymentBreakdown) === null || _b === void 0 ? void 0 : _b.title, (0, format_1.format)(new Date(invoiceMonthlySummaryBreakdown.fromDate), 'dd MMM yyyy')),
|
|
146
|
-
accountCreditRow: __assign(__assign({}, subscriptionSummaryContext.paymentBreakdown.accountCreditRow), { value: (0, dataUtils_1.formatPrice)(invoiceMonthlySummaryBreakdown.creditBalance
|
|
147
|
-
.beforeApplyingSubscriptionCharges, userSubscription === null || userSubscription === void 0 ? void 0 : userSubscription.currency) }),
|
|
148
|
-
},
|
|
149
|
-
}
|
|
150
|
-
: {})), { nextPaymentRow: __assign(__assign({}, subscriptionSummaryContext.nextPaymentRow), { value: invoiceMonthlySummaryBreakdown.totalAmountToPay }) }), (subscriptionSummaryContext.remainingCredit &&
|
|
151
|
-
(Number(invoiceMonthlySummaryBreakdown.creditBalance
|
|
152
|
-
.afterApplyingSubscriptionCharges)
|
|
153
|
-
? {
|
|
154
|
-
remainingCredit: __assign(__assign({}, subscriptionSummaryContext.remainingCredit), { value: constants_1.CURRENCY_MAP[userSubscription === null || userSubscription === void 0 ? void 0 : userSubscription.currency] +
|
|
155
|
-
invoiceMonthlySummaryBreakdown.creditBalance
|
|
156
|
-
.afterApplyingSubscriptionCharges }),
|
|
157
|
-
}
|
|
158
|
-
: {})));
|
|
159
|
-
};
|
|
160
|
-
exports.populateSubscriptionSummaryData = populateSubscriptionSummaryData;
|
|
161
97
|
//# sourceMappingURL=cancellationUtils.js.map
|